Файловый менеджер - Редактировать - /home/u368772545/domains/remushop.com/public_html/static/img/logo/dist.tar
Ðазад
rich-text.min.js 0000644 00000074435 15013651111 0007602 0 ustar 00 /*! This file is auto-generated */ (()=>{"use strict";var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{RichTextData:()=>j,__experimentalRichText:()=>Xe,__unstableCreateElement:()=>y,__unstableToDom:()=>be,__unstableUseRichText:()=>Be,applyFormat:()=>h,concat:()=>Y,create:()=>V,getActiveFormat:()=>G,getActiveFormats:()=>T,getActiveObject:()=>Z,getTextContent:()=>P,insert:()=>oe,insertObject:()=>ie,isCollapsed:()=>J,isEmpty:()=>Q,join:()=>ee,registerFormatType:()=>te,remove:()=>ae,removeFormat:()=>ne,replace:()=>se,slice:()=>ce,split:()=>le,store:()=>f,toHTMLString:()=>_,toggleFormat:()=>Le,unregisterFormatType:()=>Ce,useAnchor:()=>Re,useAnchorRef:()=>Oe});var n={};e.r(n),e.d(n,{getFormatType:()=>i,getFormatTypeForBareElement:()=>c,getFormatTypeForClassName:()=>l,getFormatTypes:()=>s});var r={};e.r(r),e.d(r,{addFormatTypes:()=>u,removeFormatTypes:()=>d});const o=window.wp.data;const a=(0,o.combineReducers)({formatTypes:function(e={},t){switch(t.type){case"ADD_FORMAT_TYPES":return{...e,...t.formatTypes.reduce(((e,t)=>({...e,[t.name]:t})),{})};case"REMOVE_FORMAT_TYPES":return Object.fromEntries(Object.entries(e).filter((([e])=>!t.names.includes(e))))}return e}}),s=(0,o.createSelector)((e=>Object.values(e.formatTypes)),(e=>[e.formatTypes]));function i(e,t){return e.formatTypes[t]}function c(e,t){const n=s(e);return n.find((({className:e,tagName:n})=>null===e&&t===n))||n.find((({className:e,tagName:t})=>null===e&&"*"===t))}function l(e,t){return s(e).find((({className:e})=>null!==e&&` ${t} `.indexOf(` ${e} `)>=0))}function u(e){return{type:"ADD_FORMAT_TYPES",formatTypes:Array.isArray(e)?e:[e]}}function d(e){return{type:"REMOVE_FORMAT_TYPES",names:Array.isArray(e)?e:[e]}}const f=(0,o.createReduxStore)("core/rich-text",{reducer:a,selectors:n,actions:r});function m(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.type!==t.type)return!1;const n=e.attributes,r=t.attributes;if(n===r)return!0;if(!n||!r)return!1;const o=Object.keys(n),a=Object.keys(r);if(o.length!==a.length)return!1;const s=o.length;for(let e=0;e<s;e++){const t=o[e];if(n[t]!==r[t])return!1}return!0}function p(e){const t=e.formats.slice();return t.forEach(((e,n)=>{const r=t[n-1];if(r){const o=e.slice();o.forEach(((e,t)=>{const n=r[t];m(e,n)&&(o[t]=n)})),t[n]=o}})),{...e,formats:t}}function g(e,t,n){return(e=e.slice())[t]=n,e}function h(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,s=o.slice();if(n===r){const e=s[n]?.find((({type:e})=>e===t.type));if(e){const o=s[n].indexOf(e);for(;s[n]&&s[n][o]===e;)s[n]=g(s[n],o,t),n--;for(r++;s[r]&&s[r][o]===e;)s[r]=g(s[r],o,t),r++}}else{let e=1/0;for(let o=n;o<r;o++)if(s[o]){s[o]=s[o].filter((({type:e})=>e!==t.type));const n=s[o].length;n<e&&(e=n)}else s[o]=[],e=0;for(let o=n;o<r;o++)s[o].splice(e,0,t)}return p({...e,formats:s,activeFormats:[...a?.filter((({type:e})=>e!==t.type))||[],t]})}function y({implementation:e},t){return y.body||(y.body=e.createHTMLDocument("").body),y.body.innerHTML=t,y.body}(0,o.register)(f);const v="",E="\ufeff",b=window.wp.escapeHtml;function T(e,t=[]){const{formats:n,start:r,end:o,activeFormats:a}=e;if(void 0===r)return t;if(r===o){if(a)return a;const e=n[r-1]||t,o=n[r]||t;return e.length<o.length?e:o}if(!n[r])return t;const s=n.slice(r,o),i=[...s[0]];let c=s.length;for(;c--;){const e=s[c];if(!e)return t;let n=i.length;for(;n--;){const t=i[n];e.find((e=>m(t,e)))||i.splice(n,1)}if(0===i.length)return t}return i||t}function x(e){return(0,o.select)(f).getFormatType(e)}function w(e,t){if(t)return e;const n={};for(const t in e){let r=t;t.startsWith("data-disable-rich-text-")&&(r=t.slice(23)),n[r]=e[t]}return n}function N({type:e,tagName:t,attributes:n,unregisteredAttributes:r,object:o,boundaryClass:a,isEditableTree:s}){const i=x(e);let c={};if(a&&s&&(c["data-rich-text-format-boundary"]="true"),!i)return n&&(c={...n,...c}),{type:e,attributes:w(c,s),object:o};c={...r,...c};for(const e in n){const t=!!i.attributes&&i.attributes[e];t?c[t]=n[e]:c[e]=n[e]}return i.className&&(c.class?c.class=`${i.className} ${c.class}`:c.class=i.className),s&&!1===i.contentEditable&&(c.contenteditable="false"),{type:t||i.tagName,object:i.object,attributes:w(c,s)}}function L(e,t,n){do{if(e[n]!==t[n])return!1}while(n--);return!0}function C({value:e,preserveWhiteSpace:t,createEmpty:n,append:r,getLastChild:o,getParent:a,isText:s,getText:i,remove:c,appendText:l,onStartIndex:u,onEndIndex:d,isEditableTree:f,placeholder:m}){const{formats:p,replacements:g,text:h,start:y,end:b}=e,w=p.length+1,C=n(),_=T(e),A=_[_.length-1];let F,O;r(C,"");for(let e=0;e<w;e++){const n=h.charAt(e),T=f&&(!O||"\n"===O),w=p[e];let _=o(C);if(w&&w.forEach(((e,t)=>{if(_&&F&&L(w,F,t))return void(_=o(_));const{type:n,tagName:l,attributes:u,unregisteredAttributes:d}=e,m=f&&e===A,p=a(_),g=r(p,N({type:n,tagName:l,attributes:u,unregisteredAttributes:d,boundaryClass:m,isEditableTree:f}));s(_)&&0===i(_).length&&c(_),_=r(g,"")})),0===e&&(u&&0===y&&u(C,_),d&&0===b&&d(C,_)),n===v){const t=g[e];if(!t)continue;const{type:n,attributes:o,innerHTML:s}=t,i=x(n);f&&"#comment"===n?(_=r(a(_),{type:"span",attributes:{contenteditable:"false","data-rich-text-comment":o["data-rich-text-comment"]}}),r(r(_,{type:"span"}),o["data-rich-text-comment"].trim())):f||"script"!==n?!1===i?.contentEditable?(_=r(a(_),N({...t,isEditableTree:f,boundaryClass:y===e&&b===e+1})),s&&r(_,{html:s})):_=r(a(_),N({...t,object:!0,isEditableTree:f})):(_=r(a(_),N({type:"script",isEditableTree:f})),r(_,{html:decodeURIComponent(o["data-rich-text-script"])})),_=r(a(_),"")}else t||"\n"!==n?s(_)?l(_,n):_=r(a(_),n):(_=r(a(_),{type:"br",attributes:f?{"data-rich-text-line-break":"true"}:void 0,object:!0}),_=r(a(_),""));u&&y===e+1&&u(C,_),d&&b===e+1&&d(C,_),T&&e===h.length&&(r(a(_),E),m&&0===h.length&&r(a(_),{type:"span",attributes:{"data-rich-text-placeholder":m,style:"pointer-events:none;user-select:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;"}})),F=w,O=n}return C}function _({value:e,preserveWhiteSpace:t}){return $(C({value:e,preserveWhiteSpace:t,createEmpty:A,append:O,getLastChild:F,getParent:D,isText:R,getText:M,remove:k,appendText:S}).children)}function A(){return{}}function F({children:e}){return e&&e[e.length-1]}function O(e,t){return"string"==typeof t&&(t={text:t}),t.parent=e,e.children=e.children||[],e.children.push(t),t}function S(e,t){e.text+=t}function D({parent:e}){return e}function R({text:e}){return"string"==typeof e}function M({text:e}){return e}function k(e){const t=e.parent.children.indexOf(e);return-1!==t&&e.parent.children.splice(t,1),e}function $(e=[]){return e.map((e=>void 0!==e.html?e.html:void 0===e.text?function({type:e,attributes:t,object:n,children:r}){if("#comment"===e)return`\x3c!--${t["data-rich-text-comment"]}--\x3e`;let o="";for(const e in t)(0,b.isValidAttributeName)(e)&&(o+=` ${e}="${(0,b.escapeAttribute)(t[e])}"`);return n?`<${e}${o}>`:`<${e}${o}>${$(r)}</${e}>`}(e):(0,b.escapeEditableHTML)(e.text))).join("")}function P({text:e}){return e.replace(v,"")}function H({tagName:e,attributes:t}){let n;if(t&&t.class&&(n=(0,o.select)(f).getFormatTypeForClassName(t.class),n&&(t.class=` ${t.class} `.replace(` ${n.className} `," ").trim(),t.class||delete t.class)),n||(n=(0,o.select)(f).getFormatTypeForBareElement(e)),!n)return t?{type:e,attributes:t}:{type:e};if(n.__experimentalCreatePrepareEditableTree&&!n.__experimentalCreateOnChangeEditableValue)return null;if(!t)return{formatType:n,type:n.name,tagName:e};const r={},a={},s={...t};for(const e in n.attributes){const t=n.attributes[e];r[e]=s[t],delete s[t],void 0===r[e]&&delete r[e]}for(const e in s)a[e]=t[e];return!1===n.contentEditable&&delete a.contenteditable,{formatType:n,type:n.name,tagName:e,attributes:r,unregisteredAttributes:a}}class j{#e;static empty(){return new j}static fromPlainText(e){return new j(V({text:e}))}static fromHTMLString(e){return new j(V({html:e}))}static fromHTMLElement(e,t={}){const{preserveWhiteSpace:n=!1}=t,r=n?e:z(e),o=new j(V({element:r}));return Object.defineProperty(o,"originalHTML",{value:e.innerHTML}),o}constructor(e={formats:[],replacements:[],text:""}){this.#e=e}toPlainText(){return P(this.#e)}toHTMLString({preserveWhiteSpace:e}={}){return this.originalHTML||_({value:this.#e,preserveWhiteSpace:e})}valueOf(){return this.toHTMLString()}toString(){return this.toHTMLString()}toJSON(){return this.toHTMLString()}get length(){return this.text.length}get formats(){return this.#e.formats}get replacements(){return this.#e.replacements}get text(){return this.#e.text}}for(const e of Object.getOwnPropertyNames(String.prototype))j.prototype.hasOwnProperty(e)||Object.defineProperty(j.prototype,e,{value(...t){return this.toHTMLString()[e](...t)}});function V({element:e,text:t,html:n,range:r,__unstableIsEditableTree:o}={}){return n instanceof j?{text:n.text,formats:n.formats,replacements:n.replacements}:"string"==typeof t&&t.length>0?{formats:Array(t.length),replacements:Array(t.length),text:t}:("string"==typeof n&&n.length>0&&(e=y(document,n)),"object"!=typeof e?{formats:[],replacements:[],text:""}:K({element:e,range:r,isEditableTree:o}))}function I(e,t,n,r){if(!n)return;const{parentNode:o}=t,{startContainer:a,startOffset:s,endContainer:i,endOffset:c}=n,l=e.text.length;void 0!==r.start?e.start=l+r.start:t===a&&t.nodeType===t.TEXT_NODE?e.start=l+s:o===a&&t===a.childNodes[s]?e.start=l:o===a&&t===a.childNodes[s-1]?e.start=l+r.text.length:t===a&&(e.start=l),void 0!==r.end?e.end=l+r.end:t===i&&t.nodeType===t.TEXT_NODE?e.end=l+c:o===i&&t===i.childNodes[c-1]?e.end=l+r.text.length:o===i&&t===i.childNodes[c]?e.end=l:t===i&&(e.end=l+c)}function W(e,t,n){if(!t)return;const{startContainer:r,endContainer:o}=t;let{startOffset:a,endOffset:s}=t;return e===r&&(a=n(e.nodeValue.slice(0,a)).length),e===o&&(s=n(e.nodeValue.slice(0,s)).length),{startContainer:r,startOffset:a,endContainer:o,endOffset:s}}function z(e,t=!0){const n=e.cloneNode(!0);return n.normalize(),Array.from(n.childNodes).forEach(((e,n,r)=>{if(e.nodeType===e.TEXT_NODE){let o=e.nodeValue;/[\n\t\r\f]/.test(o)&&(o=o.replace(/[\n\t\r\f]+/g," ")),-1!==o.indexOf(" ")&&(o=o.replace(/ {2,}/g," ")),0===n&&o.startsWith(" ")?o=o.slice(1):t&&n===r.length-1&&o.endsWith(" ")&&(o=o.slice(0,-1)),e.nodeValue=o}else e.nodeType===e.ELEMENT_NODE&&z(e,!1)})),n}const B="\r";function X(e){return e.replace(new RegExp(`[${E}${v}${B}]`,"gu"),"")}function K({element:e,range:t,isEditableTree:n}){const r={formats:[],replacements:[],text:""};if(!e)return r;if(!e.hasChildNodes())return I(r,e,t,{formats:[],replacements:[],text:""}),r;const o=e.childNodes.length;for(let a=0;a<o;a++){const s=e.childNodes[a],i=s.nodeName.toLowerCase();if(s.nodeType===s.TEXT_NODE){const u=X(s.nodeValue);I(r,s,t=W(s,t,X),{text:u}),r.formats.length+=u.length,r.replacements.length+=u.length,r.text+=u;continue}if(s.nodeType===s.COMMENT_NODE||s.nodeType===s.ELEMENT_NODE&&"SPAN"===s.tagName&&s.hasAttribute("data-rich-text-comment")){const d={formats:[,],replacements:[{type:"#comment",attributes:{"data-rich-text-comment":s.nodeType===s.COMMENT_NODE?s.nodeValue:s.getAttribute("data-rich-text-comment")}}],text:v};I(r,s,t,d),U(r,d);continue}if(s.nodeType!==s.ELEMENT_NODE)continue;if(n&&"br"===i&&!s.getAttribute("data-rich-text-line-break")){I(r,s,t,{formats:[],replacements:[],text:""});continue}if("script"===i){const f={formats:[,],replacements:[{type:i,attributes:{"data-rich-text-script":s.getAttribute("data-rich-text-script")||encodeURIComponent(s.innerHTML)}}],text:v};I(r,s,t,f),U(r,f);continue}if("br"===i){I(r,s,t,{formats:[],replacements:[],text:""}),U(r,V({text:"\n"}));continue}const c=H({tagName:i,attributes:q({element:s})});if(!1===c?.formatType?.contentEditable){delete c.formatType,I(r,s,t,{formats:[],replacements:[],text:""}),U(r,{formats:[,],replacements:[{...c,innerHTML:s.innerHTML}],text:v});continue}c&&delete c.formatType;const l=K({element:s,range:t,isEditableTree:n});if(I(r,s,t,l),!c||s.getAttribute("data-rich-text-placeholder"))U(r,l);else if(0===l.text.length)c.attributes&&U(r,{formats:[,],replacements:[c],text:v});else{function m(e){if(m.formats===e)return m.newFormats;const t=e?[c,...e]:[c];return m.formats=e,m.newFormats=t,t}m.newFormats=[c],U(r,{...l,formats:Array.from(l.formats,m)})}}return r}function q({element:e}){if(!e.hasAttributes())return;const t=e.attributes.length;let n;for(let r=0;r<t;r++){const{name:t,value:o}=e.attributes[r];if(0===t.indexOf("data-rich-text-"))continue;n=n||{},n[/^on/i.test(t)?"data-disable-rich-text-"+t:t]=o}return n}function U(e,t){return e.formats=e.formats.concat(t.formats),e.replacements=e.replacements.concat(t.replacements),e.text+=t.text,e}function Y(...e){return p(e.reduce(U,V()))}function G(e,t){return T(e).find((({type:e})=>e===t))}function Z({start:e,end:t,replacements:n,text:r}){if(e+1===t&&r[e]===v)return n[e]}function J({start:e,end:t}){if(void 0!==e&&void 0!==t)return e===t}function Q({text:e}){return 0===e.length}function ee(e,t=""){return"string"==typeof t&&(t=V({text:t})),p(e.reduce(((e,{formats:n,replacements:r,text:o})=>({formats:e.formats.concat(t.formats,n),replacements:e.replacements.concat(t.replacements,r),text:e.text+t.text+o}))))}function te(e,t){if("string"==typeof(t={name:e,...t}).name)if(/^[a-z][a-z0-9-]*\/[a-z][a-z0-9-]*$/.test(t.name))if((0,o.select)(f).getFormatType(t.name))window.console.error('Format "'+t.name+'" is already registered.');else if("string"==typeof t.tagName&&""!==t.tagName)if("string"==typeof t.className&&""!==t.className||null===t.className)if(/^[_a-zA-Z]+[a-zA-Z0-9_-]*$/.test(t.className)){if(null===t.className){const e=(0,o.select)(f).getFormatTypeForBareElement(t.tagName);if(e&&"core/unknown"!==e.name)return void window.console.error(`Format "${e.name}" is already registered to handle bare tag name "${t.tagName}".`)}else{const e=(0,o.select)(f).getFormatTypeForClassName(t.className);if(e)return void window.console.error(`Format "${e.name}" is already registered to handle class name "${t.className}".`)}if("title"in t&&""!==t.title)if("keywords"in t&&t.keywords.length>3)window.console.error('The format "'+t.name+'" can have a maximum of 3 keywords.');else{if("string"==typeof t.title)return(0,o.dispatch)(f).addFormatTypes(t),t;window.console.error("Format titles must be strings.")}else window.console.error('The format "'+t.name+'" must have a title.')}else window.console.error("A class name must begin with a letter, followed by any number of hyphens, underscores, letters, or numbers.");else window.console.error("Format class names must be a string, or null to handle bare elements.");else window.console.error("Format tag names must be a string.");else window.console.error("Format names must contain a namespace prefix, include only lowercase alphanumeric characters or dashes, and start with a letter. Example: my-plugin/my-custom-format");else window.console.error("Format names must be strings.")}function ne(e,t,n=e.start,r=e.end){const{formats:o,activeFormats:a}=e,s=o.slice();if(n===r){const e=s[n]?.find((({type:e})=>e===t));if(e){for(;s[n]?.find((t=>t===e));)re(s,n,t),n--;for(r++;s[r]?.find((t=>t===e));)re(s,r,t),r++}}else for(let e=n;e<r;e++)s[e]&&re(s,e,t);return p({...e,formats:s,activeFormats:a?.filter((({type:e})=>e!==t))||[]})}function re(e,t,n){const r=e[t].filter((({type:e})=>e!==n));r.length?e[t]=r:delete e[t]}function oe(e,t,n=e.start,r=e.end){const{formats:o,replacements:a,text:s}=e;"string"==typeof t&&(t=V({text:t}));const i=n+t.text.length;return p({formats:o.slice(0,n).concat(t.formats,o.slice(r)),replacements:a.slice(0,n).concat(t.replacements,a.slice(r)),text:s.slice(0,n)+t.text+s.slice(r),start:i,end:i})}function ae(e,t,n){return oe(e,V(),t,n)}function se({formats:e,replacements:t,text:n,start:r,end:o},a,s){return n=n.replace(a,((n,...a)=>{const i=a[a.length-2];let c,l,u=s;return"function"==typeof u&&(u=s(n,...a)),"object"==typeof u?(c=u.formats,l=u.replacements,u=u.text):(c=Array(u.length),l=Array(u.length),e[i]&&(c=c.fill(e[i]))),e=e.slice(0,i).concat(c,e.slice(i+n.length)),t=t.slice(0,i).concat(l,t.slice(i+n.length)),r&&(r=o=i+u.length),u})),p({formats:e,replacements:t,text:n,start:r,end:o})}function ie(e,t,n,r){return oe(e,{formats:[,],replacements:[t],text:v},n,r)}function ce(e,t=e.start,n=e.end){const{formats:r,replacements:o,text:a}=e;return void 0===t||void 0===n?{...e}:{formats:r.slice(t,n),replacements:o.slice(t,n),text:a.slice(t,n)}}function le({formats:e,replacements:t,text:n,start:r,end:o},a){if("string"!=typeof a)return function({formats:e,replacements:t,text:n,start:r,end:o},a=r,s=o){if(void 0===r||void 0===o)return;const i={formats:e.slice(0,a),replacements:t.slice(0,a),text:n.slice(0,a)},c={formats:e.slice(s),replacements:t.slice(s),text:n.slice(s),start:0,end:0};return[i,c]}(...arguments);let s=0;return n.split(a).map((n=>{const i=s,c={formats:e.slice(i,i+n.length),replacements:t.slice(i,i+n.length),text:n};return s+=a.length+n.length,void 0!==r&&void 0!==o&&(r>=i&&r<s?c.start=r-i:r<i&&o>i&&(c.start=0),o>=i&&o<s?c.end=o-i:r<s&&o>s&&(c.end=n.length)),c}))}function ue(e,t){return e===t||e&&t&&e.startContainer===t.startContainer&&e.startOffset===t.startOffset&&e.endContainer===t.endContainer&&e.endOffset===t.endOffset}function de(e,t,n){const r=e.parentNode;let o=0;for(;e=e.previousSibling;)o++;return n=[o,...n],r!==t&&(n=de(r,t,n)),n}function fe(e,t){for(t=[...t];e&&t.length>1;)e=e.childNodes[t.shift()];return{node:e,offset:t[0]}}function me(e,t){if(void 0!==t.html)return e.innerHTML+=t.html;"string"==typeof t&&(t=e.ownerDocument.createTextNode(t));const{type:n,attributes:r}=t;if(n)if("#comment"===n)t=e.ownerDocument.createComment(r["data-rich-text-comment"]);else{t=e.ownerDocument.createElement(n);for(const e in r)t.setAttribute(e,r[e])}return e.appendChild(t)}function pe(e,t){e.appendData(t)}function ge({lastChild:e}){return e}function he({parentNode:e}){return e}function ye(e){return e.nodeType===e.TEXT_NODE}function ve({nodeValue:e}){return e}function Ee(e){return e.parentNode.removeChild(e)}function be({value:e,prepareEditableTree:t,isEditableTree:n=!0,placeholder:r,doc:o=document}){let a=[],s=[];t&&(e={...e,formats:t(e)});return{body:C({value:e,createEmpty:()=>y(o,""),append:me,getLastChild:ge,getParent:he,isText:ye,getText:ve,remove:Ee,appendText:pe,onStartIndex(e,t){a=de(t,e,[t.nodeValue.length])},onEndIndex(e,t){s=de(t,e,[t.nodeValue.length])},isEditableTree:n,placeholder:r}),selection:{startPath:a,endPath:s}}}function Te({value:e,current:t,prepareEditableTree:n,__unstableDomOnly:r,placeholder:o}){const{body:a,selection:s}=be({value:e,prepareEditableTree:n,placeholder:o,doc:t.ownerDocument});xe(a,t),void 0===e.start||r||function({startPath:e,endPath:t},n){const{node:r,offset:o}=fe(n,e),{node:a,offset:s}=fe(n,t),{ownerDocument:i}=n,{defaultView:c}=i,l=c.getSelection(),u=i.createRange();u.setStart(r,o),u.setEnd(a,s);const{activeElement:d}=i;if(l.rangeCount>0){if(ue(u,l.getRangeAt(0)))return;l.removeAllRanges()}l.addRange(u),d!==i.activeElement&&d instanceof c.HTMLElement&&d.focus()}(s,t)}function xe(e,t){let n,r=0;for(;n=e.firstChild;){const o=t.childNodes[r];if(o)if(o.isEqualNode(n))e.removeChild(n);else if(o.nodeName!==n.nodeName||o.nodeType===o.TEXT_NODE&&o.data!==n.data)t.replaceChild(n,o);else{const t=o.attributes,r=n.attributes;if(t){let e=t.length;for(;e--;){const{name:r}=t[e];n.getAttribute(r)||o.removeAttribute(r)}}if(r)for(let e=0;e<r.length;e++){const{name:t,value:n}=r[e];o.getAttribute(t)!==n&&o.setAttribute(t,n)}xe(n,o),e.removeChild(n)}else t.appendChild(n);r++}for(;t.childNodes[r];)t.removeChild(t.childNodes[r])}const we=window.wp.a11y,Ne=window.wp.i18n;function Le(e,t){return G(e,t.type)?(t.title&&(0,we.speak)((0,Ne.sprintf)((0,Ne.__)("%s removed."),t.title),"assertive"),ne(e,t.type)):(t.title&&(0,we.speak)((0,Ne.sprintf)((0,Ne.__)("%s applied."),t.title),"assertive"),h(e,t))}function Ce(e){const t=(0,o.select)(f).getFormatType(e);if(t)return(0,o.dispatch)(f).removeFormatTypes(e),t;window.console.error(`Format ${e} is not registered.`)}const _e=window.wp.element,Ae=window.wp.deprecated;var Fe=e.n(Ae);function Oe({ref:e,value:t,settings:n={}}){Fe()("`useAnchorRef` hook",{since:"6.1",alternative:"`useAnchor` hook"});const{tagName:r,className:o,name:a}=n,s=a?G(t,a):void 0;return(0,_e.useMemo)((()=>{if(!e.current)return;const{ownerDocument:{defaultView:t}}=e.current,n=t.getSelection();if(!n.rangeCount)return;const a=n.getRangeAt(0);if(!s)return a;let i=a.startContainer;for(i=i.nextElementSibling||i;i.nodeType!==i.ELEMENT_NODE;)i=i.parentNode;return i.closest(r+(o?"."+o:""))}),[s,t.start,t.end,r,o])}const Se=window.wp.compose;function De(e,t,n){if(!e)return;const{ownerDocument:r}=e,{defaultView:o}=r,a=o.getSelection();if(!a)return;if(!a.rangeCount)return;const s=a.getRangeAt(0);if(!s||!s.startContainer)return;const i=function(e,t,n,r){let o=e.startContainer;if(o.nodeType===o.TEXT_NODE&&e.startOffset===o.length&&o.nextSibling)for(o=o.nextSibling;o.firstChild;)o=o.firstChild;if(o.nodeType!==o.ELEMENT_NODE&&(o=o.parentElement),!o)return;if(o===t)return;if(!t.contains(o))return;const a=n+(r?"."+r:"");for(;o!==t;){if(o.matches(a))return o;o=o.parentElement}}(s,e,t,n);return i||function(e,t){return{contextElement:t,getBoundingClientRect:()=>t.contains(e.startContainer)?e.getBoundingClientRect():t.getBoundingClientRect()}}(s,e)}function Re({editableContentElement:e,settings:t={}}){const{tagName:n,className:r,isActive:o}=t,[a,s]=(0,_e.useState)((()=>De(e,n,r))),i=(0,Se.usePrevious)(o);return(0,_e.useLayoutEffect)((()=>{if(!e)return;function t(){s(De(e,n,r))}function a(){l.addEventListener("selectionchange",t)}function c(){l.removeEventListener("selectionchange",t)}const{ownerDocument:l}=e;return(e===l.activeElement||!i&&o||i&&!o)&&(s(De(e,n,r)),a()),e.addEventListener("focusin",a),e.addEventListener("focusout",c),()=>{c(),e.removeEventListener("focusin",a),e.removeEventListener("focusout",c)}}),[e,n,r,o,i]),a}const Me="pre-wrap",ke="1px";function $e({record:e}){const t=(0,_e.useRef)(),{activeFormats:n=[],replacements:r,start:o}=e.current,a=r[o];return(0,_e.useEffect)((()=>{if(!(n&&n.length||a))return;const e="*[data-rich-text-format-boundary]",r=t.current.querySelector(e);if(!r)return;const{ownerDocument:o}=r,{defaultView:s}=o,i=`${`.rich-text:focus ${e}`} {${`background-color: ${s.getComputedStyle(r).color.replace(")",", 0.2)").replace("rgb","rgba")}`}}`,c="rich-text-boundary-style";let l=o.getElementById(c);l||(l=o.createElement("style"),l.id=c,o.head.appendChild(l)),l.innerHTML!==i&&(l.innerHTML=i)}),[n,a]),t}const Pe=window.wp.keycodes,He=[];const je=new Set(["insertParagraph","insertOrderedList","insertUnorderedList","insertHorizontalRule","insertLink"]),Ve=[],Ie="data-rich-text-placeholder";const We=[e=>t=>{function n(n){const{record:r}=e.current,{ownerDocument:o}=t;if(J(r.current)||!t.contains(o.activeElement))return;const a=ce(r.current),s=P(a),i=_({value:a});n.clipboardData.setData("text/plain",s),n.clipboardData.setData("text/html",i),n.clipboardData.setData("rich-text","true"),n.preventDefault(),"cut"===n.type&&o.execCommand("delete")}const{defaultView:r}=t.ownerDocument;return r.addEventListener("copy",n),r.addEventListener("cut",n),()=>{r.removeEventListener("copy",n),r.removeEventListener("cut",n)}},()=>e=>{function t(t){const{target:n}=t;if(n===e||n.textContent&&n.isContentEditable)return;const{ownerDocument:r}=n,{defaultView:o}=r,a=o.getSelection();if(a.containsNode(n))return;const s=r.createRange(),i=n.isContentEditable?n:n.closest("[contenteditable]");s.selectNode(i),a.removeAllRanges(),a.addRange(s),t.preventDefault()}function n(n){n.relatedTarget&&!e.contains(n.relatedTarget)&&"A"===n.relatedTarget.tagName&&t(n)}return e.addEventListener("click",t),e.addEventListener("focusin",n),()=>{e.removeEventListener("click",t),e.removeEventListener("focusin",n)}},e=>t=>{function n(n){const{keyCode:r,shiftKey:o,altKey:a,metaKey:s,ctrlKey:i}=n;if(o||a||s||i||r!==Pe.LEFT&&r!==Pe.RIGHT)return;const{record:c,applyRecord:l,forceRender:u}=e.current,{text:d,formats:f,start:m,end:p,activeFormats:g=[]}=c.current,h=J(c.current),{ownerDocument:y}=t,{defaultView:v}=y,{direction:E}=v.getComputedStyle(t),b="rtl"===E?Pe.RIGHT:Pe.LEFT,T=n.keyCode===b;if(h&&0===g.length){if(0===m&&T)return;if(p===d.length&&!T)return}if(!h)return;const x=f[m-1]||He,w=f[m]||He,N=T?x:w,L=g.every(((e,t)=>e===N[t]));let C=g.length;if(L?C<N.length&&C++:C--,C===g.length)return void(c.current._newActiveFormats=N);n.preventDefault();const _=(L?N:T?w:x).slice(0,C),A={...c.current,activeFormats:_};c.current=A,l(A),u()}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{function n(t){const{keyCode:n}=t,{createRecord:r,handleChange:o}=e.current;if(t.defaultPrevented)return;if(n!==Pe.DELETE&&n!==Pe.BACKSPACE)return;const a=r(),{start:s,end:i,text:c}=a;0===s&&0!==i&&i===c.length&&(o(ae(a)),t.preventDefault())}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}},e=>t=>{const{ownerDocument:n}=t,{defaultView:r}=n;let o=!1;function a(t){if(o)return;let n;t&&(n=t.inputType);const{record:r,applyRecord:a,createRecord:s,handleChange:i}=e.current;if(n&&(0===n.indexOf("format")||je.has(n)))return void a(r.current);const c=s(),{start:l,activeFormats:u=[]}=r.current,d=function({value:e,start:t,end:n,formats:r}){const o=Math.min(t,n),a=Math.max(t,n),s=e.formats[o-1]||[],i=e.formats[a]||[];for(e.activeFormats=r.map(((e,t)=>{if(s[t]){if(m(e,s[t]))return s[t]}else if(i[t]&&m(e,i[t]))return i[t];return e}));--n>=t;)e.activeFormats.length>0?e.formats[n]=e.activeFormats:delete e.formats[n];return e}({value:c,start:l,end:c.start,formats:u});i(d)}function s(){const{record:i,applyRecord:c,createRecord:l,onSelectionChange:u}=e.current;if("true"!==t.contentEditable)return;if(n.activeElement!==t)return void n.removeEventListener("selectionchange",s);if(o)return;const{start:d,end:f,text:m}=l(),p=i.current;if(m!==p.text)return void a();if(d===p.start&&f===p.end)return void(0===p.text.length&&0===d&&function(e){const t=e.getSelection(),{anchorNode:n,anchorOffset:r}=t;if(n.nodeType!==n.ELEMENT_NODE)return;const o=n.childNodes[r];o&&o.nodeType===o.ELEMENT_NODE&&o.hasAttribute(Ie)&&t.collapseToStart()}(r));const g={...p,start:d,end:f,activeFormats:p._newActiveFormats,_newActiveFormats:void 0},h=T(g,Ve);g.activeFormats=h,i.current=g,c(g,{domOnly:!0}),u(d,f)}function i(){o=!0,n.removeEventListener("selectionchange",s),t.querySelector(`[${Ie}]`)?.remove()}function c(){o=!1,a({inputType:"insertText"}),n.addEventListener("selectionchange",s)}function l(){const{record:r,isSelected:o,onSelectionChange:a,applyRecord:i}=e.current;if(!t.parentElement.closest('[contenteditable="true"]')){if(o)i(r.current,{domOnly:!0});else{const e=void 0;r.current={...r.current,start:e,end:e,activeFormats:Ve}}a(r.current.start,r.current.end),window.queueMicrotask(s),n.addEventListener("selectionchange",s)}}return t.addEventListener("input",a),t.addEventListener("compositionstart",i),t.addEventListener("compositionend",c),t.addEventListener("focus",l),()=>{t.removeEventListener("input",a),t.removeEventListener("compositionstart",i),t.removeEventListener("compositionend",c),t.removeEventListener("focus",l)}},()=>e=>{const{ownerDocument:t}=e,{defaultView:n}=t,r=n?.getSelection();let o;function a(){return r.rangeCount?r.getRangeAt(0):null}function s(e){const n="keydown"===e.type?"keyup":"pointerup";function r(){t.removeEventListener(n,s),t.removeEventListener("selectionchange",r),t.removeEventListener("input",r)}function s(){r(),ue(o,a())||t.dispatchEvent(new Event("selectionchange"))}t.addEventListener(n,s),t.addEventListener("selectionchange",r),t.addEventListener("input",r),o=a()}return e.addEventListener("pointerdown",s),e.addEventListener("keydown",s),()=>{e.removeEventListener("pointerdown",s),e.removeEventListener("keydown",s)}},function(){return e=>{const{ownerDocument:t}=e,{defaultView:n}=t;let r=null;function o(t){t.defaultPrevented||t.target!==e&&t.target.contains(e)&&(r=e.getAttribute("contenteditable"),e.setAttribute("contenteditable","false"),n.getSelection().removeAllRanges())}function a(){null!==r&&(e.setAttribute("contenteditable",r),r=null)}return n.addEventListener("pointerdown",o),n.addEventListener("pointerup",a),()=>{n.removeEventListener("pointerdown",o),n.removeEventListener("pointerup",a)}}}];function ze(e){const t=(0,_e.useRef)(e);(0,_e.useInsertionEffect)((()=>{t.current=e}));const n=(0,_e.useMemo)((()=>We.map((e=>e(t)))),[t]);return(0,Se.useRefEffect)((e=>{const t=n.map((t=>t(e)));return()=>{t.forEach((e=>e()))}}),[n])}function Be({value:e="",selectionStart:t,selectionEnd:n,placeholder:r,onSelectionChange:a,preserveWhiteSpace:s,onChange:i,__unstableDisableFormats:c,__unstableIsSelected:l,__unstableDependencies:u=[],__unstableAfterParse:d,__unstableBeforeSerialize:f,__unstableAddInvisibleFormats:m}){const p=(0,o.useRegistry)(),[,g]=(0,_e.useReducer)((()=>({}))),h=(0,_e.useRef)();function y(e,{domOnly:t}={}){Te({value:e,current:h.current,prepareEditableTree:m,__unstableDomOnly:t,placeholder:r})}const v=(0,_e.useRef)(e),E=(0,_e.useRef)();function b(){v.current=e,E.current=e,e instanceof j||(E.current=e?j.fromHTMLString(e,{preserveWhiteSpace:s}):j.empty()),E.current={text:E.current.text,formats:E.current.formats,replacements:E.current.replacements},c&&(E.current.formats=Array(e.length),E.current.replacements=Array(e.length)),d&&(E.current.formats=d(E.current)),E.current.start=t,E.current.end=n}const T=(0,_e.useRef)(!1);function x(t){if(E.current=t,y(t),c)v.current=t.text;else{const n=f?f(t):t.formats;t={...t,formats:n},v.current="string"==typeof e?_({value:t,preserveWhiteSpace:s}):new j(t)}const{start:n,end:r,formats:o,text:l}=E.current;p.batch((()=>{a(n,r),i(v.current,{__unstableFormats:o,__unstableText:l})})),g()}function w(){b(),y(E.current)}E.current?t===E.current.start&&n===E.current.end||(T.current=l,E.current={...E.current,start:t,end:n,activeFormats:void 0}):(T.current=l,b());const N=(0,_e.useRef)(!1);(0,_e.useLayoutEffect)((()=>{N.current&&e!==v.current&&(w(),g())}),[e]),(0,_e.useLayoutEffect)((()=>{T.current&&(h.current.ownerDocument.activeElement!==h.current&&h.current.focus(),y(E.current),T.current=!1)}),[T.current]);const L=(0,Se.useMergeRefs)([h,(0,_e.useCallback)((e=>{e&&(e.style.whiteSpace=Me,e.style.minWidth=ke)}),[]),$e({record:E}),ze({record:E,handleChange:x,applyRecord:y,createRecord:function(){const{ownerDocument:{defaultView:e}}=h.current,t=e.getSelection(),n=t.rangeCount>0?t.getRangeAt(0):null;return V({element:h.current,range:n,__unstableIsEditableTree:!0})},isSelected:l,onSelectionChange:a,forceRender:g}),(0,Se.useRefEffect)((()=>{w(),N.current=!0}),[r,...u])]);return{value:E.current,getValue:()=>E.current,onChange:x,ref:L}}function Xe(){}(window.wp=window.wp||{}).richText=t})(); block-library.min.js 0000644 00003257223 15013651111 0010430 0 ustar 00 /*! This file is auto-generated */ (()=>{var e={2321:e=>{e.exports=function(e){return e&&"__experimental"in e&&!1!==e.__experimental}},7734:e=>{"use strict";e.exports=function e(t,o){if(t===o)return!0;if(t&&o&&"object"==typeof t&&"object"==typeof o){if(t.constructor!==o.constructor)return!1;var n,a,r;if(Array.isArray(t)){if((n=t.length)!=o.length)return!1;for(a=n;0!=a--;)if(!e(t[a],o[a]))return!1;return!0}if(t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(a of t.entries())if(!o.has(a[0]))return!1;for(a of t.entries())if(!e(a[1],o.get(a[0])))return!1;return!0}if(t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(a of t.entries())if(!o.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(o)){if((n=t.length)!=o.length)return!1;for(a=n;0!=a--;)if(t[a]!==o[a])return!1;return!0}if(t.constructor===RegExp)return t.source===o.source&&t.flags===o.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===o.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===o.toString();if((n=(r=Object.keys(t)).length)!==Object.keys(o).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(o,r[a]))return!1;for(a=n;0!=a--;){var i=r[a];if(!e(t[i],o[i]))return!1}return!0}return t!=t&&o!=o}},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},o=Object.keys(t).join("|"),n=new RegExp(o,"g"),a=new RegExp(o,"");function r(e){return t[e]}var i=function(e){return e.replace(n,r)};e.exports=i,e.exports.has=function(e){return!!e.match(a)},e.exports.remove=i}},t={};function o(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,o),r.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";o.r(n),o.d(n,{__experimentalGetCoreBlocks:()=>MB,__experimentalRegisterExperimentalCoreBlocks:()=>zB,privateApis:()=>IB,registerCoreBlocks:()=>DB});var e={};o.r(e),o.d(e,{init:()=>_t,metadata:()=>gt,name:()=>ht,settings:()=>xt});var t={};o.r(t),o.d(t,{init:()=>Dt,metadata:()=>Pt,name:()=>It,settings:()=>Mt});var a={};o.r(a),o.d(a,{init:()=>ro,metadata:()=>oo,name:()=>no,settings:()=>ao});var r={};o.r(r),o.d(r,{init:()=>Mo,metadata:()=>No,name:()=>Po,settings:()=>Io});var i={};o.r(i),o.d(i,{init:()=>qo,metadata:()=>$o,name:()=>Go,settings:()=>Uo});var s={};o.r(s),o.d(s,{init:()=>Xo,metadata:()=>Ko,name:()=>Yo,settings:()=>Jo});var l={};o.r(l),o.d(l,{init:()=>cn,metadata:()=>rn,name:()=>sn,settings:()=>ln});var c={};o.r(c),o.d(c,{init:()=>vn,metadata:()=>bn,name:()=>yn,settings:()=>fn});var u={};o.r(u),o.d(u,{init:()=>Pn,metadata:()=>Bn,name:()=>Tn,settings:()=>Nn});var d={};o.r(d),o.d(d,{init:()=>Vn,metadata:()=>Rn,name:()=>Hn,settings:()=>Ln});var p={};o.r(p),o.d(p,{init:()=>aa,metadata:()=>ta,name:()=>oa,settings:()=>na});var m={};o.r(m),o.d(m,{init:()=>_a,metadata:()=>ga,name:()=>ha,settings:()=>xa});var g={};o.r(g),o.d(g,{init:()=>va,metadata:()=>ba,name:()=>ya,settings:()=>fa});var h={};o.r(h),o.d(h,{init:()=>Ta,metadata:()=>ja,name:()=>Sa,settings:()=>Ba});var x={};o.r(x),o.d(x,{init:()=>Da,metadata:()=>Pa,name:()=>Ia,settings:()=>Ma});var _={};o.r(_),o.d(_,{init:()=>Ea,metadata:()=>La,name:()=>Va,settings:()=>Fa});var b={};o.r(b),o.d(b,{init:()=>qa,metadata:()=>$a,name:()=>Ga,settings:()=>Ua});var y={};o.r(y),o.d(y,{init:()=>Ja,metadata:()=>Qa,name:()=>Ka,settings:()=>Ya});var f={};o.r(f),o.d(f,{init:()=>ur,metadata:()=>sr,name:()=>lr,settings:()=>cr});var v={};o.r(v),o.d(v,{init:()=>xr,metadata:()=>mr,name:()=>gr,settings:()=>hr});var k={};o.r(k),o.d(k,{init:()=>wr,metadata:()=>fr,name:()=>vr,settings:()=>kr});var w={};o.r(w),o.d(w,{init:()=>Nr,metadata:()=>Sr,name:()=>Br,settings:()=>Tr});var C={};o.r(C),o.d(C,{init:()=>Ar,metadata:()=>Mr,name:()=>Dr,settings:()=>zr});var j={};o.r(j),o.d(j,{init:()=>$r,metadata:()=>Fr,name:()=>Er,settings:()=>Or});var S={};o.r(S),o.d(S,{init:()=>Os,metadata:()=>Vs,name:()=>Fs,settings:()=>Es});var B={};o.r(B),o.d(B,{init:()=>Ks,metadata:()=>Ws,name:()=>Zs,settings:()=>Qs});var T={};o.r(T),o.d(T,{init:()=>Fl,metadata:()=>Hl,name:()=>Ll,settings:()=>Vl});var N={};o.r(N),o.d(N,{init:()=>nc,metadata:()=>ec,name:()=>tc,settings:()=>oc});var P={};o.r(P),o.d(P,{init:()=>mc,metadata:()=>uc,name:()=>dc,settings:()=>pc});var I={};o.r(I),o.d(I,{init:()=>Bc,metadata:()=>Cc,name:()=>jc,settings:()=>Sc});var M={};o.r(M),o.d(M,{init:()=>Dc,metadata:()=>Pc,name:()=>Ic,settings:()=>Mc});var D={};o.r(D),o.d(D,{init:()=>Oc,metadata:()=>Vc,name:()=>Fc,settings:()=>Ec});var z={};o.r(z),o.d(z,{init:()=>Hu,metadata:()=>zu,name:()=>Au,settings:()=>Ru});var A={};o.r(A),o.d(A,{init:()=>td,metadata:()=>Ju,name:()=>Xu,settings:()=>ed});var R={};o.r(R),o.d(R,{init:()=>Cd,metadata:()=>vd,name:()=>kd,settings:()=>wd});var H={};o.r(H),o.d(H,{init:()=>Pd,metadata:()=>Bd,name:()=>Td,settings:()=>Nd});var L={};o.r(L),o.d(L,{init:()=>Ld,metadata:()=>Ad,name:()=>Rd,settings:()=>Hd});var V={};o.r(V),o.d(V,{init:()=>xp,metadata:()=>mp,name:()=>gp,settings:()=>hp});var F={};o.r(F),o.d(F,{init:()=>vp,metadata:()=>bp,name:()=>yp,settings:()=>fp});var E={};o.r(E),o.d(E,{init:()=>Ap,metadata:()=>Mp,name:()=>Dp,settings:()=>zp});var O={};o.r(O),o.d(O,{init:()=>cm,metadata:()=>im,name:()=>sm,settings:()=>lm});var $={};o.r($),o.d($,{init:()=>km,metadata:()=>ym,name:()=>fm,settings:()=>vm});var G={};o.r(G),o.d(G,{init:()=>Bm,metadata:()=>Cm,name:()=>jm,settings:()=>Sm});var U={};o.r(U),o.d(U,{init:()=>bg,metadata:()=>hg,name:()=>xg,settings:()=>_g});var q={};o.r(q),o.d(q,{init:()=>kg,metadata:()=>yg,name:()=>fg,settings:()=>vg});var W={};o.r(W),o.d(W,{init:()=>Ng,metadata:()=>Sg,name:()=>Bg,settings:()=>Tg});var Z={};o.r(Z),o.d(Z,{init:()=>dx,metadata:()=>lx,name:()=>cx,settings:()=>ux});var Q={};o.r(Q),o.d(Q,{init:()=>Cx,metadata:()=>vx,name:()=>kx,settings:()=>wx});var K={};o.r(K),o.d(K,{init:()=>zx,metadata:()=>Ix,name:()=>Mx,settings:()=>Dx});var Y={};o.r(Y),o.d(Y,{init:()=>Fx,metadata:()=>Hx,name:()=>Lx,settings:()=>Vx});var J={};o.r(J),o.d(J,{init:()=>Kx,metadata:()=>Wx,name:()=>Zx,settings:()=>Qx});var X={};o.r(X),o.d(X,{init:()=>l_,metadata:()=>r_,name:()=>i_,settings:()=>s_});var ee={};o.r(ee),o.d(ee,{init:()=>m_,metadata:()=>u_,name:()=>d_,settings:()=>p_});var te={};o.r(te),o.d(te,{init:()=>z_,metadata:()=>I_,name:()=>M_,settings:()=>D_});var oe={};o.r(oe),o.d(oe,{init:()=>E_,metadata:()=>L_,name:()=>V_,settings:()=>F_});var ne={};o.r(ne),o.d(ne,{init:()=>W_,metadata:()=>G_,name:()=>U_,settings:()=>q_});var ae={};o.r(ae),o.d(ae,{init:()=>J_,metadata:()=>Q_,name:()=>K_,settings:()=>Y_});var re={};o.r(re),o.d(re,{init:()=>ab,metadata:()=>tb,name:()=>ob,settings:()=>nb});var ie={};o.r(ie),o.d(ie,{init:()=>cb,metadata:()=>ib,name:()=>sb,settings:()=>lb});var se={};o.r(se),o.d(se,{init:()=>gb,metadata:()=>db,name:()=>pb,settings:()=>mb});var le={};o.r(le),o.d(le,{init:()=>yb,metadata:()=>xb,name:()=>_b,settings:()=>bb});var ce={};o.r(ce),o.d(ce,{init:()=>Nb,metadata:()=>Sb,name:()=>Bb,settings:()=>Tb});var ue={};o.r(ue),o.d(ue,{init:()=>Lb,metadata:()=>Ab,name:()=>Rb,settings:()=>Hb});var de={};o.r(de),o.d(de,{init:()=>Gb,metadata:()=>Eb,name:()=>Ob,settings:()=>$b});var pe={};o.r(pe),o.d(pe,{init:()=>ay,metadata:()=>ty,name:()=>oy,settings:()=>ny});var me={};o.r(me),o.d(me,{init:()=>py,metadata:()=>cy,name:()=>uy,settings:()=>dy});var ge={};o.r(ge),o.d(ge,{init:()=>yy,metadata:()=>xy,name:()=>_y,settings:()=>by});var he={};o.r(he),o.d(he,{init:()=>Ny,metadata:()=>Sy,name:()=>By,settings:()=>Ty});var xe={};o.r(xe),o.d(xe,{init:()=>Ry,metadata:()=>Dy,name:()=>zy,settings:()=>Ay});var _e={};o.r(_e),o.d(_e,{init:()=>Oy,metadata:()=>Vy,name:()=>Fy,settings:()=>Ey});var be={};o.r(be),o.d(be,{init:()=>Qy,metadata:()=>qy,name:()=>Wy,settings:()=>Zy});var ye={};o.r(ye),o.d(ye,{init:()=>xf,metadata:()=>mf,name:()=>gf,settings:()=>hf});var fe={};o.r(fe),o.d(fe,{init:()=>Bv,metadata:()=>Cv,name:()=>jv,settings:()=>Sv});var ve={};o.r(ve),o.d(ve,{init:()=>Mv,metadata:()=>Nv,name:()=>Pv,settings:()=>Iv});var ke={};o.r(ke),o.d(ke,{init:()=>Fv,metadata:()=>Hv,name:()=>Lv,settings:()=>Vv});var we={};o.r(we),o.d(we,{init:()=>Uv,metadata:()=>Ov,name:()=>$v,settings:()=>Gv});var Ce={};o.r(Ce),o.d(Ce,{init:()=>Kv,metadata:()=>Wv,name:()=>Zv,settings:()=>Qv});var je={};o.r(je),o.d(je,{init:()=>tk,metadata:()=>Jv,name:()=>Xv,settings:()=>ek});var Se={};o.r(Se),o.d(Se,{init:()=>uk,metadata:()=>sk,name:()=>lk,settings:()=>ck});var Be={};o.r(Be),o.d(Be,{init:()=>_k,metadata:()=>gk,name:()=>hk,settings:()=>xk});var Te={};o.r(Te),o.d(Te,{init:()=>Rk,metadata:()=>Dk,name:()=>zk,settings:()=>Ak});var Ne={};o.r(Ne),o.d(Ne,{init:()=>Jk,metadata:()=>Qk,name:()=>Kk,settings:()=>Yk});var Pe={};o.r(Pe),o.d(Pe,{init:()=>ow,metadata:()=>Xk,name:()=>ew,settings:()=>tw});var Ie={};o.r(Ie),o.d(Ie,{init:()=>sw,metadata:()=>aw,name:()=>rw,settings:()=>iw});var Me={};o.r(Me),o.d(Me,{init:()=>vw,metadata:()=>bw,name:()=>yw,settings:()=>fw});var De={};o.r(De),o.d(De,{init:()=>Nw,metadata:()=>Sw,name:()=>Bw,settings:()=>Tw});var ze={};o.r(ze),o.d(ze,{init:()=>Rw,metadata:()=>Dw,name:()=>zw,settings:()=>Aw});var Ae={};o.r(Ae),o.d(Ae,{init:()=>Ww,metadata:()=>Gw,name:()=>Uw,settings:()=>qw});var Re={};o.r(Re),o.d(Re,{init:()=>eC,metadata:()=>Yw,name:()=>Jw,settings:()=>Xw});var He={};o.r(He),o.d(He,{init:()=>lC,metadata:()=>rC,name:()=>iC,settings:()=>sC});var Le={};o.r(Le),o.d(Le,{init:()=>yC,metadata:()=>xC,name:()=>_C,settings:()=>bC});var Ve={};o.r(Ve),o.d(Ve,{init:()=>TC,metadata:()=>jC,name:()=>SC,settings:()=>BC});var Fe={};o.r(Fe),o.d(Fe,{init:()=>OC,metadata:()=>VC,name:()=>FC,settings:()=>EC});var Ee={};o.r(Ee),o.d(Ee,{init:()=>Tj,metadata:()=>jj,name:()=>Sj,settings:()=>Bj});var Oe={};o.r(Oe),o.d(Oe,{init:()=>Vj,metadata:()=>Rj,name:()=>Hj,settings:()=>Lj});var $e={};o.r($e),o.d($e,{init:()=>Uj,metadata:()=>Oj,name:()=>$j,settings:()=>Gj});var Ge={};o.r(Ge),o.d(Ge,{init:()=>wS,metadata:()=>fS,name:()=>vS,settings:()=>kS});var Ue={};o.r(Ue),o.d(Ue,{init:()=>TS,metadata:()=>jS,name:()=>SS,settings:()=>BS});var qe={};o.r(qe),o.d(qe,{init:()=>zS,metadata:()=>IS,name:()=>MS,settings:()=>DS});var We={};o.r(We),o.d(We,{init:()=>$S,metadata:()=>FS,name:()=>ES,settings:()=>OS});var Ze={};o.r(Ze),o.d(Ze,{init:()=>dB,metadata:()=>lB,name:()=>cB,settings:()=>uB});var Qe={};o.r(Qe),o.d(Qe,{init:()=>SB,metadata:()=>wB,name:()=>CB,settings:()=>jB});const Ke=window.wp.blocks,Ye=window.wp.primitives,Je=window.ReactJSXRuntime,Xe=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z"})});function et(e){if(!e)return;const{metadata:t,settings:o,name:n}=e;return(0,Ke.registerBlockType)({name:n,...t},o)}const tt=window.wp.components,ot=window.wp.i18n,nt=window.wp.blockEditor,at=window.wp.serverSideRender;var rt=o.n(at);const it=window.wp.data,st=window.wp.element,lt=window.wp.blob,ct=window.wp.coreData,ut=window.wp.compose;function dt(e,t,o){return(0,it.useSelect)((n=>n(ct.store).canUser("update",{kind:e,name:t,id:o})),[e,t,o])}function pt(e={}){const t=(0,st.useRef)(e),o=(0,st.useRef)(!1),{getSettings:n}=(0,it.useSelect)(nt.store);(0,st.useLayoutEffect)((()=>{t.current=e})),(0,st.useEffect)((()=>{if(o.current)return;if(!t.current.url||!(0,lt.isBlobURL)(t.current.url))return;const e=(0,lt.getBlobByURL)(t.current.url);if(!e)return;const{url:a,allowedTypes:r,onChange:i,onError:s}=t.current,{mediaUpload:l}=n();o.current=!0,l({filesList:[e],allowedTypes:r,onFileChange:([e])=>{(0,lt.isBlobURL)(e?.url)||((0,lt.revokeBlobURL)(a),i(e),o.current=!1)},onError:e=>{(0,lt.revokeBlobURL)(a),s(e),o.current=!1}})}),[n])}function mt(){return(0,ut.useViewportMatch)("medium","<")?{}:{popoverProps:{placement:"left-start",offset:259}}}const gt={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/archives",title:"Archives",category:"widgets",description:"Display a date archive of your posts.",textdomain:"default",attributes:{displayAsDropdown:{type:"boolean",default:!1},showLabel:{type:"boolean",default:!0},showPostCounts:{type:"boolean",default:!1},type:{type:"string",default:"monthly"}},supports:{align:!0,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-archives-editor"},{name:ht}=gt,xt={icon:Xe,example:{},edit:function({attributes:e,setAttributes:t}){const{showLabel:o,showPostCounts:n,displayAsDropdown:a,type:r}=e,i=mt();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{t({displayAsDropdown:!1,showLabel:!1,showPostCounts:!1,type:"monthly"})},dropdownMenuProps:i,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Display as dropdown"),isShownByDefault:!0,hasValue:()=>a,onDeselect:()=>t({displayAsDropdown:!1}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display as dropdown"),checked:a,onChange:()=>t({displayAsDropdown:!a})})}),a&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Show label"),isShownByDefault:!0,hasValue:()=>!o,onDeselect:()=>t({showLabel:!1}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show label"),checked:o,onChange:()=>t({showLabel:!o})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Show post counts"),isShownByDefault:!0,hasValue:()=>n,onDeselect:()=>t({showPostCounts:!1}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show post counts"),checked:n,onChange:()=>t({showPostCounts:!n})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Group by"),isShownByDefault:!0,hasValue:()=>"monthly"!==r,onDeselect:()=>t({type:"monthly"}),children:(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Group by"),options:[{label:(0,ot.__)("Year"),value:"yearly"},{label:(0,ot.__)("Month"),value:"monthly"},{label:(0,ot.__)("Week"),value:"weekly"},{label:(0,ot.__)("Day"),value:"daily"}],value:r,onChange:e=>t({type:e})})})]})}),(0,Je.jsx)("div",{...(0,nt.useBlockProps)(),children:(0,Je.jsx)(tt.Disabled,{children:(0,Je.jsx)(rt(),{block:"core/archives",skipBlockSupportAttributes:!0,attributes:e})})})]})}},_t=()=>et({name:ht,metadata:gt,settings:xt}),bt=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{fillRule:"evenodd",d:"M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z",clipRule:"evenodd"})});function yt(e){var t,o,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=yt(e[t]))&&(n&&(n+=" "),n+=o)}else for(o in e)e[o]&&(n&&(n+=" "),n+=o);return n}const ft=function(){for(var e,t,o=0,n="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=yt(e))&&(n&&(n+=" "),n+=t);return n},vt=window.wp.url;function kt(e){const t=e?e[0]:24,o=e?e[e.length-1]:96;return{minSize:t,maxSize:Math.floor(2.5*o)}}function wt(){const{avatarURL:e}=(0,it.useSelect)((e=>{const{getSettings:t}=e(nt.store),{__experimentalDiscussionSettings:o}=t();return o}));return e}const Ct={who:"authors",per_page:-1,_fields:"id,name",context:"view"};const jt=function({value:e,onChange:t}){const[o,n]=(0,st.useState)(),a=(0,it.useSelect)((e=>{const{getUsers:t}=e(ct.store);return t(Ct)}),[]);if(!a)return null;const r=a.map((e=>({label:e.name,value:e.id})));return(0,Je.jsx)(tt.ComboboxControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("User"),help:(0,ot.__)("Select the avatar user to display, if it is blank it will use the post/page author."),value:e,onChange:t,options:o||r,onFilterValueChange:e=>n(r.filter((t=>t.label.toLowerCase().startsWith(e.toLowerCase()))))})},St=({setAttributes:e,avatar:t,attributes:o,selectUser:n})=>(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Image size"),onChange:t=>e({size:t}),min:t.minSize,max:t.maxSize,initialPosition:o?.size,value:o?.size}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link to user profile"),onChange:()=>e({isLink:!o.isLink}),checked:o.isLink}),o.isLink&&(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open in new tab"),onChange:t=>e({linkTarget:t?"_blank":"_self"}),checked:"_blank"===o.linkTarget}),n&&(0,Je.jsx)(jt,{value:o?.userId,onChange:t=>{e({userId:t})}})]})}),Bt=({setAttributes:e,attributes:t,avatar:o,blockProps:n,isSelected:a})=>{const r=(0,nt.__experimentalUseBorderProps)(t),i=(0,vt.addQueryArgs)((0,vt.removeQueryArgs)(o?.src,["s"]),{s:2*t?.size});return(0,Je.jsx)("div",{...n,children:(0,Je.jsx)(tt.ResizableBox,{size:{width:t.size,height:t.size},showHandle:a,onResizeStop:(o,n,a,r)=>{e({size:parseInt(t.size+(r.height||r.width),10)})},lockAspectRatio:!0,enable:{top:!1,right:!(0,ot.isRTL)(),bottom:!0,left:(0,ot.isRTL)()},minWidth:o.minSize,maxWidth:o.maxSize,children:(0,Je.jsx)("img",{src:i,alt:o.alt,className:ft("avatar","avatar-"+t.size,"photo","wp-block-avatar__image",r.className),style:r.style})})})},Tt=({attributes:e,context:t,setAttributes:o,isSelected:n})=>{const{commentId:a}=t,r=(0,nt.useBlockProps)(),i=function({commentId:e}){const[t]=(0,ct.useEntityProp)("root","comment","author_avatar_urls",e),[o]=(0,ct.useEntityProp)("root","comment","author_name",e),n=t?Object.values(t):null,a=t?Object.keys(t):null,{minSize:r,maxSize:i}=kt(a),s=wt();return{src:n?n[n.length-1]:s,minSize:r,maxSize:i,alt:o?(0,ot.sprintf)((0,ot.__)("%s Avatar"),o):(0,ot.__)("Default Avatar")}}({commentId:a});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(St,{avatar:i,setAttributes:o,attributes:e,selectUser:!1}),e.isLink?(0,Je.jsx)("a",{href:"#avatar-pseudo-link",className:"wp-block-avatar__link",onClick:e=>e.preventDefault(),children:(0,Je.jsx)(Bt,{attributes:e,avatar:i,blockProps:r,isSelected:n,setAttributes:o})}):(0,Je.jsx)(Bt,{attributes:e,avatar:i,blockProps:r,isSelected:n,setAttributes:o})]})},Nt=({attributes:e,context:t,setAttributes:o,isSelected:n})=>{const{postId:a,postType:r}=t,i=function({userId:e,postId:t,postType:o}){const{authorDetails:n}=(0,it.useSelect)((n=>{const{getEditedEntityRecord:a,getUser:r}=n(ct.store);if(e)return{authorDetails:r(e)};const i=a("postType",o,t)?.author;return{authorDetails:i?r(i):null}}),[o,t,e]),a=n?.avatar_urls?Object.values(n.avatar_urls):null,r=n?.avatar_urls?Object.keys(n.avatar_urls):null,{minSize:i,maxSize:s}=kt(r),l=wt();return{src:a?a[a.length-1]:l,minSize:i,maxSize:s,alt:n?(0,ot.sprintf)((0,ot.__)("%s Avatar"),n?.name):(0,ot.__)("Default Avatar")}}({userId:e?.userId,postId:a,postType:r}),s=(0,nt.useBlockProps)();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(St,{selectUser:!0,attributes:e,avatar:i,setAttributes:o}),e.isLink?(0,Je.jsx)("a",{href:"#avatar-pseudo-link",className:"wp-block-avatar__link",onClick:e=>e.preventDefault(),children:(0,Je.jsx)(Bt,{attributes:e,avatar:i,blockProps:s,isSelected:n,setAttributes:o})}):(0,Je.jsx)(Bt,{attributes:e,avatar:i,blockProps:s,isSelected:n,setAttributes:o})]})};const Pt={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/avatar",title:"Avatar",category:"theme",description:"Add a user’s avatar.",textdomain:"default",attributes:{userId:{type:"number"},size:{type:"number",default:96},isLink:{type:"boolean",default:!1},linkTarget:{type:"string",default:"_self"}},usesContext:["postType","postId","commentId"],supports:{html:!1,align:!0,alignWide:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__experimentalBorder:{__experimentalSkipSerialization:!0,radius:!0,width:!0,color:!0,style:!0,__experimentalDefaultControls:{radius:!0}},color:{text:!1,background:!1,__experimentalDuotone:"img"},interactivity:{clientNavigation:!0}},selectors:{border:".wp-block-avatar img"},editorStyle:"wp-block-avatar-editor",style:"wp-block-avatar"},{name:It}=Pt,Mt={icon:bt,edit:function(e){return e?.context?.commentId||null===e?.context?.commentId?(0,Je.jsx)(Tt,{...e}):(0,Je.jsx)(Nt,{...e})},example:{}},Dt=()=>et({name:It,metadata:Pt,settings:Mt}),zt=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z"})}),At=[{attributes:{src:{type:"string",source:"attribute",selector:"audio",attribute:"src"},caption:{type:"string",source:"html",selector:"figcaption"},id:{type:"number"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{align:!0},save({attributes:e}){const{autoplay:t,caption:o,loop:n,preload:a,src:r}=e;return(0,Je.jsxs)("figure",{children:[(0,Je.jsx)("audio",{controls:"controls",src:r,autoPlay:t,loop:n,preload:a}),!nt.RichText.isEmpty(o)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:o})]})}}],Rt=window.wp.notices;function Ht(e,t){var o,n,a=0;function r(){var r,i,s=o,l=arguments.length;e:for(;s;){if(s.args.length===arguments.length){for(i=0;i<l;i++)if(s.args[i]!==arguments[i]){s=s.next;continue e}return s!==o&&(s===n&&(n=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=o,s.prev=null,o.prev=s,o=s),s.val}s=s.next}for(r=new Array(l),i=0;i<l;i++)r[i]=arguments[i];return s={args:r,val:e.apply(null,r)},o?(o.prev=s,s.next=o):n=s,a===t.maxSize?(n=n.prev).next=null:a++,o=s,s.val}return t=t||{},r.clear=function(){o=null,n=null,a=0},r}const Lt=[{ratio:"2.33",className:"wp-embed-aspect-21-9"},{ratio:"2.00",className:"wp-embed-aspect-18-9"},{ratio:"1.78",className:"wp-embed-aspect-16-9"},{ratio:"1.33",className:"wp-embed-aspect-4-3"},{ratio:"1.00",className:"wp-embed-aspect-1-1"},{ratio:"0.56",className:"wp-embed-aspect-9-16"},{ratio:"0.50",className:"wp-embed-aspect-1-2"}],Vt="wp-embed",Ft=window.wp.privateApis,{lock:Et,unlock:Ot}=(0,Ft.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/block-library"),{name:$t}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},type:{type:"string",role:"content"},providerNameSlug:{type:"string",role:"content"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1,role:"content"},previewable:{type:"boolean",default:!0,role:"content"}},supports:{align:!0,spacing:{margin:!0},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},{kebabCase:Gt}=Ot(tt.privateApis),Ut=e=>e&&e.includes('class="wp-embedded-content"'),qt=(e,t={})=>{const{preview:o,attributes:n={}}=e,{url:a,providerNameSlug:r,type:i,...s}=n;if(!a||!(0,Ke.getBlockType)($t))return;const l=(e=>(0,Ke.getBlockVariations)($t)?.find((({patterns:t})=>((e,t=[])=>t.some((t=>e.match(t))))(e,t))))(a),c="wordpress"===r||i===Vt;if(!c&&l&&(l.attributes.providerNameSlug!==r||!r))return(0,Ke.createBlock)($t,{url:a,...s,...l.attributes});const u=(0,Ke.getBlockVariations)($t)?.find((({name:e})=>"wordpress"===e));return u&&o&&Ut(o.html)&&!c?(0,Ke.createBlock)($t,{url:a,...u.attributes,...t}):void 0},Wt=e=>{if(!e)return e;const t=Lt.reduce(((e,{className:t})=>(e.push(t),e)),["wp-has-aspect-ratio"]);let o=e;for(const e of t)o=o.replace(e,"");return o.trim()};function Zt(e,t,o=!0){if(!o)return Wt(t);const n=document.implementation.createHTMLDocument("");n.body.innerHTML=e;const a=n.body.querySelector("iframe");if(a&&a.height&&a.width){const e=(a.width/a.height).toFixed(2);for(let o=0;o<Lt.length;o++){const n=Lt[o];if(e>=n.ratio){return e-n.ratio>.1?Wt(t):ft(Wt(t),n.className,"wp-has-aspect-ratio")}}}return t}const Qt=Ht(((e,t,o,n,a=!0)=>{if(!e)return{};const r={};let{type:i="rich"}=e;const{html:s,provider_name:l}=e,c=Gt((l||t).toLowerCase());return Ut(s)&&(i=Vt),(s||"photo"===i)&&(r.type=i,r.providerNameSlug=c),(u=o)&&Lt.some((({className:e})=>u.includes(e)))||(r.className=Zt(s,o,n&&a)),r;var u})),Kt=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5.5h12a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5ZM4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6Zm4 10h2v-1.5H8V16Zm5 0h-2v-1.5h2V16Zm1 0h2v-1.5h-2V16Z"})});function Yt({attributeKey:e="caption",attributes:t,setAttributes:o,isSelected:n,insertBlocksAfter:a,placeholder:r=(0,ot.__)("Add caption"),label:i=(0,ot.__)("Caption text"),showToolbarButton:s=!0,excludeElementClassName:l,className:c,readOnly:u,tagName:d="figcaption",addLabel:p=(0,ot.__)("Add caption"),removeLabel:m=(0,ot.__)("Remove caption"),icon:g=Kt,...h}){const x=t[e],_=(0,ut.usePrevious)(x),{PrivateRichText:b}=Ot(nt.privateApis),y=b.isEmpty(x),f=b.isEmpty(_),[v,k]=(0,st.useState)(!y);(0,st.useEffect)((()=>{!y&&f&&k(!0)}),[y,f]),(0,st.useEffect)((()=>{!n&&y&&k(!1)}),[n,y]);const w=(0,st.useCallback)((e=>{e&&y&&e.focus()}),[y]);return(0,Je.jsxs)(Je.Fragment,{children:[s&&(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(tt.ToolbarButton,{onClick:()=>{k(!v),v&&x&&o({[e]:void 0})},icon:g,isPressed:v,label:v?m:p})}),v&&(!b.isEmpty(x)||n)&&(0,Je.jsx)(b,{identifier:e,tagName:d,className:ft(c,l?"":(0,nt.__experimentalGetElementClassName)("caption")),ref:w,"aria-label":i,placeholder:r,value:x,onChange:t=>o({[e]:t}),inlineToolbar:!0,__unstableOnSplitAtEnd:()=>a((0,Ke.createBlock)((0,Ke.getDefaultBlockName)())),readOnly:u,...h})]})}const Jt=["audio"];const Xt=function({attributes:e,className:t,setAttributes:o,onReplace:n,isSelected:a,insertBlocksAfter:r}){const{id:i,autoplay:s,loop:l,preload:c,src:u}=e,[d,p]=(0,st.useState)(e.blob);function m(e){return t=>{o({[e]:t})}}function g(e){if(e!==u){const t=qt({attributes:{url:e}});if(void 0!==t&&n)return void n(t);o({src:e,id:void 0,blob:void 0}),p()}}pt({url:d,allowedTypes:Jt,onChange:_,onError:x});const{createErrorNotice:h}=(0,it.useDispatch)(Rt.store);function x(e){h(e,{type:"snackbar"})}function _(e){if(!e||!e.url)return o({src:void 0,id:void 0,caption:void 0,blob:void 0}),void p();(0,lt.isBlobURL)(e.url)?p(e.url):(o({blob:void 0,src:e.url,id:e.id,caption:e.caption}),p())}const b=ft(t,{"is-transient":!!d}),y=(0,nt.useBlockProps)({className:b});return u||d?(0,Je.jsxs)(Je.Fragment,{children:[a&&(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(nt.MediaReplaceFlow,{mediaId:i,mediaURL:u,allowedTypes:Jt,accept:"audio/*",onSelect:_,onSelectURL:g,onError:x,onReset:()=>_(void 0)})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Autoplay"),onChange:m("autoplay"),checked:s,help:function(e){return e?(0,ot.__)("Autoplay may cause usability issues for some users."):null}}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Loop"),onChange:m("loop"),checked:l}),(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot._x)("Preload","noun; Audio block parameter"),value:c||"",onChange:e=>o({preload:e||void 0}),options:[{value:"",label:(0,ot.__)("Browser default")},{value:"auto",label:(0,ot.__)("Auto")},{value:"metadata",label:(0,ot.__)("Metadata")},{value:"none",label:(0,ot._x)("None","Preload value")}]})]})}),(0,Je.jsxs)("figure",{...y,children:[(0,Je.jsx)(tt.Disabled,{isDisabled:!a,children:(0,Je.jsx)("audio",{controls:"controls",src:null!=u?u:d})}),!!d&&(0,Je.jsx)(tt.Spinner,{}),(0,Je.jsx)(Yt,{attributes:e,setAttributes:o,isSelected:a,insertBlocksAfter:r,label:(0,ot.__)("Audio caption text"),showToolbarButton:a})]})]}):(0,Je.jsx)("div",{...y,children:(0,Je.jsx)(nt.MediaPlaceholder,{icon:(0,Je.jsx)(nt.BlockIcon,{icon:zt}),onSelect:_,onSelectURL:g,accept:"audio/*",allowedTypes:Jt,value:e,onError:x})})};const eo={from:[{type:"files",isMatch:e=>1===e.length&&0===e[0].type.indexOf("audio/"),transform(e){const t=e[0];return(0,Ke.createBlock)("core/audio",{blob:(0,lt.createBlobURL)(t)})}},{type:"shortcode",tag:"audio",attributes:{src:{type:"string",shortcode:({named:{src:e,mp3:t,m4a:o,ogg:n,wav:a,wma:r}})=>e||t||o||n||a||r},loop:{type:"string",shortcode:({named:{loop:e}})=>e},autoplay:{type:"string",shortcode:({named:{autoplay:e}})=>e},preload:{type:"string",shortcode:({named:{preload:e}})=>e}}}]},to=eo,oo={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/audio",title:"Audio",category:"media",description:"Embed a simple audio player.",keywords:["music","sound","podcast","recording"],textdomain:"default",attributes:{blob:{type:"string",role:"local"},src:{type:"string",source:"attribute",selector:"audio",attribute:"src",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},id:{type:"number",role:"content"},autoplay:{type:"boolean",source:"attribute",selector:"audio",attribute:"autoplay"},loop:{type:"boolean",source:"attribute",selector:"audio",attribute:"loop"},preload:{type:"string",source:"attribute",selector:"audio",attribute:"preload"}},supports:{anchor:!0,align:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-audio-editor",style:"wp-block-audio"},{name:no}=oo,ao={icon:zt,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg"},viewportWidth:350},transforms:to,deprecated:At,edit:Xt,save:function({attributes:e}){const{autoplay:t,caption:o,loop:n,preload:a,src:r}=e;return r&&(0,Je.jsxs)("figure",{...nt.useBlockProps.save(),children:[(0,Je.jsx)("audio",{controls:"controls",src:r,autoPlay:t,loop:n,preload:a}),!nt.RichText.isEmpty(o)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:o,className:(0,nt.__experimentalGetElementClassName)("caption")})]})}},ro=()=>et({name:no,metadata:oo,settings:ao}),io=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z"})}),{cleanEmptyObject:so}=Ot(nt.privateApis);function lo(e){if(!e?.style?.typography?.fontFamily)return e;const{fontFamily:t,...o}=e.style.typography;return{...e,style:so({...e.style,typography:o}),fontFamily:t.split("|").pop()}}const co=e=>{const{borderRadius:t,...o}=e,n=[t,o.style?.border?.radius].find((e=>"number"==typeof e&&0!==e));return n?{...o,style:{...o.style,border:{...o.style?.border,radius:`${n}px`}}}:o};const uo=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customGradient)return e;const t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customGradient&&(t.color.gradient=e.customGradient);const{customTextColor:o,customBackgroundColor:n,customGradient:a,...r}=e;return{...r,style:t}},po=e=>{const{color:t,textColor:o,...n}={...e,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.color&&"#"===e.color[0]?e.color:void 0};return uo(n)},mo={url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"}},go={attributes:{tagName:{type:"string",enum:["a","button"],default:"a"},type:{type:"string",default:"button"},textAlign:{type:"string"},url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a,button",attribute:"title",role:"content"},text:{type:"rich-text",source:"rich-text",selector:"a,button",role:"content"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target",role:"content"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel",role:"content"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,shadow:{__experimentalSkipSerialization:!0},spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},__experimentalSelector:".wp-block-button__link",interactivity:{clientNavigation:!0}},save({attributes:e,className:t}){const{tagName:o,type:n,textAlign:a,fontSize:r,linkTarget:i,rel:s,style:l,text:c,title:u,url:d,width:p}=e,m=o||"a",g="button"===m,h=n||"button",x=(0,nt.__experimentalGetBorderClassesAndStyles)(e),_=(0,nt.__experimentalGetColorClassesAndStyles)(e),b=(0,nt.__experimentalGetSpacingClassesAndStyles)(e),y=(0,nt.__experimentalGetShadowClassesAndStyles)(e),f=ft("wp-block-button__link",_.className,x.className,{[`has-text-align-${a}`]:a,"no-border-radius":0===l?.border?.radius},(0,nt.__experimentalGetElementClassName)("button")),v={...x.style,..._.style,...b.style,...y.style},k=ft(t,{[`has-custom-width wp-block-button__width-${p}`]:p,"has-custom-font-size":r||l?.typography?.fontSize});return(0,Je.jsx)("div",{...nt.useBlockProps.save({className:k}),children:(0,Je.jsx)(nt.RichText.Content,{tagName:m,type:g?h:null,className:f,href:g?null:d,title:u,style:v,value:c,target:g?null:i,rel:g?null:s})})}},ho={attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,__experimentalFontFamily:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{radius:!0}},__experimentalSelector:".wp-block-button__link"},save({attributes:e,className:t}){const{fontSize:o,linkTarget:n,rel:a,style:r,text:i,title:s,url:l,width:c}=e;if(!i)return null;const u=(0,nt.__experimentalGetBorderClassesAndStyles)(e),d=(0,nt.__experimentalGetColorClassesAndStyles)(e),p=(0,nt.__experimentalGetSpacingClassesAndStyles)(e),m=ft("wp-block-button__link",d.className,u.className,{"no-border-radius":0===r?.border?.radius}),g={...u.style,...d.style,...p.style},h=ft(t,{[`has-custom-width wp-block-button__width-${c}`]:c,"has-custom-font-size":o||r?.typography?.fontSize});return(0,Je.jsx)("div",{...nt.useBlockProps.save({className:h}),children:(0,Je.jsx)(nt.RichText.Content,{tagName:"a",className:m,href:l,title:s,style:g,value:i,target:n,rel:a})})}},xo={attributes:{url:{type:"string",source:"attribute",selector:"a",attribute:"href"},title:{type:"string",source:"attribute",selector:"a",attribute:"title"},text:{type:"string",source:"html",selector:"a"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0},__experimentalSelector:".wp-block-button__link"},save({attributes:e,className:t}){const{fontSize:o,linkTarget:n,rel:a,style:r,text:i,title:s,url:l,width:c}=e;if(!i)return null;const u=(0,nt.__experimentalGetBorderClassesAndStyles)(e),d=(0,nt.__experimentalGetColorClassesAndStyles)(e),p=(0,nt.__experimentalGetSpacingClassesAndStyles)(e),m=ft("wp-block-button__link",d.className,u.className,{"no-border-radius":0===r?.border?.radius}),g={...u.style,...d.style,...p.style},h=ft(t,{[`has-custom-width wp-block-button__width-${c}`]:c,"has-custom-font-size":o||r?.typography?.fontSize});return(0,Je.jsx)("div",{...nt.useBlockProps.save({className:h}),children:(0,Je.jsx)(nt.RichText.Content,{tagName:"a",className:m,href:l,title:s,style:g,value:i,target:n,rel:a})})},migrate:lo,isEligible:({style:e})=>e?.typography?.fontFamily},_o=[go,ho,xo,{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...mo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},isEligible:({style:e})=>"number"==typeof e?.border?.radius,save({attributes:e,className:t}){const{fontSize:o,linkTarget:n,rel:a,style:r,text:i,title:s,url:l,width:c}=e;if(!i)return null;const u=r?.border?.radius,d=(0,nt.__experimentalGetColorClassesAndStyles)(e),p=ft("wp-block-button__link",d.className,{"no-border-radius":0===r?.border?.radius}),m={borderRadius:u||void 0,...d.style},g=ft(t,{[`has-custom-width wp-block-button__width-${c}`]:c,"has-custom-font-size":o||r?.typography?.fontSize});return(0,Je.jsx)("div",{...nt.useBlockProps.save({className:g}),children:(0,Je.jsx)(nt.RichText.Content,{tagName:"a",className:p,href:l,title:s,style:m,value:i,target:n,rel:a})})},migrate:(0,ut.compose)(lo,co)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...mo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:o,linkTarget:n,rel:a,text:r,title:i,url:s,width:l}=e,c=(0,nt.__experimentalGetColorClassesAndStyles)(e),u=ft("wp-block-button__link",c.className,{"no-border-radius":0===o}),d={borderRadius:o?o+"px":void 0,...c.style},p=ft(t,{[`has-custom-width wp-block-button__width-${l}`]:l});return(0,Je.jsx)("div",{...nt.useBlockProps.save({className:p}),children:(0,Je.jsx)(nt.RichText.Content,{tagName:"a",className:u,href:s,title:i,style:d,value:r,target:n,rel:a})})},migrate:(0,ut.compose)(lo,co)},{supports:{anchor:!0,align:!0,alignWide:!1,color:{__experimentalSkipSerialization:!0},reusable:!1,__experimentalSelector:".wp-block-button__link"},attributes:{...mo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"},width:{type:"number"}},save({attributes:e,className:t}){const{borderRadius:o,linkTarget:n,rel:a,text:r,title:i,url:s,width:l}=e,c=(0,nt.__experimentalGetColorClassesAndStyles)(e),u=ft("wp-block-button__link",c.className,{"no-border-radius":0===o}),d={borderRadius:o?o+"px":void 0,...c.style},p=ft(t,{[`has-custom-width wp-block-button__width-${l}`]:l});return(0,Je.jsx)("div",{...nt.useBlockProps.save({className:p}),children:(0,Je.jsx)(nt.RichText.Content,{tagName:"a",className:u,href:s,title:i,style:d,value:r,target:n,rel:a})})},migrate:(0,ut.compose)(lo,co)},{supports:{align:!0,alignWide:!1,color:{gradients:!0}},attributes:{...mo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},style:{type:"object"}},save({attributes:e}){const{borderRadius:t,linkTarget:o,rel:n,text:a,title:r,url:i}=e,s=ft("wp-block-button__link",{"no-border-radius":0===t}),l={borderRadius:t?t+"px":void 0};return(0,Je.jsx)(nt.RichText.Content,{tagName:"a",className:s,href:i,title:r,style:l,value:a,target:o,rel:n})},migrate:co},{supports:{align:!0,alignWide:!1},attributes:{...mo,linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"},borderRadius:{type:"number"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},customGradient:{type:"string"},gradient:{type:"string"}},isEligible:e=>!!(e.customTextColor||e.customBackgroundColor||e.customGradient||e.align),migrate:(0,ut.compose)(co,uo,(function(e){if(!e.align)return e;const{align:t,...o}=e;return{...o,className:ft(o.className,`align${e.align}`)}})),save({attributes:e}){const{backgroundColor:t,borderRadius:o,customBackgroundColor:n,customTextColor:a,customGradient:r,linkTarget:i,gradient:s,rel:l,text:c,textColor:u,title:d,url:p}=e,m=(0,nt.getColorClassName)("color",u),g=!r&&(0,nt.getColorClassName)("background-color",t),h=(0,nt.__experimentalGetGradientClass)(s),x=ft("wp-block-button__link",{"has-text-color":u||a,[m]:m,"has-background":t||n||r||s,[g]:g,"no-border-radius":0===o,[h]:h}),_={background:r||void 0,backgroundColor:g||r||s?void 0:n,color:m?void 0:a,borderRadius:o?o+"px":void 0};return(0,Je.jsx)("div",{children:(0,Je.jsx)(nt.RichText.Content,{tagName:"a",className:x,href:p,title:d,style:_,value:c,target:i,rel:l})})}},{attributes:{...mo,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel"},placeholder:{type:"string"}},isEligible:e=>e.className&&e.className.includes("is-style-squared"),migrate(e){let t=e.className;return t&&(t=t.replace(/is-style-squared[\s]?/,"").trim()),co(uo({...e,className:t||void 0,borderRadius:0}))},save({attributes:e}){const{backgroundColor:t,customBackgroundColor:o,customTextColor:n,linkTarget:a,rel:r,text:i,textColor:s,title:l,url:c}=e,u=(0,nt.getColorClassName)("color",s),d=(0,nt.getColorClassName)("background-color",t),p=ft("wp-block-button__link",{"has-text-color":s||n,[u]:u,"has-background":t||o,[d]:d}),m={backgroundColor:d?void 0:o,color:u?void 0:n};return(0,Je.jsx)("div",{children:(0,Je.jsx)(nt.RichText.Content,{tagName:"a",className:p,href:c,title:l,style:m,value:i,target:a,rel:r})})}},{attributes:{...mo,align:{type:"string",default:"none"},backgroundColor:{type:"string"},textColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"}},migrate:po,save({attributes:e}){const{url:t,text:o,title:n,backgroundColor:a,textColor:r,customBackgroundColor:i,customTextColor:s}=e,l=(0,nt.getColorClassName)("color",r),c=(0,nt.getColorClassName)("background-color",a),u=ft("wp-block-button__link",{"has-text-color":r||s,[l]:l,"has-background":a||i,[c]:c}),d={backgroundColor:c?void 0:i,color:l?void 0:s};return(0,Je.jsx)("div",{children:(0,Je.jsx)(nt.RichText.Content,{tagName:"a",className:u,href:t,title:n,style:d,value:o})})}},{attributes:{...mo,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:o,title:n,align:a,color:r,textColor:i}=e,s={backgroundColor:r,color:i};return(0,Je.jsx)("div",{className:`align${a}`,children:(0,Je.jsx)(nt.RichText.Content,{tagName:"a",className:"wp-block-button__link",href:t,title:n,style:s,value:o})})},migrate:po},{attributes:{...mo,color:{type:"string"},textColor:{type:"string"},align:{type:"string",default:"none"}},save({attributes:e}){const{url:t,text:o,title:n,align:a,color:r,textColor:i}=e;return(0,Je.jsx)("div",{className:`align${a}`,style:{backgroundColor:r},children:(0,Je.jsx)(nt.RichText.Content,{tagName:"a",href:t,title:n,style:{color:i},value:o})})},migrate:po}],bo=_o,yo="noreferrer noopener",fo="_blank",vo="nofollow";function ko(e){return e.toString().replace(/<\/?a[^>]*>/g,"")}const wo=window.wp.keycodes,Co=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),jo=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})}),So=[...nt.LinkControl.DEFAULT_LINK_SETTINGS,{id:"nofollow",title:(0,ot.__)("Mark as nofollow")}];function Bo({selectedWidth:e,setAttributes:t}){const o=mt();return(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>t({width:void 0}),dropdownMenuProps:o,children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Width"),isShownByDefault:!0,hasValue:()=>!!e,onDeselect:()=>t({width:void 0}),__nextHasNoMarginBottom:!0,children:(0,Je.jsx)(tt.__experimentalToggleGroupControl,{label:(0,ot.__)("Width"),value:e,onChange:e=>t({width:e}),isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:[25,50,75,100].map((e=>(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:e,label:(0,ot.sprintf)((0,ot.__)("%d%%"),e)},e)))})})})}const To=function(e){const{attributes:t,setAttributes:o,className:n,isSelected:a,onReplace:r,mergeBlocks:i,clientId:s,context:l}=e,{tagName:c,textAlign:u,linkTarget:d,placeholder:p,rel:m,style:g,text:h,url:x,width:_,metadata:b}=t,y=c||"a",[f,v]=(0,st.useState)(null),k=(0,nt.__experimentalUseBorderProps)(t),w=(0,nt.__experimentalUseColorProps)(t),C=(0,nt.__experimentalGetSpacingClassesAndStyles)(t),j=(0,nt.__experimentalGetShadowClassesAndStyles)(t),S=(0,st.useRef)(),B=(0,st.useRef)(),T=(0,nt.useBlockProps)({ref:(0,ut.useMergeRefs)([v,S]),onKeyDown:function(e){wo.isKeyboardEvent.primary(e,"k")?R(e):wo.isKeyboardEvent.primaryShift(e,"k")&&(H(),B.current?.focus())}}),N=(0,nt.useBlockEditingMode)(),[P,I]=(0,st.useState)(!1),M=!!x,D=d===fo,z=!!m?.includes(vo),A="a"===y;function R(e){e.preventDefault(),I(!0)}function H(){o({url:void 0,linkTarget:void 0,rel:void 0}),I(!1)}(0,st.useEffect)((()=>{a||I(!1)}),[a]);const L=(0,st.useMemo)((()=>({url:x,opensInNewTab:D,nofollow:z})),[x,D,z]),V=function(e){const{replaceBlocks:t,selectionChange:o}=(0,it.useDispatch)(nt.store),{getBlock:n,getBlockRootClientId:a,getBlockIndex:r}=(0,it.useSelect)(nt.store),i=(0,st.useRef)(e);return i.current=e,(0,ut.useRefEffect)((e=>{function s(e){if(e.defaultPrevented||e.keyCode!==wo.ENTER)return;const{content:s,clientId:l}=i.current;if(s.length)return;e.preventDefault();const c=n(a(l)),u=r(l),d=(0,Ke.cloneBlock)({...c,innerBlocks:c.innerBlocks.slice(0,u)}),p=(0,Ke.createBlock)((0,Ke.getDefaultBlockName)()),m=c.innerBlocks.slice(u+1),g=m.length?[(0,Ke.cloneBlock)({...c,innerBlocks:m})]:[];t(c.clientId,[d,p,...g],1),o(p.clientId)}return e.addEventListener("keydown",s),()=>{e.removeEventListener("keydown",s)}}),[])}({content:h,clientId:s}),F=(0,ut.useMergeRefs)([V,B]),{lockUrlControls:E=!1}=(0,it.useSelect)((e=>{if(!a)return{};const t=(0,Ke.getBlockBindingsSource)(b?.bindings?.url?.source);return{lockUrlControls:!!b?.bindings?.url&&!t?.canUserEditValue?.({select:e,context:l,args:b?.bindings?.url?.args})}}),[l,a,b?.bindings?.url]),[O,$]=(0,nt.useSettings)("typography.fluid","layout"),G=(0,nt.getTypographyClassesAndStyles)(t,{typography:{fluid:O},layout:{wideSize:$?.wideSize}});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("div",{...T,className:ft(T.className,{[`has-custom-width wp-block-button__width-${_}`]:_}),children:(0,Je.jsx)(nt.RichText,{ref:F,"aria-label":(0,ot.__)("Button text"),placeholder:p||(0,ot.__)("Add text…"),value:h,onChange:e=>o({text:ko(e)}),withoutInteractiveFormatting:!0,className:ft(n,"wp-block-button__link",w.className,k.className,G.className,{[`has-text-align-${u}`]:u,"no-border-radius":0===g?.border?.radius,"has-custom-font-size":T.style.fontSize},(0,nt.__experimentalGetElementClassName)("button")),style:{...k.style,...w.style,...C.style,...j.style,...G.style,writingMode:void 0},onReplace:r,onMerge:i,identifier:"text"})}),(0,Je.jsxs)(nt.BlockControls,{group:"block",children:["default"===N&&(0,Je.jsx)(nt.AlignmentControl,{value:u,onChange:e=>{o({textAlign:e})}}),!M&&A&&!E&&(0,Je.jsx)(tt.ToolbarButton,{name:"link",icon:Co,title:(0,ot.__)("Link"),shortcut:wo.displayShortcut.primary("k"),onClick:R}),M&&A&&!E&&(0,Je.jsx)(tt.ToolbarButton,{name:"link",icon:jo,title:(0,ot.__)("Unlink"),shortcut:wo.displayShortcut.primaryShift("k"),onClick:H,isActive:!0})]}),A&&a&&(P||M)&&!E&&(0,Je.jsx)(tt.Popover,{placement:"bottom",onClose:()=>{I(!1),B.current?.focus()},anchor:f,focusOnMount:!!P&&"firstElement",__unstableSlotName:"__unstable-block-tools-after",shift:!0,children:(0,Je.jsx)(nt.LinkControl,{value:L,onChange:({url:e,opensInNewTab:t,nofollow:n})=>o(function({rel:e="",url:t="",opensInNewTab:o,nofollow:n}){let a,r=e;if(o)a=fo,r=r?.includes(yo)?r:r+` ${yo}`;else{const e=new RegExp(`\\b${yo}\\s*`,"g");r=r?.replace(e,"").trim()}if(n)r=r?.includes(vo)?r:(r+` ${vo}`).trim();else{const e=new RegExp(`\\b${vo}\\s*`,"g");r=r?.replace(e,"").trim()}return{url:(0,vt.prependHTTP)(t),linkTarget:a,rel:r||void 0}}({rel:m,url:e,opensInNewTab:t,nofollow:n})),onRemove:()=>{H(),B.current?.focus()},forceIsEditingLink:P,settings:So})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(Bo,{selectedWidth:_,setAttributes:o})}),(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:A&&(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link rel"),value:m||"",onChange:e=>o({rel:e})})})]})};const No={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/button",title:"Button",category:"design",parent:["core/buttons"],description:"Prompt visitors to take action with a button-style link.",keywords:["link"],textdomain:"default",attributes:{tagName:{type:"string",enum:["a","button"],default:"a"},type:{type:"string",default:"button"},textAlign:{type:"string"},url:{type:"string",source:"attribute",selector:"a",attribute:"href",role:"content"},title:{type:"string",source:"attribute",selector:"a,button",attribute:"title",role:"content"},text:{type:"rich-text",source:"rich-text",selector:"a,button",role:"content"},linkTarget:{type:"string",source:"attribute",selector:"a",attribute:"target",role:"content"},rel:{type:"string",source:"attribute",selector:"a",attribute:"rel",role:"content"},placeholder:{type:"string"},backgroundColor:{type:"string"},textColor:{type:"string"},gradient:{type:"string"},width:{type:"number"}},supports:{anchor:!0,splitting:!0,align:!1,alignWide:!1,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{__experimentalSkipSerialization:["fontSize","lineHeight","fontFamily","fontWeight","fontStyle","textTransform","textDecoration","letterSpacing"],fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},reusable:!1,shadow:{__experimentalSkipSerialization:!0},spacing:{__experimentalSkipSerialization:!0,padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},interactivity:{clientNavigation:!0}},styles:[{name:"fill",label:"Fill",isDefault:!0},{name:"outline",label:"Outline"}],editorStyle:"wp-block-button-editor",style:"wp-block-button",selectors:{root:".wp-block-button .wp-block-button__link",typography:{writingMode:".wp-block-button"}}},{name:Po}=No,Io={icon:io,example:{attributes:{className:"is-style-fill",text:(0,ot.__)("Call to action")}},edit:To,save:function({attributes:e,className:t}){const{tagName:o,type:n,textAlign:a,fontSize:r,linkTarget:i,rel:s,style:l,text:c,title:u,url:d,width:p}=e,m=o||"a",g="button"===m,h=n||"button",x=(0,nt.__experimentalGetBorderClassesAndStyles)(e),_=(0,nt.__experimentalGetColorClassesAndStyles)(e),b=(0,nt.__experimentalGetSpacingClassesAndStyles)(e),y=(0,nt.__experimentalGetShadowClassesAndStyles)(e),f=(0,nt.getTypographyClassesAndStyles)(e),v=ft("wp-block-button__link",_.className,x.className,f.className,{[`has-text-align-${a}`]:a,"no-border-radius":0===l?.border?.radius,"has-custom-font-size":r||l?.typography?.fontSize},(0,nt.__experimentalGetElementClassName)("button")),k={...x.style,..._.style,...b.style,...y.style,...f.style,writingMode:void 0},w=ft(t,{[`has-custom-width wp-block-button__width-${p}`]:p});return(0,Je.jsx)("div",{...nt.useBlockProps.save({className:w}),children:(0,Je.jsx)(nt.RichText.Content,{tagName:m,type:g?h:null,className:v,href:g?null:d,title:u,style:k,value:c,target:g?null:i,rel:g?null:s})})},deprecated:bo,merge:(e,{text:t=""})=>({...e,text:(e.text||"")+t})},Mo=()=>et({name:Po,metadata:No,settings:Io}),Do=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M14.5 17.5H9.5V16H14.5V17.5Z M14.5 8H9.5V6.5H14.5V8Z M7 3.5H17C18.1046 3.5 19 4.39543 19 5.5V9C19 10.1046 18.1046 11 17 11H7C5.89543 11 5 10.1046 5 9V5.5C5 4.39543 5.89543 3.5 7 3.5ZM17 5H7C6.72386 5 6.5 5.22386 6.5 5.5V9C6.5 9.27614 6.72386 9.5 7 9.5H17C17.2761 9.5 17.5 9.27614 17.5 9V5.5C17.5 5.22386 17.2761 5 17 5Z M7 13H17C18.1046 13 19 13.8954 19 15V18.5C19 19.6046 18.1046 20.5 17 20.5H7C5.89543 20.5 5 19.6046 5 18.5V15C5 13.8954 5.89543 13 7 13ZM17 14.5H7C6.72386 14.5 6.5 14.7239 6.5 15V18.5C6.5 18.7761 6.72386 19 7 19H17C17.2761 19 17.5 18.7761 17.5 18.5V15C17.5 14.7239 17.2761 14.5 17 14.5Z"})}),zo=e=>{if(e.layout)return e;const{contentJustification:t,orientation:o,...n}=e;return(t||o)&&Object.assign(n,{layout:{type:"flex",...t&&{justifyContent:t},...o&&{orientation:o}}}),n},Ao=[{attributes:{contentJustification:{type:"string"},orientation:{type:"string",default:"horizontal"}},supports:{anchor:!0,align:["wide","full"],__experimentalExposeControlsToChildren:!0,spacing:{blockGap:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}}},isEligible:({contentJustification:e,orientation:t})=>!!e||!!t,migrate:zo,save:({attributes:{contentJustification:e,orientation:t}})=>(0,Je.jsx)("div",{...nt.useBlockProps.save({className:ft({[`is-content-justification-${e}`]:e,"is-vertical":"vertical"===t})}),children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})},{supports:{align:["center","left","right"],anchor:!0},save:()=>(0,Je.jsx)("div",{children:(0,Je.jsx)(nt.InnerBlocks.Content,{})}),isEligible:({align:e})=>e&&["center","left","right"].includes(e),migrate:e=>zo({...e,align:void 0,contentJustification:e.align})}],Ro=Ao,Ho=window.wp.richText;function Lo(e,t,o){if(!e)return;const{supports:n}=(0,Ke.getBlockType)(t),a=[];if(["core/paragraph","core/heading","core/image","core/button"].includes(t)&&o&&a.push("id","bindings"),!1!==n.renaming&&a.push("name"),!a.length)return;const r=Object.entries(e).reduce(((e,[t,n])=>a.includes(t)?(e[t]="bindings"===t?o(n):n,e):e),{});return Object.keys(r).length?r:void 0}const Vo={from:[{type:"block",isMultiBlock:!0,blocks:["core/button"],transform:e=>(0,Ke.createBlock)("core/buttons",{},e.map((e=>(0,Ke.createBlock)("core/button",e))))},{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>(0,Ke.createBlock)("core/buttons",{},e.map((e=>{const{content:t,metadata:o}=e,n=(0,Ho.__unstableCreateElement)(document,t),a=n.innerText||"",r=n.querySelector("a"),i=r?.getAttribute("href");return(0,Ke.createBlock)("core/button",{text:a,url:i,metadata:Lo(o,"core/button",(({content:e})=>({text:e})))})}))),isMatch:e=>e.every((e=>{const t=(0,Ho.__unstableCreateElement)(document,e.content),o=t.innerText||"",n=t.querySelectorAll("a");return o.length<=30&&n.length<=1}))}]},Fo=Vo,Eo={name:"core/button",attributesToCopy:["backgroundColor","border","className","fontFamily","fontSize","gradient","style","textColor","width"]};const Oo=function({attributes:e,className:t}){var o;const{fontSize:n,layout:a,style:r}=e,i=(0,nt.useBlockProps)({className:ft(t,{"has-custom-font-size":n||r?.typography?.fontSize})}),{hasButtonVariations:s}=(0,it.useSelect)((e=>({hasButtonVariations:e(Ke.store).getBlockVariations("core/button","inserter").length>0})),[]),l=(0,nt.useInnerBlocksProps)(i,{defaultBlock:Eo,directInsert:!s,template:[["core/button"]],templateInsertUpdatesSelection:!0,orientation:null!==(o=a?.orientation)&&void 0!==o?o:"horizontal"});return(0,Je.jsx)("div",{...l})};const $o={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/buttons",title:"Buttons",category:"design",allowedBlocks:["core/button"],description:"Prompt visitors to take action with a group of button-style links.",keywords:["link"],textdomain:"default",supports:{anchor:!0,align:["wide","full"],html:!1,__experimentalExposeControlsToChildren:!0,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},spacing:{blockGap:["horizontal","vertical"],padding:!0,margin:["top","bottom"],__experimentalDefaultControls:{blockGap:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-buttons-editor",style:"wp-block-buttons"},{name:Go}=$o,Uo={icon:Do,example:{attributes:{layout:{type:"flex",justifyContent:"center"}},innerBlocks:[{name:"core/button",attributes:{text:(0,ot.__)("Find out more")}},{name:"core/button",attributes:{text:(0,ot.__)("Contact us")}}]},deprecated:Ro,transforms:Fo,edit:Oo,save:function({attributes:e,className:t}){const{fontSize:o,style:n}=e,a=nt.useBlockProps.save({className:ft(t,{"has-custom-font-size":o||n?.typography?.fontSize})}),r=nt.useInnerBlocksProps.save(a);return(0,Je.jsx)("div",{...r})}},qo=()=>et({name:Go,metadata:$o,settings:Uo}),Wo=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z"})}),Zo=Ht((e=>{if(!e)return{};const t=new Date(e);return{year:t.getFullYear(),month:t.getMonth()+1}}));const Qo={from:[{type:"block",blocks:["core/archives"],transform:()=>(0,Ke.createBlock)("core/calendar")}],to:[{type:"block",blocks:["core/archives"],transform:()=>(0,Ke.createBlock)("core/archives")}]},Ko={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/calendar",title:"Calendar",category:"widgets",description:"A calendar of your site’s posts.",keywords:["posts","archive"],textdomain:"default",attributes:{month:{type:"integer"},year:{type:"integer"}},supports:{align:!0,color:{link:!0,__experimentalSkipSerialization:["text","background"],__experimentalDefaultControls:{background:!0,text:!0},__experimentalSelector:"table, th"},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-calendar"},{name:Yo}=Ko,Jo={icon:Wo,example:{},edit:function({attributes:e}){const t=(0,nt.useBlockProps)(),{date:o,hasPosts:n,hasPostsResolved:a}=(0,it.useSelect)((e=>{const{getEntityRecords:t,hasFinishedResolution:o}=e(ct.store),n={status:"publish",per_page:1},a=t("postType","post",n),r=o("getEntityRecords",["postType","post",n]);let i;const s=e("core/editor");if(s){"post"===s.getEditedPostAttribute("type")&&(i=s.getEditedPostAttribute("date"))}return{date:i,hasPostsResolved:r,hasPosts:r&&1===a?.length}}),[]);return n?(0,Je.jsx)("div",{...t,children:(0,Je.jsx)(tt.Disabled,{children:(0,Je.jsx)(rt(),{block:"core/calendar",attributes:{...e,...Zo(o)}})})}):(0,Je.jsx)("div",{...t,children:(0,Je.jsx)(tt.Placeholder,{icon:Wo,label:(0,ot.__)("Calendar"),children:a?(0,ot.__)("No published posts found."):(0,Je.jsx)(tt.Spinner,{})})})},transforms:Qo},Xo=()=>et({name:Yo,metadata:Ko,settings:Jo}),en=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})}),tn=window.wp.htmlEntities,on=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z"})});const nn=[{name:"terms",title:(0,ot.__)("Terms List"),icon:en,attributes:{taxonomy:"post_tag"},isActive:e=>"category"!==e.taxonomy},{name:"categories",title:(0,ot.__)("Categories List"),description:(0,ot.__)("Display a list of all categories."),icon:en,attributes:{taxonomy:"category"},isActive:["taxonomy"],isDefault:!0}],an=nn,rn={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/categories",title:"Terms List",category:"widgets",description:"Display a list of all terms of a given taxonomy.",keywords:["categories"],textdomain:"default",attributes:{taxonomy:{type:"string",default:"category"},displayAsDropdown:{type:"boolean",default:!1},showHierarchy:{type:"boolean",default:!1},showPostCounts:{type:"boolean",default:!1},showOnlyTopLevel:{type:"boolean",default:!1},showEmpty:{type:"boolean",default:!1},label:{type:"string",role:"content"},showLabel:{type:"boolean",default:!0}},usesContext:["enhancedPagination"],supports:{align:!0,html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-categories-editor",style:"wp-block-categories"},{name:sn}=rn,ln={icon:en,example:{},edit:function e({attributes:{displayAsDropdown:t,showHierarchy:o,showPostCounts:n,showOnlyTopLevel:a,showEmpty:r,label:i,showLabel:s,taxonomy:l},setAttributes:c,className:u}){const d=(0,ut.useInstanceId)(e,"blocks-category-select"),{records:p,isResolvingTaxonomies:m}=(0,ct.useEntityRecords)("root","taxonomy"),g=p?.filter((e=>e.visibility.public)),h=g?.find((e=>e.slug===l)),x=!m&&h?.hierarchical,_={per_page:-1,hide_empty:!r,context:"view"};x&&a&&(_.parent=0);const{records:b,isResolving:y}=(0,ct.useEntityRecords)("taxonomy",l,_),f=e=>b?.length?null===e?b:b.filter((({parent:t})=>t===e)):[],v=e=>t=>c({[e]:t}),k=e=>e?(0,tn.decodeEntities)(e).trim():(0,ot.__)("(Untitled)"),w=e=>{const t=f(e.id),{id:a,link:r,count:i,name:s}=e;return(0,Je.jsxs)("li",{className:`cat-item cat-item-${a}`,children:[(0,Je.jsx)("a",{href:r,target:"_blank",rel:"noreferrer noopener",children:k(s)}),n&&` (${i})`,x&&o&&!!t.length&&(0,Je.jsx)("ul",{className:"children",children:t.map((e=>w(e)))})]},a)},C=(e,t)=>{const{id:a,count:r,name:i}=e,s=f(a);return[(0,Je.jsxs)("option",{className:`level-${t}`,children:[Array.from({length:3*t}).map((()=>" ")),k(i),n&&` (${r})`]},a),x&&o&&!!s.length&&s.map((e=>C(e,t+1)))]},j=!b?.length||t||y?"div":"ul",S=ft(u,{"wp-block-categories-list":!!b?.length&&!t&&!y,"wp-block-categories-dropdown":!!b?.length&&t&&!y}),B=(0,nt.useBlockProps)({className:S}),T=mt();return(0,Je.jsxs)(j,{...B,children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{c({taxonomy:"category",displayAsDropdown:!1,showHierarchy:!1,showPostCounts:!1,showOnlyTopLevel:!1,showEmpty:!1,showLabel:!0})},dropdownMenuProps:T,children:[Array.isArray(g)&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>"category"!==l,label:(0,ot.__)("Taxonomy"),onDeselect:()=>{c({taxonomy:"category"})},isShownByDefault:!0,children:(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Taxonomy"),options:g.map((e=>({label:e.name,value:e.slug}))),value:l,onChange:e=>c({taxonomy:e})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:(0,ot.__)("Display as dropdown"),onDeselect:()=>c({displayAsDropdown:!1}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display as dropdown"),checked:t,onChange:v("displayAsDropdown")})}),t&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!s,label:(0,ot.__)("Show label"),onDeselect:()=>c({showLabel:!0}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,className:"wp-block-categories__indentation",label:(0,ot.__)("Show label"),checked:s,onChange:v("showLabel")})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!n,label:(0,ot.__)("Show post counts"),onDeselect:()=>c({showPostCounts:!1}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show post counts"),checked:n,onChange:v("showPostCounts")})}),x&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!a,label:(0,ot.__)("Show only top level terms"),onDeselect:()=>c({showOnlyTopLevel:!1}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show only top level terms"),checked:a,onChange:v("showOnlyTopLevel")})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!r,label:(0,ot.__)("Show empty terms"),onDeselect:()=>c({showEmpty:!1}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show empty terms"),checked:r,onChange:v("showEmpty")})}),x&&!a&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!o,label:(0,ot.__)("Show hierarchy"),onDeselect:()=>c({showHierarchy:!1}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show hierarchy"),checked:o,onChange:v("showHierarchy")})})]})}),y&&(0,Je.jsx)(tt.Placeholder,{icon:on,label:(0,ot.__)("Terms"),children:(0,Je.jsx)(tt.Spinner,{})}),!y&&0===b?.length&&(0,Je.jsx)("p",{children:h.labels.no_terms}),!y&&b?.length>0&&(t?(()=>{const e=f(x&&o?0:null);return(0,Je.jsxs)(Je.Fragment,{children:[s?(0,Je.jsx)(nt.RichText,{className:"wp-block-categories__label","aria-label":(0,ot.__)("Label text"),placeholder:h.name,withoutInteractiveFormatting:!0,value:i,onChange:e=>c({label:e})}):(0,Je.jsx)(tt.VisuallyHidden,{as:"label",htmlFor:d,children:i||h.name}),(0,Je.jsxs)("select",{id:d,children:[(0,Je.jsx)("option",{children:(0,ot.sprintf)((0,ot.__)("Select %s"),h.labels.singular_name)}),e.map((e=>C(e,0)))]})]})})():f(x&&o?0:null).map((e=>w(e))))]})},variations:an},cn=()=>et({name:sn,metadata:rn,settings:ln}),un=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z"})}),dn=({clientId:e})=>{const{replaceBlocks:t}=(0,it.useDispatch)(nt.store),o=(0,it.useSelect)((t=>t(nt.store).getBlock(e)),[e]);return(0,Je.jsx)(tt.ToolbarButton,{onClick:()=>t(o.clientId,(0,Ke.rawHandler)({HTML:(0,Ke.serialize)(o)})),children:(0,ot.__)("Convert to blocks")})},pn=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"})});function mn({onClick:e,isModalFullScreen:t}){return(0,ut.useViewportMatch)("small","<")?null:(0,Je.jsx)(tt.Button,{size:"compact",onClick:e,icon:pn,isPressed:t,label:t?(0,ot.__)("Exit fullscreen"):(0,ot.__)("Enter fullscreen")})}function gn(e){const t=(0,it.useSelect)((e=>e(nt.store).getSettings().styles));return(0,st.useEffect)((()=>{const{baseURL:o,suffix:n,settings:a}=window.wpEditorL10n.tinymce;return window.tinymce.EditorManager.overrideDefaults({base_url:o,suffix:n}),window.wp.oldEditor.initialize(e.id,{tinymce:{...a,setup(e){e.on("init",(()=>{const o=e.getDoc();t.forEach((({css:e})=>{const t=o.createElement("style");t.innerHTML=e,o.head.appendChild(t)}))}))}}}),()=>{window.wp.oldEditor.remove(e.id)}}),[]),(0,Je.jsx)("textarea",{...e})}function hn(e){const{clientId:t,attributes:{content:o},setAttributes:n,onReplace:a}=e,[r,i]=(0,st.useState)(!1),[s,l]=(0,st.useState)(!1),c=`editor-${t}`,u=()=>o?i(!1):a([]);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(tt.ToolbarGroup,{children:(0,Je.jsx)(tt.ToolbarButton,{onClick:()=>i(!0),children:(0,ot.__)("Edit")})})}),o&&(0,Je.jsx)(st.RawHTML,{children:o}),(r||!o)&&(0,Je.jsxs)(tt.Modal,{title:(0,ot.__)("Classic Editor"),onRequestClose:u,shouldCloseOnClickOutside:!1,overlayClassName:"block-editor-freeform-modal",isFullScreen:s,className:"block-editor-freeform-modal__content",headerActions:(0,Je.jsx)(mn,{onClick:()=>l(!s),isModalFullScreen:s}),children:[(0,Je.jsx)(gn,{id:c,defaultValue:o}),(0,Je.jsxs)(tt.Flex,{className:"block-editor-freeform-modal__actions",justify:"flex-end",expanded:!1,children:[(0,Je.jsx)(tt.FlexItem,{children:(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:u,children:(0,ot.__)("Cancel")})}),(0,Je.jsx)(tt.FlexItem,{children:(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>{n({content:window.wp.oldEditor.getContent(c)}),i(!1)},children:(0,ot.__)("Save")})})]})]})]})}const{wp:xn}=window;function _n({clientId:e,attributes:{content:t},setAttributes:o,onReplace:n}){const{getMultiSelectedBlockClientIds:a}=(0,it.useSelect)(nt.store),r=(0,st.useRef)(!1);return(0,st.useEffect)((()=>{if(!r.current)return;const o=window.tinymce.get(`editor-${e}`);if(!o)return;o.getContent()!==t&&o.setContent(t||"")}),[e,t]),(0,st.useEffect)((()=>{const{baseURL:i,suffix:s}=window.wpEditorL10n.tinymce;function l(e){let r;t&&e.on("loadContent",(()=>e.setContent(t))),e.on("blur",(()=>{r=e.selection.getBookmark(2,!0);const t=document.querySelector(".interface-interface-skeleton__content"),n=t.scrollTop;return a()?.length||o({content:e.getContent()}),e.once("focus",(()=>{r&&(e.selection.moveToBookmark(r),t.scrollTop!==n&&(t.scrollTop=n))})),!1})),e.on("mousedown touchstart",(()=>{r=null}));const i=(0,ut.debounce)((()=>{const t=e.getContent();t!==e._lastChange&&(e._lastChange=t,o({content:t}))}),250);e.on("Paste Change input Undo Redo",i),e.on("remove",i.cancel),e.on("keydown",(t=>{wo.isKeyboardEvent.primary(t,"z")&&t.stopPropagation(),t.keyCode!==wo.BACKSPACE&&t.keyCode!==wo.DELETE||!function(e){const t=e.getBody();return!(t.childNodes.length>1)&&(0===t.childNodes.length||!(t.childNodes[0].childNodes.length>1)&&/^\n?$/.test(t.innerText||t.textContent))}(e)||(n([]),t.preventDefault(),t.stopImmediatePropagation());const{altKey:o}=t;o&&t.keyCode===wo.F10&&t.stopPropagation()})),e.on("init",(()=>{const t=e.getBody();t.ownerDocument.activeElement===t&&(t.blur(),e.focus())}))}function c(){const{settings:t}=window.wpEditorL10n.tinymce;xn.oldEditor.initialize(`editor-${e}`,{tinymce:{...t,inline:!0,content_css:!1,fixed_toolbar_container:`#toolbar-${e}`,setup:l}})}function u(){"complete"===document.readyState&&c()}return r.current=!0,window.tinymce.EditorManager.overrideDefaults({base_url:i,suffix:s}),"complete"===document.readyState?c():document.addEventListener("readystatechange",u),()=>{document.removeEventListener("readystatechange",u),xn.oldEditor.remove(`editor-${e}`),r.current=!1}}),[]),(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("div",{id:`toolbar-${e}`,className:"block-library-classic__toolbar",onClick:function(){const t=window.tinymce.get(`editor-${e}`);t&&t.focus()},"data-placeholder":(0,ot.__)("Classic"),onKeyDown:function(e){e.stopPropagation(),e.nativeEvent.stopImmediatePropagation()}},"toolbar"),(0,Je.jsx)("div",{id:`editor-${e}`,className:"wp-block-freeform block-library-rich-text__tinymce"},"editor")]})}const bn={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/freeform",title:"Classic",category:"text",description:"Use the classic WordPress editor.",textdomain:"default",attributes:{content:{type:"string",source:"raw"}},supports:{className:!1,customClassName:!1,reusable:!1},editorStyle:"wp-block-freeform-editor"},{name:yn}=bn,fn={icon:un,edit:function(e){const{clientId:t}=e,o=(0,it.useSelect)((e=>e(nt.store).canRemoveBlock(t)),[t]),[n,a]=(0,st.useState)(!1),r=(0,ut.useRefEffect)((e=>{a(e.ownerDocument!==document)}),[]);return(0,Je.jsxs)(Je.Fragment,{children:[o&&(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(tt.ToolbarGroup,{children:(0,Je.jsx)(dn,{clientId:t})})}),(0,Je.jsx)("div",{...(0,nt.useBlockProps)({ref:r}),children:n?(0,Je.jsx)(hn,{...e}):(0,Je.jsx)(_n,{...e})})]})},save:function({attributes:e}){const{content:t}=e;return(0,Je.jsx)(st.RawHTML,{children:t})}},vn=()=>et({name:yn,metadata:bn,settings:fn}),kn=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.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"})});function wn(e){return e.replace(/\[/g,"[")}function Cn(e){return e.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m,"$1//$2")}const jn={from:[{type:"enter",regExp:/^```$/,transform:()=>(0,Ke.createBlock)("core/code")},{type:"block",blocks:["core/paragraph"],transform:({content:e,metadata:t})=>(0,Ke.createBlock)("core/code",{content:e,metadata:Lo(t,"core/code")})},{type:"block",blocks:["core/html"],transform:({content:e,metadata:t})=>(0,Ke.createBlock)("core/code",{content:(0,Ho.toHTMLString)({value:(0,Ho.create)({text:e})}),metadata:Lo(t,"core/code")})},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&1===e.children.length&&"CODE"===e.firstChild.nodeName,schema:{pre:{children:{code:{children:{"#text":{}}}}}}}],to:[{type:"block",blocks:["core/paragraph"],transform:({content:e,metadata:t})=>(0,Ke.createBlock)("core/paragraph",{content:e,metadata:Lo(t,"core/paragraph")})}]},Sn=jn,Bn={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/code",title:"Code",category:"text",description:"Display code snippets that respect your spacing and tabs.",textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"code",__unstablePreserveWhiteSpace:!0}},supports:{align:["wide"],anchor:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{width:!0,color:!0}},color:{text:!0,background:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-code"},{name:Tn}=Bn,Nn={icon:kn,example:{attributes:{content:(0,ot.__)("// A “block” is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );")}},merge:(e,t)=>({content:e.content+"\n\n"+t.content}),transforms:Sn,edit:function({attributes:e,setAttributes:t,onRemove:o,insertBlocksAfter:n,mergeBlocks:a}){const r=(0,nt.useBlockProps)();return(0,Je.jsx)("pre",{...r,children:(0,Je.jsx)(nt.RichText,{tagName:"code",identifier:"content",value:e.content,onChange:e=>t({content:e}),onRemove:o,onMerge:a,placeholder:(0,ot.__)("Write code…"),"aria-label":(0,ot.__)("Code"),preserveWhiteSpace:!0,__unstablePastePlainText:!0,__unstableOnSplitAtDoubleLineEnd:()=>n((0,Ke.createBlock)((0,Ke.getDefaultBlockName)()))})})},save:function({attributes:e}){return(0,Je.jsx)("pre",{...nt.useBlockProps.save(),children:(0,Je.jsx)(nt.RichText.Content,{tagName:"code",value:(t="string"==typeof e.content?e.content:e.content.toHTMLString({preserveWhiteSpace:!0}),(0,ut.pipe)(wn,Cn)(t||""))})});var t}},Pn=()=>et({name:Tn,metadata:Bn,settings:Nn}),In=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z"})}),Mn=[{attributes:{verticalAlignment:{type:"string"},width:{type:"number",min:0,max:100}},isEligible:({width:e})=>isFinite(e),migrate:e=>({...e,width:`${e.width}%`}),save({attributes:e}){const{verticalAlignment:t,width:o}=e,n=ft({[`is-vertically-aligned-${t}`]:t}),a={flexBasis:o+"%"};return(0,Je.jsx)("div",{className:n,style:a,children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})}}],Dn=Mn;function zn({width:e,setAttributes:t}){const[o]=(0,nt.useSettings)("spacing.units"),n=(0,tt.__experimentalUseCustomUnits)({availableUnits:o||["%","px","em","rem","vw"]}),a=mt();return(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{t({width:void 0})},dropdownMenuProps:a,children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>void 0!==e,label:(0,ot.__)("Width"),onDeselect:()=>t({width:void 0}),isShownByDefault:!0,children:(0,Je.jsx)(tt.__experimentalUnitControl,{label:(0,ot.__)("Width"),__unstableInputWidth:"calc(50% - 8px)",__next40pxDefaultSize:!0,value:e||"",onChange:e=>{e=0>parseFloat(e)?"0":e,t({width:e})},units:n})})})}const An=function({attributes:{verticalAlignment:e,width:t,templateLock:o,allowedBlocks:n},setAttributes:a,clientId:r}){const i=ft("block-core-columns",{[`is-vertically-aligned-${e}`]:e}),{columnsIds:s,hasChildBlocks:l,rootClientId:c}=(0,it.useSelect)((e=>{const{getBlockOrder:t,getBlockRootClientId:o}=e(nt.store),n=o(r);return{hasChildBlocks:t(r).length>0,rootClientId:n,columnsIds:t(n)}}),[r]),{updateBlockAttributes:u}=(0,it.useDispatch)(nt.store),d=Number.isFinite(t)?t+"%":t,p=(0,nt.useBlockProps)({className:i,style:d?{flexBasis:d}:void 0}),m=s.length,g=s.indexOf(r)+1,h=(0,ot.sprintf)((0,ot.__)("%1$s (%2$d of %3$d)"),p["aria-label"],g,m),x=(0,nt.useInnerBlocksProps)({...p,"aria-label":h},{templateLock:o,allowedBlocks:n,renderAppender:l?void 0:nt.InnerBlocks.ButtonBlockAppender});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(nt.BlockVerticalAlignmentToolbar,{onChange:e=>{a({verticalAlignment:e}),u(c,{verticalAlignment:null})},value:e,controls:["top","center","bottom","stretch"]})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(zn,{width:t,setAttributes:a})}),(0,Je.jsx)("div",{...x})]})};const Rn={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/column",title:"Column",category:"design",parent:["core/columns"],description:"A single column within a columns block.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},width:{type:"string"},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{__experimentalOnEnter:!0,anchor:!0,reusable:!1,html:!1,color:{gradients:!0,heading:!0,button:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},shadow:!0,spacing:{blockGap:!0,padding:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:!0,interactivity:{clientNavigation:!0}}},{name:Hn}=Rn,Ln={icon:In,edit:An,save:function({attributes:e}){const{verticalAlignment:t,width:o}=e,n=ft({[`is-vertically-aligned-${t}`]:t});let a;if(o&&/\d/.test(o)){let e=Number.isFinite(o)?o+"%":o;if(!Number.isFinite(o)&&o?.endsWith("%")){const t=1e12;e=Math.round(Number.parseFloat(o)*t)/t+"%"}a={flexBasis:e}}const r=nt.useBlockProps.save({className:n,style:a}),i=nt.useInnerBlocksProps.save(r);return(0,Je.jsx)("div",{...i})},deprecated:Dn},Vn=()=>et({name:Hn,metadata:Rn,settings:Ln}),Fn=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M15 7.5h-5v10h5v-10Zm1.5 0v10H19a.5.5 0 0 0 .5-.5V8a.5.5 0 0 0-.5-.5h-2.5ZM6 7.5h2.5v10H6a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5ZM6 6h13a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2Z"})});function En(e){let t,{doc:o}=En;o||(o=document.implementation.createHTMLDocument(""),En.doc=o),o.body.innerHTML=e;for(const e of o.body.firstChild.classList)if(t=e.match(/^layout-column-(\d+)$/))return Number(t[1])-1}const On=[{attributes:{verticalAlignment:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>{if(!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor);const{customTextColor:o,customBackgroundColor:n,...a}=e;return{...a,style:t,isStackedOnMobile:!0}},save({attributes:e}){const{verticalAlignment:t,backgroundColor:o,customBackgroundColor:n,textColor:a,customTextColor:r}=e,i=(0,nt.getColorClassName)("background-color",o),s=(0,nt.getColorClassName)("color",a),l=ft({"has-background":o||n,"has-text-color":a||r,[i]:i,[s]:s,[`are-vertically-aligned-${t}`]:t}),c={backgroundColor:i?void 0:n,color:s?void 0:r};return(0,Je.jsx)("div",{className:l||void 0,style:c,children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})}},{attributes:{columns:{type:"number",default:2}},isEligible:(e,t)=>!!t.some((e=>/layout-column-\d+/.test(e.originalContent)))&&t.some((e=>void 0!==En(e.originalContent))),migrate(e,t){const o=t.reduce(((e,t)=>{const{originalContent:o}=t;let n=En(o);return void 0===n&&(n=0),e[n]||(e[n]=[]),e[n].push(t),e}),[]).map((e=>(0,Ke.createBlock)("core/column",{},e))),{columns:n,...a}=e;return[{...a,isStackedOnMobile:!0},o]},save({attributes:e}){const{columns:t}=e;return(0,Je.jsx)("div",{className:`has-${t}-columns`,children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})}},{attributes:{columns:{type:"number",default:2}},migrate(e,t){const{columns:o,...n}=e;return[e={...n,isStackedOnMobile:!0},t]},save({attributes:e}){const{verticalAlignment:t,columns:o}=e,n=ft(`has-${o}-columns`,{[`are-vertically-aligned-${t}`]:t});return(0,Je.jsx)("div",{className:n,children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})}}],$n=e=>{const t=parseFloat(e);return Number.isFinite(t)?parseFloat(t.toFixed(2)):void 0};function Gn(e,t){const{width:o=100/t}=e.attributes;return $n(o)}function Un(e,t,o=e.length){const n=function(e,t=e.length){return e.reduce(((e,o)=>e+Gn(o,t)),0)}(e,o);return Object.fromEntries(Object.entries(function(e,t=e.length){return e.reduce(((e,o)=>{const n=Gn(o,t);return Object.assign(e,{[o.clientId]:n})}),{})}(e,o)).map((([e,o])=>[e,$n(t*o/n)])))}function qn(e,t){return e.map((e=>({...e,attributes:{...e.attributes,width:`${t[e.clientId]}%`}})))}const Wn={name:"core/column"};function Zn({clientId:e,setAttributes:t,isStackedOnMobile:o}){const{count:n,canInsertColumnBlock:a,minCount:r}=(0,it.useSelect)((t=>{const{canInsertBlockType:o,canRemoveBlock:n,getBlockOrder:a}=t(nt.store),r=a(e),i=r.reduce(((e,t,o)=>(n(t)||e.push(o),e)),[]);return{count:r.length,canInsertColumnBlock:o("core/column",e),minCount:Math.max(...i)+1}}),[e]),{getBlocks:i}=(0,it.useSelect)(nt.store),{replaceInnerBlocks:s}=(0,it.useDispatch)(nt.store);function l(t,o){let n=i(e);const a=n.every((e=>{const t=e.attributes.width;return Number.isFinite(t?.endsWith?.("%")?parseFloat(t):t)}));const r=o>t;if(r&&a){const e=$n(100/o),a=o-t;n=[...qn(n,Un(n,100-e*a)),...Array.from({length:a}).map((()=>(0,Ke.createBlock)("core/column",{width:`${e}%`})))]}else if(r)n=[...n,...Array.from({length:o-t}).map((()=>(0,Ke.createBlock)("core/column")))];else if(o<t&&(n=n.slice(0,-(t-o)),a)){n=qn(n,Un(n,100))}s(e,n)}const c=mt();return(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{l(n,r),t({isStackedOnMobile:!0})},dropdownMenuProps:c,children:[a&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Columns"),isShownByDefault:!0,hasValue:()=>n,onDeselect:()=>l(n,r),children:(0,Je.jsxs)(tt.__experimentalVStack,{spacing:4,children:[(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Columns"),value:n,onChange:e=>l(n,Math.max(r,e)),min:Math.max(1,r),max:Math.max(6,n)}),n>6&&(0,Je.jsx)(tt.Notice,{status:"warning",isDismissible:!1,children:(0,ot.__)("This column count exceeds the recommended amount and may cause visual breakage.")})]})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Stack on mobile"),isShownByDefault:!0,hasValue:()=>!0!==o,onDeselect:()=>t({isStackedOnMobile:!0}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Stack on mobile"),checked:o,onChange:()=>t({isStackedOnMobile:!o})})})]})}function Qn({attributes:e,setAttributes:t,clientId:o}){const{isStackedOnMobile:n,verticalAlignment:a,templateLock:r}=e,i=(0,it.useRegistry)(),{getBlockOrder:s}=(0,it.useSelect)(nt.store),{updateBlockAttributes:l}=(0,it.useDispatch)(nt.store),c=ft({[`are-vertically-aligned-${a}`]:a,"is-not-stacked-on-mobile":!n}),u=(0,nt.useBlockProps)({className:c}),d=(0,nt.useInnerBlocksProps)(u,{defaultBlock:Wn,directInsert:!0,orientation:"horizontal",renderAppender:!1,templateLock:r});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(nt.BlockVerticalAlignmentToolbar,{onChange:function(e){const n=s(o);i.batch((()=>{t({verticalAlignment:e}),l(n,{verticalAlignment:e})}))},value:a})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(Zn,{clientId:o,setAttributes:t,isStackedOnMobile:n})}),(0,Je.jsx)("div",{...d})]})}function Kn({clientId:e,name:t,setAttributes:o}){const{blockType:n,defaultVariation:a,variations:r}=(0,it.useSelect)((e=>{const{getBlockVariations:o,getBlockType:n,getDefaultBlockVariation:a}=e(Ke.store);return{blockType:n(t),defaultVariation:a(t,"block"),variations:o(t,"block")}}),[t]),{replaceInnerBlocks:i}=(0,it.useDispatch)(nt.store),s=(0,nt.useBlockProps)();return(0,Je.jsx)("div",{...s,children:(0,Je.jsx)(nt.__experimentalBlockVariationPicker,{icon:n?.icon?.src,label:n?.title,variations:r,instructions:(0,ot.__)("Divide into columns. Select a layout:"),onSelect:(t=a)=>{t.attributes&&o(t.attributes),t.innerBlocks&&i(e,(0,Ke.createBlocksFromInnerBlocksTemplate)(t.innerBlocks),!0)},allowSkip:!0})})}const Yn=e=>{const{clientId:t}=e,o=(0,it.useSelect)((e=>e(nt.store).getBlocks(t).length>0),[t])?Qn:Kn;return(0,Je.jsx)(o,{...e})};const Jn=[{name:"one-column-full",title:(0,ot.__)("100"),description:(0,ot.__)("One column"),icon:(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column"]],scope:["block"]},{name:"two-columns-equal",title:(0,ot.__)("50 / 50"),description:(0,ot.__)("Two columns; equal split"),icon:(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z"})}),isDefault:!0,innerBlocks:[["core/column"],["core/column"]],scope:["block"]},{name:"two-columns-one-third-two-thirds",title:(0,ot.__)("33 / 66"),description:(0,ot.__)("Two columns; one-third, two-thirds split"),icon:(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M0 10a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm17 0a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column",{width:"33.33%"}],["core/column",{width:"66.66%"}]],scope:["block"]},{name:"two-columns-two-thirds-one-third",title:(0,ot.__)("66 / 33"),description:(0,ot.__)("Two columns; two-thirds, one-third split"),icon:(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M0 10a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm33 0a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35a2 2 0 0 1-2-2V10Z"})}),innerBlocks:[["core/column",{width:"66.66%"}],["core/column",{width:"33.33%"}]],scope:["block"]},{name:"three-columns-equal",title:(0,ot.__)("33 / 33 / 33"),description:(0,ot.__)("Three columns; equal split"),icon:(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M0 10a2 2 0 0 1 2-2h10.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm16.5 0c0-1.105.864-2 1.969-2H29.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H18.47c-1.105 0-1.969-.895-1.969-2V10Zm17 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35.469c-1.105 0-1.969-.895-1.969-2V10Z"})}),innerBlocks:[["core/column"],["core/column"],["core/column"]],scope:["block"]},{name:"three-columns-wider-center",title:(0,ot.__)("25 / 50 / 25"),description:(0,ot.__)("Three columns; wide center column"),icon:(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M0 10a2 2 0 0 1 2-2h7.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm13.5 0c0-1.105.864-2 1.969-2H32.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H15.47c-1.105 0-1.969-.895-1.969-2V10Zm23 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2h-7.531c-1.105 0-1.969-.895-1.969-2V10Z"})}),innerBlocks:[["core/column",{width:"25%"}],["core/column",{width:"50%"}],["core/column",{width:"25%"}]],scope:["block"]}],Xn={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert:e=>{const t=+(100/e.length).toFixed(2),o=e.map((({name:e,attributes:o,innerBlocks:n})=>["core/column",{width:`${t}%`},[[e,{...o},n]]]));return(0,Ke.createBlock)("core/columns",{},(0,Ke.createBlocksFromInnerBlocksTemplate)(o))},isMatch:({length:e},t)=>(1!==t.length||"core/columns"!==t[0].name)&&(e&&e<=6)},{type:"block",blocks:["core/media-text"],priority:1,transform:(e,t)=>{const{align:o,backgroundColor:n,textColor:a,style:r,mediaAlt:i,mediaId:s,mediaPosition:l,mediaSizeSlug:c,mediaType:u,mediaUrl:d,mediaWidth:p,verticalAlignment:m}=e;let g;if("image"!==u&&u)g=["core/video",{id:s,src:d}];else{g=["core/image",{...{id:s,alt:i,url:d,sizeSlug:c},...{href:e.href,linkClass:e.linkClass,linkDestination:e.linkDestination,linkTarget:e.linkTarget,rel:e.rel}}]}const h=[["core/column",{width:`${p}%`},[g]],["core/column",{width:100-p+"%"},t]];return"right"===l&&h.reverse(),(0,Ke.createBlock)("core/columns",{align:o,backgroundColor:n,textColor:a,style:r,verticalAlignment:m},(0,Ke.createBlocksFromInnerBlocksTemplate)(h))}}],ungroup:(e,t)=>t.flatMap((e=>e.innerBlocks))},ea=Xn,ta={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/columns",title:"Columns",category:"design",allowedBlocks:["core/column"],description:"Display content in multiple columns, with blocks added to each column.",textdomain:"default",attributes:{verticalAlignment:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},supports:{anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0,heading:!0,button:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{blockGap:{__experimentalDefault:"2em",sides:["horizontal","vertical"]},margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,allowEditing:!1,default:{type:"flex",flexWrap:"nowrap"}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},shadow:!0},editorStyle:"wp-block-columns-editor",style:"wp-block-columns"},{name:oa}=ta,na={icon:Fn,variations:Jn,example:{viewportWidth:782,innerBlocks:[{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,ot.__)("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.")}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg"}},{name:"core/paragraph",attributes:{content:(0,ot.__)("Suspendisse commodo neque lacus, a dictum orci interdum et.")}}]},{name:"core/column",innerBlocks:[{name:"core/paragraph",attributes:{content:(0,ot.__)("Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.")}},{name:"core/paragraph",attributes:{content:(0,ot.__)("Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.")}}]}]},deprecated:On,edit:Yn,save:function({attributes:e}){const{isStackedOnMobile:t,verticalAlignment:o}=e,n=ft({[`are-vertically-aligned-${o}`]:o,"is-not-stacked-on-mobile":!t}),a=nt.useBlockProps.save({className:n}),r=nt.useInnerBlocksProps.save(a);return(0,Je.jsx)("div",{...r})},transforms:ea},aa=()=>et({name:oa,metadata:ta,settings:na}),ra=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z"})}),ia=[{attributes:{tagName:{type:"string",default:"div"}},apiVersion:3,supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}}},save({attributes:{tagName:e}}){const t=nt.useBlockProps.save(),{className:o}=t,n=o?.split(" ")||[],a=n?.filter((e=>"wp-block-comments"!==e)),r={...t,className:a.join(" ")};return(0,Je.jsx)(e,{...r,children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})}}],sa={article:(0,ot.__)("The <article> element should represent a self-contained, syndicatable portion of the document."),aside:(0,ot.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."),div:(0,ot.__)("The <div> element should only be used if the block is a design element with no semantic meaning."),footer:(0,ot.__)("The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.)."),header:(0,ot.__)("The <header> element should represent introductory content, typically a group of introductory or navigational aids."),main:(0,ot.__)("The <main> element should be used for the primary content of your document only."),nav:(0,ot.__)("The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation."),section:(0,ot.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element.")};function la({attributes:{tagName:e},setAttributes:t}){return(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("HTML element"),options:[{label:(0,ot.__)("Default (<div>)"),value:"div"},{label:"<section>",value:"section"},{label:"<aside>",value:"aside"}],value:e,onChange:e=>t({tagName:e}),help:sa[e]})})})}const ca=()=>{const e=(0,ut.useInstanceId)(ca);return(0,Je.jsxs)("div",{className:"comment-respond",children:[(0,Je.jsx)("h3",{className:"comment-reply-title",children:(0,ot.__)("Leave a Reply")}),(0,Je.jsxs)("form",{noValidate:!0,className:"comment-form",onSubmit:e=>e.preventDefault(),children:[(0,Je.jsxs)("p",{children:[(0,Je.jsx)("label",{htmlFor:`comment-${e}`,children:(0,ot.__)("Comment")}),(0,Je.jsx)("textarea",{id:`comment-${e}`,name:"comment",cols:"45",rows:"8",readOnly:!0})]}),(0,Je.jsx)("p",{className:"form-submit wp-block-button",children:(0,Je.jsx)("input",{name:"submit",type:"submit",className:ft("wp-block-button__link",(0,nt.__experimentalGetElementClassName)("button")),label:(0,ot.__)("Post Comment"),value:(0,ot.__)("Post Comment"),"aria-disabled":"true"})})]})]})},ua=({postId:e,postType:t})=>{const[o,n]=(0,ct.useEntityProp)("postType",t,"comment_status",e),a=void 0===t||void 0===e,{defaultCommentStatus:r}=(0,it.useSelect)((e=>e(nt.store).getSettings().__experimentalDiscussionSettings)),i=(0,it.useSelect)((e=>!!t&&!!e(ct.store).getPostType(t)?.supports.comments));if(!a&&"open"!==o){if("closed"===o){const e=[(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,onClick:()=>n("open"),variant:"primary",children:(0,ot._x)("Enable comments","action that affects the current post")},"enableComments")];return(0,Je.jsx)(nt.Warning,{actions:e,children:(0,ot.__)("Post Comments Form block: Comments are not enabled for this item.")})}if(!i)return(0,Je.jsx)(nt.Warning,{children:(0,ot.sprintf)((0,ot.__)("Post Comments Form block: Comments are not enabled for this post type (%s)."),t)});if("open"!==r)return(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("Post Comments Form block: Comments are not enabled.")})}return(0,Je.jsx)(ca,{})};function da({postType:e,postId:t}){let[o]=(0,ct.useEntityProp)("postType",e,"title",t);o=o||(0,ot.__)("Post Title");const{avatarURL:n}=(0,it.useSelect)((e=>e(nt.store).getSettings().__experimentalDiscussionSettings));return(0,Je.jsxs)("div",{className:"wp-block-comments__legacy-placeholder",inert:"true",children:[(0,Je.jsx)("h3",{children:(0,ot.sprintf)((0,ot.__)("One response to %s"),o)}),(0,Je.jsxs)("div",{className:"navigation",children:[(0,Je.jsx)("div",{className:"alignleft",children:(0,Je.jsxs)("a",{href:"#top",children:["« ",(0,ot.__)("Older Comments")]})}),(0,Je.jsx)("div",{className:"alignright",children:(0,Je.jsxs)("a",{href:"#top",children:[(0,ot.__)("Newer Comments")," »"]})})]}),(0,Je.jsx)("ol",{className:"commentlist",children:(0,Je.jsx)("li",{className:"comment even thread-even depth-1",children:(0,Je.jsxs)("article",{className:"comment-body",children:[(0,Je.jsxs)("footer",{className:"comment-meta",children:[(0,Je.jsxs)("div",{className:"comment-author vcard",children:[(0,Je.jsx)("img",{alt:(0,ot.__)("Commenter Avatar"),src:n,className:"avatar avatar-32 photo",height:"32",width:"32",loading:"lazy"}),(0,Je.jsx)("b",{className:"fn",children:(0,Je.jsx)("a",{href:"#top",className:"url",children:(0,ot.__)("A WordPress Commenter")})})," ",(0,Je.jsxs)("span",{className:"says",children:[(0,ot.__)("says"),":"]})]}),(0,Je.jsxs)("div",{className:"comment-metadata",children:[(0,Je.jsx)("a",{href:"#top",children:(0,Je.jsx)("time",{dateTime:"2000-01-01T00:00:00+00:00",children:(0,ot.__)("January 1, 2000 at 00:00 am")})})," ",(0,Je.jsx)("span",{className:"edit-link",children:(0,Je.jsx)("a",{className:"comment-edit-link",href:"#top",children:(0,ot.__)("Edit")})})]})]}),(0,Je.jsx)("div",{className:"comment-content",children:(0,Je.jsxs)("p",{children:[(0,ot.__)("Hi, this is a comment."),(0,Je.jsx)("br",{}),(0,ot.__)("To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard."),(0,Je.jsx)("br",{}),(0,st.createInterpolateElement)((0,ot.__)("Commenter avatars come from <a>Gravatar</a>."),{a:(0,Je.jsx)("a",{href:"https://gravatar.com/"})})]})}),(0,Je.jsx)("div",{className:"reply",children:(0,Je.jsx)("a",{className:"comment-reply-link",href:"#top","aria-label":(0,ot.__)("Reply to A WordPress Commenter"),children:(0,ot.__)("Reply")})})]})})}),(0,Je.jsxs)("div",{className:"navigation",children:[(0,Je.jsx)("div",{className:"alignleft",children:(0,Je.jsxs)("a",{href:"#top",children:["« ",(0,ot.__)("Older Comments")]})}),(0,Je.jsx)("div",{className:"alignright",children:(0,Je.jsxs)("a",{href:"#top",children:[(0,ot.__)("Newer Comments")," »"]})})]}),(0,Je.jsx)(ua,{postId:t,postType:e})]})}function pa({attributes:e,setAttributes:t,context:{postType:o,postId:n}}){const{textAlign:a}=e,r=[(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,onClick:()=>{t({legacy:!1})},variant:"primary",children:(0,ot.__)("Switch to editable mode")},"convert")],i=(0,nt.useBlockProps)({className:ft({[`has-text-align-${a}`]:a})});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:a,onChange:e=>{t({textAlign:e})}})}),(0,Je.jsxs)("div",{...i,children:[(0,Je.jsx)(nt.Warning,{actions:r,children:(0,ot.__)("Comments block: You’re currently using the legacy version of the block. The following is just a placeholder - the final styling will likely look different. For a better representation and more customization options, switch the block to its editable mode.")}),(0,Je.jsx)(da,{postId:n,postType:o})]})]})}const ma=[["core/comments-title"],["core/comment-template",{},[["core/columns",{},[["core/column",{width:"40px"},[["core/avatar",{size:40,style:{border:{radius:"20px"}}}]]],["core/column",{},[["core/comment-author-name",{fontSize:"small"}],["core/group",{layout:{type:"flex"},style:{spacing:{margin:{top:"0px",bottom:"0px"}}}},[["core/comment-date",{fontSize:"small"}],["core/comment-edit-link",{fontSize:"small"}]]],["core/comment-content"],["core/comment-reply-link",{fontSize:"small"}]]]]]]],["core/comments-pagination"],["core/post-comments-form"]];const ga={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments",title:"Comments",category:"theme",description:"An advanced block that allows displaying post comments using different visual configurations.",textdomain:"default",attributes:{tagName:{type:"string",default:"div"},legacy:{type:"boolean",default:!1}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-comments-editor",usesContext:["postId","postType"]},{name:ha}=ga,xa={icon:ra,example:{},edit:function(e){const{attributes:t,setAttributes:o}=e,{tagName:n,legacy:a}=t,r=(0,nt.useBlockProps)(),i=(0,nt.useInnerBlocksProps)(r,{template:ma});return a?(0,Je.jsx)(pa,{...e}):(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(la,{attributes:t,setAttributes:o}),(0,Je.jsx)(n,{...i})]})},save:function({attributes:{tagName:e,legacy:t}}){const o=nt.useBlockProps.save(),n=nt.useInnerBlocksProps.save(o);return t?null:(0,Je.jsx)(e,{...n})},deprecated:ia},_a=()=>et({name:ha,metadata:ga,settings:xa});const ba={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/comment-author-avatar",title:"Comment Author Avatar (deprecated)",category:"theme",ancestor:["core/comment-template"],description:"This block is deprecated. Please use the Avatar block instead.",textdomain:"default",attributes:{width:{type:"number",default:96},height:{type:"number",default:96}},usesContext:["commentId"],supports:{html:!1,inserter:!1,__experimentalBorder:{radius:!0,width:!0,color:!0,style:!0},color:{background:!0,text:!1,__experimentalDefaultControls:{background:!0}},spacing:{__experimentalSkipSerialization:!0,margin:!0,padding:!0},interactivity:{clientNavigation:!0}}},{name:ya}=ba,fa={icon:bt,edit:function({attributes:e,context:{commentId:t},setAttributes:o,isSelected:n}){const{height:a,width:r}=e,[i]=(0,ct.useEntityProp)("root","comment","author_avatar_urls",t),[s]=(0,ct.useEntityProp)("root","comment","author_name",t),l=i?Object.values(i):null,c=i?Object.keys(i):null,u=c?c[0]:24,d=c?c[c.length-1]:96,p=(0,nt.useBlockProps)(),m=(0,nt.__experimentalGetSpacingClassesAndStyles)(e),g=Math.floor(2.5*d),{avatarURL:h}=(0,it.useSelect)((e=>{const{getSettings:t}=e(nt.store),{__experimentalDiscussionSettings:o}=t();return o})),x=(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Image size"),onChange:e=>o({width:e,height:e}),min:u,max:g,initialPosition:r,value:r})})}),_=(0,Je.jsx)(tt.ResizableBox,{size:{width:r,height:a},showHandle:n,onResizeStop:(e,t,n,i)=>{o({height:parseInt(a+i.height,10),width:parseInt(r+i.width,10)})},lockAspectRatio:!0,enable:{top:!1,right:!(0,ot.isRTL)(),bottom:!0,left:(0,ot.isRTL)()},minWidth:u,maxWidth:g,children:(0,Je.jsx)("img",{src:l?l[l.length-1]:h,alt:`${s} ${(0,ot.__)("Avatar")}`,...p})});return(0,Je.jsxs)(Je.Fragment,{children:[x,(0,Je.jsx)("div",{...m,children:_})]})}},va=()=>et({name:ya,metadata:ba,settings:fa}),ka=(0,Je.jsxs)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Je.jsx)(Ye.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z",fillRule:"evenodd",clipRule:"evenodd"}),(0,Je.jsx)(Ye.Path,{d:"M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15",fillRule:"evenodd",clipRule:"evenodd"}),(0,Je.jsx)(Ye.Circle,{cx:"12",cy:"9",r:"2",fillRule:"evenodd",clipRule:"evenodd"})]});const wa={attributes:{isLink:{type:"boolean",default:!1},linkTarget:{type:"string",default:"_self"}},supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:lo,isEligible:({style:e})=>e?.typography?.fontFamily},Ca=[wa],ja={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-author-name",title:"Comment Author Name",category:"theme",ancestor:["core/comment-template"],description:"Displays the name of the author of the comment.",textdomain:"default",attributes:{isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"},textAlign:{type:"string"}},usesContext:["commentId"],supports:{html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-comment-author-name"},{name:Sa}=ja,Ba={icon:ka,edit:function({attributes:{isLink:e,linkTarget:t,textAlign:o},context:{commentId:n},setAttributes:a}){const r=(0,nt.useBlockProps)({className:ft({[`has-text-align-${o}`]:o})});let i=(0,it.useSelect)((e=>{const{getEntityRecord:t}=e(ct.store),o=t("root","comment",n),a=o?.author_name;if(o&&!a){var r;const e=t("root","user",o.author);return null!==(r=e?.name)&&void 0!==r?r:(0,ot.__)("Anonymous")}return null!=a?a:""}),[n]);const s=(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:o,onChange:e=>a({textAlign:e})})}),l=(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link to authors URL"),onChange:()=>a({isLink:!e}),checked:e}),e&&(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open in new tab"),onChange:e=>a({linkTarget:e?"_blank":"_self"}),checked:"_blank"===t})]})});n&&i||(i=(0,ot._x)("Comment Author","block title"));const c=e?(0,Je.jsx)("a",{href:"#comment-author-pseudo-link",onClick:e=>e.preventDefault(),children:i}):i;return(0,Je.jsxs)(Je.Fragment,{children:[l,s,(0,Je.jsx)("div",{...r,children:c})]})},deprecated:Ca,example:{}},Ta=()=>et({name:Sa,metadata:ja,settings:Ba}),Na=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z"})});const Pa={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-content",title:"Comment Content",category:"theme",ancestor:["core/comment-template"],description:"Displays the contents of a comment.",textdomain:"default",usesContext:["commentId"],attributes:{textAlign:{type:"string"}},supports:{color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}},spacing:{padding:["horizontal","vertical"],__experimentalDefaultControls:{padding:!0}},html:!1},style:"wp-block-comment-content"},{name:Ia}=Pa,Ma={icon:Na,edit:function({setAttributes:e,attributes:{textAlign:t},context:{commentId:o}}){const n=(0,nt.useBlockProps)({className:ft({[`has-text-align-${t}`]:t})}),[a]=(0,ct.useEntityProp)("root","comment","content",o),r=(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:t,onChange:t=>e({textAlign:t})})});return o&&a?(0,Je.jsxs)(Je.Fragment,{children:[r,(0,Je.jsx)("div",{...n,children:(0,Je.jsx)(tt.Disabled,{children:(0,Je.jsx)(st.RawHTML,{children:a.rendered},"html")})})]}):(0,Je.jsxs)(Je.Fragment,{children:[r,(0,Je.jsx)("div",{...n,children:(0,Je.jsx)("p",{children:(0,ot._x)("Comment Content","block title")})})]})},example:{}},Da=()=>et({name:Ia,metadata:Pa,settings:Ma}),za=(0,Je.jsxs)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(Ye.Path,{d:"M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z"}),(0,Je.jsx)(Ye.Path,{d:"M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z"})]}),Aa=window.wp.date;const Ra={attributes:{format:{type:"string"},isLink:{type:"boolean",default:!1}},supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:lo,isEligible:({style:e})=>e?.typography?.fontFamily},Ha=[Ra],La={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-date",title:"Comment Date",category:"theme",ancestor:["core/comment-template"],description:"Displays the date on which the comment was posted.",textdomain:"default",attributes:{format:{type:"string"},isLink:{type:"boolean",default:!0}},usesContext:["commentId"],supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-comment-date"},{name:Va}=La,Fa={icon:za,edit:function({attributes:{format:e,isLink:t},context:{commentId:o},setAttributes:n}){const a=(0,nt.useBlockProps)();let[r]=(0,ct.useEntityProp)("root","comment","date",o);const[i=(0,Aa.getSettings)().formats.date]=(0,ct.useEntityProp)("root","site","date_format"),s=(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[(0,Je.jsx)(nt.__experimentalDateFormatPicker,{format:e,defaultFormat:i,onChange:e=>n({format:e})}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link to comment"),onChange:()=>n({isLink:!t}),checked:t})]})});o&&r||(r=(0,ot._x)("Comment Date","block title"));let l=r instanceof Date?(0,Je.jsx)("time",{dateTime:(0,Aa.dateI18n)("c",r),children:"human-diff"===e?(0,Aa.humanTimeDiff)(r):(0,Aa.dateI18n)(e||i,r)}):(0,Je.jsx)("time",{children:r});return t&&(l=(0,Je.jsx)("a",{href:"#comment-date-pseudo-link",onClick:e=>e.preventDefault(),children:l})),(0,Je.jsxs)(Je.Fragment,{children:[s,(0,Je.jsx)("div",{...a,children:l})]})},deprecated:Ha,example:{}},Ea=()=>et({name:Va,metadata:La,settings:Fa}),Oa=(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"m6.249 11.065.44-.44h3.186l-1.5 1.5H7.31l-1.957 1.96A.792.792 0 0 1 4 13.524V5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1.5L12.5 8V5.5h-7v6.315l.749-.75ZM20 19.75H7v-1.5h13v1.5Zm0-12.653-8.967 9.064L8 17l.867-2.935L17.833 5 20 7.097Z"})});const $a={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-edit-link",title:"Comment Edit Link",category:"theme",ancestor:["core/comment-template"],description:"Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.",textdomain:"default",usesContext:["commentId"],attributes:{linkTarget:{type:"string",default:"_self"},textAlign:{type:"string"}},supports:{html:!1,color:{link:!0,gradients:!0,text:!1,__experimentalDefaultControls:{background:!0,link:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},style:"wp-block-comment-edit-link"},{name:Ga}=$a,Ua={icon:Oa,edit:function({attributes:{linkTarget:e,textAlign:t},setAttributes:o}){const n=(0,nt.useBlockProps)({className:ft({[`has-text-align-${t}`]:t})}),a=(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:t,onChange:e=>o({textAlign:e})})}),r=(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open in new tab"),onChange:e=>o({linkTarget:e?"_blank":"_self"}),checked:"_blank"===e})})});return(0,Je.jsxs)(Je.Fragment,{children:[a,r,(0,Je.jsx)("div",{...n,children:(0,Je.jsx)("a",{href:"#edit-comment-pseudo-link",onClick:e=>e.preventDefault(),children:(0,ot.__)("Edit")})})]})},example:{}},qa=()=>et({name:Ga,metadata:$a,settings:Ua}),Wa=(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z"})});const Za=function({setAttributes:e,attributes:{textAlign:t}}){const o=(0,nt.useBlockProps)({className:ft({[`has-text-align-${t}`]:t})}),n=(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:t,onChange:t=>e({textAlign:t})})});return(0,Je.jsxs)(Je.Fragment,{children:[n,(0,Je.jsx)("div",{...o,children:(0,Je.jsx)("a",{href:"#comment-reply-pseudo-link",onClick:e=>e.preventDefault(),children:(0,ot.__)("Reply")})})]})},Qa={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-reply-link",title:"Comment Reply Link",category:"theme",ancestor:["core/comment-template"],description:"Displays a link to reply to a comment.",textdomain:"default",usesContext:["commentId"],attributes:{textAlign:{type:"string"}},supports:{color:{gradients:!0,link:!0,text:!1,__experimentalDefaultControls:{background:!0,link:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},html:!1},style:"wp-block-comment-reply-link"},{name:Ka}=Qa,Ya={edit:Za,icon:Wa,example:{}},Ja=()=>et({name:Ka,metadata:Qa,settings:Ya}),Xa=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),er=window.wp.apiFetch;var tr=o.n(er);const or=({defaultPage:e,postId:t,perPage:o,queryArgs:n})=>{const[a,r]=(0,st.useState)({}),i=`${t}_${o}`,s=a[i]||0;return(0,st.useEffect)((()=>{s||"newest"!==e||tr()({path:(0,vt.addQueryArgs)("/wp/v2/comments",{...n,post:t,per_page:o,_fields:"id"}),method:"HEAD",parse:!1}).then((e=>{const t=parseInt(e.headers.get("X-WP-TotalPages"));r({...a,[i]:t<=1?1:t})}))}),[e,t,o,r]),"newest"===e?s:1},nr=[["core/avatar"],["core/comment-author-name"],["core/comment-date"],["core/comment-content"],["core/comment-reply-link"],["core/comment-edit-link"]];function ar({comment:e,activeCommentId:t,setActiveCommentId:o,firstCommentId:n,blocks:a}){const{children:r,...i}=(0,nt.useInnerBlocksProps)({},{template:nr});return(0,Je.jsxs)("li",{...i,children:[e.commentId===(t||n)?r:null,(0,Je.jsx)(rr,{blocks:a,commentId:e.commentId,setActiveCommentId:o,isHidden:e.commentId===(t||n)}),e?.children?.length>0?(0,Je.jsx)(ir,{comments:e.children,activeCommentId:t,setActiveCommentId:o,blocks:a,firstCommentId:n}):null]})}const rr=(0,st.memo)((({blocks:e,commentId:t,setActiveCommentId:o,isHidden:n})=>{const a=(0,nt.__experimentalUseBlockPreview)({blocks:e}),r=()=>{o(t)},i={display:n?"none":void 0};return(0,Je.jsx)("div",{...a,tabIndex:0,role:"button",style:i,onClick:r,onKeyPress:r})})),ir=({comments:e,blockProps:t,activeCommentId:o,setActiveCommentId:n,blocks:a,firstCommentId:r})=>(0,Je.jsx)("ol",{...t,children:e&&e.map((({commentId:e,...t},i)=>(0,Je.jsx)(nt.BlockContextProvider,{value:{commentId:e<0?null:e},children:(0,Je.jsx)(ar,{comment:{commentId:e,...t},activeCommentId:o,setActiveCommentId:n,blocks:a,firstCommentId:r})},t.commentId||i)))});const sr={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comment-template",title:"Comment Template",category:"design",parent:["core/comments"],description:"Contains the block elements used to display a comment, like the title, date, author, avatar and more.",textdomain:"default",usesContext:["postId"],supports:{align:!0,html:!1,reusable:!1,spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-comment-template"},{name:lr}=sr,cr={icon:Xa,edit:function({clientId:e,context:{postId:t}}){const o=(0,nt.useBlockProps)(),[n,a]=(0,st.useState)(),{commentOrder:r,threadCommentsDepth:i,threadComments:s,commentsPerPage:l,pageComments:c}=(0,it.useSelect)((e=>{const{getSettings:t}=e(nt.store);return t().__experimentalDiscussionSettings})),u=(({postId:e})=>{const t={status:"approve",order:"asc",context:"embed",parent:0,_embed:"children"},{pageComments:o,commentsPerPage:n,defaultCommentsPage:a}=(0,it.useSelect)((e=>{const{getSettings:t}=e(nt.store),{__experimentalDiscussionSettings:o}=t();return o})),r=o?Math.min(n,100):100,i=or({defaultPage:a,postId:e,perPage:r,queryArgs:t});return(0,st.useMemo)((()=>i?{...t,post:e,per_page:r,page:i}:null),[e,r,i])})({postId:t}),{topLevelComments:d,blocks:p}=(0,it.useSelect)((t=>{const{getEntityRecords:o}=t(ct.store),{getBlocks:n}=t(nt.store);return{topLevelComments:u?o("root","comment",u):null,blocks:n(e)}}),[e,u]);let m=(e=>(0,st.useMemo)((()=>e?.map((({id:e,_embedded:t})=>{const[o]=t?.children||[[]];return{commentId:e,children:o.map((e=>({commentId:e.id})))}}))),[e]))("desc"===r&&d?[...d].reverse():d);return d?(t||(m=(({perPage:e,pageComments:t,threadComments:o,threadCommentsDepth:n})=>{const a=o?Math.min(n,3):1,r=e=>e<a?[{commentId:-(e+3),children:r(e+1)}]:[],i=[{commentId:-1,children:r(1)}];return(!t||e>=2)&&a<3&&i.push({commentId:-2,children:[]}),(!t||e>=3)&&a<2&&i.push({commentId:-3,children:[]}),i})({perPage:l,pageComments:c,threadComments:s,threadCommentsDepth:i})),m.length?(0,Je.jsx)(ir,{comments:m,blockProps:o,blocks:p,activeCommentId:n,setActiveCommentId:a,firstCommentId:m[0]?.commentId}):(0,Je.jsx)("p",{...o,children:(0,ot.__)("No results found.")})):(0,Je.jsx)("p",{...o,children:(0,Je.jsx)(tt.Spinner,{})})},save:function(){return(0,Je.jsx)(nt.InnerBlocks.Content,{})}},ur=()=>et({name:lr,metadata:sr,settings:cr}),dr=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z"})}),pr={none:"",arrow:"←",chevron:"«"};const mr={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments-pagination-previous",title:"Comments Previous Page",category:"theme",parent:["core/comments-pagination"],description:"Displays the previous comment's page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["postId","comments/paginationArrow"],supports:{reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:gr}=mr,hr={icon:dr,edit:function({attributes:{label:e},setAttributes:t,context:{"comments/paginationArrow":o}}){const n=pr[o];return(0,Je.jsxs)("a",{href:"#comments-pagination-previous-pseudo-link",onClick:e=>e.preventDefault(),...(0,nt.useBlockProps)(),children:[n&&(0,Je.jsx)("span",{className:`wp-block-comments-pagination-previous-arrow is-arrow-${o}`,children:n}),(0,Je.jsx)(nt.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":(0,ot.__)("Older comments page link"),placeholder:(0,ot.__)("Older Comments"),value:e,onChange:e=>t({label:e})})]})},example:{attributes:{label:(0,ot.__)("Older Comments")}}},xr=()=>et({name:gr,metadata:mr,settings:hr}),_r=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z"})});function br({value:e,onChange:t}){return(0,Je.jsxs)(tt.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Arrow"),value:e,onChange:t,help:(0,ot.__)("A decorative arrow appended to the next and previous comments link."),isBlock:!0,children:[(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"none",label:(0,ot._x)("None","Arrow option for Comments Pagination Next/Previous blocks")}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"arrow",label:(0,ot._x)("Arrow","Arrow option for Comments Pagination Next/Previous blocks")}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"chevron",label:(0,ot._x)("Chevron","Arrow option for Comments Pagination Next/Previous blocks")})]})}const yr=[["core/comments-pagination-previous"],["core/comments-pagination-numbers"],["core/comments-pagination-next"]];const fr={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments-pagination",title:"Comments Pagination",category:"theme",parent:["core/comments"],allowedBlocks:["core/comments-pagination-previous","core/comments-pagination-numbers","core/comments-pagination-next"],description:"Displays a paginated navigation to next/previous set of comments, when applicable.",textdomain:"default",attributes:{paginationArrow:{type:"string",default:"none"}},example:{attributes:{paginationArrow:"none"}},providesContext:{"comments/paginationArrow":"paginationArrow"},supports:{align:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-comments-pagination-editor",style:"wp-block-comments-pagination"},{name:vr}=fr,kr={icon:_r,edit:function({attributes:{paginationArrow:e},setAttributes:t,clientId:o}){const n=(0,it.useSelect)((e=>{const{getBlocks:t}=e(nt.store),n=t(o);return n?.find((e=>["core/comments-pagination-previous","core/comments-pagination-next"].includes(e.name)))}),[]),a=(0,nt.useBlockProps)(),r=(0,nt.useInnerBlocksProps)(a,{template:yr});return(0,it.useSelect)((e=>{const{getSettings:t}=e(nt.store),{__experimentalDiscussionSettings:o}=t();return o?.pageComments}),[])?(0,Je.jsxs)(Je.Fragment,{children:[n&&(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:(0,Je.jsx)(br,{value:e,onChange:e=>{t({paginationArrow:e})}})})}),(0,Je.jsx)("div",{...r})]}):(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("Comments Pagination block: paging comments is disabled in the Discussion Settings")})},save:function(){return(0,Je.jsx)(nt.InnerBlocks.Content,{})}},wr=()=>et({name:vr,metadata:fr,settings:kr}),Cr=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z"})}),jr={none:"",arrow:"→",chevron:"»"};const Sr={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments-pagination-next",title:"Comments Next Page",category:"theme",parent:["core/comments-pagination"],description:"Displays the next comment's page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["postId","comments/paginationArrow"],supports:{reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:Br}=Sr,Tr={icon:Cr,edit:function({attributes:{label:e},setAttributes:t,context:{"comments/paginationArrow":o}}){const n=jr[o];return(0,Je.jsxs)("a",{href:"#comments-pagination-next-pseudo-link",onClick:e=>e.preventDefault(),...(0,nt.useBlockProps)(),children:[(0,Je.jsx)(nt.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":(0,ot.__)("Newer comments page link"),placeholder:(0,ot.__)("Newer Comments"),value:e,onChange:e=>t({label:e})}),n&&(0,Je.jsx)("span",{className:`wp-block-comments-pagination-next-arrow is-arrow-${o}`,children:n})]})},example:{attributes:{label:(0,ot.__)("Newer Comments")}}},Nr=()=>et({name:Br,metadata:Sr,settings:Tr}),Pr=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z"})}),Ir=({content:e,tag:t="a",extraClass:o=""})=>"a"===t?(0,Je.jsx)(t,{className:`page-numbers ${o}`,href:"#comments-pagination-numbers-pseudo-link",onClick:e=>e.preventDefault(),children:e}):(0,Je.jsx)(t,{className:`page-numbers ${o}`,children:e});const Mr={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments-pagination-numbers",title:"Comments Page Numbers",category:"theme",parent:["core/comments-pagination"],description:"Displays a list of page numbers for comments pagination.",textdomain:"default",usesContext:["postId"],supports:{reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:Dr}=Mr,zr={icon:Pr,edit:function(){return(0,Je.jsxs)("div",{...(0,nt.useBlockProps)(),children:[(0,Je.jsx)(Ir,{content:"1"}),(0,Je.jsx)(Ir,{content:"2"}),(0,Je.jsx)(Ir,{content:"3",tag:"span",extraClass:"current"}),(0,Je.jsx)(Ir,{content:"4"}),(0,Je.jsx)(Ir,{content:"5"}),(0,Je.jsx)(Ir,{content:"...",tag:"span",extraClass:"dots"}),(0,Je.jsx)(Ir,{content:"8"})]})},example:{}},Ar=()=>et({name:Dr,metadata:Mr,settings:zr}),Rr=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"m4 5.5h2v6.5h1.5v-6.5h2v-1.5h-5.5zm16 10.5h-16v-1.5h16zm-7 4h-9v-1.5h9z"})});const{attributes:Hr,supports:Lr}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments-title",title:"Comments Title",category:"theme",ancestor:["core/comments"],description:"Displays a title with the number of comments.",textdomain:"default",usesContext:["postId","postType"],attributes:{textAlign:{type:"string"},showPostTitle:{type:"boolean",default:!0},showCommentsCount:{type:"boolean",default:!0},level:{type:"number",default:2},levelOptions:{type:"array"}},supports:{anchor:!1,align:!0,html:!1,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0}},interactivity:{clientNavigation:!0}}},Vr=[{attributes:{...Hr,singleCommentLabel:{type:"string"},multipleCommentsLabel:{type:"string"}},supports:Lr,migrate:e=>{const{singleCommentLabel:t,multipleCommentsLabel:o,...n}=e;return n},isEligible:({multipleCommentsLabel:e,singleCommentLabel:t})=>e||t,save:()=>null}],Fr={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/comments-title",title:"Comments Title",category:"theme",ancestor:["core/comments"],description:"Displays a title with the number of comments.",textdomain:"default",usesContext:["postId","postType"],attributes:{textAlign:{type:"string"},showPostTitle:{type:"boolean",default:!0},showCommentsCount:{type:"boolean",default:!0},level:{type:"number",default:2},levelOptions:{type:"array"}},supports:{anchor:!1,align:!0,html:!1,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0}},interactivity:{clientNavigation:!0}}},{name:Er}=Fr,Or={icon:Rr,edit:function({attributes:{textAlign:e,showPostTitle:t,showCommentsCount:o,level:n,levelOptions:a},setAttributes:r,context:{postType:i,postId:s}}){const l="h"+n,[c,u]=(0,st.useState)(),[d]=(0,ct.useEntityProp)("postType",i,"title",s),p=void 0===s,m=(0,nt.useBlockProps)({className:ft({[`has-text-align-${e}`]:e})}),{threadCommentsDepth:g,threadComments:h,commentsPerPage:x,pageComments:_}=(0,it.useSelect)((e=>{const{getSettings:t}=e(nt.store);return t().__experimentalDiscussionSettings}));(0,st.useEffect)((()=>{if(p){const e=h?Math.min(g,3)-1:0,t=_?x:3,o=parseInt(e)+parseInt(t);return void u(Math.min(o,3))}const e=s;tr()({path:(0,vt.addQueryArgs)("/wp/v2/comments",{post:s,_fields:"id"}),method:"HEAD",parse:!1}).then((t=>{e===s&&u(parseInt(t.headers.get("X-WP-Total")))})).catch((()=>{u(0)}))}),[s]);const b=(0,Je.jsxs)(nt.BlockControls,{group:"block",children:[(0,Je.jsx)(nt.AlignmentControl,{value:e,onChange:e=>r({textAlign:e})}),(0,Je.jsx)(nt.HeadingLevelDropdown,{value:n,options:a,onChange:e=>r({level:e})})]}),y=(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show post title"),checked:t,onChange:e=>r({showPostTitle:e})}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show comments count"),checked:o,onChange:e=>r({showCommentsCount:e})})]})}),f=p?(0,ot.__)("“Post Title”"):`"${d}"`;let v;return v=o&&void 0!==c?t?1===c?(0,ot.sprintf)((0,ot.__)("One response to %s"),f):(0,ot.sprintf)((0,ot._n)("%1$s response to %2$s","%1$s responses to %2$s",c),c,f):1===c?(0,ot.__)("One response"):(0,ot.sprintf)((0,ot._n)("%s response","%s responses",c),c):t?1===c?(0,ot.sprintf)((0,ot.__)("Response to %s"),f):(0,ot.sprintf)((0,ot.__)("Responses to %s"),f):1===c?(0,ot.__)("Response"):(0,ot.__)("Responses"),(0,Je.jsxs)(Je.Fragment,{children:[b,y,(0,Je.jsx)(l,{...m,children:v})]})},deprecated:Vr,example:{}},$r=()=>et({name:Er,metadata:Fr,settings:Or}),Gr=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z"})}),Ur={"top left":"is-position-top-left","top center":"is-position-top-center","top right":"is-position-top-right","center left":"is-position-center-left","center center":"is-position-center-center",center:"is-position-center-center","center right":"is-position-center-right","bottom left":"is-position-bottom-left","bottom center":"is-position-bottom-center","bottom right":"is-position-bottom-right"},qr="image",Wr="video",Zr={x:.5,y:.5},Qr=["image","video"];function Kr({x:e,y:t}=Zr){return`${Math.round(100*e)}% ${Math.round(100*t)}%`}function Yr(e){return 50===e||void 0===e?null:"has-background-dim-"+10*Math.round(e/10)}function Jr(e){return!e||"center center"===e||"center"===e}function Xr(e){return Jr(e)?"":Ur[e]}function ei(e){return e?{backgroundImage:`url(${e})`}:{}}function ti(e){return 0!==e&&50!==e&&e?"has-background-dim-"+10*Math.round(e/10):null}function oi(e){return{...e,dimRatio:e.url?e.dimRatio:100}}function ni(e){return e.tagName||(e={...e,tagName:"div"}),{...e}}const ai={url:{type:"string"},id:{type:"number"},hasParallax:{type:"boolean",default:!1},dimRatio:{type:"number",default:50},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"}},ri={url:{type:"string"},id:{type:"number"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},hasParallax:{type:"boolean",default:!1},isRepeated:{type:"boolean",default:!1},dimRatio:{type:"number",default:100},overlayColor:{type:"string"},customOverlayColor:{type:"string"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"},isDark:{type:"boolean",default:!0},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},ii={...ri,useFeaturedImage:{type:"boolean",default:!1},tagName:{type:"string",default:"div"}},si={...ii,isUserOverlayColor:{type:"boolean"},sizeSlug:{type:"string"},alt:{type:"string",default:""}},li={anchor:!0,align:!0,html:!1,spacing:{padding:!0,__experimentalDefaultControls:{padding:!0}},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",text:!1,background:!1}},ci={...li,spacing:{padding:!0,margin:["top","bottom"],blockGap:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",heading:!0,text:!0,background:!1,__experimentalSkipSerialization:["gradients"],enableContrastChecker:!1},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:{allowJustification:!1}},ui={attributes:si,supports:{...ci,shadow:!0,dimensions:{aspectRatio:!0},interactivity:{clientNavigation:!0}},save({attributes:e}){const{backgroundType:t,gradient:o,contentPosition:n,customGradient:a,customOverlayColor:r,dimRatio:i,focalPoint:s,useFeaturedImage:l,hasParallax:c,isDark:u,isRepeated:d,overlayColor:p,url:m,alt:g,id:h,minHeight:x,minHeightUnit:_,tagName:b,sizeSlug:y}=e,f=(0,nt.getColorClassName)("background-color",p),v=(0,nt.__experimentalGetGradientClass)(o),k=qr===t,w=Wr===t,C=!(c||d),j={minHeight:(x&&_?`${x}${_}`:x)||void 0},S={backgroundColor:f?void 0:r,background:a||void 0},B=s&&C?Kr(s):void 0,T=m?`url(${m})`:void 0,N=Kr(s),P=ft({"is-light":!u,"has-parallax":c,"is-repeated":d,"has-custom-content-position":!Jr(n)},Xr(n)),I=ft("wp-block-cover__image-background",h?`wp-image-${h}`:null,{[`size-${y}`]:y,"has-parallax":c,"is-repeated":d}),M=o||a;return(0,Je.jsxs)(b,{...nt.useBlockProps.save({className:P,style:j}),children:[(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__background",f,Yr(i),{"has-background-dim":void 0!==i,"wp-block-cover__gradient-background":m&&M&&0!==i,"has-background-gradient":M,[v]:v}),style:S}),!l&&k&&m&&(C?(0,Je.jsx)("img",{className:I,alt:g,src:m,style:{objectPosition:B},"data-object-fit":"cover","data-object-position":B}):(0,Je.jsx)("div",{role:g?"img":void 0,"aria-label":g||void 0,className:I,style:{backgroundPosition:N,backgroundImage:T}})),w&&m&&(0,Je.jsx)("video",{className:ft("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:m,style:{objectPosition:B},"data-object-fit":"cover","data-object-position":B}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})}},di={attributes:ii,supports:ci,save({attributes:e}){const{backgroundType:t,gradient:o,contentPosition:n,customGradient:a,customOverlayColor:r,dimRatio:i,focalPoint:s,useFeaturedImage:l,hasParallax:c,isDark:u,isRepeated:d,overlayColor:p,url:m,alt:g,id:h,minHeight:x,minHeightUnit:_,tagName:b}=e,y=(0,nt.getColorClassName)("background-color",p),f=(0,nt.__experimentalGetGradientClass)(o),v=qr===t,k=Wr===t,w=!(c||d),C={minHeight:(x&&_?`${x}${_}`:x)||void 0},j={backgroundColor:y?void 0:r,background:a||void 0},S=s&&w?Kr(s):void 0,B=m?`url(${m})`:void 0,T=Kr(s),N=ft({"is-light":!u,"has-parallax":c,"is-repeated":d,"has-custom-content-position":!Jr(n)},Xr(n)),P=ft("wp-block-cover__image-background",h?`wp-image-${h}`:null,{"has-parallax":c,"is-repeated":d}),I=o||a;return(0,Je.jsxs)(b,{...nt.useBlockProps.save({className:N,style:C}),children:[(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__background",y,Yr(i),{"has-background-dim":void 0!==i,"wp-block-cover__gradient-background":m&&I&&0!==i,"has-background-gradient":I,[f]:f}),style:j}),!l&&v&&m&&(w?(0,Je.jsx)("img",{className:P,alt:g,src:m,style:{objectPosition:S},"data-object-fit":"cover","data-object-position":S}):(0,Je.jsx)("div",{role:"img",className:P,style:{backgroundPosition:T,backgroundImage:B}})),k&&m&&(0,Je.jsx)("video",{className:ft("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:m,style:{objectPosition:S},"data-object-fit":"cover","data-object-position":S}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})}},pi={attributes:ii,supports:ci,isEligible:e=>(void 0!==e.customOverlayColor||void 0!==e.overlayColor)&&void 0===e.isUserOverlayColor,migrate:e=>({...e,isUserOverlayColor:!0}),save({attributes:e}){const{backgroundType:t,gradient:o,contentPosition:n,customGradient:a,customOverlayColor:r,dimRatio:i,focalPoint:s,useFeaturedImage:l,hasParallax:c,isDark:u,isRepeated:d,overlayColor:p,url:m,alt:g,id:h,minHeight:x,minHeightUnit:_,tagName:b}=e,y=(0,nt.getColorClassName)("background-color",p),f=(0,nt.__experimentalGetGradientClass)(o),v=qr===t,k=Wr===t,w=!(c||d),C={minHeight:(x&&_?`${x}${_}`:x)||void 0},j={backgroundColor:y?void 0:r,background:a||void 0},S=s&&w?Kr(s):void 0,B=m?`url(${m})`:void 0,T=Kr(s),N=ft({"is-light":!u,"has-parallax":c,"is-repeated":d,"has-custom-content-position":!Jr(n)},Xr(n)),P=ft("wp-block-cover__image-background",h?`wp-image-${h}`:null,{"has-parallax":c,"is-repeated":d}),I=o||a;return(0,Je.jsxs)(b,{...nt.useBlockProps.save({className:N,style:C}),children:[(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__background",y,Yr(i),{"has-background-dim":void 0!==i,"wp-block-cover__gradient-background":m&&I&&0!==i,"has-background-gradient":I,[f]:f}),style:j}),!l&&v&&m&&(w?(0,Je.jsx)("img",{className:P,alt:g,src:m,style:{objectPosition:S},"data-object-fit":"cover","data-object-position":S}):(0,Je.jsx)("div",{role:"img",className:P,style:{backgroundPosition:T,backgroundImage:B}})),k&&m&&(0,Je.jsx)("video",{className:ft("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:m,style:{objectPosition:S},"data-object-fit":"cover","data-object-position":S}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})}},mi={attributes:ri,supports:li,save({attributes:e}){const{backgroundType:t,gradient:o,contentPosition:n,customGradient:a,customOverlayColor:r,dimRatio:i,focalPoint:s,useFeaturedImage:l,hasParallax:c,isDark:u,isRepeated:d,overlayColor:p,url:m,alt:g,id:h,minHeight:x,minHeightUnit:_}=e,b=(0,nt.getColorClassName)("background-color",p),y=(0,nt.__experimentalGetGradientClass)(o),f=qr===t,v=Wr===t,k=!(c||d),w={minHeight:(x&&_?`${x}${_}`:x)||void 0},C={backgroundColor:b?void 0:r,background:a||void 0},j=s&&k?Kr(s):void 0,S=m?`url(${m})`:void 0,B=Kr(s),T=ft({"is-light":!u,"has-parallax":c,"is-repeated":d,"has-custom-content-position":!Jr(n)},Xr(n)),N=ft("wp-block-cover__image-background",h?`wp-image-${h}`:null,{"has-parallax":c,"is-repeated":d}),P=o||a;return(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:T,style:w}),children:[(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__background",b,Yr(i),{"has-background-dim":void 0!==i,"wp-block-cover__gradient-background":m&&P&&0!==i,"has-background-gradient":P,[y]:y}),style:C}),!l&&f&&m&&(k?(0,Je.jsx)("img",{className:N,alt:g,src:m,style:{objectPosition:j},"data-object-fit":"cover","data-object-position":j}):(0,Je.jsx)("div",{role:"img",className:N,style:{backgroundPosition:B,backgroundImage:S}})),v&&m&&(0,Je.jsx)("video",{className:ft("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:m,style:{objectPosition:j},"data-object-fit":"cover","data-object-position":j}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})},migrate:ni},gi={attributes:ri,supports:li,save({attributes:e}){const{backgroundType:t,gradient:o,contentPosition:n,customGradient:a,customOverlayColor:r,dimRatio:i,focalPoint:s,useFeaturedImage:l,hasParallax:c,isDark:u,isRepeated:d,overlayColor:p,url:m,alt:g,id:h,minHeight:x,minHeightUnit:_}=e,b=(0,nt.getColorClassName)("background-color",p),y=(0,nt.__experimentalGetGradientClass)(o),f=x&&_?`${x}${_}`:x,v=qr===t,k=Wr===t,w=!(c||d),C={...!v||w||l?{}:ei(m),minHeight:f||void 0},j={backgroundColor:b?void 0:r,background:a||void 0},S=s&&w?`${Math.round(100*s.x)}% ${Math.round(100*s.y)}%`:void 0,B=ft({"is-light":!u,"has-parallax":c,"is-repeated":d,"has-custom-content-position":!Jr(n)},Xr(n)),T=o||a;return(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:B,style:C}),children:[(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__background",b,Yr(i),{"has-background-dim":void 0!==i,"wp-block-cover__gradient-background":m&&T&&0!==i,"has-background-gradient":T,[y]:y}),style:j}),!l&&v&&w&&m&&(0,Je.jsx)("img",{className:ft("wp-block-cover__image-background",h?`wp-image-${h}`:null),alt:g,src:m,style:{objectPosition:S},"data-object-fit":"cover","data-object-position":S}),k&&m&&(0,Je.jsx)("video",{className:ft("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:m,style:{objectPosition:S},"data-object-fit":"cover","data-object-position":S}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})},migrate:ni},hi={attributes:ri,supports:li,save({attributes:e}){const{backgroundType:t,gradient:o,contentPosition:n,customGradient:a,customOverlayColor:r,dimRatio:i,focalPoint:s,hasParallax:l,isDark:c,isRepeated:u,overlayColor:d,url:p,alt:m,id:g,minHeight:h,minHeightUnit:x}=e,_=(0,nt.getColorClassName)("background-color",d),b=(0,nt.__experimentalGetGradientClass)(o),y=x?`${h}${x}`:h,f=qr===t,v=Wr===t,k=!(l||u),w={...f&&!k?ei(p):{},minHeight:y||void 0},C={backgroundColor:_?void 0:r,background:a||void 0},j=s&&k?`${Math.round(100*s.x)}% ${Math.round(100*s.y)}%`:void 0,S=ft({"is-light":!c,"has-parallax":l,"is-repeated":u,"has-custom-content-position":!Jr(n)},Xr(n)),B=o||a;return(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:S,style:w}),children:[(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__background",_,Yr(i),{"has-background-dim":void 0!==i,"wp-block-cover__gradient-background":p&&B&&0!==i,"has-background-gradient":B,[b]:b}),style:C}),f&&k&&p&&(0,Je.jsx)("img",{className:ft("wp-block-cover__image-background",g?`wp-image-${g}`:null),alt:m,src:p,style:{objectPosition:j},"data-object-fit":"cover","data-object-position":j}),v&&p&&(0,Je.jsx)("video",{className:ft("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:p,style:{objectPosition:j},"data-object-fit":"cover","data-object-position":j}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})},migrate:ni},xi={attributes:ri,supports:li,save({attributes:e}){const{backgroundType:t,gradient:o,contentPosition:n,customGradient:a,customOverlayColor:r,dimRatio:i,focalPoint:s,hasParallax:l,isDark:c,isRepeated:u,overlayColor:d,url:p,alt:m,id:g,minHeight:h,minHeightUnit:x}=e,_=(0,nt.getColorClassName)("background-color",d),b=(0,nt.__experimentalGetGradientClass)(o),y=x?`${h}${x}`:h,f=qr===t,v=Wr===t,k=!(l||u),w={...f&&!k?ei(p):{},minHeight:y||void 0},C={backgroundColor:_?void 0:r,background:a||void 0},j=s&&k?`${Math.round(100*s.x)}% ${Math.round(100*s.y)}%`:void 0,S=ft({"is-light":!c,"has-parallax":l,"is-repeated":u,"has-custom-content-position":!Jr(n)},Xr(n));return(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:S,style:w}),children:[(0,Je.jsx)("span",{"aria-hidden":"true",className:ft(_,Yr(i),"wp-block-cover__gradient-background",b,{"has-background-dim":void 0!==i,"has-background-gradient":o||a,[b]:!p&&b}),style:C}),f&&k&&p&&(0,Je.jsx)("img",{className:ft("wp-block-cover__image-background",g?`wp-image-${g}`:null),alt:m,src:p,style:{objectPosition:j},"data-object-fit":"cover","data-object-position":j}),v&&p&&(0,Je.jsx)("video",{className:ft("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:p,style:{objectPosition:j},"data-object-fit":"cover","data-object-position":j}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})},migrate:ni},_i={attributes:{...ai,isRepeated:{type:"boolean",default:!1},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""}},supports:li,save({attributes:e}){const{backgroundType:t,gradient:o,contentPosition:n,customGradient:a,customOverlayColor:r,dimRatio:i,focalPoint:s,hasParallax:l,isRepeated:c,overlayColor:u,url:d,alt:p,id:m,minHeight:g,minHeightUnit:h}=e,x=(0,nt.getColorClassName)("background-color",u),_=(0,nt.__experimentalGetGradientClass)(o),b=h?`${g}${h}`:g,y=qr===t,f=Wr===t,v=!(l||c),k={...y&&!v?ei(d):{},backgroundColor:x?void 0:r,background:a&&!d?a:void 0,minHeight:b||void 0},w=s&&v?`${Math.round(100*s.x)}% ${Math.round(100*s.y)}%`:void 0,C=ft(ti(i),x,{"has-background-dim":0!==i,"has-parallax":l,"is-repeated":c,"has-background-gradient":o||a,[_]:!d&&_,"has-custom-content-position":!Jr(n)},Xr(n));return(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:C,style:k}),children:[d&&(o||a)&&0!==i&&(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__gradient-background",_),style:a?{background:a}:void 0}),y&&v&&d&&(0,Je.jsx)("img",{className:ft("wp-block-cover__image-background",m?`wp-image-${m}`:null),alt:p,src:d,style:{objectPosition:w},"data-object-fit":"cover","data-object-position":w}),f&&d&&(0,Je.jsx)("video",{className:ft("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:d,style:{objectPosition:w},"data-object-fit":"cover","data-object-position":w}),(0,Je.jsx)("div",{className:"wp-block-cover__inner-container",children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})]})},migrate:(0,ut.compose)(oi,ni)},bi={attributes:{...ai,isRepeated:{type:"boolean",default:!1},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:o,contentPosition:n,customGradient:a,customOverlayColor:r,dimRatio:i,focalPoint:s,hasParallax:l,isRepeated:c,overlayColor:u,url:d,minHeight:p,minHeightUnit:m}=e,g=(0,nt.getColorClassName)("background-color",u),h=(0,nt.__experimentalGetGradientClass)(o),x=m?`${p}${m}`:p,_=qr===t,b=Wr===t,y=_?ei(d):{},f={};let v;g||(y.backgroundColor=r),a&&!d&&(y.background=a),y.minHeight=x||void 0,s&&(v=`${Math.round(100*s.x)}% ${Math.round(100*s.y)}%`,_&&!l&&(y.backgroundPosition=v),b&&(f.objectPosition=v));const k=ft(ti(i),g,{"has-background-dim":0!==i,"has-parallax":l,"is-repeated":c,"has-background-gradient":o||a,[h]:!d&&h,"has-custom-content-position":!Jr(n)},Xr(n));return(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:k,style:y}),children:[d&&(o||a)&&0!==i&&(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__gradient-background",h),style:a?{background:a}:void 0}),b&&d&&(0,Je.jsx)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:d,style:f}),(0,Je.jsx)("div",{className:"wp-block-cover__inner-container",children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})]})},migrate:(0,ut.compose)(oi,ni)},yi={attributes:{...ai,minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:o,customGradient:n,customOverlayColor:a,dimRatio:r,focalPoint:i,hasParallax:s,overlayColor:l,url:c,minHeight:u}=e,d=(0,nt.getColorClassName)("background-color",l),p=(0,nt.__experimentalGetGradientClass)(o),m=t===qr?ei(c):{};d||(m.backgroundColor=a),i&&!s&&(m.backgroundPosition=`${Math.round(100*i.x)}% ${Math.round(100*i.y)}%`),n&&!c&&(m.background=n),m.minHeight=u||void 0;const g=ft(ti(r),d,{"has-background-dim":0!==r,"has-parallax":s,"has-background-gradient":n,[p]:!c&&p});return(0,Je.jsxs)("div",{className:g,style:m,children:[c&&(o||n)&&0!==r&&(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__gradient-background",p),style:n?{background:n}:void 0}),Wr===t&&c&&(0,Je.jsx)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:c}),(0,Je.jsx)("div",{className:"wp-block-cover__inner-container",children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})]})},migrate:(0,ut.compose)(oi,ni)},fi={attributes:{...ai,minHeight:{type:"number"},gradient:{type:"string"},customGradient:{type:"string"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,gradient:o,customGradient:n,customOverlayColor:a,dimRatio:r,focalPoint:i,hasParallax:s,overlayColor:l,url:c,minHeight:u}=e,d=(0,nt.getColorClassName)("background-color",l),p=(0,nt.__experimentalGetGradientClass)(o),m=t===qr?ei(c):{};d||(m.backgroundColor=a),i&&!s&&(m.backgroundPosition=`${100*i.x}% ${100*i.y}%`),n&&!c&&(m.background=n),m.minHeight=u||void 0;const g=ft(ti(r),d,{"has-background-dim":0!==r,"has-parallax":s,"has-background-gradient":n,[p]:!c&&p});return(0,Je.jsxs)("div",{className:g,style:m,children:[c&&(o||n)&&0!==r&&(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__gradient-background",p),style:n?{background:n}:void 0}),Wr===t&&c&&(0,Je.jsx)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:c}),(0,Je.jsx)("div",{className:"wp-block-cover__inner-container",children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})]})},migrate:(0,ut.compose)(oi,ni)},vi={attributes:{...ai,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"}},supports:{align:!0},save({attributes:e}){const{backgroundType:t,contentAlign:o,customOverlayColor:n,dimRatio:a,focalPoint:r,hasParallax:i,overlayColor:s,title:l,url:c}=e,u=(0,nt.getColorClassName)("background-color",s),d=t===qr?ei(c):{};u||(d.backgroundColor=n),r&&!i&&(d.backgroundPosition=`${100*r.x}% ${100*r.y}%`);const p=ft(ti(a),u,{"has-background-dim":0!==a,"has-parallax":i,[`has-${o}-content`]:"center"!==o});return(0,Je.jsxs)("div",{className:p,style:d,children:[Wr===t&&c&&(0,Je.jsx)("video",{className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:c}),!nt.RichText.isEmpty(l)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"p",className:"wp-block-cover-text",value:l})]})},migrate(e){const t={...e,dimRatio:e.url?e.dimRatio:100,tagName:e.tagName?e.tagName:"div"},{title:o,contentAlign:n,...a}=t;return[a,[(0,Ke.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:(0,ot.__)("Write title…")})]]}},ki={attributes:{...ai,title:{type:"string",source:"html",selector:"p"},contentAlign:{type:"string",default:"center"},align:{type:"string"}},supports:{className:!1},save({attributes:e}){const{url:t,title:o,hasParallax:n,dimRatio:a,align:r,contentAlign:i,overlayColor:s,customOverlayColor:l}=e,c=(0,nt.getColorClassName)("background-color",s),u=ei(t);c||(u.backgroundColor=l);const d=ft("wp-block-cover-image",ti(a),c,{"has-background-dim":0!==a,"has-parallax":n,[`has-${i}-content`]:"center"!==i},r?`align${r}`:null);return(0,Je.jsx)("div",{className:d,style:u,children:!nt.RichText.isEmpty(o)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"p",className:"wp-block-cover-image-text",value:o})})},migrate(e){const t={...e,dimRatio:e.url?e.dimRatio:100,tagName:e.tagName?e.tagName:"div"},{title:o,contentAlign:n,align:a,...r}=t;return[r,[(0,Ke.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:(0,ot.__)("Write title…")})]]}},wi={attributes:{...ai,title:{type:"string",source:"html",selector:"h2"},align:{type:"string"},contentAlign:{type:"string",default:"center"}},supports:{className:!1},save({attributes:e}){const{url:t,title:o,hasParallax:n,dimRatio:a,align:r}=e,i=ei(t),s=ft("wp-block-cover-image",ti(a),{"has-background-dim":0!==a,"has-parallax":n},r?`align${r}`:null);return(0,Je.jsx)("section",{className:s,style:i,children:(0,Je.jsx)(nt.RichText.Content,{tagName:"h2",value:o})})},migrate(e){const t={...e,dimRatio:e.url?e.dimRatio:100,tagName:e.tagName?e.tagName:"div"},{title:o,contentAlign:n,align:a,...r}=t;return[r,[(0,Ke.createBlock)("core/paragraph",{content:e.title,align:e.contentAlign,fontSize:"large",placeholder:(0,ot.__)("Write title…")})]]}},Ci=[ui,di,pi,mi,gi,hi,xi,_i,bi,yi,fi,vi,ki,wi],ji="full",{cleanEmptyObject:Si,ResolutionTool:Bi}=Ot(nt.privateApis);function Ti({onChange:e,onUnitChange:t,unit:o="px",value:n=""}){const a=`block-cover-height-input-${(0,ut.useInstanceId)(tt.__experimentalUnitControl)}`,r="px"===o,[i]=(0,nt.useSettings)("spacing.units"),s=(0,tt.__experimentalUseCustomUnits)({availableUnits:i||["px","em","rem","vw","vh"],defaultValues:{px:430,"%":20,em:20,rem:20,vw:20,vh:50}}),l=(0,st.useMemo)((()=>{const[e]=(0,tt.__experimentalParseQuantityAndUnitFromRawValue)(n);return[e,o].join("")}),[o,n]),c=r?50:0;return(0,Je.jsx)(tt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,ot.__)("Minimum height"),id:a,isResetValueOnUnitChange:!0,min:c,onChange:t=>{const o=""!==t?parseFloat(t):void 0;isNaN(o)&&void 0!==o||e(o)},onUnitChange:t,units:s,value:l})}function Ni({attributes:e,setAttributes:t,clientId:o,setOverlayColor:n,coverRef:a,currentSettings:r,updateDimRatio:i,featuredImage:s}){const{useFeaturedImage:l,id:c,dimRatio:u,focalPoint:d,hasParallax:p,isRepeated:m,minHeight:g,minHeightUnit:h,alt:x,tagName:_}=e,{isVideoBackground:b,isImageBackground:y,mediaElement:f,url:v,overlayColor:k}=r,w=e.sizeSlug||ji,{gradientValue:C,setGradient:j}=(0,nt.__experimentalUseGradient)(),{getSettings:S}=(0,it.useSelect)(nt.store),B=S()?.imageSizes,T=(0,it.useSelect)((e=>c&&y?e(ct.store).getMedia(c,{context:"view"}):null),[c,y]),N=l?s:T;const P=B?.filter((({slug:e})=>N?.media_details?.sizes?.[e]?.source_url))?.map((({name:e,slug:t})=>({value:t,label:e}))),I=b||y&&(!p||m),M=e=>{const[t,o]=f.current?[f.current.style,"objectPosition"]:[a.current.style,"backgroundPosition"];t[o]=Kr(e)},D=(0,nt.__experimentalUseMultipleOriginColorsAndGradients)(),z=mt();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:!!v&&(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{t({hasParallax:!1,focalPoint:void 0,isRepeated:!1,alt:"",sizeSlug:void 0})},dropdownMenuProps:z,children:[y&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Fixed background"),isShownByDefault:!0,hasValue:()=>p,onDeselect:()=>t({hasParallax:!1,focalPoint:void 0}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Fixed background"),checked:p,onChange:()=>{t({hasParallax:!p,...p?{}:{focalPoint:void 0}})}})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Repeated background"),isShownByDefault:!0,hasValue:()=>m,onDeselect:()=>t({isRepeated:!1}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Repeated background"),checked:m,onChange:()=>{t({isRepeated:!m})}})})]}),I&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Focal point"),isShownByDefault:!0,hasValue:()=>!!d,onDeselect:()=>t({focalPoint:void 0}),children:(0,Je.jsx)(tt.FocalPointPicker,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Focal point"),url:v,value:d,onDragStart:M,onDrag:M,onChange:e=>t({focalPoint:e})})}),!l&&v&&!b&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Alternative text"),isShownByDefault:!0,hasValue:()=>!!x,onDeselect:()=>t({alt:""}),children:(0,Je.jsx)(tt.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Alternative text"),value:x,onChange:e=>t({alt:e}),help:(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.ExternalLink,{href:(0,ot.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,ot.__)("Describe the purpose of the image.")}),(0,Je.jsx)("br",{}),(0,ot.__)("Leave empty if decorative.")]})})}),!!P?.length&&(0,Je.jsx)(Bi,{value:w,onChange:function(e){const o=N?.media_details?.sizes?.[e]?.source_url;if(!o)return null;t({url:o,sizeSlug:e})},options:P,defaultValue:ji})]})}),D.hasColorsOrGradients&&(0,Je.jsxs)(nt.InspectorControls,{group:"color",children:[(0,Je.jsx)(nt.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:k.color,gradientValue:C,label:(0,ot.__)("Overlay"),onColorChange:n,onGradientChange:j,isShownByDefault:!0,resetAllFilter:()=>({overlayColor:void 0,customOverlayColor:void 0,gradient:void 0,customGradient:void 0}),clearable:!0}],panelId:o,...D}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>void 0!==u&&u!==(v?50:100),label:(0,ot.__)("Overlay opacity"),onDeselect:()=>i(v?50:100),resetAllFilter:()=>({dimRatio:v?50:100}),isShownByDefault:!0,panelId:o,children:(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Overlay opacity"),value:u,onChange:e=>i(e),min:0,max:100,step:10,required:!0,__next40pxDefaultSize:!0})})]}),(0,Je.jsx)(nt.InspectorControls,{group:"dimensions",children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!g,label:(0,ot.__)("Minimum height"),onDeselect:()=>t({minHeight:void 0,minHeightUnit:void 0}),resetAllFilter:()=>({minHeight:void 0,minHeightUnit:void 0}),isShownByDefault:!0,panelId:o,children:(0,Je.jsx)(Ti,{value:e?.style?.dimensions?.aspectRatio?"":g,unit:h,onChange:o=>t({minHeight:o,style:Si({...e?.style,dimensions:{...e?.style?.dimensions,aspectRatio:void 0}})}),onUnitChange:e=>t({minHeightUnit:e})})})}),(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("HTML element"),options:[{label:(0,ot.__)("Default (<div>)"),value:"div"},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"}],value:_,onChange:e=>t({tagName:e}),help:sa[_]})})]})}const{cleanEmptyObject:Pi}=Ot(nt.privateApis);function Ii({attributes:e,setAttributes:t,onSelectMedia:o,currentSettings:n,toggleUseFeaturedImage:a,onClearMedia:r}){const{contentPosition:i,id:s,useFeaturedImage:l,minHeight:c,minHeightUnit:u}=e,{hasInnerBlocks:d,url:p}=n,[m,g]=(0,st.useState)(c),[h,x]=(0,st.useState)(u),_="vh"===u&&100===c&&!e?.style?.dimensions?.aspectRatio;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(nt.BlockControls,{group:"block",children:[(0,Je.jsx)(nt.__experimentalBlockAlignmentMatrixControl,{label:(0,ot.__)("Change content position"),value:i,onChange:e=>t({contentPosition:e}),isDisabled:!d}),(0,Je.jsx)(nt.__experimentalBlockFullHeightAligmentControl,{isActive:_,onToggle:()=>_?t("vh"===h&&100===m?{minHeight:void 0,minHeightUnit:void 0}:{minHeight:m,minHeightUnit:h}):(g(c),x(u),t({minHeight:100,minHeightUnit:"vh",style:Pi({...e?.style,dimensions:{...e?.style?.dimensions,aspectRatio:void 0}})})),isDisabled:!d})]}),(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(nt.MediaReplaceFlow,{mediaId:s,mediaURL:p,allowedTypes:Qr,accept:"image/*,video/*",onSelect:o,onToggleFeaturedImage:a,useFeaturedImage:l,name:p?(0,ot.__)("Replace"):(0,ot.__)("Add media"),onReset:r})})]})}function Mi({disableMediaButtons:e=!1,children:t,onSelectMedia:o,onError:n,style:a,toggleUseFeaturedImage:r}){return(0,Je.jsx)(nt.MediaPlaceholder,{icon:(0,Je.jsx)(nt.BlockIcon,{icon:Gr}),labels:{title:(0,ot.__)("Cover")},onSelect:o,accept:"image/*,video/*",allowedTypes:Qr,disableMediaButtons:e,onToggleFeaturedImage:r,onError:n,style:a,children:t})}const Di={top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},{ResizableBoxPopover:zi}=Ot(nt.privateApis);function Ai({className:e,height:t,minHeight:o,onResize:n,onResizeStart:a,onResizeStop:r,showHandle:i,size:s,width:l,...c}){const[u,d]=(0,st.useState)(!1),p={className:ft(e,{"is-resizing":u}),enable:Di,onResizeStart:(e,t,o)=>{a(o.clientHeight),n(o.clientHeight)},onResize:(e,t,o)=>{n(o.clientHeight),u||d(!0)},onResizeStop:(e,t,o)=>{r(o.clientHeight),d(!1)},showHandle:i,size:s,__experimentalShowTooltip:!0,__experimentalTooltipProps:{axis:"y",position:"bottom",isVisible:u}};return(0,Je.jsx)(zi,{className:"block-library-cover__resizable-box-popover",resizableBoxProps:p,...c})}var Ri={grad:.9,turn:360,rad:360/(2*Math.PI)},Hi=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Li=function(e,t,o){return void 0===t&&(t=0),void 0===o&&(o=Math.pow(10,t)),Math.round(o*e)/o+0},Vi=function(e,t,o){return void 0===t&&(t=0),void 0===o&&(o=1),e>o?o:e>t?e:t},Fi=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Ei=function(e){return{r:Vi(e.r,0,255),g:Vi(e.g,0,255),b:Vi(e.b,0,255),a:Vi(e.a)}},Oi=function(e){return{r:Li(e.r),g:Li(e.g),b:Li(e.b),a:Li(e.a,3)}},$i=/^#([0-9a-f]{3,8})$/i,Gi=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Ui=function(e){var t=e.r,o=e.g,n=e.b,a=e.a,r=Math.max(t,o,n),i=r-Math.min(t,o,n),s=i?r===t?(o-n)/i:r===o?2+(n-t)/i:4+(t-o)/i:0;return{h:60*(s<0?s+6:s),s:r?i/r*100:0,v:r/255*100,a}},qi=function(e){var t=e.h,o=e.s,n=e.v,a=e.a;t=t/360*6,o/=100,n/=100;var r=Math.floor(t),i=n*(1-o),s=n*(1-(t-r)*o),l=n*(1-(1-t+r)*o),c=r%6;return{r:255*[n,s,i,i,l,n][c],g:255*[l,n,n,s,i,i][c],b:255*[i,i,l,n,n,s][c],a}},Wi=function(e){return{h:Fi(e.h),s:Vi(e.s,0,100),l:Vi(e.l,0,100),a:Vi(e.a)}},Zi=function(e){return{h:Li(e.h),s:Li(e.s),l:Li(e.l),a:Li(e.a,3)}},Qi=function(e){return qi((o=(t=e).s,{h:t.h,s:(o*=((n=t.l)<50?n:100-n)/100)>0?2*o/(n+o)*100:0,v:n+o,a:t.a}));var t,o,n},Ki=function(e){return{h:(t=Ui(e)).h,s:(a=(200-(o=t.s))*(n=t.v)/100)>0&&a<200?o*n/100/(a<=100?a:200-a)*100:0,l:a/2,a:t.a};var t,o,n,a},Yi=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ji=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xi=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,es=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ts={string:[[function(e){var t=$i.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Li(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Li(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Xi.exec(e)||es.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Ei({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Yi.exec(e)||Ji.exec(e);if(!t)return null;var o,n,a=Wi({h:(o=t[1],n=t[2],void 0===n&&(n="deg"),Number(o)*(Ri[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Qi(a)},"hsl"]],object:[[function(e){var t=e.r,o=e.g,n=e.b,a=e.a,r=void 0===a?1:a;return Hi(t)&&Hi(o)&&Hi(n)?Ei({r:Number(t),g:Number(o),b:Number(n),a:Number(r)}):null},"rgb"],[function(e){var t=e.h,o=e.s,n=e.l,a=e.a,r=void 0===a?1:a;if(!Hi(t)||!Hi(o)||!Hi(n))return null;var i=Wi({h:Number(t),s:Number(o),l:Number(n),a:Number(r)});return Qi(i)},"hsl"],[function(e){var t=e.h,o=e.s,n=e.v,a=e.a,r=void 0===a?1:a;if(!Hi(t)||!Hi(o)||!Hi(n))return null;var i=function(e){return{h:Fi(e.h),s:Vi(e.s,0,100),v:Vi(e.v,0,100),a:Vi(e.a)}}({h:Number(t),s:Number(o),v:Number(n),a:Number(r)});return qi(i)},"hsv"]]},os=function(e,t){for(var o=0;o<t.length;o++){var n=t[o][0](e);if(n)return[n,t[o][1]]}return[null,void 0]},ns=function(e){return"string"==typeof e?os(e.trim(),ts.string):"object"==typeof e&&null!==e?os(e,ts.object):[null,void 0]},as=function(e,t){var o=Ki(e);return{h:o.h,s:Vi(o.s+100*t,0,100),l:o.l,a:o.a}},rs=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},is=function(e,t){var o=Ki(e);return{h:o.h,s:o.s,l:Vi(o.l+100*t,0,100),a:o.a}},ss=function(){function e(e){this.parsed=ns(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return Li(rs(this.rgba),2)},e.prototype.isDark=function(){return rs(this.rgba)<.5},e.prototype.isLight=function(){return rs(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=Oi(this.rgba)).r,o=e.g,n=e.b,r=(a=e.a)<1?Gi(Li(255*a)):"","#"+Gi(t)+Gi(o)+Gi(n)+r;var e,t,o,n,a,r},e.prototype.toRgb=function(){return Oi(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Oi(this.rgba)).r,o=e.g,n=e.b,(a=e.a)<1?"rgba("+t+", "+o+", "+n+", "+a+")":"rgb("+t+", "+o+", "+n+")";var e,t,o,n,a},e.prototype.toHsl=function(){return Zi(Ki(this.rgba))},e.prototype.toHslString=function(){return t=(e=Zi(Ki(this.rgba))).h,o=e.s,n=e.l,(a=e.a)<1?"hsla("+t+", "+o+"%, "+n+"%, "+a+")":"hsl("+t+", "+o+"%, "+n+"%)";var e,t,o,n,a},e.prototype.toHsv=function(){return e=Ui(this.rgba),{h:Li(e.h),s:Li(e.s),v:Li(e.v),a:Li(e.a,3)};var e},e.prototype.invert=function(){return ls({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),ls(as(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),ls(as(this.rgba,-e))},e.prototype.grayscale=function(){return ls(as(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),ls(is(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),ls(is(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?ls({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Li(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ki(this.rgba);return"number"==typeof e?ls({h:e,s:t.s,l:t.l,a:t.a}):Li(t.h)},e.prototype.isEqual=function(e){return this.toHex()===ls(e).toHex()},e}(),ls=function(e){return e instanceof ss?e:new ss(e)},cs=[]; /*! Fast Average Color | © 2022 Denis Seleznev | MIT License | https://github.com/fast-average-color/fast-average-color */ function us(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function ds(e){return"#"+e.map(us).join("")}function ps(e){return e?(t=e,Array.isArray(t[0])?e:[e]):[];var t}function ms(e,t,o){for(var n=0;n<o.length;n++)if(gs(e,t,o[n]))return!0;return!1}function gs(e,t,o){switch(o.length){case 3:if(function(e,t,o){if(255!==e[t+3])return!0;if(e[t]===o[0]&&e[t+1]===o[1]&&e[t+2]===o[2])return!0;return!1}(e,t,o))return!0;break;case 4:if(function(e,t,o){if(e[t+3]&&o[3])return e[t]===o[0]&&e[t+1]===o[1]&&e[t+2]===o[2]&&e[t+3]===o[3];return e[t+3]===o[3]}(e,t,o))return!0;break;case 5:if(function(e,t,o){var n=o[0],a=o[1],r=o[2],i=o[3],s=o[4],l=e[t+3],c=hs(l,i,s);if(!i)return c;if(!l&&c)return!0;if(hs(e[t],n,s)&&hs(e[t+1],a,s)&&hs(e[t+2],r,s)&&c)return!0;return!1}(e,t,o))return!0;break;default:return!1}}function hs(e,t,o){return e>=t-o&&e<=t+o}function xs(e,t,o){for(var n={},a=o.ignoredColor,r=o.step,i=[0,0,0,0,0],s=0;s<t;s+=r){var l=e[s],c=e[s+1],u=e[s+2],d=e[s+3];if(!a||!ms(e,s,a)){var p=Math.round(l/24)+","+Math.round(c/24)+","+Math.round(u/24);n[p]?n[p]=[n[p][0]+l*d,n[p][1]+c*d,n[p][2]+u*d,n[p][3]+d,n[p][4]+1]:n[p]=[l*d,c*d,u*d,d,1],i[4]<n[p][4]&&(i=n[p])}}var m=i[0],g=i[1],h=i[2],x=i[3],_=i[4];return x?[Math.round(m/x),Math.round(g/x),Math.round(h/x),Math.round(x/_)]:o.defaultColor}function _s(e,t,o){for(var n=0,a=0,r=0,i=0,s=0,l=o.ignoredColor,c=o.step,u=0;u<t;u+=c){var d=e[u+3],p=e[u]*d,m=e[u+1]*d,g=e[u+2]*d;l&&ms(e,u,l)||(n+=p,a+=m,r+=g,i+=d,s++)}return i?[Math.round(n/i),Math.round(a/i),Math.round(r/i),Math.round(i/s)]:o.defaultColor}function bs(e,t,o){for(var n=0,a=0,r=0,i=0,s=0,l=o.ignoredColor,c=o.step,u=0;u<t;u+=c){var d=e[u],p=e[u+1],m=e[u+2],g=e[u+3];l&&ms(e,u,l)||(n+=d*d*g,a+=p*p*g,r+=m*m*g,i+=g,s++)}return i?[Math.round(Math.sqrt(n/i)),Math.round(Math.sqrt(a/i)),Math.round(Math.sqrt(r/i)),Math.round(i/s)]:o.defaultColor}function ys(e){return fs(e,"defaultColor",[0,0,0,0])}function fs(e,t,o){return void 0===e[t]?o:e[t]}function vs(e){if(ws(e)){var t=e.naturalWidth,o=e.naturalHeight;return e.naturalWidth||-1===e.src.search(/\.svg(\?|$)/i)||(t=o=100),{width:t,height:o}}return function(e){return"undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement}(e)?{width:e.videoWidth,height:e.videoHeight}:{width:e.width,height:e.height}}function ks(e){return function(e){return"undefined"!=typeof HTMLCanvasElement&&e instanceof HTMLCanvasElement}(e)?"canvas":function(e){return Cs&&e instanceof OffscreenCanvas}(e)?"offscreencanvas":function(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap}(e)?"imagebitmap":e.src}function ws(e){return"undefined"!=typeof HTMLImageElement&&e instanceof HTMLImageElement}var Cs="undefined"!=typeof OffscreenCanvas;var js="undefined"==typeof window;function Ss(e){return Error("FastAverageColor: "+e)}function Bs(e,t){t||console.error(e)}var Ts=function(){function e(){this.canvas=null,this.ctx=null}return e.prototype.getColorAsync=function(e,t){if(!e)return Promise.reject(Ss("call .getColorAsync() without resource."));if("string"==typeof e){if("undefined"==typeof Image)return Promise.reject(Ss("resource as string is not supported in this environment"));var o=new Image;return o.crossOrigin=t&&t.crossOrigin||"",o.src=e,this.bindImageEvents(o,t)}if(ws(e)&&!e.complete)return this.bindImageEvents(e,t);var n=this.getColor(e,t);return n.error?Promise.reject(n.error):Promise.resolve(n)},e.prototype.getColor=function(e,t){var o=ys(t=t||{});if(!e)return Bs(r=Ss("call .getColor(null) without resource"),t.silent),this.prepareResult(o,r);var n=function(e,t){var o,n=fs(t,"left",0),a=fs(t,"top",0),r=fs(t,"width",e.width),i=fs(t,"height",e.height),s=r,l=i;return"precision"===t.mode||(r>i?(o=r/i,s=100,l=Math.round(s/o)):(o=i/r,l=100,s=Math.round(l/o)),(s>r||l>i||s<10||l<10)&&(s=r,l=i)),{srcLeft:n,srcTop:a,srcWidth:r,srcHeight:i,destWidth:s,destHeight:l}}(vs(e),t);if(!(n.srcWidth&&n.srcHeight&&n.destWidth&&n.destHeight))return Bs(r=Ss('incorrect sizes for resource "'.concat(ks(e),'"')),t.silent),this.prepareResult(o,r);if(!this.canvas&&(this.canvas=js?Cs?new OffscreenCanvas(1,1):null:document.createElement("canvas"),!this.canvas))return Bs(r=Ss("OffscreenCanvas is not supported in this browser"),t.silent),this.prepareResult(o,r);if(!this.ctx){if(this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0}),!this.ctx)return Bs(r=Ss("Canvas Context 2D is not supported in this browser"),t.silent),this.prepareResult(o);this.ctx.imageSmoothingEnabled=!1}this.canvas.width=n.destWidth,this.canvas.height=n.destHeight;try{this.ctx.clearRect(0,0,n.destWidth,n.destHeight),this.ctx.drawImage(e,n.srcLeft,n.srcTop,n.srcWidth,n.srcHeight,0,0,n.destWidth,n.destHeight);var a=this.ctx.getImageData(0,0,n.destWidth,n.destHeight).data;return this.prepareResult(this.getColorFromArray4(a,t))}catch(n){var r;return Bs(r=Ss("security error (CORS) for resource ".concat(ks(e),".\nDetails: https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image")),t.silent),!t.silent&&console.error(n),this.prepareResult(o,r)}},e.prototype.getColorFromArray4=function(e,t){t=t||{};var o=e.length,n=ys(t);if(o<4)return n;var a,r=o-o%4,i=4*(t.step||1);switch(t.algorithm||"sqrt"){case"simple":a=_s;break;case"sqrt":a=bs;break;case"dominant":a=xs;break;default:throw Ss("".concat(t.algorithm," is unknown algorithm"))}return a(e,r,{defaultColor:n,ignoredColor:ps(t.ignoredColor),step:i})},e.prototype.prepareResult=function(e,t){var o,n=e.slice(0,3),a=[e[0],e[1],e[2],e[3]/255],r=(299*(o=e)[0]+587*o[1]+114*o[2])/1e3<128;return{value:[e[0],e[1],e[2],e[3]],rgb:"rgb("+n.join(",")+")",rgba:"rgba("+a.join(",")+")",hex:ds(n),hexa:ds(e),isDark:r,isLight:!r,error:t}},e.prototype.destroy=function(){this.canvas&&(this.canvas.width=1,this.canvas.height=1,this.canvas=null),this.ctx=null},e.prototype.bindImageEvents=function(e,t){var o=this;return new Promise((function(n,a){var r=function(){l();var r=o.getColor(e,t);r.error?a(r.error):n(r)},i=function(){l(),a(Ss('Error loading image "'.concat(e.src,'".')))},s=function(){l(),a(Ss('Image "'.concat(e.src,'" loading aborted')))},l=function(){e.removeEventListener("load",r),e.removeEventListener("error",i),e.removeEventListener("abort",s)};e.addEventListener("load",r),e.addEventListener("error",i),e.addEventListener("abort",s)}))},e}();const Ns=window.wp.hooks;!function(e){e.forEach((function(e){cs.indexOf(e)<0&&(e(ss,ts),cs.push(e))}))}([function(e,t){var o={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},n={};for(var a in o)n[o[a]]=a;var r={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,i,s=n[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var l=this.toRgb(),c=1/0,u="black";if(!r.length)for(var d in o)r[d]=new e(o[d]).toRgb();for(var p in o){var m=(a=l,i=r[p],Math.pow(a.r-i.r,2)+Math.pow(a.g-i.g,2)+Math.pow(a.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var n=t.toLowerCase(),a="transparent"===n?"#0000":o[n];return a?new e(a).toRgb():null},"name"])}]);const Ps="#FFF";function Is(){return Is.fastAverageColor||(Is.fastAverageColor=new Ts),Is.fastAverageColor}const Ms=Ht((async e=>{if(!e)return Ps;const{r:t,g:o,b:n,a}=ls(Ps).toRgb();try{const r=(0,Ns.applyFilters)("media.crossOrigin",void 0,e);return(await Is().getColorAsync(e,{defaultColor:[t,o,n,255*a],silent:!0,crossOrigin:r})).hex}catch(e){return Ps}}));function Ds(e,t,o){if(t===o||100===e)return ls(t).isDark();const n=ls(t).alpha(e/100).toRgb(),a=ls(o).toRgb(),r=(s=a,{r:(i=n).r*i.a+s.r*s.a*(1-i.a),g:i.g*i.a+s.g*s.a*(1-i.a),b:i.b*i.a+s.b*s.a*(1-i.a),a:i.a+s.a*(1-i.a)});var i,s;return ls(r).isDark()}const zs=(0,ut.compose)([(0,nt.withColors)({overlayColor:"background-color"})])((function({attributes:e,clientId:t,isSelected:o,overlayColor:n,setAttributes:a,setOverlayColor:r,toggleSelection:i,context:{postId:s,postType:l}}){var c;const{contentPosition:u,id:d,url:p,backgroundType:m,useFeaturedImage:g,dimRatio:h,focalPoint:x,hasParallax:_,isDark:b,isRepeated:y,minHeight:f,minHeightUnit:v,alt:k,allowedBlocks:w,templateLock:C,tagName:j="div",isUserOverlayColor:S,sizeSlug:B}=e,[T]=(0,ct.useEntityProp)("postType",l,"featured_media",s),{getSettings:N}=(0,it.useSelect)(nt.store),{__unstableMarkNextChangeAsNotPersistent:P}=(0,it.useDispatch)(nt.store),{media:I}=(0,it.useSelect)((e=>({media:T&&g?e(ct.store).getMedia(T,{context:"view"}):void 0})),[T,g]),M=null!==(c=I?.media_details?.sizes?.[B]?.source_url)&&void 0!==c?c:I?.source_url;(0,st.useEffect)((()=>{(async()=>{if(!g)return;const e=await Ms(M);let t=n.color;S||(t=e,P(),r(t));const o=Ds(h,t,e);P(),a({isDark:o,isUserOverlayColor:S||!1})})()}),[M]);const D=g?M:p?.replaceAll("&","&"),z=g?qr:m,{createErrorNotice:A}=(0,it.useDispatch)(Rt.store),{gradientClass:R,gradientValue:H}=(0,nt.__experimentalUseGradient)(),L=async e=>{const t=function(e){if(!e||!e.url&&!e.src)return{url:void 0,id:void 0};let t;if((0,lt.isBlobURL)(e.url)&&(e.type=(0,lt.getBlobTypeByURL)(e.url)),e.media_type)t=e.media_type===qr?qr:Wr;else{if(!e.type||e.type!==qr&&e.type!==Wr)return;t=e.type}return{url:e.url||e.src,id:e.id,alt:e?.alt,backgroundType:t,...t===Wr?{hasParallax:void 0}:{}}}(e),o=[e?.type,e?.media_type].includes(qr),i=await Ms(o?e?.url:void 0);let s=n.color;S||(s=i,r(s),P());const l=void 0===p&&100===h?50:h,c=Ds(l,s,i);if(z===qr&&t?.id){const{imageDefaultSize:o}=N();B&&(e?.sizes?.[B]||e?.media_details?.sizes?.[B])?(t.sizeSlug=B,t.url=e?.sizes?.[B]?.url||e?.media_details?.sizes?.[B]?.source_url):e?.sizes?.[o]||e?.media_details?.sizes?.[o]?(t.sizeSlug=o,t.url=e?.sizes?.[o]?.url||e?.media_details?.sizes?.[o]?.source_url):t.sizeSlug=ji}a({...t,focalPoint:void 0,useFeaturedImage:void 0,dimRatio:l,isDark:c,isUserOverlayColor:S||!1})},V=()=>{let e=n.color;S||(e="#000",r(void 0),P());const t=Ds(h,e,Ps);a({url:void 0,id:void 0,backgroundType:void 0,focalPoint:void 0,hasParallax:void 0,isRepeated:void 0,useFeaturedImage:void 0,isDark:t})},F=async e=>{const t=await Ms(D),o=Ds(h,e,t);r(e),P(),a({isUserOverlayColor:!0,isDark:o})},E=e=>{A(e,{type:"snackbar"})},O=((e,t)=>!e&&(0,lt.isBlobURL)(t))(d,D),$=qr===z,G=Wr===z,U="default"===(0,nt.useBlockEditingMode)(),[q,{height:W,width:Z}]=(0,ut.useResizeObserver)(),Q=(0,st.useMemo)((()=>({height:"px"===v?f:"auto",width:"auto"})),[f,v]),K=f&&v?`${f}${v}`:f,Y=!(_||y),J={minHeight:K||void 0},X=D?`url(${D})`:void 0,ee=Kr(x),te={backgroundColor:n.color},oe={objectPosition:x&&Y?Kr(x):void 0},ne=!!(D||n.color||H),ae=(0,it.useSelect)((e=>e(nt.store).getBlock(t).innerBlocks.length>0),[t]),re=(0,st.useRef)(),ie=(0,nt.useBlockProps)({ref:re}),[se]=(0,nt.useSettings)("typography.fontSizes"),le=function(e){return[["core/paragraph",{align:"center",placeholder:(0,ot.__)("Write title…"),...e}]]}({fontSize:se?.length>0?"large":void 0}),ce=(0,nt.useInnerBlocksProps)({className:"wp-block-cover__inner-container"},{template:ae?void 0:le,templateInsertUpdatesSelection:!0,allowedBlocks:w,templateLock:C,dropZoneElement:re.current}),ue=(0,st.useRef)(),de={isVideoBackground:G,isImageBackground:$,mediaElement:ue,hasInnerBlocks:ae,url:D,isImgElement:Y,overlayColor:n},pe=async()=>{const e=!g,t=e?await Ms(M):Ps,o=S?n.color:t;S||(r(e?o:void 0),P());const i=100===h?50:h,s=Ds(i,o,t);a({id:void 0,url:void 0,useFeaturedImage:e,dimRatio:i,backgroundType:g?qr:void 0,isDark:s})},me=(0,Je.jsx)(Ii,{attributes:e,setAttributes:a,onSelectMedia:L,currentSettings:de,toggleUseFeaturedImage:pe,onClearMedia:V}),ge=(0,Je.jsx)(Ni,{attributes:e,setAttributes:a,clientId:t,setOverlayColor:F,coverRef:re,currentSettings:de,toggleUseFeaturedImage:pe,updateDimRatio:async e=>{const t=await Ms(D),o=Ds(e,n.color,t);a({dimRatio:e,isDark:o})},onClearMedia:V,featuredImage:I}),he={className:"block-library-cover__resize-container",clientId:t,height:W,minHeight:K,onResizeStart:()=>{a({minHeightUnit:"px"}),i(!1)},onResize:e=>{a({minHeight:e})},onResizeStop:e=>{i(!0),a({minHeight:e})},showHandle:!e.style?.dimensions?.aspectRatio,size:Q,width:Z};if(!g&&!ae&&!ne)return(0,Je.jsxs)(Je.Fragment,{children:[me,ge,U&&o&&(0,Je.jsx)(Ai,{...he}),(0,Je.jsxs)(j,{...ie,className:ft("is-placeholder",ie.className),style:{...ie.style,minHeight:K||void 0},children:[q,(0,Je.jsx)(Mi,{onSelectMedia:L,onError:E,toggleUseFeaturedImage:pe,children:(0,Je.jsx)("div",{className:"wp-block-cover__placeholder-background-options",children:(0,Je.jsx)(nt.ColorPalette,{disableCustomColors:!0,value:n.color,onChange:F,clearable:!1,asButtons:!0,"aria-label":(0,ot.__)("Overlay color")})})})]})]});const xe=ft({"is-dark-theme":b,"is-light":!b,"is-transient":O,"has-parallax":_,"is-repeated":y,"has-custom-content-position":!Jr(u)},Xr(u)),_e=D||!g||g&&!D;return(0,Je.jsxs)(Je.Fragment,{children:[me,ge,(0,Je.jsxs)(j,{...ie,className:ft(xe,ie.className),style:{...J,...ie.style},"data-url":D,children:[q,!D&&g&&(0,Je.jsx)(tt.Placeholder,{className:"wp-block-cover__image--placeholder-image",withIllustration:!0}),D&&$&&(Y?(0,Je.jsx)("img",{ref:ue,className:"wp-block-cover__image-background",alt:k,src:D,style:oe}):(0,Je.jsx)("div",{ref:ue,role:k?"img":void 0,"aria-label":k||void 0,className:ft(xe,"wp-block-cover__image-background"),style:{backgroundImage:X,backgroundPosition:ee}})),D&&G&&(0,Je.jsx)("video",{ref:ue,className:"wp-block-cover__video-background",autoPlay:!0,muted:!0,loop:!0,src:D,style:oe}),_e&&(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__background",Yr(h),{[n.class]:n.class,"has-background-dim":void 0!==h,"wp-block-cover__gradient-background":D&&H&&0!==h,"has-background-gradient":H,[R]:R}),style:{backgroundImage:H,...te}}),O&&(0,Je.jsx)(tt.Spinner,{}),(0,Je.jsx)(Mi,{disableMediaButtons:!0,onSelectMedia:L,onError:E,toggleUseFeaturedImage:pe}),(0,Je.jsx)("div",{...ce})]}),U&&o&&(0,Je.jsx)(Ai,{...he})]})}));const{cleanEmptyObject:As}=Ot(nt.privateApis),Rs={from:[{type:"block",blocks:["core/image"],transform:({caption:e,url:t,alt:o,align:n,id:a,anchor:r,style:i})=>(0,Ke.createBlock)("core/cover",{dimRatio:50,url:t,alt:o,align:n,id:a,anchor:r,style:{color:{duotone:i?.color?.duotone}}},[(0,Ke.createBlock)("core/paragraph",{content:e,fontSize:"large",align:"center"})])},{type:"block",blocks:["core/video"],transform:({caption:e,src:t,align:o,id:n,anchor:a})=>(0,Ke.createBlock)("core/cover",{dimRatio:50,url:t,align:o,id:n,backgroundType:Wr,anchor:a},[(0,Ke.createBlock)("core/paragraph",{content:e,fontSize:"large",align:"center"})])},{type:"block",blocks:["core/group"],transform:(e,t)=>{const{align:o,anchor:n,backgroundColor:a,gradient:r,style:i}=e;if(1===t?.length&&"core/cover"===t[0]?.name)return(0,Ke.createBlock)("core/cover",t[0].attributes,t[0].innerBlocks);const s={align:o,anchor:n,dimRatio:a||r||i?.color?.background||i?.color?.gradient?void 0:50,overlayColor:a,customOverlayColor:i?.color?.background,gradient:r,customGradient:i?.color?.gradient},l={...e,backgroundColor:void 0,gradient:void 0,style:As({...e?.style,color:i?.color?{...i?.color,background:void 0,gradient:void 0}:void 0})};return(0,Ke.createBlock)("core/cover",s,[(0,Ke.createBlock)("core/group",l,t)])}}],to:[{type:"block",blocks:["core/image"],isMatch:({backgroundType:e,url:t,overlayColor:o,customOverlayColor:n,gradient:a,customGradient:r})=>t?e===qr:!(o||n||a||r),transform:({title:e,url:t,alt:o,align:n,id:a,anchor:r,style:i})=>(0,Ke.createBlock)("core/image",{caption:e,url:t,alt:o,align:n,id:a,anchor:r,style:{color:{duotone:i?.color?.duotone}}})},{type:"block",blocks:["core/video"],isMatch:({backgroundType:e,url:t,overlayColor:o,customOverlayColor:n,gradient:a,customGradient:r})=>t?e===Wr:!(o||n||a||r),transform:({title:e,url:t,align:o,id:n,anchor:a})=>(0,Ke.createBlock)("core/video",{caption:e,src:t,id:n,align:o,anchor:a})},{type:"block",blocks:["core/group"],isMatch:({url:e,useFeaturedImage:t})=>!e&&!t,transform:(e,t)=>{const o={backgroundColor:e?.overlayColor,gradient:e?.gradient,style:As({...e?.style,color:e?.customOverlayColor||e?.customGradient||e?.style?.color?{background:e?.customOverlayColor,gradient:e?.customGradient,...e?.style?.color}:void 0})};if(1===t?.length&&"core/group"===t[0]?.name){const e=As(t[0].attributes||{});return e?.backgroundColor||e?.gradient||e?.style?.color?.background||e?.style?.color?.gradient?(0,Ke.createBlock)("core/group",e,t[0]?.innerBlocks):(0,Ke.createBlock)("core/group",{...o,...e,style:As({...e?.style,color:o?.style?.color||e?.style?.color?{...o?.style?.color,...e?.style?.color}:void 0})},t[0]?.innerBlocks)}return(0,Ke.createBlock)("core/group",{...e,...o},t)}}]},Hs=Rs,Ls=[{name:"cover",title:(0,ot.__)("Cover"),description:(0,ot.__)("Add an image or video with a text overlay."),attributes:{layout:{type:"constrained"}},isDefault:!0,icon:Gr}],Vs={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/cover",title:"Cover",category:"media",description:"Add an image or video with a text overlay.",textdomain:"default",attributes:{url:{type:"string"},useFeaturedImage:{type:"boolean",default:!1},id:{type:"number"},alt:{type:"string",default:""},hasParallax:{type:"boolean",default:!1},isRepeated:{type:"boolean",default:!1},dimRatio:{type:"number",default:100},overlayColor:{type:"string"},customOverlayColor:{type:"string"},isUserOverlayColor:{type:"boolean"},backgroundType:{type:"string",default:"image"},focalPoint:{type:"object"},minHeight:{type:"number"},minHeightUnit:{type:"string"},gradient:{type:"string"},customGradient:{type:"string"},contentPosition:{type:"string"},isDark:{type:"boolean",default:!0},allowedBlocks:{type:"array"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]},tagName:{type:"string",default:"div"},sizeSlug:{type:"string"}},usesContext:["postId","postType"],supports:{anchor:!0,align:!0,html:!1,shadow:!0,spacing:{padding:!0,margin:["top","bottom"],blockGap:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},color:{__experimentalDuotone:"> .wp-block-cover__image-background, > .wp-block-cover__video-background",heading:!0,text:!0,background:!1,__experimentalSkipSerialization:["gradients"],enableContrastChecker:!1},dimensions:{aspectRatio:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:{allowJustification:!1},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-cover-editor",style:"wp-block-cover"},{name:Fs}=Vs,Es={icon:Gr,example:{attributes:{customOverlayColor:"#065174",dimRatio:40,url:"https://s.w.org/images/core/5.3/Windbuchencom.jpg",style:{typography:{fontSize:48},color:{text:"white"}}},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,ot.__)("<strong>Snow Patrol</strong>"),align:"center"}}]},transforms:Hs,save:function({attributes:e}){const{backgroundType:t,gradient:o,contentPosition:n,customGradient:a,customOverlayColor:r,dimRatio:i,focalPoint:s,useFeaturedImage:l,hasParallax:c,isDark:u,isRepeated:d,overlayColor:p,url:m,alt:g,id:h,minHeight:x,minHeightUnit:_,tagName:b,sizeSlug:y}=e,f=(0,nt.getColorClassName)("background-color",p),v=(0,nt.__experimentalGetGradientClass)(o),k=qr===t,w=Wr===t,C=!(c||d),j={minHeight:(x&&_?`${x}${_}`:x)||void 0},S={backgroundColor:f?void 0:r,background:a||void 0},B=s&&C?Kr(s):void 0,T=m?`url(${m})`:void 0,N=Kr(s),P=ft({"is-light":!u,"has-parallax":c,"is-repeated":d,"has-custom-content-position":!Jr(n)},Xr(n)),I=ft("wp-block-cover__image-background",h?`wp-image-${h}`:null,{[`size-${y}`]:y,"has-parallax":c,"is-repeated":d}),M=o||a;return(0,Je.jsxs)(b,{...nt.useBlockProps.save({className:P,style:j}),children:[!l&&k&&m&&(C?(0,Je.jsx)("img",{className:I,alt:g,src:m,style:{objectPosition:B},"data-object-fit":"cover","data-object-position":B}):(0,Je.jsx)("div",{role:g?"img":void 0,"aria-label":g||void 0,className:I,style:{backgroundPosition:N,backgroundImage:T}})),w&&m&&(0,Je.jsx)("video",{className:ft("wp-block-cover__video-background","intrinsic-ignore"),autoPlay:!0,muted:!0,loop:!0,playsInline:!0,src:m,style:{objectPosition:B},"data-object-fit":"cover","data-object-position":B}),(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-cover__background",f,Yr(i),{"has-background-dim":void 0!==i,"wp-block-cover__gradient-background":m&&M&&0!==i,"has-background-gradient":M,[v]:v}),style:S}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-cover__inner-container"})})]})},edit:zs,deprecated:Ci,variations:Ls},Os=()=>et({name:Fs,metadata:Vs,settings:Es}),$s=(0,Je.jsxs)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,Je.jsx)(Ye.Path,{d:"M4 16h10v1.5H4V16Zm0-4.5h16V13H4v-1.5ZM10 7h10v1.5H10V7Z",fillRule:"evenodd",clipRule:"evenodd"}),(0,Je.jsx)(Ye.Path,{d:"m4 5.25 4 2.5-4 2.5v-5Z"})]}),Gs=[["core/paragraph",{placeholder:(0,ot.__)("Type / to add a hidden block")}]];const Us=function({attributes:e,setAttributes:t}){const{name:o,showContent:n,summary:a,allowedBlocks:r,placeholder:i}=e,s=(0,nt.useBlockProps)(),l=(0,nt.useInnerBlocksProps)(s,{template:Gs,__experimentalCaptureToolbars:!0,allowedBlocks:r}),[c,u]=(0,st.useState)(n),d=mt();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{t({showContent:!1})},dropdownMenuProps:d,children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,ot.__)("Open by default"),hasValue:()=>n,onDeselect:()=>{t({showContent:!1})},children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open by default"),checked:n,onChange:()=>t({showContent:!n})})})})}),(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Name attribute"),value:o||"",onChange:e=>t({name:e}),help:(0,ot.__)("Enables multiple Details blocks with the same name attribute to be connected, with only one open at a time.")})}),(0,Je.jsxs)("details",{...l,open:c,children:[(0,Je.jsx)("summary",{onClick:e=>{e.preventDefault(),u(!c)},children:(0,Je.jsx)(nt.RichText,{identifier:"summary","aria-label":(0,ot.__)("Write summary"),placeholder:i||(0,ot.__)("Write summary…"),allowedFormats:[],withoutInteractiveFormatting:!0,value:a,onChange:e=>t({summary:e})})}),l.children]})]})};const qs={from:[{type:"block",isMultiBlock:!0,blocks:["*"],isMatch:({},e)=>!(1===e.length&&"core/details"===e[0].name),__experimentalConvert:e=>(0,Ke.createBlock)("core/details",{},e.map((e=>(0,Ke.cloneBlock)(e))))}]},Ws={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/details",title:"Details",category:"text",description:"Hide and show additional content.",keywords:["accordion","summary","toggle","disclosure"],textdomain:"default",attributes:{showContent:{type:"boolean",default:!1},summary:{type:"rich-text",source:"rich-text",selector:"summary"},name:{type:"string",source:"attribute",attribute:"name",selector:".wp-block-details"},allowedBlocks:{type:"array"},placeholder:{type:"string"}},supports:{__experimentalOnEnter:!0,align:["wide","full"],anchor:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},__experimentalBorder:{color:!0,width:!0,style:!0},html:!1,spacing:{margin:!0,padding:!0,blockGap:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:{allowEditing:!1},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-details-editor",style:"wp-block-details"},{name:Zs}=Ws,Qs={icon:$s,example:{attributes:{summary:"La Mancha",showContent:!0},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,ot.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}}]},__experimentalLabel(e,{context:t}){const{summary:o}=e,n=e?.metadata?.name,a=o?.trim().length>0;return"list-view"===t&&(n||a)?n||o:"accessibility"===t?a?(0,ot.sprintf)((0,ot.__)("Details. %s"),o):(0,ot.__)("Details. Empty."):void 0},save:function({attributes:e}){const{name:t,showContent:o}=e,n=e.summary?e.summary:"Details",a=nt.useBlockProps.save();return(0,Je.jsxs)("details",{...a,name:t||void 0,open:o,children:[(0,Je.jsx)("summary",{children:(0,Je.jsx)(nt.RichText.Content,{value:n})}),(0,Je.jsx)(nt.InnerBlocks.Content,{})]})},edit:Us,transforms:qs},Ks=()=>et({name:Zs,metadata:Ws,settings:Qs}),Ys=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"})});function Js(e){return e?(0,ot.__)("This embed will preserve its aspect ratio when the browser is resized."):(0,ot.__)("This embed may not preserve its aspect ratio when the browser is resized.")}const Xs=({blockSupportsResponsive:e,showEditButton:t,themeSupportsResponsive:o,allowResponsive:n,toggleResponsive:a,switchBackToURLInput:r})=>(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(tt.ToolbarGroup,{children:t&&(0,Je.jsx)(tt.ToolbarButton,{className:"components-toolbar__control",label:(0,ot.__)("Edit URL"),icon:Ys,onClick:r})})}),o&&e&&(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.PanelBody,{title:(0,ot.__)("Media settings"),className:"blocks-responsive",children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Resize for smaller devices"),checked:n,help:Js,onChange:a})})})]}),el=(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(tt.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z"})}),tl=(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(tt.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z"})}),ol=(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(tt.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})}),nl=(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(tt.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z"})}),al={foreground:"#1da1f2",src:(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.G,{children:(0,Je.jsx)(tt.Path,{d:"M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z"})})})},rl={foreground:"#ff0000",src:(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.Path,{d:"M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z"})})},il={foreground:"#3b5998",src:(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.Path,{d:"M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z"})})},sl=(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.G,{children:(0,Je.jsx)(tt.Path,{d:"M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z"})})}),ll={foreground:"#0073AA",src:(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.G,{children:(0,Je.jsx)(tt.Path,{d:"M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z"})})})},cl={foreground:"#1db954",src:(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.Path,{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325"})})},ul=(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.Path,{d:"m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z"})}),dl={foreground:"#1ab7ea",src:(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.G,{children:(0,Je.jsx)(tt.Path,{d:"M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z"})})})},pl=(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.Path,{d:"M22 12.068a2.184 2.184 0 0 0-2.186-2.186c-.592 0-1.13.233-1.524.609-1.505-1.075-3.566-1.774-5.86-1.864l1.004-4.695 3.261.699A1.56 1.56 0 1 0 18.255 3c-.61-.001-1.147.357-1.398.877l-3.638-.77a.382.382 0 0 0-.287.053.348.348 0 0 0-.161.251l-1.112 5.233c-2.33.072-4.426.77-5.95 1.864a2.201 2.201 0 0 0-1.523-.61 2.184 2.184 0 0 0-.896 4.176c-.036.215-.053.43-.053.663 0 3.37 3.924 6.111 8.763 6.111s8.763-2.724 8.763-6.11c0-.216-.017-.449-.053-.664A2.207 2.207 0 0 0 22 12.068Zm-15.018 1.56a1.56 1.56 0 0 1 3.118 0c0 .86-.699 1.558-1.559 1.558-.86.018-1.559-.699-1.559-1.559Zm8.728 4.139c-1.076 1.075-3.119 1.147-3.71 1.147-.61 0-2.652-.09-3.71-1.147a.4.4 0 0 1 0-.573.4.4 0 0 1 .574 0c.68.68 2.114.914 3.136.914 1.022 0 2.473-.233 3.136-.914a.4.4 0 0 1 .574 0 .436.436 0 0 1 0 .573Zm-.287-2.563a1.56 1.56 0 0 1 0-3.118c.86 0 1.56.699 1.56 1.56 0 .841-.7 1.558-1.56 1.558Z"})}),ml={foreground:"#35465c",src:(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.Path,{d:"M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z"})})},gl=(0,Je.jsxs)(tt.SVG,{viewBox:"0 0 24 24",children:[(0,Je.jsx)(tt.Path,{d:"M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z"}),(0,Je.jsx)(tt.Path,{d:"M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z"}),(0,Je.jsx)(tt.Path,{d:"M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z"})]}),hl=(0,Je.jsxs)(tt.SVG,{viewBox:"0 0 24 24",children:[(0,Je.jsx)(tt.Path,{d:"m.0206909 21 19.8160091-13.07806 3.5831 6.20826z",fill:"#4bc7ee"}),(0,Je.jsx)(tt.Path,{d:"m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z",fill:"#d4cdcb"}),(0,Je.jsx)(tt.Path,{d:"m.0206909 21 15.2439091-16.38571 4.3029 7.32271z",fill:"#c3d82e"}),(0,Je.jsx)(tt.Path,{d:"m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z",fill:"#e4ecb0"}),(0,Je.jsx)(tt.Path,{d:"m.0206909 21 19.5468091-9.063 1.6621 2.8344z",fill:"#209dbd"}),(0,Je.jsx)(tt.Path,{d:"m.0206909 21 17.9209091-11.82623 1.6259 2.76323z",fill:"#7cb3c9"})]}),xl=(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.Path,{d:"M11.903 16.568c-1.82 0-3.124-1.281-3.124-2.967a2.987 2.987 0 0 1 2.989-2.989c1.663 0 2.944 1.304 2.944 3.034 0 1.663-1.281 2.922-2.81 2.922ZM17.997 3l-3.308.73v5.107c-.809-1.034-2.045-1.37-3.505-1.37-1.529 0-2.9.561-4.023 1.662-1.259 1.214-1.933 2.764-1.933 4.495 0 1.888.72 3.506 2.113 4.742 1.056.944 2.314 1.415 3.775 1.415 1.438 0 2.517-.382 3.573-1.415v1.415h3.308V3Z",fill:"#333436"})}),_l=(0,Je.jsx)(tt.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(tt.Path,{d:"M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"})}),bl=(0,Je.jsx)(tt.SVG,{viewBox:"0 0 44 44",children:(0,Je.jsx)(tt.Path,{d:"M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z"})}),yl={foreground:"#f43e37",src:(0,Je.jsxs)(tt.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,Je.jsx)(tt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M24,12A12,12,0,1,1,12,0,12,12,0,0,1,24,12Z"}),(0,Je.jsx)(tt.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M2.67,12a9.33,9.33,0,0,1,18.66,0H19a7,7,0,1,0-7,7v2.33A9.33,9.33,0,0,1,2.67,12ZM12,17.6A5.6,5.6,0,1,1,17.6,12h-2A3.56,3.56,0,1,0,12,15.56Z",fill:"#fff"})]})},fl=(0,Je.jsx)(tt.SVG,{viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.Path,{fill:"#0a7aff",d:"M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z"})}),vl=()=>(0,Je.jsx)("div",{className:"wp-block-embed is-loading",children:(0,Je.jsx)(tt.Spinner,{})}),kl=({icon:e,label:t,value:o,onSubmit:n,onChange:a,cannotEmbed:r,fallback:i,tryAgain:s})=>(0,Je.jsxs)(tt.Placeholder,{icon:(0,Je.jsx)(nt.BlockIcon,{icon:e,showColors:!0}),label:t,className:"wp-block-embed",instructions:(0,ot.__)("Paste a link to the content you want to display on your site."),children:[(0,Je.jsxs)("form",{onSubmit:n,children:[(0,Je.jsx)(tt.__experimentalInputControl,{__next40pxDefaultSize:!0,type:"url",value:o||"",className:"wp-block-embed__placeholder-input",label:t,hideLabelFromVision:!0,placeholder:(0,ot.__)("Enter URL to embed here…"),onChange:a}),(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,ot._x)("Embed","button label")})]}),(0,Je.jsx)("div",{className:"wp-block-embed__learn-more",children:(0,Je.jsx)(tt.ExternalLink,{href:(0,ot.__)("https://wordpress.org/documentation/article/embeds/"),children:(0,ot.__)("Learn more about embeds")})}),r&&(0,Je.jsxs)(tt.__experimentalVStack,{spacing:3,className:"components-placeholder__error",children:[(0,Je.jsx)("div",{className:"components-placeholder__instructions",children:(0,ot.__)("Sorry, this content could not be embedded.")}),(0,Je.jsxs)(tt.__experimentalHStack,{expanded:!1,spacing:3,justify:"flex-start",children:[(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:s,children:(0,ot._x)("Try again","button label")})," ",(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:i,children:(0,ot._x)("Convert to link","button label")})]})]})]}),wl={class:"className",frameborder:"frameBorder",marginheight:"marginHeight",marginwidth:"marginWidth"};function Cl({html:e}){const t=(0,st.useRef)(),o=(0,st.useMemo)((()=>{const t=(new window.DOMParser).parseFromString(e,"text/html").querySelector("iframe"),o={};return t?(Array.from(t.attributes).forEach((({name:e,value:t})=>{"style"!==e&&(o[wl[e]||e]=t)})),o):o}),[e]);return(0,st.useEffect)((()=>{const{ownerDocument:e}=t.current,{defaultView:n}=e;function a({data:{secret:e,message:n,value:a}={}}){"height"===n&&e===o["data-secret"]&&(t.current.height=a)}return n.addEventListener("message",a),()=>{n.removeEventListener("message",a)}}),[]),(0,Je.jsx)("div",{className:"wp-block-embed__wrapper",children:(0,Je.jsx)("iframe",{ref:(0,ut.useMergeRefs)([t,(0,ut.useFocusableIframe)()]),title:o.title,...o})})}function jl({preview:e,previewable:t,url:o,type:n,isSelected:a,className:r,icon:i,label:s}){const[l,c]=(0,st.useState)(!1);!a&&l&&c(!1);const u=()=>{c(!0)},{scripts:d}=e,p="photo"===n?(e=>{const t=e.url||e.thumbnail_url,o=(0,Je.jsx)("p",{children:(0,Je.jsx)("img",{src:t,alt:e.title,width:"100%"})});return(0,st.renderToString)(o)})(e):e.html,m=(0,vt.getAuthority)(o),g=(0,ot.sprintf)((0,ot.__)("Embedded content from %s"),m),h=ft(n,r,"wp-block-embed__wrapper"),x="wp-embed"===n?(0,Je.jsx)(Cl,{html:p}):(0,Je.jsxs)("div",{className:"wp-block-embed__wrapper",children:[(0,Je.jsx)(tt.SandBox,{html:p,scripts:d,title:g,type:h,onFocus:u}),!l&&(0,Je.jsx)("div",{className:"block-library-embed__interactive-overlay",onMouseUp:u})]});return(0,Je.jsx)(Je.Fragment,{children:t?x:(0,Je.jsxs)(tt.Placeholder,{icon:(0,Je.jsx)(nt.BlockIcon,{icon:i,showColors:!0}),label:s,children:[(0,Je.jsx)("p",{className:"components-placeholder__error",children:(0,Je.jsx)("a",{href:o,children:o})}),(0,Je.jsx)("p",{className:"components-placeholder__error",children:(0,ot.sprintf)((0,ot.__)("Embedded content from %s can't be previewed in the editor."),m)})]})})}const Sl=e=>{const{attributes:{providerNameSlug:t,previewable:o,responsive:n,url:a},attributes:r,isSelected:i,onReplace:s,setAttributes:l,insertBlocksAfter:c,onFocus:u}=e,d={title:(0,ot._x)("Embed","block title"),icon:el},{icon:p,title:m}=(g=t,(0,Ke.getBlockVariations)($t)?.find((({name:e})=>e===g))||d);var g;const[h,x]=(0,st.useState)(a),[_,b]=(0,st.useState)(!1),{invalidateResolution:y}=(0,it.useDispatch)(ct.store),{preview:f,fetching:v,themeSupportsResponsive:k,cannotEmbed:w,hasResolved:C}=(0,it.useSelect)((e=>{const{getEmbedPreview:t,isPreviewEmbedFallback:o,isRequestingEmbedPreview:n,getThemeSupports:r,hasFinishedResolution:i}=e(ct.store);if(!a)return{fetching:!1,cannotEmbed:!1};const s=t(a),l=o(a),c=!!s&&!(!1===s?.html&&void 0===s?.type)&&!(404===s?.data?.status);return{preview:c?s:void 0,fetching:n(a),themeSupportsResponsive:r()["responsive-embeds"],cannotEmbed:!c||l,hasResolved:i("getEmbedPreview",[a])}}),[a]),j=()=>((e,t,o,n)=>{const{allowResponsive:a,className:r}=e;return{...e,...Qt(t,o,r,n,a)}})(r,f,m,n);(0,st.useEffect)((()=>{if(f?.html||!w||!C)return;const e=a.replace(/\/$/,"");x(e),b(!1),l({url:e})}),[f?.html,a,w,C,l]),(0,st.useEffect)((()=>{if(w&&!v&&h&&"x.com"===(0,vt.getAuthority)(h)){const e=new URL(h);e.host="twitter.com",l({url:e.toString()})}}),[h,w,v,l]),(0,st.useEffect)((()=>{if(f&&!_){const t=j();if(l(t),s){const o=qt(e,t);o&&s(o)}}}),[f,_]);const S=(0,nt.useBlockProps)();if(v)return(0,Je.jsx)(Ye.View,{...S,children:(0,Je.jsx)(vl,{})});const B=(0,ot.sprintf)((0,ot.__)("%s URL"),m);if(!f||w||_)return(0,Je.jsx)(Ye.View,{...S,children:(0,Je.jsx)(kl,{icon:p,label:B,onFocus:u,onSubmit:e=>{e&&e.preventDefault();const t=Wt(r.className);b(!1),l({url:h,className:t})},value:h,cannotEmbed:w,onChange:e=>x(e),fallback:()=>function(e,t){const o=(0,Je.jsx)("a",{href:e,children:e});t((0,Ke.createBlock)("core/paragraph",{content:(0,st.renderToString)(o)}))}(h,s),tryAgain:()=>{y("getEmbedPreview",[h])}})});const{caption:T,type:N,allowResponsive:P,className:I}=j(),M=ft(I,e.className);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Xs,{showEditButton:f&&!w,themeSupportsResponsive:k,blockSupportsResponsive:n,allowResponsive:P,toggleResponsive:()=>{const{allowResponsive:e,className:t}=r,{html:o}=f,a=!e;l({allowResponsive:a,className:Zt(o,t,n&&a)})},switchBackToURLInput:()=>b(!0)}),(0,Je.jsxs)("figure",{...S,className:ft(S.className,M,{[`is-type-${N}`]:N,[`is-provider-${t}`]:t,[`wp-block-embed-${t}`]:t}),children:[(0,Je.jsx)(jl,{preview:f,previewable:o,className:M,url:h,type:N,caption:T,onCaptionChange:e=>l({caption:e}),isSelected:i,icon:p,label:B,insertBlocksAfter:c,attributes:r,setAttributes:l}),(0,Je.jsx)(Yt,{attributes:r,setAttributes:l,isSelected:i,insertBlocksAfter:c,label:(0,ot.__)("Embed caption text"),showToolbarButton:i})]})]})};const{name:Bl}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},type:{type:"string",role:"content"},providerNameSlug:{type:"string",role:"content"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1,role:"content"},previewable:{type:"boolean",default:!0,role:"content"}},supports:{align:!0,spacing:{margin:!0},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},Tl={from:[{type:"raw",isMatch:e=>"P"===e.nodeName&&/^\s*(https?:\/\/\S+)\s*$/i.test(e.textContent)&&1===e.textContent?.match(/https/gi)?.length,transform:e=>(0,Ke.createBlock)(Bl,{url:e.textContent.trim()})}],to:[{type:"block",blocks:["core/paragraph"],isMatch:({url:e})=>!!e,transform:({url:e,caption:t,className:o})=>{let n=`<a href="${e}">${e}</a>`;return t?.trim()&&(n+=`<br />${t}`),(0,Ke.createBlock)("core/paragraph",{content:n,className:Wt(o)})}}]},Nl=Tl;function Pl(e){return(0,ot.sprintf)((0,ot.__)("%s Embed"),e)}const Il=[{name:"twitter",title:Pl("Twitter"),icon:al,keywords:["tweet",(0,ot.__)("social")],description:(0,ot.__)("Embed a tweet."),patterns:[/^https?:\/\/(www\.)?twitter\.com\/.+/i],attributes:{providerNameSlug:"twitter",responsive:!0}},{name:"youtube",title:Pl("YouTube"),icon:rl,keywords:[(0,ot.__)("music"),(0,ot.__)("video")],description:(0,ot.__)("Embed a YouTube video."),patterns:[/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i,/^https?:\/\/youtu\.be\/.+/i],attributes:{providerNameSlug:"youtube",responsive:!0}},{name:"facebook",title:Pl("Facebook"),icon:il,keywords:[(0,ot.__)("social")],description:(0,ot.__)("Embed a Facebook post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"facebook",previewable:!1,responsive:!0}},{name:"instagram",title:Pl("Instagram"),icon:sl,keywords:[(0,ot.__)("image"),(0,ot.__)("social")],description:(0,ot.__)("Embed an Instagram post."),scope:["block"],patterns:[],attributes:{providerNameSlug:"instagram",responsive:!0}},{name:"wordpress",title:Pl("WordPress"),icon:ll,keywords:[(0,ot.__)("post"),(0,ot.__)("blog")],description:(0,ot.__)("Embed a WordPress post."),attributes:{providerNameSlug:"wordpress"}},{name:"soundcloud",title:Pl("SoundCloud"),icon:tl,keywords:[(0,ot.__)("music"),(0,ot.__)("audio")],description:(0,ot.__)("Embed SoundCloud content."),patterns:[/^https?:\/\/(www\.)?soundcloud\.com\/.+/i],attributes:{providerNameSlug:"soundcloud",responsive:!0}},{name:"spotify",title:Pl("Spotify"),icon:cl,keywords:[(0,ot.__)("music"),(0,ot.__)("audio")],description:(0,ot.__)("Embed Spotify content."),patterns:[/^https?:\/\/(open|play)\.spotify\.com\/.+/i],attributes:{providerNameSlug:"spotify",responsive:!0}},{name:"flickr",title:Pl("Flickr"),icon:ul,keywords:[(0,ot.__)("image")],description:(0,ot.__)("Embed Flickr content."),patterns:[/^https?:\/\/(www\.)?flickr\.com\/.+/i,/^https?:\/\/flic\.kr\/.+/i],attributes:{providerNameSlug:"flickr",responsive:!0}},{name:"vimeo",title:Pl("Vimeo"),icon:dl,keywords:[(0,ot.__)("video")],description:(0,ot.__)("Embed a Vimeo video."),patterns:[/^https?:\/\/(www\.)?vimeo\.com\/.+/i],attributes:{providerNameSlug:"vimeo",responsive:!0}},{name:"animoto",title:Pl("Animoto"),icon:hl,description:(0,ot.__)("Embed an Animoto video."),patterns:[/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i],attributes:{providerNameSlug:"animoto",responsive:!0}},{name:"cloudup",title:Pl("Cloudup"),icon:el,description:(0,ot.__)("Embed Cloudup content."),patterns:[/^https?:\/\/cloudup\.com\/.+/i],attributes:{providerNameSlug:"cloudup",responsive:!0}},{name:"collegehumor",title:Pl("CollegeHumor"),icon:nl,description:(0,ot.__)("Embed CollegeHumor content."),scope:["block"],patterns:[],attributes:{providerNameSlug:"collegehumor",responsive:!0}},{name:"crowdsignal",title:Pl("Crowdsignal"),icon:el,keywords:["polldaddy",(0,ot.__)("survey")],description:(0,ot.__)("Embed Crowdsignal (formerly Polldaddy) content."),patterns:[/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.crowdsignal\.net|.+\.survey\.fm)\/.+/i],attributes:{providerNameSlug:"crowdsignal",responsive:!0}},{name:"dailymotion",title:Pl("Dailymotion"),icon:xl,keywords:[(0,ot.__)("video")],description:(0,ot.__)("Embed a Dailymotion video."),patterns:[/^https?:\/\/(www\.)?dailymotion\.com\/.+/i],attributes:{providerNameSlug:"dailymotion",responsive:!0}},{name:"imgur",title:Pl("Imgur"),icon:ol,description:(0,ot.__)("Embed Imgur content."),patterns:[/^https?:\/\/(.+\.)?imgur\.com\/.+/i],attributes:{providerNameSlug:"imgur",responsive:!0}},{name:"issuu",title:Pl("Issuu"),icon:el,description:(0,ot.__)("Embed Issuu content."),patterns:[/^https?:\/\/(www\.)?issuu\.com\/.+/i],attributes:{providerNameSlug:"issuu",responsive:!0}},{name:"kickstarter",title:Pl("Kickstarter"),icon:el,description:(0,ot.__)("Embed Kickstarter content."),patterns:[/^https?:\/\/(www\.)?kickstarter\.com\/.+/i,/^https?:\/\/kck\.st\/.+/i],attributes:{providerNameSlug:"kickstarter",responsive:!0}},{name:"mixcloud",title:Pl("Mixcloud"),icon:tl,keywords:[(0,ot.__)("music"),(0,ot.__)("audio")],description:(0,ot.__)("Embed Mixcloud content."),patterns:[/^https?:\/\/(www\.)?mixcloud\.com\/.+/i],attributes:{providerNameSlug:"mixcloud",responsive:!0}},{name:"pocket-casts",title:Pl("Pocket Casts"),icon:yl,keywords:[(0,ot.__)("podcast"),(0,ot.__)("audio")],description:(0,ot.__)("Embed a podcast player from Pocket Casts."),patterns:[/^https:\/\/pca.st\/\w+/i],attributes:{providerNameSlug:"pocket-casts",responsive:!0}},{name:"reddit",title:Pl("Reddit"),icon:pl,description:(0,ot.__)("Embed a Reddit thread."),patterns:[/^https?:\/\/(www\.)?reddit\.com\/.+/i],attributes:{providerNameSlug:"reddit",responsive:!0}},{name:"reverbnation",title:Pl("ReverbNation"),icon:tl,description:(0,ot.__)("Embed ReverbNation content."),patterns:[/^https?:\/\/(www\.)?reverbnation\.com\/.+/i],attributes:{providerNameSlug:"reverbnation",responsive:!0}},{name:"screencast",title:Pl("Screencast"),icon:nl,description:(0,ot.__)("Embed Screencast content."),patterns:[/^https?:\/\/(www\.)?screencast\.com\/.+/i],attributes:{providerNameSlug:"screencast",responsive:!0}},{name:"scribd",title:Pl("Scribd"),icon:el,description:(0,ot.__)("Embed Scribd content."),patterns:[/^https?:\/\/(www\.)?scribd\.com\/.+/i],attributes:{providerNameSlug:"scribd",responsive:!0}},{name:"smugmug",title:Pl("SmugMug"),icon:ol,description:(0,ot.__)("Embed SmugMug content."),patterns:[/^https?:\/\/(.+\.)?smugmug\.com\/.*/i],attributes:{providerNameSlug:"smugmug",previewable:!1,responsive:!0}},{name:"speaker-deck",title:Pl("Speaker Deck"),icon:el,description:(0,ot.__)("Embed Speaker Deck content."),patterns:[/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i],attributes:{providerNameSlug:"speaker-deck",responsive:!0}},{name:"tiktok",title:Pl("TikTok"),icon:nl,keywords:[(0,ot.__)("video")],description:(0,ot.__)("Embed a TikTok video."),patterns:[/^https?:\/\/(www\.)?tiktok\.com\/.+/i],attributes:{providerNameSlug:"tiktok",responsive:!0}},{name:"ted",title:Pl("TED"),icon:nl,description:(0,ot.__)("Embed a TED video."),patterns:[/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i],attributes:{providerNameSlug:"ted",responsive:!0}},{name:"tumblr",title:Pl("Tumblr"),icon:ml,keywords:[(0,ot.__)("social")],description:(0,ot.__)("Embed a Tumblr post."),patterns:[/^https?:\/\/(.+)\.tumblr\.com\/.+/i],attributes:{providerNameSlug:"tumblr",responsive:!0}},{name:"videopress",title:Pl("VideoPress"),icon:nl,keywords:[(0,ot.__)("video")],description:(0,ot.__)("Embed a VideoPress video."),patterns:[/^https?:\/\/videopress\.com\/.+/i],attributes:{providerNameSlug:"videopress",responsive:!0}},{name:"wordpress-tv",title:Pl("WordPress.tv"),icon:nl,description:(0,ot.__)("Embed a WordPress.tv video."),patterns:[/^https?:\/\/wordpress\.tv\/.+/i],attributes:{providerNameSlug:"wordpress-tv",responsive:!0}},{name:"amazon-kindle",title:Pl("Amazon Kindle"),icon:gl,keywords:[(0,ot.__)("ebook")],description:(0,ot.__)("Embed Amazon Kindle content."),patterns:[/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i,/^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i],attributes:{providerNameSlug:"amazon-kindle"}},{name:"pinterest",title:Pl("Pinterest"),icon:_l,keywords:[(0,ot.__)("social"),(0,ot.__)("bookmark")],description:(0,ot.__)("Embed Pinterest pins, boards, and profiles."),patterns:[/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i],attributes:{providerNameSlug:"pinterest"}},{name:"wolfram-cloud",title:Pl("Wolfram"),icon:bl,description:(0,ot.__)("Embed Wolfram notebook content."),patterns:[/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i],attributes:{providerNameSlug:"wolfram-cloud",responsive:!0}},{name:"bluesky",title:Pl("Bluesky"),icon:fl,description:(0,ot.__)("Embed a Bluesky post."),patterns:[/^https?:\/\/bsky\.app\/profile\/.+\/post\/.+/i],attributes:{providerNameSlug:"bluesky"}}];Il.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.providerNameSlug===t.providerNameSlug)}));const Ml=Il,{attributes:Dl}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},type:{type:"string",role:"content"},providerNameSlug:{type:"string",role:"content"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1,role:"content"},previewable:{type:"boolean",default:!0,role:"content"}},supports:{align:!0,spacing:{margin:!0},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},zl={attributes:Dl,save({attributes:e}){const{url:t,caption:o,type:n,providerNameSlug:a}=e;if(!t)return null;const r=ft("wp-block-embed",{[`is-type-${n}`]:n,[`is-provider-${a}`]:a,[`wp-block-embed-${a}`]:a});return(0,Je.jsxs)("figure",{...nt.useBlockProps.save({className:r}),children:[(0,Je.jsx)("div",{className:"wp-block-embed__wrapper",children:`\n${t}\n`}),!nt.RichText.isEmpty(o)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:o})]})}},Al={attributes:Dl,save({attributes:{url:e,caption:t,type:o,providerNameSlug:n}}){if(!e)return null;const a=ft("wp-block-embed",{[`is-type-${o}`]:o,[`is-provider-${n}`]:n});return(0,Je.jsxs)("figure",{className:a,children:[`\n${e}\n`,!nt.RichText.isEmpty(t)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:t})]})}},Rl=[zl,Al],Hl={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/embed",title:"Embed",category:"embed",description:"Add a block that displays content pulled from other sites, like Twitter or YouTube.",textdomain:"default",attributes:{url:{type:"string",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},type:{type:"string",role:"content"},providerNameSlug:{type:"string",role:"content"},allowResponsive:{type:"boolean",default:!0},responsive:{type:"boolean",default:!1,role:"content"},previewable:{type:"boolean",default:!0,role:"content"}},supports:{align:!0,spacing:{margin:!0},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-embed-editor",style:"wp-block-embed"},{name:Ll}=Hl,Vl={icon:el,edit:Sl,save:function({attributes:e}){const{url:t,caption:o,type:n,providerNameSlug:a}=e;if(!t)return null;const r=ft("wp-block-embed",{[`is-type-${n}`]:n,[`is-provider-${a}`]:a,[`wp-block-embed-${a}`]:a});return(0,Je.jsxs)("figure",{...nt.useBlockProps.save({className:r}),children:[(0,Je.jsx)("div",{className:"wp-block-embed__wrapper",children:`\n${t}\n`}),!nt.RichText.isEmpty(o)&&(0,Je.jsx)(nt.RichText.Content,{className:(0,nt.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:o})]})},transforms:Nl,variations:Ml,deprecated:Rl},Fl=()=>et({name:Ll,metadata:Hl,settings:Vl}),El=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"})}),Ol={attributes:{id:{type:"number"},href:{type:"string"},fileId:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"id"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0},save({attributes:e}){const{href:t,fileId:o,fileName:n,textLinkHref:a,textLinkTarget:r,showDownloadButton:i,downloadButtonText:s,displayPreview:l,previewHeight:c}=e,u=nt.RichText.isEmpty(n)?(0,ot.__)("PDF embed"):(0,ot.sprintf)((0,ot.__)("Embed of %s."),n),d=!nt.RichText.isEmpty(n),p=d?o:void 0;return t&&(0,Je.jsxs)("div",{...nt.useBlockProps.save(),children:[l&&(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsx)("object",{className:"wp-block-file__embed",data:t,type:"application/pdf",style:{width:"100%",height:`${c}px`},"aria-label":u})}),d&&(0,Je.jsx)("a",{id:p,href:a,target:r,rel:r?"noreferrer noopener":void 0,children:(0,Je.jsx)(nt.RichText.Content,{value:n})}),i&&(0,Je.jsx)("a",{href:t,className:ft("wp-block-file__button",(0,nt.__experimentalGetElementClassName)("button")),download:!0,"aria-describedby":p,children:(0,Je.jsx)(nt.RichText.Content,{value:s})})]})}},$l={attributes:{id:{type:"number"},href:{type:"string"},fileId:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"id"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0},save({attributes:e}){const{href:t,fileId:o,fileName:n,textLinkHref:a,textLinkTarget:r,showDownloadButton:i,downloadButtonText:s,displayPreview:l,previewHeight:c}=e,u=nt.RichText.isEmpty(n)?(0,ot.__)("PDF embed"):(0,ot.sprintf)((0,ot.__)("Embed of %s."),n),d=!nt.RichText.isEmpty(n),p=d?o:void 0;return t&&(0,Je.jsxs)("div",{...nt.useBlockProps.save(),children:[l&&(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsx)("object",{className:"wp-block-file__embed",data:t,type:"application/pdf",style:{width:"100%",height:`${c}px`},"aria-label":u})}),d&&(0,Je.jsx)("a",{id:p,href:a,target:r,rel:r?"noreferrer noopener":void 0,children:(0,Je.jsx)(nt.RichText.Content,{value:n})}),i&&(0,Je.jsx)("a",{href:t,className:"wp-block-file__button",download:!0,"aria-describedby":p,children:(0,Je.jsx)(nt.RichText.Content,{value:s})})]})}},Gl={attributes:{id:{type:"number"},href:{type:"string"},fileName:{type:"string",source:"html",selector:"a:not([download])"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"string",source:"html",selector:"a[download]"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0},save({attributes:e}){const{href:t,fileName:o,textLinkHref:n,textLinkTarget:a,showDownloadButton:r,downloadButtonText:i,displayPreview:s,previewHeight:l}=e,c=nt.RichText.isEmpty(o)?(0,ot.__)("PDF embed"):(0,ot.sprintf)((0,ot.__)("Embed of %s."),o);return t&&(0,Je.jsxs)("div",{...nt.useBlockProps.save(),children:[s&&(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsx)("object",{className:"wp-block-file__embed",data:t,type:"application/pdf",style:{width:"100%",height:`${l}px`},"aria-label":c})}),!nt.RichText.isEmpty(o)&&(0,Je.jsx)("a",{href:n,target:a,rel:a?"noreferrer noopener":void 0,children:(0,Je.jsx)(nt.RichText.Content,{value:o})}),r&&(0,Je.jsx)("a",{href:t,className:"wp-block-file__button",download:!0,children:(0,Je.jsx)(nt.RichText.Content,{value:i})})]})}},Ul=[Ol,$l,Gl];function ql({hrefs:e,openInNewWindow:t,showDownloadButton:o,changeLinkDestinationOption:n,changeOpenInNewWindow:a,changeShowDownloadButton:r,displayPreview:i,changeDisplayPreview:s,previewHeight:l,changePreviewHeight:c}){const{href:u,textLinkHref:d,attachmentPage:p}=e;let m=[{value:u,label:(0,ot.__)("URL")}];return p&&(m=[{value:u,label:(0,ot.__)("Media file")},{value:p,label:(0,ot.__)("Attachment page")}]),(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsxs)(nt.InspectorControls,{children:[u.endsWith(".pdf")&&(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("PDF settings"),children:[(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show inline embed"),help:i?(0,ot.__)("Note: Most phone and tablet browsers won't display embedded PDFs."):null,checked:!!i,onChange:s}),i&&(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Height in pixels"),min:Zl,max:Math.max(Ql,l),value:l,onChange:c})]}),(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link to"),value:d,options:m,onChange:n}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open in new tab"),checked:t,onChange:a}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show download button"),checked:o,onChange:r})]})]})})}const Wl=e=>{let t;try{t=new window.ActiveXObject(e)}catch(e){t=void 0}return t},Zl=200,Ql=2e3;function Kl({text:e,disabled:t}){const{createNotice:o}=(0,it.useDispatch)(Rt.store),n=(0,ut.useCopyToClipboard)(e,(()=>{o("info",(0,ot.__)("Copied URL to clipboard."),{isDismissible:!0,type:"snackbar"})}));return(0,Je.jsx)(tt.ToolbarButton,{className:"components-clipboard-toolbar-button",ref:n,disabled:t,children:(0,ot.__)("Copy URL")})}const Yl=function({attributes:e,isSelected:t,setAttributes:o,clientId:n}){const{id:a,fileName:r,href:i,textLinkHref:s,textLinkTarget:l,showDownloadButton:c,downloadButtonText:u,displayPreview:d,previewHeight:p}=e,[m,g]=(0,st.useState)(e.blob),{media:h}=(0,it.useSelect)((e=>({media:void 0===a?void 0:e(ct.store).getMedia(a)})),[a]),{createErrorNotice:x}=(0,it.useDispatch)(Rt.store),{toggleSelection:_,__unstableMarkNextChangeAsNotPersistent:b}=(0,it.useDispatch)(nt.store);function y(t){var a,r;if(!t||!t.url)return o({href:void 0,fileName:void 0,textLinkHref:void 0,id:void 0,fileId:void 0,displayPreview:void 0,previewHeight:void 0}),void g();if((0,lt.isBlobURL)(t.url))return void g(t.url);const i=t.url.endsWith(".pdf"),s={displayPreview:i?null===(a=e.displayPreview)||void 0===a||a:void 0,previewHeight:i?null!==(r=e.previewHeight)&&void 0!==r?r:600:void 0};o({href:t.url,fileName:t.title,textLinkHref:t.url,id:t.id,fileId:`wp-block-file--media-${n}`,blob:void 0,...s}),g()}function f(e){o({href:void 0}),x(e,{type:"snackbar"})}pt({url:m,onChange:y,onError:f}),(0,st.useEffect)((()=>{nt.RichText.isEmpty(u)&&(b(),o({downloadButtonText:(0,ot._x)("Download","button label")}))}),[]);const v=h&&h.link,k=(0,nt.useBlockProps)({className:ft(!!m&&(0,tt.__unstableGetAnimateClassName)({type:"loading"}),{"is-transient":!!m})}),w=!(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!Wl("AcroPDF.PDF")&&!Wl("PDF.PdfCtrl"))&&d;return i||m?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(ql,{hrefs:{href:i||m,textLinkHref:s,attachmentPage:v},openInNewWindow:!!l,showDownloadButton:c,changeLinkDestinationOption:function(e){o({textLinkHref:e})},changeOpenInNewWindow:function(e){o({textLinkTarget:!!e&&"_blank"})},changeShowDownloadButton:function(e){o({showDownloadButton:e})},displayPreview:d,changeDisplayPreview:function(e){o({displayPreview:e})},previewHeight:p,changePreviewHeight:function(e){const t=Math.max(parseInt(e,10),Zl);o({previewHeight:t})}}),(0,Je.jsxs)(nt.BlockControls,{group:"other",children:[(0,Je.jsx)(nt.MediaReplaceFlow,{mediaId:a,mediaURL:i,accept:"*",onSelect:y,onError:f,onReset:()=>y(void 0)}),(0,Je.jsx)(Kl,{text:i,disabled:(0,lt.isBlobURL)(i)})]}),(0,Je.jsxs)("div",{...k,children:[w&&(0,Je.jsxs)(tt.ResizableBox,{size:{height:p,width:"100%"},minHeight:Zl,maxHeight:Ql,grid:[1,10],enable:{top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},onResizeStart:()=>_(!1),onResizeStop:function(e,t,n,a){_(!0);const r=parseInt(p+a.height,10);o({previewHeight:r})},showHandle:t,children:[(0,Je.jsx)("object",{className:"wp-block-file__preview",data:i,type:"application/pdf","aria-label":(0,ot.__)("Embed of the selected PDF file.")}),!t&&(0,Je.jsx)("div",{className:"wp-block-file__preview-overlay"})]}),(0,Je.jsxs)("div",{className:"wp-block-file__content-wrapper",children:[(0,Je.jsx)(nt.RichText,{identifier:"fileName",tagName:"a",value:r,placeholder:(0,ot.__)("Write file name…"),withoutInteractiveFormatting:!0,onChange:e=>o({fileName:ko(e)}),href:s}),c&&(0,Je.jsx)("div",{className:"wp-block-file__button-richtext-wrapper",children:(0,Je.jsx)(nt.RichText,{identifier:"downloadButtonText",tagName:"div","aria-label":(0,ot.__)("Download button text"),className:ft("wp-block-file__button",(0,nt.__experimentalGetElementClassName)("button")),value:u,withoutInteractiveFormatting:!0,placeholder:(0,ot.__)("Add text…"),onChange:e=>o({downloadButtonText:ko(e)})})})]})]})]}):(0,Je.jsx)("div",{...k,children:(0,Je.jsx)(nt.MediaPlaceholder,{icon:(0,Je.jsx)(nt.BlockIcon,{icon:El}),labels:{title:(0,ot.__)("File"),instructions:(0,ot.__)("Drag and drop a file, upload, or choose from your library.")},onSelect:y,onError:f,accept:"*"})})};const Jl={from:[{type:"files",isMatch:e=>e.length>0,priority:15,transform:e=>{const t=[];return e.forEach((e=>{const o=(0,lt.createBlobURL)(e);e.type.startsWith("video/")?t.push((0,Ke.createBlock)("core/video",{blob:(0,lt.createBlobURL)(e)})):e.type.startsWith("image/")?t.push((0,Ke.createBlock)("core/image",{blob:(0,lt.createBlobURL)(e)})):e.type.startsWith("audio/")?t.push((0,Ke.createBlock)("core/audio",{blob:(0,lt.createBlobURL)(e)})):t.push((0,Ke.createBlock)("core/file",{blob:o,fileName:e.name}))})),t}},{type:"block",blocks:["core/audio"],transform:e=>(0,Ke.createBlock)("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/video"],transform:e=>(0,Ke.createBlock)("core/file",{href:e.src,fileName:e.caption,textLinkHref:e.src,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/image"],transform:e=>(0,Ke.createBlock)("core/file",{href:e.url,fileName:e.caption||(0,vt.getFilename)(e.url),textLinkHref:e.url,id:e.id,anchor:e.anchor})}],to:[{type:"block",blocks:["core/audio"],isMatch:({id:e})=>{if(!e)return!1;const{getMedia:t}=(0,it.select)(ct.store),o=t(e);return!!o&&o.mime_type.includes("audio")},transform:e=>(0,Ke.createBlock)("core/audio",{src:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/video"],isMatch:({id:e})=>{if(!e)return!1;const{getMedia:t}=(0,it.select)(ct.store),o=t(e);return!!o&&o.mime_type.includes("video")},transform:e=>(0,Ke.createBlock)("core/video",{src:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})},{type:"block",blocks:["core/image"],isMatch:({id:e})=>{if(!e)return!1;const{getMedia:t}=(0,it.select)(ct.store),o=t(e);return!!o&&o.mime_type.includes("image")},transform:e=>(0,Ke.createBlock)("core/image",{url:e.href,caption:e.fileName,id:e.id,anchor:e.anchor})}]},Xl=Jl,ec={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/file",title:"File",category:"media",description:"Add a link to a downloadable file.",keywords:["document","pdf","download"],textdomain:"default",attributes:{id:{type:"number"},blob:{type:"string",role:"local"},href:{type:"string",role:"content"},fileId:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"id"},fileName:{type:"rich-text",source:"rich-text",selector:"a:not([download])",role:"content"},textLinkHref:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"href",role:"content"},textLinkTarget:{type:"string",source:"attribute",selector:"a:not([download])",attribute:"target"},showDownloadButton:{type:"boolean",default:!0},downloadButtonText:{type:"rich-text",source:"rich-text",selector:"a[download]",role:"content"},displayPreview:{type:"boolean"},previewHeight:{type:"number",default:600}},supports:{anchor:!0,align:!0,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,text:!1,__experimentalDefaultControls:{background:!0,link:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}},interactivity:!0},editorStyle:"wp-block-file-editor",style:"wp-block-file"},{name:tc}=ec,oc={icon:El,example:{attributes:{href:"https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg",fileName:(0,ot._x)("Armstrong_Small_Step","Name of the file")}},transforms:Xl,deprecated:Ul,edit:Yl,save:function({attributes:e}){const{href:t,fileId:o,fileName:n,textLinkHref:a,textLinkTarget:r,showDownloadButton:i,downloadButtonText:s,displayPreview:l,previewHeight:c}=e,u=nt.RichText.isEmpty(n)?"PDF embed":n.toString(),d=!nt.RichText.isEmpty(n),p=d?o:void 0;return t&&(0,Je.jsxs)("div",{...nt.useBlockProps.save(),children:[l&&(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsx)("object",{className:"wp-block-file__embed",data:t,type:"application/pdf",style:{width:"100%",height:`${c}px`},"aria-label":u})}),d&&(0,Je.jsx)("a",{id:p,href:a,target:r,rel:r?"noreferrer noopener":void 0,children:(0,Je.jsx)(nt.RichText.Content,{value:n})}),i&&(0,Je.jsx)("a",{href:t,className:ft("wp-block-file__button",(0,nt.__experimentalGetElementClassName)("button")),download:!0,"aria-describedby":p,children:(0,Je.jsx)(nt.RichText.Content,{value:s})})]})}},nc=()=>et({name:tc,metadata:ec,settings:oc}),ac=["core/form-submission-notification",{type:"success"},[["core/paragraph",{content:'<mark style="background-color:rgba(0, 0, 0, 0);color:#345C00" class="has-inline-color">'+(0,ot.__)("Your form has been submitted successfully")+"</mark>"}]]],rc=["core/form-submission-notification",{type:"error"},[["core/paragraph",{content:'<mark style="background-color:rgba(0, 0, 0, 0);color:#CF2E2E" class="has-inline-color">'+(0,ot.__)("There was an error submitting your form.")+"</mark>"}]]],ic=[ac,rc,["core/form-input",{type:"text",label:(0,ot.__)("Name"),required:!0}],["core/form-input",{type:"email",label:(0,ot.__)("Email"),required:!0}],["core/form-input",{type:"textarea",label:(0,ot.__)("Comment"),required:!0}],["core/form-submit-button",{}]],sc=({attributes:e,setAttributes:t,clientId:o})=>{const{action:n,method:a,email:r,submissionMethod:i}=e,s=(0,nt.useBlockProps)(),{hasInnerBlocks:l}=(0,it.useSelect)((e=>{const{getBlock:t}=e(nt.store),n=t(o);return{hasInnerBlocks:!(!n||!n.innerBlocks.length)}}),[o]),c=(0,nt.useInnerBlocksProps)(s,{template:ic,renderAppender:l?void 0:nt.InnerBlocks.ButtonBlockAppender});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Submissions method"),options:[{label:(0,ot.__)("Send email"),value:"email"},{label:(0,ot.__)("- Custom -"),value:"custom"}],value:i,onChange:e=>t({submissionMethod:e}),help:"custom"===i?(0,ot.__)('Select the method to use for form submissions. Additional options for the "custom" mode can be found in the "Advanced" section.'):(0,ot.__)("Select the method to use for form submissions.")}),"email"===i&&(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,autoComplete:"off",label:(0,ot.__)("Email for form submissions"),value:r,required:!0,onChange:e=>{t({email:e}),t({action:`mailto:${e}`}),t({method:"post"})},help:(0,ot.__)("The email address where form submissions will be sent. Separate multiple email addresses with a comma."),type:"email"})]})}),"email"!==i&&(0,Je.jsxs)(nt.InspectorControls,{group:"advanced",children:[(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Method"),options:[{label:"Get",value:"get"},{label:"Post",value:"post"}],value:a,onChange:e=>t({method:e}),help:(0,ot.__)("Select the method to use for form submissions.")}),(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,ot.__)("Form action"),value:n,onChange:e=>{t({action:e})},help:(0,ot.__)("The URL where the form should be submitted."),type:"url"})]}),(0,Je.jsx)("form",{...c,className:"wp-block-form",encType:"email"===i?"text/plain":null})]})};const lc=[{name:"comment-form",title:(0,ot.__)("Experimental Comment form"),description:(0,ot.__)("A comment form for posts and pages."),attributes:{submissionMethod:"custom",action:"{SITE_URL}/wp-comments-post.php",method:"post",anchor:"comment-form"},isDefault:!1,innerBlocks:[["core/form-input",{type:"text",name:"author",label:(0,ot.__)("Name"),required:!0,visibilityPermissions:"logged-out"}],["core/form-input",{type:"email",name:"email",label:(0,ot.__)("Email"),required:!0,visibilityPermissions:"logged-out"}],["core/form-input",{type:"textarea",name:"comment",label:(0,ot.__)("Comment"),required:!0,visibilityPermissions:"all"}],["core/form-submit-button",{}]],scope:["inserter","transform"],isActive:e=>!e?.type||"text"===e?.type},{name:"wp-privacy-form",title:(0,ot.__)("Experimental Privacy Request Form"),keywords:["GDPR"],description:(0,ot.__)("A form to request data exports and/or deletion."),attributes:{submissionMethod:"custom",action:"",method:"post",anchor:"gdpr-form"},isDefault:!1,innerBlocks:[ac,rc,["core/paragraph",{content:(0,ot.__)("To request an export or deletion of your personal data on this site, please fill-in the form below. You can define the type of request you wish to perform, and your email address. Once the form is submitted, you will receive a confirmation email with instructions on the next steps.")}],["core/form-input",{type:"email",name:"email",label:(0,ot.__)("Enter your email address."),required:!0,visibilityPermissions:"all"}],["core/form-input",{type:"checkbox",name:"export_personal_data",label:(0,ot.__)("Request data export"),required:!1,visibilityPermissions:"all"}],["core/form-input",{type:"checkbox",name:"remove_personal_data",label:(0,ot.__)("Request data deletion"),required:!1,visibilityPermissions:"all"}],["core/form-submit-button",{}],["core/form-input",{type:"hidden",name:"wp-action",value:"wp_privacy_send_request"}],["core/form-input",{type:"hidden",name:"wp-privacy-request",value:"1"}]],scope:["inserter","transform"],isActive:e=>!e?.type||"text"===e?.type}],cc=lc,uc={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/form",title:"Form",category:"common",allowedBlocks:["core/paragraph","core/heading","core/form-input","core/form-submit-button","core/form-submission-notification","core/group","core/columns"],description:"A form.",keywords:["container","wrapper","row","section"],textdomain:"default",icon:"feedback",attributes:{submissionMethod:{type:"string",default:"email"},method:{type:"string",default:"post"},action:{type:"string"},email:{type:"string"}},supports:{anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"form"}},{name:dc}=uc,pc={edit:sc,save:function({attributes:e}){const t=nt.useBlockProps.save(),{submissionMethod:o}=e;return(0,Je.jsx)("form",{...t,className:"wp-block-form",encType:"email"===o?"text/plain":null,children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})},variations:cc},mc=()=>{const e=["core/form"];return(0,Ns.addFilter)("blockEditor.__unstableCanInsertBlockType","core/block-library/preventInsertingFormIntoAnotherForm",((t,o,n,{getBlock:a,getBlockParentsByBlockName:r})=>{if("core/form"!==o.name)return t;for(const t of e){if(a(n)?.name===t||r(n,t).length)return!1}return!0})),et({name:dc,metadata:uc,settings:pc})};var gc=o(9681),hc=o.n(gc);const xc=window.wp.dom,_c=e=>hc()((0,xc.__unstableStripHTML)(e)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase().replace(/(^-+)|(-+$)/g,""),bc={attributes:{type:{type:"string",default:"text"},name:{type:"string"},label:{type:"string",default:"Label",selector:".wp-block-form-input__label-content",source:"html",role:"content"},inlineLabel:{type:"boolean",default:!1},required:{type:"boolean",default:!1,selector:".wp-block-form-input__input",source:"attribute",attribute:"required"},placeholder:{type:"string",selector:".wp-block-form-input__input",source:"attribute",attribute:"placeholder",role:"content"},value:{type:"string",default:"",selector:"input",source:"attribute",attribute:"value"},visibilityPermissions:{type:"string",default:"all"}},supports:{anchor:!0,reusable:!1,spacing:{margin:["top","bottom"]},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{radius:!0}}},save({attributes:e}){const{type:t,name:o,label:n,inlineLabel:a,required:r,placeholder:i,value:s}=e,l=(0,nt.__experimentalGetBorderClassesAndStyles)(e),c=(0,nt.__experimentalGetColorClassesAndStyles)(e),u={...l.style,...c.style},d=ft("wp-block-form-input__input",c.className,l.className),p="textarea"===t?"textarea":"input",m=nt.useBlockProps.save();return"hidden"===t?(0,Je.jsx)("input",{type:t,name:o,value:s}):(0,Je.jsx)("div",{...m,children:(0,Je.jsxs)("label",{className:ft("wp-block-form-input__label",{"is-label-inline":a}),children:[(0,Je.jsx)("span",{className:"wp-block-form-input__label-content",children:(0,Je.jsx)(nt.RichText.Content,{value:n})}),(0,Je.jsx)(p,{className:d,type:"textarea"===t?void 0:t,name:o||_c(n),required:r,"aria-required":r,placeholder:i||void 0,style:u})]})})}},yc={attributes:{type:{type:"string",default:"text"},name:{type:"string"},label:{type:"string",default:"Label",selector:".wp-block-form-input__label-content",source:"html",role:"content"},inlineLabel:{type:"boolean",default:!1},required:{type:"boolean",default:!1,selector:".wp-block-form-input__input",source:"attribute",attribute:"required"},placeholder:{type:"string",selector:".wp-block-form-input__input",source:"attribute",attribute:"placeholder",role:"content"},value:{type:"string",default:"",selector:"input",source:"attribute",attribute:"value"},visibilityPermissions:{type:"string",default:"all"}},supports:{className:!1,anchor:!0,reusable:!1,spacing:{margin:["top","bottom"]},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{radius:!0}}},save({attributes:e}){const{type:t,name:o,label:n,inlineLabel:a,required:r,placeholder:i,value:s}=e,l=(0,nt.__experimentalGetBorderClassesAndStyles)(e),c=(0,nt.__experimentalGetColorClassesAndStyles)(e),u={...l.style,...c.style},d=ft("wp-block-form-input__input",c.className,l.className),p="textarea"===t?"textarea":"input";return"hidden"===t?(0,Je.jsx)("input",{type:t,name:o,value:s}):(0,Je.jsxs)("label",{className:ft("wp-block-form-input__label",{"is-label-inline":a}),children:[(0,Je.jsx)("span",{className:"wp-block-form-input__label-content",children:(0,Je.jsx)(nt.RichText.Content,{value:n})}),(0,Je.jsx)(p,{className:d,type:"textarea"===t?void 0:t,name:o||_c(n),required:r,"aria-required":r,placeholder:i||void 0,style:u})]})}},fc=[bc,yc];const vc=function({attributes:e,setAttributes:t,className:o}){const{type:n,name:a,label:r,inlineLabel:i,required:s,placeholder:l,value:c}=e,u=(0,nt.useBlockProps)(),d=(0,st.useRef)(),p="textarea"===n?"textarea":"input",m=(0,nt.__experimentalUseBorderProps)(e),g=(0,nt.__experimentalUseColorProps)(e);d.current&&d.current.focus();const h="checkbox"===n||"radio"===n,x=(0,Je.jsxs)(Je.Fragment,{children:["hidden"!==n&&(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:["checkbox"!==n&&(0,Je.jsx)(tt.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Inline label"),checked:i,onChange:e=>{t({inlineLabel:e})}}),(0,Je.jsx)(tt.CheckboxControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Required"),checked:s,onChange:e=>{t({required:e})}})]})}),(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,ot.__)("Name"),value:a,onChange:e=>{t({name:e})},help:(0,ot.__)('Affects the "name" attribute of the input element, and is used as a name for the form submission results.')})})]}),_=(0,Je.jsx)(nt.RichText,{tagName:"span",className:"wp-block-form-input__label-content",value:r,onChange:e=>t({label:e}),"aria-label":r?(0,ot.__)("Label"):(0,ot.__)("Empty label"),"data-empty":!r,placeholder:(0,ot.__)("Type the label for this input")});return"hidden"===n?(0,Je.jsxs)(Je.Fragment,{children:[x,(0,Je.jsx)("input",{type:"hidden",className:ft(o,"wp-block-form-input__input",g.className,m.className),"aria-label":(0,ot.__)("Value"),value:c,onChange:e=>t({value:e.target.value})})]}):(0,Je.jsxs)("div",{...u,children:[x,(0,Je.jsxs)("span",{className:ft("wp-block-form-input__label",{"is-label-inline":i||"checkbox"===n}),children:[!h&&_,(0,Je.jsx)(p,{type:"textarea"===n?void 0:n,className:ft(o,"wp-block-form-input__input",g.className,m.className),"aria-label":(0,ot.__)("Optional placeholder text"),placeholder:l?void 0:(0,ot.__)("Optional placeholder…"),value:l,onChange:e=>t({placeholder:e.target.value}),"aria-required":s,style:{...m.style,...g.style}}),h&&_]})]})};const kc=[{name:"text",title:(0,ot.__)("Text Input"),icon:"edit-page",description:(0,ot.__)("A generic text input."),attributes:{type:"text"},isDefault:!0,scope:["inserter","transform"],isActive:e=>!e?.type||"text"===e?.type},{name:"textarea",title:(0,ot.__)("Textarea Input"),icon:"testimonial",description:(0,ot.__)("A textarea input to allow entering multiple lines of text."),attributes:{type:"textarea"},isDefault:!0,scope:["inserter","transform"],isActive:e=>"textarea"===e?.type},{name:"checkbox",title:(0,ot.__)("Checkbox Input"),description:(0,ot.__)("A simple checkbox input."),icon:"forms",attributes:{type:"checkbox",inlineLabel:!0},isDefault:!0,scope:["inserter","transform"],isActive:e=>"checkbox"===e?.type},{name:"email",title:(0,ot.__)("Email Input"),icon:"email",description:(0,ot.__)("Used for email addresses."),attributes:{type:"email"},isDefault:!0,scope:["inserter","transform"],isActive:e=>"email"===e?.type},{name:"url",title:(0,ot.__)("URL Input"),icon:"admin-site",description:(0,ot.__)("Used for URLs."),attributes:{type:"url"},isDefault:!0,scope:["inserter","transform"],isActive:e=>"url"===e?.type},{name:"tel",title:(0,ot.__)("Telephone Input"),icon:"phone",description:(0,ot.__)("Used for phone numbers."),attributes:{type:"tel"},isDefault:!0,scope:["inserter","transform"],isActive:e=>"tel"===e?.type},{name:"number",title:(0,ot.__)("Number Input"),icon:"edit-page",description:(0,ot.__)("A numeric input."),attributes:{type:"number"},isDefault:!0,scope:["inserter","transform"],isActive:e=>"number"===e?.type}],wc=kc,Cc={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/form-input",title:"Input Field",category:"common",ancestor:["core/form"],description:"The basic building block for forms.",keywords:["input","form"],textdomain:"default",icon:"forms",attributes:{type:{type:"string",default:"text"},name:{type:"string"},label:{type:"rich-text",default:"Label",selector:".wp-block-form-input__label-content",source:"rich-text",role:"content"},inlineLabel:{type:"boolean",default:!1},required:{type:"boolean",default:!1,selector:".wp-block-form-input__input",source:"attribute",attribute:"required"},placeholder:{type:"string",selector:".wp-block-form-input__input",source:"attribute",attribute:"placeholder",role:"content"},value:{type:"string",default:"",selector:"input",source:"attribute",attribute:"value"},visibilityPermissions:{type:"string",default:"all"}},supports:{anchor:!0,reusable:!1,spacing:{margin:["top","bottom"]},__experimentalBorder:{radius:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{radius:!0}}},style:["wp-block-form-input"]},{name:jc}=Cc,Sc={deprecated:fc,edit:vc,save:function({attributes:e}){const{type:t,name:o,label:n,inlineLabel:a,required:r,placeholder:i,value:s}=e,l=(0,nt.__experimentalGetBorderClassesAndStyles)(e),c=(0,nt.__experimentalGetColorClassesAndStyles)(e),u={...l.style,...c.style},d=ft("wp-block-form-input__input",c.className,l.className),p="textarea"===t?"textarea":"input",m=nt.useBlockProps.save(),g="checkbox"===t||"radio"===t;return"hidden"===t?(0,Je.jsx)("input",{type:t,name:o,value:s}):(0,Je.jsx)("div",{...m,children:(0,Je.jsxs)("label",{className:ft("wp-block-form-input__label",{"is-label-inline":a}),children:[!g&&(0,Je.jsx)("span",{className:"wp-block-form-input__label-content",children:(0,Je.jsx)(nt.RichText.Content,{value:n})}),(0,Je.jsx)(p,{className:d,type:"textarea"===t?void 0:t,name:o||(h=n,hc()((0,xc.__unstableStripHTML)(h)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase().replace(/(^-+)|(-+$)/g,"")),required:r,"aria-required":r,placeholder:i||void 0,style:u}),g&&(0,Je.jsx)("span",{className:"wp-block-form-input__label-content",children:(0,Je.jsx)(nt.RichText.Content,{value:n})})]})});var h},variations:wc},Bc=()=>et({name:jc,metadata:Cc,settings:Sc}),Tc=[["core/buttons",{},[["core/button",{text:(0,ot.__)("Submit"),tagName:"button",type:"submit"}]]]],Nc=()=>{const e=(0,nt.useBlockProps)(),t=(0,nt.useInnerBlocksProps)(e,{template:Tc,templateLock:"all"});return(0,Je.jsx)("div",{className:"wp-block-form-submit-wrapper",...t})};const Pc={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/form-submit-button",title:"Form Submit Button",category:"common",icon:"button",ancestor:["core/form"],allowedBlocks:["core/buttons","core/button"],description:"A submission button for forms.",keywords:["submit","button","form"],textdomain:"default",style:["wp-block-form-submit-button"]},{name:Ic}=Pc,Mc={edit:Nc,save:function(){const e=nt.useBlockProps.save();return(0,Je.jsx)("div",{className:"wp-block-form-submit-wrapper",...e,children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})}},Dc=()=>et({name:Ic,metadata:Pc,settings:Mc}),zc=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})}),Ac=[["core/paragraph",{content:(0,ot.__)("Enter the message you wish displayed for form submission error/success, and select the type of the message (success/error) from the block's options.")}]],Rc=({attributes:e,clientId:t})=>{const{type:o}=e,n=(0,nt.useBlockProps)({className:ft("wp-block-form-submission-notification",{[`form-notification-type-${o}`]:o})}),{hasInnerBlocks:a}=(0,it.useSelect)((e=>{const{getBlock:o}=e(nt.store),n=o(t);return{hasInnerBlocks:!(!n||!n.innerBlocks.length)}}),[t]),r=(0,nt.useInnerBlocksProps)(n,{template:Ac,renderAppender:a?void 0:nt.InnerBlocks.ButtonBlockAppender});return(0,Je.jsx)("div",{...r,"data-message-success":(0,ot.__)("Submission success notification"),"data-message-error":(0,ot.__)("Submission error notification")})};const Hc=[{name:"form-submission-success",title:(0,ot.__)("Form Submission Success"),description:(0,ot.__)("Success message for form submissions."),attributes:{type:"success"},isDefault:!0,innerBlocks:[["core/paragraph",{content:(0,ot.__)("Your form has been submitted successfully."),backgroundColor:"#00D084",textColor:"#000000",style:{elements:{link:{color:{text:"#000000"}}}}}]],scope:["inserter","transform"],isActive:e=>!e?.type||"success"===e?.type},{name:"form-submission-error",title:(0,ot.__)("Form Submission Error"),description:(0,ot.__)("Error/failure message for form submissions."),attributes:{type:"error"},isDefault:!1,innerBlocks:[["core/paragraph",{content:(0,ot.__)("There was an error submitting your form."),backgroundColor:"#CF2E2E",textColor:"#FFFFFF",style:{elements:{link:{color:{text:"#FFFFFF"}}}}}]],scope:["inserter","transform"],isActive:e=>!e?.type||"error"===e?.type}],Lc=Hc,Vc={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/form-submission-notification",title:"Form Submission Notification",category:"common",ancestor:["core/form"],description:"Provide a notification message after the form has been submitted.",keywords:["form","feedback","notification","message"],textdomain:"default",icon:"feedback",attributes:{type:{type:"string",default:"success"}}},{name:Fc}=Vc,Ec={icon:zc,edit:Rc,save:function({attributes:e}){const{type:t}=e;return(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save(nt.useBlockProps.save({className:ft("wp-block-form-submission-notification",{[`form-notification-type-${t}`]:t})}))})},variations:Lc},Oc=()=>et({name:Fc,metadata:Vc,settings:Ec}),$c=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M16.375 4.5H4.625a.125.125 0 0 0-.125.125v8.254l2.859-1.54a.75.75 0 0 1 .68-.016l2.384 1.142 2.89-2.074a.75.75 0 0 1 .874 0l2.313 1.66V4.625a.125.125 0 0 0-.125-.125Zm.125 9.398-2.75-1.975-2.813 2.02a.75.75 0 0 1-.76.067l-2.444-1.17L4.5 14.583v1.792c0 .069.056.125.125.125h11.75a.125.125 0 0 0 .125-.125v-2.477ZM4.625 3C3.728 3 3 3.728 3 4.625v11.75C3 17.273 3.728 18 4.625 18h11.75c.898 0 1.625-.727 1.625-1.625V4.625C18 3.728 17.273 3 16.375 3H4.625ZM20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z",fillRule:"evenodd",clipRule:"evenodd"})}),Gc="none",Uc="media",qc="lightbox",Wc="attachment",Zc="file",Qc="post";function Kc(e){return Math.min(3,e?.images?.length)}function Yc(e,t){switch(t){case Zc:return{href:e?.source_url||e?.url,linkDestination:Uc};case Qc:return{href:e?.link,linkDestination:Wc};case Uc:return{href:e?.source_url||e?.url,linkDestination:Uc};case Wc:return{href:e?.link,linkDestination:Wc};case Gc:return{href:void 0,linkDestination:Gc}}return{}}function Jc(e){let t=e.linkTo?e.linkTo:"none";"post"===t?t="attachment":"file"===t&&(t="media");const o=e.images.map((o=>function(e,t,o){return(0,Ke.createBlock)("core/image",{...e.id&&{id:parseInt(e.id)},url:e.url,alt:e.alt,caption:e.caption,sizeSlug:t,...Yc(e,o)})}(o,e.sizeSlug,t))),{images:n,ids:a,...r}=e;return[{...r,linkTo:t,allowResize:!1},o]}const Xc={attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},shortCodeTransforms:{type:"array",default:[],items:{type:"object"}},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},fixedHeight:{type:"boolean",default:!0},linkTarget:{type:"string"},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"},allowResize:{type:"boolean",default:!1}},save({attributes:e}){const{caption:t,columns:o,imageCrop:n}=e,a=ft("has-nested-images",{[`columns-${o}`]:void 0!==o,"columns-default":void 0===o,"is-cropped":n}),r=nt.useBlockProps.save({className:a}),i=nt.useInnerBlocksProps.save(r);return(0,Je.jsxs)("figure",{...i,children:[i.children,!nt.RichText.isEmpty(t)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:t})]})}},eu={attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},fixedHeight:{type:"boolean",default:!0},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"}},supports:{anchor:!0,align:!0},save({attributes:e}){const{images:t,columns:o=Kc(e),imageCrop:n,caption:a,linkTo:r}=e,i=`columns-${o} ${n?"is-cropped":""}`;return(0,Je.jsxs)("figure",{...nt.useBlockProps.save({className:i}),children:[(0,Je.jsx)("ul",{className:"blocks-gallery-grid",children:t.map((e=>{let t;switch(r){case Zc:t=e.fullUrl||e.url;break;case Qc:t=e.link}const o=(0,Je.jsx)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,Je.jsx)("li",{className:"blocks-gallery-item",children:(0,Je.jsxs)("figure",{children:[t?(0,Je.jsx)("a",{href:t,children:o}):o,!nt.RichText.isEmpty(e.caption)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})]})},e.id||e.url)}))}),!nt.RichText.isEmpty(a)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:a})]})},migrate:e=>Jc(e)},tu={attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},sizeSlug:{type:"string",default:"large"}},supports:{align:!0},isEligible:({linkTo:e})=>!e||"attachment"===e||"media"===e,migrate:e=>Jc(e),save({attributes:e}){const{images:t,columns:o=Kc(e),imageCrop:n,caption:a,linkTo:r}=e;return(0,Je.jsxs)("figure",{className:`columns-${o} ${n?"is-cropped":""}`,children:[(0,Je.jsx)("ul",{className:"blocks-gallery-grid",children:t.map((e=>{let t;switch(r){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const o=(0,Je.jsx)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,Je.jsx)("li",{className:"blocks-gallery-item",children:(0,Je.jsxs)("figure",{children:[t?(0,Je.jsx)("a",{href:t,children:o}):o,!nt.RichText.isEmpty(e.caption)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})]})},e.id||e.url)}))}),!nt.RichText.isEmpty(a)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:a})]})}},ou={attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},link:{source:"attribute",selector:"img",attribute:"data-link"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"string",source:"html",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",default:[]},columns:{type:"number"},caption:{type:"string",source:"html",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},isEligible:({ids:e})=>e&&e.some((e=>"string"==typeof e)),migrate:e=>Jc(e),save({attributes:e}){const{images:t,columns:o=Kc(e),imageCrop:n,caption:a,linkTo:r}=e;return(0,Je.jsxs)("figure",{className:`columns-${o} ${n?"is-cropped":""}`,children:[(0,Je.jsx)("ul",{className:"blocks-gallery-grid",children:t.map((e=>{let t;switch(r){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const o=(0,Je.jsx)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,Je.jsx)("li",{className:"blocks-gallery-item",children:(0,Je.jsxs)("figure",{children:[t?(0,Je.jsx)("a",{href:t,children:o}):o,!nt.RichText.isEmpty(e.caption)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-item__caption",value:e.caption})]})},e.id||e.url)}))}),!nt.RichText.isEmpty(a)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",className:"blocks-gallery-caption",value:a})]})}},nu={attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},fullUrl:{source:"attribute",selector:"img",attribute:"data-full-url"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"string",source:"html",selector:"figcaption"}}},ids:{type:"array",default:[]},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},supports:{align:!0},save({attributes:e}){const{images:t,columns:o=Kc(e),imageCrop:n,linkTo:a}=e;return(0,Je.jsx)("ul",{className:`columns-${o} ${n?"is-cropped":""}`,children:t.map((e=>{let t;switch(a){case"media":t=e.fullUrl||e.url;break;case"attachment":t=e.link}const o=(0,Je.jsx)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-full-url":e.fullUrl,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,Je.jsx)("li",{className:"blocks-gallery-item",children:(0,Je.jsxs)("figure",{children:[t?(0,Je.jsx)("a",{href:t,children:o}):o,e.caption&&e.caption.length>0&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:e.caption})]})},e.id||e.url)}))})},migrate:e=>Jc(e)},au={attributes:{images:{type:"array",default:[],source:"query",selector:"ul.wp-block-gallery .blocks-gallery-item",query:{url:{source:"attribute",selector:"img",attribute:"src"},alt:{source:"attribute",selector:"img",attribute:"alt",default:""},id:{source:"attribute",selector:"img",attribute:"data-id"},link:{source:"attribute",selector:"img",attribute:"data-link"},caption:{type:"string",source:"html",selector:"figcaption"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"}},isEligible:({images:e,ids:t})=>e&&e.length>0&&(!t&&e||t&&e&&t.length!==e.length||e.some(((e,o)=>!e&&null!==t[o]||parseInt(e,10)!==t[o]))),migrate:e=>Jc(e),supports:{align:!0},save({attributes:e}){const{images:t,columns:o=Kc(e),imageCrop:n,linkTo:a}=e;return(0,Je.jsx)("ul",{className:`columns-${o} ${n?"is-cropped":""}`,children:t.map((e=>{let t;switch(a){case"media":t=e.url;break;case"attachment":t=e.link}const o=(0,Je.jsx)("img",{src:e.url,alt:e.alt,"data-id":e.id,"data-link":e.link,className:e.id?`wp-image-${e.id}`:null});return(0,Je.jsx)("li",{className:"blocks-gallery-item",children:(0,Je.jsxs)("figure",{children:[t?(0,Je.jsx)("a",{href:t,children:o}):o,e.caption&&e.caption.length>0&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:e.caption})]})},e.id||e.url)}))})}},ru={attributes:{images:{type:"array",default:[],source:"query",selector:"div.wp-block-gallery figure.blocks-gallery-image img",query:{url:{source:"attribute",attribute:"src"},alt:{source:"attribute",attribute:"alt",default:""},id:{source:"attribute",attribute:"data-id"}}},columns:{type:"number"},imageCrop:{type:"boolean",default:!0},linkTo:{type:"string",default:"none"},align:{type:"string",default:"none"}},supports:{align:!0},save({attributes:e}){const{images:t,columns:o=Kc(e),align:n,imageCrop:a,linkTo:r}=e,i=ft(`columns-${o}`,{alignnone:"none"===n,"is-cropped":a});return(0,Je.jsx)("div",{className:i,children:t.map((e=>{let t;switch(r){case"media":t=e.url;break;case"attachment":t=e.link}const o=(0,Je.jsx)("img",{src:e.url,alt:e.alt,"data-id":e.id});return(0,Je.jsx)("figure",{className:"blocks-gallery-image",children:t?(0,Je.jsx)("a",{href:t,children:o}):o},e.id||e.url)}))})},migrate:e=>Jc(e)},iu=[Xc,eu,tu,ou,nu,au,ru],su=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z"})}),lu=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z"})}),cu=(0,Je.jsx)(nt.BlockIcon,{icon:$c});const uu=(e,t="large")=>{const o=Object.fromEntries(Object.entries(null!=e?e:{}).filter((([e])=>["alt","id","link"].includes(e))));o.url=e?.sizes?.[t]?.url||e?.media_details?.sizes?.[t]?.source_url||e?.url||e?.source_url;const n=e?.sizes?.full?.url||e?.media_details?.sizes?.full?.source_url;return n&&(o.fullUrl=n),o},du=20,pu="none",mu="media",gu="attachment",hu="custom",xu=["noreferrer","noopener"],_u=["image"];function bu(e,t,o,n,a){switch(o||t){case"file":case Uc:return{href:e?.source_url||e?.url,linkDestination:mu,lightbox:a?.enabled?{...n?.lightbox,enabled:!1}:void 0};case"post":case Wc:return{href:e?.link,linkDestination:gu,lightbox:a?.enabled?{...n?.lightbox,enabled:!1}:void 0};case qc:return{href:void 0,lightbox:a?.enabled?void 0:{...n?.lightbox,enabled:!0},linkDestination:pu};case Gc:return{href:void 0,linkDestination:pu,lightbox:void 0}}return{}}function yu(e,{rel:t}){const o=e?"_blank":void 0;let n;return n=o||t?function(e){let t=e;return void 0!==e&&t&&(xu.forEach((e=>{const o=new RegExp("\\b"+e+"\\b","gi");t=t.replace(o,"")})),t!==e&&(t=t.trim()),t||(t=void 0)),t}(t):void 0,{linkTarget:o,rel:n}}function fu(e){return _u.some((t=>0===e.type.indexOf(t)))}function vu(e){const{attributes:t,isSelected:o,setAttributes:n,mediaPlaceholder:a,insertBlocksAfter:r,blockProps:i,__unstableLayoutClassNames:s,isContentLocked:l,multiGallerySelection:c}=e,{align:u,columns:d,imageCrop:p}=t;return(0,Je.jsxs)("figure",{...i,className:ft(i.className,s,"blocks-gallery-grid",{[`align${u}`]:u,[`columns-${d}`]:void 0!==d,"columns-default":void 0===d,"is-cropped":p}),children:[i.children,o&&!i.children&&(0,Je.jsx)(Ye.View,{className:"blocks-gallery-media-placeholder-wrapper",children:a}),(0,Je.jsx)(Yt,{attributes:t,setAttributes:n,isSelected:o,insertBlocksAfter:r,showToolbarButton:!c&&!l,className:"blocks-gallery-caption",label:(0,ot.__)("Gallery caption text"),placeholder:(0,ot.__)("Add gallery caption")})]})}function ku(e,t,o){return(0,st.useMemo)((()=>function(){if(!e||0===e.length)return;const{imageSizes:n}=o();let a={};t&&(a=e.reduce(((e,t)=>{if(!t.id)return e;const o=n.reduce(((e,o)=>{const n=t.sizes?.[o.slug]?.url,a=t.media_details?.sizes?.[o.slug]?.source_url;return{...e,[o.slug]:n||a}}),{});return{...e,[parseInt(t.id,10)]:o}}),{}));const r=Object.values(a);return n.filter((({slug:e})=>r.some((t=>t[e])))).map((({name:e,slug:t})=>({value:t,label:e})))}()),[e,t])}function wu(e,t){const[o,n]=(0,st.useState)([]);return(0,st.useMemo)((()=>function(){let a=!1;const r=o.filter((t=>e.find((e=>t.clientId===e.clientId))));r.length<o.length&&(a=!0);e.forEach((e=>{e.fromSavedContent&&!r.find((t=>t.id===e.id))&&(a=!0,r.push(e))}));const i=e.filter((e=>!r.find((t=>e.clientId&&t.clientId===e.clientId))&&t?.find((t=>t.id===e.id))&&!e.fromSavedContent));(a||i?.length>0)&&n([...r,...i]);return i.length>0?i:null}()),[e,t])}const Cu=[];function ju({blockGap:e,clientId:t}){const o="var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )";let n,a=o,r=o;e&&(n="string"==typeof e?(0,nt.__experimentalGetGapCSSValue)(e):(0,nt.__experimentalGetGapCSSValue)(e?.top)||o,r="string"==typeof e?(0,nt.__experimentalGetGapCSSValue)(e):(0,nt.__experimentalGetGapCSSValue)(e?.left)||o,a=n===r?n:`${n} ${r}`);const i=`#block-${t} {\n\t\t--wp--style--unstable-gallery-gap: ${"0"===r?"0px":r};\n\t\tgap: ${a}\n\t}`;return(0,nt.useStyleOverride)({css:i}),null}const Su=[{icon:su,label:(0,ot.__)("Link images to attachment pages"),value:Wc,noticeText:(0,ot.__)("Attachment Pages")},{icon:lu,label:(0,ot.__)("Link images to media files"),value:Uc,noticeText:(0,ot.__)("Media Files")},{icon:pn,label:(0,ot.__)("Enlarge on click"),value:qc,noticeText:(0,ot.__)("Lightbox effect"),infoText:(0,ot.__)("Scale images with a lightbox effect")},{icon:jo,label:(0,ot._x)("None","Media item link option"),value:Gc,noticeText:(0,ot.__)("None")}],Bu=["image"],Tu=st.Platform.isNative?(0,ot.__)("Add media"):(0,ot.__)("Drag and drop images, upload, or choose from your library."),Nu=st.Platform.isNative?{type:"stepper"}:{},Pu={name:"core/image"},Iu=[];(0,Ns.addFilter)("blocks.switchToBlockType.transformedBlock","core/gallery/update-third-party-transform-to",(function(e){if("core/gallery"===e.name&&e.attributes?.images.length>0){const t=e.attributes.images.map((({url:t,id:o,alt:n})=>(0,Ke.createBlock)("core/image",{url:t,id:o?parseInt(o,10):null,alt:n,sizeSlug:e.attributes.sizeSlug,linkDestination:e.attributes.linkDestination})));delete e.attributes.ids,delete e.attributes.images,e.innerBlocks=t}return e})),(0,Ns.addFilter)("blocks.switchToBlockType.transformedBlock","core/gallery/update-third-party-transform-from",(function(e,t){const o=(Array.isArray(t)?t:[t]).find((t=>"core/gallery"===t.name&&t.innerBlocks.length>0&&!t.attributes.images?.length>0&&!e.name.includes("core/")));if(o){const e=o.innerBlocks.map((({attributes:{url:e,id:t,alt:o}})=>({url:e,id:t?parseInt(t,10):null,alt:o}))),t=e.map((({id:e})=>e));o.attributes.images=e,o.attributes.ids=t}return e}));const Mu={from:[{type:"block",isMultiBlock:!0,blocks:["core/image"],transform:e=>{let{align:t,sizeSlug:o}=e[0];t=e.every((e=>e.align===t))?t:void 0,o=e.every((e=>e.sizeSlug===o))?o:void 0;const n=e.filter((({url:e})=>e)).map((e=>(e.width=void 0,e.height=void 0,(0,Ke.createBlock)("core/image",e))));return(0,Ke.createBlock)("core/gallery",{align:t,sizeSlug:o},n)}},{type:"shortcode",tag:"gallery",transform({named:{ids:e,columns:t=3,link:o,orderby:n}}){const a=(e=>e?e.split(",").map((e=>parseInt(e,10))):[])(e).map((e=>parseInt(e,10)));let r=Gc;"post"===o?r=Wc:"file"===o&&(r=Uc);return(0,Ke.createBlock)("core/gallery",{columns:parseInt(t,10),linkTo:r,randomOrder:"rand"===n},a.map((e=>(0,Ke.createBlock)("core/image",{id:e}))))},isMatch:({named:e})=>void 0!==e.ids},{type:"files",priority:1,isMatch:e=>1!==e.length&&e.every((e=>0===e.type.indexOf("image/"))),transform(e){const t=e.map((e=>(0,Ke.createBlock)("core/image",{blob:(0,lt.createBlobURL)(e)})));return(0,Ke.createBlock)("core/gallery",{},t)}}],to:[{type:"block",blocks:["core/image"],transform:({align:e},t)=>t.length>0?t.map((({attributes:{url:t,alt:o,caption:n,title:a,href:r,rel:i,linkClass:s,id:l,sizeSlug:c,linkDestination:u,linkTarget:d,anchor:p,className:m}})=>(0,Ke.createBlock)("core/image",{align:e,url:t,alt:o,caption:n,title:a,href:r,rel:i,linkClass:s,id:l,sizeSlug:c,linkDestination:u,linkTarget:d,anchor:p,className:m}))):(0,Ke.createBlock)("core/image",{align:e})}]},Du=Mu,zu={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/gallery",title:"Gallery",category:"media",allowedBlocks:["core/image"],description:"Display multiple images in a rich gallery.",keywords:["images","photos"],textdomain:"default",attributes:{images:{type:"array",default:[],source:"query",selector:".blocks-gallery-item",query:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},fullUrl:{type:"string",source:"attribute",selector:"img",attribute:"data-full-url"},link:{type:"string",source:"attribute",selector:"img",attribute:"data-link"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},id:{type:"string",source:"attribute",selector:"img",attribute:"data-id"},caption:{type:"rich-text",source:"rich-text",selector:".blocks-gallery-item__caption"}}},ids:{type:"array",items:{type:"number"},default:[]},shortCodeTransforms:{type:"array",items:{type:"object"},default:[]},columns:{type:"number",minimum:1,maximum:8},caption:{type:"rich-text",source:"rich-text",selector:".blocks-gallery-caption"},imageCrop:{type:"boolean",default:!0},randomOrder:{type:"boolean",default:!1},fixedHeight:{type:"boolean",default:!0},linkTarget:{type:"string"},linkTo:{type:"string"},sizeSlug:{type:"string",default:"large"},allowResize:{type:"boolean",default:!1}},providesContext:{allowResize:"allowResize",imageCrop:"imageCrop",fixedHeight:"fixedHeight"},supports:{anchor:!0,align:!0,__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{color:!0,radius:!0}},html:!1,units:["px","em","rem","vh","vw"],spacing:{margin:!0,padding:!0,blockGap:["horizontal","vertical"],__experimentalSkipSerialization:["blockGap"],__experimentalDefaultControls:{blockGap:!0,margin:!1,padding:!1}},color:{text:!1,background:!0,gradients:!0},layout:{allowSwitching:!1,allowInheriting:!1,allowEditing:!1,default:{type:"flex"}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-gallery-editor",style:"wp-block-gallery"},{name:Au}=zu,Ru={icon:$c,example:{attributes:{columns:2},innerBlocks:[{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg"}},{name:"core/image",attributes:{url:"https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg"}}]},transforms:Du,edit:function(e){const{setAttributes:t,attributes:o,className:n,clientId:a,isSelected:r,insertBlocksAfter:i,isContentLocked:s,onFocus:l}=e,[c]=(0,nt.useSettings)("blocks.core/image.lightbox"),u=c?.allowEditing?Su:Su.filter((e=>e.value!==qc)),{columns:d,imageCrop:p,randomOrder:m,linkTarget:g,linkTo:h,sizeSlug:x}=o,{__unstableMarkNextChangeAsNotPersistent:_,replaceInnerBlocks:b,updateBlockAttributes:y,selectBlock:f}=(0,it.useDispatch)(nt.store),{createSuccessNotice:v,createErrorNotice:k}=(0,it.useDispatch)(Rt.store),{getBlock:w,getSettings:C,innerBlockImages:j,blockWasJustInserted:S,multiGallerySelection:B}=(0,it.useSelect)((e=>{var t;const{getBlockName:o,getMultiSelectedBlockClientIds:n,getSettings:r,getBlock:i,wasBlockJustInserted:s}=e(nt.store),l=n();return{getBlock:i,getSettings:r,innerBlockImages:null!==(t=i(a)?.innerBlocks)&&void 0!==t?t:Iu,blockWasJustInserted:s(a,"inserter_menu"),multiGallerySelection:l.length&&l.every((e=>"core/gallery"===o(e)))}}),[a]),T=(0,st.useMemo)((()=>j?.map((e=>({clientId:e.clientId,id:e.attributes.id,url:e.attributes.url,attributes:e.attributes,fromSavedContent:Boolean(e.originalContent)})))),[j]),N=function(e){return(0,it.useSelect)((t=>{var o;const n=e.map((e=>e.attributes.id)).filter((e=>void 0!==e));return 0===n.length?Cu:null!==(o=t(ct.store).getMediaItems({include:n.join(","),per_page:-1,orderby:"include"}))&&void 0!==o?o:Cu}),[e])}(j),P=wu(T,N);(0,st.useEffect)((()=>{P?.forEach((e=>{_(),y(e.clientId,{...M(e.attributes),id:e.id,align:void 0})}))}),[P]);const I=ku(N,r,C);function M(e){const t=e.id?N.find((({id:t})=>t===e.id)):null;let n,a;return e.className&&""!==e.className&&(n=e.className),a=e.linkTarget||e.rel?{linkTarget:e.linkTarget,rel:e.rel}:yu(g,o),{...uu(t,x),...bu(t,h,e?.linkDestination),...a,className:n,sizeSlug:x,caption:e.caption||t.caption?.raw,alt:e.alt||t.alt_text}}function D(e){const t=st.Platform.isNative&&e.id?N.find((({id:t})=>t===e.id)):null,o=t?t?.media_type:e.type;return Bu.some((e=>0===o?.indexOf(e)))||e.blob}function z(e){const t="[object FileList]"===Object.prototype.toString.call(e),o=t?Array.from(e).map((e=>e.url?e:{blob:(0,lt.createBlobURL)(e)})):e;o.every(D)||k((0,ot.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-upload-invalid-file",type:"snackbar"});const n=o.filter((e=>e.url||D(e))).map((e=>e.url?e:{blob:e.blob||(0,lt.createBlobURL)(e)})),r=n.reduce(((e,t,o)=>(e[t.id]=o,e)),{}),i=t?j:j.filter((e=>n.find((t=>t.id===e.attributes.id)))),s=n.filter((e=>!i.find((t=>e.id===t.attributes.id)))).map((e=>(0,Ke.createBlock)("core/image",{id:e.id,blob:e.blob,url:e.url,caption:e.caption,alt:e.alt})));b(a,i.concat(s).sort(((e,t)=>r[e.attributes.id]-r[t.attributes.id]))),s?.length>0&&f(s[0].clientId)}function A(e){t({linkTo:e});const o={},n=[];w(a).innerBlocks.forEach((t=>{n.push(t.clientId);const a=t.attributes.id?N.find((({id:e})=>e===t.attributes.id)):null;o[t.clientId]=bu(a,e,!1,t.attributes,c)})),y(n,o,!0);const r=[...u].find((t=>t.value===e));v((0,ot.sprintf)((0,ot.__)("All gallery image links updated to: %s"),r.noticeText),{id:"gallery-attributes-linkTo",type:"snackbar"})}(0,st.useEffect)((()=>{h||(_(),t({linkTo:window?.wp?.media?.view?.settings?.defaultProps?.link||Gc}))}),[h]);const R=!!T.length,H=R&&T.some((e=>!!e.id)),L=T.some((e=>st.Platform.isNative?0===e.url?.indexOf("file:"):!e.id&&0===e.url?.indexOf("blob:"))),V=st.Platform.select({web:{addToGallery:!1,disableMediaButtons:L,value:{}},native:{addToGallery:H,isAppender:R,disableMediaButtons:R&&!r||L,value:H?T:{},autoOpenMediaUpload:!R&&r&&S,onFocus:l}}),F=(0,Je.jsx)(nt.MediaPlaceholder,{handleUpload:!1,icon:cu,labels:{title:(0,ot.__)("Gallery"),instructions:Tu},onSelect:z,accept:"image/*",allowedTypes:Bu,multiple:!0,onError:function(e){k(e,{type:"snackbar"})},...V}),E=(0,nt.useBlockProps)({className:ft(n,"has-nested-images")}),O=st.Platform.isNative&&{marginHorizontal:0,marginVertical:0},$=(0,nt.useInnerBlocksProps)(E,{defaultBlock:Pu,directInsert:!0,orientation:"horizontal",renderAppender:!1,...O});if(!R)return(0,Je.jsxs)(Ye.View,{...$,children:[$.children,F]});const G=h&&"none"!==h;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[T.length>1&&(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Columns"),value:d||(U=T.length,U?Math.min(3,U):3),onChange:function(e){t({columns:e})},min:1,max:Math.min(8,T.length),...Nu,required:!0,__next40pxDefaultSize:!0}),I?.length>0&&(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Resolution"),help:(0,ot.__)("Select the size of the source images."),value:x,options:I,onChange:function(e){t({sizeSlug:e});const o={},n=[];w(a).innerBlocks.forEach((t=>{n.push(t.clientId);const a=t.attributes.id?N.find((({id:e})=>e===t.attributes.id)):null;o[t.clientId]=function(e,t){const o=e?.media_details?.sizes?.[t]?.source_url;return o?{url:o,width:void 0,height:void 0,sizeSlug:t}:{}}(a,e)})),y(n,o,!0);const r=I.find((t=>t.value===e));v((0,ot.sprintf)((0,ot.__)("All gallery image sizes updated to: %s"),r.label),{id:"gallery-attributes-sizeSlug",type:"snackbar"})},hideCancelButton:!0,size:"__unstable-large"}),st.Platform.isNative?(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link"),value:h,onChange:A,options:u,hideCancelButton:!0,size:"__unstable-large"}):null,(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Crop images to fit"),checked:!!p,onChange:function(){t({imageCrop:!p})}}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Randomize order"),checked:!!m,onChange:function(){t({randomOrder:!m})}}),G&&(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open images in new tab"),checked:"_blank"===g,onChange:function(e){const o=e?"_blank":void 0;t({linkTarget:o});const n={},r=[];w(a).innerBlocks.forEach((e=>{r.push(e.clientId),n[e.clientId]=yu(o,e.attributes)})),y(r,n,!0);const i=e?(0,ot.__)("All gallery images updated to open in new tab"):(0,ot.__)("All gallery images updated to not open in new tab");v(i,{id:"gallery-attributes-openInNewTab",type:"snackbar"})}}),st.Platform.isWeb&&!I&&H&&(0,Je.jsxs)(tt.BaseControl,{className:"gallery-image-sizes",__nextHasNoMarginBottom:!0,children:[(0,Je.jsx)(tt.BaseControl.VisualLabel,{children:(0,ot.__)("Resolution")}),(0,Je.jsxs)(Ye.View,{className:"gallery-image-sizes__loading",children:[(0,Je.jsx)(tt.Spinner,{}),(0,ot.__)("Loading options…")]})]})]})}),st.Platform.isWeb?(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(tt.ToolbarDropdownMenu,{icon:Co,label:(0,ot.__)("Link"),children:({onClose:e})=>(0,Je.jsx)(tt.MenuGroup,{children:u.map((t=>{const o=h===t.value;return(0,Je.jsx)(tt.MenuItem,{isSelected:o,className:ft("components-dropdown-menu__menu-item",{"is-active":o}),iconPosition:"left",icon:t.icon,onClick:()=>{A(t.value),e()},role:"menuitemradio",info:t.infoText,children:t.label},t.value)}))})})}):null,st.Platform.isWeb&&(0,Je.jsxs)(Je.Fragment,{children:[!B&&(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(nt.MediaReplaceFlow,{allowedTypes:Bu,accept:"image/*",handleUpload:!1,onSelect:z,name:(0,ot.__)("Add"),multiple:!0,mediaIds:T.filter((e=>e.id)).map((e=>e.id)),addToGallery:H})}),(0,Je.jsx)(ju,{blockGap:o.style?.spacing?.blockGap,clientId:a})]}),(0,Je.jsx)(vu,{...e,isContentLocked:s,images:T,mediaPlaceholder:!R||st.Platform.isNative?F:void 0,blockProps:$,insertBlocksAfter:i,multiGallerySelection:B})]});var U},save:function({attributes:e}){const{caption:t,columns:o,imageCrop:n}=e,a=ft("has-nested-images",{[`columns-${o}`]:void 0!==o,"columns-default":void 0===o,"is-cropped":n}),r=nt.useBlockProps.save({className:a}),i=nt.useInnerBlocksProps.save(r);return(0,Je.jsxs)("figure",{...i,children:[i.children,!nt.RichText.isEmpty(t)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",className:ft("blocks-gallery-caption",(0,nt.__experimentalGetElementClassName)("caption")),value:t})]})},deprecated:iu},Hu=()=>et({name:Au,metadata:zu,settings:Ru}),Lu=e=>{if(e.tagName||(e={...e,tagName:"div"}),!e.customTextColor&&!e.customBackgroundColor)return e;const t={color:{}};e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor);const{customTextColor:o,customBackgroundColor:n,...a}=e;return{...a,style:t}},Vu=[{attributes:{tagName:{type:"string",default:"div"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},supports:{__experimentalOnEnter:!0,__experimentalSettings:!0,align:["wide","full"],anchor:!0,ariaLabel:!0,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:["top","bottom"],padding:!0,blockGap:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},layout:!0},save:({attributes:{tagName:e}})=>(0,Je.jsx)(e,{...nt.useInnerBlocksProps.save(nt.useBlockProps.save())}),isEligible:({layout:e})=>e?.inherit||e?.contentSize&&"constrained"!==e?.type,migrate:e=>{const{layout:t=null}=e;if(t?.inherit||t?.contentSize)return{...e,layout:{...t,type:"constrained"}}}},{attributes:{tagName:{type:"string",default:"div"},templateLock:{type:["string","boolean"],enum:["all","insert",!1]}},supports:{align:["wide","full"],anchor:!0,color:{gradients:!0,link:!0},spacing:{padding:!0},__experimentalBorder:{radius:!0}},save({attributes:e}){const{tagName:t}=e;return(0,Je.jsx)(t,{...nt.useBlockProps.save(),children:(0,Je.jsx)("div",{className:"wp-block-group__inner-container",children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})})}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1},migrate:Lu,save({attributes:e}){const{backgroundColor:t,customBackgroundColor:o,textColor:n,customTextColor:a}=e,r=(0,nt.getColorClassName)("background-color",t),i=(0,nt.getColorClassName)("color",n),s=ft(r,i,{"has-text-color":n||a,"has-background":t||o}),l={backgroundColor:r?void 0:o,color:i?void 0:a};return(0,Je.jsx)("div",{className:s,style:l,children:(0,Je.jsx)("div",{className:"wp-block-group__inner-container",children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})})}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}},migrate:Lu,supports:{align:["wide","full"],anchor:!0,html:!1},save({attributes:e}){const{backgroundColor:t,customBackgroundColor:o,textColor:n,customTextColor:a}=e,r=(0,nt.getColorClassName)("background-color",t),i=(0,nt.getColorClassName)("color",n),s=ft(r,{"has-text-color":n||a,"has-background":t||o}),l={backgroundColor:r?void 0:o,color:i?void 0:a};return(0,Je.jsx)("div",{className:s,style:l,children:(0,Je.jsx)("div",{className:"wp-block-group__inner-container",children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})})}},{attributes:{backgroundColor:{type:"string"},customBackgroundColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1},migrate:Lu,save({attributes:e}){const{backgroundColor:t,customBackgroundColor:o}=e,n=(0,nt.getColorClassName)("background-color",t),a=ft(n,{"has-background":t||o}),r={backgroundColor:n?void 0:o};return(0,Je.jsx)("div",{className:a,style:r,children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})}}],Fu=Vu,Eu=(e="group")=>{const t={group:(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z"})}),"group-row":(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z"})}),"group-stack":(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm0 17a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V27Z"})}),"group-grid":(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10ZM0 27a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V27Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V27Z"})})};return t?.[e]};const Ou=function({name:e,onSelect:t}){const o=(0,it.useSelect)((t=>t(Ke.store).getBlockVariations(e,"block")),[e]),n=(0,nt.useBlockProps)({className:"wp-block-group__placeholder"});return(0,st.useEffect)((()=>{o&&1===o.length&&t(o[0])}),[t,o]),(0,Je.jsx)("div",{...n,children:(0,Je.jsx)(tt.Placeholder,{instructions:(0,ot.__)("Group blocks together. Select a layout:"),children:(0,Je.jsx)("ul",{role:"list",className:"wp-block-group-placeholder__variations","aria-label":(0,ot.__)("Block variations"),children:o.map((e=>(0,Je.jsx)("li",{children:(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"tertiary",icon:Eu(e.name),iconSize:48,onClick:()=>t(e),className:"wp-block-group-placeholder__variation-button",label:`${e.title}: ${e.description}`})},e.name)))})})})};function $u({tagName:e,onSelectTagName:t}){return(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("HTML element"),options:[{label:(0,ot.__)("Default (<div>)"),value:"div"},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"}],value:e,onChange:t,help:sa[e]})})}const Gu=function({attributes:e,name:t,setAttributes:o,clientId:n}){const{hasInnerBlocks:a,themeSupportsLayout:r}=(0,it.useSelect)((e=>{const{getBlock:t,getSettings:o}=e(nt.store),a=t(n);return{hasInnerBlocks:!(!a||!a.innerBlocks.length),themeSupportsLayout:o()?.supportsLayout}}),[n]),{tagName:i="div",templateLock:s,allowedBlocks:l,layout:c={}}=e,{type:u="default"}=c,d=r||"flex"===u||"grid"===u,p=(0,st.useRef)(),m=(0,nt.useBlockProps)({ref:p}),[g,h]=function({attributes:e={style:void 0,backgroundColor:void 0,textColor:void 0,fontSize:void 0},usedLayoutType:t="",hasInnerBlocks:o=!1}){const{style:n,backgroundColor:a,textColor:r,fontSize:i}=e,[s,l]=(0,st.useState)(!(o||a||i||r||n||"flex"===t||"grid"===t));return(0,st.useEffect)((()=>{(o||a||i||r||n||"flex"===t)&&l(!1)}),[a,i,r,n,t,o]),[s,l]}({attributes:e,usedLayoutType:u,hasInnerBlocks:a});let x;g?x=!1:a||(x=nt.InnerBlocks.ButtonBlockAppender);const _=(0,nt.useInnerBlocksProps)(d?m:{className:"wp-block-group__inner-container"},{dropZoneElement:p.current,templateLock:s,allowedBlocks:l,renderAppender:x}),{selectBlock:b}=(0,it.useDispatch)(nt.store);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)($u,{tagName:i,onSelectTagName:e=>o({tagName:e})}),g&&(0,Je.jsxs)(Ye.View,{children:[_.children,(0,Je.jsx)(Ou,{name:t,onSelect:e=>{o(e.attributes),b(n,-1),h(!1)}})]}),d&&!g&&(0,Je.jsx)(i,{..._}),!d&&!g&&(0,Je.jsx)(i,{...m,children:(0,Je.jsx)("div",{..._})})]})};const Uu={from:[{type:"block",isMultiBlock:!0,blocks:["*"],__experimentalConvert(e){const t=["wide","full"],o=e.reduce(((e,o)=>{const{align:n}=o.attributes;return t.indexOf(n)>t.indexOf(e)?n:e}),void 0),n=e.map((e=>(0,Ke.createBlock)(e.name,e.attributes,e.innerBlocks)));return(0,Ke.createBlock)("core/group",{align:o,layout:{type:"constrained"}},n)}}]},qu=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z"})}),Wu=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z"})}),Zu=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z",fillRule:"evenodd",clipRule:"evenodd"})}),Qu={innerBlocks:[{name:"core/paragraph",attributes:{customTextColor:"#cf2e2e",fontSize:"large",content:(0,ot.__)("One.")}},{name:"core/paragraph",attributes:{customTextColor:"#ff6900",fontSize:"large",content:(0,ot.__)("Two.")}},{name:"core/paragraph",attributes:{customTextColor:"#fcb900",fontSize:"large",content:(0,ot.__)("Three.")}},{name:"core/paragraph",attributes:{customTextColor:"#00d084",fontSize:"large",content:(0,ot.__)("Four.")}},{name:"core/paragraph",attributes:{customTextColor:"#0693e3",fontSize:"large",content:(0,ot.__)("Five.")}},{name:"core/paragraph",attributes:{customTextColor:"#9b51e0",fontSize:"large",content:(0,ot.__)("Six.")}}]},Ku=[{name:"group",title:(0,ot.__)("Group"),description:(0,ot.__)("Gather blocks in a container."),attributes:{layout:{type:"constrained"}},isDefault:!0,scope:["block","inserter","transform"],isActive:e=>!e.layout||!e.layout?.type||"default"===e.layout?.type||"constrained"===e.layout?.type,icon:zc},{name:"group-row",title:(0,ot._x)("Row","single horizontal line"),description:(0,ot.__)("Arrange blocks horizontally."),attributes:{layout:{type:"flex",flexWrap:"nowrap"}},scope:["block","inserter","transform"],isActive:e=>"flex"===e.layout?.type&&(!e.layout?.orientation||"horizontal"===e.layout?.orientation),icon:qu,example:Qu},{name:"group-stack",title:(0,ot.__)("Stack"),description:(0,ot.__)("Arrange blocks vertically."),attributes:{layout:{type:"flex",orientation:"vertical"}},scope:["block","inserter","transform"],isActive:e=>"flex"===e.layout?.type&&"vertical"===e.layout?.orientation,icon:Wu,example:Qu},{name:"group-grid",title:(0,ot.__)("Grid"),description:(0,ot.__)("Arrange blocks in a grid."),attributes:{layout:{type:"grid"}},scope:["block","inserter","transform"],isActive:e=>"grid"===e.layout?.type,icon:Zu,example:Qu}],Yu=Ku,Ju={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/group",title:"Group",category:"design",description:"Gather blocks in a layout container.",keywords:["container","wrapper","row","section"],textdomain:"default",attributes:{tagName:{type:"string",default:"div"},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]},allowedBlocks:{type:"array"}},supports:{__experimentalOnEnter:!0,__experimentalOnMerge:!0,__experimentalSettings:!0,align:["wide","full"],anchor:!0,ariaLabel:!0,html:!1,background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},color:{gradients:!0,heading:!0,button:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},shadow:!0,spacing:{margin:["top","bottom"],padding:!0,blockGap:!0,__experimentalDefaultControls:{padding:!0,blockGap:!0}},dimensions:{minHeight:!0},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},position:{sticky:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},layout:{allowSizingOnChildren:!0},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-group-editor",style:"wp-block-group"},{name:Xu}=Ju,ed={icon:zc,example:{attributes:{layout:{type:"constrained",justifyContent:"center"},style:{spacing:{padding:{top:"4em",right:"3em",bottom:"4em",left:"3em"}}}},innerBlocks:[{name:"core/heading",attributes:{content:(0,ot.__)("La Mancha"),textAlign:"center"}},{name:"core/paragraph",attributes:{align:"center",content:(0,ot.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},{name:"core/spacer",attributes:{height:"10px"}},{name:"core/button",attributes:{text:(0,ot.__)("Read more")}}],viewportWidth:600},transforms:Uu,edit:Gu,save:function({attributes:{tagName:e}}){return(0,Je.jsx)(e,{...nt.useInnerBlocksProps.save(nt.useBlockProps.save())})},deprecated:Fu,variations:Yu},td=()=>et({name:Xu,metadata:Ju,settings:ed}),od=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M6 5V18.5911L12 13.8473L18 18.5911V5H6Z"})}),nd={className:!1,anchor:!0},ad={align:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:""},level:{type:"number",default:2},placeholder:{type:"string"}},rd=e=>{if(!e.customTextColor)return e;const t={color:{text:e.customTextColor}},{customTextColor:o,...n}=e;return{...n,style:t}},id=["left","right","center"],sd=e=>{const{align:t,...o}=e;return id.includes(t)?{...o,textAlign:t}:e},ld={supports:nd,attributes:{...ad,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>rd(sd(e)),save({attributes:e}){const{align:t,level:o,content:n,textColor:a,customTextColor:r}=e,i="h"+o,s=(0,nt.getColorClassName)("color",a),l=ft({[s]:s});return(0,Je.jsx)(nt.RichText.Content,{className:l||void 0,tagName:i,style:{textAlign:t,color:s?void 0:r},value:n})}},cd={attributes:{...ad,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>rd(sd(e)),save({attributes:e}){const{align:t,content:o,customTextColor:n,level:a,textColor:r}=e,i="h"+a,s=(0,nt.getColorClassName)("color",r),l=ft({[s]:s,[`has-text-align-${t}`]:t});return(0,Je.jsx)(nt.RichText.Content,{className:l||void 0,tagName:i,style:{color:s?void 0:n},value:o})},supports:nd},ud={supports:nd,attributes:{...ad,customTextColor:{type:"string"},textColor:{type:"string"}},migrate:e=>rd(sd(e)),save({attributes:e}){const{align:t,content:o,customTextColor:n,level:a,textColor:r}=e,i="h"+a,s=(0,nt.getColorClassName)("color",r),l=ft({[s]:s,"has-text-color":r||n,[`has-text-align-${t}`]:t});return(0,Je.jsx)(nt.RichText.Content,{className:l||void 0,tagName:i,style:{color:s?void 0:n},value:o})}},dd={supports:{align:["wide","full"],anchor:!0,className:!1,color:{link:!0},fontSize:!0,lineHeight:!0,__experimentalSelector:{"core/heading/h1":"h1","core/heading/h2":"h2","core/heading/h3":"h3","core/heading/h4":"h4","core/heading/h5":"h5","core/heading/h6":"h6"},__unstablePasteTextInline:!0},attributes:ad,isEligible:({align:e})=>id.includes(e),migrate:sd,save({attributes:e}){const{align:t,content:o,level:n}=e,a="h"+n,r=ft({[`has-text-align-${t}`]:t});return(0,Je.jsx)(a,{...nt.useBlockProps.save({className:r}),children:(0,Je.jsx)(nt.RichText.Content,{value:o})})}},pd={supports:{align:["wide","full"],anchor:!0,className:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0,textTransform:!0}},__experimentalSelector:"h1,h2,h3,h4,h5,h6",__unstablePasteTextInline:!0,__experimentalSlashInserter:!0},attributes:{textAlign:{type:"string"},content:{type:"string",source:"html",selector:"h1,h2,h3,h4,h5,h6",default:"",role:"content"},level:{type:"number",default:2},placeholder:{type:"string"}},save({attributes:e}){const{textAlign:t,content:o,level:n}=e,a="h"+n,r=ft({[`has-text-align-${t}`]:t});return(0,Je.jsx)(a,{...nt.useBlockProps.save({className:r}),children:(0,Je.jsx)(nt.RichText.Content,{value:o})})}},md=[pd,dd,ud,cd,ld],gd={},hd=e=>hc()((e=>{const t=document.createElement("div");return t.innerHTML=e,t.innerText})(e)).replace(/[^\p{L}\p{N}]+/gu,"-").toLowerCase().replace(/(^-+)|(-+$)/g,""),xd=(e,t)=>{const o=hd(t);if(""===o)return null;delete gd[e];let n=o,a=0;for(;Object.values(gd).includes(n);)a+=1,n=o+"-"+a;return n},_d=(e,t)=>{gd[e]=t};const bd=function({attributes:e,setAttributes:t,mergeBlocks:o,onReplace:n,style:a,clientId:r}){const{textAlign:i,content:s,level:l,levelOptions:c,placeholder:u,anchor:d}=e,p="h"+l,m=(0,nt.useBlockProps)({className:ft({[`has-text-align-${i}`]:i}),style:a}),g=(0,nt.useBlockEditingMode)(),{canGenerateAnchors:h}=(0,it.useSelect)((e=>{const{getGlobalBlockCount:t,getSettings:o}=e(nt.store);return{canGenerateAnchors:!!o().generateAnchors||t("core/table-of-contents")>0}}),[]),{__unstableMarkNextChangeAsNotPersistent:x}=(0,it.useDispatch)(nt.store);return(0,st.useEffect)((()=>{if(h)return!d&&s&&(x(),t({anchor:xd(r,s)})),_d(r,d),()=>_d(r,null)}),[d,s,r,h]),(0,Je.jsxs)(Je.Fragment,{children:["default"===g&&(0,Je.jsxs)(nt.BlockControls,{group:"block",children:[(0,Je.jsx)(nt.HeadingLevelDropdown,{value:l,options:c,onChange:e=>t({level:e})}),(0,Je.jsx)(nt.AlignmentControl,{value:i,onChange:e=>{t({textAlign:e})}})]}),(0,Je.jsx)(nt.RichText,{identifier:"content",tagName:p,value:s,onChange:e=>{const o={content:e};!h||d&&e&&xd(r,s)!==d||(o.anchor=xd(r,e)),t(o)},onMerge:o,onReplace:n,onRemove:()=>n([]),placeholder:u||(0,ot.__)("Heading"),textAlign:i,...st.Platform.isNative&&{deleteEnter:!0},...m})]})};const yd={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,anchor:t,align:o,metadata:n})=>(0,Ke.createBlock)("core/heading",{content:e,anchor:t,textAlign:o,metadata:Lo(n,"core/heading",(({content:e})=>({content:e})))})))},{type:"raw",selector:"h1,h2,h3,h4,h5,h6",schema:({phrasingContentSchema:e,isPaste:t})=>{const o={children:e,attributes:t?[]:["style","id"]};return{h1:o,h2:o,h3:o,h4:o,h5:o,h6:o}},transform(e){const t=(0,Ke.getBlockAttributes)("core/heading",e.outerHTML),{textAlign:o}=e.style||{};var n;return t.level=(n=e.nodeName,Number(n.substr(1))),"left"!==o&&"center"!==o&&"right"!==o||(t.align=o),(0,Ke.createBlock)("core/heading",t)}},...[1,2,3,4,5,6].map((e=>({type:"prefix",prefix:Array(e+1).join("#"),transform:t=>(0,Ke.createBlock)("core/heading",{level:e,content:t})}))),...[1,2,3,4,5,6].map((e=>({type:"enter",regExp:new RegExp(`^/(h|H)${e}$`),transform:()=>(0,Ke.createBlock)("core/heading",{level:e})})))],to:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>e.map((({content:e,textAlign:t,metadata:o})=>(0,Ke.createBlock)("core/paragraph",{content:e,align:t,metadata:Lo(o,"core/paragraph",(({content:e})=>({content:e})))})))}]},fd=yd,vd={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/heading",title:"Heading",category:"text",description:"Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.",keywords:["title","subtitle"],textdomain:"default",attributes:{textAlign:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"h1,h2,h3,h4,h5,h6",role:"content"},level:{type:"number",default:2},levelOptions:{type:"array"},placeholder:{type:"string"}},supports:{align:["wide","full"],anchor:!0,className:!0,splitting:!0,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__unstablePasteTextInline:!0,__experimentalSlashInserter:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-heading-editor",style:"wp-block-heading"},{name:kd}=vd,wd={icon:od,example:{attributes:{content:(0,ot.__)("Code is Poetry"),level:2,textAlign:"center"}},__experimentalLabel(e,{context:t}){const{content:o,level:n}=e,a=e?.metadata?.name,r=o?.trim().length>0;return"list-view"===t&&(a||r)?a||o:"accessibility"===t?r?(0,ot.sprintf)((0,ot.__)("Level %1$s. %2$s"),n,o):(0,ot.sprintf)((0,ot.__)("Level %s. Empty."),n):void 0},transforms:fd,deprecated:md,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:bd,save:function({attributes:e}){const{textAlign:t,content:o,level:n}=e,a="h"+n,r=ft({[`has-text-align-${t}`]:t});return(0,Je.jsx)(a,{...nt.useBlockProps.save({className:r}),children:(0,Je.jsx)(nt.RichText.Content,{value:o})})}},Cd=()=>et({name:kd,metadata:vd,settings:wd}),jd=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})}),Sd=e=>e.preventDefault();const Bd={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/home-link",category:"design",parent:["core/navigation"],title:"Home Link",description:"Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","fontSize","customFontSize","style"],supports:{reusable:!1,html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-home-link-editor",style:"wp-block-home-link"},{name:Td}=Bd,Nd={icon:jd,edit:function({attributes:e,setAttributes:t,context:o}){var n;const a=(0,it.useSelect)((e=>e(ct.store).getEntityRecord("root","__unstableBase")?.home),[]),{textColor:r,backgroundColor:i,style:s}=o,l=(0,nt.useBlockProps)({className:ft("wp-block-navigation-item",{"has-text-color":!!r||!!s?.color?.text,[`has-${r}-color`]:!!r,"has-background":!!i||!!s?.color?.background,[`has-${i}-background-color`]:!!i}),style:{color:s?.color?.text,backgroundColor:s?.color?.background}});return(0,Je.jsx)("div",{...l,children:(0,Je.jsx)("a",{className:"wp-block-home-link__content wp-block-navigation-item__content",href:a,onClick:Sd,children:(0,Je.jsx)(nt.RichText,{identifier:"label",className:"wp-block-home-link__label",value:null!==(n=e.label)&&void 0!==n?n:(0,ot.__)("Home"),onChange:e=>{t({label:e})},"aria-label":(0,ot.__)("Home link text"),placeholder:(0,ot.__)("Add home link"),withoutInteractiveFormatting:!0})})})},save:function(){return(0,Je.jsx)(nt.InnerBlocks.Content,{})},example:{attributes:{label:(0,ot._x)("Home Link","block example")}}},Pd=()=>et({name:Td,metadata:Bd,settings:Nd}),Id=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z"})});function Md({content:e,isSelected:t}){const o=(0,it.useSelect)((e=>e(nt.store).getSettings().styles),[]),n=(0,st.useMemo)((()=>["\n\thtml,body,:root {\n\t\tmargin: 0 !important;\n\t\tpadding: 0 !important;\n\t\toverflow: visible !important;\n\t\tmin-height: auto !important;\n\t}\n",...(0,nt.transformStyles)((null!=o?o:[]).filter((e=>e.css)))]),[o]);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.SandBox,{html:e,styles:n,title:(0,ot.__)("Custom HTML Preview"),tabIndex:-1}),!t&&(0,Je.jsx)("div",{className:"block-library-html__preview-overlay"})]})}const Dd={from:[{type:"block",blocks:["core/code"],transform:({content:e})=>(0,Ke.createBlock)("core/html",{content:(0,Ho.create)({html:e}).text})}]},zd=Dd,Ad={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/html",title:"Custom HTML",category:"widgets",description:"Add custom HTML code and preview it as you edit.",keywords:["embed"],textdomain:"default",attributes:{content:{type:"string",source:"raw"}},supports:{customClassName:!1,className:!1,html:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-html-editor"},{name:Rd}=Ad,Hd={icon:Id,example:{attributes:{content:"<marquee>"+(0,ot.__)("Welcome to the wonderful world of blocks…")+"</marquee>"}},edit:function e({attributes:t,setAttributes:o,isSelected:n}){const[a,r]=(0,st.useState)(),i=(0,st.useContext)(tt.Disabled.Context),s=(0,ut.useInstanceId)(e,"html-edit-desc"),l=(0,it.useSelect)((e=>e(nt.store).getSettings().isPreviewMode),[]),c=(0,nt.useBlockProps)({className:"block-library-html__edit","aria-describedby":a?s:void 0});return(0,Je.jsxs)("div",{...c,children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsxs)(tt.ToolbarGroup,{children:[(0,Je.jsx)(tt.ToolbarButton,{isPressed:!a,onClick:function(){r(!1)},children:"HTML"}),(0,Je.jsx)(tt.ToolbarButton,{isPressed:a,onClick:function(){r(!0)},children:(0,ot.__)("Preview")})]})}),a||l||i?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Md,{content:t.content,isSelected:n}),(0,Je.jsx)(tt.VisuallyHidden,{id:s,children:(0,ot.__)("HTML preview is not yet fully accessible. Please switch screen reader to virtualized mode to navigate the below iFrame.")})]}):(0,Je.jsx)(nt.PlainText,{value:t.content,onChange:e=>o({content:e}),placeholder:(0,ot.__)("Write HTML…"),"aria-label":(0,ot.__)("HTML")})]})},save:function({attributes:e}){return(0,Je.jsx)(st.RawHTML,{children:e.content})},transforms:zd},Ld=()=>et({name:Rd,metadata:Ad,settings:Hd}),Vd={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"}},save({attributes:e}){const{url:t,alt:o,caption:n,align:a,href:r,width:i,height:s}=e,l=i||s?{width:i,height:s}:{},c=(0,Je.jsx)("img",{src:t,alt:o,...l});let u={};return i?u={width:i}:"left"!==a&&"right"!==a||(u={maxWidth:"50%"}),(0,Je.jsxs)("figure",{className:a?`align${a}`:null,style:u,children:[r?(0,Je.jsx)("a",{href:r,children:c}):c,!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:n})]})}},Fd={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"}},save({attributes:e}){const{url:t,alt:o,caption:n,align:a,href:r,width:i,height:s,id:l}=e,c=(0,Je.jsx)("img",{src:t,alt:o,className:l?`wp-image-${l}`:null,width:i,height:s});return(0,Je.jsxs)("figure",{className:a?`align${a}`:null,children:[r?(0,Je.jsx)("a",{href:r,children:c}):c,!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:n})]})}},Ed={attributes:{url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"array",source:"children",selector:"figcaption"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},id:{type:"number"},align:{type:"string"},width:{type:"number"},height:{type:"number"},linkDestination:{type:"string",default:"none"}},save({attributes:e}){const{url:t,alt:o,caption:n,align:a,href:r,width:i,height:s,id:l}=e,c=ft({[`align${a}`]:a,"is-resized":i||s}),u=(0,Je.jsx)("img",{src:t,alt:o,className:l?`wp-image-${l}`:null,width:i,height:s});return(0,Je.jsxs)("figure",{className:c,children:[r?(0,Je.jsx)("a",{href:r,children:u}):u,!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:n})]})}},Od={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0},save({attributes:e}){const{url:t,alt:o,caption:n,align:a,href:r,rel:i,linkClass:s,width:l,height:c,id:u,linkTarget:d,sizeSlug:p,title:m}=e,g=i||void 0,h=ft({[`align${a}`]:a,[`size-${p}`]:p,"is-resized":l||c}),x=(0,Je.jsx)("img",{src:t,alt:o,className:u?`wp-image-${u}`:null,width:l,height:c,title:m}),_=(0,Je.jsxs)(Je.Fragment,{children:[r?(0,Je.jsx)("a",{className:s,href:r,target:d,rel:g,children:x}):x,!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:n})]});return"left"===a||"right"===a||"center"===a?(0,Je.jsx)("div",{...nt.useBlockProps.save(),children:(0,Je.jsx)("figure",{className:h,children:_})}):(0,Je.jsx)("figure",{...nt.useBlockProps.save({className:h}),children:_})}},$d={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:""},caption:{type:"string",source:"html",selector:"figcaption"},title:{type:"string",source:"attribute",selector:"img",attribute:"title"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number"},width:{type:"number"},height:{type:"number"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{__experimentalDuotone:"img",text:!1,background:!1},__experimentalBorder:{radius:!0,__experimentalDefaultControls:{radius:!0}},__experimentalStyle:{spacing:{margin:"0 0 1em 0"}}},save({attributes:e}){const{url:t,alt:o,caption:n,align:a,href:r,rel:i,linkClass:s,width:l,height:c,id:u,linkTarget:d,sizeSlug:p,title:m}=e,g=i||void 0,h=ft({[`align${a}`]:a,[`size-${p}`]:p,"is-resized":l||c}),x=(0,Je.jsx)("img",{src:t,alt:o,className:u?`wp-image-${u}`:null,width:l,height:c,title:m}),_=(0,Je.jsxs)(Je.Fragment,{children:[r?(0,Je.jsx)("a",{className:s,href:r,target:d,rel:g,children:x}):x,!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:n})]});return(0,Je.jsx)("figure",{...nt.useBlockProps.save({className:h}),children:_})}},Gd={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"string",source:"html",selector:"figcaption",role:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",role:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"number"},height:{type:"number"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate(e){const{height:t,width:o}=e;return{...e,width:"number"==typeof o?`${o}px`:o,height:"number"==typeof t?`${t}px`:t}},save({attributes:e}){const{url:t,alt:o,caption:n,align:a,href:r,rel:i,linkClass:s,width:l,height:c,aspectRatio:u,scale:d,id:p,linkTarget:m,sizeSlug:g,title:h}=e,x=i||void 0,_=(0,nt.__experimentalGetBorderClassesAndStyles)(e),b=ft({[`align${a}`]:a,[`size-${g}`]:g,"is-resized":l||c,"has-custom-border":!!_.className||_.style&&Object.keys(_.style).length>0}),y=ft(_.className,{[`wp-image-${p}`]:!!p}),f=(0,Je.jsx)("img",{src:t,alt:o,className:y||void 0,style:{..._.style,aspectRatio:u,objectFit:d},width:l,height:c,title:h}),v=(0,Je.jsxs)(Je.Fragment,{children:[r?(0,Je.jsx)("a",{className:s,href:r,target:m,rel:x,children:f}):f,!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{className:(0,nt.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:n})]});return(0,Je.jsx)("figure",{...nt.useBlockProps.save({className:b}),children:v})}},Ud={attributes:{align:{type:"string"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"string",source:"html",selector:"figcaption",role:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",role:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"number"},height:{type:"number"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate:({width:e,height:t,...o})=>({...o,width:`${e}px`,height:`${t}px`}),save({attributes:e}){const{url:t,alt:o,caption:n,align:a,href:r,rel:i,linkClass:s,width:l,height:c,aspectRatio:u,scale:d,id:p,linkTarget:m,sizeSlug:g,title:h}=e,x=i||void 0,_=(0,nt.__experimentalGetBorderClassesAndStyles)(e),b=ft({[`align${a}`]:a,[`size-${g}`]:g,"is-resized":l||c,"has-custom-border":!!_.className||_.style&&Object.keys(_.style).length>0}),y=ft(_.className,{[`wp-image-${p}`]:!!p}),f=(0,Je.jsx)("img",{src:t,alt:o,className:y||void 0,style:{..._.style,aspectRatio:u,objectFit:d,width:l,height:c},width:l,height:c,title:h}),v=(0,Je.jsxs)(Je.Fragment,{children:[r?(0,Je.jsx)("a",{className:s,href:r,target:m,rel:x,children:f}):f,!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{className:(0,nt.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:n})]});return(0,Je.jsx)("figure",{...nt.useBlockProps.save({className:b}),children:v})}},qd={attributes:{align:{type:"string"},behaviors:{type:"object"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"string",source:"html",selector:"figcaption",role:"content"},title:{type:"string",source:"attribute",selector:"img",attribute:"title",role:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"string"},height:{type:"string"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}}},migrate({width:e,height:t,...o}){if(!o.behaviors?.lightbox)return o;const{behaviors:{lightbox:{enabled:n}}}=o,a={...o,lightbox:{enabled:n}};return delete a.behaviors,a},isEligible:e=>!!e.behaviors,save({attributes:e}){const{url:t,alt:o,caption:n,align:a,href:r,rel:i,linkClass:s,width:l,height:c,aspectRatio:u,scale:d,id:p,linkTarget:m,sizeSlug:g,title:h}=e,x=i||void 0,_=(0,nt.__experimentalGetBorderClassesAndStyles)(e),b=ft({[`align${a}`]:a,[`size-${g}`]:g,"is-resized":l||c,"has-custom-border":!!_.className||_.style&&Object.keys(_.style).length>0}),y=ft(_.className,{[`wp-image-${p}`]:!!p}),f=(0,Je.jsx)("img",{src:t,alt:o,className:y||void 0,style:{..._.style,aspectRatio:u,objectFit:d,width:l,height:c},title:h}),v=(0,Je.jsxs)(Je.Fragment,{children:[r?(0,Je.jsx)("a",{className:s,href:r,target:m,rel:x,children:f}):f,!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{className:(0,nt.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:n})]});return(0,Je.jsx)("figure",{...nt.useBlockProps.save({className:b}),children:v})}},Wd=[qd,Ud,Gd,$d,Od,Ed,Fd,Vd],Zd=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z"})}),Qd=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),Kd=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M18 20v-2h2v-1.5H7.75a.25.25 0 0 1-.25-.25V4H6v2H4v1.5h2v8.75c0 .966.784 1.75 1.75 1.75h8.75v2H18ZM9.273 7.5h6.977a.25.25 0 0 1 .25.25v6.977H18V7.75A1.75 1.75 0 0 0 16.25 6H9.273v1.5Z"})}),Yd=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z"})}),Jd=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})}),{DimensionsTool:Xd,ResolutionTool:ep}=Ot(nt.privateApis),tp=[{value:"cover",label:(0,ot._x)("Cover","Scale option for dimensions control"),help:(0,ot.__)("Image covers the space evenly.")},{value:"contain",label:(0,ot._x)("Contain","Scale option for dimensions control"),help:(0,ot.__)("Image is contained without distortion.")}],op={placement:"bottom-start"},np=({href:e,children:t})=>e?(0,Je.jsx)("a",{href:e,onClick:e=>e.preventDefault(),"aria-disabled":!0,style:{pointerEvents:"none",cursor:"default",display:"inline"},children:t}):t;function ap({attributes:e,setAttributes:t,lockAltControls:o,lockAltControlsMessage:n,lockTitleControls:a,lockTitleControlsMessage:r}){const[i,s]=(0,st.useState)(null),[l,c]=(0,st.useState)(!1),[u,d]=(0,st.useState)(!1);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.ToolbarItem,{ref:s,children:e=>(0,Je.jsx)(tt.DropdownMenu,{icon:Qd,label:(0,ot.__)("More"),toggleProps:{...e,description:(0,ot.__)("Displays more controls.")},popoverProps:op,children:({onClose:e})=>(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.MenuItem,{onClick:()=>{c(!0),e()},"aria-haspopup":"dialog",children:(0,ot._x)("Alternative text","Alternative text for an image. Block toolbar label, a low character count is preferred.")}),(0,Je.jsx)(tt.MenuItem,{onClick:()=>{d(!0),e()},"aria-haspopup":"dialog",children:(0,ot.__)("Title text")})]})})}),l&&(0,Je.jsx)(tt.Popover,{placement:"bottom-start",anchor:i,onClose:()=>c(!1),offset:13,variant:"toolbar",children:(0,Je.jsx)("div",{className:"wp-block-image__toolbar_content_textarea__container",children:(0,Je.jsx)(tt.TextareaControl,{className:"wp-block-image__toolbar_content_textarea",label:(0,ot.__)("Alternative text"),value:e.alt||"",onChange:e=>t({alt:e}),disabled:o,help:o?(0,Je.jsx)(Je.Fragment,{children:n}):(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.ExternalLink,{href:(0,ot.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,ot.__)("Describe the purpose of the image.")}),(0,Je.jsx)("br",{}),(0,ot.__)("Leave empty if decorative.")]}),__nextHasNoMarginBottom:!0})})}),u&&(0,Je.jsx)(tt.Popover,{placement:"bottom-start",anchor:i,onClose:()=>d(!1),offset:13,variant:"toolbar",children:(0,Je.jsx)("div",{className:"wp-block-image__toolbar_content_textarea__container",children:(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,className:"wp-block-image__toolbar_content_textarea",__nextHasNoMarginBottom:!0,label:(0,ot.__)("Title attribute"),value:e.title||"",onChange:e=>t({title:e}),disabled:a,help:a?(0,Je.jsx)(Je.Fragment,{children:r}):(0,Je.jsxs)(Je.Fragment,{children:[(0,ot.__)("Describe the role of this image on the page."),(0,Je.jsx)(tt.ExternalLink,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute",children:(0,ot.__)("(Note: many devices and browsers do not display this text.)")})]})})})})]})}function rp({temporaryURL:e,attributes:t,setAttributes:o,isSingleSelected:n,insertBlocksAfter:a,onReplace:r,onSelectImage:i,onSelectURL:s,onUploadError:l,context:c,clientId:u,blockEditingMode:d,parentLayoutType:p,maxContentWidth:m}){const{url:g="",alt:h,align:x,id:_,href:b,rel:y,linkClass:f,linkDestination:v,title:k,width:w,height:C,aspectRatio:j,scale:S,linkTarget:B,sizeSlug:T,lightbox:N,metadata:P}=t,I=w?parseInt(w,10):void 0,M=C?parseInt(C,10):void 0,D=(0,st.useRef)(),{allowResize:z=!0}=c,{getBlock:A,getSettings:R}=(0,it.useSelect)(nt.store),H=(0,it.useSelect)((e=>_&&n?e(ct.store).getMedia(_,{context:"view"}):null),[_,n]),{canInsertCover:L,imageEditing:V,imageSizes:F,maxWidth:E}=(0,it.useSelect)((e=>{const{getBlockRootClientId:t,canInsertBlockType:o}=e(nt.store),n=t(u),a=R();return{imageEditing:a.imageEditing,imageSizes:a.imageSizes,maxWidth:a.maxWidth,canInsertCover:o("core/cover",n)}}),[u]),{replaceBlocks:O,toggleSelection:$}=(0,it.useDispatch)(nt.store),{createErrorNotice:G,createSuccessNotice:U}=(0,it.useDispatch)(Rt.store),q=(0,ut.useViewportMatch)("medium"),W=["wide","full"].includes(x),[{loadedNaturalWidth:Z,loadedNaturalHeight:Q},K]=(0,st.useState)({}),[Y,J]=(0,st.useState)(!1),[X,ee]=(0,st.useState)(),[te,oe]=(0,st.useState)(!1),ne="default"===d,ae="contentOnly"===d,re=z&&ne&&!W&&q,ie=F.filter((({slug:e})=>H?.media_details?.sizes?.[e]?.source_url)).map((({name:e,slug:t})=>({value:t,label:e})));(0,st.useEffect)((()=>{ip(_,g)&&n&&R().mediaUpload?X||window.fetch(g.includes("?")?g:g+"?").then((e=>e.blob())).then((e=>ee(e))).catch((()=>{})):ee()}),[_,g,n,X]);const{naturalWidth:se,naturalHeight:le}=(0,st.useMemo)((()=>({naturalWidth:D.current?.naturalWidth||Z||void 0,naturalHeight:D.current?.naturalHeight||Q||void 0})),[Z,Q,D.current?.complete]);(0,st.useEffect)((()=>{n||J(!1)}),[n]);const ce=_&&se&&le&&V,ue=n&&ce&&!Y&&!ae;const de=(0,tt.__experimentalUseCustomUnits)({availableUnits:["px"]}),[pe]=(0,nt.useSettings)("lightbox"),me=!!N&&N?.enabled!==pe?.enabled||pe?.allowEditing,ge=!!N?.enabled||!N&&!!pe?.enabled,he=mt(),xe=(0,Je.jsx)(Xd,{value:{width:w,height:C,scale:S,aspectRatio:j},onChange:({width:e,height:t,scale:n,aspectRatio:a})=>{o({width:!e&&t?"auto":e,height:t,scale:n,aspectRatio:a})},defaultScale:"cover",defaultAspectRatio:"auto",scaleOptions:tp,unitsOptions:de}),_e=(0,Je.jsx)(Xd,{value:{aspectRatio:j},onChange:({aspectRatio:e})=>{o({aspectRatio:e,scale:"cover"})},defaultAspectRatio:"auto",tools:["aspectRatio"]}),be=()=>{o({alt:void 0,width:void 0,height:void 0,scale:void 0,aspectRatio:void 0,lightbox:void 0})},ye=(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:be,dropdownMenuProps:he,children:re&&("grid"===p?_e:xe)})}),fe="core/pattern-overrides"===P?.bindings?.__default?.source,{lockUrlControls:ve=!1,lockHrefControls:ke=!1,lockAltControls:we=!1,lockAltControlsMessage:Ce,lockTitleControls:je=!1,lockTitleControlsMessage:Se,lockCaption:Be=!1}=(0,it.useSelect)((e=>{if(!n)return{};const{url:t,alt:o,title:a}=P?.bindings||{},r=!!c["pattern/overrides"],i=(0,Ke.getBlockBindingsSource)(t?.source),s=(0,Ke.getBlockBindingsSource)(o?.source),l=(0,Ke.getBlockBindingsSource)(a?.source);return{lockUrlControls:!!t&&!i?.canUserEditValue?.({select:e,context:c,args:t?.args}),lockHrefControls:r||fe,lockCaption:r,lockAltControls:!!o&&!s?.canUserEditValue?.({select:e,context:c,args:o?.args}),lockAltControlsMessage:s?.label?(0,ot.sprintf)((0,ot.__)("Connected to %s"),s.label):(0,ot.__)("Connected to dynamic data"),lockTitleControls:!!a&&!l?.canUserEditValue?.({select:e,context:c,args:a?.args}),lockTitleControlsMessage:l?.label?(0,ot.sprintf)((0,ot.__)("Connected to %s"),l.label):(0,ot.__)("Connected to dynamic data")}}),[fe,c,n,P?.bindings]),Te=n&&!Y&&!ke&&!ve,Ne=n&&L,Pe=Te||ue||Ne,Ie=n&&!Y&&!ve&&(0,Je.jsx)(nt.BlockControls,{group:ae?"inline":"other",children:(0,Je.jsx)(nt.MediaReplaceFlow,{mediaId:_,mediaURL:g,allowedTypes:_u,accept:"image/*",onSelect:i,onSelectURL:s,onError:l,name:g?(0,ot.__)("Replace"):(0,ot.__)("Add image"),onReset:()=>i(void 0)})}),Me=(0,Je.jsxs)(Je.Fragment,{children:[Pe&&(0,Je.jsxs)(nt.BlockControls,{group:"block",children:[Te&&(0,Je.jsx)(nt.__experimentalImageURLInputUI,{url:b||"",onChangeUrl:function(e){o(e)},linkDestination:v,mediaUrl:H&&H.source_url||g,mediaLink:H&&H.link,linkTarget:B,linkClass:f,rel:y,showLightboxSetting:me,lightboxEnabled:ge,onSetLightbox:function(e){o(e&&!pe?.enabled?{lightbox:{enabled:!0}}:!e&&pe?.enabled?{lightbox:{enabled:!1}}:{lightbox:void 0})},resetLightbox:function(){o(pe?.enabled&&pe?.allowEditing?{lightbox:{enabled:!1}}:{lightbox:void 0})}}),ue&&(0,Je.jsx)(tt.ToolbarButton,{onClick:()=>J(!0),icon:Kd,label:(0,ot.__)("Crop")}),Ne&&(0,Je.jsx)(tt.ToolbarButton,{icon:Yd,label:(0,ot.__)("Add text over image"),onClick:function(){O(u,(0,Ke.switchToBlockType)(A(u),"core/cover"))}})]}),n&&X&&(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(tt.ToolbarGroup,{children:(0,Je.jsx)(tt.ToolbarButton,{onClick:function(){const{mediaUpload:e}=R();e&&e({filesList:[X],onFileChange([e]){i(e),(0,lt.isBlobURL)(e.url)||(ee(),U((0,ot.__)("Image uploaded."),{type:"snackbar"}))},allowedTypes:_u,onError(e){G(e,{type:"snackbar"})}})},icon:Jd,label:(0,ot.__)("Upload to Media Library")})})}),ae&&(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(ap,{attributes:t,setAttributes:o,lockAltControls:we,lockAltControlsMessage:Ce,lockTitleControls:je,lockTitleControlsMessage:Se})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:be,dropdownMenuProps:he,children:[n&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Alternative text"),isShownByDefault:!0,hasValue:()=>!!h,onDeselect:()=>o({alt:void 0}),children:(0,Je.jsx)(tt.TextareaControl,{label:(0,ot.__)("Alternative text"),value:h||"",onChange:function(e){o({alt:e})},readOnly:we,help:we?(0,Je.jsx)(Je.Fragment,{children:Ce}):(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.ExternalLink,{href:(0,ot.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,ot.__)("Describe the purpose of the image.")}),(0,Je.jsx)("br",{}),(0,ot.__)("Leave empty if decorative.")]}),__nextHasNoMarginBottom:!0})}),re&&("grid"===p?_e:xe),!!ie.length&&(0,Je.jsx)(ep,{value:T,onChange:function(e){const t=H?.media_details?.sizes?.[e]?.source_url;if(!t)return null;o({url:t,sizeSlug:e})},options:ie})]})}),(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Title attribute"),value:k||"",onChange:function(e){o({title:e})},readOnly:je,help:je?(0,Je.jsx)(Je.Fragment,{children:Se}):(0,Je.jsxs)(Je.Fragment,{children:[(0,ot.__)("Describe the role of this image on the page."),(0,Je.jsx)(tt.ExternalLink,{href:"https://www.w3.org/TR/html52/dom.html#the-title-attribute",children:(0,ot.__)("(Note: many devices and browsers do not display this text.)")})]})})})]}),De=(0,vt.getFilename)(g);let ze;ze=h||(De?(0,ot.sprintf)((0,ot.__)("This image has an empty alt attribute; its file name is %s"),De):(0,ot.__)("This image has an empty alt attribute"));const Ae=(0,nt.__experimentalUseBorderProps)(t),Re=(0,nt.__experimentalGetShadowClassesAndStyles)(t),He=t.className?.includes("is-style-rounded"),{postType:Le,postId:Ve,queryId:Fe}=c,Ee=Number.isFinite(Fe),[,Oe]=(0,ct.useEntityProp)("postType",Le,"featured_media",Ve);let $e=e&&te?(0,Je.jsx)(tt.Placeholder,{className:"wp-block-image__placeholder",withIllustration:!0,children:(0,Je.jsx)(tt.Spinner,{})}):(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("img",{src:e||g,alt:ze,onError:function(){oe(!0);const e=qt({attributes:{url:g}});void 0!==e&&r(e)},onLoad:function(e){oe(!1),K({loadedNaturalWidth:e.target?.naturalWidth,loadedNaturalHeight:e.target?.naturalHeight})},ref:D,className:Ae.className,style:{width:w&&C||j?"100%":void 0,height:w&&C||j?"100%":void 0,objectFit:S,...Ae.style,...Re.style}}),e&&(0,Je.jsx)(tt.Spinner,{})]});if(ce&&Y)$e=(0,Je.jsx)(np,{href:b,children:(0,Je.jsx)(nt.__experimentalImageEditor,{id:_,url:g,width:I,height:M,naturalHeight:le,naturalWidth:se,onSaveImage:e=>o(e),onFinishEditing:()=>{J(!1)},borderProps:He?void 0:Ae})});else if(re&&"grid"!==p){const e=j&&function(e){const[t,o=1]=e.split("/").map(Number),n=t/o;return n===1/0||0===n?NaN:n}(j),t=se/le,a=e||I/M||t||1,r=!I&&M?M*a:I,i=!M&&I?I/a:M,s=se<le?du:du*a,l=le<se?du:du/a,c=m||2.5*E;let u=!1,d=!1;"center"===x?(u=!0,d=!0):(0,ot.isRTL)()?"left"===x?u=!0:d=!0:"right"===x?d=!0:u=!0,$e=(0,Je.jsx)(tt.ResizableBox,{style:{display:"block",objectFit:S,aspectRatio:w||C||!j?void 0:j},size:{width:null!=r?r:"auto",height:null!=i?i:"auto"},showHandle:n,minWidth:s,maxWidth:c,minHeight:l,maxHeight:c/a,lockAspectRatio:a,enable:{top:!1,right:u,bottom:!0,left:d},onResizeStart:function(){$(!1)},onResizeStop:(e,n,r)=>{$(!0),m&&se>=m&&Math.abs(r.offsetWidth-m)<10?o({width:void 0,height:void 0}):o({width:`${r.offsetWidth}px`,height:"auto",aspectRatio:a===t?void 0:String(a)})},resizeRatio:"center"===x?2:1,children:(0,Je.jsx)(np,{href:b,children:$e})})}else $e=(0,Je.jsx)("div",{style:{width:w,height:C,aspectRatio:j},children:(0,Je.jsx)(np,{href:b,children:$e})});if(!g&&!e)return(0,Je.jsxs)(Je.Fragment,{children:[Ie,P?.bindings?Me:ye]});const Ge=()=>{Oe(_),U((0,ot.__)("Post featured image updated."),{type:"snackbar"})},Ue=(0,Je.jsx)(nt.BlockSettingsMenuControls,{children:({selectedClientIds:e})=>1===e.length&&!Ee&&Ve&&_&&u===e[0]&&(0,Je.jsx)(tt.MenuItem,{onClick:Ge,children:(0,ot.__)("Set as featured image")})});return(0,Je.jsxs)(Je.Fragment,{children:[Ie,Me,Ue,$e,(0,Je.jsx)(Yt,{attributes:t,setAttributes:o,isSelected:n,insertBlocksAfter:a,label:(0,ot.__)("Image caption text"),showToolbarButton:n&&ne&&!fe,readOnly:Be})]})}const ip=(e,t)=>t&&!e&&!(0,lt.isBlobURL)(t);function sp(e,t){var o,n;return"url"in(null!==(o=e?.sizes?.[t])&&void 0!==o?o:{})||"source_url"in(null!==(n=e?.media_details?.sizes?.[t])&&void 0!==n?n:{})}const lp=function({attributes:e,setAttributes:t,isSelected:o,className:n,insertBlocksAfter:a,onReplace:r,context:i,clientId:s,__unstableParentLayout:l}){const{url:c="",alt:u,caption:d,id:p,width:m,height:g,sizeSlug:h,aspectRatio:x,scale:_,align:b,metadata:y}=e,[f,v]=(0,st.useState)(e.blob),k=(0,st.useRef)(),w=!l||"flex"!==l.type&&"grid"!==l.type,[C,j]=function(){const[e,{width:t}]=(0,ut.useResizeObserver)(),o=(0,st.useRef)();return[(0,Je.jsx)("div",{className:"wp-block","aria-hidden":"true",style:{position:"absolute",inset:0,width:"100%",height:0,margin:0},ref:o,children:e}),t]}(),[S,{width:B}]=(0,ut.useResizeObserver)(),T=B&&B<160,N=(0,st.useRef)();(0,st.useEffect)((()=>{N.current=u}),[u]);const P=(0,st.useRef)();(0,st.useEffect)((()=>{P.current=d}),[d]);const{__unstableMarkNextChangeAsNotPersistent:I,replaceBlock:M}=(0,it.useDispatch)(nt.store);(0,st.useEffect)((()=>{["wide","full"].includes(b)&&(I(),t({width:void 0,height:void 0,aspectRatio:void 0,scale:void 0}))}),[I,b,t]);const{getSettings:D,getBlockRootClientId:z,getBlockName:A,canInsertBlockType:R}=(0,it.useSelect)(nt.store),H=(0,nt.useBlockEditingMode)(),{createErrorNotice:L}=(0,it.useDispatch)(Rt.store);function V(e){L(e,{type:"snackbar"}),t({src:void 0,id:void 0,url:void 0,blob:void 0})}function F(o){if(Array.isArray(o))return void function(e){const t=k.current?.ownerDocument.defaultView;if(e.every((e=>e instanceof t.File))){const t=e,o=z(s);t.some((e=>!fu(e)))&&L((0,ot.__)("If uploading to a gallery all files need to be image formats"),{id:"gallery-upload-invalid-file",type:"snackbar"});const n=t.filter((e=>fu(e))).map((e=>(0,Ke.createBlock)("core/image",{blob:(0,lt.createBlobURL)(e)})));if("core/gallery"===A(o))M(s,n);else if(R("core/gallery",o)){const e=(0,Ke.createBlock)("core/gallery",{},n);M(s,e)}}}(o);if(!o||!o.url)return t({url:void 0,alt:void 0,id:void 0,title:void 0,caption:void 0,blob:void 0}),void v();if((0,lt.isBlobURL)(o.url))return void v(o.url);const{imageDefaultSize:n}=D();let a="full";h&&sp(o,h)?a=h:sp(o,n)&&(a=n);let r,i=((e,t)=>{const o=Object.fromEntries(Object.entries(null!=e?e:{}).filter((([e])=>["alt","id","link","caption"].includes(e))));return o.url=e?.sizes?.[t]?.url||e?.media_details?.sizes?.[t]?.source_url||e.url,o})(o,a);if(P.current&&!i.caption){const{caption:e,...t}=i;i=t}r=o.id&&o.id===p?{url:c}:{sizeSlug:a};let l,u=e.linkDestination;if(!u)switch(window?.wp?.media?.view?.settings?.defaultProps?.link||pu){case"file":case mu:u=mu;break;case"post":case gu:u=gu;break;case hu:u=hu;break;case pu:u=pu}switch(u){case mu:l=o.url;break;case gu:l=o.link}i.href=l,t({blob:void 0,...i,...r,linkDestination:u}),v()}function E(e){e!==c&&(t({blob:void 0,url:e,id:void 0,sizeSlug:D().imageDefaultSize}),v())}pt({url:f,allowedTypes:_u,onChange:F,onError:V});const O=ip(p,c)?c:void 0,$=!!c&&(0,Je.jsx)("img",{alt:(0,ot.__)("Edit image"),title:(0,ot.__)("Edit image"),className:"edit-image-preview",src:c}),G=(0,nt.__experimentalUseBorderProps)(e),U=(0,nt.__experimentalGetShadowClassesAndStyles)(e),q=ft(n,{"is-transient":!!f,"is-resized":!!m||!!g,[`size-${h}`]:h,"has-custom-border":!!G.className||G.style&&Object.keys(G.style).length>0}),W=(0,nt.useBlockProps)({ref:k,className:q}),{lockUrlControls:Z=!1,lockUrlControlsMessage:Q}=(0,it.useSelect)((e=>{if(!o)return{};const t=(0,Ke.getBlockBindingsSource)(y?.bindings?.url?.source);return{lockUrlControls:!!y?.bindings?.url&&!t?.canUserEditValue?.({select:e,context:i,args:y?.bindings?.url?.args}),lockUrlControlsMessage:t?.label?(0,ot.sprintf)((0,ot.__)("Connected to %s"),t.label):(0,ot.__)("Connected to dynamic data")}}),[i,o,y?.bindings?.url]);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)("figure",{...W,children:[(0,Je.jsx)(rp,{temporaryURL:f,attributes:e,setAttributes:t,isSingleSelected:o,insertBlocksAfter:a,onReplace:r,onSelectImage:F,onSelectURL:E,onUploadError:V,context:i,clientId:s,blockEditingMode:H,parentLayoutType:l?.type,maxContentWidth:j}),(0,Je.jsx)(nt.MediaPlaceholder,{icon:(0,Je.jsx)(nt.BlockIcon,{icon:lu}),onSelect:F,onSelectURL:E,onError:V,placeholder:e=>(0,Je.jsxs)(tt.Placeholder,{className:ft("block-editor-media-placeholder",{[G.className]:!!G.className&&!o}),icon:!T&&(Z?Zd:lu),withIllustration:!o||T,label:!T&&(0,ot.__)("Image"),instructions:!Z&&!T&&(0,ot.__)("Drag and drop an image, upload, or choose from your library."),style:{aspectRatio:m&&g||!x?void 0:x,width:g&&x?"100%":m,height:m&&x?"100%":g,objectFit:_,...G.style,...U.style},children:[Z&&!T&&Q,!Z&&!T&&e,S]}),accept:"image/*",allowedTypes:_u,handleUpload:e=>1===e.length,value:{id:p,src:O},mediaPreview:$,disableMediaButtons:f||c})]}),o&&w&&C]})};function cp(e,t){const{body:o}=document.implementation.createHTMLDocument("");o.innerHTML=e;const{firstElementChild:n}=o;if(n&&"A"===n.nodeName)return n.getAttribute(t)||void 0}const up={img:{attributes:["src","alt","title"],classes:["alignleft","aligncenter","alignright","alignnone",/^wp-image-\d+$/]}},dp={from:[{type:"raw",isMatch:e=>"FIGURE"===e.nodeName&&!!e.querySelector("img"),schema:({phrasingContentSchema:e})=>({figure:{require:["img"],children:{...up,a:{attributes:["href","rel","target"],classes:["*"],children:up},figcaption:{children:e}}}}),transform:e=>{const t=e.className+" "+e.querySelector("img").className,o=/(?:^|\s)align(left|center|right)(?:$|\s)/.exec(t),n=""===e.id?void 0:e.id,a=o?o[1]:void 0,r=/(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(t),i=r?Number(r[1]):void 0,s=e.querySelector("a"),l=s&&s.href?"custom":void 0,c=s&&s.href?s.href:void 0,u=s&&s.rel?s.rel:void 0,d=s&&s.className?s.className:void 0,p=(0,Ke.getBlockAttributes)("core/image",e.outerHTML,{align:a,id:i,linkDestination:l,href:c,rel:u,linkClass:d,anchor:n});return(0,lt.isBlobURL)(p.url)&&(p.blob=p.url,delete p.url),(0,Ke.createBlock)("core/image",p)}},{type:"files",isMatch:e=>e.every((e=>0===e.type.indexOf("image/"))),transform(e){const t=e.map((e=>(0,Ke.createBlock)("core/image",{blob:(0,lt.createBlobURL)(e)})));return t}},{type:"shortcode",tag:"caption",attributes:{url:{type:"string",source:"attribute",attribute:"src",selector:"img"},alt:{type:"string",source:"attribute",attribute:"alt",selector:"img"},caption:{shortcode:function(e,{shortcode:t}){const{body:o}=document.implementation.createHTMLDocument("");o.innerHTML=t.content;let n=o.querySelector("img");for(;n&&n.parentNode&&n.parentNode!==o;)n=n.parentNode;return n&&n.parentNode.removeChild(n),o.innerHTML.trim()}},href:{shortcode:(e,{shortcode:t})=>cp(t.content,"href")},rel:{shortcode:(e,{shortcode:t})=>cp(t.content,"rel")},linkClass:{shortcode:(e,{shortcode:t})=>cp(t.content,"class")},id:{type:"number",shortcode:({named:{id:e}})=>{if(e)return parseInt(e.replace("attachment_",""),10)}},align:{type:"string",shortcode:({named:{align:e="alignnone"}})=>e.replace("align","")}}}]},pp=dp,mp={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/image",title:"Image",category:"media",usesContext:["allowResize","imageCrop","fixedHeight","postId","postType","queryId"],description:"Insert an image to make a visual statement.",keywords:["img","photo","picture"],textdomain:"default",attributes:{blob:{type:"string",role:"local"},url:{type:"string",source:"attribute",selector:"img",attribute:"src",role:"content"},alt:{type:"string",source:"attribute",selector:"img",attribute:"alt",default:"",role:"content"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},lightbox:{type:"object",enabled:{type:"boolean"}},title:{type:"string",source:"attribute",selector:"img",attribute:"title",role:"content"},href:{type:"string",source:"attribute",selector:"figure > a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure > a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure > a",attribute:"class"},id:{type:"number",role:"content"},width:{type:"string"},height:{type:"string"},aspectRatio:{type:"string"},scale:{type:"string"},sizeSlug:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure > a",attribute:"target"}},supports:{interactivity:!0,align:["left","center","right","wide","full"],anchor:!0,color:{text:!1,background:!1},filter:{duotone:!0},spacing:{margin:!0},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}},shadow:{__experimentalSkipSerialization:!0}},selectors:{border:".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder",shadow:".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder",filter:{duotone:".wp-block-image img, .wp-block-image .components-placeholder"}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-image-editor",style:"wp-block-image"},{name:gp}=mp,hp={icon:lu,example:{attributes:{sizeSlug:"large",url:"https://s.w.org/images/core/5.3/MtBlanc1.jpg",caption:(0,ot.__)("Mont Blanc appears—still, snowy, and serene.")}},__experimentalLabel(e,{context:t}){const o=e?.metadata?.name;if("list-view"===t&&o)return o;if("accessibility"===t){const{caption:t,alt:o,url:n}=e;return n?o?o+(t?". "+t:""):t||"":(0,ot.__)("Empty")}},getEditWrapperProps:e=>({"data-align":e.align}),transforms:pp,edit:lp,save:function({attributes:e}){const{url:t,alt:o,caption:n,align:a,href:r,rel:i,linkClass:s,width:l,height:c,aspectRatio:u,scale:d,id:p,linkTarget:m,sizeSlug:g,title:h}=e,x=i||void 0,_=(0,nt.__experimentalGetBorderClassesAndStyles)(e),b=(0,nt.__experimentalGetShadowClassesAndStyles)(e),y=ft({alignnone:"none"===a,[`size-${g}`]:g,"is-resized":l||c,"has-custom-border":!!_.className||_.style&&Object.keys(_.style).length>0}),f=ft(_.className,{[`wp-image-${p}`]:!!p}),v=(0,Je.jsx)("img",{src:t,alt:o,className:f||void 0,style:{..._.style,...b.style,aspectRatio:u,objectFit:d,width:l,height:c},title:h}),k=(0,Je.jsxs)(Je.Fragment,{children:[r?(0,Je.jsx)("a",{className:s,href:r,target:m,rel:x,children:v}):v,!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{className:(0,nt.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:n})]});return(0,Je.jsx)("figure",{...nt.useBlockProps.save({className:y}),children:k})},deprecated:Wd},xp=()=>et({name:gp,metadata:mp,settings:hp}),_p=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"})});const bp={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/latest-comments",title:"Latest Comments",category:"widgets",description:"Display a list of your most recent comments.",keywords:["recent comments"],textdomain:"default",attributes:{commentsToShow:{type:"number",default:5,minimum:1,maximum:100},displayAvatar:{type:"boolean",default:!0},displayDate:{type:"boolean",default:!0},displayExcerpt:{type:"boolean",default:!0}},supports:{align:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},html:!1,spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-latest-comments-editor",style:"wp-block-latest-comments"},{name:yp}=bp,fp={icon:_p,example:{},edit:function({attributes:e,setAttributes:t}){const{commentsToShow:o,displayAvatar:n,displayDate:a,displayExcerpt:r}=e,i={...e,style:{...e?.style,spacing:void 0}},s=mt();return(0,Je.jsxs)("div",{...(0,nt.useBlockProps)(),children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{t({commentsToShow:5,displayAvatar:!0,displayDate:!0,displayExcerpt:!0})},dropdownMenuProps:s,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!n,label:(0,ot.__)("Display avatar"),onDeselect:()=>t({displayAvatar:!0}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display avatar"),checked:n,onChange:()=>t({displayAvatar:!n})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!a,label:(0,ot.__)("Display date"),onDeselect:()=>t({displayDate:!0}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display date"),checked:a,onChange:()=>t({displayDate:!a})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!r,label:(0,ot.__)("Display excerpt"),onDeselect:()=>t({displayExcerpt:!0}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display excerpt"),checked:r,onChange:()=>t({displayExcerpt:!r})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>5!==o,label:(0,ot.__)("Number of comments"),onDeselect:()=>t({commentsToShow:5}),isShownByDefault:!0,children:(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Number of comments"),value:o,onChange:e=>t({commentsToShow:e}),min:1,max:100,required:!0})})]})}),(0,Je.jsx)(tt.Disabled,{children:(0,Je.jsx)(rt(),{block:"core/latest-comments",attributes:i,urlQueryArgs:{_locale:"site"}})})]})}},vp=()=>et({name:yp,metadata:bp,settings:fp}),kp=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z"})}),{attributes:wp}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"},Cp=[{attributes:{...wp,categories:{type:"string"}},supports:{align:!0,html:!1},migrate:e=>({...e,categories:[{id:Number(e.categories)}]}),isEligible:({categories:e})=>e&&"string"==typeof e,save:()=>null}],jp=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z"})}),Sp=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z"})}),Bp=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z"})}),Tp=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z"})}),Np=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z"})}),Pp={per_page:-1,context:"view"},Ip={per_page:-1,has_published_posts:["post"],context:"view"};const Mp={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/latest-posts",title:"Latest Posts",category:"widgets",description:"Display a list of your most recent posts.",keywords:["recent posts"],textdomain:"default",attributes:{categories:{type:"array",items:{type:"object"}},selectedAuthor:{type:"number"},postsToShow:{type:"number",default:5},displayPostContent:{type:"boolean",default:!1},displayPostContentRadio:{type:"string",default:"excerpt"},excerptLength:{type:"number",default:55},displayAuthor:{type:"boolean",default:!1},displayPostDate:{type:"boolean",default:!1},postLayout:{type:"string",default:"list"},columns:{type:"number",default:3},order:{type:"string",default:"desc"},orderBy:{type:"string",default:"date"},displayFeaturedImage:{type:"boolean",default:!1},featuredImageAlign:{type:"string",enum:["left","center","right"]},featuredImageSizeSlug:{type:"string",default:"thumbnail"},featuredImageSizeWidth:{type:"number",default:null},featuredImageSizeHeight:{type:"number",default:null},addLinkToFeaturedImage:{type:"boolean",default:!1}},supports:{align:!0,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-latest-posts-editor",style:"wp-block-latest-posts"},{name:Dp}=Mp,zp={icon:kp,example:{},edit:function e({attributes:t,setAttributes:o}){var n;const a=(0,ut.useInstanceId)(e),r=mt(),{postsToShow:i,order:s,orderBy:l,categories:c,selectedAuthor:u,displayFeaturedImage:d,displayPostContentRadio:p,displayPostContent:m,displayPostDate:g,displayAuthor:h,postLayout:x,columns:_,excerptLength:b,featuredImageAlign:y,featuredImageSizeSlug:f,featuredImageSizeWidth:v,featuredImageSizeHeight:k,addLinkToFeaturedImage:w}=t,{imageSizes:C,latestPosts:j,defaultImageWidth:S,defaultImageHeight:B,categoriesList:T,authorList:N}=(0,it.useSelect)((e=>{var t,o;const{getEntityRecords:n,getUsers:a}=e(ct.store),r=e(nt.store).getSettings(),d=c&&c.length>0?c.map((e=>e.id)):[],p=Object.fromEntries(Object.entries({categories:d,author:u,order:s,orderby:l,per_page:i,_embed:"wp:featuredmedia",ignore_sticky:!0}).filter((([,e])=>void 0!==e)));return{defaultImageWidth:null!==(t=r.imageDimensions?.[f]?.width)&&void 0!==t?t:0,defaultImageHeight:null!==(o=r.imageDimensions?.[f]?.height)&&void 0!==o?o:0,imageSizes:r.imageSizes,latestPosts:n("postType","post",p),categoriesList:n("taxonomy","category",Pp),authorList:a(Ip)}}),[f,i,s,l,c,u]),{createWarningNotice:P}=(0,it.useDispatch)(Rt.store),I=e=>{e.preventDefault(),P((0,ot.__)("Links are disabled in the editor."),{id:`block-library/core/latest-posts/redirection-prevented/${a}`,type:"snackbar"})},M=C.filter((({slug:e})=>"full"!==e)).map((({name:e,slug:t})=>({value:t,label:e}))),D=null!==(n=T?.reduce(((e,t)=>({...e,[t.name]:t})),{}))&&void 0!==n?n:{},z=[{value:"none",icon:jp,label:(0,ot.__)("None")},{value:"left",icon:Sp,label:(0,ot.__)("Left")},{value:"center",icon:Bp,label:(0,ot.__)("Center")},{value:"right",icon:Tp,label:(0,ot.__)("Right")}],A=!!j?.length,R=(0,Je.jsxs)(nt.InspectorControls,{children:[(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Post content"),resetAll:()=>o({displayPostContent:!1,displayPostContentRadio:"excerpt",excerptLength:55}),dropdownMenuProps:r,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!m,label:(0,ot.__)("Post content"),onDeselect:()=>o({displayPostContent:!1}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Post content"),checked:m,onChange:e=>o({displayPostContent:e})})}),m&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>"excerpt"!==p,label:(0,ot.__)("Show"),onDeselect:()=>o({displayPostContentRadio:"excerpt"}),isShownByDefault:!0,children:(0,Je.jsx)(tt.RadioControl,{label:(0,ot.__)("Show"),selected:p,options:[{label:(0,ot.__)("Excerpt"),value:"excerpt"},{label:(0,ot.__)("Full post"),value:"full_post"}],onChange:e=>o({displayPostContentRadio:e})})}),m&&"excerpt"===p&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>55!==b,label:(0,ot.__)("Max number of words"),onDeselect:()=>o({excerptLength:55}),isShownByDefault:!0,children:(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Max number of words"),value:b,onChange:e=>o({excerptLength:e}),min:10,max:100})})]}),(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Post meta"),resetAll:()=>o({displayAuthor:!1,displayPostDate:!1}),dropdownMenuProps:r,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!h,label:(0,ot.__)("Display author name"),onDeselect:()=>o({displayAuthor:!1}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display author name"),checked:h,onChange:e=>o({displayAuthor:e})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!g,label:(0,ot.__)("Display post date"),onDeselect:()=>o({displayPostDate:!1}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display post date"),checked:g,onChange:e=>o({displayPostDate:e})})})]}),(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Featured image"),children:[(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display featured image"),checked:d,onChange:e=>o({displayFeaturedImage:e})}),d&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.__experimentalImageSizeControl,{onChange:e=>{const t={};e.hasOwnProperty("width")&&(t.featuredImageSizeWidth=e.width),e.hasOwnProperty("height")&&(t.featuredImageSizeHeight=e.height),o(t)},slug:f,width:v,height:k,imageWidth:S,imageHeight:B,imageSizeOptions:M,imageSizeHelp:(0,ot.__)("Select the size of the source image."),onChangeImage:e=>o({featuredImageSizeSlug:e,featuredImageSizeWidth:void 0,featuredImageSizeHeight:void 0})}),(0,Je.jsx)(tt.__experimentalToggleGroupControl,{className:"editor-latest-posts-image-alignment-control",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Image alignment"),value:y||"none",onChange:e=>o({featuredImageAlign:"none"!==e?e:void 0}),children:z.map((({value:e,icon:t,label:o})=>(0,Je.jsx)(tt.__experimentalToggleGroupControlOptionIcon,{value:e,icon:t,label:o},e)))}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Add link to featured image"),checked:w,onChange:e=>o({addLinkToFeaturedImage:e})})]})]}),(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Sorting and filtering"),children:[(0,Je.jsx)(tt.QueryControls,{order:s,orderBy:l,numberOfItems:i,onOrderChange:e=>o({order:e}),onOrderByChange:e=>o({orderBy:e}),onNumberOfItemsChange:e=>o({postsToShow:e}),categorySuggestions:D,onCategoryChange:e=>{if(e.some((e=>"string"==typeof e&&!D[e])))return;const t=e.map((e=>"string"==typeof e?D[e]:e));if(t.includes(null))return!1;o({categories:t})},selectedCategories:c,onAuthorChange:e=>o({selectedAuthor:""!==e?Number(e):void 0}),authorList:null!=N?N:[],selectedAuthorId:u}),"grid"===x&&(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Columns"),value:_,onChange:e=>o({columns:e}),min:2,max:A?Math.min(6,j.length):6,required:!0})]})]}),H=(0,nt.useBlockProps)({className:ft({"wp-block-latest-posts__list":!0,"is-grid":"grid"===x,"has-dates":g,"has-author":h,[`columns-${_}`]:"grid"===x})});if(!A)return(0,Je.jsxs)("div",{...H,children:[R,(0,Je.jsx)(tt.Placeholder,{icon:on,label:(0,ot.__)("Latest Posts"),children:Array.isArray(j)?(0,ot.__)("No posts found."):(0,Je.jsx)(tt.Spinner,{})})]});const L=j.length>i?j.slice(0,i):j,V=[{icon:Np,title:(0,ot._x)("List view","Latest posts block display setting"),onClick:()=>o({postLayout:"list"}),isActive:"list"===x},{icon:Zu,title:(0,ot._x)("Grid view","Latest posts block display setting"),onClick:()=>o({postLayout:"grid"}),isActive:"grid"===x}],F=(0,Aa.getSettings)().formats.date;return(0,Je.jsxs)(Je.Fragment,{children:[R,(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(tt.ToolbarGroup,{controls:V})}),(0,Je.jsx)("ul",{...H,children:L.map((e=>{const t=e.title.rendered.trim();let o=e.excerpt.rendered;const n=N?.find((t=>t.id===e.author)),a=document.createElement("div");a.innerHTML=o,o=a.textContent||a.innerText||"";const{url:r,alt:i}=function(e,t){var o;const n=e._embedded?.["wp:featuredmedia"]?.[0];return{url:null!==(o=n?.media_details?.sizes?.[t]?.source_url)&&void 0!==o?o:n?.source_url,alt:n?.alt_text}}(e,f),s=ft({"wp-block-latest-posts__featured-image":!0,[`align${y}`]:!!y}),l=d&&r,c=l&&(0,Je.jsx)("img",{src:r,alt:i,style:{maxWidth:v,maxHeight:k}}),u=b<o.trim().split(" ").length&&""===e.excerpt.raw?(0,Je.jsxs)(Je.Fragment,{children:[o.trim().split(" ",b).join(" "),(0,st.createInterpolateElement)((0,ot.sprintf)((0,ot.__)("… <a>Read more<span>: %1$s</span></a>"),t||(0,ot.__)("(no title)")),{a:(0,Je.jsx)("a",{className:"wp-block-latest-posts__read-more",href:e.link,rel:"noopener noreferrer",onClick:I}),span:(0,Je.jsx)("span",{className:"screen-reader-text"})})]}):o;return(0,Je.jsxs)("li",{children:[l&&(0,Je.jsx)("div",{className:s,children:w?(0,Je.jsx)("a",{href:e.link,rel:"noreferrer noopener",onClick:I,children:c}):c}),(0,Je.jsx)("a",{className:"wp-block-latest-posts__post-title",href:e.link,rel:"noreferrer noopener",dangerouslySetInnerHTML:t?{__html:t}:void 0,onClick:I,children:t?null:(0,ot.__)("(no title)")}),h&&n&&(0,Je.jsx)("div",{className:"wp-block-latest-posts__post-author",children:(0,ot.sprintf)((0,ot.__)("by %s"),n.name)}),g&&e.date_gmt&&(0,Je.jsx)("time",{dateTime:(0,Aa.format)("c",e.date_gmt),className:"wp-block-latest-posts__post-date",children:(0,Aa.dateI18n)(F,e.date_gmt)}),m&&"excerpt"===p&&(0,Je.jsx)("div",{className:"wp-block-latest-posts__post-excerpt",children:u}),m&&"full_post"===p&&(0,Je.jsx)("div",{className:"wp-block-latest-posts__post-full-content",dangerouslySetInnerHTML:{__html:e.content.raw.trim()}})]},e.id)}))})]})},deprecated:Cp},Ap=()=>et({name:Dp,metadata:Mp,settings:zp}),Rp={A:"upper-alpha",a:"lower-alpha",I:"upper-roman",i:"lower-roman"};function Hp(e){const{values:t,start:o,reversed:n,ordered:a,type:r,...i}=e,s=document.createElement(a?"ol":"ul");s.innerHTML=t,o&&s.setAttribute("start",o),n&&s.setAttribute("reversed",!0),r&&s.setAttribute("type",r);const[l]=(0,Ke.rawHandler)({HTML:s.outerHTML});return[{...i,...l.attributes},l.innerBlocks]}const Lp={attributes:{ordered:{type:"boolean",default:!1,role:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",role:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0},color:{gradients:!0,link:!0},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},save({attributes:e}){const{ordered:t,values:o,type:n,reversed:a,start:r}=e,i=t?"ol":"ul";return(0,Je.jsx)(i,{...nt.useBlockProps.save({type:n,reversed:a,start:r}),children:(0,Je.jsx)(nt.RichText.Content,{value:o,multiline:"li"})})},migrate:lo,isEligible:({style:e})=>e?.typography?.fontFamily},Vp={attributes:{ordered:{type:"boolean",default:!1,role:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",role:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},save({attributes:e}){const{ordered:t,values:o,type:n,reversed:a,start:r}=e,i=t?"ol":"ul";return(0,Je.jsx)(i,{...nt.useBlockProps.save({type:n,reversed:a,start:r}),children:(0,Je.jsx)(nt.RichText.Content,{value:o,multiline:"li"})})},migrate:Hp},Fp={attributes:{ordered:{type:"boolean",default:!1,role:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",role:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalSlashInserter:!0},isEligible:({type:e})=>!!e,save({attributes:e}){const{ordered:t,type:o,reversed:n,start:a}=e,r=t?"ol":"ul";return(0,Je.jsx)(r,{...nt.useBlockProps.save({type:o,reversed:n,start:a}),children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})},migrate:function(e){const{type:t}=e;return t&&Rp[t]?{...e,type:Rp[t]}:e}},Ep={attributes:{ordered:{type:"boolean",default:!1,role:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",role:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,className:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__unstablePasteTextInline:!0,__experimentalSelector:"ol,ul",__experimentalOnMerge:"true",__experimentalSlashInserter:!0},save({attributes:e}){const{ordered:t,type:o,reversed:n,start:a}=e,r=t?"ol":"ul";return(0,Je.jsx)(r,{...nt.useBlockProps.save({reversed:n,start:a,style:{listStyleType:t&&"decimal"!==o?o:void 0}}),children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})}},Op=[Ep,Fp,Vp,Lp],$p=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z"})}),Gp=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z"})}),Up=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})}),qp=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),Wp=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z"})}),Zp=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z"})}),Qp=window.wp.deprecated;var Kp=o.n(Qp);const Yp=({setAttributes:e,reversed:t,start:o,type:n})=>(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("List style"),options:[{label:(0,ot.__)("Numbers"),value:"decimal"},{label:(0,ot.__)("Uppercase letters"),value:"upper-alpha"},{label:(0,ot.__)("Lowercase letters"),value:"lower-alpha"},{label:(0,ot.__)("Uppercase Roman numerals"),value:"upper-roman"},{label:(0,ot.__)("Lowercase Roman numerals"),value:"lower-roman"}],value:n,onChange:t=>e({type:t})}),(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Start value"),type:"number",onChange:t=>{const o=parseInt(t,10);e({start:isNaN(o)?void 0:o})},value:Number.isInteger(o)?o.toString(10):"",step:"1"}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Reverse order"),checked:t||!1,onChange:t=>{e({reversed:t||void 0})}})]})});const Jp=(0,st.forwardRef)((function(e,t){const{ordered:o,...n}=e,a=o?"ol":"ul";return(0,Je.jsx)(a,{ref:t,...n})})),Xp={name:"core/list-item"},em=[["core/list-item"]];function tm({clientId:e}){const t=function(e){const{replaceBlocks:t,selectionChange:o}=(0,it.useDispatch)(nt.store),{getBlockRootClientId:n,getBlockAttributes:a,getBlock:r}=(0,it.useSelect)(nt.store);return(0,st.useCallback)((()=>{const i=n(e),s=a(i),l=(0,Ke.createBlock)("core/list-item",s),{innerBlocks:c}=r(e);t([i],[l,...c]),o(c[c.length-1].clientId)}),[e])}(e),o=(0,it.useSelect)((t=>{const{getBlockRootClientId:o,getBlockName:n}=t(nt.store);return"core/list-item"===n(o(e))}),[e]);return(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsx)(tt.ToolbarButton,{icon:(0,ot.isRTL)()?$p:Gp,title:(0,ot.__)("Outdent"),description:(0,ot.__)("Outdent list item"),disabled:!o,onClick:t})})}function om({phrasingContentSchema:e}){const t={...e,ul:{},ol:{attributes:["type","start","reversed"]}};return["ul","ol"].forEach((e=>{t[e].children={li:{children:t}}})),t}function nm(e){return e.flatMap((({name:e,attributes:t,innerBlocks:o=[]})=>"core/list-item"===e?[t.content,...nm(o)]:nm(o)))}const am={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph","core/heading"],transform:e=>{let t=[];if(e.length>1)t=e.map((({content:e})=>(0,Ke.createBlock)("core/list-item",{content:e})));else if(1===e.length){const o=(0,Ho.create)({html:e[0].content});t=(0,Ho.split)(o,"\n").map((e=>(0,Ke.createBlock)("core/list-item",{content:(0,Ho.toHTMLString)({value:e})})))}return(0,Ke.createBlock)("core/list",{anchor:e.anchor},t)}},{type:"raw",selector:"ol,ul",schema:e=>({ol:om(e).ol,ul:om(e).ul}),transform:function e(t){const o=t.getAttribute("type"),n={ordered:"OL"===t.tagName,anchor:""===t.id?void 0:t.id,start:t.getAttribute("start")?parseInt(t.getAttribute("start"),10):void 0,reversed:!!t.hasAttribute("reversed")||void 0,type:o&&Rp[o]?Rp[o]:void 0},a=Array.from(t.children).map((t=>{const o=Array.from(t.childNodes).filter((e=>e.nodeType!==e.TEXT_NODE||0!==e.textContent.trim().length));o.reverse();const[n,...a]=o;if(!("UL"===n?.tagName||"OL"===n?.tagName))return(0,Ke.createBlock)("core/list-item",{content:t.innerHTML});const r=a.map((e=>e.nodeType===e.TEXT_NODE?e.textContent:e.outerHTML));r.reverse();const i={content:r.join("").trim()},s=[e(n)];return(0,Ke.createBlock)("core/list-item",i,s)}));return(0,Ke.createBlock)("core/list",n,a)}},...["*","-"].map((e=>({type:"prefix",prefix:e,transform:e=>(0,Ke.createBlock)("core/list",{},[(0,Ke.createBlock)("core/list-item",{content:e})])}))),...["1.","1)"].map((e=>({type:"prefix",prefix:e,transform:e=>(0,Ke.createBlock)("core/list",{ordered:!0},[(0,Ke.createBlock)("core/list-item",{content:e})])})))],to:[...["core/paragraph","core/heading"].map((e=>({type:"block",blocks:[e],transform:(t,o)=>nm(o).map((t=>(0,Ke.createBlock)(e,{content:t})))})))]},rm=am,im={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/list",title:"List",category:"text",allowedBlocks:["core/list-item"],description:"An organized collection of items displayed in a specific order.",keywords:["bullet list","ordered list","numbered list"],textdomain:"default",attributes:{ordered:{type:"boolean",default:!1,role:"content"},values:{type:"string",source:"html",selector:"ol,ul",multiline:"li",__unstableMultilineWrapperTags:["ol","ul"],default:"",role:"content"},type:{type:"string"},start:{type:"number"},reversed:{type:"boolean"},placeholder:{type:"string"}},supports:{anchor:!0,html:!1,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__unstablePasteTextInline:!0,__experimentalOnMerge:!0,__experimentalSlashInserter:!0,interactivity:{clientNavigation:!0}},selectors:{border:".wp-block-list:not(.wp-block-list .wp-block-list)"},editorStyle:"wp-block-list-editor",style:"wp-block-list"},{name:sm}=im,lm={icon:Np,example:{innerBlocks:[{name:"core/list-item",attributes:{content:(0,ot.__)("Alice.")}},{name:"core/list-item",attributes:{content:(0,ot.__)("The White Rabbit.")}},{name:"core/list-item",attributes:{content:(0,ot.__)("The Cheshire Cat.")}},{name:"core/list-item",attributes:{content:(0,ot.__)("The Mad Hatter.")}},{name:"core/list-item",attributes:{content:(0,ot.__)("The Queen of Hearts.")}}]},transforms:rm,edit:function({attributes:e,setAttributes:t,clientId:o,style:n}){const{ordered:a,type:r,reversed:i,start:s}=e,l=(0,nt.useBlockProps)({style:{...st.Platform.isNative&&n,listStyleType:a&&"decimal"!==r?r:void 0}}),c=(0,nt.useInnerBlocksProps)(l,{defaultBlock:Xp,directInsert:!0,template:em,templateLock:!1,templateInsertUpdatesSelection:!0,...st.Platform.isNative&&{marginVertical:8,marginHorizontal:8,renderAppender:!1},__experimentalCaptureToolbars:!0});!function(e,t){const o=(0,it.useRegistry)(),{updateBlockAttributes:n,replaceInnerBlocks:a}=(0,it.useDispatch)(nt.store);(0,st.useEffect)((()=>{if(!e.values)return;const[r,i]=Hp(e);Kp()("Value attribute on the list block",{since:"6.0",version:"6.5",alternative:"inner blocks"}),o.batch((()=>{n(t,r),a(t,i)}))}),[e.values])}(e,o);const u=(0,Je.jsxs)(nt.BlockControls,{group:"block",children:[(0,Je.jsx)(tt.ToolbarButton,{icon:(0,ot.isRTL)()?Up:qp,title:(0,ot.__)("Unordered"),description:(0,ot.__)("Convert to unordered list"),isActive:!1===a,onClick:()=>{t({ordered:!1})}}),(0,Je.jsx)(tt.ToolbarButton,{icon:(0,ot.isRTL)()?Wp:Zp,title:(0,ot.__)("Ordered"),description:(0,ot.__)("Convert to ordered list"),isActive:!0===a,onClick:()=>{t({ordered:!0})}}),(0,Je.jsx)(tm,{clientId:o})]});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Jp,{ordered:a,reversed:i,start:s,...c}),u,a&&(0,Je.jsx)(Yp,{setAttributes:t,reversed:i,start:s,type:r})]})},save:function({attributes:e}){const{ordered:t,type:o,reversed:n,start:a}=e,r=t?"ol":"ul";return(0,Je.jsx)(r,{...nt.useBlockProps.save({reversed:n,start:a,style:{listStyleType:t&&"decimal"!==o?o:void 0}}),children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})},deprecated:Op},cm=()=>et({name:sm,metadata:im,settings:lm}),um=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M12 11v1.5h8V11h-8zm-6-1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),dm=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z"})}),pm=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z"})});function mm(e){const{replaceBlocks:t,selectionChange:o,multiSelect:n}=(0,it.useDispatch)(nt.store),{getBlock:a,getPreviousBlockClientId:r,getSelectionStart:i,getSelectionEnd:s,hasMultiSelection:l,getMultiSelectedBlockClientIds:c}=(0,it.useSelect)(nt.store);return(0,st.useCallback)((()=>{const u=l(),d=u?c():[e],p=d.map((e=>(0,Ke.cloneBlock)(a(e)))),m=r(e),g=(0,Ke.cloneBlock)(a(m));g.innerBlocks?.length||(g.innerBlocks=[(0,Ke.createBlock)("core/list")]),g.innerBlocks[g.innerBlocks.length-1].innerBlocks.push(...p);const h=i(),x=s();return t([m,...d],[g]),u?n(p[0].clientId,p[p.length-1].clientId):o(p[0].clientId,x.attributeKey,x.clientId===h.clientId?h.offset:x.offset,x.offset),!0}),[e])}function gm(){const e=(0,it.useRegistry)(),{moveBlocksToPosition:t,removeBlock:o,insertBlock:n,updateBlockListSettings:a}=(0,it.useDispatch)(nt.store),{getBlockRootClientId:r,getBlockName:i,getBlockOrder:s,getBlockIndex:l,getSelectedBlockClientIds:c,getBlock:u,getBlockListSettings:d}=(0,it.useSelect)(nt.store);return(0,st.useCallback)(((p=c())=>{if(Array.isArray(p)||(p=[p]),!p.length)return;const m=p[0];if("core/list-item"!==i(m))return;const g=function(e){const t=r(e),o=r(t);if(o&&"core/list-item"===i(o))return o}(m);if(!g)return;const h=r(m),x=p[p.length-1],_=s(h).slice(l(x)+1);return e.batch((()=>{if(_.length){let e=s(m)[0];if(!e){const t=(0,Ke.cloneBlock)(u(h),{},[]);e=t.clientId,n(t,0,m,!1),a(e,d(h))}t(_,h,e)}if(t(p,h,r(g),l(g)+1),!s(h).length){o(h,!1)}})),!0}),[])}function hm(e,t){const o=(0,it.useRegistry)(),{getPreviousBlockClientId:n,getNextBlockClientId:a,getBlockOrder:r,getBlockRootClientId:i,getBlockName:s}=(0,it.useSelect)(nt.store),{mergeBlocks:l,moveBlocksToPosition:c}=(0,it.useDispatch)(nt.store),u=gm();function d(e){const t=r(e);return t.length?d(t[t.length-1]):e}function p(e){const t=i(e),o=i(t);if(o&&"core/list-item"===s(o))return o}function m(e){const t=a(e);if(t)return t;const o=p(e);return o?m(o):void 0}function g(e){const t=r(e);return t.length?r(t[0])[0]:m(e)}return a=>{function s(e,t){o.batch((()=>{const[o]=r(t);o&&(n(t)!==e||r(e).length?c(r(o),o,i(e)):c([o],t,e)),l(e,t)}))}if(a){const o=g(e);if(!o)return void t(a);p(o)?u(o):s(e,o)}else{const o=n(e);if(p(e))u(e);else if(o){s(d(o),e)}else t(a)}}}function xm({clientId:e}){const t=mm(e),o=gm(),{canIndent:n,canOutdent:a}=(0,it.useSelect)((t=>{const{getBlockIndex:o,getBlockRootClientId:n,getBlockName:a}=t(nt.store);return{canIndent:o(e)>0,canOutdent:"core/list-item"===a(n(n(e)))}}),[e]);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.ToolbarButton,{icon:(0,ot.isRTL)()?$p:Gp,title:(0,ot.__)("Outdent"),description:(0,ot.__)("Outdent list item"),disabled:!a,onClick:()=>o()}),(0,Je.jsx)(tt.ToolbarButton,{icon:(0,ot.isRTL)()?dm:pm,title:(0,ot.__)("Indent"),description:(0,ot.__)("Indent list item"),disabled:!n,onClick:()=>t()})]})}const _m={to:[{type:"block",blocks:["core/paragraph"],transform:(e,t=[])=>[(0,Ke.createBlock)("core/paragraph",e),...t.map((e=>(0,Ke.cloneBlock)(e)))]}]},bm=_m,ym={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/list-item",title:"List Item",category:"text",parent:["core/list"],allowedBlocks:["core/list"],description:"An individual item within a list.",textdomain:"default",attributes:{placeholder:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"li",role:"content"}},supports:{anchor:!0,className:!1,splitting:!0,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},color:{gradients:!0,link:!0,background:!0,__experimentalDefaultControls:{text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},selectors:{root:".wp-block-list > li",border:".wp-block-list:not(.wp-block-list .wp-block-list) > li"}},{name:fm}=ym,vm={icon:um,edit:function({attributes:e,setAttributes:t,clientId:o,mergeBlocks:n}){const{placeholder:a,content:r}=e,i=(0,nt.useBlockProps)(),s=(0,nt.useInnerBlocksProps)(i,{renderAppender:!1,__unstableDisableDropZone:!0}),l=function(e){const{replaceBlocks:t,selectionChange:o}=(0,it.useDispatch)(nt.store),{getBlock:n,getBlockRootClientId:a,getBlockIndex:r,getBlockName:i}=(0,it.useSelect)(nt.store),s=(0,st.useRef)(e);s.current=e;const l=gm();return(0,ut.useRefEffect)((e=>{function c(e){if(e.defaultPrevented||e.keyCode!==wo.ENTER)return;const{content:c,clientId:u}=s.current;if(c.length)return;if(e.preventDefault(),"core/list-item"===i(a(a(s.current.clientId))))return void l();const d=n(a(u)),p=r(u),m=(0,Ke.cloneBlock)({...d,innerBlocks:d.innerBlocks.slice(0,p)}),g=(0,Ke.createBlock)((0,Ke.getDefaultBlockName)()),h=[...d.innerBlocks[p].innerBlocks[0]?.innerBlocks||[],...d.innerBlocks.slice(p+1)],x=h.length?[(0,Ke.cloneBlock)({...d,innerBlocks:h})]:[];t(d.clientId,[m,g,...x],1),o(g.clientId)}return e.addEventListener("keydown",c),()=>{e.removeEventListener("keydown",c)}}),[])}({content:r,clientId:o}),c=function(e){const{getSelectionStart:t,getSelectionEnd:o,getBlockIndex:n}=(0,it.useSelect)(nt.store),a=mm(e),r=gm();return(0,ut.useRefEffect)((i=>{function s(i){const{keyCode:s,shiftKey:l,altKey:c,metaKey:u,ctrlKey:d}=i;if(i.defaultPrevented||s!==wo.SPACE&&s!==wo.TAB||c||u||d)return;const p=t(),m=o();0===p.offset&&0===m.offset&&(l?s===wo.TAB&&r()&&i.preventDefault():0!==n(e)&&a()&&i.preventDefault())}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[e,a])}(o),u=hm(o,n);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)("li",{...s,children:[(0,Je.jsx)(nt.RichText,{ref:(0,ut.useMergeRefs)([l,c]),identifier:"content",tagName:"div",onChange:e=>t({content:e}),value:r,"aria-label":(0,ot.__)("List text"),placeholder:a||(0,ot.__)("List"),onMerge:u}),s.children]}),(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(xm,{clientId:o})})]})},save:function({attributes:e}){return(0,Je.jsxs)("li",{...nt.useBlockProps.save(),children:[(0,Je.jsx)(nt.RichText.Content,{value:e.content}),(0,Je.jsx)(nt.InnerBlocks.Content,{})]})},merge:(e,t)=>({...e,content:e.content+t.content}),transforms:bm,[Ot(nt.privateApis).requiresWrapperOnCopy]:!0},km=()=>et({name:fm,metadata:ym,settings:vm}),wm=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z"})});const Cm={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/loginout",title:"Login/out",category:"theme",description:"Show login & logout links.",keywords:["login","logout","form"],textdomain:"default",attributes:{displayLoginAsForm:{type:"boolean",default:!1},redirectToCurrent:{type:"boolean",default:!0}},example:{viewportWidth:350},supports:{className:!0,color:{background:!0,text:!1,gradients:!0,link:!0},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},interactivity:{clientNavigation:!0}},style:"wp-block-loginout"},{name:jm}=Cm,Sm={icon:wm,edit:function({attributes:e,setAttributes:t}){const{displayLoginAsForm:o,redirectToCurrent:n}=e,a=mt();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{t({displayLoginAsForm:!1,redirectToCurrent:!0})},dropdownMenuProps:a,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Display login as form"),isShownByDefault:!0,hasValue:()=>o,onDeselect:()=>t({displayLoginAsForm:!1}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display login as form"),checked:o,onChange:()=>t({displayLoginAsForm:!o})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Redirect to current URL"),isShownByDefault:!0,hasValue:()=>!n,onDeselect:()=>t({redirectToCurrent:!0}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Redirect to current URL"),checked:n,onChange:()=>t({redirectToCurrent:!n})})})]})}),(0,Je.jsx)("div",{...(0,nt.useBlockProps)({className:"logged-in"}),children:(0,Je.jsx)("a",{href:"#login-pseudo-link",children:(0,ot.__)("Log out")})})]})}},Bm=()=>et({name:jm,metadata:Cm,settings:Sm}),Tm=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M3 6v11.5h8V6H3Zm11 3h7V7.5h-7V9Zm7 3.5h-7V11h7v1.5ZM14 16h7v-1.5h-7V16Z"})}),Nm="full",Pm=[["core/paragraph",{placeholder:(0,ot._x)("Content…","content placeholder")}]],Im=(e,t)=>e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${100*t.x}% ${100*t.y}%`:"50% 50%"}:{},Mm=(e,t)=>e?{backgroundImage:`url(${e})`,backgroundPosition:t?`${Math.round(100*t.x)}% ${Math.round(100*t.y)}%`:"50% 50%"}:{},Dm=50,zm=()=>{},Am=e=>{if(!e.customBackgroundColor)return e;const t={color:{background:e.customBackgroundColor}},{customBackgroundColor:o,...n}=e;return{...n,style:t}},Rm=e=>e.align?e:{...e,align:"wide"},Hm={align:{type:"string",default:"wide"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:""},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number"},mediaType:{type:"string"},mediaWidth:{type:"number",default:50},isStackedOnMobile:{type:"boolean",default:!1}},Lm={...Hm,isStackedOnMobile:{type:"boolean",default:!0},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},mediaSizeSlug:{type:"string"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},Vm={...Lm,mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:"",role:"content"},mediaId:{type:"number",role:"content"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src",role:"content"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href",role:"content"},mediaType:{type:"string",role:"content"}},Fm={...Vm,align:{type:"string",default:"none"},useFeaturedImage:{type:"boolean",default:!1}},Em={anchor:!0,align:["wide","full"],html:!1,color:{gradients:!0,link:!0}},Om={...Em,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}}},$m={attributes:Fm,supports:{...Om,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},interactivity:{clientNavigation:!0}},usesContext:["postId","postType"],save({attributes:e}){const{isStackedOnMobile:t,mediaAlt:o,mediaPosition:n,mediaType:a,mediaUrl:r,mediaWidth:i,mediaId:s,verticalAlignment:l,imageFill:c,focalPoint:u,linkClass:d,href:p,linkTarget:m,rel:g}=e,h=e.mediaSizeSlug||Nm,x=g||void 0,_=ft({[`wp-image-${s}`]:s&&"image"===a,[`size-${h}`]:s&&"image"===a});let b=r?(0,Je.jsx)("img",{src:r,alt:o,className:_||null}):null;p&&(b=(0,Je.jsx)("a",{className:d,href:p,target:m,rel:x,children:b}));const y={image:()=>b,video:()=>(0,Je.jsx)("video",{controls:!0,src:r})},f=ft({"has-media-on-the-right":"right"===n,"is-stacked-on-mobile":t,[`is-vertically-aligned-${l}`]:l,"is-image-fill":c}),v=c?Mm(r,u):{};let k;i!==Dm&&(k="right"===n?`auto ${i}%`:`${i}% auto`);const w={gridTemplateColumns:k};return"right"===n?(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:f,style:w}),children:[(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:v,children:(y[a]||zm)()})]}):(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:f,style:w}),children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:v,children:(y[a]||zm)()}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})}},Gm={attributes:Vm,supports:Om,save({attributes:e}){const{isStackedOnMobile:t,mediaAlt:o,mediaPosition:n,mediaType:a,mediaUrl:r,mediaWidth:i,mediaId:s,verticalAlignment:l,imageFill:c,focalPoint:u,linkClass:d,href:p,linkTarget:m,rel:g}=e,h=e.mediaSizeSlug||Nm,x=g||void 0,_=ft({[`wp-image-${s}`]:s&&"image"===a,[`size-${h}`]:s&&"image"===a});let b=(0,Je.jsx)("img",{src:r,alt:o,className:_||null});p&&(b=(0,Je.jsx)("a",{className:d,href:p,target:m,rel:x,children:b}));const y={image:()=>b,video:()=>(0,Je.jsx)("video",{controls:!0,src:r})},f=ft({"has-media-on-the-right":"right"===n,"is-stacked-on-mobile":t,[`is-vertically-aligned-${l}`]:l,"is-image-fill":c}),v=c?Mm(r,u):{};let k;i!==Dm&&(k="right"===n?`auto ${i}%`:`${i}% auto`);const w={gridTemplateColumns:k};return"right"===n?(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:f,style:w}),children:[(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:v,children:(y[a]||zm)()})]}):(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:f,style:w}),children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:v,children:(y[a]||zm)()}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})},migrate:Rm,isEligible(e,t,{block:o}){const{attributes:n}=o;return void 0===e.align&&!!n.className?.includes("alignwide")}},Um={attributes:Lm,supports:Em,save({attributes:e}){const{isStackedOnMobile:t,mediaAlt:o,mediaPosition:n,mediaType:a,mediaUrl:r,mediaWidth:i,mediaId:s,verticalAlignment:l,imageFill:c,focalPoint:u,linkClass:d,href:p,linkTarget:m,rel:g}=e,h=e.mediaSizeSlug||Nm,x=g||void 0,_=ft({[`wp-image-${s}`]:s&&"image"===a,[`size-${h}`]:s&&"image"===a});let b=(0,Je.jsx)("img",{src:r,alt:o,className:_||null});p&&(b=(0,Je.jsx)("a",{className:d,href:p,target:m,rel:x,children:b}));const y={image:()=>b,video:()=>(0,Je.jsx)("video",{controls:!0,src:r})},f=ft({"has-media-on-the-right":"right"===n,"is-stacked-on-mobile":t,[`is-vertically-aligned-${l}`]:l,"is-image-fill":c}),v=c?Im(r,u):{};let k;i!==Dm&&(k="right"===n?`auto ${i}%`:`${i}% auto`);const w={gridTemplateColumns:k};return"right"===n?(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:f,style:w}),children:[(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:v,children:(y[a]||zm)()})]}):(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:f,style:w}),children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:v,children:(y[a]||zm)()}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})},migrate:Rm},qm={attributes:Lm,supports:Em,save({attributes:e}){const{isStackedOnMobile:t,mediaAlt:o,mediaPosition:n,mediaType:a,mediaUrl:r,mediaWidth:i,mediaId:s,verticalAlignment:l,imageFill:c,focalPoint:u,linkClass:d,href:p,linkTarget:m,rel:g}=e,h=e.mediaSizeSlug||Nm,x=g||void 0,_=ft({[`wp-image-${s}`]:s&&"image"===a,[`size-${h}`]:s&&"image"===a});let b=(0,Je.jsx)("img",{src:r,alt:o,className:_||null});p&&(b=(0,Je.jsx)("a",{className:d,href:p,target:m,rel:x,children:b}));const y={image:()=>b,video:()=>(0,Je.jsx)("video",{controls:!0,src:r})},f=ft({"has-media-on-the-right":"right"===n,"is-stacked-on-mobile":t,[`is-vertically-aligned-${l}`]:l,"is-image-fill":c}),v=c?Im(r,u):{};let k;i!==Dm&&(k="right"===n?`auto ${i}%`:`${i}% auto`);const w={gridTemplateColumns:k};return(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:f,style:w}),children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:v,children:(y[a]||zm)()}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})},migrate:Rm},Wm={attributes:{...Hm,isStackedOnMobile:{type:"boolean",default:!0},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:(0,ut.compose)(Am,Rm),save({attributes:e}){const{backgroundColor:t,customBackgroundColor:o,isStackedOnMobile:n,mediaAlt:a,mediaPosition:r,mediaType:i,mediaUrl:s,mediaWidth:l,mediaId:c,verticalAlignment:u,imageFill:d,focalPoint:p,linkClass:m,href:g,linkTarget:h,rel:x}=e,_=x||void 0;let b=(0,Je.jsx)("img",{src:s,alt:a,className:c&&"image"===i?`wp-image-${c}`:null});g&&(b=(0,Je.jsx)("a",{className:m,href:g,target:h,rel:_,children:b}));const y={image:()=>b,video:()=>(0,Je.jsx)("video",{controls:!0,src:s})},f=(0,nt.getColorClassName)("background-color",t),v=ft({"has-media-on-the-right":"right"===r,"has-background":f||o,[f]:f,"is-stacked-on-mobile":n,[`is-vertically-aligned-${u}`]:u,"is-image-fill":d}),k=d?Im(s,p):{};let w;l!==Dm&&(w="right"===r?`auto ${l}%`:`${l}% auto`);const C={backgroundColor:f?void 0:o,gridTemplateColumns:w};return(0,Je.jsxs)("div",{className:v,style:C,children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:k,children:(y[i]||zm)()}),(0,Je.jsx)("div",{className:"wp-block-media-text__content",children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})]})}},Zm={attributes:{...Hm,backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"}},migrate:(0,ut.compose)(Am,Rm),save({attributes:e}){const{backgroundColor:t,customBackgroundColor:o,isStackedOnMobile:n,mediaAlt:a,mediaPosition:r,mediaType:i,mediaUrl:s,mediaWidth:l,mediaId:c,verticalAlignment:u,imageFill:d,focalPoint:p}=e,m={image:()=>(0,Je.jsx)("img",{src:s,alt:a,className:c&&"image"===i?`wp-image-${c}`:null}),video:()=>(0,Je.jsx)("video",{controls:!0,src:s})},g=(0,nt.getColorClassName)("background-color",t),h=ft({"has-media-on-the-right":"right"===r,[g]:g,"is-stacked-on-mobile":n,[`is-vertically-aligned-${u}`]:u,"is-image-fill":d}),x=d?Im(s,p):{};let _;l!==Dm&&(_="right"===r?`auto ${l}%`:`${l}% auto`);const b={backgroundColor:g?void 0:o,gridTemplateColumns:_};return(0,Je.jsxs)("div",{className:h,style:b,children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",style:x,children:(m[i]||zm)()}),(0,Je.jsx)("div",{className:"wp-block-media-text__content",children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})]})}},Qm={attributes:{...Hm,backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src"}},migrate:Rm,save({attributes:e}){const{backgroundColor:t,customBackgroundColor:o,isStackedOnMobile:n,mediaAlt:a,mediaPosition:r,mediaType:i,mediaUrl:s,mediaWidth:l}=e,c={image:()=>(0,Je.jsx)("img",{src:s,alt:a}),video:()=>(0,Je.jsx)("video",{controls:!0,src:s})},u=(0,nt.getColorClassName)("background-color",t),d=ft({"has-media-on-the-right":"right"===r,[u]:u,"is-stacked-on-mobile":n});let p;l!==Dm&&(p="right"===r?`auto ${l}%`:`${l}% auto`);const m={backgroundColor:u?void 0:o,gridTemplateColumns:p};return(0,Je.jsxs)("div",{className:d,style:m,children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",children:(c[i]||zm)()}),(0,Je.jsx)("div",{className:"wp-block-media-text__content",children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})]})}},Km=[$m,Gm,Um,qm,Wm,Zm,Qm],Ym=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z"})}),Jm=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z"})}),Xm=(0,Je.jsxs)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(Ye.Path,{d:"m7 6.5 4 2.5-4 2.5z"}),(0,Je.jsx)(Ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z"})]});function eg(e,t){return e?{objectPosition:t?`${Math.round(100*t.x)}% ${Math.round(100*t.y)}%`:"50% 50%"}:{}}const tg=["image","video"],og=()=>{},ng=(0,st.forwardRef)((({isSelected:e,isStackedOnMobile:t,...o},n)=>{const a=(0,ut.useViewportMatch)("small","<");return(0,Je.jsx)(tt.ResizableBox,{ref:n,showHandle:e&&(!a||!t),...o})}));function ag({mediaId:e,mediaUrl:t,onSelectMedia:o,toggleUseFeaturedImage:n,useFeaturedImage:a}){return(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(nt.MediaReplaceFlow,{mediaId:e,mediaURL:t,allowedTypes:tg,accept:"image/*,video/*",onSelect:o,onToggleFeaturedImage:n,useFeaturedImage:a,onReset:()=>o(void 0)})})}function rg({className:e,mediaUrl:t,onSelectMedia:o,toggleUseFeaturedImage:n}){const{createErrorNotice:a}=(0,it.useDispatch)(Rt.store);return(0,Je.jsx)(nt.MediaPlaceholder,{icon:(0,Je.jsx)(nt.BlockIcon,{icon:Xm}),labels:{title:(0,ot.__)("Media area")},className:e,onSelect:o,accept:"image/*,video/*",onToggleFeaturedImage:n,allowedTypes:tg,onError:e=>{a(e,{type:"snackbar"})},disableMediaButtons:t})}const ig=(0,st.forwardRef)((function(e,t){const{className:o,commitWidthChange:n,focalPoint:a,imageFill:r,isSelected:i,isStackedOnMobile:s,mediaAlt:l,mediaId:c,mediaPosition:u,mediaType:d,mediaUrl:p,mediaWidth:m,onSelectMedia:g,onWidthChange:h,enableResize:x,toggleUseFeaturedImage:_,useFeaturedImage:b,featuredImageURL:y,featuredImageAlt:f,refMedia:v}=e,k=!c&&(0,lt.isBlobURL)(p),{toggleSelection:w}=(0,it.useDispatch)(nt.store);if(p||y||b){const C=()=>{w(!1)},j=(e,t,o)=>{h(parseInt(o.style.width))},S=(e,t,o)=>{w(!0),n(parseInt(o.style.width))},B={right:x&&"left"===u,left:x&&"right"===u},T="image"===d&&r?eg(p||y,a):{},N={image:()=>b&&y?(0,Je.jsx)("img",{ref:v,src:y,alt:f,style:T}):p&&(0,Je.jsx)("img",{ref:v,src:p,alt:l,style:T}),video:()=>(0,Je.jsx)("video",{controls:!0,ref:v,src:p})};return(0,Je.jsxs)(ng,{as:"figure",className:ft(o,"editor-media-container__resizer",{"is-transient":k}),size:{width:m+"%"},minWidth:"10%",maxWidth:"100%",enable:B,onResizeStart:C,onResize:j,onResizeStop:S,axis:"x",isSelected:i,isStackedOnMobile:s,ref:t,children:[(0,Je.jsx)(ag,{onSelectMedia:g,mediaUrl:b&&y?y:p,mediaId:c,toggleUseFeaturedImage:_}),(N[d]||og)(),k&&(0,Je.jsx)(tt.Spinner,{}),!b&&(0,Je.jsx)(rg,{...e}),!y&&b&&(0,Je.jsx)(tt.Placeholder,{className:"wp-block-media-text--placeholder-image",style:T,withIllustration:!0})]})}return(0,Je.jsx)(rg,{...e})})),{ResolutionTool:sg}=Ot(nt.privateApis),lg=e=>Math.max(15,Math.min(e,85));function cg(e,t){return e?.media_details?.sizes?.[t]?.source_url}function ug({image:e,value:t,onChange:o}){const{imageSizes:n}=(0,it.useSelect)((e=>{const{getSettings:t}=e(nt.store);return{imageSizes:t().imageSizes}}),[]);if(!n?.length)return null;const a=n.filter((({slug:t})=>cg(e,t))).map((({name:e,slug:t})=>({value:t,label:e})));return(0,Je.jsx)(sg,{value:t,defaultValue:Nm,options:a,onChange:o})}const dg=function({attributes:e,isSelected:t,setAttributes:o,context:{postId:n,postType:a}}){const{focalPoint:r,href:i,imageFill:s,isStackedOnMobile:l,linkClass:c,linkDestination:u,linkTarget:d,mediaAlt:p,mediaId:m,mediaPosition:g,mediaType:h,mediaUrl:x,mediaWidth:_,mediaSizeSlug:b,rel:y,verticalAlignment:f,allowedBlocks:v,useFeaturedImage:k}=e,[w]=(0,ct.useEntityProp)("postType",a,"featured_media",n),{featuredImageMedia:C}=(0,it.useSelect)((e=>({featuredImageMedia:w&&k?e(ct.store).getMedia(w,{context:"view"}):void 0})),[w,k]),{image:j}=(0,it.useSelect)((e=>({image:m&&t?e(ct.store).getMedia(m,{context:"view"}):null})),[t,m]),S=k?C?.source_url:"",B=k?C?.alt_text:"",T=(0,st.useRef)(),N=e=>{const{style:t}=T.current,{x:o,y:n}=e;t.objectPosition=`${100*o}% ${100*n}%`},[P,I]=(0,st.useState)(null),M=function({attributes:{linkDestination:e,href:t},setAttributes:o}){return n=>{if(!n||!n.url)return void o({mediaAlt:void 0,mediaId:void 0,mediaType:void 0,mediaUrl:void 0,mediaLink:void 0,href:void 0,focalPoint:void 0,useFeaturedImage:!1});let a,r;(0,lt.isBlobURL)(n.url)&&(n.type=(0,lt.getBlobTypeByURL)(n.url)),a=n.media_type?"image"===n.media_type?"image":"video":n.type,"image"===a&&(r=n.sizes?.large?.url||n.media_details?.sizes?.large?.source_url);let i=t;"media"===e&&(i=n.url),"attachment"===e&&(i=n.link),o({mediaAlt:n.alt,mediaId:n.id,mediaType:a,mediaUrl:r||n.url,mediaLink:n.link||void 0,href:i,focalPoint:void 0,useFeaturedImage:!1})}}({attributes:e,setAttributes:o}),D=e=>{o({mediaWidth:lg(e)}),I(null)},z=ft({"has-media-on-the-right":"right"===g,"is-selected":t,"is-stacked-on-mobile":l,[`is-vertically-aligned-${f}`]:f,"is-image-fill-element":s}),A=`${P||_}%`,R="right"===g?`1fr ${A}`:`${A} 1fr`,H={gridTemplateColumns:R,msGridColumns:R},L=mt(),V=(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{o({isStackedOnMobile:!0,imageFill:!1,mediaAlt:"",focalPoint:void 0,mediaWidth:50,mediaSizeSlug:void 0})},dropdownMenuProps:L,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Media width"),isShownByDefault:!0,hasValue:()=>50!==_,onDeselect:()=>o({mediaWidth:50}),children:(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Media width"),value:P||_,onChange:D,min:15,max:85})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Stack on mobile"),isShownByDefault:!0,hasValue:()=>!l,onDeselect:()=>o({isStackedOnMobile:!0}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Stack on mobile"),checked:l,onChange:()=>o({isStackedOnMobile:!l})})}),"image"===h&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Crop image to fill"),isShownByDefault:!0,hasValue:()=>!!s,onDeselect:()=>o({imageFill:!1}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Crop image to fill"),checked:!!s,onChange:()=>o({imageFill:!s})})}),s&&(x||S)&&"image"===h&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Focal point"),isShownByDefault:!0,hasValue:()=>!!r,onDeselect:()=>o({focalPoint:void 0}),children:(0,Je.jsx)(tt.FocalPointPicker,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Focal point"),url:k&&S?S:x,value:r,onChange:e=>o({focalPoint:e}),onDragStart:N,onDrag:N})}),"image"===h&&x&&!k&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Alternative text"),isShownByDefault:!0,hasValue:()=>!!p,onDeselect:()=>o({mediaAlt:""}),children:(0,Je.jsx)(tt.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Alternative text"),value:p,onChange:e=>{o({mediaAlt:e})},help:(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.ExternalLink,{href:(0,ot.__)("https://www.w3.org/WAI/tutorials/images/decision-tree/"),children:(0,ot.__)("Describe the purpose of the image.")}),(0,Je.jsx)("br",{}),(0,ot.__)("Leave empty if decorative.")]})})}),"image"===h&&!k&&(0,Je.jsx)(ug,{image:j,value:b,onChange:e=>{const t=cg(j,e);if(!t)return null;o({mediaUrl:t,mediaSizeSlug:e})}})]}),F=(0,nt.useBlockProps)({className:z,style:H}),E=(0,nt.useInnerBlocksProps)({className:"wp-block-media-text__content"},{template:Pm,allowedBlocks:v}),O=(0,nt.useBlockEditingMode)();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:V}),(0,Je.jsxs)(nt.BlockControls,{group:"block",children:["default"===O&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockVerticalAlignmentControl,{onChange:e=>{o({verticalAlignment:e})},value:f}),(0,Je.jsx)(tt.ToolbarButton,{icon:Ym,title:(0,ot.__)("Show media on left"),isActive:"left"===g,onClick:()=>o({mediaPosition:"left"})}),(0,Je.jsx)(tt.ToolbarButton,{icon:Jm,title:(0,ot.__)("Show media on right"),isActive:"right"===g,onClick:()=>o({mediaPosition:"right"})})]}),"image"===h&&!k&&(0,Je.jsx)(nt.__experimentalImageURLInputUI,{url:i||"",onChangeUrl:e=>{o(e)},linkDestination:u,mediaType:h,mediaUrl:j&&j.source_url,mediaLink:j&&j.link,linkTarget:d,linkClass:c,rel:y})]}),(0,Je.jsxs)("div",{...F,children:["right"===g&&(0,Je.jsx)("div",{...E}),(0,Je.jsx)(ig,{className:"wp-block-media-text__media",onSelectMedia:M,onWidthChange:e=>{I(lg(e))},commitWidthChange:D,refMedia:T,enableResize:"default"===O,toggleUseFeaturedImage:()=>{o({imageFill:!1,mediaType:"image",mediaId:void 0,mediaUrl:void 0,mediaAlt:void 0,mediaLink:void 0,linkDestination:void 0,linkTarget:void 0,linkClass:void 0,rel:void 0,href:void 0,useFeaturedImage:!k})},focalPoint:r,imageFill:s,isSelected:t,isStackedOnMobile:l,mediaAlt:p,mediaId:m,mediaPosition:g,mediaType:h,mediaUrl:x,mediaWidth:_,useFeaturedImage:k,featuredImageURL:S,featuredImageAlt:B}),"right"!==g&&(0,Je.jsx)("div",{...E})]})]})},pg=()=>{};const mg={from:[{type:"block",blocks:["core/image"],transform:({alt:e,url:t,id:o,anchor:n})=>(0,Ke.createBlock)("core/media-text",{mediaAlt:e,mediaId:o,mediaUrl:t,mediaType:"image",anchor:n})},{type:"block",blocks:["core/video"],transform:({src:e,id:t,anchor:o})=>(0,Ke.createBlock)("core/media-text",{mediaId:t,mediaUrl:e,mediaType:"video",anchor:o})},{type:"block",blocks:["core/cover"],transform:({align:e,alt:t,anchor:o,backgroundType:n,customGradient:a,customOverlayColor:r,gradient:i,id:s,overlayColor:l,style:c,textColor:u,url:d},p)=>{let m={};return a?m={style:{color:{gradient:a}}}:r&&(m={style:{color:{background:r}}}),c?.color?.text&&(m.style={color:{...m.style?.color,text:c.color.text}}),(0,Ke.createBlock)("core/media-text",{align:e,anchor:o,backgroundColor:l,gradient:i,mediaAlt:t,mediaId:s,mediaType:n,mediaUrl:d,textColor:u,...m},p)}}],to:[{type:"block",blocks:["core/image"],isMatch:({mediaType:e,mediaUrl:t})=>!t||"image"===e,transform:({mediaAlt:e,mediaId:t,mediaUrl:o,anchor:n})=>(0,Ke.createBlock)("core/image",{alt:e,id:t,url:o,anchor:n})},{type:"block",blocks:["core/video"],isMatch:({mediaType:e,mediaUrl:t})=>!t||"video"===e,transform:({mediaId:e,mediaUrl:t,anchor:o})=>(0,Ke.createBlock)("core/video",{id:e,src:t,anchor:o})},{type:"block",blocks:["core/cover"],transform:({align:e,anchor:t,backgroundColor:o,focalPoint:n,gradient:a,mediaAlt:r,mediaId:i,mediaType:s,mediaUrl:l,style:c,textColor:u},d)=>{const p={};c?.color?.gradient?p.customGradient=c.color.gradient:c?.color?.background&&(p.customOverlayColor=c.color.background),c?.color?.text&&(p.style={color:{text:c.color.text}});const m={align:e,alt:r,anchor:t,backgroundType:s,dimRatio:l?50:100,focalPoint:n,gradient:a,id:i,overlayColor:o,textColor:u,url:l,...p};return(0,Ke.createBlock)("core/cover",m,d)}}]},gg=mg,hg={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/media-text",title:"Media & Text",category:"media",description:"Set media and words side-by-side for a richer layout.",keywords:["image","video"],textdomain:"default",attributes:{align:{type:"string",default:"none"},mediaAlt:{type:"string",source:"attribute",selector:"figure img",attribute:"alt",default:"",role:"content"},mediaPosition:{type:"string",default:"left"},mediaId:{type:"number",role:"content"},mediaUrl:{type:"string",source:"attribute",selector:"figure video,figure img",attribute:"src",role:"content"},mediaLink:{type:"string"},linkDestination:{type:"string"},linkTarget:{type:"string",source:"attribute",selector:"figure a",attribute:"target"},href:{type:"string",source:"attribute",selector:"figure a",attribute:"href",role:"content"},rel:{type:"string",source:"attribute",selector:"figure a",attribute:"rel"},linkClass:{type:"string",source:"attribute",selector:"figure a",attribute:"class"},mediaType:{type:"string",role:"content"},mediaWidth:{type:"number",default:50},mediaSizeSlug:{type:"string"},isStackedOnMobile:{type:"boolean",default:!0},verticalAlignment:{type:"string"},imageFill:{type:"boolean"},focalPoint:{type:"object"},allowedBlocks:{type:"array"},useFeaturedImage:{type:"boolean",default:!1}},usesContext:["postId","postType"],supports:{anchor:!0,align:["wide","full"],html:!1,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-media-text-editor",style:"wp-block-media-text"},{name:xg}=hg,_g={icon:Tm,example:{viewportWidth:601,attributes:{mediaType:"image",mediaUrl:"https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg"},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,ot.__)("The wren<br>Earns his living<br>Noiselessly.")}},{name:"core/paragraph",attributes:{content:(0,ot.__)("— Kobayashi Issa (一茶)")}}]},transforms:gg,edit:dg,save:function({attributes:e}){const{isStackedOnMobile:t,mediaAlt:o,mediaPosition:n,mediaType:a,mediaUrl:r,mediaWidth:i,mediaId:s,verticalAlignment:l,imageFill:c,focalPoint:u,linkClass:d,href:p,linkTarget:m,rel:g}=e,h=e.mediaSizeSlug||Nm,x=g||void 0,_=ft({[`wp-image-${s}`]:s&&"image"===a,[`size-${h}`]:s&&"image"===a}),b=c?eg(r,u):{};let y=r?(0,Je.jsx)("img",{src:r,alt:o,className:_||null,style:b}):null;p&&(y=(0,Je.jsx)("a",{className:d,href:p,target:m,rel:x,children:y}));const f={image:()=>y,video:()=>(0,Je.jsx)("video",{controls:!0,src:r})},v=ft({"has-media-on-the-right":"right"===n,"is-stacked-on-mobile":t,[`is-vertically-aligned-${l}`]:l,"is-image-fill-element":c});let k;50!==i&&(k="right"===n?`auto ${i}%`:`${i}% auto`);const w={gridTemplateColumns:k};return"right"===n?(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:v,style:w}),children:[(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})}),(0,Je.jsx)("figure",{className:"wp-block-media-text__media",children:(f[a]||pg)()})]}):(0,Je.jsxs)("div",{...nt.useBlockProps.save({className:v,style:w}),children:[(0,Je.jsx)("figure",{className:"wp-block-media-text__media",children:(f[a]||pg)()}),(0,Je.jsx)("div",{...nt.useInnerBlocksProps.save({className:"wp-block-media-text__content"})})]})},deprecated:Km},bg=()=>et({name:xg,metadata:hg,settings:_g});const yg={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/missing",title:"Unsupported",category:"text",description:"Your site doesn’t include support for this block.",textdomain:"default",attributes:{originalName:{type:"string"},originalUndelimitedContent:{type:"string"},originalContent:{type:"string",source:"raw"}},supports:{className:!1,customClassName:!1,inserter:!1,html:!1,reusable:!1,interactivity:{clientNavigation:!0}}},{name:fg}=yg,vg={name:fg,__experimentalLabel(e,{context:t}){if("accessibility"===t){const{originalName:t}=e,o=t?(0,Ke.getBlockType)(t):void 0;return o?o.settings.title||t:""}},edit:function({attributes:e,clientId:t}){const{originalName:o,originalUndelimitedContent:n}=e,a=!!n,{hasFreeformBlock:r,hasHTMLBlock:i}=(0,it.useSelect)((e=>{const{canInsertBlockType:o,getBlockRootClientId:n}=e(nt.store);return{hasFreeformBlock:o("core/freeform",n(t)),hasHTMLBlock:o("core/html",n(t))}}),[t]),{replaceBlock:s}=(0,it.useDispatch)(nt.store),l=[];let c;const u=(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,onClick:function(){s(t,(0,Ke.createBlock)("core/html",{content:n}))},variant:"primary",children:(0,ot.__)("Keep as HTML")},"convert");return!a||r||o?a&&i?(c=(0,ot.sprintf)((0,ot.__)('Your site doesn’t include support for the "%s" block. You can leave it as-is, convert it to custom HTML, or remove it.'),o),l.push(u)):c=(0,ot.sprintf)((0,ot.__)('Your site doesn’t include support for the "%s" block. You can leave it as-is or remove it.'),o):i?(c=(0,ot.__)("It appears you are trying to use the deprecated Classic block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely. Alternatively, you can refresh the page to use the Classic block."),l.push(u)):c=(0,ot.__)("It appears you are trying to use the deprecated Classic block. You can leave this block intact, or remove it entirely. Alternatively, you can refresh the page to use the Classic block."),(0,Je.jsxs)("div",{...(0,nt.useBlockProps)({className:"has-warning"}),children:[(0,Je.jsx)(nt.Warning,{actions:l,children:c}),(0,Je.jsx)(st.RawHTML,{children:(0,xc.safeHTML)(n)})]})},save:function({attributes:e}){return(0,Je.jsx)(st.RawHTML,{children:e.originalContent})}},kg=()=>et({name:fg,metadata:yg,settings:vg}),wg=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z"})}),Cg=(0,ot.__)("Read more");const jg={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/more"===e.dataset.block,transform(e){const{customText:t,noTeaser:o}=e.dataset,n={};return t&&(n.customText=t),""===o&&(n.noTeaser=!0),(0,Ke.createBlock)("core/more",n)}}]},Sg={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/more",title:"More",category:"design",description:"Content before this block will be shown in the excerpt on your archives page.",keywords:["read more"],textdomain:"default",attributes:{customText:{type:"string",default:""},noTeaser:{type:"boolean",default:!1}},supports:{customClassName:!1,className:!1,html:!1,multiple:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-more-editor"},{name:Bg}=Sg,Tg={icon:wg,example:{},__experimentalLabel(e,{context:t}){const o=e?.metadata?.name;return"list-view"===t&&o?o:"accessibility"===t?e.customText:void 0},transforms:jg,edit:function({attributes:{customText:e,noTeaser:t},insertBlocksAfter:o,setAttributes:n}){const a={width:`${(e||Cg).length+1.2}em`},r=mt();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{n({noTeaser:!1})},dropdownMenuProps:r,children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Hide excerpt"),isShownByDefault:!0,hasValue:()=>t,onDeselect:()=>n({noTeaser:!1}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Hide the excerpt on the full content page"),checked:!!t,onChange:()=>n({noTeaser:!t}),help:e=>e?(0,ot.__)("The excerpt is hidden."):(0,ot.__)("The excerpt is visible.")})})})}),(0,Je.jsx)("div",{...(0,nt.useBlockProps)(),children:(0,Je.jsx)("input",{"aria-label":(0,ot.__)("“Read more” link text"),type:"text",value:e,placeholder:Cg,onChange:e=>{n({customText:e.target.value})},onKeyDown:({keyCode:e})=>{e===wo.ENTER&&o([(0,Ke.createBlock)((0,Ke.getDefaultBlockName)())])},style:a})})]})},save:function({attributes:{customText:e,noTeaser:t}}){const o=e?`\x3c!--more ${e}--\x3e`:"\x3c!--more--\x3e",n=t?"\x3c!--noteaser--\x3e":"";return(0,Je.jsx)(st.RawHTML,{children:[o,n].filter(Boolean).join("\n")})}},Ng=()=>et({name:Bg,metadata:Sg,settings:Tg}),Pg=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z"})}),Ig=window.wp.a11y;const Mg=(0,st.forwardRef)((function({icon:e,size:t=24,...o},n){return(0,st.cloneElement)(e,{width:t,height:t,...o,ref:n})})),Dg=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})}),zg={name:"core/navigation-link"},Ag=["core/navigation-link/page","core/navigation-link"],Rg={per_page:100,status:["publish","draft"],order:"desc",orderby:"date"},Hg=["postType","wp_navigation",Rg];function Lg(e){const t=(0,ct.useResourcePermissions)({kind:"postType",name:"wp_navigation",id:e}),{navigationMenu:o,isNavigationMenuResolved:n,isNavigationMenuMissing:a}=(0,it.useSelect)((t=>function(e,t){if(!t)return{isNavigationMenuResolved:!1,isNavigationMenuMissing:!0};const{getEntityRecord:o,getEditedEntityRecord:n,hasFinishedResolution:a}=e(ct.store),r=["postType","wp_navigation",t],i=o(...r),s=n(...r),l=a("getEditedEntityRecord",r),c="publish"===s.status||"draft"===s.status;return{isNavigationMenuResolved:l,isNavigationMenuMissing:l&&(!i||!c),navigationMenu:c?s:null}}(t,e)),[e]),{canCreate:r,canUpdate:i,canDelete:s,isResolving:l,hasResolved:c}=t,{records:u,isResolving:d,hasResolved:p}=(0,ct.useEntityRecords)("postType","wp_navigation",Rg);return{navigationMenu:o,isNavigationMenuResolved:n,isNavigationMenuMissing:a,navigationMenus:u,isResolvingNavigationMenus:d,hasResolvedNavigationMenus:p,canSwitchNavigationMenu:e?u?.length>1:u?.length>0,canUserCreateNavigationMenus:r,isResolvingCanUserCreateNavigationMenus:l,hasResolvedCanUserCreateNavigationMenus:c,canUserUpdateNavigationMenu:i,hasResolvedCanUserUpdateNavigationMenu:e?c:void 0,canUserDeleteNavigationMenu:s,hasResolvedCanUserDeleteNavigationMenu:e?c:void 0}}function Vg(e){const{records:t,isResolving:o,hasResolved:n}=(0,ct.useEntityRecords)("root","menu",{per_page:-1,context:"view"}),{records:a,isResolving:r,hasResolved:i}=(0,ct.useEntityRecords)("postType","page",{parent:0,order:"asc",orderby:"id",per_page:-1,context:"view"}),{records:s,hasResolved:l}=(0,ct.useEntityRecords)("root","menuItem",{menus:e,per_page:-1,context:"view"},{enabled:!!e});return{pages:a,isResolvingPages:r,hasResolvedPages:i,hasPages:!(!i||!a?.length),menus:t,isResolvingMenus:o,hasResolvedMenus:n,hasMenus:!(!n||!t?.length),menuItems:s,hasResolvedMenuItems:l}}const Fg=({isVisible:e=!0})=>(0,Je.jsx)("div",{"aria-hidden":!e||void 0,className:"wp-block-navigation-placeholder__preview",children:(0,Je.jsxs)("div",{className:"wp-block-navigation-placeholder__actions__indicator",children:[(0,Je.jsx)(Mg,{icon:Pg}),(0,ot.__)("Navigation")]})}),Eg=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});const Og=function({currentMenuId:e,onSelectNavigationMenu:t,onSelectClassicMenu:o,onCreateNew:n,actionLabel:a,createNavigationMenuIsSuccess:r,createNavigationMenuIsError:i}){const s=(0,ot.__)("Create from '%s'"),[l,c]=(0,st.useState)(!1);a=a||s;const{menus:u}=Vg(),{navigationMenus:d,isResolvingNavigationMenus:p,hasResolvedNavigationMenus:m,canUserCreateNavigationMenus:g,canSwitchNavigationMenu:h,isNavigationMenuMissing:x}=Lg(e),[_]=(0,ct.useEntityProp)("postType","wp_navigation","title"),b=(0,st.useMemo)((()=>d?.map((({id:e,title:t,status:o},n)=>{const r=function(e,t,o){return e?"publish"===o?(0,tn.decodeEntities)(e):(0,ot.sprintf)((0,ot.__)("%1$s (%2$s)"),(0,tn.decodeEntities)(e),o):(0,ot.sprintf)((0,ot.__)("(no title %s)"),t)}(t?.rendered,n+1,o);return{value:e,label:r,ariaLabel:(0,ot.sprintf)(a,r),disabled:l||p||!m}}))||[]),[d,a,p,m,l]),y=!!d?.length,f=!!u?.length,v=!!h,k=!!g,w=y&&!e,C=!y&&m,j=m&&null===e,S=e&&x;let B="";B=p?(0,ot.__)("Loading…"):w||C||j||S?(0,ot.__)("Choose or create a Navigation Menu"):_,(0,st.useEffect)((()=>{l&&(r||i)&&c(!1)}),[m,r,g,i,l,j,C,w]);const T=(0,Je.jsx)(tt.DropdownMenu,{label:B,icon:Eg,toggleProps:{size:"small"},children:({onClose:a})=>(0,Je.jsxs)(Je.Fragment,{children:[v&&y&&(0,Je.jsx)(tt.MenuGroup,{label:(0,ot.__)("Menus"),children:(0,Je.jsx)(tt.MenuItemsChoice,{value:e,onSelect:e=>{t(e),a()},choices:b})}),k&&f&&(0,Je.jsx)(tt.MenuGroup,{label:(0,ot.__)("Import Classic Menus"),children:u?.map((e=>{const t=(0,tn.decodeEntities)(e.name);return(0,Je.jsx)(tt.MenuItem,{onClick:async()=>{c(!0),await o(e),c(!1),a()},"aria-label":(0,ot.sprintf)(s,t),disabled:l||p||!m,children:t},e.id)}))}),g&&(0,Je.jsx)(tt.MenuGroup,{label:(0,ot.__)("Tools"),children:(0,Je.jsx)(tt.MenuItem,{onClick:async()=>{c(!0),await n(),c(!1),a()},disabled:l||p||!m,children:(0,ot.__)("Create new Menu")})})]})});return T};function $g({isSelected:e,currentMenuId:t,clientId:o,canUserCreateNavigationMenus:n=!1,isResolvingCanUserCreateNavigationMenus:a,onSelectNavigationMenu:r,onSelectClassicMenu:i,onCreateEmpty:s}){const{isResolvingMenus:l,hasResolvedMenus:c}=Vg();(0,st.useEffect)((()=>{e&&(l&&(0,Ig.speak)((0,ot.__)("Loading navigation block setup options…")),c&&(0,Ig.speak)((0,ot.__)("Navigation block setup options ready.")))}),[c,l,e]);const u=l&&a;return(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsxs)(tt.Placeholder,{className:"wp-block-navigation-placeholder",children:[(0,Je.jsx)(Fg,{isVisible:!e}),(0,Je.jsx)("div",{"aria-hidden":!e||void 0,className:"wp-block-navigation-placeholder__controls",children:(0,Je.jsxs)("div",{className:"wp-block-navigation-placeholder__actions",children:[(0,Je.jsxs)("div",{className:"wp-block-navigation-placeholder__actions__indicator",children:[(0,Je.jsx)(Mg,{icon:Pg})," ",(0,ot.__)("Navigation")]}),(0,Je.jsx)("hr",{}),u&&(0,Je.jsx)(tt.Spinner,{}),(0,Je.jsx)(Og,{currentMenuId:t,clientId:o,onSelectNavigationMenu:r,onSelectClassicMenu:i}),(0,Je.jsx)("hr",{}),n&&(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:s,children:(0,ot.__)("Start empty")})]})})]})})}const Gg=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"})});function Ug({icon:e}){return"menu"===e?(0,Je.jsx)(Mg,{icon:Gg}):(0,Je.jsxs)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:[(0,Je.jsx)(Ye.Rect,{x:"4",y:"7.5",width:"16",height:"1.5"}),(0,Je.jsx)(Ye.Rect,{x:"4",y:"15",width:"16",height:"1.5"})]})}function qg({children:e,id:t,isOpen:o,isResponsive:n,onToggle:a,isHiddenByDefault:r,overlayBackgroundColor:i,overlayTextColor:s,hasIcon:l,icon:c}){if(!n)return e;const u=ft("wp-block-navigation__responsive-container",{"has-text-color":!!s.color||!!s?.class,[(0,nt.getColorClassName)("color",s?.slug)]:!!s?.slug,"has-background":!!i.color||i?.class,[(0,nt.getColorClassName)("background-color",i?.slug)]:!!i?.slug,"is-menu-open":o,"hidden-by-default":r}),d={color:!s?.slug&&s?.color,backgroundColor:!i?.slug&&i?.color&&i.color},p=ft("wp-block-navigation__responsive-container-open",{"always-shown":r}),m=`${t}-modal`,g={className:"wp-block-navigation__responsive-dialog",...o&&{role:"dialog","aria-modal":!0,"aria-label":(0,ot.__)("Menu")}};return(0,Je.jsxs)(Je.Fragment,{children:[!o&&(0,Je.jsxs)(tt.Button,{__next40pxDefaultSize:!0,"aria-haspopup":"true","aria-label":l&&(0,ot.__)("Open menu"),className:p,onClick:()=>a(!0),children:[l&&(0,Je.jsx)(Ug,{icon:c}),!l&&(0,ot.__)("Menu")]}),(0,Je.jsx)("div",{className:u,style:d,id:m,children:(0,Je.jsx)("div",{className:"wp-block-navigation__responsive-close",tabIndex:"-1",children:(0,Je.jsxs)("div",{...g,children:[(0,Je.jsxs)(tt.Button,{__next40pxDefaultSize:!0,className:"wp-block-navigation__responsive-container-close","aria-label":l&&(0,ot.__)("Close menu"),onClick:()=>a(!1),children:[l&&(0,Je.jsx)(Mg,{icon:Dg}),!l&&(0,ot.__)("Close")]}),(0,Je.jsx)("div",{className:"wp-block-navigation__responsive-container-content",id:`${m}-content`,children:e})]})})})]})}function Wg({clientId:e,hasCustomPlaceholder:t,orientation:o,templateLock:n}){const{isImmediateParentOfSelectedBlock:a,selectedBlockHasChildren:r,isSelected:i}=(0,it.useSelect)((t=>{const{getBlockCount:o,hasSelectedInnerBlock:n,getSelectedBlockClientId:a}=t(nt.store),r=a();return{isImmediateParentOfSelectedBlock:n(e,!1),selectedBlockHasChildren:!!o(r),isSelected:r===e}}),[e]),[s,l,c]=(0,ct.useEntityBlockEditor)("postType","wp_navigation"),u=i||a&&!r,d=(0,st.useMemo)((()=>(0,Je.jsx)(Fg,{})),[]),p=!t&&!!!s?.length&&!i,m=(0,nt.useInnerBlocksProps)({className:"wp-block-navigation__container"},{value:s,onInput:l,onChange:c,prioritizedInserterBlocks:Ag,defaultBlock:zg,directInsert:!0,orientation:o,templateLock:n,renderAppender:!!(i||a&&!r||u)&&nt.InnerBlocks.ButtonBlockAppender,placeholder:p?d:void 0,__experimentalCaptureToolbars:!0,__unstableDisableLayoutClassNames:!0});return(0,Je.jsx)("div",{...m})}function Zg(){const[e,t]=(0,ct.useEntityProp)("postType","wp_navigation","title");return(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Menu name"),value:e,onChange:t})}const Qg=(e,t,o)=>{if(e===t)return!0;if("object"==typeof e&&null!=e&&"object"==typeof t&&null!=t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){if(!t.hasOwnProperty(n))return!1;if(o&&o(n,e))return!0;if(!Qg(e[n],t[n],o))return!1}return!0}return!1},Kg={};function Yg({blocks:e,createNavigationMenu:t,hasSelection:o}){const n=(0,st.useRef)();(0,st.useEffect)((()=>{n?.current||(n.current=e)}),[e]);const a=function(e,t){return!Qg(e,t,((e,t)=>{if("core/page-list"===t?.name&&"innerBlocks"===e)return!0}))}(n?.current,e),r=(0,st.useContext)(tt.Disabled.Context),i=(0,nt.useInnerBlocksProps)({className:"wp-block-navigation__container"},{renderAppender:!!o&&void 0,defaultBlock:zg,directInsert:!0}),{isSaving:s,hasResolvedAllNavigationMenus:l}=(0,it.useSelect)((e=>{if(r)return Kg;const{hasFinishedResolution:t,isSavingEntityRecord:o}=e(ct.store);return{isSaving:o("postType","wp_navigation"),hasResolvedAllNavigationMenus:t("getEntityRecords",Hg)}}),[r]);(0,st.useEffect)((()=>{!r&&!s&&l&&o&&a&&t(null,e)}),[e,t,r,s,l,a,o]);const c=s?tt.Disabled:"div";return(0,Je.jsx)(c,{...i})}function Jg({onDelete:e}){const[t,o]=(0,st.useState)(!1),n=(0,ct.useEntityId)("postType","wp_navigation"),{deleteEntityRecord:a}=(0,it.useDispatch)(ct.store);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,className:"wp-block-navigation-delete-menu-button",variant:"secondary",isDestructive:!0,onClick:()=>{o(!0)},children:(0,ot.__)("Delete menu")}),t&&(0,Je.jsx)(tt.__experimentalConfirmDialog,{isOpen:!0,onConfirm:()=>{a("postType","wp_navigation",n,{force:!0}),e()},onCancel:()=>{o(!1)},confirmButtonText:(0,ot.__)("Delete"),size:"medium",children:(0,ot.__)("Are you sure you want to delete this Navigation Menu?")})]})}const Xg=function({name:e,message:t=""}={}){const o=(0,st.useRef)(),{createWarningNotice:n,removeNotice:a}=(0,it.useDispatch)(Rt.store);return[(0,st.useCallback)((a=>{o.current||(o.current=e,n(a||t,{id:o.current,type:"snackbar"}))}),[o,n,t,e]),(0,st.useCallback)((()=>{o.current&&(a(o.current),o.current=null)}),[o,a])]};function eh({setAttributes:e,hasIcon:t,icon:o}){return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show icon button"),help:(0,ot.__)("Configure the visual appearance of the button that toggles the overlay menu."),onChange:t=>e({hasIcon:t}),checked:t}),(0,Je.jsxs)(tt.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"wp-block-navigation__overlay-menu-icon-toggle-group",label:(0,ot.__)("Icon"),value:o,onChange:t=>e({icon:t}),isBlock:!0,children:[(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"handle","aria-label":(0,ot.__)("handle"),label:(0,Je.jsx)(Ug,{icon:"handle"})}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"menu","aria-label":(0,ot.__)("menu"),label:(0,Je.jsx)(Ug,{icon:"menu"})})]})]})}function th(e){if(!e)return null;const t=oh(function(e,t="id",o="parent"){const n=Object.create(null),a=[];for(const r of e)n[r[t]]={...r,children:[]},r[o]?(n[r[o]]=n[r[o]]||{},n[r[o]].children=n[r[o]].children||[],n[r[o]].children.push(n[r[t]])):a.push(n[r[t]]);return a}(e));return(0,Ns.applyFilters)("blocks.navigation.__unstableMenuItemsToBlocks",t,e)}function oh(e,t=0){let o={};const n=[...e].sort(((e,t)=>e.menu_order-t.menu_order)),a=n.map((e=>{if("block"===e.type){const[t]=(0,Ke.parse)(e.content.raw);return t||(0,Ke.createBlock)("core/freeform",{content:e.content})}const n=e.children?.length?"core/navigation-submenu":"core/navigation-link",a=function({title:e,xfn:t,classes:o,attr_title:n,object:a,object_id:r,description:i,url:s,type:l,target:c},u,d){a&&"post_tag"===a&&(a="tag");return{label:e?.rendered||"",...a?.length&&{type:a},kind:l?.replace("_","-")||"custom",url:s||"",...t?.length&&t.join(" ").trim()&&{rel:t.join(" ").trim()},...o?.length&&o.join(" ").trim()&&{className:o.join(" ").trim()},...n?.length&&{title:n},...r&&"custom"!==a&&{id:r},...i?.length&&{description:i},..."_blank"===c&&{opensInNewTab:!0},..."core/navigation-submenu"===u&&{isTopLevelItem:0===d},..."core/navigation-link"===u&&{isTopLevelLink:0===d}}}(e,n,t),{innerBlocks:r=[],mapping:i={}}=e.children?.length?oh(e.children,t+1):{};o={...o,...i};const s=(0,Ke.createBlock)(n,a,r);return o[e.id]=s.clientId,s}));return{innerBlocks:a,mapping:o}}const nh="success",ah="error",rh="pending";let ih=null;const sh=function(e,{throwOnError:t=!1}={}){const o=(0,it.useRegistry)(),{editEntityRecord:n}=(0,it.useDispatch)(ct.store),[a,r]=(0,st.useState)("idle"),[i,s]=(0,st.useState)(null),l=(0,st.useCallback)((async(t,a,r="publish")=>{let i,s;try{s=await o.resolveSelect(ct.store).getMenuItems({menus:t,per_page:-1,context:"view"})}catch(e){throw new Error((0,ot.sprintf)((0,ot.__)('Unable to fetch classic menu "%s" from API.'),a),{cause:e})}if(null===s)throw new Error((0,ot.sprintf)((0,ot.__)('Unable to fetch classic menu "%s" from API.'),a));const{innerBlocks:l}=th(s);try{i=await e(a,l,r),await n("postType","wp_navigation",i.id,{status:"publish"},{throwOnError:!0})}catch(e){throw new Error((0,ot.sprintf)((0,ot.__)('Unable to create Navigation Menu "%s".'),a),{cause:e})}return i}),[e,n,o]);return{convert:(0,st.useCallback)((async(e,o,n)=>{if(ih!==e)return ih=e,e&&o?(r(rh),s(null),await l(e,o,n).then((e=>(r(nh),ih=null,e))).catch((e=>{if(s(e?.message),r(ah),ih=null,t)throw new Error((0,ot.sprintf)((0,ot.__)('Unable to create Navigation Menu "%s".'),o),{cause:e})}))):(s("Unable to convert menu. Missing menu details."),void r(ah))}),[l,t]),status:a,error:i}};function lh(e,t){return e&&t?e+"//"+t:null}const ch=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),uh=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{fillRule:"evenodd",d:"M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),dh=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})}),ph=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),mh=e=>"header"===e?ch:"footer"===e?uh:"sidebar"===e?dh:ph;const gh=["postType","wp_navigation",{status:"draft",per_page:-1}],hh=["postType","wp_navigation",{per_page:-1,status:"publish"}];function xh(e){const t=(0,st.useContext)(tt.Disabled.Context),o=function(e){return(0,it.useSelect)((t=>{if(!e)return;const{getBlock:o,getBlockParentsByBlockName:n}=t(nt.store),a=n(e,"core/template-part",!0);if(!a?.length)return;const{getCurrentTheme:r,getEditedEntityRecord:i}=t(ct.store),s=r(),l=(s?.default_template_part_areas||[]).map((e=>({...e,icon:mh(e.icon)})));for(const e of a){const t=o(e),{theme:n=s?.stylesheet,slug:a}=t.attributes,r=i("postType","wp_template_part",lh(n,a));if(r?.area)return l.find((e=>"uncategorized"!==e.area&&e.area===r.area))?.label}}),[e])}(t?void 0:e),n=(0,it.useRegistry)();return(0,st.useCallback)((async()=>{if(t)return"";const{getEntityRecords:e}=n.resolveSelect(ct.store),[a,r]=await Promise.all([e(...gh),e(...hh)]),i=o?(0,ot.sprintf)((0,ot.__)("%s menu"),o):(0,ot.__)("Menu"),s=[...a,...r].reduce(((e,t)=>t?.title?.raw?.startsWith(i)?e+1:e),0);return(s>0?`${i} ${s+1}`:i)||""}),[t,o,n])}const _h="success",bh="error",yh="pending",fh="idle";const vh=[];function kh(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function wh(e,t,o){if(!e)return;t(kh(e).color);let n=e,a=kh(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===a&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,a=kh(n).backgroundColor;o(a)}function Ch(e,t){const{textColor:o,customTextColor:n,backgroundColor:a,customBackgroundColor:r,overlayTextColor:i,customOverlayTextColor:s,overlayBackgroundColor:l,customOverlayBackgroundColor:c,style:u}=e,d={};return t&&s?d.customTextColor=s:t&&i?d.textColor=i:n?d.customTextColor=n:o?d.textColor=o:u?.color?.text&&(d.customTextColor=u.color.text),t&&c?d.customBackgroundColor=c:t&&l?d.backgroundColor=l:r?d.customBackgroundColor=r:a?d.backgroundColor=a:u?.color?.background&&(d.customTextColor=u.color.background),d}function jh(e){return{className:ft("wp-block-navigation__submenu-container",{"has-text-color":!(!e.textColor&&!e.customTextColor),[`has-${e.textColor}-color`]:!!e.textColor,"has-background":!(!e.backgroundColor&&!e.customBackgroundColor),[`has-${e.backgroundColor}-background-color`]:!!e.backgroundColor}),style:{color:e.customTextColor,backgroundColor:e.customBackgroundColor}}}const Sh=({className:e="",disabled:t,isMenuItem:o=!1})=>{let n=tt.Button;return o&&(n=tt.MenuItem),(0,Je.jsx)(n,{variant:"link",disabled:t,className:e,href:(0,vt.addQueryArgs)("edit.php",{post_type:"wp_navigation"}),children:(0,ot.__)("Manage menus")})};const Bh=function({onCreateNew:e,isNotice:t=!1}){const[o,n]=(0,st.useState)(!1),a=(0,st.createInterpolateElement)((0,ot.__)("Navigation Menu has been deleted or is unavailable. <button>Create a new Menu?</button>"),{button:(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,onClick:()=>{n(!0),e()},variant:"link",disabled:o,accessibleWhenDisabled:!0})});return t?(0,Je.jsx)(tt.Notice,{status:"warning",isDismissible:!1,children:a}):(0,Je.jsx)(nt.Warning,{children:a})},Th=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z"})}),Nh=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),Ph={className:"block-editor-block-settings-menu__popover",placement:"bottom-start"},Ih=["core/navigation-link","core/navigation-submenu"];function Mh({block:e,onClose:t,expandedState:o,expand:n,setInsertedBlock:a}){const{insertBlock:r,replaceBlock:i,replaceInnerBlocks:s}=(0,it.useDispatch)(nt.store),l=e.clientId,c=!Ih.includes(e.name);return(0,Je.jsx)(tt.MenuItem,{icon:Th,disabled:c,onClick:()=>{const c=!1,u=(0,Ke.createBlock)("core/navigation-link");if("core/navigation-submenu"===e.name)r(u,e.innerBlocks.length,l,c);else{const t=(0,Ke.createBlock)("core/navigation-submenu",e.attributes,e.innerBlocks);i(l,t),s(t.clientId,[u],c)}a(u),o[e.clientId]||n(e.clientId),t()},children:(0,ot.__)("Add submenu link")})}function Dh(e){const{block:t}=e,{clientId:o}=t,{moveBlocksDown:n,moveBlocksUp:a,removeBlocks:r}=(0,it.useDispatch)(nt.store),i=(0,ot.sprintf)((0,ot.__)("Remove %s"),(0,nt.BlockTitle)({clientId:o,maximumLength:25})),s=(0,it.useSelect)((e=>{const{getBlockRootClientId:t}=e(nt.store);return t(o)}),[o]);return(0,Je.jsx)(tt.DropdownMenu,{icon:Eg,label:(0,ot.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Ph,noIcons:!0,...e,children:({onClose:l})=>(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(tt.MenuGroup,{children:[(0,Je.jsx)(tt.MenuItem,{icon:Nh,onClick:()=>{a([o],s),l()},children:(0,ot.__)("Move up")}),(0,Je.jsx)(tt.MenuItem,{icon:Qd,onClick:()=>{n([o],s),l()},children:(0,ot.__)("Move down")}),(0,Je.jsx)(Mh,{block:t,onClose:l,expanded:!0,expandedState:e.expandedState,expand:e.expand,setInsertedBlock:e.setInsertedBlock})]}),(0,Je.jsx)(tt.MenuGroup,{children:(0,Je.jsx)(tt.MenuItem,{onClick:()=>{r([o],!1),l()},children:i})})]})})}const zh=window.wp.escapeHtml,Ah=(e={},t,o={})=>{const{label:n="",kind:a="",type:r=""}=o,{title:i="",url:s="",opensInNewTab:l,id:c,kind:u=a,type:d=r}=e,p=i.replace(/http(s?):\/\//gi,""),m=s.replace(/http(s?):\/\//gi,""),g=i&&i!==n&&p!==m?(0,zh.escapeHTML)(i):n||(0,zh.escapeHTML)(m),h="post_tag"===d?"tag":d.replace("-","_"),x=["post","page","tag","category"].indexOf(h)>-1,_=!u&&!x||"custom"===u?"custom":u;t({...s&&{url:encodeURI((0,vt.safeDecodeURI)(s))},...g&&{label:g},...void 0!==l&&{opensInNewTab:l},...c&&Number.isInteger(c)&&{id:c},..._&&{kind:_},...h&&"URL"!==h&&{type:h}})},Rh=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),Hh=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z"})}),Lh=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),{PrivateQuickInserter:Vh}=Ot(nt.privateApis);function Fh(e,t){switch(e){case"post":case"page":return{type:"post",subtype:e};case"category":return{type:"term",subtype:"category"};case"tag":return{type:"term",subtype:"post_tag"};case"post_format":return{type:"post-format"};default:return"taxonomy"===t?{type:"term",subtype:e}:"post-type"===t?{type:"post",subtype:e}:{initialSuggestionsSearchOptions:{type:"post",subtype:"page",perPage:20}}}}function Eh({clientId:e,onBack:t}){const{rootBlockClientId:o}=(0,it.useSelect)((t=>{const{getBlockRootClientId:o}=t(nt.store);return{rootBlockClientId:o(e)}}),[e]),n=(0,ut.useFocusOnMount)("firstElement"),a=(0,ut.useInstanceId)(nt.LinkControl,"link-ui-block-inserter__title"),r=(0,ut.useInstanceId)(nt.LinkControl,"link-ui-block-inserter__description");return e?(0,Je.jsxs)("div",{className:"link-ui-block-inserter",role:"dialog","aria-labelledby":a,"aria-describedby":r,ref:n,children:[(0,Je.jsxs)(tt.VisuallyHidden,{children:[(0,Je.jsx)("h2",{id:a,children:(0,ot.__)("Add block")}),(0,Je.jsx)("p",{id:r,children:(0,ot.__)("Choose a block to add to your Navigation.")})]}),(0,Je.jsx)(tt.Button,{className:"link-ui-block-inserter__back",icon:(0,ot.isRTL)()?Rh:Hh,onClick:e=>{e.preventDefault(),t()},size:"small",children:(0,ot.__)("Back")}),(0,Je.jsx)(Vh,{rootClientId:o,clientId:e,isAppender:!1,prioritizePatterns:!1,selectBlockOnInsert:!0,hasSearch:!1})]}):null}const Oh=(0,st.forwardRef)((function(e,t){const{label:o,url:n,opensInNewTab:a,type:r,kind:i}=e.link,s=r||"page",[l,c]=(0,st.useState)(!1),[u,d]=(0,st.useState)(!1),{saveEntityRecord:p}=(0,it.useDispatch)(ct.store),m=(0,ct.useResourcePermissions)({kind:"postType",name:s}),g=(0,st.useMemo)((()=>({url:n,opensInNewTab:a,title:o&&(0,xc.__unstableStripHTML)(o)})),[o,a,n]),h=(0,ut.useInstanceId)(Oh,"link-ui-link-control__title"),x=(0,ut.useInstanceId)(Oh,"link-ui-link-control__description");return(0,Je.jsxs)(tt.Popover,{ref:t,placement:"bottom",onClose:e.onClose,anchor:e.anchor,shift:!0,children:[!l&&(0,Je.jsxs)("div",{role:"dialog","aria-labelledby":h,"aria-describedby":x,children:[(0,Je.jsxs)(tt.VisuallyHidden,{children:[(0,Je.jsx)("h2",{id:h,children:(0,ot.__)("Add link")}),(0,Je.jsx)("p",{id:x,children:(0,ot.__)("Search for and add a link to your Navigation.")})]}),(0,Je.jsx)(nt.LinkControl,{hasTextControl:!0,hasRichPreviews:!0,value:g,showInitialSuggestions:!0,withCreateSuggestion:m.canCreate,createSuggestion:async function(e){const t=await p("postType",s,{title:e,status:"draft"});return{id:t.id,type:s,title:(0,tn.decodeEntities)(t.title.rendered),url:t.link,kind:"post-type"}},createSuggestionButtonText:e=>{let t;return t="post"===r?(0,ot.__)("Create draft post: <mark>%s</mark>"):(0,ot.__)("Create draft page: <mark>%s</mark>"),(0,st.createInterpolateElement)((0,ot.sprintf)(t,e),{mark:(0,Je.jsx)("mark",{})})},noDirectEntry:!!r,noURLSuggestion:!!r,suggestionsQuery:Fh(r,i),onChange:e.onChange,onRemove:e.onRemove,onCancel:e.onCancel,renderControlBottom:()=>!g?.url?.length&&(0,Je.jsx)($h,{focusAddBlockButton:u,setAddingBlock:()=>{c(!0),d(!1)}})})]}),l&&(0,Je.jsx)(Eh,{clientId:e.clientId,onBack:()=>{c(!1),d(!0)}})]})})),$h=({setAddingBlock:e,focusAddBlockButton:t})=>{const o=(0,st.useRef)();return(0,st.useEffect)((()=>{t&&o.current?.focus()}),[t]),(0,Je.jsx)(tt.__experimentalVStack,{className:"link-ui-tools",children:(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,ref:o,icon:Lh,onClick:t=>{t.preventDefault(),e(!0)},"aria-haspopup":"listbox",children:(0,ot.__)("Add block")})})},Gh=(0,ot.__)("Switch to '%s'"),Uh=["core/navigation-link","core/navigation-submenu"],{PrivateListView:qh}=Ot(nt.privateApis);function Wh({block:e,insertedBlock:t,setInsertedBlock:o}){const{updateBlockAttributes:n}=(0,it.useDispatch)(nt.store),a=Uh?.includes(t?.name),r=t?.clientId===e.clientId;if(!(a&&r))return null;return(0,Je.jsx)(Oh,{clientId:t?.clientId,link:t?.attributes,onClose:()=>{o(null)},onChange:e=>{var a;Ah(e,(a=t?.clientId,e=>{a&&n(a,e)}),t?.attributes),o(null)},onCancel:()=>{o(null)}})}const Zh=({clientId:e,currentMenuId:t,isLoading:o,isNavigationMenuMissing:n,onCreateNew:a})=>{const r=(0,it.useSelect)((t=>!!t(nt.store).getBlockCount(e)),[e]),{navigationMenu:i}=Lg(t);if(t&&n)return(0,Je.jsx)(Bh,{onCreateNew:a,isNotice:!0});if(o)return(0,Je.jsx)(tt.Spinner,{});const s=i?(0,ot.sprintf)((0,ot.__)("Structure for Navigation Menu: %s"),i?.title||(0,ot.__)("Untitled menu")):(0,ot.__)("You have not yet created any menus. Displaying a list of your Pages");return(0,Je.jsxs)("div",{className:"wp-block-navigation__menu-inspector-controls",children:[!r&&(0,Je.jsx)("p",{className:"wp-block-navigation__menu-inspector-controls__empty-message",children:(0,ot.__)("This Navigation Menu is empty.")}),(0,Je.jsx)(qh,{rootClientId:e,isExpanded:!0,description:s,showAppender:!0,blockSettingsMenu:Dh,additionalBlockContent:Wh})]})},Qh=e=>{const{createNavigationMenuIsSuccess:t,createNavigationMenuIsError:o,currentMenuId:n=null,onCreateNew:a,onSelectClassicMenu:r,onSelectNavigationMenu:i,isManageMenusButtonDisabled:s,blockEditingMode:l}=e;return(0,Je.jsx)(nt.InspectorControls,{group:"list",children:(0,Je.jsxs)(tt.PanelBody,{title:null,children:[(0,Je.jsxs)(tt.__experimentalHStack,{className:"wp-block-navigation-off-canvas-editor__header",children:[(0,Je.jsx)(tt.__experimentalHeading,{className:"wp-block-navigation-off-canvas-editor__title",level:2,children:(0,ot.__)("Menu")}),"default"===l&&(0,Je.jsx)(Og,{currentMenuId:n,onSelectClassicMenu:r,onSelectNavigationMenu:i,onCreateNew:a,createNavigationMenuIsSuccess:t,createNavigationMenuIsError:o,actionLabel:Gh,isManageMenusButtonDisabled:s})]}),(0,Je.jsx)(Zh,{...e})]})})};function Kh({id:e,children:t}){return(0,Je.jsx)(tt.VisuallyHidden,{children:(0,Je.jsx)("div",{id:e,className:"wp-block-navigation__description",children:t})})}function Yh({id:e}){const[t]=(0,ct.useEntityProp)("postType","wp_navigation","title"),o=(0,ot.sprintf)((0,ot.__)('Navigation Menu: "%s"'),t);return(0,Je.jsx)(Kh,{id:e,children:o})}function Jh({textColor:e,setTextColor:t,backgroundColor:o,setBackgroundColor:n,overlayTextColor:a,setOverlayTextColor:r,overlayBackgroundColor:i,setOverlayBackgroundColor:s,clientId:l,navRef:c}){const[u,d]=(0,st.useState)(),[p,m]=(0,st.useState)(),[g,h]=(0,st.useState)(),[x,_]=(0,st.useState)(),b="web"===st.Platform.OS;(0,st.useEffect)((()=>{if(!b)return;wh(c.current,m,d);const e=c.current?.querySelector('[data-type="core/navigation-submenu"] [data-type="core/navigation-link"]');e&&(a.color||i.color)&&wh(e,_,h)}),[b,a.color,i.color,c]);const y=(0,nt.__experimentalUseMultipleOriginColorsAndGradients)();return y.hasColorsOrGradients?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:e.color,label:(0,ot.__)("Text"),onColorChange:t,resetAllFilter:()=>t(),clearable:!0},{colorValue:o.color,label:(0,ot.__)("Background"),onColorChange:n,resetAllFilter:()=>n(),clearable:!0},{colorValue:a.color,label:(0,ot.__)("Submenu & overlay text"),onColorChange:r,resetAllFilter:()=>r(),clearable:!0},{colorValue:i.color,label:(0,ot.__)("Submenu & overlay background"),onColorChange:s,resetAllFilter:()=>s(),clearable:!0}],panelId:l,...y,gradients:[],disableCustomGradients:!0}),b&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.ContrastChecker,{backgroundColor:u,textColor:p}),(0,Je.jsx)(nt.ContrastChecker,{backgroundColor:g,textColor:x})]})]}):null}const Xh=(0,nt.withColors)({textColor:"color"},{backgroundColor:"color"},{overlayBackgroundColor:"color"},{overlayTextColor:"color"})((function({attributes:e,setAttributes:t,clientId:o,isSelected:n,className:a,backgroundColor:r,setBackgroundColor:i,textColor:s,setTextColor:l,overlayBackgroundColor:c,setOverlayBackgroundColor:u,overlayTextColor:d,setOverlayTextColor:p,hasSubmenuIndicatorSetting:m=!0,customPlaceholder:g=null,__unstableLayoutClassNames:h}){const{openSubmenusOnClick:x,overlayMenu:_,showSubmenuIcon:b,templateLock:y,layout:{justifyContent:f,orientation:v="horizontal",flexWrap:k="wrap"}={},hasIcon:w,icon:C="handle"}=e,j=e.ref,S=(0,st.useCallback)((e=>{t({ref:e})}),[t]),B=`navigationMenu/${j}`,T=(0,nt.useHasRecursion)(B),N=(0,nt.useBlockEditingMode)(),{menus:P}=Vg(),[I,M]=Xg({name:"block-library/core/navigation/status"}),[D,z]=Xg({name:"block-library/core/navigation/classic-menu-conversion"}),[A,R]=Xg({name:"block-library/core/navigation/permissions/update"}),{create:H,status:L,error:V,value:F,isPending:E,isSuccess:O,isError:$}=function(e){const[t,o]=(0,st.useState)(fh),[n,a]=(0,st.useState)(null),[r,i]=(0,st.useState)(null),{saveEntityRecord:s,editEntityRecord:l}=(0,it.useDispatch)(ct.store),c=xh(e),u=(0,st.useCallback)((async(e=null,t=[],n)=>{if(e&&"string"!=typeof e)throw i("Invalid title supplied when creating Navigation Menu."),o(bh),new Error("Value of supplied title argument was not a string.");o(yh),a(null),i(null),e||(e=await c().catch((e=>{throw i(e?.message),o(bh),new Error("Failed to create title when saving new Navigation Menu.",{cause:e})})));const r={title:e,content:(0,Ke.serialize)(t),status:n};return s("postType","wp_navigation",r).then((e=>(a(e),o(_h),"publish"!==n&&l("postType","wp_navigation",e.id,{status:"publish"}),e))).catch((e=>{throw i(e?.message),o(bh),new Error("Unable to save new Navigation Menu",{cause:e})}))}),[s,l,c]);return{create:u,status:t,value:n,error:r,isIdle:t===fh,isPending:t===yh,isSuccess:t===_h,isError:t===bh}}(o),G=async()=>{await H("")},{hasUncontrolledInnerBlocks:U,uncontrolledInnerBlocks:q,isInnerBlockSelected:W,innerBlocks:Z}=function(e){return(0,it.useSelect)((t=>{const{getBlock:o,getBlocks:n,hasSelectedInnerBlock:a}=t(nt.store),r=o(e).innerBlocks,i=!!r?.length,s=i?vh:n(e);return{innerBlocks:i?r:s,hasUncontrolledInnerBlocks:i,uncontrolledInnerBlocks:r,controlledInnerBlocks:s,isInnerBlockSelected:a(e,!0)}}),[e])}(o),Q=!!Z.find((e=>"core/navigation-submenu"===e.name)),{replaceInnerBlocks:K,selectBlock:Y,__unstableMarkNextChangeAsNotPersistent:J}=(0,it.useDispatch)(nt.store),[X,ee]=(0,st.useState)(!1),[te,oe]=(0,st.useState)(!1),{hasResolvedNavigationMenus:ne,isNavigationMenuResolved:ae,isNavigationMenuMissing:re,canUserUpdateNavigationMenu:ie,hasResolvedCanUserUpdateNavigationMenu:se,canUserDeleteNavigationMenu:le,hasResolvedCanUserDeleteNavigationMenu:ce,canUserCreateNavigationMenus:ue,isResolvingCanUserCreateNavigationMenus:de,hasResolvedCanUserCreateNavigationMenus:pe}=Lg(j),me=ne&&re,{convert:ge,status:he,error:xe}=sh(H),_e=he===rh,be=(0,st.useCallback)(((e,t={focusNavigationBlock:!1})=>{const{focusNavigationBlock:n}=t;S(e),n&&Y(o)}),[Y,o,S]),ye=!re&&ae,fe=U&&!ye,{getNavigationFallbackId:ve}=Ot((0,it.useSelect)(ct.store)),ke=j||fe?null:ve();(0,st.useEffect)((()=>{j||fe||!ke||(J(),S(ke))}),[j,S,fe,ke,J]);const we=(0,st.useRef)(),Ce="nav",je=!j&&!E&&!_e&&ne&&0===P?.length&&!U,Se=!ne||E||_e||!(!j||ye||_e),Be=e.style?.typography?.textDecoration,Te=(0,it.useSelect)((e=>e(nt.store).__unstableHasActiveBlockOverlayActive(o)),[o]),Ne="never"!==_,Pe=(0,nt.useBlockProps)({ref:we,className:ft(a,{"items-justified-right":"right"===f,"items-justified-space-between":"space-between"===f,"items-justified-left":"left"===f,"items-justified-center":"center"===f,"is-vertical":"vertical"===v,"no-wrap":"nowrap"===k,"is-responsive":Ne,"has-text-color":!!s.color||!!s?.class,[(0,nt.getColorClassName)("color",s?.slug)]:!!s?.slug,"has-background":!!r.color||r.class,[(0,nt.getColorClassName)("background-color",r?.slug)]:!!r?.slug,[`has-text-decoration-${Be}`]:Be,"block-editor-block-content-overlay":Te},h),style:{color:!s?.slug&&s?.color,backgroundColor:!r?.slug&&r?.color}}),Ie=async e=>ge(e.id,e.name,"draft"),Me=e=>{be(e)};(0,st.useEffect)((()=>{M(),E&&(0,Ig.speak)((0,ot.__)("Creating Navigation Menu.")),O&&(be(F?.id,{focusNavigationBlock:!0}),I((0,ot.__)("Navigation Menu successfully created."))),$&&I((0,ot.__)("Failed to create Navigation Menu."))}),[L,V,F?.id,$,O,E,be,M,I]),(0,st.useEffect)((()=>{z(),he===rh&&(0,Ig.speak)((0,ot.__)("Classic menu importing.")),he===nh&&(D((0,ot.__)("Classic menu imported successfully.")),be(F?.id,{focusNavigationBlock:!0})),he===ah&&D((0,ot.__)("Classic menu import failed."))}),[he,xe,z,D,F?.id,be]),(0,st.useEffect)((()=>{n||W||R(),(n||W)&&(j&&!me&&se&&!ie&&A((0,ot.__)("You do not have permission to edit this Menu. Any changes made will not be saved.")),j||!pe||ue||A((0,ot.__)("You do not have permission to create Navigation Menus.")))}),[n,W,ie,se,ue,pe,j,R,A,me]);const De=ue||ie,ze=ft("wp-block-navigation__overlay-menu-preview",{open:te}),Ae=b||x?"":(0,ot.__)('The current menu options offer reduced accessibility for users and are not recommended. Enabling either "Open on Click" or "Show arrow" offers enhanced accessibility by allowing keyboard users to browse submenus selectively.'),Re=(0,st.useRef)(!0);(0,st.useEffect)((()=>{!Re.current&&Ae&&(0,Ig.speak)(Ae),Re.current=!1}),[Ae]);const He=(0,ut.useInstanceId)(eh,"overlay-menu-preview"),Le=(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:m&&(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Display"),children:[Ne&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(tt.Button,{__next40pxDefaultSize:!0,className:ze,onClick:()=>{oe(!te)},"aria-label":(0,ot.__)("Overlay menu controls"),"aria-controls":He,"aria-expanded":te,children:[w&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Ug,{icon:C}),(0,Je.jsx)(Mg,{icon:Dg})]}),!w&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("span",{children:(0,ot.__)("Menu")}),(0,Je.jsx)("span",{children:(0,ot.__)("Close")})]})]}),(0,Je.jsx)("div",{id:He,children:te&&(0,Je.jsx)(eh,{setAttributes:t,hasIcon:w,icon:C,hidden:!te})})]}),(0,Je.jsxs)(tt.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Overlay Menu"),"aria-label":(0,ot.__)("Configure overlay menu"),value:_,help:(0,ot.__)("Collapses the navigation options in a menu icon opening an overlay."),onChange:e=>t({overlayMenu:e}),isBlock:!0,children:[(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"never",label:(0,ot.__)("Off")}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"mobile",label:(0,ot.__)("Mobile")}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"always",label:(0,ot.__)("Always")})]}),Q&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("h3",{children:(0,ot.__)("Submenus")}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,checked:x,onChange:e=>{t({openSubmenusOnClick:e,...e&&{showSubmenuIcon:!0}})},label:(0,ot.__)("Open on click")}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,checked:b,onChange:e=>{t({showSubmenuIcon:e})},disabled:e.openSubmenusOnClick,label:(0,ot.__)("Show arrow")}),Ae&&(0,Je.jsx)("div",{children:(0,Je.jsx)(tt.Notice,{spokenMessage:null,status:"warning",isDismissible:!1,children:Ae})})]})]})}),(0,Je.jsx)(nt.InspectorControls,{group:"color",children:(0,Je.jsx)(Jh,{textColor:s,setTextColor:l,backgroundColor:r,setBackgroundColor:i,overlayTextColor:d,setOverlayTextColor:p,overlayBackgroundColor:c,setOverlayBackgroundColor:u,clientId:o,navRef:we})})]}),Ve=`${o}-desc`,Fe="always"===_,Ee=!De||!ne;if(fe&&!E)return(0,Je.jsxs)(Ce,{...Pe,"aria-describedby":je?void 0:Ve,children:[(0,Je.jsx)(Kh,{id:Ve,children:(0,ot.__)("Unsaved Navigation Menu.")}),(0,Je.jsx)(Qh,{clientId:o,createNavigationMenuIsSuccess:O,createNavigationMenuIsError:$,currentMenuId:j,isNavigationMenuMissing:re,isManageMenusButtonDisabled:Ee,onCreateNew:G,onSelectClassicMenu:Ie,onSelectNavigationMenu:Me,isLoading:Se,blockEditingMode:N}),"default"===N&&Le,(0,Je.jsx)(qg,{id:o,onToggle:ee,isOpen:X,hasIcon:w,icon:C,isResponsive:Ne,isHiddenByDefault:Fe,overlayBackgroundColor:c,overlayTextColor:d,children:(0,Je.jsx)(Yg,{createNavigationMenu:H,blocks:q,hasSelection:n||W})})]});if(j&&re)return(0,Je.jsxs)(Ce,{...Pe,children:[(0,Je.jsx)(Qh,{clientId:o,createNavigationMenuIsSuccess:O,createNavigationMenuIsError:$,currentMenuId:j,isNavigationMenuMissing:re,isManageMenusButtonDisabled:Ee,onCreateNew:G,onSelectClassicMenu:Ie,onSelectNavigationMenu:Me,isLoading:Se,blockEditingMode:N}),(0,Je.jsx)(Bh,{onCreateNew:G})]});if(ye&&T)return(0,Je.jsx)("div",{...Pe,children:(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("Block cannot be rendered inside itself.")})});const Oe=g||$g;return je&&g?(0,Je.jsx)(Ce,{...Pe,children:(0,Je.jsx)(Oe,{isSelected:n,currentMenuId:j,clientId:o,canUserCreateNavigationMenus:ue,isResolvingCanUserCreateNavigationMenus:de,onSelectNavigationMenu:Me,onSelectClassicMenu:Ie,onCreateEmpty:G})}):(0,Je.jsx)(ct.EntityProvider,{kind:"postType",type:"wp_navigation",id:j,children:(0,Je.jsxs)(nt.RecursionProvider,{uniqueId:B,children:[(0,Je.jsx)(Qh,{clientId:o,createNavigationMenuIsSuccess:O,createNavigationMenuIsError:$,currentMenuId:j,isNavigationMenuMissing:re,isManageMenusButtonDisabled:Ee,onCreateNew:G,onSelectClassicMenu:Ie,onSelectNavigationMenu:Me,isLoading:Se,blockEditingMode:N}),"default"===N&&Le,"default"===N&&ye&&(0,Je.jsxs)(nt.InspectorControls,{group:"advanced",children:[se&&ie&&(0,Je.jsx)(Zg,{}),ce&&le&&(0,Je.jsx)(Jg,{onDelete:()=>{K(o,[]),I((0,ot.__)("Navigation Menu successfully deleted."))}}),(0,Je.jsx)(Sh,{disabled:Ee,className:"wp-block-navigation-manage-menus-button"})]}),(0,Je.jsxs)(Ce,{...Pe,"aria-describedby":je||Se?void 0:Ve,children:[Se&&!Fe&&(0,Je.jsx)("div",{className:"wp-block-navigation__loading-indicator-container",children:(0,Je.jsx)(tt.Spinner,{className:"wp-block-navigation__loading-indicator"})}),(!Se||Fe)&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Yh,{id:Ve}),(0,Je.jsx)(qg,{id:o,onToggle:ee,hasIcon:w,icon:C,isOpen:X,isResponsive:Ne,isHiddenByDefault:Fe,overlayBackgroundColor:c,overlayTextColor:d,children:ye&&(0,Je.jsx)(Wg,{clientId:o,hasCustomPlaceholder:!!g,templateLock:y,orientation:v})})]})]})]})})}));const ex={fontStyle:"var:preset|font-style|",fontWeight:"var:preset|font-weight|",textDecoration:"var:preset|text-decoration|",textTransform:"var:preset|text-transform|"},tx=({navigationMenuId:e,...t})=>({...t,ref:e}),ox=e=>{if(e.layout)return e;const{itemsJustification:t,orientation:o,...n}=e;return(t||o)&&Object.assign(n,{layout:{type:"flex",...t&&{justifyContent:t},...o&&{orientation:o}}}),n},nx={attributes:{navigationMenuId:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"mobile"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}}},save:()=>(0,Je.jsx)(nt.InnerBlocks.Content,{}),isEligible:({navigationMenuId:e})=>!!e,migrate:tx},ax={attributes:{navigationMenuId:{type:"number"},orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save:()=>(0,Je.jsx)(nt.InnerBlocks.Content,{}),isEligible:({itemsJustification:e,orientation:t})=>!!e||!!t,migrate:(0,ut.compose)(tx,ox)},rx={attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"never"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}}},save:()=>(0,Je.jsx)(nt.InnerBlocks.Content,{}),migrate:(0,ut.compose)(tx,ox,lo),isEligible:({style:e})=>e?.typography?.fontFamily},ix=[nx,ax,rx,{attributes:{orientation:{type:"string",default:"horizontal"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},isResponsive:{type:"boolean",default:"false"},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0}},isEligible:e=>e.isResponsive,migrate:(0,ut.compose)(tx,ox,lo,(function(e){return delete e.isResponsive,{...e,overlayMenu:"mobile"}})),save:()=>(0,Je.jsx)(nt.InnerBlocks.Content,{})},{attributes:{orientation:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0}},supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0,fontSize:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,color:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0},save:()=>(0,Je.jsx)(nt.InnerBlocks.Content,{}),isEligible(e){if(!e.style||!e.style.typography)return!1;for(const t in ex){const o=e.style.typography[t];if(o&&o.startsWith(ex[t]))return!0}return!1},migrate:(0,ut.compose)(tx,ox,lo,(function(e){var t;return{...e,style:{...e.style,typography:Object.fromEntries(Object.entries(null!==(t=e.style.typography)&&void 0!==t?t:{}).map((([e,t])=>{const o=ex[e];if(o&&t.startsWith(o)){const n=t.slice(o.length);return"textDecoration"===e&&"strikethrough"===n?[e,"line-through"]:[e,n]}return[e,t]})))}}}))},{attributes:{className:{type:"string"},textColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},fontSize:{type:"string"},customFontSize:{type:"number"},itemsJustification:{type:"string"},showSubmenuIcon:{type:"boolean"}},isEligible:e=>e.rgbTextColor||e.rgbBackgroundColor,supports:{align:["wide","full"],anchor:!0,html:!1,inserter:!0},migrate:(0,ut.compose)(tx,(e=>{const{rgbTextColor:t,rgbBackgroundColor:o,...n}=e;return{...n,customTextColor:e.textColor?void 0:e.rgbTextColor,customBackgroundColor:e.backgroundColor?void 0:e.rgbBackgroundColor}})),save:()=>(0,Je.jsx)(nt.InnerBlocks.Content,{})}],sx=ix,lx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation",title:"Navigation",category:"theme",allowedBlocks:["core/navigation-link","core/search","core/social-links","core/page-list","core/spacer","core/home-link","core/site-title","core/site-logo","core/navigation-submenu","core/loginout","core/buttons"],description:"A collection of blocks that allow visitors to get around your site.",keywords:["menu","navigation","links"],textdomain:"default",attributes:{ref:{type:"number"},textColor:{type:"string"},customTextColor:{type:"string"},rgbTextColor:{type:"string"},backgroundColor:{type:"string"},customBackgroundColor:{type:"string"},rgbBackgroundColor:{type:"string"},showSubmenuIcon:{type:"boolean",default:!0},openSubmenusOnClick:{type:"boolean",default:!1},overlayMenu:{type:"string",default:"mobile"},icon:{type:"string",default:"handle"},hasIcon:{type:"boolean",default:!0},__unstableLocation:{type:"string"},overlayBackgroundColor:{type:"string"},customOverlayBackgroundColor:{type:"string"},overlayTextColor:{type:"string"},customOverlayTextColor:{type:"string"},maxNestingLevel:{type:"number",default:5},templateLock:{type:["string","boolean"],enum:["all","insert","contentOnly",!1]}},providesContext:{textColor:"textColor",customTextColor:"customTextColor",backgroundColor:"backgroundColor",customBackgroundColor:"customBackgroundColor",overlayTextColor:"overlayTextColor",customOverlayTextColor:"customOverlayTextColor",overlayBackgroundColor:"overlayBackgroundColor",customOverlayBackgroundColor:"customOverlayBackgroundColor",fontSize:"fontSize",customFontSize:"customFontSize",showSubmenuIcon:"showSubmenuIcon",openSubmenusOnClick:"openSubmenusOnClick",style:"style",maxNestingLevel:"maxNestingLevel"},supports:{align:["wide","full"],ariaLabel:!0,html:!1,inserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalTextTransform:!0,__experimentalFontFamily:!0,__experimentalLetterSpacing:!0,__experimentalTextDecoration:!0,__experimentalSkipSerialization:["textDecoration"],__experimentalDefaultControls:{fontSize:!0}},spacing:{blockGap:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0}},layout:{allowSwitching:!1,allowInheriting:!1,allowVerticalAlignment:!1,allowSizingOnChildren:!0,default:{type:"flex"}},interactivity:!0,renaming:!1},editorStyle:"wp-block-navigation-editor",style:"wp-block-navigation"},{name:cx}=lx,ux={icon:Pg,example:{attributes:{overlayMenu:"never"},innerBlocks:[{name:"core/navigation-link",attributes:{label:(0,ot.__)("Home"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:(0,ot.__)("About"),url:"https://make.wordpress.org/"}},{name:"core/navigation-link",attributes:{label:(0,ot.__)("Contact"),url:"https://make.wordpress.org/"}}]},edit:Xh,save:function({attributes:e}){if(!e.ref)return(0,Je.jsx)(nt.InnerBlocks.Content,{})},__experimentalLabel:({ref:e})=>{if(!e)return;const t=(0,it.select)(ct.store).getEditedEntityRecord("postType","wp_navigation",e);return t?.title?(0,tn.decodeEntities)(t.title):void 0},deprecated:sx},dx=()=>et({name:cx,metadata:lx,settings:ux}),px={name:"core/navigation-link"};function mx({attributes:e,setAttributes:t,setIsLabelFieldFocused:o}){const{label:n,url:a,description:r,title:i,rel:s}=e;return(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!n,label:(0,ot.__)("Text"),onDeselect:()=>t({label:""}),isShownByDefault:!0,children:(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Text"),value:n?(0,xc.__unstableStripHTML)(n):"",onChange:e=>{t({label:e})},autoComplete:"off",onFocus:()=>o(!0),onBlur:()=>o(!1)})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!a,label:(0,ot.__)("Link"),onDeselect:()=>t({url:""}),isShownByDefault:!0,children:(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Link"),value:a?(0,vt.safeDecodeURI)(a):"",onChange:o=>{Ah({url:o},t,e)},autoComplete:"off",type:"url"})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!r,label:(0,ot.__)("Description"),onDeselect:()=>t({description:""}),isShownByDefault:!0,children:(0,Je.jsx)(tt.TextareaControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Description"),value:r||"",onChange:e=>{t({description:e})},help:(0,ot.__)("The description will be displayed in the menu if the current theme supports it.")})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!i,label:(0,ot.__)("Title attribute"),onDeselect:()=>t({title:""}),isShownByDefault:!0,children:(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Title attribute"),value:i||"",onChange:e=>{t({title:e})},autoComplete:"off",help:(0,ot.__)("Additional information to help clarify the purpose of the link.")})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!s,label:(0,ot.__)("Rel attribute"),onDeselect:()=>t({rel:""}),isShownByDefault:!0,children:(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Rel attribute"),value:s||"",onChange:e=>{t({rel:e})},autoComplete:"off",help:(0,ot.__)("The relationship of the linked URL as space-separated link types.")})})]})}const gx=(0,Je.jsxs)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(Ye.Path,{d:"M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"}),(0,Je.jsx)(Ye.Path,{d:"M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"})]}),hx=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})}),xx=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z"})});function _x(e){switch(e){case"post":return kp;case"page":return gx;case"tag":return hx;case"category":return en;default:return xx}}function bx(e,t){if("core/navigation-link"!==t)return e;if(e.variations){const t=(e,t)=>e.type===t.type,o=e.variations.map((e=>({...e,...!e.icon&&{icon:_x(e.name)},...!e.isActive&&{isActive:t}})));return{...e,variations:o}}return e}const yx={from:[{type:"block",blocks:["core/site-logo"],transform:()=>(0,Ke.createBlock)("core/navigation-link")},{type:"block",blocks:["core/spacer"],transform:()=>(0,Ke.createBlock)("core/navigation-link")},{type:"block",blocks:["core/home-link"],transform:()=>(0,Ke.createBlock)("core/navigation-link")},{type:"block",blocks:["core/social-links"],transform:()=>(0,Ke.createBlock)("core/navigation-link")},{type:"block",blocks:["core/search"],transform:()=>(0,Ke.createBlock)("core/navigation-link")},{type:"block",blocks:["core/page-list"],transform:()=>(0,Ke.createBlock)("core/navigation-link")},{type:"block",blocks:["core/buttons"],transform:()=>(0,Ke.createBlock)("core/navigation-link")}],to:[{type:"block",blocks:["core/navigation-submenu"],transform:(e,t)=>(0,Ke.createBlock)("core/navigation-submenu",e,t)},{type:"block",blocks:["core/spacer"],transform:()=>(0,Ke.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],transform:()=>(0,Ke.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],transform:()=>(0,Ke.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],transform:()=>(0,Ke.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],transform:()=>(0,Ke.createBlock)("core/search",{showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"})},{type:"block",blocks:["core/page-list"],transform:()=>(0,Ke.createBlock)("core/page-list")},{type:"block",blocks:["core/buttons"],transform:({label:e,url:t,rel:o,title:n,opensInNewTab:a})=>(0,Ke.createBlock)("core/buttons",{},[(0,Ke.createBlock)("core/button",{text:e,url:t,rel:o,title:n,linkTarget:a?"_blank":void 0})])}]},fx=yx,vx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation-link",title:"Custom Link",category:"design",parent:["core/navigation"],allowedBlocks:["core/navigation-link","core/navigation-submenu","core/page-list"],description:"Add a page, link, or another item to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelLink:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","maxNestingLevel","style"],supports:{reusable:!1,html:!1,__experimentalSlashInserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},renaming:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-navigation-link-editor",style:"wp-block-navigation-link"},{name:kx}=vx,wx={icon:su,__experimentalLabel:({label:e})=>e,merge:(e,{label:t=""})=>({...e,label:e.label+t}),edit:function({attributes:e,isSelected:t,setAttributes:o,insertBlocksAfter:n,mergeBlocks:a,onReplace:r,context:i,clientId:s}){const{id:l,label:c,type:u,url:d,description:p,kind:m}=e,[g,h]=((e,t,o)=>{const n="post-type"===e||"post"===t||"page"===t,a=Number.isInteger(o),r=(0,it.useSelect)((e=>{if(!n)return null;const{getEntityRecord:a}=e(ct.store);return a("postType",t,o)?.status}),[n,t,o]);return[n&&a&&r&&"trash"===r,"draft"===r]})(m,u,l),{maxNestingLevel:x}=i,{replaceBlock:_,__unstableMarkNextChangeAsNotPersistent:b,selectBlock:y,selectPreviousBlock:f}=(0,it.useDispatch)(nt.store),[v,k]=(0,st.useState)(t&&!d),[w,C]=(0,st.useState)(null),[j,S]=(0,st.useState)(null),B=(0,st.useRef)(null),T=(e=>{const[t,o]=(0,st.useState)(!1);return(0,st.useEffect)((()=>{const{ownerDocument:t}=e.current;function n(e){r(e)}function a(){o(!1)}function r(t){e.current.contains(t.target)?o(!0):o(!1)}return t.addEventListener("dragstart",n),t.addEventListener("dragend",a),t.addEventListener("dragenter",r),()=>{t.removeEventListener("dragstart",n),t.removeEventListener("dragend",a),t.removeEventListener("dragenter",r)}}),[e]),t})(B),N=(0,ot.__)("Add label…"),P=(0,st.useRef)(),I=(0,st.useRef)(),M=(0,ut.usePrevious)(d),[D,z]=(0,st.useState)(!1),{isAtMaxNesting:A,isTopLevelLink:R,isParentOfSelectedBlock:H,hasChildren:L}=(0,it.useSelect)((e=>{const{getBlockCount:t,getBlockName:o,getBlockRootClientId:n,hasSelectedInnerBlock:a,getBlockParentsByBlockName:r}=e(nt.store);return{isAtMaxNesting:r(s,["core/navigation-link","core/navigation-submenu"]).length>=x,isTopLevelLink:"core/navigation"===o(n(s)),isParentOfSelectedBlock:a(s,!0),hasChildren:!!t(s)}}),[s,x]),{getBlocks:V}=(0,it.useSelect)(nt.store),F=()=>{let t=V(s);0===t.length&&(t=[(0,Ke.createBlock)("core/navigation-link")],y(t[0].clientId));const o=(0,Ke.createBlock)("core/navigation-submenu",e,t);_(s,o)};(0,st.useEffect)((()=>{L&&(b(),F())}),[L]),(0,st.useEffect)((()=>{!M&&d&&v&&(0,vt.isURL)((0,vt.prependHTTP)(c))&&/^.+\.[a-z]+/.test(c)&&function(){P.current.focus();const{ownerDocument:e}=P.current,{defaultView:t}=e,o=t.getSelection(),n=e.createRange();n.selectNodeContents(P.current),o.removeAllRanges(),o.addRange(n)}()}),[M,d,v,c]);const{textColor:E,customTextColor:O,backgroundColor:$,customBackgroundColor:G}=Ch(i,!R),U=(0,nt.useBlockProps)({ref:(0,ut.useMergeRefs)([S,B]),className:ft("wp-block-navigation-item",{"is-editing":t||H,"is-dragging-within":T,"has-link":!!d,"has-child":L,"has-text-color":!!E||!!O,[(0,nt.getColorClassName)("color",E)]:!!E,"has-background":!!$||G,[(0,nt.getColorClassName)("background-color",$)]:!!$}),style:{color:!E&&O,backgroundColor:!$&&G},onKeyDown:function(e){wo.isKeyboardEvent.primary(e,"k")&&(e.preventDefault(),e.stopPropagation(),k(!0),C(P.current))}}),q=(0,nt.useInnerBlocksProps)({...U,className:"remove-outline"},{defaultBlock:px,directInsert:!0,renderAppender:!1});(!d||g||h)&&(U.onClick=()=>{k(!0),C(P.current)});const W=ft("wp-block-navigation-item__content",{"wp-block-navigation-link__placeholder":!d||g||h}),Z=function(e){let t="";switch(e){case"post":t=(0,ot.__)("Select post");break;case"page":t=(0,ot.__)("Select page");break;case"category":t=(0,ot.__)("Select category");break;case"tag":t=(0,ot.__)("Select tag");break;default:t=(0,ot.__)("Add link")}return t}(u),Q=`(${g?(0,ot.__)("Invalid"):(0,ot.__)("Draft")})`;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsxs)(tt.ToolbarGroup,{children:[(0,Je.jsx)(tt.ToolbarButton,{name:"link",icon:Co,title:(0,ot.__)("Link"),shortcut:wo.displayShortcut.primary("k"),onClick:e=>{k(!0),C(e.currentTarget)}}),!A&&(0,Je.jsx)(tt.ToolbarButton,{name:"submenu",icon:Th,title:(0,ot.__)("Add submenu"),onClick:F})]})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(mx,{attributes:e,setAttributes:o,setIsLabelFieldFocused:z})}),(0,Je.jsxs)("div",{...U,children:[(0,Je.jsxs)("a",{className:W,children:[d?(0,Je.jsxs)(Je.Fragment,{children:[!g&&!h&&!D&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.RichText,{ref:P,identifier:"label",className:"wp-block-navigation-item__label",value:c,onChange:e=>o({label:e}),onMerge:a,onReplace:r,__unstableOnSplitAtEnd:()=>n((0,Ke.createBlock)("core/navigation-link")),"aria-label":(0,ot.__)("Navigation link text"),placeholder:N,withoutInteractiveFormatting:!0}),p&&(0,Je.jsx)("span",{className:"wp-block-navigation-item__description",children:p})]}),(g||h||D)&&(0,Je.jsx)("div",{className:ft("wp-block-navigation-link__placeholder-text","wp-block-navigation-link__label",{"is-invalid":g,"is-draft":h}),children:(0,Je.jsx)("span",{children:`${(0,tn.decodeEntities)(c)} ${g||h?Q:""}`.trim()})})]}):(0,Je.jsx)("div",{className:"wp-block-navigation-link__placeholder-text",children:(0,Je.jsx)("span",{children:Z})}),v&&(0,Je.jsx)(Oh,{ref:I,clientId:s,link:e,onClose:()=>{if(!d)return I.current.contains(window.document.activeElement)&&f(s,!0),void r([]);k(!1),w?(w.focus(),C(null)):P.current?P.current.focus():f(s,!0)},anchor:j,onRemove:function(){o({url:void 0,label:void 0,id:void 0,kind:void 0,type:void 0,opensInNewTab:!1}),k(!1)},onChange:t=>{Ah(t,o,e)}})]}),(0,Je.jsx)("div",{...q})]})]})},save:function(){return(0,Je.jsx)(nt.InnerBlocks.Content,{})},example:{attributes:{label:(0,ot._x)("Example Link","navigation link preview example"),url:"https://example.com"}},deprecated:[{isEligible:e=>e.nofollow,attributes:{label:{type:"string"},type:{type:"string"},nofollow:{type:"boolean"},description:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"}},migrate:({nofollow:e,...t})=>({rel:e?"nofollow":"",...t}),save:()=>(0,Je.jsx)(nt.InnerBlocks.Content,{})}],transforms:fx},Cx=()=>((0,Ns.addFilter)("blocks.registerBlockType","core/navigation-link",bx),et({name:kx,metadata:vx,settings:wx})),jx=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"m13.955 20.748 8-17.5-.91-.416L19.597 6H13.5v1.5h5.411l-1.6 3.5H13.5v1.5h3.126l-1.6 3.5H13.5l.028 1.5h.812l-1.295 2.832.91.416ZM17.675 16l-.686 1.5h4.539L21.5 16h-3.825Zm2.286-5-.686 1.5H21.5V11h-1.54ZM2 12c0 3.58 2.42 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.48 0-4.5-1.52-4.5-4S5.52 7.5 8 7.5h3.5V6H8c-3.58 0-6 2.42-6 6Z"})}),Sx=()=>(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:(0,Je.jsx)(tt.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"})}),Bx=["core/navigation-link","core/navigation-submenu","core/page-list"],Tx={name:"core/navigation-link"};const Nx={to:[{type:"block",blocks:["core/navigation-link"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:e=>(0,Ke.createBlock)("core/navigation-link",e)},{type:"block",blocks:["core/spacer"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Ke.createBlock)("core/spacer")},{type:"block",blocks:["core/site-logo"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Ke.createBlock)("core/site-logo")},{type:"block",blocks:["core/home-link"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Ke.createBlock)("core/home-link")},{type:"block",blocks:["core/social-links"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Ke.createBlock)("core/social-links")},{type:"block",blocks:["core/search"],isMatch:(e,t)=>0===t?.innerBlocks?.length,transform:()=>(0,Ke.createBlock)("core/search")}]},Px=Nx,Ix={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/navigation-submenu",title:"Submenu",category:"design",parent:["core/navigation"],description:"Add a submenu to your navigation.",textdomain:"default",attributes:{label:{type:"string"},type:{type:"string"},description:{type:"string"},rel:{type:"string"},id:{type:"number"},opensInNewTab:{type:"boolean",default:!1},url:{type:"string"},title:{type:"string"},kind:{type:"string"},isTopLevelItem:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","style"],supports:{reusable:!1,html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-navigation-submenu-editor",style:"wp-block-navigation-submenu"},{name:Mx}=Ix,Dx={icon:({context:e})=>"list-view"===e?gx:Th,__experimentalLabel(e,{context:t}){const{label:o}=e,n=e?.metadata?.name;return"list-view"===t&&(n||o)&&e?.metadata?.name||o},edit:function({attributes:e,isSelected:t,setAttributes:o,mergeBlocks:n,onReplace:a,context:r,clientId:i}){const{label:s,url:l,description:c,rel:u,title:d}=e,{showSubmenuIcon:p,maxNestingLevel:m,openSubmenusOnClick:g}=r,{__unstableMarkNextChangeAsNotPersistent:h,replaceBlock:x,selectBlock:_}=(0,it.useDispatch)(nt.store),[b,y]=(0,st.useState)(!1),[f,v]=(0,st.useState)(null),[k,w]=(0,st.useState)(null),C=(0,st.useRef)(null),j=(e=>{const[t,o]=(0,st.useState)(!1);return(0,st.useEffect)((()=>{const{ownerDocument:t}=e.current;function n(e){r(e)}function a(){o(!1)}function r(t){e.current.contains(t.target)?o(!0):o(!1)}return t.addEventListener("dragstart",n),t.addEventListener("dragend",a),t.addEventListener("dragenter",r),()=>{t.removeEventListener("dragstart",n),t.removeEventListener("dragend",a),t.removeEventListener("dragenter",r)}}),[]),t})(C),S=(0,ot.__)("Add text…"),B=(0,st.useRef)(),T=mt(),{parentCount:N,isParentOfSelectedBlock:P,isImmediateParentOfSelectedBlock:I,hasChildren:M,selectedBlockHasChildren:D,onlyDescendantIsEmptyLink:z}=(0,it.useSelect)((e=>{const{hasSelectedInnerBlock:t,getSelectedBlockClientId:o,getBlockParentsByBlockName:n,getBlock:a,getBlockCount:r,getBlockOrder:s}=e(nt.store);let l;const c=s(o());if(1===c?.length){const e=a(c[0]);l="core/navigation-link"===e?.name&&!e?.attributes?.label}return{parentCount:n(i,"core/navigation-submenu").length,isParentOfSelectedBlock:t(i,!0),isImmediateParentOfSelectedBlock:t(i,!1),hasChildren:!!r(i),selectedBlockHasChildren:!!c?.length,onlyDescendantIsEmptyLink:l}}),[i]),A=(0,ut.usePrevious)(M);(0,st.useEffect)((()=>{g||l||y(!0)}),[]),(0,st.useEffect)((()=>{t||y(!1)}),[t]),(0,st.useEffect)((()=>{b&&l&&(0,vt.isURL)((0,vt.prependHTTP)(s))&&/^.+\.[a-z]+/.test(s)&&function(){B.current.focus();const{ownerDocument:e}=B.current,{defaultView:t}=e,o=t.getSelection(),n=e.createRange();n.selectNodeContents(B.current),o.removeAllRanges(),o.addRange(n)}()}),[l]);const{textColor:R,customTextColor:H,backgroundColor:L,customBackgroundColor:V}=Ch(r,N>0),F=(0,nt.useBlockProps)({ref:(0,ut.useMergeRefs)([w,C]),className:ft("wp-block-navigation-item",{"is-editing":t||P,"is-dragging-within":j,"has-link":!!l,"has-child":M,"has-text-color":!!R||!!H,[(0,nt.getColorClassName)("color",R)]:!!R,"has-background":!!L||V,[(0,nt.getColorClassName)("background-color",L)]:!!L,"open-on-click":g}),style:{color:!R&&H,backgroundColor:!L&&V},onKeyDown:function(e){wo.isKeyboardEvent.primary(e,"k")&&(e.preventDefault(),e.stopPropagation(),y(!0),v(B.current))}}),E=Ch(r,!0),O=N>=m?Bx.filter((e=>"core/navigation-submenu"!==e)):Bx,$=jh(E),G=(0,nt.useInnerBlocksProps)($,{allowedBlocks:O,defaultBlock:Tx,directInsert:!0,__experimentalCaptureToolbars:!0,renderAppender:!!(t||I&&!D||M)&&nt.InnerBlocks.ButtonBlockAppender}),U=g?"button":"a";function q(){const t=(0,Ke.createBlock)("core/navigation-link",e);x(i,t)}(0,st.useEffect)((()=>{!M&&A&&(h(),q())}),[M,A]);const W=!D||z;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsxs)(tt.ToolbarGroup,{children:[!g&&(0,Je.jsx)(tt.ToolbarButton,{name:"link",icon:Co,title:(0,ot.__)("Link"),shortcut:wo.displayShortcut.primary("k"),onClick:e=>{y(!0),v(e.currentTarget)}}),(0,Je.jsx)(tt.ToolbarButton,{name:"revert",icon:jx,title:(0,ot.__)("Convert to Link"),onClick:q,className:"wp-block-navigation__submenu__revert",disabled:!W})]})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{o({label:"",url:"",description:"",title:"",rel:""})},dropdownMenuProps:T,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Text"),isShownByDefault:!0,hasValue:()=>!!s,onDeselect:()=>o({label:""}),children:(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:s||"",onChange:e=>{o({label:e})},label:(0,ot.__)("Text"),autoComplete:"off"})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Link"),isShownByDefault:!0,hasValue:()=>!!l,onDeselect:()=>o({url:""}),children:(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:l||"",onChange:e=>{o({url:e})},label:(0,ot.__)("Link"),autoComplete:"off",type:"url"})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Description"),isShownByDefault:!0,hasValue:()=>!!c,onDeselect:()=>o({description:""}),children:(0,Je.jsx)(tt.TextareaControl,{__nextHasNoMarginBottom:!0,value:c||"",onChange:e=>{o({description:e})},label:(0,ot.__)("Description"),help:(0,ot.__)("The description will be displayed in the menu if the current theme supports it.")})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Title attribute"),isShownByDefault:!0,hasValue:()=>!!d,onDeselect:()=>o({title:""}),children:(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:d||"",onChange:e=>{o({title:e})},label:(0,ot.__)("Title attribute"),autoComplete:"off",help:(0,ot.__)("Additional information to help clarify the purpose of the link.")})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Rel attribute"),isShownByDefault:!0,hasValue:()=>!!u,onDeselect:()=>o({rel:""}),children:(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,value:u||"",onChange:e=>{o({rel:e})},label:(0,ot.__)("Rel attribute"),autoComplete:"off",help:(0,ot.__)("The relationship of the linked URL as space-separated link types.")})})]})}),(0,Je.jsxs)("div",{...F,children:[(0,Je.jsxs)(U,{className:"wp-block-navigation-item__content",children:[(0,Je.jsx)(nt.RichText,{ref:B,identifier:"label",className:"wp-block-navigation-item__label",value:s,onChange:e=>o({label:e}),onMerge:n,onReplace:a,"aria-label":(0,ot.__)("Navigation link text"),placeholder:S,withoutInteractiveFormatting:!0,onClick:()=>{g||l||(y(!0),v(B.current))}}),c&&(0,Je.jsx)("span",{className:"wp-block-navigation-item__description",children:c}),!g&&b&&(0,Je.jsx)(Oh,{clientId:i,link:e,onClose:()=>{y(!1),f?(f.focus(),v(null)):_(i)},anchor:k,onRemove:()=>{o({url:""}),(0,Ig.speak)((0,ot.__)("Link removed."),"assertive")},onChange:t=>{Ah(t,o,e)}})]}),(p||g)&&(0,Je.jsx)("span",{className:"wp-block-navigation__submenu-icon",children:(0,Je.jsx)(Sx,{})}),(0,Je.jsx)("div",{...G})]})]})},example:{attributes:{label:(0,ot._x)("About","Example link text for Navigation Submenu"),type:"page"}},save:function(){return(0,Je.jsx)(nt.InnerBlocks.Content,{})},transforms:Px},zx=()=>et({name:Mx,metadata:Ix,settings:Dx}),Ax=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M17.5 9V6a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v3H8V6a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v3h1.5Zm0 6.5V18a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2v-2.5H8V18a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-2.5h1.5ZM4 13h16v-1.5H4V13Z"})});const Rx={from:[{type:"raw",schema:{"wp-block":{attributes:["data-block"]}},isMatch:e=>e.dataset&&"core/nextpage"===e.dataset.block,transform:()=>(0,Ke.createBlock)("core/nextpage",{})}]},Hx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/nextpage",title:"Page Break",category:"design",description:"Separate your content into a multi-page experience.",keywords:["next page","pagination"],parent:["core/post-content"],textdomain:"default",supports:{customClassName:!1,className:!1,html:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-nextpage-editor"},{name:Lx}=Hx,Vx={icon:Ax,example:{},transforms:Rx,edit:function(){return(0,Je.jsx)("div",{...(0,nt.useBlockProps)(),children:(0,Je.jsx)("span",{children:(0,ot.__)("Page break")})})},save:function(){return(0,Je.jsx)(st.RawHTML,{children:"\x3c!--nextpage--\x3e"})}},Fx=()=>et({name:Lx,metadata:Hx,settings:Vx}),Ex=new WeakMap;function Ox(){const e=(0,it.useRegistry)();if(!Ex.has(e)){const t=new Map;Ex.set(e,$x.bind(null,t))}return Ex.get(e)}function $x(e,{name:t,blocks:o}){const n=[...o];for(;n.length;){const o=n.shift();for(const e of null!==(a=o.innerBlocks)&&void 0!==a?a:[]){var a;n.unshift(e)}"core/pattern"===o.name&&Gx(e,t,o.attributes.slug)}}function Gx(e,t,o){if(e.has(t)||e.set(t,new Set),e.get(t).add(o),Ux(e,t))throw new TypeError(`Pattern ${t} has a circular dependency and cannot be rendered.`)}function Ux(e,t,o=new Set,n=new Set){var a;o.add(t),n.add(t);const r=null!==(a=e.get(t))&&void 0!==a?a:new Set;for(const t of r)if(o.has(t)){if(n.has(t))return!0}else if(Ux(e,t,o,n))return!0;return n.delete(t),!1}const qx=({attributes:e,clientId:t})=>{const o=(0,it.useRegistry)(),n=(0,it.useSelect)((t=>t(nt.store).__experimentalGetParsedPattern(e.slug)),[e.slug]),a=(0,it.useSelect)((e=>e(ct.store).getCurrentTheme()?.stylesheet),[]),{replaceBlocks:r,setBlockEditingMode:i,__unstableMarkNextChangeAsNotPersistent:s}=(0,it.useDispatch)(nt.store),{getBlockRootClientId:l,getBlockEditingMode:c}=(0,it.useSelect)(nt.store),[u,d]=(0,st.useState)(!1),p=Ox();(0,st.useEffect)((()=>{if(!u&&n?.blocks){try{p(n)}catch(e){return void d(!0)}window.queueMicrotask((()=>{const e=l(t),u=n.blocks.map((e=>(0,Ke.cloneBlock)(function(e){return e.innerBlocks.find((e=>"core/template-part"===e.name))&&(e.innerBlocks=e.innerBlocks.map((e=>("core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=a),e)))),"core/template-part"===e.name&&void 0===e.attributes.theme&&(e.attributes.theme=a),e}(e))));1===u.length&&n.categories?.length>0&&(u[0].attributes={...u[0].attributes,metadata:{...u[0].attributes.metadata,categories:n.categories,patternName:n.name,name:u[0].attributes.metadata.name||n.title}});const d=c(e);o.batch((()=>{s(),i(e,"default"),s(),r(t,u),s(),i(e,d)}))}))}}),[t,u,n,s,r,c,i,l]);const m=(0,nt.useBlockProps)();return u?(0,Je.jsx)("div",{...m,children:(0,Je.jsx)(nt.Warning,{children:(0,ot.sprintf)((0,ot.__)('Pattern "%s" cannot be rendered inside itself.'),n?.name)})}):(0,Je.jsx)("div",{...m})},Wx={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/pattern",title:"Pattern Placeholder",category:"theme",description:"Show a block pattern.",supports:{html:!1,inserter:!1,renaming:!1,interactivity:{clientNavigation:!0}},textdomain:"default",attributes:{slug:{type:"string"}}},{name:Zx}=Wx,Qx={edit:qx},Kx=()=>et({name:Zx,metadata:Wx,settings:Qx}),Yx=(0,Je.jsxs)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(Ye.Path,{d:"M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z"}),(0,Je.jsx)(Ye.Path,{d:"M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z"}),(0,Je.jsx)(Ye.Path,{d:"M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z"})]});function Jx(e,t){for(const o of e){if(o.attributes.id===t)return o;if(o.innerBlocks&&o.innerBlocks.length){const e=Jx(o.innerBlocks,t);if(e)return e}}return null}function Xx(e=[],t=null){let o=function(e=[]){const t={},o=[];return e.forEach((({id:e,title:n,link:a,type:r,parent:i})=>{var s;const l=null!==(s=t[e]?.innerBlocks)&&void 0!==s?s:[];t[e]=(0,Ke.createBlock)("core/navigation-link",{id:e,label:n.rendered,url:a,type:r,kind:"post-type"},l),i?(t[i]||(t[i]={innerBlocks:[]}),t[i].innerBlocks.push(t[e])):o.push(t[e])})),o}(e);if(t){const e=Jx(o,t);e&&e.innerBlocks&&(o=e.innerBlocks)}const n=e=>{e.forEach(((e,t,o)=>{const{attributes:a,innerBlocks:r}=e;if(0!==r.length){n(r);const e=(0,Ke.createBlock)("core/navigation-submenu",a,r);o[t]=e}}))};return n(o),o}function e_({clientId:e,pages:t,parentClientId:o,parentPageID:n}){const{replaceBlock:a,selectBlock:r}=(0,it.useDispatch)(nt.store);return()=>{const i=Xx(t,n);a(e,i),r(o)}}const t_=(0,ot.__)("This Navigation Menu displays your website's pages. Editing it will enable you to add, delete, or reorder pages. However, new pages will no longer be added automatically.");function o_({onClick:e,onClose:t,disabled:o}){return(0,Je.jsxs)(tt.Modal,{onRequestClose:t,title:(0,ot.__)("Edit Page List"),className:"wp-block-page-list-modal",aria:{describedby:(0,ut.useInstanceId)(o_,"wp-block-page-list-modal__description")},children:[(0,Je.jsx)("p",{id:(0,ut.useInstanceId)(o_,"wp-block-page-list-modal__description"),children:t_}),(0,Je.jsxs)("div",{className:"wp-block-page-list-modal-buttons",children:[(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:t,children:(0,ot.__)("Cancel")}),(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",accessibleWhenDisabled:!0,disabled:o,onClick:e,children:(0,ot.__)("Edit")})]})]})}const n_=()=>{};function a_({blockProps:e,innerBlocksProps:t,hasResolvedPages:o,blockList:n,pages:a,parentPageID:r}){if(!o)return(0,Je.jsx)("div",{...e,children:(0,Je.jsx)("div",{className:"wp-block-page-list__loading-indicator-container",children:(0,Je.jsx)(tt.Spinner,{className:"wp-block-page-list__loading-indicator"})})});if(null===a)return(0,Je.jsx)("div",{...e,children:(0,Je.jsx)(tt.Notice,{status:"warning",isDismissible:!1,children:(0,ot.__)("Page List: Cannot retrieve Pages.")})});if(0===a.length)return(0,Je.jsx)("div",{...e,children:(0,Je.jsx)(tt.Notice,{status:"info",isDismissible:!1,children:(0,ot.__)("Page List: Cannot retrieve Pages.")})});if(0===n.length){const t=a.find((e=>e.id===r));return t?.title?.rendered?(0,Je.jsx)("div",{...e,children:(0,Je.jsx)(nt.Warning,{children:(0,ot.sprintf)((0,ot.__)('Page List: "%s" page has no children.'),t.title.rendered)})}):(0,Je.jsx)("div",{...e,children:(0,Je.jsx)(tt.Notice,{status:"warning",isDismissible:!1,children:(0,ot.__)("Page List: Cannot retrieve Pages.")})})}return a.length>0?(0,Je.jsx)("ul",{...t}):void 0}const r_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/page-list",title:"Page List",category:"widgets",allowedBlocks:["core/page-list-item"],description:"Display a list of all pages.",keywords:["menu","navigation"],textdomain:"default",attributes:{parentPageID:{type:"integer",default:0},isNested:{type:"boolean",default:!1}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style","openSubmenusOnClick"],supports:{reusable:!1,html:!1,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},color:{text:!0,background:!0,link:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},spacing:{padding:!0,margin:!0,__experimentalDefaultControls:{padding:!1,margin:!1}}},editorStyle:"wp-block-page-list-editor",style:"wp-block-page-list"},{name:i_}=r_,s_={icon:Yx,example:{},edit:function({context:e,clientId:t,attributes:o,setAttributes:n}){const{parentPageID:a}=o,[r,i]=(0,st.useState)(!1),s=(0,st.useCallback)((()=>i(!0)),[]),l=mt(),{records:c,hasResolved:u}=(0,ct.useEntityRecords)("postType","page",{per_page:100,_fields:["id","link","menu_order","parent","title","type"],orderby:"menu_order",order:"asc"}),d="showSubmenuIcon"in e&&c?.length>0&&c?.length<=100,p=(0,st.useMemo)((()=>{if(null===c)return new Map;const e=c.sort(((e,t)=>e.menu_order===t.menu_order?e.title.rendered.localeCompare(t.title.rendered):e.menu_order-t.menu_order));return e.reduce(((e,t)=>{const{parent:o}=t;return e.has(o)?e.get(o).push(t):e.set(o,[t]),e}),new Map)}),[c]),m=(0,nt.useBlockProps)({className:ft("wp-block-page-list",{"has-text-color":!!e.textColor,[(0,nt.getColorClassName)("color",e.textColor)]:!!e.textColor,"has-background":!!e.backgroundColor,[(0,nt.getColorClassName)("background-color",e.backgroundColor)]:!!e.backgroundColor}),style:{...e.style?.color}}),g=(0,st.useMemo)((function e(t=0,o=0){const n=p.get(t);return n?.length?n.reduce(((t,n)=>{const a=p.has(n.id),r={value:n.id,label:"— ".repeat(o)+n.title.rendered,rawName:n.title.rendered};return t.push(r),a&&t.push(...e(n.id,o+1)),t}),[]):[]}),[p]),h=(0,st.useMemo)((function e(t=a){const o=p.get(t);return o?.length?o.reduce(((t,o)=>{const n=p.has(o.id),a={id:o.id,label:""!==o.title?.rendered?.trim()?o.title?.rendered:(0,ot.__)("(no title)"),title:""!==o.title?.rendered?.trim()?o.title?.rendered:(0,ot.__)("(no title)"),link:o.url,hasChildren:n};let r=null;const i=e(o.id);return r=(0,Ke.createBlock)("core/page-list-item",a,i),t.push(r),t}),[]):[]}),[p,a]),{isNested:x,hasSelectedChild:_,parentClientId:b,hasDraggedChild:y,isChildOfNavigation:f}=(0,it.useSelect)((e=>{const{getBlockParentsByBlockName:o,hasSelectedInnerBlock:n,hasDraggedInnerBlock:a}=e(nt.store),r=o(t,"core/navigation-submenu",!0),i=o(t,"core/navigation",!0);return{isNested:r.length>0,isChildOfNavigation:i.length>0,hasSelectedChild:n(t,!0),hasDraggedChild:a(t,!0),parentClientId:i[0]}}),[t]),v=e_({clientId:t,pages:c,parentClientId:b,parentPageID:a}),k=(0,nt.useInnerBlocksProps)(m,{renderAppender:!1,__unstableDisableDropZone:!0,templateLock:!f&&"all",onInput:n_,onChange:n_,value:h}),{selectBlock:w}=(0,it.useDispatch)(nt.store);return(0,st.useEffect)((()=>{(_||y)&&(s(),w(b))}),[_,y,b,w,s]),(0,st.useEffect)((()=>{n({isNested:x})}),[x,n]),(0,Je.jsxs)(Je.Fragment,{children:[(g.length>0||d)&&(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{n({parentPageID:0})},dropdownMenuProps:l,children:[g.length>0&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Parent Page"),hasValue:()=>0!==a,onDeselect:()=>n({parentPageID:0}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ComboboxControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,className:"editor-page-attributes__parent",label:(0,ot.__)("Parent"),value:a,options:g,onChange:e=>n({parentPageID:null!=e?e:0}),help:(0,ot.__)("Choose a page to show only its subpages.")})}),d&&(0,Je.jsxs)("div",{style:{gridColumn:"1 / -1"},children:[(0,Je.jsx)("p",{children:t_}),(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",accessibleWhenDisabled:!0,disabled:!u,onClick:v,children:(0,ot.__)("Edit")})]})]})}),d&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(tt.ToolbarButton,{title:(0,ot.__)("Edit"),onClick:s,children:(0,ot.__)("Edit")})}),r&&(0,Je.jsx)(o_,{onClick:v,onClose:()=>i(!1),disabled:!u})]}),(0,Je.jsx)(a_,{blockProps:m,innerBlocksProps:k,hasResolvedPages:u,blockList:h,pages:c,parentPageID:a})]})}},l_=()=>et({name:i_,metadata:r_,settings:s_}),c_=()=>(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:(0,Je.jsx)(tt.Path,{d:"M1.50002 4L6.00002 8L10.5 4",strokeWidth:"1.5"})});const u_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/page-list-item",title:"Page List Item",category:"widgets",parent:["core/page-list"],description:"Displays a page inside a list of all pages.",keywords:["page","menu","navigation"],textdomain:"default",attributes:{id:{type:"number"},label:{type:"string"},title:{type:"string"},link:{type:"string"},hasChildren:{type:"boolean"}},usesContext:["textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","fontSize","customFontSize","showSubmenuIcon","style","openSubmenusOnClick"],supports:{reusable:!1,html:!1,lock:!1,inserter:!1,__experimentalToolbar:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-page-list-editor",style:"wp-block-page-list"},{name:d_}=u_,p_={__experimentalLabel:({label:e})=>e,icon:gx,example:{},edit:function({context:e,attributes:t}){const{id:o,label:n,link:a,hasChildren:r,title:i}=t,s="showSubmenuIcon"in e,l=(0,it.useSelect)((e=>{if(!e(ct.store).canUser("read",{kind:"root",name:"site"}))return;const t=e(ct.store).getEntityRecord("root","site");return"page"===t?.show_on_front&&t?.page_on_front}),[]),c=jh(Ch(e,!0)),u=(0,nt.useBlockProps)(c,{className:"wp-block-pages-list__item"}),d=(0,nt.useInnerBlocksProps)(u);return(0,Je.jsxs)("li",{className:ft("wp-block-pages-list__item",{"has-child":r,"wp-block-navigation-item":s,"open-on-click":e.openSubmenusOnClick,"open-on-hover-click":!e.openSubmenusOnClick&&e.showSubmenuIcon,"menu-item-home":o===l}),children:[r&&e.openSubmenusOnClick?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("button",{type:"button",className:"wp-block-navigation-item__content wp-block-navigation-submenu__toggle","aria-expanded":"false",children:(0,tn.decodeEntities)(n)}),(0,Je.jsx)("span",{className:"wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon",children:(0,Je.jsx)(c_,{})})]}):(0,Je.jsx)("a",{className:ft("wp-block-pages-list__item__link",{"wp-block-navigation-item__content":s}),href:a,children:(0,tn.decodeEntities)(i)}),r&&(0,Je.jsxs)(Je.Fragment,{children:[!e.openSubmenusOnClick&&e.showSubmenuIcon&&(0,Je.jsx)("button",{className:"wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon","aria-expanded":"false",type:"button",children:(0,Je.jsx)(c_,{})}),(0,Je.jsx)("ul",{...d})]})]},o)}},m_=()=>et({name:d_,metadata:u_,settings:p_}),g_=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z"})}),h_={className:!1},x_={align:{type:"string"},content:{type:"string",source:"html",selector:"p",default:""},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},textColor:{type:"string"},backgroundColor:{type:"string"},fontSize:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]},style:{type:"object"}},__=e=>{if(!e.customTextColor&&!e.customBackgroundColor&&!e.customFontSize)return e;const t={};(e.customTextColor||e.customBackgroundColor)&&(t.color={}),e.customTextColor&&(t.color.text=e.customTextColor),e.customBackgroundColor&&(t.color.background=e.customBackgroundColor),e.customFontSize&&(t.typography={fontSize:e.customFontSize});const{customTextColor:o,customBackgroundColor:n,customFontSize:a,...r}=e;return{...r,style:t}},{style:b_,...y_}=x_,f_=[{supports:h_,attributes:{...y_,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},save({attributes:e}){const{align:t,content:o,dropCap:n,direction:a}=e,r=ft({"has-drop-cap":t!==((0,ot.isRTL)()?"left":"right")&&"center"!==t&&n,[`has-text-align-${t}`]:t});return(0,Je.jsx)("p",{...nt.useBlockProps.save({className:r,dir:a}),children:(0,Je.jsx)(nt.RichText.Content,{value:o})})}},{supports:h_,attributes:{...y_,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:__,save({attributes:e}){const{align:t,content:o,dropCap:n,backgroundColor:a,textColor:r,customBackgroundColor:i,customTextColor:s,fontSize:l,customFontSize:c,direction:u}=e,d=(0,nt.getColorClassName)("color",r),p=(0,nt.getColorClassName)("background-color",a),m=(0,nt.getFontSizeClass)(l),g=ft({"has-text-color":r||s,"has-background":a||i,"has-drop-cap":n,[`has-text-align-${t}`]:t,[m]:m,[d]:d,[p]:p}),h={backgroundColor:p?void 0:i,color:d?void 0:s,fontSize:m?void 0:c};return(0,Je.jsx)(nt.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:o,dir:u})}},{supports:h_,attributes:{...y_,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"}},migrate:__,save({attributes:e}){const{align:t,content:o,dropCap:n,backgroundColor:a,textColor:r,customBackgroundColor:i,customTextColor:s,fontSize:l,customFontSize:c,direction:u}=e,d=(0,nt.getColorClassName)("color",r),p=(0,nt.getColorClassName)("background-color",a),m=(0,nt.getFontSizeClass)(l),g=ft({"has-text-color":r||s,"has-background":a||i,"has-drop-cap":n,[m]:m,[d]:d,[p]:p}),h={backgroundColor:p?void 0:i,color:d?void 0:s,fontSize:m?void 0:c,textAlign:t};return(0,Je.jsx)(nt.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:o,dir:u})}},{supports:h_,attributes:{...y_,customTextColor:{type:"string"},customBackgroundColor:{type:"string"},customFontSize:{type:"number"},width:{type:"string"}},migrate:__,save({attributes:e}){const{width:t,align:o,content:n,dropCap:a,backgroundColor:r,textColor:i,customBackgroundColor:s,customTextColor:l,fontSize:c,customFontSize:u}=e,d=(0,nt.getColorClassName)("color",i),p=(0,nt.getColorClassName)("background-color",r),m=c&&`is-${c}-text`,g=ft({[`align${t}`]:t,"has-background":r||s,"has-drop-cap":a,[m]:m,[d]:d,[p]:p}),h={backgroundColor:p?void 0:s,color:d?void 0:l,fontSize:m?void 0:u,textAlign:o};return(0,Je.jsx)(nt.RichText.Content,{tagName:"p",style:h,className:g||void 0,value:n})}},{supports:h_,attributes:{...y_,fontSize:{type:"number"}},save({attributes:e}){const{width:t,align:o,content:n,dropCap:a,backgroundColor:r,textColor:i,fontSize:s}=e,l=ft({[`align${t}`]:t,"has-background":r,"has-drop-cap":a}),c={backgroundColor:r,color:i,fontSize:s,textAlign:o};return(0,Je.jsx)("p",{style:c,className:l||void 0,children:n})},migrate:e=>__({...e,customFontSize:Number.isFinite(e.fontSize)?e.fontSize:void 0,customTextColor:e.textColor&&"#"===e.textColor[0]?e.textColor:void 0,customBackgroundColor:e.backgroundColor&&"#"===e.backgroundColor[0]?e.backgroundColor:void 0})},{supports:h_,attributes:{...x_,content:{type:"string",source:"html",default:""}},save:({attributes:e})=>(0,Je.jsx)(st.RawHTML,{children:e.content}),migrate:e=>e}],v_=f_,k_=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z"})});function w_(e){const{batch:t}=(0,it.useRegistry)(),{moveBlocksToPosition:o,replaceInnerBlocks:n,duplicateBlocks:a,insertBlock:r}=(0,it.useDispatch)(nt.store),{getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:l,getBlockName:c,getBlock:u,getNextBlockClientId:d,canInsertBlockType:p}=(0,it.useSelect)(nt.store),m=(0,st.useRef)(e);return m.current=e,(0,ut.useRefEffect)((e=>{function g(e){if(e.defaultPrevented)return;if(e.keyCode!==wo.ENTER)return;const{content:g,clientId:h}=m.current;if(g.length)return;const x=i(h);if(!(0,Ke.hasBlockSupport)(c(x),"__experimentalOnEnter",!1))return;const _=l(x),b=_.indexOf(h);if(b===_.length-1){let t=x;for(;!p(c(h),i(t));)t=i(t);return void("string"==typeof t&&(e.preventDefault(),o([h],x,i(t),s(t)+1)))}const y=(0,Ke.getDefaultBlockName)();if(!p(y,i(x)))return;e.preventDefault();const f=u(x);t((()=>{a([x]);const e=s(x);n(x,f.innerBlocks.slice(0,b)),n(d(x),f.innerBlocks.slice(b+1)),r((0,Ke.createBlock)(y),e+1,i(x),!0)}))}return e.addEventListener("keydown",g),()=>{e.removeEventListener("keydown",g)}}),[])}function C_({direction:e,setDirection:t}){return(0,ot.isRTL)()&&(0,Je.jsx)(tt.ToolbarButton,{icon:k_,title:(0,ot._x)("Left to right","editor button"),isActive:"ltr"===e,onClick:()=>{t("ltr"===e?void 0:"ltr")}})}function j_(e){return e===((0,ot.isRTL)()?"left":"right")||"center"===e}function S_({clientId:e,attributes:t,setAttributes:o,name:n}){const[a]=(0,nt.useSettings)("typography.dropCap");if(!a)return null;const{align:r,dropCap:i}=t;let s;s=j_(r)?(0,ot.__)("Not available for aligned text."):i?(0,ot.__)("Showing large initial letter."):(0,ot.__)("Show a large initial letter.");const l=(0,Ke.getBlockSupport)(n,"typography.defaultControls.dropCap",!1);return(0,Je.jsx)(nt.InspectorControls,{group:"typography",children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!i,label:(0,ot.__)("Drop cap"),isShownByDefault:l,onDeselect:()=>o({dropCap:void 0}),resetAllFilter:()=>({dropCap:void 0}),panelId:e,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Drop cap"),checked:!!i,onChange:()=>o({dropCap:!i}),help:s,disabled:j_(r)})})})}const B_=function({attributes:e,mergeBlocks:t,onReplace:o,onRemove:n,setAttributes:a,clientId:r,isSelected:i,name:s}){const{align:l,content:c,direction:u,dropCap:d,placeholder:p}=e,m=(0,nt.useBlockProps)({ref:w_({clientId:r,content:c}),className:ft({"has-drop-cap":!j_(l)&&d,[`has-text-align-${l}`]:l}),style:{direction:u}}),g=(0,nt.useBlockEditingMode)();return(0,Je.jsxs)(Je.Fragment,{children:["default"===g&&(0,Je.jsxs)(nt.BlockControls,{group:"block",children:[(0,Je.jsx)(nt.AlignmentControl,{value:l,onChange:e=>a({align:e,dropCap:!j_(e)&&d})}),(0,Je.jsx)(C_,{direction:u,setDirection:e=>a({direction:e})})]}),i&&(0,Je.jsx)(S_,{name:s,clientId:r,attributes:e,setAttributes:a}),(0,Je.jsx)(nt.RichText,{identifier:"content",tagName:"p",...m,value:c,onChange:e=>a({content:e}),onMerge:t,onReplace:o,onRemove:n,"aria-label":nt.RichText.isEmpty(c)?(0,ot.__)("Empty block; start writing or type forward slash to choose a block"):(0,ot.__)("Block: Paragraph"),"data-empty":nt.RichText.isEmpty(c),placeholder:p||(0,ot.__)("Type / to choose a block"),"data-custom-placeholder":!!p||void 0,__unstableEmbedURLOnPaste:!0,__unstableAllowPrefixTransformations:!0})]})};const{name:T_}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"p",role:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{splitting:!0,anchor:!0,className:!1,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},N_={from:[{type:"raw",priority:20,selector:"p",schema:({phrasingContentSchema:e,isPaste:t})=>({p:{children:e,attributes:t?[]:["style","id"]}}),transform(e){const t=(0,Ke.getBlockAttributes)(T_,e.outerHTML),{textAlign:o}=e.style||{};return"left"!==o&&"center"!==o&&"right"!==o||(t.align=o),(0,Ke.createBlock)(T_,t)}}]},P_=N_,I_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/paragraph",title:"Paragraph",category:"text",description:"Start with the basic building block of all narrative.",keywords:["text"],textdomain:"default",attributes:{align:{type:"string"},content:{type:"rich-text",source:"rich-text",selector:"p",role:"content"},dropCap:{type:"boolean",default:!1},placeholder:{type:"string"},direction:{type:"string",enum:["ltr","rtl"]}},supports:{splitting:!0,anchor:!0,className:!1,__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalSelector:"p",__unstablePasteTextInline:!0,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-paragraph-editor",style:"wp-block-paragraph"},{name:M_}=I_,D_={icon:g_,example:{attributes:{content:(0,ot.__)("In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.")}},__experimentalLabel(e,{context:t}){const o=e?.metadata?.name;if("list-view"===t&&o)return o;if("accessibility"===t){if(o)return o;const{content:t}=e;return t&&0!==t.length?t:(0,ot.__)("Empty")}},transforms:P_,deprecated:v_,merge:(e,t)=>({content:(e.content||"")+(t.content||"")}),edit:B_,save:function({attributes:e}){const{align:t,content:o,dropCap:n,direction:a}=e,r=ft({"has-drop-cap":t!==((0,ot.isRTL)()?"left":"right")&&"center"!==t&&n,[`has-text-align-${t}`]:t});return(0,Je.jsx)("p",{...nt.useBlockProps.save({className:r,dir:a}),children:(0,Je.jsx)(nt.RichText.Content,{value:o})})}},z_=()=>et({name:M_,metadata:I_,settings:D_}),A_=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",fillRule:"evenodd",clipRule:"evenodd"})}),R_={who:"authors",per_page:100};const H_=function({isSelected:e,context:{postType:t,postId:o,queryId:n},attributes:a,setAttributes:r}){const i=Number.isFinite(n),{authorId:s,authorDetails:l,authors:c,supportsAuthor:u}=(0,it.useSelect)((e=>{var n;const{getEditedEntityRecord:a,getUser:r,getUsers:i,getPostType:s}=e(ct.store),l=a("postType",t,o)?.author;return{authorId:l,authorDetails:l?r(l):null,authors:i(R_),supportsAuthor:null!==(n=s(t)?.supports?.author)&&void 0!==n&&n}}),[t,o]),{editEntityRecord:d}=(0,it.useDispatch)(ct.store),{textAlign:p,showAvatar:m,showBio:g,byline:h,isLink:x,linkTarget:_}=a,b=[],y=l?.name||(0,ot.__)("Post Author");l?.avatar_urls&&Object.keys(l.avatar_urls).forEach((e=>{b.push({value:e,label:`${e} x ${e}`})}));const f=(0,nt.useBlockProps)({className:ft({[`has-text-align-${p}`]:p})}),v=c?.length?c.map((({id:e,name:t})=>({value:e,label:t}))):[],k=e=>{d("postType",t,o,{author:e})},w=v.length>=25,C=!!o&&!i&&v.length>0;return u||void 0===t?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:(0,Je.jsxs)(tt.__experimentalVStack,{spacing:4,className:"wp-block-post-author__inspector-settings",children:[C&&(w&&(0,Je.jsx)(tt.ComboboxControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Author"),options:v,value:s,onChange:k,allowReset:!1})||(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Author"),value:s,options:v,onChange:k})),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show avatar"),checked:m,onChange:()=>r({showAvatar:!m})}),m&&(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Avatar size"),value:a.avatarSize,options:b,onChange:e=>{r({avatarSize:Number(e)})}}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show bio"),checked:g,onChange:()=>r({showBio:!g})}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link author name to author page"),checked:x,onChange:()=>r({isLink:!x})}),x&&(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open in new tab"),onChange:e=>r({linkTarget:e?"_blank":"_self"}),checked:"_blank"===_})]})})}),(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:p,onChange:e=>{r({textAlign:e})}})}),(0,Je.jsxs)("div",{...f,children:[m&&l?.avatar_urls&&(0,Je.jsx)("div",{className:"wp-block-post-author__avatar",children:(0,Je.jsx)("img",{width:a.avatarSize,src:l.avatar_urls[a.avatarSize],alt:l.name})}),(0,Je.jsxs)("div",{className:"wp-block-post-author__content",children:[(!nt.RichText.isEmpty(h)||e)&&(0,Je.jsx)(nt.RichText,{identifier:"byline",className:"wp-block-post-author__byline","aria-label":(0,ot.__)("Post author byline text"),placeholder:(0,ot.__)("Write byline…"),value:h,onChange:e=>r({byline:e})}),(0,Je.jsx)("p",{className:"wp-block-post-author__name",children:x?(0,Je.jsx)("a",{href:"#post-author-pseudo-link",onClick:e=>e.preventDefault(),children:y}):y}),g&&(0,Je.jsx)("p",{className:"wp-block-post-author__bio",dangerouslySetInnerHTML:{__html:l?.description}})]})]})]}):(0,Je.jsx)("div",{...f,children:(0,ot.sprintf)((0,ot.__)("This post type (%s) does not support the author."),t)})},L_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author",title:"Author",category:"theme",description:"Display post author details such as name, avatar, and bio.",textdomain:"default",attributes:{textAlign:{type:"string"},avatarSize:{type:"number",default:48},showAvatar:{type:"boolean",default:!0},showBio:{type:"boolean"},byline:{type:"string"},isLink:{type:"boolean",default:!1,role:"content"},linkTarget:{type:"string",default:"_self",role:"content"}},usesContext:["postType","postId","queryId"],supports:{html:!1,spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,link:!0,__experimentalDuotone:".wp-block-post-author__avatar img",__experimentalDefaultControls:{background:!0,text:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-post-author-editor",style:"wp-block-post-author"},{name:V_}=L_,F_={icon:A_,example:{viewportWidth:350,attributes:{showBio:!0,byline:(0,ot.__)("Posted by")}},edit:H_},E_=()=>et({name:V_,metadata:L_,settings:F_});const O_=function({context:{postType:e,postId:t},attributes:{textAlign:o,isLink:n,linkTarget:a},setAttributes:r}){const{authorName:i,supportsAuthor:s}=(0,it.useSelect)((o=>{var n;const{getEditedEntityRecord:a,getUser:r,getPostType:i}=o(ct.store),s=a("postType",e,t)?.author;return{authorName:s?r(s):null,supportsAuthor:null!==(n=i(e)?.supports?.author)&&void 0!==n&&n}}),[e,t]),l=(0,nt.useBlockProps)({className:ft({[`has-text-align-${o}`]:o})}),c=i?.name||(0,ot.__)("Author Name"),u=n?(0,Je.jsx)("a",{href:"#author-pseudo-link",onClick:e=>e.preventDefault(),className:"wp-block-post-author-name__link",children:c}):c,d=mt();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:o,onChange:e=>{r({textAlign:e})}})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{r({isLink:!1,linkTarget:"_self"})},dropdownMenuProps:d,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Link to author archive"),isShownByDefault:!0,hasValue:()=>n,onDeselect:()=>r({isLink:!1}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link to author archive"),onChange:()=>r({isLink:!n}),checked:n})}),n&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Open in new tab"),isShownByDefault:!0,hasValue:()=>"_self"!==a,onDeselect:()=>r({linkTarget:"_self"}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open in new tab"),onChange:e=>r({linkTarget:e?"_blank":"_self"}),checked:"_blank"===a})})]})}),(0,Je.jsx)("div",{...l,children:s||void 0===e?u:(0,ot.sprintf)((0,ot.__)("This post type (%s) does not support the author."),e)})]})},$_={from:[{type:"block",blocks:["core/post-author"],transform:({textAlign:e})=>(0,Ke.createBlock)("core/post-author-name",{textAlign:e})}],to:[{type:"block",blocks:["core/post-author"],transform:({textAlign:e})=>(0,Ke.createBlock)("core/post-author",{textAlign:e})}]},G_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author-name",title:"Author Name",category:"theme",description:"The author name.",textdomain:"default",attributes:{textAlign:{type:"string"},isLink:{type:"boolean",default:!1,role:"content"},linkTarget:{type:"string",default:"_self",role:"content"}},usesContext:["postType","postId"],example:{viewportWidth:350},supports:{html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-author-name"},{name:U_}=G_,q_={icon:A_,transforms:$_,edit:O_},W_=()=>et({name:U_,metadata:G_,settings:q_});const Z_=function({context:{postType:e,postId:t},attributes:{textAlign:o},setAttributes:n}){const{authorDetails:a}=(0,it.useSelect)((o=>{const{getEditedEntityRecord:n,getUser:a}=o(ct.store),r=n("postType",e,t)?.author;return{authorDetails:r?a(r):null}}),[e,t]),r=(0,nt.useBlockProps)({className:ft({[`has-text-align-${o}`]:o})}),i=a?.description||(0,ot.__)("Author Biography");return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:o,onChange:e=>{n({textAlign:e})}})}),(0,Je.jsx)("div",{...r,dangerouslySetInnerHTML:{__html:i}})]})},Q_={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-author-biography",title:"Author Biography",category:"theme",description:"The author biography.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postType","postId"],example:{viewportWidth:350},supports:{spacing:{margin:!0,padding:!0},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-author-biography"},{name:K_}=Q_,Y_={icon:A_,edit:Z_},J_=()=>et({name:K_,metadata:Q_,settings:Y_}),X_=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),eb=[["core/avatar"],["core/comment-author-name"],["core/comment-date"],["core/comment-content"],["core/comment-reply-link"],["core/comment-edit-link"]];const tb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/post-comment",title:"Comment (deprecated)",category:"theme",allowedBlocks:["core/avatar","core/comment-author-name","core/comment-content","core/comment-date","core/comment-edit-link","core/comment-reply-link"],description:"This block is deprecated. Please use the Comments block instead.",textdomain:"default",attributes:{commentId:{type:"number"}},providesContext:{commentId:"commentId"},supports:{html:!1,inserter:!1,interactivity:{clientNavigation:!0}}},{name:ob}=tb,nb={icon:_p,edit:function({attributes:{commentId:e},setAttributes:t}){const[o,n]=(0,st.useState)(e),a=(0,nt.useBlockProps)(),r=(0,nt.useInnerBlocksProps)(a,{template:eb});return e?(0,Je.jsx)("div",{...r}):(0,Je.jsx)("div",{...a,children:(0,Je.jsxs)(tt.Placeholder,{icon:X_,label:(0,ot._x)("Post Comment","block title"),instructions:(0,ot.__)("To show a comment, input the comment ID."),children:[(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:e,onChange:e=>n(parseInt(e))}),(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>{t({commentId:o})},children:(0,ot.__)("Save")})]})})},save:function(){const e=nt.useBlockProps.save(),t=nt.useInnerBlocksProps.save(e);return(0,Je.jsx)("div",{...t})}},ab=()=>et({name:ob,metadata:tb,settings:nb}),rb=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z"})});const ib={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/post-comments-count",title:"Comments Count",category:"theme",description:"Display a post's comments count.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId"],supports:{html:!1,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},interactivity:{clientNavigation:!0}},style:"wp-block-post-comments-count"},{name:sb}=ib,lb={icon:rb,edit:function({attributes:e,context:t,setAttributes:o}){const{textAlign:n}=e,{postId:a}=t,[r,i]=(0,st.useState)(),s=(0,nt.useBlockProps)({className:ft({[`has-text-align-${n}`]:n})});(0,st.useEffect)((()=>{if(!a)return;const e=a;tr()({path:(0,vt.addQueryArgs)("/wp/v2/comments",{post:a}),parse:!1}).then((t=>{e===a&&i(t.headers.get("X-WP-Total"))}))}),[a]);const l=a&&void 0!==r,c={...s.style,textDecoration:l?s.style?.textDecoration:void 0};return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:n,onChange:e=>{o({textAlign:e})}})}),(0,Je.jsx)("div",{...s,style:c,children:l?r:(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("Post Comments Count block: post not found.")})})]})}},cb=()=>et({name:sb,metadata:ib,settings:lb}),ub=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z"})});const db={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-comments-form",title:"Comments Form",category:"theme",description:"Display a post's comments form.",textdomain:"default",attributes:{textAlign:{type:"string"}},usesContext:["postId","postType"],supports:{html:!1,color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-post-comments-form-editor",style:["wp-block-post-comments-form","wp-block-buttons","wp-block-button"],example:{attributes:{textAlign:"center"}}},{name:pb}=db,mb={icon:ub,edit:function e({attributes:t,context:o,setAttributes:n}){const{textAlign:a}=t,{postId:r,postType:i}=o,s=(0,ut.useInstanceId)(e),l=(0,ot.sprintf)("comments-form-edit-%d-desc",s),c=(0,nt.useBlockProps)({className:ft({[`has-text-align-${a}`]:a}),"aria-describedby":l});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:a,onChange:e=>{n({textAlign:e})}})}),(0,Je.jsxs)("div",{...c,children:[(0,Je.jsx)(ua,{postId:r,postType:i}),(0,Je.jsx)(tt.VisuallyHidden,{id:l,children:(0,ot.__)("Comments form disabled in editor.")})]})]})}},gb=()=>et({name:pb,metadata:db,settings:mb});const hb=function({context:e,attributes:t,setAttributes:o}){const{textAlign:n}=t,{postType:a,postId:r}=e,[i,s]=(0,st.useState)(),l=(0,nt.useBlockProps)({className:ft({[`has-text-align-${n}`]:n})});(0,st.useEffect)((()=>{if(!r)return;const e=r;tr()({path:(0,vt.addQueryArgs)("/wp/v2/comments",{post:r}),parse:!1}).then((t=>{e===r&&s(t.headers.get("X-WP-Total"))}))}),[r]);const c=(0,it.useSelect)((e=>e(ct.store).getEditedEntityRecord("postType",a,r)),[a,r]);if(!c)return null;const{link:u}=c;let d;if(void 0!==i){const e=parseInt(i);d=0===e?(0,ot.__)("No comments"):(0,ot.sprintf)((0,ot._n)("%s comment","%s comments",e),e.toLocaleString())}return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:n,onChange:e=>{o({textAlign:e})}})}),(0,Je.jsx)("div",{...l,children:u&&void 0!==d?(0,Je.jsx)("a",{href:u+"#comments",onClick:e=>e.preventDefault(),children:d}):(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("Post Comments Link block: post not found.")})})]})},xb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:"fse",name:"core/post-comments-link",title:"Comments Link",category:"theme",description:"Displays the link to the current post comments.",textdomain:"default",usesContext:["postType","postId"],attributes:{textAlign:{type:"string"}},supports:{html:!1,color:{link:!0,text:!1,__experimentalDefaultControls:{background:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-comments-link"},{name:_b}=xb,bb={edit:hb,icon:rb},yb=()=>et({name:_b,metadata:xb,settings:bb}),fb=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z"})});function vb({parentLayout:e,layoutClassNames:t,userCanEdit:o,postType:n,postId:a}){const[,,r]=(0,ct.useEntityProp)("postType",n,"content",a),i=(0,nt.useBlockProps)({className:t}),s=(0,st.useMemo)((()=>r?.raw?(0,Ke.parse)(r.raw):[]),[r?.raw]),l=(0,nt.__experimentalUseBlockPreview)({blocks:s,props:i,layout:e});return o?(0,Je.jsx)("div",{...l}):r?.protected?(0,Je.jsx)("div",{...i,children:(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("This content is password protected.")})}):(0,Je.jsx)("div",{...i,dangerouslySetInnerHTML:{__html:r?.rendered}})}function kb({context:e={}}){const{postType:t,postId:o}=e,[n,a,r]=(0,ct.useEntityBlockEditor)("postType",t,{id:o}),i=(0,it.useSelect)((e=>e(ct.store).getEntityRecord("postType",t,o)),[t,o]),s=!!i?.content?.raw||n?.length,l=(0,nt.useInnerBlocksProps)((0,nt.useBlockProps)({className:"entry-content"}),{value:n,onInput:a,onChange:r,template:s?void 0:[["core/paragraph"]]});return(0,Je.jsx)("div",{...l})}function wb(e){const{context:{queryId:t,postType:o,postId:n}={},layoutClassNames:a}=e,r=dt("postType",o,n);if(void 0===r)return null;const i=Number.isFinite(t);return r&&!i?(0,Je.jsx)(kb,{...e}):(0,Je.jsx)(vb,{parentLayout:e.parentLayout,layoutClassNames:a,userCanEdit:r,postType:o,postId:n})}function Cb({layoutClassNames:e}){const t=(0,nt.useBlockProps)({className:e});return(0,Je.jsxs)("div",{...t,children:[(0,Je.jsx)("p",{children:(0,ot.__)("This is the Content block, it will display all the blocks in any single post or page.")}),(0,Je.jsx)("p",{children:(0,ot.__)("That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.")}),(0,Je.jsx)("p",{children:(0,ot.__)("If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well.")})]})}function jb(){const e=(0,nt.useBlockProps)();return(0,Je.jsx)("div",{...e,children:(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("Block cannot be rendered inside itself.")})})}const Sb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-content",title:"Content",category:"theme",description:"Displays the contents of a post or page.",textdomain:"default",usesContext:["postId","postType","queryId"],example:{viewportWidth:350},supports:{align:["wide","full"],html:!1,layout:!0,background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},dimensions:{minHeight:!0},spacing:{blockGap:!0,padding:!0,margin:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!1,text:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-content",editorStyle:"wp-block-post-content-editor"},{name:Bb}=Sb,Tb={icon:fb,edit:function({context:e,__unstableLayoutClassNames:t,__unstableParentLayout:o}){const{postId:n,postType:a}=e,r=(0,nt.useHasRecursion)(n);return n&&a&&r?(0,Je.jsx)(jb,{}):(0,Je.jsx)(nt.RecursionProvider,{uniqueId:n,children:n&&a?(0,Je.jsx)(wb,{context:e,parentLayout:o,layoutClassNames:t}):(0,Je.jsx)(Cb,{layoutClassNames:t})})}},Nb=()=>et({name:Bb,metadata:Sb,settings:Tb});function Pb(e){return/(?:^|[^\\])[aAgh]/.test(e)}const Ib={attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1}},supports:{html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:lo,isEligible:({style:e})=>e?.typography?.fontFamily},Mb=[Ib],Db=[{name:"post-date-modified",title:(0,ot.__)("Modified Date"),description:(0,ot.__)("Display a post's last updated date."),attributes:{displayType:"modified"},scope:["block","inserter"],isActive:e=>"modified"===e.displayType,icon:za}],zb=Db,Ab={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-date",title:"Date",category:"theme",description:"Display the publish date for an entry such as a post or page.",textdomain:"default",attributes:{textAlign:{type:"string"},format:{type:"string"},isLink:{type:"boolean",default:!1,role:"content"},displayType:{type:"string",default:"date"}},usesContext:["postId","postType","queryId"],example:{viewportWidth:350},supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}}},{name:Rb}=Ab,Hb={icon:za,edit:function({attributes:{textAlign:e,format:t,isLink:o,displayType:n},context:{postId:a,postType:r,queryId:i},setAttributes:s}){const l=(0,nt.useBlockProps)({className:ft({[`has-text-align-${e}`]:e,"wp-block-post-date__modified-date":"modified"===n})}),c=mt(),[u,d]=(0,st.useState)(null),p=(0,st.useMemo)((()=>({anchor:u})),[u]),m=Number.isFinite(i),g=(0,Aa.getSettings)(),[h=g.formats.date]=(0,ct.useEntityProp)("root","site","date_format"),[x=g.formats.time]=(0,ct.useEntityProp)("root","site","time_format"),[_,b]=(0,ct.useEntityProp)("postType",r,n,a),y=(0,it.useSelect)((e=>r?e(ct.store).getPostType(r):null),[r]),f="date"===n?(0,ot.__)("Post Date"):(0,ot.__)("Post Modified Date");let v=_?(0,Je.jsx)("time",{dateTime:(0,Aa.dateI18n)("c",_),ref:d,children:"human-diff"===t?(0,Aa.humanTimeDiff)(_):(0,Aa.dateI18n)(t||h,_)}):f;return o&&_&&(v=(0,Je.jsx)("a",{href:"#post-date-pseudo-link",onClick:e=>e.preventDefault(),children:v})),(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(nt.BlockControls,{group:"block",children:[(0,Je.jsx)(nt.AlignmentControl,{value:e,onChange:e=>{s({textAlign:e})}}),_&&"date"===n&&!m&&(0,Je.jsx)(tt.ToolbarGroup,{children:(0,Je.jsx)(tt.Dropdown,{popoverProps:p,renderContent:({onClose:e})=>(0,Je.jsx)(nt.__experimentalPublishDateTimePicker,{currentDate:_,onChange:b,is12Hour:Pb(x),onClose:e,dateOrder:(0,ot._x)("dmy","date order")}),renderToggle:({isOpen:e,onToggle:t})=>(0,Je.jsx)(tt.ToolbarButton,{"aria-expanded":e,icon:Ys,title:(0,ot.__)("Change Date"),onClick:t,onKeyDown:o=>{e||o.keyCode!==wo.DOWN||(o.preventDefault(),t())}})})})]}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{s({format:void 0,isLink:!1,displayType:"date"})},dropdownMenuProps:c,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:(0,ot.__)("Date Format"),onDeselect:()=>s({format:void 0}),isShownByDefault:!0,children:(0,Je.jsx)(nt.__experimentalDateFormatPicker,{format:t,defaultFormat:h,onChange:e=>s({format:e})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!1!==o,label:y?.labels.singular_name?(0,ot.sprintf)((0,ot.__)("Link to %s"),y.labels.singular_name.toLowerCase()):(0,ot.__)("Link to post"),onDeselect:()=>s({isLink:!1}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:y?.labels.singular_name?(0,ot.sprintf)((0,ot.__)("Link to %s"),y.labels.singular_name.toLowerCase()):(0,ot.__)("Link to post"),onChange:()=>s({isLink:!o}),checked:o})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>"date"!==n,label:(0,ot.__)("Display last modified date"),onDeselect:()=>s({displayType:"date"}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display last modified date"),onChange:e=>s({displayType:e?"modified":"date"}),checked:"modified"===n,help:(0,ot.__)("Only shows if the post has been modified")})})]})}),(0,Je.jsx)("div",{...l,children:v})]})},deprecated:Mb,variations:zb},Lb=()=>et({name:Rb,metadata:Ab,settings:Hb}),Vb=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M8.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H4v-3h4.001ZM4 20h9v-1.5H4V20Zm16-4H4v-1.5h16V16ZM13.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H9v-3h4.001Z"})});const Fb={from:[{type:"block",blocks:["core/post-content"],transform:()=>(0,Ke.createBlock)("core/post-excerpt")}],to:[{type:"block",blocks:["core/post-content"],transform:()=>(0,Ke.createBlock)("core/post-content")}]},Eb={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-excerpt",title:"Excerpt",category:"theme",description:"Display the excerpt.",textdomain:"default",attributes:{textAlign:{type:"string"},moreText:{type:"string"},showMoreOnNewLine:{type:"boolean",default:!0},excerptLength:{type:"number",default:55}},usesContext:["postId","postType","queryId"],example:{viewportWidth:350},supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-post-excerpt-editor",style:"wp-block-post-excerpt"},{name:Ob}=Eb,$b={icon:Vb,transforms:Fb,edit:function({attributes:{textAlign:e,moreText:t,showMoreOnNewLine:o,excerptLength:n},setAttributes:a,isSelected:r,context:{postId:i,postType:s,queryId:l}}){const c=Number.isFinite(l),u=dt("postType",s,i),[d,p,{rendered:m,protected:g}={}]=(0,ct.useEntityProp)("postType",s,"excerpt",i),h=mt(),x=(0,it.useSelect)((e=>"page"===s||!!e(ct.store).getPostType(s)?.supports?.excerpt),[s]),_=u&&!c&&x,b=(0,nt.useBlockProps)({className:ft({[`has-text-align-${e}`]:e})}),y=(0,ot._x)("words","Word count type. Do not translate!"),f=(0,st.useMemo)((()=>{if(!m)return"";const e=(new window.DOMParser).parseFromString(m,"text/html");return e.body.textContent||e.body.innerText||""}),[m]);if(!s||!i)return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(nt.AlignmentToolbar,{value:e,onChange:e=>a({textAlign:e})})}),(0,Je.jsx)("div",{...b,children:(0,Je.jsx)("p",{children:(0,ot.__)("This block will display the excerpt.")})})]});if(g&&!u)return(0,Je.jsx)("div",{...b,children:(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("The content is currently protected and does not have the available excerpt.")})});const v=(0,Je.jsx)(nt.RichText,{identifier:"moreText",className:"wp-block-post-excerpt__more-link",tagName:"a","aria-label":(0,ot.__)("“Read more” link text"),placeholder:(0,ot.__)('Add "read more" link text'),value:t,onChange:e=>a({moreText:e}),withoutInteractiveFormatting:!0}),k=ft("wp-block-post-excerpt__excerpt",{"is-inline":!o}),w=(d||f).trim();let C="";if("words"===y)C=w.split(" ",n).join(" ");else if("characters_excluding_spaces"===y){const e=w.split("",n).join(""),t=e.length-e.replaceAll(" ","").length;C=w.split("",n+t).join("")}else"characters_including_spaces"===y&&(C=w.split("",n).join(""));const j=C!==w,S=_?(0,Je.jsx)(nt.RichText,{className:k,"aria-label":(0,ot.__)("Excerpt text"),value:r?w:(j?C+"…":w)||(0,ot.__)("No excerpt found"),onChange:p,tagName:"p"}):(0,Je.jsx)("p",{className:k,children:j?C+"…":w||(0,ot.__)("No excerpt found")});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(nt.AlignmentToolbar,{value:e,onChange:e=>a({textAlign:e})})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{a({showMoreOnNewLine:!0,excerptLength:55})},dropdownMenuProps:h,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!0!==o,label:(0,ot.__)("Show link on new line"),onDeselect:()=>a({showMoreOnNewLine:!0}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show link on new line"),checked:o,onChange:e=>a({showMoreOnNewLine:e})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>55!==n,label:(0,ot.__)("Max number of words"),onDeselect:()=>a({excerptLength:55}),isShownByDefault:!0,children:(0,Je.jsx)(tt.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Max number of words"),value:n,onChange:e=>{a({excerptLength:e})},min:"10",max:"100"})})]})}),(0,Je.jsxs)("div",{...b,children:[S,!o&&" ",o?(0,Je.jsx)("p",{className:"wp-block-post-excerpt__more-text",children:v}):v]})]})}},Gb=()=>et({name:Ob,metadata:Eb,settings:$b}),Ub=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z"})}),qb=(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"cover",label:(0,ot._x)("Cover","Scale option for Image dimension control")}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"contain",label:(0,ot._x)("Contain","Scale option for Image dimension control")}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"fill",label:(0,ot._x)("Fill","Scale option for Image dimension control")})]}),Wb="cover",Zb={cover:(0,ot.__)("Image is scaled and cropped to fill the entire space without being distorted."),contain:(0,ot.__)("Image is scaled to fill the space without clipping nor distorting."),fill:(0,ot.__)("Image will be stretched and distorted to completely fill the space.")},Qb=({clientId:e,attributes:{aspectRatio:t,width:o,height:n,scale:a},setAttributes:r})=>{const[i,s,l,c]=(0,nt.useSettings)("spacing.units","dimensions.aspectRatios.default","dimensions.aspectRatios.theme","dimensions.defaultAspectRatios"),u=(0,tt.__experimentalUseCustomUnits)({availableUnits:i||["px","%","vw","em","rem"]}),d=(e,t)=>{const o=parseFloat(t);isNaN(o)&&t||r({[e]:o<0?"0":t})},p=(0,ot._x)("Scale","Image scaling options"),m=n||t&&"auto"!==t,g=l?.map((({name:e,ratio:t})=>({label:e,value:t}))),h=s?.map((({name:e,ratio:t})=>({label:e,value:t}))),x=[{label:(0,ot._x)("Original","Aspect ratio option for dimensions control"),value:"auto"},...c?h:[],...g||[]];return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!t,label:(0,ot.__)("Aspect ratio"),onDeselect:()=>r({aspectRatio:void 0}),resetAllFilter:()=>({aspectRatio:void 0}),isShownByDefault:!0,panelId:e,children:(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Aspect ratio"),value:t,options:x,onChange:e=>r({aspectRatio:e})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!n,label:(0,ot.__)("Height"),onDeselect:()=>r({height:void 0}),resetAllFilter:()=>({height:void 0}),isShownByDefault:!0,panelId:e,children:(0,Je.jsx)(tt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,ot.__)("Height"),labelPosition:"top",value:n||"",min:0,onChange:e=>d("height",e),units:u})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>!!o,label:(0,ot.__)("Width"),onDeselect:()=>r({width:void 0}),resetAllFilter:()=>({width:void 0}),isShownByDefault:!0,panelId:e,children:(0,Je.jsx)(tt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,ot.__)("Width"),labelPosition:"top",value:o||"",min:0,onChange:e=>d("width",e),units:u})}),m&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!a&&a!==Wb,label:p,onDeselect:()=>r({scale:Wb}),resetAllFilter:()=>({scale:Wb}),isShownByDefault:!0,panelId:e,children:(0,Je.jsx)(tt.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:p,value:a,help:Zb[a],onChange:e=>r({scale:e}),isBlock:!0,children:qb})})]})},Kb=(0,ut.compose)([(0,nt.withColors)({overlayColor:"background-color"})])((({clientId:e,attributes:t,setAttributes:o,overlayColor:n,setOverlayColor:a})=>{const{dimRatio:r}=t,{gradientValue:i,setGradient:s}=(0,nt.__experimentalUseGradient)(),l=(0,nt.__experimentalUseMultipleOriginColorsAndGradients)();return l.hasColorsOrGradients?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:n.color,gradientValue:i,label:(0,ot.__)("Overlay"),onColorChange:a,onGradientChange:s,isShownByDefault:!0,resetAllFilter:()=>({overlayColor:void 0,customOverlayColor:void 0,gradient:void 0,customGradient:void 0}),clearable:!0}],panelId:e,...l}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>void 0!==r,label:(0,ot.__)("Overlay opacity"),onDeselect:()=>o({dimRatio:0}),resetAllFilter:()=>({dimRatio:0}),isShownByDefault:!0,panelId:e,children:(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Overlay opacity"),value:r,onChange:e=>o({dimRatio:e}),min:0,max:100,step:10,required:!0,__next40pxDefaultSize:!0})})]}):null}));const Yb=(0,ut.compose)([(0,nt.withColors)({overlayColor:"background-color"})])((({attributes:e,overlayColor:t})=>{const{dimRatio:o}=e,{gradientClass:n,gradientValue:a}=(0,nt.__experimentalUseGradient)(),r=(0,nt.__experimentalUseMultipleOriginColorsAndGradients)(),i=(0,nt.__experimentalUseBorderProps)(e),s={backgroundColor:t.color,backgroundImage:a,...i.style};return r.hasColorsOrGradients&&o?(0,Je.jsx)("span",{"aria-hidden":"true",className:ft("wp-block-post-featured-image__overlay",(l=o,void 0===l?null:"has-background-dim-"+10*Math.round(l/10)),{[t.class]:t.class,"has-background-dim":void 0!==o,"has-background-gradient":a,[n]:n},i.className),style:s}):null;var l})),Jb=["image"],{ResolutionTool:Xb}=Ot(nt.privateApis);function ey({image:e,value:t,onChange:o}){const{imageSizes:n}=(0,it.useSelect)((e=>{const{getSettings:t}=e(nt.store);return{imageSizes:t().imageSizes}}),[]);if(!n?.length)return null;const a=n.filter((({slug:t})=>e?.media_details?.sizes?.[t]?.source_url)).map((({name:e,slug:t})=>({value:t,label:e})));return(0,Je.jsx)(Xb,{value:t,defaultValue:"full",options:a,onChange:o})}const ty={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-featured-image",title:"Featured Image",category:"theme",description:"Display a post's featured image.",textdomain:"default",attributes:{isLink:{type:"boolean",default:!1,role:"content"},aspectRatio:{type:"string"},width:{type:"string"},height:{type:"string"},scale:{type:"string",default:"cover"},sizeSlug:{type:"string"},rel:{type:"string",attribute:"rel",default:"",role:"content"},linkTarget:{type:"string",default:"_self",role:"content"},overlayColor:{type:"string"},customOverlayColor:{type:"string"},dimRatio:{type:"number",default:0},gradient:{type:"string"},customGradient:{type:"string"},useFirstImageFromPost:{type:"boolean",default:!1}},usesContext:["postId","postType","queryId"],example:{viewportWidth:350},supports:{align:["left","right","center","wide","full"],color:{text:!1,background:!1},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}},filter:{duotone:!0},shadow:{__experimentalSkipSerialization:!0},html:!1,spacing:{margin:!0,padding:!0},interactivity:{clientNavigation:!0}},selectors:{border:".wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay",shadow:".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder",filter:{duotone:".wp-block-post-featured-image img, .wp-block-post-featured-image .wp-block-post-featured-image__placeholder, .wp-block-post-featured-image .components-placeholder__illustration, .wp-block-post-featured-image .components-placeholder::before"}},editorStyle:"wp-block-post-featured-image-editor",style:"wp-block-post-featured-image"},{name:oy}=ty,ny={icon:Ub,edit:function({clientId:e,attributes:t,setAttributes:o,context:{postId:n,postType:a,queryId:r}}){const i=Number.isFinite(r),{isLink:s,aspectRatio:l,height:c,width:u,scale:d,sizeSlug:p,rel:m,linkTarget:g,useFirstImageFromPost:h}=t,[x,_]=(0,st.useState)(),[b,y]=(0,ct.useEntityProp)("postType",a,"featured_media",n),[f]=(0,ct.useEntityProp)("postType",a,"content",n),v=(0,st.useMemo)((()=>{if(b)return b;if(!h)return;const e=/<!--\s+wp:(?:core\/)?image\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*)?}\s+)?-->/.exec(f);return e?.groups?.attrs&&JSON.parse(e.groups.attrs)?.id}),[b,h,f]),{media:k,postType:w,postPermalink:C}=(0,it.useSelect)((e=>{const{getMedia:t,getPostType:o,getEditedEntityRecord:r}=e(ct.store);return{media:v&&t(v,{context:"view"}),postType:a&&o(a),postPermalink:r("postType",a,n)?.link}}),[v,a,n]),j=k?.media_details?.sizes?.[p]?.source_url||k?.source_url,S=(0,nt.useBlockProps)({style:{width:u,height:c,aspectRatio:l},className:ft({"is-transient":x})}),B=(0,nt.__experimentalUseBorderProps)(t),T=(0,nt.__experimentalGetShadowClassesAndStyles)(t),N=(0,nt.useBlockEditingMode)(),P=e=>(0,Je.jsx)(tt.Placeholder,{className:ft("block-editor-media-placeholder",B.className),withIllustration:!0,style:{height:!!l&&"100%",width:!!l&&"100%",...B.style,...T.style},children:e}),I=e=>{e?.id&&y(e.id),e?.url&&(0,lt.isBlobURL)(e.url)&&_(e.url)};(0,st.useEffect)((()=>{j&&x&&_()}),[j,x]);const{createErrorNotice:M}=(0,it.useDispatch)(Rt.store),D=e=>{M(e,{type:"snackbar"}),_()},z=mt(),A="default"===N&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{group:"color",children:(0,Je.jsx)(Kb,{attributes:t,setAttributes:o,clientId:e})}),(0,Je.jsx)(nt.InspectorControls,{group:"dimensions",children:(0,Je.jsx)(Qb,{clientId:e,attributes:t,setAttributes:o,media:k})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{o({isLink:!1,linkTarget:"_self",rel:""})},dropdownMenuProps:z,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:w?.labels.singular_name?(0,ot.sprintf)((0,ot.__)("Link to %s"),w.labels.singular_name):(0,ot.__)("Link to post"),isShownByDefault:!0,hasValue:()=>!!s,onDeselect:()=>o({isLink:!1}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:w?.labels.singular_name?(0,ot.sprintf)((0,ot.__)("Link to %s"),w.labels.singular_name):(0,ot.__)("Link to post"),onChange:()=>o({isLink:!s}),checked:s})}),s&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Open in new tab"),isShownByDefault:!0,hasValue:()=>"_self"!==g,onDeselect:()=>o({linkTarget:"_self"}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open in new tab"),onChange:e=>o({linkTarget:e?"_blank":"_self"}),checked:"_blank"===g})}),s&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Link rel"),isShownByDefault:!0,hasValue:()=>!!m,onDeselect:()=>o({rel:""}),children:(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link rel"),value:m,onChange:e=>o({rel:e})})}),(0,Je.jsx)(ey,{image:k,value:p,onChange:e=>o({sizeSlug:e})})]})})]});let R;if(!v&&(i||!n))return(0,Je.jsxs)(Je.Fragment,{children:[A,(0,Je.jsxs)("div",{...S,children:[s?(0,Je.jsx)("a",{href:C,target:g,children:P()}):P(),(0,Je.jsx)(Yb,{attributes:t,setAttributes:o,clientId:e})]})]});const H=(0,ot.__)("Add a featured image"),L={...B.style,...T.style,height:l?"100%":c,width:!!l&&"100%",objectFit:!(!c&&!l)&&d};return R=v||x?k||x?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("img",{className:B.className,src:x||j,alt:k&&k?.alt_text?(0,ot.sprintf)((0,ot.__)("Featured image: %s"),k.alt_text):(0,ot.__)("Featured image"),style:L}),x&&(0,Je.jsx)(tt.Spinner,{})]}):P():(0,Je.jsx)(nt.MediaPlaceholder,{onSelect:I,accept:"image/*",allowedTypes:Jb,onError:D,placeholder:P,mediaLibraryButton:({open:e})=>(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,icon:Jd,variant:"primary",label:H,showTooltip:!0,tooltipPosition:"top center",onClick:t=>{t.preventDefault(),e()}})}),(0,Je.jsxs)(Je.Fragment,{children:[!x&&A,!!k&&!i&&(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(nt.MediaReplaceFlow,{mediaId:v,mediaURL:j,allowedTypes:Jb,accept:"image/*",onSelect:I,onError:D,onReset:()=>y(0)})}),(0,Je.jsxs)("figure",{...S,children:[s?(0,Je.jsx)("a",{href:C,target:g,children:R}):R,(0,Je.jsx)(Yb,{attributes:t,setAttributes:o,clientId:e})]})]})}},ay=()=>et({name:oy,metadata:ty,settings:ny});const ry=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),iy=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})}),sy=[{isDefault:!0,name:"post-next",title:(0,ot.__)("Next Post"),description:(0,ot.__)("Displays the post link that follows the current post."),icon:ry,attributes:{type:"next"},scope:["inserter","transform"],example:{attributes:{label:(0,ot.__)("Next post"),arrow:"arrow"}}},{name:"post-previous",title:(0,ot.__)("Previous Post"),description:(0,ot.__)("Displays the post link that precedes the current post."),icon:iy,attributes:{type:"previous"},scope:["inserter","transform"],example:{attributes:{label:(0,ot.__)("Previous post"),arrow:"arrow"}}}];sy.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));const ly=sy,cy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-navigation-link",title:"Post Navigation Link",category:"theme",description:"Displays the next or previous post link that is adjacent to the current post.",textdomain:"default",attributes:{textAlign:{type:"string"},type:{type:"string",default:"next"},label:{type:"string"},showTitle:{type:"boolean",default:!1},linkLabel:{type:"boolean",default:!1},arrow:{type:"string",default:"none"},taxonomy:{type:"string",default:""}},usesContext:["postType"],supports:{reusable:!1,html:!1,color:{link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-post-navigation-link"},{name:uy}=cy,dy={edit:function({context:{postType:e},attributes:{type:t,label:o,showTitle:n,textAlign:a,linkLabel:r,arrow:i,taxonomy:s},setAttributes:l}){const c="next"===t;let u=c?(0,ot.__)("Next"):(0,ot.__)("Previous");const d={none:"",arrow:c?"→":"←",chevron:c?"»":"«"}[i];n&&(u=c?(0,ot.__)("Next: "):(0,ot.__)("Previous: "));const p=c?(0,ot.__)("Next post"):(0,ot.__)("Previous post"),m=(0,nt.useBlockProps)({className:ft({[`has-text-align-${a}`]:a})}),g=(0,it.useSelect)((t=>{const{getTaxonomies:o}=t(ct.store);return o({type:e,per_page:-1})}),[e]);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{children:[(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display the title as a link"),help:(0,ot.__)("If you have entered a custom label, it will be prepended before the title."),checked:!!n,onChange:()=>l({showTitle:!n})}),n&&(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Include the label as part of the link"),checked:!!r,onChange:()=>l({linkLabel:!r})}),(0,Je.jsxs)(tt.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Arrow"),value:i,onChange:e=>{l({arrow:e})},help:(0,ot.__)("A decorative arrow for the next and previous link."),isBlock:!0,children:[(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"none",label:(0,ot._x)("None","Arrow option for Next/Previous link")}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"arrow",label:(0,ot._x)("Arrow","Arrow option for Next/Previous link")}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"chevron",label:(0,ot._x)("Chevron","Arrow option for Next/Previous link")})]})]})}),(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Filter by taxonomy"),value:s,options:[{label:(0,ot.__)("Unfiltered"),value:""},...(null!=g?g:[]).filter((({visibility:e})=>!!e?.publicly_queryable)).map((e=>({value:e.slug,label:e.name})))],onChange:e=>l({taxonomy:e}),help:(0,ot.__)("Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.")})}),(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(nt.AlignmentToolbar,{value:a,onChange:e=>{l({textAlign:e})}})}),(0,Je.jsxs)("div",{...m,children:[!c&&d&&(0,Je.jsx)("span",{className:`wp-block-post-navigation-link__arrow-previous is-arrow-${i}`,children:d}),(0,Je.jsx)(nt.RichText,{tagName:"a",identifier:"label","aria-label":p,placeholder:u,value:o,withoutInteractiveFormatting:!0,onChange:e=>l({label:e})}),n&&(0,Je.jsx)("a",{href:"#post-navigation-pseudo-link",onClick:e=>e.preventDefault(),children:(0,ot.__)("An example title")}),c&&d&&(0,Je.jsx)("span",{className:`wp-block-post-navigation-link__arrow-next is-arrow-${i}`,"aria-hidden":!0,children:d})]})]})},variations:ly,example:{attributes:{label:(0,ot.__)("Next post"),arrow:"arrow"}}},py=()=>et({name:uy,metadata:cy,settings:dy}),my=[["core/post-title"],["core/post-date"],["core/post-excerpt"]];function gy({classList:e}){const t=(0,nt.useInnerBlocksProps)({className:ft("wp-block-post",e)},{template:my,__unstableDisableLayoutClassNames:!0});return(0,Je.jsx)("li",{...t})}const hy=(0,st.memo)((function({blocks:e,blockContextId:t,classList:o,isHidden:n,setActiveBlockContextId:a}){const r=(0,nt.__experimentalUseBlockPreview)({blocks:e,props:{className:ft("wp-block-post",o)}}),i=()=>{a(t)},s={display:n?"none":void 0};return(0,Je.jsx)("li",{...r,tabIndex:0,role:"button",onClick:i,onKeyPress:i,style:s})}));const xy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-template",title:"Post Template",category:"theme",ancestor:["core/query"],description:"Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.",textdomain:"default",usesContext:["queryId","query","displayLayout","templateSlug","previewPostType","enhancedPagination","postType"],supports:{reusable:!1,html:!1,align:["wide","full"],layout:!0,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:!0,padding:!0,blockGap:{__experimentalDefault:"1.25em"},__experimentalDefaultControls:{blockGap:!0,padding:!1,margin:!1}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},style:"wp-block-post-template",editorStyle:"wp-block-post-template-editor"},{name:_y}=xy,by={icon:Xa,edit:function({setAttributes:e,clientId:t,context:{query:{perPage:o,offset:n=0,postType:a,order:r,orderBy:i,author:s,search:l,exclude:c,sticky:u,inherit:d,taxQuery:p,parents:m,pages:g,format:h,...x}={},templateSlug:_,previewPostType:b},attributes:{layout:y},__unstableLayoutClassNames:f}){const{type:v,columnCount:k=3}=y||{},[w,C]=(0,st.useState)(),{posts:j,blocks:S}=(0,it.useSelect)((e=>{const{getEntityRecords:g,getTaxonomies:y}=e(ct.store),{getBlocks:f}=e(nt.store),v=d&&_?.startsWith("category-")&&g("taxonomy","category",{context:"view",per_page:1,_fields:["id"],slug:_.replace("category-","")}),k=d&&_?.startsWith("tag-")&&g("taxonomy","post_tag",{context:"view",per_page:1,_fields:["id"],slug:_.replace("tag-","")}),w={offset:n||0,order:r,orderby:i};if(p&&!d){const e=y({type:a,per_page:-1,context:"view"}),t=Object.entries(p).reduce(((t,[o,n])=>{const a=e?.find((({slug:e})=>e===o));return a?.rest_base&&(t[a?.rest_base]=n),t}),{});Object.keys(t).length&&Object.assign(w,t)}o&&(w.per_page=o),s&&(w.author=s),l&&(w.search=l),c?.length&&(w.exclude=c),m?.length&&(w.parent=m),h?.length&&(w.format=h),u&&"ignore"!==u&&(w.sticky="only"===u),"ignore"===u&&(delete w.sticky,w.ignore_sticky=!0);let C=a;d&&(_?.startsWith("archive-")?(w.postType=_.replace("archive-",""),C=w.postType):v?w.categories=v[0]?.id:k?w.tags=k[0]?.id:_?.startsWith("taxonomy-post_format")&&(w.format=_.replace("taxonomy-post_format-post-format-","")));return{posts:g("postType",b||C,{...w,...x}),blocks:f(t)}}),[o,n,r,i,t,s,l,a,c,u,d,_,p,m,h,x,b]),B=(0,st.useMemo)((()=>j?.map((e=>{var t;return{postType:e.type,postId:e.id,classList:null!==(t=e.class_list)&&void 0!==t?t:""}}))),[j]),T=(0,nt.useBlockProps)({className:ft(f,{[`columns-${k}`]:"grid"===v&&k})});if(!j)return(0,Je.jsx)("p",{...T,children:(0,Je.jsx)(tt.Spinner,{})});if(!j.length)return(0,Je.jsxs)("p",{...T,children:[" ",(0,ot.__)("No results found.")]});const N=t=>e({layout:{...y,...t}}),P=[{icon:Np,title:(0,ot._x)("List view","Post template block display setting"),onClick:()=>N({type:"default"}),isActive:"default"===v||"constrained"===v},{icon:Zu,title:(0,ot._x)("Grid view","Post template block display setting"),onClick:()=>N({type:"grid",columnCount:k}),isActive:"grid"===v}];return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(tt.ToolbarGroup,{controls:P})}),(0,Je.jsx)("ul",{...T,children:B&&B.map((e=>(0,Je.jsxs)(nt.BlockContextProvider,{value:e,children:[e.postId===(w||B[0]?.postId)?(0,Je.jsx)(gy,{classList:e.classList}):null,(0,Je.jsx)(hy,{blocks:S,blockContextId:e.postId,classList:e.classList,setActiveBlockContextId:C,isHidden:e.postId===(w||B[0]?.postId)})]},e.postId)))})]})},save:function(){return(0,Je.jsx)(nt.InnerBlocks.Content,{})}},yy=()=>et({name:_y,metadata:xy,settings:by}),fy=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z",fillRule:"evenodd",clipRule:"evenodd"})}),vy=[];const ky=["core/bold","core/image","core/italic","core/link","core/strikethrough","core/text-color"];const wy=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})}),Cy={category:fy,post_tag:wy};function jy(e,t){if("core/post-terms"!==t)return e;const o=e.variations.map((e=>{var t;return{...e,icon:null!==(t=Cy[e.name])&&void 0!==t?t:fy}}));return{...e,variations:o}}const Sy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-terms",title:"Post Terms",category:"theme",description:"Post terms.",textdomain:"default",attributes:{term:{type:"string"},textAlign:{type:"string"},separator:{type:"string",default:", "},prefix:{type:"string",default:""},suffix:{type:"string",default:""}},usesContext:["postId","postType"],example:{viewportWidth:350},supports:{html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-terms"},{name:By}=Sy,Ty={icon:fy,edit:function({attributes:e,clientId:t,context:o,isSelected:n,setAttributes:a,insertBlocksAfter:r}){const{term:i,textAlign:s,separator:l,prefix:c,suffix:u}=e,{postId:d,postType:p}=o,m=(0,it.useSelect)((e=>{if(!i)return{};const{getTaxonomy:t}=e(ct.store),o=t(i);return o?.visibility?.publicly_queryable?o:{}}),[i]),{postTerms:g,hasPostTerms:h,isLoading:x}=function({postId:e,term:t}){const{slug:o}=t;return(0,it.useSelect)((n=>{const a=t?.visibility?.publicly_queryable;if(!a)return{postTerms:vy,isLoading:!1,hasPostTerms:!1};const{getEntityRecords:r,isResolving:i}=n(ct.store),s=["taxonomy",o,{post:e,per_page:-1,context:"view"}],l=r(...s);return{postTerms:l,isLoading:i("getEntityRecords",s),hasPostTerms:!!l?.length}}),[e,t?.visibility?.publicly_queryable,o])}({postId:d,term:m}),_=d&&p,b=(0,nt.useBlockDisplayInformation)(t),y=(0,nt.useBlockProps)({className:ft({[`has-text-align-${s}`]:s,[`taxonomy-${i}`]:i})});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(nt.AlignmentToolbar,{value:s,onChange:e=>{a({textAlign:e})}})}),(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,autoComplete:"off",label:(0,ot.__)("Separator"),value:l||"",onChange:e=>{a({separator:e})},help:(0,ot.__)("Enter character(s) used to separate terms.")})}),(0,Je.jsxs)("div",{...y,children:[x&&_&&(0,Je.jsx)(tt.Spinner,{}),!x&&(n||c)&&(0,Je.jsx)(nt.RichText,{identifier:"prefix",allowedFormats:ky,className:"wp-block-post-terms__prefix","aria-label":(0,ot.__)("Prefix"),placeholder:(0,ot.__)("Prefix")+" ",value:c,onChange:e=>a({prefix:e}),tagName:"span"}),(!_||!i)&&(0,Je.jsx)("span",{children:b.title}),_&&!x&&h&&g.map((e=>(0,Je.jsx)("a",{href:e.link,onClick:e=>e.preventDefault(),rel:"tag",children:(0,tn.decodeEntities)(e.name)},e.id))).reduce(((e,t)=>(0,Je.jsxs)(Je.Fragment,{children:[e,(0,Je.jsx)("span",{className:"wp-block-post-terms__separator",children:l||" "}),t]}))),_&&!x&&!h&&(m?.labels?.no_terms||(0,ot.__)("Term items not found.")),!x&&(n||u)&&(0,Je.jsx)(nt.RichText,{identifier:"suffix",allowedFormats:ky,className:"wp-block-post-terms__suffix","aria-label":(0,ot.__)("Suffix"),placeholder:" "+(0,ot.__)("Suffix"),value:u,onChange:e=>a({suffix:e}),tagName:"span",__unstableOnSplitAtEnd:()=>r((0,Ke.createBlock)((0,Ke.getDefaultBlockName)()))})]})]})}},Ny=()=>((0,Ns.addFilter)("blocks.registerBlockType","core/template-part",jy),et({name:By,metadata:Sy,settings:Ty})),Py=window.wp.wordcount;const Iy=function({attributes:e,setAttributes:t,context:o}){const{textAlign:n}=e,{postId:a,postType:r}=o,[i]=(0,ct.useEntityProp)("postType",r,"content",a),[s]=(0,ct.useEntityBlockEditor)("postType",r,{id:a}),l=(0,st.useMemo)((()=>{let e;e=i instanceof Function?i({blocks:s}):s?(0,Ke.__unstableSerializeAndClean)(s):i;const t=(0,ot._x)("words","Word count type. Do not translate!"),o=Math.max(1,Math.round((0,Py.count)(e||"",t)/189));return(0,ot.sprintf)((0,ot._n)("%s minute","%s minutes",o),o)}),[i,s]),c=(0,nt.useBlockProps)({className:ft({[`has-text-align-${n}`]:n})});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:n,onChange:e=>{t({textAlign:e})}})}),(0,Je.jsx)("div",{...c,children:l})]})},My=(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.Path,{d:"M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16.5c-4.1 0-7.5-3.4-7.5-7.5S7.9 4.5 12 4.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5zM12 7l-1 5c0 .3.2.6.4.8l4.2 2.8-2.7-4.1L12 7z"})}),Dy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/post-time-to-read",title:"Time to Read",category:"theme",description:"Show minutes required to finish reading the post.",textdomain:"default",usesContext:["postId","postType"],attributes:{textAlign:{type:"string"}},supports:{color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},html:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}}},{name:zy}=Dy,Ay={icon:My,edit:Iy,example:{}},Ry=()=>et({name:zy,metadata:Dy,settings:Ay});const Hy={attributes:{textAlign:{type:"string"},level:{type:"number",default:2},isLink:{type:"boolean",default:!1},rel:{type:"string",attribute:"rel",default:""},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0}},save:()=>null,migrate:lo,isEligible:({style:e})=>e?.typography?.fontFamily},Ly=[Hy],Vy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/post-title",title:"Title",category:"theme",description:"Displays the title of a post, page, or any other content-type.",textdomain:"default",usesContext:["postId","postType","queryId"],attributes:{textAlign:{type:"string"},level:{type:"number",default:2},levelOptions:{type:"array"},isLink:{type:"boolean",default:!1,role:"content"},rel:{type:"string",attribute:"rel",default:"",role:"content"},linkTarget:{type:"string",default:"_self",role:"content"}},example:{viewportWidth:350},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-post-title"},{name:Fy}=Vy,Ey={icon:Rr,edit:function({attributes:{level:e,levelOptions:t,textAlign:o,isLink:n,rel:a,linkTarget:r},setAttributes:i,context:{postType:s,postId:l,queryId:c},insertBlocksAfter:u}){const d=0===e?"p":`h${e}`,p=Number.isFinite(c),m=(0,it.useSelect)((e=>!p&&e(ct.store).canUser("update",{kind:"postType",name:s,id:l})),[p,s,l]),[g="",h,x]=(0,ct.useEntityProp)("postType",s,"title",l),[_]=(0,ct.useEntityProp)("postType",s,"link",l),b=()=>{u((0,Ke.createBlock)((0,Ke.getDefaultBlockName)()))},y=(0,nt.useBlockProps)({className:ft({[`has-text-align-${o}`]:o})}),f=(0,nt.useBlockEditingMode)();let v=(0,Je.jsx)(d,{...y,children:(0,ot.__)("Title")});return s&&l&&(v=m?(0,Je.jsx)(nt.PlainText,{tagName:d,placeholder:(0,ot.__)("No title"),value:g,onChange:h,__experimentalVersion:2,__unstableOnSplitAtEnd:b,...y}):(0,Je.jsx)(d,{...y,dangerouslySetInnerHTML:{__html:x?.rendered}})),n&&s&&l&&(v=m?(0,Je.jsx)(d,{...y,children:(0,Je.jsx)(nt.PlainText,{tagName:"a",href:_,target:r,rel:a,placeholder:g.length?null:(0,ot.__)("No title"),value:g,onChange:h,__experimentalVersion:2,__unstableOnSplitAtEnd:b})}):(0,Je.jsx)(d,{...y,children:(0,Je.jsx)("a",{href:_,target:r,rel:a,onClick:e=>e.preventDefault(),dangerouslySetInnerHTML:{__html:x?.rendered}})})),(0,Je.jsxs)(Je.Fragment,{children:["default"===f&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(nt.BlockControls,{group:"block",children:[(0,Je.jsx)(nt.HeadingLevelDropdown,{value:e,options:t,onChange:e=>i({level:e})}),(0,Je.jsx)(nt.AlignmentControl,{value:o,onChange:e=>{i({textAlign:e})}})]}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Make title a link"),onChange:()=>i({isLink:!n}),checked:n}),n&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open in new tab"),onChange:e=>i({linkTarget:e?"_blank":"_self"}),checked:"_blank"===r}),(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link rel"),value:a,onChange:e=>i({rel:e})})]})]})})]}),v]})},deprecated:Ly},Oy=()=>et({name:Fy,metadata:Vy,settings:Ey}),$y=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z"})});const Gy={from:[{type:"block",blocks:["core/code","core/paragraph"],transform:({content:e,anchor:t})=>(0,Ke.createBlock)("core/preformatted",{content:e,anchor:t})},{type:"raw",isMatch:e=>"PRE"===e.nodeName&&!(1===e.children.length&&"CODE"===e.firstChild.nodeName),schema:({phrasingContentSchema:e})=>({pre:{children:e}})}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,Ke.createBlock)("core/paragraph",e)},{type:"block",blocks:["core/code"],transform:e=>(0,Ke.createBlock)("core/code",e)}]},Uy=Gy,qy={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/preformatted",title:"Preformatted",category:"text",description:"Add text that respects your spacing and tabs, and also allows styling.",textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"pre",__unstablePreserveWhiteSpace:!0,role:"content"}},supports:{anchor:!0,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-preformatted"},{name:Wy}=qy,Zy={icon:$y,example:{attributes:{content:(0,ot.__)("EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;")}},transforms:Uy,edit:function({attributes:e,mergeBlocks:t,setAttributes:o,onRemove:n,insertBlocksAfter:a,style:r}){const{content:i}=e,s=(0,nt.useBlockProps)({style:r});return(0,Je.jsx)(nt.RichText,{tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:i,onChange:e=>{o({content:e})},onRemove:n,"aria-label":(0,ot.__)("Preformatted text"),placeholder:(0,ot.__)("Write preformatted text…"),onMerge:t,...s,__unstablePastePlainText:!0,__unstableOnSplitAtDoubleLineEnd:()=>a((0,Ke.createBlock)((0,Ke.getDefaultBlockName)()))})},save:function({attributes:e}){const{content:t}=e;return(0,Je.jsx)("pre",{...nt.useBlockProps.save(),children:(0,Je.jsx)(nt.RichText.Content,{value:t})})},merge:(e,t)=>({content:e.content+"\n\n"+t.content})},Qy=()=>et({name:Wy,metadata:qy,settings:Zy}),Ky=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z"})}),Yy="is-style-solid-color",Jy={value:{type:"string",source:"html",selector:"blockquote",multiline:"p"},citation:{type:"string",source:"html",selector:"cite",default:""},mainColor:{type:"string"},customMainColor:{type:"string"},textColor:{type:"string"},customTextColor:{type:"string"}};function Xy(e){if(!e)return;const t=e.match(/border-color:([^;]+)[;]?/);return t&&t[1]?t[1]:void 0}function ef(e){const t=`</p>${e=e||"<p></p>"}<p>`.split("</p><p>");return t.shift(),t.pop(),t.join("<br>")}const tf={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",role:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",role:"content"},textAlign:{type:"string"}},save({attributes:e}){const{textAlign:t,citation:o,value:n}=e,a=!nt.RichText.isEmpty(o);return(0,Je.jsx)("figure",{...nt.useBlockProps.save({className:ft({[`has-text-align-${t}`]:t})}),children:(0,Je.jsxs)("blockquote",{children:[(0,Je.jsx)(nt.RichText.Content,{value:n,multiline:!0}),a&&(0,Je.jsx)(nt.RichText.Content,{tagName:"cite",value:o})]})})},migrate:({value:e,...t})=>({value:ef(e),...t})},of={attributes:{...Jy},save({attributes:e}){const{mainColor:t,customMainColor:o,customTextColor:n,textColor:a,value:r,citation:i,className:s}=e,l=s?.includes(Yy);let c,u;if(l){const e=(0,nt.getColorClassName)("background-color",t);c=ft({"has-background":e||o,[e]:e}),u={backgroundColor:e?void 0:o}}else o&&(u={borderColor:o});const d=(0,nt.getColorClassName)("color",a),p=ft({"has-text-color":a||n,[d]:d}),m=d?void 0:{color:n};return(0,Je.jsx)("figure",{...nt.useBlockProps.save({className:c,style:u}),children:(0,Je.jsxs)("blockquote",{className:p,style:m,children:[(0,Je.jsx)(nt.RichText.Content,{value:r,multiline:!0}),!nt.RichText.isEmpty(i)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"cite",value:i})]})})},migrate({value:e,className:t,mainColor:o,customMainColor:n,customTextColor:a,...r}){const i=t?.includes(Yy);let s;return n&&(s=i?{color:{background:n}}:{border:{color:n}}),a&&s&&(s.color={...s.color,text:a}),{value:ef(e),className:t,backgroundColor:i?o:void 0,borderColor:i?void 0:o,textAlign:i?"left":void 0,style:s,...r}}},nf={attributes:{...Jy,figureStyle:{source:"attribute",selector:"figure",attribute:"style"}},save({attributes:e}){const{mainColor:t,customMainColor:o,textColor:n,customTextColor:a,value:r,citation:i,className:s,figureStyle:l}=e,c=s?.includes(Yy);let u,d;if(c){const e=(0,nt.getColorClassName)("background-color",t);u=ft({"has-background":e||o,[e]:e}),d={backgroundColor:e?void 0:o}}else if(o)d={borderColor:o};else if(t){d={borderColor:Xy(l)}}const p=(0,nt.getColorClassName)("color",n),m=(n||a)&&ft("has-text-color",{[p]:p}),g=p?void 0:{color:a};return(0,Je.jsx)("figure",{className:u,style:d,children:(0,Je.jsxs)("blockquote",{className:m,style:g,children:[(0,Je.jsx)(nt.RichText.Content,{value:r,multiline:!0}),!nt.RichText.isEmpty(i)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"cite",value:i})]})})},migrate({value:e,className:t,figureStyle:o,mainColor:n,customMainColor:a,customTextColor:r,...i}){const s=t?.includes(Yy);let l;if(a&&(l=s?{color:{background:a}}:{border:{color:a}}),r&&l&&(l.color={...l.color,text:r}),!s&&n&&o){const n=Xy(o);if(n)return{value:ef(e),...i,className:t,style:{border:{color:n}}}}return{value:ef(e),className:t,backgroundColor:s?n:void 0,borderColor:s?void 0:n,textAlign:s?"left":void 0,style:l,...i}}},af={attributes:Jy,save({attributes:e}){const{mainColor:t,customMainColor:o,textColor:n,customTextColor:a,value:r,citation:i,className:s}=e,l=s?.includes(Yy);let c,u;if(l)c=(0,nt.getColorClassName)("background-color",t),c||(u={backgroundColor:o});else if(o)u={borderColor:o};else if(t){var d;const e=null!==(d=(0,it.select)(nt.store).getSettings().colors)&&void 0!==d?d:[];u={borderColor:(0,nt.getColorObjectByAttributeValues)(e,t).color}}const p=(0,nt.getColorClassName)("color",n),m=n||a?ft("has-text-color",{[p]:p}):void 0,g=p?void 0:{color:a};return(0,Je.jsx)("figure",{className:c,style:u,children:(0,Je.jsxs)("blockquote",{className:m,style:g,children:[(0,Je.jsx)(nt.RichText.Content,{value:r,multiline:!0}),!nt.RichText.isEmpty(i)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"cite",value:i})]})})},migrate({value:e,className:t,mainColor:o,customMainColor:n,customTextColor:a,...r}){const i=t?.includes(Yy);let s={};return n&&(s=i?{color:{background:n}}:{border:{color:n}}),a&&s&&(s.color={...s.color,text:a}),{value:ef(e),className:t,backgroundColor:i?o:void 0,borderColor:i?void 0:o,textAlign:i?"left":void 0,style:s,...r}}},rf={attributes:{...Jy},save({attributes:e}){const{value:t,citation:o}=e;return(0,Je.jsxs)("blockquote",{children:[(0,Je.jsx)(nt.RichText.Content,{value:t,multiline:!0}),!nt.RichText.isEmpty(o)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"cite",value:o})]})},migrate:({value:e,...t})=>({value:ef(e),...t})},sf={attributes:{...Jy,citation:{type:"string",source:"html",selector:"footer"},align:{type:"string",default:"none"}},save({attributes:e}){const{value:t,citation:o,align:n}=e;return(0,Je.jsxs)("blockquote",{className:`align${n}`,children:[(0,Je.jsx)(nt.RichText.Content,{value:t,multiline:!0}),!nt.RichText.isEmpty(o)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"footer",value:o})]})},migrate:({value:e,...t})=>({value:ef(e),...t})},lf=[tf,of,nf,af,rf,sf],cf="web"===st.Platform.OS;const uf=function({attributes:e,setAttributes:t,isSelected:o,insertBlocksAfter:n}){const{textAlign:a,citation:r,value:i}=e,s=(0,nt.useBlockProps)({className:ft({[`has-text-align-${a}`]:a})}),l=!nt.RichText.isEmpty(r)||o;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:a,onChange:e=>{t({textAlign:e})}})}),(0,Je.jsx)("figure",{...s,children:(0,Je.jsxs)("blockquote",{children:[(0,Je.jsx)(nt.RichText,{identifier:"value",tagName:"p",value:i,onChange:e=>t({value:e}),"aria-label":(0,ot.__)("Pullquote text"),placeholder:(0,ot.__)("Add quote"),textAlign:"center"}),l&&(0,Je.jsx)(nt.RichText,{identifier:"citation",tagName:cf?"cite":void 0,style:{display:"block"},value:r,"aria-label":(0,ot.__)("Pullquote citation text"),placeholder:(0,ot.__)("Add citation"),onChange:e=>t({citation:e}),className:"wp-block-pullquote__citation",__unstableMobileNoFocusOnMount:!0,textAlign:"center",__unstableOnSplitAtEnd:()=>n((0,Ke.createBlock)((0,Ke.getDefaultBlockName)()))})]})})]})};const df={from:[{type:"block",isMultiBlock:!0,blocks:["core/paragraph"],transform:e=>(0,Ke.createBlock)("core/pullquote",{value:(0,Ho.toHTMLString)({value:(0,Ho.join)(e.map((({content:e})=>(0,Ho.create)({html:e}))),"\n")}),anchor:e.anchor})},{type:"block",blocks:["core/heading"],transform:({content:e,anchor:t})=>(0,Ke.createBlock)("core/pullquote",{value:e,anchor:t})}],to:[{type:"block",blocks:["core/paragraph"],transform:({value:e,citation:t})=>{const o=[];return e&&o.push((0,Ke.createBlock)("core/paragraph",{content:e})),t&&o.push((0,Ke.createBlock)("core/paragraph",{content:t})),0===o.length?(0,Ke.createBlock)("core/paragraph",{content:""}):o}},{type:"block",blocks:["core/heading"],transform:({value:e,citation:t})=>{if(!e)return(0,Ke.createBlock)("core/heading",{content:t});const o=(0,Ke.createBlock)("core/heading",{content:e});return t?[o,(0,Ke.createBlock)("core/heading",{content:t})]:o}}]},pf=df,mf={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/pullquote",title:"Pullquote",category:"text",description:"Give special visual emphasis to a quote from your text.",textdomain:"default",attributes:{value:{type:"rich-text",source:"rich-text",selector:"p",role:"content"},citation:{type:"rich-text",source:"rich-text",selector:"cite",role:"content"},textAlign:{type:"string"}},supports:{anchor:!0,align:["left","right","wide","full"],background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},color:{gradients:!0,background:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},dimensions:{minHeight:!0,__experimentalDefaultControls:{minHeight:!1}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},__experimentalStyle:{typography:{fontSize:"1.5em",lineHeight:"1.6"}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-pullquote-editor",style:"wp-block-pullquote"},{name:gf}=mf,hf={icon:Ky,example:{attributes:{value:(0,ot.__)("One of the hardest things to do in technology is disrupt yourself."),citation:(0,ot.__)("Matt Mullenweg")}},transforms:pf,edit:uf,save:function({attributes:e}){const{textAlign:t,citation:o,value:n}=e,a=!nt.RichText.isEmpty(o);return(0,Je.jsx)("figure",{...nt.useBlockProps.save({className:ft({[`has-text-align-${t}`]:t})}),children:(0,Je.jsxs)("blockquote",{children:[(0,Je.jsx)(nt.RichText.Content,{tagName:"p",value:n}),a&&(0,Je.jsx)(nt.RichText.Content,{tagName:"cite",value:o})]})})},deprecated:lf},xf=()=>et({name:gf,metadata:mf,settings:hf}),_f=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z"})}),bf=e=>{const t=e?.reduce(((e,t)=>{const{mapById:o,mapByName:n,names:a}=e;return o[t.id]=t,n[t.name]=t,a.push(t.name),e}),{mapById:{},mapByName:{},names:[]});return{entities:e,...t}},yf=(e,t)=>{const o=t.split(".");let n=e;return o.forEach((e=>{n=n?.[e]})),n},ff=(e,t)=>(e||[]).map((e=>({...e,name:(0,tn.decodeEntities)(yf(e,t))}))),vf=e=>{const t=(0,it.useSelect)((t=>{const{getTaxonomies:o,getPostType:n}=t(ct.store);return n(e)?.taxonomies?.length>0?o({type:e,per_page:-1}):[]}),[e]);return(0,st.useMemo)((()=>t?.filter((({visibility:e})=>!!e?.publicly_queryable))),[t])};function kf(e,t){return!e||e.includes(t)}const wf=e=>(0,it.useSelect)((t=>{const{getClientIdsOfDescendants:o,getBlockName:n}=t(nt.store),a={};return o(e).forEach((e=>{const t=n(e),o=Object.is((0,Ke.getBlockSupport)(t,"interactivity"),!0),r=(0,Ke.getBlockSupport)(t,"interactivity.clientNavigation");o||r?"core/post-content"===t&&(a.hasPostContentBlock=!0):a.hasBlocksFromPlugins=!0})),a.hasUnsupportedBlocks=a.hasBlocksFromPlugins||a.hasPostContentBlock,a}),[e]);function Cf({enhancedPagination:e,setAttributes:t,clientId:o}){const{hasUnsupportedBlocks:n}=wf(o),a=window.__experimentalFullPageClientSideNavigation;let r=(0,ot.__)("Reload the full page—instead of just the posts list—when visitors navigate between pages.");return a?r=(0,ot.__)("Experimental full-page client-side navigation setting enabled."):n&&(r=(0,ot.__)("Enhancement disabled because there are non-compatible blocks inside the Query block.")),(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Reload full page"),help:r,checked:!e&&!a,disabled:n||a,onChange:e=>{t({enhancedPagination:!e})}})})}const jf=[{label:(0,ot.__)("Newest to oldest"),value:"date/desc"},{label:(0,ot.__)("Oldest to newest"),value:"date/asc"},{label:(0,ot.__)("A → Z"),value:"title/asc"},{label:(0,ot.__)("Z → A"),value:"title/desc"}];const Sf=function({order:e,orderBy:t,orderByOptions:o=jf,onChange:n}){return(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Order by"),value:`${t}/${e}`,options:o,onChange:e=>{const[t,o]=e.split("/");n({order:o,orderBy:t})}})},Bf={who:"authors",per_page:-1,_fields:"id,name",context:"view"};const Tf=function({value:e,onChange:t}){const o=(0,it.useSelect)((e=>{const{getUsers:t}=e(ct.store);return t(Bf)}),[]);if(!o)return null;const n=bf(o),a=(e?e.toString().split(","):[]).reduce(((e,t)=>{const o=n.mapById[t];return o&&e.push({id:t,value:o.name}),e}),[]);return(0,Je.jsx)(tt.FormTokenField,{label:(0,ot.__)("Authors"),value:a,suggestions:n.names,onChange:e=>{const o=Array.from(e.reduce(((e,t)=>{const o=((e,t)=>{const o=t?.id||e[t]?.id;if(o)return o})(n.mapByName,t);return o&&e.add(o),e}),new Set));t({author:o.join(",")})},__experimentalShowHowTo:!1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},Nf=[],Pf={order:"asc",_fields:"id,title",context:"view"};const If=function({parents:e,postType:t,onChange:o}){const[n,a]=(0,st.useState)(""),[r,i]=(0,st.useState)(Nf),[s,l]=(0,st.useState)(Nf),c=(0,ut.useDebounce)(a,250),{searchResults:u,searchHasResolved:d}=(0,it.useSelect)((o=>{if(!n)return{searchResults:Nf,searchHasResolved:!0};const{getEntityRecords:a,hasFinishedResolution:r}=o(ct.store),i=["postType",t,{...Pf,search:n,orderby:"relevance",exclude:e,per_page:20}];return{searchResults:a(...i),searchHasResolved:r("getEntityRecords",i)}}),[n,e]),p=(0,it.useSelect)((o=>{if(!e?.length)return Nf;const{getEntityRecords:n}=o(ct.store);return n("postType",t,{...Pf,include:e,per_page:e.length})}),[e]);(0,st.useEffect)((()=>{if(e?.length||i(Nf),!p?.length)return;const t=bf(ff(p,"title.rendered")),o=e.reduce(((e,o)=>{const n=t.mapById[o];return n&&e.push({id:o,value:n.name}),e}),[]);i(o)}),[e,p]);const m=(0,st.useMemo)((()=>u?.length?bf(ff(u,"title.rendered")):Nf),[u]);return(0,st.useEffect)((()=>{d&&l(m.names)}),[m.names,d]),(0,Je.jsx)(tt.FormTokenField,{__next40pxDefaultSize:!0,label:(0,ot.__)("Parents"),value:r,onInputChange:c,suggestions:s,onChange:e=>{const t=Array.from(e.reduce(((e,t)=>{const o=((e,t)=>{const o=t?.id||e?.[t]?.id;if(o)return o})(m.mapByName,t);return o&&e.add(o),e}),new Set));l(Nf),o({parents:t})},__experimentalShowHowTo:!1,__nextHasNoMarginBottom:!0})},Mf=[],Df={order:"asc",_fields:"id,name",context:"view"},zf=(e,t)=>{const o=t?.id||e?.find((e=>e.name===t))?.id;if(o)return o;const n=t.toLocaleLowerCase();return e?.find((e=>e.name.toLocaleLowerCase()===n))?.id};function Af({onChange:e,query:t}){const{postType:o,taxQuery:n}=t,a=vf(o);return a&&0!==a.length?(0,Je.jsx)(tt.__experimentalVStack,{spacing:4,children:a.map((t=>{const o=n?.[t.slug]||[];return(0,Je.jsx)(Rf,{taxonomy:t,termIds:o,onChange:o=>e({taxQuery:{...n,[t.slug]:o}})},t.slug)}))}):null}function Rf({taxonomy:e,termIds:t,onChange:o}){const[n,a]=(0,st.useState)(""),[r,i]=(0,st.useState)(Mf),[s,l]=(0,st.useState)(Mf),c=(0,ut.useDebounce)(a,250),{searchResults:u,searchHasResolved:d}=(0,it.useSelect)((o=>{if(!n)return{searchResults:Mf,searchHasResolved:!0};const{getEntityRecords:a,hasFinishedResolution:r}=o(ct.store),i=["taxonomy",e.slug,{...Df,search:n,orderby:"name",exclude:t,per_page:20}];return{searchResults:a(...i),searchHasResolved:r("getEntityRecords",i)}}),[n,t]),p=(0,it.useSelect)((o=>{if(!t?.length)return Mf;const{getEntityRecords:n}=o(ct.store);return n("taxonomy",e.slug,{...Df,include:t,per_page:t.length})}),[t]);(0,st.useEffect)((()=>{if(t?.length||i(Mf),!p?.length)return;const e=t.reduce(((e,t)=>{const o=p.find((e=>e.id===t));return o&&e.push({id:t,value:o.name}),e}),[]);i(e)}),[t,p]),(0,st.useEffect)((()=>{d&&l(u.map((e=>e.name)))}),[u,d]);return(0,Je.jsx)("div",{className:"block-library-query-inspector__taxonomy-control",children:(0,Je.jsx)(tt.FormTokenField,{label:e.name,value:r,onInputChange:c,suggestions:s,displayTransform:tn.decodeEntities,onChange:e=>{const t=new Set;for(const o of e){const e=zf(u,o);e&&t.add(e)}l(Mf),o(Array.from(t))},__experimentalShowHowTo:!1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})})}const Hf=[{value:"aside",label:(0,ot.__)("Aside")},{value:"audio",label:(0,ot.__)("Audio")},{value:"chat",label:(0,ot.__)("Chat")},{value:"gallery",label:(0,ot.__)("Gallery")},{value:"image",label:(0,ot.__)("Image")},{value:"link",label:(0,ot.__)("Link")},{value:"quote",label:(0,ot.__)("Quote")},{value:"standard",label:(0,ot.__)("Standard")},{value:"status",label:(0,ot.__)("Status")},{value:"video",label:(0,ot.__)("Video")}].sort(((e,t)=>{const o=e.label.toUpperCase(),n=t.label.toUpperCase();return o<n?-1:o>n?1:0}));function Lf(e,t){return e.map((e=>t.find((t=>t.label.toLocaleLowerCase()===e.toLocaleLowerCase()))?.value)).filter(Boolean)}function Vf({onChange:e,query:{format:t}}){const o=Array.isArray(t)?t:[t],{supportedFormats:n}=(0,it.useSelect)((e=>({supportedFormats:e(ct.store).getThemeSupports().formats})),[]),a=Hf.filter((e=>n.includes(e.value))),r=o.map((e=>a.find((t=>t.value===e))?.label)).filter(Boolean),i=a.filter((e=>!o.includes(e.value))).map((e=>e.label));return(0,Je.jsx)(tt.FormTokenField,{label:(0,ot.__)("Formats"),value:r,suggestions:i,onChange:t=>{e({format:Lf(t,a)})},__experimentalShowHowTo:!1,__experimentalExpandOnFocus:!0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})}const Ff=[{label:(0,ot.__)("Include"),value:""},{label:(0,ot.__)("Ignore"),value:"ignore"},{label:(0,ot.__)("Exclude"),value:"exclude"},{label:(0,ot.__)("Only"),value:"only"}];function Ef({value:e,onChange:t}){return(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Sticky posts"),options:Ff,value:e,onChange:t,help:(0,ot.__)("Sticky posts always appear first, regardless of their publish date.")})}const Of=({perPage:e,offset:t=0,onChange:o})=>(0,Je.jsx)(tt.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Items per page"),min:1,max:100,onChange:e=>{isNaN(e)||e<1||e>100||o({perPage:e,offset:t})},value:parseInt(e,10)}),$f=({offset:e=0,onChange:t})=>(0,Je.jsx)(tt.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,ot.__)("Offset"),value:e,min:0,onChange:e=>{isNaN(e)||e<0||e>100||t({offset:e})}}),Gf=({pages:e,onChange:t})=>(0,Je.jsx)(tt.__experimentalNumberControl,{__next40pxDefaultSize:!0,label:(0,ot.__)("Max pages to show"),value:e,min:0,onChange:e=>{isNaN(e)||e<0||t({pages:e})},help:(0,ot.__)("Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).")});function Uf(e){const{attributes:t,setQuery:o,setDisplayLayout:n,isSingular:a}=e,{query:r,displayLayout:i}=t,{order:s,orderBy:l,author:c,pages:u,postType:d,perPage:p,offset:m,sticky:g,inherit:h,taxQuery:x,parents:_,format:b}=r,y=function(e){return(0,it.useSelect)((t=>t(Ke.store).getActiveBlockVariation("core/query",e)?.allowedControls),[e])}(t),f="post"===d,{postTypesTaxonomiesMap:v,postTypesSelectOptions:k,postTypeFormatSupportMap:w}=(()=>{const e=(0,it.useSelect)((e=>{const{getPostTypes:t}=e(ct.store),o=["attachment"],n=t({per_page:-1})?.filter((({viewable:e,slug:t})=>e&&!o.includes(t)));return n}),[]);return{postTypesTaxonomiesMap:(0,st.useMemo)((()=>{if(e?.length)return e.reduce(((e,t)=>(e[t.slug]=t.taxonomies,e)),{})}),[e]),postTypesSelectOptions:(0,st.useMemo)((()=>(e||[]).map((({labels:e,slug:t})=>({label:e.singular_name,value:t})))),[e]),postTypeFormatSupportMap:(0,st.useMemo)((()=>e?.length?e.reduce(((e,t)=>(e[t.slug]=t.supports?.["post-formats"]||!1,e)),{}):{}),[e])}})(),C=vf(d),j=function(e){return(0,it.useSelect)((t=>{const o=t(ct.store).getPostType(e);return o?.viewable&&o?.hierarchical}),[e])}(d),S=e=>{const t={postType:e},n=v[e],a=Object.entries(x||{}).reduce(((e,[t,o])=>(n.includes(t)&&(e[t]=o),e)),{});t.taxQuery=Object.keys(a).length?a:void 0,"post"!==e&&(t.sticky=""),t.parents=[];w[e]||(t.format=[]),o(t)},[B,T]=(0,st.useState)(r.search),N=(0,st.useCallback)((0,ut.debounce)((()=>{r.search!==B&&o({search:B})}),250),[B,r.search]);(0,st.useEffect)((()=>(N(),N.cancel)),[B,N]);const P=function(e){const t=(0,it.useSelect)((t=>{const o=t(ct.store).getPostType(e);return!!o?.supports?.["page-attributes"]}),[e]);return(0,st.useMemo)((()=>{const e=[{label:(0,ot.__)("Newest to oldest"),value:"date/desc"},{label:(0,ot.__)("Oldest to newest"),value:"date/asc"},{label:(0,ot.__)("A → Z"),value:"title/asc"},{label:(0,ot.__)("Z → A"),value:"title/desc"}];return t&&e.push({label:(0,ot.__)("Ascending by order"),value:"menu_order/asc"},{label:(0,ot.__)("Descending by order"),value:"menu_order/desc"}),e}),[t])}(d),I=!a&&kf(y,"inherit"),M=!h&&kf(y,"postType"),D=(0,ot.__)("Post type"),z=(0,ot.__)("Select the type of content to display: posts, pages, or custom post types."),A=!1,R=!h&&kf(y,"order"),H=!h&&f&&kf(y,"sticky"),L=I||M||R||H,V=!!C?.length&&kf(y,"taxQuery"),F=kf(y,"author"),E=kf(y,"search"),O=kf(y,"parents")&&j,$=w[d],G=(0,it.useSelect)((e=>{if(!$||!kf(y,"format"))return!1;const t=e(ct.store).getThemeSupports();return t.formats&&t.formats.length>0&&t.formats.some((e=>"standard"!==e))}),[y,$]),U=V||F||E||O||G,q=mt(),W=kf(y,"postCount"),Z=kf(y,"offset"),Q=kf(y,"pages"),K=W||Z||Q;return(0,Je.jsxs)(Je.Fragment,{children:[L&&(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{o({postType:"post",order:"desc",orderBy:"date",sticky:"",inherit:!0})},dropdownMenuProps:q,children:[I&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!h,label:(0,ot.__)("Query type"),onDeselect:()=>o({inherit:!0}),isShownByDefault:!0,children:(0,Je.jsxs)(tt.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Query type"),isBlock:!0,onChange:e=>{o({inherit:"default"===e})},help:h?(0,ot.__)("Display a list of posts or custom post types based on the current template."):(0,ot.__)("Display a list of posts or custom post types based on specific criteria."),value:h?"default":"custom",children:[(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"default",label:(0,ot.__)("Default")}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"custom",label:(0,ot.__)("Custom")})]})}),M&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>"post"!==d,label:D,onDeselect:()=>S("post"),isShownByDefault:!0,children:k.length>2?(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,options:k,value:d,label:D,onChange:S,help:z}):(0,Je.jsx)(tt.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,value:d,label:D,onChange:S,help:z,children:k.map((e=>(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:e.value,label:e.label},e.value)))})}),A,R&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>"desc"!==s||"date"!==l,label:(0,ot.__)("Order by"),onDeselect:()=>o({order:"desc",orderBy:"date"}),isShownByDefault:!0,children:(0,Je.jsx)(Sf,{order:s,orderBy:l,orderByOptions:P,onChange:o})}),H&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!g,label:(0,ot.__)("Sticky posts"),onDeselect:()=>o({sticky:""}),isShownByDefault:!0,children:(0,Je.jsx)(Ef,{value:g,onChange:e=>o({sticky:e})})})]}),!h&&K&&(0,Je.jsxs)(tt.__experimentalToolsPanel,{className:"block-library-query-toolspanel__display",label:(0,ot.__)("Display"),resetAll:()=>{o({offset:0,pages:0})},dropdownMenuProps:q,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Items per page"),hasValue:()=>p>0,children:(0,Je.jsx)(Of,{perPage:p,offset:m,onChange:o})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Offset"),hasValue:()=>m>0,onDeselect:()=>o({offset:0}),children:(0,Je.jsx)($f,{offset:m,onChange:o})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Max pages to show"),hasValue:()=>u>0,onDeselect:()=>o({pages:0}),children:(0,Je.jsx)(Gf,{pages:u,onChange:o})})]}),!h&&U&&(0,Je.jsxs)(tt.__experimentalToolsPanel,{className:"block-library-query-toolspanel__filters",label:(0,ot.__)("Filters"),resetAll:()=>{o({author:"",parents:[],search:"",taxQuery:null,format:[]}),T("")},dropdownMenuProps:q,children:[V&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Taxonomies"),hasValue:()=>Object.values(x||{}).some((e=>!!e.length)),onDeselect:()=>o({taxQuery:null}),children:(0,Je.jsx)(Af,{onChange:o,query:r})}),F&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!c,label:(0,ot.__)("Authors"),onDeselect:()=>o({author:""}),children:(0,Je.jsx)(Tf,{value:c,onChange:o})}),E&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!B,label:(0,ot.__)("Keyword"),onDeselect:()=>T(""),children:(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Keyword"),value:B,onChange:T})}),O&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!_?.length,label:(0,ot.__)("Parents"),onDeselect:()=>o({parents:[]}),children:(0,Je.jsx)(If,{parents:_,postType:d,onChange:o})}),G&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!b?.length,label:(0,ot.__)("Formats"),onDeselect:()=>o({format:[]}),children:(0,Je.jsx)(Vf,{onChange:o,query:r})})]})]})}const qf="wp-block-query-enhanced-pagination-modal__description";function Wf({clientId:e,attributes:{enhancedPagination:t},setAttributes:o}){const[n,a]=(0,st.useState)(!1),{hasBlocksFromPlugins:r,hasPostContentBlock:i,hasUnsupportedBlocks:s}=wf(e);(0,st.useEffect)((()=>{t&&s&&!window.__experimentalFullPageClientSideNavigation&&(o({enhancedPagination:!1}),a(!0))}),[t,s,o]);const l=()=>{a(!1)};let c=(0,ot.__)('If you still want to prevent full page reloads, remove that block, then disable "Reload full page" again in the Query Block settings.');return r?c=(0,ot.__)("Currently, avoiding full page reloads is not possible when non-interactive or non-client Navigation compatible blocks from plugins are present inside the Query block.")+" "+c:i&&(c=(0,ot.__)("Currently, avoiding full page reloads is not possible when a Content block is present inside the Query block.")+" "+c),n&&(0,Je.jsx)(tt.Modal,{title:(0,ot.__)("Query block: Reload full page enabled"),className:"wp-block-query__enhanced-pagination-modal",aria:{describedby:qf},role:"alertdialog",focusOnMount:"firstElement",isDismissible:!1,onRequestClose:l,children:(0,Je.jsxs)(tt.__experimentalVStack,{alignment:"right",spacing:5,children:[(0,Je.jsx)("span",{id:qf,children:c}),(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:l,children:(0,ot.__)("OK")})]})})}function Zf(e=""){return e=(e=hc()(e)).trim().toLowerCase()}function Qf(e,t){const o=Zf(t),n=Zf(e.title);let a=0;if(o===n)a+=30;else if(n.startsWith(o))a+=20;else{o.split(" ").every((e=>n.includes(e)))&&(a+=10)}return a}function Kf(e=[],t=""){if(!t)return e;const o=e.map((e=>[e,Qf(e,t)])).filter((([,e])=>e>0));return o.sort((([,e],[,t])=>t-e)),o.map((([e])=>e))}function Yf({clientId:e,attributes:t,setIsPatternSelectionModalOpen:o}){return(0,Je.jsx)(tt.Modal,{overlayClassName:"block-library-query-pattern__selection-modal",title:(0,ot.__)("Choose a pattern"),onRequestClose:()=>o(!1),isFullScreen:!0,children:(0,Je.jsx)(Xf,{clientId:e,attributes:t})})}function Jf(e,t){const o=function(e,t){return(0,it.useSelect)((o=>{const n=o(Ke.store).getActiveBlockVariation("core/query",t)?.name;if(!n)return"core/query";const{getBlockRootClientId:a,getPatternsByBlockTypes:r}=o(nt.store);return r(`core/query/${n}`,a(e)).length>0?`core/query/${n}`:"core/query"}),[e,t])}(e,t);return((e,t)=>(0,it.useSelect)((o=>{const{getBlockRootClientId:n,getPatternsByBlockTypes:a}=o(nt.store),r=n(e);return a(t,r)}),[t,e]))(e,o)}function Xf({clientId:e,attributes:t,showTitlesAsTooltip:o=!1,showSearch:n=!0}){const[a,r]=(0,st.useState)(""),{replaceBlock:i,selectBlock:s}=(0,it.useDispatch)(nt.store),l=Jf(e,t),c=(0,st.useMemo)((()=>({previewPostType:t.query.postType})),[t.query.postType]),u=(0,st.useMemo)((()=>Kf(l,a)),[l,a]);return(0,Je.jsxs)("div",{className:"block-library-query-pattern__selection-content",children:[n&&(0,Je.jsx)("div",{className:"block-library-query-pattern__selection-search",children:(0,Je.jsx)(tt.SearchControl,{__nextHasNoMarginBottom:!0,onChange:r,value:a,label:(0,ot.__)("Search"),placeholder:(0,ot.__)("Search")})}),(0,Je.jsx)(nt.BlockContextProvider,{value:c,children:(0,Je.jsx)(nt.__experimentalBlockPatternsList,{blockPatterns:u,onClickPattern:(o,n)=>{const{newBlocks:a,queryClientIds:r}=((e,t)=>{const{query:{postType:o,inherit:n},namespace:a}=t,r=e.map((e=>(0,Ke.cloneBlock)(e))),i=[],s=[...r];for(;s.length>0;){const e=s.shift();"core/query"===e.name&&(e.attributes.query={...e.attributes.query,postType:o,inherit:n},a&&(e.attributes.namespace=a),i.push(e.clientId)),e.innerBlocks?.forEach((e=>{s.push(e)}))}return{newBlocks:r,queryClientIds:i}})(n,t);i(e,a),r[0]&&s(r[0])},showTitlesAsTooltip:o})})]})}function ev({clientId:e,attributes:t}){return Jf(e,t).length?(0,Je.jsx)(tt.ToolbarGroup,{className:"wp-block-template-part__block-control-group",children:(0,Je.jsx)(tt.__experimentalDropdownContentWrapper,{children:(0,Je.jsx)(tt.Dropdown,{contentClassName:"block-editor-block-settings-menu__popover",focusOnMount:"firstElement",expandOnMobile:!0,renderToggle:({isOpen:e,onToggle:t})=>(0,Je.jsx)(tt.ToolbarButton,{"aria-haspopup":"true","aria-expanded":e,onClick:t,children:(0,ot.__)("Change design")}),renderContent:()=>(0,Je.jsx)(Xf,{clientId:e,attributes:t,showSearch:!1,showTitlesAsTooltip:!0})})})}):null}const tv=[["core/post-template"]];function ov({attributes:e,setAttributes:t,clientId:o,context:n,name:a}){const{queryId:r,query:i,displayLayout:s,enhancedPagination:l,tagName:c="div",query:{inherit:u}={}}=e,{templateSlug:d}=n,{isSingular:p}=function(e){if(!e)return{isSingular:!0};let t=!1,o="wp"===e?"custom":e;const n=e.includes("-")?e.split("-",1)[0]:e;return(e.includes("-")?e.split("-").slice(1).join("-"):"")&&(o=n),t=["404","blank","single","page","custom"].includes(o),{isSingular:t,templateType:o}}(d),{__unstableMarkNextChangeAsNotPersistent:m}=(0,it.useDispatch)(nt.store),g=(0,ut.useInstanceId)(ov),h=(0,nt.useBlockProps)(),x=(0,nt.useInnerBlocksProps)(h,{template:tv}),{postsPerPage:_}=(0,it.useSelect)((e=>{const{getSettings:t}=e(nt.store),{getEntityRecord:o,getEntityRecordEdits:n,canUser:a}=e(ct.store),r=a("read",{kind:"root",name:"site"})?+o("root","site")?.posts_per_page:+t().postsPerPage;return{postsPerPage:+n("root","site")?.posts_per_page||r||3}}),[]),b=(0,st.useCallback)((e=>t({query:{...i,...e}})),[i,t]);(0,st.useEffect)((()=>{const e={};(u&&i.perPage!==_||!i.perPage&&_)&&(e.perPage=_),p&&i.inherit&&(e.inherit=!1),Object.keys(e).length&&(m(),b(e))}),[i.perPage,i.inherit,_,u,p,m,b]),(0,st.useEffect)((()=>{Number.isFinite(r)||(m(),t({queryId:g}))}),[r,g,m,t]);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Wf,{attributes:e,setAttributes:t,clientId:o}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(Uf,{name:a,attributes:e,setQuery:b,setDisplayLayout:e=>t({displayLayout:{...s,...e}}),setAttributes:t,clientId:o,isSingular:p})}),(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(ev,{attributes:e,clientId:o})}),(0,Je.jsxs)(nt.InspectorControls,{group:"advanced",children:[(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("HTML element"),options:[{label:(0,ot.__)("Default (<div>)"),value:"div"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<aside>",value:"aside"}],value:c,onChange:e=>t({tagName:e}),help:sa[c]}),(0,Je.jsx)(Cf,{enhancedPagination:l,setAttributes:t,clientId:o})]}),(0,Je.jsx)(c,{...x})]})}function nv({attributes:e,clientId:t,name:o,openPatternSelectionModal:n}){const[a,r]=(0,st.useState)(!1),i=(0,nt.useBlockProps)(),{blockType:s,activeBlockVariation:l}=(0,it.useSelect)((t=>{const{getActiveBlockVariation:n,getBlockType:a}=t(Ke.store);return{blockType:a(o),activeBlockVariation:n(o,e)}}),[o,e]),c=!!Jf(t,e).length,u=l?.icon?.src||l?.icon||s?.icon?.src,d=l?.title||s?.title;return a?(0,Je.jsx)(av,{clientId:t,attributes:e,icon:u,label:d}):(0,Je.jsx)("div",{...i,children:(0,Je.jsxs)(tt.Placeholder,{icon:u,label:d,instructions:(0,ot.__)("Choose a pattern for the query loop or start blank."),children:[!!c&&(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:n,children:(0,ot.__)("Choose")}),(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{r(!0)},children:(0,ot.__)("Start blank")})]})})}function av({clientId:e,attributes:t,icon:o,label:n}){const a=function(e){const{activeVariationName:t,blockVariations:o}=(0,it.useSelect)((t=>{const{getActiveBlockVariation:o,getBlockVariations:n}=t(Ke.store);return{activeVariationName:o("core/query",e)?.name,blockVariations:n("core/query","block")}}),[e]);return(0,st.useMemo)((()=>{const e=e=>!e.attributes?.namespace;if(!t)return o.filter(e);const n=o.filter((e=>e.attributes?.namespace?.includes(t)));return n.length?n:o.filter(e)}),[t,o])}(t),{replaceInnerBlocks:r}=(0,it.useDispatch)(nt.store),i=(0,nt.useBlockProps)();return(0,Je.jsx)("div",{...i,children:(0,Je.jsx)(nt.__experimentalBlockVariationPicker,{icon:o,label:n,variations:a,onSelect:t=>{t.innerBlocks&&r(e,(0,Ke.createBlocksFromInnerBlocksTemplate)(t.innerBlocks),!1)}})})}const rv=e=>{const{clientId:t,attributes:o}=e,[n,a]=(0,st.useState)(!1),r=(0,it.useSelect)((e=>!!e(nt.store).getBlocks(t).length),[t])?ov:nv;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(r,{...e,openPatternSelectionModal:()=>a(!0)}),n&&(0,Je.jsx)(Yf,{clientId:t,attributes:o,setIsPatternSelectionModalOpen:a})]})};const iv=(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z"})}),sv=(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z"})}),lv=(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z"})}),cv=(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",children:(0,Je.jsx)(tt.Path,{d:"M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z"})}),uv=[{name:"title-date",title:(0,ot.__)("Title & Date"),icon:iv,attributes:{},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-date"]]],["core/query-pagination"],["core/query-no-results"]],scope:["block"]},{name:"title-excerpt",title:(0,ot.__)("Title & Excerpt"),icon:sv,attributes:{},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-excerpt"]]],["core/query-pagination"],["core/query-no-results"]],scope:["block"]},{name:"title-date-excerpt",title:(0,ot.__)("Title, Date, & Excerpt"),icon:lv,attributes:{},innerBlocks:[["core/post-template",{},[["core/post-title"],["core/post-date"],["core/post-excerpt"]]],["core/query-pagination"],["core/query-no-results"]],scope:["block"]},{name:"image-date-title",title:(0,ot.__)("Image, Date, & Title"),icon:cv,attributes:{},innerBlocks:[["core/post-template",{},[["core/post-featured-image"],["core/post-date"],["core/post-title"]]],["core/query-pagination"],["core/query-no-results"]],scope:["block"]}],{cleanEmptyObject:dv}=Ot(nt.privateApis),pv=e=>{const{query:t}=e,{categoryIds:o,tagIds:n,...a}=t;return(t.categoryIds?.length||t.tagIds?.length)&&(a.taxQuery={category:t.categoryIds?.length?t.categoryIds:void 0,post_tag:t.tagIds?.length?t.tagIds:void 0}),{...e,query:a}},mv=(e,t)=>{const{style:o,backgroundColor:n,gradient:a,textColor:r,...i}=e;if(!(n||a||r||o?.color||o?.elements?.link))return[e,t];if(o&&(i.style=dv({...o,color:void 0,elements:{...o.elements,link:void 0}})),gv(t)){const e=t[0],s=o?.color||o?.elements?.link||e.attributes.style?dv({...e.attributes.style,color:o?.color,elements:o?.elements?.link?{link:o?.elements?.link}:void 0}):void 0;return[i,[(0,Ke.createBlock)("core/group",{...e.attributes,backgroundColor:n,gradient:a,textColor:r,style:s},e.innerBlocks)]]}return[i,[(0,Ke.createBlock)("core/group",{backgroundColor:n,gradient:a,textColor:r,style:dv({color:o?.color,elements:o?.elements?.link?{link:o?.elements?.link}:void 0})},t)]]},gv=(e=[])=>1===e.length&&"core/group"===e[0].name,hv=e=>{const{layout:t=null}=e;if(!t)return e;const{inherit:o=null,contentSize:n=null,...a}=t;return o||n?{...e,layout:{...a,contentSize:n,type:"constrained"}}:e},xv=(e=[])=>{let t=null;for(const o of e){if("core/post-template"===o.name){t=o;break}o.innerBlocks.length&&(t=xv(o.innerBlocks))}return t},_v=(e=[],t)=>(e.forEach(((o,n)=>{"core/post-template"===o.name?e.splice(n,1,t):o.innerBlocks.length&&(o.innerBlocks=_v(o.innerBlocks,t))})),e),bv=(e,t)=>{const{displayLayout:o=null,...n}=e;if(!o)return[e,t];const a=xv(t);if(!a)return[e,t];const{type:r,columns:i}=o,s="flex"===r?"grid":"default",l=(0,Ke.createBlock)("core/post-template",{...a.attributes,layout:{type:s,...i&&{columnCount:i}}},a.innerBlocks);return[n,_v(t,l)]},yv={attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},layout:{type:"object",default:{type:"list"}}},supports:{html:!1},migrate(e,t){const o=pv(e),{layout:n,...a}=o,r={...a,displayLayout:o.layout};return bv(r,t)},save:()=>(0,Je.jsx)(nt.InnerBlocks.Content,{})},fv={attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",categoryIds:[],tagIds:[],order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},layout:!0},isEligible:({query:{categoryIds:e,tagIds:t}={}})=>e||t,migrate(e,t){const o=pv(e),[n,a]=mv(o,t),r=hv(n);return bv(r,a)},save({attributes:{tagName:e="div"}}){const t=nt.useBlockProps.save(),o=nt.useInnerBlocksProps.save(t);return(0,Je.jsx)(e,{...o})}},vv={attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0,taxQuery:null,parents:[]}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}},namespace:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},layout:!0},isEligible(e){const{style:t,backgroundColor:o,gradient:n,textColor:a}=e;return o||n||a||t?.color||t?.elements?.link},migrate(e,t){const[o,n]=mv(e,t),a=hv(o);return bv(a,n)},save({attributes:{tagName:e="div"}}){const t=nt.useBlockProps.save(),o=nt.useInnerBlocksProps.save(t);return(0,Je.jsx)(e,{...o})}},kv={attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0,taxQuery:null,parents:[]}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}},namespace:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},layout:!0},save({attributes:{tagName:e="div"}}){const t=nt.useBlockProps.save(),o=nt.useInnerBlocksProps.save(t);return(0,Je.jsx)(e,{...o})},isEligible:({layout:e})=>e?.inherit||e?.contentSize&&"constrained"!==e?.type,migrate(e,t){const o=hv(e);return bv(o,t)}},wv=[{attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0,taxQuery:null,parents:[]}},tagName:{type:"string",default:"div"},displayLayout:{type:"object",default:{type:"list"}},namespace:{type:"string"}},supports:{align:["wide","full"],anchor:!0,html:!1,layout:!0},save({attributes:{tagName:e="div"}}){const t=nt.useBlockProps.save(),o=nt.useInnerBlocksProps.save(t);return(0,Je.jsx)(e,{...o})},isEligible:({displayLayout:e})=>!!e,migrate:bv},kv,vv,fv,yv],Cv={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query",title:"Query Loop",category:"theme",description:"An advanced block that allows displaying post types based on different query parameters and visual configurations.",keywords:["posts","list","blog","blogs","custom post types"],textdomain:"default",attributes:{queryId:{type:"number"},query:{type:"object",default:{perPage:null,pages:0,offset:0,postType:"post",order:"desc",orderBy:"date",author:"",search:"",exclude:[],sticky:"",inherit:!0,taxQuery:null,parents:[],format:[]}},tagName:{type:"string",default:"div"},namespace:{type:"string"},enhancedPagination:{type:"boolean",default:!1}},usesContext:["templateSlug"],providesContext:{queryId:"queryId",query:"query",displayLayout:"displayLayout",enhancedPagination:"enhancedPagination"},supports:{align:["wide","full"],html:!1,layout:!0,interactivity:!0},editorStyle:"wp-block-query-editor"},{name:jv}=Cv,Sv={icon:_f,edit:rv,example:{viewportWidth:650,attributes:{namespace:"core/posts-list",query:{perPage:4,pages:1,offset:0,postType:"post",order:"desc",orderBy:"date",author:"",search:"",sticky:"exclude",inherit:!1}},innerBlocks:[{name:"core/post-template",attributes:{layout:{type:"grid",columnCount:2}},innerBlocks:[{name:"core/post-title"},{name:"core/post-date"},{name:"core/post-excerpt"}]}]},save:function({attributes:{tagName:e="div"}}){const t=nt.useBlockProps.save(),o=nt.useInnerBlocksProps.save(t);return(0,Je.jsx)(e,{...o})},variations:uv,deprecated:wv},Bv=()=>et({name:jv,metadata:Cv,settings:Sv}),Tv=[["core/paragraph",{placeholder:(0,ot.__)("Add text or blocks that will display when a query returns no results.")}]];const Nv={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-no-results",title:"No Results",category:"theme",description:"Contains the block elements used to render content when no query results are found.",ancestor:["core/query"],textdomain:"default",usesContext:["queryId","query"],supports:{align:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:Pv}=Nv,Iv={icon:_f,edit:function(){const e=(0,nt.useBlockProps)(),t=(0,nt.useInnerBlocksProps)(e,{template:Tv});return(0,Je.jsx)("div",{...t})},save:function(){return(0,Je.jsx)(nt.InnerBlocks.Content,{})},example:{innerBlocks:[{name:"core/paragraph",attributes:{content:(0,ot.__)("No posts were found.")}}]}},Mv=()=>et({name:Pv,metadata:Nv,settings:Iv});function Dv({value:e,onChange:t}){return(0,Je.jsxs)(tt.__experimentalToggleGroupControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Arrow"),value:e,onChange:t,help:(0,ot.__)("A decorative arrow appended to the next and previous page link."),isBlock:!0,children:[(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"none",label:(0,ot._x)("None","Arrow option for Query Pagination Next/Previous blocks")}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"arrow",label:(0,ot._x)("Arrow","Arrow option for Query Pagination Next/Previous blocks")}),(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:"chevron",label:(0,ot._x)("Chevron","Arrow option for Query Pagination Next/Previous blocks")})]})}function zv({value:e,onChange:t}){return(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show label text"),help:(0,ot.__)('Make label text visible, e.g. "Next Page".'),onChange:t,checked:!0===e})}const Av=[["core/query-pagination-previous"],["core/query-pagination-numbers"],["core/query-pagination-next"]];const Rv=[{save:()=>(0,Je.jsx)("div",{...nt.useBlockProps.save(),children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})}],Hv={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-pagination",title:"Pagination",category:"theme",ancestor:["core/query"],allowedBlocks:["core/query-pagination-previous","core/query-pagination-numbers","core/query-pagination-next"],description:"Displays a paginated navigation to next/previous set of posts, when applicable.",textdomain:"default",attributes:{paginationArrow:{type:"string",default:"none"},showLabel:{type:"boolean",default:!0}},usesContext:["queryId","query"],providesContext:{paginationArrow:"paginationArrow",showLabel:"showLabel"},supports:{align:!0,reusable:!1,html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},layout:{allowSwitching:!1,allowInheriting:!1,default:{type:"flex"}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-query-pagination-editor",style:"wp-block-query-pagination"},{name:Lv}=Hv,Vv={icon:_r,edit:function({attributes:{paginationArrow:e,showLabel:t},setAttributes:o,clientId:n}){const a=(0,it.useSelect)((e=>{const{getBlocks:t}=e(nt.store),o=t(n);return o?.find((e=>["core/query-pagination-next","core/query-pagination-previous"].includes(e.name)))}),[n]),{__unstableMarkNextChangeAsNotPersistent:r}=(0,it.useDispatch)(nt.store),i=mt(),s=(0,nt.useBlockProps)(),l=(0,nt.useInnerBlocksProps)(s,{template:Av});return(0,st.useEffect)((()=>{"none"!==e||t||(r(),o({showLabel:!0}))}),[e,o,t,r]),(0,Je.jsxs)(Je.Fragment,{children:[a&&(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{o({paginationArrow:"none",showLabel:!0})},dropdownMenuProps:i,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>"none"!==e,label:(0,ot.__)("Pagination arrow"),onDeselect:()=>o({paginationArrow:"none"}),isShownByDefault:!0,children:(0,Je.jsx)(Dv,{value:e,onChange:e=>{o({paginationArrow:e})}})}),"none"!==e&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!t,label:(0,ot.__)("Show text"),onDeselect:()=>o({showLabel:!0}),isShownByDefault:!0,children:(0,Je.jsx)(zv,{value:t,onChange:e=>{o({showLabel:e})}})})]})}),(0,Je.jsx)("nav",{...l})]})},save:function(){return(0,Je.jsx)(nt.InnerBlocks.Content,{})},deprecated:Rv},Fv=()=>et({name:Lv,metadata:Hv,settings:Vv}),Ev={none:"",arrow:"→",chevron:"»"};const Ov={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-pagination-next",title:"Next Page",category:"theme",parent:["core/query-pagination"],description:"Displays the next posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query","paginationArrow","showLabel","enhancedPagination"],supports:{reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:$v}=Ov,Gv={icon:Cr,edit:function({attributes:{label:e},setAttributes:t,context:{paginationArrow:o,showLabel:n}}){const a=Ev[o];return(0,Je.jsxs)("a",{href:"#pagination-next-pseudo-link",onClick:e=>e.preventDefault(),...(0,nt.useBlockProps)(),children:[n&&(0,Je.jsx)(nt.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":(0,ot.__)("Next page link"),placeholder:(0,ot.__)("Next Page"),value:e,onChange:e=>t({label:e})}),a&&(0,Je.jsx)("span",{className:`wp-block-query-pagination-next-arrow is-arrow-${o}`,"aria-hidden":!0,children:a})]})}},Uv=()=>et({name:$v,metadata:Ov,settings:Gv}),qv=(e,t="a",o="")=>(0,Je.jsx)(t,{className:`page-numbers ${o}`,children:e},e);const Wv={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-pagination-numbers",title:"Page Numbers",category:"theme",parent:["core/query-pagination"],description:"Displays a list of page numbers for pagination.",textdomain:"default",attributes:{midSize:{type:"number",default:2}},usesContext:["queryId","query","enhancedPagination"],supports:{reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-query-pagination-numbers-editor"},{name:Zv}=Wv,Qv={icon:Pr,edit:function({attributes:e,setAttributes:t}){const{midSize:o}=e,n=(e=>{const t=[];for(let o=1;o<=e;o++)t.push(qv(o));t.push(qv(e+1,"span","current"));for(let o=1;o<=e;o++)t.push(qv(e+1+o));return t.push(qv("...","span","dots")),t.push(qv(2*e+3)),(0,Je.jsx)(Je.Fragment,{children:t})})(parseInt(o,10)),a=mt();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>t({midSize:2}),dropdownMenuProps:a,children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Number of links"),hasValue:()=>2!==o,onDeselect:()=>t({midSize:2}),isShownByDefault:!0,children:(0,Je.jsx)(tt.RangeControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Number of links"),help:(0,ot.__)("Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible."),value:o,onChange:e=>{t({midSize:parseInt(e,10)})},min:0,max:5,withInputField:!1})})})}),(0,Je.jsx)("div",{...(0,nt.useBlockProps)(),children:n})]})},example:{}},Kv=()=>et({name:Zv,metadata:Wv,settings:Qv}),Yv={none:"",arrow:"←",chevron:"«"};const Jv={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-pagination-previous",title:"Previous Page",category:"theme",parent:["core/query-pagination"],description:"Displays the previous posts page link.",textdomain:"default",attributes:{label:{type:"string"}},usesContext:["queryId","query","paginationArrow","showLabel","enhancedPagination"],supports:{reusable:!1,html:!1,color:{gradients:!0,text:!1,__experimentalDefaultControls:{background:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}}},{name:Xv}=Jv,ek={icon:dr,edit:function({attributes:{label:e},setAttributes:t,context:{paginationArrow:o,showLabel:n}}){const a=Yv[o];return(0,Je.jsxs)("a",{href:"#pagination-previous-pseudo-link",onClick:e=>e.preventDefault(),...(0,nt.useBlockProps)(),children:[a&&(0,Je.jsx)("span",{className:`wp-block-query-pagination-previous-arrow is-arrow-${o}`,"aria-hidden":!0,children:a}),n&&(0,Je.jsx)(nt.PlainText,{__experimentalVersion:2,tagName:"span","aria-label":(0,ot.__)("Previous page link"),placeholder:(0,ot.__)("Previous Page"),value:e,onChange:e=>t({label:e})})]})}},tk=()=>et({name:Xv,metadata:Jv,settings:ek});const ok=["archive","search"];const nk=[{isDefault:!0,name:"archive-title",title:(0,ot.__)("Archive Title"),description:(0,ot.__)("Display the archive title based on the queried object."),icon:Rr,attributes:{type:"archive"},scope:["inserter"]},{isDefault:!1,name:"search-title",title:(0,ot.__)("Search Results Title"),description:(0,ot.__)("Display the search results title based on the queried object."),icon:Rr,attributes:{type:"search"},scope:["inserter"]}];nk.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.type===t.type)}));const ak=nk,rk={attributes:{type:{type:"string"},textAlign:{type:"string"},level:{type:"number",default:1}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0}},save:()=>null,migrate:lo,isEligible:({style:e})=>e?.typography?.fontFamily},ik=[rk],sk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-title",title:"Query Title",category:"theme",description:"Display the query title.",textdomain:"default",attributes:{type:{type:"string"},textAlign:{type:"string"},level:{type:"number",default:1},levelOptions:{type:"array"},showPrefix:{type:"boolean",default:!0},showSearchTerm:{type:"boolean",default:!0}},example:{attributes:{type:"search"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-query-title"},{name:lk}=sk,ck={icon:Rr,edit:function({attributes:{type:e,level:t,levelOptions:o,textAlign:n,showPrefix:a,showSearchTerm:r},setAttributes:i}){const{archiveTypeLabel:s,archiveNameLabel:l}=function(){const e=(0,it.useSelect)((e=>{const{getCurrentPostId:t,getCurrentPostType:o,getCurrentTemplateId:n}=e("core/editor"),a=o(),r=n()||("wp_template"===a?t():null);return r?e(ct.store).getEditedEntityRecord("postType","wp_template",r)?.slug:null}),[]),t=e?.match(/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/);let o,n,a,r=!1;if(t)t[1]?o=t[2]?t[2]:t[1]:t[3]&&(o=t[6]?t[6]:t[4],n=t[7]),o="tag"===o?"post_tag":o;else{const t=e?.match(/^(author)$|^author-(.+)$/);t&&(r=!0,t[2]&&(a=t[2]))}return(0,it.useSelect)((e=>{const{getEntityRecords:t,getTaxonomy:i,getAuthors:s}=e(ct.store);let l,c;if(o&&(l=i(o)?.labels?.singular_name),n){const e=t("taxonomy",o,{slug:n,per_page:1});e&&e[0]&&(c=e[0].name)}if(r&&(l="Author",a)){const e=s({slug:a});e&&e[0]&&(c=e[0].name)}return{archiveTypeLabel:l,archiveNameLabel:c}}),[a,r,o,n])}(),c=mt(),u=`h${t}`,d=(0,nt.useBlockProps)({className:ft("wp-block-query-title__placeholder",{[`has-text-align-${n}`]:n})});if(!ok.includes(e))return(0,Je.jsx)("div",{...d,children:(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("Provided type is not supported.")})});let p;if("archive"===e){let e;e=s?a?l?(0,ot.sprintf)((0,ot._x)("%1$s: %2$s","archive label"),s,l):(0,ot.sprintf)((0,ot.__)("%s: Name"),s):l||(0,ot.sprintf)((0,ot.__)("%s name"),s):a?(0,ot.__)("Archive type: Name"):(0,ot.__)("Archive title"),p=(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>i({showPrefix:!0}),dropdownMenuProps:c,children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!a,label:(0,ot.__)("Show archive type in title"),onDeselect:()=>i({showPrefix:!0}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show archive type in title"),onChange:()=>i({showPrefix:!a}),checked:a})})})}),(0,Je.jsx)(u,{...d,children:e})]})}return"search"===e&&(p=(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>i({showSearchTerm:!0}),dropdownMenuProps:c,children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!r,label:(0,ot.__)("Show search term in title"),onDeselect:()=>i({showSearchTerm:!0}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show search term in title"),onChange:()=>i({showSearchTerm:!r}),checked:r})})})}),(0,Je.jsx)(u,{...d,children:r?(0,ot.__)("Search results for: “search term”"):(0,ot.__)("Search results")})]})),(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(nt.BlockControls,{group:"block",children:[(0,Je.jsx)(nt.HeadingLevelDropdown,{value:t,options:o,onChange:e=>i({level:e})}),(0,Je.jsx)(nt.AlignmentControl,{value:n,onChange:e=>{i({textAlign:e})}})]}),p]})},variations:ak,deprecated:ik},uk=()=>et({name:lk,metadata:sk,settings:ck}),dk=(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:(0,Je.jsx)(tt.Path,{d:"M4 11h4v2H4v-2zm6 0h6v2h-6v-2zm8 0h2v2h-2v-2z"})}),pk=(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:(0,Je.jsx)(tt.Path,{d:"M4 13h2v-2H4v2zm4 0h10v-2H8v2zm12 0h2v-2h-2v2z"})}),mk=(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",children:(0,Je.jsx)(tt.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2Zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12Zm-7-6-4.1 5h8.8v-3h-1.5v1.5h-4.2l2.9-3.5-2.9-3.5h4.2V10h1.5V7H7.4l4.1 5Z"})});const gk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/query-total",title:"Query Total",category:"theme",ancestor:["core/query"],description:"Display the total number of results in a query.",textdomain:"default",attributes:{displayType:{type:"string",default:"total-results"}},usesContext:["queryId","query"],supports:{align:["wide","full"],html:!1,spacing:{margin:!0,padding:!0},color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-query-total"},{name:hk}=gk,xk={icon:mk,edit:function({attributes:e,setAttributes:t}){const{displayType:o}=e,n=(0,nt.useBlockProps)(),a=[{role:"menuitemradio",title:(0,ot.__)("Total results"),isActive:"total-results"===o,icon:dk,onClick:()=>{t({displayType:"total-results"})}},{role:"menuitemradio",title:(0,ot.__)("Range display"),isActive:"range-display"===o,icon:pk,onClick:()=>{t({displayType:"range-display"})}}],r=(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(tt.ToolbarGroup,{children:(0,Je.jsx)(tt.ToolbarDropdownMenu,{icon:(()=>{switch(o){case"total-results":return dk;case"range-display":return pk}})(),label:(0,ot.__)("Change display type"),controls:a})})});return(0,Je.jsxs)("div",{...n,children:[r,"total-results"===o?(0,Je.jsx)(Je.Fragment,{children:(0,ot.__)("12 results found")}):"range-display"===o?(0,Je.jsx)(Je.Fragment,{children:(0,ot.__)("Displaying 1 – 10 of 12")}):null]})}},_k=()=>et({name:hk,metadata:gk,settings:xk}),bk=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z"})}),yk=e=>{const{value:t,...o}=e;return[{...o},t?(0,Ke.parseWithAttributeSchema)(t,{type:"array",source:"query",selector:"p",query:{content:{type:"string",source:"html"}}}).map((({content:e})=>(0,Ke.createBlock)("core/paragraph",{content:e}))):(0,Ke.createBlock)("core/paragraph")]},fk=["left","right","center"],vk=(e,t)=>{const{align:o,...n}=e;return[fk.includes(o)?{...n,textAlign:o}:e,t]},kk={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:"",role:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",role:"content"},align:{type:"string"}},supports:{anchor:!0,html:!1,__experimentalOnEnter:!0,__experimentalOnMerge:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}},color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}}},isEligible:({align:e})=>fk.includes(e),save({attributes:e}){const{align:t,citation:o}=e,n=ft({[`has-text-align-${t}`]:t});return(0,Je.jsxs)("blockquote",{...nt.useBlockProps.save({className:n}),children:[(0,Je.jsx)(nt.InnerBlocks.Content,{}),!nt.RichText.isEmpty(o)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"cite",value:o})]})},migrate:vk},wk={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:"",role:"content"},citation:{type:"string",source:"html",selector:"cite",default:"",role:"content"},align:{type:"string"}},supports:{anchor:!0,__experimentalSlashInserter:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalDefaultControls:{fontSize:!0,fontAppearance:!0}}},save({attributes:e}){const{align:t,value:o,citation:n}=e,a=ft({[`has-text-align-${t}`]:t});return(0,Je.jsxs)("blockquote",{...nt.useBlockProps.save({className:a}),children:[(0,Je.jsx)(nt.RichText.Content,{multiline:!0,value:o}),!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"cite",value:n})]})},migrate:e=>vk(...yk(e))},Ck={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:""},citation:{type:"string",source:"html",selector:"cite",default:""},align:{type:"string"}},migrate:e=>vk(...yk(e)),save({attributes:e}){const{align:t,value:o,citation:n}=e;return(0,Je.jsxs)("blockquote",{style:{textAlign:t||null},children:[(0,Je.jsx)(nt.RichText.Content,{multiline:!0,value:o}),!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"cite",value:n})]})}},jk={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:""},citation:{type:"string",source:"html",selector:"cite",default:""},align:{type:"string"},style:{type:"number",default:1}},migrate(e){if(2===e.style){const{style:t,...o}=e;return vk(...((e,t)=>[{...e,className:e.className?e.className+" is-style-large":"is-style-large"},t])(...yk(o)))}return vk(...yk(e))},save({attributes:e}){const{align:t,value:o,citation:n,style:a}=e;return(0,Je.jsxs)("blockquote",{className:2===a?"is-large":"",style:{textAlign:t||null},children:[(0,Je.jsx)(nt.RichText.Content,{multiline:!0,value:o}),!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"cite",value:n})]})}},Sk={attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:""},citation:{type:"string",source:"html",selector:"footer",default:""},align:{type:"string"},style:{type:"number",default:1}},migrate(e){if(!isNaN(parseInt(e.style))){const{style:t,...o}=e;return vk(...yk(o))}return vk(...yk(e))},save({attributes:e}){const{align:t,value:o,citation:n,style:a}=e;return(0,Je.jsxs)("blockquote",{className:`blocks-quote-style-${a}`,style:{textAlign:t||null},children:[(0,Je.jsx)(nt.RichText.Content,{multiline:!0,value:o}),!nt.RichText.isEmpty(n)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"footer",value:n})]})}},Bk=[kk,wk,Ck,jk,Sk],Tk=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z"})}),Nk="web"===st.Platform.OS,Pk=[["core/paragraph",{}]];const Ik={from:[{type:"block",blocks:["core/pullquote"],transform:({value:e,align:t,citation:o,anchor:n,fontSize:a,style:r})=>(0,Ke.createBlock)("core/quote",{align:t,citation:o,anchor:n,fontSize:a,style:r},[(0,Ke.createBlock)("core/paragraph",{content:e})])},{type:"prefix",prefix:">",transform:e=>(0,Ke.createBlock)("core/quote",{},[(0,Ke.createBlock)("core/paragraph",{content:e})])},{type:"raw",schema:()=>({blockquote:{children:"*"}}),selector:"blockquote",transform:(e,t)=>(0,Ke.createBlock)("core/quote",{},t({HTML:e.innerHTML,mode:"BLOCKS"}))},{type:"block",isMultiBlock:!0,blocks:["*"],isMatch:({},e)=>1===e.length?["core/paragraph","core/heading","core/list","core/pullquote"].includes(e[0].name):!e.some((({name:e})=>"core/quote"===e)),__experimentalConvert:e=>(0,Ke.createBlock)("core/quote",{},e.map((e=>(0,Ke.createBlock)(e.name,e.attributes,e.innerBlocks))))}],to:[{type:"block",blocks:["core/pullquote"],isMatch:({},e)=>e.innerBlocks.every((({name:e})=>"core/paragraph"===e)),transform:({align:e,citation:t,anchor:o,fontSize:n,style:a},r)=>{const i=r.map((({attributes:e})=>`${e.content}`)).join("<br>");return(0,Ke.createBlock)("core/pullquote",{value:i,align:e,citation:t,anchor:o,fontSize:n,style:a})}},{type:"block",blocks:["core/paragraph"],transform:({citation:e},t)=>nt.RichText.isEmpty(e)?t:[...t,(0,Ke.createBlock)("core/paragraph",{content:e})]},{type:"block",blocks:["core/group"],transform:({citation:e,anchor:t},o)=>(0,Ke.createBlock)("core/group",{anchor:t},nt.RichText.isEmpty(e)?o:[...o,(0,Ke.createBlock)("core/paragraph",{content:e})])}],ungroup:({citation:e},t)=>nt.RichText.isEmpty(e)?t:[...t,(0,Ke.createBlock)("core/paragraph",{content:e})]},Mk=Ik,Dk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/quote",title:"Quote",category:"text",description:'Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Julio Cortázar',keywords:["blockquote","cite"],textdomain:"default",attributes:{value:{type:"string",source:"html",selector:"blockquote",multiline:"p",default:"",role:"content"},citation:{type:"rich-text",source:"rich-text",selector:"cite",role:"content"},textAlign:{type:"string"}},supports:{anchor:!0,align:["left","right","wide","full"],html:!1,background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},__experimentalBorder:{color:!0,radius:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,radius:!0,style:!0,width:!0}},dimensions:{minHeight:!0,__experimentalDefaultControls:{minHeight:!1}},__experimentalOnEnter:!0,__experimentalOnMerge:!0,typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},color:{gradients:!0,heading:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},layout:{allowEditing:!1},spacing:{blockGap:!0,padding:!0,margin:!0},interactivity:{clientNavigation:!0}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"plain",label:"Plain"}],editorStyle:"wp-block-quote-editor",style:"wp-block-quote"},{name:zk}=Dk,Ak={icon:bk,example:{attributes:{citation:"Julio Cortázar"},innerBlocks:[{name:"core/paragraph",attributes:{content:(0,ot.__)("In quoting others, we cite ourselves.")}}]},transforms:Mk,edit:function({attributes:e,setAttributes:t,insertBlocksAfter:o,clientId:n,className:a,style:r,isSelected:i}){const{textAlign:s}=e;((e,t)=>{const o=(0,it.useRegistry)(),{updateBlockAttributes:n,replaceInnerBlocks:a}=(0,it.useDispatch)(nt.store);(0,st.useEffect)((()=>{if(!e.value)return;const[r,i]=yk(e);Kp()("Value attribute on the quote block",{since:"6.0",version:"6.5",alternative:"inner blocks"}),o.batch((()=>{n(t,r),a(t,i)}))}),[e.value])})(e,n);const l=(0,nt.useBlockProps)({className:ft(a,{[`has-text-align-${s}`]:s}),...!Nk&&{style:r}}),c=(0,nt.useInnerBlocksProps)(l,{template:Pk,templateInsertUpdatesSelection:!0,__experimentalCaptureToolbars:!0,renderAppender:!1});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:s,onChange:e=>{t({textAlign:e})}})}),(0,Je.jsxs)(tt.BlockQuotation,{...c,children:[c.children,(0,Je.jsx)(Yt,{attributeKey:"citation",tagName:Nk?"cite":"p",style:Nk&&{display:"block"},isSelected:i,attributes:e,setAttributes:t,__unstableMobileNoFocusOnMount:!0,icon:Tk,label:(0,ot.__)("Quote citation"),placeholder:(0,ot.__)("Add citation"),addLabel:(0,ot.__)("Add citation"),removeLabel:(0,ot.__)("Remove citation"),excludeElementClassName:!0,className:"wp-block-quote__citation",insertBlocksAfter:o,...Nk?{}:{textAlign:s}})]})]})},save:function({attributes:e}){const{textAlign:t,citation:o}=e,n=ft({[`has-text-align-${t}`]:t});return(0,Je.jsxs)("blockquote",{...nt.useBlockProps.save({className:n}),children:[(0,Je.jsx)(nt.InnerBlocks.Content,{}),!nt.RichText.isEmpty(o)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"cite",value:o})]})},deprecated:Bk},Rk=()=>et({name:zk,metadata:Dk,settings:Ak}),Hk=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})}),Lk=window.wp.patterns,{useLayoutClasses:Vk}=Ot(nt.privateApis),{hasOverridableBlocks:Fk}=Ot(Lk.privateApis),Ek=["full","wide","left","right"];function Ok(){const e=(0,nt.useBlockProps)();return(0,Je.jsx)("div",{...e,children:(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("Block cannot be rendered inside itself.")})})}const $k=()=>{};function Gk({recordId:e,canOverrideBlocks:t,hasContent:o,handleEditOriginal:n,resetContent:a}){const r=(0,it.useSelect)((t=>!!t(ct.store).canUser("update",{kind:"postType",name:"wp_block",id:e})),[e]);return(0,Je.jsxs)(Je.Fragment,{children:[r&&!!n&&(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(tt.ToolbarGroup,{children:(0,Je.jsx)(tt.ToolbarButton,{onClick:n,children:(0,ot.__)("Edit original")})})}),t&&(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(tt.ToolbarGroup,{children:(0,Je.jsx)(tt.ToolbarButton,{onClick:a,disabled:!o,children:(0,ot.__)("Reset")})})})]})}function Uk({name:e,attributes:{ref:t,content:o},__unstableParentLayout:n,setAttributes:a}){const{record:r,hasResolved:i}=(0,ct.useEntityRecord)("postType","wp_block",t),[s]=(0,ct.useEntityBlockEditor)("postType","wp_block",{id:t}),l=i&&!r,{__unstableMarkLastChangeAsPersistent:c}=(0,it.useDispatch)(nt.store),{onNavigateToEntityRecord:u,hasPatternOverridesSource:d}=(0,it.useSelect)((e=>{const{getSettings:t}=e(nt.store);return{onNavigateToEntityRecord:t().onNavigateToEntityRecord,hasPatternOverridesSource:!!(0,Ke.getBlockBindingsSource)("core/pattern-overrides")}}),[]),p=(0,st.useMemo)((()=>d&&Fk(s)),[d,s]),{alignment:m,layout:g}=((e,t)=>{const o=(0,st.useRef)();return(0,st.useMemo)((()=>{if(!e?.length)return{};let n=o.current;if(void 0===n){const a="constrained"===t?.type,r=e.some((e=>Ek.includes(e.attributes.align)));n=a&&r?"full":null,o.current=n}return{alignment:n,layout:n?t:void 0}}),[e,t])})(s,n),h=Vk({layout:g},e),x=(0,nt.useBlockProps)({className:ft("block-library-block__reusable-block-container",g&&h,{[`align${m}`]:m})}),_=(0,nt.useInnerBlocksProps)(x,{layout:g,value:s,onInput:$k,onChange:$k,renderAppender:s?.length?void 0:nt.InnerBlocks.ButtonBlockAppender});let b=null;return l&&(b=(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("Block has been deleted or is unavailable.")})),i||(b=(0,Je.jsx)(tt.Placeholder,{children:(0,Je.jsx)(tt.Spinner,{})})),(0,Je.jsxs)(Je.Fragment,{children:[i&&!l&&(0,Je.jsx)(Gk,{recordId:t,canOverrideBlocks:p,hasContent:!!o,handleEditOriginal:u?()=>{u({postId:t,postType:"wp_block"})}:void 0,resetContent:()=>{o&&(c(),a({content:void 0}))}}),null===b?(0,Je.jsx)("div",{..._}):(0,Je.jsx)("div",{...x,children:b})]})}const qk={attributes:{ref:{type:"number"},content:{type:"object"}},supports:{customClassName:!1,html:!1,inserter:!1,renaming:!1},isEligible:({content:e})=>!!e&&Object.keys(e).every((t=>{return e[t].values&&("object"==typeof(o=e[t].values)&&!Array.isArray(o)&&null!==o);var o})),migrate(e){const{content:t,...o}=e;if(t&&Object.keys(t).length){const e={...t};for(const o in t)e[o]=t[o].values;return{...o,content:e}}return e}},Wk={attributes:{ref:{type:"number"},overrides:{type:"object"}},supports:{customClassName:!1,html:!1,inserter:!1,renaming:!1},isEligible:({overrides:e})=>!!e,migrate(e){const{overrides:t,...o}=e,n={};return Object.keys(t).forEach((e=>{n[e]=t[e]})),{...o,content:n}}},Zk=[qk,Wk],Qk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/block",title:"Pattern",category:"reusable",description:"Reuse this design across your site.",keywords:["reusable"],textdomain:"default",attributes:{ref:{type:"number"},content:{type:"object",default:{}}},providesContext:{"pattern/overrides":"content"},supports:{customClassName:!1,html:!1,inserter:!1,renaming:!1,interactivity:{clientNavigation:!0}}},{name:Kk}=Qk,Yk={deprecated:Zk,edit:function(e){const{ref:t}=e.attributes;return(0,nt.useHasRecursion)(t)?(0,Je.jsx)(Ok,{}):(0,Je.jsx)(nt.RecursionProvider,{uniqueId:t,children:(0,Je.jsx)(Uk,{...e})})},icon:Hk,__experimentalLabel:({ref:e})=>{if(!e)return;const t=(0,it.select)(ct.store).getEditedEntityRecord("postType","wp_block",e);return t?.title?(0,tn.decodeEntities)(t.title):void 0}},Jk=()=>et({name:Kk,metadata:Qk,settings:Yk});const Xk={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/read-more",title:"Read More",category:"theme",description:"Displays the link of a post, page, or any other content-type.",textdomain:"default",attributes:{content:{type:"string"},linkTarget:{type:"string",default:"_self"}},usesContext:["postId"],supports:{html:!1,color:{gradients:!0,text:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0,textDecoration:!0}},spacing:{margin:["top","bottom"],padding:!0,__experimentalDefaultControls:{padding:!0}},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalDefaultControls:{width:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-read-more"},{name:ew}=Xk,tw={icon:Co,edit:function({attributes:{content:e,linkTarget:t},setAttributes:o,insertBlocksAfter:n}){const a=(0,nt.useBlockProps)(),r=mt();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>o({linkTarget:"_self"}),dropdownMenuProps:r,children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Open in new tab"),isShownByDefault:!0,hasValue:()=>"_self"!==t,onDeselect:()=>o({linkTarget:"_self"}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open in new tab"),onChange:e=>o({linkTarget:e?"_blank":"_self"}),checked:"_blank"===t})})})}),(0,Je.jsx)(nt.RichText,{identifier:"content",tagName:"a","aria-label":(0,ot.__)("“Read more” link text"),placeholder:(0,ot.__)("Read more"),value:e,onChange:e=>o({content:e}),__unstableOnSplitAtEnd:()=>n((0,Ke.createBlock)((0,Ke.getDefaultBlockName)())),withoutInteractiveFormatting:!0,...a})]})},example:{attributes:{content:(0,ot.__)("Read more")}}},ow=()=>et({name:ew,metadata:Xk,settings:tw}),nw=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z"})});const aw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/rss",title:"RSS",category:"widgets",description:"Display entries from any RSS or Atom feed.",keywords:["atom","feed"],textdomain:"default",attributes:{columns:{type:"number",default:2},blockLayout:{type:"string",default:"list"},feedURL:{type:"string",default:""},itemsToShow:{type:"number",default:5},displayExcerpt:{type:"boolean",default:!1},displayAuthor:{type:"boolean",default:!1},displayDate:{type:"boolean",default:!1},excerptLength:{type:"number",default:55}},supports:{align:!0,html:!1,interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{padding:!1,margin:!1}},color:{background:!0,text:!0,gradients:!0,link:!0}},editorStyle:"wp-block-rss-editor",style:"wp-block-rss"},{name:rw}=aw,iw={icon:nw,example:{attributes:{feedURL:"https://wordpress.org"}},edit:function({attributes:e,setAttributes:t}){const[o,n]=(0,st.useState)(!e.feedURL),{blockLayout:a,columns:r,displayAuthor:i,displayDate:s,displayExcerpt:l,excerptLength:c,feedURL:u,itemsToShow:d}=e;function p(o){return()=>{const n=e[o];t({[o]:!n})}}const m=(0,nt.useBlockProps)(),g=(0,ot.__)("RSS URL");if(o)return(0,Je.jsx)("div",{...m,children:(0,Je.jsx)(tt.Placeholder,{icon:nw,label:g,instructions:(0,ot.__)("Display entries from any RSS or Atom feed."),children:(0,Je.jsxs)("form",{onSubmit:function(e){e.preventDefault(),u&&(t({feedURL:(0,vt.prependHTTP)(u)}),n(!1))},className:"wp-block-rss__placeholder-form",children:[(0,Je.jsx)(tt.__experimentalInputControl,{__next40pxDefaultSize:!0,label:g,type:"url",hideLabelFromVision:!0,placeholder:(0,ot.__)("Enter URL here…"),value:u,onChange:e=>t({feedURL:e}),className:"wp-block-rss__placeholder-input"}),(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,ot.__)("Apply")})]})})});const h=[{icon:Ys,title:(0,ot.__)("Edit RSS URL"),onClick:()=>n(!0)},{icon:Np,title:(0,ot._x)("List view","RSS block display setting"),onClick:()=>t({blockLayout:"list"}),isActive:"list"===a},{icon:Zu,title:(0,ot._x)("Grid view","RSS block display setting"),onClick:()=>t({blockLayout:"grid"}),isActive:"grid"===a}],x={...e,style:{...e?.style,border:void 0,spacing:void 0}};return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(tt.ToolbarGroup,{controls:h})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Number of items"),value:d,onChange:e=>t({itemsToShow:e}),min:1,max:20,required:!0}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display author"),checked:i,onChange:p("displayAuthor")}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display date"),checked:s,onChange:p("displayDate")}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Display excerpt"),checked:l,onChange:p("displayExcerpt")}),l&&(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Max number of words in excerpt"),value:c,onChange:e=>t({excerptLength:e}),min:10,max:100,required:!0}),"grid"===a&&(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Columns"),value:r,onChange:e=>t({columns:e}),min:2,max:6,required:!0})]})}),(0,Je.jsx)("div",{...m,children:(0,Je.jsx)(tt.Disabled,{children:(0,Je.jsx)(rt(),{block:"core/rss",attributes:x})})})]})}},sw=()=>et({name:rw,metadata:aw,settings:iw}),lw=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})}),cw=(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.Rect,{x:"7",y:"10",width:"10",height:"4",rx:"1",fill:"currentColor"})}),uw=(0,Je.jsxs)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(tt.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"9.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,Je.jsx)(tt.Rect,{x:"16",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})]}),dw=(0,Je.jsxs)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(tt.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,Je.jsx)(tt.Rect,{x:"14",y:"10",width:"4",height:"4",rx:"1",fill:"currentColor"})]}),pw=(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(tt.Rect,{x:"4.75",y:"15.25",width:"6.5",height:"14.5",transform:"rotate(-90 4.75 15.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"})}),mw=(0,Je.jsxs)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(tt.Rect,{x:"4.75",y:"7.75",width:"14.5",height:"8.5",rx:"1.25",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),(0,Je.jsx)(tt.Rect,{x:"8",y:"11",width:"8",height:"2",fill:"currentColor"})]}),gw=(0,Je.jsxs)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(tt.Rect,{x:"4.75",y:"17.25",width:"5.5",height:"14.5",transform:"rotate(-90 4.75 17.25)",stroke:"currentColor",fill:"none",strokeWidth:"1.5"}),(0,Je.jsx)(tt.Rect,{x:"4",y:"7",width:"10",height:"2",fill:"currentColor"})]});function hw(e){return"%"===e}const xw=[25,50,75,100];const _w=[{name:"default",isDefault:!0,attributes:{buttonText:(0,ot.__)("Search"),label:(0,ot.__)("Search")}}],bw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/search",title:"Search",category:"widgets",description:"Help visitors find your content.",keywords:["find"],textdomain:"default",attributes:{label:{type:"string",role:"content"},showLabel:{type:"boolean",default:!0},placeholder:{type:"string",default:"",role:"content"},width:{type:"number"},widthUnit:{type:"string"},buttonText:{type:"string",role:"content"},buttonPosition:{type:"string",default:"button-outside"},buttonUseIcon:{type:"boolean",default:!1},query:{type:"object",default:{}},isSearchFieldHidden:{type:"boolean",default:!1}},supports:{align:["left","center","right"],color:{gradients:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{background:!0,text:!0}},interactivity:!0,typography:{__experimentalSkipSerialization:!0,__experimentalSelector:".wp-block-search__label, .wp-block-search__input, .wp-block-search__button",fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{color:!0,radius:!0,width:!0,__experimentalSkipSerialization:!0,__experimentalDefaultControls:{color:!0,radius:!0,width:!0}},spacing:{margin:!0},html:!1},editorStyle:"wp-block-search-editor",style:"wp-block-search"},{name:yw}=bw,fw={icon:lw,example:{attributes:{buttonText:(0,ot.__)("Search"),label:(0,ot.__)("Search")},viewportWidth:400},variations:_w,edit:function({className:e,attributes:t,setAttributes:o,toggleSelection:n,isSelected:a,clientId:r}){const{label:i,showLabel:s,placeholder:l,width:c,widthUnit:u,align:d,buttonText:p,buttonPosition:m,buttonUseIcon:g,isSearchFieldHidden:h,style:x}=t,_=(0,it.useSelect)((e=>{const{getBlockParentsByBlockName:t,wasBlockJustInserted:o}=e(nt.store);return!!t(r,"core/navigation")?.length&&o(r)}),[r]),{__unstableMarkNextChangeAsNotPersistent:b}=(0,it.useDispatch)(nt.store);(0,st.useEffect)((()=>{_&&(b(),o({showLabel:!1,buttonUseIcon:!0,buttonPosition:"button-inside"}))}),[b,_,o]);const y=x?.border?.radius;let f=(0,nt.__experimentalUseBorderProps)(t);"number"==typeof y&&(f={...f,style:{...f.style,borderRadius:`${y}px`}});const v=(0,nt.__experimentalUseColorProps)(t),[k,w]=(0,nt.useSettings)("typography.fluid","layout"),C=(0,nt.getTypographyClassesAndStyles)(t,{typography:{fluid:k},layout:{wideSize:w?.wideSize}}),j=`wp-block-search__width-${(0,ut.useInstanceId)(tt.__experimentalUnitControl)}`,S="button-inside"===m,B="button-outside"===m,T="no-button"===m,N="button-only"===m,P=(0,st.useRef)(),I=(0,st.useRef)(),M=(0,tt.__experimentalUseCustomUnits)({availableUnits:["%","px"],defaultValues:{"%":50,px:350}});(0,st.useEffect)((()=>{N&&!a&&o({isSearchFieldHidden:!0})}),[N,a,o]),(0,st.useEffect)((()=>{N&&a&&o({isSearchFieldHidden:!1})}),[N,a,o,c]);const D=[{role:"menuitemradio",title:(0,ot.__)("Button outside"),isActive:"button-outside"===m,icon:uw,onClick:()=>{o({buttonPosition:"button-outside",isSearchFieldHidden:!1})}},{role:"menuitemradio",title:(0,ot.__)("Button inside"),isActive:"button-inside"===m,icon:dw,onClick:()=>{o({buttonPosition:"button-inside",isSearchFieldHidden:!1})}},{role:"menuitemradio",title:(0,ot.__)("No button"),isActive:"no-button"===m,icon:pw,onClick:()=>{o({buttonPosition:"no-button",isSearchFieldHidden:!1})}},{role:"menuitemradio",title:(0,ot.__)("Button only"),isActive:"button-only"===m,icon:cw,onClick:()=>{o({buttonPosition:"button-only",isSearchFieldHidden:!0})}}],z=()=>{const e=ft("wp-block-search__input",S?void 0:f.className,C.className),t={...S?{borderRadius:y}:f.style,...C.style,textDecoration:void 0};return(0,Je.jsx)("input",{type:"search",className:e,style:t,"aria-label":(0,ot.__)("Optional placeholder text"),placeholder:l?void 0:(0,ot.__)("Optional placeholder…"),value:l,onChange:e=>o({placeholder:e.target.value}),ref:P})},A=mt(),R=(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsxs)(tt.ToolbarGroup,{children:[(0,Je.jsx)(tt.ToolbarButton,{title:(0,ot.__)("Show search label"),icon:gw,onClick:()=>{o({showLabel:!s})},className:s?"is-pressed":void 0}),(0,Je.jsx)(tt.ToolbarDropdownMenu,{icon:(()=>{switch(m){case"button-inside":return dw;case"button-outside":return uw;case"no-button":return pw;case"button-only":return cw}})(),label:(0,ot.__)("Change button position"),controls:D}),!T&&(0,Je.jsx)(tt.ToolbarButton,{title:(0,ot.__)("Use button with icon"),icon:mw,onClick:()=>{o({buttonUseIcon:!g})},className:g?"is-pressed":void 0})]})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{o({width:void 0,widthUnit:void 0})},dropdownMenuProps:A,children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!c,label:(0,ot.__)("Width"),onDeselect:()=>{o({width:void 0,widthUnit:void 0})},isShownByDefault:!0,children:(0,Je.jsxs)(tt.__experimentalVStack,{children:[(0,Je.jsx)(tt.__experimentalUnitControl,{__next40pxDefaultSize:!0,label:(0,ot.__)("Width"),id:j,min:hw(u)?0:220,max:hw(u)?100:void 0,step:1,onChange:e=>{const t=""===e?void 0:parseInt(e,10);o({width:t})},onUnitChange:e=>{o({width:"%"===e?50:350,widthUnit:e})},__unstableInputWidth:"80px",value:`${c}${u}`,units:M}),(0,Je.jsx)(tt.__experimentalToggleGroupControl,{label:(0,ot.__)("Percentage Width"),value:xw.includes(c)&&"%"===u?c:void 0,hideLabelFromVision:!0,onChange:e=>{o({width:e,widthUnit:"%"})},isBlock:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:xw.map((e=>(0,Je.jsx)(tt.__experimentalToggleGroupControlOption,{value:e,label:(0,ot.sprintf)((0,ot.__)("%d%%"),e)},e)))})]})})})})]}),H=e=>e?`calc(${e} + 4px)`:void 0,L=(0,nt.useBlockProps)({className:ft(e,S?"wp-block-search__button-inside":void 0,B?"wp-block-search__button-outside":void 0,T?"wp-block-search__no-button":void 0,N?"wp-block-search__button-only":void 0,g||T?void 0:"wp-block-search__text-button",g&&!T?"wp-block-search__icon-button":void 0,N&&h?"wp-block-search__searchfield-hidden":void 0),style:{...C.style,textDecoration:void 0}}),V=ft("wp-block-search__label",C.className);return(0,Je.jsxs)("div",{...L,children:[R,s&&(0,Je.jsx)(nt.RichText,{identifier:"label",className:V,"aria-label":(0,ot.__)("Label text"),placeholder:(0,ot.__)("Add label…"),withoutInteractiveFormatting:!0,value:i,onChange:e=>o({label:e}),style:C.style}),(0,Je.jsxs)(tt.ResizableBox,{size:{width:void 0===c?"auto":`${c}${u}`,height:"auto"},className:ft("wp-block-search__inside-wrapper",S?f.className:void 0),style:(()=>{const e=S?f.style:{borderRadius:f.style?.borderRadius,borderTopLeftRadius:f.style?.borderTopLeftRadius,borderTopRightRadius:f.style?.borderTopRightRadius,borderBottomLeftRadius:f.style?.borderBottomLeftRadius,borderBottomRightRadius:f.style?.borderBottomRightRadius},t=void 0!==y&&0!==parseInt(y,10);if(S&&t){if("object"==typeof y){const{topLeft:t,topRight:o,bottomLeft:n,bottomRight:a}=y;return{...e,borderTopLeftRadius:H(t),borderTopRightRadius:H(o),borderBottomLeftRadius:H(n),borderBottomRightRadius:H(a)}}const t=Number.isInteger(y)?`${y}px`:y;e.borderRadius=`calc(${t} + 4px)`}return e})(),minWidth:220,enable:N?{}:{right:"right"!==d,left:"right"===d},onResizeStart:(e,t,a)=>{o({width:parseInt(a.offsetWidth,10),widthUnit:"px"}),n(!1)},onResizeStop:(e,t,a,r)=>{o({width:parseInt(c+r.width,10)}),n(!0)},showHandle:a,children:[(S||B||N)&&(0,Je.jsxs)(Je.Fragment,{children:[z(),(()=>{const e=ft("wp-block-search__button",v.className,C.className,S?void 0:f.className,g?"has-icon":void 0,(0,nt.__experimentalGetElementClassName)("button")),t={...v.style,...C.style,...S?{borderRadius:y}:f.style},n=()=>{N&&o({isSearchFieldHidden:!h})};return(0,Je.jsxs)(Je.Fragment,{children:[g&&(0,Je.jsx)("button",{type:"button",className:e,style:t,"aria-label":p?(0,xc.__unstableStripHTML)(p):(0,ot.__)("Search"),onClick:n,ref:I,children:(0,Je.jsx)(Mg,{icon:lw})}),!g&&(0,Je.jsx)(nt.RichText,{identifier:"buttonText",className:e,style:t,"aria-label":(0,ot.__)("Button text"),placeholder:(0,ot.__)("Add button text…"),withoutInteractiveFormatting:!0,value:p,onChange:e=>o({buttonText:e}),onClick:n})]})})()]}),T&&z()]})]})}},vw=()=>et({name:yw,metadata:bw,settings:fw}),kw=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M4.5 12.5v4H3V7h1.5v3.987h15V7H21v9.5h-1.5v-4h-15Z"})});const ww={from:[{type:"enter",regExp:/^-{3,}$/,transform:()=>(0,Ke.createBlock)("core/separator")},{type:"raw",selector:"hr",schema:{hr:{}}}],to:[{type:"block",blocks:["core/spacer"],transform:({anchor:e})=>(0,Ke.createBlock)("core/spacer",{anchor:e||""})}]},Cw={attributes:{color:{type:"string"},customColor:{type:"string"}},save({attributes:e}){const{color:t,customColor:o}=e,n=(0,nt.getColorClassName)("background-color",t),a=(0,nt.getColorClassName)("color",t),r=ft({"has-text-color has-background":t||o,[n]:n,[a]:a}),i={backgroundColor:n?void 0:o,color:a?void 0:o};return(0,Je.jsx)("hr",{...nt.useBlockProps.save({className:r,style:i})})},migrate(e){const{color:t,customColor:o,...n}=e;return{...n,backgroundColor:t||void 0,opacity:"css",style:o?{color:{background:o}}:void 0,tagName:"hr"}}},jw=[Cw],Sw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/separator",title:"Separator",category:"design",description:"Create a break between ideas or sections with a horizontal separator.",keywords:["horizontal-line","hr","divider"],textdomain:"default",attributes:{opacity:{type:"string",default:"alpha-channel"},tagName:{type:"string",enum:["hr","div"],default:"hr"}},supports:{anchor:!0,align:["center","wide","full"],color:{enableContrastChecker:!1,__experimentalSkipSerialization:!0,gradients:!0,background:!0,text:!1,__experimentalDefaultControls:{background:!0}},spacing:{margin:["top","bottom"]},interactivity:{clientNavigation:!0}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"wide",label:"Wide Line"},{name:"dots",label:"Dots"}],editorStyle:"wp-block-separator-editor",style:"wp-block-separator"},{name:Bw}=Sw,Tw={icon:kw,example:{attributes:{customColor:"#065174",className:"is-style-wide"}},transforms:ww,edit:function({attributes:e,setAttributes:t}){const{backgroundColor:o,opacity:n,style:a,tagName:r}=e,i=(0,nt.__experimentalUseColorProps)(e),s=i?.style?.backgroundColor,l=!!a?.color?.background;!function(e,t,o){const[n,a]=(0,st.useState)(!1),r=(0,ut.usePrevious)(t);(0,st.useEffect)((()=>{"css"!==e||t||r||a(!0)}),[t,r,e]),(0,st.useEffect)((()=>{"css"===e&&(n&&t||r&&t!==r)&&(o({opacity:"alpha-channel"}),a(!1))}),[n,t,r])}(n,s,t);const c=(0,nt.getColorClassName)("color",o),u=ft({"has-text-color":o||s,[c]:c,"has-css-opacity":"css"===n,"has-alpha-channel-opacity":"alpha-channel"===n},i.className),d={color:s,backgroundColor:s},p="hr"===r?tt.HorizontalRule:r;return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("HTML element"),options:[{label:(0,ot.__)("Default (<hr>)"),value:"hr"},{label:"<div>",value:"div"}],value:r,onChange:e=>t({tagName:e}),help:sa[r]})}),(0,Je.jsx)(p,{...(0,nt.useBlockProps)({className:u,style:l?d:void 0})})]})},save:function({attributes:e}){const{backgroundColor:t,style:o,opacity:n,tagName:a}=e,r=o?.color?.background,i=(0,nt.__experimentalGetColorClassesAndStyles)(e),s=(0,nt.getColorClassName)("color",t),l=ft({"has-text-color":t||r,[s]:s,"has-css-opacity":"css"===n,"has-alpha-channel-opacity":"alpha-channel"===n},i.className),c={backgroundColor:i?.style?.backgroundColor,color:s?void 0:r};return(0,Je.jsx)(a,{...nt.useBlockProps.save({className:l,style:c})})},deprecated:jw},Nw=()=>et({name:Bw,metadata:Sw,settings:Tw}),Pw=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z"})});const Iw=window.wp.autop,Mw={from:[{type:"shortcode",tag:"[a-z][a-z0-9_-]*",attributes:{text:{type:"string",shortcode:(e,{content:t})=>(0,Iw.removep)((0,Iw.autop)(t))}},priority:20}]},Dw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/shortcode",title:"Shortcode",category:"widgets",description:"Insert additional custom elements with a WordPress shortcode.",textdomain:"default",attributes:{text:{type:"string",source:"raw"}},supports:{className:!1,customClassName:!1,html:!1},editorStyle:"wp-block-shortcode-editor"},{name:zw}=Dw,Aw={icon:Pw,transforms:Mw,edit:function e({attributes:t,setAttributes:o}){const n=`blocks-shortcode-input-${(0,ut.useInstanceId)(e)}`;return(0,Je.jsx)("div",{...(0,nt.useBlockProps)(),children:(0,Je.jsx)(tt.Placeholder,{icon:Pw,label:(0,ot.__)("Shortcode"),children:(0,Je.jsx)(nt.PlainText,{className:"blocks-shortcode__textarea",id:n,value:t.text,"aria-label":(0,ot.__)("Shortcode text"),placeholder:(0,ot.__)("Write shortcode here…"),onChange:e=>o({text:e})})})})},save:function({attributes:e}){return(0,Je.jsx)(st.RawHTML,{children:e.text})}},Rw=()=>et({name:zw,metadata:Dw,settings:Aw}),Hw=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z"})}),Lw=["image"],Vw="image/*",Fw=({alt:e,attributes:{align:t,width:o,height:n,isLink:a,linkTarget:r,shouldSyncIcon:i},isSelected:s,setAttributes:l,setLogo:c,logoUrl:u,siteUrl:d,logoId:p,iconId:m,setIcon:g,canUserEdit:h})=>{const x=(0,ut.useViewportMatch)("medium"),_=!["wide","full"].includes(t)&&x,[{naturalWidth:b,naturalHeight:y},f]=(0,st.useState)({}),[v,k]=(0,st.useState)(!1),{toggleSelection:w}=(0,it.useDispatch)(nt.store),{imageEditing:C,maxWidth:j,title:S}=(0,it.useSelect)((e=>{const t=e(nt.store).getSettings(),o=e(ct.store).getEntityRecord("root","__unstableBase");return{title:o?.name,imageEditing:t.imageEditing,maxWidth:t.maxWidth}}),[]);(0,st.useEffect)((()=>{i&&p!==m&&l({shouldSyncIcon:!1})}),[]),(0,st.useEffect)((()=>{s||k(!1)}),[s]);const B=(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("img",{className:"custom-logo",src:u,alt:e,onLoad:e=>{f({naturalWidth:e.target.naturalWidth,naturalHeight:e.target.naturalHeight})}}),(0,lt.isBlobURL)(u)&&(0,Je.jsx)(tt.Spinner,{})]});let T=B;if(a&&(T=(0,Je.jsx)("a",{href:d,className:"custom-logo-link",rel:"home",title:S,onClick:e=>e.preventDefault(),children:B})),!_||!b||!y)return(0,Je.jsx)("div",{style:{width:o,height:n},children:T});const N=o||120,P=b/y,I=N/P,M=b<y?du:Math.ceil(du*P),D=y<b?du:Math.ceil(du/P),z=2.5*j;let A=!1,R=!1;"center"===t?(A=!0,R=!0):(0,ot.isRTL)()?"left"===t?A=!0:R=!0:"right"===t?R=!0:A=!0;const H=p&&b&&y&&C,L=H&&v?(0,Je.jsx)(nt.__experimentalImageEditor,{id:p,url:u,width:N,height:I,naturalHeight:y,naturalWidth:b,onSaveImage:e=>{c(e.id)},onFinishEditing:()=>{k(!1)}}):(0,Je.jsx)(tt.ResizableBox,{size:{width:N,height:I},showHandle:s,minWidth:M,maxWidth:z,minHeight:D,maxHeight:z/P,lockAspectRatio:!0,enable:{top:!1,right:A,bottom:!0,left:R},onResizeStart:function(){w(!1)},onResizeStop:(e,t,o,n)=>{w(!0),l({width:parseInt(N+n.width,10),height:parseInt(I+n.height,10)})},children:T}),V=!window?.__experimentalUseCustomizerSiteLogoUrl?d+"/wp-admin/options-general.php":d+"/wp-admin/customize.php?autofocus[section]=title_tagline",F=(0,st.createInterpolateElement)((0,ot.__)("Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>."),{a:(0,Je.jsx)("a",{href:V,target:"_blank",rel:"noopener noreferrer"})});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.PanelBody,{title:(0,ot.__)("Settings"),children:[(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Image width"),onChange:e=>l({width:e}),min:M,max:z,initialPosition:Math.min(120,z),value:o||"",disabled:!_}),(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link image to home"),onChange:()=>l({isLink:!a}),checked:a}),a&&(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open in new tab"),onChange:e=>l({linkTarget:e?"_blank":"_self"}),checked:"_blank"===r})}),h&&(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Use as Site Icon"),onChange:e=>{l({shouldSyncIcon:e}),g(e?p:void 0)},checked:!!i,help:F})})]})}),(0,Je.jsx)(nt.BlockControls,{group:"block",children:H&&!v&&(0,Je.jsx)(tt.ToolbarButton,{onClick:()=>k(!0),icon:Kd,label:(0,ot.__)("Crop")})}),L]})};function Ew({mediaURL:e,...t}){return(0,Je.jsx)(nt.MediaReplaceFlow,{...t,mediaURL:e,allowedTypes:Lw,accept:Vw})}const Ow=({media:e,itemGroupProps:t})=>{const{alt_text:o,source_url:n,slug:a,media_details:r}=null!=e?e:{},i=r?.sizes?.full?.file||a;return(0,Je.jsx)(tt.__experimentalItemGroup,{...t,as:"span",children:(0,Je.jsxs)(tt.__experimentalHStack,{justify:"flex-start",as:"span",children:[(0,Je.jsx)("img",{src:n,alt:o}),(0,Je.jsx)(tt.FlexItem,{as:"span",children:(0,Je.jsx)(tt.__experimentalTruncate,{numberOfLines:1,className:"block-library-site-logo__inspector-media-replace-title",children:i})})]})})};const $w={to:[{type:"block",blocks:["core/site-title"],transform:({isLink:e,linkTarget:t})=>(0,Ke.createBlock)("core/site-title",{isLink:e,linkTarget:t})}]},Gw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/site-logo",title:"Site Logo",category:"theme",description:"Display an image to represent this site. Update this block and the changes apply everywhere.",textdomain:"default",attributes:{width:{type:"number"},isLink:{type:"boolean",default:!0,role:"content"},linkTarget:{type:"string",default:"_self",role:"content"},shouldSyncIcon:{type:"boolean"}},example:{viewportWidth:500,attributes:{width:350,className:"block-editor-block-types-list__site-logo-example"}},supports:{html:!1,align:!0,alignWide:!1,color:{__experimentalDuotone:"img, .components-placeholder__illustration, .components-placeholder::before",text:!1,background:!1},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},interactivity:{clientNavigation:!0}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"rounded",label:"Rounded"}],editorStyle:"wp-block-site-logo-editor",style:"wp-block-site-logo"},{name:Uw}=Gw,qw={icon:Hw,example:{},edit:function({attributes:e,className:t,setAttributes:o,isSelected:n}){const{width:a,shouldSyncIcon:r}=e,{siteLogoId:i,canUserEdit:s,url:l,siteIconId:c,mediaItemData:u,isRequestingMediaItem:d}=(0,it.useSelect)((e=>{const{canUser:t,getEntityRecord:o,getEditedEntityRecord:n}=e(ct.store),a=t("update",{kind:"root",name:"site"}),r=a?n("root","site"):void 0,i=o("root","__unstableBase"),s=a?r?.site_logo:i?.site_logo,l=r?.site_icon,c=s&&e(ct.store).getMedia(s,{context:"view"}),u=!!s&&!e(ct.store).hasFinishedResolution("getMedia",[s,{context:"view"}]);return{siteLogoId:s,canUserEdit:a,url:i?.home,mediaItemData:c,isRequestingMediaItem:u,siteIconId:l}}),[]),{getSettings:p}=(0,it.useSelect)(nt.store),[m,g]=(0,st.useState)(),{editEntityRecord:h}=(0,it.useDispatch)(ct.store),x=(e,t=!1)=>{(r||t)&&_(e),h("root","site",void 0,{site_logo:e})},_=e=>h("root","site",void 0,{site_icon:null!=e?e:null}),{alt_text:b,source_url:y}=null!=u?u:{},f=e=>{if(void 0===r){const t=!c;return o({shouldSyncIcon:t}),void v(e,t)}v(e)},v=(e,t=!1)=>{if(e)return!e.id&&e.url?(g(e.url),void x(void 0)):void x(e.id,t)},{createErrorNotice:k}=(0,it.useDispatch)(Rt.store),w=e=>{k(e,{type:"snackbar"}),g()},C=e=>{p().mediaUpload({allowedTypes:Lw,filesList:e,onFileChange([e]){(0,lt.isBlobURL)(e?.url)?g(e.url):f(e)},onError:w,multiple:!1})},j={mediaURL:y,name:y?(0,ot.__)("Replace"):(0,ot.__)("Choose logo"),onSelect:v,onError:w,onReset:()=>{x(null),o({width:void 0})}},S=s&&(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(Ew,{...j})});let B;const T=void 0===i||d;T&&(B=(0,Je.jsx)(tt.Spinner,{})),(0,st.useEffect)((()=>{y&&m&&g()}),[y,m]),(y||m)&&(B=(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Fw,{alt:b,attributes:e,className:t,isSelected:n,setAttributes:o,logoUrl:m||y,setLogo:x,logoId:u?.id||i,siteUrl:l,setIcon:_,iconId:c,canUserEdit:s}),s&&(0,Je.jsx)(tt.DropZone,{onFilesDrop:C})]}));const N=ft(t,{"is-default-size":!a,"is-transient":m}),P=(0,nt.useBlockProps)({className:N}),I=(s||y)&&(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.PanelBody,{title:(0,ot.__)("Media"),children:(0,Je.jsx)("div",{className:"block-library-site-logo__inspector-media-replace-container",children:s?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Ew,{...j,name:y?(0,Je.jsx)(Ow,{media:u}):(0,ot.__)("Choose logo"),renderToggle:e=>(0,Je.jsx)(tt.Button,{...e,__next40pxDefaultSize:!0,children:m?(0,Je.jsx)(tt.Spinner,{}):e.children})}),(0,Je.jsx)(tt.DropZone,{onFilesDrop:C})]}):(0,Je.jsx)(Ow,{media:u,itemGroupProps:{isBordered:!0,className:"block-library-site-logo__inspector-readonly-logo-preview"}})})})});return(0,Je.jsxs)("div",{...P,children:[S,I,(!!y||!!m)&&B,(T||!m&&!y&&!s)&&(0,Je.jsx)(tt.Placeholder,{className:"site-logo_placeholder",withIllustration:!0,children:T&&(0,Je.jsx)("span",{className:"components-placeholder__preview",children:(0,Je.jsx)(tt.Spinner,{})})}),!T&&!m&&!y&&s&&(0,Je.jsx)(nt.MediaPlaceholder,{onSelect:f,accept:Vw,allowedTypes:Lw,onError:w,placeholder:e=>{const o=ft("block-editor-media-placeholder",t);return(0,Je.jsx)(tt.Placeholder,{className:o,preview:B,withIllustration:!0,style:{width:a},children:e})},mediaLibraryButton:({open:e})=>(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,icon:Jd,variant:"primary",label:(0,ot.__)("Choose logo"),showTooltip:!0,tooltipPosition:"middle right",onClick:()=>{e()}})})]})},transforms:$w},Ww=()=>et({name:Uw,metadata:Gw,settings:qw});const Zw=(0,Je.jsx)(tt.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:(0,Je.jsx)(tt.Path,{d:"M4 10.5h16V9H4v1.5ZM4 15h9v-1.5H4V15Z"})}),Qw={attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:lo,isEligible:({style:e})=>e?.typography?.fontFamily},Kw=[Qw],Yw={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/site-tagline",title:"Site Tagline",category:"theme",description:"Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it’s not displayed in the theme design.",keywords:["description"],textdomain:"default",attributes:{textAlign:{type:"string"},level:{type:"number",default:0},levelOptions:{type:"array",default:[0,1,2,3,4,5,6]}},example:{viewportWidth:350,attributes:{textAlign:"center"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},editorStyle:"wp-block-site-tagline-editor",style:"wp-block-site-tagline"},{name:Jw}=Yw,Xw={icon:Zw,edit:function({attributes:e,setAttributes:t,insertBlocksAfter:o}){const{textAlign:n,level:a,levelOptions:r}=e,{canUserEdit:i,tagline:s}=(0,it.useSelect)((e=>{const{canUser:t,getEntityRecord:o,getEditedEntityRecord:n}=e(ct.store),a=t("update",{kind:"root",name:"site"}),r=a?n("root","site"):{},i=o("root","__unstableBase");return{canUserEdit:a,tagline:a?r?.description:i?.description}}),[]),l=0===a?"p":`h${a}`,{editEntityRecord:c}=(0,it.useDispatch)(ct.store),u=(0,nt.useBlockProps)({className:ft({[`has-text-align-${n}`]:n,"wp-block-site-tagline__placeholder":!i&&!s})}),d=i?(0,Je.jsx)(nt.RichText,{allowedFormats:[],onChange:function(e){c("root","site",void 0,{description:e})},"aria-label":(0,ot.__)("Site tagline text"),placeholder:(0,ot.__)("Write site tagline…"),tagName:l,value:s,disableLineBreaks:!0,__unstableOnSplitAtEnd:()=>o((0,Ke.createBlock)((0,Ke.getDefaultBlockName)())),...u}):(0,Je.jsx)(l,{...u,children:s||(0,ot.__)("Site Tagline placeholder")});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(nt.BlockControls,{group:"block",children:[(0,Je.jsx)(nt.HeadingLevelDropdown,{value:a,options:r,onChange:e=>t({level:e})}),(0,Je.jsx)(nt.AlignmentControl,{onChange:e=>t({textAlign:e}),value:n})]}),d]})},deprecated:Kw},eC=()=>et({name:Jw,metadata:Yw,settings:Xw}),tC=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z"})});const oC={attributes:{level:{type:"number",default:1},textAlign:{type:"string"},isLink:{type:"boolean",default:!0},linkTarget:{type:"string",default:"_self"}},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0}},save:()=>null,migrate:lo,isEligible:({style:e})=>e?.typography?.fontFamily},nC=[oC],aC={to:[{type:"block",blocks:["core/site-logo"],transform:({isLink:e,linkTarget:t})=>(0,Ke.createBlock)("core/site-logo",{isLink:e,linkTarget:t})}]},rC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/site-title",title:"Site Title",category:"theme",description:"Displays the name of this site. Update the block, and the changes apply everywhere it’s used. This will also appear in the browser title bar and in search results.",textdomain:"default",attributes:{level:{type:"number",default:1},levelOptions:{type:"array",default:[0,1,2,3,4,5,6]},textAlign:{type:"string"},isLink:{type:"boolean",default:!0,role:"content"},linkTarget:{type:"string",default:"_self",role:"content"}},example:{viewportWidth:500},supports:{align:["wide","full"],html:!1,color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0,link:!0}},spacing:{padding:!0,margin:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0}},editorStyle:"wp-block-site-title-editor",style:"wp-block-site-title"},{name:iC}=rC,sC={icon:tC,example:{viewportWidth:350,attributes:{textAlign:"center"}},edit:function({attributes:e,setAttributes:t,insertBlocksAfter:o}){const{level:n,levelOptions:a,textAlign:r,isLink:i,linkTarget:s}=e,{canUserEdit:l,title:c}=(0,it.useSelect)((e=>{const{canUser:t,getEntityRecord:o,getEditedEntityRecord:n}=e(ct.store),a=t("update",{kind:"root",name:"site"}),r=a?n("root","site"):{},i=o("root","__unstableBase");return{canUserEdit:a,title:a?r?.title:i?.name}}),[]),{editEntityRecord:u}=(0,it.useDispatch)(ct.store),d=mt(),p=0===n?"p":`h${n}`,m=(0,nt.useBlockProps)({className:ft({[`has-text-align-${r}`]:r,"wp-block-site-title__placeholder":!l&&!c})}),g=l?(0,Je.jsx)(p,{...m,children:(0,Je.jsx)(nt.RichText,{tagName:i?"a":"span",href:i?"#site-title-pseudo-link":void 0,"aria-label":(0,ot.__)("Site title text"),placeholder:(0,ot.__)("Write site title…"),value:c,onChange:function(e){u("root","site",void 0,{title:e})},allowedFormats:[],disableLineBreaks:!0,__unstableOnSplitAtEnd:()=>o((0,Ke.createBlock)((0,Ke.getDefaultBlockName)()))})}):(0,Je.jsx)(p,{...m,children:i?(0,Je.jsx)("a",{href:"#site-title-pseudo-link",onClick:e=>e.preventDefault(),children:(0,tn.decodeEntities)(c)||(0,ot.__)("Site Title placeholder")}):(0,Je.jsx)("span",{children:(0,tn.decodeEntities)(c)||(0,ot.__)("Site Title placeholder")})});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(nt.BlockControls,{group:"block",children:[(0,Je.jsx)(nt.HeadingLevelDropdown,{value:n,options:a,onChange:e=>t({level:e})}),(0,Je.jsx)(nt.AlignmentControl,{value:r,onChange:e=>{t({textAlign:e})}})]}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{t({isLink:!0,linkTarget:"_self"})},dropdownMenuProps:d,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!i,label:(0,ot.__)("Make title link to home"),onDeselect:()=>t({isLink:!0}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Make title link to home"),onChange:()=>t({isLink:!i}),checked:i})}),i&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>"_self"!==s,label:(0,ot.__)("Open in new tab"),onDeselect:()=>t({linkTarget:"_self"}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open in new tab"),onChange:e=>t({linkTarget:e?"_blank":"_self"}),checked:"_blank"===s})})]})}),g]})},transforms:aC,deprecated:nC},lC=()=>et({name:iC,metadata:rC,settings:sC}),cC=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z"})}),uC=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-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"})}),dC=()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.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"})}),pC=[{isDefault:!0,name:"wordpress",attributes:{service:"wordpress"},title:"WordPress",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z"})})},{name:"fivehundredpx",attributes:{service:"fivehundredpx"},title:"500px",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z"})})},{name:"amazon",attributes:{service:"amazon"},title:"Amazon",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z"})})},{name:"bandcamp",attributes:{service:"bandcamp"},title:"Bandcamp",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289"})})},{name:"behance",attributes:{service:"behance"},title:"Behance",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z"})})},{name:"bluesky",attributes:{service:"bluesky"},title:"Bluesky",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z"})})},{name:"chain",attributes:{service:"chain"},title:"Link",icon:dC},{name:"codepen",attributes:{service:"codepen"},title:"CodePen",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z"})})},{name:"deviantart",attributes:{service:"deviantart"},title:"DeviantArt",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z"})})},{name:"discord",attributes:{service:"discord"},title:"Discord",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M20.317 4.369A19.88 19.88 0 0 0 15.894 3a14.145 14.145 0 0 0-.719 1.518 19.205 19.205 0 0 0-5.351 0A14.183 14.183 0 0 0 9.104 3 19.896 19.896 0 0 0 4.682 4.369a18.921 18.921 0 0 0-3.012 12.52 19.929 19.929 0 0 0 6.081 3.097c.487-.65.922-1.339 1.3-2.061a12.445 12.445 0 0 1-1.958-.896c.165-.12.326-.246.483-.374a12.445 12.445 0 0 0 8.946 0c.157.128.318.253.483.374-.627.371-1.281.683-1.958.896.379.722.813 1.41 1.3 2.061a19.94 19.94 0 0 0 6.081-3.097 18.921 18.921 0 0 0-3.012-12.52ZM8.12 15.233c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Zm7.757 0c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Z"})})},{name:"dribbble",attributes:{service:"dribbble"},title:"Dribbble",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z"})})},{name:"dropbox",attributes:{service:"dropbox"},title:"Dropbox",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z"})})},{name:"etsy",attributes:{service:"etsy"},title:"Etsy",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z"})})},{name:"facebook",attributes:{service:"facebook"},title:"Facebook",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z"})})},{name:"feed",attributes:{service:"feed"},title:"RSS Feed",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z"})})},{name:"flickr",attributes:{service:"flickr"},title:"Flickr",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z"})})},{name:"foursquare",attributes:{service:"foursquare"},title:"Foursquare",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z"})})},{name:"goodreads",attributes:{service:"goodreads"},title:"Goodreads",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z"})})},{name:"google",attributes:{service:"google"},title:"Google",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z"})})},{name:"github",attributes:{service:"github"},title:"GitHub",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z"})})},{name:"gravatar",attributes:{service:"gravatar"},title:"Gravatar",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M10.8001 4.69937V10.6494C10.8001 11.1001 10.9791 11.5323 11.2978 11.851C11.6165 12.1697 12.0487 12.3487 12.4994 12.3487C12.9501 12.3487 13.3824 12.1697 13.7011 11.851C14.0198 11.5323 14.1988 11.1001 14.1988 10.6494V6.69089C15.2418 7.05861 16.1371 7.75537 16.7496 8.67617C17.3622 9.59698 17.6589 10.6919 17.595 11.796C17.5311 12.9001 17.1101 13.9535 16.3954 14.7975C15.6807 15.6415 14.711 16.2303 13.6325 16.4753C12.5541 16.7202 11.4252 16.608 10.4161 16.1555C9.40691 15.703 8.57217 14.9348 8.03763 13.9667C7.50308 12.9985 7.29769 11.8828 7.45242 10.7877C7.60714 9.69266 8.11359 8.67755 8.89545 7.89537C9.20904 7.57521 9.38364 7.14426 9.38132 6.69611C9.37899 6.24797 9.19994 5.81884 8.88305 5.50195C8.56616 5.18506 8.13704 5.00601 7.68889 5.00369C7.24075 5.00137 6.80979 5.17597 6.48964 5.48956C5.09907 6.8801 4.23369 8.7098 4.04094 10.6669C3.84819 12.624 4.34 14.5873 5.43257 16.2224C6.52515 17.8575 8.15088 19.0632 10.0328 19.634C11.9146 20.2049 13.9362 20.1055 15.753 19.3529C17.5699 18.6003 19.0695 17.241 19.9965 15.5066C20.9234 13.7722 21.2203 11.7701 20.8366 9.84133C20.4528 7.91259 19.4122 6.17658 17.892 4.92911C16.3717 3.68163 14.466 2.99987 12.4994 3C12.0487 3 11.6165 3.17904 11.2978 3.49773C10.9791 3.81643 10.8001 4.24867 10.8001 4.69937Z"})})},{name:"instagram",attributes:{service:"instagram"},title:"Instagram",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z"})})},{name:"lastfm",attributes:{service:"lastfm"},title:"Last.fm",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z"})})},{name:"linkedin",attributes:{service:"linkedin"},title:"LinkedIn",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z"})})},{name:"mail",attributes:{service:"mail"},title:"Mail",keywords:["email","e-mail"],icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l7.5 5.6 7.5-5.6V17zm0-9.1L12 13.6 4.5 7.9V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v.9z"})})},{name:"mastodon",attributes:{service:"mastodon"},title:"Mastodon",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z"})})},{name:"meetup",attributes:{service:"meetup"},title:"Meetup",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z"})})},{name:"medium",attributes:{service:"medium"},title:"Medium",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M13.2,12c0,3-2.4,5.4-5.3,5.4S2.6,15,2.6,12s2.4-5.4,5.3-5.4S13.2,9,13.2,12 M19.1,12c0,2.8-1.2,5-2.7,5s-2.7-2.3-2.7-5s1.2-5,2.7-5C17.9,7,19.1,9.2,19.1,12 M21.4,12c0,2.5-0.4,4.5-0.9,4.5c-0.5,0-0.9-2-0.9-4.5s0.4-4.5,0.9-4.5C21,7.5,21.4,9.5,21.4,12"})})},{name:"patreon",attributes:{service:"patreon"},title:"Patreon",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M20 8.40755C19.9969 6.10922 18.2543 4.22555 16.2097 3.54588C13.6708 2.70188 10.3222 2.82421 7.89775 3.99921C4.95932 5.42355 4.03626 8.54355 4.00186 11.6552C3.97363 14.2136 4.2222 20.9517 7.92225 20.9997C10.6715 21.0356 11.0809 17.3967 12.3529 15.6442C13.258 14.3974 14.4233 14.0452 15.8578 13.6806C18.3233 13.0537 20.0036 11.0551 20 8.40755Z"})})},{name:"pinterest",attributes:{service:"pinterest"},title:"Pinterest",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2"})})},{name:"pocket",attributes:{service:"pocket"},title:"Pocket",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z"})})},{name:"reddit",attributes:{service:"reddit"},title:"Reddit",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M5.27 9.221A2.775 2.775 0 0 0 2.498 11.993a2.785 2.785 0 0 0 1.6 2.511 5.337 5.337 0 0 0 2.374 4.11 9.386 9.386 0 0 0 5.539 1.7 9.386 9.386 0 0 0 5.541-1.7 5.331 5.331 0 0 0 2.372-4.114 2.787 2.787 0 0 0 1.583-2.5 2.775 2.775 0 0 0-2.772-2.772 2.742 2.742 0 0 0-1.688.574 9.482 9.482 0 0 0-4.637-1.348v-.008a2.349 2.349 0 0 1 2.011-2.316 1.97 1.97 0 0 0 1.926 1.521 1.98 1.98 0 0 0 1.978-1.978 1.98 1.98 0 0 0-1.978-1.978 1.985 1.985 0 0 0-1.938 1.578 3.183 3.183 0 0 0-2.849 3.172v.011a9.463 9.463 0 0 0-4.59 1.35 2.741 2.741 0 0 0-1.688-.574Zm6.736 9.1a3.162 3.162 0 0 1-2.921-1.944.215.215 0 0 1 .014-.2.219.219 0 0 1 .168-.106 27.327 27.327 0 0 1 2.74-.133 27.357 27.357 0 0 1 2.74.133.219.219 0 0 1 .168.106.215.215 0 0 1 .014.2 3.158 3.158 0 0 1-2.921 1.944Zm3.743-3.157a1.265 1.265 0 0 1-1.4-1.371 1.954 1.954 0 0 1 .482-1.442 1.15 1.15 0 0 1 .842-.379 1.7 1.7 0 0 1 1.49 1.777 1.323 1.323 0 0 1-.325 1.015 1.476 1.476 0 0 1-1.089.4Zm-7.485 0a1.476 1.476 0 0 1-1.086-.4 1.323 1.323 0 0 1-.325-1.016 1.7 1.7 0 0 1 1.49-1.777 1.151 1.151 0 0 1 .843.379 1.951 1.951 0 0 1 .481 1.441 1.276 1.276 0 0 1-1.403 1.373Z"})})},{name:"skype",attributes:{service:"skype"},title:"Skype",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z"})})},{name:"snapchat",attributes:{service:"snapchat"},title:"Snapchat",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z"})})},{name:"soundcloud",attributes:{service:"soundcloud"},title:"SoundCloud",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M23.994 14.552a3.36 3.36 0 01-3.401 3.171h-8.176a.685.685 0 01-.679-.681V8.238a.749.749 0 01.452-.716S12.942 7 14.526 7a5.357 5.357 0 012.748.755 5.44 5.44 0 012.56 3.546c.282-.08.574-.12.868-.119a3.273 3.273 0 013.292 3.37zM10.718 8.795a.266.266 0 10-.528 0c-.224 2.96-.397 5.735 0 8.685a.265.265 0 00.528 0c.425-2.976.246-5.7 0-8.685zM9.066 9.82a.278.278 0 00-.553 0 33.183 33.183 0 000 7.663.278.278 0 00.55 0c.33-2.544.332-5.12.003-7.664zM7.406 9.56a.269.269 0 00-.535 0c-.253 2.7-.38 5.222 0 7.917a.266.266 0 10.531 0c.394-2.73.272-5.181.004-7.917zM5.754 10.331a.275.275 0 10-.55 0 28.035 28.035 0 000 7.155.272.272 0 00.54 0c.332-2.373.335-4.78.01-7.155zM4.087 12.12a.272.272 0 00-.544 0c-.393 1.843-.208 3.52.016 5.386a.26.26 0 00.512 0c.247-1.892.435-3.53.016-5.386zM2.433 11.838a.282.282 0 00-.56 0c-.349 1.882-.234 3.54.01 5.418.025.285.508.282.54 0 .269-1.907.394-3.517.01-5.418zM.762 12.76a.282.282 0 00-.56 0c-.32 1.264-.22 2.31.023 3.578a.262.262 0 00.521 0c.282-1.293.42-2.317.016-3.578z"})})},{name:"spotify",attributes:{service:"spotify"},title:"Spotify",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865"})})},{name:"telegram",attributes:{service:"telegram"},title:"Telegram",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 128 128",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z"})})},{name:"threads",attributes:{service:"threads"},title:"Threads",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M16.3 11.3c-.1 0-.2-.1-.2-.1-.1-2.6-1.5-4-3.9-4-1.4 0-2.6.6-3.3 1.7l1.3.9c.5-.8 1.4-1 2-1 .8 0 1.4.2 1.7.7.3.3.5.8.5 1.3-.7-.1-1.4-.2-2.2-.1-2.2.1-3.7 1.4-3.6 3.2 0 .9.5 1.7 1.3 2.2.7.4 1.5.6 2.4.6 1.2-.1 2.1-.5 2.7-1.3.5-.6.8-1.4.9-2.4.6.3 1 .8 1.2 1.3.4.9.4 2.4-.8 3.6-1.1 1.1-2.3 1.5-4.3 1.5-2.1 0-3.8-.7-4.8-2S5.7 14.3 5.7 12c0-2.3.5-4.1 1.5-5.4 1.1-1.3 2.7-2 4.8-2 2.2 0 3.8.7 4.9 2 .5.7.9 1.5 1.2 2.5l1.5-.4c-.3-1.2-.8-2.2-1.5-3.1-1.3-1.7-3.3-2.6-6-2.6-2.6 0-4.7.9-6 2.6C4.9 7.2 4.3 9.3 4.3 12s.6 4.8 1.9 6.4c1.4 1.7 3.4 2.6 6 2.6 2.3 0 4-.6 5.3-2 1.8-1.8 1.7-4 1.1-5.4-.4-.9-1.2-1.7-2.3-2.3zm-4 3.8c-1 .1-2-.4-2-1.3 0-.7.5-1.5 2.1-1.6h.5c.6 0 1.1.1 1.6.2-.2 2.3-1.3 2.7-2.2 2.7z"})})},{name:"tiktok",attributes:{service:"tiktok"},title:"TikTok",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 32 32",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z"})})},{name:"tumblr",attributes:{service:"tumblr"},title:"Tumblr",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z"})})},{name:"twitch",attributes:{service:"twitch"},title:"Twitch",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z"})})},{name:"twitter",attributes:{service:"twitter"},title:"Twitter",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z"})})},{name:"vimeo",attributes:{service:"vimeo"},title:"Vimeo",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z"})})},{name:"vk",attributes:{service:"vk"},title:"VK",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z"})})},{name:"whatsapp",attributes:{service:"whatsapp"},title:"WhatsApp",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M 12.011719 2 C 6.5057187 2 2.0234844 6.478375 2.0214844 11.984375 C 2.0204844 13.744375 2.4814687 15.462563 3.3554688 16.976562 L 2 22 L 7.2324219 20.763672 C 8.6914219 21.559672 10.333859 21.977516 12.005859 21.978516 L 12.009766 21.978516 C 17.514766 21.978516 21.995047 17.499141 21.998047 11.994141 C 22.000047 9.3251406 20.962172 6.8157344 19.076172 4.9277344 C 17.190172 3.0407344 14.683719 2.001 12.011719 2 z M 12.009766 4 C 14.145766 4.001 16.153109 4.8337969 17.662109 6.3417969 C 19.171109 7.8517969 20.000047 9.8581875 19.998047 11.992188 C 19.996047 16.396187 16.413812 19.978516 12.007812 19.978516 C 10.674812 19.977516 9.3544062 19.642812 8.1914062 19.007812 L 7.5175781 18.640625 L 6.7734375 18.816406 L 4.8046875 19.28125 L 5.2851562 17.496094 L 5.5019531 16.695312 L 5.0878906 15.976562 C 4.3898906 14.768562 4.0204844 13.387375 4.0214844 11.984375 C 4.0234844 7.582375 7.6067656 4 12.009766 4 z M 8.4765625 7.375 C 8.3095625 7.375 8.0395469 7.4375 7.8105469 7.6875 C 7.5815469 7.9365 6.9355469 8.5395781 6.9355469 9.7675781 C 6.9355469 10.995578 7.8300781 12.182609 7.9550781 12.349609 C 8.0790781 12.515609 9.68175 15.115234 12.21875 16.115234 C 14.32675 16.946234 14.754891 16.782234 15.212891 16.740234 C 15.670891 16.699234 16.690438 16.137687 16.898438 15.554688 C 17.106437 14.971687 17.106922 14.470187 17.044922 14.367188 C 16.982922 14.263188 16.816406 14.201172 16.566406 14.076172 C 16.317406 13.951172 15.090328 13.348625 14.861328 13.265625 C 14.632328 13.182625 14.464828 13.140625 14.298828 13.390625 C 14.132828 13.640625 13.655766 14.201187 13.509766 14.367188 C 13.363766 14.534188 13.21875 14.556641 12.96875 14.431641 C 12.71875 14.305641 11.914938 14.041406 10.960938 13.191406 C 10.218937 12.530406 9.7182656 11.714844 9.5722656 11.464844 C 9.4272656 11.215844 9.5585938 11.079078 9.6835938 10.955078 C 9.7955938 10.843078 9.9316406 10.663578 10.056641 10.517578 C 10.180641 10.371578 10.223641 10.267562 10.306641 10.101562 C 10.389641 9.9355625 10.347156 9.7890625 10.285156 9.6640625 C 10.223156 9.5390625 9.737625 8.3065 9.515625 7.8125 C 9.328625 7.3975 9.131125 7.3878594 8.953125 7.3808594 C 8.808125 7.3748594 8.6425625 7.375 8.4765625 7.375 z"})})},{name:"x",attributes:{service:"x"},keywords:["twitter"],title:"X",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z"})})},{name:"yelp",attributes:{service:"yelp"},title:"Yelp",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z"})})},{name:"youtube",attributes:{service:"youtube"},title:"YouTube",icon:()=>(0,Je.jsx)(Ye.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",children:(0,Je.jsx)(Ye.Path,{d:"M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z"})})}];pC.forEach((e=>{e.isActive||(e.isActive=(e,t)=>e.service===t.service)}));const mC=pC,gC=({url:e,setAttributes:t,setPopover:o,popoverAnchor:n,clientId:a})=>{const{removeBlock:r}=(0,it.useDispatch)(nt.store);return(0,Je.jsx)(nt.URLPopover,{anchor:n,"aria-label":(0,ot.__)("Edit social link"),onClose:()=>{o(!1),n?.focus()},children:(0,Je.jsx)("form",{className:"block-editor-url-popover__link-editor",onSubmit:e=>{e.preventDefault(),o(!1),n?.focus()},children:(0,Je.jsx)("div",{className:"block-editor-url-input",children:(0,Je.jsx)(nt.URLInput,{value:e,onChange:e=>t({url:e}),placeholder:(0,ot.__)("Enter social link"),label:(0,ot.__)("Enter social link"),hideLabelFromVision:!0,disableSuggestions:!0,onKeyDown:t=>{e||t.defaultPrevented||![wo.BACKSPACE,wo.DELETE].includes(t.keyCode)||r(a)},suffix:(0,Je.jsx)(tt.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,Je.jsx)(tt.Button,{icon:uC,label:(0,ot.__)("Apply"),type:"submit",size:"small"})})})})})})},hC=({attributes:e,context:t,isSelected:o,setAttributes:n,clientId:a})=>{const{url:r,service:i,label:s="",rel:l}=e,c=mt(),{showLabels:u,iconColor:d,iconColorValue:p,iconBackgroundColor:m,iconBackgroundColorValue:g}=t,[h,x]=(0,st.useState)(!1),_=ft("wp-social-link","wp-block-social-link","wp-social-link-"+i,{"wp-social-link__is-incomplete":!r,[`has-${d}-color`]:d,[`has-${m}-background-color`]:m}),[b,y]=(0,st.useState)(null),f="contentOnly"===(0,nt.useBlockEditingMode)(),v=(e=>{const t=mC.find((t=>t.name===e));return t?t.icon:dC})(i),k=(e=>{const t=mC.find((t=>t.name===e));return t?t.title:(0,ot.__)("Social Icon")})(i),w=""===s.trim()?k:s,C=(0,st.useRef)(),j=(0,nt.useBlockProps)({className:"wp-block-social-link-anchor",ref:(0,ut.useMergeRefs)([y,C]),onClick:()=>x(!0),onKeyDown:e=>{e.keyCode===wo.ENTER&&(e.preventDefault(),x(!0))}});return(0,Je.jsxs)(Je.Fragment,{children:[f&&u&&(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(tt.Dropdown,{popoverProps:{position:"bottom right"},renderToggle:({isOpen:e,onToggle:t})=>(0,Je.jsx)(tt.ToolbarButton,{onClick:t,"aria-haspopup":"true","aria-expanded":e,children:(0,ot.__)("Text")}),renderContent:()=>(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"wp-block-social-link__toolbar_content_text",label:(0,ot.__)("Text"),help:(0,ot.__)("Provide a text label or use the default."),value:s,onChange:e=>n({label:e}),placeholder:k})})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{n({label:void 0})},dropdownMenuProps:c,children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,ot.__)("Text"),hasValue:()=>!!s,onDeselect:()=>{n({label:void 0})},children:(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Text"),help:(0,ot.__)("The text is visible when enabled from the parent Social Icons block."),value:s,onChange:e=>n({label:e}),placeholder:k})})})}),(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Link rel"),value:l||"",onChange:e=>n({rel:e})})}),(0,Je.jsxs)("li",{role:"presentation",className:_,style:{color:p,backgroundColor:g},children:[(0,Je.jsxs)("button",{"aria-haspopup":"dialog",...j,role:"button",children:[(0,Je.jsx)(v,{}),(0,Je.jsx)("span",{className:ft("wp-block-social-link-label",{"screen-reader-text":!u}),children:w})]}),o&&h&&(0,Je.jsx)(gC,{url:r,setAttributes:n,setPopover:x,popoverAnchor:b,clientId:a})]})]})},xC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/social-link",title:"Social Icon",category:"widgets",parent:["core/social-links"],description:"Display an icon linking to a social profile or site.",textdomain:"default",attributes:{url:{type:"string",role:"content"},service:{type:"string"},label:{type:"string",role:"content"},rel:{type:"string"}},usesContext:["openInNewTab","showLabels","iconColor","iconColorValue","iconBackgroundColor","iconBackgroundColorValue"],supports:{reusable:!1,html:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-social-link-editor"},{name:_C}=xC,bC={icon:cC,edit:hC,variations:mC},yC=()=>et({name:_C,metadata:xC,settings:bC}),fC=[{attributes:{iconColor:{type:"string"},customIconColor:{type:"string"},iconColorValue:{type:"string"},iconBackgroundColor:{type:"string"},customIconBackgroundColor:{type:"string"},iconBackgroundColorValue:{type:"string"},openInNewTab:{type:"boolean",default:!1},size:{type:"string"}},providesContext:{openInNewTab:"openInNewTab"},supports:{align:["left","center","right"],anchor:!0},migrate:e=>{if(e.layout)return e;const{className:t}=e,o="items-justified-",n=new RegExp(`\\b${o}[^ ]*[ ]?\\b`,"g"),a={...e,className:t?.replace(n,"").trim()},r=t?.match(n)?.[0]?.trim();return r&&Object.assign(a,{layout:{type:"flex",justifyContent:r.slice(16)}}),a},save:e=>{const{attributes:{iconBackgroundColorValue:t,iconColorValue:o,itemsJustification:n,size:a}}=e,r=ft(a,{"has-icon-color":o,"has-icon-background-color":t,[`items-justified-${n}`]:n}),i={"--wp--social-links--icon-color":o,"--wp--social-links--icon-background-color":t};return(0,Je.jsx)("ul",{...nt.useBlockProps.save({className:r,style:i}),children:(0,Je.jsx)(nt.InnerBlocks.Content,{})})}}],vC=fC,kC=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),wC=[{name:(0,ot.__)("Small"),value:"has-small-icon-size"},{name:(0,ot.__)("Normal"),value:"has-normal-icon-size"},{name:(0,ot.__)("Large"),value:"has-large-icon-size"},{name:(0,ot.__)("Huge"),value:"has-huge-icon-size"}];const CC=(0,nt.withColors)({iconColor:"icon-color",iconBackgroundColor:"icon-background-color"})((function(e){var t;const{clientId:o,attributes:n,iconBackgroundColor:a,iconColor:r,isSelected:i,setAttributes:s,setIconBackgroundColor:l,setIconColor:c}=e,{iconBackgroundColorValue:u,customIconBackgroundColor:d,iconColorValue:p,openInNewTab:m,showLabels:g,size:h}=n,x=(0,it.useSelect)((e=>e(nt.store).hasSelectedInnerBlock(o)),[o]),_=i||x,b=n.className?.includes("is-style-logos-only"),y=mt(),f=(0,st.useRef)({});(0,st.useEffect)((()=>{b?(f.current={iconBackgroundColor:a,iconBackgroundColorValue:u,customIconBackgroundColor:d},s({iconBackgroundColor:void 0,customIconBackgroundColor:void 0,iconBackgroundColorValue:void 0})):s({...f.current})}),[b]);const v=(0,Je.jsx)("li",{className:"wp-block-social-links__social-placeholder",children:(0,Je.jsxs)("div",{className:"wp-block-social-links__social-placeholder-icons",children:[(0,Je.jsx)("div",{className:"wp-social-link wp-social-link-twitter"}),(0,Je.jsx)("div",{className:"wp-social-link wp-social-link-facebook"}),(0,Je.jsx)("div",{className:"wp-social-link wp-social-link-instagram"})]})}),k=ft(h,{"has-visible-labels":g,"has-icon-color":r.color||p,"has-icon-background-color":a.color||u}),w=(0,nt.useBlockProps)({className:k}),C=(0,nt.useInnerBlocksProps)(w,{placeholder:!i&&v,templateLock:!1,orientation:null!==(t=n.layout?.orientation)&&void 0!==t?t:"horizontal",__experimentalAppenderTagName:"li",renderAppender:_&&nt.InnerBlocks.ButtonBlockAppender}),j=[{value:r.color||p,onChange:e=>{c(e),s({iconColorValue:e})},label:(0,ot.__)("Icon color"),resetAllFilter:()=>{c(void 0),s({iconColorValue:void 0})}}];b||j.push({value:a.color||u,onChange:e=>{l(e),s({iconBackgroundColorValue:e})},label:(0,ot.__)("Icon background"),resetAllFilter:()=>{l(void 0),s({iconBackgroundColorValue:void 0})}});const S=(0,nt.__experimentalUseMultipleOriginColorsAndGradients)();return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(tt.ToolbarDropdownMenu,{label:(0,ot.__)("Size"),text:(0,ot.__)("Size"),icon:null,popoverProps:{position:"bottom right"},children:({onClose:e})=>(0,Je.jsx)(tt.MenuGroup,{children:wC.map((t=>(0,Je.jsx)(tt.MenuItem,{icon:(h===t.value||!h&&"has-normal-icon-size"===t.value)&&kC,isSelected:h===t.value,onClick:()=>{s({size:t.value})},onClose:e,role:"menuitemradio",children:t.name},t.value)))})})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{s({openInNewTab:!1,showLabels:!1})},dropdownMenuProps:y,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,ot.__)("Open links in new tab"),hasValue:()=>!!m,onDeselect:()=>s({openInNewTab:!1}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Open links in new tab"),checked:m,onChange:()=>s({openInNewTab:!m})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{isShownByDefault:!0,label:(0,ot.__)("Show text"),hasValue:()=>!!g,onDeselect:()=>s({showLabels:!1}),children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show text"),checked:g,onChange:()=>s({showLabels:!g})})})]})}),S.hasColorsOrGradients&&(0,Je.jsxs)(nt.InspectorControls,{group:"color",children:[j.map((({onChange:e,label:t,value:n,resetAllFilter:a})=>(0,Je.jsx)(nt.__experimentalColorGradientSettingsDropdown,{__experimentalIsRenderedInSidebar:!0,settings:[{colorValue:n,label:t,onColorChange:e,isShownByDefault:!0,resetAllFilter:a,enableAlpha:!0,clearable:!0}],panelId:o,...S},`social-links-color-${t}`))),!b&&(0,Je.jsx)(nt.ContrastChecker,{textColor:p,backgroundColor:u,isLargeText:!1})]}),(0,Je.jsx)("ul",{...C})]})}));const jC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/social-links",title:"Social Icons",category:"widgets",allowedBlocks:["core/social-link"],description:"Display icons linking to your social profiles or sites.",keywords:["links"],textdomain:"default",attributes:{iconColor:{type:"string"},customIconColor:{type:"string"},iconColorValue:{type:"string"},iconBackgroundColor:{type:"string"},customIconBackgroundColor:{type:"string"},iconBackgroundColorValue:{type:"string"},openInNewTab:{type:"boolean",default:!1},showLabels:{type:"boolean",default:!1},size:{type:"string"}},providesContext:{openInNewTab:"openInNewTab",showLabels:"showLabels",iconColor:"iconColor",iconColorValue:"iconColorValue",iconBackgroundColor:"iconBackgroundColor",iconBackgroundColorValue:"iconBackgroundColorValue"},supports:{align:["left","center","right"],anchor:!0,__experimentalExposeControlsToChildren:!0,layout:{allowSwitching:!1,allowInheriting:!1,allowVerticalAlignment:!1,default:{type:"flex"}},color:{enableContrastChecker:!1,background:!0,gradients:!0,text:!1,__experimentalDefaultControls:{background:!1}},spacing:{blockGap:["horizontal","vertical"],margin:!0,padding:!0,units:["px","em","rem","vh","vw"],__experimentalDefaultControls:{blockGap:!0,margin:!0,padding:!1}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"logos-only",label:"Logos Only"},{name:"pill-shape",label:"Pill Shape"}],editorStyle:"wp-block-social-links-editor",style:"wp-block-social-links"},{name:SC}=jC,BC={example:{innerBlocks:[{name:"core/social-link",attributes:{service:"wordpress",url:"https://wordpress.org"}},{name:"core/social-link",attributes:{service:"facebook",url:"https://www.facebook.com/WordPress/"}},{name:"core/social-link",attributes:{service:"twitter",url:"https://twitter.com/WordPress"}}]},icon:cC,edit:CC,save:function(e){const{attributes:{iconBackgroundColorValue:t,iconColorValue:o,showLabels:n,size:a}}=e,r=ft(a,{"has-visible-labels":n,"has-icon-color":o,"has-icon-background-color":t}),i=nt.useBlockProps.save({className:r}),s=nt.useInnerBlocksProps.save(i);return(0,Je.jsx)("ul",{...s})},deprecated:vC},TC=()=>et({name:SC,metadata:jC,settings:BC}),NC=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M7 18h4.5v1.5h-7v-7H6V17L17 6h-4.5V4.5h7v7H18V7L7 18Z"})}),PC=[{attributes:{height:{type:"number",default:100},width:{type:"number"}},migrate(e){const{height:t,width:o}=e;return{...e,width:void 0!==o?`${o}px`:void 0,height:void 0!==t?`${t}px`:void 0}},save:({attributes:e})=>(0,Je.jsx)("div",{...nt.useBlockProps.save({style:{height:e.height,width:e.width},"aria-hidden":!0})})}],IC=PC,{useSpacingSizes:MC}=Ot(nt.privateApis);function DC({label:e,onChange:t,isResizing:o,value:n=""}){const a=(0,ut.useInstanceId)(tt.__experimentalUnitControl,"block-spacer-height-input"),r=MC(),[i]=(0,nt.useSettings)("spacing.units"),s=i?i.filter((e=>"%"!==e)):["px","em","rem","vw","vh"],l=(0,tt.__experimentalUseCustomUnits)({availableUnits:s,defaultValues:{px:100,em:10,rem:10,vw:10,vh:25}}),[c,u]=(0,tt.__experimentalParseQuantityAndUnitFromRawValue)(n),d=(0,nt.isValueSpacingPreset)(n)?n:[c,o?"px":u].join("");return(0,Je.jsx)(Je.Fragment,{children:r?.length<2?(0,Je.jsx)(tt.__experimentalUnitControl,{id:a,isResetValueOnUnitChange:!0,min:0,onChange:t,value:d,units:l,label:e,__next40pxDefaultSize:!0}):(0,Je.jsx)(Ye.View,{className:"tools-panel-item-spacing",children:(0,Je.jsx)(nt.__experimentalSpacingSizesControl,{values:{all:d},onChange:({all:e})=>{t(e)},label:e,sides:["all"],units:l,allowReset:!1,splitOnAxis:!1,showSideInLabel:!1})})})}function zC({setAttributes:e,orientation:t,height:o,width:n,isResizing:a}){const r=mt();return(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{e({width:void 0,height:"100px"})},dropdownMenuProps:r,children:["horizontal"===t&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Width"),isShownByDefault:!0,hasValue:()=>void 0!==n,onDeselect:()=>e({width:void 0}),children:(0,Je.jsx)(DC,{label:(0,ot.__)("Width"),value:n,onChange:t=>e({width:t}),isResizing:a})}),"horizontal"!==t&&(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Height"),isShownByDefault:!0,hasValue:()=>"100px"!==o,onDeselect:()=>e({height:"100px"}),children:(0,Je.jsx)(DC,{label:(0,ot.__)("Height"),value:o,onChange:t=>e({height:t}),isResizing:a})})]})})}const{useSpacingSizes:AC}=Ot(nt.privateApis),RC=({orientation:e,onResizeStart:t,onResize:o,onResizeStop:n,isSelected:a,isResizing:r,setIsResizing:i,...s})=>{const l=t=>"horizontal"===e?t.clientWidth:t.clientHeight,c=e=>`${l(e)}px`;return(0,Je.jsx)(tt.ResizableBox,{className:ft("block-library-spacer__resize-container",{"resize-horizontal":"horizontal"===e,"is-resizing":r,"is-selected":a}),onResizeStart:(e,n,a)=>{const r=c(a);t(r),o(r)},onResize:(e,t,n)=>{o(c(n)),r||i(!0)},onResizeStop:(e,t,o)=>{const a=l(o);n(`${a}px`),i(!1)},__experimentalShowTooltip:!0,__experimentalTooltipProps:{axis:"horizontal"===e?"x":"y",position:"corner",isVisible:r},showHandle:a,...s})},HC=({attributes:e,isSelected:t,setAttributes:o,toggleSelection:n,context:a,__unstableParentLayout:r,className:i})=>{const s=(0,it.useSelect)((e=>{const t=e(nt.store).getSettings();return t?.disableCustomSpacingSizes})),{orientation:l}=a,{orientation:c,type:u,default:{type:d}={}}=r||{},p="flex"===u||!u&&"flex"===d,m=!c&&p?"horizontal":c||l,{height:g,width:h,style:x={}}=e,{layout:_={}}=x,{selfStretch:b,flexSize:y}=_,f=AC(),[v,k]=(0,st.useState)(!1),[w,C]=(0,st.useState)(null),[j,S]=(0,st.useState)(null),B=()=>n(!1),T=()=>n(!0),{__unstableMarkNextChangeAsNotPersistent:N}=(0,it.useDispatch)(nt.store),P=e=>{T(),p&&o({style:{...x,layout:{..._,flexSize:e,selfStretch:"fixed"}}}),o({height:e}),C(null)},I=e=>{T(),p&&o({style:{...x,layout:{..._,flexSize:e,selfStretch:"fixed"}}}),o({width:e}),S(null)},M="horizontal"===m?j||y:w||y,D={height:"horizontal"===m?24:(()=>{if(!p)return w||(0,nt.getSpacingPresetCssVar)(g)||void 0})(),width:"horizontal"===m?(()=>{if(!p)return j||(0,nt.getSpacingPresetCssVar)(h)||void 0})():void 0,minWidth:"vertical"===m&&p?48:void 0,flexBasis:p?M:void 0,flexGrow:p&&v?0:void 0};return(0,st.useEffect)((()=>{const e=e=>{N(),o(e)};if(p&&"fill"!==b&&"fit"!==b&&void 0===y)if("horizontal"===m){const t=(0,nt.getCustomValueFromPreset)(h,f)||(0,nt.getCustomValueFromPreset)(g,f)||"100px";e({width:"0px",style:{...x,layout:{..._,flexSize:t,selfStretch:"fixed"}}})}else{const t=(0,nt.getCustomValueFromPreset)(g,f)||(0,nt.getCustomValueFromPreset)(h,f)||"100px";e({height:"0px",style:{...x,layout:{..._,flexSize:t,selfStretch:"fixed"}}})}else!p||"fill"!==b&&"fit"!==b?p||!b&&!y||e({..."horizontal"===m?{width:y}:{height:y},style:{...x,layout:{..._,flexSize:void 0,selfStretch:void 0}}}):e("horizontal"===m?{width:void 0}:{height:void 0})}),[x,y,g,m,p,_,b,o,f,h,N]),(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(Ye.View,{...(0,nt.useBlockProps)({style:D,className:ft(i,{"custom-sizes-disabled":s})}),children:(z=m,"horizontal"===z?(0,Je.jsx)(RC,{minWidth:0,enable:{top:!1,right:!0,bottom:!1,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},orientation:z,onResizeStart:B,onResize:S,onResizeStop:I,isSelected:t,isResizing:v,setIsResizing:k}):(0,Je.jsx)(Je.Fragment,{children:(0,Je.jsx)(RC,{minHeight:0,enable:{top:!1,right:!1,bottom:!0,left:!1,topRight:!1,bottomRight:!1,bottomLeft:!1,topLeft:!1},orientation:z,onResizeStart:B,onResize:C,onResizeStop:P,isSelected:t,isResizing:v,setIsResizing:k})}))}),!p&&(0,Je.jsx)(zC,{setAttributes:o,height:w||g,width:j||h,orientation:m,isResizing:v})]});var z},LC={to:[{type:"block",blocks:["core/separator"],transform:({anchor:e})=>(0,Ke.createBlock)("core/separator",{anchor:e||""})}]};const VC={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/spacer",title:"Spacer",category:"design",description:"Add white space between blocks and customize its height.",textdomain:"default",attributes:{height:{type:"string",default:"100px"},width:{type:"string"}},usesContext:["orientation"],supports:{anchor:!0,spacing:{margin:["top","bottom"],__experimentalDefaultControls:{margin:!0}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-spacer-editor",style:"wp-block-spacer"},{name:FC}=VC,EC={icon:NC,transforms:LC,edit:HC,save:function({attributes:e}){const{height:t,width:o,style:n}=e,{layout:{selfStretch:a}={}}=n||{},r="fill"===a||"fit"===a?void 0:t;return(0,Je.jsx)("div",{...nt.useBlockProps.save({style:{height:(0,nt.getSpacingPresetCssVar)(r),width:(0,nt.getSpacingPresetCssVar)(o)},"aria-hidden":!0})})},deprecated:IC},OC=()=>et({name:FC,metadata:VC,settings:EC}),$C=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"})}),GC={"subtle-light-gray":"#f3f4f5","subtle-pale-green":"#e9fbe5","subtle-pale-blue":"#e7f5fe","subtle-pale-pink":"#fcf0ef"},UC={content:{type:"rich-text",source:"rich-text"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"},colspan:{type:"string",source:"attribute",attribute:"colspan"},rowspan:{type:"string",source:"attribute",attribute:"rowspan"}},qC={attributes:{hasFixedLayout:{type:"boolean",default:!1},caption:{type:"rich-text",source:"rich-text",selector:"figcaption"},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:UC}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:UC}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:UC}}}},supports:{anchor:!0,align:!0,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{__experimentalSkipSerialization:!0,color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},__experimentalSelector:".wp-block-table > table",interactivity:{clientNavigation:!0}},save({attributes:e}){const{hasFixedLayout:t,head:o,body:n,foot:a,caption:r}=e;if(!o.length&&!n.length&&!a.length)return null;const i=(0,nt.__experimentalGetColorClassesAndStyles)(e),s=(0,nt.__experimentalGetBorderClassesAndStyles)(e),l=ft(i.className,s.className,{"has-fixed-layout":t}),c=!nt.RichText.isEmpty(r),u=({type:e,rows:t})=>{if(!t.length)return null;const o=`t${e}`;return(0,Je.jsx)(o,{children:t.map((({cells:e},t)=>(0,Je.jsx)("tr",{children:e.map((({content:e,tag:t,scope:o,align:n,colspan:a,rowspan:r},i)=>{const s=ft({[`has-text-align-${n}`]:n});return(0,Je.jsx)(nt.RichText.Content,{className:s||void 0,"data-align":n,tagName:t,value:e,scope:"th"===t?o:void 0,colSpan:a,rowSpan:r},i)}))},t)))})};return(0,Je.jsxs)("figure",{...nt.useBlockProps.save(),children:[(0,Je.jsxs)("table",{className:""===l?void 0:l,style:{...i.style,...s.style},children:[(0,Je.jsx)(u,{type:"head",rows:o}),(0,Je.jsx)(u,{type:"body",rows:n}),(0,Je.jsx)(u,{type:"foot",rows:a})]}),c&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:r,className:(0,nt.__experimentalGetElementClassName)("caption")})]})}},WC={content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}},ZC={attributes:{hasFixedLayout:{type:"boolean",default:!1},caption:{type:"string",source:"html",selector:"figcaption",default:""},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:WC}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:WC}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:WC}}}},supports:{anchor:!0,align:!0,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{__experimentalSkipSerialization:!0,color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},__experimentalSelector:".wp-block-table > table"},save({attributes:e}){const{hasFixedLayout:t,head:o,body:n,foot:a,caption:r}=e;if(!o.length&&!n.length&&!a.length)return null;const i=(0,nt.__experimentalGetColorClassesAndStyles)(e),s=(0,nt.__experimentalGetBorderClassesAndStyles)(e),l=ft(i.className,s.className,{"has-fixed-layout":t}),c=!nt.RichText.isEmpty(r),u=({type:e,rows:t})=>{if(!t.length)return null;const o=`t${e}`;return(0,Je.jsx)(o,{children:t.map((({cells:e},t)=>(0,Je.jsx)("tr",{children:e.map((({content:e,tag:t,scope:o,align:n},a)=>{const r=ft({[`has-text-align-${n}`]:n});return(0,Je.jsx)(nt.RichText.Content,{className:r||void 0,"data-align":n,tagName:t,value:e,scope:"th"===t?o:void 0},a)}))},t)))})};return(0,Je.jsxs)("figure",{...nt.useBlockProps.save(),children:[(0,Je.jsxs)("table",{className:""===l?void 0:l,style:{...i.style,...s.style},children:[(0,Je.jsx)(u,{type:"head",rows:o}),(0,Je.jsx)(u,{type:"body",rows:n}),(0,Je.jsx)(u,{type:"foot",rows:a})]}),c&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:r})]})}},QC={content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"}},KC={attributes:{hasFixedLayout:{type:"boolean",default:!1},backgroundColor:{type:"string"},caption:{type:"string",source:"html",selector:"figcaption",default:""},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:QC}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:QC}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:QC}}}},supports:{anchor:!0,align:!0,__experimentalSelector:".wp-block-table > table"},save:({attributes:e})=>{const{hasFixedLayout:t,head:o,body:n,foot:a,backgroundColor:r,caption:i}=e;if(!o.length&&!n.length&&!a.length)return null;const s=(0,nt.getColorClassName)("background-color",r),l=ft(s,{"has-fixed-layout":t,"has-background":!!s}),c=!nt.RichText.isEmpty(i),u=({type:e,rows:t})=>{if(!t.length)return null;const o=`t${e}`;return(0,Je.jsx)(o,{children:t.map((({cells:e},t)=>(0,Je.jsx)("tr",{children:e.map((({content:e,tag:t,scope:o,align:n},a)=>{const r=ft({[`has-text-align-${n}`]:n});return(0,Je.jsx)(nt.RichText.Content,{className:r||void 0,"data-align":n,tagName:t,value:e,scope:"th"===t?o:void 0},a)}))},t)))})};return(0,Je.jsxs)("figure",{...nt.useBlockProps.save(),children:[(0,Je.jsxs)("table",{className:""===l?void 0:l,children:[(0,Je.jsx)(u,{type:"head",rows:o}),(0,Je.jsx)(u,{type:"body",rows:n}),(0,Je.jsx)(u,{type:"foot",rows:a})]}),c&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:i})]})},isEligible:e=>e.backgroundColor&&e.backgroundColor in GC&&!e.style,migrate:e=>({...e,backgroundColor:void 0,style:{color:{background:GC[e.backgroundColor]}}})},YC={content:{type:"string",source:"html"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"}},JC={attributes:{hasFixedLayout:{type:"boolean",default:!1},backgroundColor:{type:"string"},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:YC}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:YC}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:YC}}}},supports:{align:!0},save({attributes:e}){const{hasFixedLayout:t,head:o,body:n,foot:a,backgroundColor:r}=e;if(!o.length&&!n.length&&!a.length)return null;const i=(0,nt.getColorClassName)("background-color",r),s=ft(i,{"has-fixed-layout":t,"has-background":!!i}),l=({type:e,rows:t})=>{if(!t.length)return null;const o=`t${e}`;return(0,Je.jsx)(o,{children:t.map((({cells:e},t)=>(0,Je.jsx)("tr",{children:e.map((({content:e,tag:t,scope:o},n)=>(0,Je.jsx)(nt.RichText.Content,{tagName:t,value:e,scope:"th"===t?o:void 0},n)))},t)))})};return(0,Je.jsxs)("table",{className:s,children:[(0,Je.jsx)(l,{type:"head",rows:o}),(0,Je.jsx)(l,{type:"body",rows:n}),(0,Je.jsx)(l,{type:"foot",rows:a})]})}},XC=[qC,ZC,KC,JC],ej=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})}),tj=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})}),oj=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})}),nj=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z"})}),aj=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z"})}),rj=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z"})}),ij=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z"})}),sj=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z"})}),lj=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z"})}),cj=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z"})}),uj=["align"];function dj(e,t,o){if(!t)return e;const n=Object.fromEntries(Object.entries(e).filter((([e])=>["head","body","foot"].includes(e)))),{sectionName:a,rowIndex:r}=t;return Object.fromEntries(Object.entries(n).map((([e,n])=>a&&a!==e?[e,n]:[e,n.map(((n,a)=>r&&r!==a?n:{cells:n.cells.map(((n,r)=>function(e,t){if(!e||!t)return!1;switch(t.type){case"column":return"column"===t.type&&e.columnIndex===t.columnIndex;case"cell":return"cell"===t.type&&e.sectionName===t.sectionName&&e.columnIndex===t.columnIndex&&e.rowIndex===t.rowIndex}}({sectionName:e,columnIndex:r,rowIndex:a},t)?o(n):n))}))])))}function pj(e,{sectionName:t,rowIndex:o,columnCount:n}){const a=function(e){return gj(e.head)?gj(e.body)?gj(e.foot)?void 0:e.foot[0]:e.body[0]:e.head[0]}(e),r=void 0===n?a?.cells?.length:n;return r?{[t]:[...e[t].slice(0,o),{cells:Array.from({length:r}).map(((e,o)=>{var n;const r=null!==(n=a?.cells?.[o])&&void 0!==n?n:{};return{...Object.fromEntries(Object.entries(r).filter((([e])=>uj.includes(e)))),content:"",tag:"head"===t?"th":"td"}}))},...e[t].slice(o)]}:e}function mj(e,t){var o;if(!gj(e[t]))return{[t]:[]};return pj(e,{sectionName:t,rowIndex:0,columnCount:null!==(o=e.body?.[0]?.cells?.length)&&void 0!==o?o:1})}function gj(e){return!e||!e.length||e.every(hj)}function hj(e){return!(e.cells&&e.cells.length)}const xj=[{icon:ej,title:(0,ot.__)("Align column left"),align:"left"},{icon:tj,title:(0,ot.__)("Align column center"),align:"center"},{icon:oj,title:(0,ot.__)("Align column right"),align:"right"}],_j={head:(0,ot.__)("Header cell text"),body:(0,ot.__)("Body cell text"),foot:(0,ot.__)("Footer cell text")},bj={head:(0,ot.__)("Header label"),foot:(0,ot.__)("Footer label")};function yj({name:e,...t}){const o=`t${e}`;return(0,Je.jsx)(o,{...t})}const fj=function({attributes:e,setAttributes:t,insertBlocksAfter:o,isSelected:n}){const{hasFixedLayout:a,head:r,foot:i}=e,[s,l]=(0,st.useState)(2),[c,u]=(0,st.useState)(2),[d,p]=(0,st.useState)(),m=(0,nt.__experimentalUseColorProps)(e),g=(0,nt.__experimentalUseBorderProps)(e),h=(0,st.useRef)(),[x,_]=(0,st.useState)(!1),b=mt();function y(o){d&&t(dj(e,d,(e=>({...e,content:o}))))}function f(o){if(!d)return;const{sectionName:n,rowIndex:a}=d,r=a+o;t(pj(e,{sectionName:n,rowIndex:r})),p({sectionName:n,rowIndex:r,columnIndex:0,type:"cell"})}function v(o=0){if(!d)return;const{columnIndex:n}=d,a=n+o;t(function(e,{columnIndex:t}){const o=Object.fromEntries(Object.entries(e).filter((([e])=>["head","body","foot"].includes(e))));return Object.fromEntries(Object.entries(o).map((([e,o])=>gj(o)?[e,o]:[e,o.map((o=>hj(o)||o.cells.length<t?o:{cells:[...o.cells.slice(0,t),{content:"",tag:"head"===e?"th":"td"},...o.cells.slice(t)]}))])))}(e,{columnIndex:a})),p({rowIndex:0,columnIndex:a,type:"cell"})}(0,st.useEffect)((()=>{n||p()}),[n]),(0,st.useEffect)((()=>{x&&(h?.current?.querySelector('td div[contentEditable="true"]')?.focus(),_(!1))}),[x]);const k=["head","body","foot"].filter((t=>!gj(e[t]))),w=[{icon:nj,title:(0,ot.__)("Insert row before"),isDisabled:!d,onClick:function(){f(0)}},{icon:aj,title:(0,ot.__)("Insert row after"),isDisabled:!d,onClick:function(){f(1)}},{icon:rj,title:(0,ot.__)("Delete row"),isDisabled:!d,onClick:function(){if(!d)return;const{sectionName:o,rowIndex:n}=d;p(),t(function(e,{sectionName:t,rowIndex:o}){return{[t]:e[t].filter(((e,t)=>t!==o))}}(e,{sectionName:o,rowIndex:n}))}},{icon:ij,title:(0,ot.__)("Insert column before"),isDisabled:!d,onClick:function(){v(0)}},{icon:sj,title:(0,ot.__)("Insert column after"),isDisabled:!d,onClick:function(){v(1)}},{icon:lj,title:(0,ot.__)("Delete column"),isDisabled:!d,onClick:function(){if(!d)return;const{sectionName:o,columnIndex:n}=d;p(),t(function(e,{columnIndex:t}){const o=Object.fromEntries(Object.entries(e).filter((([e])=>["head","body","foot"].includes(e))));return Object.fromEntries(Object.entries(o).map((([e,o])=>gj(o)?[e,o]:[e,o.map((e=>({cells:e.cells.length>=t?e.cells.filter(((e,o)=>o!==t)):e.cells}))).filter((e=>e.cells.length))])))}(e,{sectionName:o,columnIndex:n}))}}],C=k.map((t=>(0,Je.jsx)(yj,{name:t,children:e[t].map((({cells:e},o)=>(0,Je.jsx)("tr",{children:e.map((({content:e,tag:n,scope:a,align:r,colspan:i,rowspan:s},l)=>(0,Je.jsx)(n,{scope:"th"===n?a:void 0,colSpan:i,rowSpan:s,className:ft({[`has-text-align-${r}`]:r},"wp-block-table__cell-content"),children:(0,Je.jsx)(nt.RichText,{value:e,onChange:y,onFocus:()=>{p({sectionName:t,rowIndex:o,columnIndex:l,type:"cell"})},"aria-label":_j[t],placeholder:bj[t]})},l)))},o)))},t))),j=!k.length;return(0,Je.jsxs)("figure",{...(0,nt.useBlockProps)({ref:h}),children:[!j&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{label:(0,ot.__)("Change column alignment"),alignmentControls:xj,value:function(){if(d)return function(e,t,o){const{sectionName:n,rowIndex:a,columnIndex:r}=t;return e[n]?.[a]?.cells?.[r]?.[o]}(e,d,"align")}(),onChange:o=>function(o){if(!d)return;const n={type:"column",columnIndex:d.columnIndex},a=dj(e,n,(e=>({...e,align:o})));t(a)}(o)})}),(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(tt.ToolbarDropdownMenu,{icon:cj,label:(0,ot.__)("Edit table"),controls:w})})]}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{t({hasFixedLayout:!0,head:[],foot:[]})},dropdownMenuProps:b,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!0!==a,label:(0,ot.__)("Fixed width table cells"),onDeselect:()=>t({hasFixedLayout:!0}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Fixed width table cells"),checked:!!a,onChange:function(){t({hasFixedLayout:!a})}})}),!j&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>r&&r.length,label:(0,ot.__)("Header section"),onDeselect:()=>t({head:[]}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Header section"),checked:!(!r||!r.length),onChange:function(){t(mj(e,"head"))}})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>i&&i.length,label:(0,ot.__)("Footer section"),onDeselect:()=>t({foot:[]}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Footer section"),checked:!(!i||!i.length),onChange:function(){t(mj(e,"foot"))}})})]})]})}),!j&&(0,Je.jsx)("table",{className:ft(m.className,g.className,{"has-fixed-layout":a,"has-individual-borders":(0,tt.__experimentalHasSplitBorders)(e?.style?.border)}),style:{...m.style,...g.style},children:C}),j?(0,Je.jsx)(tt.Placeholder,{label:(0,ot.__)("Table"),icon:(0,Je.jsx)(nt.BlockIcon,{icon:$C,showColors:!0}),instructions:(0,ot.__)("Insert a table for sharing data."),children:(0,Je.jsxs)("form",{className:"blocks-table__placeholder-form",onSubmit:function(e){e.preventDefault(),t(function({rowCount:e,columnCount:t}){return{body:Array.from({length:e}).map((()=>({cells:Array.from({length:t}).map((()=>({content:"",tag:"td"})))})))}}({rowCount:parseInt(s,10)||2,columnCount:parseInt(c,10)||2})),_(!0)},children:[(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,type:"number",label:(0,ot.__)("Column count"),value:c,onChange:function(e){u(e)},min:"1",className:"blocks-table__placeholder-input"}),(0,Je.jsx)(tt.TextControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,type:"number",label:(0,ot.__)("Row count"),value:s,onChange:function(e){l(e)},min:"1",className:"blocks-table__placeholder-input"}),(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",children:(0,ot.__)("Create Table")})]})}):(0,Je.jsx)(Yt,{attributes:e,setAttributes:t,isSelected:n,insertBlocksAfter:o,label:(0,ot.__)("Table caption text"),showToolbarButton:n})]})};function vj(e){const t=parseInt(e,10);if(Number.isInteger(t))return t<0||1===t?void 0:t.toString()}const kj=({phrasingContentSchema:e})=>({tr:{allowEmpty:!0,children:{th:{allowEmpty:!0,children:e,attributes:["scope","colspan","rowspan"]},td:{allowEmpty:!0,children:e,attributes:["colspan","rowspan"]}}}}),wj={from:[{type:"raw",selector:"table",schema:e=>({table:{children:{thead:{allowEmpty:!0,children:kj(e)},tfoot:{allowEmpty:!0,children:kj(e)},tbody:{allowEmpty:!0,children:kj(e)}}}}),transform:e=>{const t=Array.from(e.children).reduce(((e,t)=>{if(!t.children.length)return e;const o=t.nodeName.toLowerCase().slice(1),n=Array.from(t.children).reduce(((e,t)=>{if(!t.children.length)return e;const o=Array.from(t.children).reduce(((e,t)=>{const o=vj(t.getAttribute("rowspan")),n=vj(t.getAttribute("colspan"));return e.push({tag:t.nodeName.toLowerCase(),content:t.innerHTML,rowspan:o,colspan:n}),e}),[]);return e.push({cells:o}),e}),[]);return e[o]=n,e}),{});return(0,Ke.createBlock)("core/table",t)}}]},Cj=wj,jj={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/table",title:"Table",category:"text",description:"Create structured content in rows and columns to display information.",textdomain:"default",attributes:{hasFixedLayout:{type:"boolean",default:!0},caption:{type:"rich-text",source:"rich-text",selector:"figcaption"},head:{type:"array",default:[],source:"query",selector:"thead tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"rich-text",source:"rich-text"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"},colspan:{type:"string",source:"attribute",attribute:"colspan"},rowspan:{type:"string",source:"attribute",attribute:"rowspan"}}}}},body:{type:"array",default:[],source:"query",selector:"tbody tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"rich-text",source:"rich-text"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"},colspan:{type:"string",source:"attribute",attribute:"colspan"},rowspan:{type:"string",source:"attribute",attribute:"rowspan"}}}}},foot:{type:"array",default:[],source:"query",selector:"tfoot tr",query:{cells:{type:"array",default:[],source:"query",selector:"td,th",query:{content:{type:"rich-text",source:"rich-text"},tag:{type:"string",default:"td",source:"tag"},scope:{type:"string",source:"attribute",attribute:"scope"},align:{type:"string",source:"attribute",attribute:"data-align"},colspan:{type:"string",source:"attribute",attribute:"colspan"},rowspan:{type:"string",source:"attribute",attribute:"rowspan"}}}}}},supports:{anchor:!0,align:!0,color:{__experimentalSkipSerialization:!0,gradients:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalDefaultControls:{fontSize:!0}},__experimentalBorder:{__experimentalSkipSerialization:!0,color:!0,style:!0,width:!0,__experimentalDefaultControls:{color:!0,style:!0,width:!0}},interactivity:{clientNavigation:!0}},selectors:{root:".wp-block-table > table",spacing:".wp-block-table"},styles:[{name:"regular",label:"Default",isDefault:!0},{name:"stripes",label:"Stripes"}],editorStyle:"wp-block-table-editor",style:"wp-block-table"},{name:Sj}=jj,Bj={icon:$C,example:{attributes:{head:[{cells:[{content:(0,ot.__)("Version"),tag:"th"},{content:(0,ot.__)("Jazz Musician"),tag:"th"},{content:(0,ot.__)("Release Date"),tag:"th"}]}],body:[{cells:[{content:"5.2",tag:"td"},{content:"Jaco Pastorius",tag:"td"},{content:(0,ot.__)("May 7, 2019"),tag:"td"}]},{cells:[{content:"5.1",tag:"td"},{content:"Betty Carter",tag:"td"},{content:(0,ot.__)("February 21, 2019"),tag:"td"}]},{cells:[{content:"5.0",tag:"td"},{content:"Bebo Valdés",tag:"td"},{content:(0,ot.__)("December 6, 2018"),tag:"td"}]}]},viewportWidth:450},transforms:Cj,edit:fj,save:function({attributes:e}){const{hasFixedLayout:t,head:o,body:n,foot:a,caption:r}=e;if(!o.length&&!n.length&&!a.length)return null;const i=(0,nt.__experimentalGetColorClassesAndStyles)(e),s=(0,nt.__experimentalGetBorderClassesAndStyles)(e),l=ft(i.className,s.className,{"has-fixed-layout":t}),c=!nt.RichText.isEmpty(r),u=({type:e,rows:t})=>{if(!t.length)return null;const o=`t${e}`;return(0,Je.jsx)(o,{children:t.map((({cells:e},t)=>(0,Je.jsx)("tr",{children:e.map((({content:e,tag:t,scope:o,align:n,colspan:a,rowspan:r},i)=>{const s=ft({[`has-text-align-${n}`]:n});return(0,Je.jsx)(nt.RichText.Content,{className:s||void 0,"data-align":n,tagName:t,value:e,scope:"th"===t?o:void 0,colSpan:a,rowSpan:r},i)}))},t)))})};return(0,Je.jsxs)("figure",{...nt.useBlockProps.save(),children:[(0,Je.jsxs)("table",{className:""===l?void 0:l,style:{...i.style,...s.style},children:[(0,Je.jsx)(u,{type:"head",rows:o}),(0,Je.jsx)(u,{type:"body",rows:n}),(0,Je.jsx)(u,{type:"foot",rows:a})]}),c&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:r,className:(0,nt.__experimentalGetElementClassName)("caption")})]})},deprecated:XC},Tj=()=>et({name:Sj,metadata:jj,settings:Bj}),Nj=(0,Je.jsxs)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,Je.jsx)(Ye.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20 9.484h-8.889v-1.5H20v1.5Zm0 7h-4.889v-1.5H20v1.5Zm-14 .032a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"}),(0,Je.jsx)(Ye.Path,{d:"M13 15.516a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM8 8.484a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"})]}),Pj="wp-block-table-of-contents__entry";function Ij({nestedHeadingList:e,disableLinkActivation:t,onClick:o}){return(0,Je.jsx)(Je.Fragment,{children:e.map(((e,n)=>{const{content:a,link:r}=e.heading,i=r?(0,Je.jsx)("a",{className:Pj,href:r,"aria-disabled":t||void 0,onClick:t&&"function"==typeof o?o:void 0,children:a}):(0,Je.jsx)("span",{className:Pj,children:a});return(0,Je.jsxs)("li",{children:[i,e.children?(0,Je.jsx)("ol",{children:(0,Je.jsx)(Ij,{nestedHeadingList:e.children,disableLinkActivation:t,onClick:t&&"function"==typeof o?o:void 0})}):null]},n)}))})}function Mj(e){const t=[];return e.forEach(((o,n)=>{if(""!==o.content&&o.level===e[0].level)if(e[n+1]?.level>o.level){let a=e.length;for(let t=n+1;t<e.length;t++)if(e[t].level===o.level){a=t;break}t.push({heading:o,children:Mj(e.slice(n+1,a))})}else t.push({heading:o,children:null})})),t}var Dj=o(7734),zj=o.n(Dj);function Aj(e,t,o){const{getBlockAttributes:n}=e(nt.store),{updateBlockAttributes:a,__unstableMarkNextChangeAsNotPersistent:r}=t(nt.store),i=n(o);if(null===i)return;const s=function(e,t){var o,n;const{getBlockAttributes:a,getBlockName:r,getClientIdsWithDescendants:i,getBlocksByName:s}=e(nt.store),l=null!==(o=e("core/editor").getPermalink())&&void 0!==o?o:null,c=0!==s("core/nextpage").length,{onlyIncludeCurrentPage:u}=null!==(n=a(t))&&void 0!==n?n:{},d=i();let p=1;if(c&&u){const e=d.indexOf(t);for(const[t,o]of d.entries()){if(t>=e)break;"core/nextpage"===r(o)&&p++}}const m=[];let g=1,h=null;"string"==typeof l&&(h=c?(0,vt.addQueryArgs)(l,{page:g}):l);for(const e of d){const t=r(e);if("core/nextpage"===t){if(g++,u&&g>p)break;"string"==typeof l&&(h=(0,vt.addQueryArgs)((0,vt.removeQueryArgs)(l,["page"]),{page:g}))}else if((!u||g===p)&&"core/heading"===t){const t=a(e),o="string"==typeof h&&"string"==typeof t.anchor&&""!==t.anchor;m.push({content:(0,xc.__unstableStripHTML)(t.content.replace(/(<br *\/?>)+/g," ")),level:t.level,link:o?`${h}#${t.anchor}`:null})}}return m}(e,o);zj()(s,i.headings)||(r(),a(o,{headings:s}))}const Rj={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,__experimental:!0,name:"core/table-of-contents",title:"Table of Contents",category:"design",description:"Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.",keywords:["document outline","summary"],textdomain:"default",attributes:{headings:{type:"array",items:{type:"object"},default:[]},onlyIncludeCurrentPage:{type:"boolean",default:!1}},supports:{html:!1,color:{text:!0,background:!0,gradients:!0,link:!0},spacing:{margin:!0,padding:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},style:"wp-block-table-of-contents"},{name:Hj}=Rj,Lj={icon:Nj,edit:function e({attributes:{headings:t=[],onlyIncludeCurrentPage:o},clientId:n,setAttributes:a}){!function(e){const t=(0,it.useRegistry)();(0,st.useEffect)((()=>t.subscribe((()=>Aj(t.select,t.dispatch,e)))),[t,e])}(n);const r=(0,nt.useBlockProps)(),i=(0,ut.useInstanceId)(e,"table-of-contents"),{createWarningNotice:s}=(0,it.useDispatch)(Rt.store),l=(0,it.useSelect)((e=>{const{getBlockRootClientId:t,canInsertBlockType:o}=e(nt.store);return o("core/list",t(n))}),[n]),{replaceBlocks:c}=(0,it.useDispatch)(nt.store),u=mt(),d=Mj(t),p=l&&(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(tt.ToolbarGroup,{children:(0,Je.jsx)(tt.ToolbarButton,{onClick:()=>c(n,(0,Ke.createBlock)("core/list",{ordered:!0,values:(0,st.renderToString)((0,Je.jsx)(Ij,{nestedHeadingList:d}))})),children:(0,ot.__)("Convert to static list")})})}),m=(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{a({onlyIncludeCurrentPage:!1})},dropdownMenuProps:u,children:(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!!o,label:(0,ot.__)("Only include current page"),onDeselect:()=>a({onlyIncludeCurrentPage:!1}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Only include current page"),checked:o,onChange:e=>a({onlyIncludeCurrentPage:e}),help:o?(0,ot.__)("Only including headings from the current page (if the post is paginated)."):(0,ot.__)("Include headings from all pages (if the post is paginated).")})})})});return 0===t.length?(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("div",{...r,children:(0,Je.jsx)(tt.Placeholder,{icon:(0,Je.jsx)(nt.BlockIcon,{icon:Nj}),label:(0,ot.__)("Table of Contents"),instructions:(0,ot.__)("Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.")})}),m]}):(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)("nav",{...r,children:(0,Je.jsx)("ol",{children:(0,Je.jsx)(Ij,{nestedHeadingList:d,disableLinkActivation:!0,onClick:e=>{e.preventDefault(),s((0,ot.__)("Links are disabled in the editor."),{id:`block-library/core/table-of-contents/redirection-prevented/${i}`,type:"snackbar"})}})})}),p,m]})},save:function({attributes:{headings:e=[]}}){return 0===e.length?null:(0,Je.jsx)("nav",{...nt.useBlockProps.save(),children:(0,Je.jsx)("ol",{children:(0,Je.jsx)(Ij,{nestedHeadingList:Mj(e)})})})},example:{innerBlocks:[{name:"core/heading",attributes:{level:2,content:(0,ot.__)("Heading")}},{name:"core/heading",attributes:{level:3,content:(0,ot.__)("Subheading")}},{name:"core/heading",attributes:{level:2,content:(0,ot.__)("Heading")}},{name:"core/heading",attributes:{level:3,content:(0,ot.__)("Subheading")}}],attributes:{headings:[{content:(0,ot.__)("Heading"),level:2},{content:(0,ot.__)("Subheading"),level:3},{content:(0,ot.__)("Heading"),level:2},{content:(0,ot.__)("Subheading"),level:3}]}}},Vj=()=>et({name:Hj,metadata:Rj,settings:Lj}),Fj={from:[{type:"block",blocks:["core/categories"],transform:()=>(0,Ke.createBlock)("core/tag-cloud")}],to:[{type:"block",blocks:["core/categories"],transform:()=>(0,Ke.createBlock)("core/categories")}]};const Ej=function({attributes:e,setAttributes:t}){const{taxonomy:o,showTagCounts:n,numberOfTags:a,smallestFontSize:r,largestFontSize:i}=e,[s]=(0,nt.useSettings)("spacing.units"),l=mt(),c=(0,tt.__experimentalUseCustomUnits)({availableUnits:s?[...s,"pt"]:["%","px","em","rem","pt"]}),u=(0,it.useSelect)((e=>e(ct.store).getTaxonomies({per_page:-1})),[]),d=(e,o)=>{const[n,a]=(0,tt.__experimentalParseQuantityAndUnitFromRawValue)(o);if(!Number.isFinite(n))return;const s={[e]:o};Object.entries({smallestFontSize:r,largestFontSize:i}).forEach((([t,o])=>{const[n,r]=(0,tt.__experimentalParseQuantityAndUnitFromRawValue)(o);t!==e&&r!==a&&(s[t]=`${n}${a}`)})),t(s)},p={...e,style:{...e?.style,border:void 0}},m=(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{t({taxonomy:"post_tag",showTagCounts:!1,numberOfTags:45,smallestFontSize:"8pt",largestFontSize:"22pt"})},dropdownMenuProps:l,children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>"post_tag"!==o,label:(0,ot.__)("Taxonomy"),onDeselect:()=>t({taxonomy:"post_tag"}),isShownByDefault:!0,children:(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Taxonomy"),options:[{label:(0,ot.__)("- Select -"),value:"",disabled:!0},...(null!=u?u:[]).filter((e=>!!e.show_cloud)).map((e=>({value:e.slug,label:e.name})))],value:o,onChange:e=>t({taxonomy:e})})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>"8pt"!==r||"22pt"!==i,label:(0,ot.__)("Font size"),onDeselect:()=>t({smallestFontSize:"8pt",largestFontSize:"22pt"}),isShownByDefault:!0,children:(0,Je.jsxs)(tt.Flex,{gap:4,children:[(0,Je.jsx)(tt.FlexItem,{isBlock:!0,children:(0,Je.jsx)(tt.__experimentalUnitControl,{label:(0,ot.__)("Smallest size"),value:r,onChange:e=>{d("smallestFontSize",e)},units:c,min:.1,max:100,size:"__unstable-large"})}),(0,Je.jsx)(tt.FlexItem,{isBlock:!0,children:(0,Je.jsx)(tt.__experimentalUnitControl,{label:(0,ot.__)("Largest size"),value:i,onChange:e=>{d("largestFontSize",e)},units:c,min:.1,max:100,size:"__unstable-large"})})]})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>45!==a,label:(0,ot.__)("Number of tags"),onDeselect:()=>t({numberOfTags:45}),isShownByDefault:!0,children:(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Number of tags"),value:a,onChange:e=>t({numberOfTags:e}),min:1,max:100,required:!0})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{hasValue:()=>!1!==n,label:(0,ot.__)("Show tag counts"),onDeselect:()=>t({showTagCounts:!1}),isShownByDefault:!0,children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Show tag counts"),checked:n,onChange:()=>t({showTagCounts:!n})})})]})});return(0,Je.jsxs)(Je.Fragment,{children:[m,(0,Je.jsx)("div",{...(0,nt.useBlockProps)(),children:(0,Je.jsx)(tt.Disabled,{children:(0,Je.jsx)(rt(),{skipBlockSupportAttributes:!0,block:"core/tag-cloud",attributes:p})})})]})},Oj={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/tag-cloud",title:"Tag Cloud",category:"widgets",description:"A cloud of popular keywords, each sized by how often it appears.",textdomain:"default",attributes:{numberOfTags:{type:"number",default:45,minimum:1,maximum:100},taxonomy:{type:"string",default:"post_tag"},showTagCounts:{type:"boolean",default:!1},smallestFontSize:{type:"string",default:"8pt"},largestFontSize:{type:"string",default:"22pt"}},styles:[{name:"default",label:"Default",isDefault:!0},{name:"outline",label:"Outline"}],supports:{html:!1,align:!0,spacing:{margin:!0,padding:!0},typography:{lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalLetterSpacing:!0},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}},editorStyle:"wp-block-tag-cloud-editor"},{name:$j}=Oj,Gj={icon:hx,example:{},edit:Ej,transforms:Fj},Uj=()=>et({name:$j,metadata:Oj,settings:Gj});var qj=function(){return qj=Object.assign||function(e){for(var t,o=1,n=arguments.length;o<n;o++)for(var a in t=arguments[o])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},qj.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function Wj(e){return e.toLowerCase()}var Zj=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Qj=/[^A-Z0-9]+/gi;function Kj(e,t){void 0===t&&(t={});for(var o=t.splitRegexp,n=void 0===o?Zj:o,a=t.stripRegexp,r=void 0===a?Qj:a,i=t.transform,s=void 0===i?Wj:i,l=t.delimiter,c=void 0===l?" ":l,u=Yj(Yj(e,n,"$1\0$2"),r,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(s).join(c)}function Yj(e,t,o){return t instanceof RegExp?e.replace(t,o):t.reduce((function(e,t){return e.replace(t,o)}),e)}function Jj(e){return function(e){return e.charAt(0).toUpperCase()+e.substr(1)}(e.toLowerCase())}function Xj(e,t){return void 0===t&&(t={}),function(e,t){return void 0===t&&(t={}),Kj(e,qj({delimiter:"."},t))}(e,qj({delimiter:"-"},t))}function eS(e,t){const{templateParts:o,isResolving:n}=(0,it.useSelect)((e=>{const{getEntityRecords:t,isResolving:o}=e(ct.store),n={per_page:-1};return{templateParts:t("postType","wp_template_part",n),isResolving:o("getEntityRecords",["postType","wp_template_part",n])}}),[]);return{templateParts:(0,st.useMemo)((()=>o&&o.filter((o=>lh(o.theme,o.slug)!==t&&(!e||"uncategorized"===e||o.area===e)))||[]),[o,e,t]),isResolving:n}}function tS(e,t){return(0,it.useSelect)((o=>{const n=e?`core/template-part/${e}`:"core/template-part",{getBlockRootClientId:a,getPatternsByBlockTypes:r}=o(nt.store);return r(n,a(t))}),[e,t])}function oS(e,t){const{saveEntityRecord:o}=(0,it.useDispatch)(ct.store);return async(n=[],a=(0,ot.__)("Untitled Template Part"))=>{const r={title:a,slug:Xj(a).replace(/[^\w-]+/g,"")||"wp-custom-part",content:(0,Ke.serialize)(n),area:e},i=await o("postType","wp_template_part",r);t({slug:i.slug,theme:i.theme,area:void 0})}}function nS(e){return(0,it.useSelect)((t=>{var o;const n=t(ct.store).getCurrentTheme()?.default_template_part_areas||[],a=n.find((t=>t.area===e)),r=n.find((e=>"uncategorized"===e.area));return{icon:a?.icon||r?.icon,label:a?.label||(0,ot.__)("Template Part"),tagName:null!==(o=a?.area_tag)&&void 0!==o?o:"div"}}),[e])}function aS({areaLabel:e,onClose:t,onSubmit:o}){const[n,a]=(0,st.useState)("");return(0,Je.jsx)(tt.Modal,{title:(0,ot.sprintf)((0,ot.__)("Create new %s"),e.toLowerCase()),onRequestClose:t,focusOnMount:"firstContentElement",size:"small",children:(0,Je.jsx)("form",{onSubmit:e=>{e.preventDefault(),o(n)},children:(0,Je.jsxs)(tt.__experimentalVStack,{spacing:"5",children:[(0,Je.jsx)(tt.TextControl,{label:(0,ot.__)("Name"),value:n,onChange:a,placeholder:(0,ot.__)("Custom Template Part"),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,Je.jsxs)(tt.__experimentalHStack,{justify:"right",children:[(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{t(),a("")},children:(0,ot.__)("Cancel")}),(0,Je.jsx)(tt.Button,{variant:"primary",type:"submit",accessibleWhenDisabled:!0,disabled:!n.length,__next40pxDefaultSize:!0,children:(0,ot.__)("Create")})]})]})})})}function rS({area:e,clientId:t,templatePartId:o,onOpenSelectionModal:n,setAttributes:a}){const{templateParts:r,isResolving:i}=eS(e,o),s=tS(e,t),{isBlockBasedTheme:l,canCreateTemplatePart:c}=(0,it.useSelect)((e=>{const{getCurrentTheme:t,canUser:o}=e(ct.store);return{isBlockBasedTheme:t()?.is_block_theme,canCreateTemplatePart:o("create",{kind:"postType",name:"wp_template_part"})}}),[]),[u,d]=(0,st.useState)(!1),p=nS(e),m=oS(e,a);return(0,Je.jsxs)(tt.Placeholder,{icon:p.icon,label:p.label,instructions:l?(0,ot.sprintf)((0,ot.__)("Choose an existing %s or create a new one."),p.label.toLowerCase()):(0,ot.sprintf)((0,ot.__)("Choose an existing %s."),p.label.toLowerCase()),children:[i&&(0,Je.jsx)(tt.Spinner,{}),!i&&!(!r.length&&!s.length)&&(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:n,children:(0,ot.__)("Choose")}),!i&&l&&c&&(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"secondary",onClick:()=>{d(!0)},children:(0,ot.__)("Start blank")}),u&&(0,Je.jsx)(aS,{areaLabel:p.label,onClose:()=>d(!1),onSubmit:e=>{m([],e)}})]})}function iS({setAttributes:e,onClose:t,templatePartId:o=null,area:n,clientId:a}){const[r,i]=(0,st.useState)(""),{templateParts:s}=eS(n,o),l=(0,st.useMemo)((()=>Kf(s.map((e=>function(e){return{name:lh(e.theme,e.slug),title:e.title.rendered,blocks:(0,Ke.parse)(e.content.raw),templatePart:e}}(e))),r)),[s,r]),c=tS(n,a),u=(0,st.useMemo)((()=>Kf(c,r)),[c,r]),{createSuccessNotice:d}=(0,it.useDispatch)(Rt.store),p=!!l.length,m=!!u.length;return(0,Je.jsxs)("div",{className:"block-library-template-part__selection-content",children:[(0,Je.jsx)("div",{className:"block-library-template-part__selection-search",children:(0,Je.jsx)(tt.SearchControl,{__nextHasNoMarginBottom:!0,onChange:i,value:r,label:(0,ot.__)("Search"),placeholder:(0,ot.__)("Search")})}),p&&(0,Je.jsxs)("div",{children:[(0,Je.jsx)("h2",{children:(0,ot.__)("Existing template parts")}),(0,Je.jsx)(nt.__experimentalBlockPatternsList,{blockPatterns:l,onClickPattern:o=>{var n;n=o.templatePart,e({slug:n.slug,theme:n.theme,area:void 0}),d((0,ot.sprintf)((0,ot.__)('Template Part "%s" inserted.'),n.title?.rendered||n.slug),{type:"snackbar"}),t()}})]}),!p&&!m&&(0,Je.jsx)(tt.__experimentalHStack,{alignment:"center",children:(0,Je.jsx)("p",{children:(0,ot.__)("No results found.")})})]})}function sS(e){const t=(0,Ke.getPossibleBlockTransformations)([e]).filter((e=>{if(!e.transforms)return!0;const t=e.transforms?.from?.find((e=>e.blocks&&e.blocks.includes("*"))),o=e.transforms?.to?.find((e=>e.blocks&&e.blocks.includes("*")));return!t&&!o}));if(t.length)return(0,Ke.switchToBlockType)(e,t[0].name)}function lS(e=[]){return e.flatMap((e=>"core/legacy-widget"===e.name?sS(e):(0,Ke.createBlock)(e.name,e.attributes,lS(e.innerBlocks)))).filter((e=>!!e))}const cS={per_page:-1,_fields:"id,name,description,status,widgets"};function uS({area:e,setAttributes:t}){const[o,n]=(0,st.useState)(""),[a,r]=(0,st.useState)(!1),i=(0,it.useRegistry)(),{sidebars:s,hasResolved:l}=(0,it.useSelect)((e=>{const{getSidebars:t,hasFinishedResolution:o}=e(ct.store);return{sidebars:t(cS),hasResolved:o("getSidebars",[cS])}}),[]),{createErrorNotice:c}=(0,it.useDispatch)(Rt.store),u=oS(e,t),d=(0,st.useMemo)((()=>{const e=(null!=s?s:[]).filter((e=>"wp_inactive_widgets"!==e.id&&e.widgets.length>0)).map((e=>({value:e.id,label:e.name})));return e.length?[{value:"",label:(0,ot.__)("Select widget area")},...e]:[]}),[s]);if(!l)return(0,Je.jsx)(tt.__experimentalSpacer,{marginBottom:"0"});if(l&&!d.length)return null;return(0,Je.jsx)(tt.__experimentalSpacer,{marginBottom:"4",children:(0,Je.jsxs)(tt.__experimentalHStack,{as:"form",onSubmit:async function(e){if(e.preventDefault(),a||!o)return;r(!0);const t=d.find((({value:e})=>e===o)),{getWidgets:n}=i.resolveSelect(ct.store),s=await n({sidebar:t.value,_embed:"about"}),l=new Set,p=s.flatMap((e=>{const t=function(e){if("block"!==e.id_base){let t;return t=e._embedded.about[0].is_multi?{idBase:e.id_base,instance:e.instance}:{id:e.id},sS((0,Ke.createBlock)("core/legacy-widget",t))}const t=(0,Ke.parse)(e.instance.raw.content,{__unstableSkipAutop:!0});if(!t.length)return;const o=t[0];return"core/widget-group"===o.name?(0,Ke.createBlock)((0,Ke.getGroupingBlockName)(),void 0,lS(o.innerBlocks)):o.innerBlocks.length>0?(0,Ke.cloneBlock)(o,void 0,lS(o.innerBlocks)):o}(e);return t||(l.add(e.id_base),[])}));await u(p,(0,ot.sprintf)((0,ot.__)("Widget area: %s"),t.label)),l.size&&c((0,ot.sprintf)((0,ot.__)("Unable to import the following widgets: %s."),Array.from(l).join(", ")),{type:"snackbar"}),r(!1)},children:[(0,Je.jsx)(tt.FlexBlock,{children:(0,Je.jsx)(tt.SelectControl,{label:(0,ot.__)("Import widget area"),value:o,options:d,onChange:e=>n(e),disabled:!d.length,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0})}),(0,Je.jsx)(tt.FlexItem,{style:{marginBottom:"8px",marginTop:"auto"},children:(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",type:"submit",isBusy:a,"aria-disabled":a||!o,children:(0,ot._x)("Import","button label")})})]})})}function dS({tagName:e,setAttributes:t,isEntityAvailable:o,templatePartId:n,defaultWrapper:a,hasInnerBlocks:r}){const[i,s]=(0,ct.useEntityProp)("postType","wp_template_part","area",n),[l,c]=(0,ct.useEntityProp)("postType","wp_template_part","title",n),u=(0,it.useSelect)((e=>e(ct.store).getCurrentTheme()?.default_template_part_areas||[]),[]).map((({label:e,area:t})=>({label:e,value:t})));return(0,Je.jsxs)(Je.Fragment,{children:[o&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Title"),value:l,onChange:e=>{c(e)},onFocus:e=>e.target.select()}),(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Area"),labelPosition:"top",options:u,value:i,onChange:s})]}),(0,Je.jsx)(tt.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("HTML element"),options:[{label:(0,ot.sprintf)((0,ot.__)("Default based on area (%s)"),`<${a}>`),value:""},{label:"<header>",value:"header"},{label:"<main>",value:"main"},{label:"<section>",value:"section"},{label:"<article>",value:"article"},{label:"<aside>",value:"aside"},{label:"<footer>",value:"footer"},{label:"<div>",value:"div"}],value:e||"",onChange:e=>t({tagName:e}),help:sa[e]}),!r&&(0,Je.jsx)(uS,{area:i,setAttributes:t})]})}function pS(e){return"contentOnly"!==(0,nt.useBlockEditingMode)()&&(e?void 0:nt.InnerBlocks.ButtonBlockAppender)}function mS(e){const t=(0,it.useSelect)((e=>{const{getSettings:t}=e(nt.store);return t()?.supportsLayout}),[]),[o]=(0,nt.useSettings)("layout");if(t)return e?.inherit?o||{}:e}function gS({postId:e,layout:t,tagName:o,blockProps:n}){(0,nt.useBlockEditingMode)("disabled");const{content:a,editedBlocks:r}=(0,it.useSelect)((t=>{if(!e)return{};const{getEditedEntityRecord:o}=t(ct.store),n=o("postType","wp_template_part",e,{context:"view"});return{editedBlocks:n.blocks,content:n.content}}),[e]),i=(0,st.useMemo)((()=>{if(e)return r||(a&&"string"==typeof a?(0,Ke.parse)(a):[])}),[e,r,a]),s=(0,nt.useInnerBlocksProps)(n,{value:i,onInput:()=>{},onChange:()=>{},renderAppender:!1,layout:mS(t)});return(0,Je.jsx)(o,{...s})}function hS({postId:e,hasInnerBlocks:t,layout:o,tagName:n,blockProps:a}){const r=(0,it.useSelect)((e=>e(nt.store).getSettings().onNavigateToEntityRecord),[]),[i,s,l]=(0,ct.useEntityBlockEditor)("postType","wp_template_part",{id:e}),c=(0,nt.useInnerBlocksProps)(a,{value:i,onInput:s,onChange:l,renderAppender:pS(t),layout:mS(o)}),u="contentOnly"===(0,nt.useBlockEditingMode)()&&r?{onDoubleClick:()=>r({postId:e,postType:"wp_template_part"})}:{};return(0,Je.jsx)(n,{...c,...u})}function xS({postId:e,hasInnerBlocks:t,layout:o,tagName:n,blockProps:a}){const{canViewTemplatePart:r,canEditTemplatePart:i}=(0,it.useSelect)((t=>({canViewTemplatePart:!!t(ct.store).canUser("read",{kind:"postType",name:"wp_template_part",id:e}),canEditTemplatePart:!!t(ct.store).canUser("update",{kind:"postType",name:"wp_template_part",id:e})})),[e]);if(!r)return null;const s=i?hS:gS;return(0,Je.jsx)(s,{postId:e,hasInnerBlocks:t,layout:o,tagName:n,blockProps:a})}function _S({isEntityAvailable:e,area:t,templatePartId:o,isTemplatePartSelectionOpen:n,setIsTemplatePartSelectionOpen:a}){const{templateParts:r}=eS(t,o),i=!!r.length;return e&&i&&("header"===t||"footer"===t)?(0,Je.jsx)(tt.MenuItem,{onClick:()=>{a(!0)},"aria-expanded":n,"aria-haspopup":"dialog",children:(0,ot.__)("Replace")}):null}function bS({area:e,clientId:t,isEntityAvailable:o,onSelect:n}){const a=tS(e,t);return o&&!!a.length&&("header"===e||"footer"===e)?(0,Je.jsx)(tt.PanelBody,{title:(0,ot.__)("Design"),children:(0,Je.jsx)(nt.__experimentalBlockPatternsList,{label:(0,ot.__)("Templates"),blockPatterns:a,onClickPattern:n,showTitlesAsTooltip:!0})}):null}function yS(e,t){if("core/template-part"!==t)return e;if(e.variations){const t=(e,t)=>{const{area:o,theme:n,slug:a}=e;if(o)return o===t.area;if(!a)return!1;const{getCurrentTheme:r,getEntityRecord:i}=(0,it.select)(ct.store),s=i("postType","wp_template_part",`${n||r()?.stylesheet}//${a}`);return s?.slug?s.slug===t.slug:s?.area===t.area},o=e.variations.map((e=>({...e,...!e.isActive&&{isActive:t},..."string"==typeof e.icon&&{icon:mh(e.icon)}})));return{...e,variations:o}}return e}const fS={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/template-part",title:"Template Part",category:"theme",description:"Edit the different global regions of your site, like the header, footer, sidebar, or create your own.",textdomain:"default",attributes:{slug:{type:"string"},theme:{type:"string"},tagName:{type:"string"},area:{type:"string"}},supports:{align:!0,html:!1,reusable:!1,renaming:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-template-part-editor"},{name:vS}=fS,kS={icon:ph,__experimentalLabel:({slug:e,theme:t})=>{if(!e)return;const{getCurrentTheme:o,getEditedEntityRecord:n}=(0,it.select)(ct.store),a=n("postType","wp_template_part",(t||o()?.stylesheet)+"//"+e);return a?(0,tn.decodeEntities)(a.title)||function(e,t){return void 0===t&&(t={}),Kj(e,qj({delimiter:" ",transform:Jj},t))}(a.slug||""):void 0},edit:function({attributes:e,setAttributes:t,clientId:o}){const{createSuccessNotice:n}=(0,it.useDispatch)(Rt.store),{editEntityRecord:a}=(0,it.useDispatch)(ct.store),r=(0,it.useSelect)((e=>e(ct.store).getCurrentTheme()?.stylesheet),[]),{slug:i,theme:s=r,tagName:l,layout:c={}}=e,u=lh(s,i),d=(0,nt.useHasRecursion)(u),[p,m]=(0,st.useState)(!1),{isResolved:g,hasInnerBlocks:h,isMissing:x,area:_,onNavigateToEntityRecord:b,title:y,canUserEdit:f}=(0,it.useSelect)((t=>{const{getEditedEntityRecord:n,hasFinishedResolution:a}=t(ct.store),{getBlockCount:r,getSettings:i}=t(nt.store),s=["postType","wp_template_part",u],l=u?n(...s):null,c=l?.area||e.area,d=!!u&&a("getEditedEntityRecord",s),p=!!d&&t(ct.store).canUser("update",{kind:"postType",name:"wp_template_part",id:u});return{hasInnerBlocks:r(o)>0,isResolved:d,isMissing:d&&(!l||0===Object.keys(l).length),area:c,onNavigateToEntityRecord:i().onNavigateToEntityRecord,title:l?.title,canUserEdit:!!p}}),[u,e.area,o]),v=nS(_),k=(0,nt.useBlockProps)(),w=!i,C=!w&&!x&&g,j=l||v.tagName;return!h&&(i&&!s||i&&x)?(0,Je.jsx)(j,{...k,children:(0,Je.jsx)(nt.Warning,{children:(0,ot.sprintf)((0,ot.__)("Template part has been deleted or is unavailable: %s"),i)})}):C&&d?(0,Je.jsx)(j,{...k,children:(0,Je.jsx)(nt.Warning,{children:(0,ot.__)("Block cannot be rendered inside itself.")})}):(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsxs)(nt.RecursionProvider,{uniqueId:u,children:[C&&b&&f&&(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(tt.ToolbarButton,{onClick:()=>b({postId:u,postType:"wp_template_part"}),children:(0,ot.__)("Edit")})}),f&&(0,Je.jsx)(nt.InspectorControls,{group:"advanced",children:(0,Je.jsx)(dS,{tagName:l,setAttributes:t,isEntityAvailable:C,templatePartId:u,defaultWrapper:v.tagName,hasInnerBlocks:h})}),w&&(0,Je.jsx)(j,{...k,children:(0,Je.jsx)(rS,{area:e.area,templatePartId:u,clientId:o,setAttributes:t,onOpenSelectionModal:()=>m(!0)})}),(0,Je.jsx)(nt.BlockSettingsMenuControls,{children:({selectedClientIds:e})=>1!==e.length||o!==e[0]?null:(0,Je.jsx)(_S,{isEntityAvailable:C,area:_,clientId:o,templatePartId:u,isTemplatePartSelectionOpen:p,setIsTemplatePartSelectionOpen:m})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(bS,{area:_,clientId:o,isEntityAvailable:C,onSelect:e=>(async e=>{await a("postType","wp_template_part",u,{blocks:e.blocks,content:(0,Ke.serialize)(e.blocks)}),n((0,ot.sprintf)((0,ot.__)('Template Part "%s" updated.'),y||i),{type:"snackbar"})})(e)})}),C&&(0,Je.jsx)(xS,{tagName:j,blockProps:k,postId:u,hasInnerBlocks:h,layout:c}),!w&&!g&&(0,Je.jsx)(j,{...k,children:(0,Je.jsx)(tt.Spinner,{})})]}),p&&(0,Je.jsx)(tt.Modal,{overlayClassName:"block-editor-template-part__selection-modal",title:(0,ot.sprintf)((0,ot.__)("Choose a %s"),v.label.toLowerCase()),onRequestClose:()=>m(!1),isFullScreen:!0,children:(0,Je.jsx)(iS,{templatePartId:u,clientId:o,area:_,setAttributes:t,onClose:()=>m(!1)})})]})}},wS=()=>{(0,Ns.addFilter)("blocks.registerBlockType","core/template-part",yS);const e=["core/post-template","core/post-content"];return(0,Ns.addFilter)("blockEditor.__unstableCanInsertBlockType","core/block-library/removeTemplatePartsFromPostTemplates",((t,o,n,{getBlock:a,getBlockParentsByBlockName:r})=>{if("core/template-part"!==o.name)return t;for(const t of e){if(a(n)?.name===t||r(n,t).length)return!1}return!0})),et({name:vS,metadata:fS,settings:kS})},CS=(0,Je.jsx)(Ye.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Je.jsx)(Ye.Path,{d:"M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z"})});const jS={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/term-description",title:"Term Description",category:"theme",description:"Display the description of categories, tags and custom taxonomies when viewing an archive.",textdomain:"default",attributes:{textAlign:{type:"string"}},supports:{align:["wide","full"],html:!1,color:{link:!0,__experimentalDefaultControls:{background:!0,text:!0}},spacing:{padding:!0,margin:!0},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalFontWeight:!0,__experimentalFontStyle:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalLetterSpacing:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0},__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!0,color:!0,width:!0,style:!0}}}},{name:SS}=jS,BS={icon:CS,edit:function({attributes:e,setAttributes:t,mergedStyle:o}){const{textAlign:n}=e,a=(0,nt.useBlockProps)({className:ft({[`has-text-align-${n}`]:n}),style:o});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{group:"block",children:(0,Je.jsx)(nt.AlignmentControl,{value:n,onChange:e=>{t({textAlign:e})}})}),(0,Je.jsx)("div",{...a,children:(0,Je.jsx)("div",{className:"wp-block-term-description__placeholder",children:(0,Je.jsx)("span",{children:(0,ot.__)("Term Description")})})})]})},example:{}},TS=()=>et({name:SS,metadata:jS,settings:BS});const NS={to:[{type:"block",blocks:["core/columns"],transform:({className:e,columns:t,content:o,width:n})=>(0,Ke.createBlock)("core/columns",{align:"wide"===n||"full"===n?n:void 0,className:e,columns:t},o.map((({children:e})=>(0,Ke.createBlock)("core/column",{},[(0,Ke.createBlock)("core/paragraph",{content:e})]))))}]},PS=NS,IS={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/text-columns",title:"Text Columns (deprecated)",icon:"columns",category:"design",description:"This block is deprecated. Please use the Columns block instead.",textdomain:"default",attributes:{content:{type:"array",source:"query",selector:"p",query:{children:{type:"string",source:"html"}},default:[{},{}]},columns:{type:"number",default:2},width:{type:"string"}},supports:{inserter:!1,interactivity:{clientNavigation:!0}},editorStyle:"wp-block-text-columns-editor",style:"wp-block-text-columns"},{name:MS}=IS,DS={transforms:PS,getEditWrapperProps(e){const{width:t}=e;if("wide"===t||"full"===t)return{"data-align":t}},edit:function({attributes:e,setAttributes:t}){const{width:o,content:n,columns:a}=e;return Kp()("The Text Columns block",{since:"5.3",alternative:"the Columns block"}),(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(nt.BlockAlignmentToolbar,{value:o,onChange:e=>t({width:e}),controls:["center","wide","full"]})}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsx)(tt.PanelBody,{children:(0,Je.jsx)(tt.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,ot.__)("Columns"),value:a,onChange:e=>t({columns:e}),min:2,max:4,required:!0})})}),(0,Je.jsx)("div",{...(0,nt.useBlockProps)({className:`align${o} columns-${a}`}),children:Array.from({length:a}).map(((e,o)=>(0,Je.jsx)("div",{className:"wp-block-column",children:(0,Je.jsx)(nt.RichText,{tagName:"p",value:n?.[o]?.children,onChange:e=>{t({content:[...n.slice(0,o),{children:e},...n.slice(o+1)]})},"aria-label":(0,ot.sprintf)((0,ot.__)("Column %d text"),o+1),placeholder:(0,ot.__)("New Column")})},`column-${o}`)))})]})},save:function({attributes:e}){const{width:t,content:o,columns:n}=e;return(0,Je.jsx)("div",{...nt.useBlockProps.save({className:`align${t} columns-${n}`}),children:Array.from({length:n}).map(((e,t)=>(0,Je.jsx)("div",{className:"wp-block-column",children:(0,Je.jsx)(nt.RichText.Content,{tagName:"p",value:o?.[t]?.children})},`column-${t}`)))})}},zS=()=>et({name:MS,metadata:IS,settings:DS}),AS={attributes:{content:{type:"string",source:"html",selector:"pre",default:""},textAlign:{type:"string"}},save({attributes:e}){const{textAlign:t,content:o}=e;return(0,Je.jsx)(nt.RichText.Content,{tagName:"pre",style:{textAlign:t},value:o})}},RS={attributes:{content:{type:"string",source:"html",selector:"pre",default:"",__unstablePreserveWhiteSpace:!0,role:"content"},textAlign:{type:"string"}},supports:{anchor:!0,color:{gradients:!0,link:!0},typography:{fontSize:!0,__experimentalFontFamily:!0},spacing:{padding:!0}},save({attributes:e}){const{textAlign:t,content:o}=e,n=ft({[`has-text-align-${t}`]:t});return(0,Je.jsx)("pre",{...nt.useBlockProps.save({className:n}),children:(0,Je.jsx)(nt.RichText.Content,{value:o})})},migrate:lo,isEligible:({style:e})=>e?.typography?.fontFamily},HS=[RS,AS];const LS={from:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,Ke.createBlock)("core/verse",e)}],to:[{type:"block",blocks:["core/paragraph"],transform:e=>(0,Ke.createBlock)("core/paragraph",e)}]},VS=LS,FS={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/verse",title:"Verse",category:"text",description:"Insert poetry. Use special spacing formats. Or quote song lyrics.",keywords:["poetry","poem"],textdomain:"default",attributes:{content:{type:"rich-text",source:"rich-text",selector:"pre",__unstablePreserveWhiteSpace:!0,role:"content"},textAlign:{type:"string"}},supports:{anchor:!0,background:{backgroundImage:!0,backgroundSize:!0,__experimentalDefaultControls:{backgroundImage:!0}},color:{gradients:!0,link:!0,__experimentalDefaultControls:{background:!0,text:!0}},dimensions:{minHeight:!0,__experimentalDefaultControls:{minHeight:!1}},typography:{fontSize:!0,__experimentalFontFamily:!0,lineHeight:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalTextDecoration:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},__experimentalBorder:{radius:!0,width:!0,color:!0,style:!0},interactivity:{clientNavigation:!0}},style:"wp-block-verse",editorStyle:"wp-block-verse-editor"},{name:ES}=FS,OS={icon:Tk,example:{attributes:{content:(0,ot.__)("WHAT was he doing, the great god Pan,\n\tDown in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.")}},transforms:VS,deprecated:HS,merge:(e,t)=>({content:e.content+"\n\n"+t.content}),edit:function({attributes:e,setAttributes:t,mergeBlocks:o,onRemove:n,insertBlocksAfter:a,style:r}){const{textAlign:i,content:s}=e,l=(0,nt.useBlockProps)({className:ft({[`has-text-align-${i}`]:i}),style:r});return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(nt.AlignmentToolbar,{value:i,onChange:e=>{t({textAlign:e})}})}),(0,Je.jsx)(nt.RichText,{tagName:"pre",identifier:"content",preserveWhiteSpace:!0,value:s,onChange:e=>{t({content:e})},"aria-label":(0,ot.__)("Verse text"),placeholder:(0,ot.__)("Write verse…"),onRemove:n,onMerge:o,textAlign:i,...l,__unstablePastePlainText:!0,__unstableOnSplitAtDoubleLineEnd:()=>a((0,Ke.createBlock)((0,Ke.getDefaultBlockName)()))})]})},save:function({attributes:e}){const{textAlign:t,content:o}=e,n=ft({[`has-text-align-${t}`]:t});return(0,Je.jsx)("pre",{...nt.useBlockProps.save({className:n}),children:(0,Je.jsx)(nt.RichText.Content,{value:o})})}},$S=()=>et({name:ES,metadata:FS,settings:OS}),GS=(0,Je.jsx)(Ye.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Je.jsx)(Ye.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})});function US({tracks:e=[]}){return e.map((e=>(0,Je.jsx)("track",{...e},e.src)))}const{attributes:qS}={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/video",title:"Video",category:"media",description:"Embed a video from your media library or upload a new one.",keywords:["movie"],textdomain:"default",attributes:{autoplay:{type:"boolean",source:"attribute",selector:"video",attribute:"autoplay"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},controls:{type:"boolean",source:"attribute",selector:"video",attribute:"controls",default:!0},id:{type:"number",role:"content"},loop:{type:"boolean",source:"attribute",selector:"video",attribute:"loop"},muted:{type:"boolean",source:"attribute",selector:"video",attribute:"muted"},poster:{type:"string",source:"attribute",selector:"video",attribute:"poster"},preload:{type:"string",source:"attribute",selector:"video",attribute:"preload",default:"metadata"},blob:{type:"string",role:"local"},src:{type:"string",source:"attribute",selector:"video",attribute:"src",role:"content"},playsInline:{type:"boolean",source:"attribute",selector:"video",attribute:"playsinline"},tracks:{role:"content",type:"array",items:{type:"object"},default:[]}},supports:{anchor:!0,align:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-video-editor",style:"wp-block-video"},WS={attributes:qS,save({attributes:e}){const{autoplay:t,caption:o,controls:n,loop:a,muted:r,poster:i,preload:s,src:l,playsInline:c,tracks:u}=e;return(0,Je.jsxs)("figure",{...nt.useBlockProps.save(),children:[l&&(0,Je.jsx)("video",{autoPlay:t,controls:n,loop:a,muted:r,poster:i,preload:"metadata"!==s?s:void 0,src:l,playsInline:c,children:(0,Je.jsx)(US,{tracks:u})}),!nt.RichText.isEmpty(o)&&(0,Je.jsx)(nt.RichText.Content,{tagName:"figcaption",value:o})]})}},ZS=[WS];const QS=function({poster:e,setAttributes:t,instanceId:o}){const n=(0,st.useRef)(),a=`video-block__poster-image-description-${o}`;return(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Poster image"),isShownByDefault:!0,hasValue:()=>!!e,onDeselect:()=>{t({poster:""})},children:(0,Je.jsx)(nt.MediaUploadCheck,{children:(0,Je.jsxs)("div",{className:"editor-video-poster-control",children:[(0,Je.jsx)(tt.BaseControl.VisualLabel,{children:(0,ot.__)("Poster image")}),(0,Je.jsx)(nt.MediaUpload,{title:(0,ot.__)("Select poster image"),onSelect:function(e){t({poster:e.url})},allowedTypes:["image"],render:({open:t})=>(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,ref:n,"aria-describedby":a,children:e?(0,ot.__)("Replace"):(0,ot.__)("Select")})}),(0,Je.jsx)("p",{id:a,hidden:!0,children:e?(0,ot.sprintf)((0,ot.__)("The current poster image url is %s"),e):(0,ot.__)("There is no poster image currently selected")}),!!e&&(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,onClick:function(){t({poster:void 0}),n.current.focus()},variant:"tertiary",children:(0,ot.__)("Remove")})]})})})},KS=[{value:"auto",label:(0,ot.__)("Auto")},{value:"metadata",label:(0,ot.__)("Metadata")},{value:"none",label:(0,ot._x)("None","Preload value")}],YS=({setAttributes:e,attributes:t})=>{const{autoplay:o,controls:n,loop:a,muted:r,playsInline:i,preload:s}=t,l=(0,ot.__)("Autoplay may cause usability issues for some users."),c=st.Platform.select({web:(0,st.useCallback)((e=>e?l:null),[]),native:l}),u=(0,st.useMemo)((()=>{const t=t=>o=>{e({[t]:o,..."autoplay"===t&&{muted:o}})};return{autoplay:t("autoplay"),loop:t("loop"),muted:t("muted"),controls:t("controls"),playsInline:t("playsInline")}}),[]),d=(0,st.useCallback)((t=>{e({preload:t})}),[]);return(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Autoplay"),isShownByDefault:!0,hasValue:()=>!!o,onDeselect:()=>{e({autoplay:!1,muted:!1})},children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Autoplay"),onChange:u.autoplay,checked:!!o,help:c})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Loop"),isShownByDefault:!0,hasValue:()=>!!a,onDeselect:()=>{e({loop:!1})},children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Loop"),onChange:u.loop,checked:!!a})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Muted"),isShownByDefault:!0,hasValue:()=>!!r,onDeselect:()=>{e({muted:!1})},children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Muted"),onChange:u.muted,checked:!!r,disabled:o,help:o?(0,ot.__)("Muted because of Autoplay."):null})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Playback controls"),isShownByDefault:!0,hasValue:()=>!n,onDeselect:()=>{e({controls:!0})},children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Playback controls"),onChange:u.controls,checked:!!n})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Play inline"),isShownByDefault:!0,hasValue:()=>!!i,onDeselect:()=>{e({playsInline:!1})},children:(0,Je.jsx)(tt.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,ot.__)("Play inline"),onChange:u.playsInline,checked:!!i,help:(0,ot.__)("When enabled, videos will play directly within the webpage on mobile browsers, instead of opening in a fullscreen player.")})}),(0,Je.jsx)(tt.__experimentalToolsPanelItem,{label:(0,ot.__)("Preload"),isShownByDefault:!0,hasValue:()=>"metadata"!==s,onDeselect:()=>{e({preload:"metadata"})},children:(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,ot.__)("Preload"),value:s,onChange:d,options:KS,hideCancelButton:!0})})]})},JS=["text/vtt"],XS="subtitles",eB=[{label:(0,ot.__)("Subtitles"),value:"subtitles"},{label:(0,ot.__)("Captions"),value:"captions"},{label:(0,ot.__)("Descriptions"),value:"descriptions"},{label:(0,ot.__)("Chapters"),value:"chapters"},{label:(0,ot.__)("Metadata"),value:"metadata"}];function tB({tracks:e,onEditPress:t}){const o=e.map(((e,o)=>(0,Je.jsxs)(tt.__experimentalHStack,{className:"block-library-video-tracks-editor__track-list-track",children:[(0,Je.jsx)("span",{children:e.label}),(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>t(o),"aria-label":(0,ot.sprintf)((0,ot._x)("Edit %s","text tracks"),e.label),children:(0,ot.__)("Edit")})]},o)));return(0,Je.jsx)(tt.MenuGroup,{label:(0,ot.__)("Text tracks"),className:"block-library-video-tracks-editor__track-list",children:o})}function oB({track:e,onChange:t,onClose:o,onRemove:n}){const{src:a="",label:r="",srcLang:i="",kind:s=XS}=e,l=a.startsWith("blob:")?"":(0,vt.getFilename)(a)||"";return(0,Je.jsxs)(tt.__experimentalVStack,{className:"block-library-video-tracks-editor__single-track-editor",spacing:"4",children:[(0,Je.jsx)("span",{className:"block-library-video-tracks-editor__single-track-editor-edit-track-label",children:(0,ot.__)("Edit track")}),(0,Je.jsxs)("span",{children:[(0,ot.__)("File"),": ",(0,Je.jsx)("b",{children:l})]}),(0,Je.jsxs)(tt.__experimentalGrid,{columns:2,gap:4,children:[(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:o=>t({...e,label:o}),label:(0,ot.__)("Label"),value:r,help:(0,ot.__)("Title of track")}),(0,Je.jsx)(tt.TextControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,onChange:o=>t({...e,srcLang:o}),label:(0,ot.__)("Source language"),value:i,help:(0,ot.__)("Language tag (en, fr, etc.)")})]}),(0,Je.jsxs)(tt.__experimentalVStack,{spacing:"8",children:[(0,Je.jsx)(tt.SelectControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,className:"block-library-video-tracks-editor__single-track-editor-kind-select",options:eB,value:s,label:(0,ot.__)("Kind"),onChange:o=>{t({...e,kind:o})}}),(0,Je.jsxs)(tt.__experimentalHStack,{className:"block-library-video-tracks-editor__single-track-editor-buttons-container",children:[(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,isDestructive:!0,variant:"link",onClick:n,children:(0,ot.__)("Remove track")}),(0,Je.jsx)(tt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:()=>{const n={};let a=!1;""===r&&(n.label=(0,ot.__)("English"),a=!0),""===i&&(n.srcLang="en",a=!0),void 0===e.kind&&(n.kind=XS,a=!0),a&&t({...e,...n}),o()},children:(0,ot.__)("Apply")})]})]})]})}function nB({tracks:e=[],onChange:t}){const o=(0,it.useSelect)((e=>e(nt.store).getSettings().mediaUpload),[]),[n,a]=(0,st.useState)(null),r=(0,st.useRef)();return(0,st.useEffect)((()=>{r.current?.focus()}),[n]),o?(0,Je.jsx)(tt.Dropdown,{contentClassName:"block-library-video-tracks-editor",focusOnMount:!0,popoverProps:{ref:r},renderToggle:({isOpen:e,onToggle:t})=>(0,Je.jsx)(tt.ToolbarGroup,{children:(0,Je.jsx)(tt.ToolbarButton,{"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e||a(null),t()},children:(0,ot.__)("Text tracks")})}),renderContent:()=>null!==n?(0,Je.jsx)(oB,{track:e[n],onChange:o=>{const a=[...e];a[n]=o,t(a)},onClose:()=>a(null),onRemove:()=>{t(e.filter(((e,t)=>t!==n))),a(null)}}):(0,Je.jsxs)(Je.Fragment,{children:[0===e.length&&(0,Je.jsxs)("div",{className:"block-library-video-tracks-editor__tracks-informative-message",children:[(0,Je.jsx)("h2",{className:"block-library-video-tracks-editor__tracks-informative-message-title",children:(0,ot.__)("Text tracks")}),(0,Je.jsx)("p",{className:"block-library-video-tracks-editor__tracks-informative-message-description",children:(0,ot.__)("Tracks can be subtitles, captions, chapters, or descriptions. They help make your content more accessible to a wider range of users.")})]}),(0,Je.jsxs)(tt.NavigableMenu,{children:[(0,Je.jsx)(tB,{tracks:e,onEditPress:a}),(0,Je.jsxs)(tt.MenuGroup,{className:"block-library-video-tracks-editor__add-tracks-container",label:(0,ot.__)("Add tracks"),children:[(0,Je.jsx)(nt.MediaUpload,{onSelect:({url:o})=>{const n=e.length;t([...e,{src:o}]),a(n)},allowedTypes:JS,render:({open:e})=>(0,Je.jsx)(tt.MenuItem,{icon:Xm,onClick:e,children:(0,ot.__)("Open Media Library")})}),(0,Je.jsx)(nt.MediaUploadCheck,{children:(0,Je.jsx)(tt.FormFileUpload,{onChange:n=>{const r=n.target.files,i=e.length;o({allowedTypes:JS,filesList:r,onFileChange:([{url:o}])=>{const n=[...e];n[i]||(n[i]={}),n[i]={...e[i],src:o},t(n),a(i)}})},accept:".vtt,text/vtt",render:({openFileDialog:e})=>(0,Je.jsx)(tt.MenuItem,{icon:Jd,onClick:()=>{e()},children:(0,ot._x)("Upload","verb")})})})]})]})]})}):null}const aB=["video"];const rB=function e({isSelected:t,attributes:o,className:n,setAttributes:a,insertBlocksAfter:r,onReplace:i}){const s=(0,ut.useInstanceId)(e),l=(0,st.useRef)(),{id:c,controls:u,poster:d,src:p,tracks:m}=o,[g,h]=(0,st.useState)(o.blob),x=mt();function _(e){if(!e||!e.url)return a({src:void 0,id:void 0,poster:void 0,caption:void 0,blob:void 0}),void h();(0,lt.isBlobURL)(e.url)?h(e.url):(a({blob:void 0,src:e.url,id:e.id,poster:e.image?.src!==e.icon?e.image?.src:void 0,caption:e.caption}),h())}function b(e){if(e!==p){const t=qt({attributes:{url:e}});if(void 0!==t&&i)return void i(t);a({blob:void 0,src:e,id:void 0,poster:void 0}),h()}}pt({url:g,allowedTypes:aB,onChange:_,onError:f}),(0,st.useEffect)((()=>{l.current&&l.current.load()}),[d]);const{createErrorNotice:y}=(0,it.useDispatch)(Rt.store);function f(e){y(e,{type:"snackbar"})}const v=e=>(0,Je.jsx)(tt.Placeholder,{className:"block-editor-media-placeholder",withIllustration:!t,icon:GS,label:(0,ot.__)("Video"),instructions:(0,ot.__)("Drag and drop a video, upload, or choose from your library."),children:e}),k=ft(n,{"is-transient":!!g}),w=(0,nt.useBlockProps)({className:k});return p||g?(0,Je.jsxs)(Je.Fragment,{children:[t&&(0,Je.jsxs)(Je.Fragment,{children:[(0,Je.jsx)(nt.BlockControls,{children:(0,Je.jsx)(nB,{tracks:m,onChange:e=>{a({tracks:e})}})}),(0,Je.jsx)(nt.BlockControls,{group:"other",children:(0,Je.jsx)(nt.MediaReplaceFlow,{mediaId:c,mediaURL:p,allowedTypes:aB,accept:"video/*",onSelect:_,onSelectURL:b,onError:f,onReset:()=>_(void 0)})})]}),(0,Je.jsx)(nt.InspectorControls,{children:(0,Je.jsxs)(tt.__experimentalToolsPanel,{label:(0,ot.__)("Settings"),resetAll:()=>{a({autoplay:!1,controls:!0,loop:!1,muted:!1,playsInline:!1,preload:"metadata",poster:""})},dropdownMenuProps:x,children:[(0,Je.jsx)(YS,{setAttributes:a,attributes:o}),(0,Je.jsx)(QS,{poster:d,setAttributes:a,instanceId:s})]})}),(0,Je.jsxs)("figure",{...w,children:[(0,Je.jsx)(tt.Disabled,{isDisabled:!t,children:(0,Je.jsx)("video",{controls:u,poster:d,src:p||g,ref:l,children:(0,Je.jsx)(US,{tracks:m})})}),!!g&&(0,Je.jsx)(tt.Spinner,{}),(0,Je.jsx)(Yt,{attributes:o,setAttributes:a,isSelected:t,insertBlocksAfter:r,label:(0,ot.__)("Video caption text"),showToolbarButton:t})]})]}):(0,Je.jsx)("div",{...w,children:(0,Je.jsx)(nt.MediaPlaceholder,{icon:(0,Je.jsx)(nt.BlockIcon,{icon:GS}),onSelect:_,onSelectURL:b,accept:"video/*",allowedTypes:aB,value:o,onError:f,placeholder:v})})};const iB={from:[{type:"files",isMatch:e=>1===e.length&&0===e[0].type.indexOf("video/"),transform(e){const t=e[0];return(0,Ke.createBlock)("core/video",{blob:(0,lt.createBlobURL)(t)})}},{type:"shortcode",tag:"video",attributes:{src:{type:"string",shortcode:({named:{src:e,mp4:t,m4v:o,webm:n,ogv:a,flv:r}})=>e||t||o||n||a||r},poster:{type:"string",shortcode:({named:{poster:e}})=>e},loop:{type:"string",shortcode:({named:{loop:e}})=>e},autoplay:{type:"string",shortcode:({named:{autoplay:e}})=>e},preload:{type:"string",shortcode:({named:{preload:e}})=>e}}},{type:"raw",isMatch:e=>"P"===e.nodeName&&1===e.children.length&&"VIDEO"===e.firstChild.nodeName,transform:e=>{const t=e.firstChild,o={autoplay:!!t.hasAttribute("autoplay")||void 0,controls:!!t.hasAttribute("controls")&&void 0,loop:!!t.hasAttribute("loop")||void 0,muted:!!t.hasAttribute("muted")||void 0,preload:t.getAttribute("preload")||void 0,playsInline:!!t.hasAttribute("playsinline")||void 0,poster:t.getAttribute("poster")||void 0,src:t.getAttribute("src")||void 0};return(0,lt.isBlobURL)(o.src)&&(o.blob=o.src,delete o.src),(0,Ke.createBlock)("core/video",o)}}]},sB=iB,lB={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/video",title:"Video",category:"media",description:"Embed a video from your media library or upload a new one.",keywords:["movie"],textdomain:"default",attributes:{autoplay:{type:"boolean",source:"attribute",selector:"video",attribute:"autoplay"},caption:{type:"rich-text",source:"rich-text",selector:"figcaption",role:"content"},controls:{type:"boolean",source:"attribute",selector:"video",attribute:"controls",default:!0},id:{type:"number",role:"content"},loop:{type:"boolean",source:"attribute",selector:"video",attribute:"loop"},muted:{type:"boolean",source:"attribute",selector:"video",attribute:"muted"},poster:{type:"string",source:"attribute",selector:"video",attribute:"poster"},preload:{type:"string",source:"attribute",selector:"video",attribute:"preload",default:"metadata"},blob:{type:"string",role:"local"},src:{type:"string",source:"attribute",selector:"video",attribute:"src",role:"content"},playsInline:{type:"boolean",source:"attribute",selector:"video",attribute:"playsinline"},tracks:{role:"content",type:"array",items:{type:"object"},default:[]}},supports:{anchor:!0,align:!0,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},interactivity:{clientNavigation:!0}},editorStyle:"wp-block-video-editor",style:"wp-block-video"},{name:cB}=lB,uB={icon:GS,example:{attributes:{src:"https://upload.wikimedia.org/wikipedia/commons/c/ca/Wood_thrush_in_Central_Park_switch_sides_%2816510%29.webm",caption:(0,ot.__)("Wood thrush singing in Central Park, NYC.")}},transforms:sB,deprecated:ZS,edit:rB,save:function({attributes:e}){const{autoplay:t,caption:o,controls:n,loop:a,muted:r,poster:i,preload:s,src:l,playsInline:c,tracks:u}=e;return(0,Je.jsxs)("figure",{...nt.useBlockProps.save(),children:[l&&(0,Je.jsx)("video",{autoPlay:t,controls:n,loop:a,muted:r,poster:i,preload:"metadata"!==s?s:void 0,src:l,playsInline:c,children:(0,Je.jsx)(US,{tracks:u})}),!nt.RichText.isEmpty(o)&&(0,Je.jsx)(nt.RichText.Content,{className:(0,nt.__experimentalGetElementClassName)("caption"),tagName:"figcaption",value:o})]})}},dB=()=>et({name:cB,metadata:lB,settings:uB});const pB={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let mB;const gB=new Uint8Array(16);function hB(){if(!mB&&(mB="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!mB))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mB(gB)}const xB=[];for(let e=0;e<256;++e)xB.push((e+256).toString(16).slice(1));function _B(e,t=0){return xB[e[t+0]]+xB[e[t+1]]+xB[e[t+2]]+xB[e[t+3]]+"-"+xB[e[t+4]]+xB[e[t+5]]+"-"+xB[e[t+6]]+xB[e[t+7]]+"-"+xB[e[t+8]]+xB[e[t+9]]+"-"+xB[e[t+10]]+xB[e[t+11]]+xB[e[t+12]]+xB[e[t+13]]+xB[e[t+14]]+xB[e[t+15]]}const bB=function(e,t,o){if(pB.randomUUID&&!t&&!e)return pB.randomUUID();const n=(e=e||{}).random||(e.rng||hB)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){o=o||0;for(let e=0;e<16;++e)t[o+e]=n[e];return t}return _B(n)},{usesContextKey:yB}=Ot(nt.privateApis),fB="core/footnote",vB="core/post-content",kB={title:(0,ot.__)("Footnote"),tagName:"sup",className:"fn",attributes:{"data-fn":"data-fn"},interactive:!0,contentEditable:!1,[yB]:["postType","postId"],edit:function({value:e,onChange:t,isObjectActive:o,context:{postType:n,postId:a}}){const r=(0,it.useRegistry)(),{getSelectedBlockClientId:i,getBlocks:s,getBlockRootClientId:l,getBlockName:c,getBlockParentsByBlockName:u}=r.select(nt.store),d=(0,it.useSelect)((e=>{if(!e(Ke.store).getBlockType("core/footnotes"))return!1;const t=e(nt.store).getSettings().allowedBlockTypes;if(!1===t||Array.isArray(t)&&!t.includes("core/footnotes"))return!1;const o=e(ct.store).getEntityRecord("postType",n,a);if("string"!=typeof o?.meta?.footnotes)return!1;const{getBlockParentsByBlockName:r,getSelectedBlockClientId:i}=e(nt.store),s=r(i(),"core/block");return!s||0===s.length}),[n,a]),{selectionChange:p,insertBlock:m}=(0,it.useDispatch)(nt.store);if(!d)return null;return(0,Je.jsx)(nt.RichTextToolbarButton,{icon:Zp,title:(0,ot.__)("Footnote"),onClick:function(){r.batch((()=>{let n;if(o){const t=e.replacements[e.start];n=t?.attributes?.["data-fn"]}else{n=bB();const o=(0,Ho.insertObject)(e,{type:fB,attributes:{"data-fn":n},innerHTML:`<a href="#${n}" id="${n}-link">*</a>`},e.end,e.end);o.start=o.end-1,t(o)}const a=i(),r=u(a,vB);let d=null;{const e=[...r.length?s(r[0]):s()];for(;e.length;){const t=e.shift();if("core/footnotes"===t.name){d=t;break}e.push(...t.innerBlocks)}}if(!d){let e=l(a);for(;e&&c(e)!==vB;)e=l(e);d=(0,Ke.createBlock)("core/footnotes"),m(d,void 0,e)}p(d.clientId,n,0,0)}))},isActive:o})}},wB={$schema:"https://schemas.wp.org/trunk/block.json",apiVersion:3,name:"core/footnotes",title:"Footnotes",category:"text",description:"Display footnotes added to the page.",keywords:["references"],textdomain:"default",usesContext:["postId","postType"],supports:{__experimentalBorder:{radius:!0,color:!0,width:!0,style:!0,__experimentalDefaultControls:{radius:!1,color:!1,width:!1,style:!1}},color:{background:!0,link:!0,text:!0,__experimentalDefaultControls:{link:!0,text:!0}},html:!1,multiple:!1,reusable:!1,inserter:!1,spacing:{margin:!0,padding:!0,__experimentalDefaultControls:{margin:!1,padding:!1}},typography:{fontSize:!0,lineHeight:!0,__experimentalFontFamily:!0,__experimentalTextDecoration:!0,__experimentalFontStyle:!0,__experimentalFontWeight:!0,__experimentalLetterSpacing:!0,__experimentalTextTransform:!0,__experimentalWritingMode:!0,__experimentalDefaultControls:{fontSize:!0}},interactivity:{clientNavigation:!0}},style:"wp-block-footnotes"},{name:CB}=wB,jB={icon:Zp,edit:function({context:{postType:e,postId:t}}){const[o,n]=(0,ct.useEntityProp)("postType",e,"meta",t),a="string"==typeof o?.footnotes,r=o?.footnotes?JSON.parse(o.footnotes):[],i=(0,nt.useBlockProps)();return a?r.length?(0,Je.jsx)("ol",{...i,children:r.map((({id:e,content:t})=>(0,Je.jsxs)("li",{onMouseDown:e=>{e.target===e.currentTarget&&(e.target.firstElementChild.focus(),e.preventDefault())},children:[(0,Je.jsx)(nt.RichText,{id:e,tagName:"span",value:t,identifier:e,onFocus:e=>{e.target.textContent.trim()||e.target.scrollIntoView()},onChange:t=>{n({...o,footnotes:JSON.stringify(r.map((o=>o.id===e?{content:t,id:e}:o)))})}})," ",(0,Je.jsx)("a",{href:`#${e}-link`,children:"↩︎"})]},e)))}):(0,Je.jsx)("div",{...i,children:(0,Je.jsx)(tt.Placeholder,{icon:(0,Je.jsx)(nt.BlockIcon,{icon:Zp}),label:(0,ot.__)("Footnotes"),instructions:(0,ot.__)("Footnotes found in blocks within this document will be displayed here.")})}):(0,Je.jsx)("div",{...i,children:(0,Je.jsx)(tt.Placeholder,{icon:(0,Je.jsx)(nt.BlockIcon,{icon:Zp}),label:(0,ot.__)("Footnotes"),instructions:(0,ot.__)("Footnotes are not supported here. Add this block to post or page content.")})})}},SB=()=>{(0,Ho.registerFormatType)(fB,kB),et({name:CB,metadata:wB,settings:jB})};var BB=o(2321),TB=o.n(BB);const NB=window.wp.keyboardShortcuts;const PB=function(){const{registerShortcut:e}=(0,it.useDispatch)(NB.store),{replaceBlocks:t}=(0,it.useDispatch)(nt.store),{getBlockName:o,getSelectedBlockClientId:n,getBlockAttributes:a}=(0,it.useSelect)(nt.store),r=(e,r)=>{e.preventDefault();const i=n();if(null===i)return;const s=o(i),l="core/paragraph"===s,c="core/heading"===s;if(!l&&!c)return;const u=0===r?"core/paragraph":"core/heading",d=a(i);if(l&&0===r||c&&d.level===r)return;const p="core/paragraph"===s?"align":"textAlign",m="core/paragraph"===u?"align":"textAlign";t(i,(0,Ke.createBlock)(u,{level:r,content:d.content,[m]:d[p]}))};return(0,st.useEffect)((()=>{e({name:"core/block-editor/transform-heading-to-paragraph",category:"block-library",description:(0,ot.__)("Transform heading to paragraph."),keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}]}),[1,2,3,4,5,6].forEach((t=>{e({name:`core/block-editor/transform-paragraph-to-heading-${t}`,category:"block-library",description:(0,ot.__)("Transform paragraph to heading."),keyCombination:{modifier:"access",character:`${t}`}})}))}),[e]),(0,NB.useShortcut)("core/block-editor/transform-heading-to-paragraph",(e=>r(e,0))),(0,NB.useShortcut)("core/block-editor/transform-paragraph-to-heading-1",(e=>r(e,1))),(0,NB.useShortcut)("core/block-editor/transform-paragraph-to-heading-2",(e=>r(e,2))),(0,NB.useShortcut)("core/block-editor/transform-paragraph-to-heading-3",(e=>r(e,3))),(0,NB.useShortcut)("core/block-editor/transform-paragraph-to-heading-4",(e=>r(e,4))),(0,NB.useShortcut)("core/block-editor/transform-paragraph-to-heading-5",(e=>r(e,5))),(0,NB.useShortcut)("core/block-editor/transform-paragraph-to-heading-6",(e=>r(e,6))),null},IB={};Et(IB,{BlockKeyboardShortcuts:PB});const MB=()=>(()=>{const o=[te,V,R,z,O,$,Te,e,a,r,i,s,l,u,d,p,g,S,B,T,N,A,L,F,E,U,q,W,Y,X,ee,J,be,ye,Ne,Ie,Me,De,ze,Le,Ve,Fe,Ee,$e,qe,We,Ze,Qe,Z,Q,K,Ae,He,Re,fe,Ge,t,_e,de,pe,ce,oe,ne,re,ie,le,ue,he,me,ge,xe,ke,we,Ce,je,ve,Be,Pe,m,h,x,_,b,y,f,j,k,w,C,v,se,Oe,H,G,Ue,Se,ae];return window?.__experimentalEnableFormBlocks&&(o.push(P),o.push(I),o.push(M),o.push(D)),window?.wp?.oldEditor&&(window?.wp?.needsClassicBlock||!window?.__experimentalDisableTinymce||new URLSearchParams(window?.location?.search).get("requiresTinymce"))&&o.push(c),o.filter(Boolean)})().filter((({metadata:e})=>!TB()(e))),DB=(e=MB())=>{e.forEach((({init:e})=>e())),(0,Ke.setDefaultBlockName)(M_),window.wp&&window.wp.oldEditor&&e.some((({name:e})=>e===yn))&&(0,Ke.setFreeformContentHandlerName)(yn),(0,Ke.setUnregisteredTypeHandlerName)(fg),(0,Ke.setGroupingBlockName)(Xu)},zB=void 0})(),(window.wp=window.wp||{}).blockLibrary=n})(); style-engine.min.js 0000644 00000013642 15013651111 0010267 0 ustar 00 /*! This file is auto-generated */ (()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{compileCSS:()=>w,getCSSRules:()=>R,getCSSValueFromRawStyle:()=>f});var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function r(e){return e.toLowerCase()}var o=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],a=/[^A-Z0-9]+/gi;function i(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function g(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,g=void 0===n?o:n,c=t.stripRegexp,u=void 0===c?a:c,d=t.transform,l=void 0===d?r:d,s=t.delimiter,p=void 0===s?" ":s,m=i(i(e,g,"$1\0$2"),u,"\0"),f=0,y=m.length;"\0"===m.charAt(f);)f++;for(;"\0"===m.charAt(y-1);)y--;return m.slice(f,y).split("\0").map(l).join(p)}(e,n({delimiter:"."},t))}function c(e,t){return void 0===t&&(t={}),g(e,n({delimiter:"-"},t))}const u="var:",d="|",l="--",s=(e,t)=>{let n=e;return t.forEach((e=>{n=n?.[e]})),n};function p(e,t,n,r){const o=s(e,n);return o?[{selector:t?.selector,key:r,value:f(o)}]:[]}function m(e,t,n,r,o=["top","right","bottom","left"]){const a=s(e,n);if(!a)return[];const i=[];if("string"==typeof a)i.push({selector:t?.selector,key:r.default,value:a});else{const e=o.reduce(((e,n)=>{const o=f(s(a,[n]));return o&&e.push({selector:t?.selector,key:r?.individual.replace("%s",y(n)),value:o}),e}),[]);i.push(...e)}return i}function f(e){if("string"==typeof e&&e.startsWith(u)){return`var(--wp--${e.slice(u.length).split(d).map((e=>c(e,{splitRegexp:[/([a-z0-9])([A-Z])/g,/([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]}))).join(l)})`}return e}function y(e){const[t,...n]=e;return t.toUpperCase()+n.join("")}function b(e){try{return decodeURI(e)}catch(t){return e}}function h(e){return(t,n)=>p(t,n,e,function(e){const[t,...n]=e;return t.toLowerCase()+n.map(y).join("")}(e))}function k(e){return(t,n)=>["color","style","width"].flatMap((r=>h(["border",e,r])(t,n)))}const v={name:"radius",generate:(e,t)=>m(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},S=[...[{name:"color",generate:h(["border","color"])},{name:"style",generate:h(["border","style"])},{name:"width",generate:h(["border","width"])},v,{name:"borderTop",generate:k("top")},{name:"borderRight",generate:k("right")},{name:"borderBottom",generate:k("bottom")},{name:"borderLeft",generate:k("left")}],...[{name:"text",generate:(e,t)=>p(e,t,["color","text"],"color")},{name:"gradient",generate:(e,t)=>p(e,t,["color","gradient"],"background")},{name:"background",generate:(e,t)=>p(e,t,["color","background"],"backgroundColor")}],...[{name:"minHeight",generate:(e,t)=>p(e,t,["dimensions","minHeight"],"minHeight")},{name:"aspectRatio",generate:(e,t)=>p(e,t,["dimensions","aspectRatio"],"aspectRatio")}],...[{name:"color",generate:(e,t,n=["outline","color"],r="outlineColor")=>p(e,t,n,r)},{name:"style",generate:(e,t,n=["outline","style"],r="outlineStyle")=>p(e,t,n,r)},{name:"offset",generate:(e,t,n=["outline","offset"],r="outlineOffset")=>p(e,t,n,r)},{name:"width",generate:(e,t,n=["outline","width"],r="outlineWidth")=>p(e,t,n,r)}],...[{name:"margin",generate:(e,t)=>m(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},{name:"padding",generate:(e,t)=>m(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})}],...[{name:"fontFamily",generate:(e,t)=>p(e,t,["typography","fontFamily"],"fontFamily")},{name:"fontSize",generate:(e,t)=>p(e,t,["typography","fontSize"],"fontSize")},{name:"fontStyle",generate:(e,t)=>p(e,t,["typography","fontStyle"],"fontStyle")},{name:"fontWeight",generate:(e,t)=>p(e,t,["typography","fontWeight"],"fontWeight")},{name:"letterSpacing",generate:(e,t)=>p(e,t,["typography","letterSpacing"],"letterSpacing")},{name:"lineHeight",generate:(e,t)=>p(e,t,["typography","lineHeight"],"lineHeight")},{name:"textColumns",generate:(e,t)=>p(e,t,["typography","textColumns"],"columnCount")},{name:"textDecoration",generate:(e,t)=>p(e,t,["typography","textDecoration"],"textDecoration")},{name:"textTransform",generate:(e,t)=>p(e,t,["typography","textTransform"],"textTransform")},{name:"writingMode",generate:(e,t)=>p(e,t,["typography","writingMode"],"writingMode")}],...[{name:"shadow",generate:(e,t)=>p(e,t,["shadow"],"boxShadow")}],...[{name:"backgroundImage",generate:(e,t)=>{const n=e?.background?.backgroundImage;return"object"==typeof n&&n?.url?[{selector:t.selector,key:"backgroundImage",value:`url( '${encodeURI(b(n.url))}' )`}]:p(e,t,["background","backgroundImage"],"backgroundImage")}},{name:"backgroundPosition",generate:(e,t)=>p(e,t,["background","backgroundPosition"],"backgroundPosition")},{name:"backgroundRepeat",generate:(e,t)=>p(e,t,["background","backgroundRepeat"],"backgroundRepeat")},{name:"backgroundSize",generate:(e,t)=>p(e,t,["background","backgroundSize"],"backgroundSize")},{name:"backgroundAttachment",generate:(e,t)=>p(e,t,["background","backgroundAttachment"],"backgroundAttachment")}]];function w(e,t={}){const n=R(e,t);if(!t?.selector){const e=[];return n.forEach((t=>{e.push(`${c(t.key)}: ${t.value};`)})),e.join(" ")}const r=n.reduce(((e,t)=>{const{selector:n}=t;return n?(e[n]||(e[n]=[]),e[n].push(t),e):e}),{});return Object.keys(r).reduce(((e,t)=>(e.push(`${t} { ${r[t].map((e=>`${c(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function R(e,t={}){const n=[];return S.forEach((r=>{"function"==typeof r.generate&&n.push(...r.generate(e,t))})),n}(window.wp=window.wp||{}).styleEngine=t})(); escape-html.js 0000644 00000013563 15013651111 0007306 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { escapeAmpersand: () => (/* binding */ escapeAmpersand), escapeAttribute: () => (/* binding */ escapeAttribute), escapeEditableHTML: () => (/* binding */ escapeEditableHTML), escapeHTML: () => (/* binding */ escapeHTML), escapeLessThan: () => (/* binding */ escapeLessThan), escapeQuotationMark: () => (/* binding */ escapeQuotationMark), isValidAttributeName: () => (/* binding */ isValidAttributeName) }); ;// ./node_modules/@wordpress/escape-html/build-module/escape-greater.js /** * Returns a string with greater-than sign replaced. * * Note that if a resolution for Trac#45387 comes to fruition, it is no longer * necessary for `__unstableEscapeGreaterThan` to exist. * * See: https://core.trac.wordpress.org/ticket/45387 * * @param value Original string. * * @return Escaped string. */ function __unstableEscapeGreaterThan(value) { return value.replace(/>/g, '>'); } ;// ./node_modules/@wordpress/escape-html/build-module/index.js /** * Internal dependencies */ /** * Regular expression matching invalid attribute names. * * "Attribute names must consist of one or more characters other than controls, * U+0020 SPACE, U+0022 ("), U+0027 ('), U+003E (>), U+002F (/), U+003D (=), * and noncharacters." * * @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 */ const REGEXP_INVALID_ATTRIBUTE_NAME = /[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/; /** * Returns a string with ampersands escaped. Note that this is an imperfect * implementation, where only ampersands which do not appear as a pattern of * named, decimal, or hexadecimal character references are escaped. Invalid * named references (i.e. ambiguous ampersand) are still permitted. * * @see https://w3c.github.io/html/syntax.html#character-references * @see https://w3c.github.io/html/syntax.html#ambiguous-ampersand * @see https://w3c.github.io/html/syntax.html#named-character-references * * @param value Original string. * * @return Escaped string. */ function escapeAmpersand(value) { return value.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi, '&'); } /** * Returns a string with quotation marks replaced. * * @param value Original string. * * @return Escaped string. */ function escapeQuotationMark(value) { return value.replace(/"/g, '"'); } /** * Returns a string with less-than sign replaced. * * @param value Original string. * * @return Escaped string. */ function escapeLessThan(value) { return value.replace(/</g, '<'); } /** * Returns an escaped attribute value. * * @see https://w3c.github.io/html/syntax.html#elements-attributes * * "[...] the text cannot contain an ambiguous ampersand [...] must not contain * any literal U+0022 QUOTATION MARK characters (")" * * Note we also escape the greater than symbol, as this is used by wptexturize to * split HTML strings. This is a WordPress specific fix * * Note that if a resolution for Trac#45387 comes to fruition, it is no longer * necessary for `__unstableEscapeGreaterThan` to be used. * * See: https://core.trac.wordpress.org/ticket/45387 * * @param value Attribute value. * * @return Escaped attribute value. */ function escapeAttribute(value) { return __unstableEscapeGreaterThan(escapeQuotationMark(escapeAmpersand(value))); } /** * Returns an escaped HTML element value. * * @see https://w3c.github.io/html/syntax.html#writing-html-documents-elements * * "the text must not contain the character U+003C LESS-THAN SIGN (<) or an * ambiguous ampersand." * * @param value Element value. * * @return Escaped HTML element value. */ function escapeHTML(value) { return escapeLessThan(escapeAmpersand(value)); } /** * Returns an escaped Editable HTML element value. This is different from * `escapeHTML`, because for editable HTML, ALL ampersands must be escaped in * order to render the content correctly on the page. * * @param value Element value. * * @return Escaped HTML element value. */ function escapeEditableHTML(value) { return escapeLessThan(value.replace(/&/g, '&')); } /** * Returns true if the given attribute name is valid, or false otherwise. * * @param name Attribute name to test. * * @return Whether attribute is valid. */ function isValidAttributeName(name) { return !REGEXP_INVALID_ATTRIBUTE_NAME.test(name); } (window.wp = window.wp || {}).escapeHtml = __webpack_exports__; /******/ })() ; redux-routine.js 0000644 00000056266 15013651111 0007725 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ 3304: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.cps = exports.call = undefined; var _is = __webpack_require__(6921); var _is2 = _interopRequireDefault(_is); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var call = exports.call = function call(value, next, rungen, yieldNext, raiseNext) { if (!_is2.default.call(value)) return false; try { next(value.func.apply(value.context, value.args)); } catch (err) { raiseNext(err); } return true; }; var cps = exports.cps = function cps(value, next, rungen, yieldNext, raiseNext) { var _value$func; if (!_is2.default.cps(value)) return false; (_value$func = value.func).call.apply(_value$func, [null].concat(_toConsumableArray(value.args), [function (err, result) { if (err) raiseNext(err);else next(result); }])); return true; }; exports["default"] = [call, cps]; /***/ }), /***/ 3524: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createChannel = exports.subscribe = exports.cps = exports.apply = exports.call = exports.invoke = exports.delay = exports.race = exports.join = exports.fork = exports.error = exports.all = undefined; var _keys = __webpack_require__(4137); var _keys2 = _interopRequireDefault(_keys); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var all = exports.all = function all(value) { return { type: _keys2.default.all, value: value }; }; var error = exports.error = function error(err) { return { type: _keys2.default.error, error: err }; }; var fork = exports.fork = function fork(iterator) { for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } return { type: _keys2.default.fork, iterator: iterator, args: args }; }; var join = exports.join = function join(task) { return { type: _keys2.default.join, task: task }; }; var race = exports.race = function race(competitors) { return { type: _keys2.default.race, competitors: competitors }; }; var delay = exports.delay = function delay(timeout) { return new Promise(function (resolve) { setTimeout(function () { return resolve(true); }, timeout); }); }; var invoke = exports.invoke = function invoke(func) { for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } return { type: _keys2.default.call, func: func, context: null, args: args }; }; var call = exports.call = function call(func, context) { for (var _len3 = arguments.length, args = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { args[_key3 - 2] = arguments[_key3]; } return { type: _keys2.default.call, func: func, context: context, args: args }; }; var apply = exports.apply = function apply(func, context, args) { return { type: _keys2.default.call, func: func, context: context, args: args }; }; var cps = exports.cps = function cps(func) { for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { args[_key4 - 1] = arguments[_key4]; } return { type: _keys2.default.cps, func: func, args: args }; }; var subscribe = exports.subscribe = function subscribe(channel) { return { type: _keys2.default.subscribe, channel: channel }; }; var createChannel = exports.createChannel = function createChannel(callback) { var listeners = []; var subscribe = function subscribe(l) { listeners.push(l); return function () { return listeners.splice(listeners.indexOf(l), 1); }; }; var next = function next(val) { return listeners.forEach(function (l) { return l(val); }); }; callback(next); return { subscribe: subscribe }; }; /***/ }), /***/ 4137: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); var keys = { all: Symbol('all'), error: Symbol('error'), fork: Symbol('fork'), join: Symbol('join'), race: Symbol('race'), call: Symbol('call'), cps: Symbol('cps'), subscribe: Symbol('subscribe') }; exports["default"] = keys; /***/ }), /***/ 5136: /***/ ((__unused_webpack_module, exports) => { Object.defineProperty(exports, "__esModule", ({ value: true })); var createDispatcher = function createDispatcher() { var listeners = []; return { subscribe: function subscribe(listener) { listeners.push(listener); return function () { listeners = listeners.filter(function (l) { return l !== listener; }); }; }, dispatch: function dispatch(action) { listeners.slice().forEach(function (listener) { return listener(action); }); } }; }; exports["default"] = createDispatcher; /***/ }), /***/ 5357: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.iterator = exports.array = exports.object = exports.error = exports.any = undefined; var _is = __webpack_require__(6921); var _is2 = _interopRequireDefault(_is); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var any = exports.any = function any(value, next, rungen, yieldNext) { yieldNext(value); return true; }; var error = exports.error = function error(value, next, rungen, yieldNext, raiseNext) { if (!_is2.default.error(value)) return false; raiseNext(value.error); return true; }; var object = exports.object = function object(value, next, rungen, yieldNext, raiseNext) { if (!_is2.default.all(value) || !_is2.default.obj(value.value)) return false; var result = {}; var keys = Object.keys(value.value); var count = 0; var hasError = false; var gotResultSuccess = function gotResultSuccess(key, ret) { if (hasError) return; result[key] = ret; count++; if (count === keys.length) { yieldNext(result); } }; var gotResultError = function gotResultError(key, error) { if (hasError) return; hasError = true; raiseNext(error); }; keys.map(function (key) { rungen(value.value[key], function (ret) { return gotResultSuccess(key, ret); }, function (err) { return gotResultError(key, err); }); }); return true; }; var array = exports.array = function array(value, next, rungen, yieldNext, raiseNext) { if (!_is2.default.all(value) || !_is2.default.array(value.value)) return false; var result = []; var count = 0; var hasError = false; var gotResultSuccess = function gotResultSuccess(key, ret) { if (hasError) return; result[key] = ret; count++; if (count === value.value.length) { yieldNext(result); } }; var gotResultError = function gotResultError(key, error) { if (hasError) return; hasError = true; raiseNext(error); }; value.value.map(function (v, key) { rungen(v, function (ret) { return gotResultSuccess(key, ret); }, function (err) { return gotResultError(key, err); }); }); return true; }; var iterator = exports.iterator = function iterator(value, next, rungen, yieldNext, raiseNext) { if (!_is2.default.iterator(value)) return false; rungen(value, next, raiseNext); return true; }; exports["default"] = [error, iterator, array, object, any]; /***/ }), /***/ 6910: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.race = exports.join = exports.fork = exports.promise = undefined; var _is = __webpack_require__(6921); var _is2 = _interopRequireDefault(_is); var _helpers = __webpack_require__(3524); var _dispatcher = __webpack_require__(5136); var _dispatcher2 = _interopRequireDefault(_dispatcher); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var promise = exports.promise = function promise(value, next, rungen, yieldNext, raiseNext) { if (!_is2.default.promise(value)) return false; value.then(next, raiseNext); return true; }; var forkedTasks = new Map(); var fork = exports.fork = function fork(value, next, rungen) { if (!_is2.default.fork(value)) return false; var task = Symbol('fork'); var dispatcher = (0, _dispatcher2.default)(); forkedTasks.set(task, dispatcher); rungen(value.iterator.apply(null, value.args), function (result) { return dispatcher.dispatch(result); }, function (err) { return dispatcher.dispatch((0, _helpers.error)(err)); }); var unsubscribe = dispatcher.subscribe(function () { unsubscribe(); forkedTasks.delete(task); }); next(task); return true; }; var join = exports.join = function join(value, next, rungen, yieldNext, raiseNext) { if (!_is2.default.join(value)) return false; var dispatcher = forkedTasks.get(value.task); if (!dispatcher) { raiseNext('join error : task not found'); } else { (function () { var unsubscribe = dispatcher.subscribe(function (result) { unsubscribe(); next(result); }); })(); } return true; }; var race = exports.race = function race(value, next, rungen, yieldNext, raiseNext) { if (!_is2.default.race(value)) return false; var finished = false; var success = function success(result, k, v) { if (finished) return; finished = true; result[k] = v; next(result); }; var fail = function fail(err) { if (finished) return; raiseNext(err); }; if (_is2.default.array(value.competitors)) { (function () { var result = value.competitors.map(function () { return false; }); value.competitors.forEach(function (competitor, index) { rungen(competitor, function (output) { return success(result, index, output); }, fail); }); })(); } else { (function () { var result = Object.keys(value.competitors).reduce(function (p, c) { p[c] = false; return p; }, {}); Object.keys(value.competitors).forEach(function (index) { rungen(value.competitors[index], function (output) { return success(result, index, output); }, fail); }); })(); } return true; }; var subscribe = function subscribe(value, next) { if (!_is2.default.subscribe(value)) return false; if (!_is2.default.channel(value.channel)) { throw new Error('the first argument of "subscribe" must be a valid channel'); } var unsubscribe = value.channel.subscribe(function (ret) { unsubscribe && unsubscribe(); next(ret); }); return true; }; exports["default"] = [promise, fork, join, race, subscribe]; /***/ }), /***/ 6921: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; var _keys = __webpack_require__(4137); var _keys2 = _interopRequireDefault(_keys); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var is = { obj: function obj(value) { return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !!value; }, all: function all(value) { return is.obj(value) && value.type === _keys2.default.all; }, error: function error(value) { return is.obj(value) && value.type === _keys2.default.error; }, array: Array.isArray, func: function func(value) { return typeof value === 'function'; }, promise: function promise(value) { return value && is.func(value.then); }, iterator: function iterator(value) { return value && is.func(value.next) && is.func(value.throw); }, fork: function fork(value) { return is.obj(value) && value.type === _keys2.default.fork; }, join: function join(value) { return is.obj(value) && value.type === _keys2.default.join; }, race: function race(value) { return is.obj(value) && value.type === _keys2.default.race; }, call: function call(value) { return is.obj(value) && value.type === _keys2.default.call; }, cps: function cps(value) { return is.obj(value) && value.type === _keys2.default.cps; }, subscribe: function subscribe(value) { return is.obj(value) && value.type === _keys2.default.subscribe; }, channel: function channel(value) { return is.obj(value) && is.func(value.subscribe); } }; exports["default"] = is; /***/ }), /***/ 8975: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.wrapControls = exports.asyncControls = exports.create = undefined; var _helpers = __webpack_require__(3524); Object.keys(_helpers).forEach(function (key) { if (key === "default") return; Object.defineProperty(exports, key, { enumerable: true, get: function get() { return _helpers[key]; } }); }); var _create = __webpack_require__(9127); var _create2 = _interopRequireDefault(_create); var _async = __webpack_require__(6910); var _async2 = _interopRequireDefault(_async); var _wrap = __webpack_require__(3304); var _wrap2 = _interopRequireDefault(_wrap); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.create = _create2.default; exports.asyncControls = _async2.default; exports.wrapControls = _wrap2.default; /***/ }), /***/ 9127: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { Object.defineProperty(exports, "__esModule", ({ value: true })); var _builtin = __webpack_require__(5357); var _builtin2 = _interopRequireDefault(_builtin); var _is = __webpack_require__(6921); var _is2 = _interopRequireDefault(_is); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } var create = function create() { var userControls = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; var controls = [].concat(_toConsumableArray(userControls), _toConsumableArray(_builtin2.default)); var runtime = function runtime(input) { var success = arguments.length <= 1 || arguments[1] === undefined ? function () {} : arguments[1]; var error = arguments.length <= 2 || arguments[2] === undefined ? function () {} : arguments[2]; var iterate = function iterate(gen) { var yieldValue = function yieldValue(isError) { return function (ret) { try { var _ref = isError ? gen.throw(ret) : gen.next(ret); var value = _ref.value; var done = _ref.done; if (done) return success(value); next(value); } catch (e) { return error(e); } }; }; var next = function next(ret) { controls.some(function (control) { return control(ret, next, runtime, yieldValue(false), yieldValue(true)); }); }; yieldValue(false)(); }; var iterator = _is2.default.iterator(input) ? input : regeneratorRuntime.mark(function _callee() { return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: _context.next = 2; return input; case 2: return _context.abrupt('return', _context.sent); case 3: case 'end': return _context.stop(); } } }, _callee, this); })(); iterate(iterator, success, error); }; return runtime; }; exports["default"] = create; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ createMiddleware) }); ;// ./node_modules/@wordpress/redux-routine/build-module/is-generator.js /* eslint-disable jsdoc/valid-types */ /** * Returns true if the given object is a generator, or false otherwise. * * @see https://www.ecma-international.org/ecma-262/6.0/#sec-generator-objects * * @param {any} object Object to test. * * @return {object is Generator} Whether object is a generator. */ function isGenerator(object) { /* eslint-enable jsdoc/valid-types */ // Check that iterator (next) and iterable (Symbol.iterator) interfaces are satisfied. // These checks seem to be compatible with several generator helpers as well as the native implementation. return !!object && typeof object[Symbol.iterator] === 'function' && typeof object.next === 'function'; } // EXTERNAL MODULE: ./node_modules/rungen/dist/index.js var dist = __webpack_require__(8975); ;// ./node_modules/is-promise/index.mjs function isPromise(obj) { return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function'; } ;// ./node_modules/is-plain-object/dist/is-plain-object.mjs /*! * is-plain-object <https://github.com/jonschlinkert/is-plain-object> * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function isObject(o) { return Object.prototype.toString.call(o) === '[object Object]'; } function isPlainObject(o) { var ctor,prot; if (isObject(o) === false) return false; // If has modified constructor ctor = o.constructor; if (ctor === undefined) return true; // If has modified prototype prot = ctor.prototype; if (isObject(prot) === false) return false; // If constructor does not have an Object-specific method if (prot.hasOwnProperty('isPrototypeOf') === false) { return false; } // Most likely a plain Object return true; } ;// ./node_modules/@wordpress/redux-routine/build-module/is-action.js /** * External dependencies */ /* eslint-disable jsdoc/valid-types */ /** * Returns true if the given object quacks like an action. * * @param {any} object Object to test * * @return {object is import('redux').AnyAction} Whether object is an action. */ function isAction(object) { return isPlainObject(object) && typeof object.type === 'string'; } /** * Returns true if the given object quacks like an action and has a specific * action type * * @param {unknown} object Object to test * @param {string} expectedType The expected type for the action. * * @return {object is import('redux').AnyAction} Whether object is an action and is of specific type. */ function isActionOfType(object, expectedType) { /* eslint-enable jsdoc/valid-types */ return isAction(object) && object.type === expectedType; } ;// ./node_modules/@wordpress/redux-routine/build-module/runtime.js /** * External dependencies */ /** * Internal dependencies */ /** * Create a co-routine runtime. * * @param controls Object of control handlers. * @param dispatch Unhandled action dispatch. */ function createRuntime(controls = {}, dispatch) { const rungenControls = Object.entries(controls).map(([actionType, control]) => (value, next, iterate, yieldNext, yieldError) => { if (!isActionOfType(value, actionType)) { return false; } const routine = control(value); if (isPromise(routine)) { // Async control routine awaits resolution. routine.then(yieldNext, yieldError); } else { yieldNext(routine); } return true; }); const unhandledActionControl = (value, next) => { if (!isAction(value)) { return false; } dispatch(value); next(); return true; }; rungenControls.push(unhandledActionControl); const rungenRuntime = (0,dist.create)(rungenControls); return action => new Promise((resolve, reject) => rungenRuntime(action, result => { if (isAction(result)) { dispatch(result); } resolve(result); }, reject)); } ;// ./node_modules/@wordpress/redux-routine/build-module/index.js /** * Internal dependencies */ /** * Creates a Redux middleware, given an object of controls where each key is an * action type for which to act upon, the value a function which returns either * a promise which is to resolve when evaluation of the action should continue, * or a value. The value or resolved promise value is assigned on the return * value of the yield assignment. If the control handler returns undefined, the * execution is not continued. * * @param {Record<string, (value: import('redux').AnyAction) => Promise<boolean> | boolean>} controls Object of control handlers. * * @return {import('redux').Middleware} Co-routine runtime */ function createMiddleware(controls = {}) { return store => { const runtime = createRuntime(controls, store.dispatch); return next => action => { if (!isGenerator(action)) { return next(action); } return runtime(action); }; }; } (window.wp = window.wp || {}).reduxRoutine = __webpack_exports__["default"]; /******/ })() ; components.min.js 0000644 00002574235 15013651111 0010065 0 ustar 00 /*! This file is auto-generated */ (()=>{var e,t,n={66:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function r(e,t){return!1!==t.clone&&t.isMergeableObject(e)?l((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function o(e,t,n){return e.concat(t).map((function(e){return r(e,n)}))}function i(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function a(e,t,n){var o={};return n.isMergeableObject(e)&&i(e).forEach((function(t){o[t]=r(e[t],n)})),i(t).forEach((function(i){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(s(e,i)&&n.isMergeableObject(t[i])?o[i]=function(e,t){if(!t.customMerge)return l;var n=t.customMerge(e);return"function"==typeof n?n:l}(i,n)(e[i],t[i],n):o[i]=r(t[i],n))})),o}function l(e,n,i){(i=i||{}).arrayMerge=i.arrayMerge||o,i.isMergeableObject=i.isMergeableObject||t,i.cloneUnlessOtherwiseSpecified=r;var s=Array.isArray(n);return s===Array.isArray(e)?s?i.arrayMerge(e,n,i):a(e,n,i):r(n,i)}l.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return l(e,n,t)}),{})};var c=l;e.exports=c},83:(e,t,n)=>{"use strict"; /** * @license React * use-sync-external-store-shim.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var r=n(1609);var o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return a((function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,n,t]),s((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},422:(e,t,n)=>{"use strict";e.exports=n(83)},1178:(e,t,n)=>{"use strict";e.exports=n(2950)},1609:e=>{"use strict";e.exports=window.React},1880:(e,t,n)=>{"use strict";var r=n(1178),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return r.isMemo(e)?s:a[e.$$typeof]||o}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var s=u(n);d&&(s=s.concat(d(n)));for(var a=l(t),m=l(n),g=0;g<s.length;++g){var v=s[g];if(!(i[v]||r&&r[v]||m&&m[v]||a&&a[v])){var b=p(n,v);try{c(t,v,b)}catch(e){}}}}return t}},2950:(e,t)=>{"use strict"; /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,h=n?Symbol.for("react.suspense_list"):60120,m=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,b=n?Symbol.for("react.fundamental"):60117,x=n?Symbol.for("react.responder"):60118,y=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case i:case a:case s:case f:return e;default:switch(e=e&&e.$$typeof){case c:case p:case g:case m:case l:return e;default:return t}}case o:return t}}}function _(e){return w(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=p,t.Fragment=i,t.Lazy=g,t.Memo=m,t.Portal=o,t.Profiler=a,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return _(e)||w(e)===u},t.isConcurrentMode=_,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===p},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===m},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===d||e===a||e===s||e===f||e===h||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===m||e.$$typeof===l||e.$$typeof===c||e.$$typeof===p||e.$$typeof===b||e.$$typeof===x||e.$$typeof===y||e.$$typeof===v)},t.typeOf=w},7734:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],n.get(o[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var s=i[o];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},8924:(e,t)=>{var n={};n.parse=function(){var e=/^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i,t=/^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i,n=/^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i,r=/^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i,i=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,a=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,d=/^\(/,p=/^\)/,f=/^,/,h=/^\#([0-9a-fA-F]+)/,m=/^([a-zA-Z]+)/,g=/^rgb/i,v=/^rgba/i,b=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,x="";function y(e){var t=new Error(x+": "+e);throw t.source=x,t}function w(){var e=T(_);return x.length>0&&y("Invalid input not EOF"),e}function _(){return S("linear-gradient",e,k)||S("repeating-linear-gradient",t,k)||S("radial-gradient",n,j)||S("repeating-radial-gradient",r,j)}function S(e,t,n){return C(t,(function(t){var r=n();return r&&(z(f)||y("Missing comma before color stops")),{type:e,orientation:r,colorStops:T(I)}}))}function C(e,t){var n=z(e);if(n)return z(d)||y("Missing ("),result=t(n),z(p)||y("Missing )"),result}function k(){return D("directional",o,1)||D("angular",u,1)}function j(){var e,t,n=E();return n&&((e=[]).push(n),t=x,z(f)&&((n=E())?e.push(n):x=t)),e}function E(){var e=function(){var e=D("shape",/^(circle)/i,0);e&&(e.style=A()||P());return e}()||function(){var e=D("shape",/^(ellipse)/i,0);e&&(e.style=M()||P());return e}();if(e)e.at=function(){if(D("position",/^at/,0)){var e=N();return e||y("Missing positioning value"),e}}();else{var t=N();t&&(e={type:"default-radial",at:t})}return e}function P(){return D("extent-keyword",i,1)}function N(){var e={x:M(),y:M()};if(e.x||e.y)return{type:"position",value:e}}function T(e){var t=e(),n=[];if(t)for(n.push(t);z(f);)(t=e())?n.push(t):y("One extra comma");return n}function I(){var e=D("hex",h,1)||C(v,(function(){return{type:"rgba",value:T(R)}}))||C(g,(function(){return{type:"rgb",value:T(R)}}))||D("literal",m,0);return e||y("Expected color definition"),e.length=M(),e}function R(){return z(b)[1]}function M(){return D("%",l,1)||D("position-keyword",s,1)||A()}function A(){return D("px",a,1)||D("em",c,1)}function D(e,t,n){var r=z(t);if(r)return{type:e,value:r[n]}}function z(e){var t,n;return(n=/^[\n\r\t\s]+/.exec(x))&&O(n[0].length),(t=e.exec(x))&&O(t[0].length),t}function O(e){x=x.substr(e)}return function(e){return x=e.toString(),w()}}(),t.parse=(n||{}).parse},9664:e=>{e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}return n.m=e,n.c=t,n.p="",n(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);Object.defineProperty(t,"combineChunks",{enumerable:!0,get:function(){return r.combineChunks}}),Object.defineProperty(t,"fillInChunks",{enumerable:!0,get:function(){return r.fillInChunks}}),Object.defineProperty(t,"findAll",{enumerable:!0,get:function(){return r.findAll}}),Object.defineProperty(t,"findChunks",{enumerable:!0,get:function(){return r.findChunks}})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.findAll=function(e){var t=e.autoEscape,i=e.caseSensitive,s=void 0!==i&&i,a=e.findChunks,l=void 0===a?r:a,c=e.sanitize,u=e.searchWords,d=e.textToHighlight;return o({chunksToHighlight:n({chunks:l({autoEscape:t,caseSensitive:s,sanitize:c,searchWords:u,textToHighlight:d})}),totalLength:d?d.length:0})};var n=t.combineChunks=function(e){var t=e.chunks;return t=t.sort((function(e,t){return e.start-t.start})).reduce((function(e,t){if(0===e.length)return[t];var n=e.pop();if(t.start<=n.end){var r=Math.max(n.end,t.end);e.push({highlight:!1,start:n.start,end:r})}else e.push(n,t);return e}),[])},r=function(e){var t=e.autoEscape,n=e.caseSensitive,r=e.sanitize,o=void 0===r?i:r,s=e.searchWords,a=e.textToHighlight;return a=o(a),s.filter((function(e){return e})).reduce((function(e,r){r=o(r),t&&(r=r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"));for(var i=new RegExp(r,n?"g":"gi"),s=void 0;s=i.exec(a);){var l=s.index,c=i.lastIndex;c>l&&e.push({highlight:!1,start:l,end:c}),s.index===i.lastIndex&&i.lastIndex++}return e}),[])};t.findChunks=r;var o=t.fillInChunks=function(e){var t=e.chunksToHighlight,n=e.totalLength,r=[],o=function(e,t,n){t-e>0&&r.push({start:e,end:t,highlight:n})};if(0===t.length)o(0,n,!1);else{var i=0;t.forEach((function(e){o(i,e.start,!1),o(e.start,e.end,!0),i=e.end})),o(i,n,!1)}return r};function i(e){return e}}])},9681:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),r=new RegExp(n,"g"),o=new RegExp(n,"");function i(e){return t[e]}var s=function(e){return e.replace(r,i)};e.exports=s,e.exports.has=function(e){return!!e.match(o)},e.exports.remove=s}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var s={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>s[e]=()=>n[e]));return s.default=()=>n,o.d(i,s),i},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var i={};(()=>{"use strict";o.r(i),o.d(i,{AlignmentMatrixControl:()=>Yl,AnglePickerControl:()=>_y,Animate:()=>Ql,Autocomplete:()=>Aw,BaseControl:()=>Wx,BlockQuotation:()=>n.BlockQuotation,BorderBoxControl:()=>kj,BorderControl:()=>sj,BoxControl:()=>lE,Button:()=>Jx,ButtonGroup:()=>cE,Card:()=>WE,CardBody:()=>eP,CardDivider:()=>pP,CardFooter:()=>hP,CardHeader:()=>gP,CardMedia:()=>bP,CheckboxControl:()=>xP,Circle:()=>n.Circle,ClipboardButton:()=>wP,ColorIndicator:()=>F_,ColorPalette:()=>jk,ColorPicker:()=>nk,ComboboxControl:()=>lT,Composite:()=>Gn,CustomGradientPicker:()=>dN,CustomSelectControl:()=>DI,Dashicon:()=>Yx,DatePicker:()=>kM,DateTimePicker:()=>KM,Disabled:()=>nA,Draggable:()=>iA,DropZone:()=>aA,DropZoneProvider:()=>lA,Dropdown:()=>W_,DropdownMenu:()=>NN,DuotonePicker:()=>gA,DuotoneSwatch:()=>dA,ExternalLink:()=>vA,Fill:()=>vw,Flex:()=>kg,FlexBlock:()=>Eg,FlexItem:()=>Fg,FocalPointPicker:()=>VA,FocusReturnProvider:()=>FB,FocusableIframe:()=>$A,FontSizePicker:()=>nD,FormFileUpload:()=>rD,FormToggle:()=>sD,FormTokenField:()=>pD,G:()=>n.G,GradientPicker:()=>gN,Guide:()=>mD,GuidePage:()=>gD,HorizontalRule:()=>n.HorizontalRule,Icon:()=>Xx,IconButton:()=>vD,IsolatedEventContainer:()=>SB,KeyboardShortcuts:()=>xD,Line:()=>n.Line,MenuGroup:()=>yD,MenuItem:()=>_D,MenuItemsChoice:()=>CD,Modal:()=>kT,NavigableMenu:()=>kN,Navigator:()=>lO,Notice:()=>pO,NoticeList:()=>hO,Panel:()=>gO,PanelBody:()=>wO,PanelHeader:()=>mO,PanelRow:()=>_O,Path:()=>n.Path,Placeholder:()=>CO,Polygon:()=>n.Polygon,Popover:()=>jw,ProgressBar:()=>TO,QueryControls:()=>VO,RadioControl:()=>XO,RangeControl:()=>ZS,Rect:()=>n.Rect,ResizableBox:()=>zL,ResponsiveWrapper:()=>OL,SVG:()=>n.SVG,SandBox:()=>FL,ScrollLock:()=>Hy,SearchControl:()=>mz,SelectControl:()=>cS,Slot:()=>bw,SlotFillProvider:()=>xw,Snackbar:()=>VL,SnackbarList:()=>HL,Spinner:()=>oT,TabPanel:()=>iF,TabbableContainer:()=>kD,TextControl:()=>aF,TextHighlight:()=>hF,TextareaControl:()=>fF,TimePicker:()=>HM,Tip:()=>gF,ToggleControl:()=>bF,Toolbar:()=>OF,ToolbarButton:()=>PF,ToolbarDropdownMenu:()=>LF,ToolbarGroup:()=>IF,ToolbarItem:()=>jF,Tooltip:()=>ss,TreeSelect:()=>DO,VisuallyHidden:()=>Sl,__experimentalAlignmentMatrixControl:()=>Yl,__experimentalApplyValueToSides:()=>Dj,__experimentalBorderBoxControl:()=>kj,__experimentalBorderControl:()=>sj,__experimentalBoxControl:()=>lE,__experimentalConfirmDialog:()=>ET,__experimentalDimensionControl:()=>XM,__experimentalDivider:()=>uP,__experimentalDropdownContentWrapper:()=>xk,__experimentalElevation:()=>fE,__experimentalGrid:()=>cj,__experimentalHStack:()=>fy,__experimentalHasSplitBorders:()=>bj,__experimentalHeading:()=>mk,__experimentalInputControl:()=>qx,__experimentalInputControlPrefixWrapper:()=>lC,__experimentalInputControlSuffixWrapper:()=>U_,__experimentalIsDefinedBorder:()=>vj,__experimentalIsEmptyBorder:()=>gj,__experimentalItem:()=>LP,__experimentalItemGroup:()=>FP,__experimentalNavigation:()=>UD,__experimentalNavigationBackButton:()=>YD,__experimentalNavigationGroup:()=>QD,__experimentalNavigationItem:()=>az,__experimentalNavigationMenu:()=>xz,__experimentalNavigatorBackButton:()=>sO,__experimentalNavigatorButton:()=>iO,__experimentalNavigatorProvider:()=>rO,__experimentalNavigatorScreen:()=>oO,__experimentalNavigatorToParentButton:()=>aO,__experimentalNumberControl:()=>gy,__experimentalPaletteEdit:()=>WN,__experimentalParseQuantityAndUnitFromRawValue:()=>qk,__experimentalRadio:()=>WO,__experimentalRadioGroup:()=>GO,__experimentalScrollable:()=>QE,__experimentalSpacer:()=>zg,__experimentalStyleProvider:()=>lw,__experimentalSurface:()=>WL,__experimentalText:()=>$v,__experimentalToggleGroupControl:()=>x_,__experimentalToggleGroupControlOption:()=>FM,__experimentalToggleGroupControlOptionIcon:()=>z_,__experimentalToolbarContext:()=>kF,__experimentalToolsPanel:()=>aB,__experimentalToolsPanelContext:()=>YF,__experimentalToolsPanelItem:()=>uB,__experimentalTreeGrid:()=>gB,__experimentalTreeGridCell:()=>wB,__experimentalTreeGridItem:()=>yB,__experimentalTreeGridRow:()=>vB,__experimentalTruncate:()=>fk,__experimentalUnitControl:()=>tj,__experimentalUseCustomUnits:()=>Yk,__experimentalUseNavigator:()=>Jz,__experimentalUseSlot:()=>Gy,__experimentalUseSlotFills:()=>CB,__experimentalVStack:()=>pk,__experimentalView:()=>_l,__experimentalZStack:()=>NB,__unstableAnimatePresence:()=>hg,__unstableComposite:()=>fT,__unstableCompositeGroup:()=>hT,__unstableCompositeItem:()=>mT,__unstableDisclosureContent:()=>rA,__unstableGetAnimateClassName:()=>Zl,__unstableMotion:()=>ag,__unstableUseAutocompleteProps:()=>Mw,__unstableUseCompositeState:()=>gT,__unstableUseNavigateRegions:()=>IB,createSlotFill:()=>yw,navigateRegions:()=>RB,privateApis:()=>X$,useBaseControlProps:()=>Dw,useNavigator:()=>Jz,withConstrainedTabbing:()=>MB,withFallbackStyles:()=>AB,withFilters:()=>OB,withFocusOutside:()=>QN,withFocusReturn:()=>LB,withNotices:()=>BB,withSpokenMessages:()=>cz});var e={};o.r(e),o.d(e,{Text:()=>Ev,block:()=>Pv,destructive:()=>Tv,highlighterText:()=>Rv,muted:()=>Iv,positive:()=>Nv,upperCase:()=>Mv});var t={};o.r(t),o.d(t,{Rp:()=>P_,y0:()=>S_,uG:()=>k_,eh:()=>C_});const n=window.wp.primitives;function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=r(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}const s=function(){for(var e,t,n=0,o="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=r(e))&&(o&&(o+=" "),o+=t);return o},a=window.wp.i18n,l=window.wp.compose,c=window.wp.element;var u=Object.defineProperty,d=Object.defineProperties,p=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,g=(e,t,n)=>t in e?u(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t)=>{for(var n in t||(t={}))h.call(t,n)&&g(e,n,t[n]);if(f)for(var n of f(t))m.call(t,n)&&g(e,n,t[n]);return e},b=(e,t)=>d(e,p(t)),x=(e,t)=>{var n={};for(var r in e)h.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&f)for(var r of f(e))t.indexOf(r)<0&&m.call(e,r)&&(n[r]=e[r]);return n},y=Object.defineProperty,w=Object.defineProperties,_=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable,j=(e,t,n)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t)=>{for(var n in t||(t={}))C.call(t,n)&&j(e,n,t[n]);if(S)for(var n of S(t))k.call(t,n)&&j(e,n,t[n]);return e},P=(e,t)=>w(e,_(t)),N=(e,t)=>{var n={};for(var r in e)C.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&S)for(var r of S(e))t.indexOf(r)<0&&k.call(e,r)&&(n[r]=e[r]);return n};function T(...e){}function I(e,t){if(function(e){return"function"==typeof e}(e)){return e(function(e){return"function"==typeof e}(t)?t():t)}return e}function R(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function M(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function A(e){return e}function D(e,t){if(!e){if("string"!=typeof t)throw new Error("Invariant failed");throw new Error(t)}}function z(e,...t){const n="function"==typeof e?e(...t):e;return null!=n&&!n}function O(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function L(e){const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}function F(...e){for(const t of e)if(void 0!==t)return t}var B=o(1609),V=o.t(B,2),$=o.n(B);function H(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function W(e){if(!function(e){return!!e&&!!(0,B.isValidElement)(e)&&("ref"in e.props||"ref"in e)}(e))return null;return v({},e.props).ref||e.ref}var U,G="undefined"!=typeof window&&!!(null==(U=window.document)?void 0:U.createElement);function K(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function q(e){return e?"self"in e?e.self:K(e).defaultView||window:self}function Y(e,t=!1){const{activeElement:n}=K(e);if(!(null==n?void 0:n.nodeName))return null;if(Z(n)&&n.contentDocument)return Y(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=K(n).getElementById(e);if(t)return t}}return n}function X(e,t){return e===t||e.contains(t)}function Z(e){return"IFRAME"===e.tagName}function Q(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==J.indexOf(e.type)}var J=["button","color","file","image","reset","submit"];function ee(e){if("function"==typeof e.checkVisibility)return e.checkVisibility();const t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}function te(e){try{const t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName;return t||n||!1}catch(e){return!1}}function ne(e){return e.isContentEditable||te(e)}function re(e,t){const n=null==e?void 0:e.getAttribute("role");return n&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(n)?n:t}function oe(e,t){var n;const r=re(e);if(!r)return t;return null!=(n={menu:"menuitem",listbox:"option",tree:"treeitem"}[r])?n:t}function ie(e){if(!e)return null;const t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){const{overflowY:n}=getComputedStyle(e);if(t(n))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){const{overflowX:n}=getComputedStyle(e);if(t(n))return e}return ie(e.parentElement)||document.scrollingElement||document.body}function se(e,t){const n=e.map(((e,t)=>[t,e]));let r=!1;return n.sort((([e,n],[o,i])=>{const s=t(n),a=t(i);return s===a?0:s&&a?function(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}(s,a)?(e>o&&(r=!0),-1):(e<o&&(r=!0),1):0})),r?n.map((([e,t])=>t)):e}function ae(){return!!G&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function le(){return G&&ae()&&/apple/i.test(navigator.vendor)}function ce(){return G&&navigator.platform.startsWith("Mac")&&!(G&&navigator.maxTouchPoints)}function ue(e){return Boolean(e.currentTarget&&!X(e.currentTarget,e.target))}function de(e){return e.target===e.currentTarget}function pe(e){const t=e.currentTarget;if(!t)return!1;const n=ae();if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const r=t.tagName.toLowerCase();return"a"===r||("button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}function fe(e){const t=e.currentTarget;if(!t)return!1;const n=t.tagName.toLowerCase();return!!e.altKey&&("a"===n||("button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type))}function he(e,t){const n=new FocusEvent("blur",t),r=e.dispatchEvent(n),o=P(E({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusout",o)),r}function me(e,t){const n=new MouseEvent("click",t);return e.dispatchEvent(n)}function ge(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!X(n,r)}function ve(e,t,n,r){const o=(e=>{if(r){const t=setTimeout(e,r);return()=>clearTimeout(t)}const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})((()=>{e.removeEventListener(t,i,!0),n()})),i=()=>{o(),n()};return e.addEventListener(t,i,{once:!0,capture:!0}),o}function be(e,t,n,r=window){const o=[];try{r.document.addEventListener(e,t,n);for(const i of Array.from(r.frames))o.push(be(e,t,n,i))}catch(e){}return()=>{try{r.document.removeEventListener(e,t,n)}catch(e){}for(const e of o)e()}}var xe=v({},V),ye=xe.useId,we=(xe.useDeferredValue,xe.useInsertionEffect),_e=G?B.useLayoutEffect:B.useEffect;function Se(e){const[t]=(0,B.useState)(e);return t}function Ce(e){const t=(0,B.useRef)(e);return _e((()=>{t.current=e})),t}function ke(e){const t=(0,B.useRef)((()=>{throw new Error("Cannot call an event handler while rendering.")}));return we?we((()=>{t.current=e})):t.current=e,(0,B.useCallback)(((...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)}),[])}function je(e){const[t,n]=(0,B.useState)(null);return _e((()=>{if(null==t)return;if(!e)return;let n=null;return e((e=>(n=e,t))),()=>{e(n)}}),[t,e]),[t,n]}function Ee(...e){return(0,B.useMemo)((()=>{if(e.some(Boolean))return t=>{for(const n of e)H(n,t)}}),e)}function Pe(e){if(ye){const t=ye();return e||t}const[t,n]=(0,B.useState)(e);return _e((()=>{if(e||t)return;const r=Math.random().toString(36).slice(2,8);n(`id-${r}`)}),[e,t]),e||t}function Ne(e,t){const n=e=>{if("string"==typeof e)return e},[r,o]=(0,B.useState)((()=>n(t)));return _e((()=>{const r=e&&"current"in e?e.current:e;o((null==r?void 0:r.tagName.toLowerCase())||n(t))}),[e,t]),r}function Te(e,t){const n=(0,B.useRef)(!1);(0,B.useEffect)((()=>{if(n.current)return e();n.current=!0}),t),(0,B.useEffect)((()=>()=>{n.current=!1}),[])}function Ie(){return(0,B.useReducer)((()=>[]),[])}function Re(e){return ke("function"==typeof e?e:()=>e)}function Me(e,t,n=[]){const r=(0,B.useCallback)((n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n))),[...n,e.wrapElement]);return b(v({},e),{wrapElement:r})}function Ae(e=!1,t){const[n,r]=(0,B.useState)(null);return{portalRef:Ee(r,t),portalNode:n,domReady:!e||n}}function De(e,t,n){const r=e.onLoadedMetadataCapture,o=(0,B.useMemo)((()=>Object.assign((()=>{}),b(v({},r),{[t]:n}))),[r,t,n]);return[null==r?void 0:r[t],{onLoadedMetadataCapture:o}]}function ze(){(0,B.useEffect)((()=>{be("mousemove",Be,!0),be("mousedown",Ve,!0),be("mouseup",Ve,!0),be("keydown",Ve,!0),be("scroll",Ve,!0)}),[]);return ke((()=>Oe))}var Oe=!1,Le=0,Fe=0;function Be(e){(function(e){const t=e.movementX||e.screenX-Le,n=e.movementY||e.screenY-Fe;return Le=e.screenX,Fe=e.screenY,t||n||!1})(e)&&(Oe=!0)}function Ve(){Oe=!1}function $e(e,t){const n=e.__unstableInternals;return D(n,"Invalid store"),n[t]}function He(e,...t){let n=e,r=n,o=Symbol(),i=T;const s=new Set,a=new Set,l=new Set,c=new Set,u=new Set,d=new WeakMap,p=new WeakMap,f=(e,t,n=c)=>(n.add(t),p.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),p.delete(t),n.delete(t)}),h=(e,i,s=!1)=>{var l;if(!R(n,e))return;const f=I(i,n[e]);if(f===n[e])return;if(!s)for(const n of t)null==(l=null==n?void 0:n.setState)||l.call(n,e,f);const h=n;n=P(E({},n),{[e]:f});const m=Symbol();o=m,a.add(e);const g=(t,r,o)=>{var i;const s=p.get(t);s&&!s.some((t=>o?o.has(t):t===e))||(null==(i=d.get(t))||i(),d.set(t,t(n,r)))};for(const e of c)g(e,h);queueMicrotask((()=>{if(o!==m)return;const e=n;for(const e of u)g(e,r,a);r=e,a.clear()}))},m={getState:()=>n,setState:h,__unstableInternals:{setup:e=>(l.add(e),()=>l.delete(e)),init:()=>{const e=s.size,r=Symbol();s.add(r);const o=()=>{s.delete(r),s.size||i()};if(e)return o;const a=(c=n,Object.keys(c)).map((e=>M(...t.map((t=>{var n;const r=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);if(r&&R(r,e))return Ke(t,[e],(t=>{h(e,t[e],!0)}))})))));var c;const u=[];for(const e of l)u.push(e());const d=t.map(Ue);return i=M(...a,...u,...d),o},subscribe:(e,t)=>f(e,t),sync:(e,t)=>(d.set(t,t(n,n)),f(e,t)),batch:(e,t)=>(d.set(t,t(n,r)),f(e,t,u)),pick:e=>He(function(e,t){const n={};for(const r of t)R(e,r)&&(n[r]=e[r]);return n}(n,e),m),omit:e=>He(function(e,t){const n=E({},e);for(const e of t)R(n,e)&&delete n[e];return n}(n,e),m)}};return m}function We(e,...t){if(e)return $e(e,"setup")(...t)}function Ue(e,...t){if(e)return $e(e,"init")(...t)}function Ge(e,...t){if(e)return $e(e,"subscribe")(...t)}function Ke(e,...t){if(e)return $e(e,"sync")(...t)}function qe(e,...t){if(e)return $e(e,"batch")(...t)}function Ye(e,...t){if(e)return $e(e,"omit")(...t)}function Xe(...e){const t=e.reduce(((e,t)=>{var n;const r=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);return r?Object.assign(e,r):e}),{}),n=He(t,...e);return Object.assign({},...e,n)}var Ze=o(422),{useSyncExternalStore:Qe}=Ze,Je=()=>()=>{};function et(e,t=A){const n=B.useCallback((t=>e?Ge(e,null,t):Je()),[e]),r=()=>{const n="string"==typeof t?t:null,r="function"==typeof t?t:null,o=null==e?void 0:e.getState();return r?r(o):o&&n&&R(o,n)?o[n]:void 0};return Qe(n,r,r)}function tt(e,t){const n=B.useRef({}),r=B.useCallback((t=>e?Ge(e,null,t):Je()),[e]),o=()=>{const r=null==e?void 0:e.getState();let o=!1;const i=n.current;for(const e in t){const n=t[e];if("function"==typeof n){const t=n(r);t!==i[e]&&(i[e]=t,o=!0)}if("string"==typeof n){if(!r)continue;if(!R(r,n))continue;const t=r[n];t!==i[e]&&(i[e]=t,o=!0)}}return o&&(n.current=v({},i)),n.current};return Qe(r,o,o)}function nt(e,t,n,r){const o=R(t,n)?t[n]:void 0,i=r?t[r]:void 0,s=Ce({value:o,setValue:i});_e((()=>Ke(e,[n],((e,t)=>{const{value:r,setValue:o}=s.current;o&&e[n]!==t[n]&&e[n]!==r&&o(e[n])}))),[e,n]),_e((()=>{if(void 0!==o)return e.setState(n,o),qe(e,[n],(()=>{void 0!==o&&e.setState(n,o)}))}))}function rt(e,t){const[n,r]=B.useState((()=>e(t)));_e((()=>Ue(n)),[n]);const o=B.useCallback((e=>et(n,e)),[n]);return[B.useMemo((()=>b(v({},n),{useState:o})),[n,o]),ke((()=>{r((n=>e(v(v({},t),n.getState()))))}))]}function ot(e,t,n){return Te(t,[n.store]),nt(e,n,"items","setItems"),e}function it(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),r=F(e.items,null==n?void 0:n.items,e.defaultItems,[]),o=new Map(r.map((e=>[e.id,e]))),i={items:r,renderedItems:F(null==n?void 0:n.renderedItems,[])},s=null==(a=e.store)?void 0:a.__unstablePrivateStore;var a;const l=He({items:r,renderedItems:i.renderedItems},s),c=He(i,e.store),u=e=>{const t=se(e,(e=>e.element));l.setState("renderedItems",t),c.setState("renderedItems",t)};We(c,(()=>Ue(l))),We(l,(()=>qe(l,["items"],(e=>{c.setState("items",e.items)})))),We(l,(()=>qe(l,["renderedItems"],(e=>{let t=!0,n=requestAnimationFrame((()=>{const{renderedItems:t}=c.getState();e.renderedItems!==t&&u(e.renderedItems)}));if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(n);const r=function(e){var t;const n=e.find((e=>!!e.element)),r=[...e].reverse().find((e=>!!e.element));let o=null==(t=null==n?void 0:n.element)?void 0:t.parentElement;for(;o&&(null==r?void 0:r.element);){if(r&&o.contains(r.element))return o;o=o.parentElement}return K(o).body}(e.renderedItems),o=new IntersectionObserver((()=>{t?t=!1:(cancelAnimationFrame(n),n=requestAnimationFrame((()=>u(e.renderedItems))))}),{root:r});for(const t of e.renderedItems)t.element&&o.observe(t.element);return()=>{cancelAnimationFrame(n),o.disconnect()}}))));const d=(e,t,n=!1)=>{let r;t((t=>{const n=t.findIndex((({id:t})=>t===e.id)),i=t.slice();if(-1!==n){r=t[n];const s=E(E({},r),e);i[n]=s,o.set(e.id,s)}else i.push(e),o.set(e.id,e);return i}));return()=>{t((t=>{if(!r)return n&&o.delete(e.id),t.filter((({id:t})=>t!==e.id));const i=t.findIndex((({id:t})=>t===e.id));if(-1===i)return t;const s=t.slice();return s[i]=r,o.set(e.id,r),s}))}},p=e=>d(e,(e=>l.setState("items",e)),!0);return P(E({},c),{registerItem:p,renderItem:e=>M(p(e),d(e,(e=>l.setState("renderedItems",e)))),item:e=>{if(!e)return null;let t=o.get(e);if(!t){const{items:n}=l.getState();t=n.find((t=>t.id===e)),t&&o.set(e,t)}return t||null},__unstablePrivateStore:l})}function st(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}function at(e){const t=[];for(const n of e)t.push(...n);return t}function lt(e){return e.slice().reverse()}var ct={id:null};function ut(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}function dt(e,t){return e.filter((e=>e.rowId===t))}function pt(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}function ft(e){let t=0;for(const{length:n}of e)n>t&&(t=n);return t}function ht(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=it(e),o=F(e.activeId,null==n?void 0:n.activeId,e.defaultActiveId),i=He(P(E({},r.getState()),{id:F(e.id,null==n?void 0:n.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:F(null==n?void 0:n.baseElement,null),includesBaseElement:F(e.includesBaseElement,null==n?void 0:n.includesBaseElement,null===o),moves:F(null==n?void 0:n.moves,0),orientation:F(e.orientation,null==n?void 0:n.orientation,"both"),rtl:F(e.rtl,null==n?void 0:n.rtl,!1),virtualFocus:F(e.virtualFocus,null==n?void 0:n.virtualFocus,!1),focusLoop:F(e.focusLoop,null==n?void 0:n.focusLoop,!1),focusWrap:F(e.focusWrap,null==n?void 0:n.focusWrap,!1),focusShift:F(e.focusShift,null==n?void 0:n.focusShift,!1)}),r,e.store);We(i,(()=>Ke(i,["renderedItems","activeId"],(e=>{i.setState("activeId",(t=>{var n;return void 0!==t?t:null==(n=ut(e.renderedItems))?void 0:n.id}))}))));const s=(e="next",t={})=>{var n,r;const o=i.getState(),{skip:s=0,activeId:a=o.activeId,focusShift:l=o.focusShift,focusLoop:c=o.focusLoop,focusWrap:u=o.focusWrap,includesBaseElement:d=o.includesBaseElement,renderedItems:p=o.renderedItems,rtl:f=o.rtl}=t,h="up"===e||"down"===e,m="next"===e||"down"===e,g=m?f&&!h:!f||h,v=l&&!s;let b=h?at(function(e,t,n){const r=ft(e);for(const o of e)for(let e=0;e<r;e+=1){const r=o[e];if(!r||n&&r.disabled){const r=0===e&&n?ut(o):o[e-1];o[e]=r&&t!==r.id&&n?r:{id:"__EMPTY_ITEM__",disabled:!0,rowId:null==r?void 0:r.rowId}}}return e}(pt(p),a,v)):p;if(b=g?lt(b):b,b=h?function(e){const t=pt(e),n=ft(t),r=[];for(let e=0;e<n;e+=1)for(const n of t){const t=n[e];t&&r.push(P(E({},t),{rowId:t.rowId?`${e}`:void 0}))}return r}(b):b,null==a)return null==(n=ut(b))?void 0:n.id;const x=b.find((e=>e.id===a));if(!x)return null==(r=ut(b))?void 0:r.id;const y=b.some((e=>e.rowId)),w=b.indexOf(x),_=b.slice(w+1),S=dt(_,x.rowId);if(s){const e=function(e,t){return e.filter((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(S,a),t=e.slice(s)[0]||e[e.length-1];return null==t?void 0:t.id}const C=c&&(h?"horizontal"!==c:"vertical"!==c),k=y&&u&&(h?"horizontal"!==u:"vertical"!==u),j=m?(!y||h)&&C&&d:!!h&&d;if(C){const e=function(e,t,n=!1){const r=e.findIndex((e=>e.id===t));return[...e.slice(r+1),...n?[ct]:[],...e.slice(0,r)]}(k&&!j?b:dt(b,x.rowId),a,j),t=ut(e,a);return null==t?void 0:t.id}if(k){const e=ut(j?S:_,a);return j?(null==e?void 0:e.id)||null:null==e?void 0:e.id}const N=ut(S,a);return!N&&j?null:null==N?void 0:N.id};return P(E(E({},r),i),{setBaseElement:e=>i.setState("baseElement",e),setActiveId:e=>i.setState("activeId",e),move:e=>{void 0!==e&&(i.setState("activeId",e),i.setState("moves",(e=>e+1)))},first:()=>{var e;return null==(e=ut(i.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=ut(lt(i.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("up",e))})}function mt(e){const t=Pe(e.id);return v({id:t},e)}function gt(e,t,n){return nt(e=ot(e,t,n),n,"activeId","setActiveId"),nt(e,n,"includesBaseElement"),nt(e,n,"virtualFocus"),nt(e,n,"orientation"),nt(e,n,"rtl"),nt(e,n,"focusLoop"),nt(e,n,"focusWrap"),nt(e,n,"focusShift"),e}function vt(e={}){e=mt(e);const[t,n]=rt(ht,e);return gt(t,n,e)}var bt={id:null};function xt(e,t){return t&&e.item(t)||null}var yt=Symbol("FOCUS_SILENTLY");function wt(e,t,n){if(!t)return!1;if(t===n)return!1;const r=e.item(t.id);return!!r&&(!n||r.element!==n)}const _t=window.ReactJSXRuntime;function St(e){const t=B.forwardRef(((t,n)=>e(b(v({},t),{ref:n}))));return t.displayName=e.displayName||e.name,t}function Ct(e,t){return B.memo(e,t)}function kt(e,t){const n=t,{wrapElement:r,render:o}=n,i=x(n,["wrapElement","render"]),s=Ee(t.ref,W(o));let a;if(B.isValidElement(o)){const e=b(v({},o.props),{ref:s});a=B.cloneElement(o,function(e,t){const n=v({},e);for(const r in t){if(!R(t,r))continue;if("className"===r){const r="className";n[r]=e[r]?`${e[r]} ${t[r]}`:t[r];continue}if("style"===r){const r="style";n[r]=e[r]?v(v({},e[r]),t[r]):t[r];continue}const o=t[r];if("function"==typeof o&&r.startsWith("on")){const t=e[r];if("function"==typeof t){n[r]=(...e)=>{o(...e),t(...e)};continue}}n[r]=o}return n}(i,e))}else a=o?o(i):(0,_t.jsx)(e,v({},i));return r?r(a):a}function jt(e){const t=(t={})=>e(t);return t.displayName=e.name,t}function Et(e=[],t=[]){const n=B.createContext(void 0),r=B.createContext(void 0),o=()=>B.useContext(n),i=t=>e.reduceRight(((e,n)=>(0,_t.jsx)(n,b(v({},t),{children:e}))),(0,_t.jsx)(n.Provider,v({},t)));return{context:n,scopedContext:r,useContext:o,useScopedContext:(e=!1)=>{const t=B.useContext(r),n=o();return e?t:t||n},useProviderContext:()=>{const e=B.useContext(r),t=o();if(!e||e!==t)return t},ContextProvider:i,ScopedContextProvider:e=>(0,_t.jsx)(i,b(v({},e),{children:t.reduceRight(((t,n)=>(0,_t.jsx)(n,b(v({},e),{children:t}))),(0,_t.jsx)(r.Provider,v({},e)))}))}}var Pt=Et(),Nt=Pt.useContext,Tt=(Pt.useScopedContext,Pt.useProviderContext,Et([Pt.ContextProvider],[Pt.ScopedContextProvider])),It=Tt.useContext,Rt=(Tt.useScopedContext,Tt.useProviderContext),Mt=Tt.ContextProvider,At=Tt.ScopedContextProvider,Dt=(0,B.createContext)(void 0),zt=(0,B.createContext)(void 0),Ot=(0,B.createContext)(!0),Lt="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function Ft(e){return!!e.matches(Lt)&&(!!ee(e)&&!e.closest("[inert]"))}function Bt(e){if(!Ft(e))return!1;if(function(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}(e))return!1;if(!("form"in e))return!0;if(!e.form)return!0;if(e.checked)return!0;if("radio"!==e.type)return!0;const t=e.form.elements.namedItem(e.name);if(!t)return!0;if(!("length"in t))return!0;const n=Y(e);return!n||(n===e||(!("form"in n)||(n.form!==e.form||n.name!==e.name)))}function Vt(e,t){const n=Array.from(e.querySelectorAll(Lt));t&&n.unshift(e);const r=n.filter(Ft);return r.forEach(((e,t)=>{if(Z(e)&&e.contentDocument){const n=e.contentDocument.body;r.splice(t,1,...Vt(n))}})),r}function $t(e,t,n){const r=Array.from(e.querySelectorAll(Lt)),o=r.filter(Bt);return t&&Bt(e)&&o.unshift(e),o.forEach(((e,t)=>{if(Z(e)&&e.contentDocument){const r=$t(e.contentDocument.body,!1,n);o.splice(t,1,...r)}})),!o.length&&n?r:o}function Ht(e,t,n){const[r]=$t(e,t,n);return r||null}function Wt(e,t){return function(e,t,n,r){const o=Y(e),i=Vt(e,t),s=i.indexOf(o),a=i.slice(s+1);return a.find(Bt)||(n?i.find(Bt):null)||(r?a[0]:null)||null}(document.body,!1,e,t)}function Ut(e,t){return function(e,t,n,r){const o=Y(e),i=Vt(e,t).reverse(),s=i.indexOf(o),a=i.slice(s+1);return a.find(Bt)||(n?i.find(Bt):null)||(r?a[0]:null)||null}(document.body,!1,e,t)}function Gt(e){const t=Y(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function Kt(e){const t=Y(e);if(!t)return!1;if(X(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&("id"in e&&(n===e.id||!!e.querySelector(`#${CSS.escape(n)}`)))}function qt(e){!Kt(e)&&Ft(e)&&e.focus()}function Yt(e){var t;const n=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",n),e.setAttribute("tabindex","-1")}var Xt=le(),Zt=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],Qt=Symbol("safariFocusAncestor");function Jt(e,t){e&&(e[Qt]=t)}function en(e){return!("input"!==e.tagName.toLowerCase()||!e.type)&&("radio"===e.type||"checkbox"===e.type)}function tn(e,t,n,r,o){return e?t?n&&!r?-1:void 0:n?o:o||0:o}function nn(e,t){return ke((n=>{null==e||e(n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())}))}var rn=!0;function on(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(rn=!1))}function sn(e){e.metaKey||e.ctrlKey||e.altKey||(rn=!0)}var an=jt((function(e){var t=e,{focusable:n=!0,accessibleWhenDisabled:r,autoFocus:o,onFocusVisible:i}=t,s=x(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const a=(0,B.useRef)(null);(0,B.useEffect)((()=>{n&&(be("mousedown",on,!0),be("keydown",sn,!0))}),[n]),Xt&&(0,B.useEffect)((()=>{if(!n)return;const e=a.current;if(!e)return;if(!en(e))return;const t=function(e){return"labels"in e?e.labels:null}(e);if(!t)return;const r=()=>queueMicrotask((()=>e.focus()));for(const e of t)e.addEventListener("mouseup",r);return()=>{for(const e of t)e.removeEventListener("mouseup",r)}}),[n]);const l=n&&O(s),c=!!l&&!r,[u,d]=(0,B.useState)(!1);(0,B.useEffect)((()=>{n&&c&&u&&d(!1)}),[n,c,u]),(0,B.useEffect)((()=>{if(!n)return;if(!u)return;const e=a.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver((()=>{Ft(e)||d(!1)}));return t.observe(e),()=>t.disconnect()}),[n,u]);const p=nn(s.onKeyPressCapture,l),f=nn(s.onMouseDownCapture,l),h=nn(s.onClickCapture,l),m=s.onMouseDown,g=ke((e=>{if(null==m||m(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget;if(!Xt)return;if(ue(e))return;if(!Q(t)&&!en(t))return;let r=!1;const o=()=>{r=!0};t.addEventListener("focusin",o,{capture:!0,once:!0});const i=function(e){for(;e&&!Ft(e);)e=e.closest(Lt);return e||null}(t.parentElement);Jt(i,!0),ve(t,"mouseup",(()=>{t.removeEventListener("focusin",o,!0),Jt(i,!1),r||qt(t)}))})),y=(e,t)=>{if(t&&(e.currentTarget=t),!n)return;const r=e.currentTarget;r&&Gt(r)&&(null==i||i(e),e.defaultPrevented||(r.dataset.focusVisible="true",d(!0)))},w=s.onKeyDownCapture,_=ke((e=>{if(null==w||w(e),e.defaultPrevented)return;if(!n)return;if(u)return;if(e.metaKey)return;if(e.altKey)return;if(e.ctrlKey)return;if(!de(e))return;const t=e.currentTarget;ve(t,"focusout",(()=>y(e,t)))})),S=s.onFocusCapture,C=ke((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!n)return;if(!de(e))return void d(!1);const t=e.currentTarget,r=()=>y(e,t);rn||function(e){const{tagName:t,readOnly:n,type:r}=e;return"TEXTAREA"===t&&!n||("SELECT"===t&&!n||("INPUT"!==t||n?!!e.isContentEditable||!("combobox"!==e.getAttribute("role")||!e.dataset.name):Zt.includes(r)))}(e.target)?ve(e.target,"focusout",r):d(!1)})),k=s.onBlur,j=ke((e=>{null==k||k(e),n&&ge(e)&&d(!1)})),E=(0,B.useContext)(Ot),P=ke((e=>{n&&o&&e&&E&&queueMicrotask((()=>{Gt(e)||Ft(e)&&e.focus()}))})),N=Ne(a),T=n&&function(e){return!e||"button"===e||"summary"===e||"input"===e||"select"===e||"textarea"===e||"a"===e}(N),I=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e}(N),R=s.style,M=(0,B.useMemo)((()=>c?v({pointerEvents:"none"},R):R),[c,R]);return L(s=b(v({"data-focus-visible":n&&u||void 0,"data-autofocus":o||void 0,"aria-disabled":l||void 0},s),{ref:Ee(a,P,s.ref),style:M,tabIndex:tn(n,c,T,I,s.tabIndex),disabled:!(!I||!c)||void 0,contentEditable:l?void 0:s.contentEditable,onKeyPressCapture:p,onClickCapture:h,onMouseDownCapture:f,onMouseDown:g,onKeyDownCapture:_,onFocusCapture:C,onBlur:j}))}));St((function(e){return kt("div",an(e))}));function ln(e,t,n){return ke((r=>{var o;if(null==t||t(r),r.defaultPrevented)return;if(r.isPropagationStopped())return;if(!de(r))return;if(function(e){return"Shift"===e.key||"Control"===e.key||"Alt"===e.key||"Meta"===e.key}(r))return;if(function(e){const t=e.target;return!(t&&!te(t)||1!==e.key.length||e.ctrlKey||e.metaKey)}(r))return;const i=e.getState(),s=null==(o=xt(e,i.activeId))?void 0:o.element;if(!s)return;const a=r,{view:l}=a,c=x(a,["view"]);s!==(null==n?void 0:n.current)&&s.focus(),function(e,t,n){const r=new KeyboardEvent(t,n);return e.dispatchEvent(r)}(s,r.type,c)||r.preventDefault(),r.currentTarget.contains(s)&&r.stopPropagation()}))}var cn=jt((function(e){var t=e,{store:n,composite:r=!0,focusOnMove:o=r,moveOnKeyPress:i=!0}=t,s=x(t,["store","composite","focusOnMove","moveOnKeyPress"]);const a=Rt();D(n=n||a,!1);const l=(0,B.useRef)(null),c=(0,B.useRef)(null),u=function(e){const[t,n]=(0,B.useState)(!1),r=(0,B.useCallback)((()=>n(!0)),[]),o=e.useState((t=>xt(e,t.activeId)));return(0,B.useEffect)((()=>{const e=null==o?void 0:o.element;t&&e&&(n(!1),e.focus({preventScroll:!0}))}),[o,t]),r}(n),d=n.useState("moves"),[,p]=je(r?n.setBaseElement:null);(0,B.useEffect)((()=>{var e;if(!n)return;if(!d)return;if(!r)return;if(!o)return;const{activeId:t}=n.getState(),i=null==(e=xt(n,t))?void 0:e.element;i&&function(e,t){"scrollIntoView"in e?(e.focus({preventScroll:!0}),e.scrollIntoView(E({block:"nearest",inline:"nearest"},t))):e.focus()}(i)}),[n,d,r,o]),_e((()=>{if(!n)return;if(!d)return;if(!r)return;const{baseElement:e,activeId:t}=n.getState();if(!(null===t))return;if(!e)return;const o=c.current;c.current=null,o&&he(o,{relatedTarget:e}),Gt(e)||e.focus()}),[n,d,r]);const f=n.useState("activeId"),h=n.useState("virtualFocus");_e((()=>{var e;if(!n)return;if(!r)return;if(!h)return;const t=c.current;if(c.current=null,!t)return;const o=(null==(e=xt(n,f))?void 0:e.element)||Y(t);o!==t&&he(t,{relatedTarget:o})}),[n,f,h,r]);const m=ln(n,s.onKeyDownCapture,c),g=ln(n,s.onKeyUpCapture,c),y=s.onFocusCapture,w=ke((e=>{if(null==y||y(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const r=e.relatedTarget,o=function(e){const t=e[yt];return delete e[yt],t}(e.currentTarget);de(e)&&o&&(e.stopPropagation(),c.current=r)})),_=s.onFocus,S=ke((e=>{if(null==_||_(e),e.defaultPrevented)return;if(!r)return;if(!n)return;const{relatedTarget:t}=e,{virtualFocus:o}=n.getState();o?de(e)&&!wt(n,t)&&queueMicrotask(u):de(e)&&n.setActiveId(null)})),C=s.onBlurCapture,k=ke((e=>{var t;if(null==C||C(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:r,activeId:o}=n.getState();if(!r)return;const i=null==(t=xt(n,o))?void 0:t.element,s=e.relatedTarget,a=wt(n,s),l=c.current;if(c.current=null,de(e)&&a)s===i?l&&l!==s&&he(l,e):i?he(i,e):l&&he(l,e),e.stopPropagation();else{!wt(n,e.target)&&i&&he(i,e)}})),j=s.onKeyDown,P=Re(i),N=ke((e=>{var t;if(null==j||j(e),e.defaultPrevented)return;if(!n)return;if(!de(e))return;const{orientation:r,renderedItems:o,activeId:i}=n.getState(),s=xt(n,i);if(null==(t=null==s?void 0:s.element)?void 0:t.isConnected)return;const a="horizontal"!==r,l="vertical"!==r,c=o.some((e=>!!e.rowId));if(("ArrowLeft"===e.key||"ArrowRight"===e.key||"Home"===e.key||"End"===e.key)&&te(e.currentTarget))return;const u={ArrowUp:(c||a)&&(()=>{if(c){const e=function(e){return function(e,t){return e.find((e=>t?!e.disabled&&e.id!==t:!e.disabled))}(at(lt(function(e){const t=[];for(const n of e){const e=t.find((e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId}));e?e.push(n):t.push([n])}return t}(e))))}(o);return null==e?void 0:e.id}return null==n?void 0:n.last()}),ArrowRight:(c||l)&&n.first,ArrowDown:(c||a)&&n.first,ArrowLeft:(c||l)&&n.last,Home:n.first,End:n.last,PageUp:n.first,PageDown:n.last},d=u[e.key];if(d){const t=d();if(void 0!==t){if(!P(e))return;e.preventDefault(),n.move(t)}}}));s=Me(s,(e=>(0,_t.jsx)(Mt,{value:n,children:e})),[n]);const T=n.useState((e=>{var t;if(n&&r&&e.virtualFocus)return null==(t=xt(n,e.activeId))?void 0:t.id}));s=b(v({"aria-activedescendant":T},s),{ref:Ee(l,p,s.ref),onKeyDownCapture:m,onKeyUpCapture:g,onFocusCapture:w,onFocus:S,onBlurCapture:k,onKeyDown:N});const I=n.useState((e=>r&&(e.virtualFocus||null===e.activeId)));return s=an(v({focusable:I},s))})),un=St((function(e){return kt("div",cn(e))}));const dn=(0,c.createContext)({}),pn=()=>(0,c.useContext)(dn);var fn=(0,B.createContext)(void 0),hn=jt((function(e){const[t,n]=(0,B.useState)();return e=Me(e,(e=>(0,_t.jsx)(fn.Provider,{value:n,children:e})),[]),L(e=v({role:"group","aria-labelledby":t},e))})),mn=(St((function(e){return kt("div",hn(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);return r=hn(r)}))),gn=St((function(e){return kt("div",mn(e))}));const vn=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(gn,{store:o,...e,ref:t})}));var bn=jt((function(e){const t=(0,B.useContext)(fn),n=Pe(e.id);return _e((()=>(null==t||t(n),()=>null==t?void 0:t(void 0))),[t,n]),L(e=v({id:n,"aria-hidden":!0},e))})),xn=(St((function(e){return kt("div",bn(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);return r=bn(r)}))),yn=St((function(e){return kt("div",xn(e))}));const wn=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(yn,{store:o,...e,ref:t})}));function _n(e){const t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var Sn=Symbol("composite-hover");var Cn=jt((function(e){var t=e,{store:n,focusOnHover:r=!0,blurOnHoverEnd:o=!!r}=t,i=x(t,["store","focusOnHover","blurOnHoverEnd"]);const s=It();D(n=n||s,!1);const a=ze(),l=i.onMouseMove,c=Re(r),u=ke((e=>{if(null==l||l(e),!e.defaultPrevented&&a()&&c(e)){if(!Kt(e.currentTarget)){const e=null==n?void 0:n.getState().baseElement;e&&!Gt(e)&&e.focus()}null==n||n.setActiveId(e.currentTarget.id)}})),d=i.onMouseLeave,p=Re(o),f=ke((e=>{var t;null==d||d(e),e.defaultPrevented||a()&&(function(e){const t=_n(e);return!!t&&X(e.currentTarget,t)}(e)||function(e){let t=_n(e);if(!t)return!1;do{if(R(t,Sn)&&t[Sn])return!0;t=t.parentElement}while(t);return!1}(e)||c(e)&&p(e)&&(null==n||n.setActiveId(null),null==(t=null==n?void 0:n.getState().baseElement)||t.focus()))})),h=(0,B.useCallback)((e=>{e&&(e[Sn]=!0)}),[]);return L(i=b(v({},i),{ref:Ee(h,i.ref),onMouseMove:u,onMouseLeave:f}))})),kn=Ct(St((function(e){return kt("div",Cn(e))})));const jn=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(kn,{store:o,...e,ref:t})}));var En=jt((function(e){var t=e,{store:n,shouldRegisterItem:r=!0,getItem:o=A,element:i}=t,s=x(t,["store","shouldRegisterItem","getItem","element"]);const a=Nt();n=n||a;const l=Pe(s.id),c=(0,B.useRef)(i);return(0,B.useEffect)((()=>{const e=c.current;if(!l)return;if(!e)return;if(!r)return;const t=o({id:l,element:e});return null==n?void 0:n.renderItem(t)}),[l,r,o,n]),L(s=b(v({},s),{ref:Ee(c,s.ref)}))}));St((function(e){return kt("div",En(e))}));function Pn(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return"Enter"===e.key?Q(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(Q(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}var Nn=Symbol("command"),Tn=jt((function(e){var t=e,{clickOnEnter:n=!0,clickOnSpace:r=!0}=t,o=x(t,["clickOnEnter","clickOnSpace"]);const i=(0,B.useRef)(null),[s,a]=(0,B.useState)(!1);(0,B.useEffect)((()=>{i.current&&a(Q(i.current))}),[]);const[l,c]=(0,B.useState)(!1),u=(0,B.useRef)(!1),d=O(o),[p,f]=De(o,Nn,!0),h=o.onKeyDown,m=ke((e=>{null==h||h(e);const t=e.currentTarget;if(e.defaultPrevented)return;if(p)return;if(d)return;if(!de(e))return;if(te(t))return;if(t.isContentEditable)return;const o=n&&"Enter"===e.key,i=r&&" "===e.key,s="Enter"===e.key&&!n,a=" "===e.key&&!r;if(s||a)e.preventDefault();else if(o||i){const n=Pn(e);if(o){if(!n){e.preventDefault();const n=e,{view:r}=n,o=x(n,["view"]),i=()=>me(t,o);G&&/firefox\//i.test(navigator.userAgent)?ve(t,"keyup",i):queueMicrotask(i)}}else i&&(u.current=!0,n||(e.preventDefault(),c(!0)))}})),g=o.onKeyUp,y=ke((e=>{if(null==g||g(e),e.defaultPrevented)return;if(p)return;if(d)return;if(e.metaKey)return;const t=r&&" "===e.key;if(u.current&&t&&(u.current=!1,!Pn(e))){e.preventDefault(),c(!1);const t=e.currentTarget,n=e,{view:r}=n,o=x(n,["view"]);queueMicrotask((()=>me(t,o)))}}));return o=b(v(v({"data-active":l||void 0,type:s?"button":void 0},f),o),{ref:Ee(i,o.ref),onKeyDown:m,onKeyUp:y}),o=an(o)}));St((function(e){return kt("button",Tn(e))}));function In(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function Rn(e,t,n,r=!1){var o;if(!t)return;if(!n)return;const{renderedItems:i}=t.getState(),s=ie(e);if(!s)return;const a=function(e,t=!1){const n=e.clientHeight,{top:r}=e.getBoundingClientRect(),o=1.5*Math.max(.875*n,n-40),i=t?n-o+r:o+r;return"HTML"===e.tagName?i+e.scrollTop:i}(s,r);let l,c;for(let e=0;e<i.length;e+=1){const i=l;if(l=n(e),!l)break;if(l===i)continue;const s=null==(o=xt(t,l))?void 0:o.element;if(!s)continue;const u=In(s,r)-a,d=Math.abs(u);if(r&&u<=0||!r&&u>=0){void 0!==c&&c<d&&(l=i);break}c=d}return l}var Mn=jt((function(e){var t=e,{store:n,rowId:r,preventScrollOnKeyDown:o=!1,moveOnKeyPress:i=!0,tabbable:s=!1,getItem:a,"aria-setsize":l,"aria-posinset":c}=t,u=x(t,["store","rowId","preventScrollOnKeyDown","moveOnKeyPress","tabbable","getItem","aria-setsize","aria-posinset"]);const d=It();n=n||d;const p=Pe(u.id),f=(0,B.useRef)(null),h=(0,B.useContext)(zt),m=O(u)&&!u.accessibleWhenDisabled,{rowId:g,baseElement:y,isActiveItem:w,ariaSetSize:_,ariaPosInSet:S,isTabbable:C}=tt(n,{rowId:e=>r||(e&&(null==h?void 0:h.baseElement)&&h.baseElement===e.baseElement?h.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===p,ariaSetSize:e=>null!=l?l:e&&(null==h?void 0:h.ariaSetSize)&&h.baseElement===e.baseElement?h.ariaSetSize:void 0,ariaPosInSet(e){if(null!=c)return c;if(!e)return;if(!(null==h?void 0:h.ariaPosInSet))return;if(h.baseElement!==e.baseElement)return;const t=e.renderedItems.filter((e=>e.rowId===g));return h.ariaPosInSet+t.findIndex((e=>e.id===p))},isTabbable(e){if(!(null==e?void 0:e.renderedItems.length))return!0;if(e.virtualFocus)return!1;if(s)return!0;if(null===e.activeId)return!1;const t=null==n?void 0:n.item(e.activeId);return!!(null==t?void 0:t.disabled)||(!(null==t?void 0:t.element)||e.activeId===p)}}),k=(0,B.useCallback)((e=>{var t;const n=b(v({},e),{id:p||e.id,rowId:g,disabled:!!m,children:null==(t=e.element)?void 0:t.textContent});return a?a(n):n}),[p,g,m,a]),j=u.onFocus,E=(0,B.useRef)(!1),P=ke((e=>{if(null==j||j(e),e.defaultPrevented)return;if(ue(e))return;if(!p)return;if(!n)return;if(function(e,t){return!de(e)&&wt(t,e.target)}(e,n))return;const{virtualFocus:t,baseElement:r}=n.getState();if(n.setActiveId(p),ne(e.currentTarget)&&function(e,t=!1){if(te(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){const n=K(e).getSelection();null==n||n.selectAllChildren(e),t&&(null==n||n.collapseToEnd())}}(e.currentTarget),!t)return;if(!de(e))return;if(ne(o=e.currentTarget)||"INPUT"===o.tagName&&!Q(o))return;var o;if(!(null==r?void 0:r.isConnected))return;le()&&e.currentTarget.hasAttribute("data-autofocus")&&e.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),E.current=!0;e.relatedTarget===r||wt(n,e.relatedTarget)?function(e){e[yt]=!0,e.focus({preventScroll:!0})}(r):r.focus()})),N=u.onBlurCapture,T=ke((e=>{if(null==N||N(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState();(null==t?void 0:t.virtualFocus)&&E.current&&(E.current=!1,e.preventDefault(),e.stopPropagation())})),I=u.onKeyDown,R=Re(o),M=Re(i),A=ke((e=>{if(null==I||I(e),e.defaultPrevented)return;if(!de(e))return;if(!n)return;const{currentTarget:t}=e,r=n.getState(),o=n.item(p),i=!!(null==o?void 0:o.rowId),s="horizontal"!==r.orientation,a="vertical"!==r.orientation,l=()=>!!i||(!!a||(!r.baseElement||!te(r.baseElement))),c={ArrowUp:(i||s)&&n.up,ArrowRight:(i||a)&&n.next,ArrowDown:(i||s)&&n.down,ArrowLeft:(i||a)&&n.previous,Home:()=>{if(l())return!i||e.ctrlKey?null==n?void 0:n.first():null==n?void 0:n.previous(-1)},End:()=>{if(l())return!i||e.ctrlKey?null==n?void 0:n.last():null==n?void 0:n.next(-1)},PageUp:()=>Rn(t,n,null==n?void 0:n.up,!0),PageDown:()=>Rn(t,n,null==n?void 0:n.down)}[e.key];if(c){if(ne(t)){const n=function(e){let t=0,n=0;if(te(e))t=e.selectionStart||0,n=e.selectionEnd||0;else if(e.isContentEditable){const r=K(e).getSelection();if((null==r?void 0:r.rangeCount)&&r.anchorNode&&X(e,r.anchorNode)&&r.focusNode&&X(e,r.focusNode)){const o=r.getRangeAt(0),i=o.cloneRange();i.selectNodeContents(e),i.setEnd(o.startContainer,o.startOffset),t=i.toString().length,i.setEnd(o.endContainer,o.endOffset),n=i.toString().length}}return{start:t,end:n}}(t),r=a&&"ArrowLeft"===e.key,o=a&&"ArrowRight"===e.key,i=s&&"ArrowUp"===e.key,l=s&&"ArrowDown"===e.key;if(o||l){const{length:e}=function(e){if(te(e))return e.value;if(e.isContentEditable){const t=K(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(t);if(n.end!==e)return}else if((r||i)&&0!==n.start)return}const r=c();if(R(e)||void 0!==r){if(!M(e))return;e.preventDefault(),n.move(r)}}})),D=(0,B.useMemo)((()=>({id:p,baseElement:y})),[p,y]);return u=Me(u,(e=>(0,_t.jsx)(Dt.Provider,{value:D,children:e})),[D]),u=b(v({id:p,"data-active-item":w||void 0},u),{ref:Ee(f,u.ref),tabIndex:C?u.tabIndex:-1,onFocus:P,onBlurCapture:T,onKeyDown:A}),u=Tn(u),u=En(b(v({store:n},u),{getItem:k,shouldRegisterItem:!!p&&u.shouldRegisterItem})),L(b(v({},u),{"aria-setsize":_,"aria-posinset":S}))})),An=Ct(St((function(e){return kt("button",Mn(e))})));const Dn=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(An,{store:o,...e,ref:t})}));var zn=jt((function(e){var t=e,{store:n,"aria-setsize":r,"aria-posinset":o}=t,i=x(t,["store","aria-setsize","aria-posinset"]);const s=It();D(n=n||s,!1);const a=Pe(i.id),l=n.useState((e=>e.baseElement||void 0)),c=(0,B.useMemo)((()=>({id:a,baseElement:l,ariaSetSize:r,ariaPosInSet:o})),[a,l,r,o]);return i=Me(i,(e=>(0,_t.jsx)(zt.Provider,{value:c,children:e})),[c]),L(i=v({id:a},i))})),On=St((function(e){return kt("div",zn(e))}));const Ln=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(On,{store:o,...e,ref:t})}));var Fn="";function Bn(){Fn=""}function Vn(e,t){var n;const r=(null==(n=e.element)?void 0:n.textContent)||e.children||"value"in e&&e.value;return!!r&&(o=r,o.normalize("NFD").replace(/[\u0300-\u036f]/g,"")).trim().toLowerCase().startsWith(t.toLowerCase());var o}function $n(e,t,n){if(!n)return e;const r=e.find((e=>e.id===n));return r&&Vn(r,t)?Fn!==t&&Vn(r,Fn)?e:(Fn=t,function(e,t,n=!1){const r=e.findIndex((e=>e.id===t));return[...e.slice(r+1),...n?[bt]:[],...e.slice(0,r)]}(e.filter((e=>Vn(e,Fn))),n).filter((e=>e.id!==n))):e}var Hn=jt((function(e){var t=e,{store:n,typeahead:r=!0}=t,o=x(t,["store","typeahead"]);const i=It();D(n=n||i,!1);const s=o.onKeyDownCapture,a=(0,B.useRef)(0),l=ke((e=>{if(null==s||s(e),e.defaultPrevented)return;if(!r)return;if(!n)return;if(!function(e){const t=e.target;return(!t||!te(t))&&(!(" "!==e.key||!Fn.length)||1===e.key.length&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&/^[\p{Letter}\p{Number}]$/u.test(e.key))}(e))return Bn();const{renderedItems:t,items:o,activeId:i,id:l}=n.getState();let c=function(e){return e.filter((e=>!e.disabled))}(o.length>t.length?o:t);const u=`[data-offscreen-id="${l}"]`,d=K(e.currentTarget).querySelectorAll(u);for(const e of d){const t="true"===e.ariaDisabled||"disabled"in e&&!!e.disabled;c.push({id:e.id,element:e,disabled:t})}if(d.length&&(c=se(c,(e=>e.element))),!function(e,t){if(de(e))return!0;const n=e.target;if(!n)return!1;const r=t.some((e=>e.element===n));return r}(e,c))return Bn();e.preventDefault(),window.clearTimeout(a.current),a.current=window.setTimeout((()=>{Fn=""}),500);const p=e.key.toLowerCase();Fn+=p,c=$n(c,p,i);const f=c.find((e=>Vn(e,Fn)));f?n.move(f.id):Bn()}));return L(o=b(v({},o),{onKeyDownCapture:l}))})),Wn=St((function(e){return kt("div",Hn(e))}));const Un=(0,c.forwardRef)((function(e,t){var n;const r=pn(),o=null!==(n=e.store)&&void 0!==n?n:r.store;return(0,_t.jsx)(Wn,{store:o,...e,ref:t})})),Gn=Object.assign((0,c.forwardRef)((function({activeId:e,defaultActiveId:t,setActiveId:n,focusLoop:r=!1,focusWrap:o=!1,focusShift:i=!1,virtualFocus:s=!1,orientation:l="both",rtl:u=(0,a.isRTL)(),children:d,disabled:p=!1,...f},h){const m=f.store,g=vt({activeId:e,defaultActiveId:t,setActiveId:n,focusLoop:r,focusWrap:o,focusShift:i,virtualFocus:s,orientation:l,rtl:u}),v=null!=m?m:g,b=(0,c.useMemo)((()=>({store:v})),[v]);return(0,_t.jsx)(un,{disabled:p,store:v,...f,ref:h,children:(0,_t.jsx)(dn.Provider,{value:b,children:d})})})),{Group:Object.assign(vn,{displayName:"Composite.Group"}),GroupLabel:Object.assign(wn,{displayName:"Composite.GroupLabel"}),Item:Object.assign(Dn,{displayName:"Composite.Item"}),Row:Object.assign(Ln,{displayName:"Composite.Row"}),Hover:Object.assign(jn,{displayName:"Composite.Hover"}),Typeahead:Object.assign(Un,{displayName:"Composite.Typeahead"}),Context:Object.assign(dn,{displayName:"Composite.Context"})});function Kn(e={}){const t=Xe(e.store,Ye(e.disclosure,["contentElement","disclosureElement"])),n=null==t?void 0:t.getState(),r=F(e.open,null==n?void 0:n.open,e.defaultOpen,!1),o=F(e.animated,null==n?void 0:n.animated,!1),i=He({open:r,animated:o,animating:!!o&&r,mounted:r,contentElement:F(null==n?void 0:n.contentElement,null),disclosureElement:F(null==n?void 0:n.disclosureElement,null)},t);return We(i,(()=>Ke(i,["animated","animating"],(e=>{e.animated||i.setState("animating",!1)})))),We(i,(()=>Ge(i,["open"],(()=>{i.getState().animated&&i.setState("animating",!0)})))),We(i,(()=>Ke(i,["open","animating"],(e=>{i.setState("mounted",e.open||e.animating)})))),P(E({},i),{disclosure:e.disclosure,setOpen:e=>i.setState("open",e),show:()=>i.setState("open",!0),hide:()=>i.setState("open",!1),toggle:()=>i.setState("open",(e=>!e)),stopAnimation:()=>i.setState("animating",!1),setContentElement:e=>i.setState("contentElement",e),setDisclosureElement:e=>i.setState("disclosureElement",e)})}function qn(e,t,n){return Te(t,[n.store,n.disclosure]),nt(e,n,"open","setOpen"),nt(e,n,"mounted","setMounted"),nt(e,n,"animated"),Object.assign(e,{disclosure:n.disclosure})}function Yn(e={}){const[t,n]=rt(Kn,e);return qn(t,n,e)}function Xn(e={}){return Kn(e)}function Zn(e,t,n){return qn(e,t,n)}function Qn(e,t,n){return Te(t,[n.popover]),nt(e,n,"placement"),Zn(e,t,n)}function Jn(e,t,n){return nt(e,n,"timeout"),nt(e,n,"showTimeout"),nt(e,n,"hideTimeout"),Qn(e,t,n)}function er(e={}){var t=e,{popover:n}=t,r=N(t,["popover"]);const o=Xe(r.store,Ye(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),i=null==o?void 0:o.getState(),s=Xn(P(E({},r),{store:o})),a=F(r.placement,null==i?void 0:i.placement,"bottom"),l=He(P(E({},s.getState()),{placement:a,currentPlacement:a,anchorElement:F(null==i?void 0:i.anchorElement,null),popoverElement:F(null==i?void 0:i.popoverElement,null),arrowElement:F(null==i?void 0:i.arrowElement,null),rendered:Symbol("rendered")}),s,o);return P(E(E({},s),l),{setAnchorElement:e=>l.setState("anchorElement",e),setPopoverElement:e=>l.setState("popoverElement",e),setArrowElement:e=>l.setState("arrowElement",e),render:()=>l.setState("rendered",Symbol("rendered"))})}function tr(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=er(P(E({},e),{placement:F(e.placement,null==n?void 0:n.placement,"bottom")})),o=F(e.timeout,null==n?void 0:n.timeout,500),i=He(P(E({},r.getState()),{timeout:o,showTimeout:F(e.showTimeout,null==n?void 0:n.showTimeout),hideTimeout:F(e.hideTimeout,null==n?void 0:n.hideTimeout),autoFocusOnShow:F(null==n?void 0:n.autoFocusOnShow,!1)}),r,e.store);return P(E(E({},r),i),{setAutoFocusOnShow:e=>i.setState("autoFocusOnShow",e)})}function nr(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),r=tr(P(E({},e),{placement:F(e.placement,null==n?void 0:n.placement,"top"),hideTimeout:F(e.hideTimeout,null==n?void 0:n.hideTimeout,0)})),o=He(P(E({},r.getState()),{type:F(e.type,null==n?void 0:n.type,"description"),skipTimeout:F(e.skipTimeout,null==n?void 0:n.skipTimeout,300)}),r,e.store);return E(E({},r),o)}function rr(e={}){const[t,n]=rt(nr,e);return function(e,t,n){return nt(e,n,"type"),nt(e,n,"skipTimeout"),Jn(e,t,n)}(t,n,e)}jt((function(e){return e}));var or=St((function(e){return kt("div",e)}));Object.assign(or,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce(((e,t)=>(e[t]=St((function(e){return kt(t,e)})),e)),{}));var ir=Et(),sr=(ir.useContext,ir.useScopedContext,ir.useProviderContext),ar=Et([ir.ContextProvider],[ir.ScopedContextProvider]),lr=(ar.useContext,ar.useScopedContext,ar.useProviderContext),cr=ar.ContextProvider,ur=ar.ScopedContextProvider,dr=(0,B.createContext)(void 0),pr=(0,B.createContext)(void 0),fr=Et([cr],[ur]),hr=fr.useContext,mr=(fr.useScopedContext,fr.useProviderContext),gr=fr.ContextProvider,vr=fr.ScopedContextProvider,br=Et([gr],[vr]),xr=(br.useContext,br.useScopedContext,br.useProviderContext),yr=br.ContextProvider,wr=br.ScopedContextProvider,_r=jt((function(e){var t=e,{store:n,showOnHover:r=!0}=t,o=x(t,["store","showOnHover"]);const i=xr();D(n=n||i,!1);const s=O(o),a=(0,B.useRef)(0);(0,B.useEffect)((()=>()=>window.clearTimeout(a.current)),[]),(0,B.useEffect)((()=>be("mouseleave",(e=>{if(!n)return;const{anchorElement:t}=n.getState();t&&e.target===t&&(window.clearTimeout(a.current),a.current=0)}),!0)),[n]);const l=o.onMouseMove,c=Re(r),u=ze(),d=ke((e=>{if(null==l||l(e),s)return;if(!n)return;if(e.defaultPrevented)return;if(a.current)return;if(!u())return;if(!c(e))return;const t=e.currentTarget;n.setAnchorElement(t),n.setDisclosureElement(t);const{showTimeout:r,timeout:o}=n.getState(),i=()=>{a.current=0,u()&&(null==n||n.setAnchorElement(t),null==n||n.show(),queueMicrotask((()=>{null==n||n.setDisclosureElement(t)})))},d=null!=r?r:o;0===d?i():a.current=window.setTimeout(i,d)})),p=o.onClick,f=ke((e=>{null==p||p(e),n&&(window.clearTimeout(a.current),a.current=0)})),h=(0,B.useCallback)((e=>{if(!n)return;const{anchorElement:t}=n.getState();(null==t?void 0:t.isConnected)||n.setAnchorElement(e)}),[n]);return o=b(v({},o),{ref:Ee(h,o.ref),onMouseMove:d,onClick:f}),o=an(o)})),Sr=(St((function(e){return kt("a",_r(e))})),Et([yr],[wr])),Cr=(Sr.useContext,Sr.useScopedContext,Sr.useProviderContext),kr=(Sr.ContextProvider,Sr.ScopedContextProvider),jr=He({activeStore:null});function Er(e){return()=>{const{activeStore:t}=jr.getState();t===e&&jr.setState("activeStore",null)}}var Pr=jt((function(e){var t=e,{store:n,showOnHover:r=!0}=t,o=x(t,["store","showOnHover"]);const i=Cr();D(n=n||i,!1);const s=(0,B.useRef)(!1);(0,B.useEffect)((()=>Ke(n,["mounted"],(e=>{e.mounted||(s.current=!1)}))),[n]),(0,B.useEffect)((()=>{if(n)return M(Er(n),Ke(n,["mounted","skipTimeout"],(e=>{if(!n)return;if(e.mounted){const{activeStore:e}=jr.getState();return e!==n&&(null==e||e.hide()),jr.setState("activeStore",n)}const t=setTimeout(Er(n),e.skipTimeout);return()=>clearTimeout(t)})))}),[n]);const a=o.onMouseEnter,l=ke((e=>{null==a||a(e),s.current=!0})),c=o.onFocusVisible,u=ke((e=>{null==c||c(e),e.defaultPrevented||(null==n||n.setAnchorElement(e.currentTarget),null==n||n.show())})),d=o.onBlur,p=ke((e=>{if(null==d||d(e),e.defaultPrevented)return;const{activeStore:t}=jr.getState();s.current=!1,t===n&&jr.setState("activeStore",null)})),f=n.useState("type"),h=n.useState((e=>{var t;return null==(t=e.contentElement)?void 0:t.id}));return o=b(v({"aria-labelledby":"label"===f?h:void 0},o),{onMouseEnter:l,onFocusVisible:u,onBlur:p}),o=_r(v({store:n,showOnHover(e){if(!s.current)return!1;if(z(r,e))return!1;const{activeStore:t}=jr.getState();return!t||(null==n||n.show(),!1)}},o))})),Nr=St((function(e){return kt("div",Pr(e))}));function Tr(e){return[e.clientX,e.clientY]}function Ir(e,t){const[n,r]=e;let o=!1;for(let e=t.length,i=0,s=e-1;i<e;s=i++){const[a,l]=t[i],[c,u]=t[s],[,d]=t[0===s?e-1:s-1]||[0,0],p=(l-u)*(n-a)-(a-c)*(r-l);if(u<l){if(r>=u&&r<l){if(0===p)return!0;p>0&&(r===u?r>d&&(o=!o):o=!o)}}else if(l<u){if(r>l&&r<=u){if(0===p)return!0;p<0&&(r===u?r<d&&(o=!o):o=!o)}}else if(r===l&&(n>=c&&n<=a||n>=a&&n<=c))return!0}return o}function Rr(e,t){const n=e.getBoundingClientRect(),{top:r,right:o,bottom:i,left:s}=n,[a,l]=function(e,t){const{top:n,right:r,bottom:o,left:i}=t,[s,a]=e;return[s<i?"left":s>r?"right":null,a<n?"top":a>o?"bottom":null]}(t,n),c=[t];return a?("top"!==l&&c.push(["left"===a?s:o,r]),c.push(["left"===a?o:s,r]),c.push(["left"===a?o:s,i]),"bottom"!==l&&c.push(["left"===a?s:o,i])):"top"===l?(c.push([s,r]),c.push([s,i]),c.push([o,i]),c.push([o,r])):(c.push([s,i]),c.push([s,r]),c.push([o,r]),c.push([o,i])),c}function Mr(e,...t){if(!e)return!1;const n=e.getAttribute("data-backdrop");return null!=n&&(""===n||("true"===n||(!t.length||t.some((e=>n===e)))))}var Ar=new WeakMap;function Dr(e,t,n){Ar.has(e)||Ar.set(e,new Map);const r=Ar.get(e),o=r.get(t);if(!o)return r.set(t,n()),()=>{var e;null==(e=r.get(t))||e(),r.delete(t)};const i=n(),s=()=>{i(),o(),r.delete(t)};return r.set(t,s),()=>{r.get(t)===s&&(i(),r.set(t,o))}}function zr(e,t,n){return Dr(e,t,(()=>{const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{null==r?e.removeAttribute(t):e.setAttribute(t,r)}}))}function Or(e,t,n){return Dr(e,t,(()=>{const r=t in e,o=e[t];return e[t]=n,()=>{r?e[t]=o:delete e[t]}}))}function Lr(e,t){if(!e)return()=>{};return Dr(e,"style",(()=>{const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}))}var Fr=["SCRIPT","STYLE"];function Br(e){return`__ariakit-dialog-snapshot-${e}`}function Vr(e,t,n){return!Fr.includes(t.tagName)&&(!!function(e,t){const n=K(t),r=Br(e);if(!n.body[r])return!0;for(;;){if(t===n.body)return!1;if(t[r])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!n.some((e=>e&&X(t,e))))}function $r(e,t,n,r){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;const i=t.some((e=>!!e&&(e!==o&&e.contains(o)))),s=K(o),a=o;for(;o.parentElement&&o!==s.body;){if(null==r||r(o.parentElement,a),!i)for(const r of o.parentElement.children)Vr(e,r,t)&&n(r,a);o=o.parentElement}}}function Hr(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function Wr(e,t=""){return M(Or(e,Hr("",!0),!0),Or(e,Hr(t,!0),!0))}function Ur(e,t){if(e[Hr(t,!0)])return!0;const n=Hr(t);for(;;){if(e[n])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function Gr(e,t){const n=[],r=t.map((e=>null==e?void 0:e.id));$r(e,t,(t=>{Mr(t,...r)||n.unshift(function(e,t=""){return M(Or(e,Hr(),!0),Or(e,Hr(t),!0))}(t,e))}),((t,r)=>{r.hasAttribute("data-dialog")&&r.id!==e||n.unshift(Wr(t,e))}));return()=>{for(const e of n)e()}}const Kr=window.ReactDOM;function qr(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function Yr(...e){return e.join(", ").split(", ").reduce(((e,t)=>{const n=t.endsWith("ms")?1:1e3,r=Number.parseFloat(t||"0s")*n;return r>e?r:e}),0)}function Xr(e,t,n){return!(n||!1===t||e&&!t)}var Zr=jt((function(e){var t=e,{store:n,alwaysVisible:r}=t,o=x(t,["store","alwaysVisible"]);const i=sr();D(n=n||i,!1);const s=(0,B.useRef)(null),a=Pe(o.id),[l,c]=(0,B.useState)(null),u=n.useState("open"),d=n.useState("mounted"),p=n.useState("animated"),f=n.useState("contentElement"),h=et(n.disclosure,"contentElement");_e((()=>{s.current&&(null==n||n.setContentElement(s.current))}),[n]),_e((()=>{let e;return null==n||n.setState("animated",(t=>(e=t,!0))),()=>{void 0!==e&&(null==n||n.setState("animated",e))}}),[n]),_e((()=>{if(p){if(null==f?void 0:f.isConnected)return function(e){let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}((()=>{c(u?"enter":d?"leave":null)}));c(null)}}),[p,f,u,d]),_e((()=>{if(!n)return;if(!p)return;if(!l)return;if(!f)return;const e=()=>null==n?void 0:n.setState("animating",!1),t=()=>(0,Kr.flushSync)(e);if("leave"===l&&u)return;if("enter"===l&&!u)return;if("number"==typeof p){return qr(p,t)}const{transitionDuration:r,animationDuration:o,transitionDelay:i,animationDelay:s}=getComputedStyle(f),{transitionDuration:a="0",animationDuration:c="0",transitionDelay:d="0",animationDelay:m="0"}=h?getComputedStyle(h):{},g=Yr(i,s,d,m)+Yr(r,o,a,c);if(!g)return"enter"===l&&n.setState("animated",!1),void e();return qr(Math.max(g-1e3/60,0),t)}),[n,p,f,h,u,l]),o=Me(o,(e=>(0,_t.jsx)(ur,{value:n,children:e})),[n]);const m=Xr(d,o.hidden,r),g=o.style,y=(0,B.useMemo)((()=>m?b(v({},g),{display:"none"}):g),[m,g]);return L(o=b(v({id:a,"data-open":u||void 0,"data-enter":"enter"===l||void 0,"data-leave":"leave"===l||void 0,hidden:m},o),{ref:Ee(a?n.setContentElement:null,s,o.ref),style:y}))})),Qr=St((function(e){return kt("div",Zr(e))})),Jr=St((function(e){var t=e,{unmountOnHide:n}=t,r=x(t,["unmountOnHide"]);const o=sr();return!1===et(r.store||o,(e=>!n||(null==e?void 0:e.mounted)))?null:(0,_t.jsx)(Qr,v({},r))}));function eo({store:e,backdrop:t,alwaysVisible:n,hidden:r}){const o=(0,B.useRef)(null),i=Yn({disclosure:e}),s=et(e,"contentElement");(0,B.useEffect)((()=>{const e=o.current,t=s;e&&t&&(e.style.zIndex=getComputedStyle(t).zIndex)}),[s]),_e((()=>{const e=null==s?void 0:s.id;if(!e)return;const t=o.current;return t?Wr(t,e):void 0}),[s]);const a=Zr({ref:o,store:i,role:"presentation","data-backdrop":(null==s?void 0:s.id)||"",alwaysVisible:n,hidden:null!=r?r:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,B.isValidElement)(t))return(0,_t.jsx)(or,b(v({},a),{render:t}));const l="boolean"!=typeof t?t:"div";return(0,_t.jsx)(or,b(v({},a),{render:(0,_t.jsx)(l,{})}))}function to(e){return zr(e,"aria-hidden","true")}function no(){return"inert"in HTMLElement.prototype}function ro(e,t){if(!("style"in e))return T;if(no())return Or(e,"inert",!0);const n=$t(e,!0).map((e=>{if(null==t?void 0:t.some((t=>t&&X(t,e))))return T;const n=Dr(e,"focus",(()=>(e.focus=T,()=>{delete e.focus})));return M(zr(e,"tabindex","-1"),n)}));return M(...n,to(e),Lr(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function oo(e,t,n){const r=function({attribute:e,contentId:t,contentElement:n,enabled:r}){const[o,i]=Ie(),s=(0,B.useCallback)((()=>{if(!r)return!1;if(!n)return!1;const{body:o}=K(n),i=o.getAttribute(e);return!i||i===t}),[o,r,n,e,t]);return(0,B.useEffect)((()=>{if(!r)return;if(!t)return;if(!n)return;const{body:o}=K(n);if(s())return o.setAttribute(e,t),()=>o.removeAttribute(e);const a=new MutationObserver((()=>(0,Kr.flushSync)(i)));return a.observe(o,{attributeFilter:[e]}),()=>a.disconnect()}),[o,r,t,n,s,e]),s}({attribute:"data-dialog-prevent-body-scroll",contentElement:e,contentId:t,enabled:n});(0,B.useEffect)((()=>{if(!r())return;if(!e)return;const t=K(e),n=q(e),{documentElement:o,body:i}=t,s=o.style.getPropertyValue("--scrollbar-width"),a=s?Number.parseInt(s):n.innerWidth-o.clientWidth,l=function(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}(o),c=ae()&&!ce();return M((d="--scrollbar-width",p=`${a}px`,(u=o)?Dr(u,d,(()=>{const e=u.style.getPropertyValue(d);return u.style.setProperty(d,p),()=>{e?u.style.setProperty(d,e):u.style.removeProperty(d)}})):()=>{}),c?(()=>{var e,t;const{scrollX:r,scrollY:o,visualViewport:s}=n,c=null!=(e=null==s?void 0:s.offsetLeft)?e:0,u=null!=(t=null==s?void 0:s.offsetTop)?t:0,d=Lr(i,{position:"fixed",overflow:"hidden",top:-(o-Math.floor(u))+"px",left:-(r-Math.floor(c))+"px",right:"0",[l]:`${a}px`});return()=>{d(),n.scrollTo({left:r,top:o,behavior:"instant"})}})():Lr(i,{overflow:"hidden",[l]:`${a}px`}));var u,d,p}),[r,e])}var io=(0,B.createContext)({});function so({store:e,type:t,listener:n,capture:r,domReady:o}){const i=ke(n),s=et(e,"open"),a=(0,B.useRef)(!1);_e((()=>{if(!s)return;if(!o)return;const{contentElement:t}=e.getState();if(!t)return;const n=()=>{a.current=!0};return t.addEventListener("focusin",n,!0),()=>t.removeEventListener("focusin",n,!0)}),[e,s,o]),(0,B.useEffect)((()=>{if(!s)return;return be(t,(t=>{const{contentElement:n,disclosureElement:r}=e.getState(),o=t.target;if(!n)return;if(!o)return;if(!function(e){return"HTML"===e.tagName||X(K(e).body,e)}(o))return;if(X(n,o))return;if(function(e,t){if(!e)return!1;if(X(e,t))return!0;const n=t.getAttribute("aria-activedescendant");if(n){const t=K(e).getElementById(n);if(t)return X(e,t)}return!1}(r,o))return;if(o.hasAttribute("data-focus-trap"))return;if(function(e,t){if(!("clientY"in e))return!1;const n=t.getBoundingClientRect();return 0!==n.width&&0!==n.height&&n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}(t,n))return;var s;a.current&&!Ur(o,n.id)||((s=o)&&s[Qt]||i(t))}),r)}),[s,r])}function ao(e,t){return"function"==typeof e?e(t):!!e}function lo(e,t,n){const r=function(e){const t=(0,B.useRef)();return(0,B.useEffect)((()=>{if(e)return be("mousedown",(e=>{t.current=e.target}),!0);t.current=null}),[e]),t}(et(e,"open")),o={store:e,domReady:n,capture:!0};so(b(v({},o),{type:"click",listener:n=>{const{contentElement:o}=e.getState(),i=r.current;i&&ee(i)&&Ur(i,null==o?void 0:o.id)&&ao(t,n)&&e.hide()}})),so(b(v({},o),{type:"focusin",listener:n=>{const{contentElement:r}=e.getState();r&&n.target!==K(r)&&ao(t,n)&&e.hide()}})),so(b(v({},o),{type:"contextmenu",listener:n=>{ao(t,n)&&e.hide()}}))}var co=jt((function(e){var t=e,{autoFocusOnShow:n=!0}=t,r=x(t,["autoFocusOnShow"]);return r=Me(r,(e=>(0,_t.jsx)(Ot.Provider,{value:n,children:e})),[n])})),uo=(St((function(e){return kt("div",co(e))})),(0,B.createContext)(0));function po({level:e,children:t}){const n=(0,B.useContext)(uo),r=Math.max(Math.min(e||n+1,6),1);return(0,_t.jsx)(uo.Provider,{value:r,children:t})}var fo=jt((function(e){return e=b(v({},e),{style:v({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},e.style)})})),ho=(St((function(e){return kt("span",fo(e))})),jt((function(e){return e=b(v({"data-focus-trap":"",tabIndex:0,"aria-hidden":!0},e),{style:v({position:"fixed",top:0,left:0},e.style)}),e=fo(e)}))),mo=St((function(e){return kt("span",ho(e))})),go=(0,B.createContext)(null);function vo(e){queueMicrotask((()=>{null==e||e.focus()}))}var bo=jt((function(e){var t=e,{preserveTabOrder:n,preserveTabOrderAnchor:r,portalElement:o,portalRef:i,portal:s=!0}=t,a=x(t,["preserveTabOrder","preserveTabOrderAnchor","portalElement","portalRef","portal"]);const l=(0,B.useRef)(null),c=Ee(l,a.ref),u=(0,B.useContext)(go),[d,p]=(0,B.useState)(null),[f,h]=(0,B.useState)(null),m=(0,B.useRef)(null),g=(0,B.useRef)(null),y=(0,B.useRef)(null),w=(0,B.useRef)(null);return _e((()=>{const e=l.current;if(!e||!s)return void p(null);const t=function(e,t){return t?"function"==typeof t?t(e):t:K(e).createElement("div")}(e,o);if(!t)return void p(null);const n=t.isConnected;if(!n){const n=u||function(e){return K(e).body}(e);n.appendChild(t)}return t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),p(t),H(i,t),n?void 0:()=>{t.remove(),H(i,null)}}),[s,o,u,i]),_e((()=>{if(!s)return;if(!n)return;if(!r)return;const e=K(r).createElement("span");return e.style.position="fixed",r.insertAdjacentElement("afterend",e),h(e),()=>{e.remove(),h(null)}}),[s,n,r]),(0,B.useEffect)((()=>{if(!d)return;if(!n)return;let e=0;const t=t=>{if(!ge(t))return;const n="focusin"===t.type;if(cancelAnimationFrame(e),n)return function(e){const t=e.querySelectorAll("[data-tabindex]"),n=e=>{const t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};e.hasAttribute("data-tabindex")&&n(e);for(const e of t)n(e)}(d);e=requestAnimationFrame((()=>{!function(e,t){const n=$t(e,t);for(const e of n)Yt(e)}(d,!0)}))};return d.addEventListener("focusin",t,!0),d.addEventListener("focusout",t,!0),()=>{cancelAnimationFrame(e),d.removeEventListener("focusin",t,!0),d.removeEventListener("focusout",t,!0)}}),[d,n]),a=Me(a,(e=>{if(e=(0,_t.jsx)(go.Provider,{value:d||u,children:e}),!s)return e;if(!d)return(0,_t.jsx)("span",{ref:c,id:a.id,style:{position:"fixed"},hidden:!0});e=(0,_t.jsxs)(_t.Fragment,{children:[n&&d&&(0,_t.jsx)(mo,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{ge(e,d)?vo(Wt()):vo(m.current)}}),e,n&&d&&(0,_t.jsx)(mo,{ref:y,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{ge(e,d)?vo(Ut()):vo(w.current)}})]}),d&&(e=(0,Kr.createPortal)(e,d));let t=(0,_t.jsxs)(_t.Fragment,{children:[n&&d&&(0,_t.jsx)(mo,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{!(e.relatedTarget===w.current)&&ge(e,d)?vo(g.current):vo(Ut())}}),n&&(0,_t.jsx)("span",{"aria-owns":null==d?void 0:d.id,style:{position:"fixed"}}),n&&d&&(0,_t.jsx)(mo,{ref:w,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(ge(e,d))vo(y.current);else{const e=Wt();if(e===g.current)return void requestAnimationFrame((()=>{var e;return null==(e=Wt())?void 0:e.focus()}));vo(e)}}})]});return f&&n&&(t=(0,Kr.createPortal)(t,f)),(0,_t.jsxs)(_t.Fragment,{children:[t,e]})}),[d,u,s,a.id,n,f]),a=b(v({},a),{ref:c})})),xo=(St((function(e){return kt("div",bo(e))})),le());function yo(e,t=!1){if(!e)return null;const n="current"in e?e.current:e;return n?t?Ft(n)?n:null:n:null}var wo=jt((function(e){var t=e,{store:n,open:r,onClose:o,focusable:i=!0,modal:s=!0,portal:a=!!s,backdrop:l=!!s,hideOnEscape:c=!0,hideOnInteractOutside:u=!0,getPersistentElements:d,preventBodyScroll:p=!!s,autoFocusOnShow:f=!0,autoFocusOnHide:h=!0,initialFocus:m,finalFocus:g,unmountOnHide:y,unstable_treeSnapshotKey:w}=t,_=x(t,["store","open","onClose","focusable","modal","portal","backdrop","hideOnEscape","hideOnInteractOutside","getPersistentElements","preventBodyScroll","autoFocusOnShow","autoFocusOnHide","initialFocus","finalFocus","unmountOnHide","unstable_treeSnapshotKey"]);const S=lr(),C=(0,B.useRef)(null),k=function(e={}){const[t,n]=rt(Xn,e);return Zn(t,n,e)}({store:n||S,open:r,setOpen(e){if(e)return;const t=C.current;if(!t)return;const n=new Event("close",{bubbles:!1,cancelable:!0});o&&t.addEventListener("close",o,{once:!0}),t.dispatchEvent(n),n.defaultPrevented&&k.setOpen(!0)}}),{portalRef:j,domReady:E}=Ae(a,_.portalRef),P=_.preserveTabOrder,N=et(k,(e=>P&&!s&&e.mounted)),T=Pe(_.id),I=et(k,"open"),R=et(k,"mounted"),A=et(k,"contentElement"),D=Xr(R,_.hidden,_.alwaysVisible);oo(A,T,p&&!D),lo(k,u,E);const{wrapElement:z,nestedDialogs:O}=function(e){const t=(0,B.useContext)(io),[n,r]=(0,B.useState)([]),o=(0,B.useCallback)((e=>{var n;return r((t=>[...t,e])),M(null==(n=t.add)?void 0:n.call(t,e),(()=>{r((t=>t.filter((t=>t!==e))))}))}),[t]);_e((()=>Ke(e,["open","contentElement"],(n=>{var r;if(n.open&&n.contentElement)return null==(r=t.add)?void 0:r.call(t,e)}))),[e,t]);const i=(0,B.useMemo)((()=>({store:e,add:o})),[e,o]);return{wrapElement:(0,B.useCallback)((e=>(0,_t.jsx)(io.Provider,{value:i,children:e})),[i]),nestedDialogs:n}}(k);_=Me(_,z,[z]),_e((()=>{if(!I)return;const e=C.current,t=Y(e,!0);t&&"BODY"!==t.tagName&&(e&&X(e,t)||k.setDisclosureElement(t))}),[k,I]),xo&&(0,B.useEffect)((()=>{if(!R)return;const{disclosureElement:e}=k.getState();if(!e)return;if(!Q(e))return;const t=()=>{let t=!1;const n=()=>{t=!0};e.addEventListener("focusin",n,{capture:!0,once:!0}),ve(e,"mouseup",(()=>{e.removeEventListener("focusin",n,!0),t||qt(e)}))};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}}),[k,R]),(0,B.useEffect)((()=>{if(!R)return;if(!E)return;const e=C.current;if(!e)return;const t=q(e),n=t.visualViewport||t,r=()=>{var n,r;const o=null!=(r=null==(n=t.visualViewport)?void 0:n.height)?r:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${o}px`)};return r(),n.addEventListener("resize",r),()=>{n.removeEventListener("resize",r)}}),[R,E]),(0,B.useEffect)((()=>{if(!s)return;if(!R)return;if(!E)return;const e=C.current;if(!e)return;return e.querySelector("[data-dialog-dismiss]")?void 0:function(e,t){const n=K(e).createElement("button");return n.type="button",n.tabIndex=-1,n.textContent="Dismiss popup",Object.assign(n.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),n.addEventListener("click",t),e.prepend(n),()=>{n.removeEventListener("click",t),n.remove()}}(e,k.hide)}),[k,s,R,E]),_e((()=>{if(!no())return;if(I)return;if(!R)return;if(!E)return;const e=C.current;return e?ro(e):void 0}),[I,R,E]);const L=I&&E;_e((()=>{if(!T)return;if(!L)return;const e=C.current;return function(e,t){const{body:n}=K(t[0]),r=[];return $r(e,t,(t=>{r.push(Or(t,Br(e),!0))})),M(Or(n,Br(e),!0),(()=>{for(const e of r)e()}))}(T,[e])}),[T,L,w]);const F=ke(d);_e((()=>{if(!T)return;if(!L)return;const{disclosureElement:e}=k.getState(),t=[C.current,...F()||[],...O.map((e=>e.getState().contentElement))];return s?M(Gr(T,t),function(e,t){const n=[],r=t.map((e=>null==e?void 0:e.id));return $r(e,t,(e=>{Mr(e,...r)||function(e,...t){if(!e)return!1;const n=e.getAttribute("data-focus-trap");return null!=n&&(!t.length||""!==n&&t.some((e=>n===e)))}(e,...r)||n.unshift(ro(e,t))}),(e=>{e.hasAttribute("role")&&(t.some((t=>t&&X(t,e)))||n.unshift(zr(e,"role","none")))})),()=>{for(const e of n)e()}}(T,t)):Gr(T,[e,...t])}),[T,k,L,F,O,s,w]);const V=!!f,$=Re(f),[H,W]=(0,B.useState)(!1);(0,B.useEffect)((()=>{if(!I)return;if(!V)return;if(!E)return;if(!(null==A?void 0:A.isConnected))return;const e=yo(m,!0)||A.querySelector("[data-autofocus=true],[autofocus]")||Ht(A,!0,a&&N)||A,t=Ft(e);$(t?e:null)&&(W(!0),queueMicrotask((()=>{e.focus(),xo&&e.scrollIntoView({block:"nearest",inline:"nearest"})})))}),[I,V,E,A,m,a,N,$]);const U=!!h,G=Re(h),[Z,J]=(0,B.useState)(!1);(0,B.useEffect)((()=>{if(I)return J(!0),()=>J(!1)}),[I]);const ee=(0,B.useCallback)(((e,t=!0)=>{const{disclosureElement:n}=k.getState();if(function(e){const t=Y();return!(!t||e&&X(e,t)||!Ft(t))}(e))return;let r=yo(g)||n;if(null==r?void 0:r.id){const e=K(r),t=`[aria-activedescendant="${r.id}"]`,n=e.querySelector(t);n&&(r=n)}if(r&&!Ft(r)){const e=r.closest("[data-dialog]");if(null==e?void 0:e.id){const t=K(e),n=`[aria-controls~="${e.id}"]`,o=t.querySelector(n);o&&(r=o)}}const o=r&&Ft(r);o||!t?G(o?r:null)&&o&&(null==r||r.focus()):requestAnimationFrame((()=>ee(e,!1)))}),[k,g,G]),te=(0,B.useRef)(!1);_e((()=>{if(I)return;if(!Z)return;if(!U)return;const e=C.current;te.current=!0,ee(e)}),[I,Z,E,U,ee]),(0,B.useEffect)((()=>{if(!Z)return;if(!U)return;const e=C.current;return()=>{te.current?te.current=!1:ee(e)}}),[Z,U,ee]);const ne=Re(c);(0,B.useEffect)((()=>{if(!E)return;if(!R)return;return be("keydown",(e=>{if("Escape"!==e.key)return;if(e.defaultPrevented)return;const t=C.current;if(!t)return;if(Ur(t))return;const n=e.target;if(!n)return;const{disclosureElement:r}=k.getState();("BODY"===n.tagName||X(t,n)||!r||X(r,n))&&ne(e)&&k.hide()}),!0)}),[k,E,R,ne]);const re=(_=Me(_,(e=>(0,_t.jsx)(po,{level:s?1:void 0,children:e})),[s])).hidden,oe=_.alwaysVisible;_=Me(_,(e=>l?(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(eo,{store:k,backdrop:l,hidden:re,alwaysVisible:oe}),e]}):e),[k,l,re,oe]);const[ie,se]=(0,B.useState)(),[ae,le]=(0,B.useState)();return _=Me(_,(e=>(0,_t.jsx)(ur,{value:k,children:(0,_t.jsx)(dr.Provider,{value:se,children:(0,_t.jsx)(pr.Provider,{value:le,children:e})})})),[k]),_=b(v({id:T,"data-dialog":"",role:"dialog",tabIndex:i?-1:void 0,"aria-labelledby":ie,"aria-describedby":ae},_),{ref:Ee(C,_.ref)}),_=co(b(v({},_),{autoFocusOnShow:H})),_=Zr(v({store:k},_)),_=an(b(v({},_),{focusable:i})),_=bo(b(v({portal:a},_),{portalRef:j,preserveTabOrder:N}))}));function _o(e,t=lr){return St((function(n){const r=t();return et(n.store||r,(e=>!n.unmountOnHide||(null==e?void 0:e.mounted)||!!n.open))?(0,_t.jsx)(e,v({},n)):null}))}_o(St((function(e){return kt("div",wo(e))})),lr);const So=Math.min,Co=Math.max,ko=(Math.round,Math.floor,{left:"right",right:"left",bottom:"top",top:"bottom"}),jo={start:"end",end:"start"};function Eo(e,t,n){return Co(e,So(t,n))}function Po(e,t){return"function"==typeof e?e(t):e}function No(e){return e.split("-")[0]}function To(e){return e.split("-")[1]}function Io(e){return"x"===e?"y":"x"}function Ro(e){return"y"===e?"height":"width"}function Mo(e){return["top","bottom"].includes(No(e))?"y":"x"}function Ao(e){return Io(Mo(e))}function Do(e){return e.replace(/start|end/g,(e=>jo[e]))}function zo(e){return e.replace(/left|right|bottom|top/g,(e=>ko[e]))}function Oo(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Lo(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Fo(e,t,n){let{reference:r,floating:o}=e;const i=Mo(t),s=Ao(t),a=Ro(s),l=No(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(To(t)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1)}return f}async function Bo(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=Po(t,e),h=Oo(f),m=a[p?"floating"===d?"reference":"floating":d],g=Lo(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v="floating"===d?{...s.floating,x:r,y:o}:s.reference,b=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(b))&&await(null==i.getScale?void 0:i.getScale(b))||{x:1,y:1},y=Lo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:b,strategy:l}):v);return{top:(g.top-y.top+h.top)/x.y,bottom:(y.bottom-g.bottom+h.bottom)/x.y,left:(g.left-y.left+h.left)/x.x,right:(y.right-g.right+h.right)/x.x}}const Vo=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=No(n),a=To(n),l="y"===Mo(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=Po(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof h&&(f="end"===a?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},$o=Math.min,Ho=Math.max,Wo=Math.round,Uo=Math.floor,Go=e=>({x:e,y:e});function Ko(){return"undefined"!=typeof window}function qo(e){return Zo(e)?(e.nodeName||"").toLowerCase():"#document"}function Yo(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Xo(e){var t;return null==(t=(Zo(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Zo(e){return!!Ko()&&(e instanceof Node||e instanceof Yo(e).Node)}function Qo(e){return!!Ko()&&(e instanceof Element||e instanceof Yo(e).Element)}function Jo(e){return!!Ko()&&(e instanceof HTMLElement||e instanceof Yo(e).HTMLElement)}function ei(e){return!(!Ko()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Yo(e).ShadowRoot)}function ti(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ai(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function ni(e){return["table","td","th"].includes(qo(e))}function ri(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function oi(e){const t=ii(),n=Qo(e)?ai(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function ii(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function si(e){return["html","body","#document"].includes(qo(e))}function ai(e){return Yo(e).getComputedStyle(e)}function li(e){return Qo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ci(e){if("html"===qo(e))return e;const t=e.assignedSlot||e.parentNode||ei(e)&&e.host||Xo(e);return ei(t)?t.host:t}function ui(e){const t=ci(e);return si(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jo(t)&&ti(t)?t:ui(t)}function di(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ui(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=Yo(o);if(i){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}(s);return t.concat(s,s.visualViewport||[],ti(o)?o:[],e&&n?di(e):[])}return t.concat(o,di(o,[],n))}function pi(e){const t=ai(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jo(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Wo(n)!==i||Wo(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function fi(e){return Qo(e)?e:e.contextElement}function hi(e){const t=fi(e);if(!Jo(t))return Go(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=pi(t);let s=(i?Wo(n.width):n.width)/r,a=(i?Wo(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const mi=Go(0);function gi(e){const t=Yo(e);return ii()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:mi}function vi(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=fi(e);let s=Go(1);t&&(r?Qo(r)&&(s=hi(r)):s=hi(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Yo(e))&&t}(i,n,r)?gi(i):Go(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=Yo(i),t=r&&Qo(r)?Yo(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=hi(o),t=o.getBoundingClientRect(),r=ai(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=Yo(o),o=n.frameElement}}return Lo({width:u,height:d,x:l,y:c})}const bi=[":popover-open",":modal"];function xi(e){return bi.some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function yi(e){return vi(Xo(e)).left+li(e).scrollLeft}function wi(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Yo(e),r=Xo(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=ii();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=Xo(e),n=li(e),r=e.ownerDocument.body,o=Ho(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ho(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+yi(e);const a=-n.scrollTop;return"rtl"===ai(r).direction&&(s+=Ho(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(Xo(e));else if(Qo(t))r=function(e,t){const n=vi(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Jo(e)?hi(e):Go(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=gi(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return Lo(r)}function _i(e,t){const n=ci(e);return!(n===t||!Qo(n)||si(n))&&("fixed"===ai(n).position||_i(n,t))}function Si(e,t,n){const r=Jo(t),o=Xo(t),i="fixed"===n,s=vi(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Go(0);if(r||!r&&!i)if(("body"!==qo(t)||ti(o))&&(a=li(t)),r){const e=vi(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=yi(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function Ci(e,t){return Jo(e)&&"fixed"!==ai(e).position?t?t(e):e.offsetParent:null}function ki(e,t){const n=Yo(e);if(!Jo(e)||xi(e))return n;let r=Ci(e,t);for(;r&&ni(r)&&"static"===ai(r).position;)r=Ci(r,t);return r&&("html"===qo(r)||"body"===qo(r)&&"static"===ai(r).position&&!oi(r))?n:r||function(e){let t=ci(e);for(;Jo(t)&&!si(t);){if(oi(t))return t;if(ri(t))return null;t=ci(t)}return null}(e)||n}const ji={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=Xo(r),a=!!t&&xi(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Go(1);const u=Go(0),d=Jo(r);if((d||!d&&!i)&&(("body"!==qo(r)||ti(s))&&(l=li(r)),Jo(r))){const e=vi(r);c=hi(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:Xo,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=di(e,[],!1).filter((e=>Qo(e)&&"body"!==qo(e))),o=null;const i="fixed"===ai(e).position;let s=i?ci(e):e;for(;Qo(s)&&!si(s);){const t=ai(s),n=oi(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||ti(s)&&!n&&_i(e,s))?r=r.filter((e=>e!==s)):o=t,s=ci(s)}return t.set(e,r),r}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce(((e,n)=>{const r=wi(t,n,o);return e.top=Ho(r.top,e.top),e.right=$o(r.right,e.right),e.bottom=$o(r.bottom,e.bottom),e.left=Ho(r.left,e.left),e}),wi(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:ki,getElementRects:async function(e){const t=this.getOffsetParent||ki,n=this.getDimensions;return{reference:Si(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=pi(e);return{width:t,height:n}},getScale:hi,isElement:Qo,isRTL:function(e){return"rtl"===ai(e).direction}};function Ei(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=fi(e),u=o||i?[...c?di(c):[],...di(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=Xo(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const f={rootMargin:-Uo(u)+"px "+-Uo(o.clientWidth-(c+d))+"px "+-Uo(o.clientHeight-(u+p))+"px "+-Uo(c)+"px",threshold:Ho(0,$o(1,l))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),100)}h=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let m=l?vi(e):null;return l&&function t(){const r=vi(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const Pi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Po(e,t),c={x:n,y:r},u=await Bo(t,l),d=Mo(No(o)),p=Io(d);let f=c[p],h=c[d];if(i){const e="y"===p?"bottom":"right";f=Eo(f+u["y"===p?"top":"left"],f,f-u[e])}if(s){const e="y"===d?"bottom":"right";h=Eo(h+u["y"===d?"top":"left"],h,h-u[e])}const m=a.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},Ni=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Po(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=No(o),b=No(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),y=p||(b||!m?[zo(a)]:function(e){const t=zo(e);return[Do(e),t,Do(t)]}(a));p||"none"===h||y.push(...function(e,t,n,r){const o=To(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(No(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Do)))),i}(a,m,h,x));const w=[a,...y],_=await Bo(t,g),S=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&S.push(_[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=To(e),o=Ao(e),i=Ro(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=zo(s)),[s,zo(s)]}(o,s,x);S.push(_[e[0]],_[e[1]])}if(C=[...C,{placement:o,overflows:S}],!S.every((e=>e<=0))){var k,j;const e=((null==(k=i.flip)?void 0:k.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(j=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:j.placement;if(!n)switch(f){case"bestFit":{var E;const e=null==(E=C.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:E[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},Ti=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=Po(e,t),l=await Bo(t,a),c=No(n),u=To(n),d="y"===Mo(n),{width:p,height:f}=r.floating;let h,m;"top"===c||"bottom"===c?(h=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,h="end"===u?"top":"bottom");const g=f-l[h],v=p-l[m],b=!t.middlewareData.shift;let x=g,y=v;if(d){const e=p-l.left-l.right;y=u||b?So(v,e):e}else{const e=f-l.top-l.bottom;x=u||b?So(g,e):e}if(b&&!u){const e=Co(l.left,0),t=Co(l.right,0),n=Co(l.top,0),r=Co(l.bottom,0);d?y=p-2*(0!==e||0!==t?e+t:Co(l.left,l.right)):x=f-2*(0!==n||0!==r?n+r:Co(l.top,l.bottom))}await s({...t,availableWidth:y,availableHeight:x});const w=await o.getDimensions(i.floating);return p!==w.width||f!==w.height?{reset:{rects:!0}}:{}}}},Ii=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Po(e,t)||{};if(null==c)return{};const d=Oo(u),p={x:n,y:r},f=Ao(o),h=Ro(f),m=await s.getDimensions(c),g="y"===f,v=g?"top":"left",b=g?"bottom":"right",x=g?"clientHeight":"clientWidth",y=i.reference[h]+i.reference[f]-p[f]-i.floating[h],w=p[f]-i.reference[f],_=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let S=_?_[x]:0;S&&await(null==s.isElement?void 0:s.isElement(_))||(S=a.floating[x]||i.floating[h]);const C=y/2-w/2,k=S/2-m[h]/2-1,j=So(d[v],k),E=So(d[b],k),P=j,N=S-m[h]-E,T=S/2-m[h]/2+C,I=Eo(P,T,N),R=!l.arrow&&null!=To(o)&&T!=I&&i.reference[h]/2-(T<P?j:E)-m[h]/2<0,M=R?T<P?T-P:T-N:0;return{[f]:p[f]+M,data:{[f]:I,centerOffset:T-I-M,...R&&{alignmentOffset:M}},reset:R}}}),Ri=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Po(e,t),u={x:n,y:r},d=Mo(o),p=Io(d);let f=u[p],h=u[d];const m=Po(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;f<t?f=t:f>n&&(f=n)}if(c){var v,b;const e="y"===p?"width":"height",t=["top","left"].includes(No(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(b=s.offset)?void 0:b[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},Mi=(e,t,n)=>{const r=new Map,o={platform:ji,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Fo(c,r,l),p=r,f={},h=0;for(let n=0;n<a.length;n++){const{name:i,fn:m}=a[n],{x:g,y:v,data:b,reset:x}=await m({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,f={...f,[i]:{...f[i],...b}},x&&h<=50&&(h++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(c=!0===x.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:u,y:d}=Fo(c,p,l))),n=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};function Ai(e=0,t=0,n=0,r=0){if("function"==typeof DOMRect)return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return b(v({},o),{toJSON:()=>o})}function Di(e,t){return{contextElement:e||void 0,getBoundingClientRect:()=>{const n=e,r=null==t?void 0:t(n);return r||!n?function(e){if(!e)return Ai();const{x:t,y:n,width:r,height:o}=e;return Ai(t,n,r,o)}(r):n.getBoundingClientRect()}}}function zi(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function Oi(e){const t=window.devicePixelRatio||1;return Math.round(e*t)/t}function Li(e,t){return Vo((({placement:n})=>{var r;const o=((null==e?void 0:e.clientHeight)||0)/2,i="number"==typeof t.gutter?t.gutter+o:null!=(r=t.gutter)?r:o;return{crossAxis:!!n.split("-")[1]?void 0:t.shift,mainAxis:i,alignmentAxis:t.shift}}))}function Fi(e){if(!1===e.flip)return;const t="string"==typeof e.flip?e.flip.split(" "):void 0;return D(!t||t.every(zi),!1),Ni({padding:e.overflowPadding,fallbackPlacements:t})}function Bi(e){if(e.slide||e.overlap)return Pi({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Ri()})}function Vi(e){return Ti({padding:e.overflowPadding,apply({elements:t,availableWidth:n,availableHeight:r,rects:o}){const i=t.floating,s=Math.round(o.reference.width);n=Math.floor(n),r=Math.floor(r),i.style.setProperty("--popover-anchor-width",`${s}px`),i.style.setProperty("--popover-available-width",`${n}px`),i.style.setProperty("--popover-available-height",`${r}px`),e.sameWidth&&(i.style.width=`${s}px`),e.fitViewport&&(i.style.maxWidth=`${n}px`,i.style.maxHeight=`${r}px`)}})}function $i(e,t){if(e)return Ii({element:e,padding:t.arrowPadding})}var Hi=jt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,preserveTabOrder:i=!0,autoFocusOnShow:s=!0,wrapperProps:a,fixed:l=!1,flip:c=!0,shift:u=0,slide:d=!0,overlap:p=!1,sameWidth:f=!1,fitViewport:h=!1,gutter:m,arrowPadding:g=4,overflowPadding:y=8,getAnchorRect:w,updatePosition:_}=t,S=x(t,["store","modal","portal","preserveTabOrder","autoFocusOnShow","wrapperProps","fixed","flip","shift","slide","overlap","sameWidth","fitViewport","gutter","arrowPadding","overflowPadding","getAnchorRect","updatePosition"]);const C=mr();D(n=n||C,!1);const k=n.useState("arrowElement"),j=n.useState("anchorElement"),E=n.useState("disclosureElement"),P=n.useState("popoverElement"),N=n.useState("contentElement"),T=n.useState("placement"),I=n.useState("mounted"),R=n.useState("rendered"),M=(0,B.useRef)(null),[A,z]=(0,B.useState)(!1),{portalRef:O,domReady:L}=Ae(o,S.portalRef),F=ke(w),V=ke(_),$=!!_;_e((()=>{if(!(null==P?void 0:P.isConnected))return;P.style.setProperty("--popover-overflow-padding",`${y}px`);const e=Di(j,F),t=async()=>{if(!I)return;k||(M.current=M.current||document.createElement("div"));const t=k||M.current,r=[Li(t,{gutter:m,shift:u}),Fi({flip:c,overflowPadding:y}),Bi({slide:d,shift:u,overlap:p,overflowPadding:y}),$i(t,{arrowPadding:g}),Vi({sameWidth:f,fitViewport:h,overflowPadding:y})],o=await Mi(e,P,{placement:T,strategy:l?"fixed":"absolute",middleware:r});null==n||n.setState("currentPlacement",o.placement),z(!0);const i=Oi(o.x),s=Oi(o.y);if(Object.assign(P.style,{top:"0",left:"0",transform:`translate3d(${i}px,${s}px,0)`}),t&&o.middlewareData.arrow){const{x:e,y:n}=o.middlewareData.arrow,r=o.placement.split("-")[0],i=t.clientWidth/2,s=t.clientHeight/2,a=null!=e?e+i:-i,l=null!=n?n+s:-s;P.style.setProperty("--popover-transform-origin",{top:`${a}px calc(100% + ${s}px)`,bottom:`${a}px ${-s}px`,left:`calc(100% + ${i}px) ${l}px`,right:`${-i}px ${l}px`}[r]),Object.assign(t.style,{left:null!=e?`${e}px`:"",top:null!=n?`${n}px`:"",[r]:"100%"})}},r=Ei(e,P,(async()=>{$?(await V({updatePosition:t}),z(!0)):await t()}),{elementResize:"function"==typeof ResizeObserver});return()=>{z(!1),r()}}),[n,R,P,k,j,P,T,I,L,l,c,u,d,p,f,h,m,g,y,F,$,V]),_e((()=>{if(!I)return;if(!L)return;if(!(null==P?void 0:P.isConnected))return;if(!(null==N?void 0:N.isConnected))return;const e=()=>{P.style.zIndex=getComputedStyle(N).zIndex};e();let t=requestAnimationFrame((()=>{t=requestAnimationFrame(e)}));return()=>cancelAnimationFrame(t)}),[I,L,P,N]);const H=l?"fixed":"absolute";return S=Me(S,(e=>(0,_t.jsx)("div",b(v({},a),{style:v({position:H,top:0,left:0,width:"max-content"},null==a?void 0:a.style),ref:null==n?void 0:n.setPopoverElement,children:e}))),[n,H,a]),S=Me(S,(e=>(0,_t.jsx)(vr,{value:n,children:e})),[n]),S=b(v({"data-placing":!A||void 0},S),{style:v({position:"relative"},S.style)}),S=wo(b(v({store:n,modal:r,portal:o,preserveTabOrder:i,preserveTabOrderAnchor:E||j,autoFocusOnShow:A&&s},S),{portalRef:O}))}));_o(St((function(e){return kt("div",Hi(e))})),mr);function Wi(e,t,n,r){return!!Kt(t)||!!e&&(!!X(t,e)||(!(!n||!X(n,e))||!!(null==r?void 0:r.some((t=>Wi(e,t,n))))))}var Ui=(0,B.createContext)(null),Gi=jt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,hideOnEscape:i=!0,hideOnHoverOutside:s=!0,disablePointerEventsOnApproach:a=!!s}=t,l=x(t,["store","modal","portal","hideOnEscape","hideOnHoverOutside","disablePointerEventsOnApproach"]);const c=xr();D(n=n||c,!1);const u=(0,B.useRef)(null),[d,p]=(0,B.useState)([]),f=(0,B.useRef)(0),h=(0,B.useRef)(null),{portalRef:m,domReady:g}=Ae(o,l.portalRef),y=ze(),w=!!s,_=Re(s),S=!!a,C=Re(a),k=n.useState("open"),j=n.useState("mounted");(0,B.useEffect)((()=>{if(!g)return;if(!j)return;if(!w&&!S)return;const e=u.current;if(!e)return;return M(be("mousemove",(t=>{if(!n)return;if(!y())return;const{anchorElement:r,hideTimeout:o,timeout:i}=n.getState(),s=h.current,[a]=t.composedPath(),l=r;if(Wi(a,e,l,d))return h.current=a&&l&&X(l,a)?Tr(t):null,window.clearTimeout(f.current),void(f.current=0);if(!f.current){if(s){const n=Tr(t);if(Ir(n,Rr(e,s))){if(h.current=n,!C(t))return;return t.preventDefault(),void t.stopPropagation()}}_(t)&&(f.current=window.setTimeout((()=>{f.current=0,null==n||n.hide()}),null!=o?o:i))}}),!0),(()=>clearTimeout(f.current)))}),[n,y,g,j,w,S,d,C,_]),(0,B.useEffect)((()=>{if(!g)return;if(!j)return;if(!S)return;const e=e=>{const t=u.current;if(!t)return;const n=h.current;if(!n)return;const r=Rr(t,n);if(Ir(Tr(e),r)){if(!C(e))return;e.preventDefault(),e.stopPropagation()}};return M(be("mouseenter",e,!0),be("mouseover",e,!0),be("mouseout",e,!0),be("mouseleave",e,!0))}),[g,j,S,C]),(0,B.useEffect)((()=>{g&&(k||null==n||n.setAutoFocusOnShow(!1))}),[n,g,k]);const E=Ce(k);(0,B.useEffect)((()=>{if(g)return()=>{E.current||null==n||n.setAutoFocusOnShow(!1)}}),[n,g]);const P=(0,B.useContext)(Ui);_e((()=>{if(r)return;if(!o)return;if(!j)return;if(!g)return;const e=u.current;return e?null==P?void 0:P(e):void 0}),[r,o,j,g]);const N=(0,B.useCallback)((e=>{p((t=>[...t,e]));const t=null==P?void 0:P(e);return()=>{p((t=>t.filter((t=>t!==e)))),null==t||t()}}),[P]);l=Me(l,(e=>(0,_t.jsx)(wr,{value:n,children:(0,_t.jsx)(Ui.Provider,{value:N,children:e})})),[n,N]),l=b(v({},l),{ref:Ee(u,l.ref)}),l=function(e){var t=e,{store:n}=t,r=x(t,["store"]);const[o,i]=(0,B.useState)(!1),s=n.useState("mounted");(0,B.useEffect)((()=>{s||i(!1)}),[s]);const a=r.onFocus,l=ke((e=>{null==a||a(e),e.defaultPrevented||i(!0)})),c=(0,B.useRef)(null);return(0,B.useEffect)((()=>Ke(n,["anchorElement"],(e=>{c.current=e.anchorElement}))),[]),b(v({autoFocusOnHide:o,finalFocus:c},r),{onFocus:l})}(v({store:n},l));const T=n.useState((e=>r||e.autoFocusOnShow));return l=Hi(b(v({store:n,modal:r,portal:o,autoFocusOnShow:T},l),{portalRef:m,hideOnEscape:e=>!z(i,e)&&(requestAnimationFrame((()=>{requestAnimationFrame((()=>{null==n||n.hide()}))})),!0)}))})),Ki=(_o(St((function(e){return kt("div",Gi(e))})),xr),jt((function(e){var t=e,{store:n,portal:r=!0,gutter:o=8,preserveTabOrder:i=!1,hideOnHoverOutside:s=!0,hideOnInteractOutside:a=!0}=t,l=x(t,["store","portal","gutter","preserveTabOrder","hideOnHoverOutside","hideOnInteractOutside"]);const c=Cr();D(n=n||c,!1),l=Me(l,(e=>(0,_t.jsx)(kr,{value:n,children:e})),[n]);const u=n.useState((e=>"description"===e.type?"tooltip":"none"));return l=v({role:u},l),l=Gi(b(v({},l),{store:n,portal:r,gutter:o,preserveTabOrder:i,hideOnHoverOutside(e){if(z(s,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!("focusVisible"in t.dataset)},hideOnInteractOutside:e=>{if(z(a,e))return!1;const t=null==n?void 0:n.getState().anchorElement;return!t||!X(t,e.target)}}))}))),qi=_o(St((function(e){return kt("div",Ki(e))})),Cr);const Yi=window.wp.deprecated;var Xi=o.n(Yi);const Zi=function(e){const{shortcut:t,className:n}=e;if(!t)return null;let r,o;return"string"==typeof t&&(r=t),null!==t&&"object"==typeof t&&(r=t.display,o=t.ariaLabel),(0,_t.jsx)("span",{className:n,"aria-label":o,children:r})},Qi={bottom:"bottom",top:"top","middle left":"left","middle right":"right","bottom left":"bottom-end","bottom center":"bottom","bottom right":"bottom-start","top left":"top-end","top center":"top","top right":"top-start","middle left left":"left","middle left right":"left","middle left bottom":"left-end","middle left top":"left-start","middle right left":"right","middle right right":"right","middle right bottom":"right-end","middle right top":"right-start","bottom left left":"bottom-end","bottom left right":"bottom-end","bottom left bottom":"bottom-end","bottom left top":"bottom-end","bottom center left":"bottom","bottom center right":"bottom","bottom center bottom":"bottom","bottom center top":"bottom","bottom right left":"bottom-start","bottom right right":"bottom-start","bottom right bottom":"bottom-start","bottom right top":"bottom-start","top left left":"top-end","top left right":"top-end","top left bottom":"top-end","top left top":"top-end","top center left":"top","top center right":"top","top center bottom":"top","top center top":"top","top right left":"top-start","top right right":"top-start","top right bottom":"top-start","top right top":"top-start",middle:"bottom","middle center":"bottom","middle center bottom":"bottom","middle center left":"bottom","middle center right":"bottom","middle center top":"bottom"},Ji=e=>{var t;return null!==(t=Qi[e])&&void 0!==t?t:"bottom"},es={top:{originX:.5,originY:1},"top-start":{originX:0,originY:1},"top-end":{originX:1,originY:1},right:{originX:0,originY:.5},"right-start":{originX:0,originY:0},"right-end":{originX:0,originY:1},bottom:{originX:.5,originY:0},"bottom-start":{originX:0,originY:0},"bottom-end":{originX:1,originY:0},left:{originX:1,originY:.5},"left-start":{originX:1,originY:0},"left-end":{originX:1,originY:1},overlay:{originX:.5,originY:.5}};const ts=e=>null===e||Number.isNaN(e)?void 0:Math.round(e),ns=(0,c.createContext)({isNestedInTooltip:!1}),rs=700,os={isNestedInTooltip:!0};const is=(0,c.forwardRef)((function(e,t){const{children:n,className:r,delay:o=rs,hideOnClick:i=!0,placement:a,position:u,shortcut:d,text:p,...f}=e,{isNestedInTooltip:h}=(0,c.useContext)(ns),m=(0,l.useInstanceId)(is,"tooltip"),g=p||d?m:void 0,v=1===c.Children.count(n);let b;void 0!==a?b=a:void 0!==u&&(b=Ji(u),Xi()("`position` prop in wp.components.tooltip",{since:"6.4",alternative:"`placement` prop"})),b=b||"bottom";const x=rr({placement:b,showTimeout:o}),y=et(x,"mounted");return h?v?(0,_t.jsx)(or,{...f,render:n}):n:(0,_t.jsxs)(ns.Provider,{value:os,children:[(0,_t.jsx)(Nr,{onClick:i?x.hide:void 0,store:x,render:v?(w=n,g&&y&&void 0===w.props["aria-describedby"]&&w.props["aria-label"]!==p?(0,c.cloneElement)(w,{"aria-describedby":g}):w):void 0,ref:t,children:v?void 0:n}),v&&(p||d)&&(0,_t.jsxs)(qi,{...f,className:s("components-tooltip",r),unmountOnHide:!0,gutter:4,id:g,overflowPadding:.5,store:x,children:[p,d&&(0,_t.jsx)(Zi,{className:p?"components-tooltip__shortcut":"",shortcut:d})]})]});var w})),ss=is;window.wp.warning;var as=o(66),ls=o.n(as),cs=o(7734),us=o.n(cs); /*! * is-plain-object <https://github.com/jonschlinkert/is-plain-object> * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function ds(e){return"[object Object]"===Object.prototype.toString.call(e)}function ps(e){var t,n;return!1!==ds(e)&&(void 0===(t=e.constructor)||!1!==ds(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))}const fs=function(e,t){const n=(0,c.useRef)(!1);(0,c.useEffect)((()=>{if(n.current)return e();n.current=!0}),t),(0,c.useEffect)((()=>()=>{n.current=!1}),[])},hs=(0,c.createContext)({}),ms=()=>(0,c.useContext)(hs);const gs=(0,c.memo)((({children:e,value:t})=>{const n=function({value:e}){const t=ms(),n=(0,c.useRef)(e);return fs((()=>{us()(n.current,e)&&n.current}),[e]),(0,c.useMemo)((()=>ls()(null!=t?t:{},null!=e?e:{},{isMergeableObject:ps})),[t,e])}({value:t});return(0,_t.jsx)(hs.Provider,{value:n,children:e})})),vs="data-wp-component",bs="data-wp-c16t",xs="__contextSystemKey__";var ys=function(){return ys=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ys.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function ws(e){return e.toLowerCase()}var _s=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Ss=/[^A-Z0-9]+/gi;function Cs(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function ks(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,r=void 0===n?_s:n,o=t.stripRegexp,i=void 0===o?Ss:o,s=t.transform,a=void 0===s?ws:s,l=t.delimiter,c=void 0===l?" ":l,u=Cs(Cs(e,r,"$1\0$2"),i,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(a).join(c)}(e,ys({delimiter:"."},t))}function js(e,t){return void 0===t&&(t={}),ks(e,ys({delimiter:"-"},t))}function Es(e,t){var n,r,o=0;function i(){var i,s,a=n,l=arguments.length;e:for(;a;){if(a.args.length===arguments.length){for(s=0;s<l;s++)if(a.args[s]!==arguments[s]){a=a.next;continue e}return a!==n&&(a===r&&(r=a.prev),a.prev.next=a.next,a.next&&(a.next.prev=a.prev),a.next=n,a.prev=null,n.prev=a,n=a),a.val}a=a.next}for(i=new Array(l),s=0;s<l;s++)i[s]=arguments[s];return a={args:i,val:e.apply(null,i)},n?(n.prev=a,a.next=n):r=a,o===t.maxSize?(r=r.prev).next=null:o++,n=a,a.val}return t=t||{},i.clear=function(){n=null,r=null,o=0},i}const Ps=Es((function(e){return`components-${js(e)}`}));var Ns=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){0}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),Ts=Math.abs,Is=String.fromCharCode,Rs=Object.assign;function Ms(e){return e.trim()}function As(e,t,n){return e.replace(t,n)}function Ds(e,t){return e.indexOf(t)}function zs(e,t){return 0|e.charCodeAt(t)}function Os(e,t,n){return e.slice(t,n)}function Ls(e){return e.length}function Fs(e){return e.length}function Bs(e,t){return t.push(e),e}var Vs=1,$s=1,Hs=0,Ws=0,Us=0,Gs="";function Ks(e,t,n,r,o,i,s){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:Vs,column:$s,length:s,return:""}}function qs(e,t){return Rs(Ks("",null,null,"",null,null,0),e,{length:-e.length},t)}function Ys(){return Us=Ws>0?zs(Gs,--Ws):0,$s--,10===Us&&($s=1,Vs--),Us}function Xs(){return Us=Ws<Hs?zs(Gs,Ws++):0,$s++,10===Us&&($s=1,Vs++),Us}function Zs(){return zs(Gs,Ws)}function Qs(){return Ws}function Js(e,t){return Os(Gs,e,t)}function ea(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ta(e){return Vs=$s=1,Hs=Ls(Gs=e),Ws=0,[]}function na(e){return Gs="",e}function ra(e){return Ms(Js(Ws-1,sa(91===e?e+2:40===e?e+1:e)))}function oa(e){for(;(Us=Zs())&&Us<33;)Xs();return ea(e)>2||ea(Us)>3?"":" "}function ia(e,t){for(;--t&&Xs()&&!(Us<48||Us>102||Us>57&&Us<65||Us>70&&Us<97););return Js(e,Qs()+(t<6&&32==Zs()&&32==Xs()))}function sa(e){for(;Xs();)switch(Us){case e:return Ws;case 34:case 39:34!==e&&39!==e&&sa(Us);break;case 40:41===e&&sa(e);break;case 92:Xs()}return Ws}function aa(e,t){for(;Xs()&&e+Us!==57&&(e+Us!==84||47!==Zs()););return"/*"+Js(t,Ws-1)+"*"+Is(47===e?e:Xs())}function la(e){for(;!ea(Zs());)Xs();return Js(e,Ws)}var ca="-ms-",ua="-moz-",da="-webkit-",pa="comm",fa="rule",ha="decl",ma="@keyframes";function ga(e,t){for(var n="",r=Fs(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function va(e,t,n,r){switch(e.type){case"@import":case ha:return e.return=e.return||e.value;case pa:return"";case ma:return e.return=e.value+"{"+ga(e.children,r)+"}";case fa:e.value=e.props.join(",")}return Ls(n=ga(e.children,r))?e.return=e.value+"{"+n+"}":""}function ba(e){return na(xa("",null,null,null,[""],e=ta(e),0,[0],e))}function xa(e,t,n,r,o,i,s,a,l){for(var c=0,u=0,d=s,p=0,f=0,h=0,m=1,g=1,v=1,b=0,x="",y=o,w=i,_=r,S=x;g;)switch(h=b,b=Xs()){case 40:if(108!=h&&58==zs(S,d-1)){-1!=Ds(S+=As(ra(b),"&","&\f"),"&\f")&&(v=-1);break}case 34:case 39:case 91:S+=ra(b);break;case 9:case 10:case 13:case 32:S+=oa(h);break;case 92:S+=ia(Qs()-1,7);continue;case 47:switch(Zs()){case 42:case 47:Bs(wa(aa(Xs(),Qs()),t,n),l);break;default:S+="/"}break;case 123*m:a[c++]=Ls(S)*v;case 125*m:case 59:case 0:switch(b){case 0:case 125:g=0;case 59+u:f>0&&Ls(S)-d&&Bs(f>32?_a(S+";",r,n,d-1):_a(As(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(Bs(_=ya(S,t,n,c,u,o,a,x,y=[],w=[],d),i),123===b)if(0===u)xa(S,t,_,_,y,i,d,a,w);else switch(99===p&&110===zs(S,3)?100:p){case 100:case 109:case 115:xa(e,_,_,r&&Bs(ya(e,_,_,0,0,o,a,x,o,y=[],d),w),o,w,d,a,r?y:w);break;default:xa(S,_,_,_,[""],w,0,a,w)}}c=u=f=0,m=v=1,x=S="",d=s;break;case 58:d=1+Ls(S),f=h;default:if(m<1)if(123==b)--m;else if(125==b&&0==m++&&125==Ys())continue;switch(S+=Is(b),b*m){case 38:v=u>0?1:(S+="\f",-1);break;case 44:a[c++]=(Ls(S)-1)*v,v=1;break;case 64:45===Zs()&&(S+=ra(Xs())),p=Zs(),u=d=Ls(x=S+=la(Qs())),b++;break;case 45:45===h&&2==Ls(S)&&(m=0)}}return i}function ya(e,t,n,r,o,i,s,a,l,c,u){for(var d=o-1,p=0===o?i:[""],f=Fs(p),h=0,m=0,g=0;h<r;++h)for(var v=0,b=Os(e,d+1,d=Ts(m=s[h])),x=e;v<f;++v)(x=Ms(m>0?p[v]+" "+b:As(b,/&\f/g,p[v])))&&(l[g++]=x);return Ks(e,t,n,0===o?fa:a,l,c,u)}function wa(e,t,n){return Ks(e,t,n,pa,Is(Us),Os(e,2,-2),0)}function _a(e,t,n,r){return Ks(e,t,n,ha,Os(e,0,r),Os(e,r+1,-1),r)}var Sa=function(e,t,n){for(var r=0,o=0;r=o,o=Zs(),38===r&&12===o&&(t[n]=1),!ea(o);)Xs();return Js(e,Ws)},Ca=function(e,t){return na(function(e,t){var n=-1,r=44;do{switch(ea(r)){case 0:38===r&&12===Zs()&&(t[n]=1),e[n]+=Sa(Ws-1,t,n);break;case 2:e[n]+=ra(r);break;case 4:if(44===r){e[++n]=58===Zs()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Is(r)}}while(r=Xs());return e}(ta(e),t))},ka=new WeakMap,ja=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||ka.get(n))&&!r){ka.set(e,!0);for(var o=[],i=Ca(t,o),s=n.props,a=0,l=0;a<i.length;a++)for(var c=0;c<s.length;c++,l++)e.props[l]=o[a]?i[a].replace(/&\f/g,s[c]):s[c]+" "+i[a]}}},Ea=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Pa(e,t){switch(function(e,t){return 45^zs(e,0)?(((t<<2^zs(e,0))<<2^zs(e,1))<<2^zs(e,2))<<2^zs(e,3):0}(e,t)){case 5103:return da+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return da+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return da+e+ua+e+ca+e+e;case 6828:case 4268:return da+e+ca+e+e;case 6165:return da+e+ca+"flex-"+e+e;case 5187:return da+e+As(e,/(\w+).+(:[^]+)/,da+"box-$1$2"+ca+"flex-$1$2")+e;case 5443:return da+e+ca+"flex-item-"+As(e,/flex-|-self/,"")+e;case 4675:return da+e+ca+"flex-line-pack"+As(e,/align-content|flex-|-self/,"")+e;case 5548:return da+e+ca+As(e,"shrink","negative")+e;case 5292:return da+e+ca+As(e,"basis","preferred-size")+e;case 6060:return da+"box-"+As(e,"-grow","")+da+e+ca+As(e,"grow","positive")+e;case 4554:return da+As(e,/([^-])(transform)/g,"$1"+da+"$2")+e;case 6187:return As(As(As(e,/(zoom-|grab)/,da+"$1"),/(image-set)/,da+"$1"),e,"")+e;case 5495:case 3959:return As(e,/(image-set\([^]*)/,da+"$1$`$1");case 4968:return As(As(e,/(.+:)(flex-)?(.*)/,da+"box-pack:$3"+ca+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+da+e+e;case 4095:case 3583:case 4068:case 2532:return As(e,/(.+)-inline(.+)/,da+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ls(e)-1-t>6)switch(zs(e,t+1)){case 109:if(45!==zs(e,t+4))break;case 102:return As(e,/(.+:)(.+)-([^]+)/,"$1"+da+"$2-$3$1"+ua+(108==zs(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ds(e,"stretch")?Pa(As(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==zs(e,t+1))break;case 6444:switch(zs(e,Ls(e)-3-(~Ds(e,"!important")&&10))){case 107:return As(e,":",":"+da)+e;case 101:return As(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+da+(45===zs(e,14)?"inline-":"")+"box$3$1"+da+"$2$3$1"+ca+"$2box$3")+e}break;case 5936:switch(zs(e,t+11)){case 114:return da+e+ca+As(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return da+e+ca+As(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return da+e+ca+As(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return da+e+ca+e+e}return e}var Na=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case ha:e.return=Pa(e.value,e.length);break;case ma:return ga([qs(e,{value:As(e.value,"@","@"+da)})],r);case fa:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ga([qs(e,{props:[As(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return ga([qs(e,{props:[As(t,/:(plac\w+)/,":"+da+"input-$1")]}),qs(e,{props:[As(t,/:(plac\w+)/,":-moz-$1")]}),qs(e,{props:[As(t,/:(plac\w+)/,ca+"input-$1")]})],r)}return""}))}}];const Ta=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var r=e.stylisPlugins||Na;var o,i,s={},a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)s[t[n]]=!0;a.push(e)}));var l,c,u,d,p=[va,(d=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],f=(c=[ja,Ea].concat(r,p),u=Fs(c),function(e,t,n,r){for(var o="",i=0;i<u;i++)o+=c[i](e,t,n,r)||"";return o});i=function(e,t,n,r){l=n,function(e){ga(ba(e),f)}(e?e+"{"+t.styles+"}":t.styles),r&&(h.inserted[t.name]=!0)};var h={key:t,sheet:new Ns({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:i};return h.sheet.hydrate(a),h};const Ia=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)};const Ra={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Ma(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Aa=/[A-Z]|^ms/g,Da=/_EMO_([^_]+?)_([^]*?)_EMO_/g,za=function(e){return 45===e.charCodeAt(1)},Oa=function(e){return null!=e&&"boolean"!=typeof e},La=Ma((function(e){return za(e)?e:e.replace(Aa,"-$&").toLowerCase()})),Fa=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Da,(function(e,t,n){return Va={name:t,styles:n,next:Va},t}))}return 1===Ra[e]||za(e)||"number"!=typeof t||0===t?t:t+"px"};function Ba(e,t,n){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return Va={name:n.name,styles:n.styles,next:Va},n.name;if(void 0!==n.styles){var r=n.next;if(void 0!==r)for(;void 0!==r;)Va={name:r.name,styles:r.styles,next:Va},r=r.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Ba(e,t,n[o])+";";else for(var i in n){var s=n[i];if("object"!=typeof s)null!=t&&void 0!==t[s]?r+=i+"{"+t[s]+"}":Oa(s)&&(r+=La(i)+":"+Fa(i,s)+";");else if(!Array.isArray(s)||"string"!=typeof s[0]||null!=t&&void 0!==t[s[0]]){var a=Ba(e,t,s);switch(i){case"animation":case"animationName":r+=La(i)+":"+a+";";break;default:r+=i+"{"+a+"}"}}else for(var l=0;l<s.length;l++)Oa(s[l])&&(r+=La(i)+":"+Fa(i,s[l])+";")}return r}(e,t,n);case"function":if(void 0!==e){var o=Va,i=n(e);return Va=o,Ba(e,t,i)}}if(null==t)return n;var s=t[n];return void 0!==s?s:n}var Va,$a=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var Ha=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";Va=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=Ba(n,t,i)):o+=i[0];for(var s=1;s<e.length;s++)o+=Ba(n,t,e[s]),r&&(o+=i[s]);$a.lastIndex=0;for(var a,l="";null!==(a=$a.exec(o));)l+="-"+a[1];return{name:Ia(o)+l,styles:o,next:Va}},Wa=!!B.useInsertionEffect&&B.useInsertionEffect,Ua=Wa||function(e){return e()},Ga=(0,B.createContext)("undefined"!=typeof HTMLElement?Ta({key:"css"}):null);var Ka=Ga.Provider,qa=function(e){return(0,B.forwardRef)((function(t,n){var r=(0,B.useContext)(Ga);return e(t,r,n)}))},Ya=(0,B.createContext)({});function Xa(e,t,n){var r="";return n.split(" ").forEach((function(n){void 0!==e[n]?t.push(e[n]+";"):r+=n+" "})),r}var Za=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Qa=function(e,t,n){Za(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0);o=o.next}while(void 0!==o)}};function Ja(e,t){if(void 0===e.inserted[t.name])return e.insert("",t,e.sheet,!0)}function el(e,t,n){var r=[],o=Xa(e,r,n);return r.length<2?n:o+t(r)}var tl=function e(t){for(var n="",r=0;r<t.length;r++){var o=t[r];if(null!=o){var i=void 0;switch(typeof o){case"boolean":break;case"object":if(Array.isArray(o))i=e(o);else for(var s in i="",o)o[s]&&s&&(i&&(i+=" "),i+=s);break;default:i=o}i&&(n&&(n+=" "),n+=i)}}return n};const nl=function(e){var t=Ta(e);t.sheet.speedy=function(e){this.isSpeedy=e},t.compat=!0;var n=function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=Ha(n,t.registered,void 0);return Qa(t,o,!1),t.key+"-"+o.name};return{css:n,cx:function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return el(t.registered,n,tl(r))},injectGlobal:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=Ha(n,t.registered);Ja(t,o)},keyframes:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];var o=Ha(n,t.registered),i="animation-"+o.name;return Ja(t,{name:o.name,styles:"@keyframes "+i+"{"+o.styles+"}"}),i},hydrate:function(e){e.forEach((function(e){t.inserted[e]=!0}))},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:Xa.bind(null,t.registered),merge:el.bind(null,t.registered,n)}};var rl=nl({key:"css"}),ol=(rl.flush,rl.hydrate,rl.cx);rl.merge,rl.getRegisteredStyles,rl.injectGlobal,rl.keyframes,rl.css,rl.sheet,rl.cache;const il=()=>{const e=(0,B.useContext)(Ga),t=(0,c.useCallback)(((...t)=>{if(null===e)throw new Error("The `useCx` hook should be only used within a valid Emotion Cache Context");return ol(...t.map((t=>(e=>null!=e&&["name","styles"].every((t=>void 0!==e[t])))(t)?(Qa(e,t,!1),`${e.key}-${t.name}`):t)))}),[e]);return t};function sl(e,t){const n=ms(),r=n?.[t]||{},o={[bs]:!0,...(i=t,{[vs]:i})};var i;const{_overrides:s,...a}=r,l=Object.entries(a).length?Object.assign({},a,e):e,c=il()(Ps(t),e.className),u="function"==typeof l.renderChildren?l.renderChildren(l):l.children;for(const e in l)o[e]=l[e];for(const e in s)o[e]=s[e];return void 0!==u&&(o.children=u),o.className=c,o}function al(e,t){return cl(e,t,{forwardsRef:!0})}function ll(e,t){return cl(e,t)}function cl(e,t,n){const r=n?.forwardsRef?(0,c.forwardRef)(e):e;let o=r[xs]||[t];return Array.isArray(t)&&(o=[...o,...t]),"string"==typeof t&&(o=[...o,t]),Object.assign(r,{[xs]:[...new Set(o)],displayName:t,selector:`.${Ps(t)}`})}function ul(e){if(!e)return[];let t=[];return e[xs]&&(t=e[xs]),e.type&&e.type[xs]&&(t=e.type[xs]),t}function dl(e,t){return!!e&&("string"==typeof t?ul(e).includes(t):!!Array.isArray(t)&&t.some((t=>ul(e).includes(t))))}const pl={border:0,clip:"rect(1px, 1px, 1px, 1px)",WebkitClipPath:"inset( 50% )",clipPath:"inset( 50% )",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",wordWrap:"normal"};function fl(){return fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fl.apply(null,arguments)}var hl=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,ml=Ma((function(e){return hl.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91})),gl=function(e){return"theme"!==e},vl=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?ml:gl},bl=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},xl=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;Za(t,n,r);Ua((function(){return Qa(t,n,r)}));return null};const yl=function e(t,n){var r,o,i=t.__emotion_real===t,s=i&&t.__emotion_base||t;void 0!==n&&(r=n.label,o=n.target);var a=bl(t,n,i),l=a||vl(s),c=!l("as");return function(){var u=arguments,d=i&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==r&&d.push("label:"+r+";"),null==u[0]||void 0===u[0].raw)d.push.apply(d,u);else{0,d.push(u[0][0]);for(var p=u.length,f=1;f<p;f++)d.push(u[f],u[0][f])}var h=qa((function(e,t,n){var r=c&&e.as||s,i="",u=[],p=e;if(null==e.theme){for(var f in p={},e)p[f]=e[f];p.theme=(0,B.useContext)(Ya)}"string"==typeof e.className?i=Xa(t.registered,u,e.className):null!=e.className&&(i=e.className+" ");var h=Ha(d.concat(u),t.registered,p);i+=t.key+"-"+h.name,void 0!==o&&(i+=" "+o);var m=c&&void 0===a?vl(r):l,g={};for(var v in e)c&&"as"===v||m(v)&&(g[v]=e[v]);return g.className=i,g.ref=n,(0,B.createElement)(B.Fragment,null,(0,B.createElement)(xl,{cache:t,serialized:h,isStringTag:"string"==typeof r}),(0,B.createElement)(r,g))}));return h.displayName=void 0!==r?r:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",h.defaultProps=t.defaultProps,h.__emotion_real=h,h.__emotion_base=s,h.__emotion_styles=d,h.__emotion_forwardProp=a,Object.defineProperty(h,"toString",{value:function(){return"."+o}}),h.withComponent=function(t,r){return e(t,fl({},n,r,{shouldForwardProp:bl(h,r,!0)})).apply(void 0,d)},h}},wl=yl("div",{target:"e19lxcc00"})("");const _l=Object.assign((0,c.forwardRef)((function({as:e,...t},n){return(0,_t.jsx)(wl,{as:e,ref:n,...t})})),{selector:".components-view"});const Sl=al((function(e,t){const{style:n,...r}=sl(e,"VisuallyHidden");return(0,_t.jsx)(_l,{ref:t,...r,style:{...pl,...n||{}}})}),"VisuallyHidden"),Cl=[["top left","top center","top right"],["center left","center center","center right"],["bottom left","bottom center","bottom right"]],kl={"top left":(0,a.__)("Top Left"),"top center":(0,a.__)("Top Center"),"top right":(0,a.__)("Top Right"),"center left":(0,a.__)("Center Left"),"center center":(0,a.__)("Center"),center:(0,a.__)("Center"),"center right":(0,a.__)("Center Right"),"bottom left":(0,a.__)("Bottom Left"),"bottom center":(0,a.__)("Bottom Center"),"bottom right":(0,a.__)("Bottom Right")},jl=Cl.flat();function El(e){const t="center"===e?"center center":e,n=t?.replace("-"," ");return jl.includes(n)?n:void 0}function Pl(e,t){const n=El(t);if(!n)return;return`${e}-${n.replace(" ","-")}`}o(1880);function Nl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ha(t)}var Tl=function(){var e=Nl.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};function Il(e){if(void 0===e)return;if(!e)return"0";const t="number"==typeof e?e:Number(e);return"undefined"!=typeof window&&window.CSS?.supports?.("margin",e.toString())||Number.isNaN(t)?e.toString():`calc(4px * ${e})`}const Rl="#fff",Ml={900:"#1e1e1e",800:"#2f2f2f",700:"#757575",600:"#949494",400:"#ccc",300:"#ddd",200:"#e0e0e0",100:"#f0f0f0"},Al={accent:"var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9))",accentDarker10:"var(--wp-components-color-accent-darker-10, var(--wp-admin-theme-color-darker-10, #2145e6))",accentDarker20:"var(--wp-components-color-accent-darker-20, var(--wp-admin-theme-color-darker-20, #183ad6))",accentInverted:`var(--wp-components-color-accent-inverted, ${Rl})`,background:`var(--wp-components-color-background, ${Rl})`,foreground:`var(--wp-components-color-foreground, ${Ml[900]})`,foregroundInverted:`var(--wp-components-color-foreground-inverted, ${Rl})`,gray:{900:`var(--wp-components-color-foreground, ${Ml[900]})`,800:`var(--wp-components-color-gray-800, ${Ml[800]})`,700:`var(--wp-components-color-gray-700, ${Ml[700]})`,600:`var(--wp-components-color-gray-600, ${Ml[600]})`,400:`var(--wp-components-color-gray-400, ${Ml[400]})`,300:`var(--wp-components-color-gray-300, ${Ml[300]})`,200:`var(--wp-components-color-gray-200, ${Ml[200]})`,100:`var(--wp-components-color-gray-100, ${Ml[100]})`}},Dl={background:Al.background,backgroundDisabled:Al.gray[100],border:Al.gray[600],borderHover:Al.gray[700],borderFocus:Al.accent,borderDisabled:Al.gray[400],textDisabled:Al.gray[600],darkGrayPlaceholder:`color-mix(in srgb, ${Al.foreground}, transparent 38%)`,lightGrayPlaceholder:`color-mix(in srgb, ${Al.background}, transparent 35%)`},zl=Object.freeze({gray:Ml,white:Rl,alert:{yellow:"#f0b849",red:"#d94f4f",green:"#4ab866"},theme:Al,ui:Dl}),Ol="36px",Ll={controlPaddingX:12,controlPaddingXSmall:8,controlPaddingXLarge:12*1.3334,controlBoxShadowFocus:`0 0 0 0.5px ${zl.theme.accent}`,controlHeight:Ol,controlHeightXSmall:`calc( ${Ol} * 0.6 )`,controlHeightSmall:`calc( ${Ol} * 0.8 )`,controlHeightLarge:`calc( ${Ol} * 1.2 )`,controlHeightXLarge:`calc( ${Ol} * 1.4 )`},Fl=Object.assign({},Ll,{colorDivider:"rgba(0, 0, 0, 0.1)",colorScrollbarThumb:"rgba(0, 0, 0, 0.2)",colorScrollbarThumbHover:"rgba(0, 0, 0, 0.5)",colorScrollbarTrack:"rgba(0, 0, 0, 0.04)",elevationIntensity:1,radiusXSmall:"1px",radiusSmall:"2px",radiusMedium:"4px",radiusLarge:"8px",radiusFull:"9999px",radiusRound:"50%",borderWidth:"1px",borderWidthFocus:"1.5px",borderWidthTab:"4px",spinnerSize:16,fontSize:"13px",fontSizeH1:"calc(2.44 * 13px)",fontSizeH2:"calc(1.95 * 13px)",fontSizeH3:"calc(1.56 * 13px)",fontSizeH4:"calc(1.25 * 13px)",fontSizeH5:"13px",fontSizeH6:"calc(0.8 * 13px)",fontSizeInputMobile:"16px",fontSizeMobile:"15px",fontSizeSmall:"calc(0.92 * 13px)",fontSizeXSmall:"calc(0.75 * 13px)",fontLineHeightBase:"1.4",fontWeight:"normal",fontWeightHeading:"600",gridBase:"4px",cardPaddingXSmall:`${Il(2)}`,cardPaddingSmall:`${Il(4)}`,cardPaddingMedium:`${Il(4)} ${Il(6)}`,cardPaddingLarge:`${Il(6)} ${Il(8)}`,elevationXSmall:"0 1px 1px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02), 0 3px 3px rgba(0, 0, 0, 0.02), 0 4px 4px rgba(0, 0, 0, 0.01)",elevationSmall:"0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.04), 0 6px 6px rgba(0, 0, 0, 0.03), 0 8px 8px rgba(0, 0, 0, 0.02)",elevationMedium:"0 2px 3px rgba(0, 0, 0, 0.05), 0 4px 5px rgba(0, 0, 0, 0.04), 0 12px 12px rgba(0, 0, 0, 0.03), 0 16px 16px rgba(0, 0, 0, 0.02)",elevationLarge:"0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 27px rgba(0, 0, 0, 0.07), 0 30px 36px rgba(0, 0, 0, 0.04), 0 50px 43px rgba(0, 0, 0, 0.02)",surfaceBackgroundColor:zl.white,surfaceBackgroundSubtleColor:"#F3F3F3",surfaceBackgroundTintColor:"#F5F5F5",surfaceBorderColor:"rgba(0, 0, 0, 0.1)",surfaceBorderBoldColor:"rgba(0, 0, 0, 0.15)",surfaceBorderSubtleColor:"rgba(0, 0, 0, 0.05)",surfaceBackgroundTertiaryColor:zl.white,surfaceColor:zl.white,transitionDuration:"200ms",transitionDurationFast:"160ms",transitionDurationFaster:"120ms",transitionDurationFastest:"100ms",transitionTimingFunction:"cubic-bezier(0.08, 0.52, 0.52, 1)",transitionTimingFunctionControl:"cubic-bezier(0.12, 0.8, 0.32, 1)"});const Bl=({size:e=92})=>Nl("direction:ltr;display:grid;grid-template-columns:repeat( 3, 1fr );grid-template-rows:repeat( 3, 1fr );box-sizing:border-box;width:",e,"px;aspect-ratio:1;border-radius:",Fl.radiusMedium,";outline:none;","");var Vl={name:"e0dnmk",styles:"cursor:pointer"};const $l=yl("div",{target:"e1r95csn3"})(Bl," border:1px solid transparent;",(e=>e.disablePointerEvents?Nl("",""):Vl),";"),Hl=yl("div",{target:"e1r95csn2"})({name:"1fbxn64",styles:"grid-column:1/-1;box-sizing:border-box;display:grid;grid-template-columns:repeat( 3, 1fr )"}),Wl=yl("span",{target:"e1r95csn1"})({name:"e2kws5",styles:"position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;appearance:none;border:none;outline:none"}),Ul=yl("span",{target:"e1r95csn0"})("display:block;contain:strict;box-sizing:border-box;width:",6,"px;aspect-ratio:1;margin:auto;color:",zl.theme.gray[400],";border:",3,"px solid currentColor;",Wl,"[data-active-item] &{color:",zl.gray[900],";transform:scale( calc( 5 / 3 ) );}",Wl,":not([data-active-item]):hover &{color:",zl.theme.accent,";}",Wl,"[data-focus-visible] &{outline:1px solid ",zl.theme.accent,";outline-offset:1px;}@media not ( prefers-reduced-motion ){transition-property:color,transform;transition-duration:120ms;transition-timing-function:linear;}");function Gl({id:e,value:t,...n}){return(0,_t.jsx)(ss,{text:kl[t],children:(0,_t.jsxs)(Gn.Item,{id:e,render:(0,_t.jsx)(Wl,{...n,role:"gridcell"}),children:[(0,_t.jsx)(Sl,{children:t}),(0,_t.jsx)(Ul,{role:"presentation"})]})})}const Kl=function({className:e,disablePointerEvents:t=!0,size:r,width:o,height:i,style:a={},value:l="center",...c}){var u,d;return(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:null!==(u=null!=r?r:o)&&void 0!==u?u:24,height:null!==(d=null!=r?r:i)&&void 0!==d?d:24,role:"presentation",className:s("component-alignment-matrix-control-icon",e),style:{pointerEvents:t?"none":void 0,...a},...c,children:jl.map(((e,t)=>{const r=function(e="center"){const t=El(e);if(!t)return;const n=jl.indexOf(t);return n>-1?n:void 0}(l)===t?4:2;return(0,_t.jsx)(n.Rect,{x:1.5+t%3*7+(7-r)/2,y:1.5+7*Math.floor(t/3)+(7-r)/2,width:r,height:r,fill:"currentColor"},e)}))})};const ql=Object.assign((function e({className:t,id:n,label:r=(0,a.__)("Alignment Matrix Control"),defaultValue:o="center center",value:i,onChange:u,width:d=92,...p}){const f=(0,l.useInstanceId)(e,"alignment-matrix-control",n),h=(0,c.useCallback)((e=>{const t=function(e,t){const n=t?.replace(e+"-","");return El(n)}(f,e);t&&u?.(t)}),[f,u]),m=s("component-alignment-matrix-control",t);return(0,_t.jsx)(Gn,{defaultActiveId:Pl(f,o),activeId:Pl(f,i),setActiveId:h,rtl:(0,a.isRTL)(),render:(0,_t.jsx)($l,{...p,"aria-label":r,className:m,id:f,role:"grid",size:d}),children:Cl.map(((e,t)=>(0,_t.jsx)(Gn.Row,{render:(0,_t.jsx)(Hl,{role:"row"}),children:e.map((e=>(0,_t.jsx)(Gl,{id:Pl(f,e),value:e},e)))},t)))})}),{Icon:Object.assign(Kl,{displayName:"AlignmentMatrixControl.Icon"})}),Yl=ql;function Xl(e){return"appear"===e?"top":"left"}function Zl(e){if("loading"===e.type)return"components-animate__loading";const{type:t,origin:n=Xl(t)}=e;if("appear"===t){const[e,t="center"]=n.split(" ");return s("components-animate__appear",{["is-from-"+t]:"center"!==t,["is-from-"+e]:"middle"!==e})}return"slide-in"===t?s("components-animate__slide-in","is-from-"+n):void 0}const Ql=function({type:e,options:t={},children:n}){return n({className:Zl({type:e,...t})})},Jl=(0,B.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),ec=(0,B.createContext)({}),tc=(0,B.createContext)(null),nc="undefined"!=typeof document,rc=nc?B.useLayoutEffect:B.useEffect,oc=(0,B.createContext)({strict:!1}),ic=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),sc="data-"+ic("framerAppearId"),ac=!1,lc=!1;class cc{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}const uc=["read","resolveKeyframes","update","preRender","render","postRender"];function dc(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=uc.reduce(((e,t)=>(e[t]=function(e){let t=new cc,n=new cc,r=0,o=!1,i=!1;const s=new WeakSet,a={schedule:(e,i=!1,a=!1)=>{const l=a&&o,c=l?t:n;return i&&s.add(e),c.add(e)&&l&&o&&(r=t.order.length),e},cancel:e=>{n.remove(e),s.delete(e)},process:l=>{if(o)i=!0;else{if(o=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let n=0;n<r;n++){const r=t.order[n];s.has(r)&&(a.schedule(r),e()),r(l)}o=!1,i&&(i=!1,a.process(l))}}};return a}((()=>n=!0)),e)),{}),s=e=>{i[e].process(o)},a=()=>{const i=lc?o.timestamp:performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(i-o.timestamp,40),1),o.timestamp=i,o.isProcessing=!0,uc.forEach(s),o.isProcessing=!1,n&&t&&(r=!1,e(a))};return{schedule:uc.reduce(((t,s)=>{const l=i[s];return t[s]=(t,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||e(a)),l.schedule(t,i,s)),t}),{}),cancel:e=>uc.forEach((t=>i[t].cancel(e))),state:o,steps:i}}const{schedule:pc,cancel:fc}=dc(queueMicrotask,!1);function hc(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function mc(e,t,n){return(0,B.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):hc(n)&&(n.current=r))}),[t])}function gc(e){return"string"==typeof e||Array.isArray(e)}function vc(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const bc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],xc=["initial",...bc];function yc(e){return vc(e.animate)||xc.some((t=>gc(e[t])))}function wc(e){return Boolean(yc(e)||e.variants)}function _c(e){const{initial:t,animate:n}=function(e,t){if(yc(e)){const{initial:t,animate:n}=e;return{initial:!1===t||gc(t)?t:void 0,animate:gc(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,B.useContext)(ec));return(0,B.useMemo)((()=>({initial:t,animate:n})),[Sc(t),Sc(n)])}function Sc(e){return Array.isArray(e)?e.join(" "):e}const Cc={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},kc={};for(const e in Cc)kc[e]={isEnabled:t=>Cc[e].some((e=>!!t[e]))};const jc=(0,B.createContext)({}),Ec=(0,B.createContext)({}),Pc=Symbol.for("motionComponentSymbol");function Nc({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&function(e){for(const t in e)kc[t]={...kc[t],...e[t]}}(e);const i=(0,B.forwardRef)((function(i,s){let a;const l={...(0,B.useContext)(Jl),...i,layoutId:Tc(i)},{isStatic:c}=l,u=_c(i),d=r(i,c);if(!c&&nc){u.visualElement=function(e,t,n,r){const{visualElement:o}=(0,B.useContext)(ec),i=(0,B.useContext)(oc),s=(0,B.useContext)(tc),a=(0,B.useContext)(Jl).reducedMotion,l=(0,B.useRef)();r=r||i.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:o,props:n,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:a}));const c=l.current;(0,B.useInsertionEffect)((()=>{c&&c.update(n,s)}));const u=(0,B.useRef)(Boolean(n[sc]&&!window.HandoffComplete));return rc((()=>{c&&(pc.render(c.render),u.current&&c.animationState&&c.animationState.animateChanges())})),(0,B.useEffect)((()=>{c&&(c.updateFeatures(),!u.current&&c.animationState&&c.animationState.animateChanges(),u.current&&(u.current=!1,window.HandoffComplete=!0))})),c}(o,d,l,t);const n=(0,B.useContext)(Ec),r=(0,B.useContext)(oc).strict;u.visualElement&&(a=u.visualElement.loadFeatures(l,r,e,n))}return(0,_t.jsxs)(ec.Provider,{value:u,children:[a&&u.visualElement?(0,_t.jsx)(a,{visualElement:u.visualElement,...l}):null,n(o,i,mc(d,u.visualElement,s),d,c,u.visualElement)]})}));return i[Pc]=o,i}function Tc({layoutId:e}){const t=(0,B.useContext)(jc).id;return t&&void 0!==e?t+"-"+e:e}function Ic(e){function t(t,n={}){return Nc(e(t,n))}if("undefined"==typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}const Rc=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Mc(e){return"string"==typeof e&&!e.includes("-")&&!!(Rc.indexOf(e)>-1||/[A-Z]/u.test(e))}const Ac={};const Dc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zc=new Set(Dc);function Oc(e,{layout:t,layoutId:n}){return zc.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!Ac[e]||"opacity"===e)}const Lc=e=>Boolean(e&&e.getVelocity),Fc={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bc=Dc.length;const Vc=e=>t=>"string"==typeof t&&t.startsWith(e),$c=Vc("--"),Hc=Vc("var(--"),Wc=e=>!!Hc(e)&&Uc.test(e.split("/*")[0].trim()),Uc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Gc=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Kc=(e,t,n)=>n>t?t:n<e?e:n,qc={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Yc={...qc,transform:e=>Kc(0,1,e)},Xc={...qc,default:1},Zc=e=>Math.round(1e5*e)/1e5,Qc=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Jc=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,eu=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function tu(e){return"string"==typeof e}const nu=e=>({test:t=>tu(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ru=nu("deg"),ou=nu("%"),iu=nu("px"),su=nu("vh"),au=nu("vw"),lu={...ou,parse:e=>ou.parse(e)/100,transform:e=>ou.transform(100*e)},cu={...qc,transform:Math.round},uu={borderWidth:iu,borderTopWidth:iu,borderRightWidth:iu,borderBottomWidth:iu,borderLeftWidth:iu,borderRadius:iu,radius:iu,borderTopLeftRadius:iu,borderTopRightRadius:iu,borderBottomRightRadius:iu,borderBottomLeftRadius:iu,width:iu,maxWidth:iu,height:iu,maxHeight:iu,size:iu,top:iu,right:iu,bottom:iu,left:iu,padding:iu,paddingTop:iu,paddingRight:iu,paddingBottom:iu,paddingLeft:iu,margin:iu,marginTop:iu,marginRight:iu,marginBottom:iu,marginLeft:iu,rotate:ru,rotateX:ru,rotateY:ru,rotateZ:ru,scale:Xc,scaleX:Xc,scaleY:Xc,scaleZ:Xc,skew:ru,skewX:ru,skewY:ru,distance:iu,translateX:iu,translateY:iu,translateZ:iu,x:iu,y:iu,z:iu,perspective:iu,transformPerspective:iu,opacity:Yc,originX:lu,originY:lu,originZ:iu,zIndex:cu,backgroundPositionX:iu,backgroundPositionY:iu,fillOpacity:Yc,strokeOpacity:Yc,numOctaves:cu};function du(e,t,n,r){const{style:o,vars:i,transform:s,transformOrigin:a}=e;let l=!1,c=!1,u=!0;for(const e in t){const n=t[e];if($c(e)){i[e]=n;continue}const r=uu[e],d=Gc(n,r);if(zc.has(e)){if(l=!0,s[e]=d,!u)continue;n!==(r.default||0)&&(u=!1)}else e.startsWith("origin")?(c=!0,a[e]=d):o[e]=d}if(t.transform||(l||r?o.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,o){let i="";for(let t=0;t<Bc;t++){const n=Dc[t];void 0!==e[n]&&(i+=`${Fc[n]||n}(${e[n]}) `)}return t&&!e.z&&(i+="translateZ(0)"),i=i.trim(),o?i=o(e,r?"":i):n&&r&&(i="none"),i}(e.transform,n,u,r):o.transform&&(o.transform="none")),c){const{originX:e="50%",originY:t="50%",originZ:n=0}=a;o.transformOrigin=`${e} ${t} ${n}`}}const pu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fu(e,t,n){for(const r in t)Lc(t[r])||Oc(r,n)||(e[r]=t[r])}function hu(e,t,n){const r={};return fu(r,e.style||{},e),Object.assign(r,function({transformTemplate:e},t,n){return(0,B.useMemo)((()=>{const r={style:{},transform:{},transformOrigin:{},vars:{}};return du(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)}),[t])}(e,t,n)),r}function mu(e,t,n){const r={},o=hu(e,t,n);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=o,r}const gu=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function vu(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||gu.has(e)}let bu=e=>!vu(e);try{(xu=require("@emotion/is-prop-valid").default)&&(bu=e=>e.startsWith("on")?!vu(e):xu(e))}catch(U){}var xu;function yu(e,t,n){return"string"==typeof e?e:iu.transform(t+n*e)}const wu={offset:"stroke-dashoffset",array:"stroke-dasharray"},_u={offset:"strokeDashoffset",array:"strokeDasharray"};function Su(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...c},u,d,p){if(du(e,c,u,p),d)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:h,dimensions:m}=e;f.transform&&(m&&(h.transform=f.transform),delete f.transform),m&&(void 0!==o||void 0!==i||h.transform)&&(h.transformOrigin=function(e,t,n){return`${yu(t,e.x,e.width)} ${yu(n,e.y,e.height)}`}(m,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==s&&function(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?wu:_u;e[i.offset]=iu.transform(-r);const s=iu.transform(t),a=iu.transform(n);e[i.array]=`${s} ${a}`}(f,s,a,l,!1)}const Cu=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),ku=e=>"string"==typeof e&&"svg"===e.toLowerCase();function ju(e,t,n,r){const o=(0,B.useMemo)((()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Su(n,t,{enableHardwareAcceleration:!1},ku(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};fu(t,e.style,e),o.style={...t,...o.style}}return o}function Eu(e=!1){return(t,n,r,{latestValues:o},i)=>{const s=(Mc(t)?ju:mu)(n,o,i,t),a=function(e,t,n){const r={};for(const o in e)"values"===o&&"object"==typeof e.values||(bu(o)||!0===n&&vu(o)||!t&&!vu(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}(n,"string"==typeof t,e),l=t!==B.Fragment?{...a,...s,ref:r}:{},{children:c}=n,u=(0,B.useMemo)((()=>Lc(c)?c.get():c),[c]);return(0,B.createElement)(t,{...l,children:u})}}function Pu(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const Nu=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Tu(e,t,n,r){Pu(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(Nu.has(n)?n:ic(n),t.attrs[n])}function Iu(e,t,n){var r;const{style:o}=e,i={};for(const s in o)(Lc(o[s])||t.style&&Lc(t.style[s])||Oc(s,e)||void 0!==(null===(r=null==n?void 0:n.getValue(s))||void 0===r?void 0:r.liveStyle))&&(i[s]=o[s]);return i}function Ru(e,t,n){const r=Iu(e,t,n);for(const n in e)if(Lc(e[n])||Lc(t[n])){r[-1!==Dc.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]}return r}function Mu(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function Au(e,t,n,r){if("function"==typeof t){const[o,i]=Mu(r);t=t(void 0!==n?n:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,i]=Mu(r);t=t(void 0!==n?n:e.custom,o,i)}return t}function Du(e){const t=(0,B.useRef)(null);return null===t.current&&(t.current=e()),t.current}const zu=e=>Array.isArray(e),Ou=e=>zu(e)?e[e.length-1]||0:e;function Lu(e){const t=Lc(e)?e.get():e;return(e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const Fu=e=>(t,n)=>{const r=(0,B.useContext)(ec),o=(0,B.useContext)(tc),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,o,i){const s={latestValues:Bu(r,o,i,e),renderState:t()};return n&&(s.mount=e=>n(r,e,s)),s}(e,t,r,o);return n?i():Du(i)};function Bu(e,t,n,r){const o={},i=r(e,{});for(const e in i)o[e]=Lu(i[e]);let{initial:s,animate:a}=e;const l=yc(e),c=wc(e);t&&c&&!l&&!1!==e.inherit&&(void 0===s&&(s=t.initial),void 0===a&&(a=t.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!=typeof d&&!vc(d)){(Array.isArray(d)?d:[d]).forEach((t=>{const n=Au(e,t);if(!n)return;const{transitionEnd:r,transition:i,...s}=n;for(const e in s){let t=s[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(o[e]=t)}for(const e in r)o[e]=r[e]}))}return o}const Vu=e=>e,{schedule:$u,cancel:Hu,state:Wu,steps:Uu}=dc("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Vu,!0),Gu={useVisualState:Fu({scrapeMotionValuesFromProps:Ru,createRenderState:Cu,onMount:(e,t,{renderState:n,latestValues:r})=>{$u.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),$u.render((()=>{Su(n,r,{enableHardwareAcceleration:!1},ku(t.tagName),e.transformTemplate),Tu(t,n)}))}})},Ku={useVisualState:Fu({scrapeMotionValuesFromProps:Iu,createRenderState:pu})};function qu(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const Yu=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function Xu(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}function Zu(e,t,n,r){return qu(e,t,(e=>t=>Yu(t)&&e(t,Xu(t)))(n),r)}const Qu=(e,t)=>n=>t(e(n)),Ju=(...e)=>e.reduce(Qu);function ed(e){let t=null;return()=>{const n=()=>{t=null};return null===t&&(t=e,n)}}const td=ed("dragHorizontal"),nd=ed("dragVertical");function rd(e){let t=!1;if("y"===e)t=nd();else if("x"===e)t=td();else{const e=td(),n=nd();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function od(){const e=rd(!0);return!e||(e(),!1)}class id{constructor(e){this.isMounted=!1,this.node=e}update(){}}function sd(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return Zu(e.current,n,((n,o)=>{if("touch"===n.pointerType||od())return;const i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);const s=i[r];s&&$u.postRender((()=>s(n,o)))}),{passive:!e.getProps()[r]})}const ad=(e,t)=>!!t&&(e===t||ad(e,t.parentElement));function ld(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Xu(n))}const cd=new WeakMap,ud=new WeakMap,dd=e=>{const t=cd.get(e.target);t&&t(e)},pd=e=>{e.forEach(dd)};function fd(e,t,n){const r=function({root:e,...t}){const n=e||document;ud.has(n)||ud.set(n,{});const r=ud.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(pd,{root:e,...t})),r[o]}(t);return cd.set(e,n),r.observe(e),()=>{cd.delete(e),r.unobserve(e)}}const hd={some:0,all:1};const md={inView:{Feature:class extends id{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:hd[r]};return fd(this.node.current,i,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,o&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=t?n:r;i&&i(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends id{constructor(){super(...arguments),this.removeStartListeners=Vu,this.removeEndListeners=Vu,this.removeAccessibleListeners=Vu,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=Zu(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:o}=this.node.getProps(),i=o||ad(this.node.current,e.target)?n:r;i&&$u.update((()=>i(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),o=Zu(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=Ju(r,o),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=qu(this.node.current,"keydown",(e=>{if("Enter"!==e.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=qu(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&ld("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&$u.postRender((()=>n(e,t)))}))})),ld("down",((e,t)=>{this.startPress(e,t)}))})),t=qu(this.node.current,"blur",(()=>{this.isPressing&&ld("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=Ju(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&$u.postRender((()=>n(e,t)))}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!od()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&$u.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=Zu(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=qu(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Ju(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends id{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Ju(qu(this.node.current,"focus",(()=>this.onFocus())),qu(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends id{mount(){this.unmount=Ju(sd(this.node,!0),sd(this.node,!1))}unmount(){}}}};function gd(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function vd(e,t,n){const r=e.getProps();return Au(r,t,void 0!==n?n:r.custom,e)}const bd=e=>1e3*e,xd=e=>e/1e3,yd={type:"spring",stiffness:500,damping:25,restSpeed:10},wd={type:"keyframes",duration:.8},_d={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Sd=(e,{keyframes:t})=>t.length>2?wd:zc.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:yd:_d;function Cd(e,t){return e[t]||e.default||e}const kd=!1,jd=e=>null!==e;function Ed(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(jd),i=t&&"loop"!==n&&t%2==1?0:o.length-1;return i&&void 0!==r?r:o[i]}let Pd;function Nd(){Pd=void 0}const Td={now:()=>(void 0===Pd&&Td.set(Wu.isProcessing||lc?Wu.timestamp:performance.now()),Pd),set:e=>{Pd=e,queueMicrotask(Nd)}},Id=e=>/^0[^.\s]+$/u.test(e);let Rd=Vu,Md=Vu;const Ad=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Dd=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zd(e,t,n=1){Md(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=function(e){const t=Dd.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${null!=n?n:r}`,o]}(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const e=i.trim();return Ad(e)?parseFloat(e):e}return Wc(o)?zd(o,t,n+1):o}const Od=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Ld=e=>e===qc||e===iu,Fd=(e,t)=>parseFloat(e.split(", ")[t]),Bd=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/u);if(o)return Fd(o[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Fd(t[1],e):0}},Vd=new Set(["x","y","z"]),$d=Dc.filter((e=>!Vd.has(e)));const Hd={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Bd(4,13),y:Bd(5,14)};Hd.translateX=Hd.x,Hd.translateY=Hd.y;const Wd=e=>t=>t.test(e),Ud=[qc,iu,ou,ru,au,su,{test:e=>"auto"===e,parse:e=>e}],Gd=e=>Ud.find(Wd(e)),Kd=new Set;let qd=!1,Yd=!1;function Xd(){if(Yd){const e=Array.from(Kd).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return $d.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}Yd=!1,qd=!1,Kd.forEach((e=>e.complete())),Kd.clear()}function Zd(){Kd.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(Yd=!0)}))}class Qd{constructor(e,t,n,r,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Kd.add(this),qd||(qd=!0,$u.read(Zd),$u.resolveKeyframes(Xd))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==r?void 0:r.get(),i=e[e.length-1];if(void 0!==o)e[0]=o;else if(n&&t){const r=n.readValue(t,i);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=i),r&&void 0===o&&r.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Kd.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Kd.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Jd=(e,t)=>n=>Boolean(tu(n)&&eu.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),ep=(e,t,n)=>r=>{if(!tu(r))return r;const[o,i,s,a]=r.match(Qc);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},tp={...qc,transform:e=>Math.round((e=>Kc(0,255,e))(e))},np={test:Jd("rgb","red"),parse:ep("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+tp.transform(e)+", "+tp.transform(t)+", "+tp.transform(n)+", "+Zc(Yc.transform(r))+")"};const rp={test:Jd("#"),parse:function(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:np.transform},op={test:Jd("hsl","hue"),parse:ep("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+ou.transform(Zc(t))+", "+ou.transform(Zc(n))+", "+Zc(Yc.transform(r))+")"},ip={test:e=>np.test(e)||rp.test(e)||op.test(e),parse:e=>np.test(e)?np.parse(e):op.test(e)?op.parse(e):rp.parse(e),transform:e=>tu(e)?e:e.hasOwnProperty("red")?np.transform(e):op.transform(e)};const sp="number",ap="color",lp=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function cp(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const s=t.replace(lp,(e=>(ip.test(e)?(r.color.push(i),o.push(ap),n.push(ip.parse(e))):e.startsWith("var(")?(r.var.push(i),o.push("var"),n.push(e)):(r.number.push(i),o.push(sp),n.push(parseFloat(e))),++i,"${}"))).split("${}");return{values:n,split:s,indexes:r,types:o}}function up(e){return cp(e).values}function dp(e){const{split:t,types:n}=cp(e),r=t.length;return e=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],void 0!==e[i]){const t=n[i];o+=t===sp?Zc(e[i]):t===ap?ip.transform(e[i]):e[i]}return o}}const pp=e=>"number"==typeof e?0:e;const fp={test:function(e){var t,n;return isNaN(e)&&tu(e)&&((null===(t=e.match(Qc))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(Jc))||void 0===n?void 0:n.length)||0)>0},parse:up,createTransformer:dp,getAnimatableNone:function(e){const t=up(e);return dp(e)(t.map(pp))}},hp=new Set(["brightness","contrast","saturate","opacity"]);function mp(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Qc)||[];if(!r)return e;const o=n.replace(r,"");let i=hp.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const gp=/\b([a-z-]*)\(.*?\)/gu,vp={...fp,getAnimatableNone:e=>{const t=e.match(gp);return t?t.map(mp).join(" "):e}},bp={...uu,color:ip,backgroundColor:ip,outlineColor:ip,fill:ip,stroke:ip,borderColor:ip,borderTopColor:ip,borderRightColor:ip,borderBottomColor:ip,borderLeftColor:ip,filter:vp,WebkitFilter:vp},xp=e=>bp[e];function yp(e,t){let n=xp(e);return n!==vp&&(n=fp),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const wp=new Set(["auto","none","0"]);class _p extends Qd{constructor(e,t,n,r){super(e,t,n,r,null==r?void 0:r.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){const r=e[n];if("string"==typeof r&&Wc(r)){const o=zd(r,t.current);void 0!==o&&(e[n]=o),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Od.has(n)||2!==e.length)return;const[r,o]=e,i=Gd(r),s=Gd(o);if(i!==s)if(Ld(i)&&Ld(s))for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)("number"==typeof(r=e[t])?0===r:null===r||"none"===r||"0"===r||Id(r))&&n.push(t);var r;n.length&&function(e,t,n){let r,o=0;for(;o<e.length&&!r;){const t=e[o];"string"==typeof t&&!wp.has(t)&&cp(t).values.length&&(r=e[o]),o++}if(r&&n)for(const o of t)e[o]=yp(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Hd[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,s=r[i];r[i]=Hd[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==s&&void 0===this.finalKeyframe&&(this.finalKeyframe=s),(null===(e=this.removedTransforms)||void 0===e?void 0:e.length)&&this.removedTransforms.forEach((([e,n])=>{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}const Sp=(e,t)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!fp.test(e)&&"0"!==e||e.startsWith("url(")));class Cp{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i="loop",...s}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:o,repeatType:i,...s},this.updateFinishedPromise()}get resolved(){return this._resolved||this.hasAttemptedResolve||(Zd(),Xd()),this._resolved}onKeyframesResolved(e,t){this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:o,delay:i,onComplete:s,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const i=e[e.length-1],s=Sp(o,t),a=Sp(i,t);return Rd(s===a,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!(!s||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||"spring"===n&&r)}(e,n,r,o)){if(kd||!i)return null==a||a(Ed(e,this.options,t)),null==s||s(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}updateFinishedPromise(){this.currentFinishedPromise=new Promise((e=>{this.resolveFinishedPromise=e}))}}function kp(e,t){return t?e*(1e3/t):0}function jp(e,t,n){const r=Math.max(t-5,0);return kp(n-e(r),t-r)}const Ep=.001;function Pp({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let o,i;Rd(e<=bd(10),"Spring duration must be 10 seconds or less");let s=1-t;s=Kc(.05,1,s),e=Kc(.01,10,xd(e)),s<1?(o=t=>{const r=t*s,o=r*e,i=r-n,a=Tp(t,s),l=Math.exp(-o);return Ep-i/a*l},i=t=>{const r=t*s*e,i=r*n+n,a=Math.pow(s,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=Tp(Math.pow(t,2),s);return(-o(t)+Ep>0?-1:1)*((i-a)*l)/c}):(o=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,i=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n<Np;n++)r-=e(r)/t(r);return r}(o,i,5/e);if(e=bd(e),isNaN(a))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(a,2)*r;return{stiffness:t,damping:2*s*Math.sqrt(r*t),duration:e}}}const Np=12;function Tp(e,t){return e*Math.sqrt(1-t*t)}const Ip=["duration","bounce"],Rp=["stiffness","damping","mass"];function Mp(e,t){return t.some((t=>void 0!==e[t]))}function Ap({keyframes:e,restDelta:t,restSpeed:n,...r}){const o=e[0],i=e[e.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Mp(e,Rp)&&Mp(e,Ip)){const n=Pp(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...r,velocity:-xd(r.velocity||0)}),f=d||0,h=l/(2*Math.sqrt(a*c)),m=i-o,g=xd(Math.sqrt(a/c)),v=Math.abs(m)<5;let b;if(n||(n=v?.01:2),t||(t=v?.005:.5),h<1){const e=Tp(g,h);b=t=>{const n=Math.exp(-h*g*t);return i-n*((f+h*g*m)/e*Math.sin(e*t)+m*Math.cos(e*t))}}else if(1===h)b=e=>i-Math.exp(-g*e)*(m+(f+g*m)*e);else{const e=g*Math.sqrt(h*h-1);b=t=>{const n=Math.exp(-h*g*t),r=Math.min(e*t,300);return i-n*((f+h*g*m)*Math.sinh(r)+e*m*Math.cosh(r))/e}}return{calculatedDuration:p&&u||null,next:e=>{const r=b(e);if(p)s.done=e>=u;else{let o=f;0!==e&&(o=h<1?jp(b,e,r):0);const a=Math.abs(o)<=n,l=Math.abs(i-r)<=t;s.done=a&&l}return s.value=s.done?i:r,s}}}function Dp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],p={done:!1,value:d},f=e=>void 0===a?l:void 0===l||Math.abs(a-e)<Math.abs(l-e)?a:l;let h=n*t;const m=d+h,g=void 0===s?m:s(m);g!==m&&(h=g-d);const v=e=>-h*Math.exp(-e/r),b=e=>g+v(e),x=e=>{const t=v(e),n=b(e);p.done=Math.abs(t)<=c,p.value=p.done?g:n};let y,w;const _=e=>{(e=>void 0!==a&&e<a||void 0!==l&&e>l)(p.value)&&(y=e,w=Ap({keyframes:[p.value,f(p.value)],velocity:jp(b,e,p.value),damping:o,stiffness:i,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return w||void 0!==y||(t=!0,x(e),_(e)),void 0!==y&&e>=y?w.next(e-y):(!t&&x(e),p)}}}const zp=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function Op(e,t,n,r){if(e===t&&n===r)return Vu;const o=t=>function(e,t,n,r,o){let i,s,a=0;do{s=t+(n-t)/2,i=zp(s,r,o)-e,i>0?n=s:t=s}while(Math.abs(i)>1e-7&&++a<12);return s}(t,0,1,e,n);return e=>0===e||1===e?e:zp(o(e),t,r)}const Lp=Op(.42,0,1,1),Fp=Op(0,0,.58,1),Bp=Op(.42,0,.58,1),Vp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,$p=e=>t=>1-e(1-t),Hp=e=>1-Math.sin(Math.acos(e)),Wp=$p(Hp),Up=Vp(Hp),Gp=Op(.33,1.53,.69,.99),Kp=$p(Gp),qp=Vp(Kp),Yp={linear:Vu,easeIn:Lp,easeInOut:Bp,easeOut:Fp,circIn:Hp,circInOut:Up,circOut:Wp,backIn:Kp,backInOut:qp,backOut:Gp,anticipate:e=>(e*=2)<1?.5*Kp(e):.5*(2-Math.pow(2,-10*(e-1)))},Xp=e=>{if(Array.isArray(e)){Md(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return Op(t,n,r,o)}return"string"==typeof e?(Md(void 0!==Yp[e],`Invalid easing type '${e}'`),Yp[e]):e},Zp=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},Qp=(e,t,n)=>e+(t-e)*n;function Jp(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}const ef=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},tf=[rp,np,op];function nf(e){const t=(e=>tf.find((t=>t.test(e))))(e);Md(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`);let n=t.parse(e);return t===op&&(n=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let o=0,i=0,s=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;o=Jp(a,r,e+1/3),i=Jp(a,r,e),s=Jp(a,r,e-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const rf=(e,t)=>{const n=nf(e),r=nf(t),o={...n};return e=>(o.red=ef(n.red,r.red,e),o.green=ef(n.green,r.green,e),o.blue=ef(n.blue,r.blue,e),o.alpha=Qp(n.alpha,r.alpha,e),np.transform(o))},of=new Set(["none","hidden"]);function sf(e,t){return n=>n>0?t:e}function af(e,t){return n=>Qp(e,t,n)}function lf(e){return"number"==typeof e?af:"string"==typeof e?Wc(e)?sf:ip.test(e)?rf:df:Array.isArray(e)?cf:"object"==typeof e?ip.test(e)?rf:uf:sf}function cf(e,t){const n=[...e],r=n.length,o=e.map(((e,n)=>lf(e)(e,t[n])));return e=>{for(let t=0;t<r;t++)n[t]=o[t](e);return n}}function uf(e,t){const n={...e,...t},r={};for(const o in n)void 0!==e[o]&&void 0!==t[o]&&(r[o]=lf(e[o])(e[o],t[o]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const df=(e,t)=>{const n=fp.createTransformer(t),r=cp(e),o=cp(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?of.has(e)&&!o.values.length||of.has(t)&&!r.values.length?function(e,t){return of.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):Ju(cf(function(e,t){var n;const r=[],o={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const s=t.types[i],a=e.indexes[s][o[s]],l=null!==(n=e.values[a])&&void 0!==n?n:0;r[i]=l,o[s]++}return r}(r,o),o.values),n):(Rd(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),sf(e,t))};function pf(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return Qp(e,t,n);return lf(e)(e,t)}function ff(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Md(i===t.length,"Both input and output ranges must be the same length"),1===i)return()=>t[0];if(2===i&&e[0]===e[1])return()=>t[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],o=n||pf,i=e.length-1;for(let n=0;n<i;n++){let i=o(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||Vu:t;i=Ju(e,i)}r.push(i)}return r}(t,r,o),a=s.length,l=t=>{let n=0;if(a>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const r=Zp(e[n],e[n+1],t);return s[n](r)};return n?t=>l(Kc(e[0],e[i-1],t)):l}function hf(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Zp(0,t,r);e.push(Qp(n,1,o))}}(t,e.length-1),t}function mf({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Xp):Xp(r),i={done:!1,value:t[0]},s=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:hf(t),e),a=ff(s,t,{ease:Array.isArray(o)?o:(l=t,c=o,l.map((()=>c||Bp)).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(i.value=a(t),i.done=t>=e,i)}}const gf=e=>{const t=({timestamp:t})=>e(t);return{start:()=>$u.update(t,!0),stop:()=>Hu(t),now:()=>Wu.isProcessing?Wu.timestamp:Td.now()}},vf={decay:Dp,inertia:Dp,tween:mf,keyframes:mf,spring:Ap},bf=e=>e/100;class xf extends Cp{constructor({KeyframeResolver:e=Qd,...t}){super(t),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:n,motionValue:r,keyframes:o}=this.options,i=(e,t)=>this.onKeyframesResolved(e,t);n&&r&&r.owner?this.resolver=r.owner.resolveKeyframes(o,i,n,r):this.resolver=new e(o,i,n,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:i=0}=this.options,s=vf[t]||mf;let a,l;s!==mf&&"number"!=typeof e[0]&&(a=Ju(bf,pf(e[0],e[1])),e=[0,100]);const c=s({...this.options,keyframes:e});"mirror"===o&&(l=s({...this.options,keyframes:[...e].reverse(),velocity:-i})),null===c.calculatedDuration&&(c.calculatedDuration=function(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:i,mapPercentToKeyframes:s,keyframes:a,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return o.next(0);const{delay:d,repeat:p,repeatType:f,repeatDelay:h,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let b=this.currentTime,x=o;if(p){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,p+1);Boolean(t%2)&&("reverse"===f?(n=1-n,h&&(n-=h/u)):"mirror"===f&&(x=i)),b=Kc(0,1,n)*u}const y=v?{done:!1,value:a[0]}:x.next(b);s&&(y.value=s(y.value));let{done:w}=y;v||null===l||(w=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return _&&void 0!==r&&(y.value=Ed(a,this.options,r)),m&&m(y.value),_&&this.finish(),y}get duration(){const{resolved:e}=this;return e?xd(e.calculatedDuration):0}get time(){return xd(this.currentTime)}set time(e){e=bd(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=xd(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=gf,onPlay:t}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime&&"finished"!==this.state||(this.startTime=n),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const yf=e=>Array.isArray(e)&&"number"==typeof e[0];function wf(e){return Boolean(!e||"string"==typeof e&&e in Sf||yf(e)||Array.isArray(e)&&e.every(wf))}const _f=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Sf={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_f([0,.65,.55,1]),circOut:_f([.55,0,1,.45]),backIn:_f([.31,.01,.66,-.59]),backOut:_f([.33,1.53,.69,.99])};function Cf(e){return kf(e)||Sf.easeOut}function kf(e){return e?yf(e)?_f(e):Array.isArray(e)?e.map(Cf):Sf[e]:void 0}const jf=function(e){let t;return()=>(void 0===t&&(t=e()),t)}((()=>Object.hasOwnProperty.call(Element.prototype,"animate"))),Ef=new Set(["opacity","clipPath","filter","transform"]);class Pf extends Cp{constructor(e){super(e);const{name:t,motionValue:n,keyframes:r}=this.options;this.resolver=new _p(r,((e,t)=>this.onKeyframesResolved(e,t)),t,n),this.resolver.scheduleResolve()}initPlayback(e,t){var n;let{duration:r=300,times:o,ease:i,type:s,motionValue:a,name:l}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if(function(e){return"spring"===e.type||"backgroundColor"===e.name||!wf(e.ease)}(this.options)){const{onComplete:t,onUpdate:n,motionValue:a,...l}=this.options,c=function(e,t){const n=new xf({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<2e4;)r=n.sample(i),o.push(r.value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,l);1===(e=c.keyframes).length&&(e[1]=e[0]),r=c.duration,o=c.times,i=c.ease,s="keyframes"}const c=function(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=kf(a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:o,ease:i});return c.startTime=Td.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;a.set(Ed(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:o,type:s,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return xd(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return xd(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=bd(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Vu;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Vu}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:o,ease:i,times:s}=e;if("idle"!==t.playState&&"finished"!==t.playState){if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,...l}=this.options,c=new xf({...l,keyframes:n,duration:r,type:o,ease:i,times:s,isGenerator:!0}),u=bd(this.time);e.setWithVelocity(c.sample(u-10).value,c.sample(u).value,10)}this.cancel()}}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:o,damping:i,type:s}=e;return jf()&&n&&Ef.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==o&&0!==i&&"inertia"!==s}}const Nf=(e,t,n,r={},o,i)=>s=>{const a=Cd(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c-=bd(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:e=>{t.set(e),a.onUpdate&&a.onUpdate(e)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:o};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||(u={...u,...Sd(e,u)}),u.duration&&(u.duration=bd(u.duration)),u.repeatDelay&&(u.repeatDelay=bd(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),(kd||ac)&&(d=!0,u.duration=0,u.delay=0),d&&!i&&void 0!==t.get()){const e=Ed(u.keyframes,a);if(void 0!==e)return void $u.update((()=>{u.onUpdate(e),u.onComplete()}))}return!i&&Pf.supports(u)?new Pf(u):new xf(u)};function Tf(e){return Boolean(Lc(e)&&e.add)}function If(e,t){-1===e.indexOf(t)&&e.push(t)}function Rf(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Mf{constructor(){this.subscriptions=[]}add(e){return If(this.subscriptions,e),()=>Rf(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Af={current:void 0};class Df{constructor(e,t={}){this.version="11.2.6",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=Td.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Td.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Mf);const n=this.events[e].add(t);return"change"===e?()=>{n(),$u.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Af.current&&Af.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Td.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return kp(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function zf(e,t){return new Df(e,t)}function Of(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,zf(n))}function Lf({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Ff(e,t,{delay:n=0,transitionOverride:r,type:o}={}){var i;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...l}=t;const c=e.getValue("willChange");r&&(s=r);const u=[],d=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const r=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||d&&Lf(d,t))continue;const a={delay:n,elapsed:0,...Cd(s||{},t)};let p=!1;if(window.HandoffAppearAnimations){const n=e.getProps()[sc];if(n){const e=window.HandoffAppearAnimations(n,t,r,$u);null!==e&&(a.elapsed=e,p=!0)}}r.start(Nf(t,r,o,e.shouldReduceMotion&&zc.has(t)?{type:!1}:a,e,p));const f=r.animation;f&&(Tf(c)&&(c.add(t),f.then((()=>c.remove(t)))),u.push(f))}return a&&Promise.all(u).then((()=>{$u.update((()=>{a&&function(e,t){const n=vd(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const t in i)Of(e,t,Ou(i[t]))}(e,a)}))})),u}function Bf(e,t,n={}){var r;const o=vd(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:i=e.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const s=o?()=>Promise.all(Ff(e,o,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:o=0,staggerChildren:s,staggerDirection:a}=i;return function(e,t,n=0,r=0,o=1,i){const s=[],a=(e.variantChildren.size-1)*r,l=1===o?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(Vf).forEach(((e,r)=>{e.notify("AnimationStart",t),s.push(Bf(e,t,{...i,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(s)}(e,t,o+r,s,a,n)}:()=>Promise.resolve(),{when:l}=i;if(l){const[e,t]="beforeChildren"===l?[s,a]:[a,s];return e().then((()=>t()))}return Promise.all([s(),a(n.delay)])}function Vf(e,t){return e.sortNodePosition(t)}const $f=[...bc].reverse(),Hf=bc.length;function Wf(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map((t=>Bf(e,t,n)));r=Promise.all(o)}else if("string"==typeof t)r=Bf(e,t,n);else{const o="function"==typeof t?vd(e,t,n.custom):t;r=Promise.all(Ff(e,o,n))}return r.then((()=>{$u.postRender((()=>{e.notify("AnimationComplete",t)}))}))}(e,t,n))))}function Uf(e){let t=Wf(e);const n={animate:Kf(!0),whileInView:Kf(),whileHover:Kf(),whileTap:Kf(),whileDrag:Kf(),whileFocus:Kf(),exit:Kf()};let r=!0;const o=t=>(n,r)=>{var o;const i=vd(e,r,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){const{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function i(i){const s=e.getProps(),a=e.getVariantContext(!0)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<Hf;t++){const p=$f[t],f=n[p],h=void 0!==s[p]?s[p]:a[p],m=gc(h),g=p===i?f.isActive:null;!1===g&&(d=t);let v=h===a[p]&&h!==s[p]&&m;if(v&&r&&e.manuallyAnimateOnMount&&(v=!1),f.protectedKeys={...u},!f.isActive&&null===g||!h&&!f.prevProp||vc(h)||"boolean"==typeof h)continue;let b=Gf(f.prevProp,h)||p===i&&f.isActive&&!v&&m||t>d&&m,x=!1;const y=Array.isArray(h)?h:[h];let w=y.reduce(o(p),{});!1===g&&(w={});const{prevResolvedValues:_={}}=f,S={..._,...w},C=t=>{b=!0,c.has(t)&&(x=!0,c.delete(t)),f.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in S){const t=w[e],n=_[e];if(u.hasOwnProperty(e))continue;let r=!1;r=zu(t)&&zu(n)?!gd(t,n):t!==n,r?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):f.protectedKeys[e]=!0}f.prevProp=h,f.prevResolvedValues=w,f.isActive&&(u={...u,...w}),r&&e.blockInitialAnimation&&(b=!1),!b||v&&!x||l.push(...y.map((e=>({animation:e,options:{type:p}}))))}if(c.size){const t={};c.forEach((n=>{const r=e.getBaseTarget(n),o=e.getValue(n);o&&(o.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let p=Boolean(l.length);return!r||!1!==s.initial&&s.initial!==s.animate||e.manuallyAnimateOnMount||(p=!1),r=!1,p?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,r){var o;if(n[t].isActive===r)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const s=i(t);for(const e in n)n[e].protectedKeys={};return s},setAnimateFunction:function(n){t=n(e)},getState:()=>n}}function Gf(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!gd(t,e)}function Kf(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let qf=0;const Yf={animation:{Feature:class extends id{constructor(e){super(e),e.animationState||(e.animationState=Uf(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),vc(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends id{constructor(){super(...arguments),this.id=qf++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},Xf=(e,t)=>Math.abs(e-t);class Zf{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=eh(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=Xf(e.x,t.x),r=Xf(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:o}=Wu;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;t||(i&&i(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=Qf(t,this.transformPagePoint),$u.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const i=eh("pointercancel"===e.type?this.lastMoveEventInfo:Qf(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,i),r&&r(e,i)},!Yu(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const i=Qf(Xu(e),this.transformPagePoint),{point:s}=i,{timestamp:a}=Wu;this.history=[{...s,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,eh(i,this.history)),this.removeListeners=Ju(Zu(this.contextWindow,"pointermove",this.handlePointerMove),Zu(this.contextWindow,"pointerup",this.handlePointerUp),Zu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Hu(this.updatePoint)}}function Qf(e,t){return t?{point:t(e.point)}:e}function Jf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function eh({point:e},t){return{point:e,delta:Jf(e,nh(t)),offset:Jf(e,th(t)),velocity:rh(t,.1)}}function th(e){return e[0]}function nh(e){return e[e.length-1]}function rh(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=nh(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>bd(t)));)n--;if(!r)return{x:0,y:0};const i=xd(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function oh(e){return e.max-e.min}function ih(e,t=0,n=.01){return Math.abs(e-t)<=n}function sh(e,t,n,r=.5){e.origin=r,e.originPoint=Qp(t.min,t.max,e.origin),e.scale=oh(n)/oh(t),(ih(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Qp(n.min,n.max,e.origin)-e.originPoint,(ih(e.translate)||isNaN(e.translate))&&(e.translate=0)}function ah(e,t,n,r){sh(e.x,t.x,n.x,r?r.originX:void 0),sh(e.y,t.y,n.y,r?r.originY:void 0)}function lh(e,t,n){e.min=n.min+t.min,e.max=e.min+oh(t)}function ch(e,t,n){e.min=t.min-n.min,e.max=e.min+oh(t)}function uh(e,t,n){ch(e.x,t.x,n.x),ch(e.y,t.y,n.y)}function dh(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function ph(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const fh=.35;function hh(e,t,n){return{min:mh(e,t),max:mh(e,n)}}function mh(e,t){return"number"==typeof e?e:e[t]||0}function gh(e){return[e("x"),e("y")]}function vh({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function bh(e){return void 0===e||1===e}function xh({scale:e,scaleX:t,scaleY:n}){return!bh(e)||!bh(t)||!bh(n)}function yh(e){return xh(e)||wh(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function wh(e){return _h(e.x)||_h(e.y)}function _h(e){return e&&"0%"!==e}function Sh(e,t,n){return n+t*(e-n)}function Ch(e,t,n,r,o){return void 0!==o&&(e=Sh(e,o,r)),Sh(e,n,r)+t}function kh(e,t=0,n=1,r,o){e.min=Ch(e.min,t,n,r,o),e.max=Ch(e.max,t,n,r,o)}function jh(e,{x:t,y:n}){kh(e.x,t.translate,t.scale,t.originPoint),kh(e.y,n.translate,n.scale,n.originPoint)}function Eh(e){return Number.isInteger(e)||e>1.0000000000001||e<.999999999999?e:1}function Ph(e,t){e.min=e.min+t,e.max=e.max+t}function Nh(e,t,[n,r,o]){const i=void 0!==t[o]?t[o]:.5,s=Qp(e.min,e.max,i);kh(e,t[n],t[r],s,t.scale)}const Th=["x","scaleX","originX"],Ih=["y","scaleY","originY"];function Rh(e,t){Nh(e.x,t,Th),Nh(e.y,t,Ih)}function Mh(e,t){return vh(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Ah=({current:e})=>e?e.ownerDocument.defaultView:null,Dh=new WeakMap;class zh{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new Zf(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(Xu(e,"page").point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=rd(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),gh((e=>{let t=this.getAxisMotionValue(e).get()||0;if(ou.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];if(r){t=oh(r)*(parseFloat(t)/100)}}}this.originPoint[e]=t})),o&&$u.postRender((()=>o(e,t)));const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,s),this.updateAxis("y",t.point,s),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>gh((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Ah(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&$u.postRender((()=>o(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Oh(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?Qp(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?Qp(n,e,r.max):Math.min(e,n)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&hc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:o}){return{x:dh(e.x,n,o),y:dh(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=fh){return!1===e?e=0:!0===e&&(e=fh),{x:hh(e,"left","right"),y:hh(e,"top","bottom")}}(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&gh((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!hc(e))return!1;const n=e.current;Md(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=function(e,t,n){const r=Mh(e,n),{scroll:o}=t;return o&&(Ph(r.x,o.offset.x),Ph(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(e,t){return{x:ph(e.x,t.x),y:ph(e.y,t.y)}}(r.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(i));this.hasMutatedConstraints=!!e,e&&(i=vh(e))}return i}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=gh((s=>{if(!Oh(s,t,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[s]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(Nf(e,n,0,t,this.visualElement))}stopAnimation(){gh((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){gh((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),r=n[t];return r||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){gh((t=>{const{drag:n}=this.getProps();if(!Oh(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[t];o.set(e[t]-Qp(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!hc(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};gh((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=oh(e),o=oh(t);return o>r?n=Zp(t.min,t.max-r,e.min):r>o&&(n=Zp(e.min,e.max-o,t.min)),Kc(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),gh((t=>{if(!Oh(t,e,null))return;const n=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];n.set(Qp(o,i,r[t]))}))}addListeners(){if(!this.visualElement.current)return;Dh.set(this.visualElement,this);const e=Zu(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();hc(e)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),t();const o=qu(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(gh((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{o(),e(),r(),i&&i()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=fh,dragMomentum:s=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Oh(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Lh=e=>(t,n)=>{e&&$u.postRender((()=>e(t,n)))};const Fh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Bh(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Vh={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!iu.test(e))return e;e=parseFloat(e)}return`${Bh(e,t.target.x)}% ${Bh(e,t.target.y)}%`}},$h={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=fp.parse(e);if(o.length>5)return r;const i=fp.createTransformer(e),s="number"!=typeof o[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;o[0+s]/=a,o[1+s]/=l;const c=Qp(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=c),"number"==typeof o[3+s]&&(o[3+s]/=c),i(o)}};class Hh extends B.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=e;var i;i=Uh,Object.assign(Ac,i),o&&(t.group&&t.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Fh.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?i.promote():i.relegate()||$u.postRender((()=>{const e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),pc.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Wh(e){const[t,n]=function(){const e=(0,B.useContext)(tc);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,o=(0,B.useId)();return(0,B.useEffect)((()=>r(o)),[]),!t&&n?[!1,()=>n&&n(o)]:[!0]}(),r=(0,B.useContext)(jc);return(0,_t.jsx)(Hh,{...e,layoutGroup:r,switchLayoutGroup:(0,B.useContext)(Ec),isPresent:t,safeToRemove:n})}const Uh={borderRadius:{...Vh,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Vh,borderTopRightRadius:Vh,borderBottomLeftRadius:Vh,borderBottomRightRadius:Vh,boxShadow:$h},Gh=["TopLeft","TopRight","BottomLeft","BottomRight"],Kh=Gh.length,qh=e=>"string"==typeof e?parseFloat(e):e,Yh=e=>"number"==typeof e||iu.test(e);function Xh(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Zh=Jh(0,.5,Wp),Qh=Jh(.5,.95,Vu);function Jh(e,t,n){return r=>r<e?0:r>t?1:n(Zp(e,t,r))}function em(e,t){e.min=t.min,e.max=t.max}function tm(e,t){em(e.x,t.x),em(e.y,t.y)}function nm(e,t,n,r,o){return e=Sh(e-=t,1/n,r),void 0!==o&&(e=Sh(e,1/o,r)),e}function rm(e,t,[n,r,o],i,s){!function(e,t=0,n=1,r=.5,o,i=e,s=e){ou.test(t)&&(t=parseFloat(t),t=Qp(s.min,s.max,t/100)-s.min);if("number"!=typeof t)return;let a=Qp(i.min,i.max,r);e===i&&(a-=t),e.min=nm(e.min,t,n,a,o),e.max=nm(e.max,t,n,a,o)}(e,t[n],t[r],t[o],t.scale,i,s)}const om=["x","scaleX","originX"],im=["y","scaleY","originY"];function sm(e,t,n,r){rm(e.x,t,om,n?n.x:void 0,r?r.x:void 0),rm(e.y,t,im,n?n.y:void 0,r?r.y:void 0)}function am(e){return 0===e.translate&&1===e.scale}function lm(e){return am(e.x)&&am(e.y)}function cm(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function um(e){return oh(e.x)/oh(e.y)}class dm{constructor(){this.members=[]}add(e){If(this.members,e),e.scheduleRender()}remove(e){if(Rf(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function pm(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,s=(null==n?void 0:n.z)||0;if((o||i||s)&&(r=`translate3d(${o}px, ${i}px, ${s}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:i,skewX:s,skewY:a}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),o&&(r+=`rotateX(${o}deg) `),i&&(r+=`rotateY(${i}deg) `),s&&(r+=`skewX(${s}deg) `),a&&(r+=`skewY(${a}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return 1===a&&1===l||(r+=`scale(${a}, ${l})`),r||"none"}const fm=(e,t)=>e.depth-t.depth;class hm{constructor(){this.children=[],this.isDirty=!1}add(e){If(this.children,e),this.isDirty=!0}remove(e){Rf(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(fm),this.isDirty=!1,this.children.forEach(e)}}const mm=["","X","Y","Z"],gm={visibility:"hidden"};let vm=0;const bm={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function xm(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ym({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=vm++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var e;this.projectionUpdateScheduled=!1,bm.totalNodes=bm.resolvedTargetDeltas=bm.recalculatedProjection=0,this.nodes.forEach(Sm),this.nodes.forEach(Tm),this.nodes.forEach(Im),this.nodes.forEach(Cm),e=bm,window.MotionDebug&&window.MotionDebug.record(e)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new hm)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new Mf),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=t)instanceof SVGElement&&"svg"!==r.tagName,this.instance=t;const{layoutId:o,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||o)&&(this.isLayoutDirty=!0),e){let n;const r=()=>this.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Td.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Hu(r),e(i-t))};return $u.read(r,!0),()=>Hu(r)}(r,250),Fh.hasAnimatedSinceResize&&(Fh.hasAnimatedSinceResize=!1,this.nodes.forEach(Nm))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Om,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!cm(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...Cd(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Nm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Hu(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,window.HandoffCancelAllAnimations&&window.HandoffCancelAllAnimations(),this.nodes&&this.nodes.forEach(Rm),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(jm);this.isUpdating||this.nodes.forEach(Em),this.isUpdating=!1,this.nodes.forEach(Pm),this.nodes.forEach(wm),this.nodes.forEach(_m),this.clearAllSnapshots();const e=Td.now();Wu.delta=Kc(0,1e3/60,e-Wu.timestamp),Wu.timestamp=e,Wu.isProcessing=!0,Uu.update.process(Wu),Uu.preRender.process(Wu),Uu.render.process(Wu),Wu.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,pc.read((()=>this.update())))}clearAllSnapshots(){this.nodes.forEach(km),this.sharedNodes.forEach(Mm)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,$u.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){$u.postRender((()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++){this.path[e].updateScroll()}const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&(this.scroll={animationId:this.root.animationId,phase:e,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform,t=this.projectionDelta&&!lm(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;e&&(t||yh(this.latestValues)||i)&&(o(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),Bm((r=n).x),Bm(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:e}=this.options;if(!e)return{x:{min:0,max:0},y:{min:0,max:0}};const t=e.measureViewportBox(),{scroll:n}=this.root;return n&&(Ph(t.x,n.offset.x),Ph(t.y,n.offset.y)),t}removeElementScroll(e){const t={x:{min:0,max:0},y:{min:0,max:0}};tm(t,e);for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:o,options:i}=r;if(r!==this.root&&o&&i.layoutScroll){if(o.isRoot){tm(t,e);const{scroll:n}=this.root;n&&(Ph(t.x,-n.offset.x),Ph(t.y,-n.offset.y))}Ph(t.x,o.offset.x),Ph(t.y,o.offset.y)}}return t}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};tm(n,e);for(let e=0;e<this.path.length;e++){const r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Rh(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),yh(r.latestValues)&&Rh(n,r.latestValues)}return yh(this.latestValues)&&Rh(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};tm(t,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];if(!n.instance)continue;if(!yh(n.latestValues))continue;xh(n.latestValues)&&n.updateSnapshot();const r={x:{min:0,max:0},y:{min:0,max:0}};tm(r,n.measurePageBox()),sm(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return yh(this.latestValues)&&sm(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Wu.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:o,layoutId:i}=this.options;if(this.layout&&(o||i)){if(this.resolvedRelativeTargetAt=Wu.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},uh(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),tm(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,a,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,lh(s.x,a.x,l.x),lh(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):tm(this.target,this.layout.layoutBox),jh(this.target,this.targetDelta)):tm(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&Boolean(e.resumingFrom)===Boolean(this.resumingFrom)&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},uh(this.relativeTargetOrigin,this.target,e.target),tm(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}bm.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!xh(this.parent.latestValues)&&!wh(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let r=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===Wu.timestamp&&(r=!1),r)return;const{layout:o,layoutId:i}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!i)return;tm(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(e,t,n,r=!1){const o=n.length;if(!o)return;let i,s;t.x=t.y=1;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const o=i.instance;o&&o.style&&"contents"===o.style.display||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Rh(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,jh(e,s)),r&&yh(i.latestValues)&&Rh(e,i.latestValues))}t.x=Eh(t.x),t.y=Eh(t.y)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;if(!l)return void(this.projectionTransform&&(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionTransform="none",this.scheduleRender()));this.projectionDelta||(this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}});const c=this.projectionTransform;ah(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=pm(this.projectionDelta,this.treeScale),this.projectionTransform===c&&this.treeScale.x===s&&this.treeScale.y===a||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),bm.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const s={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(zm));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;Am(i.x,e.x,n),Am(i.y,e.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(uh(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){Dm(e.x,t.x,n.x,r),Dm(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,s,n),d&&function(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),tm(d,this.relativeTarget)),a&&(this.animationValues=o,function(e,t,n,r,o,i){o?(e.opacity=Qp(0,void 0!==n.opacity?n.opacity:1,Zh(r)),e.opacityExit=Qp(void 0!==t.opacity?t.opacity:1,0,Qh(r))):i&&(e.opacity=Qp(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o<Kh;o++){const i=`border${Gh[o]}Radius`;let s=Xh(t,i),a=Xh(n,i);void 0===s&&void 0===a||(s||(s=0),a||(a=0),0===s||0===a||Yh(s)===Yh(a)?(e[i]=Math.max(Qp(qh(s),qh(a),r),0),(ou.test(a)||ou.test(s))&&(e[i]+="%")):e[i]=a)}(t.rotate||n.rotate)&&(e.rotate=Qp(t.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Hu(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=$u.update((()=>{Fh.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=Lc(e)?e:zf(e);return r.start(Nf("",r,t,n)),r.animation}(0,1e3,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0}))}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:o}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&Vm(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=oh(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=oh(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}tm(t,n),Rh(t,o),ah(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new dm);this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&xm("z",e,r,this.animationValues);for(let t=0;t<mm.length;t++)xm(`rotate${mm[t]}`,e,r,this.animationValues),xm(`skew${mm[t]}`,e,r,this.animationValues);e.render();for(const t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}getProjectionStyles(e){var t,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return gm;const r={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Lu(null==e?void 0:e.pointerEvents)||"",r.transform=o?o(this.latestValues,""):"none",r;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=Lu(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!yh(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const s=i.animationValues||i.latestValues;this.applyTransformsToTarget(),r.transform=pm(this.projectionDeltaWithTransform,this.treeScale,s),o&&(r.transform=o(s,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,i.animationValues?r.opacity=i===this?null!==(n=null!==(t=s.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:r.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const e in Ac){if(void 0===s[e])continue;const{correct:t,applyTo:n}=Ac[e],o="none"===r.transform?s[e]:t(s[e],i);if(n){const e=n.length;for(let t=0;t<e;t++)r[n[t]]=o}else r[e]=o}return this.options.layoutId&&(r.pointerEvents=i===this?Lu(null==e?void 0:e.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach((e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(jm),this.root.sharedNodes.clear()}}}function wm(e){e.updateLayout()}function _m(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;"size"===o?gh((e=>{const r=i?n.measuredBox[e]:n.layoutBox[e],o=oh(r);r.min=t[e].min,r.max=r.min+o})):Vm(o,n.layoutBox,t)&&gh((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=oh(t[r]);o.max=o.min+s,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+s)}));const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};ah(s,t,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};i?ah(a,e.applyTransform(r,!0),n.measuredBox):ah(a,t,n.layoutBox);const l=!lm(s);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s={x:{min:0,max:0},y:{min:0,max:0}};uh(s,n.layoutBox,o.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};uh(a,t,i.layoutBox),cm(s,a)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Sm(e){bm.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Cm(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function km(e){e.clearSnapshot()}function jm(e){e.clearMeasurements()}function Em(e){e.isLayoutDirty=!1}function Pm(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Nm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Tm(e){e.resolveTargetDelta()}function Im(e){e.calcProjection()}function Rm(e){e.resetSkewAndRotation()}function Mm(e){e.removeLeadSnapshot()}function Am(e,t,n){e.translate=Qp(t.translate,0,n),e.scale=Qp(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Dm(e,t,n,r){e.min=Qp(t.min,n.min,r),e.max=Qp(t.max,n.max,r)}function zm(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const Om={duration:.45,ease:[.4,0,.1,1]},Lm=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Fm=Lm("applewebkit/")&&!Lm("chrome/")?Math.round:Vu;function Bm(e){e.min=Fm(e.min),e.max=Fm(e.max)}function Vm(e,t,n){return"position"===e||"preserve-aspect"===e&&!ih(um(t),um(n),.2)}const $m=ym({attachResizeListener:(e,t)=>qu(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Hm={current:void 0},Wm=ym({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Hm.current){const e=new $m({});e.mount(window),e.setOptions({layoutScroll:!0}),Hm.current=e}return Hm.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),Um={pan:{Feature:class extends id{constructor(){super(...arguments),this.removePointerDownListener=Vu}onPointerDown(e){this.session=new Zf(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ah(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Lh(e),onStart:Lh(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&$u.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=Zu(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends id{constructor(e){super(e),this.removeGroupControls=Vu,this.removeListeners=Vu,this.controls=new zh(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Vu}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Wm,MeasureLayout:Wh}},Gm={current:null},Km={current:!1};const qm=new WeakMap,Ym=[...Ud,ip,fp],Xm=Object.keys(kc),Zm=Xm.length,Qm=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Jm=xc.length;function eg(e){if(e)return!1!==e.options.allowProjection?e.projection:eg(e.parent)}class tg{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:o,visualState:i},s={}){this.resolveKeyframes=(e,t,n,r)=>new this.KeyframeResolver(e,t,n,r,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Qd,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>$u.render(this.render,!1,!0);const{latestValues:a,renderState:l}=i;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=s,this.blockInitialAnimation=Boolean(o),this.isControllingVariants=yc(t),this.isVariantNode=wc(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in u){const t=u[e];void 0!==a[e]&&Lc(t)&&(t.set(a[e],!1),Tf(c)&&c.add(e))}}mount(e){this.current=e,qm.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((e,t)=>this.bindToMotionValue(t,e))),Km.current||function(){if(Km.current=!0,nc)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Gm.current=e.matches;e.addListener(t),t()}else Gm.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Gm.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){var e;qm.delete(this.current),this.projection&&this.projection.unmount(),Hu(this.notifyUpdate),Hu(this.render),this.valueSubscriptions.forEach((e=>e())),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const t in this.features)null===(e=this.features[t])||void 0===e||e.unmount();this.current=null}bindToMotionValue(e,t){const n=zc.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&$u.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,(()=>{r(),o(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures({children:e,...t},n,r,o){let i,s;for(let e=0;e<Zm;e++){const n=Xm[e],{isEnabled:r,Feature:o,ProjectionNode:a,MeasureLayout:l}=kc[n];a&&(i=a),r(t)&&(!this.features[n]&&o&&(this.features[n]=new o(this)),l&&(s=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&i){const{layoutId:e,layout:n,drag:r,dragConstraints:s,layoutScroll:a,layoutRoot:l}=t;this.projection=new i(this.latestValues,t["data-framer-portal-id"]?void 0:eg(this.parent)),this.projection.setOptions({layoutId:e,layout:n,alwaysMeasureLayout:Boolean(r)||s&&hc(s),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:a,layoutRoot:l})}return s}updateFeatures(){for(const e in this.features){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Qm.length;t++){const n=Qm[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=e["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(e,t,n){const{willChange:r}=t;for(const o in t){const i=t[o],s=n[o];if(Lc(i))e.addValue(o,i),Tf(r)&&r.add(o);else if(Lc(s))e.addValue(o,zf(i,{owner:e})),Tf(r)&&r.remove(o);else if(s!==i)if(e.hasValue(o)){const t=e.getValue(o);!0===t.liveStyle?t.jump(i):t.hasAnimated||t.set(i)}else{const t=e.getStaticValue(o);e.addValue(o,zf(void 0!==t?t:i,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const e=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(e.initial=this.props.initial),e}const t={};for(let e=0;e<Jm;e++){const n=xc[e],r=this.props[n];(gc(r)||!1===r)&&(t[n]=r)}return t}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=zf(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Ad(r)||Id(r))?r=parseFloat(r):!(e=>Ym.find(Wd(e)))(r)&&fp.test(t)&&(r=yp(e,t)),this.setBaseTarget(e,Lc(r)?r.get():r)),Lc(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const o=Au(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||Lc(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new Mf),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class ng extends tg{constructor(){super(...arguments),this.KeyframeResolver=_p}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}}class rg extends ng{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(zc.has(t)){const e=xp(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),o=($c(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Mh(e,t)}build(e,t,n,r){du(e,t,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Iu(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Lc(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}renderInstance(e,t,n,r){Pu(e,t,n,r)}}class og extends ng{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(zc.has(t)){const e=xp(t);return e&&e.default||0}return t=Nu.has(t)?t:ic(t),e.getAttribute(t)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(e,t,n){return Ru(e,t,n)}build(e,t,n,r){Su(e,t,n,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,n,r){Tu(e,t,0,r)}mount(e){this.isSVGTag=ku(e.tagName),super.mount(e)}}const ig=(e,t)=>Mc(e)?new og(t,{enableHardwareAcceleration:!1}):new rg(t,{allowProjection:e!==B.Fragment,enableHardwareAcceleration:!0}),sg={...Yf,...md,...Um,...{layout:{ProjectionNode:Wm,MeasureLayout:Wh}}},ag=Ic(((e,t)=>function(e,{forwardMotionProps:t=!1},n,r){return{...Mc(e)?Gu:Ku,preloadedFeatures:n,useRender:Eu(t),createVisualElement:r,Component:e}}(e,t,sg,ig)));function lg(){const e=(0,B.useRef)(!1);return rc((()=>(e.current=!0,()=>{e.current=!1})),[]),e}class cg extends B.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ug({children:e,isPresent:t}){const n=(0,B.useId)(),r=(0,B.useRef)(null),o=(0,B.useRef)({width:0,height:0,top:0,left:0}),{nonce:i}=(0,B.useContext)(Jl);return(0,B.useInsertionEffect)((()=>{const{width:e,height:s,top:a,left:l}=o.current;if(t||!r.current||!e||!s)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return i&&(c.nonce=i),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${s}px !important;\n top: ${a}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}}),[t]),(0,_t.jsx)(cg,{isPresent:t,childRef:r,sizeRef:o,children:B.cloneElement(e,{ref:r})})}const dg=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:s})=>{const a=Du(pg),l=(0,B.useId)(),c=(0,B.useMemo)((()=>({id:l,initial:t,isPresent:n,custom:o,onExitComplete:e=>{a.set(e,!0);for(const e of a.values())if(!e)return;r&&r()},register:e=>(a.set(e,!1),()=>a.delete(e))})),i?[Math.random()]:[n]);return(0,B.useMemo)((()=>{a.forEach(((e,t)=>a.set(t,!1)))}),[n]),B.useEffect((()=>{!n&&!a.size&&r&&r()}),[n]),"popLayout"===s&&(e=(0,_t.jsx)(ug,{isPresent:n,children:e})),(0,_t.jsx)(tc.Provider,{value:c,children:e})};function pg(){return new Map}const fg=e=>e.key||"";const hg=({children:e,custom:t,initial:n=!0,onExitComplete:r,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:s="sync"})=>{Md(!o,"Replace exitBeforeEnter with mode='wait'");const a=(0,B.useContext)(jc).forceRender||function(){const e=lg(),[t,n]=(0,B.useState)(0),r=(0,B.useCallback)((()=>{e.current&&n(t+1)}),[t]);return[(0,B.useCallback)((()=>$u.postRender(r)),[r]),t]}()[0],l=lg(),c=function(e){const t=[];return B.Children.forEach(e,(e=>{(0,B.isValidElement)(e)&&t.push(e)})),t}(e);let u=c;const d=(0,B.useRef)(new Map).current,p=(0,B.useRef)(u),f=(0,B.useRef)(new Map).current,h=(0,B.useRef)(!0);var m;if(rc((()=>{h.current=!1,function(e,t){e.forEach((e=>{const n=fg(e);t.set(n,e)}))}(c,f),p.current=u})),m=()=>{h.current=!0,f.clear(),d.clear()},(0,B.useEffect)((()=>()=>m()),[]),h.current)return(0,_t.jsx)(_t.Fragment,{children:u.map((e=>(0,_t.jsx)(dg,{isPresent:!0,initial:!!n&&void 0,presenceAffectsLayout:i,mode:s,children:e},fg(e))))});u=[...u];const g=p.current.map(fg),v=c.map(fg),b=g.length;for(let e=0;e<b;e++){const t=g[e];-1!==v.indexOf(t)||d.has(t)||d.set(t,void 0)}return"wait"===s&&d.size&&(u=[]),d.forEach(((e,n)=>{if(-1!==v.indexOf(n))return;const o=f.get(n);if(!o)return;const h=g.indexOf(n);let m=e;if(!m){const e=()=>{d.delete(n);const e=Array.from(f.keys()).filter((e=>!v.includes(e)));if(e.forEach((e=>f.delete(e))),p.current=c.filter((t=>{const r=fg(t);return r===n||e.includes(r)})),!d.size){if(!1===l.current)return;a(),r&&r()}};m=(0,_t.jsx)(dg,{isPresent:!1,onExitComplete:e,custom:t,presenceAffectsLayout:i,mode:s,children:o},fg(o)),d.set(n,m)}u.splice(h,0,m)})),u=u.map((e=>{const t=e.key;return d.has(t)?e:(0,_t.jsx)(dg,{isPresent:!0,presenceAffectsLayout:i,mode:s,children:e},fg(e))})),(0,_t.jsx)(_t.Fragment,{children:d.size?u:u.map((e=>(0,B.cloneElement)(e)))})},mg=["40em","52em","64em"],gg=(e={})=>{const{defaultIndex:t=0}=e;if("number"!=typeof t)throw new TypeError(`Default breakpoint index should be a number. Got: ${t}, ${typeof t}`);if(t<0||t>mg.length-1)throw new RangeError(`Default breakpoint index out of range. Theme has ${mg.length} breakpoints, got index ${t}`);const[n,r]=(0,c.useState)(t);return(0,c.useEffect)((()=>{const e=()=>{const e=mg.filter((e=>"undefined"!=typeof window&&window.matchMedia(`screen and (min-width: ${e})`).matches)).length;n!==e&&r(e)};return e(),"undefined"!=typeof window&&window.addEventListener("resize",e),()=>{"undefined"!=typeof window&&window.removeEventListener("resize",e)}}),[n]),n};function vg(e,t={}){const n=gg(t);if(!Array.isArray(e)&&"function"!=typeof e)return e;const r=e||[];return r[n>=r.length?r.length-1:n]}const bg={name:"zjik7",styles:"display:flex"},xg={name:"qgaee5",styles:"display:block;max-height:100%;max-width:100%;min-height:0;min-width:0"},yg={name:"82a6rk",styles:"flex:1"},wg={name:"13nosa1",styles:">*{min-height:0;}"},_g={name:"1pwxzk4",styles:">*{min-width:0;}"};function Sg(e){const{align:t,className:n,direction:r="row",expanded:o=!0,gap:i=2,justify:s="space-between",wrap:a=!1,...l}=sl(function(e){const{isReversed:t,...n}=e;return void 0!==t?(Xi()("Flex isReversed",{alternative:'Flex direction="row-reverse" or "column-reverse"',since:"5.9"}),{...n,direction:t?"row-reverse":"row"}):n}(e),"Flex"),u=vg(Array.isArray(r)?r:[r]),d="string"==typeof u&&!!u.includes("column"),p=il();return{...l,className:(0,c.useMemo)((()=>{const e=Nl({alignItems:null!=t?t:d?"normal":"center",flexDirection:u,flexWrap:a?"wrap":void 0,gap:Il(i),justifyContent:s,height:d&&o?"100%":void 0,width:!d&&o?"100%":void 0},"","");return p(bg,e,d?wg:_g,n)}),[t,n,p,u,o,i,d,s,a]),isColumn:d}}const Cg=(0,c.createContext)({flexItemDisplay:void 0});const kg=al((function(e,t){const{children:n,isColumn:r,...o}=Sg(e);return(0,_t.jsx)(Cg.Provider,{value:{flexItemDisplay:r?"block":void 0},children:(0,_t.jsx)(_l,{...o,ref:t,children:n})})}),"Flex");function jg(e){const{className:t,display:n,isBlock:r=!1,...o}=sl(e,"FlexItem"),i={},s=(0,c.useContext)(Cg).flexItemDisplay;i.Base=Nl({display:n||s},"","");return{...o,className:il()(xg,i.Base,r&&yg,t)}}const Eg=al((function(e,t){const n=function(e){return jg({isBlock:!0,...sl(e,"FlexBlock")})}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"FlexBlock"),Pg=new RegExp(/-left/g),Ng=new RegExp(/-right/g),Tg=new RegExp(/Left/g),Ig=new RegExp(/Right/g);function Rg(e){return"left"===e?"right":"right"===e?"left":Pg.test(e)?e.replace(Pg,"-right"):Ng.test(e)?e.replace(Ng,"-left"):Tg.test(e)?e.replace(Tg,"Right"):Ig.test(e)?e.replace(Ig,"Left"):e}function Mg(e={},t){return()=>t?(0,a.isRTL)()?Nl(t,"",""):Nl(e,"",""):(0,a.isRTL)()?Nl(((e={})=>Object.fromEntries(Object.entries(e).map((([e,t])=>[Rg(e),t]))))(e),"",""):Nl(e,"","")}function Ag(e){return null!=e}Mg.watch=()=>(0,a.isRTL)();const Dg=al((function(e,t){const n=function(e){const{className:t,margin:n,marginBottom:r=2,marginLeft:o,marginRight:i,marginTop:s,marginX:a,marginY:l,padding:c,paddingBottom:u,paddingLeft:d,paddingRight:p,paddingTop:f,paddingX:h,paddingY:m,...g}=sl(e,"Spacer");return{...g,className:il()(Ag(n)&&Nl("margin:",Il(n),";",""),Ag(l)&&Nl("margin-bottom:",Il(l),";margin-top:",Il(l),";",""),Ag(a)&&Nl("margin-left:",Il(a),";margin-right:",Il(a),";",""),Ag(s)&&Nl("margin-top:",Il(s),";",""),Ag(r)&&Nl("margin-bottom:",Il(r),";",""),Ag(o)&&Mg({marginLeft:Il(o)})(),Ag(i)&&Mg({marginRight:Il(i)})(),Ag(c)&&Nl("padding:",Il(c),";",""),Ag(m)&&Nl("padding-bottom:",Il(m),";padding-top:",Il(m),";",""),Ag(h)&&Nl("padding-left:",Il(h),";padding-right:",Il(h),";",""),Ag(f)&&Nl("padding-top:",Il(f),";",""),Ag(u)&&Nl("padding-bottom:",Il(u),";",""),Ag(d)&&Mg({paddingLeft:Il(d)})(),Ag(p)&&Mg({paddingRight:Il(p)})(),t)}}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Spacer"),zg=Dg,Og=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),Lg=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M7 11.5h10V13H7z"})});const Fg=al((function(e,t){const n=jg(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"FlexItem");const Bg={name:"hdknak",styles:"display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap"};function Vg(e){return null!=e}const $g=e=>"string"==typeof e?(e=>parseFloat(e))(e):e,Hg="…",Wg={auto:"auto",head:"head",middle:"middle",tail:"tail",none:"none"},Ug={ellipsis:Hg,ellipsizeMode:Wg.auto,limit:0,numberOfLines:0};function Gg(e="",t){const n={...Ug,...t},{ellipsis:r,ellipsizeMode:o,limit:i}=n;if(o===Wg.none)return e;let s,a;switch(o){case Wg.head:s=0,a=i;break;case Wg.middle:s=Math.floor(i/2),a=Math.floor(i/2);break;default:s=i,a=0}const l=o!==Wg.auto?function(e,t,n,r){if("string"!=typeof e)return"";const o=e.length,i=~~t,s=~~n,a=Vg(r)?r:Hg;return 0===i&&0===s||i>=o||s>=o||i+s>=o?e:0===s?e.slice(0,i)+a:e.slice(0,i)+a+e.slice(o-s)}(e,s,a,r):e;return l}function Kg(e){const{className:t,children:n,ellipsis:r=Hg,ellipsizeMode:o=Wg.auto,limit:i=0,numberOfLines:s=0,...a}=sl(e,"Truncate"),l=il();let u;"string"==typeof n?u=n:"number"==typeof n&&(u=n.toString());const d=u?Gg(u,{ellipsis:r,ellipsizeMode:o,limit:i,numberOfLines:s}):n,p=!!u&&o===Wg.auto;return{...a,className:(0,c.useMemo)((()=>l(p&&!s&&Bg,p&&!!s&&Nl(1===s?"word-break: break-all;":""," -webkit-box-orient:vertical;-webkit-line-clamp:",s,";display:-webkit-box;overflow:hidden;",""),t)),[t,l,s,p]),children:d}}var qg={grad:.9,turn:360,rad:360/(2*Math.PI)},Yg=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Xg=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Zg=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Qg=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Jg=function(e){return{r:Zg(e.r,0,255),g:Zg(e.g,0,255),b:Zg(e.b,0,255),a:Zg(e.a)}},ev=function(e){return{r:Xg(e.r),g:Xg(e.g),b:Xg(e.b),a:Xg(e.a,3)}},tv=/^#([0-9a-f]{3,8})$/i,nv=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},rv=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:i?s/i*100:0,v:i/255*100,a:o}},ov=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,a,s,s,l,r][c],g:255*[l,r,r,a,s,s][c],b:255*[s,s,l,r,r,a][c],a:o}},iv=function(e){return{h:Qg(e.h),s:Zg(e.s,0,100),l:Zg(e.l,0,100),a:Zg(e.a)}},sv=function(e){return{h:Xg(e.h),s:Xg(e.s),l:Xg(e.l),a:Xg(e.a,3)}},av=function(e){return ov((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},lv=function(e){return{h:(t=rv(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},cv=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,uv=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,dv=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,pv=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fv={string:[[function(e){var t=tv.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Xg(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Xg(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=dv.exec(e)||pv.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Jg({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=cv.exec(e)||uv.exec(e);if(!t)return null;var n,r,o=iv({h:(n=t[1],r=t[2],void 0===r&&(r="deg"),Number(n)*(qg[r]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return av(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=void 0===o?1:o;return Yg(t)&&Yg(n)&&Yg(r)?Jg({r:Number(t),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,i=void 0===o?1:o;if(!Yg(t)||!Yg(n)||!Yg(r))return null;var s=iv({h:Number(t),s:Number(n),l:Number(r),a:Number(i)});return av(s)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,i=void 0===o?1:o;if(!Yg(t)||!Yg(n)||!Yg(r))return null;var s=function(e){return{h:Qg(e.h),s:Zg(e.s,0,100),v:Zg(e.v,0,100),a:Zg(e.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(i)});return ov(s)},"hsv"]]},hv=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},mv=function(e){return"string"==typeof e?hv(e.trim(),fv.string):"object"==typeof e&&null!==e?hv(e,fv.object):[null,void 0]},gv=function(e,t){var n=lv(e);return{h:n.h,s:Zg(n.s+100*t,0,100),l:n.l,a:n.a}},vv=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},bv=function(e,t){var n=lv(e);return{h:n.h,s:n.s,l:Zg(n.l+100*t,0,100),a:n.a}},xv=function(){function e(e){this.parsed=mv(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return Xg(vv(this.rgba),2)},e.prototype.isDark=function(){return vv(this.rgba)<.5},e.prototype.isLight=function(){return vv(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=ev(this.rgba)).r,n=e.g,r=e.b,i=(o=e.a)<1?nv(Xg(255*o)):"","#"+nv(t)+nv(n)+nv(r)+i;var e,t,n,r,o,i},e.prototype.toRgb=function(){return ev(this.rgba)},e.prototype.toRgbString=function(){return t=(e=ev(this.rgba)).r,n=e.g,r=e.b,(o=e.a)<1?"rgba("+t+", "+n+", "+r+", "+o+")":"rgb("+t+", "+n+", "+r+")";var e,t,n,r,o},e.prototype.toHsl=function(){return sv(lv(this.rgba))},e.prototype.toHslString=function(){return t=(e=sv(lv(this.rgba))).h,n=e.s,r=e.l,(o=e.a)<1?"hsla("+t+", "+n+"%, "+r+"%, "+o+")":"hsl("+t+", "+n+"%, "+r+"%)";var e,t,n,r,o},e.prototype.toHsv=function(){return e=rv(this.rgba),{h:Xg(e.h),s:Xg(e.s),v:Xg(e.v),a:Xg(e.a,3)};var e},e.prototype.invert=function(){return yv({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),yv(gv(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),yv(gv(this.rgba,-e))},e.prototype.grayscale=function(){return yv(gv(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),yv(bv(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),yv(bv(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?yv({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Xg(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=lv(this.rgba);return"number"==typeof e?yv({h:e,s:t.s,l:t.l,a:t.a}):Xg(t.h)},e.prototype.isEqual=function(e){return this.toHex()===yv(e).toHex()},e}(),yv=function(e){return e instanceof xv?e:new xv(e)},wv=[],_v=function(e){e.forEach((function(e){wv.indexOf(e)<0&&(e(xv,fv),wv.push(e))}))};function Sv(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var o,s,a=r[this.toHex()];if(a)return a;if(null==t?void 0:t.closest){var l=this.toRgb(),c=1/0,u="black";if(!i.length)for(var d in n)i[d]=new e(n[d]).toRgb();for(var p in n){var f=(o=l,s=i[p],Math.pow(o.r-s.r,2)+Math.pow(o.g-s.g,2)+Math.pow(o.b-s.b,2));f<c&&(c=f,u=p)}return u}},t.string.push([function(t){var r=t.toLowerCase(),o="transparent"===r?"#0000":n[r];return o?new e(o).toRgb():null},"name"])}let Cv;_v([Sv]);const kv=Es((function(e){if("string"!=typeof e)return"";if("string"==typeof(t=e)&&yv(t).isValid())return e;var t;if(!e.includes("var("))return"";if("undefined"==typeof document)return"";const n=function(){if("undefined"!=typeof document){if(!Cv){const e=document.createElement("div");e.setAttribute("data-g2-color-computation-node",""),document.body.appendChild(e),Cv=e}return Cv}}();if(!n)return"";n.style.background=e;const r=window?.getComputedStyle(n).background;return n.style.background="",r||""}));function jv(e){const t=function(e){const t=kv(e);return yv(t).isLight()?"#000000":"#ffffff"}(e);return"#000000"===t?"dark":"light"}const Ev=Nl("color:",zl.theme.foreground,";line-height:",Fl.fontLineHeightBase,";margin:0;text-wrap:balance;text-wrap:pretty;",""),Pv={name:"4zleql",styles:"display:block"},Nv=Nl("color:",zl.alert.green,";",""),Tv=Nl("color:",zl.alert.red,";",""),Iv=Nl("color:",zl.gray[700],";",""),Rv=Nl("mark{background:",zl.alert.yellow,";border-radius:",Fl.radiusSmall,";box-shadow:0 0 0 1px rgba( 0, 0, 0, 0.05 ) inset,0 -1px 0 rgba( 0, 0, 0, 0.1 ) inset;}",""),Mv={name:"50zrmy",styles:"text-transform:uppercase"};var Av=o(9664);const Dv=Es((e=>{const t={};for(const n in e)t[n.toLowerCase()]=e[n];return t}));const zv={body:13,caption:10,footnote:11,largeTitle:28,subheadline:12,title:20},Ov=[1,2,3,4,5,6].flatMap((e=>[e,e.toString()]));function Lv(e=13){if(e in zv)return Lv(zv[e]);if("number"!=typeof e){const t=parseFloat(e);if(Number.isNaN(t))return e;e=t}return`calc(${`(${e} / 13)`} * ${Fl.fontSize})`}function Fv(e=3){if(!Ov.includes(e))return Lv(e);return Fl[`fontSizeH${e}`]}var Bv={name:"50zrmy",styles:"text-transform:uppercase"};function Vv(t){const{adjustLineHeightForInnerControls:n,align:r,children:o,className:i,color:s,ellipsizeMode:a,isDestructive:l=!1,display:u,highlightEscape:d=!1,highlightCaseSensitive:p=!1,highlightWords:f,highlightSanitize:h,isBlock:m=!1,letterSpacing:g,lineHeight:v,optimizeReadabilityFor:b,size:x,truncate:y=!1,upperCase:w=!1,variant:_,weight:S=Fl.fontWeight,...C}=sl(t,"Text");let k=o;const j=Array.isArray(f),E="caption"===x;if(j){if("string"!=typeof o)throw new TypeError("`children` of `Text` must only be `string` types when `highlightWords` is defined");k=function({activeClassName:e="",activeIndex:t=-1,activeStyle:n,autoEscape:r,caseSensitive:o=!1,children:i,findChunks:s,highlightClassName:a="",highlightStyle:l={},highlightTag:u="mark",sanitize:d,searchWords:p=[],unhighlightClassName:f="",unhighlightStyle:h}){if(!i)return null;if("string"!=typeof i)return i;const m=i,g=(0,Av.findAll)({autoEscape:r,caseSensitive:o,findChunks:s,sanitize:d,searchWords:p,textToHighlight:m}),v=u;let b,x=-1,y="";const w=g.map(((r,i)=>{const s=m.substr(r.start,r.end-r.start);if(r.highlight){let r;x++,r="object"==typeof a?o?a[s]:(a=Dv(a))[s.toLowerCase()]:a;const u=x===+t;y=`${r} ${u?e:""}`,b=!0===u&&null!==n?Object.assign({},l,n):l;const d={children:s,className:y,key:i,style:b};return"string"!=typeof v&&(d.highlightIndex=x),(0,c.createElement)(v,d)}return(0,c.createElement)("span",{children:s,className:f,key:i,style:h})}));return w}({autoEscape:d,children:o,caseSensitive:p,searchWords:f,sanitize:h})}const P=il();let N;!0===y&&(N="auto"),!1===y&&(N="none");const T=Kg({...C,className:(0,c.useMemo)((()=>{const t={},o=function(e,t){if(t)return t;if(!e)return;let n=`calc(${Fl.controlHeight} + ${Il(2)})`;switch(e){case"large":n=`calc(${Fl.controlHeightLarge} + ${Il(2)})`;break;case"small":n=`calc(${Fl.controlHeightSmall} + ${Il(2)})`;break;case"xSmall":n=`calc(${Fl.controlHeightXSmall} + ${Il(2)})`}return n}(n,v);if(t.Base=Nl({color:s,display:u,fontSize:Lv(x),fontWeight:S,lineHeight:o,letterSpacing:g,textAlign:r},"",""),t.upperCase=Bv,t.optimalTextColor=null,b){const e="dark"===jv(b);t.optimalTextColor=Nl(e?{color:zl.gray[900]}:{color:zl.white},"","")}return P(Ev,t.Base,t.optimalTextColor,l&&Tv,!!j&&Rv,m&&Pv,E&&Iv,_&&e[_],w&&t.upperCase,i)}),[n,r,i,s,P,u,m,E,l,j,g,v,b,x,w,_,S]),children:o,ellipsizeMode:a||N});return!y&&Array.isArray(o)&&(k=c.Children.map(o,(e=>{if("object"!=typeof e||null===e||!("props"in e))return e;return dl(e,["Link"])?(0,c.cloneElement)(e,{size:e.props.size||"inherit"}):e}))),{...T,children:y?T.children:k}}const $v=al((function(e,t){const n=Vv(e);return(0,_t.jsx)(_l,{as:"span",...n,ref:t})}),"Text");const Hv={name:"9amh4a",styles:"font-size:11px;font-weight:500;line-height:1.4;text-transform:uppercase"};const Wv=yl("span",{target:"em5sgkm8"})({name:"pvvbxf",styles:"box-sizing:border-box;display:block"}),Uv=yl("span",{target:"em5sgkm7"})({name:"jgf79h",styles:"align-items:center;align-self:stretch;box-sizing:border-box;display:flex"}),Gv=({disabled:e,isBorderless:t})=>t?"transparent":e?zl.ui.borderDisabled:zl.ui.border,Kv=yl("div",{target:"em5sgkm6"})("&&&{box-sizing:border-box;border-color:",Gv,";border-radius:inherit;border-style:solid;border-width:1px;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;",Mg({paddingLeft:2}),";}"),qv=yl(kg,{target:"em5sgkm5"})("box-sizing:border-box;position:relative;border-radius:",Fl.radiusSmall,";padding-top:0;&:focus-within:not( :has( :is( ",Wv,", ",Uv," ):focus-within ) ){",Kv,"{border-color:",zl.ui.borderFocus,";box-shadow:",Fl.controlBoxShadowFocus,";outline:2px solid transparent;outline-offset:-2px;}}"),Yv=({disabled:e})=>Nl({backgroundColor:e?zl.ui.backgroundDisabled:zl.ui.background},"","");var Xv={name:"1d3w5wq",styles:"width:100%"};const Zv=({__unstableInputWidth:e,labelPosition:t})=>e?"side"===t?"":Nl("edge"===t?{flex:`0 0 ${e}`}:{width:e},"",""):Xv,Qv=yl("div",{target:"em5sgkm4"})("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;",Yv," ",Zv,";"),Jv=({disabled:e})=>e?Nl({color:zl.ui.textDisabled},"",""):"",eb=({inputSize:e})=>{const t={default:"13px",small:"11px",compact:"13px","__unstable-large":"13px"},n=t[e]||t.default;return n?Nl("font-size:","16px",";@media ( min-width: 600px ){font-size:",n,";}",""):""},tb=({inputSize:e,__next40pxDefaultSize:t})=>{const n={default:{height:40,lineHeight:1,minHeight:40,paddingLeft:Fl.controlPaddingX,paddingRight:Fl.controlPaddingX},small:{height:24,lineHeight:1,minHeight:24,paddingLeft:Fl.controlPaddingXSmall,paddingRight:Fl.controlPaddingXSmall},compact:{height:32,lineHeight:1,minHeight:32,paddingLeft:Fl.controlPaddingXSmall,paddingRight:Fl.controlPaddingXSmall},"__unstable-large":{height:40,lineHeight:1,minHeight:40,paddingLeft:Fl.controlPaddingX,paddingRight:Fl.controlPaddingX}};return t||(n.default=n.compact),n[e]||n.default},nb=e=>Nl(tb(e),"",""),rb=({paddingInlineStart:e,paddingInlineEnd:t})=>Nl({paddingInlineStart:e,paddingInlineEnd:t},"",""),ob=({isDragging:e,dragCursor:t})=>{let n,r;return e&&(n=Nl("cursor:",t,";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}","")),e&&t&&(r=Nl("&:active{cursor:",t,";}","")),Nl(n," ",r,";","")},ib=yl("input",{target:"em5sgkm3"})("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:",zl.theme.foreground,";display:block;font-family:inherit;margin:0;outline:none;width:100%;",ob," ",Jv," ",eb," ",nb," ",rb," &::-webkit-input-placeholder{color:",zl.ui.darkGrayPlaceholder,";}&::-moz-placeholder{color:",zl.ui.darkGrayPlaceholder,";}&:-ms-input-placeholder{color:",zl.ui.darkGrayPlaceholder,";}&[type='email'],&[type='url']{direction:ltr;}}"),sb=yl($v,{target:"em5sgkm2"})("&&&{",Hv,";box-sizing:border-box;display:block;padding-top:0;padding-bottom:0;max-width:100%;z-index:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}"),ab=e=>(0,_t.jsx)(sb,{...e,as:"label"}),lb=yl(Fg,{target:"em5sgkm1"})({name:"1b6uupn",styles:"max-width:calc( 100% - 10px )"}),cb=({variant:e="default",size:t,__next40pxDefaultSize:n,isPrefix:r})=>{const{paddingLeft:o}=tb({inputSize:t,__next40pxDefaultSize:n}),i=r?"paddingInlineStart":"paddingInlineEnd";return Nl("default"===e?{[i]:o}:{display:"flex",[i]:o-4},"","")},ub=yl("div",{target:"em5sgkm0"})(cb,";");const db=(0,c.memo)((function({disabled:e=!1,isBorderless:t=!1}){return(0,_t.jsx)(Kv,{"aria-hidden":"true",className:"components-input-control__backdrop",disabled:e,isBorderless:t})})),pb=db;function fb({children:e,hideLabelFromVision:t,htmlFor:n,...r}){return e?t?(0,_t.jsx)(Sl,{as:"label",htmlFor:n,children:e}):(0,_t.jsx)(lb,{children:(0,_t.jsx)(ab,{htmlFor:n,...r,children:e})}):null}function hb(e){const{__next36pxDefaultSize:t,__next40pxDefaultSize:n,...r}=e;return{...r,__next40pxDefaultSize:null!=n?n:t}}function mb(e){const t={};switch(e){case"top":t.direction="column",t.expanded=!1,t.gap=0;break;case"bottom":t.direction="column-reverse",t.expanded=!1,t.gap=0;break;case"edge":t.justify="space-between"}return t}function gb(e,t){const{__next40pxDefaultSize:n,__unstableInputWidth:r,children:o,className:i,disabled:s=!1,hideLabelFromVision:a=!1,labelPosition:u,id:d,isBorderless:p=!1,label:f,prefix:h,size:m="default",suffix:g,...v}=hb(sl(e,"InputBase")),b=function(e){const t=(0,l.useInstanceId)(gb);return e||`input-base-control-${t}`}(d),x=a||!f,y=(0,c.useMemo)((()=>({InputControlPrefixWrapper:{__next40pxDefaultSize:n,size:m},InputControlSuffixWrapper:{__next40pxDefaultSize:n,size:m}})),[n,m]);return(0,_t.jsxs)(qv,{...v,...mb(u),className:i,gap:2,ref:t,children:[(0,_t.jsx)(fb,{className:"components-input-control__label",hideLabelFromVision:a,labelPosition:u,htmlFor:b,children:f}),(0,_t.jsxs)(Qv,{__unstableInputWidth:r,className:"components-input-control__container",disabled:s,hideLabel:x,labelPosition:u,children:[(0,_t.jsxs)(gs,{value:y,children:[h&&(0,_t.jsx)(Wv,{className:"components-input-control__prefix",children:h}),o,g&&(0,_t.jsx)(Uv,{className:"components-input-control__suffix",children:g})]}),(0,_t.jsx)(pb,{disabled:s,isBorderless:p})]})]})}const vb=al(gb,"InputBase");const bb={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function xb(e,t,n){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*n):e*t*n/(t+n*e)}function yb(e,t,n,r=.15){return 0===r?function(e,t,n){return Math.max(t,Math.min(e,n))}(e,t,n):e<t?-xb(t-e,n-t,r)+t:e>n?+xb(e-n,n-t,r)+n:e}function wb(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function _b(e,t,n){return(t=wb(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Cb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sb(Object(n),!0).forEach((function(t){_b(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sb(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}const kb={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function jb(e){return e?e[0].toUpperCase()+e.slice(1):""}const Eb=["enter","leave"];function Pb(e,t="",n=!1){const r=kb[e],o=r&&r[t]||t;return"on"+jb(e)+jb(o)+(function(e=!1,t){return e&&!Eb.includes(t)}(n,o)?"Capture":"")}const Nb=["gotpointercapture","lostpointercapture"];function Tb(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=Nb.includes(t)?"capturecapture":"capture",o=!!~t.indexOf(r);return o&&(t=t.replace("capture","")),{device:t,capture:o,passive:n}}function Ib(e){return"touches"in e}function Rb(e){return Ib(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function Mb(e){return Ib(e)?function(e){return"touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches}(e)[0]:e}function Ab(e){return function(e){return Array.from(e.touches).filter((t=>{var n,r;return t.target===e.currentTarget||(null===(n=e.currentTarget)||void 0===n||null===(r=n.contains)||void 0===r?void 0:r.call(n,t.target))}))}(e).map((e=>e.identifier))}function Db(e){const t=Mb(e);return Ib(e)?t.identifier:t.pointerId}function zb(e){const t=Mb(e);return[t.clientX,t.clientY]}function Ob(e,...t){return"function"==typeof e?e(...t):e}function Lb(){}function Fb(...e){return 0===e.length?Lb:1===e.length?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Bb(e,t){return Object.assign({},t,e||{})}class Vb{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:r}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?Ob(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:r}=this;t.args=this.args;let o=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,o=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const e=t._delta.map(Math.abs);bb.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);const[i,s]=t._movement,[a,l]=n.threshold,{_step:c,values:u}=t;if(n.hasCustomTransform?(!1===c[0]&&(c[0]=Math.abs(i)>=a&&u[0]),!1===c[1]&&(c[1]=Math.abs(s)>=l&&u[1])):(!1===c[0]&&(c[0]=Math.abs(i)>=a&&Math.sign(i)*a),!1===c[1]&&(c[1]=Math.abs(s)>=l&&Math.sign(s)*l)),t.intentional=!1!==c[0]||!1!==c[1],!t.intentional)return;const d=[0,0];if(n.hasCustomTransform){const[e,t]=u;d[0]=!1!==c[0]?e-c[0]:0,d[1]=!1!==c[1]?t-c[1]:0}else d[0]=!1!==c[0]?i-c[0]:0,d[1]=!1!==c[1]?s-c[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(d);const p=t.offset,f=t._active&&!t._blocked||t.active;f&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=Ob(n.bounds,t)),this.setup&&this.setup()),t.movement=d,this.computeOffset()));const[h,m]=t.offset,[[g,v],[b,x]]=t._bounds;t.overflow=[h<g?-1:h>v?1:0,m<b?-1:m>x?1:0],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);const y=t._active&&n.rubberband||[0,0];if(t.offset=function(e,[t,n],[r,o]){const[[i,s],[a,l]]=e;return[yb(t,i,s,r),yb(n,a,l,o)]}(t._bounds,t.offset,y),t.delta=bb.sub(t.offset,p),this.computeMovement(),f&&(!t.last||o>32)){t.delta=bb.sub(t.offset,p);const e=t.delta.map(Math.abs);bb.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&o>0&&(t.velocity=[e[0]/o,e[1]/o],t.timeDelta=o)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const r=this.handler(Cb(Cb(Cb({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class $b extends Vb{constructor(...e){super(...e),_b(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=bb.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=bb.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const r="object"==typeof n.axisThreshold?n.axisThreshold[Rb(e)]:n.axisThreshold;t.axis=function([e,t],n){const r=Math.abs(e),o=Math.abs(t);return r>o&&r>n?"x":o>r&&o>n?"y":void 0}(t._movement,r)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}const Hb=e=>e,Wb={enabled:(e=!0)=>e,eventOptions:(e,t,n)=>Cb(Cb({},n.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return bb.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?bb.toVector(e):void 0,transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||Hb},threshold:e=>bb.toVector(e,0)};const Ub=Cb(Cb({},Wb),{},{axis(e,t,{axis:n}){if(this.lockDirection="lock"===n,!this.lockDirection)return n},axisThreshold:(e=0)=>e,bounds(e={}){if("function"==typeof e)return t=>Ub.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),Gb={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};const Kb="undefined"!=typeof window&&window.document&&window.document.createElement;function qb(){return Kb&&"ontouchstart"in window}const Yb={isBrowser:Kb,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:qb(),touchscreen:qb()||Kb&&window.navigator.maxTouchPoints>1,pointer:Kb&&"onpointerdown"in window,pointerLock:Kb&&"exitPointerLock"in window.document},Xb={mouse:0,touch:0,pen:8},Zb=Cb(Cb({},Ub),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Yb.pointerLock,Yb.touch&&n?"touch":this.pointerLock?"mouse":Yb.pointer&&!o?"pointer":Yb.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay="number"==typeof n?n:n||void 0===n&&e?250:void 0,Yb.touchscreen&&!1!==n)return e||(void 0!==n?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&"pointer"===this.device&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o}){const i=bb.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=.5,distance:t=50,duration:n=250}={}){return{velocity:this.transform(bb.toVector(e)),distance:this.transform(bb.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?Cb(Cb({},Xb),e):Xb,keyboardDisplacement:(e=10)=>e});Cb(Cb({},Wb),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Yb.touch&&Yb.gesture)return"gesture";if(Yb.touch&&r)return"touch";if(Yb.touchscreen){if(Yb.pointer)return"pointer";if(Yb.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=e=>{const t=Bb(Ob(n,e),{min:-1/0,max:1/0});return[t.min,t.max]},i=e=>{const t=Bb(Ob(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof n&&"function"!=typeof r?[o(),i()]:e=>[o(e),i(e)]},threshold(e,t,n){this.lockDirection="lock"===n.axis;return bb.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e});Cb(Cb({},Ub),{},{mouseOnly:(e=!0)=>e});Cb(Cb({},Ub),{},{mouseOnly:(e=!0)=>e});const Qb=new Map,Jb=new Map;const ex={key:"drag",engine:class extends $b{constructor(...e){super(...e),_b(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),r={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Ub.bounds(r)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout((()=>{this.compute(),this.emit()}),0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;const r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&n._pointerActive||(this.start(e),this.setupPointer(e),n._pointerId=Db(e),n._pointerActive=!0,this.computeValues(zb(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==Rb(e)?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const r=Db(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;const o=zb(e);return document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=bb.sub(o,t._values),this.computeValues(o)),bb.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional?(this.timeoutStore.remove("dragDelay"),t.active=!1,void this.startPointerDrag(e)):n.preventScrollAxis&&!t._preventScroll?t.axis?t.axis===n.preventScrollAxis||"xy"===n.preventScrollAxis?(t._active=!1,void this.clean()):(this.timeoutStore.remove("startPointerDrag"),void this.startPointerDrag(e)):void 0:void this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){0}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const r=Db(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[o,i]=t._distance;if(t.tap=o<=n.tapsThreshold&&i<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[e,r]=t._delta,[o,i]=t._movement,[s,a]=n.swipe.velocity,[l,c]=n.swipe.distance,u=n.swipe.duration;if(t.elapsedTime<u){const n=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);n>s&&Math.abs(o)>l&&(t.swipe[0]=Math.sign(e)),u>a&&Math.abs(i)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,function(e){"persist"in e&&"function"==typeof e.persist&&e.persist()}(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",(()=>{this.state._step=[0,0],this.startPointerDrag(e)}),this.config.delay)}keyDown(e){const t=Gb[e.key];if(t){const n=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,r),n._keyboardActive=!0,bb.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in Gb&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:Zb};function tx(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const nx={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=(Yb.isBrowser?window:void 0))=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},rx=["target","eventOptions","window","enabled","transform"];function ox(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=ox(e[r],o);break;case"boolean":o&&(n[r]=e[r])}return n}class ix{constructor(e,t){_b(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,r,o){const i=this._listeners,s=function(e,t=""){const n=kb[e];return e+(n&&n[t]||t)}(t,n),a=Cb(Cb({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),o);e.addEventListener(s,r,a);const l=()=>{e.removeEventListener(s,r,a),i.delete(l)};return i.add(l),l}clean(){this._listeners.forEach((e=>e())),this._listeners.clear()}}class sx{constructor(){_b(this,"_timeouts",new Map)}add(e,t,n=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...r))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach((e=>{window.clearTimeout(e)})),this._timeouts.clear()}}class ax{constructor(e){_b(this,"gestures",new Set),_b(this,"_targetEventStore",new ix(this)),_b(this,"gestureEventStores",{}),_b(this,"gestureTimeoutStores",{}),_b(this,"handlers",{}),_b(this,"config",{}),_b(this,"pointerIds",new Set),_b(this,"touchIds",new Set),_b(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&lx(e,"drag");t.wheel&&lx(e,"wheel");t.scroll&&lx(e,"scroll");t.move&&lx(e,"move");t.pinch&&lx(e,"pinch");t.hover&&lx(e,"hover")}(this,e)}setEventIds(e){return Ib(e)?(this.touchIds=new Set(Ab(e)),this.touchIds):"pointerId"in e?("pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds):void 0}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,n={}){const r=e,{target:o,eventOptions:i,window:s,enabled:a,transform:l}=r,c=tx(r,rx);if(n.shared=ox({target:o,eventOptions:i,window:s,enabled:a,transform:l},nx),t){const e=Jb.get(t);n[t]=ox(Cb({shared:n.shared},c),e)}else for(const e in c){const t=Jb.get(e);t&&(n[e]=ox(Cb({shared:n.shared},c[e]),t))}return n}(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let r;if(!t.target||(r=t.target(),r)){if(t.enabled){for(const t of this.gestures){const o=this.config[t],i=cx(n,o.eventOptions,!!r);if(o.enabled){new(Qb.get(t))(this,e,t).bind(i)}}const o=cx(n,t.eventOptions,!!r);for(const t in this.nativeHandlers)o(t,"",(n=>this.nativeHandlers[t](Cb(Cb({},this.state.shared),{},{event:n,args:e}))),void 0,!0)}for(const e in n)n[e]=Fb(...n[e]);if(!r)return n;for(const e in n){const{device:t,capture:o,passive:i}=Tb(e);this._targetEventStore.add(r,t,"",n[e],{capture:o,passive:i})}}}}function lx(e,t){e.gestures.add(t),e.gestureEventStores[t]=new ix(e,t),e.gestureTimeoutStores[t]=new sx}const cx=(e,t,n)=>(r,o,i,s={},a=!1)=>{var l,c;const u=null!==(l=s.capture)&&void 0!==l?l:t.capture,d=null!==(c=s.passive)&&void 0!==c?c:t.passive;let p=a?r:Pb(r,o,u);n&&d&&(p+="Passive"),e[p]=e[p]||[],e[p].push(i)};function ux(e,t={},n,r){const o=$().useMemo((()=>new ax(e)),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),$().useEffect(o.effect.bind(o)),$().useEffect((()=>o.clean.bind(o)),[]),void 0===t.target)return o.bind.bind(o)}function dx(e,t){var n;return n=ex,Qb.set(n.key,n.engine),Jb.set(n.key,n.resolver),ux({drag:e},t||{},"drag")}const px=e=>e,fx={error:null,initialValue:"",isDirty:!1,isDragEnabled:!1,isDragging:!1,isPressEnterToChange:!1,value:""},hx="CHANGE",mx="COMMIT",gx="CONTROL",vx="DRAG_END",bx="DRAG_START",xx="DRAG",yx="INVALIDATE",wx="PRESS_DOWN",_x="PRESS_ENTER",Sx="PRESS_UP",Cx="RESET";function kx(e=px,t=fx,n){const[r,o]=(0,c.useReducer)((i=e,(e,t)=>{const n={...e};switch(t.type){case gx:return n.value=t.payload.value,n.isDirty=!1,n._event=void 0,n;case Sx:case wx:n.isDirty=!1;break;case bx:n.isDragging=!0;break;case vx:n.isDragging=!1;break;case hx:n.error=null,n.value=t.payload.value,e.isPressEnterToChange&&(n.isDirty=!0);break;case mx:n.value=t.payload.value,n.isDirty=!1;break;case Cx:n.error=null,n.isDirty=!1,n.value=t.payload.value||e.initialValue;break;case yx:n.error=t.payload.error}return n._event=t.payload.event,i(n,t)}),function(e=fx){const{value:t}=e;return{...fx,...e,initialValue:t}}(t));var i;const s=e=>(t,n)=>{o({type:e,payload:{value:t,event:n}})},a=e=>t=>{o({type:e,payload:{event:t}})},l=e=>t=>{o({type:e,payload:t})},u=s(hx),d=s(Cx),p=s(mx),f=l(bx),h=l(xx),m=l(vx),g=a(Sx),v=a(wx),b=a(_x),x=(0,c.useRef)(r),y=(0,c.useRef)({value:t.value,onChangeHandler:n});return(0,c.useLayoutEffect)((()=>{x.current=r,y.current={value:t.value,onChangeHandler:n}})),(0,c.useLayoutEffect)((()=>{var e;void 0===x.current._event||r.value===y.current.value||r.isDirty||y.current.onChangeHandler(null!==(e=r.value)&&void 0!==e?e:"",{event:x.current._event})}),[r.value,r.isDirty]),(0,c.useLayoutEffect)((()=>{var e;t.value===x.current.value||x.current.isDirty||o({type:gx,payload:{value:null!==(e=t.value)&&void 0!==e?e:""}})}),[t.value]),{change:u,commit:p,dispatch:o,drag:h,dragEnd:m,dragStart:f,invalidate:(e,t)=>o({type:yx,payload:{error:e,event:t}}),pressDown:v,pressEnter:b,pressUp:g,reset:d,state:r}}function jx(e){return t=>{const{isComposing:n}="nativeEvent"in t?t.nativeEvent:t;n||229===t.keyCode||e(t)}}const Ex=()=>{};const Px=(0,c.forwardRef)((function({disabled:e=!1,dragDirection:t="n",dragThreshold:n=10,id:r,isDragEnabled:o=!1,isPressEnterToChange:i=!1,onBlur:s=Ex,onChange:a=Ex,onDrag:l=Ex,onDragEnd:u=Ex,onDragStart:d=Ex,onKeyDown:p=Ex,onValidate:f=Ex,size:h="default",stateReducer:m=e=>e,value:g,type:v,...b},x){const{state:y,change:w,commit:_,drag:S,dragEnd:C,dragStart:k,invalidate:j,pressDown:E,pressEnter:P,pressUp:N,reset:T}=kx(m,{isDragEnabled:o,value:g,isPressEnterToChange:i},a),{value:I,isDragging:R,isDirty:M}=y,A=(0,c.useRef)(!1),D=function(e,t){const n=function(e){let t="ns-resize";switch(e){case"n":case"s":t="ns-resize";break;case"e":case"w":t="ew-resize"}return t}(t);return(0,c.useEffect)((()=>{document.documentElement.style.cursor=e?n:null}),[e,n]),n}(R,t),z=e=>{const t=e.currentTarget.value;try{f(t),_(t,e)}catch(t){j(t,e)}},O=dx((e=>{const{distance:t,dragging:n,event:r,target:o}=e;if(e.event={...e.event,target:o},t){if(r.stopPropagation(),!n)return u(e),void C(e);l(e),S(e),R||(d(e),k(e))}}),{axis:"e"===t||"w"===t?"x":"y",threshold:n,enabled:o,pointer:{capture:!1}}),L=o?O():{};let F;return"number"===v&&(F=e=>{b.onMouseDown?.(e),e.currentTarget!==e.currentTarget.ownerDocument.activeElement&&e.currentTarget.focus()}),(0,_t.jsx)(ib,{...b,...L,className:"components-input-control__input",disabled:e,dragCursor:D,isDragging:R,id:r,onBlur:e=>{s(e),!M&&e.target.validity.valid||(A.current=!0,z(e))},onChange:e=>{const t=e.target.value;w(t,e)},onKeyDown:jx((e=>{const{key:t}=e;switch(p(e),t){case"ArrowUp":N(e);break;case"ArrowDown":E(e);break;case"Enter":P(e),i&&(e.preventDefault(),z(e));break;case"Escape":i&&M&&(e.preventDefault(),T(g,e))}})),onMouseDown:F,ref:x,inputSize:h,value:null!=I?I:"",type:v})})),Nx=Px,Tx={"default.fontFamily":"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif","default.fontSize":"13px","helpText.fontSize":"12px",mobileTextMinFontSize:"16px"};function Ix(e){var t;return null!==(t=Tx[e])&&void 0!==t?t:""}const Rx={name:"kv6lnz",styles:"box-sizing:border-box;*,*::before,*::after{box-sizing:inherit;}"};const Mx=yl("div",{target:"ej5x27r4"})("font-family:",Ix("default.fontFamily"),";font-size:",Ix("default.fontSize"),";",Rx,";"),Ax=({__nextHasNoMarginBottom:e=!1})=>!e&&Nl("margin-bottom:",Il(2),";",""),Dx=yl("div",{target:"ej5x27r3"})(Ax," .components-panel__row &{margin-bottom:inherit;}"),zx=Nl(Hv,";display:block;margin-bottom:",Il(2),";padding:0;",""),Ox=yl("label",{target:"ej5x27r2"})(zx,";");var Lx={name:"11yad0w",styles:"margin-bottom:revert"};const Fx=({__nextHasNoMarginBottom:e=!1})=>!e&&Lx,Bx=yl("p",{target:"ej5x27r1"})("margin-top:",Il(2),";margin-bottom:0;font-size:",Ix("helpText.fontSize"),";font-style:normal;color:",zl.gray[700],";",Fx,";"),Vx=yl("span",{target:"ej5x27r0"})(zx,";"),$x=(0,c.forwardRef)(((e,t)=>{const{className:n,children:r,...o}=e;return(0,_t.jsx)(Vx,{ref:t,...o,className:s("components-base-control__label",n),children:r})})),Hx=Object.assign(ll((e=>{const{__nextHasNoMarginBottom:t=!1,__associatedWPComponentName:n="BaseControl",id:r,label:o,hideLabelFromVision:i=!1,help:s,className:a,children:l}=sl(e,"BaseControl");return t||Xi()(`Bottom margin styles for wp.components.${n}`,{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."}),(0,_t.jsxs)(Mx,{className:a,children:[(0,_t.jsxs)(Dx,{className:"components-base-control__field",__nextHasNoMarginBottom:t,children:[o&&r&&(i?(0,_t.jsx)(Sl,{as:"label",htmlFor:r,children:o}):(0,_t.jsx)(Ox,{className:"components-base-control__label",htmlFor:r,children:o})),o&&!r&&(i?(0,_t.jsx)(Sl,{as:"label",children:o}):(0,_t.jsx)($x,{children:o})),l]}),!!s&&(0,_t.jsx)(Bx,{id:r?r+"__help":void 0,className:"components-base-control__help",__nextHasNoMarginBottom:t,children:s})]})}),"BaseControl"),{VisualLabel:$x}),Wx=Hx;function Ux({componentName:e,__next40pxDefaultSize:t,size:n,__shouldNotWarnDeprecated36pxSize:r}){r||t||void 0!==n&&"default"!==n||Xi()(`36px default size for wp.components.${e}`,{since:"6.8",version:"7.1",hint:"Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version."})}const Gx=()=>{};const Kx=(0,c.forwardRef)((function(e,t){const{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:r,__unstableStateReducer:o=e=>e,__unstableInputWidth:i,className:a,disabled:u=!1,help:d,hideLabelFromVision:p=!1,id:f,isPressEnterToChange:h=!1,label:m,labelPosition:g="top",onChange:v=Gx,onValidate:b=Gx,onKeyDown:x=Gx,prefix:y,size:w="default",style:_,suffix:S,value:C,...k}=hb(e),j=function(e){const t=(0,l.useInstanceId)(Kx);return e||`inspector-input-control-${t}`}(f),E=s("components-input-control",a),P=function(e){const t=(0,c.useRef)(e.value),[n,r]=(0,c.useState)({}),o=void 0!==n.value?n.value:e.value;return(0,c.useLayoutEffect)((()=>{const{current:o}=t;t.current=e.value,void 0===n.value||n.isStale?n.isStale&&e.value!==o&&r({}):r({...n,isStale:!0})}),[e.value,n]),{value:o,onBlur:t=>{r({}),e.onBlur?.(t)},onChange:(t,n)=>{r((e=>Object.assign(e,{value:t,isStale:!1}))),e.onChange(t,n)}}}({value:C,onBlur:k.onBlur,onChange:v}),N=d?{"aria-describedby":`${j}__help`}:{};return Ux({componentName:"InputControl",__next40pxDefaultSize:n,size:w,__shouldNotWarnDeprecated36pxSize:r}),(0,_t.jsx)(Wx,{className:E,help:d,id:j,__nextHasNoMarginBottom:!0,children:(0,_t.jsx)(vb,{__next40pxDefaultSize:n,__unstableInputWidth:i,disabled:u,gap:3,hideLabelFromVision:p,id:j,justify:"left",label:m,labelPosition:g,prefix:y,size:w,style:_,suffix:S,children:(0,_t.jsx)(Nx,{...k,...N,__next40pxDefaultSize:n,className:"components-input-control__input",disabled:u,id:j,isPressEnterToChange:h,onKeyDown:x,onValidate:b,paddingInlineStart:y?Il(1):void 0,paddingInlineEnd:S?Il(1):void 0,ref:t,size:w,stateReducer:o,...P})})})})),qx=Kx;const Yx=function({icon:e,className:t,size:n=20,style:r={},...o}){const i=["dashicon","dashicons","dashicons-"+e,t].filter(Boolean).join(" "),s={...20!=n?{fontSize:`${n}px`,width:`${n}px`,height:`${n}px`}:{},...r};return(0,_t.jsx)("span",{className:i,style:s,...o})};const Xx=function({icon:e=null,size:t=("string"==typeof e?20:24),...r}){if("string"==typeof e)return(0,_t.jsx)(Yx,{icon:e,size:t,...r});if((0,c.isValidElement)(e)&&Yx===e.type)return(0,c.cloneElement)(e,{...r});if("function"==typeof e)return(0,c.createElement)(e,{size:t,...r});if(e&&("svg"===e.type||e.type===n.SVG)){const o={...e.props,width:t,height:t,...r};return(0,_t.jsx)(n.SVG,{...o})}return(0,c.isValidElement)(e)?(0,c.cloneElement)(e,{size:t,...r}):e},Zx=["onMouseDown","onClick"];const Qx=(0,c.forwardRef)((function(e,t){const{__next40pxDefaultSize:n,accessibleWhenDisabled:r,isBusy:o,isDestructive:i,className:a,disabled:c,icon:u,iconPosition:d="left",iconSize:p,showTooltip:f,tooltipPosition:h,shortcut:m,label:g,children:v,size:b="default",text:x,variant:y,description:w,..._}=function({__experimentalIsFocusable:e,isDefault:t,isPrimary:n,isSecondary:r,isTertiary:o,isLink:i,isPressed:s,isSmall:a,size:l,variant:c,describedBy:u,...d}){let p=l,f=c;const h={accessibleWhenDisabled:e,"aria-pressed":s,description:u};var m,g,v,b,x,y;return a&&(null!==(m=p)&&void 0!==m||(p="small")),n&&(null!==(g=f)&&void 0!==g||(f="primary")),o&&(null!==(v=f)&&void 0!==v||(f="tertiary")),r&&(null!==(b=f)&&void 0!==b||(f="secondary")),t&&(Xi()("wp.components.Button `isDefault` prop",{since:"5.4",alternative:'variant="secondary"'}),null!==(x=f)&&void 0!==x||(f="secondary")),i&&(null!==(y=f)&&void 0!==y||(f="link")),{...h,...d,size:p,variant:f}}(e),{href:S,target:C,"aria-checked":k,"aria-pressed":j,"aria-selected":E,...P}="href"in _?_:{href:void 0,target:void 0,..._},N=(0,l.useInstanceId)(Qx,"components-button__description"),T="string"==typeof v&&!!v||Array.isArray(v)&&v?.[0]&&null!==v[0]&&"components-tooltip"!==v?.[0]?.props?.className,I=s("components-button",a,{"is-next-40px-default-size":n,"is-secondary":"secondary"===y,"is-primary":"primary"===y,"is-small":"small"===b,"is-compact":"compact"===b,"is-tertiary":"tertiary"===y,"is-pressed":[!0,"true","mixed"].includes(j),"is-pressed-mixed":"mixed"===j,"is-busy":o,"is-link":"link"===y,"is-destructive":i,"has-text":!!u&&(T||x),"has-icon":!!u}),R=c&&!r,M=void 0===S||c?"button":"a",A="button"===M?{type:"button",disabled:R,"aria-checked":k,"aria-pressed":j,"aria-selected":E}:{},D="a"===M?{href:S,target:C}:{},z={};if(c&&r){A["aria-disabled"]=!0,D["aria-disabled"]=!0;for(const e of Zx)z[e]=e=>{e&&(e.stopPropagation(),e.preventDefault())}}const O=!R&&(f&&!!g||!!m||!!g&&!v?.length&&!1!==f),L=w?N:void 0,F=P["aria-describedby"]||L,B={className:I,"aria-label":P["aria-label"]||g,"aria-describedby":F,ref:t},V=(0,_t.jsxs)(_t.Fragment,{children:[u&&"left"===d&&(0,_t.jsx)(Xx,{icon:u,size:p}),x&&(0,_t.jsx)(_t.Fragment,{children:x}),v,u&&"right"===d&&(0,_t.jsx)(Xx,{icon:u,size:p})]}),$="a"===M?(0,_t.jsx)("a",{...D,...P,...z,...B,children:V}):(0,_t.jsx)("button",{...A,...P,...z,...B,children:V}),H=O?{text:v?.length&&w?w:g,shortcut:m,placement:h&&Ji(h)}:{};return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(ss,{...H,children:$}),w&&(0,_t.jsx)(Sl,{children:(0,_t.jsx)("span",{id:L,children:w})})]})})),Jx=Qx;var ey={name:"euqsgg",styles:"input[type='number']::-webkit-outer-spin-button,input[type='number']::-webkit-inner-spin-button{-webkit-appearance:none!important;margin:0!important;}input[type='number']{-moz-appearance:textfield;}"};const ty=({hideHTMLArrows:e})=>e?ey:"",ny=yl(qx,{target:"ep09it41"})(ty,";"),ry=yl(Jx,{target:"ep09it40"})("&&&&&{color:",zl.theme.accent,";}"),oy={smallSpinButtons:Nl("width:",Il(5),";min-width:",Il(5),";height:",Il(5),";","")};function iy(e){const t=Number(e);return isNaN(t)?0:t}function sy(...e){return e.reduce(((e,t)=>e+iy(t)),0)}function ay(e,t,n){const r=iy(e);return Math.max(t,Math.min(r,n))}function ly(e=0,t=1/0,n=1/0,r=1){const o=iy(e),i=iy(r),s=function(e){const t=(e+"").split(".");return void 0!==t[1]?t[1].length:0}(r),a=ay(Math.round(o/i)*i,t,n);return s?iy(a.toFixed(s)):a}const cy={bottom:{align:"flex-end",justify:"center"},bottomLeft:{align:"flex-end",justify:"flex-start"},bottomRight:{align:"flex-end",justify:"flex-end"},center:{align:"center",justify:"center"},edge:{align:"center",justify:"space-between"},left:{align:"center",justify:"flex-start"},right:{align:"center",justify:"flex-end"},stretch:{align:"stretch"},top:{align:"flex-start",justify:"center"},topLeft:{align:"flex-start",justify:"flex-start"},topRight:{align:"flex-start",justify:"flex-end"}},uy={bottom:{justify:"flex-end",align:"center"},bottomLeft:{justify:"flex-end",align:"flex-start"},bottomRight:{justify:"flex-end",align:"flex-end"},center:{justify:"center",align:"center"},edge:{justify:"space-between",align:"center"},left:{justify:"center",align:"flex-start"},right:{justify:"center",align:"flex-end"},stretch:{align:"stretch"},top:{justify:"flex-start",align:"center"},topLeft:{justify:"flex-start",align:"flex-start"},topRight:{justify:"flex-start",align:"flex-end"}};function dy(e){return"string"==typeof e?[e]:c.Children.toArray(e).filter((e=>(0,c.isValidElement)(e)))}function py(e){const{alignment:t="edge",children:n,direction:r,spacing:o=2,...i}=sl(e,"HStack"),s=function(e,t="row"){if(!Vg(e))return{};const n="column"===t?uy:cy;return e in n?n[e]:{align:e}}(t,r),a=dy(n).map(((e,t)=>{if(dl(e,["Spacer"])){const n=e,r=n.key||`hstack-${t}`;return(0,_t.jsx)(Fg,{isBlock:!0,...n.props},r)}return e})),l={children:a,direction:r,justify:"center",...s,...i,gap:o},{isColumn:c,...u}=Sg(l);return u}const fy=al((function(e,t){const n=py(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"HStack"),hy=()=>{};const my=(0,c.forwardRef)((function(e,t){const{__unstableStateReducer:n,className:r,dragDirection:o="n",hideHTMLArrows:i=!1,spinControls:u=(i?"none":"native"),isDragEnabled:d=!0,isShiftStepEnabled:p=!0,label:f,max:h=1/0,min:m=-1/0,required:g=!1,shiftStep:v=10,step:b=1,spinFactor:x=1,type:y="number",value:w,size:_="default",suffix:S,onChange:C=hy,__shouldNotWarnDeprecated36pxSize:k,...j}=hb(e);Ux({componentName:"NumberControl",size:_,__next40pxDefaultSize:j.__next40pxDefaultSize,__shouldNotWarnDeprecated36pxSize:k}),i&&Xi()("wp.components.NumberControl hideHTMLArrows prop ",{alternative:'spinControls="none"',since:"6.2",version:"6.3"});const E=(0,c.useRef)(),P=(0,l.useMergeRefs)([E,t]),N="any"===b,T=N?1:$g(b),I=$g(x)*T,R=ly(0,m,h,T),M=(e,t)=>N?""+Math.min(h,Math.max(m,$g(e))):""+ly(e,m,h,null!=t?t:T),A="number"===y?"off":void 0,D=s("components-number-control",r),z=il()("small"===_&&oy.smallSpinButtons),O=(e,t,n)=>{n?.preventDefault();const r=n?.shiftKey&&p,o=r?$g(v)*I:I;let i=function(e){const t=""===e;return!Vg(e)||t}(e)?R:e;return"up"===t?i=sy(i,o):"down"===t&&(i=function(...e){return e.reduce(((e,t,n)=>{const r=iy(t);return 0===n?r:e-r}),0)}(i,o)),M(i,r?o:void 0)},L=e=>t=>C(String(O(w,e,t)),{event:{...t,target:E.current}});return(0,_t.jsx)(ny,{autoComplete:A,inputMode:"numeric",...j,className:D,dragDirection:o,hideHTMLArrows:"native"!==u,isDragEnabled:d,label:f,max:h===1/0?void 0:h,min:m===-1/0?void 0:m,ref:P,required:g,step:b,type:y,value:w,__unstableStateReducer:(e,t)=>{var r;const i=((e,t)=>{const n={...e},{type:r,payload:i}=t,s=i.event,l=n.value;if(r!==Sx&&r!==wx||(n.value=O(l,r===Sx?"up":"down",s)),r===xx&&d){const[e,t]=i.delta,r=i.shiftKey&&p,s=r?$g(v)*I:I;let c,u;switch(o){case"n":u=t,c=-1;break;case"e":u=e,c=(0,a.isRTL)()?-1:1;break;case"s":u=t,c=1;break;case"w":u=e,c=(0,a.isRTL)()?1:-1}if(0!==u){u=Math.ceil(Math.abs(u))*Math.sign(u);const e=u*s*c;n.value=M(sy(l,e),r?s:void 0)}}if(r===_x||r===mx){const e=!1===g&&""===l;n.value=e?l:M(l)}return n})(e,t);return null!==(r=n?.(i,t))&&void 0!==r?r:i},size:_,__shouldNotWarnDeprecated36pxSize:!0,suffix:"custom"===u?(0,_t.jsxs)(_t.Fragment,{children:[S,(0,_t.jsx)(zg,{marginBottom:0,marginRight:2,children:(0,_t.jsxs)(fy,{spacing:1,children:[(0,_t.jsx)(ry,{className:z,icon:Og,size:"small",label:(0,a.__)("Increment"),onClick:L("up")}),(0,_t.jsx)(ry,{className:z,icon:Lg,size:"small",label:(0,a.__)("Decrement"),onClick:L("down")})]})})]}):S,onChange:C})})),gy=my;const vy=yl("div",{target:"eln3bjz3"})("border-radius:",Fl.radiusRound,";border:",Fl.borderWidth," solid ",zl.ui.border,";box-sizing:border-box;cursor:grab;height:",32,"px;overflow:hidden;width:",32,"px;:active{cursor:grabbing;}"),by=yl("div",{target:"eln3bjz2"})({name:"1r307gh",styles:"box-sizing:border-box;position:relative;width:100%;height:100%;:focus-visible{outline:none;}"}),xy=yl("div",{target:"eln3bjz1"})("background:",zl.theme.accent,";border-radius:",Fl.radiusRound,";box-sizing:border-box;display:block;left:50%;top:4px;transform:translateX( -50% );position:absolute;width:",6,"px;height:",6,"px;"),yy=yl($v,{target:"eln3bjz0"})("color:",zl.theme.accent,";margin-right:",Il(3),";");const wy=function({value:e,onChange:t,...n}){const r=(0,c.useRef)(null),o=(0,c.useRef)(),i=(0,c.useRef)(),s=e=>{if(void 0!==e&&(e.preventDefault(),e.target?.focus(),void 0!==o.current&&void 0!==t)){const{x:n,y:r}=o.current;t(function(e,t,n,r){const o=r-t,i=n-e,s=Math.atan2(o,i),a=Math.round(s*(180/Math.PI))+90;if(a<0)return 360+a;return a}(n,r,e.clientX,e.clientY))}},{startDrag:a,isDragging:u}=(0,l.__experimentalUseDragging)({onDragStart:e=>{(()=>{if(null===r.current)return;const e=r.current.getBoundingClientRect();o.current={x:e.x+e.width/2,y:e.y+e.height/2}})(),s(e)},onDragMove:s,onDragEnd:s});return(0,c.useEffect)((()=>{u?(void 0===i.current&&(i.current=document.body.style.cursor),document.body.style.cursor="grabbing"):(document.body.style.cursor=i.current||"",i.current=void 0)}),[u]),(0,_t.jsx)(vy,{ref:r,onMouseDown:a,className:"components-angle-picker-control__angle-circle",...n,children:(0,_t.jsx)(by,{style:e?{transform:`rotate(${e}deg)`}:void 0,className:"components-angle-picker-control__angle-circle-indicator-wrapper",tabIndex:-1,children:(0,_t.jsx)(xy,{className:"components-angle-picker-control__angle-circle-indicator"})})})};const _y=(0,c.forwardRef)((function(e,t){const{className:n,label:r=(0,a.__)("Angle"),onChange:o,value:i,...l}=e,c=s("components-angle-picker-control",n),u=(0,_t.jsx)(yy,{children:"°"}),[d,p]=(0,a.isRTL)()?[u,null]:[null,u];return(0,_t.jsxs)(kg,{...l,ref:t,className:c,gap:2,children:[(0,_t.jsx)(Eg,{children:(0,_t.jsx)(gy,{__next40pxDefaultSize:!0,label:r,className:"components-angle-picker-control__input-field",max:360,min:0,onChange:e=>{if(void 0===o)return;const t=void 0!==e&&""!==e?parseInt(e,10):0;o(t)},step:"1",value:i,spinControls:"none",prefix:d,suffix:p})}),(0,_t.jsx)(zg,{marginBottom:"1",marginTop:"auto",children:(0,_t.jsx)(wy,{"aria-hidden":"true",value:i,onChange:o})})]})}));var Sy=o(9681),Cy=o.n(Sy);const ky=window.wp.richText,jy=window.wp.a11y,Ey=window.wp.keycodes,Py=new RegExp(/[\u007e\u00ad\u2053\u207b\u208b\u2212\p{Pd}]/gu),Ny=e=>Cy()(e).toLocaleLowerCase().replace(Py,"-");function Ty(e){var t;let n=null!==(t=e?.toString?.())&&void 0!==t?t:"";return n=n.replace(/['\u2019]/,""),js(n,{splitRegexp:[/(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g,/(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g,/([A-Za-z])([0-9])/g,/([A-Z])([A-Z][a-z])/g]})}function Iy(e){return e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&")}function Ry(e){return t=>{const[n,r]=(0,c.useState)([]);return(0,c.useLayoutEffect)((()=>{const{options:n,isDebounced:o}=e,i=(0,l.debounce)((()=>{const o=Promise.resolve("function"==typeof n?n(t):n).then((n=>{if(o.canceled)return;const i=n.map(((t,n)=>({key:`${e.name}-${n}`,value:t,label:e.getOptionLabel(t),keywords:e.getOptionKeywords?e.getOptionKeywords(t):[],isDisabled:!!e.isOptionDisabled&&e.isOptionDisabled(t)}))),s=new RegExp("(?:\\b|\\s|^)"+Iy(t),"i");r(function(e,t=[],n=10){const r=[];for(let o=0;o<t.length;o++){const i=t[o];let{keywords:s=[]}=i;if("string"==typeof i.label&&(s=[...s,i.label]),s.some((t=>e.test(Cy()(t))))&&(r.push(i),r.length===n))break}return r}(s,i))}));return o}),o?250:0),s=i();return()=>{i.cancel(),s&&(s.canceled=!0)}}),[t]),[n]}}const My=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Ii({element:n.current,padding:r}).fn(t):{}:n?Ii({element:n,padding:r}).fn(t):{};var o}});var Ay="undefined"!=typeof document?B.useLayoutEffect:B.useEffect;function Dy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Dy(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Dy(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function zy(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oy(e,t){const n=zy(e);return Math.round(t*n)/n}function Ly(e){const t=B.useRef(e);return Ay((()=>{t.current=e})),t}const Fy=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z"})});let By=0;function Vy(e){const t=document.scrollingElement||document.body;e&&(By=t.scrollTop);const n=e?"add":"remove";t.classList[n]("lockscroll"),document.documentElement.classList[n]("lockscroll"),e||(t.scrollTop=By)}let $y=0;const Hy=function(){return(0,c.useEffect)((()=>(0===$y&&Vy(!0),++$y,()=>{1===$y&&Vy(!1),--$y})),[]),null},Wy={slots:(0,l.observableMap)(),fills:(0,l.observableMap)(),registerSlot:()=>{},updateSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},isDefault:!0},Uy=(0,c.createContext)(Wy);function Gy(e){const t=(0,c.useContext)(Uy);return{...(0,l.useObservableValue)(t.slots,e)}}const Ky={slots:(0,l.observableMap)(),fills:(0,l.observableMap)(),registerSlot:()=>{},unregisterSlot:()=>{},registerFill:()=>{},unregisterFill:()=>{},updateFill:()=>{}},qy=(0,c.createContext)(Ky);function Yy({name:e,children:t}){const n=(0,c.useContext)(qy),r=(0,c.useRef)({}),o=(0,c.useRef)(t);return(0,c.useLayoutEffect)((()=>{o.current=t}),[t]),(0,c.useLayoutEffect)((()=>{const t=r.current;return n.registerFill(e,t,o.current),()=>n.unregisterFill(e,t)}),[n,e]),(0,c.useLayoutEffect)((()=>{n.updateFill(e,r.current,o.current)})),null}function Xy(e){return"function"==typeof e}const Zy=function(e){var t;const n=(0,c.useContext)(qy),r=(0,c.useRef)({}),{name:o,children:i,fillProps:s={}}=e;(0,c.useLayoutEffect)((()=>{const e=r.current;return n.registerSlot(o,e),()=>n.unregisterSlot(o,e)}),[n,o]);let a=null!==(t=(0,l.useObservableValue)(n.fills,o))&&void 0!==t?t:[];(0,l.useObservableValue)(n.slots,o)!==r.current&&(a=[]);const u=a.map((e=>function(e){return c.Children.map(e,((e,t)=>{if(!e||"string"==typeof e)return e;let n=t;return"object"==typeof e&&"key"in e&&e?.key&&(n=e.key),(0,c.cloneElement)(e,{key:n})}))}(Xy(e.children)?e.children(s):e.children))).filter((e=>!(0,c.isEmptyElement)(e)));return(0,_t.jsx)(_t.Fragment,{children:Xy(i)?i(u):u})},Qy={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Jy;const ew=new Uint8Array(16);function tw(){if(!Jy&&(Jy="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Jy))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Jy(ew)}const nw=[];for(let e=0;e<256;++e)nw.push((e+256).toString(16).slice(1));function rw(e,t=0){return nw[e[t+0]]+nw[e[t+1]]+nw[e[t+2]]+nw[e[t+3]]+"-"+nw[e[t+4]]+nw[e[t+5]]+"-"+nw[e[t+6]]+nw[e[t+7]]+"-"+nw[e[t+8]]+nw[e[t+9]]+"-"+nw[e[t+10]]+nw[e[t+11]]+nw[e[t+12]]+nw[e[t+13]]+nw[e[t+14]]+nw[e[t+15]]}const ow=function(e,t,n){if(Qy.randomUUID&&!t&&!e)return Qy.randomUUID();const r=(e=e||{}).random||(e.rng||tw)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(let e=0;e<16;++e)t[n+e]=r[e];return t}return rw(r)},iw=new Set,sw=new WeakMap;function aw(e){const{children:t,document:n}=e;if(!n)return null;const r=(e=>{if(sw.has(e))return sw.get(e);let t=ow().replace(/[0-9]/g,"");for(;iw.has(t);)t=ow().replace(/[0-9]/g,"");iw.add(t);const n=Ta({container:e,key:t});return sw.set(e,n),n})(n.head);return(0,_t.jsx)(Ka,{value:r,children:t})}const lw=aw;function cw({name:e,children:t}){var n;const r=(0,c.useContext)(Uy),o=(0,l.useObservableValue)(r.slots,e),i=(0,c.useRef)({});if((0,c.useEffect)((()=>{const t=i.current;return r.registerFill(e,t),()=>r.unregisterFill(e,t)}),[r,e]),!o||!o.ref.current)return null;const s=(0,_t.jsx)(lw,{document:o.ref.current.ownerDocument,children:"function"==typeof t?t(null!==(n=o.fillProps)&&void 0!==n?n:{}):t});return(0,c.createPortal)(s,o.ref.current)}const uw=(0,c.forwardRef)((function(e,t){const{name:n,fillProps:r={},as:o,children:i,...s}=e,a=(0,c.useContext)(Uy),u=(0,c.useRef)(null),d=(0,c.useRef)(r);return(0,c.useLayoutEffect)((()=>{d.current=r}),[r]),(0,c.useLayoutEffect)((()=>(a.registerSlot(n,u,d.current),()=>a.unregisterSlot(n,u))),[a,n]),(0,c.useLayoutEffect)((()=>{a.updateSlot(n,u,d.current)})),(0,_t.jsx)(_l,{as:o,ref:(0,l.useMergeRefs)([t,u]),...s})})),dw=window.wp.isShallowEqual;var pw=o.n(dw);function fw(){const e=(0,l.observableMap)(),t=(0,l.observableMap)();return{slots:e,fills:t,registerSlot:(t,n,r)=>{e.set(t,{ref:n,fillProps:r})},updateSlot:(t,n,r)=>{const o=e.get(t);o&&o.ref===n&&(pw()(o.fillProps,r)||e.set(t,{ref:n,fillProps:r}))},unregisterSlot:(t,n)=>{const r=e.get(t);r&&r.ref===n&&e.delete(t)},registerFill:(e,n)=>{t.set(e,[...t.get(e)||[],n])},unregisterFill:(e,n)=>{const r=t.get(e);r&&t.set(e,r.filter((e=>e!==n)))}}}function hw({children:e}){const[t]=(0,c.useState)(fw);return(0,_t.jsx)(Uy.Provider,{value:t,children:e})}function mw(){const e=(0,l.observableMap)(),t=(0,l.observableMap)();return{slots:e,fills:t,registerSlot:function(t,n){e.set(t,n)},unregisterSlot:function(t,n){e.get(t)===n&&e.delete(t)},registerFill:function(e,n,r){t.set(e,[...t.get(e)||[],{instance:n,children:r}])},unregisterFill:function(e,n){const r=t.get(e);r&&t.set(e,r.filter((e=>e.instance!==n)))},updateFill:function(e,n,r){const o=t.get(e);if(!o)return;const i=o.find((e=>e.instance===n));i&&i.children!==r&&t.set(e,o.map((e=>e.instance===n?{instance:n,children:r}:e)))}}}const gw=function({children:e}){const[t]=(0,c.useState)(mw);return(0,_t.jsx)(qy.Provider,{value:t,children:e})};function vw(e){return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(Yy,{...e}),(0,_t.jsx)(cw,{...e})]})}const bw=(0,c.forwardRef)((function(e,t){const{bubblesVirtually:n,...r}=e;return n?(0,_t.jsx)(uw,{...r,ref:t}):(0,_t.jsx)(Zy,{...r})}));function xw({children:e,passthrough:t=!1}){return!(0,c.useContext)(Uy).isDefault&&t?(0,_t.jsx)(_t.Fragment,{children:e}):(0,_t.jsx)(gw,{children:(0,_t.jsx)(hw,{children:e})})}function yw(e){const t="symbol"==typeof e?e.description:e,n=t=>(0,_t.jsx)(vw,{name:e,...t});n.displayName=`${t}Fill`;const r=t=>(0,_t.jsx)(bw,{name:e,...t});return r.displayName=`${t}Slot`,r.__unstableName=e,{name:e,Fill:n,Slot:r}}xw.displayName="SlotFillProvider";const ww="Popover",_w=()=>(0,_t.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:"components-popover__triangle",role:"presentation",children:[(0,_t.jsx)(n.Path,{className:"components-popover__triangle-bg",d:"M 0 0 L 50 50 L 100 0"}),(0,_t.jsx)(n.Path,{className:"components-popover__triangle-border",d:"M 0 0 L 50 50 L 100 0",vectorEffect:"non-scaling-stroke"})]}),Sw=(0,c.createContext)(void 0),Cw="components-popover__fallback-container",kw=al(((e,t)=>{const{animate:n=!0,headerTitle:r,constrainTabbing:o,onClose:i,children:u,className:d,noArrow:p=!0,position:f,placement:h="bottom-start",offset:m=0,focusOnMount:g="firstElement",anchor:v,expandOnMobile:b,onFocusOutside:x,__unstableSlotName:y=ww,flip:w=!0,resize:_=!0,shift:S=!1,inline:C=!1,variant:k,style:j,__unstableForcePosition:E,anchorRef:P,anchorRect:N,getAnchorRect:T,isAlternate:I,...R}=sl(e,"Popover");let M=w,A=_;void 0!==E&&(Xi()("`__unstableForcePosition` prop in wp.components.Popover",{since:"6.1",version:"6.3",alternative:"`flip={ false }` and `resize={ false }`"}),M=!E,A=!E),void 0!==P&&Xi()("`anchorRef` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==N&&Xi()("`anchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"}),void 0!==T&&Xi()("`getAnchorRect` prop in wp.components.Popover",{since:"6.1",alternative:"`anchor` prop"});const D=I?"toolbar":k;void 0!==I&&Xi()("`isAlternate` prop in wp.components.Popover",{since:"6.2",alternative:"`variant` prop with the `'toolbar'` value"});const z=(0,c.useRef)(null),[O,L]=(0,c.useState)(null),F=(0,c.useCallback)((e=>{L(e)}),[]),V=(0,l.useViewportMatch)("medium","<"),$=b&&V,H=!$&&!p,W=f?Ji(f):h,U=[..."overlay"===h?[{name:"overlay",fn:({rects:e})=>e.reference},Ti({apply({rects:e,elements:t}){var n;const{firstElementChild:r}=null!==(n=t.floating)&&void 0!==n?n:{};r instanceof HTMLElement&&Object.assign(r.style,{width:`${e.reference.width}px`,height:`${e.reference.height}px`})}})]:[],Vo(m),M&&Ni(),A&&Ti({apply(e){var t;const{firstElementChild:n}=null!==(t=J.floating.current)&&void 0!==t?t:{};n instanceof HTMLElement&&Object.assign(n.style,{maxHeight:`${e.availableHeight}px`,overflow:"auto"})}}),S&&Pi({crossAxis:!0,limiter:Ri(),padding:1}),My({element:z})],G=(0,c.useContext)(Sw)||y,K=Gy(G);let q;(i||x)&&(q=(e,t)=>{"focus-outside"===e&&x?x(t):i&&i()});const[Y,X]=(0,l.__experimentalUseDialog)({constrainTabbing:o,focusOnMount:g,__unstableOnClose:q,onClose:q}),{x:Z,y:Q,refs:J,strategy:ee,update:te,placement:ne,middlewareData:{arrow:re}}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=B.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,f]=B.useState(r);Dy(p,r)||f(r);const[h,m]=B.useState(null),[g,v]=B.useState(null),b=B.useCallback((e=>{e!==_.current&&(_.current=e,m(e))}),[]),x=B.useCallback((e=>{e!==S.current&&(S.current=e,v(e))}),[]),y=i||h,w=s||g,_=B.useRef(null),S=B.useRef(null),C=B.useRef(u),k=null!=l,j=Ly(l),E=Ly(o),P=B.useCallback((()=>{if(!_.current||!S.current)return;const e={placement:t,strategy:n,middleware:p};E.current&&(e.platform=E.current),Mi(_.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};N.current&&!Dy(C.current,t)&&(C.current=t,Kr.flushSync((()=>{d(t)})))}))}),[p,t,n,E]);Ay((()=>{!1===c&&C.current.isPositioned&&(C.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[c]);const N=B.useRef(!1);Ay((()=>(N.current=!0,()=>{N.current=!1})),[]),Ay((()=>{if(y&&(_.current=y),w&&(S.current=w),y&&w){if(j.current)return j.current(y,w,P);P()}}),[y,w,P,j,k]);const T=B.useMemo((()=>({reference:_,floating:S,setReference:b,setFloating:x})),[b,x]),I=B.useMemo((()=>({reference:y,floating:w})),[y,w]),R=B.useMemo((()=>{const e={position:n,left:0,top:0};if(!I.floating)return e;const t=Oy(I.floating,u.x),r=Oy(I.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...zy(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,I.floating,u.x,u.y]);return B.useMemo((()=>({...u,update:P,refs:T,elements:I,floatingStyles:R})),[u,P,T,I,R])}({placement:"overlay"===W?void 0:W,middleware:U,whileElementsMounted:(e,t,n)=>Ei(e,t,n,{layoutShift:!1,animationFrame:!0})}),oe=(0,c.useCallback)((e=>{z.current=e,te()}),[te]),ie=P?.top,se=P?.bottom,ae=P?.startContainer,le=P?.current;(0,c.useLayoutEffect)((()=>{const e=(({anchor:e,anchorRef:t,anchorRect:n,getAnchorRect:r,fallbackReferenceElement:o})=>{var i;let s=null;return e?s=e:function(e){return!!e?.top}(t)?s={getBoundingClientRect(){const e=t.top.getBoundingClientRect(),n=t.bottom.getBoundingClientRect();return new window.DOMRect(e.x,e.y,e.width,n.bottom-e.top)}}:function(e){return!!e?.current}(t)?s=t.current:t?s=t:n?s={getBoundingClientRect:()=>n}:r?s={getBoundingClientRect(){var e,t,n,i;const s=r(o);return new window.DOMRect(null!==(e=s.x)&&void 0!==e?e:s.left,null!==(t=s.y)&&void 0!==t?t:s.top,null!==(n=s.width)&&void 0!==n?n:s.right-s.left,null!==(i=s.height)&&void 0!==i?i:s.bottom-s.top)}}:o&&(s=o.parentElement),null!==(i=s)&&void 0!==i?i:null})({anchor:v,anchorRef:P,anchorRect:N,getAnchorRect:T,fallbackReferenceElement:O});J.setReference(e)}),[v,P,ie,se,ae,le,N,T,O,J]);const ce=(0,l.useMergeRefs)([J.setFloating,Y,t]),ue=$?void 0:{position:ee,top:0,left:0,x:ts(Z),y:ts(Q)},de=(0,l.useReducedMotion)(),pe=n&&!$&&!de,[fe,he]=(0,c.useState)(!1),{style:me,...ge}=(0,c.useMemo)((()=>(e=>{const t=e.startsWith("top")||e.startsWith("bottom")?"translateY":"translateX",n=e.startsWith("top")||e.startsWith("left")?1:-1;return{style:es[e],initial:{opacity:0,scale:0,[t]:2*n+"em"},animate:{opacity:1,scale:1,[t]:0},transition:{duration:.1,ease:[0,0,.2,1]}}})(ne)),[ne]),ve=pe?{style:{...j,...me,...ue},onAnimationComplete:()=>he(!0),...ge}:{animate:!1,style:{...j,...ue}},be=(!pe||fe)&&null!==Z&&null!==Q;let xe=(0,_t.jsxs)(ag.div,{className:s(d,{"is-expanded":$,"is-positioned":be,[`is-${"toolbar"===D?"alternate":D}`]:D}),...ve,...R,ref:ce,...X,tabIndex:-1,children:[$&&(0,_t.jsx)(Hy,{}),$&&(0,_t.jsxs)("div",{className:"components-popover__header",children:[(0,_t.jsx)("span",{className:"components-popover__header-title",children:r}),(0,_t.jsx)(Jx,{className:"components-popover__close",size:"small",icon:Fy,onClick:i,label:(0,a.__)("Close")})]}),(0,_t.jsx)("div",{className:"components-popover__content",children:u}),H&&(0,_t.jsx)("div",{ref:oe,className:["components-popover__arrow",`is-${ne.split("-")[0]}`].join(" "),style:{left:void 0!==re?.x&&Number.isFinite(re.x)?`${re.x}px`:"",top:void 0!==re?.y&&Number.isFinite(re.y)?`${re.y}px`:""},children:(0,_t.jsx)(_w,{})})]});const ye=K.ref&&!C,we=P||N||v;return ye?xe=(0,_t.jsx)(vw,{name:G,children:xe}):C||(xe=(0,c.createPortal)((0,_t.jsx)(aw,{document,children:xe}),(()=>{let e=document.body.querySelector("."+Cw);return e||(e=document.createElement("div"),e.className=Cw,document.body.append(e)),e})())),we?xe:(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)("span",{ref:F}),xe]})}),"Popover");kw.Slot=(0,c.forwardRef)((function({name:e=ww},t){return(0,_t.jsx)(bw,{bubblesVirtually:!0,name:e,className:"popover-slot",ref:t})})),kw.__unstableSlotNameProvider=Sw.Provider;const jw=kw;function Ew({items:e,onSelect:t,selectedIndex:n,instanceId:r,listBoxId:o,className:i,Component:a="div"}){return(0,_t.jsx)(a,{id:o,role:"listbox",className:"components-autocomplete__results",children:e.map(((e,o)=>(0,_t.jsx)(Jx,{id:`components-autocomplete-item-${r}-${e.key}`,role:"option",__next40pxDefaultSize:!0,"aria-selected":o===n,accessibleWhenDisabled:!0,disabled:e.isDisabled,className:s("components-autocomplete__result",i,{"is-selected":o===n}),variant:o===n?"primary":void 0,onClick:()=>t(e),children:e.label},e.key)))})}function Pw(e){var t;const n=null!==(t=e.useItems)&&void 0!==t?t:Ry(e);return function({filterValue:e,instanceId:t,listBoxId:r,className:o,selectedIndex:i,onChangeOptions:s,onSelect:u,onReset:d,reset:p,contentRef:f}){const[h]=n(e),m=(0,ky.useAnchor)({editableContentElement:f.current}),[g,v]=(0,c.useState)(!1),b=(0,c.useRef)(null),x=(0,l.useMergeRefs)([b,(0,l.useRefEffect)((e=>{f.current&&v(e.ownerDocument!==f.current.ownerDocument)}),[f])]);var y,w;y=b,w=p,(0,c.useEffect)((()=>{const e=e=>{y.current&&!y.current.contains(e.target)&&w(e)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}}),[w,y]);const _=(0,l.useDebounce)(jy.speak,500);return(0,c.useLayoutEffect)((()=>{s(h),function(t){_&&(t.length?_(e?(0,a.sprintf)((0,a._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",t.length),t.length):(0,a.sprintf)((0,a._n)("Initial %d result loaded. Type to filter all available results. Use up and down arrow keys to navigate.","Initial %d results loaded. Type to filter all available results. Use up and down arrow keys to navigate.",t.length),t.length),"assertive"):_((0,a.__)("No results."),"assertive"))}(h)}),[h]),0===h.length?null:(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(jw,{focusOnMount:!1,onClose:d,placement:"top-start",className:"components-autocomplete__popover",anchor:m,ref:x,children:(0,_t.jsx)(Ew,{items:h,onSelect:u,selectedIndex:i,instanceId:t,listBoxId:r,className:o})}),f.current&&g&&(0,Kr.createPortal)((0,_t.jsx)(Ew,{items:h,onSelect:u,selectedIndex:i,instanceId:t,listBoxId:r,className:o,Component:Sl}),f.current.ownerDocument.body)]})}}const Nw=e=>{if(null===e)return"";switch(typeof e){case"string":case"number":return e.toString();case"boolean":default:return"";case"object":if(e instanceof Array)return e.map(Nw).join("");if("props"in e)return Nw(e.props.children)}return""},Tw=[],Iw={};function Rw({record:e,onChange:t,onReplace:n,completers:r,contentRef:o}){const i=(0,l.useInstanceId)(Iw),[s,a]=(0,c.useState)(0),[u,d]=(0,c.useState)(Tw),[p,f]=(0,c.useState)(""),[h,m]=(0,c.useState)(null),[g,v]=(0,c.useState)(null),b=(0,c.useRef)(!1);function x(r){const{getOptionCompletion:o}=h||{};if(!r.isDisabled){if(o){const i=o(r.value,p),s=(e=>null!==e&&"object"==typeof e&&"action"in e&&void 0!==e.action&&"value"in e&&void 0!==e.value)(i)?i:{action:"insert-at-caret",value:i};if("replace"===s.action)return void n([s.value]);"insert-at-caret"===s.action&&function(n){if(null===h)return;const r=e.start,o=r-h.triggerPrefix.length-p.length,i=(0,ky.create)({html:(0,c.renderToString)(n)});t((0,ky.insert)(e,i,o,r))}(s.value)}y()}}function y(){a(0),d(Tw),f(""),m(null),v(null)}const w=(0,c.useMemo)((()=>(0,ky.isCollapsed)(e)?(0,ky.getTextContent)((0,ky.slice)(e,0)):""),[e]);(0,c.useEffect)((()=>{if(!w)return void(h&&y());const t=r.reduce(((e,t)=>w.lastIndexOf(t.triggerPrefix)>(null!==e?w.lastIndexOf(e.triggerPrefix):-1)?t:e),null);if(!t)return void(h&&y());const{allowContext:n,triggerPrefix:o}=t,i=w.lastIndexOf(o),s=w.slice(i+o.length);if(s.length>50)return;const a=0===u.length,l=s.split(/\s/),c=1===l.length,d=b.current&&l.length<=3;if(a&&!d&&!c)return void(h&&y());const p=(0,ky.getTextContent)((0,ky.slice)(e,void 0,(0,ky.getTextContent)(e).length));if(n&&!n(w.slice(0,i),p))return void(h&&y());if(/^\s/.test(s)||/\s\s+$/.test(s))return void(h&&y());if(!/[\u0000-\uFFFF]*$/.test(s))return void(h&&y());const x=Iy(t.triggerPrefix),_=Cy()(w),S=_.slice(_.lastIndexOf(t.triggerPrefix)).match(new RegExp(`${x}([\0-]*)$`)),C=S&&S[1];m(t),v((()=>t!==h?Pw(t):g)),f(null===C?"":C)}),[w]);const{key:_=""}=u[s]||{},{className:S}=h||{},C=!!h&&u.length>0,k=C?`components-autocomplete-listbox-${i}`:void 0,j=C?`components-autocomplete-item-${i}-${_}`:null,E=void 0!==e.start;return{listBoxId:k,activeId:j,onKeyDown:jx((function(e){if(b.current="Backspace"===e.key,h&&0!==u.length&&!e.defaultPrevented){switch(e.key){case"ArrowUp":{const e=(0===s?u.length:s)-1;a(e),(0,Ey.isAppleOS)()&&(0,jy.speak)(Nw(u[e].label),"assertive");break}case"ArrowDown":{const e=(s+1)%u.length;a(e),(0,Ey.isAppleOS)()&&(0,jy.speak)(Nw(u[e].label),"assertive");break}case"Escape":m(null),v(null),e.preventDefault();break;case"Enter":x(u[s]);break;case"ArrowLeft":case"ArrowRight":return void y();default:return}e.preventDefault()}})),popover:E&&g&&(0,_t.jsx)(g,{className:S,filterValue:p,instanceId:i,listBoxId:k,selectedIndex:s,onChangeOptions:function(e){a(e.length===u.length?s:0),d(e)},onSelect:x,value:e,contentRef:o,reset:y})}}function Mw(e){const t=(0,c.useRef)(null),n=(0,c.useRef)(),{record:r}=e,o=function(e){const t=(0,c.useRef)(new Set);return t.current.add(e),t.current.size>2&&t.current.delete(Array.from(t.current)[0]),Array.from(t.current)[0]}(r),{popover:i,listBoxId:s,activeId:a,onKeyDown:u}=Rw({...e,contentRef:t});n.current=u;const d=(0,l.useMergeRefs)([t,(0,l.useRefEffect)((e=>{function t(e){n.current?.(e)}return e.addEventListener("keydown",t),()=>{e.removeEventListener("keydown",t)}}),[])]);return r.text!==o?.text?{ref:d,children:i,"aria-autocomplete":s?"list":void 0,"aria-owns":s,"aria-activedescendant":a}:{ref:d}}function Aw({children:e,isSelected:t,...n}){const{popover:r,...o}=Rw(n);return(0,_t.jsxs)(_t.Fragment,{children:[e(o),t&&r]})}function Dw(e){const{help:t,id:n,...r}=e,o=(0,l.useInstanceId)(Wx,"wp-components-base-control",n);return{baseControlProps:{id:o,help:t,...r},controlProps:{id:o,...t?{"aria-describedby":`${o}__help`}:{}}}}const zw=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})}),Ow=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z"})});const Lw=Nl("",""),Fw={name:"bjn8wh",styles:"position:relative"},Bw=e=>{const{color:t=zl.gray[200],style:n="solid",width:r=Fl.borderWidth}=e||{};return`${t} ${!!r&&"0"!==r||!!t?n||"solid":n} ${r!==Fl.borderWidth?`clamp(1px, ${r}, 10px)`:r}`},Vw={name:"1nwbfnf",styles:"grid-column:span 2;margin:0 auto"};function $w(e){const{className:t,size:n="default",...r}=sl(e,"BorderBoxControlLinkedButton"),o=il();return{...r,className:(0,c.useMemo)((()=>o((e=>Nl("position:absolute;top:","__unstable-large"===e?"8px":"3px",";",Mg({right:0})()," line-height:0;",""))(n),t)),[t,o,n])}}const Hw=al(((e,t)=>{const{className:n,isLinked:r,...o}=$w(e),i=r?(0,a.__)("Unlink sides"):(0,a.__)("Link sides");return(0,_t.jsx)(Jx,{...o,size:"small",icon:r?zw:Ow,iconSize:24,label:i,ref:t,className:n})}),"BorderBoxControlLinkedButton");function Ww(e){const{className:t,value:n,size:r="default",...o}=sl(e,"BorderBoxControlVisualizer"),i=il(),s=(0,c.useMemo)((()=>i(((e,t)=>Nl("position:absolute;top:","__unstable-large"===t?"20px":"15px",";right:","__unstable-large"===t?"39px":"29px",";bottom:","__unstable-large"===t?"20px":"15px",";left:","__unstable-large"===t?"39px":"29px",";border-top:",Bw(e?.top),";border-bottom:",Bw(e?.bottom),";",Mg({borderLeft:Bw(e?.left)})()," ",Mg({borderRight:Bw(e?.right)})(),";",""))(n,r),t)),[i,t,n,r]);return{...o,className:s,value:n}}const Uw=al(((e,t)=>{const{value:n,...r}=Ww(e);return(0,_t.jsx)(_l,{...r,ref:t})}),"BorderBoxControlVisualizer"),Gw=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M5 11.25h14v1.5H5z"})}),Kw=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"})}),qw=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"})});const Yw=e=>{const t=Nl("border-color:",zl.ui.border,";","");return Nl(e&&t," &:hover{border-color:",zl.ui.borderHover,";}&:focus-within{border-color:",zl.ui.borderFocus,";box-shadow:",Fl.controlBoxShadowFocus,";z-index:1;outline:2px solid transparent;outline-offset:-2px;}","")};var Xw={name:"1aqh2c7",styles:"min-height:40px;padding:3px"},Zw={name:"1ndywgm",styles:"min-height:36px;padding:2px"};const Qw=e=>({default:Zw,"__unstable-large":Xw}[e]),Jw={name:"7whenc",styles:"display:flex;width:100%"},e_=yl("div",{target:"eakva830"})({name:"zjik7",styles:"display:flex"});function t_(e={}){var t,n=N(e,[]);const r=null==(t=n.store)?void 0:t.getState(),o=ht(P(E({},n),{focusLoop:F(n.focusLoop,null==r?void 0:r.focusLoop,!0)})),i=He(P(E({},o.getState()),{value:F(n.value,null==r?void 0:r.value,n.defaultValue,null)}),o,n.store);return P(E(E({},o),i),{setValue:e=>i.setState("value",e)})}function n_(e={}){const[t,n]=rt(t_,e);return function(e,t,n){return nt(e=gt(e,t,n),n,"value","setValue"),e}(t,n,e)}var r_=Et([Mt],[At]),o_=r_.useContext,i_=(r_.useScopedContext,r_.useProviderContext),s_=(r_.ContextProvider,r_.ScopedContextProvider),a_=jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=i_();return D(n=n||o,!1),r=Me(r,(e=>(0,_t.jsx)(s_,{value:n,children:e})),[n]),r=v({role:"radiogroup"},r),r=cn(v({store:n},r))})),l_=St((function(e){return kt("div",a_(e))}));const c_=(0,c.createContext)({}),u_=c_;function d_(e){const t=(0,c.useRef)(!0),n=(0,l.usePrevious)(e),r=(0,c.useRef)(!1);(0,c.useEffect)((()=>{t.current&&(t.current=!1)}),[]);const o=r.current||!t.current&&n!==e;return(0,c.useEffect)((()=>{r.current=o}),[o]),o?{value:null!=e?e:"",defaultValue:void 0}:{value:void 0,defaultValue:e}}const p_=(0,c.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,setSelectedElement:u,...d},p){const f=(0,l.useInstanceId)(p_,"toggle-group-control-as-radio-group"),h=s||f,{value:m,defaultValue:g}=d_(i),v=r?e=>{r(null!=e?e:void 0)}:void 0,b=n_({defaultValue:g,value:m,setValue:v,rtl:(0,a.isRTL)()}),x=et(b,"value"),y=b.setValue;(0,c.useEffect)((()=>{""===x&&b.setActiveId(void 0)}),[b,x]);const w=(0,c.useMemo)((()=>({activeItemIsNotFirstItem:()=>b.getState().activeId!==b.first(),baseId:h,isBlock:!t,size:o,value:x,setValue:y,setSelectedElement:u})),[h,t,b,x,u,y,o]);return(0,_t.jsx)(u_.Provider,{value:w,children:(0,_t.jsx)(l_,{store:b,"aria-label":n,render:(0,_t.jsx)(_l,{}),...d,id:h,ref:p,children:e})})}));function f_({defaultValue:e,onChange:t,value:n}){const r=void 0!==n,o=r?n:e,[i,s]=(0,c.useState)(o);let a;return a=r&&"function"==typeof t?t:r||"function"!=typeof t?s:e=>{t(e),s(e)},[r?n:i,a]}const h_=(0,c.forwardRef)((function({children:e,isAdaptiveWidth:t,label:n,onChange:r,size:o,value:i,id:s,setSelectedElement:a,...u},d){const p=(0,l.useInstanceId)(h_,"toggle-group-control-as-button-group"),f=s||p,{value:h,defaultValue:m}=d_(i),[g,v]=f_({defaultValue:m,value:h,onChange:r}),b=(0,c.useMemo)((()=>({baseId:f,value:g,setValue:v,isBlock:!t,isDeselectable:!0,size:o,setSelectedElement:a})),[f,g,v,t,o,a]);return(0,_t.jsx)(u_.Provider,{value:b,children:(0,_t.jsx)(_l,{"aria-label":n,...u,ref:d,role:"group",children:e})})})),m_={element:void 0,top:0,right:0,bottom:0,left:0,width:0,height:0};function g_(e,t=[]){const[n,r]=(0,c.useState)(m_),o=(0,c.useRef)(),i=(0,l.useEvent)((()=>{if(e&&e.isConnected){const t=function(e){var t,n,r;const o=e.getBoundingClientRect();if(0===o.width||0===o.height)return;const i=e.offsetParent,s=null!==(t=i?.getBoundingClientRect())&&void 0!==t?t:m_,a=null!==(n=i?.scrollLeft)&&void 0!==n?n:0,l=null!==(r=i?.scrollTop)&&void 0!==r?r:0,c=parseFloat(getComputedStyle(e).width),u=parseFloat(getComputedStyle(e).height),d=c/o.width,p=u/o.height;return{element:e,top:(o.top-s?.top)*p+l,right:(s?.right-o.right)*d-a,bottom:(s?.bottom-o.bottom)*p-l,left:(o.left-s?.left)*d+a,width:c,height:u}}(e);if(t)return r(t),clearInterval(o.current),!0}else clearInterval(o.current);return!1})),s=(0,l.useResizeObserver)((()=>{i()||requestAnimationFrame((()=>{i()||(o.current=setInterval(i,100))}))}));return(0,c.useLayoutEffect)((()=>{s(e),e||r(m_)}),[s,e]),(0,c.useLayoutEffect)((()=>{i()}),t),n}function v_(e,t,{prefix:n="subelement",dataAttribute:r=`${n}-animated`,transitionEndFilter:o=()=>!0,roundRect:i=!1}={}){const s=(0,l.useEvent)((()=>{Object.keys(t).forEach((r=>"element"!==r&&e?.style.setProperty(`--${n}-${r}`,String(i?Math.floor(t[r]):t[r]))))}));(0,c.useLayoutEffect)((()=>{s()}),[t,s]),function(e,t){const n=(0,c.useRef)(e),r=(0,l.useEvent)(t);(0,c.useLayoutEffect)((()=>{n.current!==e&&(r({previousValue:n.current}),n.current=e)}),[r,e])}(t.element,(({previousValue:n})=>{t.element&&n&&e?.setAttribute(`data-${r}`,"")})),(0,c.useLayoutEffect)((()=>{function t(t){o(t)&&e?.removeAttribute(`data-${r}`)}return e?.addEventListener("transitionend",t),()=>e?.removeEventListener("transitionend",t)}),[r,e,o])}const b_=al((function(e,t){const{__nextHasNoMarginBottom:n=!1,__next40pxDefaultSize:r=!1,__shouldNotWarnDeprecated36pxSize:o,className:i,isAdaptiveWidth:s=!1,isBlock:a=!1,isDeselectable:u=!1,label:d,hideLabelFromVision:p=!1,help:f,onChange:h,size:m="default",value:g,children:v,...b}=sl(e,"ToggleGroupControl"),x=r&&"default"===m?"__unstable-large":m,[y,w]=(0,c.useState)(),[_,S]=(0,c.useState)(),C=(0,l.useMergeRefs)([S,t]);v_(_,g_(null!=g?y:void 0),{prefix:"selected",dataAttribute:"indicator-animated",transitionEndFilter:e=>"::before"===e.pseudoElement,roundRect:!0});const k=il(),j=(0,c.useMemo)((()=>k((({isBlock:e,isDeselectable:t,size:n})=>Nl("background:",zl.ui.background,";border:1px solid transparent;border-radius:",Fl.radiusSmall,";display:inline-flex;min-width:0;position:relative;",Qw(n)," ",!t&&Yw(e),"@media not ( prefers-reduced-motion ){&[data-indicator-animated]::before{transition-property:transform,border-radius;transition-duration:0.2s;transition-timing-function:ease-out;}}&::before{content:'';position:absolute;pointer-events:none;background:",zl.theme.foreground,";outline:2px solid transparent;outline-offset:-3px;--antialiasing-factor:100;border-radius:calc(\n\t\t\t\t",Fl.radiusXSmall," /\n\t\t\t\t\t(\n\t\t\t\t\t\tvar( --selected-width, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t)/",Fl.radiusXSmall,";left:-1px;width:calc( var( --antialiasing-factor ) * 1px );height:calc( var( --selected-height, 0 ) * 1px );transform-origin:left top;transform:translateX( calc( var( --selected-left, 0 ) * 1px ) ) scaleX(\n\t\t\t\tcalc(\n\t\t\t\t\tvar( --selected-width, 0 ) / var( --antialiasing-factor )\n\t\t\t\t)\n\t\t\t);}",""))({isBlock:a,isDeselectable:u,size:x}),a&&Jw,i)),[i,k,a,u,x]),E=u?h_:p_;return Ux({componentName:"ToggleGroupControl",size:m,__next40pxDefaultSize:r,__shouldNotWarnDeprecated36pxSize:o}),(0,_t.jsxs)(Wx,{help:f,__nextHasNoMarginBottom:n,__associatedWPComponentName:"ToggleGroupControl",children:[!p&&(0,_t.jsx)(e_,{children:(0,_t.jsx)(Wx.VisualLabel,{children:d})}),(0,_t.jsx)(E,{...b,setSelectedElement:w,className:j,isAdaptiveWidth:s,label:d,onChange:h,ref:C,size:x,value:g,children:v})]})}),"ToggleGroupControl"),x_=b_;var y_="input";var w_=jt((function(e){var t=e,{store:n,name:r,value:o,checked:i}=t,s=x(t,["store","name","value","checked"]);const a=o_();n=n||a;const l=Pe(s.id),c=(0,B.useRef)(null),u=et(n,(e=>null!=i?i:function(e,t){if(void 0!==t)return null!=e&&null!=t?t===e:!!t}(o,null==e?void 0:e.value)));(0,B.useEffect)((()=>{if(!l)return;if(!u)return;(null==n?void 0:n.getState().activeId)===l||null==n||n.setActiveId(l)}),[n,u,l]);const d=s.onChange,p=function(e,t){return"input"===e&&(!t||"radio"===t)}(Ne(c,y_),s.type),f=O(s),[h,m]=Ie();(0,B.useEffect)((()=>{const e=c.current;e&&(p||(void 0!==u&&(e.checked=u),void 0!==r&&(e.name=r),void 0!==o&&(e.value=`${o}`)))}),[h,p,u,r,o]);const g=ke((e=>{if(f)return e.preventDefault(),void e.stopPropagation();(null==n?void 0:n.getState().value)!==o&&(p||(e.currentTarget.checked=!0,m()),null==d||d(e),e.defaultPrevented||null==n||n.setValue(o))})),y=s.onClick,w=ke((e=>{null==y||y(e),e.defaultPrevented||p||g(e)})),_=s.onFocus,S=ke((e=>{if(null==_||_(e),e.defaultPrevented)return;if(!p)return;if(!n)return;const{moves:t,activeId:r}=n.getState();t&&(l&&r!==l||g(e))}));return s=b(v({id:l,role:p?void 0:"radio",type:p?"radio":void 0,"aria-checked":u},s),{ref:Ee(c,s.ref),onChange:g,onClick:w,onFocus:S}),s=Mn(v({store:n,clickOnEnter:!p},s)),L(v({name:p?r:void 0,value:p?o:void 0,checked:u},s))})),__=Ct(St((function(e){const t=w_(e);return kt(y_,t)})));const S_=yl("div",{target:"et6ln9s1"})({name:"sln1fl",styles:"display:inline-flex;max-width:100%;min-width:0;position:relative"}),C_={name:"82a6rk",styles:"flex:1"},k_=({isDeselectable:e,isIcon:t,isPressed:n,size:r})=>Nl("align-items:center;appearance:none;background:transparent;border:none;border-radius:",Fl.radiusXSmall,";color:",zl.theme.gray[700],";fill:currentColor;cursor:pointer;display:flex;font-family:inherit;height:100%;justify-content:center;line-height:100%;outline:none;padding:0 12px;position:relative;text-align:center;@media not ( prefers-reduced-motion ){transition:background ",Fl.transitionDurationFast," linear,color ",Fl.transitionDurationFast," linear,font-weight 60ms linear;}user-select:none;width:100%;z-index:2;&::-moz-focus-inner{border:0;}&[disabled]{opacity:0.4;cursor:default;}&:active{background:",zl.ui.background,";}",e&&E_," ",t&&N_({size:r})," ",n&&j_,";",""),j_=Nl("color:",zl.theme.foregroundInverted,";&:active{background:transparent;}",""),E_=Nl("color:",zl.theme.foreground,";&:focus{box-shadow:inset 0 0 0 1px ",zl.ui.background,",0 0 0 ",Fl.borderWidthFocus," ",zl.theme.accent,";outline:2px solid transparent;}",""),P_=yl("div",{target:"et6ln9s0"})("display:flex;font-size:",Fl.fontSize,";line-height:1;"),N_=({size:e="default"})=>Nl("color:",zl.theme.foreground,";height:",{default:"30px","__unstable-large":"32px"}[e],";aspect-ratio:1;padding-left:0;padding-right:0;",""),{Rp:T_,y0:I_}=t,R_=({showTooltip:e,text:t,children:n})=>e&&t?(0,_t.jsx)(ss,{text:t,placement:"top",children:n}):(0,_t.jsx)(_t.Fragment,{children:n});const M_=al((function e(t,n){const r=(0,c.useContext)(c_),o=sl({...t,id:(0,l.useInstanceId)(e,r.baseId||"toggle-group-control-option-base")},"ToggleGroupControlOptionBase"),{isBlock:i=!1,isDeselectable:s=!1,size:a="default"}=r,{className:u,isIcon:d=!1,value:p,children:f,showTooltip:h=!1,disabled:m,...g}=o,v=r.value===p,b=il(),x=(0,c.useMemo)((()=>b(i&&C_)),[b,i]),y=(0,c.useMemo)((()=>b(k_({isDeselectable:s,isIcon:d,isPressed:v,size:a}),u)),[b,s,d,v,a,u]),w={...g,className:y,"data-value":p,ref:n},_=(0,c.useRef)(null);return(0,c.useLayoutEffect)((()=>{v&&_.current&&r.setSelectedElement(_.current)}),[v,r]),(0,_t.jsx)(I_,{ref:_,className:x,children:(0,_t.jsx)(R_,{showTooltip:h,text:g["aria-label"],children:s?(0,_t.jsx)("button",{...w,disabled:m,"aria-pressed":v,type:"button",onClick:()=>{s&&v?r.setValue(void 0):r.setValue(p)},children:(0,_t.jsx)(T_,{children:f})}):(0,_t.jsx)(__,{disabled:m,onFocusVisible:()=>{(null===r.value||""===r.value)&&!r.activeItemIsNotFirstItem?.()||r.setValue(p)},render:(0,_t.jsx)("button",{type:"button",...w}),value:p,children:(0,_t.jsx)(T_,{children:f})})})})}),"ToggleGroupControlOptionBase"),A_=M_;const D_=(0,c.forwardRef)((function(e,t){const{icon:n,label:r,...o}=e;return(0,_t.jsx)(A_,{...o,isIcon:!0,"aria-label":r,showTooltip:!0,ref:t,children:(0,_t.jsx)(Xx,{icon:n})})})),z_=D_,O_=[{label:(0,a.__)("Solid"),icon:Gw,value:"solid"},{label:(0,a.__)("Dashed"),icon:Kw,value:"dashed"},{label:(0,a.__)("Dotted"),icon:qw,value:"dotted"}];const L_=al((function({onChange:e,...t},n){return(0,_t.jsx)(x_,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,ref:n,isDeselectable:!0,onChange:t=>{e?.(t)},...t,children:O_.map((e=>(0,_t.jsx)(z_,{value:e.value,icon:e.icon,label:e.label},e.value)))})}),"BorderControlStylePicker");const F_=(0,c.forwardRef)((function(e,t){const{className:n,colorValue:r,...o}=e;return(0,_t.jsx)("span",{className:s("component-color-indicator",n),style:{background:r},ref:t,...o})}));var B_=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},V_=function(e){return.2126*B_(e.r)+.7152*B_(e.g)+.0722*B_(e.b)};function $_(e){e.prototype.luminance=function(){return e=V_(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,r,o,i,s,a,l,c=t instanceof e?t:new e(t);return i=this.rgba,s=c.toRgb(),n=(a=V_(i))>(l=V_(s))?(a+.05)/(l+.05):(l+.05)/(a+.05),void 0===(r=2)&&(r=0),void 0===o&&(o=Math.pow(10,r)),Math.floor(o*n)/o+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(s=void 0===(i=(n=t).size)?"normal":i,"AAA"===(o=void 0===(r=n.level)?"AA":r)&&"normal"===s?7:"AA"===o&&"large"===s?3:4.5);var n,r,o,i,s}}const H_=al(((e,t)=>{const{renderContent:n,renderToggle:r,className:o,contentClassName:i,expandOnMobile:a,headerTitle:u,focusOnMount:d,popoverProps:p,onClose:f,onToggle:h,style:m,open:g,defaultOpen:v,position:b,variant:x}=sl(e,"Dropdown");void 0!==b&&Xi()("`position` prop in wp.components.Dropdown",{since:"6.2",alternative:"`popoverProps.placement` prop",hint:"Note that the `position` prop will override any values passed through the `popoverProps.placement` prop."});const[y,w]=(0,c.useState)(null),_=(0,c.useRef)(),[S,C]=f_({defaultValue:v,value:g,onChange:h});function k(){f?.(),C(!1)}const j={isOpen:!!S,onToggle:()=>C(!S),onClose:k},E=!!(p?.anchor||p?.anchorRef||p?.getAnchorRect||p?.anchorRect);return(0,_t.jsxs)("div",{className:o,ref:(0,l.useMergeRefs)([_,t,w]),tabIndex:-1,style:m,children:[r(j),S&&(0,_t.jsx)(jw,{position:b,onClose:k,onFocusOutside:function(){if(!_.current)return;const{ownerDocument:e}=_.current,t=e?.activeElement?.closest('[role="dialog"]');_.current.contains(e.activeElement)||t&&!t.contains(_.current)||k()},expandOnMobile:a,headerTitle:u,focusOnMount:d,offset:13,anchor:E?void 0:y,variant:x,...p,className:s("components-dropdown__content",p?.className,i),children:n(j)})]})}),"Dropdown"),W_=H_;const U_=al((function(e,t){const n=sl(e,"InputControlSuffixWrapper");return(0,_t.jsx)(ub,{...n,ref:t})}),"InputControlSuffixWrapper");const G_=({disabled:e})=>e?Nl("color:",zl.ui.textDisabled,";cursor:default;",""):"";var K_={name:"1lv1yo7",styles:"display:inline-flex"};const q_=({variant:e})=>"minimal"===e?K_:"",Y_=yl(vb,{target:"e1mv6sxx3"})("color:",zl.theme.foreground,";cursor:pointer;",G_," ",q_,";"),X_=({__next40pxDefaultSize:e,multiple:t,selectSize:n="default"})=>{if(t)return;const r={default:{height:40,minHeight:40,paddingTop:0,paddingBottom:0},small:{height:24,minHeight:24,paddingTop:0,paddingBottom:0},compact:{height:32,minHeight:32,paddingTop:0,paddingBottom:0},"__unstable-large":{height:40,minHeight:40,paddingTop:0,paddingBottom:0}};e||(r.default=r.compact);return Nl(r[n]||r.default,"","")},Z_=({__next40pxDefaultSize:e,multiple:t,selectSize:n="default"})=>{const r={default:Fl.controlPaddingX,small:Fl.controlPaddingXSmall,compact:Fl.controlPaddingXSmall,"__unstable-large":Fl.controlPaddingX};e||(r.default=r.compact);const o=r[n]||r.default;return Mg({paddingLeft:o,paddingRight:o+18,...t?{paddingTop:o,paddingBottom:o}:{}})},Q_=({multiple:e})=>({overflow:e?"auto":"hidden"});var J_={name:"n1jncc",styles:"field-sizing:content"};const eS=({variant:e})=>"minimal"===e?J_:"",tS=yl("select",{target:"e1mv6sxx2"})("&&&{appearance:none;background:transparent;box-sizing:border-box;border:none;box-shadow:none!important;color:currentColor;cursor:inherit;display:block;font-family:inherit;margin:0;width:100%;max-width:none;white-space:nowrap;text-overflow:ellipsis;",eb,";",X_,";",Z_,";",Q_," ",eS,";}"),nS=yl("div",{target:"e1mv6sxx1"})("margin-inline-end:",Il(-1),";line-height:0;path{fill:currentColor;}"),rS=yl(U_,{target:"e1mv6sxx0"})("position:absolute;pointer-events:none;",Mg({right:0}),";");const oS=(0,c.forwardRef)((function({icon:e,size:t=24,...n},r){return(0,c.cloneElement)(e,{width:t,height:t,...n,ref:r})})),iS=(0,_t.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),sS=()=>(0,_t.jsx)(rS,{children:(0,_t.jsx)(nS,{children:(0,_t.jsx)(oS,{icon:iS,size:18})})});function aS({options:e}){return e.map((({id:e,label:t,value:n,...r},o)=>{const i=e||`${t}-${n}-${o}`;return(0,_t.jsx)("option",{value:n,...r,children:t},i)}))}const lS=(0,c.forwardRef)((function(e,t){const{className:n,disabled:r=!1,help:o,hideLabelFromVision:i,id:a,label:c,multiple:u=!1,onChange:d,options:p=[],size:f="default",value:h,labelPosition:m="top",children:g,prefix:v,suffix:b,variant:x="default",__next40pxDefaultSize:y=!1,__nextHasNoMarginBottom:w=!1,__shouldNotWarnDeprecated36pxSize:_,...S}=hb(e),C=function(e){const t=(0,l.useInstanceId)(lS);return e||`inspector-select-control-${t}`}(a),k=o?`${C}__help`:void 0;if(!p?.length&&!g)return null;const j=s("components-select-control",n);return Ux({componentName:"SelectControl",__next40pxDefaultSize:y,size:f,__shouldNotWarnDeprecated36pxSize:_}),(0,_t.jsx)(Wx,{help:o,id:C,__nextHasNoMarginBottom:w,__associatedWPComponentName:"SelectControl",children:(0,_t.jsx)(Y_,{className:j,disabled:r,hideLabelFromVision:i,id:C,isBorderless:"minimal"===x,label:c,size:f,suffix:b||!u&&(0,_t.jsx)(sS,{}),prefix:v,labelPosition:m,__unstableInputWidth:"minimal"===x?"auto":void 0,variant:x,__next40pxDefaultSize:y,children:(0,_t.jsx)(tS,{...S,__next40pxDefaultSize:y,"aria-describedby":k,className:"components-select-control__input",disabled:r,id:C,multiple:u,onChange:t=>{if(e.multiple){const n=Array.from(t.target.options).filter((({selected:e})=>e)).map((({value:e})=>e));e.onChange?.(n,{event:t})}else e.onChange?.(t.target.value,{event:t})},ref:t,selectSize:f,value:h,variant:x,children:g||(0,_t.jsx)(aS,{options:p})})})})})),cS=lS,uS={initial:void 0,fallback:""};const dS=function(e,t=uS){const{initial:n,fallback:r}={...uS,...t},[o,i]=(0,c.useState)(e),s=Vg(e);return(0,c.useEffect)((()=>{s&&o&&i(void 0)}),[s,o]),[function(e=[],t){var n;return null!==(n=e.find(Vg))&&void 0!==n?n:t}([e,o,n],r),(0,c.useCallback)((e=>{s||i(e)}),[s])]};function pS(e,t,n){return"number"!=typeof e?null:parseFloat(`${ay(e,t,n)}`)}const fS=30,hS=()=>Nl({height:fS,minHeight:fS},"",""),mS=12,gS=({__next40pxDefaultSize:e})=>!e&&Nl({minHeight:fS},"",""),vS=yl("div",{target:"e1epgpqk14"})("-webkit-tap-highlight-color:transparent;align-items:center;display:flex;justify-content:flex-start;padding:0;position:relative;touch-action:none;width:100%;min-height:40px;",gS,";"),bS=({color:e=zl.ui.borderFocus})=>Nl({color:e},"",""),xS=({marks:e,__nextHasNoMarginBottom:t})=>t?"":Nl({marginBottom:e?16:void 0},"",""),yS=yl("div",{shouldForwardProp:e=>!["color","__nextHasNoMarginBottom","marks"].includes(e),target:"e1epgpqk13"})("display:block;flex:1;position:relative;width:100%;",bS,";",hS,";",xS,";"),wS=yl("span",{target:"e1epgpqk12"})("display:flex;margin-top:",4,"px;",Mg({marginRight:6}),";"),_S=yl("span",{target:"e1epgpqk11"})("display:flex;margin-top:",4,"px;",Mg({marginLeft:6}),";"),SS=({disabled:e,railColor:t})=>{let n=t||"";return e&&(n=zl.ui.backgroundDisabled),Nl({background:n},"","")},CS=yl("span",{target:"e1epgpqk10"})("background-color:",zl.gray[300],";left:0;pointer-events:none;right:0;display:block;height:",4,"px;position:absolute;margin-top:",13,"px;top:0;border-radius:",Fl.radiusFull,";",SS,";"),kS=({disabled:e,trackColor:t})=>{let n=t||"currentColor";return e&&(n=zl.gray[400]),Nl({background:n},"","")},jS=yl("span",{target:"e1epgpqk9"})("background-color:currentColor;border-radius:",Fl.radiusFull,";height:",4,"px;pointer-events:none;display:block;position:absolute;margin-top:",13,"px;top:0;.is-marked &{@media not ( prefers-reduced-motion ){transition:width ease 0.1s;}}",kS,";"),ES=yl("span",{target:"e1epgpqk8"})({name:"g5kg28",styles:"display:block;pointer-events:none;position:relative;width:100%;user-select:none;margin-top:17px"}),PS=yl("span",{target:"e1epgpqk7"})("position:absolute;left:0;top:-4px;height:4px;width:2px;transform:translateX( -50% );background-color:",zl.ui.background,";z-index:1;"),NS=({isFilled:e})=>Nl({color:e?zl.gray[700]:zl.gray[300]},"",""),TS=yl("span",{target:"e1epgpqk6"})("color:",zl.gray[300],";font-size:11px;position:absolute;top:8px;white-space:nowrap;",Mg({left:0}),";",Mg({transform:"translateX( -50% )"},{transform:"translateX( 50% )"}),";",NS,";"),IS=({disabled:e})=>Nl("background-color:",e?zl.gray[400]:zl.theme.accent,";",""),RS=yl("span",{target:"e1epgpqk5"})("align-items:center;display:flex;height:",mS,"px;justify-content:center;margin-top:",9,"px;outline:0;pointer-events:none;position:absolute;top:0;user-select:none;width:",mS,"px;border-radius:",Fl.radiusRound,";z-index:3;.is-marked &{@media not ( prefers-reduced-motion ){transition:left ease 0.1s;}}",IS,";",Mg({marginLeft:-10}),";",Mg({transform:"translateX( 4.5px )"},{transform:"translateX( -4.5px )"}),";"),MS=({isFocused:e})=>e?Nl("&::before{content:' ';position:absolute;background-color:",zl.theme.accent,";opacity:0.4;border-radius:",Fl.radiusRound,";height:",20,"px;width:",20,"px;top:-4px;left:-4px;}",""):"",AS=yl("span",{target:"e1epgpqk4"})("align-items:center;border-radius:",Fl.radiusRound,";height:100%;outline:0;position:absolute;user-select:none;width:100%;box-shadow:",Fl.elevationXSmall,";",IS,";",MS,";"),DS=yl("input",{target:"e1epgpqk3"})("box-sizing:border-box;cursor:pointer;display:block;height:100%;left:0;margin:0 -",6,"px;opacity:0;outline:none;position:absolute;right:0;top:0;width:calc( 100% + ",mS,"px );"),zS=({show:e})=>Nl("display:",e?"inline-block":"none",";opacity:",e?1:0,";@media not ( prefers-reduced-motion ){transition:opacity 120ms ease,display 120ms ease allow-discrete;}@starting-style{opacity:0;}","");var OS={name:"1cypxip",styles:"top:-80%"},LS={name:"1lr98c4",styles:"bottom:-80%"};const FS=({position:e})=>"bottom"===e?LS:OS,BS=yl("span",{target:"e1epgpqk2"})("background:rgba( 0, 0, 0, 0.8 );border-radius:",Fl.radiusSmall,";color:white;font-size:12px;min-width:32px;padding:4px 8px;pointer-events:none;position:absolute;text-align:center;user-select:none;line-height:1.4;",zS,";",FS,";",Mg({transform:"translateX(-50%)"},{transform:"translateX(50%)"}),";"),VS=yl(gy,{target:"e1epgpqk1"})("display:inline-block;font-size:13px;margin-top:0;input[type='number']&{",hS,";}",Mg({marginLeft:`${Il(4)} !important`}),";"),$S=yl("span",{target:"e1epgpqk0"})("display:block;margin-top:0;button,button.is-small{margin-left:0;",hS,";}",Mg({marginLeft:8}),";");const HS=(0,c.forwardRef)((function(e,t){const{describedBy:n,label:r,value:o,...i}=e;return(0,_t.jsx)(DS,{...i,"aria-describedby":n,"aria-label":r,"aria-hidden":!1,ref:t,tabIndex:0,type:"range",value:o})}));function WS(e){const{className:t,isFilled:n=!1,label:r,style:o={},...i}=e,a=s("components-range-control__mark",n&&"is-filled",t),l=s("components-range-control__mark-label",n&&"is-filled");return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(PS,{...i,"aria-hidden":"true",className:a,style:o}),r&&(0,_t.jsx)(TS,{"aria-hidden":"true",className:l,isFilled:n,style:o,children:r})]})}function US(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0,...a}=e;return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(CS,{disabled:t,...a}),n&&(0,_t.jsx)(GS,{disabled:t,marks:n,min:r,max:o,step:i,value:s})]})}function GS(e){const{disabled:t=!1,marks:n=!1,min:r=0,max:o=100,step:i=1,value:s=0}=e,l=function({marks:e,min:t=0,max:n=100,step:r=1,value:o=0}){if(!e)return[];const i=n-t;if(!Array.isArray(e)){e=[];const n=1+Math.round(i/r);for(;n>e.push({value:r*e.length+t}););}const s=[];return e.forEach(((e,r)=>{if(e.value<t||e.value>n)return;const l=`mark-${r}`,c=e.value<=o,u=(e.value-t)/i*100+"%",d={[(0,a.isRTL)()?"right":"left"]:u};s.push({...e,isFilled:c,key:l,style:d})})),s}({marks:n,min:r,max:o,step:"any"===i?1:i,value:s});return(0,_t.jsx)(ES,{"aria-hidden":"true",className:"components-range-control__marks",children:l.map((e=>(0,B.createElement)(WS,{...e,key:e.key,"aria-hidden":"true",disabled:t})))})}function KS(e){const{className:t,inputRef:n,tooltipPosition:r,show:o=!1,style:i={},value:a=0,renderTooltipContent:l=e=>e,zIndex:u=100,...d}=e,p=function({inputRef:e,tooltipPosition:t}){const[n,r]=(0,c.useState)(),o=(0,c.useCallback)((()=>{e&&e.current&&r(t)}),[t,e]);return(0,c.useEffect)((()=>{o()}),[o]),(0,c.useEffect)((()=>(window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}))),n}({inputRef:n,tooltipPosition:r}),f=s("components-simple-tooltip",t),h={...i,zIndex:u};return(0,_t.jsx)(BS,{...d,"aria-hidden":"false",className:f,position:p,show:o,role:"tooltip",style:h,children:l(a)})}const qS=()=>{};function YS({resetFallbackValue:e,initialPosition:t}){return void 0!==e?Number.isNaN(e)?null:e:void 0!==t?Number.isNaN(t)?null:t:null}const XS=(0,c.forwardRef)((function e(t,n){const{__nextHasNoMarginBottom:r=!1,afterIcon:o,allowReset:i=!1,beforeIcon:u,className:d,color:p=zl.theme.accent,currentInput:f,disabled:h=!1,help:m,hideLabelFromVision:g=!1,initialPosition:v,isShiftStepEnabled:b=!0,label:x,marks:y=!1,max:w=100,min:_=0,onBlur:S=qS,onChange:C=qS,onFocus:k=qS,onMouseLeave:j=qS,onMouseMove:E=qS,railColor:P,renderTooltipContent:N=e=>e,resetFallbackValue:T,__next40pxDefaultSize:I=!1,shiftStep:R=10,showTooltip:M,step:A=1,trackColor:D,value:z,withInputField:O=!0,__shouldNotWarnDeprecated36pxSize:L,...F}=t,[B,V]=function(e){const{min:t,max:n,value:r,initial:o}=e,[i,s]=dS(pS(r,t,n),{initial:pS(null!=o?o:null,t,n),fallback:null});return[i,(0,c.useCallback)((e=>{s(null===e?null:pS(e,t,n))}),[t,n,s])]}({min:_,max:w,value:null!=z?z:null,initial:v}),$=(0,c.useRef)(!1);let H=M,W=O;"any"===A&&(H=!1,W=!1);const[U,G]=(0,c.useState)(H),[K,q]=(0,c.useState)(!1),Y=(0,c.useRef)(),X=Y.current?.matches(":focus"),Z=!h&&K,Q=null===B,J=Q?"":void 0!==B?B:f,ee=Q?(w-_)/2+_:B,te=`${ay(Q?50:(B-_)/(w-_)*100,0,100)}%`,ne=s("components-range-control",d),re=s("components-range-control__wrapper",!!y&&"is-marked"),oe=(0,l.useInstanceId)(e,"inspector-range-control"),ie=m?`${oe}__help`:void 0,se=!1!==H&&Number.isFinite(B),ae=()=>{const e=Number.isNaN(T)?null:null!=T?T:null;V(e),C(null!=e?e:void 0)},le={[(0,a.isRTL)()?"right":"left"]:te};return Ux({componentName:"RangeControl",__next40pxDefaultSize:I,size:void 0,__shouldNotWarnDeprecated36pxSize:L}),(0,_t.jsx)(Wx,{__nextHasNoMarginBottom:r,__associatedWPComponentName:"RangeControl",className:ne,label:x,hideLabelFromVision:g,id:`${oe}`,help:m,children:(0,_t.jsxs)(vS,{className:"components-range-control__root",__next40pxDefaultSize:I,children:[u&&(0,_t.jsx)(wS,{children:(0,_t.jsx)(Xx,{icon:u})}),(0,_t.jsxs)(yS,{__nextHasNoMarginBottom:r,className:re,color:p,marks:!!y,children:[(0,_t.jsx)(HS,{...F,className:"components-range-control__slider",describedBy:ie,disabled:h,id:`${oe}`,label:x,max:w,min:_,onBlur:e=>{S(e),q(!1),G(!1)},onChange:e=>{const t=parseFloat(e.target.value);V(t),C(t)},onFocus:e=>{k(e),q(!0),G(!0)},onMouseMove:E,onMouseLeave:j,ref:(0,l.useMergeRefs)([Y,n]),step:A,value:null!=J?J:void 0}),(0,_t.jsx)(US,{"aria-hidden":!0,disabled:h,marks:y,max:w,min:_,railColor:P,step:A,value:ee}),(0,_t.jsx)(jS,{"aria-hidden":!0,className:"components-range-control__track",disabled:h,style:{width:te},trackColor:D}),(0,_t.jsx)(RS,{className:"components-range-control__thumb-wrapper",style:le,disabled:h,children:(0,_t.jsx)(AS,{"aria-hidden":!0,isFocused:Z,disabled:h})}),se&&(0,_t.jsx)(KS,{className:"components-range-control__tooltip",inputRef:Y,tooltipPosition:"bottom",renderTooltipContent:N,show:X||U,style:le,value:B})]}),o&&(0,_t.jsx)(_S,{children:(0,_t.jsx)(Xx,{icon:o})}),W&&(0,_t.jsx)(VS,{"aria-label":x,className:"components-range-control__number",disabled:h,inputMode:"decimal",isShiftStepEnabled:b,max:w,min:_,onBlur:()=>{$.current&&(ae(),$.current=!1)},onChange:e=>{let t=parseFloat(e);V(t),isNaN(t)?i&&($.current=!0):((t<_||t>w)&&(t=pS(t,_,w)),C(t),$.current=!1)},shiftStep:R,size:I?"__unstable-large":"default",__unstableInputWidth:Il(I?20:16),step:A,value:J,__shouldNotWarnDeprecated36pxSize:!0}),i&&(0,_t.jsx)($S,{children:(0,_t.jsx)(Jx,{className:"components-range-control__reset",accessibleWhenDisabled:!h,disabled:h||B===YS({resetFallbackValue:T,initialPosition:v}),variant:"secondary",size:"small",onClick:ae,children:(0,a.__)("Reset")})})]})})})),ZS=XS,QS=yl(gy,{target:"ez9hsf46"})("width:",Il(24),";"),JS=yl(cS,{target:"ez9hsf45"})("margin-left:",Il(-2),";"),eC=yl(ZS,{target:"ez9hsf44"})("flex:1;margin-right:",Il(2),";"),tC=`\n.react-colorful__interactive {\n\twidth: calc( 100% - ${Il(2)} );\n\tmargin-left: ${Il(1)};\n}`,nC=yl("div",{target:"ez9hsf43"})("padding-top:",Il(2),";padding-right:0;padding-left:0;padding-bottom:0;"),rC=yl(fy,{target:"ez9hsf42"})("padding-left:",Il(4),";padding-right:",Il(4),";"),oC=yl(kg,{target:"ez9hsf41"})("padding-top:",Il(4),";padding-left:",Il(4),";padding-right:",Il(3),";padding-bottom:",Il(5),";"),iC=yl("div",{target:"ez9hsf40"})(Rx,";width:216px;.react-colorful{display:flex;flex-direction:column;align-items:center;width:216px;height:auto;}.react-colorful__saturation{width:100%;border-radius:0;height:216px;margin-bottom:",Il(4),";border-bottom:none;}.react-colorful__hue,.react-colorful__alpha{width:184px;height:16px;border-radius:",Fl.radiusFull,";margin-bottom:",Il(2),";}.react-colorful__pointer{height:16px;width:16px;border:none;box-shadow:0 0 2px 0 rgba( 0, 0, 0, 0.25 );outline:2px solid transparent;}.react-colorful__pointer-fill{box-shadow:inset 0 0 0 ",Fl.borderWidthFocus," #fff;}",tC,";"),sC=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})}),aC=e=>{const{color:t,colorType:n}=e,[r,o]=(0,c.useState)(null),i=(0,c.useRef)(),s=(0,l.useCopyToClipboard)((()=>{switch(n){case"hsl":return t.toHslString();case"rgb":return t.toRgbString();default:return t.toHex()}}),(()=>{i.current&&clearTimeout(i.current),o(t.toHex()),i.current=setTimeout((()=>{o(null),i.current=void 0}),3e3)}));(0,c.useEffect)((()=>()=>{i.current&&clearTimeout(i.current)}),[]);const u=r===t.toHex()?(0,a.__)("Copied!"):(0,a.__)("Copy");return(0,_t.jsx)(ss,{delay:0,hideOnClick:!1,text:u,children:(0,_t.jsx)(Qx,{size:"compact","aria-label":u,ref:s,icon:sC,showTooltip:!1})})};const lC=al((function(e,t){const n=sl(e,"InputControlPrefixWrapper");return(0,_t.jsx)(ub,{...n,isPrefix:!0,ref:t})}),"InputControlPrefixWrapper"),cC=({min:e,max:t,label:n,abbreviation:r,onChange:o,value:i})=>(0,_t.jsxs)(fy,{spacing:4,children:[(0,_t.jsx)(QS,{__next40pxDefaultSize:!0,min:e,max:t,label:n,hideLabelFromVision:!0,value:i,onChange:e=>{o(e?"string"!=typeof e?e:parseInt(e,10):0)},prefix:(0,_t.jsx)(lC,{children:(0,_t.jsx)($v,{color:zl.theme.accent,lineHeight:1,children:r})}),spinControls:"none"}),(0,_t.jsx)(eC,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:n,hideLabelFromVision:!0,min:e,max:t,value:i,onChange:o,withInputField:!1})]}),uC=({color:e,onChange:t,enableAlpha:n})=>{const{r,g:o,b:i,a:s}=e.toRgb();return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(cC,{min:0,max:255,label:"Red",abbreviation:"R",value:r,onChange:e=>t(yv({r:e,g:o,b:i,a:s}))}),(0,_t.jsx)(cC,{min:0,max:255,label:"Green",abbreviation:"G",value:o,onChange:e=>t(yv({r,g:e,b:i,a:s}))}),(0,_t.jsx)(cC,{min:0,max:255,label:"Blue",abbreviation:"B",value:i,onChange:e=>t(yv({r,g:o,b:e,a:s}))}),n&&(0,_t.jsx)(cC,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*s),onChange:e=>t(yv({r,g:o,b:i,a:e/100}))})]})},dC=({color:e,onChange:t,enableAlpha:n})=>{const r=(0,c.useMemo)((()=>e.toHsl()),[e]),[o,i]=(0,c.useState)({...r}),s=e.isEqual(yv(o));(0,c.useEffect)((()=>{s||i(r)}),[r,s]);const a=s?o:r,l=n=>{const r=yv({...a,...n});e.isEqual(r)?i((e=>({...e,...n}))):t(r)};return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(cC,{min:0,max:359,label:"Hue",abbreviation:"H",value:a.h,onChange:e=>{l({h:e})}}),(0,_t.jsx)(cC,{min:0,max:100,label:"Saturation",abbreviation:"S",value:a.s,onChange:e=>{l({s:e})}}),(0,_t.jsx)(cC,{min:0,max:100,label:"Lightness",abbreviation:"L",value:a.l,onChange:e=>{l({l:e})}}),n&&(0,_t.jsx)(cC,{min:0,max:100,label:"Alpha",abbreviation:"A",value:Math.trunc(100*a.a),onChange:e=>{l({a:e/100})}})]})},pC=({color:e,onChange:t,enableAlpha:n})=>(0,_t.jsx)(Kx,{prefix:(0,_t.jsx)(lC,{children:(0,_t.jsx)($v,{color:zl.theme.accent,lineHeight:1,children:"#"})}),value:e.toHex().slice(1).toUpperCase(),onChange:e=>{if(!e)return;const n=e.startsWith("#")?e:"#"+e;t(yv(n))},maxLength:n?9:7,label:(0,a.__)("Hex color"),hideLabelFromVision:!0,size:"__unstable-large",__unstableStateReducer:(e,t)=>{const n=t.payload?.event?.nativeEvent;if("insertFromPaste"!==n?.inputType)return{...e};const r=e.value?.startsWith("#")?e.value.slice(1).toUpperCase():e.value?.toUpperCase();return{...e,value:r}},__unstableInputWidth:"9em"}),fC=({colorType:e,color:t,onChange:n,enableAlpha:r})=>{const o={color:t,onChange:n,enableAlpha:r};switch(e){case"hsl":return(0,_t.jsx)(dC,{...o});case"rgb":return(0,_t.jsx)(uC,{...o});default:return(0,_t.jsx)(pC,{...o})}};function hC(){return(hC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function mC(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function gC(e){var t=(0,B.useRef)(e),n=(0,B.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var vC=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e<t?t:e},bC=function(e){return"touches"in e},xC=function(e){return e&&e.ownerDocument.defaultView||self},yC=function(e,t,n){var r=e.getBoundingClientRect(),o=bC(t)?function(e,t){for(var n=0;n<e.length;n++)if(e[n].identifier===t)return e[n];return e[0]}(t.touches,n):t;return{left:vC((o.pageX-(r.left+xC(e).pageXOffset))/r.width),top:vC((o.pageY-(r.top+xC(e).pageYOffset))/r.height)}},wC=function(e){!bC(e)&&e.preventDefault()},_C=B.memo((function(e){var t=e.onMove,n=e.onKey,r=mC(e,["onMove","onKey"]),o=(0,B.useRef)(null),i=gC(t),s=gC(n),a=(0,B.useRef)(null),l=(0,B.useRef)(!1),c=(0,B.useMemo)((function(){var e=function(e){wC(e),(bC(e)?e.touches.length>0:e.buttons>0)&&o.current?i(yC(o.current,e,a.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=xC(o.current),s=n?i.addEventListener:i.removeEventListener;s(r?"touchmove":"mousemove",e),s(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(wC(t),!function(e,t){return t&&!bC(e)}(t,l.current)&&r)){if(bC(t)){l.current=!0;var s=t.changedTouches||[];s.length&&(a.current=s[0].identifier)}r.focus(),i(yC(r,t,a.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),s({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[s,i]),u=c[0],d=c[1],p=c[2];return(0,B.useEffect)((function(){return p}),[p]),B.createElement("div",hC({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:d,tabIndex:0,role:"slider"}))})),SC=function(e){return e.filter(Boolean).join(" ")},CC=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=SC(["react-colorful__pointer",e.className]);return B.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},B.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},kC=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},jC=(Math.PI,function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:kC(e.h),s:kC(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:kC(o/2),a:kC(r,2)}}),EC=function(e){var t=jC(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},PC=function(e){var t=jC(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},NC=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:kC(255*[r,a,s,s,l,r][c]),g:kC(255*[l,r,r,a,s,s][c]),b:kC(255*[s,s,l,r,r,a][c]),a:kC(o,2)}},TC=function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?RC({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},IC=TC,RC=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:kC(60*(a<0?a+6:a)),s:kC(i?s/i*100:0),v:kC(i/255*100),a:o}},MC=B.memo((function(e){var t=e.hue,n=e.onChange,r=SC(["react-colorful__hue",e.className]);return B.createElement("div",{className:r},B.createElement(_C,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:vC(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":kC(t),"aria-valuemax":"360","aria-valuemin":"0"},B.createElement(CC,{className:"react-colorful__hue-pointer",left:t/360,color:EC({h:t,s:100,v:100,a:1})})))})),AC=B.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:EC({h:t.h,s:100,v:100,a:1})};return B.createElement("div",{className:"react-colorful__saturation",style:r},B.createElement(_C,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:vC(t.s+100*e.left,0,100),v:vC(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+kC(t.s)+"%, Brightness "+kC(t.v)+"%"},B.createElement(CC,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:EC(t)})))})),DC=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0},zC=function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")};function OC(e,t,n){var r=gC(n),o=(0,B.useState)((function(){return e.toHsva(t)})),i=o[0],s=o[1],a=(0,B.useRef)({color:t,hsva:i});(0,B.useEffect)((function(){if(!e.equal(t,a.current.color)){var n=e.toHsva(t);a.current={hsva:n,color:t},s(n)}}),[t,e]),(0,B.useEffect)((function(){var t;DC(i,a.current.hsva)||e.equal(t=e.fromHsva(i),a.current.color)||(a.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=(0,B.useCallback)((function(e){s((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var LC,FC="undefined"!=typeof window?B.useLayoutEffect:B.useEffect,BC=new Map,VC=function(e){FC((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!BC.has(t)){var n=t.createElement("style");n.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',BC.set(t,n);var r=LC||o.nc;r&&n.setAttribute("nonce",r),t.head.appendChild(n)}}),[])},$C=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=mC(e,["className","colorModel","color","onChange"]),a=(0,B.useRef)(null);VC(a);var l=OC(n,o,i),c=l[0],u=l[1],d=SC(["react-colorful",t]);return B.createElement("div",hC({},s,{ref:a,className:d}),B.createElement(AC,{hsva:c,onChange:u}),B.createElement(MC,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},HC=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+PC(Object.assign({},n,{a:0}))+", "+PC(Object.assign({},n,{a:1}))+")"},i=SC(["react-colorful__alpha",t]),s=kC(100*n.a);return B.createElement("div",{className:i},B.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),B.createElement(_C,{onMove:function(e){r({a:e.left})},onKey:function(e){r({a:vC(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":s+"%","aria-valuenow":s,"aria-valuemin":"0","aria-valuemax":"100"},B.createElement(CC,{className:"react-colorful__alpha-pointer",left:n.a,color:PC(n)})))},WC=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,s=mC(e,["className","colorModel","color","onChange"]),a=(0,B.useRef)(null);VC(a);var l=OC(n,o,i),c=l[0],u=l[1],d=SC(["react-colorful",t]);return B.createElement("div",hC({},s,{ref:a,className:d}),B.createElement(AC,{hsva:c,onChange:u}),B.createElement(MC,{hue:c.h,onChange:u}),B.createElement(HC,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},UC={defaultColor:"rgba(0, 0, 0, 1)",toHsva:TC,fromHsva:function(e){var t=NC(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:zC},GC=function(e){return B.createElement(WC,hC({},e,{colorModel:UC}))},KC={defaultColor:"rgb(0, 0, 0)",toHsva:IC,fromHsva:function(e){var t=NC(e);return"rgb("+t.r+", "+t.g+", "+t.b+")"},equal:zC},qC=function(e){return B.createElement($C,hC({},e,{colorModel:KC}))};const YC=({color:e,enableAlpha:t,onChange:n})=>{const r=t?GC:qC,o=(0,c.useMemo)((()=>e.toRgbString()),[e]);return(0,_t.jsx)(r,{color:o,onChange:e=>{n(yv(e))},onPointerDown:({currentTarget:e,pointerId:t})=>{e.setPointerCapture(t)},onPointerUp:({currentTarget:e,pointerId:t})=>{e.releasePointerCapture(t)}})};_v([Sv]);const XC=[{label:"RGB",value:"rgb"},{label:"HSL",value:"hsl"},{label:"Hex",value:"hex"}],ZC=al(((e,t)=>{const{enableAlpha:n=!1,color:r,onChange:o,defaultValue:i="#fff",copyFormat:s,...u}=sl(e,"ColorPicker"),[d,p]=f_({onChange:o,value:r,defaultValue:i}),f=(0,c.useMemo)((()=>yv(d||"")),[d]),h=(0,l.useDebounce)(p),m=(0,c.useCallback)((e=>{h(e.toHex())}),[h]),[g,v]=(0,c.useState)(s||"hex");return(0,_t.jsxs)(iC,{ref:t,...u,children:[(0,_t.jsx)(YC,{onChange:m,color:f,enableAlpha:n}),(0,_t.jsxs)(nC,{children:[(0,_t.jsxs)(rC,{justify:"space-between",children:[(0,_t.jsx)(JS,{__nextHasNoMarginBottom:!0,size:"compact",options:XC,value:g,onChange:e=>v(e),label:(0,a.__)("Color format"),hideLabelFromVision:!0,variant:"minimal"}),(0,_t.jsx)(aC,{color:f,colorType:s||g})]}),(0,_t.jsx)(oC,{direction:"column",gap:2,children:(0,_t.jsx)(fC,{colorType:g,color:f,onChange:m,enableAlpha:n})})]})]})}),"ColorPicker"),QC=ZC;function JC(e){if(void 0!==e)return"string"==typeof e?e:e.hex?e.hex:void 0}const ek=Es((e=>{const t=yv(e),n=t.toHex(),r=t.toRgb(),o=t.toHsv(),i=t.toHsl();return{hex:n,rgb:r,hsv:o,hsl:i,source:"hex",oldHue:i.h}}));function tk(e){const{onChangeComplete:t}=e,n=(0,c.useCallback)((e=>{t(ek(e))}),[t]);return function(e){return void 0!==e.onChangeComplete||void 0!==e.disableAlpha||"string"==typeof e.color?.hex}(e)?{color:JC(e.color),enableAlpha:!e.disableAlpha,onChange:n}:{...e,color:e.color,enableAlpha:e.enableAlpha,onChange:e.onChange}}const nk=e=>(0,_t.jsx)(QC,{...tk(e)}),rk=(0,c.createContext)({}),ok=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})});const ik=(0,c.forwardRef)((function(e,t){const{isPressed:n,label:r,...o}=e;return(0,_t.jsx)(Jx,{...o,"aria-pressed":n,ref:t,label:r})}));const sk=(0,c.forwardRef)((function(e,t){const{id:n,isSelected:r,label:o,...i}=e,{setActiveId:s,activeId:a}=(0,c.useContext)(rk);return(0,c.useEffect)((()=>{r&&!a&&window.setTimeout((()=>s?.(n)),0)}),[r,s,a,n]),(0,_t.jsx)(Gn.Item,{render:(0,_t.jsx)(Jx,{...i,role:"option","aria-selected":!!r,ref:t,label:o}),id:n})}));function ak(e){const{actions:t,options:n,baseId:r,className:o,loop:i=!0,children:s,...l}=e,[u,d]=(0,c.useState)(void 0),p=(0,c.useMemo)((()=>({baseId:r,activeId:u,setActiveId:d})),[r,u,d]);return(0,_t.jsx)("div",{className:o,children:(0,_t.jsxs)(rk.Provider,{value:p,children:[(0,_t.jsx)(Gn,{...l,id:r,focusLoop:i,rtl:(0,a.isRTL)(),role:"listbox",activeId:u,setActiveId:d,children:n}),s,t]})})}function lk(e){const{actions:t,options:n,children:r,baseId:o,...i}=e,s=(0,c.useMemo)((()=>({baseId:o})),[o]);return(0,_t.jsx)("div",{...i,role:"group",id:o,children:(0,_t.jsxs)(rk.Provider,{value:s,children:[n,r,t]})})}function ck(e){const{asButtons:t,actions:n,options:r,children:o,className:i,...a}=e,c=(0,l.useInstanceId)(ck,"components-circular-option-picker",a.id),u=t?lk:ak,d=n?(0,_t.jsx)("div",{className:"components-circular-option-picker__custom-clear-wrapper",children:n}):void 0,p=(0,_t.jsx)("div",{className:"components-circular-option-picker__swatches",children:r});return(0,_t.jsx)(u,{...a,baseId:c,className:s("components-circular-option-picker",i),actions:d,options:p,children:o})}ck.Option=function e({className:t,isSelected:n,selectedIconProps:r={},tooltipText:o,...i}){const{baseId:a,setActiveId:u}=(0,c.useContext)(rk),d={id:(0,l.useInstanceId)(e,a||"components-circular-option-picker__option"),className:"components-circular-option-picker__option",__next40pxDefaultSize:!0,...i},p=void 0!==u?(0,_t.jsx)(sk,{...d,label:o,isSelected:n}):(0,_t.jsx)(ik,{...d,label:o,isPressed:n});return(0,_t.jsxs)("div",{className:s(t,"components-circular-option-picker__option-wrapper"),children:[p,n&&(0,_t.jsx)(oS,{icon:ok,...r})]})},ck.OptionGroup=function({className:e,options:t,...n}){const r="aria-label"in n||"aria-labelledby"in n?"group":void 0;return(0,_t.jsx)("div",{...n,role:r,className:s("components-circular-option-picker__option-group","components-circular-option-picker__swatches",e),children:t})},ck.ButtonAction=function({className:e,children:t,...n}){return(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,className:s("components-circular-option-picker__clear",e),variant:"tertiary",...n,children:t})},ck.DropdownLinkAction=function({buttonProps:e,className:t,dropdownProps:n,linkText:r}){return(0,_t.jsx)(W_,{className:s("components-circular-option-picker__dropdown-link-action",t),renderToggle:({isOpen:t,onToggle:n})=>(0,_t.jsx)(Jx,{"aria-expanded":t,"aria-haspopup":"true",onClick:n,variant:"link",...e,children:r}),...n})};const uk=ck;function dk(e,t,n,r){return{metaProps:e?{asButtons:!0}:{asButtons:!1,loop:t},labelProps:{"aria-labelledby":r,"aria-label":r?void 0:n||(0,a.__)("Custom color picker")}}}const pk=al((function(e,t){const n=function(e){const{expanded:t=!1,alignment:n="stretch",...r}=sl(e,"VStack");return py({direction:"column",expanded:t,alignment:n,...r})}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"VStack");const fk=al((function(e,t){const n=Kg(e);return(0,_t.jsx)(_l,{as:"span",...n,ref:t})}),"Truncate");const hk=al((function(e,t){const n=function(e){const{as:t,level:n=2,color:r=zl.theme.foreground,isBlock:o=!0,weight:i=Fl.fontWeightHeading,...s}=sl(e,"Heading"),a=t||`h${n}`,l={};return"string"==typeof a&&"h"!==a[0]&&(l.role="heading",l["aria-level"]="string"==typeof n?parseInt(n):n),{...Vv({color:r,isBlock:o,weight:i,size:Fv(n),...s}),...l,as:a}}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Heading"),mk=hk;const gk=yl(mk,{target:"ev9wop70"})({name:"13lxv2o",styles:"text-transform:uppercase;line-height:24px;font-weight:500;&&&{font-size:11px;margin-bottom:0;}"}),vk=({paddingSize:e="small"})=>{if("none"===e)return;const t={small:Il(2),medium:Il(4)};return Nl("padding:",t[e]||t.small,";","")},bk=yl("div",{target:"eovvns30"})("margin-left:",Il(-2),";margin-right:",Il(-2),";&:first-of-type{margin-top:",Il(-2),";}&:last-of-type{margin-bottom:",Il(-2),";}",vk,";");const xk=al((function(e,t){const{paddingSize:n="small",...r}=sl(e,"DropdownContentWrapper");return(0,_t.jsx)(bk,{...r,paddingSize:n,ref:t})}),"DropdownContentWrapper");_v([Sv,$_]);const yk=e=>{const t=/var\(/.test(null!=e?e:""),n=/color-mix\(/.test(null!=e?e:"");return!t&&!n},wk=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.colors)&&!("color"in t);var t}));function _k({className:e,clearColor:t,colors:n,onChange:r,value:o,...i}){const s=(0,c.useMemo)((()=>n.map((({color:e,name:n},i)=>{const s=yv(e),l=o===e;return(0,_t.jsx)(uk.Option,{isSelected:l,selectedIconProps:l?{fill:s.contrast()>s.contrast("#000")?"#fff":"#000"}:{},tooltipText:n||(0,a.sprintf)((0,a.__)("Color code: %s"),e),style:{backgroundColor:e,color:e},onClick:l?t:()=>r(e,i)},`${e}-${i}`)}))),[n,o,r,t]);return(0,_t.jsx)(uk.OptionGroup,{className:e,options:s,...i})}function Sk({className:e,clearColor:t,colors:n,onChange:r,value:o,headingLevel:i}){const s=(0,l.useInstanceId)(Sk,"color-palette");return 0===n.length?null:(0,_t.jsx)(pk,{spacing:3,className:e,children:n.map((({name:e,colors:n},a)=>{const l=`${s}-${a}`;return(0,_t.jsxs)(pk,{spacing:2,children:[(0,_t.jsx)(gk,{id:l,level:i,children:e}),(0,_t.jsx)(_k,{clearColor:t,colors:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function Ck({isRenderedInSidebar:e,popoverProps:t,...n}){const r=(0,c.useMemo)((()=>({shift:!0,resize:!1,...e?{placement:"left-start",offset:34}:{placement:"bottom",offset:8},...t})),[e,t]);return(0,_t.jsx)(W_,{contentClassName:"components-color-palette__custom-color-dropdown-content",popoverProps:r,...n})}_v([Sv,$_]);const kk=(0,c.forwardRef)((function(e,t){const{asButtons:n,loop:r,clearable:o=!0,colors:i=[],disableCustomColors:l=!1,enableAlpha:u=!1,onChange:d,value:p,__experimentalIsRenderedInSidebar:f=!1,headingLevel:h=2,"aria-label":m,"aria-labelledby":g,...v}=e,[b,x]=(0,c.useState)(p),y=(0,c.useCallback)((()=>d(void 0)),[d]),w=(0,c.useCallback)((e=>{x(((e,t)=>{if(!e||!t||yk(e))return e;const{ownerDocument:n}=t,{defaultView:r}=n,o=r?.getComputedStyle(t).backgroundColor;return o?yv(o).toHex():e})(p,e))}),[p]),_=wk(i),S=(0,c.useMemo)((()=>((e,t=[],n=!1)=>{if(!e)return"";const r=!!e&&yk(e),o=r?yv(e).toHex():e,i=n?t:[{colors:t}];for(const{colors:e}of i)for(const{name:t,color:n}of e)if(o===(r?yv(n).toHex():n))return t;return(0,a.__)("Custom")})(p,i,_)),[p,i,_]),C=p?.startsWith("#"),k=p?.replace(/^var\((.+)\)$/,"$1"),j=k?(0,a.sprintf)((0,a.__)('Custom color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),S,k):(0,a.__)("Custom color picker"),E={clearColor:y,onChange:d,value:p},P=!!o&&(0,_t.jsx)(uk.ButtonAction,{onClick:y,accessibleWhenDisabled:!0,disabled:!p,children:(0,a.__)("Clear")}),{metaProps:N,labelProps:T}=dk(n,r,m,g);return(0,_t.jsxs)(pk,{spacing:3,ref:t,...v,children:[!l&&(0,_t.jsx)(Ck,{isRenderedInSidebar:f,renderContent:()=>(0,_t.jsx)(xk,{paddingSize:"none",children:(0,_t.jsx)(nk,{color:b,onChange:e=>d(e),enableAlpha:u})}),renderToggle:({isOpen:e,onToggle:t})=>(0,_t.jsxs)(pk,{className:"components-color-palette__custom-color-wrapper",spacing:0,children:[(0,_t.jsx)("button",{ref:w,className:"components-color-palette__custom-color-button","aria-expanded":e,"aria-haspopup":"true",onClick:t,"aria-label":j,style:{background:p},type:"button"}),(0,_t.jsxs)(pk,{className:"components-color-palette__custom-color-text-wrapper",spacing:.5,children:[(0,_t.jsx)(fk,{className:"components-color-palette__custom-color-name",children:p?S:(0,a.__)("No color selected")}),(0,_t.jsx)(fk,{className:s("components-color-palette__custom-color-value",{"components-color-palette__custom-color-value--is-hex":C}),children:k})]})]})}),(i.length>0||P)&&(0,_t.jsx)(uk,{...N,...T,actions:P,options:_?(0,_t.jsx)(Sk,{...E,headingLevel:h,colors:i,value:p}):(0,_t.jsx)(_k,{...E,colors:i,value:p})})]})})),jk=kk,Ek=yl(gy,{target:"e1bagdl32"})("&&&{input{display:block;width:100%;}",Kv,"{transition:box-shadow 0.1s linear;}}"),Pk=({selectSize:e})=>({small:Nl("box-sizing:border-box;padding:2px 1px;width:20px;font-size:8px;line-height:1;letter-spacing:-0.5px;text-transform:uppercase;text-align-last:center;&:not( :disabled ){color:",zl.gray[800],";}",""),default:Nl("box-sizing:border-box;min-width:24px;max-width:48px;height:24px;margin-inline-end:",Il(2),";padding:",Il(1),";font-size:13px;line-height:1;text-align-last:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;field-sizing:content;&:not( :disabled ){color:",zl.theme.accent,";}","")}[e]),Nk=yl("div",{target:"e1bagdl31"})("&&&{pointer-events:none;",Pk,";color:",zl.gray[900],";}"),Tk=({selectSize:e="default"})=>({small:Nl("height:100%;border:1px solid transparent;transition:box-shadow 0.1s linear,border 0.1s linear;",Mg({borderTopLeftRadius:0,borderBottomLeftRadius:0})()," &:not(:disabled):hover{background-color:",zl.gray[100],";}&:focus{border:1px solid ",zl.ui.borderFocus,";box-shadow:inset 0 0 0 ",Fl.borderWidth+" "+zl.ui.borderFocus,";outline-offset:0;outline:2px solid transparent;z-index:1;}",""),default:Nl("display:flex;justify-content:center;align-items:center;&:where( :not( :disabled ) ):hover{box-shadow:0 0 0 ",Fl.borderWidth+" "+zl.ui.borderFocus,";outline:",Fl.borderWidth," solid transparent;}&:focus{box-shadow:0 0 0 ",Fl.borderWidthFocus+" "+zl.ui.borderFocus,";outline:",Fl.borderWidthFocus," solid transparent;}","")}[e]),Ik=yl("select",{target:"e1bagdl30"})("&&&{appearance:none;background:transparent;border-radius:",Fl.radiusXSmall,";border:none;display:block;outline:none;margin:0;min-height:auto;font-family:inherit;",Pk,";",Tk,";&:not( :disabled ){cursor:pointer;}}");const Rk=Nl("box-shadow:inset ",Fl.controlBoxShadowFocus,";",""),Mk=Nl("border:0;padding:0;margin:0;",Rx,";",""),Ak=Nl(Ek,"{flex:0 0 auto;}",""),Dk=Nl("background:#fff;&&>button{aspect-ratio:1;padding:0;display:flex;align-items:center;justify-content:center;",Mg({borderRadius:"2px 0 0 2px"},{borderRadius:"0 2px 2px 0"})()," border:",Fl.borderWidth," solid ",zl.ui.border,";&:focus,&:hover:not( :disabled ){",Rk," border-color:",zl.ui.borderFocus,";z-index:1;position:relative;}}",""),zk=(e,t)=>{const{style:n}=e||{};return Nl("border-radius:",Fl.radiusFull,";border:2px solid transparent;",n?(e=>{const{color:t,style:n}=e||{},r=n&&"none"!==n?zl.gray[300]:void 0;return Nl("border-style:","none"===n?"solid":n,";border-color:",t||r,";","")})(e):void 0," width:","__unstable-large"===t?"24px":"22px",";height:","__unstable-large"===t?"24px":"22px",";padding:","__unstable-large"===t?"2px":"1px",";&>span{height:",Il(4),";width:",Il(4),";background:linear-gradient(\n\t\t\t\t-45deg,\n\t\t\t\ttransparent 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 48%,\n\t\t\t\trgb( 0 0 0 / 20% ) 52%,\n\t\t\t\ttransparent 52%\n\t\t\t);}","")},Ok=Nl("width:",228,"px;>div:first-of-type>",Ox,"{margin-bottom:0;}&& ",Ox,"+button:not( .has-text ){min-width:24px;padding:0;}",""),Lk=Nl("",""),Fk=Nl("",""),Bk={name:"1ghe26v",styles:"display:flex;justify-content:flex-end;margin-top:12px"},Vk="web"===c.Platform.OS,$k={px:{value:"px",label:Vk?"px":(0,a.__)("Pixels (px)"),a11yLabel:(0,a.__)("Pixels (px)"),step:1},"%":{value:"%",label:Vk?"%":(0,a.__)("Percentage (%)"),a11yLabel:(0,a.__)("Percent (%)"),step:.1},em:{value:"em",label:Vk?"em":(0,a.__)("Relative to parent font size (em)"),a11yLabel:(0,a._x)("ems","Relative to parent font size (em)"),step:.01},rem:{value:"rem",label:Vk?"rem":(0,a.__)("Relative to root font size (rem)"),a11yLabel:(0,a._x)("rems","Relative to root font size (rem)"),step:.01},vw:{value:"vw",label:Vk?"vw":(0,a.__)("Viewport width (vw)"),a11yLabel:(0,a.__)("Viewport width (vw)"),step:.1},vh:{value:"vh",label:Vk?"vh":(0,a.__)("Viewport height (vh)"),a11yLabel:(0,a.__)("Viewport height (vh)"),step:.1},vmin:{value:"vmin",label:Vk?"vmin":(0,a.__)("Viewport smallest dimension (vmin)"),a11yLabel:(0,a.__)("Viewport smallest dimension (vmin)"),step:.1},vmax:{value:"vmax",label:Vk?"vmax":(0,a.__)("Viewport largest dimension (vmax)"),a11yLabel:(0,a.__)("Viewport largest dimension (vmax)"),step:.1},ch:{value:"ch",label:Vk?"ch":(0,a.__)("Width of the zero (0) character (ch)"),a11yLabel:(0,a.__)("Width of the zero (0) character (ch)"),step:.01},ex:{value:"ex",label:Vk?"ex":(0,a.__)("x-height of the font (ex)"),a11yLabel:(0,a.__)("x-height of the font (ex)"),step:.01},cm:{value:"cm",label:Vk?"cm":(0,a.__)("Centimeters (cm)"),a11yLabel:(0,a.__)("Centimeters (cm)"),step:.001},mm:{value:"mm",label:Vk?"mm":(0,a.__)("Millimeters (mm)"),a11yLabel:(0,a.__)("Millimeters (mm)"),step:.1},in:{value:"in",label:Vk?"in":(0,a.__)("Inches (in)"),a11yLabel:(0,a.__)("Inches (in)"),step:.001},pc:{value:"pc",label:Vk?"pc":(0,a.__)("Picas (pc)"),a11yLabel:(0,a.__)("Picas (pc)"),step:1},pt:{value:"pt",label:Vk?"pt":(0,a.__)("Points (pt)"),a11yLabel:(0,a.__)("Points (pt)"),step:1},svw:{value:"svw",label:Vk?"svw":(0,a.__)("Small viewport width (svw)"),a11yLabel:(0,a.__)("Small viewport width (svw)"),step:.1},svh:{value:"svh",label:Vk?"svh":(0,a.__)("Small viewport height (svh)"),a11yLabel:(0,a.__)("Small viewport height (svh)"),step:.1},svi:{value:"svi",label:Vk?"svi":(0,a.__)("Viewport smallest size in the inline direction (svi)"),a11yLabel:(0,a.__)("Small viewport width or height (svi)"),step:.1},svb:{value:"svb",label:Vk?"svb":(0,a.__)("Viewport smallest size in the block direction (svb)"),a11yLabel:(0,a.__)("Small viewport width or height (svb)"),step:.1},svmin:{value:"svmin",label:Vk?"svmin":(0,a.__)("Small viewport smallest dimension (svmin)"),a11yLabel:(0,a.__)("Small viewport smallest dimension (svmin)"),step:.1},lvw:{value:"lvw",label:Vk?"lvw":(0,a.__)("Large viewport width (lvw)"),a11yLabel:(0,a.__)("Large viewport width (lvw)"),step:.1},lvh:{value:"lvh",label:Vk?"lvh":(0,a.__)("Large viewport height (lvh)"),a11yLabel:(0,a.__)("Large viewport height (lvh)"),step:.1},lvi:{value:"lvi",label:Vk?"lvi":(0,a.__)("Large viewport width or height (lvi)"),a11yLabel:(0,a.__)("Large viewport width or height (lvi)"),step:.1},lvb:{value:"lvb",label:Vk?"lvb":(0,a.__)("Large viewport width or height (lvb)"),a11yLabel:(0,a.__)("Large viewport width or height (lvb)"),step:.1},lvmin:{value:"lvmin",label:Vk?"lvmin":(0,a.__)("Large viewport smallest dimension (lvmin)"),a11yLabel:(0,a.__)("Large viewport smallest dimension (lvmin)"),step:.1},dvw:{value:"dvw",label:Vk?"dvw":(0,a.__)("Dynamic viewport width (dvw)"),a11yLabel:(0,a.__)("Dynamic viewport width (dvw)"),step:.1},dvh:{value:"dvh",label:Vk?"dvh":(0,a.__)("Dynamic viewport height (dvh)"),a11yLabel:(0,a.__)("Dynamic viewport height (dvh)"),step:.1},dvi:{value:"dvi",label:Vk?"dvi":(0,a.__)("Dynamic viewport width or height (dvi)"),a11yLabel:(0,a.__)("Dynamic viewport width or height (dvi)"),step:.1},dvb:{value:"dvb",label:Vk?"dvb":(0,a.__)("Dynamic viewport width or height (dvb)"),a11yLabel:(0,a.__)("Dynamic viewport width or height (dvb)"),step:.1},dvmin:{value:"dvmin",label:Vk?"dvmin":(0,a.__)("Dynamic viewport smallest dimension (dvmin)"),a11yLabel:(0,a.__)("Dynamic viewport smallest dimension (dvmin)"),step:.1},dvmax:{value:"dvmax",label:Vk?"dvmax":(0,a.__)("Dynamic viewport largest dimension (dvmax)"),a11yLabel:(0,a.__)("Dynamic viewport largest dimension (dvmax)"),step:.1},svmax:{value:"svmax",label:Vk?"svmax":(0,a.__)("Small viewport largest dimension (svmax)"),a11yLabel:(0,a.__)("Small viewport largest dimension (svmax)"),step:.1},lvmax:{value:"lvmax",label:Vk?"lvmax":(0,a.__)("Large viewport largest dimension (lvmax)"),a11yLabel:(0,a.__)("Large viewport largest dimension (lvmax)"),step:.1}},Hk=Object.values($k),Wk=[$k.px,$k["%"],$k.em,$k.rem,$k.vw,$k.vh],Uk=$k.px;function Gk(e,t,n){return qk(t?`${null!=e?e:""}${t}`:e,n)}function Kk(e){return Array.isArray(e)&&!!e.length}function qk(e,t=Hk){let n,r;if(void 0!==e||null===e){n=`${e}`.trim();const t=parseFloat(n);r=isFinite(t)?t:void 0}const o=n?.match(/[\d.\-\+]*\s*(.*)/),i=o?.[1]?.toLowerCase();let s;if(Kk(t)){const e=t.find((e=>e.value===i));s=e?.value}else s=Uk.value;return[r,s]}const Yk=({units:e=Hk,availableUnits:t=[],defaultValues:n})=>{const r=function(e=[],t){return Array.isArray(t)?t.filter((t=>e.includes(t.value))):[]}(t,e);return n&&r.forEach(((e,t)=>{if(n[e.value]){const[o]=qk(n[e.value]);r[t].default=o}})),r};const Xk=e=>e.replace(/^var\((.+)\)$/,"$1"),Zk=al(((e,t)=>{const{__experimentalIsRenderedInSidebar:n,border:r,colors:o,disableCustomColors:i,enableAlpha:s,enableStyle:l,indicatorClassName:u,indicatorWrapperClassName:d,isStyleSettable:p,onReset:f,onColorChange:h,onStyleChange:m,popoverContentClassName:g,popoverControlsClassName:v,resetButtonWrapperClassName:b,size:x,__unstablePopoverProps:y,...w}=function(e){const{border:t,className:n,colors:r=[],enableAlpha:o=!1,enableStyle:i=!0,onChange:s,previousStyleSelection:a,size:l="default",__experimentalIsRenderedInSidebar:u=!1,...d}=sl(e,"BorderControlDropdown"),[p]=qk(t?.width),f=0===p,h=il(),m=(0,c.useMemo)((()=>h(Dk,n)),[n,h]),g=(0,c.useMemo)((()=>h(Fk)),[h]),v=(0,c.useMemo)((()=>h(zk(t,l))),[t,h,l]),b=(0,c.useMemo)((()=>h(Ok)),[h]),x=(0,c.useMemo)((()=>h(Lk)),[h]),y=(0,c.useMemo)((()=>h(Bk)),[h]);return{...d,border:t,className:m,colors:r,enableAlpha:o,enableStyle:i,indicatorClassName:g,indicatorWrapperClassName:v,onColorChange:e=>{s({color:e,style:"none"===t?.style?a:t?.style,width:f&&e?"1px":t?.width})},onStyleChange:e=>{const n=f&&e?"1px":t?.width;s({...t,style:e,width:n})},onReset:()=>{s({...t,color:void 0,style:void 0})},popoverContentClassName:x,popoverControlsClassName:b,resetButtonWrapperClassName:y,size:l,__experimentalIsRenderedInSidebar:u}}(e),{color:_,style:S}=r||{},C=((e,t)=>{if(e&&t){if(wk(t)){let n;return t.some((t=>t.colors.some((t=>t.color===e&&(n=t,!0))))),n}return t.find((t=>t.color===e))}})(_,o),k=((e,t,n,r)=>{if(r){if(t){const e=Xk(t.color);return n?(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s". The currently selected style is "%3$s".'),t.name,e,n):(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),t.name,e)}if(e){const t=Xk(e);return n?(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color has a value of "%1$s". The currently selected style is "%2$s".'),t,n):(0,a.sprintf)((0,a.__)('Border color and style picker. The currently selected color has a value of "%s".'),t)}return(0,a.__)("Border color and style picker.")}return t?(0,a.sprintf)((0,a.__)('Border color picker. The currently selected color is called "%1$s" and has a value of "%2$s".'),t.name,Xk(t.color)):e?(0,a.sprintf)((0,a.__)('Border color picker. The currently selected color has a value of "%s".'),Xk(e)):(0,a.__)("Border color picker.")})(_,C,S,l),j=_||S&&"none"!==S,E=n?"bottom left":void 0;return(0,_t.jsx)(W_,{renderToggle:({onToggle:e})=>(0,_t.jsx)(Jx,{onClick:e,variant:"tertiary","aria-label":k,tooltipPosition:E,label:(0,a.__)("Border color and style picker"),showTooltip:!0,__next40pxDefaultSize:"__unstable-large"===x,children:(0,_t.jsx)("span",{className:d,children:(0,_t.jsx)(F_,{className:u,colorValue:_})})}),renderContent:()=>(0,_t.jsx)(_t.Fragment,{children:(0,_t.jsxs)(xk,{paddingSize:"medium",children:[(0,_t.jsxs)(pk,{className:v,spacing:6,children:[(0,_t.jsx)(jk,{className:g,value:_,onChange:h,colors:o,disableCustomColors:i,__experimentalIsRenderedInSidebar:n,clearable:!1,enableAlpha:s}),l&&p&&(0,_t.jsx)(L_,{label:(0,a.__)("Style"),value:S,onChange:m})]}),(0,_t.jsx)("div",{className:b,children:(0,_t.jsx)(Jx,{variant:"tertiary",onClick:()=>{f()},disabled:!j,accessibleWhenDisabled:!0,__next40pxDefaultSize:!0,children:(0,a.__)("Reset")})})]})}),popoverProps:{...y},...w,ref:t})}),"BorderControlDropdown"),Qk=Zk;const Jk=(0,c.forwardRef)((function({className:e,isUnitSelectTabbable:t=!0,onChange:n,size:r="default",unit:o="px",units:i=Wk,...a},l){if(!Kk(i)||1===i?.length)return(0,_t.jsx)(Nk,{className:"components-unit-control__unit-label",selectSize:r,children:o});const c=s("components-unit-control__select",e);return(0,_t.jsx)(Ik,{ref:l,className:c,onChange:e=>{const{value:t}=e.target,r=i.find((e=>e.value===t));n?.(t,{event:e,data:r})},selectSize:r,tabIndex:t?void 0:-1,value:o,...a,children:i.map((e=>(0,_t.jsx)("option",{value:e.value,children:e.label},e.value)))})}));const ej=(0,c.forwardRef)((function(e,t){const{__unstableStateReducer:n,autoComplete:r="off",children:o,className:i,disabled:l=!1,disableUnits:u=!1,isPressEnterToChange:d=!1,isResetValueOnUnitChange:p=!1,isUnitSelectTabbable:f=!0,label:h,onChange:m,onUnitChange:g,size:v="default",unit:b,units:x=Wk,value:y,onFocus:w,__shouldNotWarnDeprecated36pxSize:_,...S}=hb(e);Ux({componentName:"UnitControl",__next40pxDefaultSize:S.__next40pxDefaultSize,size:v,__shouldNotWarnDeprecated36pxSize:_}),"unit"in e&&Xi()("UnitControl unit prop",{since:"5.6",hint:"The unit should be provided within the `value` prop.",version:"6.2"});const C=null!=y?y:void 0,[k,j]=(0,c.useMemo)((()=>{const e=function(e,t,n=Hk){const r=Array.isArray(n)?[...n]:[],[,o]=Gk(e,t,Hk);return o&&!r.some((e=>e.value===o))&&$k[o]&&r.unshift($k[o]),r}(C,b,x),[{value:t=""}={},...n]=e,r=n.reduce(((e,{value:t})=>{const n=Iy(t?.substring(0,1)||"");return e.includes(n)?e:`${e}|${n}`}),Iy(t.substring(0,1)));return[e,new RegExp(`^(?:${r})$`,"i")]}),[C,b,x]),[E,P]=Gk(C,b,k),[N,T]=dS(1===k.length?k[0].value:b,{initial:P,fallback:""});(0,c.useEffect)((()=>{void 0!==P&&T(P)}),[P,T]);const I=s("components-unit-control","components-unit-control-wrapper",i);let R;!u&&f&&k.length&&(R=e=>{S.onKeyDown?.(e),e.metaKey||e.ctrlKey||!j.test(e.key)||M.current?.focus()});const M=(0,c.useRef)(null),A=u?null:(0,_t.jsx)(Jk,{ref:M,"aria-label":(0,a.__)("Select unit"),disabled:l,isUnitSelectTabbable:f,onChange:(e,t)=>{const{data:n}=t;let r=`${null!=E?E:""}${e}`;p&&void 0!==n?.default&&(r=`${n.default}${e}`),m?.(r,t),g?.(e,t),T(e)},size:["small","compact"].includes(v)||"default"===v&&!S.__next40pxDefaultSize?"small":"default",unit:N,units:k,onFocus:w,onBlur:e.onBlur});let D=S.step;if(!D&&k){var z;const e=k.find((e=>e.value===N));D=null!==(z=e?.step)&&void 0!==z?z:1}return(0,_t.jsx)(Ek,{...S,__shouldNotWarnDeprecated36pxSize:!0,autoComplete:r,className:I,disabled:l,spinControls:"none",isPressEnterToChange:d,label:h,onKeyDown:R,onChange:(e,t)=>{if(""===e||null==e)return void m?.("",t);const n=function(e,t,n,r){const[o,i]=qk(e,t),s=null!=o?o:n;let a=i||r;return!a&&Kk(t)&&(a=t[0].value),[s,a]}(e,k,E,N).join("");m?.(n,t)},ref:t,size:v,suffix:A,type:d?"text":"number",value:null!=E?E:"",step:D,onFocus:w,__unstableStateReducer:n})})),tj=ej,nj=e=>void 0!==e?.width&&""!==e.width||void 0!==e?.color;function rj(e){const{className:t,colors:n=[],isCompact:r,onChange:o,enableAlpha:i=!0,enableStyle:s=!0,shouldSanitizeBorder:a=!0,size:l="default",value:u,width:d,__experimentalIsRenderedInSidebar:p=!1,__next40pxDefaultSize:f,__shouldNotWarnDeprecated36pxSize:h,...m}=sl(e,"BorderControl");Ux({componentName:"BorderControl",__next40pxDefaultSize:f,size:l,__shouldNotWarnDeprecated36pxSize:h});const g="default"===l&&f?"__unstable-large":l,[v,b]=qk(u?.width),x=b||"px",y=0===v,[w,_]=(0,c.useState)(),[S,C]=(0,c.useState)(),k=!a||nj(u),j=(0,c.useCallback)((e=>{!a||nj(e)?o(e):o(void 0)}),[o,a]),E=(0,c.useCallback)((e=>{const t=""===e?void 0:e,[n]=qk(e),r=0===n,o={...u,width:t};r&&!y&&(_(u?.color),C(u?.style),o.color=void 0,o.style="none"),!r&&y&&(void 0===o.color&&(o.color=w),"none"===o.style&&(o.style=S)),j(o)}),[u,y,w,S,j]),P=(0,c.useCallback)((e=>{E(`${e}${x}`)}),[E,x]),N=il(),T=(0,c.useMemo)((()=>N(Mk,t)),[t,N]);let I=d;r&&(I="__unstable-large"===l?"116px":"90px");const R=(0,c.useMemo)((()=>{const e=!!I&&Ak,t=(e=>Nl("height:","__unstable-large"===e?"40px":"30px",";",""))(g);return N(Nl(Ek,"{flex:1 1 40%;}&& ",Ik,"{min-height:0;}",""),e,t)}),[I,N,g]),M=(0,c.useMemo)((()=>N(Nl("flex:1 1 60%;",Mg({marginRight:Il(3)})(),";",""))),[N]);return{...m,className:T,colors:n,enableAlpha:i,enableStyle:s,innerWrapperClassName:R,inputWidth:I,isStyleSettable:k,onBorderChange:j,onSliderChange:P,onWidthChange:E,previousStyleSelection:S,sliderClassName:M,value:u,widthUnit:x,widthValue:v,size:g,__experimentalIsRenderedInSidebar:p,__next40pxDefaultSize:f}}const oj=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,_t.jsx)(Sl,{as:"legend",children:t}):(0,_t.jsx)(Ox,{as:"legend",children:t}):null},ij=al(((e,t)=>{const{__next40pxDefaultSize:n=!1,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:l,hideLabelFromVision:c,innerWrapperClassName:u,inputWidth:d,isStyleSettable:p,label:f,onBorderChange:h,onSliderChange:m,onWidthChange:g,placeholder:v,__unstablePopoverProps:b,previousStyleSelection:x,showDropdownHeader:y,size:w,sliderClassName:_,value:S,widthUnit:C,widthValue:k,withSlider:j,__experimentalIsRenderedInSidebar:E,...P}=rj(e);return(0,_t.jsxs)(_l,{as:"fieldset",...P,ref:t,children:[(0,_t.jsx)(oj,{label:f,hideLabelFromVision:c}),(0,_t.jsxs)(fy,{spacing:4,className:u,children:[(0,_t.jsx)(tj,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,prefix:(0,_t.jsx)(zg,{marginRight:1,marginBottom:0,children:(0,_t.jsx)(Qk,{border:S,colors:r,__unstablePopoverProps:b,disableCustomColors:o,enableAlpha:s,enableStyle:l,isStyleSettable:p,onChange:h,previousStyleSelection:x,__experimentalIsRenderedInSidebar:E,size:w})}),label:(0,a.__)("Border width"),hideLabelFromVision:!0,min:0,onChange:g,value:S?.width||"",placeholder:v,disableUnits:i,__unstableInputWidth:d,size:w}),j&&(0,_t.jsx)(ZS,{__nextHasNoMarginBottom:!0,label:(0,a.__)("Border width"),hideLabelFromVision:!0,className:_,initialPosition:0,max:100,min:0,onChange:m,step:["px","%"].includes(C)?1:.1,value:k||void 0,withInputField:!1,__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0})]})]})}),"BorderControl"),sj=ij,aj={bottom:{alignItems:"flex-end",justifyContent:"center"},bottomLeft:{alignItems:"flex-start",justifyContent:"flex-end"},bottomRight:{alignItems:"flex-end",justifyContent:"flex-end"},center:{alignItems:"center",justifyContent:"center"},spaced:{alignItems:"center",justifyContent:"space-between"},left:{alignItems:"center",justifyContent:"flex-start"},right:{alignItems:"center",justifyContent:"flex-end"},stretch:{alignItems:"stretch"},top:{alignItems:"flex-start",justifyContent:"center"},topLeft:{alignItems:"flex-start",justifyContent:"flex-start"},topRight:{alignItems:"flex-start",justifyContent:"flex-end"}};function lj(e){const{align:t,alignment:n,className:r,columnGap:o,columns:i=2,gap:s=3,isInline:a=!1,justify:l,rowGap:u,rows:d,templateColumns:p,templateRows:f,...h}=sl(e,"Grid"),m=vg(Array.isArray(i)?i:[i]),g=vg(Array.isArray(d)?d:[d]),v=p||!!i&&`repeat( ${m}, 1fr )`,b=f||!!d&&`repeat( ${g}, 1fr )`,x=il();return{...h,className:(0,c.useMemo)((()=>{const e=function(e){return e?aj[e]:{}}(n),i=Nl({alignItems:t,display:a?"inline-grid":"grid",gap:`calc( ${Fl.gridBase} * ${s} )`,gridTemplateColumns:v||void 0,gridTemplateRows:b||void 0,gridRowGap:u,gridColumnGap:o,justifyContent:l,verticalAlign:a?"middle":void 0,...e},"","");return x(i,r)}),[t,n,r,o,x,s,v,b,a,l,u])}}const cj=al((function(e,t){const n=lj(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Grid");function uj(e){const{className:t,colors:n=[],enableAlpha:r=!1,enableStyle:o=!0,size:i="default",__experimentalIsRenderedInSidebar:s=!1,...a}=sl(e,"BorderBoxControlSplitControls"),l=il(),u=(0,c.useMemo)((()=>l((e=>Nl("position:relative;flex:1;width:","__unstable-large"===e?void 0:"80%",";",""))(i),t)),[l,t,i]);return{...a,centeredClassName:(0,c.useMemo)((()=>l(Vw,t)),[l,t]),className:u,colors:n,enableAlpha:r,enableStyle:o,rightAlignedClassName:(0,c.useMemo)((()=>l(Nl(Mg({marginLeft:"auto"})(),";",""),t)),[l,t]),size:i,__experimentalIsRenderedInSidebar:s}}const dj=al(((e,t)=>{const{centeredClassName:n,colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,onChange:u,popoverPlacement:d,popoverOffset:p,rightAlignedClassName:f,size:h="default",value:m,__experimentalIsRenderedInSidebar:g,...v}=uj(e),[b,x]=(0,c.useState)(null),y=(0,c.useMemo)((()=>d?{placement:d,offset:p,anchor:b,shift:!0}:void 0),[d,p,b]),w={colors:r,disableCustomColors:o,enableAlpha:i,enableStyle:s,isCompact:!0,__experimentalIsRenderedInSidebar:g,size:h,__shouldNotWarnDeprecated36pxSize:!0},_=(0,l.useMergeRefs)([x,t]);return(0,_t.jsxs)(cj,{...v,ref:_,gap:3,children:[(0,_t.jsx)(Uw,{value:m,size:h}),(0,_t.jsx)(sj,{className:n,hideLabelFromVision:!0,label:(0,a.__)("Top border"),onChange:e=>u(e,"top"),__unstablePopoverProps:y,value:m?.top,...w}),(0,_t.jsx)(sj,{hideLabelFromVision:!0,label:(0,a.__)("Left border"),onChange:e=>u(e,"left"),__unstablePopoverProps:y,value:m?.left,...w}),(0,_t.jsx)(sj,{className:f,hideLabelFromVision:!0,label:(0,a.__)("Right border"),onChange:e=>u(e,"right"),__unstablePopoverProps:y,value:m?.right,...w}),(0,_t.jsx)(sj,{className:n,hideLabelFromVision:!0,label:(0,a.__)("Bottom border"),onChange:e=>u(e,"bottom"),__unstablePopoverProps:y,value:m?.bottom,...w})]})}),"BorderBoxControlSplitControls"),pj=dj,fj=/^([\d.\-+]*)\s*(fr|cm|mm|Q|in|pc|pt|px|em|ex|ch|rem|lh|vw|vh|vmin|vmax|%|cap|ic|rlh|vi|vb|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx|svw|lvw|dvw|svh|lvh|dvh|svi|lvi|dvi|svb|lvb|dvb|svmin|lvmin|dvmin|svmax|lvmax|dvmax)?$/;const hj=["top","right","bottom","left"],mj=["color","style","width"],gj=e=>!e||!mj.some((t=>void 0!==e[t])),vj=e=>{if(!e)return!1;if(bj(e)){return!hj.every((t=>gj(e[t])))}return!gj(e)},bj=(e={})=>Object.keys(e).some((e=>-1!==hj.indexOf(e))),xj=e=>{if(!bj(e))return!1;const t=hj.map((t=>yj(e?.[t])));return!t.every((e=>e===t[0]))},yj=(e,t)=>{if(gj(e))return t;const{color:n,style:r,width:o}=t||{},{color:i=n,style:s=r,width:a=o}=e;return[a,!!a&&"0"!==a||!!i?s||"solid":s,i].filter(Boolean).join(" ")},wj=e=>function(e){if(0===e.length)return;const t={};let n,r=0;return e.forEach((e=>{t[e]=void 0===t[e]?1:t[e]+1,t[e]>r&&(n=e,r=t[e])})),n}(e.map((e=>void 0===e?void 0:function(e){const t=e.trim().match(fj);if(!t)return[void 0,void 0];const[,n,r]=t;let o=parseFloat(n);return o=Number.isNaN(o)?void 0:o,[o,r]}(`${e}`)[1])).filter((e=>void 0!==e)));function _j(e){const{className:t,colors:n=[],onChange:r,enableAlpha:o=!1,enableStyle:i=!0,size:s="default",value:a,__experimentalIsRenderedInSidebar:l=!1,__next40pxDefaultSize:u,...d}=sl(e,"BorderBoxControl");Ux({componentName:"BorderBoxControl",__next40pxDefaultSize:u,size:s});const p="default"===s&&u?"__unstable-large":s,f=xj(a),h=bj(a),m=h?(e=>{if(!e)return;const t=[],n=[],r=[];hj.forEach((o=>{t.push(e[o]?.color),n.push(e[o]?.style),r.push(e[o]?.width)}));const o=t.every((e=>e===t[0])),i=n.every((e=>e===n[0])),s=r.every((e=>e===r[0]));return{color:o?t[0]:void 0,style:i?n[0]:void 0,width:s?r[0]:wj(r)}})(a):a,g=h?a:(e=>{if(e&&!gj(e))return{top:e,right:e,bottom:e,left:e}})(a),v=!isNaN(parseFloat(`${m?.width}`)),[b,x]=(0,c.useState)(!f),y=il(),w=(0,c.useMemo)((()=>y(Lw,t)),[y,t]),_=(0,c.useMemo)((()=>y(Nl("flex:1;",Mg({marginRight:"24px"})(),";",""))),[y]),S=(0,c.useMemo)((()=>y(Fw)),[y]);return{...d,className:w,colors:n,disableUnits:f&&!v,enableAlpha:o,enableStyle:i,hasMixedBorders:f,isLinked:b,linkedControlClassName:_,onLinkedChange:e=>{if(!e)return r(void 0);if(!f||(t=e)&&mj.every((e=>void 0!==t[e])))return r(gj(e)?void 0:e);var t;const n=((e,t)=>{const n={};return e.color!==t.color&&(n.color=t.color),e.style!==t.style&&(n.style=t.style),e.width!==t.width&&(n.width=t.width),n})(m,e),o={top:{...a?.top,...n},right:{...a?.right,...n},bottom:{...a?.bottom,...n},left:{...a?.left,...n}};if(xj(o))return r(o);const i=gj(o.top)?void 0:o.top;r(i)},onSplitChange:(e,t)=>{const n={...g,[t]:e};xj(n)?r(n):r(e)},toggleLinked:()=>x(!b),linkedValue:m,size:p,splitValue:g,wrapperClassName:S,__experimentalIsRenderedInSidebar:l}}const Sj=e=>{const{label:t,hideLabelFromVision:n}=e;return t?n?(0,_t.jsx)(Sl,{as:"label",children:t}):(0,_t.jsx)(Ox,{children:t}):null},Cj=al(((e,t)=>{const{className:n,colors:r,disableCustomColors:o,disableUnits:i,enableAlpha:s,enableStyle:u,hasMixedBorders:d,hideLabelFromVision:p,isLinked:f,label:h,linkedControlClassName:m,linkedValue:g,onLinkedChange:v,onSplitChange:b,popoverPlacement:x,popoverOffset:y,size:w,splitValue:_,toggleLinked:S,wrapperClassName:C,__experimentalIsRenderedInSidebar:k,...j}=_j(e),[E,P]=(0,c.useState)(null),N=(0,c.useMemo)((()=>x?{placement:x,offset:y,anchor:E,shift:!0}:void 0),[x,y,E]),T=(0,l.useMergeRefs)([P,t]);return(0,_t.jsxs)(_l,{className:n,...j,ref:T,children:[(0,_t.jsx)(Sj,{label:h,hideLabelFromVision:p}),(0,_t.jsxs)(_l,{className:C,children:[f?(0,_t.jsx)(sj,{className:m,colors:r,disableUnits:i,disableCustomColors:o,enableAlpha:s,enableStyle:u,onChange:v,placeholder:d?(0,a.__)("Mixed"):void 0,__unstablePopoverProps:N,shouldSanitizeBorder:!1,value:g,withSlider:!0,width:"__unstable-large"===w?"116px":"110px",__experimentalIsRenderedInSidebar:k,__shouldNotWarnDeprecated36pxSize:!0,size:w}):(0,_t.jsx)(pj,{colors:r,disableCustomColors:o,enableAlpha:s,enableStyle:u,onChange:b,popoverPlacement:x,popoverOffset:y,value:_,__experimentalIsRenderedInSidebar:k,size:w}),(0,_t.jsx)(Hw,{onClick:S,isLinked:f,size:w})]})]})}),"BorderBoxControl"),kj=Cj,jj=(0,_t.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,_t.jsx)(n.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,_t.jsx)(n.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"})]}),Ej={px:{max:300,step:1},"%":{max:100,step:1},vw:{max:100,step:1},vh:{max:100,step:1},em:{max:10,step:.1},rm:{max:10,step:.1},svw:{max:100,step:1},lvw:{max:100,step:1},dvw:{max:100,step:1},svh:{max:100,step:1},lvh:{max:100,step:1},dvh:{max:100,step:1},vi:{max:100,step:1},svi:{max:100,step:1},lvi:{max:100,step:1},dvi:{max:100,step:1},vb:{max:100,step:1},svb:{max:100,step:1},lvb:{max:100,step:1},dvb:{max:100,step:1},vmin:{max:100,step:1},svmin:{max:100,step:1},lvmin:{max:100,step:1},dvmin:{max:100,step:1},vmax:{max:100,step:1},svmax:{max:100,step:1},lvmax:{max:100,step:1},dvmax:{max:100,step:1}},Pj={all:(0,a.__)("All sides"),top:(0,a.__)("Top side"),bottom:(0,a.__)("Bottom side"),left:(0,a.__)("Left side"),right:(0,a.__)("Right side"),vertical:(0,a.__)("Top and bottom sides"),horizontal:(0,a.__)("Left and right sides")},Nj={top:void 0,right:void 0,bottom:void 0,left:void 0},Tj=["top","right","bottom","left"];function Ij(e={},t=Tj){const n=Aj(t);return n.some((t=>e[t]!==e[n[0]]))}function Rj(e){return e&&Object.values(e).filter((e=>!!e&&/\d/.test(e))).length>0}function Mj(e,t){let n="all";return e||(n=t?"vertical":"top"),n}function Aj(e){const t=[];if(!e?.length)return Tj;if(e.includes("vertical"))t.push("top","bottom");else if(e.includes("horizontal"))t.push("left","right");else{const n=Tj.filter((t=>e.includes(t)));t.push(...n)}return t}function Dj(e,t,n){Xi()("applyValueToSides",{since:"6.8",version:"7.0"});const r={...e};return n?.length?n.forEach((e=>{"vertical"===e?(r.top=t,r.bottom=t):"horizontal"===e?(r.left=t,r.right=t):r[e]=t})):Tj.forEach((e=>r[e]=t)),r}function zj(e){const t=new Set(e?[]:Tj);return e?.forEach((e=>{"vertical"===e?(t.add("top"),t.add("bottom")):"horizontal"===e?(t.add("right"),t.add("left")):t.add(e)})),t}function Oj(e,t){return e.startsWith(`var:preset|${t}|`)}const Lj=yl("span",{target:"e1j5nr4z8"})({name:"1w884gc",styles:"box-sizing:border-box;display:block;width:24px;height:24px;position:relative;padding:4px"}),Fj=yl("span",{target:"e1j5nr4z7"})({name:"i6vjox",styles:"box-sizing:border-box;display:block;position:relative;width:100%;height:100%"}),Bj=({isFocused:e})=>Nl({backgroundColor:"currentColor",opacity:e?1:.3},"",""),Vj=yl("span",{target:"e1j5nr4z6"})("box-sizing:border-box;display:block;pointer-events:none;position:absolute;",Bj,";"),$j=yl(Vj,{target:"e1j5nr4z5"})({name:"1k2w39q",styles:"bottom:3px;top:3px;width:2px"}),Hj=yl(Vj,{target:"e1j5nr4z4"})({name:"1q9b07k",styles:"height:2px;left:3px;right:3px"}),Wj=yl(Hj,{target:"e1j5nr4z3"})({name:"abcix4",styles:"top:0"}),Uj=yl($j,{target:"e1j5nr4z2"})({name:"1wf8jf",styles:"right:0"}),Gj=yl(Hj,{target:"e1j5nr4z1"})({name:"8tapst",styles:"bottom:0"}),Kj=yl($j,{target:"e1j5nr4z0"})({name:"1ode3cm",styles:"left:0"});function qj({size:e=24,side:t="all",sides:n,...r}){const o=e=>!(e=>n?.length&&!n.includes(e))(e)&&("all"===t||t===e),i=o("top")||o("vertical"),s=o("right")||o("horizontal"),a=o("bottom")||o("vertical"),l=o("left")||o("horizontal"),c=e/24;return(0,_t.jsx)(Lj,{style:{transform:`scale(${c})`},...r,children:(0,_t.jsxs)(Fj,{children:[(0,_t.jsx)(Wj,{isFocused:i}),(0,_t.jsx)(Uj,{isFocused:s}),(0,_t.jsx)(Gj,{isFocused:a}),(0,_t.jsx)(Kj,{isFocused:l})]})})}const Yj=yl(tj,{target:"e1jovhle5"})({name:"1ejyr19",styles:"max-width:90px"}),Xj=yl(fy,{target:"e1jovhle4"})({name:"1j1lmoi",styles:"grid-column:1/span 3"}),Zj=yl(Jx,{target:"e1jovhle3"})({name:"tkya7b",styles:"grid-area:1/2;justify-self:end"}),Qj=yl("div",{target:"e1jovhle2"})({name:"1dfa8al",styles:"grid-area:1/3;justify-self:end"}),Jj=yl(qj,{target:"e1jovhle1"})({name:"ou8xsw",styles:"flex:0 0 auto"}),eE=yl(ZS,{target:"e1jovhle0"})("width:100%;margin-inline-end:",Il(2),";"),tE=()=>{};function nE(e,t,n){const r=zj(t);let o=[];switch(e){case"all":o=["top","bottom","left","right"];break;case"horizontal":o=["left","right"];break;case"vertical":o=["top","bottom"];break;default:o=[e]}if(n)switch(e){case"top":o.push("bottom");break;case"bottom":o.push("top");break;case"left":o.push("left");break;case"right":o.push("right")}return o.filter((e=>r.has(e)))}function rE({__next40pxDefaultSize:e,onChange:t=tE,onFocus:n=tE,values:r,selectedUnits:o,setSelectedUnits:i,sides:s,side:u,min:d=0,presets:p,presetKey:f,...h}){var m,g;const v=nE(u,s),b=e=>{t(e)},x=(e,t)=>{const n={...r},o=void 0!==e&&!isNaN(parseFloat(e))?e:void 0;nE(u,s,!!t?.event.altKey).forEach((e=>{n[e]=o})),b(n)},y=function(e={},t=Tj){const n=Aj(t);if(n.every((t=>e[t]===e[n[0]])))return e[n[0]]}(r,v),w=Rj(r),_=w&&v.length>1&&Ij(r,v),[S,C]=qk(y),k=w?C:o[v[0]],j=[(0,l.useInstanceId)(rE,"box-control-input"),u].join("-"),E=v.length>1&&void 0===y&&v.some((e=>o[e]!==k)),P=void 0===y&&k?k:y,N=_||E?(0,a.__)("Mixed"):void 0,T=p&&p.length>0&&f,I=T&&void 0!==y&&!_&&Oj(y,f),[R,M]=(0,c.useState)(!T||!I&&!_&&void 0!==y),A=I?function(e,t,n){if(!Oj(e,t))return;const r=e.match(new RegExp(`^var:preset\\|${t}\\|(.+)$`));if(!r)return;const o=r[1],i=n.findIndex((e=>e.slug===o));return-1!==i?i:void 0}(y,f,p):void 0,D=T?[{value:0,label:"",tooltip:(0,a.__)("None")}].concat(p.map(((e,t)=>{var n;return{value:t+1,label:"",tooltip:null!==(n=e.name)&&void 0!==n?n:e.slug}}))):[];return(0,_t.jsxs)(Xj,{expanded:!0,children:[(0,_t.jsx)(Jj,{side:u,sides:s}),R&&(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(ss,{placement:"top-end",text:Pj[u],children:(0,_t.jsx)(Yj,{...h,min:d,__shouldNotWarnDeprecated36pxSize:!0,__next40pxDefaultSize:e,className:"component-box-control__unit-control",id:j,isPressEnterToChange:!0,disableUnits:_||E,value:P,onChange:x,onUnitChange:e=>{const t={...o};v.forEach((n=>{t[n]=e})),i(t)},onFocus:e=>{n(e,{side:u})},label:Pj[u],placeholder:N,hideLabelFromVision:!0})}),(0,_t.jsx)(eE,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e,__shouldNotWarnDeprecated36pxSize:!0,"aria-controls":j,label:Pj[u],hideLabelFromVision:!0,onChange:e=>{x(void 0!==e?[e,k].join(""):void 0)},min:isFinite(d)?d:0,max:null!==(m=Ej[null!=k?k:"px"]?.max)&&void 0!==m?m:10,step:null!==(g=Ej[null!=k?k:"px"]?.step)&&void 0!==g?g:.1,value:null!=S?S:0,withInputField:!1})]}),T&&!R&&(0,_t.jsx)(eE,{__next40pxDefaultSize:!0,className:"spacing-sizes-control__range-control",value:void 0!==A?A+1:0,onChange:e=>{const t=0===e||void 0===e?void 0:function(e,t,n){return`var:preset|${t}|${n[e].slug}`}(e-1,f,p);(e=>{const t={...r};v.forEach((n=>{t[n]=e})),b(t)})(t)},withInputField:!1,"aria-valuenow":void 0!==A?A+1:0,"aria-valuetext":D[void 0!==A?A+1:0].tooltip,renderTooltipContent:e=>D[e||0].tooltip,min:0,max:D.length-1,marks:D,label:Pj[u],hideLabelFromVision:!0,__nextHasNoMarginBottom:!0}),T&&(0,_t.jsx)(Jx,{label:R?(0,a.__)("Use size preset"):(0,a.__)("Set custom size"),icon:jj,onClick:()=>{M(!R)},isPressed:R,size:"small",iconSize:24})]},`box-control-${u}`)}function oE({isLinked:e,...t}){const n=e?(0,a.__)("Unlink sides"):(0,a.__)("Link sides");return(0,_t.jsx)(Jx,{...t,className:"component-box-control__linked-button",size:"small",icon:e?zw:Ow,iconSize:24,label:n})}const iE={min:0},sE=()=>{};function aE({__next40pxDefaultSize:e=!1,id:t,inputProps:n=iE,onChange:r=sE,label:o=(0,a.__)("Box Control"),values:i,units:s,sides:u,splitOnAxis:d=!1,allowReset:p=!0,resetValues:f=Nj,presets:h,presetKey:m,onMouseOver:g,onMouseOut:v}){const[b,x]=dS(i,{fallback:Nj}),y=b||Nj,w=Rj(i),_=1===u?.length,[S,C]=(0,c.useState)(w),[k,j]=(0,c.useState)(!w||!Ij(y)||_),[E,P]=(0,c.useState)(Mj(k,d)),[N,T]=(0,c.useState)({top:qk(i?.top)[1],right:qk(i?.right)[1],bottom:qk(i?.bottom)[1],left:qk(i?.left)[1]}),I=function(e){const t=(0,l.useInstanceId)(aE,"inspector-box-control");return e||t}(t),R=`${I}-heading`,M={onMouseOver:g,onMouseOut:v,...n,onChange:e=>{r(e),x(e),C(!0)},onFocus:(e,{side:t})=>{P(t)},isLinked:k,units:s,selectedUnits:N,setSelectedUnits:T,sides:u,values:y,__next40pxDefaultSize:e,presets:h,presetKey:m};Ux({componentName:"BoxControl",__next40pxDefaultSize:e,size:void 0});const A=zj(u);if(h&&!m||!h&&m){}return(0,_t.jsxs)(cj,{id:I,columns:3,templateColumns:"1fr min-content min-content",role:"group","aria-labelledby":R,children:[(0,_t.jsx)(Hx.VisualLabel,{id:R,children:o}),k&&(0,_t.jsx)(Xj,{children:(0,_t.jsx)(rE,{side:"all",...M})}),!_&&(0,_t.jsx)(Qj,{children:(0,_t.jsx)(oE,{onClick:()=>{j(!k),P(Mj(!k,d))},isLinked:k})}),!k&&d&&["vertical","horizontal"].map((e=>(0,_t.jsx)(rE,{side:e,...M},e))),!k&&!d&&Array.from(A).map((e=>(0,_t.jsx)(rE,{side:e,...M},e))),p&&(0,_t.jsx)(Zj,{className:"component-box-control__reset-button",variant:"secondary",size:"small",onClick:()=>{r(f),x(f),T(f),C(!1)},disabled:!S,children:(0,a.__)("Reset")})]})}const lE=aE;const cE=(0,c.forwardRef)((function(e,t){const{className:n,__shouldNotWarnDeprecated:r,...o}=e,i=s("components-button-group",n);return r||Xi()("wp.components.ButtonGroup",{since:"6.8",alternative:"wp.components.__experimentalToggleGroupControl"}),(0,_t.jsx)("div",{ref:t,role:"group",className:i,...o})}));const uE={name:"12ip69d",styles:"background:transparent;display:block;margin:0!important;pointer-events:none;position:absolute;will-change:box-shadow"};function dE(e){return`0 ${e}px ${2*e}px 0\n\t${`rgba(0, 0, 0, ${e/20})`}`}const pE=al((function(e,t){const n=function(e){const{active:t,borderRadius:n="inherit",className:r,focus:o,hover:i,isInteractive:s=!1,offset:a=0,value:l=0,...u}=sl(e,"Elevation"),d=il();return{...u,className:(0,c.useMemo)((()=>{let e=Vg(i)?i:2*l,c=Vg(t)?t:l/2;s||(e=Vg(i)?i:void 0,c=Vg(t)?t:void 0);const u=`box-shadow ${Fl.transitionDuration} ${Fl.transitionTimingFunction}`,p={};return p.Base=Nl({borderRadius:n,bottom:a,boxShadow:dE(l),opacity:Fl.elevationIntensity,left:a,right:a,top:a},Nl("@media not ( prefers-reduced-motion ){transition:",u,";}",""),"",""),Vg(e)&&(p.hover=Nl("*:hover>&{box-shadow:",dE(e),";}","")),Vg(c)&&(p.active=Nl("*:active>&{box-shadow:",dE(c),";}","")),Vg(o)&&(p.focus=Nl("*:focus>&{box-shadow:",dE(o),";}","")),d(uE,p.Base,p.hover,p.focus,p.active,r)}),[t,n,r,d,o,i,s,a,l]),"aria-hidden":!0}}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Elevation"),fE=pE;const hE=`calc(${Fl.radiusLarge} - 1px)`,mE=Nl("box-shadow:0 0 0 1px ",Fl.surfaceBorderColor,";outline:none;",""),gE={name:"1showjb",styles:"border-bottom:1px solid;box-sizing:border-box;&:last-child{border-bottom:none;}"},vE={name:"14n5oej",styles:"border-top:1px solid;box-sizing:border-box;&:first-of-type{border-top:none;}"},bE={name:"13udsys",styles:"height:100%"},xE={name:"6ywzd",styles:"box-sizing:border-box;height:auto;max-height:100%"},yE={name:"dq805e",styles:"box-sizing:border-box;overflow:hidden;&>img,&>iframe{display:block;height:auto;max-width:100%;width:100%;}"},wE={name:"c990dr",styles:"box-sizing:border-box;display:block;width:100%"},_E=Nl("&:first-of-type{border-top-left-radius:",hE,";border-top-right-radius:",hE,";}&:last-of-type{border-bottom-left-radius:",hE,";border-bottom-right-radius:",hE,";}",""),SE=Nl("border-color:",Fl.colorDivider,";",""),CE={name:"1t90u8d",styles:"box-shadow:none"},kE={name:"1e1ncky",styles:"border:none"},jE=Nl("border-radius:",hE,";",""),EE=Nl("padding:",Fl.cardPaddingXSmall,";",""),PE={large:Nl("padding:",Fl.cardPaddingLarge,";",""),medium:Nl("padding:",Fl.cardPaddingMedium,";",""),small:Nl("padding:",Fl.cardPaddingSmall,";",""),xSmall:EE,extraSmall:EE},NE=Nl("background-color:",zl.ui.backgroundDisabled,";",""),TE=Nl("background-color:",Fl.surfaceColor,";color:",zl.gray[900],";position:relative;","");Fl.surfaceBackgroundColor;function IE({borderBottom:e,borderLeft:t,borderRight:n,borderTop:r}){const o=`1px solid ${Fl.surfaceBorderColor}`;return Nl({borderBottom:e?o:void 0,borderLeft:t?o:void 0,borderRight:n?o:void 0,borderTop:r?o:void 0},"","")}const RE=Nl("",""),ME=Nl("background:",Fl.surfaceBackgroundTintColor,";",""),AE=Nl("background:",Fl.surfaceBackgroundTertiaryColor,";",""),DE=e=>[e,e].join(" "),zE=e=>["90deg",[Fl.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),OE=e=>[[Fl.surfaceBackgroundColor,e].join(" "),"transparent 1%"].join(","),LE=(e,t)=>Nl("background:",(e=>[`linear-gradient( ${zE(e)} ) center`,`linear-gradient( ${OE(e)} ) center`,Fl.surfaceBorderBoldColor].join(","))(t),";background-size:",DE(e),";",""),FE=[`linear-gradient( ${[`${Fl.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`,`linear-gradient( ${["90deg",`${Fl.surfaceBorderSubtleColor} 1px`,"transparent 1px"].join(",")} )`].join(","),BE=(e,t,n)=>{switch(e){case"dotted":return LE(t,n);case"grid":return(e=>Nl("background:",Fl.surfaceBackgroundColor,";background-image:",FE,";background-size:",DE(e),";",""))(t);case"primary":return RE;case"secondary":return ME;case"tertiary":return AE}};function VE(e){const{backgroundSize:t=12,borderBottom:n=!1,borderLeft:r=!1,borderRight:o=!1,borderTop:i=!1,className:s,variant:a="primary",...l}=sl(e,"Surface"),u=il();return{...l,className:(0,c.useMemo)((()=>{const e={borders:IE({borderBottom:n,borderLeft:r,borderRight:o,borderTop:i})};return u(TE,e.borders,BE(a,`${t}px`,t-1+"px"),s)}),[t,n,r,o,i,s,u,a])}}function $E(e){const{className:t,elevation:n=0,isBorderless:r=!1,isRounded:o=!0,size:i="medium",...s}=sl(function({elevation:e,isElevated:t,...n}){const r={...n};let o=e;var i;return t&&(Xi()("Card isElevated prop",{since:"5.9",alternative:"elevation"}),null!==(i=o)&&void 0!==i||(o=2)),void 0!==o&&(r.elevation=o),r}(e),"Card"),a=il();return{...VE({...s,className:(0,c.useMemo)((()=>a(mE,r&&CE,o&&jE,t)),[t,a,r,o])}),elevation:n,isBorderless:r,isRounded:o,size:i}}const HE=al((function(e,t){const{children:n,elevation:r,isBorderless:o,isRounded:i,size:s,...a}=$E(e),l=i?Fl.radiusLarge:0,u=il(),d=(0,c.useMemo)((()=>u(Nl({borderRadius:l},"",""))),[u,l]),p=(0,c.useMemo)((()=>{const e={size:s,isBorderless:o};return{CardBody:e,CardHeader:e,CardFooter:e}}),[o,s]);return(0,_t.jsx)(gs,{value:p,children:(0,_t.jsxs)(_l,{...a,ref:t,children:[(0,_t.jsx)(_l,{className:u(bE),children:n}),(0,_t.jsx)(fE,{className:d,isInteractive:!1,value:r?1:0}),(0,_t.jsx)(fE,{className:d,isInteractive:!1,value:r})]})})}),"Card"),WE=HE;const UE=Nl("@media only screen and ( min-device-width: 40em ){&::-webkit-scrollbar{height:12px;width:12px;}&::-webkit-scrollbar-track{background-color:transparent;}&::-webkit-scrollbar-track{background:",Fl.colorScrollbarTrack,";border-radius:8px;}&::-webkit-scrollbar-thumb{background-clip:padding-box;background-color:",Fl.colorScrollbarThumb,";border:2px solid rgba( 0, 0, 0, 0 );border-radius:7px;}&:hover::-webkit-scrollbar-thumb{background-color:",Fl.colorScrollbarThumbHover,";}}",""),GE={name:"13udsys",styles:"height:100%"},KE={name:"7zq9w",styles:"scroll-behavior:smooth"},qE={name:"q33xhg",styles:"overflow-x:auto;overflow-y:hidden"},YE={name:"103x71s",styles:"overflow-x:hidden;overflow-y:auto"},XE={name:"umwchj",styles:"overflow-y:auto"};const ZE=al((function(e,t){const n=function(e){const{className:t,scrollDirection:n="y",smoothScroll:r=!1,...o}=sl(e,"Scrollable"),i=il();return{...o,className:(0,c.useMemo)((()=>i(GE,UE,r&&KE,"x"===n&&qE,"y"===n&&YE,"auto"===n&&XE,t)),[t,i,n,r])}}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Scrollable"),QE=ZE;const JE=al((function(e,t){const{isScrollable:n,...r}=function(e){const{className:t,isScrollable:n=!1,isShady:r=!1,size:o="medium",...i}=sl(e,"CardBody"),s=il();return{...i,className:(0,c.useMemo)((()=>s(xE,_E,PE[o],r&&NE,"components-card__body",t)),[t,s,r,o]),isScrollable:n}}(e);return n?(0,_t.jsx)(QE,{...r,ref:t}):(0,_t.jsx)(_l,{...r,ref:t})}),"CardBody"),eP=JE;var tP=jt((function(e){var t=e,{orientation:n="horizontal"}=t,r=x(t,["orientation"]);return r=v({role:"separator","aria-orientation":n},r)})),nP=St((function(e){return kt("hr",tP(e))}));const rP={vertical:{start:"marginLeft",end:"marginRight"},horizontal:{start:"marginTop",end:"marginBottom"}},oP=({"aria-orientation":e="horizontal",margin:t,marginStart:n,marginEnd:r})=>Nl(Mg({[rP[e].start]:Il(null!=n?n:t),[rP[e].end]:Il(null!=r?r:t)})(),"","");var iP={name:"1u4hpl4",styles:"display:inline"};const sP=({"aria-orientation":e="horizontal"})=>"vertical"===e?iP:void 0,aP=({"aria-orientation":e="horizontal"})=>Nl({["vertical"===e?"borderRight":"borderBottom"]:"1px solid currentColor"},"",""),lP=({"aria-orientation":e="horizontal"})=>Nl({height:"vertical"===e?"auto":0,width:"vertical"===e?0:"auto"},"",""),cP=yl("hr",{target:"e19on6iw0"})("border:0;margin:0;",sP," ",aP," ",lP," ",oP,";");const uP=al((function(e,t){const n=sl(e,"Divider");return(0,_t.jsx)(nP,{render:(0,_t.jsx)(cP,{}),...n,ref:t})}),"Divider");const dP=al((function(e,t){const n=function(e){const{className:t,...n}=sl(e,"CardDivider"),r=il();return{...n,className:(0,c.useMemo)((()=>r(wE,SE,"components-card__divider",t)),[t,r])}}(e);return(0,_t.jsx)(uP,{...n,ref:t})}),"CardDivider"),pP=dP;const fP=al((function(e,t){const n=function(e){const{className:t,justify:n,isBorderless:r=!1,isShady:o=!1,size:i="medium",...s}=sl(e,"CardFooter"),a=il();return{...s,className:(0,c.useMemo)((()=>a(vE,_E,SE,PE[i],r&&kE,o&&NE,"components-card__footer",t)),[t,a,r,o,i]),justify:n}}(e);return(0,_t.jsx)(kg,{...n,ref:t})}),"CardFooter"),hP=fP;const mP=al((function(e,t){const n=function(e){const{className:t,isBorderless:n=!1,isShady:r=!1,size:o="medium",...i}=sl(e,"CardHeader"),s=il();return{...i,className:(0,c.useMemo)((()=>s(gE,_E,SE,PE[o],n&&kE,r&&NE,"components-card__header",t)),[t,s,n,r,o])}}(e);return(0,_t.jsx)(kg,{...n,ref:t})}),"CardHeader"),gP=mP;const vP=al((function(e,t){const n=function(e){const{className:t,...n}=sl(e,"CardMedia"),r=il();return{...n,className:(0,c.useMemo)((()=>r(yE,_E,"components-card__media",t)),[t,r])}}(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"CardMedia"),bP=vP;const xP=function e(t){const{__nextHasNoMarginBottom:n,label:r,className:o,heading:i,checked:a,indeterminate:u,help:d,id:p,onChange:f,...h}=t;i&&Xi()("`heading` prop in `CheckboxControl`",{alternative:"a separate element to implement a heading",since:"5.8"});const[m,g]=(0,c.useState)(!1),[v,b]=(0,c.useState)(!1),x=(0,l.useRefEffect)((e=>{e&&(e.indeterminate=!!u,g(e.matches(":checked")),b(e.matches(":indeterminate")))}),[a,u]),y=(0,l.useInstanceId)(e,"inspector-checkbox-control",p);return(0,_t.jsx)(Wx,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"CheckboxControl",label:i,id:y,help:d&&(0,_t.jsx)("span",{className:"components-checkbox-control__help",children:d}),className:s("components-checkbox-control",o),children:(0,_t.jsxs)(fy,{spacing:0,justify:"start",alignment:"top",children:[(0,_t.jsxs)("span",{className:"components-checkbox-control__input-container",children:[(0,_t.jsx)("input",{ref:x,id:y,className:"components-checkbox-control__input",type:"checkbox",value:"1",onChange:e=>f(e.target.checked),checked:a,"aria-describedby":d?y+"__help":void 0,...h}),v?(0,_t.jsx)(oS,{icon:Lg,className:"components-checkbox-control__indeterminate",role:"presentation"}):null,m?(0,_t.jsx)(oS,{icon:ok,className:"components-checkbox-control__checked",role:"presentation"}):null]}),r&&(0,_t.jsx)("label",{className:"components-checkbox-control__label",htmlFor:y,children:r})]})})},yP=4e3;function wP({className:e,children:t,onCopy:n,onFinishCopy:r,text:o,...i}){Xi()("wp.components.ClipboardButton",{since:"5.8",alternative:"wp.compose.useCopyToClipboard"});const a=(0,c.useRef)(),u=(0,l.useCopyToClipboard)(o,(()=>{n(),a.current&&clearTimeout(a.current),r&&(a.current=setTimeout((()=>r()),yP))}));(0,c.useEffect)((()=>()=>{a.current&&clearTimeout(a.current)}),[]);const d=s("components-clipboard-button",e);return(0,_t.jsx)(Jx,{...i,className:d,ref:u,onCopy:e=>{e.target.focus()},children:t})}const _P=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});const SP={name:"1bcj5ek",styles:"width:100%;display:block"},CP={name:"150ruhm",styles:"box-sizing:border-box;width:100%;display:block;margin:0;color:inherit"},kP=Nl("border:1px solid ",Fl.surfaceBorderColor,";",""),jP=Nl(">*:not( marquee )>*{border-bottom:1px solid ",Fl.surfaceBorderColor,";}>*:last-of-type>*:not( :focus ){border-bottom-color:transparent;}",""),EP=Fl.radiusSmall,PP=Nl("border-radius:",EP,";",""),NP=Nl("border-radius:",EP,";>*:first-of-type>*{border-top-left-radius:",EP,";border-top-right-radius:",EP,";}>*:last-of-type>*{border-bottom-left-radius:",EP,";border-bottom-right-radius:",EP,";}",""),TP=`calc(${Fl.fontSize} * ${Fl.fontLineHeightBase})`,IP=`calc((${Fl.controlHeight} - ${TP} - 2px) / 2)`,RP=`calc((${Fl.controlHeightSmall} - ${TP} - 2px) / 2)`,MP=`calc((${Fl.controlHeightLarge} - ${TP} - 2px) / 2)`,AP={small:Nl("padding:",RP," ",Fl.controlPaddingXSmall,"px;",""),medium:Nl("padding:",IP," ",Fl.controlPaddingX,"px;",""),large:Nl("padding:",MP," ",Fl.controlPaddingXLarge,"px;","")},DP=(0,c.createContext)({size:"medium"}),zP=()=>(0,c.useContext)(DP);function OP(e){const{as:t,className:n,onClick:r,role:o="listitem",size:i,...s}=sl(e,"Item"),{spacedAround:a,size:l}=zP(),u=i||l,d=t||(void 0!==r?"button":"div"),p=il(),f=(0,c.useMemo)((()=>p(("button"===d||"a"===d)&&(e=>Nl("font-size:",Ix("default.fontSize"),";font-family:inherit;appearance:none;border:1px solid transparent;cursor:pointer;background:none;text-align:start;text-decoration:","a"===e?"none":void 0,";svg,path{fill:currentColor;}&:hover{color:",zl.theme.accent,";}&:focus{box-shadow:none;outline:none;}&:focus-visible{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",zl.theme.accent,";outline:2px solid transparent;outline-offset:0;}",""))(d),AP[u]||AP.medium,CP,a&&PP,n)),[d,n,p,u,a]),h=p(SP);return{as:d,className:f,onClick:r,wrapperClassName:h,role:o,...s}}const LP=al((function(e,t){const{role:n,wrapperClassName:r,...o}=OP(e);return(0,_t.jsx)("div",{role:n,className:r,children:(0,_t.jsx)(_l,{...o,ref:t})})}),"Item");const FP=al((function(e,t){const{isBordered:n,isSeparated:r,size:o,...i}=function(e){const{className:t,isBordered:n=!1,isRounded:r=!0,isSeparated:o=!1,role:i="list",...s}=sl(e,"ItemGroup");return{isBordered:n,className:il()(n&&kP,o&&jP,r&&NP,t),role:i,isSeparated:o,...s}}(e),{size:s}=zP(),a={spacedAround:!n&&!r,size:o||s};return(0,_t.jsx)(DP.Provider,{value:a,children:(0,_t.jsx)(_l,{...i,ref:t})})}),"ItemGroup");function BP(e){return Math.max(0,Math.min(100,e))}function VP(e,t,n){const r=e.slice();return r[t]=n,r}function $P(e,t,n){if(function(e,t,n,r=0){const o=e[t].position,i=Math.min(o,n),s=Math.max(o,n);return e.some((({position:e},o)=>o!==t&&(Math.abs(e-n)<r||i<e&&e<s)))}(e,t,n))return e;return VP(e,t,{...e[t],position:n})}function HP(e,t,n){return VP(e,t,{...e[t],color:n})}function WP(e,t){if(!t)return;const{x:n,width:r}=t.getBoundingClientRect(),o=e-n;return Math.round(BP(100*o/r))}function UP({isOpen:e,position:t,color:n,...r}){const o=`components-custom-gradient-picker__control-point-button-description-${(0,l.useInstanceId)(UP)}`;return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(Jx,{"aria-label":(0,a.sprintf)((0,a.__)("Gradient control point at position %1$s%% with color code %2$s."),t,n),"aria-describedby":o,"aria-haspopup":"true","aria-expanded":e,__next40pxDefaultSize:!0,className:s("components-custom-gradient-picker__control-point-button",{"is-active":e}),...r}),(0,_t.jsx)(Sl,{id:o,children:(0,a.__)("Use your left or right arrow keys or drag and drop with the mouse to change the gradient position. Press the button to change the color or remove the control point.")})]})}function GP({isRenderedInSidebar:e,className:t,...n}){const r=(0,c.useMemo)((()=>({placement:"bottom",offset:8,resize:!1})),[]),o=s("components-custom-gradient-picker__control-point-dropdown",t);return(0,_t.jsx)(Ck,{isRenderedInSidebar:e,popoverProps:r,className:o,...n})}function KP({disableRemove:e,disableAlpha:t,gradientPickerDomRef:n,ignoreMarkerPosition:r,value:o,onChange:i,onStartControlPointChange:s,onStopControlPointChange:l,__experimentalIsRenderedInSidebar:u}){const d=(0,c.useRef)(),p=e=>{if(void 0===d.current||null===n.current)return;const t=WP(e.clientX,n.current),{initialPosition:r,index:s,significantMoveHappened:a}=d.current;!a&&Math.abs(r-t)>=5&&(d.current.significantMoveHappened=!0),i($P(o,s,t))},f=()=>{window&&window.removeEventListener&&d.current&&d.current.listenersActivated&&(window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",f),l(),d.current.listenersActivated=!1)},h=(0,c.useRef)();return h.current=f,(0,c.useEffect)((()=>()=>{h.current?.()}),[]),(0,_t.jsx)(_t.Fragment,{children:o.map(((n,c)=>{const h=n?.position;return r!==h&&(0,_t.jsx)(GP,{isRenderedInSidebar:u,onClose:l,renderToggle:({isOpen:e,onToggle:t})=>(0,_t.jsx)(UP,{onClick:()=>{d.current&&d.current.significantMoveHappened||(e?l():s(),t())},onMouseDown:()=>{window&&window.addEventListener&&(d.current={initialPosition:h,index:c,significantMoveHappened:!1,listenersActivated:!0},s(),window.addEventListener("mousemove",p),window.addEventListener("mouseup",f))},onKeyDown:e=>{"ArrowLeft"===e.code?(e.stopPropagation(),i($P(o,c,BP(n.position-10)))):"ArrowRight"===e.code&&(e.stopPropagation(),i($P(o,c,BP(n.position+10))))},isOpen:e,position:n.position,color:n.color},c),renderContent:({onClose:r})=>(0,_t.jsxs)(xk,{paddingSize:"none",children:[(0,_t.jsx)(nk,{enableAlpha:!t,color:n.color,onChange:e=>{i(HP(o,c,yv(e).toRgbString()))}}),!e&&o.length>2&&(0,_t.jsx)(fy,{className:"components-custom-gradient-picker__remove-control-point-wrapper",alignment:"center",children:(0,_t.jsx)(Jx,{onClick:()=>{i(function(e,t){return e.filter(((e,n)=>n!==t))}(o,c)),r()},variant:"link",children:(0,a.__)("Remove Control Point")})})]}),style:{left:`${n.position}%`,transform:"translateX( -50% )"}},c)}))})}KP.InsertPoint=function({value:e,onChange:t,onOpenInserter:n,onCloseInserter:r,insertPosition:o,disableAlpha:i,__experimentalIsRenderedInSidebar:s}){const[a,l]=(0,c.useState)(!1);return(0,_t.jsx)(GP,{isRenderedInSidebar:s,className:"components-custom-gradient-picker__inserter",onClose:()=>{r()},renderToggle:({isOpen:e,onToggle:t})=>(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,"aria-expanded":e,"aria-haspopup":"true",onClick:()=>{e?r():(l(!1),n()),t()},className:"components-custom-gradient-picker__insert-point-dropdown",icon:Og}),renderContent:()=>(0,_t.jsx)(xk,{paddingSize:"none",children:(0,_t.jsx)(nk,{enableAlpha:!i,onChange:n=>{a?t(function(e,t,n){const r=e.findIndex((e=>e.position===t));return HP(e,r,n)}(e,o,yv(n).toRgbString())):(t(function(e,t,n){const r=e.findIndex((e=>e.position>t)),o={color:n,position:t},i=e.slice();return i.splice(r-1,0,o),i}(e,o,yv(n).toRgbString())),l(!0))}})}),style:null!==o?{left:`${o}%`,transform:"translateX( -50% )"}:void 0})};const qP=KP,YP=(e,t)=>{switch(t.type){case"MOVE_INSERTER":if("IDLE"===e.id||"MOVING_INSERTER"===e.id)return{id:"MOVING_INSERTER",insertPosition:t.insertPosition};break;case"STOP_INSERTER_MOVE":if("MOVING_INSERTER"===e.id)return{id:"IDLE"};break;case"OPEN_INSERTER":if("MOVING_INSERTER"===e.id)return{id:"INSERTING_CONTROL_POINT",insertPosition:e.insertPosition};break;case"CLOSE_INSERTER":if("INSERTING_CONTROL_POINT"===e.id)return{id:"IDLE"};break;case"START_CONTROL_CHANGE":if("IDLE"===e.id)return{id:"MOVING_CONTROL_POINT"};break;case"STOP_CONTROL_CHANGE":if("MOVING_CONTROL_POINT"===e.id)return{id:"IDLE"}}return e},XP={id:"IDLE"};function ZP({background:e,hasGradient:t,value:n,onChange:r,disableInserter:o=!1,disableAlpha:i=!1,__experimentalIsRenderedInSidebar:a=!1}){const l=(0,c.useRef)(null),[u,d]=(0,c.useReducer)(YP,XP),p=e=>{if(!l.current)return;const t=WP(e.clientX,l.current);n.some((({position:e})=>Math.abs(t-e)<10))?"MOVING_INSERTER"===u.id&&d({type:"STOP_INSERTER_MOVE"}):d({type:"MOVE_INSERTER",insertPosition:t})},f="MOVING_INSERTER"===u.id,h="INSERTING_CONTROL_POINT"===u.id;return(0,_t.jsxs)("div",{className:s("components-custom-gradient-picker__gradient-bar",{"has-gradient":t}),onMouseEnter:p,onMouseMove:p,onMouseLeave:()=>{d({type:"STOP_INSERTER_MOVE"})},children:[(0,_t.jsx)("div",{className:"components-custom-gradient-picker__gradient-bar-background",style:{background:e,opacity:t?1:.4}}),(0,_t.jsxs)("div",{ref:l,className:"components-custom-gradient-picker__markers-container",children:[!o&&(f||h)&&(0,_t.jsx)(qP.InsertPoint,{__experimentalIsRenderedInSidebar:a,disableAlpha:i,insertPosition:u.insertPosition,value:n,onChange:r,onOpenInserter:()=>{d({type:"OPEN_INSERTER"})},onCloseInserter:()=>{d({type:"CLOSE_INSERTER"})}}),(0,_t.jsx)(qP,{__experimentalIsRenderedInSidebar:a,disableAlpha:i,disableRemove:o,gradientPickerDomRef:l,ignoreMarkerPosition:h?u.insertPosition:void 0,value:n,onChange:r,onStartControlPointChange:()=>{d({type:"START_CONTROL_CHANGE"})},onStopControlPointChange:()=>{d({type:"STOP_CONTROL_CHANGE"})}})]})]})}var QP=o(8924);const JP="linear-gradient(135deg, rgba(6, 147, 227, 1) 0%, rgb(155, 81, 224) 100%)",eN={type:"angular",value:"90"},tN=[{value:"linear-gradient",label:(0,a.__)("Linear")},{value:"radial-gradient",label:(0,a.__)("Radial")}],nN={top:0,"top right":45,"right top":45,right:90,"right bottom":135,"bottom right":135,bottom:180,"bottom left":225,"left bottom":225,left:270,"top left":315,"left top":315};function rN({type:e,value:t,length:n}){return`${function({type:e,value:t}){return"literal"===e?t:"hex"===e?`#${t}`:`${e}(${t.join(",")})`}({type:e,value:t})} ${function(e){if(!e)return"";const{value:t,type:n}=e;return`${t}${n}`}(n)}`}function oN({type:e,orientation:t,colorStops:n}){const r=function(e){if(!Array.isArray(e)&&e&&"angular"===e.type)return`${e.value}deg`}(t);return`${e}(${[r,...n.sort(((e,t)=>{const n=e=>void 0===e?.length?.value?0:parseInt(e.length.value);return n(e)-n(t)})).map(rN)].filter(Boolean).join(",")})`}function iN(e){return void 0===e.length||"%"!==e.length.type}function sN(e){switch(e.type){case"hex":return`#${e.value}`;case"literal":return e.value;case"rgb":case"rgba":return`${e.type}(${e.value.join(",")})`;default:return"transparent"}}_v([Sv]);const aN=yl(Eg,{target:"e10bzpgi1"})({name:"1gvx10y",styles:"flex-grow:5"}),lN=yl(Eg,{target:"e10bzpgi0"})({name:"1gvx10y",styles:"flex-grow:5"}),cN=({gradientAST:e,hasGradient:t,onChange:n})=>{var r;const o=null!==(r=e?.orientation?.value)&&void 0!==r?r:180;return(0,_t.jsx)(_y,{onChange:t=>{n(oN({...e,orientation:{type:"angular",value:`${t}`}}))},value:t?o:""})},uN=({gradientAST:e,hasGradient:t,onChange:n})=>{const{type:r}=e;return(0,_t.jsx)(cS,{__nextHasNoMarginBottom:!0,className:"components-custom-gradient-picker__type-picker",label:(0,a.__)("Type"),labelPosition:"top",onChange:t=>{"linear-gradient"===t&&n(oN({...e,orientation:e.orientation?void 0:eN,type:"linear-gradient"})),"radial-gradient"===t&&(()=>{const{orientation:t,...r}=e;n(oN({...r,type:"radial-gradient"}))})()},options:tN,size:"__unstable-large",value:t?r:void 0})};const dN=function({value:e,onChange:t,enableAlpha:n=!0,__experimentalIsRenderedInSidebar:r=!1}){const{gradientAST:o,hasGradient:i}=function(e){let t,n=!!e;const r=null!=e?e:JP;try{t=QP.parse(r)[0]}catch(e){console.warn("wp.components.CustomGradientPicker failed to parse the gradient with error",e),t=QP.parse(JP)[0],n=!1}if(Array.isArray(t.orientation)||"directional"!==t.orientation?.type||(t.orientation={type:"angular",value:nN[t.orientation.value].toString()}),t.colorStops.some(iN)){const{colorStops:e}=t,n=100/(e.length-1);e.forEach(((e,t)=>{e.length={value:""+n*t,type:"%"}}))}return{gradientAST:t,hasGradient:n}}(e),s=function(e){return oN({type:"linear-gradient",orientation:eN,colorStops:e.colorStops})}(o),a=o.colorStops.map((e=>({color:sN(e),position:parseInt(e.length.value)})));return(0,_t.jsxs)(pk,{spacing:4,className:"components-custom-gradient-picker",children:[(0,_t.jsx)(ZP,{__experimentalIsRenderedInSidebar:r,disableAlpha:!n,background:s,hasGradient:i,value:a,onChange:e=>{t(oN(function(e,t){return{...e,colorStops:t.map((({position:e,color:t})=>{const{r:n,g:r,b:o,a:i}=yv(t).toRgb();return{length:{type:"%",value:e?.toString()},type:i<1?"rgba":"rgb",value:i<1?[`${n}`,`${r}`,`${o}`,`${i}`]:[`${n}`,`${r}`,`${o}`]}}))}}(o,e)))}}),(0,_t.jsxs)(kg,{gap:3,className:"components-custom-gradient-picker__ui-line",children:[(0,_t.jsx)(aN,{children:(0,_t.jsx)(uN,{gradientAST:o,hasGradient:i,onChange:t})}),(0,_t.jsx)(lN,{children:"linear-gradient"===o.type&&(0,_t.jsx)(cN,{gradientAST:o,hasGradient:i,onChange:t})})]})]})},pN=e=>e.length>0&&e.every((e=>{return t=e,Array.isArray(t.gradients)&&!("gradient"in t);var t}));function fN({className:e,clearGradient:t,gradients:n,onChange:r,value:o,...i}){const s=(0,c.useMemo)((()=>n.map((({gradient:e,name:n,slug:i},s)=>(0,_t.jsx)(uk.Option,{value:e,isSelected:o===e,tooltipText:n||(0,a.sprintf)((0,a.__)("Gradient code: %s"),e),style:{color:"rgba( 0,0,0,0 )",background:e},onClick:o===e?t:()=>r(e,s),"aria-label":n?(0,a.sprintf)((0,a.__)("Gradient: %s"),n):(0,a.sprintf)((0,a.__)("Gradient code: %s"),e)},i)))),[n,o,r,t]);return(0,_t.jsx)(uk.OptionGroup,{className:e,options:s,...i})}function hN({className:e,clearGradient:t,gradients:n,onChange:r,value:o,headingLevel:i}){const s=(0,l.useInstanceId)(hN);return(0,_t.jsx)(pk,{spacing:3,className:e,children:n.map((({name:e,gradients:n},a)=>{const l=`color-palette-${s}-${a}`;return(0,_t.jsxs)(pk,{spacing:2,children:[(0,_t.jsx)(gk,{level:i,id:l,children:e}),(0,_t.jsx)(fN,{clearGradient:t,gradients:n,onChange:e=>r(e,a),value:o,"aria-labelledby":l})]},a)}))})}function mN(e){const{asButtons:t,loop:n,actions:r,headingLevel:o,"aria-label":i,"aria-labelledby":s,...a}=e,l=pN(e.gradients)?(0,_t.jsx)(hN,{headingLevel:o,...a}):(0,_t.jsx)(fN,{...a}),{metaProps:c,labelProps:u}=dk(t,n,i,s);return(0,_t.jsx)(uk,{...c,...u,actions:r,options:l})}const gN=function({className:e,gradients:t=[],onChange:n,value:r,clearable:o=!0,enableAlpha:i=!0,disableCustomGradients:s=!1,__experimentalIsRenderedInSidebar:l,headingLevel:u=2,...d}){const p=(0,c.useCallback)((()=>n(void 0)),[n]);return(0,_t.jsxs)(pk,{spacing:t.length?4:0,children:[!s&&(0,_t.jsx)(dN,{__experimentalIsRenderedInSidebar:l,enableAlpha:i,value:r,onChange:n}),(t.length>0||o)&&(0,_t.jsx)(mN,{...d,className:e,clearGradient:p,gradients:t,onChange:n,value:r,actions:o&&!s&&(0,_t.jsx)(uk.ButtonAction,{onClick:p,accessibleWhenDisabled:!0,disabled:!r,children:(0,a.__)("Clear")}),headingLevel:u})]})},vN=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z"})}),bN=window.wp.dom,xN=()=>{},yN=["menuitem","menuitemradio","menuitemcheckbox"];class wN extends c.Component{constructor(e){super(e),this.onKeyDown=this.onKeyDown.bind(this),this.bindContainer=this.bindContainer.bind(this),this.getFocusableContext=this.getFocusableContext.bind(this),this.getFocusableIndex=this.getFocusableIndex.bind(this)}componentDidMount(){this.container&&this.container.addEventListener("keydown",this.onKeyDown)}componentWillUnmount(){this.container&&this.container.removeEventListener("keydown",this.onKeyDown)}bindContainer(e){const{forwardedRef:t}=this.props;this.container=e,"function"==typeof t?t(e):t&&"current"in t&&(t.current=e)}getFocusableContext(e){if(!this.container)return null;const{onlyBrowserTabstops:t}=this.props,n=(t?bN.focus.tabbable:bN.focus.focusable).find(this.container),r=this.getFocusableIndex(n,e);return r>-1&&e?{index:r,target:e,focusables:n}:null}getFocusableIndex(e,t){return e.indexOf(t)}onKeyDown(e){this.props.onKeyDown&&this.props.onKeyDown(e);const{getFocusableContext:t}=this,{cycle:n=!0,eventToOffset:r,onNavigate:o=xN,stopNavigationEvents:i}=this.props,s=r(e);if(void 0!==s&&i){e.stopImmediatePropagation();const t=e.target?.getAttribute("role");!!t&&yN.includes(t)&&e.preventDefault()}if(!s)return;const a=e.target?.ownerDocument?.activeElement;if(!a)return;const l=t(a);if(!l)return;const{index:c,focusables:u}=l,d=n?function(e,t,n){const r=e+n;return r<0?t+r:r>=t?r-t:r}(c,u.length,s):c+s;d>=0&&d<u.length&&(u[d].focus(),o(d,u[d]),"Tab"===e.code&&e.preventDefault())}render(){const{children:e,stopNavigationEvents:t,eventToOffset:n,onNavigate:r,onKeyDown:o,cycle:i,onlyBrowserTabstops:s,forwardedRef:a,...l}=this.props;return(0,_t.jsx)("div",{ref:this.bindContainer,...l,children:e})}}const _N=(e,t)=>(0,_t.jsx)(wN,{...e,forwardedRef:t});_N.displayName="NavigableContainer";const SN=(0,c.forwardRef)(_N);const CN=(0,c.forwardRef)((function({role:e="menu",orientation:t="vertical",...n},r){return(0,_t.jsx)(SN,{ref:r,stopNavigationEvents:!0,onlyBrowserTabstops:!1,role:e,"aria-orientation":"presentation"===e||"vertical"!==t&&"horizontal"!==t?void 0:t,eventToOffset:e=>{const{code:n}=e;let r=["ArrowDown"],o=["ArrowUp"];return"horizontal"===t&&(r=["ArrowRight"],o=["ArrowLeft"]),"both"===t&&(r=["ArrowRight","ArrowDown"],o=["ArrowLeft","ArrowUp"]),r.includes(n)?1:o.includes(n)?-1:["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(n)?0:void 0},...n})})),kN=CN;function jN(e={},t={}){const n={...e,...t};return t.className&&e.className&&(n.className=s(t.className,e.className)),n}function EN(e){return"function"==typeof e}const PN=ll((function(e){const{children:t,className:n,controls:r,icon:o=vN,label:i,popoverProps:a,toggleProps:l,menuProps:c,disableOpenOnArrowDown:u=!1,text:d,noIcons:p,open:f,defaultOpen:h,onToggle:m,variant:g}=sl(e,"DropdownMenu");if(!r?.length&&!EN(t))return null;let v;r?.length&&(v=r,Array.isArray(v[0])||(v=[r]));const b=jN({className:"components-dropdown-menu__popover",variant:g},a);return(0,_t.jsx)(W_,{className:n,popoverProps:b,renderToggle:({isOpen:e,onToggle:t})=>{var n;const{as:r=Jx,...a}=null!=l?l:{},c=jN({className:s("components-dropdown-menu__toggle",{"is-opened":e})},a);return(0,_t.jsx)(r,{...c,icon:o,onClick:e=>{t(),c.onClick&&c.onClick(e)},onKeyDown:n=>{(n=>{u||e||"ArrowDown"!==n.code||(n.preventDefault(),t())})(n),c.onKeyDown&&c.onKeyDown(n)},"aria-haspopup":"true","aria-expanded":e,label:i,text:d,showTooltip:null===(n=l?.showTooltip)||void 0===n||n,children:c.children})},renderContent:e=>{const n=jN({"aria-label":i,className:s("components-dropdown-menu__menu",{"no-icons":p})},c);return(0,_t.jsxs)(kN,{...n,role:"menu",children:[EN(t)?t(e):null,v?.flatMap(((t,n)=>t.map(((t,r)=>(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,onClick:n=>{n.stopPropagation(),e.onClose(),t.onClick&&t.onClick()},className:s("components-dropdown-menu__menu-item",{"has-separator":n>0&&0===r,"is-active":t.isActive,"is-icon-only":!t.title}),icon:t.icon,label:t.label,"aria-checked":"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.isActive:void 0,role:"menuitemcheckbox"===t.role||"menuitemradio"===t.role?t.role:"menuitem",accessibleWhenDisabled:!0,disabled:t.isDisabled,children:t.title},[n,r].join())))))]})},open:f,defaultOpen:h,onToggle:m})}),"DropdownMenu"),NN=PN;const TN=yl(F_,{target:"e1lpqc908"})("&&{flex-shrink:0;width:",Il(6),";height:",Il(6),";}"),IN=yl(qx,{target:"e1lpqc907"})(Qv,"{background:",zl.gray[100],";border-radius:",Fl.radiusXSmall,";",ib,ib,ib,ib,"{height:",Il(8),";}",Kv,Kv,Kv,"{border-color:transparent;box-shadow:none;}}"),RN=yl("div",{target:"e1lpqc906"})("line-height:",Il(8),";margin-left:",Il(2),";margin-right:",Il(2),";white-space:nowrap;overflow:hidden;"),MN=yl(mk,{target:"e1lpqc905"})("text-transform:uppercase;line-height:",Il(6),";font-weight:500;&&&{font-size:11px;margin-bottom:0;}"),AN=yl(_l,{target:"e1lpqc904"})("height:",Il(6),";display:flex;"),DN=yl(_l,{target:"e1lpqc903"})("margin-top:",Il(2),";"),zN=yl(_l,{target:"e1lpqc902"})({name:"u6wnko",styles:"&&&{.components-button.has-icon{min-width:0;padding:0;}}"}),ON=yl(Jx,{target:"e1lpqc901"})("&&{color:",zl.theme.accent,";}"),LN=yl(Jx,{target:"e1lpqc900"})("&&{margin-top:",Il(1),";}");function FN({value:e,onChange:t,label:n}){return(0,_t.jsx)(IN,{size:"compact",label:n,hideLabelFromVision:!0,value:e,onChange:t})}function BN({isGradient:e,element:t,onChange:n,popoverProps:r,onClose:o=()=>{}}){const i=(0,c.useMemo)((()=>({shift:!0,offset:20,resize:!1,placement:"left-start",...r,className:s("components-palette-edit__popover",r?.className)})),[r]);return(0,_t.jsxs)(jw,{...i,onClose:o,children:[!e&&(0,_t.jsx)(nk,{color:t.color,enableAlpha:!0,onChange:e=>{n({...t,color:e})}}),e&&(0,_t.jsx)("div",{className:"components-palette-edit__popover-gradient-picker",children:(0,_t.jsx)(dN,{__experimentalIsRenderedInSidebar:!0,value:t.gradient,onChange:e=>{n({...t,gradient:e})}})})]})}function VN({canOnlyChangeValues:e,element:t,onChange:n,onRemove:r,popoverProps:o,slugPrefix:i,isGradient:s}){const l=s?t.gradient:t.color,[u,d]=(0,c.useState)(!1),[p,f]=(0,c.useState)(null),h=(0,c.useMemo)((()=>({...o,anchor:p})),[p,o]);return(0,_t.jsxs)(LP,{ref:f,size:"small",children:[(0,_t.jsxs)(fy,{justify:"flex-start",children:[(0,_t.jsx)(Jx,{size:"small",onClick:()=>{d(!0)},"aria-label":(0,a.sprintf)((0,a.__)("Edit: %s"),t.name.trim().length?t.name:l),style:{padding:0},children:(0,_t.jsx)(TN,{colorValue:l})}),(0,_t.jsx)(Fg,{children:e?(0,_t.jsx)(RN,{children:t.name.trim().length?t.name:" "}):(0,_t.jsx)(FN,{label:s?(0,a.__)("Gradient name"):(0,a.__)("Color name"),value:t.name,onChange:e=>n({...t,name:e,slug:i+Ty(null!=e?e:"")})})}),!e&&(0,_t.jsx)(Fg,{children:(0,_t.jsx)(LN,{size:"small",icon:Gw,label:(0,a.sprintf)((0,a.__)("Remove color: %s"),t.name.trim().length?t.name:l),onClick:r})})]}),u&&(0,_t.jsx)(BN,{isGradient:s,onChange:n,element:t,popoverProps:h,onClose:()=>d(!1)})]})}function $N({elements:e,onChange:t,canOnlyChangeValues:n,slugPrefix:r,isGradient:o,popoverProps:i,addColorRef:s}){const a=(0,c.useRef)();(0,c.useEffect)((()=>{a.current=e}),[e]);const u=(0,l.useDebounce)((e=>t(function(e){const t={};return e.map((e=>{var n;let r;const{slug:o}=e;return t[o]=(t[o]||0)+1,t[o]>1&&(r=`${o}-${t[o]-1}`),{...e,slug:null!==(n=r)&&void 0!==n?n:o}}))}(e))),100);return(0,_t.jsx)(pk,{spacing:3,children:(0,_t.jsx)(FP,{isRounded:!0,isBordered:!0,isSeparated:!0,children:e.map(((a,l)=>(0,_t.jsx)(VN,{isGradient:o,canOnlyChangeValues:n,element:a,onChange:t=>{u(e.map(((e,n)=>n===l?t:e)))},onRemove:()=>{const n=e.filter(((e,t)=>t!==l));t(n.length?n:void 0),s.current?.focus()},slugPrefix:r,popoverProps:i},l)))})})}const HN=[];const WN=function({gradients:e,colors:t=HN,onChange:n,paletteLabel:r,paletteLabelHeadingLevel:o=2,emptyMessage:i,canOnlyChangeValues:s,canReset:u,slugPrefix:d="",popoverProps:p}){const f=!!e,h=f?e:t,[m,g]=(0,c.useState)(!1),[v,b]=(0,c.useState)(null),x=m&&!!v&&h[v]&&!h[v].slug,y=h.length>0,w=(0,l.useDebounce)(n,100),_=(0,c.useCallback)(((e,t)=>{const n=void 0===t?void 0:h[t];n&&n[f?"gradient":"color"]===e?b(t):g(!0)}),[f,h]),S=(0,c.useRef)(null);return(0,_t.jsxs)(zN,{children:[(0,_t.jsxs)(fy,{children:[(0,_t.jsx)(MN,{level:o,children:r}),(0,_t.jsxs)(AN,{children:[y&&m&&(0,_t.jsx)(ON,{size:"small",onClick:()=>{g(!1),b(null)},children:(0,a.__)("Done")}),!s&&(0,_t.jsx)(Jx,{ref:S,size:"small",isPressed:x,icon:Og,label:f?(0,a.__)("Add gradient"):(0,a.__)("Add color"),onClick:()=>{const{name:r,slug:o}=function(e,t){const n=new RegExp(`^${t}color-([\\d]+)$`),r=e.reduce(((e,t)=>{if("string"==typeof t?.slug){const r=t?.slug.match(n);if(r){const t=parseInt(r[1],10);if(t>=e)return t+1}}return e}),1);return{name:(0,a.sprintf)((0,a.__)("Color %s"),r),slug:`${t}color-${r}`}}(h,d);n(e?[...e,{gradient:JP,name:r,slug:o}]:[...t,{color:"#000",name:r,slug:o}]),g(!0),b(h.length)}}),y&&(!m||!s||u)&&(0,_t.jsx)(NN,{icon:_P,label:f?(0,a.__)("Gradient options"):(0,a.__)("Color options"),toggleProps:{size:"small"},children:({onClose:e})=>(0,_t.jsx)(_t.Fragment,{children:(0,_t.jsxs)(kN,{role:"menu",children:[!m&&(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{g(!0),e()},className:"components-palette-edit__menu-button",children:(0,a.__)("Show details")}),!s&&(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,variant:"tertiary",onClick:()=>{b(null),g(!1),n(),e()},className:"components-palette-edit__menu-button",children:f?(0,a.__)("Remove all gradients"):(0,a.__)("Remove all colors")}),u&&(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,className:"components-palette-edit__menu-button",variant:"tertiary",onClick:()=>{b(null),n(),e()},children:f?(0,a.__)("Reset gradient"):(0,a.__)("Reset colors")})]})})})]})]}),y&&(0,_t.jsxs)(DN,{children:[m&&(0,_t.jsx)($N,{canOnlyChangeValues:s,elements:h,onChange:n,slugPrefix:d,isGradient:f,popoverProps:p,addColorRef:S}),!m&&null!==v&&(0,_t.jsx)(BN,{isGradient:f,onClose:()=>b(null),onChange:e=>{w(h.map(((t,n)=>n===v?e:t)))},element:h[null!=v?v:-1],popoverProps:p}),!m&&(f?(0,_t.jsx)(gN,{gradients:e,onChange:_,clearable:!1,disableCustomGradients:!0}):(0,_t.jsx)(jk,{colors:t,onChange:_,clearable:!1,disableCustomColors:!0}))]}),!y&&i&&(0,_t.jsx)(DN,{children:i})]})},UN=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})}),GN=({__next40pxDefaultSize:e})=>!e&&Nl("height:28px;padding-left:",Il(1),";padding-right:",Il(1),";",""),KN=yl(kg,{target:"evuatpg0"})("height:38px;padding-left:",Il(2),";padding-right:",Il(2),";",GN,";");const qN=(0,c.forwardRef)((function(e,t){const{value:n,isExpanded:r,instanceId:o,selectedSuggestionIndex:i,className:a,onChange:l,onFocus:u,onBlur:d,...p}=e,[f,h]=(0,c.useState)(!1),m=n?n.length+1:0;return(0,_t.jsx)("input",{ref:t,id:`components-form-token-input-${o}`,type:"text",...p,value:n||"",onChange:e=>{l&&l({value:e.target.value})},onFocus:e=>{h(!0),u?.(e)},onBlur:e=>{h(!1),d?.(e)},size:m,className:s(a,"components-form-token-field__input"),autoComplete:"off",role:"combobox","aria-expanded":r,"aria-autocomplete":"list","aria-owns":r?`components-form-token-suggestions-${o}`:void 0,"aria-activedescendant":f&&-1!==i&&r?`components-form-token-suggestions-${o}-${i}`:void 0,"aria-describedby":`components-form-token-suggestions-howto-${o}`})})),YN=qN,XN=e=>{e.preventDefault()};const ZN=function({selectedIndex:e,scrollIntoView:t,match:n,onHover:r,onSelect:o,suggestions:i=[],displayTransform:c,instanceId:u,__experimentalRenderItem:d}){const p=(0,l.useRefEffect)((n=>(e>-1&&t&&n.children[e]&&n.children[e].scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),()=>{0})),[e,t]),f=e=>()=>{r?.(e)},h=e=>()=>{o?.(e)};return(0,_t.jsxs)("ul",{ref:p,className:"components-form-token-field__suggestions-list",id:`components-form-token-suggestions-${u}`,role:"listbox",children:[i.map(((t,r)=>{const o=(e=>{const t=c(n).toLocaleLowerCase();if(0===t.length)return null;const r=c(e),o=r.toLocaleLowerCase().indexOf(t);return{suggestionBeforeMatch:r.substring(0,o),suggestionMatch:r.substring(o,o+t.length),suggestionAfterMatch:r.substring(o+t.length)}})(t),i=r===e,a="object"==typeof t&&t?.disabled,l="object"==typeof t&&"value"in t?t?.value:c(t),p=s("components-form-token-field__suggestion",{"is-selected":i});let m;return m="function"==typeof d?d({item:t}):o?(0,_t.jsxs)("span",{"aria-label":c(t),children:[o.suggestionBeforeMatch,(0,_t.jsx)("strong",{className:"components-form-token-field__suggestion-match",children:o.suggestionMatch}),o.suggestionAfterMatch]}):c(t),(0,_t.jsx)("li",{id:`components-form-token-suggestions-${u}-${r}`,role:"option",className:p,onMouseDown:XN,onClick:h(t),onMouseEnter:f(t),"aria-selected":r===e,"aria-disabled":a,children:m},l)})),0===i.length&&(0,_t.jsx)("li",{className:"components-form-token-field__suggestion is-empty",children:(0,a.__)("No items found")})]})},QN=(0,l.createHigherOrderComponent)((e=>t=>{const[n,r]=(0,c.useState)(void 0),o=(0,c.useCallback)((e=>r((()=>e?.handleFocusOutside?e.handleFocusOutside.bind(e):void 0))),[]);return(0,_t.jsx)("div",{...(0,l.__experimentalUseFocusOutside)(n),children:(0,_t.jsx)(e,{ref:o,...t})})}),"withFocusOutside");const JN=Tl` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,eT=yl("svg",{target:"ea4tfvq2"})("width:",Fl.spinnerSize,"px;height:",Fl.spinnerSize,"px;display:inline-block;margin:5px 11px 0;position:relative;color:",zl.theme.accent,";overflow:visible;opacity:1;background-color:transparent;"),tT={name:"9s4963",styles:"fill:transparent;stroke-width:1.5px"},nT=yl("circle",{target:"ea4tfvq1"})(tT,";stroke:",zl.gray[300],";"),rT=yl("path",{target:"ea4tfvq0"})(tT,";stroke:currentColor;stroke-linecap:round;transform-origin:50% 50%;animation:1.4s linear infinite both ",JN,";");const oT=(0,c.forwardRef)((function({className:e,...t},n){return(0,_t.jsxs)(eT,{className:s("components-spinner",e),viewBox:"0 0 100 100",width:"16",height:"16",xmlns:"http://www.w3.org/2000/svg",role:"presentation",focusable:"false",...t,ref:n,children:[(0,_t.jsx)(nT,{cx:"50",cy:"50",r:"50",vectorEffect:"non-scaling-stroke"}),(0,_t.jsx)(rT,{d:"m 50 0 a 50 50 0 0 1 50 50",vectorEffect:"non-scaling-stroke"})]})})),iT=()=>{},sT=QN(class extends c.Component{handleFocusOutside(e){this.props.onFocusOutside(e)}render(){return this.props.children}}),aT=(e,t)=>null===e?-1:t.indexOf(e);const lT=function e(t){var n;const{__nextHasNoMarginBottom:r=!1,__next40pxDefaultSize:o=!1,value:i,label:u,options:d,onChange:p,onFilterValueChange:f=iT,hideLabelFromVision:h,help:m,allowReset:g=!0,className:v,isLoading:b=!1,messages:x={selected:(0,a.__)("Item selected.")},__experimentalRenderItem:y,expandOnFocus:w=!0,placeholder:_}=hb(t),[S,C]=f_({value:i,onChange:p}),k=d.find((e=>e.value===S)),j=null!==(n=k?.label)&&void 0!==n?n:"",E=(0,l.useInstanceId)(e,"combobox-control"),[P,N]=(0,c.useState)(k||null),[T,I]=(0,c.useState)(!1),[R,M]=(0,c.useState)(!1),[A,D]=(0,c.useState)(""),z=(0,c.useRef)(null),O=(0,c.useMemo)((()=>{const e=[],t=[],n=Ny(A);return d.forEach((r=>{const o=Ny(r.label).indexOf(n);0===o?e.push(r):o>0&&t.push(r)})),e.concat(t)}),[A,d]),L=e=>{e.disabled||(C(e.value),(0,jy.speak)(x.selected,"assertive"),N(e),D(""),I(!1))},F=(e=1)=>{let t=aT(P,O)+e;t<0?t=O.length-1:t>=O.length&&(t=0),N(O[t]),I(!0)},B=jx((e=>{let t=!1;if(!e.defaultPrevented){switch(e.code){case"Enter":P&&(L(P),t=!0);break;case"ArrowUp":F(-1),t=!0;break;case"ArrowDown":F(1),t=!0;break;case"Escape":I(!1),N(null),t=!0}t&&e.preventDefault()}}));return(0,c.useEffect)((()=>{const e=O.length>0,t=aT(P,O)>0;e&&!t&&N(O[0])}),[O,P]),(0,c.useEffect)((()=>{const e=O.length>0;if(T){const t=e?(0,a.sprintf)((0,a._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",O.length),O.length):(0,a.__)("No results.");(0,jy.speak)(t,"polite")}}),[O,T]),Ux({componentName:"ComboboxControl",__next40pxDefaultSize:o,size:void 0}),(0,_t.jsx)(sT,{onFocusOutside:()=>{I(!1)},children:(0,_t.jsx)(Wx,{__nextHasNoMarginBottom:r,__associatedWPComponentName:"ComboboxControl",className:s(v,"components-combobox-control"),label:u,id:`components-form-token-input-${E}`,hideLabelFromVision:h,help:m,children:(0,_t.jsxs)("div",{className:"components-combobox-control__suggestions-container",tabIndex:-1,onKeyDown:B,children:[(0,_t.jsxs)(KN,{__next40pxDefaultSize:o,children:[(0,_t.jsx)(Eg,{children:(0,_t.jsx)(YN,{className:"components-combobox-control__input",instanceId:E,ref:z,placeholder:_,value:T?A:j,onFocus:()=>{M(!0),w&&I(!0),f(""),D("")},onBlur:()=>{M(!1)},onClick:()=>{I(!0)},isExpanded:T,selectedSuggestionIndex:aT(P,O),onChange:e=>{const t=e.value;D(t),f(t),R&&I(!0)}})}),b&&(0,_t.jsx)(oT,{}),g&&(0,_t.jsx)(Jx,{size:"small",icon:UN,disabled:!S,onClick:()=>{C(null),z.current?.focus()},onKeyDown:e=>{e.stopPropagation()},label:(0,a.__)("Reset")})]}),T&&!b&&(0,_t.jsx)(ZN,{instanceId:E,match:{label:A,value:""},displayTransform:e=>e.label,suggestions:O,selectedIndex:aT(P,O),onHover:N,onSelect:L,scrollIntoView:!0,__experimentalRenderItem:y})]})})})};function cT(e){if(e.state){const{state:t,...n}=e,{store:r,...o}=cT(t);return{...n,...o,store:r}}return e}const uT={__unstableComposite:"Composite",__unstableCompositeGroup:"Composite.Group or Composite.Row",__unstableCompositeItem:"Composite.Item",__unstableUseCompositeState:"Composite"};function dT(e,t={}){var n;const r=null!==(n=e.displayName)&&void 0!==n?n:"",o=n=>{Xi()(`wp.components.${r}`,{since:"6.7",alternative:uT.hasOwnProperty(r)?uT[r]:void 0});const{store:o,...i}=cT(n);let s=i;return s={...s,id:(0,l.useInstanceId)(o,s.baseId,s.id)},Object.entries(t).forEach((([e,t])=>{s.hasOwnProperty(e)&&(Object.assign(s,{[t]:s[e]}),delete s[e])})),delete s.baseId,(0,_t.jsx)(e,{...s,store:o})};return o.displayName=r,o}const pT=(0,c.forwardRef)((({role:e,...t},n)=>{const r="row"===e?Gn.Row:Gn.Group;return(0,_t.jsx)(r,{ref:n,role:e,...t})})),fT=dT(Object.assign(Gn,{displayName:"__unstableComposite"}),{baseId:"id"}),hT=dT(Object.assign(pT,{displayName:"__unstableCompositeGroup"})),mT=dT(Object.assign(Gn.Item,{displayName:"__unstableCompositeItem"}),{focusable:"accessibleWhenDisabled"});function gT(e={}){Xi()("wp.components.__unstableUseCompositeState",{since:"6.7",alternative:uT.__unstableUseCompositeState});const{baseId:t,currentId:n,orientation:r,rtl:o=!1,loop:i=!1,wrap:s=!1,shift:a=!1,unstable_virtual:c}=e;return{baseId:(0,l.useInstanceId)(fT,"composite",t),store:vt({defaultActiveId:n,rtl:o,orientation:r,focusLoop:i,focusShift:a,focusWrap:s,virtualFocus:c})}}const vT=new Set(["alert","status","log","marquee","timer"]),bT=[];function xT(e){const t=e.getAttribute("role");return!("SCRIPT"===e.tagName||e.hasAttribute("hidden")||e.hasAttribute("aria-hidden")||e.hasAttribute("aria-live")||t&&vT.has(t))}const yT=Fl.transitionDuration,wT=Number.parseInt(Fl.transitionDuration);const _T=(0,c.createContext)(new Set),ST=new Map;const CT=(0,c.forwardRef)((function(e,t){const{bodyOpenClassName:n="modal-open",role:r="dialog",title:o=null,focusOnMount:i=!0,shouldCloseOnEsc:u=!0,shouldCloseOnClickOutside:d=!0,isDismissible:p=!0,aria:f={labelledby:void 0,describedby:void 0},onRequestClose:h,icon:m,closeButtonLabel:g,children:v,style:b,overlayClassName:x,className:y,contentLabel:w,onKeyDown:_,isFullScreen:S=!1,size:C,headerActions:k=null,__experimentalHideHeader:j=!1}=e,E=(0,c.useRef)(),P=(0,l.useInstanceId)(CT),N=o?`components-modal-header-${P}`:f.labelledby,T=(0,l.useFocusOnMount)("firstContentElement"===i?"firstElement":i),I=(0,l.useConstrainedTabbing)(),R=(0,l.useFocusReturn)(),M=(0,c.useRef)(null),A=(0,c.useRef)(null),[D,z]=(0,c.useState)(!1),[O,L]=(0,c.useState)(!1);let F;S||"fill"===C?F="is-full-screen":C&&(F=`has-size-${C}`);const B=(0,c.useCallback)((()=>{if(!M.current)return;const e=(0,bN.getScrollContainer)(M.current);M.current===e?L(!0):L(!1)}),[M]);(0,c.useEffect)((()=>(function(e){const t=Array.from(document.body.children),n=[];bT.push(n);for(const r of t)r!==e&&xT(r)&&(r.setAttribute("aria-hidden","true"),n.push(r))}(E.current),()=>function(){const e=bT.pop();if(e)for(const t of e)t.removeAttribute("aria-hidden")}())),[]);const V=(0,c.useRef)();(0,c.useEffect)((()=>{V.current=h}),[h]);const $=(0,c.useContext)(_T),[H]=(0,c.useState)((()=>new Set));(0,c.useEffect)((()=>{$.add(V);for(const e of $)e!==V&&e.current?.();return()=>{for(const e of H)e.current?.();$.delete(V)}}),[$,H]),(0,c.useEffect)((()=>{var e;const t=n,r=1+(null!==(e=ST.get(t))&&void 0!==e?e:0);return ST.set(t,r),document.body.classList.add(n),()=>{const e=ST.get(t)-1;0===e?(document.body.classList.remove(t),ST.delete(t)):ST.set(t,e)}}),[n]);const{closeModal:W,frameRef:U,frameStyle:G,overlayClassname:K}=function(){const e=(0,c.useRef)(),[t,n]=(0,c.useState)(!1),r=(0,l.useReducedMotion)(),o=(0,c.useCallback)((()=>new Promise((t=>{const o=e.current;if(r)return void t();if(!o)return void t();let i;Promise.race([new Promise((e=>{i=t=>{"components-modal__disappear-animation"===t.animationName&&e()},o.addEventListener("animationend",i),n(!0)})),new Promise((e=>{setTimeout((()=>e()),1.2*wT)}))]).then((()=>{i&&o.removeEventListener("animationend",i),n(!1),t()}))}))),[r]);return{overlayClassname:t?"is-animating-out":void 0,frameRef:e,frameStyle:{"--modal-frame-animation-duration":`${yT}`},closeModal:o}}();(0,c.useLayoutEffect)((()=>{if(!window.ResizeObserver||!A.current)return;const e=new ResizeObserver(B);return e.observe(A.current),B(),()=>{e.disconnect()}}),[B,A]);const q=(0,c.useCallback)((e=>{var t;const n=null!==(t=e?.currentTarget?.scrollTop)&&void 0!==t?t:-1;!D&&n>0?z(!0):D&&n<=0&&z(!1)}),[D]);let Y=null;const X={onPointerDown:e=>{e.target===e.currentTarget&&(Y=e.target,e.preventDefault())},onPointerUp:({target:e,button:t})=>{const n=e===Y;Y=null,0===t&&n&&W().then((()=>h()))}},Z=(0,_t.jsx)("div",{ref:(0,l.useMergeRefs)([E,t]),className:s("components-modal__screen-overlay",K,x),onKeyDown:jx((function(e){!u||"Escape"!==e.code&&"Escape"!==e.key||e.defaultPrevented||(e.preventDefault(),W().then((()=>h(e))))})),...d?X:{},children:(0,_t.jsx)(lw,{document,children:(0,_t.jsx)("div",{className:s("components-modal__frame",F,y),style:{...G,...b},ref:(0,l.useMergeRefs)([U,I,R,"firstContentElement"!==i?T:null]),role:r,"aria-label":w,"aria-labelledby":w?void 0:N,"aria-describedby":f.describedby,tabIndex:-1,onKeyDown:_,children:(0,_t.jsxs)("div",{className:s("components-modal__content",{"hide-header":j,"is-scrollable":O,"has-scrolled-content":D}),role:"document",onScroll:q,ref:M,"aria-label":O?(0,a.__)("Scrollable section"):void 0,tabIndex:O?0:void 0,children:[!j&&(0,_t.jsxs)("div",{className:"components-modal__header",children:[(0,_t.jsxs)("div",{className:"components-modal__header-heading-container",children:[m&&(0,_t.jsx)("span",{className:"components-modal__icon-container","aria-hidden":!0,children:m}),o&&(0,_t.jsx)("h1",{id:N,className:"components-modal__header-heading",children:o})]}),k,p&&(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(zg,{marginBottom:0,marginLeft:2}),(0,_t.jsx)(Jx,{size:"compact",onClick:e=>W().then((()=>h(e))),icon:Fy,label:g||(0,a.__)("Close")})]})]}),(0,_t.jsx)("div",{ref:(0,l.useMergeRefs)([A,"firstContentElement"===i?T:null]),children:v})]})})})});return(0,c.createPortal)((0,_t.jsx)(_T.Provider,{value:H,children:Z}),document.body)})),kT=CT;const jT={name:"7g5ii0",styles:"&&{z-index:1000001;}"},ET=al(((e,t)=>{const{isOpen:n,onConfirm:r,onCancel:o,children:i,confirmButtonText:s,cancelButtonText:l,...u}=sl(e,"ConfirmDialog"),d=il()(jT),p=(0,c.useRef)(),f=(0,c.useRef)(),[h,m]=(0,c.useState)(),[g,v]=(0,c.useState)();(0,c.useEffect)((()=>{const e=void 0!==n;m(!e||n),v(!e)}),[n]);const b=(0,c.useCallback)((e=>t=>{e?.(t),g&&m(!1)}),[g,m]),x=(0,c.useCallback)((e=>{e.target===p.current||e.target===f.current||"Enter"!==e.key||b(r)(e)}),[b,r]),y=null!=l?l:(0,a.__)("Cancel"),w=null!=s?s:(0,a.__)("OK");return(0,_t.jsx)(_t.Fragment,{children:h&&(0,_t.jsx)(kT,{onRequestClose:b(o),onKeyDown:x,closeButtonLabel:y,isDismissible:!0,ref:t,overlayClassName:d,__experimentalHideHeader:!0,...u,children:(0,_t.jsxs)(pk,{spacing:8,children:[(0,_t.jsx)($v,{children:i}),(0,_t.jsxs)(kg,{direction:"row",justify:"flex-end",children:[(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,ref:p,variant:"tertiary",onClick:b(o),children:y}),(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,ref:f,variant:"primary",onClick:b(r),children:w})]})]})})})}),"ConfirmDialog");(0,B.createContext)(void 0);var PT=Et([gr,Mt],[vr,At]),NT=PT.useContext,TT=(PT.useScopedContext,PT.useProviderContext);PT.ContextProvider,PT.ScopedContextProvider,(0,B.createContext)(void 0),(0,B.createContext)(!1);function IT(e={}){var t=e,{combobox:n}=t,r=N(t,["combobox"]);const o=Xe(r.store,Ye(n,["value","items","renderedItems","baseElement","arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),i=o.getState(),s=ht(P(E({},r),{store:o,virtualFocus:F(r.virtualFocus,i.virtualFocus,!0),includesBaseElement:F(r.includesBaseElement,i.includesBaseElement,!1),activeId:F(r.activeId,i.activeId,r.defaultActiveId,null),orientation:F(r.orientation,i.orientation,"vertical")})),a=er(P(E({},r),{store:o,placement:F(r.placement,i.placement,"bottom-start")})),l=new String(""),c=P(E(E({},s.getState()),a.getState()),{value:F(r.value,i.value,r.defaultValue,l),setValueOnMove:F(r.setValueOnMove,i.setValueOnMove,!1),labelElement:F(i.labelElement,null),selectElement:F(i.selectElement,null),listElement:F(i.listElement,null)}),u=He(c,s,a,o);return We(u,(()=>Ke(u,["value","items"],(e=>{if(e.value!==l)return;if(!e.items.length)return;const t=e.items.find((e=>!e.disabled&&null!=e.value));null!=(null==t?void 0:t.value)&&u.setState("value",t.value)})))),We(u,(()=>Ke(u,["mounted"],(e=>{e.mounted||u.setState("activeId",c.activeId)})))),We(u,(()=>Ke(u,["mounted","items","value"],(e=>{if(n)return;if(e.mounted)return;const t=st(e.value),r=t[t.length-1];if(null==r)return;const o=e.items.find((e=>!e.disabled&&e.value===r));o&&u.setState("activeId",o.id)})))),We(u,(()=>qe(u,["setValueOnMove","moves"],(e=>{const{mounted:t,value:n,activeId:r}=u.getState();if(!e.setValueOnMove&&t)return;if(Array.isArray(n))return;if(!e.moves)return;if(!r)return;const o=s.item(r);o&&!o.disabled&&null!=o.value&&u.setState("value",o.value)})))),P(E(E(E({},s),a),u),{combobox:n,setValue:e=>u.setState("value",e),setLabelElement:e=>u.setState("labelElement",e),setSelectElement:e=>u.setState("selectElement",e),setListElement:e=>u.setState("listElement",e)})}function RT(e={}){e=function(e){const t=TT();return mt(e=b(v({},e),{combobox:void 0!==e.combobox?e.combobox:t}))}(e);const[t,n]=rt(IT,e);return function(e,t,n){return Te(t,[n.combobox]),nt(e,n,"value","setValue"),nt(e,n,"setValueOnMove"),Object.assign(Qn(gt(e,t,n),t,n),{combobox:n.combobox})}(t,n,e)}var MT=Et([gr,Mt],[vr,At]),AT=MT.useContext,DT=MT.useScopedContext,zT=MT.useProviderContext,OT=(MT.ContextProvider,MT.ScopedContextProvider),LT=(0,B.createContext)(!1),FT=(0,B.createContext)(null),BT=jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=zT();D(n=n||o,!1);const i=Pe(r.id),s=r.onClick,a=ke((e=>{null==s||s(e),e.defaultPrevented||queueMicrotask((()=>{const e=null==n?void 0:n.getState().selectElement;null==e||e.focus()}))}));return L(r=b(v({id:i},r),{ref:Ee(n.setLabelElement,r.ref),onClick:a,style:v({cursor:"default"},r.style)}))})),VT=Ct(St((function(e){return kt("div",BT(e))}))),$T="button",HT=jt((function(e){const t=(0,B.useRef)(null),n=Ne(t,$T),[r,o]=(0,B.useState)((()=>!!n&&Q({tagName:n,type:e.type})));return(0,B.useEffect)((()=>{t.current&&o(Q(t.current))}),[]),e=b(v({role:r||"a"===n?void 0:"button"},e),{ref:Ee(t,e.ref)}),e=Tn(e)})),WT=(St((function(e){const t=HT(e);return kt($T,t)})),Symbol("disclosure")),UT=jt((function(e){var t=e,{store:n,toggleOnClick:r=!0}=t,o=x(t,["store","toggleOnClick"]);const i=sr();D(n=n||i,!1);const s=(0,B.useRef)(null),[a,l]=(0,B.useState)(!1),c=n.useState("disclosureElement"),u=n.useState("open");(0,B.useEffect)((()=>{let e=c===s.current;(null==c?void 0:c.isConnected)||(null==n||n.setDisclosureElement(s.current),e=!0),l(u&&e)}),[c,n,u]);const d=o.onClick,p=Re(r),[f,h]=De(o,WT,!0),m=ke((e=>{null==d||d(e),e.defaultPrevented||f||p(e)&&(null==n||n.setDisclosureElement(e.currentTarget),null==n||n.toggle())})),g=n.useState("contentElement");return o=b(v(v({"aria-expanded":a,"aria-controls":null==g?void 0:g.id},h),o),{ref:Ee(s,o.ref),onClick:m}),o=HT(o)})),GT=(St((function(e){return kt("button",UT(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=lr();D(n=n||o,!1);const i=n.useState("contentElement");return r=v({"aria-haspopup":re(i,"dialog")},r),r=UT(v({store:n},r))}))),KT=(St((function(e){return kt("button",GT(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=mr();return n=n||o,r=b(v({},r),{ref:Ee(null==n?void 0:n.setAnchorElement,r.ref)})}))),qT=(St((function(e){return kt("div",KT(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=mr();D(n=n||o,!1);const i=r.onClick,s=ke((e=>{null==n||n.setAnchorElement(e.currentTarget),null==i||i(e)}));return r=Me(r,(e=>(0,_t.jsx)(vr,{value:n,children:e})),[n]),r=b(v({},r),{onClick:s}),r=KT(v({store:n},r)),r=GT(v({store:n},r))}))),YT=(St((function(e){return kt("button",qT(e))})),{top:"4,10 8,6 12,10",right:"6,4 10,8 6,12",bottom:"4,6 8,10 12,6",left:"10,4 6,8 10,12"}),XT=jt((function(e){var t=e,{store:n,placement:r}=t,o=x(t,["store","placement"]);const i=hr();D(n=n||i,!1);const s=n.useState((e=>r||e.placement)).split("-")[0],a=YT[s],l=(0,B.useMemo)((()=>(0,_t.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,_t.jsx)("polyline",{points:a})})),[a]);return L(o=b(v({children:l,"aria-hidden":!0},o),{style:v({width:"1em",height:"1em",pointerEvents:"none"},o.style)}))})),ZT=(St((function(e){return kt("span",XT(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=AT();return r=XT(v({store:n=n||o},r))}))),QT=St((function(e){return kt("span",ZT(e))}));function JT(e,t){return()=>{const n=t();if(!n)return;let r=0,o=e.item(n);const i=o;for(;o&&null==o.value;){const n=t(++r);if(!n)return;if(o=e.item(n),o===i)break}return null==o?void 0:o.id}}var eI=jt((function(e){var t=e,{store:n,name:r,form:o,required:i,showOnKeyDown:s=!0,moveOnKeyDown:a=!0,toggleOnPress:l=!0,toggleOnClick:c=l}=t,u=x(t,["store","name","form","required","showOnKeyDown","moveOnKeyDown","toggleOnPress","toggleOnClick"]);const d=zT();D(n=n||d,!1);const p=u.onKeyDown,f=Re(s),h=Re(a),m=n.useState("placement").split("-")[0],g=n.useState("value"),y=Array.isArray(g),w=ke((e=>{var t;if(null==p||p(e),e.defaultPrevented)return;if(!n)return;const{orientation:r,items:o,activeId:i}=n.getState(),s="horizontal"!==r,a="vertical"!==r,l=!!(null==(t=o.find((e=>!e.disabled&&null!=e.value)))?void 0:t.rowId),c={ArrowUp:(l||s)&&JT(n,n.up),ArrowRight:(l||a)&&JT(n,n.next),ArrowDown:(l||s)&&JT(n,n.down),ArrowLeft:(l||a)&&JT(n,n.previous)}[e.key];c&&h(e)&&(e.preventDefault(),n.move(c()));const u="top"===m||"bottom"===m;({ArrowDown:u,ArrowUp:u,ArrowLeft:"left"===m,ArrowRight:"right"===m})[e.key]&&f(e)&&(e.preventDefault(),n.move(i),ve(e.currentTarget,"keyup",n.show))}));u=Me(u,(e=>(0,_t.jsx)(OT,{value:n,children:e})),[n]);const[_,S]=(0,B.useState)(!1),C=(0,B.useRef)(!1);(0,B.useEffect)((()=>{const e=C.current;C.current=!1,e||S(!1)}),[g]);const k=n.useState((e=>{var t;return null==(t=e.labelElement)?void 0:t.id})),j=u["aria-label"],E=u["aria-labelledby"]||k,P=n.useState((e=>{if(r)return e.items})),N=(0,B.useMemo)((()=>[...new Set(null==P?void 0:P.map((e=>e.value)).filter((e=>null!=e)))]),[P]);u=Me(u,(e=>r?(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsxs)("select",{style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},tabIndex:-1,"aria-hidden":!0,"aria-label":j,"aria-labelledby":E,name:r,form:o,required:i,value:g,multiple:y,onFocus:()=>{var e;return null==(e=null==n?void 0:n.getState().selectElement)?void 0:e.focus()},onChange:e=>{var t;C.current=!0,S(!0),null==n||n.setValue(y?(t=e.target,Array.from(t.selectedOptions).map((e=>e.value))):e.target.value)},children:[st(g).map((e=>null==e||N.includes(e)?null:(0,_t.jsx)("option",{value:e,children:e},e))),N.map((e=>(0,_t.jsx)("option",{value:e,children:e},e)))]}),e]}):e),[n,j,E,r,o,i,g,y,N]);const T=(0,_t.jsxs)(_t.Fragment,{children:[g,(0,_t.jsx)(QT,{})]}),I=n.useState("contentElement");return u=b(v({role:"combobox","aria-autocomplete":"none","aria-labelledby":k,"aria-haspopup":re(I,"listbox"),"data-autofill":_||void 0,"data-name":r,children:T},u),{ref:Ee(n.setSelectElement,u.ref),onKeyDown:w}),u=qT(v({store:n,toggleOnClick:c},u)),u=Hn(v({store:n},u))})),tI=St((function(e){return kt("button",eI(e))})),nI=(0,B.createContext)(null),rI=jt((function(e){var t=e,{store:n,resetOnEscape:r=!0,hideOnEnter:o=!0,focusOnMove:i=!0,composite:s,alwaysVisible:a}=t,l=x(t,["store","resetOnEscape","hideOnEnter","focusOnMove","composite","alwaysVisible"]);const c=AT();D(n=n||c,!1);const u=Pe(l.id),d=n.useState("value"),p=Array.isArray(d),[f,h]=(0,B.useState)(d),m=n.useState("mounted");(0,B.useEffect)((()=>{m||h(d)}),[m,d]),r=r&&!p;const g=l.onKeyDown,y=Re(r),w=Re(o),_=ke((e=>{null==g||g(e),e.defaultPrevented||("Escape"===e.key&&y(e)&&(null==n||n.setValue(f))," "!==e.key&&"Enter"!==e.key||de(e)&&w(e)&&(e.preventDefault(),null==n||n.hide()))})),S=(0,B.useContext)(FT),C=(0,B.useState)(),[k,j]=S||C,E=(0,B.useMemo)((()=>[k,j]),[k]),[P,N]=(0,B.useState)(null),T=(0,B.useContext)(nI);(0,B.useEffect)((()=>{if(T)return T(n),()=>T(null)}),[T,n]),l=Me(l,(e=>(0,_t.jsx)(OT,{value:n,children:(0,_t.jsx)(nI.Provider,{value:N,children:(0,_t.jsx)(FT.Provider,{value:E,children:e})})})),[n,E]);const I=!!n.combobox;s=null!=s?s:!I&&P!==n;const[R,M]=je(s?n.setListElement:null),A=function(e,t,n){const r=Se(n),[o,i]=(0,B.useState)(r);return(0,B.useEffect)((()=>{const n=e&&"current"in e?e.current:e;if(!n)return;const o=()=>{const e=n.getAttribute(t);i(null==e?r:e)},s=new MutationObserver(o);return s.observe(n,{attributeFilter:[t]}),o(),()=>s.disconnect()}),[e,t,r]),o}(R,"role",l.role),z=(s||("listbox"===A||"menu"===A||"tree"===A||"grid"===A))&&p||void 0,O=Xr(m,l.hidden,a),L=O?b(v({},l.style),{display:"none"}):l.style;s&&(l=v({role:"listbox","aria-multiselectable":z},l));const F=n.useState((e=>{var t;return k||(null==(t=e.labelElement)?void 0:t.id)}));return l=b(v({id:u,"aria-labelledby":F,hidden:O},l),{ref:Ee(M,l.ref),style:L,onKeyDown:_}),l=cn(b(v({store:n},l),{composite:s})),l=Hn(v({store:n,typeahead:!I},l))})),oI=(St((function(e){return kt("div",rI(e))})),jt((function(e){var t=e,{store:n,alwaysVisible:r}=t,o=x(t,["store","alwaysVisible"]);const i=zT();return o=rI(v({store:n=n||i,alwaysVisible:r},o)),o=Hi(v({store:n,alwaysVisible:r},o))}))),iI=_o(St((function(e){return kt("div",oI(e))})),zT);var sI=jt((function(e){var t,n=e,{store:r,value:o,getItem:i,hideOnClick:s,setValueOnClick:a=null!=o,preventScrollOnKeyDown:l=!0,focusOnHover:c=!0}=n,u=x(n,["store","value","getItem","hideOnClick","setValueOnClick","preventScrollOnKeyDown","focusOnHover"]);const d=DT();D(r=r||d,!1);const p=Pe(u.id),f=O(u),{listElement:h,multiSelectable:m,selected:g,autoFocus:y}=tt(r,{listElement:"listElement",multiSelectable:e=>Array.isArray(e.value),selected:e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.value,o),autoFocus:e=>null!=o&&(null!=e.value&&((e.activeId===p||!(null==r?void 0:r.item(e.activeId)))&&(Array.isArray(e.value)?e.value[e.value.length-1]===o:e.value===o)))}),w=(0,B.useCallback)((e=>{const t=b(v({},e),{value:f?void 0:o,children:o});return i?i(t):t}),[f,o,i]);s=null!=s?s:null!=o&&!m;const _=u.onClick,S=Re(a),C=Re(s),k=ke((e=>{null==_||_(e),e.defaultPrevented||fe(e)||pe(e)||(S(e)&&null!=o&&(null==r||r.setValue((e=>Array.isArray(e)?e.includes(o)?e.filter((e=>e!==o)):[...e,o]:o))),C(e)&&(null==r||r.hide()))}));u=Me(u,(e=>(0,_t.jsx)(LT.Provider,{value:null!=g&&g,children:e})),[g]),u=b(v({id:p,role:oe(h),"aria-selected":g,children:o},u),{autoFocus:null!=(t=u.autoFocus)?t:y,onClick:k}),u=Mn(v({store:r,getItem:w,preventScrollOnKeyDown:l},u));const j=Re(c);return u=Cn(b(v({store:r},u),{focusOnHover(e){if(!j(e))return!1;const t=null==r?void 0:r.getState();return!!(null==t?void 0:t.open)}}))})),aI=Ct(St((function(e){return kt("div",sI(e))}))),lI=(0,B.createContext)(!1),cI=(0,_t.jsx)("svg",{display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:(0,_t.jsx)("polyline",{points:"4,8 7,12 12,4"})});var uI=jt((function(e){var t=e,{store:n,checked:r}=t,o=x(t,["store","checked"]);const i=(0,B.useContext)(lI),s=function(e){return e.checked?e.children||cI:"function"==typeof e.children?e.children:null}({checked:r=null!=r?r:i,children:o.children});return L(o=b(v({"aria-hidden":!0},o),{children:s,style:v({width:"1em",height:"1em",pointerEvents:"none"},o.style)}))})),dI=(St((function(e){return kt("span",uI(e))})),jt((function(e){var t=e,{store:n,checked:r}=t,o=x(t,["store","checked"]);const i=(0,B.useContext)(LT);return r=null!=r?r:i,o=uI(b(v({},o),{checked:r}))}))),pI=St((function(e){return kt("span",dI(e))}));const fI="2px",hI="400ms",mI="cubic-bezier( 0.16, 1, 0.3, 1 )",gI={compact:Fl.controlPaddingXSmall,small:Fl.controlPaddingXSmall,default:Fl.controlPaddingX},vI=yl(tI,{shouldForwardProp:e=>"hasCustomRenderProp"!==e,target:"e1p3eej77"})((({size:e,hasCustomRenderProp:t})=>Nl("display:block;background-color:",zl.theme.background,";border:none;color:",zl.theme.foreground,";cursor:pointer;font-family:inherit;text-align:start;user-select:none;width:100%;&[data-focus-visible]{outline:none;}",((e,t)=>{const n={compact:{[t]:32,paddingInlineStart:gI.compact,paddingInlineEnd:gI.compact+18},default:{[t]:40,paddingInlineStart:gI.default,paddingInlineEnd:gI.default+18},small:{[t]:24,paddingInlineStart:gI.small,paddingInlineEnd:gI.small+18}};return n[e]||n.default})(e,t?"minHeight":"height")," ",!t&&wI," ",eb({inputSize:e}),";","")),""),bI=Tl({"0%":{opacity:0,transform:`translateY(-${fI})`},"100%":{opacity:1,transform:"translateY(0)"}}),xI=yl(iI,{target:"e1p3eej76"})("display:flex;flex-direction:column;background-color:",zl.theme.background,";border-radius:",Fl.radiusSmall,";border:1px solid ",zl.theme.foreground,";box-shadow:",Fl.elevationMedium,";z-index:1000000;max-height:min( var( --popover-available-height, 400px ), 400px );overflow:auto;overscroll-behavior:contain;min-width:min-content;&[data-open]{@media not ( prefers-reduced-motion ){animation-duration:",hI,";animation-timing-function:",mI,";animation-name:",bI,";will-change:transform,opacity;}}&[data-focus-visible]{outline:none;}"),yI=yl(aI,{target:"e1p3eej75"})((({size:e})=>Nl("cursor:default;display:flex;align-items:center;justify-content:space-between;font-size:",Fl.fontSize,";line-height:28px;padding-block:",Il(2),";scroll-margin:",Il(1),";user-select:none;&[aria-disabled='true']{cursor:not-allowed;}&[data-active-item]{background-color:",zl.theme.gray[300],";}",(e=>{const t={compact:{paddingInlineStart:gI.compact,paddingInlineEnd:gI.compact-6},default:{paddingInlineStart:gI.default,paddingInlineEnd:gI.default-6},small:{paddingInlineStart:gI.small,paddingInlineEnd:gI.small-6}};return t[e]||t.default})(e),";","")),""),wI={name:"1h52dri",styles:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap"},_I=yl("div",{target:"e1p3eej74"})(wI,";"),SI=yl("span",{target:"e1p3eej73"})("color:",zl.theme.gray[600],";margin-inline-start:",Il(2),";"),CI=yl("div",{target:"e1p3eej72"})("display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;flex:1;column-gap:",Il(4),";"),kI=yl("span",{target:"e1p3eej71"})("color:",zl.theme.gray[600],";text-align:initial;line-height:",Fl.fontLineHeightBase,";padding-inline-end:",Il(1),";margin-block:",Il(1),";"),jI=yl(pI,{target:"e1p3eej70"})("display:flex;align-items:center;margin-inline-start:",Il(2),";align-self:start;margin-block-start:2px;font-size:0;",CI,"~&,&:not(:empty){font-size:24px;}"),EI=(0,c.createContext)(void 0);function PI(e){return(Array.isArray(e)?0===e.length:null==e)?(0,a.__)("Select an item"):Array.isArray(e)?1===e.length?e[0]:(0,a.sprintf)((0,a.__)("%s items selected"),e.length):e}const NI=({renderSelectedValue:e,size:t="default",store:n,...r})=>{const{value:o}=et(n),i=(0,c.useMemo)((()=>null!=e?e:PI),[e]);return(0,_t.jsx)(vI,{...r,size:t,hasCustomRenderProp:!!e,store:n,children:i(o)})};const TI=function(e){const{children:t,hideLabelFromVision:n=!1,label:r,size:o,store:i,className:s,isLegacy:a=!1,...l}=e,u=(0,c.useCallback)((e=>{a&&e.stopPropagation()}),[a]),d=(0,c.useMemo)((()=>({store:i,size:o})),[i,o]);return(0,_t.jsxs)("div",{className:s,children:[(0,_t.jsx)(VT,{store:i,render:n?(0,_t.jsx)(Sl,{}):(0,_t.jsx)(Wx.VisualLabel,{as:"div"}),children:r}),(0,_t.jsxs)(vb,{__next40pxDefaultSize:!0,size:o,suffix:(0,_t.jsx)(sS,{}),children:[(0,_t.jsx)(NI,{...l,size:o,store:i,showOnKeyDown:!a}),(0,_t.jsx)(xI,{gutter:12,store:i,sameWidth:!0,slide:!1,onKeyDown:u,flip:!a,children:(0,_t.jsx)(EI.Provider,{value:d,children:t})})]})]})};function II({children:e,...t}){var n;const r=(0,c.useContext)(EI);return(0,_t.jsxs)(yI,{store:r?.store,size:null!==(n=r?.size)&&void 0!==n?n:"default",...t,children:[null!=e?e:t.value,(0,_t.jsx)(jI,{children:(0,_t.jsx)(oS,{icon:ok})})]})}II.displayName="CustomSelectControlV2.Item";const RI=II;function MI({__experimentalHint:e,...t}){return{hint:e,...t}}function AI(e,t){return t||(0,a.sprintf)((0,a.__)("Currently selected: %s"),e)}const DI=function e(t){const{__next40pxDefaultSize:n=!1,__shouldNotWarnDeprecated36pxSize:r,describedBy:o,options:i,onChange:a,size:c="default",value:u,className:d,showSelectedHint:p=!1,...f}=function({__experimentalShowSelectedHint:e,...t}){return{showSelectedHint:e,...t}}(t);Ux({componentName:"CustomSelectControl",__next40pxDefaultSize:n,size:c,__shouldNotWarnDeprecated36pxSize:r});const h=(0,l.useInstanceId)(e,"custom-select-control__description"),m=RT({async setValue(e){const t=i.find((t=>t.name===e));if(!a||!t)return;await Promise.resolve();const n=m.getState(),r={highlightedIndex:n.renderedItems.findIndex((t=>t.value===e)),inputValue:"",isOpen:n.open,selectedItem:t,type:""};a(r)},value:u?.name,defaultValue:i[0]?.name}),g=i.map(MI).map((({name:e,key:t,hint:n,style:r,className:o})=>{const i=(0,_t.jsxs)(CI,{children:[(0,_t.jsx)("span",{children:e}),(0,_t.jsx)(kI,{className:"components-custom-select-control__item-hint",children:n})]});return(0,_t.jsx)(RI,{value:e,children:n?i:e,style:r,className:s(o,"components-custom-select-control__item",{"has-hint":n})},t)})),v=et(m,"value"),b=n&&"default"===c||"__unstable-large"===c?"default":n||"default"!==c?c:"compact";return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(TI,{"aria-describedby":h,renderSelectedValue:p?()=>{const e=i?.map(MI)?.find((({name:e})=>v===e))?.hint;return(0,_t.jsxs)(_I,{children:[v,e&&(0,_t.jsx)(SI,{className:"components-custom-select-control__hint",children:e})]})}:void 0,size:b,store:m,className:s("components-custom-select-control",d),isLegacy:!0,...f,children:g}),(0,_t.jsx)(Sl,{children:(0,_t.jsx)("span",{id:h,children:AI(v,o)})})]})};function zI(e){const t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new e.constructor(+e):"number"==typeof e||"[object Number]"===t||"string"==typeof e||"[object String]"===t?new Date(e):new Date(NaN)}function OI(e){const t=zI(e);return t.setHours(0,0,0,0),t}function LI(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function FI(e,t){const n=zI(e);if(isNaN(t))return LI(e,NaN);if(!t)return n;const r=n.getDate(),o=LI(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);return r>=o.getDate()?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}function BI(e,t){return FI(e,-t)}const VI={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function $I(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const HI={date:$I({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:$I({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:$I({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},WI={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function UI(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,o=n?.width?String(n.width):t;r=e.formattingValues[o]||e.formattingValues[t]}else{const t=e.defaultWidth,o=n?.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const GI={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:UI({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:UI({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:UI({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:UI({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:UI({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function KI(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(a,(e=>e.test(s))):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(a,(e=>e.test(s)));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:t.slice(s.length)}}}const qI={ordinalNumber:(YI={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(YI.matchPattern);if(!n)return null;const r=n[0],o=e.match(YI.parsePattern);if(!o)return null;let i=YI.valueCallback?YI.valueCallback(o[0]):o[0];return i=t.valueCallback?t.valueCallback(i):i,{value:i,rest:e.slice(r.length)}}),era:KI({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:KI({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:KI({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:KI({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:KI({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var YI;const XI={code:"en-US",formatDistance:(e,t,n)=>{let r;const o=VI[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:HI,formatRelative:(e,t,n,r)=>WI[e],localize:GI,match:qI,options:{weekStartsOn:0,firstWeekContainsDate:1}};let ZI={};function QI(){return ZI}Math.pow(10,8);const JI=6048e5;function eR(e){const t=zI(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function tR(e,t){const n=OI(e),r=OI(t),o=+n-eR(n),i=+r-eR(r);return Math.round((o-i)/864e5)}function nR(e){const t=zI(e),n=LI(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function rR(e){const t=zI(e);return tR(t,nR(t))+1}function oR(e,t){const n=QI(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=zI(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function iR(e){return oR(e,{weekStartsOn:1})}function sR(e){const t=zI(e),n=t.getFullYear(),r=LI(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=iR(r),i=LI(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=iR(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function aR(e){const t=sR(e),n=LI(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),iR(n)}function lR(e){const t=zI(e),n=+iR(t)-+aR(t);return Math.round(n/JI)+1}function cR(e,t){const n=zI(e),r=n.getFullYear(),o=QI(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,s=LI(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=oR(s,t),l=LI(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=oR(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function uR(e,t){const n=QI(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=cR(e,t),i=LI(e,0);i.setFullYear(o,0,r),i.setHours(0,0,0,0);return oR(i,t)}function dR(e,t){const n=zI(e),r=+oR(n,t)-+uR(n,t);return Math.round(r/JI)+1}function pR(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const fR={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return pR("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):pR(n+1,2)},d:(e,t)=>pR(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>pR(e.getHours()%12||12,t.length),H:(e,t)=>pR(e.getHours(),t.length),m:(e,t)=>pR(e.getMinutes(),t.length),s:(e,t)=>pR(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return pR(Math.trunc(r*Math.pow(10,n-3)),t.length)}},hR="midnight",mR="noon",gR="morning",vR="afternoon",bR="evening",xR="night",yR={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return fR.y(e,t)},Y:function(e,t,n,r){const o=cR(e,r),i=o>0?o:1-o;if("YY"===t){return pR(i%100,2)}return"Yo"===t?n.ordinalNumber(i,{unit:"year"}):pR(i,t.length)},R:function(e,t){return pR(sR(e),t.length)},u:function(e,t){return pR(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return pR(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return pR(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return fR.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return pR(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const o=dR(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):pR(o,t.length)},I:function(e,t,n){const r=lR(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):pR(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):fR.d(e,t)},D:function(e,t,n){const r=rR(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):pR(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return pR(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return pR(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return pR(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(o=12===r?mR:0===r?hR:r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(o=r>=17?bR:r>=12?vR:r>=4?gR:xR,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return fR.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):fR.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):pR(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):pR(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):fR.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):fR.s(e,t)},S:function(e,t){return fR.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return _R(r);case"XXXX":case"XX":return SR(r);default:return SR(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return _R(r);case"xxxx":case"xx":return SR(r);default:return SR(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+wR(r,":");default:return"GMT"+SR(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+wR(r,":");default:return"GMT"+SR(r,":")}},t:function(e,t,n){return pR(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return pR(e.getTime(),t.length)}};function wR(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return 0===i?n+String(o):n+String(o)+t+pR(i,2)}function _R(e,t){if(e%60==0){return(e>0?"-":"+")+pR(Math.abs(e)/60,2)}return SR(e,t)}function SR(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+pR(Math.trunc(r/60),2)+t+pR(r%60,2)}const CR=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},kR=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},jR={p:kR,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return CR(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"})}return i.replace("{{date}}",CR(r,t)).replace("{{time}}",kR(o,t))}},ER=/^D+$/,PR=/^Y+$/,NR=["D","DD","YY","YYYY"];function TR(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function IR(e){if(!TR(e)&&"number"!=typeof e)return!1;const t=zI(e);return!isNaN(Number(t))}const RR=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,MR=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,AR=/^'([^]*?)'?$/,DR=/''/g,zR=/[a-zA-Z]/;function OR(e,t,n){const r=QI(),o=n?.locale??r.locale??XI,i=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=zI(e);if(!IR(a))throw new RangeError("Invalid time value");let l=t.match(MR).map((e=>{const t=e[0];if("p"===t||"P"===t){return(0,jR[t])(e,o.formatLong)}return e})).join("").match(RR).map((e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:LR(e)};if(yR[t])return{isToken:!0,value:e};if(t.match(zR))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}}));o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map((r=>{if(!r.isToken)return r.value;const i=r.value;(!n?.useAdditionalWeekYearTokens&&function(e){return PR.test(e)}(i)||!n?.useAdditionalDayOfYearTokens&&function(e){return ER.test(e)}(i))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),NR.includes(e))throw new RangeError(r)}(i,t,String(e));return(0,yR[i[0]])(a,i,o.localize,c)})).join("")}function LR(e){const t=e.match(AR);return t?t[1].replace(DR,"'"):e}function FR(e,t){const n=zI(e),r=zI(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function BR(e,t){return+zI(e)==+zI(t)}function VR(e,t){return+OI(e)==+OI(t)}function $R(e,t){const n=zI(e);return isNaN(t)?LI(e,NaN):t?(n.setDate(n.getDate()+t),n):n}function HR(e,t){return $R(e,7*t)}function WR(e,t){return HR(e,-t)}function UR(e,t){const n=QI(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,o=zI(e),i=o.getDay(),s=6+(i<r?-7:0)-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}const GR=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),KR=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})}),qR=window.wp.date;function YR(e,t){const n=zI(e),r=zI(t);return n.getTime()>r.getTime()}function XR(e,t){return+zI(e)<+zI(t)}function ZR(e){const t=zI(e),n=t.getFullYear(),r=t.getMonth(),o=LI(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function QR(e,t){const n=zI(e),r=n.getFullYear(),o=n.getDate(),i=LI(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=ZR(i);return n.setMonth(t,Math.min(o,s)),n}function JR(e,t){let n=zI(e);return isNaN(+n)?LI(e,NaN):(null!=t.year&&n.setFullYear(t.year),null!=t.month&&(n=QR(n,t.month)),null!=t.date&&n.setDate(t.date),null!=t.hours&&n.setHours(t.hours),null!=t.minutes&&n.setMinutes(t.minutes),null!=t.seconds&&n.setSeconds(t.seconds),null!=t.milliseconds&&n.setMilliseconds(t.milliseconds),n)}function eM(){return OI(Date.now())}function tM(e,t){const n=zI(e);return isNaN(+n)?LI(e,NaN):(n.setFullYear(t),n)}function nM(e,t){return FI(e,12*t)}function rM(e,t){return nM(e,-t)}function oM(e,t){const n=zI(e.start),r=zI(e.end);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0);let a=t?.step??1;if(!a)return[];a<0&&(a=-a,o=!o);const l=[];for(;+s<=i;)l.push(zI(s)),s.setDate(s.getDate()+a),s.setHours(0,0,0,0);return o?l.reverse():l}function iM(e,t){const n=zI(e.start),r=zI(e.end);let o=+n>+r;const i=o?+n:+r,s=o?r:n;s.setHours(0,0,0,0),s.setDate(1);let a=t?.step??1;if(!a)return[];a<0&&(a=-a,o=!o);const l=[];for(;+s<=i;)l.push(zI(s)),s.setMonth(s.getMonth()+a);return o?l.reverse():l}function sM(e){const t=zI(e);return t.setDate(1),t.setHours(0,0,0,0),t}function aM(e){const t=zI(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function lM(e,t){const n=zI(e.start),r=zI(e.end);let o=+n>+r;const i=oR(o?r:n,t),s=oR(o?n:r,t);i.setHours(15),s.setHours(15);const a=+s.getTime();let l=i,c=t?.step??1;if(!c)return[];c<0&&(c=-c,o=!o);const u=[];for(;+l<=a;)l.setHours(0),u.push(zI(l)),l=HR(l,c),l.setHours(15);return o?u.reverse():u}let cM=function(e){return e[e.SUNDAY=0]="SUNDAY",e[e.MONDAY=1]="MONDAY",e[e.TUESDAY=2]="TUESDAY",e[e.WEDNESDAY=3]="WEDNESDAY",e[e.THURSDAY=4]="THURSDAY",e[e.FRIDAY=5]="FRIDAY",e[e.SATURDAY=6]="SATURDAY",e}({});const uM=(e,t,n)=>(BR(e,t)||YR(e,t))&&(BR(e,n)||XR(e,n)),dM=e=>JR(e,{hours:0,minutes:0,seconds:0,milliseconds:0}),pM=yl("div",{target:"e105ri6r5"})(Rx,";"),fM=yl(fy,{target:"e105ri6r4"})("margin-bottom:",Il(4),";"),hM=yl(mk,{target:"e105ri6r3"})("font-size:",Fl.fontSize,";font-weight:",Fl.fontWeight,";strong{font-weight:",Fl.fontWeightHeading,";}"),mM=yl("div",{target:"e105ri6r2"})("column-gap:",Il(2),";display:grid;grid-template-columns:0.5fr repeat( 5, 1fr ) 0.5fr;justify-items:center;row-gap:",Il(2),";"),gM=yl("div",{target:"e105ri6r1"})("color:",zl.theme.gray[700],";font-size:",Fl.fontSize,";line-height:",Fl.fontLineHeightBase,";&:nth-of-type( 1 ){justify-self:start;}&:nth-of-type( 7 ){justify-self:end;}"),vM=yl(Jx,{shouldForwardProp:e=>!["column","isSelected","isToday","hasEvents"].includes(e),target:"e105ri6r0"})("grid-column:",(e=>e.column),";position:relative;justify-content:center;",(e=>1===e.column&&"\n\t\tjustify-self: start;\n\t\t")," ",(e=>7===e.column&&"\n\t\tjustify-self: end;\n\t\t")," ",(e=>e.disabled&&"\n\t\tpointer-events: none;\n\t\t")," &&&{border-radius:",Fl.radiusRound,";height:",Il(7),";width:",Il(7),";",(e=>e.isSelected&&`\n\t\t\t\tbackground: ${zl.theme.accent};\n\n\t\t\t\t&,\n\t\t\t\t&:hover:not(:disabled, [aria-disabled=true]) {\n\t\t\t\t\tcolor: ${zl.theme.accentInverted};\n\t\t\t\t}\n\n\t\t\t\t&:focus:not(:disabled),\n\t\t\t\t&:focus:not(:disabled) {\n\t\t\t\t\tborder: ${Fl.borderWidthFocus} solid currentColor;\n\t\t\t\t}\n\n\t\t\t\t/* Highlight the selected day for high-contrast mode */\n\t\t\t\t&::after {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\tinset: 0;\n\t\t\t\t\tborder-radius: inherit;\n\t\t\t\t\tborder: 1px solid transparent;\n\t\t\t\t}\n\t\t\t`)," ",(e=>!e.isSelected&&e.isToday&&`\n\t\t\tbackground: ${zl.theme.gray[200]};\n\t\t\t`),";}",(e=>e.hasEvents&&`\n\t\t::before {\n\t\t\tborder: 2px solid ${e.isSelected?zl.theme.accentInverted:zl.theme.accent};\n\t\t\tborder-radius: ${Fl.radiusRound};\n\t\t\tcontent: " ";\n\t\t\tleft: 50%;\n\t\t\tposition: absolute;\n\t\t\ttransform: translate(-50%, 9px);\n\t\t}\n\t\t`),";");function bM(e){return"string"==typeof e?new Date(e):zI(e)}function xM(e,t){return t?(e%12+12)%24:e%12}function yM(e){return(t,n)=>{const r={...t};return n.type!==mx&&n.type!==Sx&&n.type!==wx||void 0!==r.value&&(r.value=r.value.toString().padStart(e,"0")),r}}function wM(e){var t;const n=null!==(t=e.target?.ownerDocument.defaultView?.HTMLInputElement)&&void 0!==t?t:HTMLInputElement;return e.target instanceof n&&e.target.validity.valid}const _M="yyyy-MM-dd'T'HH:mm:ss";function SM({day:e,column:t,isSelected:n,isFocusable:r,isFocusAllowed:o,isToday:i,isInvalid:s,numEvents:a,onClick:l,onKeyDown:u}){const d=(0,c.useRef)();return(0,c.useEffect)((()=>{d.current&&r&&o&&d.current.focus()}),[r]),(0,_t.jsx)(vM,{__next40pxDefaultSize:!0,ref:d,className:"components-datetime__date__day",disabled:s,tabIndex:r?0:-1,"aria-label":CM(e,n,a),column:t,isSelected:n,isToday:i,hasEvents:a>0,onClick:l,onKeyDown:u,children:(0,qR.dateI18n)("j",e,-e.getTimezoneOffset())})}function CM(e,t,n){const{formats:r}=(0,qR.getSettings)(),o=(0,qR.dateI18n)(r.date,e,-e.getTimezoneOffset());return t&&n>0?(0,a.sprintf)((0,a._n)("%1$s. Selected. There is %2$d event","%1$s. Selected. There are %2$d events",n),o,n):t?(0,a.sprintf)((0,a.__)("%1$s. Selected"),o):n>0?(0,a.sprintf)((0,a._n)("%1$s. There is %2$d event","%1$s. There are %2$d events",n),o,n):o}const kM=function({currentDate:e,onChange:t,events:n=[],isInvalidDate:r,onMonthPreviewed:o,startOfWeek:i=0}){const s=e?bM(e):new Date,{calendar:l,viewing:u,setSelected:d,setViewing:p,isSelected:f,viewPreviousMonth:h,viewNextMonth:m}=(({weekStartsOn:e=cM.SUNDAY,viewing:t=new Date,selected:n=[],numberOfMonths:r=1}={})=>{const[o,i]=(0,c.useState)(t),s=(0,c.useCallback)((()=>i(eM())),[i]),a=(0,c.useCallback)((e=>i((t=>QR(t,e)))),[]),l=(0,c.useCallback)((()=>i((e=>BI(e,1)))),[]),u=(0,c.useCallback)((()=>i((e=>FI(e,1)))),[]),d=(0,c.useCallback)((e=>i((t=>tM(t,e)))),[]),p=(0,c.useCallback)((()=>i((e=>rM(e,1)))),[]),f=(0,c.useCallback)((()=>i((e=>nM(e,1)))),[]),[h,m]=(0,c.useState)(n.map(dM)),g=(0,c.useCallback)((e=>h.findIndex((t=>BR(t,e)))>-1),[h]),v=(0,c.useCallback)(((e,t)=>{m(t?Array.isArray(e)?e:[e]:t=>t.concat(Array.isArray(e)?e:[e]))}),[]),b=(0,c.useCallback)((e=>m((t=>Array.isArray(e)?t.filter((t=>!e.map((e=>e.getTime())).includes(t.getTime()))):t.filter((t=>!BR(t,e)))))),[]),x=(0,c.useCallback)(((e,t)=>g(e)?b(e):v(e,t)),[b,g,v]),y=(0,c.useCallback)(((e,t,n)=>{m(n?oM({start:e,end:t}):n=>n.concat(oM({start:e,end:t})))}),[]),w=(0,c.useCallback)(((e,t)=>{m((n=>n.filter((n=>!oM({start:e,end:t}).map((e=>e.getTime())).includes(n.getTime())))))}),[]),_=(0,c.useMemo)((()=>iM({start:sM(o),end:aM(FI(o,r-1))}).map((t=>lM({start:sM(t),end:aM(t)},{weekStartsOn:e}).map((t=>oM({start:oR(t,{weekStartsOn:e}),end:UR(t,{weekStartsOn:e})})))))),[o,e,r]);return{clearTime:dM,inRange:uM,viewing:o,setViewing:i,viewToday:s,viewMonth:a,viewPreviousMonth:l,viewNextMonth:u,viewYear:d,viewPreviousYear:p,viewNextYear:f,selected:h,setSelected:m,clearSelected:()=>m([]),isSelected:g,select:v,deselect:b,toggle:x,selectRange:y,deselectRange:w,calendar:_}})({selected:[OI(s)],viewing:OI(s),weekStartsOn:i}),[g,v]=(0,c.useState)(OI(s)),[b,x]=(0,c.useState)(!1),[y,w]=(0,c.useState)(e);return e!==y&&(w(e),d([OI(s)]),p(OI(s)),v(OI(s))),(0,_t.jsxs)(pM,{className:"components-datetime__date",role:"application","aria-label":(0,a.__)("Calendar"),children:[(0,_t.jsxs)(fM,{children:[(0,_t.jsx)(Jx,{icon:(0,a.isRTL)()?GR:KR,variant:"tertiary","aria-label":(0,a.__)("View previous month"),onClick:()=>{h(),v(BI(g,1)),o?.(OR(BI(u,1),_M))},size:"compact"}),(0,_t.jsxs)(hM,{level:3,children:[(0,_t.jsx)("strong",{children:(0,qR.dateI18n)("F",u,-u.getTimezoneOffset())})," ",(0,qR.dateI18n)("Y",u,-u.getTimezoneOffset())]}),(0,_t.jsx)(Jx,{icon:(0,a.isRTL)()?KR:GR,variant:"tertiary","aria-label":(0,a.__)("View next month"),onClick:()=>{m(),v(FI(g,1)),o?.(OR(FI(u,1),_M))},size:"compact"})]}),(0,_t.jsxs)(mM,{onFocus:()=>x(!0),onBlur:()=>x(!1),children:[l[0][0].map((e=>(0,_t.jsx)(gM,{children:(0,qR.dateI18n)("D",e,-e.getTimezoneOffset())},e.toString()))),l[0].map((e=>e.map(((e,i)=>FR(e,u)?(0,_t.jsx)(SM,{day:e,column:i+1,isSelected:f(e),isFocusable:BR(e,g),isFocusAllowed:b,isToday:VR(e,new Date),isInvalid:!!r&&r(e),numEvents:n.filter((t=>VR(t.date,e))).length,onClick:()=>{d([e]),v(e),t?.(OR(new Date(e.getFullYear(),e.getMonth(),e.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()),_M))},onKeyDown:t=>{let n;"ArrowLeft"===t.key&&(n=$R(e,(0,a.isRTL)()?1:-1)),"ArrowRight"===t.key&&(n=$R(e,(0,a.isRTL)()?-1:1)),"ArrowUp"===t.key&&(n=WR(e,1)),"ArrowDown"===t.key&&(n=HR(e,1)),"PageUp"===t.key&&(n=BI(e,1)),"PageDown"===t.key&&(n=FI(e,1)),"Home"===t.key&&(n=oR(e)),"End"===t.key&&(n=OI(UR(e))),n&&(t.preventDefault(),v(n),FR(n,u)||(p(n),o?.(OR(n,_M))))}},e.toString()):null))))]})]})};function jM(e){const t=zI(e);return t.setSeconds(0,0),t}const EM=yl("div",{target:"evcr2319"})("box-sizing:border-box;font-size:",Fl.fontSize,";"),PM=yl("fieldset",{target:"evcr2318"})("border:0;margin:0 0 ",Il(4)," 0;padding:0;&:last-child{margin-bottom:0;}"),NM=yl("div",{target:"evcr2317"})({name:"pd0mhc",styles:"direction:ltr;display:flex"}),TM=Nl("&&& ",ib,"{padding-left:",Il(2),";padding-right:",Il(2),";text-align:center;}",""),IM=yl(gy,{target:"evcr2316"})(TM," width:",Il(9),";&&& ",ib,"{padding-right:0;}&&& ",Kv,"{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0;}"),RM=yl("span",{target:"evcr2315"})("border-top:",Fl.borderWidth," solid ",zl.gray[700],";border-bottom:",Fl.borderWidth," solid ",zl.gray[700],";font-size:",Fl.fontSize,";line-height:calc(\n\t\t",Fl.controlHeight," - ",Fl.borderWidth," * 2\n\t);display:inline-block;"),MM=yl(gy,{target:"evcr2314"})(TM," width:",Il(9),";&&& ",ib,"{padding-left:0;}&&& ",Kv,"{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0;}"),AM=yl("div",{target:"evcr2313"})({name:"1ff36h2",styles:"flex-grow:1"}),DM=yl(gy,{target:"evcr2312"})(TM," width:",Il(9),";"),zM=yl(gy,{target:"evcr2311"})(TM," width:",Il(14),";"),OM=yl("div",{target:"evcr2310"})({name:"ebu3jh",styles:"text-decoration:underline dotted"}),LM=()=>{const{timezone:e}=(0,qR.getSettings)(),t=(new Date).getTimezoneOffset()/60*-1;if(Number(e.offset)===t)return null;const n=Number(e.offset)>=0?"+":"",r=""!==e.abbr&&isNaN(Number(e.abbr))?e.abbr:`UTC${n}${e.offsetFormatted}`,o=e.string.replace("_"," "),i="UTC"===e.string?(0,a.__)("Coordinated Universal Time"):`(${r}) ${o}`;return 0===o.trim().length?(0,_t.jsx)(OM,{className:"components-datetime__timezone",children:r}):(0,_t.jsx)(ss,{placement:"top",text:i,children:(0,_t.jsx)(OM,{className:"components-datetime__timezone",children:r})})};const FM=(0,c.forwardRef)((function(e,t){const{label:n,...r}=e,o=r["aria-label"]||n;return(0,_t.jsx)(A_,{...r,"aria-label":o,ref:t,children:n})}));function BM({value:e,defaultValue:t,is12Hour:n,label:r,minutesProps:o,onChange:i}){const[l={hours:(new Date).getHours(),minutes:(new Date).getMinutes()},u]=f_({value:e,onChange:i,defaultValue:t}),d=l.hours<12?"AM":"PM";const p=l.hours%12||12;const f=e=>(t,{event:r})=>{if(!wM(r))return;const o=Number(t);u({...l,[e]:"hours"===e&&n?xM(o,"PM"===d):o})};const h=r?PM:c.Fragment;return(0,_t.jsxs)(h,{children:[r&&(0,_t.jsx)(Wx.VisualLabel,{as:"legend",children:r}),(0,_t.jsxs)(fy,{alignment:"left",expanded:!1,children:[(0,_t.jsxs)(NM,{className:"components-datetime__time-field components-datetime__time-field-time",children:[(0,_t.jsx)(IM,{className:"components-datetime__time-field-hours-input",label:(0,a.__)("Hours"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:String(n?p:l.hours).padStart(2,"0"),step:1,min:n?1:0,max:n?12:23,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:f("hours"),__unstableStateReducer:yM(2)}),(0,_t.jsx)(RM,{className:"components-datetime__time-separator","aria-hidden":"true",children:":"}),(0,_t.jsx)(MM,{className:s("components-datetime__time-field-minutes-input",o?.className),label:(0,a.__)("Minutes"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:String(l.minutes).padStart(2,"0"),step:1,min:0,max:59,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:(...e)=>{f("minutes")(...e),o?.onChange?.(...e)},__unstableStateReducer:yM(2),...o})]}),n&&(0,_t.jsxs)(x_,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,isBlock:!0,label:(0,a.__)("Select AM or PM"),hideLabelFromVision:!0,value:d,onChange:e=>{var t;(t=e,()=>{d!==t&&u({...l,hours:xM(p,"PM"===t)})})()},children:[(0,_t.jsx)(FM,{value:"AM",label:(0,a.__)("AM")}),(0,_t.jsx)(FM,{value:"PM",label:(0,a.__)("PM")})]})]})]})}const VM=["dmy","mdy","ymd"];function $M({is12Hour:e,currentTime:t,onChange:n,dateOrder:r,hideLabelFromVision:o=!1}){const[i,s]=(0,c.useState)((()=>t?jM(bM(t)):new Date));(0,c.useEffect)((()=>{s(t?jM(bM(t)):new Date)}),[t]);const l=[{value:"01",label:(0,a.__)("January")},{value:"02",label:(0,a.__)("February")},{value:"03",label:(0,a.__)("March")},{value:"04",label:(0,a.__)("April")},{value:"05",label:(0,a.__)("May")},{value:"06",label:(0,a.__)("June")},{value:"07",label:(0,a.__)("July")},{value:"08",label:(0,a.__)("August")},{value:"09",label:(0,a.__)("September")},{value:"10",label:(0,a.__)("October")},{value:"11",label:(0,a.__)("November")},{value:"12",label:(0,a.__)("December")}],{day:u,month:d,year:p,minutes:f,hours:h}=(0,c.useMemo)((()=>({day:OR(i,"dd"),month:OR(i,"MM"),year:OR(i,"yyyy"),minutes:OR(i,"mm"),hours:OR(i,"HH"),am:OR(i,"a")})),[i]),m=e=>(t,{event:r})=>{if(!wM(r))return;const o=Number(t),a=JR(i,{[e]:o});s(a),n?.(OR(a,_M))},g=(0,_t.jsx)(DM,{className:"components-datetime__time-field components-datetime__time-field-day",label:(0,a.__)("Day"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:u,step:1,min:1,max:31,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("date")},"day"),v=(0,_t.jsx)(AM,{children:(0,_t.jsx)(cS,{className:"components-datetime__time-field components-datetime__time-field-month",label:(0,a.__)("Month"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,value:d,options:l,onChange:e=>{const t=QR(i,Number(e)-1);s(t),n?.(OR(t,_M))}})},"month"),b=(0,_t.jsx)(zM,{className:"components-datetime__time-field components-datetime__time-field-year",label:(0,a.__)("Year"),hideLabelFromVision:!0,__next40pxDefaultSize:!0,value:p,step:1,min:1,max:9999,required:!0,spinControls:"none",isPressEnterToChange:!0,isDragEnabled:!1,isShiftStepEnabled:!1,onChange:m("year"),__unstableStateReducer:yM(4)},"year"),x=e?"mdy":"dmy",y=(r&&VM.includes(r)?r:x).split("").map((e=>{switch(e){case"d":return g;case"m":return v;case"y":return b;default:return null}}));return(0,_t.jsxs)(EM,{className:"components-datetime__time",children:[(0,_t.jsxs)(PM,{children:[o?(0,_t.jsx)(Sl,{as:"legend",children:(0,a.__)("Time")}):(0,_t.jsx)(Wx.VisualLabel,{as:"legend",className:"components-datetime__time-legend",children:(0,a.__)("Time")}),(0,_t.jsxs)(fy,{className:"components-datetime__time-wrapper",children:[(0,_t.jsx)(BM,{value:{hours:Number(h),minutes:Number(f)},is12Hour:e,onChange:({hours:e,minutes:t})=>{const r=JR(i,{hours:e,minutes:t});s(r),n?.(OR(r,_M))}}),(0,_t.jsx)(zg,{}),(0,_t.jsx)(LM,{})]})]}),(0,_t.jsxs)(PM,{children:[o?(0,_t.jsx)(Sl,{as:"legend",children:(0,a.__)("Date")}):(0,_t.jsx)(Wx.VisualLabel,{as:"legend",className:"components-datetime__time-legend",children:(0,a.__)("Date")}),(0,_t.jsx)(fy,{className:"components-datetime__time-wrapper",children:y})]})]})}$M.TimeInput=BM,Object.assign($M.TimeInput,{displayName:"TimePicker.TimeInput"});const HM=$M;const WM=yl(pk,{target:"e1p5onf00"})({name:"1khn195",styles:"box-sizing:border-box"}),UM=()=>{};const GM=(0,c.forwardRef)((function({currentDate:e,is12Hour:t,dateOrder:n,isInvalidDate:r,onMonthPreviewed:o=UM,onChange:i,events:s,startOfWeek:a},l){return(0,_t.jsx)(WM,{ref:l,className:"components-datetime",spacing:4,children:(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(HM,{currentTime:e,onChange:i,is12Hour:t,dateOrder:n}),(0,_t.jsx)(kM,{currentDate:e,onChange:i,isInvalidDate:r,events:s,onMonthPreviewed:o,startOfWeek:a})]})})})),KM=GM,qM=[{name:(0,a._x)("None","Size of a UI element"),slug:"none"},{name:(0,a._x)("Small","Size of a UI element"),slug:"small"},{name:(0,a._x)("Medium","Size of a UI element"),slug:"medium"},{name:(0,a._x)("Large","Size of a UI element"),slug:"large"},{name:(0,a._x)("Extra Large","Size of a UI element"),slug:"xlarge"}],YM={BaseControl:{_overrides:{__associatedWPComponentName:"DimensionControl"}}};const XM=function(e){const{__next40pxDefaultSize:t=!1,__nextHasNoMarginBottom:n=!1,label:r,value:o,sizes:i=qM,icon:l,onChange:c,className:u=""}=e;Xi()("wp.components.DimensionControl",{since:"6.7",version:"7.0"}),Ux({componentName:"DimensionControl",__next40pxDefaultSize:t,size:void 0});const d=(0,_t.jsxs)(_t.Fragment,{children:[l&&(0,_t.jsx)(Xx,{icon:l}),r]});return(0,_t.jsx)(gs,{value:YM,children:(0,_t.jsx)(cS,{__next40pxDefaultSize:t,__shouldNotWarnDeprecated36pxSize:!0,__nextHasNoMarginBottom:n,className:s(u,"block-editor-dimension-control"),label:d,hideLabelFromVision:!1,value:o,onChange:e=>{const t=((e,t)=>e.find((e=>t===e.slug)))(i,e);t&&o!==t.slug?"function"==typeof c&&c(t.slug):c?.(void 0)},options:(e=>{const t=e.map((({name:e,slug:t})=>({label:e,value:t})));return[{label:(0,a.__)("Default"),value:""},...t]})(i)})})};const ZM={name:"u2jump",styles:"position:relative;pointer-events:none;&::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;}*{pointer-events:none;}"},QM=(0,c.createContext)(!1),{Consumer:JM,Provider:eA}=QM;function tA({className:e,children:t,isDisabled:n=!0,...r}){const o=il();return(0,_t.jsx)(eA,{value:n,children:(0,_t.jsx)("div",{inert:n?"true":void 0,className:n?o(ZM,e,"components-disabled"):void 0,...r,children:t})})}tA.Context=QM,tA.Consumer=JM;const nA=tA,rA=(0,c.forwardRef)((({visible:e,children:t,...n},r)=>{const o=Yn({open:e});return(0,_t.jsx)(Jr,{store:o,ref:r,...n,children:t})})),oA="is-dragging-components-draggable";const iA=function({children:e,onDragStart:t,onDragOver:n,onDragEnd:r,appendToOwnerDocument:o=!1,cloneClassname:i,elementId:s,transferData:a,__experimentalTransferDataType:u="text",__experimentalDragComponent:d}){const p=(0,c.useRef)(null),f=(0,c.useRef)((()=>{}));return(0,c.useEffect)((()=>()=>{f.current()}),[]),(0,_t.jsxs)(_t.Fragment,{children:[e({onDraggableStart:function(e){const{ownerDocument:r}=e.target;e.dataTransfer.setData(u,JSON.stringify(a));const c=r.createElement("div");c.style.top="0",c.style.left="0";const d=r.createElement("div");"function"==typeof e.dataTransfer.setDragImage&&(d.classList.add("components-draggable__invisible-drag-image"),r.body.appendChild(d),e.dataTransfer.setDragImage(d,0,0)),c.classList.add("components-draggable__clone"),i&&c.classList.add(i);let h=0,m=0;if(p.current){h=e.clientX,m=e.clientY,c.style.transform=`translate( ${h}px, ${m}px )`;const t=r.createElement("div");t.innerHTML=p.current.innerHTML,c.appendChild(t),r.body.appendChild(c)}else{const e=r.getElementById(s),t=e.getBoundingClientRect(),n=e.parentNode,i=t.top,a=t.left;c.style.width=`${t.width+0}px`;const l=e.cloneNode(!0);l.id=`clone-${s}`,h=a-0,m=i-0,c.style.transform=`translate( ${h}px, ${m}px )`,Array.from(l.querySelectorAll("iframe")).forEach((e=>e.parentNode?.removeChild(e))),c.appendChild(l),o?r.body.appendChild(c):n?.appendChild(c)}let g=e.clientX,v=e.clientY;const b=(0,l.throttle)((function(e){if(g===e.clientX&&v===e.clientY)return;const t=h+e.clientX-g,r=m+e.clientY-v;c.style.transform=`translate( ${t}px, ${r}px )`,g=e.clientX,v=e.clientY,h=t,m=r,n&&n(e)}),16);r.addEventListener("dragover",b),r.body.classList.add(oA),t&&t(e),f.current=()=>{c&&c.parentNode&&c.parentNode.removeChild(c),d&&d.parentNode&&d.parentNode.removeChild(d),r.body.classList.remove(oA),r.removeEventListener("dragover",b)}},onDraggableEnd:function(e){e.preventDefault(),f.current(),r&&r(e)}}),d&&(0,_t.jsx)("div",{className:"components-draggable-drag-component-root",style:{display:"none"},ref:p,children:d})]})},sA=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})});const aA=function({className:e,label:t,onFilesDrop:n,onHTMLDrop:r,onDrop:o,isEligible:i=()=>!0,...u}){const[d,p]=(0,c.useState)(),[f,h]=(0,c.useState)(),[m,g]=(0,c.useState)(),v=(0,l.__experimentalUseDropZone)({onDrop(e){if(!e.dataTransfer)return;const t=(0,bN.getFilesFromDataTransfer)(e.dataTransfer),i=e.dataTransfer.getData("text/html");i&&r?r(i):t.length&&n?n(t):o&&o(e)},onDragStart(e){p(!0),e.dataTransfer&&(e.dataTransfer.types.includes("text/html")?g(!!r):e.dataTransfer.types.includes("Files")||(0,bN.getFilesFromDataTransfer)(e.dataTransfer).length>0?g(!!n):g(!!o&&i(e.dataTransfer)))},onDragEnd(){h(!1),p(!1),g(void 0)},onDragEnter(){h(!0)},onDragLeave(){h(!1)}}),b=s("components-drop-zone",e,{"is-active":m,"is-dragging-over-document":d,"is-dragging-over-element":f});return(0,_t.jsx)("div",{...u,ref:v,className:b,children:(0,_t.jsx)("div",{className:"components-drop-zone__content",children:(0,_t.jsxs)("div",{className:"components-drop-zone__content-inner",children:[(0,_t.jsx)(oS,{icon:sA,className:"components-drop-zone__content-icon"}),(0,_t.jsx)("span",{className:"components-drop-zone__content-text",children:t||(0,a.__)("Drop files to upload")})]})})})};function lA({children:e}){return Xi()("wp.components.DropZoneProvider",{since:"5.8",hint:"wp.component.DropZone no longer needs a provider. wp.components.DropZoneProvider is safe to remove from your code."}),e}const cA=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M5 17.7c.4.5.8.9 1.2 1.2l1.1-1.4c-.4-.3-.7-.6-1-1L5 17.7zM5 6.3l1.4 1.1c.3-.4.6-.7 1-1L6.3 5c-.5.4-.9.8-1.3 1.3zm.1 7.8l-1.7.5c.2.6.4 1.1.7 1.6l1.5-.8c-.2-.4-.4-.8-.5-1.3zM4.8 12v-.7L3 11.1v1.8l1.7-.2c.1-.2.1-.5.1-.7zm3 7.9c.5.3 1.1.5 1.6.7l.5-1.7c-.5-.1-.9-.3-1.3-.5l-.8 1.5zM19 6.3c-.4-.5-.8-.9-1.2-1.2l-1.1 1.4c.4.3.7.6 1 1L19 6.3zm-.1 3.6l1.7-.5c-.2-.6-.4-1.1-.7-1.6l-1.5.8c.2.4.4.8.5 1.3zM5.6 8.6l-1.5-.8c-.3.5-.5 1-.7 1.6l1.7.5c.1-.5.3-.9.5-1.3zm2.2-4.5l.8 1.5c.4-.2.8-.4 1.3-.5l-.5-1.7c-.6.2-1.1.4-1.6.7zm8.8 13.5l1.1 1.4c.5-.4.9-.8 1.2-1.2l-1.4-1.1c-.2.3-.5.6-.9.9zm1.8-2.2l1.5.8c.3-.5.5-1.1.7-1.6l-1.7-.5c-.1.5-.3.9-.5 1.3zm2.6-4.3l-1.7.2v1.4l1.7.2V12v-.9zM11.1 3l.2 1.7h1.4l.2-1.7h-1.8zm3 2.1c.5.1.9.3 1.3.5l.8-1.5c-.5-.3-1.1-.5-1.6-.7l-.5 1.7zM12 19.2h-.7l-.2 1.8h1.8l-.2-1.7c-.2-.1-.5-.1-.7-.1zm2.1-.3l.5 1.7c.6-.2 1.1-.4 1.6-.7l-.8-1.5c-.4.2-.8.4-1.3.5z"})});function uA(e=[],t="90deg"){const n=100/e.length,r=e.map(((e,t)=>`${e} ${t*n}%, ${e} ${(t+1)*n}%`)).join(", ");return`linear-gradient( ${t}, ${r} )`}_v([Sv]);const dA=function({values:e}){return e?(0,_t.jsx)(F_,{colorValue:uA(e,"135deg")}):(0,_t.jsx)(Xx,{icon:cA})};function pA({label:e,value:t,colors:n,disableCustomColors:r,enableAlpha:o,onChange:i}){const[s,u]=(0,c.useState)(!1),d=(0,l.useInstanceId)(pA,"color-list-picker-option"),p=`${d}__label`,f=`${d}__content`;return(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,className:"components-color-list-picker__swatch-button",id:p,onClick:()=>u((e=>!e)),"aria-expanded":s,"aria-controls":f,icon:t?(0,_t.jsx)(F_,{colorValue:t,className:"components-color-list-picker__swatch-color"}):(0,_t.jsx)(Xx,{icon:cA}),text:e}),(0,_t.jsx)("div",{role:"group",id:f,"aria-labelledby":p,"aria-hidden":!s,children:s&&(0,_t.jsx)(jk,{"aria-label":(0,a.__)("Color options"),className:"components-color-list-picker__color-picker",colors:n,value:t,clearable:!1,onChange:i,disableCustomColors:r,enableAlpha:o})})]})}const fA=function({colors:e,labels:t,value:n=[],disableCustomColors:r,enableAlpha:o,onChange:i}){return(0,_t.jsx)("div",{className:"components-color-list-picker",children:t.map(((t,s)=>(0,_t.jsx)(pA,{label:t,value:n[s],colors:e,disableCustomColors:r,enableAlpha:o,onChange:e=>{const t=n.slice();t[s]=e,i(t)}},s)))})},hA=["#333","#CCC"];function mA({value:e,onChange:t}){const n=!!e,r=n?e:hA,o=uA(r),i=(s=r).map(((e,t)=>({position:100*t/(s.length-1),color:e})));var s;return(0,_t.jsx)(ZP,{disableInserter:!0,background:o,hasGradient:n,value:i,onChange:e=>{const n=function(e=[]){return e.map((({color:e})=>e))}(e);t(n)}})}const gA=function({asButtons:e,loop:t,clearable:n=!0,unsetable:r=!0,colorPalette:o,duotonePalette:i,disableCustomColors:s,disableCustomDuotone:l,value:u,onChange:d,"aria-label":p,"aria-labelledby":f,...h}){const[m,g]=(0,c.useMemo)((()=>{return!(e=o)||e.length<2?["#000","#fff"]:e.map((({color:e})=>({color:e,brightness:yv(e).brightness()}))).reduce((([e,t],n)=>[n.brightness<=e.brightness?n:e,n.brightness>=t.brightness?n:t]),[{brightness:1,color:""},{brightness:0,color:""}]).map((({color:e})=>e));var e}),[o]),v="unset"===u,b=(0,a.__)("Unset"),x=(0,_t.jsx)(uk.Option,{value:"unset",isSelected:v,tooltipText:b,"aria-label":b,className:"components-duotone-picker__color-indicator",onClick:()=>{d(v?void 0:"unset")}},"unset"),y=i.map((({colors:e,slug:t,name:n})=>{const r={background:uA(e,"135deg"),color:"transparent"},o=null!=n?n:(0,a.sprintf)((0,a.__)("Duotone code: %s"),t),i=n?(0,a.sprintf)((0,a.__)("Duotone: %s"),n):o,s=us()(e,u);return(0,_t.jsx)(uk.Option,{value:e,isSelected:s,"aria-label":i,tooltipText:o,style:r,onClick:()=>{d(s?void 0:e)}},t)})),{metaProps:w,labelProps:_}=dk(e,t,p,f),S=r?[x,...y]:y;return(0,_t.jsx)(uk,{...h,...w,..._,options:S,actions:!!n&&(0,_t.jsx)(uk.ButtonAction,{onClick:()=>d(void 0),accessibleWhenDisabled:!0,disabled:!u,children:(0,a.__)("Clear")}),children:(0,_t.jsx)(zg,{paddingTop:0===S.length?0:4,children:(0,_t.jsxs)(pk,{spacing:3,children:[!s&&!l&&(0,_t.jsx)(mA,{value:v?void 0:u,onChange:d}),!l&&(0,_t.jsx)(fA,{labels:[(0,a.__)("Shadows"),(0,a.__)("Highlights")],colors:o,value:v?void 0:u,disableCustomColors:s,enableAlpha:!0,onChange:e=>{e[0]||(e[0]=m),e[1]||(e[1]=g);const t=e.length>=2?e:void 0;d(t)}})]})})})};const vA=(0,c.forwardRef)((function(e,t){const{href:n,children:r,className:o,rel:i="",...l}=e,c=[...new Set([...i.split(" "),"external","noreferrer","noopener"].filter(Boolean))].join(" "),u=s("components-external-link",o),d=!!n?.startsWith("#");return(0,_t.jsxs)("a",{...l,className:u,href:n,onClick:t=>{d&&t.preventDefault(),e.onClick&&e.onClick(t)},target:"_blank",rel:c,ref:t,children:[(0,_t.jsx)("span",{className:"components-external-link__contents",children:r}),(0,_t.jsx)("span",{className:"components-external-link__icon","aria-label":(0,a.__)("(opens in a new tab)"),children:"↗"})]})})),bA={width:200,height:170},xA=["avi","mpg","mpeg","mov","mp4","m4v","ogg","ogv","webm","wmv"];function yA(e){return Math.round(100*e)}const wA=yl("div",{target:"eeew7dm8"})({name:"jqnsxy",styles:"background-color:transparent;display:flex;text-align:center;width:100%"}),_A=yl("div",{target:"eeew7dm7"})("align-items:center;border-radius:",Fl.radiusSmall,";cursor:pointer;display:inline-flex;justify-content:center;margin:auto;position:relative;height:100%;&:after{border-radius:inherit;bottom:0;box-shadow:inset 0 0 0 1px rgba( 0, 0, 0, 0.1 );content:'';left:0;pointer-events:none;position:absolute;right:0;top:0;}img,video{border-radius:inherit;box-sizing:border-box;display:block;height:auto;margin:0;max-height:100%;max-width:100%;pointer-events:none;user-select:none;width:auto;}"),SA=yl("div",{target:"eeew7dm6"})("background:",zl.gray[100],";border-radius:inherit;box-sizing:border-box;height:",bA.height,"px;max-width:280px;min-width:",bA.width,"px;width:100%;"),CA=yl(tj,{target:"eeew7dm5"})({name:"1d3w5wq",styles:"width:100%"});var kA={name:"1mn7kwb",styles:"padding-bottom:1em"};const jA=({__nextHasNoMarginBottom:e})=>e?void 0:kA;var EA={name:"1mn7kwb",styles:"padding-bottom:1em"};const PA=({hasHelpText:e=!1})=>e?EA:void 0,NA=yl(kg,{target:"eeew7dm4"})("max-width:320px;padding-top:1em;",PA," ",jA,";"),TA=yl("div",{target:"eeew7dm3"})("left:50%;overflow:hidden;pointer-events:none;position:absolute;top:50%;transform:translate3d( -50%, -50%, 0 );z-index:1;@media not ( prefers-reduced-motion ){transition:opacity 100ms linear;}opacity:",(({showOverlay:e})=>e?1:0),";"),IA=yl("div",{target:"eeew7dm2"})({name:"1yzbo24",styles:"background:rgba( 255, 255, 255, 0.4 );backdrop-filter:blur( 16px ) saturate( 180% );position:absolute;transform:translateZ( 0 )"}),RA=yl(IA,{target:"eeew7dm1"})({name:"1sw8ur",styles:"height:1px;left:1px;right:1px"}),MA=yl(IA,{target:"eeew7dm0"})({name:"188vg4t",styles:"width:1px;top:1px;bottom:1px"}),AA=()=>{};function DA({__nextHasNoMarginBottom:e,hasHelpText:t,onChange:n=AA,point:r={x:.5,y:.5}}){const o=yA(r.x),i=yA(r.y),s=(e,t)=>{if(void 0===e)return;const o=parseInt(e,10);isNaN(o)||n({...r,[t]:o/100})};return(0,_t.jsxs)(NA,{className:"focal-point-picker__controls",__nextHasNoMarginBottom:e,hasHelpText:t,gap:4,children:[(0,_t.jsx)(zA,{label:(0,a.__)("Left"),"aria-label":(0,a.__)("Focal point left position"),value:[o,"%"].join(""),onChange:e=>s(e,"x"),dragDirection:"e"}),(0,_t.jsx)(zA,{label:(0,a.__)("Top"),"aria-label":(0,a.__)("Focal point top position"),value:[i,"%"].join(""),onChange:e=>s(e,"y"),dragDirection:"s"})]})}function zA(e){return(0,_t.jsx)(CA,{__next40pxDefaultSize:!0,className:"focal-point-picker__controls-position-unit-control",labelPosition:"top",max:100,min:0,units:[{value:"%",label:"%"}],...e})}const OA=yl("div",{target:"e19snlhg0"})("background-color:transparent;cursor:grab;height:40px;margin:-20px 0 0 -20px;position:absolute;user-select:none;width:40px;will-change:transform;z-index:10000;background:rgba( 255, 255, 255, 0.4 );border:1px solid rgba( 255, 255, 255, 0.4 );border-radius:",Fl.radiusRound,";backdrop-filter:blur( 16px ) saturate( 180% );box-shadow:rgb( 0 0 0 / 10% ) 0px 0px 8px;@media not ( prefers-reduced-motion ){transition:transform 100ms linear;}",(({isDragging:e})=>e&&"\n\t\t\tbox-shadow: rgb( 0 0 0 / 12% ) 0px 0px 10px;\n\t\t\ttransform: scale( 1.1 );\n\t\t\tcursor: grabbing;\n\t\t\t"),";");function LA({left:e="50%",top:t="50%",...n}){const r={left:e,top:t};return(0,_t.jsx)(OA,{...n,className:"components-focal-point-picker__icon_container",style:r})}function FA({bounds:e,...t}){return(0,_t.jsxs)(TA,{...t,className:"components-focal-point-picker__grid",style:{width:e.width,height:e.height},children:[(0,_t.jsx)(RA,{style:{top:"33%"}}),(0,_t.jsx)(RA,{style:{top:"66%"}}),(0,_t.jsx)(MA,{style:{left:"33%"}}),(0,_t.jsx)(MA,{style:{left:"66%"}})]})}function BA({alt:e,autoPlay:t,src:n,onLoad:r,mediaRef:o,muted:i=!0,...s}){if(!n)return(0,_t.jsx)(SA,{className:"components-focal-point-picker__media components-focal-point-picker__media--placeholder",ref:o,...s});return function(e=""){return!!e&&(e.startsWith("data:video/")||xA.includes(function(e=""){const t=e.split(".");return t[t.length-1]}(e)))}(n)?(0,_t.jsx)("video",{...s,autoPlay:t,className:"components-focal-point-picker__media components-focal-point-picker__media--video",loop:!0,muted:i,onLoadedData:r,ref:o,src:n}):(0,_t.jsx)("img",{...s,alt:e,className:"components-focal-point-picker__media components-focal-point-picker__media--image",onLoad:r,ref:o,src:n})}const VA=function e({__nextHasNoMarginBottom:t,autoPlay:n=!0,className:r,help:o,label:i,onChange:u,onDrag:d,onDragEnd:p,onDragStart:f,resolvePoint:h,url:m,value:g={x:.5,y:.5},...v}){const[b,x]=(0,c.useState)(g),[y,w]=(0,c.useState)(!1),{startDrag:_,endDrag:S,isDragging:C}=(0,l.__experimentalUseDragging)({onDragStart:e=>{E.current?.focus();const t=I(e);t&&(f?.(t,e),x(t))},onDragMove:e=>{e.preventDefault();const t=I(e);t&&(d?.(t,e),x(t))},onDragEnd:()=>{p?.(),u?.(b)}}),{x:k,y:j}=C?b:g,E=(0,c.useRef)(null),[P,N]=(0,c.useState)(bA),T=(0,c.useRef)((()=>{if(!E.current)return;const{clientWidth:e,clientHeight:t}=E.current;N(e>0&&t>0?{width:e,height:t}:{...bA})}));(0,c.useEffect)((()=>{const e=T.current;if(!E.current)return;const{defaultView:t}=E.current.ownerDocument;return t?.addEventListener("resize",e),()=>t?.removeEventListener("resize",e)}),[]),(0,l.useIsomorphicLayoutEffect)((()=>{T.current()}),[]);const I=({clientX:e,clientY:t,shiftKey:n})=>{if(!E.current)return;const{top:r,left:o}=E.current.getBoundingClientRect();let i=(e-o)/P.width,s=(t-r)/P.height;return n&&(i=.1*Math.round(i/.1),s=.1*Math.round(s/.1)),R({x:i,y:s})},R=e=>{var t;const n=null!==(t=h?.(e))&&void 0!==t?t:e;n.x=Math.max(0,Math.min(n.x,1)),n.y=Math.max(0,Math.min(n.y,1));const r=e=>Math.round(100*e)/100;return{x:r(n.x),y:r(n.y)}},M={left:void 0!==k?k*P.width:.5*P.width,top:void 0!==j?j*P.height:.5*P.height},A=s("components-focal-point-picker-control",r),D=`inspector-focal-point-picker-control-${(0,l.useInstanceId)(e)}`;return fs((()=>{w(!0);const e=window.setTimeout((()=>{w(!1)}),600);return()=>window.clearTimeout(e)}),[k,j]),(0,_t.jsxs)(Wx,{...v,__nextHasNoMarginBottom:t,__associatedWPComponentName:"FocalPointPicker",label:i,id:D,help:o,className:A,children:[(0,_t.jsx)(wA,{className:"components-focal-point-picker-wrapper",children:(0,_t.jsxs)(_A,{className:"components-focal-point-picker",onKeyDown:e=>{const{code:t,shiftKey:n}=e;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t))return;e.preventDefault();const r={x:k,y:j},o=n?.1:.01,i="ArrowUp"===t||"ArrowLeft"===t?-1*o:o,s="ArrowUp"===t||"ArrowDown"===t?"y":"x";r[s]=r[s]+i,u?.(R(r))},onMouseDown:_,onBlur:()=>{C&&S()},ref:E,role:"button",tabIndex:-1,children:[(0,_t.jsx)(FA,{bounds:P,showOverlay:y}),(0,_t.jsx)(BA,{alt:(0,a.__)("Media preview"),autoPlay:n,onLoad:T.current,src:m}),(0,_t.jsx)(LA,{...M,isDragging:C})]})}),(0,_t.jsx)(DA,{__nextHasNoMarginBottom:t,hasHelpText:!!o,point:{x:k,y:j},onChange:e=>{u?.(R(e))}})]})};function $A({iframeRef:e,...t}){const n=(0,l.useMergeRefs)([e,(0,l.useFocusableIframe)()]);return Xi()("wp.components.FocusableIframe",{since:"5.9",alternative:"wp.compose.useFocusableIframe"}),(0,_t.jsx)("iframe",{ref:n,...t})}function HA(e){const[t,...n]=e;if(!t)return null;const[,r]=qk(t.size);return n.every((e=>{const[,t]=qk(e.size);return t===r}))?r:null}const WA=yl("fieldset",{target:"e8tqeku4"})({name:"k2q51s",styles:"border:0;margin:0;padding:0;display:contents"}),UA=yl(fy,{target:"e8tqeku3"})("height:",Il(4),";"),GA=yl(Jx,{target:"e8tqeku2"})("margin-top:",Il(-1),";"),KA=yl(Wx.VisualLabel,{target:"e8tqeku1"})("display:flex;gap:",Il(1),";justify-content:flex-start;margin-bottom:0;"),qA=yl("span",{target:"e8tqeku0"})("color:",zl.gray[700],";"),YA={key:"default",name:(0,a.__)("Default"),value:void 0},XA=e=>{var t;const{__next40pxDefaultSize:n,fontSizes:r,value:o,size:i,onChange:s}=e,l=!!HA(r),c=[YA,...r.map((e=>{let t;if(l){const[n]=qk(e.size);void 0!==n&&(t=String(n))}else(function(e){return/^[\d\.]+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i.test(String(e))})(e.size)&&(t=String(e.size));return{key:e.slug,name:e.name||e.slug,value:e.size,hint:t}}))],u=null!==(t=c.find((e=>e.value===o)))&&void 0!==t?t:YA;return(0,_t.jsx)(DI,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,className:"components-font-size-picker__select",label:(0,a.__)("Font size"),hideLabelFromVision:!0,describedBy:(0,a.sprintf)((0,a.__)("Currently selected font size: %s"),u.name),options:c,value:u,showSelectedHint:!0,onChange:({selectedItem:e})=>{s(e.value)},size:i})},ZA=[(0,a.__)("S"),(0,a.__)("M"),(0,a.__)("L"),(0,a.__)("XL"),(0,a.__)("XXL")],QA=[(0,a.__)("Small"),(0,a.__)("Medium"),(0,a.__)("Large"),(0,a.__)("Extra Large"),(0,a.__)("Extra Extra Large")],JA=e=>{const{fontSizes:t,value:n,__next40pxDefaultSize:r,size:o,onChange:i}=e;return(0,_t.jsx)(x_,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:r,__shouldNotWarnDeprecated36pxSize:!0,label:(0,a.__)("Font size"),hideLabelFromVision:!0,value:n,onChange:i,isBlock:!0,size:o,children:t.map(((e,t)=>(0,_t.jsx)(FM,{value:e.size,label:ZA[t],"aria-label":e.name||QA[t],showTooltip:!0},e.slug)))})},eD=["px","em","rem","vw","vh"],tD=(0,c.forwardRef)(((e,t)=>{const{__next40pxDefaultSize:n=!1,fallbackFontSize:r,fontSizes:o=[],disableCustomFontSizes:i=!1,onChange:s,size:l="default",units:u=eD,value:d,withSlider:p=!1,withReset:f=!0}=e,h=Yk({availableUnits:u}),m=o.find((e=>e.size===d)),g=!!d&&!m,[v,b]=(0,c.useState)(g);let x;x=!i&&v?"custom":o.length>5?"select":"togglegroup";const y=(0,c.useMemo)((()=>{switch(x){case"custom":return(0,a.__)("Custom");case"togglegroup":if(m)return m.name||QA[o.indexOf(m)];break;case"select":const e=HA(o);if(e)return`(${e})`}return""}),[x,m,o]);if(0===o.length&&i)return null;const w="string"==typeof d||"string"==typeof o[0]?.size,[_,S]=qk(d,h),C=!!S&&["em","rem","vw","vh"].includes(S),k=void 0===d;return Ux({componentName:"FontSizePicker",__next40pxDefaultSize:n,size:l}),(0,_t.jsxs)(WA,{ref:t,className:"components-font-size-picker",children:[(0,_t.jsx)(Sl,{as:"legend",children:(0,a.__)("Font size")}),(0,_t.jsx)(zg,{children:(0,_t.jsxs)(UA,{className:"components-font-size-picker__header",children:[(0,_t.jsxs)(KA,{"aria-label":`${(0,a.__)("Size")} ${y||""}`,children:[(0,a.__)("Size"),y&&(0,_t.jsx)(qA,{className:"components-font-size-picker__header__hint",children:y})]}),!i&&(0,_t.jsx)(GA,{label:"custom"===x?(0,a.__)("Use size preset"):(0,a.__)("Set custom size"),icon:jj,onClick:()=>b(!v),isPressed:"custom"===x,size:"small"})]})}),(0,_t.jsxs)("div",{children:["select"===x&&(0,_t.jsx)(XA,{__next40pxDefaultSize:n,fontSizes:o,value:d,disableCustomFontSizes:i,size:l,onChange:e=>{void 0===e?s?.(void 0):s?.(w?e:Number(e),o.find((t=>t.size===e)))},onSelectCustom:()=>b(!0)}),"togglegroup"===x&&(0,_t.jsx)(JA,{fontSizes:o,value:d,__next40pxDefaultSize:n,size:l,onChange:e=>{void 0===e?s?.(void 0):s?.(w?e:Number(e),o.find((t=>t.size===e)))}}),"custom"===x&&(0,_t.jsxs)(kg,{className:"components-font-size-picker__custom-size-control",children:[(0,_t.jsx)(Fg,{isBlock:!0,children:(0,_t.jsx)(tj,{__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,label:(0,a.__)("Custom"),labelPosition:"top",hideLabelFromVision:!0,value:d,onChange:e=>{b(!0),s?.(void 0===e?void 0:w?e:parseInt(e,10))},size:l,units:w?h:[],min:0})}),p&&(0,_t.jsx)(Fg,{isBlock:!0,children:(0,_t.jsx)(zg,{marginX:2,marginBottom:0,children:(0,_t.jsx)(ZS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:n,__shouldNotWarnDeprecated36pxSize:!0,className:"components-font-size-picker__custom-input",label:(0,a.__)("Custom Size"),hideLabelFromVision:!0,value:_,initialPosition:r,withInputField:!1,onChange:e=>{b(!0),s?.(void 0===e?void 0:w?e+(null!=S?S:"px"):e)},min:0,max:C?10:100,step:C?.1:1})})}),f&&(0,_t.jsx)(Fg,{children:(0,_t.jsx)(Qx,{disabled:k,accessibleWhenDisabled:!0,onClick:()=>{s?.(void 0)},variant:"secondary",__next40pxDefaultSize:!0,size:"__unstable-large"===l||e.__next40pxDefaultSize?"default":"small",children:(0,a.__)("Reset")})})]})]})]})})),nD=tD;const rD=function({accept:e,children:t,multiple:n=!1,onChange:r,onClick:o,render:i,...s}){const a=(0,c.useRef)(null),l=()=>{a.current?.click()};i||Ux({componentName:"FormFileUpload",__next40pxDefaultSize:s.__next40pxDefaultSize,size:s.size});const u=i?i({openFileDialog:l}):(0,_t.jsx)(Jx,{onClick:l,...s,children:t}),d=!(globalThis.window?.navigator.userAgent.includes("Safari")&&!globalThis.window?.navigator.userAgent.includes("Chrome")&&!globalThis.window?.navigator.userAgent.includes("Chromium"))&&e?.includes("image/*")?`${e}, image/heic, image/heif`:e;return(0,_t.jsxs)("div",{className:"components-form-file-upload",children:[u,(0,_t.jsx)("input",{type:"file",ref:a,multiple:n,style:{display:"none"},accept:d,onChange:r,onClick:o,"data-testid":"form-file-upload-input"})]})},oD=()=>{};const iD=(0,c.forwardRef)((function(e,t){const{className:n,checked:r,id:o,disabled:i,onChange:a=oD,...l}=e,c=s("components-form-toggle",n,{"is-checked":r,"is-disabled":i});return(0,_t.jsxs)("span",{className:c,children:[(0,_t.jsx)("input",{className:"components-form-toggle__input",id:o,type:"checkbox",checked:r,onChange:a,disabled:i,...l,ref:t}),(0,_t.jsx)("span",{className:"components-form-toggle__track"}),(0,_t.jsx)("span",{className:"components-form-toggle__thumb"})]})})),sD=iD,aD=()=>{};function lD({value:e,status:t,title:n,displayTransform:r,isBorderless:o=!1,disabled:i=!1,onClickRemove:c=aD,onMouseEnter:u,onMouseLeave:d,messages:p,termPosition:f,termsCount:h}){const m=(0,l.useInstanceId)(lD),g=s("components-form-token-field__token",{"is-error":"error"===t,"is-success":"success"===t,"is-validating":"validating"===t,"is-borderless":o,"is-disabled":i}),v=r(e),b=(0,a.sprintf)((0,a.__)("%1$s (%2$s of %3$s)"),v,f,h);return(0,_t.jsxs)("span",{className:g,onMouseEnter:u,onMouseLeave:d,title:n,children:[(0,_t.jsxs)("span",{className:"components-form-token-field__token-text",id:`components-form-token-field__token-text-${m}`,children:[(0,_t.jsx)(Sl,{as:"span",children:b}),(0,_t.jsx)("span",{"aria-hidden":"true",children:v})]}),(0,_t.jsx)(Jx,{className:"components-form-token-field__remove-token",size:"small",icon:UN,onClick:i?void 0:()=>c({value:e}),disabled:i,label:p.remove,"aria-describedby":`components-form-token-field__token-text-${m}`})]})}const cD=({__next40pxDefaultSize:e,hasTokens:t})=>!e&&Nl("padding-top:",Il(t?1:.5),";padding-bottom:",Il(t?1:.5),";",""),uD=yl(kg,{target:"ehq8nmi0"})("padding:7px;",Rx," ",cD,";"),dD=e=>e;const pD=function e(t){const{autoCapitalize:n,autoComplete:r,maxLength:o,placeholder:i,label:u=(0,a.__)("Add item"),className:d,suggestions:p=[],maxSuggestions:f=100,value:h=[],displayTransform:m=dD,saveTransform:g=e=>e.trim(),onChange:v=()=>{},onInputChange:b=()=>{},onFocus:x,isBorderless:y=!1,disabled:w=!1,tokenizeOnSpace:_=!1,messages:S={added:(0,a.__)("Item added."),removed:(0,a.__)("Item removed."),remove:(0,a.__)("Remove item"),__experimentalInvalid:(0,a.__)("Invalid item")},__experimentalRenderItem:C,__experimentalExpandOnFocus:k=!1,__experimentalValidateInput:j=()=>!0,__experimentalShowHowTo:E=!0,__next40pxDefaultSize:P=!1,__experimentalAutoSelectFirstMatch:N=!1,__nextHasNoMarginBottom:T=!1,tokenizeOnBlur:I=!1}=hb(t);T||Xi()("Bottom margin styles for wp.components.FormTokenField",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."}),Ux({componentName:"FormTokenField",size:void 0,__next40pxDefaultSize:P});const R=(0,l.useInstanceId)(e),[M,A]=(0,c.useState)(""),[D,z]=(0,c.useState)(0),[O,L]=(0,c.useState)(!1),[F,B]=(0,c.useState)(!1),[V,$]=(0,c.useState)(-1),[H,W]=(0,c.useState)(!1),U=(0,l.usePrevious)(p),G=(0,l.usePrevious)(h),K=(0,c.useRef)(null),q=(0,c.useRef)(null),Y=(0,l.useDebounce)(jy.speak,500);function X(){K.current?.focus()}function Z(){return K.current===K.current?.ownerDocument.activeElement}function Q(e){if(fe()&&j(M))L(!1),I&&fe()&&ae(M);else{if(A(""),z(0),L(!1),k){const t=e.relatedTarget===q.current;B(t)}else B(!1);$(-1),W(!1)}}function J(e){e.target===q.current&&O&&e.preventDefault()}function ee(e){le(e.value),X()}function te(e){const t=e.value,n=_?/[ ,\t]+/:/[,\t]+/,r=t.split(n),o=r[r.length-1]||"";r.length>1&&se(r.slice(0,-1)),A(o),b(o)}function ne(e){let t=!1;return Z()&&pe()&&(e(),t=!0),t}function re(){const e=de()-1;e>-1&&le(h[e])}function oe(){const e=de();e<h.length&&(le(h[e]),function(e){z(h.length-Math.max(e,-1)-1)}(e))}function ie(){let e=!1;const t=function(){if(-1!==V)return ue()[V];return}();return t?(ae(t),e=!0):fe()&&(ae(M),e=!0),e}function se(e){const t=[...new Set(e.map(g).filter(Boolean).filter((e=>!function(e){return h.some((t=>ce(e)===ce(t)))}(e))))];if(t.length>0){const e=[...h];e.splice(de(),0,...t),v(e)}}function ae(e){j(e)?(se([e]),(0,jy.speak)(S.added,"assertive"),A(""),$(-1),W(!1),B(!k),O&&!I&&X()):(0,jy.speak)(S.__experimentalInvalid,"assertive")}function le(e){const t=h.filter((t=>ce(t)!==ce(e)));v(t),(0,jy.speak)(S.removed,"assertive")}function ce(e){return"object"==typeof e?e.value:e}function ue(e=M,t=p,n=h,r=f,o=g){let i=o(e);const s=[],a=[],l=n.map((e=>"string"==typeof e?e:e.value));return 0===i.length?t=t.filter((e=>!l.includes(e))):(i=i.toLocaleLowerCase(),t.forEach((e=>{const t=e.toLocaleLowerCase().indexOf(i);-1===l.indexOf(e)&&(0===t?s.push(e):t>0&&a.push(e))})),t=s.concat(a)),t.slice(0,r)}function de(){return h.length-D}function pe(){return 0===M.length}function fe(){return g(M).length>0}function he(e=!0){const t=M.trim().length>1,n=ue(M),r=n.length>0,o=Z()&&k;if(B(o||t&&r),e&&(N&&t&&r?($(0),W(!0)):($(-1),W(!1))),t){const e=r?(0,a.sprintf)((0,a._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",n.length),n.length):(0,a.__)("No results.");Y(e,"assertive")}}function me(e,t,n){const r=ce(e),o="string"!=typeof e?e.status:void 0,i=t+1,s=n.length;return(0,_t.jsx)(Fg,{children:(0,_t.jsx)(lD,{value:r,status:o,title:"string"!=typeof e?e.title:void 0,displayTransform:m,onClickRemove:ee,isBorderless:"string"!=typeof e&&e.isBorderless||y,onMouseEnter:"string"!=typeof e?e.onMouseEnter:void 0,onMouseLeave:"string"!=typeof e?e.onMouseLeave:void 0,disabled:"error"!==o&&w,messages:S,termsCount:s,termPosition:i})},"token-"+r)}(0,c.useEffect)((()=>{O&&!Z()&&X()}),[O]),(0,c.useEffect)((()=>{const e=!pw()(p,U||[]);(e||h!==G)&&he(e)}),[p,U,h,G]),(0,c.useEffect)((()=>{he()}),[M]),(0,c.useEffect)((()=>{he()}),[N]),w&&O&&(L(!1),A(""));const ge=s(d,"components-form-token-field__input-container",{"is-active":O,"is-disabled":w});let ve={className:"components-form-token-field",tabIndex:-1};const be=ue();return w||(ve=Object.assign({},ve,{onKeyDown:jx((function(e){let t=!1;if(!e.defaultPrevented){switch(e.key){case"Backspace":t=ne(re);break;case"Enter":t=ie();break;case"ArrowLeft":t=function(){let e=!1;return pe()&&(z((e=>Math.min(e+1,h.length))),e=!0),e}();break;case"ArrowUp":$((e=>(0===e?ue(M,p,h,f,g).length:e)-1)),W(!0),t=!0;break;case"ArrowRight":t=function(){let e=!1;return pe()&&(z((e=>Math.max(e-1,0))),e=!0),e}();break;case"ArrowDown":$((e=>(e+1)%ue(M,p,h,f,g).length)),W(!0),t=!0;break;case"Delete":t=ne(oe);break;case"Space":_&&(t=ie());break;case"Escape":t=function(e){return e.target instanceof HTMLInputElement&&(A(e.target.value),B(!1),$(-1),W(!1)),!0}(e)}t&&e.preventDefault()}})),onKeyPress:function(e){let t=!1;","===e.key&&(fe()&&ae(M),t=!0);t&&e.preventDefault()},onFocus:function(e){Z()||e.target===q.current?(L(!0),B(k||F)):L(!1),"function"==typeof x&&x(e)}})),(0,_t.jsxs)("div",{...ve,children:[u&&(0,_t.jsx)(Ox,{htmlFor:`components-form-token-input-${R}`,className:"components-form-token-field__label",children:u}),(0,_t.jsxs)("div",{ref:q,className:ge,tabIndex:-1,onMouseDown:J,onTouchStart:J,children:[(0,_t.jsx)(uD,{justify:"flex-start",align:"center",gap:1,wrap:!0,__next40pxDefaultSize:P,hasTokens:!!h.length,children:function(){const e=h.map(me);return e.splice(de(),0,function(){const e={instanceId:R,autoCapitalize:n,autoComplete:r,placeholder:0===h.length?i:"",disabled:w,value:M,onBlur:Q,isExpanded:F,selectedSuggestionIndex:V};return(0,_t.jsx)(YN,{...e,onChange:o&&h.length>=o?void 0:te,ref:K},"input")}()),e}()}),F&&(0,_t.jsx)(ZN,{instanceId:R,match:g(M),displayTransform:m,suggestions:be,selectedIndex:V,scrollIntoView:H,onHover:function(e){const t=ue().indexOf(e);t>=0&&($(t),W(!1))},onSelect:function(e){ae(e)},__experimentalRenderItem:C})]}),!T&&(0,_t.jsx)(zg,{marginBottom:2}),E&&(0,_t.jsx)(Bx,{id:`components-form-token-suggestions-howto-${R}`,className:"components-form-token-field__help",__nextHasNoMarginBottom:T,children:_?(0,a.__)("Separate with commas, spaces, or the Enter key."):(0,a.__)("Separate with commas or the Enter key.")})]})},fD=()=>(0,_t.jsx)(n.SVG,{width:"8",height:"8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Circle,{cx:"4",cy:"4",r:"4"})});function hD({currentPage:e,numberOfPages:t,setCurrentPage:n}){return(0,_t.jsx)("ul",{className:"components-guide__page-control","aria-label":(0,a.__)("Guide controls"),children:Array.from({length:t}).map(((r,o)=>(0,_t.jsx)("li",{"aria-current":o===e?"step":void 0,children:(0,_t.jsx)(Jx,{size:"small",icon:(0,_t.jsx)(fD,{}),"aria-label":(0,a.sprintf)((0,a.__)("Page %1$d of %2$d"),o+1,t),onClick:()=>n(o)},o)},o)))})}const mD=function({children:e,className:t,contentLabel:n,finishButtonText:r=(0,a.__)("Finish"),onFinish:o,pages:i=[]}){const l=(0,c.useRef)(null),[u,d]=(0,c.useState)(0);var p;(0,c.useEffect)((()=>{const e=l.current?.querySelector(".components-guide");e instanceof HTMLElement&&e.focus()}),[u]),(0,c.useEffect)((()=>{c.Children.count(e)&&Xi()("Passing children to <Guide>",{since:"5.5",alternative:"the `pages` prop"})}),[e]),c.Children.count(e)&&(i=null!==(p=c.Children.map(e,(e=>({content:e}))))&&void 0!==p?p:[]);const f=u>0,h=u<i.length-1,m=()=>{f&&d(u-1)},g=()=>{h&&d(u+1)};return 0===i.length?null:(0,_t.jsx)(kT,{className:s("components-guide",t),contentLabel:n,isDismissible:i.length>1,onRequestClose:o,onKeyDown:e=>{"ArrowLeft"===e.code?(m(),e.preventDefault()):"ArrowRight"===e.code&&(g(),e.preventDefault())},ref:l,children:(0,_t.jsxs)("div",{className:"components-guide__container",children:[(0,_t.jsxs)("div",{className:"components-guide__page",children:[i[u].image,i.length>1&&(0,_t.jsx)(hD,{currentPage:u,numberOfPages:i.length,setCurrentPage:d}),i[u].content]}),(0,_t.jsxs)("div",{className:"components-guide__footer",children:[f&&(0,_t.jsx)(Jx,{className:"components-guide__back-button",variant:"tertiary",onClick:m,__next40pxDefaultSize:!0,children:(0,a.__)("Previous")}),h&&(0,_t.jsx)(Jx,{className:"components-guide__forward-button",variant:"primary",onClick:g,__next40pxDefaultSize:!0,children:(0,a.__)("Next")}),!h&&(0,_t.jsx)(Jx,{className:"components-guide__finish-button",variant:"primary",onClick:o,__next40pxDefaultSize:!0,children:r})]})]})})};function gD(e){return(0,c.useEffect)((()=>{Xi()("<GuidePage>",{since:"5.5",alternative:"the `pages` prop in <Guide>"})}),[]),(0,_t.jsx)("div",{...e})}const vD=(0,c.forwardRef)((function({label:e,labelPosition:t,size:n,tooltip:r,...o},i){return Xi()("wp.components.IconButton",{since:"5.4",alternative:"wp.components.Button",version:"6.2"}),(0,_t.jsx)(Jx,{...o,ref:i,tooltipPosition:t,iconSize:n,showTooltip:void 0!==r?!!r:void 0,label:r||e})}));function bD({target:e,callback:t,shortcut:n,bindGlobal:r,eventName:o}){return(0,l.useKeyboardShortcut)(n,t,{bindGlobal:r,target:e,eventName:o}),null}const xD=function({children:e,shortcuts:t,bindGlobal:n,eventName:r}){const o=(0,c.useRef)(null),i=Object.entries(null!=t?t:{}).map((([e,t])=>(0,_t.jsx)(bD,{shortcut:e,callback:t,bindGlobal:n,eventName:r,target:o},e)));return c.Children.count(e)?(0,_t.jsxs)("div",{ref:o,children:[i,e]}):(0,_t.jsx)(_t.Fragment,{children:i})};const yD=function e(t){const{children:n,className:r="",label:o,hideSeparator:i}=t,a=(0,l.useInstanceId)(e);if(!c.Children.count(n))return null;const u=`components-menu-group-label-${a}`,d=s(r,"components-menu-group",{"has-hidden-separator":i});return(0,_t.jsxs)("div",{className:d,children:[o&&(0,_t.jsx)("div",{className:"components-menu-group__label",id:u,"aria-hidden":"true",children:o}),(0,_t.jsx)("div",{role:"group","aria-labelledby":o?u:void 0,children:n})]})};const wD=(0,c.forwardRef)((function(e,t){let{children:n,info:r,className:o,icon:i,iconPosition:a="right",shortcut:l,isSelected:u,role:d="menuitem",suffix:p,...f}=e;return o=s("components-menu-item__button",o),r&&(n=(0,_t.jsxs)("span",{className:"components-menu-item__info-wrapper",children:[(0,_t.jsx)("span",{className:"components-menu-item__item",children:n}),(0,_t.jsx)("span",{className:"components-menu-item__info",children:r})]})),i&&"string"!=typeof i&&(i=(0,c.cloneElement)(i,{className:s("components-menu-items__item-icon",{"has-icon-right":"right"===a})})),(0,_t.jsxs)(Jx,{__next40pxDefaultSize:!0,ref:t,"aria-checked":"menuitemcheckbox"===d||"menuitemradio"===d?u:void 0,role:d,icon:"left"===a?i:void 0,className:o,...f,children:[(0,_t.jsx)("span",{className:"components-menu-item__item",children:n}),!p&&(0,_t.jsx)(Zi,{className:"components-menu-item__shortcut",shortcut:l}),!p&&i&&"right"===a&&(0,_t.jsx)(Xx,{icon:i}),p]})})),_D=wD,SD=()=>{};const CD=function({choices:e=[],onHover:t=SD,onSelect:n,value:r}){return(0,_t.jsx)(_t.Fragment,{children:e.map((e=>{const o=r===e.value;return(0,_t.jsx)(_D,{role:"menuitemradio",disabled:e.disabled,icon:o?ok:null,info:e.info,isSelected:o,shortcut:e.shortcut,className:"components-menu-items-choice",onClick:()=>{o||n(e.value)},onMouseEnter:()=>t(e.value),onMouseLeave:()=>t(null),"aria-label":e["aria-label"],children:e.label},e.value)}))})};const kD=(0,c.forwardRef)((function({eventToOffset:e,...t},n){return(0,_t.jsx)(SN,{ref:n,stopNavigationEvents:!0,onlyBrowserTabstops:!0,eventToOffset:t=>{const{code:n,shiftKey:r}=t;return"Tab"===n?r?-1:1:e?e(t):void 0},...t})})),jD="root",ED=()=>{},PD=()=>{},ND=(0,c.createContext)({activeItem:void 0,activeMenu:jD,setActiveMenu:ED,navigationTree:{items:{},getItem:PD,addItem:ED,removeItem:ED,menus:{},getMenu:PD,addMenu:ED,removeMenu:ED,childMenu:{},traverseMenu:ED,isMenuEmpty:()=>!1}}),TD=()=>(0,c.useContext)(ND);const ID=yl("div",{target:"eeiismy11"})("width:100%;box-sizing:border-box;padding:0 ",Il(4),";overflow:hidden;"),RD=yl("div",{target:"eeiismy10"})("margin-top:",Il(6),";margin-bottom:",Il(6),";display:flex;flex-direction:column;ul{padding:0;margin:0;list-style:none;}.components-navigation__back-button{margin-bottom:",Il(6),";}.components-navigation__group+.components-navigation__group{margin-top:",Il(6),";}"),MD=yl(Jx,{target:"eeiismy9"})({name:"26l0q2",styles:"&.is-tertiary{color:inherit;opacity:0.7;&:hover:not( :disabled ){opacity:1;box-shadow:none;color:inherit;}&:active:not( :disabled ){background:transparent;opacity:1;color:inherit;}}"}),AD=yl("div",{target:"eeiismy8"})({name:"1aubja5",styles:"overflow:hidden;width:100%"}),DD=yl("div",{target:"eeiismy7"})({name:"rgorny",styles:"margin:11px 0;padding:1px"}),zD=yl("span",{target:"eeiismy6"})("height:",Il(6),";.components-button.is-small{color:inherit;opacity:0.7;margin-right:",Il(1),";padding:0;&:active:not( :disabled ){background:none;opacity:1;color:inherit;}&:hover:not( :disabled ){box-shadow:none;opacity:1;color:inherit;}}"),OD=yl(mk,{target:"eeiismy5"})("min-height:",Il(12),";align-items:center;color:inherit;display:flex;justify-content:space-between;margin-bottom:",Il(2),";padding:",(()=>(0,a.isRTL)()?`${Il(1)} ${Il(4)} ${Il(1)} ${Il(2)}`:`${Il(1)} ${Il(2)} ${Il(1)} ${Il(4)}`),";"),LD=yl("li",{target:"eeiismy4"})("border-radius:",Fl.radiusSmall,";color:inherit;margin-bottom:0;>button,>a.components-button,>a{width:100%;color:inherit;opacity:0.7;padding:",Il(2)," ",Il(4),";",Mg({textAlign:"left"},{textAlign:"right"})," &:hover,&:focus:not( [aria-disabled='true'] ):active,&:active:not( [aria-disabled='true'] ):active{color:inherit;opacity:1;}}&.is-active{background-color:",zl.theme.accent,";color:",zl.theme.accentInverted,";>button,.components-button:hover,>a{color:",zl.theme.accentInverted,";opacity:1;}}>svg path{color:",zl.gray[600],";}"),FD=yl("div",{target:"eeiismy3"})("display:flex;align-items:center;height:auto;min-height:40px;margin:0;padding:",Il(1.5)," ",Il(4),";font-weight:400;line-height:20px;width:100%;color:inherit;opacity:0.7;"),BD=yl("span",{target:"eeiismy2"})("display:flex;margin-right:",Il(2),";"),VD=yl("span",{target:"eeiismy1"})("margin-left:",(()=>(0,a.isRTL)()?"0":Il(2)),";margin-right:",(()=>(0,a.isRTL)()?Il(2):"0"),";display:inline-flex;padding:",Il(1)," ",Il(3),";border-radius:",Fl.radiusSmall,";@keyframes fade-in{from{opacity:0;}to{opacity:1;}}@media not ( prefers-reduced-motion ){animation:fade-in 250ms ease-out;}"),$D=yl($v,{target:"eeiismy0"})((()=>(0,a.isRTL)()?"margin-left: auto;":"margin-right: auto;")," font-size:14px;line-height:20px;color:inherit;");function HD(){const[e,t]=(0,c.useState)({});return{nodes:e,getNode:t=>e[t],addNode:(e,n)=>{const{children:r,...o}=n;return t((t=>({...t,[e]:o})))},removeNode:e=>t((t=>{const{[e]:n,...r}=t;return r}))}}const WD=()=>{};const UD=function({activeItem:e,activeMenu:t=jD,children:n,className:r,onActivateMenu:o=WD}){const[i,l]=(0,c.useState)(t),[u,d]=(0,c.useState)(),p=(()=>{const{nodes:e,getNode:t,addNode:n,removeNode:r}=HD(),{nodes:o,getNode:i,addNode:s,removeNode:a}=HD(),[l,u]=(0,c.useState)({}),d=e=>l[e]||[],p=(e,t)=>{const n=[];let r,o=[e];for(;o.length>0&&(r=i(o.shift()),!r||n.includes(r.menu)||(n.push(r.menu),o=[...o,...d(r.menu)],!1!==t(r))););};return{items:e,getItem:t,addItem:n,removeItem:r,menus:o,getMenu:i,addMenu:(e,t)=>{u((n=>{const r={...n};return t.parentMenu?(r[t.parentMenu]||(r[t.parentMenu]=[]),r[t.parentMenu].push(e),r):r})),s(e,t)},removeMenu:a,childMenu:l,traverseMenu:p,isMenuEmpty:e=>{let t=!0;return p(e,(e=>{if(!e.isEmpty)return t=!1,!1})),t}}})(),f=(0,a.isRTL)()?"right":"left";Xi()("wp.components.Navigation (and all subcomponents)",{since:"6.8",version:"7.1",alternative:"wp.components.Navigator"});const h=(e,t=f)=>{p.getMenu(e)&&(d(t),l(e),o(e))},m=(0,c.useRef)(!1);(0,c.useEffect)((()=>{m.current||(m.current=!0)}),[]),(0,c.useEffect)((()=>{t!==i&&h(t)}),[t]);const g={activeItem:e,activeMenu:i,setActiveMenu:h,navigationTree:p},v=s("components-navigation",r),b=Zl({type:"slide-in",origin:u});return(0,_t.jsx)(ID,{className:v,children:(0,_t.jsx)("div",{className:b?s({[b]:m.current&&u}):void 0,children:(0,_t.jsx)(ND.Provider,{value:g,children:n})},i)})},GD=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})}),KD=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});const qD=(0,c.forwardRef)((function({backButtonLabel:e,className:t,href:n,onClick:r,parentMenu:o},i){const{setActiveMenu:l,navigationTree:c}=TD(),u=s("components-navigation__back-button",t),d=void 0!==o?c.getMenu(o)?.title:void 0,p=(0,a.isRTL)()?GD:KD;return(0,_t.jsxs)(MD,{__next40pxDefaultSize:!0,className:u,href:n,variant:"tertiary",ref:i,onClick:e=>{"function"==typeof r&&r(e);const t=(0,a.isRTL)()?"left":"right";o&&!e.defaultPrevented&&l(o,t)},children:[(0,_t.jsx)(oS,{icon:p}),e||d||(0,a.__)("Back")]})})),YD=qD,XD=(0,c.createContext)({group:void 0});let ZD=0;const QD=function({children:e,className:t,title:n}){const[r]=(0,c.useState)("group-"+ ++ZD),{navigationTree:{items:o}}=TD(),i={group:r};if(!Object.values(o).some((e=>e.group===r&&e._isVisible)))return(0,_t.jsx)(XD.Provider,{value:i,children:e});const a=`components-navigation__group-title-${r}`,l=s("components-navigation__group",t);return(0,_t.jsx)(XD.Provider,{value:i,children:(0,_t.jsxs)("li",{className:l,children:[n&&(0,_t.jsx)(OD,{className:"components-navigation__group-title",id:a,level:3,children:n}),(0,_t.jsx)("ul",{"aria-labelledby":a,role:"group",children:e})]})})};function JD(e){const{badge:t,title:n}=e;return(0,_t.jsxs)(_t.Fragment,{children:[n&&(0,_t.jsx)($D,{className:"components-navigation__item-title",as:"span",children:n}),t&&(0,_t.jsx)(VD,{className:"components-navigation__item-badge",children:t})]})}const ez=(0,c.createContext)({menu:void 0,search:""}),tz=()=>(0,c.useContext)(ez),nz=e=>Cy()(e).replace(/^\//,"").toLowerCase(),rz=(e,t)=>{const{activeMenu:n,navigationTree:{addItem:r,removeItem:o}}=TD(),{group:i}=(0,c.useContext)(XD),{menu:s,search:a}=tz();(0,c.useEffect)((()=>{const l=n===s,c=!a||void 0!==t.title&&((e,t)=>-1!==nz(e).indexOf(nz(t)))(t.title,a);return r(e,{...t,group:i,menu:s,_isVisible:l&&c}),()=>{o(e)}}),[n,a])};let oz=0;function iz(e){const{children:t,className:n,title:r,href:o,...i}=e,[a]=(0,c.useState)("item-"+ ++oz);rz(a,e);const{navigationTree:l}=TD();if(!l.getItem(a)?._isVisible)return null;const u=s("components-navigation__item",n);return(0,_t.jsx)(LD,{className:u,...i,children:t})}const sz=()=>{};const az=function(e){const{badge:t,children:n,className:r,href:o,item:i,navigateToMenu:l,onClick:c=sz,title:u,icon:d,hideIfTargetMenuEmpty:p,isText:f,...h}=e,{activeItem:m,setActiveMenu:g,navigationTree:{isMenuEmpty:v}}=TD();if(p&&l&&v(l))return null;const b=i&&m===i,x=s(r,{"is-active":b}),y=(0,a.isRTL)()?KD:GD,w=n?e:{...e,onClick:void 0},_=f?h:{as:Jx,__next40pxDefaultSize:!("as"in h)||void 0===h.as,href:o,onClick:e=>{l&&g(l),c(e)},"aria-current":b?"page":void 0,...h};return(0,_t.jsx)(iz,{...w,className:x,children:n||(0,_t.jsxs)(FD,{..._,children:[d&&(0,_t.jsx)(BD,{children:(0,_t.jsx)(oS,{icon:d})}),(0,_t.jsx)(JD,{title:u,badge:t}),l&&(0,_t.jsx)(oS,{icon:y})]})})},lz=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})}),cz=(0,l.createHigherOrderComponent)((e=>t=>(0,_t.jsx)(e,{...t,speak:jy.speak,debouncedSpeak:(0,l.useDebounce)(jy.speak,500)})),"withSpokenMessages"),uz=({size:e})=>Il("compact"===e?1:2),dz=yl("div",{target:"effl84m1"})("display:flex;padding-inline-end:",uz,";svg{fill:currentColor;}"),pz=yl(qx,{target:"effl84m0"})("input[type='search']{&::-webkit-search-decoration,&::-webkit-search-cancel-button,&::-webkit-search-results-button,&::-webkit-search-results-decoration{-webkit-appearance:none;}}&:not( :focus-within ){--wp-components-color-background:",zl.theme.gray[100],";}");function fz({searchRef:e,value:t,onChange:n,onClose:r}){if(!r&&!t)return(0,_t.jsx)(oS,{icon:lz});r&&Xi()("`onClose` prop in wp.components.SearchControl",{since:"6.8"});return(0,_t.jsx)(Jx,{size:"small",icon:UN,label:r?(0,a.__)("Close search"):(0,a.__)("Reset search"),onClick:null!=r?r:()=>{n(""),e.current?.focus()}})}const hz=(0,c.forwardRef)((function({__nextHasNoMarginBottom:e=!1,className:t,onChange:n,value:r,label:o=(0,a.__)("Search"),placeholder:i=(0,a.__)("Search"),hideLabelFromVision:u=!0,onClose:d,size:p="default",...f},h){const{disabled:m,...g}=f,v=(0,c.useRef)(null),b=(0,l.useInstanceId)(hz,"components-search-control"),x=(0,c.useMemo)((()=>({BaseControl:{_overrides:{__nextHasNoMarginBottom:e},__associatedWPComponentName:"SearchControl"},InputBase:{isBorderless:!0}})),[e]);return(0,_t.jsx)(gs,{value:x,children:(0,_t.jsx)(pz,{__next40pxDefaultSize:!0,id:b,hideLabelFromVision:u,label:o,ref:(0,l.useMergeRefs)([v,h]),type:"search",size:p,className:s("components-search-control",t),onChange:e=>n(null!=e?e:""),autoComplete:"off",placeholder:i,value:null!=r?r:"",suffix:(0,_t.jsx)(dz,{size:p,children:(0,_t.jsx)(fz,{searchRef:v,value:r,onChange:n,onClose:d})}),...g})})})),mz=hz;const gz=cz((function({debouncedSpeak:e,onCloseSearch:t,onSearch:n,search:r,title:o}){const{navigationTree:{items:i}}=TD(),{menu:s}=tz(),l=(0,c.useRef)(null);(0,c.useEffect)((()=>{const e=setTimeout((()=>{l.current?.focus()}),100);return()=>{clearTimeout(e)}}),[]),(0,c.useEffect)((()=>{if(!r)return;const t=Object.values(i).filter((e=>e._isVisible)).length,n=(0,a.sprintf)((0,a._n)("%d result found.","%d results found.",t),t);e(n)}),[i,r]);const u=()=>{n?.(""),t()},d=`components-navigation__menu-title-search-${s}`,p=(0,a.sprintf)((0,a.__)("Search %s"),o?.toLowerCase()).trim();return(0,_t.jsx)(DD,{children:(0,_t.jsx)(mz,{__nextHasNoMarginBottom:!0,className:"components-navigation__menu-search-input",id:d,onChange:e=>n?.(e),onKeyDown:e=>{"Escape"!==e.code||e.defaultPrevented||(e.preventDefault(),u())},placeholder:p,onClose:u,ref:l,value:r})})}));function vz({hasSearch:e,onSearch:t,search:n,title:r,titleAction:o}){const[i,s]=(0,c.useState)(!1),{menu:l}=tz(),u=(0,c.useRef)(null);if(!r)return null;const d=`components-navigation__menu-title-${l}`,p=(0,a.sprintf)((0,a.__)("Search in %s"),r);return(0,_t.jsxs)(AD,{className:"components-navigation__menu-title",children:[!i&&(0,_t.jsxs)(OD,{as:"h2",className:"components-navigation__menu-title-heading",level:3,children:[(0,_t.jsx)("span",{id:d,children:r}),(e||o)&&(0,_t.jsxs)(zD,{children:[o,e&&(0,_t.jsx)(Jx,{size:"small",variant:"tertiary",label:p,onClick:()=>s(!0),ref:u,children:(0,_t.jsx)(oS,{icon:lz})})]})]}),i&&(0,_t.jsx)("div",{className:Zl({type:"slide-in",origin:"left"}),children:(0,_t.jsx)(gz,{onCloseSearch:()=>{s(!1),setTimeout((()=>{u.current?.focus()}),100)},onSearch:t,search:n,title:r})})]})}function bz({search:e}){const{navigationTree:{items:t}}=TD(),n=Object.values(t).filter((e=>e._isVisible)).length;return!e||n?null:(0,_t.jsx)(LD,{children:(0,_t.jsxs)(FD,{children:[(0,a.__)("No results found.")," "]})})}const xz=function(e){const{backButtonLabel:t,children:n,className:r,hasSearch:o,menu:i=jD,onBackButtonClick:a,onSearch:l,parentMenu:u,search:d,isSearchDebouncing:p,title:f,titleAction:h}=e,[m,g]=(0,c.useState)("");(e=>{const{navigationTree:{addMenu:t,removeMenu:n}}=TD(),r=e.menu||jD;(0,c.useEffect)((()=>(t(r,{...e,menu:r}),()=>{n(r)})),[])})(e);const{activeMenu:v}=TD(),b={menu:i,search:m};if(v!==i)return(0,_t.jsx)(ez.Provider,{value:b,children:n});const x=!!l,y=x?d:m,w=x?l:g,_=`components-navigation__menu-title-${i}`,S=s("components-navigation__menu",r);return(0,_t.jsx)(ez.Provider,{value:b,children:(0,_t.jsxs)(RD,{className:S,children:[(u||a)&&(0,_t.jsx)(YD,{backButtonLabel:t,parentMenu:u,onClick:a}),f&&(0,_t.jsx)(vz,{hasSearch:o,onSearch:w,search:y,title:f,titleAction:h}),(0,_t.jsx)(kN,{children:(0,_t.jsxs)("ul",{"aria-labelledby":_,children:[n,y&&!p&&(0,_t.jsx)(bz,{search:y})]})})]})})};function yz(e,t){void 0===t&&(t={});for(var n=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var o=1,i="";if("?"===e[a=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(a));for(;a<e.length;)if("\\"!==e[a]){if(")"===e[a]){if(0==--o){a++;break}}else if("("===e[a]&&(o++,"?"!==e[a+1]))throw new TypeError("Capturing groups are not allowed at ".concat(a));i+=e[a++]}else i+=e[a++]+e[a++];if(o)throw new TypeError("Unbalanced pattern at ".concat(n));if(!i)throw new TypeError("Missing pattern at ".concat(n));t.push({type:"PATTERN",index:n,value:i}),n=a}else{for(var s="",a=n+1;a<e.length;){var l=e.charCodeAt(a);if(!(l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||95===l))break;s+=e[a++]}if(!s)throw new TypeError("Missing parameter name at ".concat(n));t.push({type:"NAME",index:n,value:s}),n=a}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(e),r=t.prefixes,o=void 0===r?"./":r,i=t.delimiter,s=void 0===i?"/#?":i,a=[],l=0,c=0,u="",d=function(e){if(c<n.length&&n[c].type===e)return n[c++].value},p=function(e){var t=d(e);if(void 0!==t)return t;var r=n[c],o=r.type,i=r.index;throw new TypeError("Unexpected ".concat(o," at ").concat(i,", expected ").concat(e))},f=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},h=function(e){var t=a[a.length-1],n=e||(t&&"string"==typeof t?t:"");if(t&&!n)throw new TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!n||function(e){for(var t=0,n=s;t<n.length;t++){var r=n[t];if(e.indexOf(r)>-1)return!0}return!1}(n)?"[^".concat(_z(s),"]+?"):"(?:(?!".concat(_z(n),")[^").concat(_z(s),"])+?")};c<n.length;){var m=d("CHAR"),g=d("NAME"),v=d("PATTERN");if(g||v){var b=m||"";-1===o.indexOf(b)&&(u+=b,b=""),u&&(a.push(u),u=""),a.push({name:g||l++,prefix:b,suffix:"",pattern:v||h(b),modifier:d("MODIFIER")||""})}else{var x=m||d("ESCAPED_CHAR");if(x)u+=x;else if(u&&(a.push(u),u=""),d("OPEN")){b=f();var y=d("NAME")||"",w=d("PATTERN")||"",_=f();p("CLOSE"),a.push({name:y||(w?l++:""),pattern:y&&!w?h(b):w,prefix:b,suffix:_,modifier:d("MODIFIER")||""})}else p("END")}}return a}function wz(e,t){var n=[];return function(e,t,n){void 0===n&&(n={});var r=n.decode,o=void 0===r?function(e){return e}:r;return function(n){var r=e.exec(n);if(!r)return!1;for(var i=r[0],s=r.index,a=Object.create(null),l=function(e){if(void 0===r[e])return"continue";var n=t[e-1];"*"===n.modifier||"+"===n.modifier?a[n.name]=r[e].split(n.prefix+n.suffix).map((function(e){return o(e,n)})):a[n.name]=o(r[e],n)},c=1;c<r.length;c++)l(c);return{path:i,index:s,params:a}}}(kz(e,n,t),n,t)}function _z(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function Sz(e){return e&&e.sensitive?"":"i"}function Cz(e,t,n){return function(e,t,n){void 0===n&&(n={});for(var r=n.strict,o=void 0!==r&&r,i=n.start,s=void 0===i||i,a=n.end,l=void 0===a||a,c=n.encode,u=void 0===c?function(e){return e}:c,d=n.delimiter,p=void 0===d?"/#?":d,f=n.endsWith,h="[".concat(_z(void 0===f?"":f),"]|$"),m="[".concat(_z(p),"]"),g=s?"^":"",v=0,b=e;v<b.length;v++){var x=b[v];if("string"==typeof x)g+=_z(u(x));else{var y=_z(u(x.prefix)),w=_z(u(x.suffix));if(x.pattern)if(t&&t.push(x),y||w)if("+"===x.modifier||"*"===x.modifier){var _="*"===x.modifier?"?":"";g+="(?:".concat(y,"((?:").concat(x.pattern,")(?:").concat(w).concat(y,"(?:").concat(x.pattern,"))*)").concat(w,")").concat(_)}else g+="(?:".concat(y,"(").concat(x.pattern,")").concat(w,")").concat(x.modifier);else{if("+"===x.modifier||"*"===x.modifier)throw new TypeError('Can not repeat "'.concat(x.name,'" without a prefix and suffix'));g+="(".concat(x.pattern,")").concat(x.modifier)}else g+="(?:".concat(y).concat(w,")").concat(x.modifier)}}if(l)o||(g+="".concat(m,"?")),g+=n.endsWith?"(?=".concat(h,")"):"$";else{var S=e[e.length-1],C="string"==typeof S?m.indexOf(S[S.length-1])>-1:void 0===S;o||(g+="(?:".concat(m,"(?=").concat(h,"))?")),C||(g+="(?=".concat(m,"|").concat(h,")"))}return new RegExp(g,Sz(n))}(yz(e,n),t,n)}function kz(e,t,n){return e instanceof RegExp?function(e,t){if(!t)return e;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,o=n.exec(e.source);o;)t.push({name:o[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),o=n.exec(e.source);return e}(e,t):Array.isArray(e)?function(e,t,n){var r=e.map((function(e){return kz(e,t,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),Sz(n))}(e,t,n):Cz(e,t,n)}function jz(e,t){return wz(t,{decode:decodeURIComponent})(e)}const Ez=(0,c.createContext)({location:{},goTo:()=>{},goBack:()=>{},goToParent:()=>{},addScreen:()=>{},removeScreen:()=>{},params:{}});const Pz={name:"1br0vvk",styles:"position:relative;overflow-x:clip;contain:layout;display:grid;grid-template-columns:1fr;grid-template-rows:1fr;align-items:start"},Nz=Tl({from:{opacity:0}}),Tz=Tl({to:{opacity:0}}),Iz=Tl({from:{transform:"translateX(100px)"}}),Rz=Tl({to:{transform:"translateX(-80px)"}}),Mz=Tl({from:{transform:"translateX(-100px)"}}),Az=Tl({to:{transform:"translateX(80px)"}}),Dz=70,zz="linear",Oz={IN:70,OUT:40},Lz=300,Fz="cubic-bezier(0.33, 0, 0, 1)",Bz=Math.max(Dz+Oz.IN,Lz),Vz=Math.max(Dz+Oz.OUT,Lz),$z={end:{in:Iz.name,out:Rz.name},start:{in:Mz.name,out:Az.name}},Hz={end:{in:Nl(Dz,"ms ",zz," ",Oz.IN,"ms both ",Nz,",",Lz,"ms ",Fz," both ",Iz,";",""),out:Nl(Dz,"ms ",zz," ",Oz.OUT,"ms both ",Tz,",",Lz,"ms ",Fz," both ",Rz,";","")},start:{in:Nl(Dz,"ms ",zz," ",Oz.IN,"ms both ",Nz,",",Lz,"ms ",Fz," both ",Mz,";",""),out:Nl(Dz,"ms ",zz," ",Oz.OUT,"ms both ",Tz,",",Lz,"ms ",Fz," both ",Az,";","")}},Wz=Nl("z-index:1;&[data-animation-type='out']{z-index:0;}@media not ( prefers-reduced-motion ){&:not( [data-skip-animation] ){",["start","end"].map((e=>["in","out"].map((t=>Nl("&[data-animation-direction='",e,"'][data-animation-type='",t,"']{animation:",Hz[e][t],";}",""))))),";}}",""),Uz={name:"14di7zd",styles:"overflow-x:auto;max-height:100%;box-sizing:border-box;position:relative;grid-column:1/-1;grid-row:1/-1"};function Gz(e,t,n={}){var r;const{focusSelectors:o}=e,i={...e.currentLocation},{isBack:s=!1,skipFocus:a=!1,replace:l,focusTargetSelector:c,...u}=n;if(i.path===t)return{currentLocation:i,focusSelectors:o};let d,p;function f(){var t;return d=null!==(t=d)&&void 0!==t?t:new Map(e.focusSelectors),d}return c&&i.path&&f().set(i.path,c),o.get(t)&&(s&&(p=o.get(t)),f().delete(t)),{currentLocation:{...u,isInitial:!1,path:t,isBack:s,hasRestoredFocus:!1,focusTargetSelector:p,skipFocus:a},focusSelectors:null!==(r=d)&&void 0!==r?r:o}}function Kz(e,t={}){const{screens:n,focusSelectors:r}=e,o={...e.currentLocation},i=o.path;if(void 0===i)return{currentLocation:o,focusSelectors:r};const s=function(e,t){if(!e.startsWith("/"))return;const n=e.split("/");let r;for(;n.length>1&&void 0===r;){n.pop();const e=""===n.join("/")?"/":n.join("/");t.find((t=>!1!==jz(e,t.path)))&&(r=e)}return r}(i,n);return void 0===s?{currentLocation:o,focusSelectors:r}:Gz(e,s,{...t,isBack:!0})}function qz(e,t){let{screens:n,currentLocation:r,matchedPath:o,focusSelectors:i,...s}=e;switch(t.type){case"add":n=function({screens:e},t){return e.some((e=>e.path===t.path))?e:[...e,t]}(e,t.screen);break;case"remove":n=function({screens:e},t){return e.filter((e=>e.id!==t.id))}(e,t.screen);break;case"goto":({currentLocation:r,focusSelectors:i}=Gz(e,t.path,t.options));break;case"gotoparent":({currentLocation:r,focusSelectors:i}=Kz(e,t.options))}if(n===e.screens&&r===e.currentLocation)return e;const a=r.path;return o=void 0!==a?function(e,t){for(const n of t){const t=jz(e,n.path);if(t)return{params:t.params,id:n.id}}}(a,n):void 0,o&&e.matchedPath&&o.id===e.matchedPath.id&&pw()(o.params,e.matchedPath.params)&&(o=e.matchedPath),{...s,screens:n,currentLocation:r,matchedPath:o,focusSelectors:i}}const Yz=al((function(e,t){const{initialPath:n,children:r,className:o,...i}=sl(e,"Navigator"),[s,a]=(0,c.useReducer)(qz,n,(e=>({screens:[],currentLocation:{path:e,isInitial:!0},matchedPath:void 0,focusSelectors:new Map,initialPath:n}))),l=(0,c.useMemo)((()=>({goBack:e=>a({type:"gotoparent",options:e}),goTo:(e,t)=>a({type:"goto",path:e,options:t}),goToParent:e=>{Xi()("wp.components.useNavigator().goToParent",{since:"6.7",alternative:"wp.components.useNavigator().goBack"}),a({type:"gotoparent",options:e})},addScreen:e=>a({type:"add",screen:e}),removeScreen:e=>a({type:"remove",screen:e})})),[]),{currentLocation:u,matchedPath:d}=s,p=(0,c.useMemo)((()=>{var e;return{location:u,params:null!==(e=d?.params)&&void 0!==e?e:{},match:d?.id,...l}}),[u,d,l]),f=il(),h=(0,c.useMemo)((()=>f(Pz,o)),[o,f]);return(0,_t.jsx)(_l,{ref:t,className:h,...i,children:(0,_t.jsx)(Ez.Provider,{value:p,children:r})})}),"Navigator"),Xz=window.wp.escapeHtml;function Zz({isMatch:e,skipAnimation:t,isBack:n,onAnimationEnd:r}){const o=(0,a.isRTL)(),i=(0,l.useReducedMotion)(),[s,u]=(0,c.useState)("INITIAL"),d="ANIMATING_IN"!==s&&"IN"!==s&&e,p="ANIMATING_OUT"!==s&&"OUT"!==s&&!e;(0,c.useLayoutEffect)((()=>{d?u(t||i?"IN":"ANIMATING_IN"):p&&u(t||i?"OUT":"ANIMATING_OUT")}),[d,p,t,i]);const f=o&&n||!o&&!n?"end":"start",h="ANIMATING_IN"===s,m="ANIMATING_OUT"===s;let g;h?g="in":m&&(g="out");const v=(0,c.useCallback)((e=>{r?.(e),((e,t,n)=>"ANIMATING_OUT"===t&&n===$z[e].out)(f,s,e.animationName)?u("OUT"):((e,t,n)=>"ANIMATING_IN"===t&&n===$z[e].in)(f,s,e.animationName)&&u("IN")}),[r,s,f]);return(0,c.useEffect)((()=>{let e;return m?e=window.setTimeout((()=>{u("OUT"),e=void 0}),1.2*Vz):h&&(e=window.setTimeout((()=>{u("IN"),e=void 0}),1.2*Bz)),()=>{e&&(window.clearTimeout(e),e=void 0)}}),[m,h]),{animationStyles:Wz,shouldRenderScreen:e||"IN"===s||"ANIMATING_OUT"===s,screenProps:{onAnimationEnd:v,"data-animation-direction":f,"data-animation-type":g,"data-skip-animation":t||void 0}}}const Qz=al((function(e,t){/^\//.test(e.path);const n=(0,c.useId)(),{children:r,className:o,path:i,onAnimationEnd:s,...a}=sl(e,"Navigator.Screen"),{location:u,match:d,addScreen:p,removeScreen:f}=(0,c.useContext)(Ez),{isInitial:h,isBack:m,focusTargetSelector:g,skipFocus:v}=u,b=d===n,x=(0,c.useRef)(null),y=!!h&&!m;(0,c.useEffect)((()=>{const e={id:n,path:(0,Xz.escapeAttribute)(i)};return p(e),()=>f(e)}),[n,i,p,f]);const{animationStyles:w,shouldRenderScreen:_,screenProps:S}=Zz({isMatch:b,isBack:m,onAnimationEnd:s,skipAnimation:y}),C=il(),k=(0,c.useMemo)((()=>C(Uz,w,o)),[o,C,w]),j=(0,c.useRef)(u);(0,c.useEffect)((()=>{j.current=u}),[u]),(0,c.useEffect)((()=>{const e=x.current;if(y||!b||!e||j.current.hasRestoredFocus||v)return;const t=e.ownerDocument.activeElement;if(e.contains(t))return;let n=null;if(m&&g&&(n=e.querySelector(g)),!n){const[t]=bN.focus.tabbable.find(e);n=null!=t?t:e}j.current.hasRestoredFocus=!0,n.focus()}),[y,b,m,g,v]);const E=(0,l.useMergeRefs)([t,x]);return _?(0,_t.jsx)(_l,{ref:E,className:k,...S,...a,children:r}):null}),"Navigator.Screen");function Jz(){const{location:e,params:t,goTo:n,goBack:r,goToParent:o}=(0,c.useContext)(Ez);return{location:e,goTo:n,goBack:r,goToParent:o,params:t}}const eO=al((function(e,t){const n=function(e){const{path:t,onClick:n,as:r=Jx,attributeName:o="id",...i}=sl(e,"Navigator.Button"),s=(0,Xz.escapeAttribute)(t),{goTo:a}=Jz();return{as:r,onClick:(0,c.useCallback)((e=>{var t,r;e.preventDefault(),a(s,{focusTargetSelector:(t=o,r=s,`[${t}="${r}"]`)}),n?.(e)}),[a,n,o,s]),...i,[o]:s}}(e);return(0,_t.jsx)(_l,{ref:t,...n})}),"Navigator.Button");const tO=al((function(e,t){const n=function(e){const{onClick:t,as:n=Jx,...r}=sl(e,"Navigator.BackButton"),{goBack:o}=Jz();return{as:n,onClick:(0,c.useCallback)((e=>{e.preventDefault(),o(),t?.(e)}),[o,t]),...r}}(e);return(0,_t.jsx)(_l,{ref:t,...n})}),"Navigator.BackButton");const nO=al((function(e,t){return Xi()("wp.components.NavigatorToParentButton",{since:"6.7",alternative:"wp.components.Navigator.BackButton"}),(0,_t.jsx)(tO,{ref:t,...e})}),"Navigator.ToParentButton"),rO=Object.assign(Yz,{displayName:"NavigatorProvider"}),oO=Object.assign(Qz,{displayName:"NavigatorScreen"}),iO=Object.assign(eO,{displayName:"NavigatorButton"}),sO=Object.assign(tO,{displayName:"NavigatorBackButton"}),aO=Object.assign(nO,{displayName:"NavigatorToParentButton"}),lO=Object.assign(Yz,{Screen:Object.assign(Qz,{displayName:"Navigator.Screen"}),Button:Object.assign(eO,{displayName:"Navigator.Button"}),BackButton:Object.assign(tO,{displayName:"Navigator.BackButton"})}),cO=()=>{};function uO(e){switch(e){case"success":case"warning":case"info":return"polite";default:return"assertive"}}function dO(e){switch(e){case"warning":return(0,a.__)("Warning notice");case"info":return(0,a.__)("Information notice");case"error":return(0,a.__)("Error notice");default:return(0,a.__)("Notice")}}const pO=function({className:e,status:t="info",children:n,spokenMessage:r=n,onRemove:o=cO,isDismissible:i=!0,actions:l=[],politeness:u=uO(t),__unstableHTML:d,onDismiss:p=cO}){!function(e,t){const n="string"==typeof e?e:(0,c.renderToString)(e);(0,c.useEffect)((()=>{n&&(0,jy.speak)(n,t)}),[n,t])}(r,u);const f=s(e,"components-notice","is-"+t,{"is-dismissible":i});return d&&"string"==typeof n&&(n=(0,_t.jsx)(c.RawHTML,{children:n})),(0,_t.jsxs)("div",{className:f,children:[(0,_t.jsx)(Sl,{children:dO(t)}),(0,_t.jsxs)("div",{className:"components-notice__content",children:[n,(0,_t.jsx)("div",{className:"components-notice__actions",children:l.map((({className:e,label:t,isPrimary:n,variant:r,noDefaultClasses:o=!1,onClick:i,url:a},l)=>{let c=r;return"primary"===r||o||(c=a?"link":"secondary"),void 0===c&&n&&(c="primary"),(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,href:a,variant:c,onClick:a?void 0:i,className:s("components-notice__action",e),children:t},l)}))})]}),i&&(0,_t.jsx)(Jx,{size:"small",className:"components-notice__dismiss",icon:Fy,label:(0,a.__)("Close"),onClick:()=>{p(),o()}})]})},fO=()=>{};const hO=function({notices:e,onRemove:t=fO,className:n,children:r}){const o=e=>()=>t(e);return n=s("components-notice-list",n),(0,_t.jsxs)("div",{className:n,children:[r,[...e].reverse().map((e=>{const{content:t,...n}=e;return(0,B.createElement)(pO,{...n,key:e.id,onRemove:o(e.id)},e.content)}))]})};const mO=function({label:e,children:t}){return(0,_t.jsxs)("div",{className:"components-panel__header",children:[e&&(0,_t.jsx)("h2",{children:e}),t]})};const gO=(0,c.forwardRef)((function({header:e,className:t,children:n},r){const o=s(t,"components-panel");return(0,_t.jsxs)("div",{className:o,ref:r,children:[e&&(0,_t.jsx)(mO,{label:e}),n]})})),vO=(0,_t.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),bO=()=>{};const xO=(0,c.forwardRef)((({isOpened:e,icon:t,title:n,...r},o)=>n?(0,_t.jsx)("h2",{className:"components-panel__body-title",children:(0,_t.jsxs)(Jx,{__next40pxDefaultSize:!0,className:"components-panel__body-toggle","aria-expanded":e,ref:o,...r,children:[(0,_t.jsx)("span",{"aria-hidden":"true",children:(0,_t.jsx)(Xx,{className:"components-panel__arrow",icon:e?vO:iS})}),n,t&&(0,_t.jsx)(Xx,{icon:t,className:"components-panel__icon",size:20})]})}):null)),yO=(0,c.forwardRef)((function(e,t){const{buttonProps:n={},children:r,className:o,icon:i,initialOpen:a,onToggle:u=bO,opened:d,title:p,scrollAfterOpen:f=!0}=e,[h,m]=dS(d,{initial:void 0===a||a,fallback:!1}),g=(0,c.useRef)(null),v=(0,l.useReducedMotion)()?"auto":"smooth",b=(0,c.useRef)();b.current=f,fs((()=>{h&&b.current&&g.current?.scrollIntoView&&g.current.scrollIntoView({inline:"nearest",block:"nearest",behavior:v})}),[h,v]);const x=s("components-panel__body",o,{"is-opened":h});return(0,_t.jsxs)("div",{className:x,ref:(0,l.useMergeRefs)([g,t]),children:[(0,_t.jsx)(xO,{icon:i,isOpened:Boolean(h),onClick:e=>{e.preventDefault();const t=!h;m(t),u(t)},title:p,...n}),"function"==typeof r?r({opened:Boolean(h)}):h&&r]})})),wO=yO;const _O=(0,c.forwardRef)((function({className:e,children:t},n){return(0,_t.jsx)("div",{className:s("components-panel__row",e),ref:n,children:t})})),SO=(0,_t.jsx)(n.SVG,{className:"components-placeholder__illustration",fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 60 60",preserveAspectRatio:"none",children:(0,_t.jsx)(n.Path,{vectorEffect:"non-scaling-stroke",d:"M60 60 0 0"})});const CO=function(e){const{icon:t,children:n,label:r,instructions:o,className:i,notices:a,preview:u,isColumnLayout:d,withIllustration:p,...f}=e,[h,{width:m}]=(0,l.useResizeObserver)();let g;"number"==typeof m&&(g={"is-large":m>=480,"is-medium":m>=160&&m<480,"is-small":m<160});const v=s("components-placeholder",i,g,p?"has-illustration":null),b=s("components-placeholder__fieldset",{"is-column-layout":d});return(0,c.useEffect)((()=>{o&&(0,jy.speak)(o)}),[o]),(0,_t.jsxs)("div",{...f,className:v,children:[p?SO:null,h,a,u&&(0,_t.jsx)("div",{className:"components-placeholder__preview",children:u}),(0,_t.jsxs)("div",{className:"components-placeholder__label",children:[(0,_t.jsx)(Xx,{icon:t}),r]}),!!o&&(0,_t.jsx)("div",{className:"components-placeholder__instructions",children:o}),(0,_t.jsx)("div",{className:b,children:n})]})};function kO(e=!1){const t=e?"right":"left";return Tl({"0%":{[t]:"-50%"},"100%":{[t]:"100%"}})}const jO=yl("div",{target:"e15u147w2"})("position:relative;overflow:hidden;height:",Fl.borderWidthFocus,";background-color:color-mix(\n\t\tin srgb,\n\t\t",zl.theme.foreground,",\n\t\ttransparent 90%\n\t);border-radius:",Fl.radiusFull,";outline:2px solid transparent;outline-offset:2px;:where( & ){width:160px;}");var EO={name:"152sa26",styles:"width:var(--indicator-width);transition:width 0.4s ease-in-out"};const PO=yl("div",{target:"e15u147w1"})("display:inline-block;position:absolute;top:0;height:100%;border-radius:",Fl.radiusFull,";background-color:color-mix(\n\t\tin srgb,\n\t\t",zl.theme.foreground,",\n\t\ttransparent 10%\n\t);outline:2px solid transparent;outline-offset:-2px;",(({isIndeterminate:e})=>e?Nl({animationDuration:"1.5s",animationTimingFunction:"ease-in-out",animationIterationCount:"infinite",animationName:kO((0,a.isRTL)()),width:"50%"},"",""):EO),";"),NO=yl("progress",{target:"e15u147w0"})({name:"11fb690",styles:"position:absolute;top:0;left:0;opacity:0;width:100%;height:100%"});const TO=(0,c.forwardRef)((function(e,t){const{className:n,value:r,...o}=e,i=!Number.isFinite(r);return(0,_t.jsxs)(jO,{className:n,children:[(0,_t.jsx)(PO,{style:{"--indicator-width":i?void 0:`${r}%`},isIndeterminate:i}),(0,_t.jsx)(NO,{max:100,value:r,"aria-label":(0,a.__)("Loading …"),ref:t,...o})]})}));function IO(e){const t=e.map((e=>({children:[],parent:null,...e,id:String(e.id)})));if(!t.every((e=>null!==e.parent)))return t;const n=t.reduce(((e,t)=>{const{parent:n}=t;return e[n]||(e[n]=[]),e[n].push(t),e}),{}),r=e=>e.map((e=>{const t=n[e.id];return{...e,children:t&&t.length?r(t):[]}}));return r(n[0]||[])}const RO=window.wp.htmlEntities,MO={BaseControl:{_overrides:{__associatedWPComponentName:"TreeSelect"}}};function AO(e,t=0){return e.flatMap((e=>[{value:e.id,label:" ".repeat(3*t)+(0,RO.decodeEntities)(e.name)},...AO(e.children||[],t+1)]))}const DO=function(e){const{label:t,noOptionLabel:n,onChange:r,selectedId:o,tree:i=[],...s}=hb(e),a=(0,c.useMemo)((()=>[n&&{value:"",label:n},...AO(i)].filter((e=>!!e))),[n,i]);return Ux({componentName:"TreeSelect",size:s.size,__next40pxDefaultSize:s.__next40pxDefaultSize}),(0,_t.jsx)(gs,{value:MO,children:(0,_t.jsx)(lS,{__shouldNotWarnDeprecated36pxSize:!0,label:t,options:a,onChange:r,value:o,...s})})};function zO({__next40pxDefaultSize:e,label:t,noOptionLabel:n,authorList:r,selectedAuthorId:o,onChange:i}){if(!r)return null;const s=IO(r);return(0,_t.jsx)(DO,{label:t,noOptionLabel:n,onChange:i,tree:s,selectedId:void 0!==o?String(o):void 0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e})}function OO({__next40pxDefaultSize:e,label:t,noOptionLabel:n,categoriesList:r,selectedCategoryId:o,onChange:i,...s}){const a=(0,c.useMemo)((()=>IO(r)),[r]);return(0,_t.jsx)(DO,{label:t,noOptionLabel:n,onChange:i,tree:a,selectedId:void 0!==o?String(o):void 0,...s,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:e})}function LO(e){return"categoriesList"in e}function FO(e){return"categorySuggestions"in e}const BO=[{label:(0,a.__)("Newest to oldest"),value:"date/desc"},{label:(0,a.__)("Oldest to newest"),value:"date/asc"},{label:(0,a.__)("A → Z"),value:"title/asc"},{label:(0,a.__)("Z → A"),value:"title/desc"}];const VO=function({authorList:e,selectedAuthorId:t,numberOfItems:n,order:r,orderBy:o,orderByOptions:i=BO,maxItems:s=100,minItems:l=1,onAuthorChange:c,onNumberOfItemsChange:u,onOrderChange:d,onOrderByChange:p,...f}){return(0,_t.jsx)(pk,{spacing:"4",className:"components-query-controls",children:[d&&p&&(0,_t.jsx)(cS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,a.__)("Order by"),value:void 0===o||void 0===r?void 0:`${o}/${r}`,options:i,onChange:e=>{if("string"!=typeof e)return;const[t,n]=e.split("/");n!==r&&d(n),t!==o&&p(t)}},"query-controls-order-select"),LO(f)&&f.categoriesList&&f.onCategoryChange&&(0,_t.jsx)(OO,{__next40pxDefaultSize:!0,categoriesList:f.categoriesList,label:(0,a.__)("Category"),noOptionLabel:(0,a._x)("All","categories"),selectedCategoryId:f.selectedCategoryId,onChange:f.onCategoryChange},"query-controls-category-select"),FO(f)&&f.categorySuggestions&&f.onCategoryChange&&(0,_t.jsx)(pD,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,a.__)("Categories"),value:f.selectedCategories&&f.selectedCategories.map((e=>({id:e.id,value:e.name||e.value}))),suggestions:Object.keys(f.categorySuggestions),onChange:f.onCategoryChange,maxSuggestions:20},"query-controls-categories-select"),c&&(0,_t.jsx)(zO,{__next40pxDefaultSize:!0,authorList:e,label:(0,a.__)("Author"),noOptionLabel:(0,a._x)("All","authors"),selectedAuthorId:t,onChange:c},"query-controls-author-select"),u&&(0,_t.jsx)(ZS,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,a.__)("Number of items"),value:n,onChange:u,min:l,max:s,required:!0},"query-controls-range-control")]})},$O=(0,c.createContext)({store:void 0,disabled:void 0});const HO=(0,c.forwardRef)((function({value:e,children:t,...n},r){const{store:o,disabled:i}=(0,c.useContext)($O),s=et(o,"value"),a=void 0!==s&&s===e;return Ux({componentName:"Radio",size:void 0,__next40pxDefaultSize:n.__next40pxDefaultSize}),(0,_t.jsx)(__,{disabled:i,store:o,ref:r,value:e,render:(0,_t.jsx)(Jx,{variant:a?"primary":"secondary",...n}),children:t||e})})),WO=HO;const UO=(0,c.forwardRef)((function({label:e,checked:t,defaultChecked:n,disabled:r,onChange:o,children:i,...s},l){const u=n_({value:t,defaultValue:n,setValue:e=>{o?.(null!=e?e:void 0)},rtl:(0,a.isRTL)()}),d=(0,c.useMemo)((()=>({store:u,disabled:r})),[u,r]);return Xi()("wp.components.__experimentalRadioGroup",{alternative:"wp.components.RadioControl or wp.components.__experimentalToggleGroupControl",since:"6.8"}),(0,_t.jsx)($O.Provider,{value:d,children:(0,_t.jsx)(l_,{store:u,render:(0,_t.jsx)(cE,{__shouldNotWarnDeprecated:!0,children:i}),"aria-label":e,ref:l,...s})})})),GO=UO;function KO(e,t){return`${e}-${t}-option-description`}function qO(e,t){return`${e}-${t}`}function YO(e){return`${e}__help`}const XO=function e(t){const{label:n,className:r,selected:o,help:i,onChange:a,hideLabelFromVision:c,options:u=[],id:d,...p}=t,f=(0,l.useInstanceId)(e,"inspector-radio-control",d),h=e=>a(e.target.value);return u?.length?(0,_t.jsxs)("fieldset",{id:f,className:s(r,"components-radio-control"),"aria-describedby":i?YO(f):void 0,children:[c?(0,_t.jsx)(Sl,{as:"legend",children:n}):(0,_t.jsx)(Wx.VisualLabel,{as:"legend",children:n}),(0,_t.jsx)(pk,{spacing:3,className:s("components-radio-control__group-wrapper",{"has-help":!!i}),children:u.map(((e,t)=>(0,_t.jsxs)("div",{className:"components-radio-control__option",children:[(0,_t.jsx)("input",{id:qO(f,t),className:"components-radio-control__input",type:"radio",name:f,value:e.value,onChange:h,checked:e.value===o,"aria-describedby":e.description?KO(f,t):void 0,...p}),(0,_t.jsx)("label",{className:"components-radio-control__label",htmlFor:qO(f,t),children:e.label}),e.description?(0,_t.jsx)(Bx,{__nextHasNoMarginBottom:!0,id:KO(f,t),className:"components-radio-control__option-description",children:e.description}):null]},qO(f,t))))}),!!i&&(0,_t.jsx)(Bx,{__nextHasNoMarginBottom:!0,id:YO(f),className:"components-base-control__help",children:i})]}):null};var ZO=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),QO=function(){return QO=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},QO.apply(this,arguments)},JO={width:"100%",height:"10px",top:"0px",left:"0px",cursor:"row-resize"},eL={width:"10px",height:"100%",top:"0px",left:"0px",cursor:"col-resize"},tL={width:"20px",height:"20px",position:"absolute"},nL={top:QO(QO({},JO),{top:"-5px"}),right:QO(QO({},eL),{left:void 0,right:"-5px"}),bottom:QO(QO({},JO),{top:void 0,bottom:"-5px"}),left:QO(QO({},eL),{left:"-5px"}),topRight:QO(QO({},tL),{right:"-10px",top:"-10px",cursor:"ne-resize"}),bottomRight:QO(QO({},tL),{right:"-10px",bottom:"-10px",cursor:"se-resize"}),bottomLeft:QO(QO({},tL),{left:"-10px",bottom:"-10px",cursor:"sw-resize"}),topLeft:QO(QO({},tL),{left:"-10px",top:"-10px",cursor:"nw-resize"})},rL=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.onMouseDown=function(e){t.props.onResizeStart(e,t.props.direction)},t.onTouchStart=function(e){t.props.onResizeStart(e,t.props.direction)},t}return ZO(t,e),t.prototype.render=function(){return B.createElement("div",{className:this.props.className||"",style:QO(QO({position:"absolute",userSelect:"none"},nL[this.props.direction]),this.props.replaceStyles||{}),onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart},this.props.children)},t}(B.PureComponent),oL=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),iL=function(){return iL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},iL.apply(this,arguments)},sL={width:"auto",height:"auto"},aL=function(e,t,n){return Math.max(Math.min(e,n),t)},lL=function(e,t){return Math.round(e/t)*t},cL=function(e,t){return new RegExp(e,"i").test(t)},uL=function(e){return Boolean(e.touches&&e.touches.length)},dL=function(e,t,n){void 0===n&&(n=0);var r=t.reduce((function(n,r,o){return Math.abs(r-e)<Math.abs(t[n]-e)?o:n}),0),o=Math.abs(t[r]-e);return 0===n||o<n?t[r]:e},pL=function(e){return"auto"===(e=e.toString())||e.endsWith("px")||e.endsWith("%")||e.endsWith("vh")||e.endsWith("vw")||e.endsWith("vmax")||e.endsWith("vmin")?e:e+"px"},fL=function(e,t,n,r){if(e&&"string"==typeof e){if(e.endsWith("px"))return Number(e.replace("px",""));if(e.endsWith("%"))return t*(Number(e.replace("%",""))/100);if(e.endsWith("vw"))return n*(Number(e.replace("vw",""))/100);if(e.endsWith("vh"))return r*(Number(e.replace("vh",""))/100)}return e},hL=["as","style","className","grid","snap","bounds","boundsByDirection","size","defaultSize","minWidth","minHeight","maxWidth","maxHeight","lockAspectRatio","lockAspectRatioExtraWidth","lockAspectRatioExtraHeight","enable","handleStyles","handleClasses","handleWrapperStyle","handleWrapperClass","children","onResizeStart","onResize","onResizeStop","handleComponent","scale","resizeRatio","snapGap"],mL="__resizable_base__",gL=function(e){function t(t){var n=e.call(this,t)||this;return n.ratio=1,n.resizable=null,n.parentLeft=0,n.parentTop=0,n.resizableLeft=0,n.resizableRight=0,n.resizableTop=0,n.resizableBottom=0,n.targetLeft=0,n.targetTop=0,n.appendBase=function(){if(!n.resizable||!n.window)return null;var e=n.parentNode;if(!e)return null;var t=n.window.document.createElement("div");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.transform="scale(0, 0)",t.style.left="0",t.style.flex="0 0 100%",t.classList?t.classList.add(mL):t.className+=mL,e.appendChild(t),t},n.removeBase=function(e){var t=n.parentNode;t&&t.removeChild(e)},n.ref=function(e){e&&(n.resizable=e)},n.state={isResizing:!1,width:void 0===(n.propsSize&&n.propsSize.width)?"auto":n.propsSize&&n.propsSize.width,height:void 0===(n.propsSize&&n.propsSize.height)?"auto":n.propsSize&&n.propsSize.height,direction:"right",original:{x:0,y:0,width:0,height:0},backgroundStyle:{height:"100%",width:"100%",backgroundColor:"rgba(0,0,0,0)",cursor:"auto",opacity:0,position:"fixed",zIndex:9999,top:"0",left:"0",bottom:"0",right:"0"},flexBasis:void 0},n.onResizeStart=n.onResizeStart.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.onMouseUp=n.onMouseUp.bind(n),n}return oL(t,e),Object.defineProperty(t.prototype,"parentNode",{get:function(){return this.resizable?this.resizable.parentNode:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"window",{get:function(){return this.resizable&&this.resizable.ownerDocument?this.resizable.ownerDocument.defaultView:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"propsSize",{get:function(){return this.props.size||this.props.defaultSize||sL},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var e=0,t=0;if(this.resizable&&this.window){var n=this.resizable.offsetWidth,r=this.resizable.offsetHeight,o=this.resizable.style.position;"relative"!==o&&(this.resizable.style.position="relative"),e="auto"!==this.resizable.style.width?this.resizable.offsetWidth:n,t="auto"!==this.resizable.style.height?this.resizable.offsetHeight:r,this.resizable.style.position=o}return{width:e,height:t}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sizeStyle",{get:function(){var e=this,t=this.props.size,n=function(t){if(void 0===e.state[t]||"auto"===e.state[t])return"auto";if(e.propsSize&&e.propsSize[t]&&e.propsSize[t].toString().endsWith("%")){if(e.state[t].toString().endsWith("%"))return e.state[t].toString();var n=e.getParentSize();return Number(e.state[t].toString().replace("px",""))/n[t]*100+"%"}return pL(e.state[t])};return{width:t&&void 0!==t.width&&!this.state.isResizing?pL(t.width):n("width"),height:t&&void 0!==t.height&&!this.state.isResizing?pL(t.height):n("height")}},enumerable:!1,configurable:!0}),t.prototype.getParentSize=function(){if(!this.parentNode)return this.window?{width:this.window.innerWidth,height:this.window.innerHeight}:{width:0,height:0};var e=this.appendBase();if(!e)return{width:0,height:0};var t=!1,n=this.parentNode.style.flexWrap;"wrap"!==n&&(t=!0,this.parentNode.style.flexWrap="wrap"),e.style.position="relative",e.style.minWidth="100%",e.style.minHeight="100%";var r={width:e.offsetWidth,height:e.offsetHeight};return t&&(this.parentNode.style.flexWrap=n),this.removeBase(e),r},t.prototype.bindEvents=function(){this.window&&(this.window.addEventListener("mouseup",this.onMouseUp),this.window.addEventListener("mousemove",this.onMouseMove),this.window.addEventListener("mouseleave",this.onMouseUp),this.window.addEventListener("touchmove",this.onMouseMove,{capture:!0,passive:!1}),this.window.addEventListener("touchend",this.onMouseUp))},t.prototype.unbindEvents=function(){this.window&&(this.window.removeEventListener("mouseup",this.onMouseUp),this.window.removeEventListener("mousemove",this.onMouseMove),this.window.removeEventListener("mouseleave",this.onMouseUp),this.window.removeEventListener("touchmove",this.onMouseMove,!0),this.window.removeEventListener("touchend",this.onMouseUp))},t.prototype.componentDidMount=function(){if(this.resizable&&this.window){var e=this.window.getComputedStyle(this.resizable);this.setState({width:this.state.width||this.size.width,height:this.state.height||this.size.height,flexBasis:"auto"!==e.flexBasis?e.flexBasis:void 0})}},t.prototype.componentWillUnmount=function(){this.window&&this.unbindEvents()},t.prototype.createSizeForCssProperty=function(e,t){var n=this.propsSize&&this.propsSize[t];return"auto"!==this.state[t]||this.state.original[t]!==e||void 0!==n&&"auto"!==n?e:"auto"},t.prototype.calculateNewMaxFromBoundary=function(e,t){var n,r,o=this.props.boundsByDirection,i=this.state.direction,s=o&&cL("left",i),a=o&&cL("top",i);if("parent"===this.props.bounds){var l=this.parentNode;l&&(n=s?this.resizableRight-this.parentLeft:l.offsetWidth+(this.parentLeft-this.resizableLeft),r=a?this.resizableBottom-this.parentTop:l.offsetHeight+(this.parentTop-this.resizableTop))}else"window"===this.props.bounds?this.window&&(n=s?this.resizableRight:this.window.innerWidth-this.resizableLeft,r=a?this.resizableBottom:this.window.innerHeight-this.resizableTop):this.props.bounds&&(n=s?this.resizableRight-this.targetLeft:this.props.bounds.offsetWidth+(this.targetLeft-this.resizableLeft),r=a?this.resizableBottom-this.targetTop:this.props.bounds.offsetHeight+(this.targetTop-this.resizableTop));return n&&Number.isFinite(n)&&(e=e&&e<n?e:n),r&&Number.isFinite(r)&&(t=t&&t<r?t:r),{maxWidth:e,maxHeight:t}},t.prototype.calculateNewSizeFromDirection=function(e,t){var n=this.props.scale||1,r=this.props.resizeRatio||1,o=this.state,i=o.direction,s=o.original,a=this.props,l=a.lockAspectRatio,c=a.lockAspectRatioExtraHeight,u=a.lockAspectRatioExtraWidth,d=s.width,p=s.height,f=c||0,h=u||0;return cL("right",i)&&(d=s.width+(e-s.x)*r/n,l&&(p=(d-h)/this.ratio+f)),cL("left",i)&&(d=s.width-(e-s.x)*r/n,l&&(p=(d-h)/this.ratio+f)),cL("bottom",i)&&(p=s.height+(t-s.y)*r/n,l&&(d=(p-f)*this.ratio+h)),cL("top",i)&&(p=s.height-(t-s.y)*r/n,l&&(d=(p-f)*this.ratio+h)),{newWidth:d,newHeight:p}},t.prototype.calculateNewSizeFromAspectRatio=function(e,t,n,r){var o=this.props,i=o.lockAspectRatio,s=o.lockAspectRatioExtraHeight,a=o.lockAspectRatioExtraWidth,l=void 0===r.width?10:r.width,c=void 0===n.width||n.width<0?e:n.width,u=void 0===r.height?10:r.height,d=void 0===n.height||n.height<0?t:n.height,p=s||0,f=a||0;if(i){var h=(u-p)*this.ratio+f,m=(d-p)*this.ratio+f,g=(l-f)/this.ratio+p,v=(c-f)/this.ratio+p,b=Math.max(l,h),x=Math.min(c,m),y=Math.max(u,g),w=Math.min(d,v);e=aL(e,b,x),t=aL(t,y,w)}else e=aL(e,l,c),t=aL(t,u,d);return{newWidth:e,newHeight:t}},t.prototype.setBoundingClientRect=function(){if("parent"===this.props.bounds){var e=this.parentNode;if(e){var t=e.getBoundingClientRect();this.parentLeft=t.left,this.parentTop=t.top}}if(this.props.bounds&&"string"!=typeof this.props.bounds){var n=this.props.bounds.getBoundingClientRect();this.targetLeft=n.left,this.targetTop=n.top}if(this.resizable){var r=this.resizable.getBoundingClientRect(),o=r.left,i=r.top,s=r.right,a=r.bottom;this.resizableLeft=o,this.resizableRight=s,this.resizableTop=i,this.resizableBottom=a}},t.prototype.onResizeStart=function(e,t){if(this.resizable&&this.window){var n,r=0,o=0;if(e.nativeEvent&&function(e){return Boolean((e.clientX||0===e.clientX)&&(e.clientY||0===e.clientY))}(e.nativeEvent)?(r=e.nativeEvent.clientX,o=e.nativeEvent.clientY):e.nativeEvent&&uL(e.nativeEvent)&&(r=e.nativeEvent.touches[0].clientX,o=e.nativeEvent.touches[0].clientY),this.props.onResizeStart)if(this.resizable)if(!1===this.props.onResizeStart(e,t,this.resizable))return;this.props.size&&(void 0!==this.props.size.height&&this.props.size.height!==this.state.height&&this.setState({height:this.props.size.height}),void 0!==this.props.size.width&&this.props.size.width!==this.state.width&&this.setState({width:this.props.size.width})),this.ratio="number"==typeof this.props.lockAspectRatio?this.props.lockAspectRatio:this.size.width/this.size.height;var i=this.window.getComputedStyle(this.resizable);if("auto"!==i.flexBasis){var s=this.parentNode;if(s){var a=this.window.getComputedStyle(s).flexDirection;this.flexDir=a.startsWith("row")?"row":"column",n=i.flexBasis}}this.setBoundingClientRect(),this.bindEvents();var l={original:{x:r,y:o,width:this.size.width,height:this.size.height},isResizing:!0,backgroundStyle:iL(iL({},this.state.backgroundStyle),{cursor:this.window.getComputedStyle(e.target).cursor||"auto"}),direction:t,flexBasis:n};this.setState(l)}},t.prototype.onMouseMove=function(e){var t=this;if(this.state.isResizing&&this.resizable&&this.window){if(this.window.TouchEvent&&uL(e))try{e.preventDefault(),e.stopPropagation()}catch(e){}var n=this.props,r=n.maxWidth,o=n.maxHeight,i=n.minWidth,s=n.minHeight,a=uL(e)?e.touches[0].clientX:e.clientX,l=uL(e)?e.touches[0].clientY:e.clientY,c=this.state,u=c.direction,d=c.original,p=c.width,f=c.height,h=this.getParentSize(),m=function(e,t,n,r,o,i,s){return r=fL(r,e.width,t,n),o=fL(o,e.height,t,n),i=fL(i,e.width,t,n),s=fL(s,e.height,t,n),{maxWidth:void 0===r?void 0:Number(r),maxHeight:void 0===o?void 0:Number(o),minWidth:void 0===i?void 0:Number(i),minHeight:void 0===s?void 0:Number(s)}}(h,this.window.innerWidth,this.window.innerHeight,r,o,i,s);r=m.maxWidth,o=m.maxHeight,i=m.minWidth,s=m.minHeight;var g=this.calculateNewSizeFromDirection(a,l),v=g.newHeight,b=g.newWidth,x=this.calculateNewMaxFromBoundary(r,o);this.props.snap&&this.props.snap.x&&(b=dL(b,this.props.snap.x,this.props.snapGap)),this.props.snap&&this.props.snap.y&&(v=dL(v,this.props.snap.y,this.props.snapGap));var y=this.calculateNewSizeFromAspectRatio(b,v,{width:x.maxWidth,height:x.maxHeight},{width:i,height:s});if(b=y.newWidth,v=y.newHeight,this.props.grid){var w=lL(b,this.props.grid[0]),_=lL(v,this.props.grid[1]),S=this.props.snapGap||0;b=0===S||Math.abs(w-b)<=S?w:b,v=0===S||Math.abs(_-v)<=S?_:v}var C={width:b-d.width,height:v-d.height};if(p&&"string"==typeof p)if(p.endsWith("%"))b=b/h.width*100+"%";else if(p.endsWith("vw")){b=b/this.window.innerWidth*100+"vw"}else if(p.endsWith("vh")){b=b/this.window.innerHeight*100+"vh"}if(f&&"string"==typeof f)if(f.endsWith("%"))v=v/h.height*100+"%";else if(f.endsWith("vw")){v=v/this.window.innerWidth*100+"vw"}else if(f.endsWith("vh")){v=v/this.window.innerHeight*100+"vh"}var k={width:this.createSizeForCssProperty(b,"width"),height:this.createSizeForCssProperty(v,"height")};"row"===this.flexDir?k.flexBasis=k.width:"column"===this.flexDir&&(k.flexBasis=k.height),(0,Kr.flushSync)((function(){t.setState(k)})),this.props.onResize&&this.props.onResize(e,u,this.resizable,C)}},t.prototype.onMouseUp=function(e){var t=this.state,n=t.isResizing,r=t.direction,o=t.original;if(n&&this.resizable){var i={width:this.size.width-o.width,height:this.size.height-o.height};this.props.onResizeStop&&this.props.onResizeStop(e,r,this.resizable,i),this.props.size&&this.setState(this.props.size),this.unbindEvents(),this.setState({isResizing:!1,backgroundStyle:iL(iL({},this.state.backgroundStyle),{cursor:"auto"})})}},t.prototype.updateSize=function(e){this.setState({width:e.width,height:e.height})},t.prototype.renderResizer=function(){var e=this,t=this.props,n=t.enable,r=t.handleStyles,o=t.handleClasses,i=t.handleWrapperStyle,s=t.handleWrapperClass,a=t.handleComponent;if(!n)return null;var l=Object.keys(n).map((function(t){return!1!==n[t]?B.createElement(rL,{key:t,direction:t,onResizeStart:e.onResizeStart,replaceStyles:r&&r[t],className:o&&o[t]},a&&a[t]?a[t]:null):null}));return B.createElement("div",{className:s,style:i},l)},t.prototype.render=function(){var e=this,t=Object.keys(this.props).reduce((function(t,n){return-1!==hL.indexOf(n)||(t[n]=e.props[n]),t}),{}),n=iL(iL(iL({position:"relative",userSelect:this.state.isResizing?"none":"auto"},this.props.style),this.sizeStyle),{maxWidth:this.props.maxWidth,maxHeight:this.props.maxHeight,minWidth:this.props.minWidth,minHeight:this.props.minHeight,boxSizing:"border-box",flexShrink:0});this.state.flexBasis&&(n.flexBasis=this.state.flexBasis);var r=this.props.as||"div";return B.createElement(r,iL({ref:this.ref,style:n,className:this.props.className},t),this.state.isResizing&&B.createElement("div",{style:this.state.backgroundStyle}),this.props.children,this.renderResizer())},t.defaultProps={as:"div",onResizeStart:function(){},onResize:function(){},onResizeStop:function(){},enable:{top:!0,right:!0,bottom:!0,left:!0,topRight:!0,bottomRight:!0,bottomLeft:!0,topLeft:!0},style:{},grid:[1,1],lockAspectRatio:!1,lockAspectRatioExtraWidth:0,lockAspectRatioExtraHeight:0,scale:1,resizeRatio:1,snapGap:0},t}(B.PureComponent);const vL=()=>{},bL="bottom",xL="corner";function yL({axis:e,fadeTimeout:t=180,onResize:n=vL,position:r=bL,showPx:o=!1}){const[i,s]=(0,l.useResizeObserver)(),a=!!e,[u,d]=(0,c.useState)(!1),[p,f]=(0,c.useState)(!1),{width:h,height:m}=s,g=(0,c.useRef)(m),v=(0,c.useRef)(h),b=(0,c.useRef)(),x=(0,c.useCallback)((()=>{b.current&&window.clearTimeout(b.current),b.current=window.setTimeout((()=>{a||(d(!1),f(!1))}),t)}),[t,a]);(0,c.useEffect)((()=>{if(!(null!==h||null!==m))return;const e=h!==v.current,t=m!==g.current;if(e||t){if(h&&!v.current&&m&&!g.current)return v.current=h,void(g.current=m);e&&(d(!0),v.current=h),t&&(f(!0),g.current=m),n({width:h,height:m}),x()}}),[h,m,n,x]);const y=function({axis:e,height:t,moveX:n=!1,moveY:r=!1,position:o=bL,showPx:i=!1,width:s}){if(!n&&!r)return;if(o===xL)return`${s} x ${t}`;const a=i?" px":"";if(e){if("x"===e&&n)return`${s}${a}`;if("y"===e&&r)return`${t}${a}`}if(n&&r)return`${s} x ${t}`;if(n)return`${s}${a}`;if(r)return`${t}${a}`;return}({axis:e,height:m,moveX:u,moveY:p,position:r,showPx:o,width:h});return{label:y,resizeListener:i}}const wL=yl("div",{target:"e1wq7y4k3"})({name:"1cd7zoc",styles:"bottom:0;box-sizing:border-box;left:0;pointer-events:none;position:absolute;right:0;top:0"}),_L=yl("div",{target:"e1wq7y4k2"})({name:"ajymcs",styles:"align-items:center;box-sizing:border-box;display:inline-flex;justify-content:center;opacity:0;pointer-events:none;transition:opacity 120ms linear"}),SL=yl("div",{target:"e1wq7y4k1"})("background:",zl.theme.foreground,";border-radius:",Fl.radiusSmall,";box-sizing:border-box;font-family:",Ix("default.fontFamily"),";font-size:12px;color:",zl.theme.foregroundInverted,";padding:4px 8px;position:relative;"),CL=yl($v,{target:"e1wq7y4k0"})("&&&{color:",zl.theme.foregroundInverted,";display:block;font-size:13px;line-height:1.4;white-space:nowrap;}");const kL=(0,c.forwardRef)((function({label:e,position:t=xL,zIndex:n=1e3,...r},o){const i=!!e,s=t===xL;if(!i)return null;let l={opacity:i?1:void 0,zIndex:n},c={};return t===bL&&(l={...l,position:"absolute",bottom:-10,left:"50%",transform:"translate(-50%, 0)"},c={transform:"translate(0, 100%)"}),s&&(l={...l,position:"absolute",top:4,right:(0,a.isRTL)()?void 0:4,left:(0,a.isRTL)()?4:void 0}),(0,_t.jsx)(_L,{"aria-hidden":"true",className:"components-resizable-tooltip__tooltip-wrapper",ref:o,style:l,...r,children:(0,_t.jsx)(SL,{className:"components-resizable-tooltip__tooltip",style:c,children:(0,_t.jsx)(CL,{as:"span",children:e})})})})),jL=kL,EL=()=>{};const PL=(0,c.forwardRef)((function({axis:e,className:t,fadeTimeout:n=180,isVisible:r=!0,labelRef:o,onResize:i=EL,position:a=bL,showPx:l=!0,zIndex:c=1e3,...u},d){const{label:p,resizeListener:f}=yL({axis:e,fadeTimeout:n,onResize:i,showPx:l,position:a});if(!r)return null;const h=s("components-resize-tooltip",t);return(0,_t.jsxs)(wL,{"aria-hidden":"true",className:h,ref:d,...u,children:[f,(0,_t.jsx)(jL,{"aria-hidden":u["aria-hidden"],label:p,position:a,ref:o,zIndex:c})]})})),NL=PL,TL="components-resizable-box__handle",IL="components-resizable-box__side-handle",RL="components-resizable-box__corner-handle",ML={top:s(TL,IL,"components-resizable-box__handle-top"),right:s(TL,IL,"components-resizable-box__handle-right"),bottom:s(TL,IL,"components-resizable-box__handle-bottom"),left:s(TL,IL,"components-resizable-box__handle-left"),topLeft:s(TL,RL,"components-resizable-box__handle-top","components-resizable-box__handle-left"),topRight:s(TL,RL,"components-resizable-box__handle-top","components-resizable-box__handle-right"),bottomRight:s(TL,RL,"components-resizable-box__handle-bottom","components-resizable-box__handle-right"),bottomLeft:s(TL,RL,"components-resizable-box__handle-bottom","components-resizable-box__handle-left")},AL={width:void 0,height:void 0,top:void 0,right:void 0,bottom:void 0,left:void 0},DL={top:AL,right:AL,bottom:AL,left:AL,topLeft:AL,topRight:AL,bottomRight:AL,bottomLeft:AL};const zL=(0,c.forwardRef)((function({className:e,children:t,showHandle:n=!0,__experimentalShowTooltip:r=!1,__experimentalTooltipProps:o={},...i},a){return(0,_t.jsxs)(gL,{className:s("components-resizable-box__container",n&&"has-show-handle",e),handleComponent:Object.fromEntries(Object.keys(ML).map((e=>[e,(0,_t.jsx)("div",{tabIndex:-1},e)]))),handleClasses:ML,handleStyles:DL,ref:a,...i,children:[t,r&&(0,_t.jsx)(NL,{...o})]})}));const OL=function({naturalWidth:e,naturalHeight:t,children:n,isInline:r=!1}){if(1!==c.Children.count(n))return null;const o=r?"span":"div";let i;return e&&t&&(i=`${e} / ${t}`),(0,_t.jsx)(o,{className:"components-responsive-wrapper",children:(0,_t.jsx)("div",{children:(0,c.cloneElement)(n,{className:s("components-responsive-wrapper__content",n.props.className),style:{...n.props.style,aspectRatio:i}})})})},LL=function(){const{MutationObserver:e}=window;if(!e||!document.body||!window.parent)return;function t(){const e=document.body.getBoundingClientRect();window.parent.postMessage({action:"resize",width:e.width,height:e.height},"*")}function n(e){e.style&&["width","height","minHeight","maxHeight"].forEach((function(t){/^\\d+(vw|vh|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)$/.test(e.style[t])&&(e.style[t]="")}))}new e(t).observe(document.body,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}),window.addEventListener("load",t,!0),Array.prototype.forEach.call(document.querySelectorAll("[style]"),n),Array.prototype.forEach.call(document.styleSheets,(function(e){Array.prototype.forEach.call(e.cssRules||e.rules,n)})),document.body.style.position="absolute",document.body.style.width="100%",document.body.setAttribute("data-resizable-iframe-connected",""),t(),window.addEventListener("resize",t,!0)};const FL=function({html:e="",title:t="",type:n,styles:r=[],scripts:o=[],onFocus:i,tabIndex:s}){const a=(0,c.useRef)(),[u,d]=(0,c.useState)(0),[p,f]=(0,c.useState)(0);function h(i=!1){if(!function(){try{return!!a.current?.contentDocument?.body}catch(e){return!1}}())return;const{contentDocument:s,ownerDocument:l}=a.current;if(!i&&null!==s?.body.getAttribute("data-resizable-iframe-connected"))return;const u=(0,_t.jsxs)("html",{lang:l.documentElement.lang,className:n,children:[(0,_t.jsxs)("head",{children:[(0,_t.jsx)("title",{children:t}),(0,_t.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n\tbody {\n\t\tmargin: 0;\n\t}\n\thtml,\n\tbody,\n\tbody > div {\n\t\twidth: 100%;\n\t}\n\thtml.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio,\n\tbody.wp-has-aspect-ratio > div,\n\tbody.wp-has-aspect-ratio > div iframe {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\toverflow: hidden; /* If it has an aspect ratio, it shouldn't scroll. */\n\t}\n\tbody > div > * {\n\t\tmargin-top: 0 !important; /* Has to have !important to override inline styles. */\n\t\tmargin-bottom: 0 !important;\n\t}\n"}}),r.map(((e,t)=>(0,_t.jsx)("style",{dangerouslySetInnerHTML:{__html:e}},t)))]}),(0,_t.jsxs)("body",{"data-resizable-iframe-connected":"data-resizable-iframe-connected",className:n,children:[(0,_t.jsx)("div",{dangerouslySetInnerHTML:{__html:e}}),(0,_t.jsx)("script",{type:"text/javascript",dangerouslySetInnerHTML:{__html:`(${LL.toString()})();`}}),o.map((e=>(0,_t.jsx)("script",{src:e},e)))]})]});s.open(),s.write("<!DOCTYPE html>"+(0,c.renderToString)(u)),s.close()}return(0,c.useEffect)((()=>{function e(){h(!1)}function t(e){const t=a.current;if(!t||t.contentWindow!==e.source)return;let n=e.data||{};if("string"==typeof n)try{n=JSON.parse(n)}catch(e){}"resize"===n.action&&(d(n.width),f(n.height))}h();const n=a.current,r=n?.ownerDocument?.defaultView;return n?.addEventListener("load",e,!1),r?.addEventListener("message",t),()=>{n?.removeEventListener("load",e,!1),r?.removeEventListener("message",t)}}),[]),(0,c.useEffect)((()=>{h()}),[t,r,o]),(0,c.useEffect)((()=>{h(!0)}),[e,n]),(0,_t.jsx)("iframe",{ref:(0,l.useMergeRefs)([a,(0,l.useFocusableIframe)()]),title:t,tabIndex:s,className:"components-sandbox",sandbox:"allow-scripts allow-same-origin allow-presentation",onFocus:i,width:Math.ceil(u),height:Math.ceil(p)})};const BL=(0,c.forwardRef)((function({className:e,children:t,spokenMessage:n=t,politeness:r="polite",actions:o=[],onRemove:i,icon:l=null,explicitDismiss:u=!1,onDismiss:d,listRef:p},f){function h(e){e&&e.preventDefault&&e.preventDefault(),p?.current?.focus(),d?.(),i?.()}!function(e,t){const n="string"==typeof e?e:(0,c.renderToString)(e);(0,c.useEffect)((()=>{n&&(0,jy.speak)(n,t)}),[n,t])}(n,r);const m=(0,c.useRef)({onDismiss:d,onRemove:i});(0,c.useLayoutEffect)((()=>{m.current={onDismiss:d,onRemove:i}})),(0,c.useEffect)((()=>{const e=setTimeout((()=>{u||(m.current.onDismiss?.(),m.current.onRemove?.())}),1e4);return()=>clearTimeout(e)}),[u]);const g=s(e,"components-snackbar",{"components-snackbar-explicit-dismiss":!!u});o&&o.length>1&&(o=[o[0]]);const v=s("components-snackbar__content",{"components-snackbar__content-with-icon":!!l});return(0,_t.jsx)("div",{ref:f,className:g,onClick:u?void 0:h,tabIndex:0,role:u?void 0:"button",onKeyPress:u?void 0:h,"aria-label":u?void 0:(0,a.__)("Dismiss this notice"),"data-testid":"snackbar",children:(0,_t.jsxs)("div",{className:v,children:[l&&(0,_t.jsx)("div",{className:"components-snackbar__icon",children:l}),t,o.map((({label:e,onClick:t,url:n},r)=>(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,href:n,variant:"link",onClick:e=>function(e,t){e.stopPropagation(),i?.(),t&&t(e)}(e,t),className:"components-snackbar__action",children:e},r))),u&&(0,_t.jsx)("span",{role:"button","aria-label":(0,a.__)("Dismiss this notice"),tabIndex:0,className:"components-snackbar__dismiss-button",onClick:h,onKeyPress:h,children:"✕"})]})})})),VL=BL,$L={init:{height:0,opacity:0},open:{height:"auto",opacity:1,transition:{height:{type:"tween",duration:.3,ease:[0,0,.2,1]},opacity:{type:"tween",duration:.25,delay:.05,ease:[0,0,.2,1]}}},exit:{opacity:0,transition:{type:"tween",duration:.1,ease:[0,0,.2,1]}}};const HL=function({notices:e,className:t,children:n,onRemove:r}){const o=(0,c.useRef)(null),i=(0,l.useReducedMotion)();t=s("components-snackbar-list",t);const a=e=>()=>r?.(e.id);return(0,_t.jsxs)("div",{className:t,tabIndex:-1,ref:o,"data-testid":"snackbar-list",children:[n,(0,_t.jsx)(hg,{children:e.map((e=>{const{content:t,...n}=e;return(0,_t.jsx)(ag.div,{layout:!i,initial:"init",animate:"open",exit:"exit",variants:i?void 0:$L,children:(0,_t.jsx)("div",{className:"components-snackbar-list__notice-container",children:(0,_t.jsx)(VL,{...n,onRemove:a(e),listRef:o,children:e.content})})},e.id)}))})]})};const WL=al((function(e,t){const n=VE(e);return(0,_t.jsx)(_l,{...n,ref:t})}),"Surface");function UL(e={}){var t=e,{composite:n,combobox:r}=t,o=N(t,["composite","combobox"]);const i=["items","renderedItems","moves","orientation","virtualFocus","includesBaseElement","baseElement","focusLoop","focusShift","focusWrap"],s=Xe(o.store,Ye(n,i),Ye(r,i)),a=null==s?void 0:s.getState(),l=ht(P(E({},o),{store:s,includesBaseElement:F(o.includesBaseElement,null==a?void 0:a.includesBaseElement,!1),orientation:F(o.orientation,null==a?void 0:a.orientation,"horizontal"),focusLoop:F(o.focusLoop,null==a?void 0:a.focusLoop,!0)})),c=it(),u=He(P(E({},l.getState()),{selectedId:F(o.selectedId,null==a?void 0:a.selectedId,o.defaultSelectedId),selectOnMove:F(o.selectOnMove,null==a?void 0:a.selectOnMove,!0)}),l,s);We(u,(()=>Ke(u,["moves"],(()=>{const{activeId:e,selectOnMove:t}=u.getState();if(!t)return;if(!e)return;const n=l.item(e);n&&(n.dimmed||n.disabled||u.setState("selectedId",n.id))}))));let d=!0;We(u,(()=>qe(u,["selectedId"],((e,t)=>{d?n&&e.selectedId===t.selectedId||u.setState("activeId",e.selectedId):d=!0})))),We(u,(()=>Ke(u,["selectedId","renderedItems"],(e=>{if(void 0!==e.selectedId)return;const{activeId:t,renderedItems:n}=u.getState(),r=l.item(t);if(!r||r.disabled||r.dimmed){const e=n.find((e=>!e.disabled&&!e.dimmed));u.setState("selectedId",null==e?void 0:e.id)}else u.setState("selectedId",r.id)})))),We(u,(()=>Ke(u,["renderedItems"],(e=>{const t=e.renderedItems;if(t.length)return Ke(c,["renderedItems"],(e=>{const n=e.renderedItems,r=n.some((e=>!e.tabId));r&&n.forEach(((e,n)=>{if(e.tabId)return;const r=t[n];r&&c.renderItem(P(E({},e),{tabId:r.id}))}))}))}))));let p=null;return We(u,(()=>{const e=()=>{p=u.getState().selectedId},t=()=>{d=!1,u.setState("selectedId",p)};return n&&"setSelectElement"in n?M(Ke(n,["value"],e),Ke(n,["mounted"],t)):r?M(Ke(r,["selectedValue"],e),Ke(r,["mounted"],t)):void 0})),P(E(E({},l),u),{panels:c,setSelectedId:e=>u.setState("selectedId",e),select:e=>{u.setState("selectedId",e),l.move(e)}})}function GL(e={}){const t=NT(),n=AT()||t;e=b(v({},e),{composite:void 0!==e.composite?e.composite:n,combobox:void 0!==e.combobox?e.combobox:t});const[r,o]=rt(UL,e);return function(e,t,n){Te(t,[n.composite,n.combobox]),nt(e=gt(e,t,n),n,"selectedId","setSelectedId"),nt(e,n,"selectOnMove");const[r,o]=rt((()=>e.panels),{});return Te(o,[e,o]),Object.assign((0,B.useMemo)((()=>b(v({},e),{panels:r})),[e,r]),{composite:n.composite,combobox:n.combobox})}(r,o,e)}var KL=Et([Mt],[At]),qL=(KL.useContext,KL.useScopedContext),YL=KL.useProviderContext,XL=(KL.ContextProvider,KL.ScopedContextProvider),ZL=jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=YL();D(n=n||o,!1);const i=n.useState((e=>"both"===e.orientation?void 0:e.orientation));return r=Me(r,(e=>(0,_t.jsx)(XL,{value:n,children:e})),[n]),n.composite&&(r=v({focusable:!1},r)),r=v({role:"tablist","aria-orientation":i},r),r=cn(v({store:n},r))})),QL=St((function(e){return kt("div",ZL(e))})),JL=jt((function(e){var t,n=e,{store:r,getItem:o}=n,i=x(n,["store","getItem"]);const s=qL();D(r=r||s,!1);const a=Pe(),l=i.id||a,c=O(i),u=(0,B.useCallback)((e=>{const t=b(v({},e),{dimmed:c});return o?o(t):t}),[c,o]),d=i.onClick,p=ke((e=>{null==d||d(e),e.defaultPrevented||null==r||r.setSelectedId(l)})),f=r.panels.useState((e=>{var t;return null==(t=e.items.find((e=>e.tabId===l)))?void 0:t.id})),h=!!a&&i.shouldRegisterItem,m=r.useState((e=>!!l&&e.activeId===l)),g=r.useState((e=>!!l&&e.selectedId===l)),y=r.useState((e=>!!r.item(e.activeId))),w=m||g&&!y,_=g||null==(t=i.accessibleWhenDisabled)||t;if(et(r.combobox||r.composite,"virtualFocus")&&(i=b(v({},i),{tabIndex:-1})),i=b(v({id:l,role:"tab","aria-selected":g,"aria-controls":f||void 0},i),{onClick:p}),r.composite){const e={id:l,accessibleWhenDisabled:_,store:r.composite,shouldRegisterItem:w&&h,rowId:i.rowId,render:i.render};i=b(v({},i),{render:(0,_t.jsx)(An,b(v({},e),{render:r.combobox&&r.composite!==r.combobox?(0,_t.jsx)(An,b(v({},e),{store:r.combobox})):e.render}))})}return i=Mn(b(v({store:r},i),{accessibleWhenDisabled:_,getItem:u,shouldRegisterItem:h}))})),eF=Ct(St((function(e){return kt("button",JL(e))}))),tF=jt((function(e){var t=e,{store:n,unmountOnHide:r,tabId:o,getItem:i,scrollRestoration:s,scrollElement:a}=t,l=x(t,["store","unmountOnHide","tabId","getItem","scrollRestoration","scrollElement"]);const c=YL();D(n=n||c,!1);const u=(0,B.useRef)(null),d=Pe(l.id),p=et(n.panels,(()=>{var e;return o||(null==(e=null==n?void 0:n.panels.item(d))?void 0:e.tabId)})),f=Yn({open:et(n,(e=>!!p&&e.selectedId===p))}),h=et(f,"mounted"),m=(0,B.useRef)(new Map),g=ke((()=>{const e=u.current;return e?a?"function"==typeof a?a(e):"current"in a?a.current:a:e:null}));(0,B.useEffect)((()=>{var e,t;if(!s)return;if(!h)return;const n=g();if(!n)return;if("reset"===s)return void n.scroll(0,0);if(!p)return;const r=m.current.get(p);n.scroll(null!=(e=null==r?void 0:r.x)?e:0,null!=(t=null==r?void 0:r.y)?t:0);const o=()=>{m.current.set(p,{x:n.scrollLeft,y:n.scrollTop})};return n.addEventListener("scroll",o),()=>{n.removeEventListener("scroll",o)}}),[s,h,p,g,n]);const[y,w]=(0,B.useState)(!1);(0,B.useEffect)((()=>{const e=u.current;if(!e)return;const t=$t(e);w(!!t.length)}),[]);const _=(0,B.useCallback)((e=>{const t=b(v({},e),{id:d||e.id,tabId:o});return i?i(t):t}),[d,o,i]),S=l.onKeyDown,C=ke((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!(null==n?void 0:n.composite))return;const t={ArrowLeft:n.previous,ArrowRight:n.next,Home:n.first,End:n.last}[e.key];if(!t)return;const{selectedId:r}=n.getState(),o=t({activeId:r});o&&(e.preventDefault(),n.move(o))}));return l=Me(l,(e=>(0,_t.jsx)(XL,{value:n,children:e})),[n]),l=b(v({id:d,role:"tabpanel","aria-labelledby":p||void 0},l),{children:r&&!h?null:l.children,ref:Ee(u,l.ref),onKeyDown:C}),l=an(v({focusable:!n.composite&&!y},l)),l=Zr(v({store:f},l)),l=En(b(v({store:n.panels},l),{getItem:_}))})),nF=St((function(e){return kt("div",tF(e))}));const rF=e=>{if(null!=e)return e.match(/^tab-panel-[0-9]*-(.*)/)?.[1]},oF=(0,c.forwardRef)((({className:e,children:t,tabs:n,selectOnMove:r=!0,initialTabName:o,orientation:i="horizontal",activeClass:u="is-active",onSelect:d},p)=>{const f=(0,l.useInstanceId)(oF,"tab-panel"),h=(0,c.useCallback)((e=>{if(void 0!==e)return`${f}-${e}`}),[f]),m=GL({setSelectedId:e=>{if(null==e)return;const t=n.find((t=>h(t.name)===e));if(t?.disabled||t===b)return;const r=rF(e);void 0!==r&&d?.(r)},orientation:i,selectOnMove:r,defaultSelectedId:h(o),rtl:(0,a.isRTL)()}),g=rF(et(m,"selectedId")),v=(0,c.useCallback)((e=>{m.setState("selectedId",h(e))}),[h,m]),b=n.find((({name:e})=>e===g)),x=(0,l.usePrevious)(g);return(0,c.useEffect)((()=>{x!==g&&g===o&&g&&d?.(g)}),[g,o,d,x]),(0,c.useLayoutEffect)((()=>{if(b)return;const e=n.find((e=>e.name===o));if(!o||e)if(e&&!e.disabled)v(e.name);else{const e=n.find((e=>!e.disabled));e&&v(e.name)}}),[n,b,o,f,v]),(0,c.useEffect)((()=>{if(!b?.disabled)return;const e=n.find((e=>!e.disabled));e&&v(e.name)}),[n,b?.disabled,v,f]),(0,_t.jsxs)("div",{className:e,ref:p,children:[(0,_t.jsx)(QL,{store:m,className:"components-tab-panel__tabs",children:n.map((e=>(0,_t.jsx)(eF,{id:h(e.name),className:s("components-tab-panel__tabs-item",e.className,{[u]:e.name===g}),disabled:e.disabled,"aria-controls":`${h(e.name)}-view`,render:(0,_t.jsx)(Jx,{__next40pxDefaultSize:!0,icon:e.icon,label:e.icon&&e.title,showTooltip:!!e.icon}),children:!e.icon&&e.title},e.name)))}),b&&(0,_t.jsx)(nF,{id:`${h(b.name)}-view`,store:m,tabId:h(b.name),className:"components-tab-panel__tab-content",children:t(b)})]})})),iF=oF;const sF=(0,c.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n,__next40pxDefaultSize:r=!1,label:o,hideLabelFromVision:i,value:a,help:c,id:u,className:d,onChange:p,type:f="text",...h}=e,m=(0,l.useInstanceId)(sF,"inspector-text-control",u);return Ux({componentName:"TextControl",size:void 0,__next40pxDefaultSize:r}),(0,_t.jsx)(Wx,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"TextControl",label:o,hideLabelFromVision:i,id:m,help:c,className:d,children:(0,_t.jsx)("input",{className:s("components-text-control__input",{"is-next-40px-default-size":r}),type:f,id:m,value:a,onChange:e=>p(e.target.value),"aria-describedby":c?m+"__help":void 0,ref:t,...h})})})),aF=sF,lF={huge:"1440px",wide:"1280px","x-large":"1080px",large:"960px",medium:"782px",small:"600px",mobile:"480px","zoomed-in":"280px"},cF=Nl("box-shadow:0 0 0 transparent;border-radius:",Fl.radiusSmall,";border:",Fl.borderWidth," solid ",zl.ui.border,";@media not ( prefers-reduced-motion ){transition:box-shadow 0.1s linear;}",""),uF=Nl("border-color:",zl.theme.accent,";box-shadow:0 0 0 calc( ",Fl.borderWidthFocus," - ",Fl.borderWidth," ) ",zl.theme.accent,";outline:2px solid transparent;",""),dF=yl("textarea",{target:"e1w5nnrk0"})("width:100%;display:block;font-family:",Ix("default.fontFamily"),";line-height:20px;padding:9px 11px;",cF,";font-size:",Ix("mobileTextMinFontSize"),";",`@media (min-width: ${lF["small"]})`,"{font-size:",Ix("default.fontSize"),";}&:focus{",uF,";}&::-webkit-input-placeholder{color:",zl.ui.darkGrayPlaceholder,";}&::-moz-placeholder{color:",zl.ui.darkGrayPlaceholder,";}&:-ms-input-placeholder{color:",zl.ui.darkGrayPlaceholder,";}.is-dark-theme &{&::-webkit-input-placeholder{color:",zl.ui.lightGrayPlaceholder,";}&::-moz-placeholder{color:",zl.ui.lightGrayPlaceholder,";}&:-ms-input-placeholder{color:",zl.ui.lightGrayPlaceholder,";}}");const pF=(0,c.forwardRef)((function(e,t){const{__nextHasNoMarginBottom:n,label:r,hideLabelFromVision:o,value:i,help:s,onChange:a,rows:c=4,className:u,...d}=e,p=`inspector-textarea-control-${(0,l.useInstanceId)(pF)}`;return(0,_t.jsx)(Wx,{__nextHasNoMarginBottom:n,__associatedWPComponentName:"TextareaControl",label:r,hideLabelFromVision:o,id:p,help:s,className:u,children:(0,_t.jsx)(dF,{className:"components-textarea-control__input",id:p,rows:c,onChange:e=>a(e.target.value),"aria-describedby":s?p+"__help":void 0,value:i,ref:t,...d})})})),fF=pF,hF=e=>{const{text:t="",highlight:n=""}=e,r=n.trim();if(!r)return(0,_t.jsx)(_t.Fragment,{children:t});const o=new RegExp(`(${Iy(r)})`,"gi");return(0,c.createInterpolateElement)(t.replace(o,"<mark>$&</mark>"),{mark:(0,_t.jsx)("mark",{})})},mF=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"})});const gF=function(e){const{children:t}=e;return(0,_t.jsxs)("div",{className:"components-tip",children:[(0,_t.jsx)(oS,{icon:mF}),(0,_t.jsx)("p",{children:t})]})};const vF=(0,c.forwardRef)((function({__nextHasNoMarginBottom:e,label:t,checked:n,help:r,className:o,onChange:i,disabled:a},c){const u=`inspector-toggle-control-${(0,l.useInstanceId)(vF)}`,d=il()("components-toggle-control",o,!e&&Nl({marginBottom:Il(3)},"",""));let p,f;return e||Xi()("Bottom margin styles for wp.components.ToggleControl",{since:"6.7",version:"7.0",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version."}),r&&("function"==typeof r?void 0!==n&&(f=r(n)):f=r,f&&(p=u+"__help")),(0,_t.jsx)(Wx,{id:u,help:f&&(0,_t.jsx)("span",{className:"components-toggle-control__help",children:f}),className:d,__nextHasNoMarginBottom:!0,children:(0,_t.jsxs)(fy,{justify:"flex-start",spacing:2,children:[(0,_t.jsx)(sD,{id:u,checked:n,onChange:function(e){i(e.target.checked)},"aria-describedby":p,disabled:a,ref:c}),(0,_t.jsx)(Eg,{as:"label",htmlFor:u,className:s("components-toggle-control__label",{"is-disabled":a}),children:t})]})})})),bF=vF;var xF=Et([Mt],[At]),yF=xF.useContext,wF=(xF.useScopedContext,xF.useProviderContext),_F=(xF.ContextProvider,xF.ScopedContextProvider),SF=jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=yF();return r=Mn(v({store:n=n||o},r))})),CF=Ct(St((function(e){return kt("button",SF(e))})));const kF=(0,c.createContext)(void 0);const jF=(0,c.forwardRef)((function({children:e,as:t,...n},r){const o=(0,c.useContext)(kF),i="function"==typeof e;if(!i&&!t)return null;const s={...n,ref:r,"data-toolbar-item":!0};if(!o)return t?(0,_t.jsx)(t,{...s,children:e}):i?e(s):null;const a=i?e:t&&(0,_t.jsx)(t,{children:e});return(0,_t.jsx)(CF,{accessibleWhenDisabled:!0,...s,store:o,render:a})})),EF=({children:e,className:t})=>(0,_t.jsx)("div",{className:t,children:e});const PF=(0,c.forwardRef)((function(e,t){const{children:n,className:r,containerClassName:o,extraProps:i,isActive:a,title:l,...u}=function({isDisabled:e,...t}){return{disabled:e,...t}}(e);return(0,c.useContext)(kF)?(0,_t.jsx)(jF,{className:s("components-toolbar-button",r),...i,...u,ref:t,children:e=>(0,_t.jsx)(Jx,{size:"compact",label:l,isPressed:a,...e,children:n})}):(0,_t.jsx)(EF,{className:o,children:(0,_t.jsx)(Jx,{ref:t,icon:u.icon,size:"compact",label:l,shortcut:u.shortcut,"data-subscript":u.subscript,onClick:e=>{e.stopPropagation(),u.onClick&&u.onClick(e)},className:s("components-toolbar__control",r),isPressed:a,accessibleWhenDisabled:!0,"data-toolbar-item":!0,...i,...u,children:n})})})),NF=({className:e,children:t,...n})=>(0,_t.jsx)("div",{className:e,...n,children:t});const TF=function({controls:e=[],toggleProps:t,...n}){const r=t=>(0,_t.jsx)(NN,{controls:e,toggleProps:{...t,"data-toolbar-item":!0},...n});return(0,c.useContext)(kF)?(0,_t.jsx)(jF,{...t,children:r}):r(t)};const IF=function({controls:e=[],children:t,className:n,isCollapsed:r,title:o,...i}){const a=(0,c.useContext)(kF);if(!(e&&e.length||t))return null;const l=s(a?"components-toolbar-group":"components-toolbar",n);let u;var d;return d=e,u=Array.isArray(d)&&Array.isArray(d[0])?e:[e],r?(0,_t.jsx)(TF,{label:o,controls:u,className:l,children:t,...i}):(0,_t.jsxs)(NF,{className:l,...i,children:[u?.flatMap(((e,t)=>e.map(((e,n)=>(0,_t.jsx)(PF,{containerClassName:t>0&&0===n?"has-left-divider":void 0,...e},[t,n].join()))))),t]})};function RF(e={}){var t;const n=null==(t=e.store)?void 0:t.getState();return ht(P(E({},e),{orientation:F(e.orientation,null==n?void 0:n.orientation,"horizontal"),focusLoop:F(e.focusLoop,null==n?void 0:n.focusLoop,!0)}))}function MF(e={}){const[t,n]=rt(RF,e);return function(e,t,n){return gt(e,t,n)}(t,n,e)}var AF=jt((function(e){var t=e,{store:n,orientation:r,virtualFocus:o,focusLoop:i,rtl:s}=t,a=x(t,["store","orientation","virtualFocus","focusLoop","rtl"]);const l=wF(),c=MF({store:n=n||l,orientation:r,virtualFocus:o,focusLoop:i,rtl:s}),u=c.useState((e=>"both"===e.orientation?void 0:e.orientation));return a=Me(a,(e=>(0,_t.jsx)(_F,{value:c,children:e})),[c]),a=v({role:"toolbar","aria-orientation":u},a),a=cn(v({store:c},a))})),DF=St((function(e){return kt("div",AF(e))}));const zF=(0,c.forwardRef)((function({label:e,...t},n){const r=MF({focusLoop:!0,rtl:(0,a.isRTL)()});return(0,_t.jsx)(kF.Provider,{value:r,children:(0,_t.jsx)(DF,{ref:n,"aria-label":e,store:r,...t})})}));const OF=(0,c.forwardRef)((function({className:e,label:t,variant:n,...r},o){const i=void 0!==n,a=(0,c.useMemo)((()=>i?{}:{DropdownMenu:{variant:"toolbar"},Dropdown:{variant:"toolbar"},Menu:{variant:"toolbar"}}),[i]);if(!t){Xi()("Using Toolbar without label prop",{since:"5.6",alternative:"ToolbarGroup component",link:"https://developer.wordpress.org/block-editor/components/toolbar/"});const{title:t,...n}=r;return(0,_t.jsx)(IF,{isCollapsed:!1,...n,className:e})}const l=s("components-accessible-toolbar",e,n&&`is-${n}`);return(0,_t.jsx)(gs,{value:a,children:(0,_t.jsx)(zF,{className:l,label:t,ref:o,...r})})}));const LF=(0,c.forwardRef)((function(e,t){return(0,c.useContext)(kF)?(0,_t.jsx)(jF,{ref:t,...e.toggleProps,children:t=>(0,_t.jsx)(NN,{...e,popoverProps:{...e.popoverProps},toggleProps:t})}):(0,_t.jsx)(NN,{...e})}));const FF={columns:e=>Nl("grid-template-columns:",`repeat( ${e}, minmax(0, 1fr) )`,";",""),spacing:Nl("column-gap:",Il(4),";row-gap:",Il(4),";",""),item:{fullWidth:{name:"18iuzk9",styles:"grid-column:1/-1"}}},BF={name:"huufmu",styles:">div:not( :first-of-type ){display:none;}"},VF=Nl(FF.item.fullWidth," gap:",Il(2),";.components-dropdown-menu{margin:",Il(-1)," 0;line-height:0;}&&&& .components-dropdown-menu__toggle{padding:0;min-width:",Il(6),";}",""),$F={name:"1pmxm02",styles:"font-size:inherit;font-weight:500;line-height:normal;&&{margin:0;}"},HF=Nl(FF.item.fullWidth,"&>div,&>fieldset{padding-bottom:0;margin-bottom:0;max-width:100%;}&& ",Mx,"{margin-bottom:0;",Dx,":last-child{margin-bottom:0;}}",Bx,"{margin-bottom:0;}&& ",lb,"{label{line-height:1.4em;}}",""),WF={name:"eivff4",styles:"display:none"},UF={name:"16gsvie",styles:"min-width:200px"},GF=yl("span",{target:"ews648u0"})("color:",zl.theme.accentDarker10,";font-size:11px;font-weight:500;line-height:1.4;",Mg({marginLeft:Il(3)})," text-transform:uppercase;"),KF=Nl("color:",zl.gray[900],";&&[aria-disabled='true']{color:",zl.gray[700],";opacity:1;&:hover{color:",zl.gray[700],";}",GF,"{opacity:0.3;}}",""),qF=()=>{},YF=(0,c.createContext)({menuItems:{default:{},optional:{}},hasMenuItems:!1,isResetting:!1,shouldRenderPlaceholderItems:!1,registerPanelItem:qF,deregisterPanelItem:qF,flagItemCustomization:qF,registerResetAllFilter:qF,deregisterResetAllFilter:qF,areAllOptionalControlsHidden:!0}),XF=()=>(0,c.useContext)(YF);const ZF=({itemClassName:e,items:t,toggleItem:n})=>{if(!t.length)return null;const r=(0,_t.jsx)(GF,{"aria-hidden":!0,children:(0,a.__)("Reset")});return(0,_t.jsx)(_t.Fragment,{children:t.map((([t,o])=>o?(0,_t.jsx)(_D,{className:e,role:"menuitem",label:(0,a.sprintf)((0,a.__)("Reset %s"),t),onClick:()=>{n(t),(0,jy.speak)((0,a.sprintf)((0,a.__)("%s reset to default"),t),"assertive")},suffix:r,children:t},t):(0,_t.jsx)(_D,{icon:ok,className:e,role:"menuitemcheckbox",isSelected:!0,"aria-disabled":!0,children:t},t)))})},QF=({items:e,toggleItem:t})=>e.length?(0,_t.jsx)(_t.Fragment,{children:e.map((([e,n])=>{const r=n?(0,a.sprintf)((0,a.__)("Hide and reset %s"),e):(0,a.sprintf)((0,a._x)("Show %s","input control"),e);return(0,_t.jsx)(_D,{icon:n?ok:null,isSelected:n,label:r,onClick:()=>{n?(0,jy.speak)((0,a.sprintf)((0,a.__)("%s hidden and reset to default"),e),"assertive"):(0,jy.speak)((0,a.sprintf)((0,a.__)("%s is now visible"),e),"assertive"),t(e)},role:"menuitemcheckbox",children:e},e)}))}):null,JF=al(((e,t)=>{const{areAllOptionalControlsHidden:n,defaultControlsItemClassName:r,dropdownMenuClassName:o,hasMenuItems:i,headingClassName:s,headingLevel:l=2,label:u,menuItems:d,resetAll:p,toggleItem:f,dropdownMenuProps:h,...m}=function(e){const{className:t,headingLevel:n=2,...r}=sl(e,"ToolsPanelHeader"),o=il(),i=(0,c.useMemo)((()=>o(VF,t)),[t,o]),s=(0,c.useMemo)((()=>o(UF)),[o]),a=(0,c.useMemo)((()=>o($F)),[o]),l=(0,c.useMemo)((()=>o(KF)),[o]),{menuItems:u,hasMenuItems:d,areAllOptionalControlsHidden:p}=XF();return{...r,areAllOptionalControlsHidden:p,defaultControlsItemClassName:l,dropdownMenuClassName:s,hasMenuItems:d,headingClassName:a,headingLevel:n,menuItems:u,className:i}}(e);if(!u)return null;const g=Object.entries(d?.default||{}),v=Object.entries(d?.optional||{}),b=n?Og:_P,x=(0,a.sprintf)((0,a._x)("%s options","Button label to reveal tool panel options"),u),y=n?(0,a.__)("All options are currently hidden"):void 0,w=[...g,...v].some((([,e])=>e));return(0,_t.jsxs)(fy,{...m,ref:t,children:[(0,_t.jsx)(mk,{level:l,className:s,children:u}),i&&(0,_t.jsx)(NN,{...h,icon:b,label:x,menuProps:{className:o},toggleProps:{size:"small",description:y},children:()=>(0,_t.jsxs)(_t.Fragment,{children:[(0,_t.jsxs)(yD,{label:u,children:[(0,_t.jsx)(ZF,{items:g,toggleItem:f,itemClassName:r}),(0,_t.jsx)(QF,{items:v,toggleItem:f})]}),(0,_t.jsx)(yD,{children:(0,_t.jsx)(_D,{"aria-disabled":!w,variant:"tertiary",onClick:()=>{w&&(p(),(0,jy.speak)((0,a.__)("All options reset"),"assertive"))},children:(0,a.__)("Reset all")})})]})})]})}),"ToolsPanelHeader"),eB=JF;function tB(){return{panelItems:[],menuItemOrder:[],menuItems:{default:{},optional:{}}}}const nB=({panelItems:e,shouldReset:t,currentMenuItems:n,menuItemOrder:r})=>{const o={default:{},optional:{}},i={default:{},optional:{}};return e.forEach((({hasValue:e,isShownByDefault:r,label:i})=>{const s=r?"default":"optional",a=n?.[s]?.[i],l=a||e();o[s][i]=!t&&l})),r.forEach((e=>{o.default.hasOwnProperty(e)&&(i.default[e]=o.default[e]),o.optional.hasOwnProperty(e)&&(i.optional[e]=o.optional[e])})),Object.keys(o.default).forEach((e=>{i.default.hasOwnProperty(e)||(i.default[e]=o.default[e])})),Object.keys(o.optional).forEach((e=>{i.optional.hasOwnProperty(e)||(i.optional[e]=o.optional[e])})),i};function rB(e,t){const n=function(e,t){switch(t.type){case"REGISTER_PANEL":{const n=[...e],r=n.findIndex((e=>e.label===t.item.label));return-1!==r&&n.splice(r,1),n.push(t.item),n}case"UNREGISTER_PANEL":{const n=e.findIndex((e=>e.label===t.label));if(-1!==n){const t=[...e];return t.splice(n,1),t}return e}default:return e}}(e.panelItems,t),r=function(e,t){return"REGISTER_PANEL"===t.type?e.includes(t.item.label)?e:[...e,t.item.label]:e}(e.menuItemOrder,t),o=function(e,t){switch(t.type){case"REGISTER_PANEL":case"UNREGISTER_PANEL":return nB({currentMenuItems:e.menuItems,panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!1});case"RESET_ALL":return nB({panelItems:e.panelItems,menuItemOrder:e.menuItemOrder,shouldReset:!0});case"UPDATE_VALUE":{const n=e.menuItems[t.group][t.label];return t.value===n?e.menuItems:{...e.menuItems,[t.group]:{...e.menuItems[t.group],[t.label]:t.value}}}case"TOGGLE_VALUE":{const n=e.panelItems.find((e=>e.label===t.label));if(!n)return e.menuItems;const r=n.isShownByDefault?"default":"optional";return{...e.menuItems,[r]:{...e.menuItems[r],[t.label]:!e.menuItems[r][t.label]}}}default:return e.menuItems}}({panelItems:n,menuItemOrder:r,menuItems:e.menuItems},t);return{panelItems:n,menuItemOrder:r,menuItems:o}}function oB(e,t){switch(t.type){case"REGISTER":return[...e,t.filter];case"UNREGISTER":return e.filter((e=>e!==t.filter));default:return e}}const iB=e=>0===Object.keys(e).length;function sB(e){const{className:t,headingLevel:n=2,resetAll:r,panelId:o,hasInnerWrapper:i=!1,shouldRenderPlaceholderItems:s=!1,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l,...u}=sl(e,"ToolsPanel"),d=(0,c.useRef)(!1),p=d.current;(0,c.useEffect)((()=>{p&&(d.current=!1)}),[p]);const[{panelItems:f,menuItems:h},m]=(0,c.useReducer)(rB,void 0,tB),[g,v]=(0,c.useReducer)(oB,[]),b=(0,c.useCallback)((e=>{m({type:"REGISTER_PANEL",item:e})}),[]),x=(0,c.useCallback)((e=>{m({type:"UNREGISTER_PANEL",label:e})}),[]),y=(0,c.useCallback)((e=>{v({type:"REGISTER",filter:e})}),[]),w=(0,c.useCallback)((e=>{v({type:"UNREGISTER",filter:e})}),[]),_=(0,c.useCallback)(((e,t,n="default")=>{m({type:"UPDATE_VALUE",group:n,label:t,value:e})}),[]),S=(0,c.useMemo)((()=>iB(h.default)&&!iB(h.optional)&&Object.values(h.optional).every((e=>!e))),[h]),C=il(),k=(0,c.useMemo)((()=>{const e=i&&Nl(">div:not( :first-of-type ){display:grid;",FF.columns(2)," ",FF.spacing," ",FF.item.fullWidth,";}","");const n=S&&BF;return C((e=>Nl(FF.columns(e)," ",FF.spacing," border-top:",Fl.borderWidth," solid ",zl.gray[300],";margin-top:-1px;padding:",Il(4),";",""))(2),e,n,t)}),[S,t,C,i]),j=(0,c.useCallback)((e=>{m({type:"TOGGLE_VALUE",label:e})}),[]),E=(0,c.useCallback)((()=>{"function"==typeof r&&(d.current=!0,r(g)),m({type:"RESET_ALL"})}),[g,r]),P=e=>{const t=h.optional||{},n=e.find((e=>e.isShownByDefault||t[e.label]));return n?.label},N=P(f),T=P([...f].reverse()),I=f.length>0;return{...u,headingLevel:n,panelContext:(0,c.useMemo)((()=>({areAllOptionalControlsHidden:S,deregisterPanelItem:x,deregisterResetAllFilter:w,firstDisplayedItem:N,flagItemCustomization:_,hasMenuItems:I,isResetting:d.current,lastDisplayedItem:T,menuItems:h,panelId:o,registerPanelItem:b,registerResetAllFilter:y,shouldRenderPlaceholderItems:s,__experimentalFirstVisibleItemClass:a,__experimentalLastVisibleItemClass:l})),[S,x,w,N,_,T,h,o,I,y,b,s,a,l]),resetAllItems:E,toggleItem:j,className:k}}const aB=al(((e,t)=>{const{children:n,label:r,panelContext:o,resetAllItems:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l,...c}=sB(e);return(0,_t.jsx)(cj,{...c,columns:2,ref:t,children:(0,_t.jsxs)(YF.Provider,{value:o,children:[(0,_t.jsx)(eB,{label:r,resetAll:i,toggleItem:s,headingLevel:a,dropdownMenuProps:l}),n]})})}),"ToolsPanel"),lB=()=>{};const cB=al(((e,t)=>{const{children:n,isShown:r,shouldRenderPlaceholder:o,...i}=function(e){const{className:t,hasValue:n,isShownByDefault:r=!1,label:o,panelId:i,resetAllFilter:s=lB,onDeselect:a,onSelect:u,...d}=sl(e,"ToolsPanelItem"),{panelId:p,menuItems:f,registerResetAllFilter:h,deregisterResetAllFilter:m,registerPanelItem:g,deregisterPanelItem:v,flagItemCustomization:b,isResetting:x,shouldRenderPlaceholderItems:y,firstDisplayedItem:w,lastDisplayedItem:_,__experimentalFirstVisibleItemClass:S,__experimentalLastVisibleItemClass:C}=XF(),k=(0,c.useCallback)(n,[i]),j=(0,c.useCallback)(s,[i]),E=(0,l.usePrevious)(p),P=p===i||null===p;(0,c.useLayoutEffect)((()=>(P&&null!==E&&g({hasValue:k,isShownByDefault:r,label:o,panelId:i}),()=>{(null===E&&p||p===i)&&v(o)})),[p,P,r,o,k,i,E,g,v]),(0,c.useEffect)((()=>(P&&h(j),()=>{P&&m(j)})),[h,m,j,P]);const N=r?"default":"optional",T=f?.[N]?.[o],I=(0,l.usePrevious)(T),R=void 0!==f?.[N]?.[o],M=n();(0,c.useEffect)((()=>{(r||M)&&b(M,o,N)}),[M,N,o,b,r]),(0,c.useEffect)((()=>{R&&!x&&P&&(!T||M||I||u?.(),!T&&M&&I&&a?.())}),[P,T,R,x,M,I,u,a]);const A=r?void 0!==f?.[N]?.[o]:T,D=il(),z=(0,c.useMemo)((()=>{const e=y&&!A;return D(HF,e&&WF,!e&&t,w===o&&S,_===o&&C)}),[A,y,t,D,w,_,S,C,o]);return{...d,isShown:A,shouldRenderPlaceholder:y,className:z}}(e);return r?(0,_t.jsx)(_l,{...i,ref:t,children:n}):o?(0,_t.jsx)(_l,{...i,ref:t}):null}),"ToolsPanelItem"),uB=cB,dB=(0,c.createContext)(void 0),pB=dB.Provider;function fB({children:e}){const[t,n]=(0,c.useState)(),r=(0,c.useMemo)((()=>({lastFocusedElement:t,setLastFocusedElement:n})),[t]);return(0,_t.jsx)(pB,{value:r,children:e})}function hB(e){return bN.focus.focusable.find(e,{sequential:!0}).filter((t=>t.closest('[role="row"]')===e))}const mB=(0,c.forwardRef)((function({children:e,onExpandRow:t=()=>{},onCollapseRow:n=()=>{},onFocusRow:r=()=>{},applicationAriaLabel:o,...i},s){const a=(0,c.useCallback)((e=>{const{keyCode:o,metaKey:i,ctrlKey:s,altKey:a}=e;if(i||s||a||![Ey.UP,Ey.DOWN,Ey.LEFT,Ey.RIGHT,Ey.HOME,Ey.END].includes(o))return;e.stopPropagation();const{activeElement:l}=document,{currentTarget:c}=e;if(!l||!c.contains(l))return;const u=l.closest('[role="row"]');if(!u)return;const d=hB(u),p=d.indexOf(l),f=0===p,h=f&&("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))&&o===Ey.RIGHT;if([Ey.LEFT,Ey.RIGHT].includes(o)){let r;if(r=o===Ey.LEFT?Math.max(0,p-1):Math.min(p+1,d.length-1),f){if(o===Ey.LEFT){var m;if("true"===u.getAttribute("data-expanded")||"true"===u.getAttribute("aria-expanded"))return n(u),void e.preventDefault();const t=Math.max(parseInt(null!==(m=u?.getAttribute("aria-level"))&&void 0!==m?m:"1",10)-1,1),r=Array.from(c.querySelectorAll('[role="row"]'));let o=u;for(let e=r.indexOf(u);e>=0;e--){const n=r[e].getAttribute("aria-level");if(null!==n&&parseInt(n,10)===t){o=r[e];break}}hB(o)?.[0]?.focus()}if(o===Ey.RIGHT){if("false"===u.getAttribute("data-expanded")||"false"===u.getAttribute("aria-expanded"))return t(u),void e.preventDefault();const n=hB(u);n.length>0&&n[r]?.focus()}return void e.preventDefault()}if(h)return;d[r].focus(),e.preventDefault()}else if([Ey.UP,Ey.DOWN].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===Ey.UP?Math.max(0,n-1):Math.min(n+1,t.length-1),i===n)return void e.preventDefault();const s=hB(t[i]);if(!s||!s.length)return void e.preventDefault();s[Math.min(p,s.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}else if([Ey.HOME,Ey.END].includes(o)){const t=Array.from(c.querySelectorAll('[role="row"]')),n=t.indexOf(u);let i;if(i=o===Ey.HOME?0:t.length-1,i===n)return void e.preventDefault();const s=hB(t[i]);if(!s||!s.length)return void e.preventDefault();s[Math.min(p,s.length-1)].focus(),r(e,u,t[i]),e.preventDefault()}}),[t,n,r]);return(0,_t.jsx)(fB,{children:(0,_t.jsx)("div",{role:"application","aria-label":o,children:(0,_t.jsx)("table",{...i,role:"treegrid",onKeyDown:a,ref:s,children:(0,_t.jsx)("tbody",{children:e})})})})})),gB=mB;const vB=(0,c.forwardRef)((function({children:e,level:t,positionInSet:n,setSize:r,isExpanded:o,...i},s){return(0,_t.jsx)("tr",{...i,ref:s,role:"row","aria-level":t,"aria-posinset":n,"aria-setsize":r,"aria-expanded":o,children:e})})),bB=(0,c.forwardRef)((function({children:e,as:t,...n},r){const o=(0,c.useRef)(),i=r||o,{lastFocusedElement:s,setLastFocusedElement:a}=(0,c.useContext)(dB);let l;s&&(l=s===("current"in i?i.current:void 0)?0:-1);const u={ref:i,tabIndex:l,onFocus:e=>a?.(e.target),...n};return"function"==typeof e?e(u):t?(0,_t.jsx)(t,{...u,children:e}):null})),xB=bB;const yB=(0,c.forwardRef)((function({children:e,...t},n){return(0,_t.jsx)(xB,{ref:n,...t,children:e})}));const wB=(0,c.forwardRef)((function({children:e,withoutGridItem:t=!1,...n},r){return(0,_t.jsx)("td",{...n,role:"gridcell",children:t?(0,_t.jsx)(_t.Fragment,{children:"function"==typeof e?e({...n,ref:r}):e}):(0,_t.jsx)(yB,{ref:r,children:e})})}));function _B(e){e.stopPropagation()}const SB=(0,c.forwardRef)(((e,t)=>(Xi()("wp.components.IsolatedEventContainer",{since:"5.7"}),(0,_t.jsx)("div",{...e,ref:t,onMouseDown:_B}))));function CB(e){const t=(0,c.useContext)(Uy);return(0,l.useObservableValue)(t.fills,e)}const kB=yl("div",{target:"ebn2ljm1"})("&:not( :first-of-type ){",(({offsetAmount:e})=>Nl({marginInlineStart:e},"","")),";}",(({zIndex:e})=>Nl({zIndex:e},"","")),";");var jB={name:"rs0gp6",styles:"grid-row-start:1;grid-column-start:1"};const EB=yl("div",{target:"ebn2ljm0"})("display:inline-grid;grid-auto-flow:column;position:relative;&>",kB,"{position:relative;justify-self:start;",(({isLayered:e})=>e?jB:void 0),";}");const PB=al((function(e,t){const{children:n,className:r,isLayered:o=!0,isReversed:i=!1,offset:s=0,...a}=sl(e,"ZStack"),l=dy(n),u=l.length-1,d=l.map(((e,t)=>{const n=i?u-t:t,r=o?s*t:s,a=(0,c.isValidElement)(e)?e.key:t;return(0,_t.jsx)(kB,{offsetAmount:r,zIndex:n,children:e},a)}));return(0,_t.jsx)(EB,{...a,className:r,isLayered:o,ref:t,children:d})}),"ZStack"),NB=PB,TB={previous:[{modifier:"ctrlShift",character:"`"},{modifier:"ctrlShift",character:"~"},{modifier:"access",character:"p"}],next:[{modifier:"ctrl",character:"`"},{modifier:"access",character:"n"}]};function IB(e=TB){const t=(0,c.useRef)(null),[n,r]=(0,c.useState)(!1);function o(e){var n;const o=Array.from(null!==(n=t.current?.querySelectorAll('[role="region"][tabindex="-1"]'))&&void 0!==n?n:[]);if(!o.length)return;let i=o[0];const s=t.current?.ownerDocument?.activeElement?.closest('[role="region"][tabindex="-1"]'),a=s?o.indexOf(s):-1;if(-1!==a){let t=a+e;t=-1===t?o.length-1:t,t=t===o.length?0:t,i=o[t]}i.focus(),r(!0)}const i=(0,l.useRefEffect)((e=>{function t(){r(!1)}return e.addEventListener("click",t),()=>{e.removeEventListener("click",t)}}),[r]);return{ref:(0,l.useMergeRefs)([t,i]),className:n?"is-focusing-regions":"",onKeyDown(t){e.previous.some((({modifier:e,character:n})=>Ey.isKeyboardEvent[e](t,n)))?o(-1):e.next.some((({modifier:e,character:n})=>Ey.isKeyboardEvent[e](t,n)))&&o(1)}}}const RB=(0,l.createHigherOrderComponent)((e=>({shortcuts:t,...n})=>(0,_t.jsx)("div",{...IB(t),children:(0,_t.jsx)(e,{...n})})),"navigateRegions"),MB=(0,l.createHigherOrderComponent)((e=>function(t){const n=(0,l.useConstrainedTabbing)();return(0,_t.jsx)("div",{ref:n,tabIndex:-1,children:(0,_t.jsx)(e,{...t})})}),"withConstrainedTabbing"),AB=e=>(0,l.createHigherOrderComponent)((t=>class extends c.Component{constructor(e){super(e),this.nodeRef=this.props.node,this.state={fallbackStyles:void 0,grabStylesCompleted:!1},this.bindRef=this.bindRef.bind(this)}bindRef(e){e&&(this.nodeRef=e)}componentDidMount(){this.grabFallbackStyles()}componentDidUpdate(){this.grabFallbackStyles()}grabFallbackStyles(){const{grabStylesCompleted:t,fallbackStyles:n}=this.state;if(this.nodeRef&&!t){const t=e(this.nodeRef,this.props);us()(t,n)||this.setState({fallbackStyles:t,grabStylesCompleted:Object.values(t).every(Boolean)})}}render(){const e=(0,_t.jsx)(t,{...this.props,...this.state.fallbackStyles});return this.props.node?e:(0,_t.jsxs)("div",{ref:this.bindRef,children:[" ",e," "]})}}),"withFallbackStyles"),DB=window.wp.hooks,zB=16;function OB(e){return(0,l.createHigherOrderComponent)((t=>{const n="core/with-filters/"+e;let r;class o extends c.Component{constructor(n){super(n),void 0===r&&(r=(0,DB.applyFilters)(e,t))}componentDidMount(){o.instances.push(this),1===o.instances.length&&((0,DB.addAction)("hookRemoved",n,s),(0,DB.addAction)("hookAdded",n,s))}componentWillUnmount(){o.instances=o.instances.filter((e=>e!==this)),0===o.instances.length&&((0,DB.removeAction)("hookRemoved",n),(0,DB.removeAction)("hookAdded",n))}render(){return(0,_t.jsx)(r,{...this.props})}}o.instances=[];const i=(0,l.debounce)((()=>{r=(0,DB.applyFilters)(e,t),o.instances.forEach((e=>{e.forceUpdate()}))}),zB);function s(t){t===e&&i()}return o}),"withFilters")}const LB=(0,l.createHigherOrderComponent)((e=>{const t=({onFocusReturn:e}={})=>t=>n=>{const r=(0,l.useFocusReturn)(e);return(0,_t.jsx)("div",{ref:r,children:(0,_t.jsx)(t,{...n})})};if((n=e)instanceof c.Component||"function"==typeof n){const n=e;return t()(n)}var n;return t(e)}),"withFocusReturn"),FB=({children:e})=>(Xi()("wp.components.FocusReturnProvider component",{since:"5.7",hint:"This provider is not used anymore. You can just remove it from your codebase"}),e),BB=(0,l.createHigherOrderComponent)((e=>{function t(t,r){const[o,i]=(0,c.useState)([]),s=(0,c.useMemo)((()=>{const e=e=>{const t=e.id?e:{...e,id:ow()};i((e=>[...e,t]))};return{createNotice:e,createErrorNotice:t=>{e({status:"error",content:t})},removeNotice:e=>{i((t=>t.filter((t=>t.id!==e))))},removeAllNotices:()=>{i([])}}}),[]),a={...t,noticeList:o,noticeOperations:s,noticeUI:o.length>0&&(0,_t.jsx)(hO,{className:"components-with-notices-ui",notices:o,onRemove:s.removeNotice})};return n?(0,_t.jsx)(e,{...a,ref:r}):(0,_t.jsx)(e,{...a})}let n;const{render:r}=e;return"function"==typeof r?(n=!0,(0,c.forwardRef)(t)):t}),"withNotices");var VB=Et([Mt,yr],[At,wr]),$B=VB.useContext,HB=VB.useScopedContext,WB=VB.useProviderContext,UB=VB.ContextProvider,GB=VB.ScopedContextProvider,KB=(0,B.createContext)(void 0),qB=Et([Mt],[At]),YB=qB.useContext,XB=qB.useScopedContext;qB.useProviderContext,qB.ContextProvider,qB.ScopedContextProvider,(0,B.createContext)(void 0);function ZB(e={}){var t=e,{combobox:n,parent:r,menubar:o}=t,i=N(t,["combobox","parent","menubar"]);const s=!!o&&!r,a=Xe(i.store,function(e,...t){if(e)return $e(e,"pick")(...t)}(r,["values"]),Ye(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),l=a.getState(),c=ht(P(E({},i),{store:a,orientation:F(i.orientation,l.orientation,"vertical")})),u=tr(P(E({},i),{store:a,placement:F(i.placement,l.placement,"bottom-start"),timeout:F(i.timeout,l.timeout,s?0:150),hideTimeout:F(i.hideTimeout,l.hideTimeout,0)})),d=He(P(E(E({},c.getState()),u.getState()),{initialFocus:F(l.initialFocus,"container"),values:F(i.values,l.values,i.defaultValues,{})}),c,u,a);return We(d,(()=>Ke(d,["mounted"],(e=>{e.mounted||d.setState("activeId",null)})))),We(d,(()=>Ke(r,["orientation"],(e=>{d.setState("placement","vertical"===e.orientation?"right-start":"bottom-start")})))),P(E(E(E({},c),u),d),{combobox:n,parent:r,menubar:o,hideAll:()=>{u.hide(),null==r||r.hideAll()},setInitialFocus:e=>d.setState("initialFocus",e),setValues:e=>d.setState("values",e),setValue:(e,t)=>{"__proto__"!==e&&"constructor"!==e&&(Array.isArray(e)||d.setState("values",(n=>{const r=n[e],o=I(t,r);return o===r?n:P(E({},n),{[e]:void 0!==o&&o})})))}})}function QB(e={}){const t=$B(),n=YB(),r=TT();e=b(v({},e),{parent:void 0!==e.parent?e.parent:t,menubar:void 0!==e.menubar?e.menubar:n,combobox:void 0!==e.combobox?e.combobox:r});const[o,i]=rt(ZB,e);return function(e,t,n){return Te(t,[n.combobox,n.parent,n.menubar]),nt(e,n,"values","setValues"),Object.assign(Jn(gt(e,t,n),t,n),{combobox:n.combobox,parent:n.parent,menubar:n.menubar})}(o,i,e)}const JB=(0,c.createContext)(void 0);var eV=jt((function(e){var t=e,{store:n,hideOnClick:r=!0,preventScrollOnKeyDown:o=!0,focusOnHover:i,blurOnHoverEnd:s}=t,a=x(t,["store","hideOnClick","preventScrollOnKeyDown","focusOnHover","blurOnHoverEnd"]);const l=HB(!0),c=XB();D(n=n||l||c,!1);const u=a.onClick,d=Re(r),p="hideAll"in n?n.hideAll:void 0,f=!!p,h=ke((e=>{if(null==u||u(e),e.defaultPrevented)return;if(fe(e))return;if(pe(e))return;if(!p)return;"menu"!==e.currentTarget.getAttribute("aria-haspopup")&&d(e)&&p()})),m=oe(et(n,(e=>"contentElement"in e?e.contentElement:null)),"menuitem");return a=b(v({role:m},a),{onClick:h}),a=Mn(v({store:n,preventScrollOnKeyDown:o},a)),a=Cn(b(v({store:n},a),{focusOnHover(e){if(!n)return!1;if(!("function"==typeof i?i(e):null==i||i))return!1;const{baseElement:t,items:r}=n.getState();return f?(e.currentTarget.hasAttribute("aria-expanded")&&e.currentTarget.focus(),!0):!!function(e,t,n){var r;if(!e)return!1;if(Kt(e))return!0;const o=null==t?void 0:t.find((e=>{var t;return e.element!==n&&"true"===(null==(t=e.element)?void 0:t.getAttribute("aria-expanded"))})),i=null==(r=null==o?void 0:o.element)?void 0:r.getAttribute("aria-controls");if(!i)return!1;const s=K(e).getElementById(i);return!(!s||!Kt(s)&&!s.querySelector("[role=menuitem][aria-expanded=true]"))}(t,r,e.currentTarget)&&(e.currentTarget.focus(),!0)},blurOnHoverEnd:e=>"function"==typeof s?s(e):null!=s?s:f})),a})),tV=Ct(St((function(e){return kt("div",eV(e))}))),nV=Et(),rV=nV.useContext,oV=(nV.useScopedContext,nV.useProviderContext,nV.ContextProvider,nV.ScopedContextProvider,"input");function iV(e,t){t?e.indeterminate=!0:e.indeterminate&&(e.indeterminate=!1)}function sV(e){return Array.isArray(e)?e.toString():e}var aV=jt((function(e){var t=e,{store:n,name:r,value:o,checked:i,defaultChecked:s}=t,a=x(t,["store","name","value","checked","defaultChecked"]);const l=rV();n=n||l;const[c,u]=(0,B.useState)(null!=s&&s),d=et(n,(e=>{if(void 0!==i)return i;if(void 0===(null==e?void 0:e.value))return c;if(null!=o){if(Array.isArray(e.value)){const t=sV(o);return e.value.includes(t)}return e.value===o}return!Array.isArray(e.value)&&("boolean"==typeof e.value&&e.value)})),p=(0,B.useRef)(null),f=function(e,t){return"input"===e&&(!t||"checkbox"===t)}(Ne(p,oV),a.type),h=d?"mixed"===d:void 0,m="mixed"!==d&&d,g=O(a),[y,w]=Ie();(0,B.useEffect)((()=>{const e=p.current;e&&(iV(e,h),f||(e.checked=m,void 0!==r&&(e.name=r),void 0!==o&&(e.value=`${o}`)))}),[y,h,f,m,r,o]);const _=a.onChange,S=ke((e=>{if(g)return e.stopPropagation(),void e.preventDefault();if(iV(e.currentTarget,h),f||(e.currentTarget.checked=!e.currentTarget.checked,w()),null==_||_(e),e.defaultPrevented)return;const t=e.currentTarget.checked;u(t),null==n||n.setValue((e=>{if(null==o)return t;const n=sV(o);return Array.isArray(e)?t?e.includes(n)?e:[...e,n]:e.filter((e=>e!==n)):e!==n&&n}))})),C=a.onClick,k=ke((e=>{null==C||C(e),e.defaultPrevented||f||S(e)}));return a=Me(a,(e=>(0,_t.jsx)(lI.Provider,{value:m,children:e})),[m]),a=b(v({role:f?void 0:"checkbox",type:f?"checkbox":void 0,"aria-checked":d},a),{ref:Ee(p,a.ref),onChange:S,onClick:k}),a=Tn(v({clickOnEnter:!f},a)),L(v({name:f?r:void 0,value:f?o:void 0,checked:m},a))}));St((function(e){const t=aV(e);return kt(oV,t)}));function lV(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),r=He({value:F(e.value,null==n?void 0:n.value,e.defaultValue,!1)},e.store);return P(E({},r),{setValue:e=>r.setState("value",e)})}function cV(e={}){const[t,n]=rt(lV,e);return function(e,t,n){return Te(t,[n.store]),nt(e,n,"value","setValue"),e}(t,n,e)}function uV(e,t,n){if(void 0===t)return Array.isArray(e)?e:!!n;const r=function(e){return Array.isArray(e)?e.toString():e}(t);return Array.isArray(e)?n?e.includes(r)?e:[...e,r]:e.filter((e=>e!==r)):n?r:e!==r&&e}var dV=jt((function(e){var t=e,{store:n,name:r,value:o,checked:i,defaultChecked:s,hideOnClick:a=!1}=t,l=x(t,["store","name","value","checked","defaultChecked","hideOnClick"]);const c=HB();D(n=n||c,!1);const u=Se(s);(0,B.useEffect)((()=>{null==n||n.setValue(r,((e=[])=>u?uV(e,o,!0):e))}),[n,r,o,u]),(0,B.useEffect)((()=>{void 0!==i&&(null==n||n.setValue(r,(e=>uV(e,o,i))))}),[n,r,o,i]);const d=cV({value:n.useState((e=>e.values[r])),setValue(e){null==n||n.setValue(r,(()=>{if(void 0===i)return e;const t=uV(e,o,i);return Array.isArray(t)&&Array.isArray(e)&&function(e,t){if(e===t)return!0;if(!e)return!1;if(!t)return!1;if("object"!=typeof e)return!1;if("object"!=typeof t)return!1;const n=Object.keys(e),r=Object.keys(t),{length:o}=n;if(r.length!==o)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}(e,t)?e:t}))}});return l=v({role:"menuitemcheckbox"},l),l=aV(v({store:d,name:r,value:o,checked:i},l)),l=eV(v({store:n,hideOnClick:a},l))})),pV=Ct(St((function(e){return kt("div",dV(e))})));function fV(e,t,n){return void 0===n?e:n?t:e}var hV=jt((function(e){var t=e,{store:n,name:r,value:o,checked:i,onChange:s,hideOnClick:a=!1}=t,l=x(t,["store","name","value","checked","onChange","hideOnClick"]);const c=HB();D(n=n||c,!1);const u=Se(l.defaultChecked);(0,B.useEffect)((()=>{null==n||n.setValue(r,((e=!1)=>fV(e,o,u)))}),[n,r,o,u]),(0,B.useEffect)((()=>{void 0!==i&&(null==n||n.setValue(r,(e=>fV(e,o,i))))}),[n,r,o,i]);const d=n.useState((e=>e.values[r]===o));return l=Me(l,(e=>(0,_t.jsx)(KB.Provider,{value:!!d,children:e})),[d]),l=v({role:"menuitemradio"},l),l=w_(v({name:r,value:o,checked:d,onChange(e){if(null==s||s(e),e.defaultPrevented)return;const t=e.currentTarget;null==n||n.setValue(r,(e=>fV(e,o,null!=i?i:t.checked)))}},l)),l=eV(v({store:n,hideOnClick:a},l))})),mV=Ct(St((function(e){return kt("div",hV(e))}))),gV=jt((function(e){return e=mn(e)})),vV=St((function(e){return kt("div",gV(e))})),bV=jt((function(e){return e=xn(e)})),xV=St((function(e){return kt("div",bV(e))})),yV=jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=It();D(n=n||o,!1);const i=n.useState((e=>"horizontal"===e.orientation?"vertical":"horizontal"));return r=tP(b(v({},r),{orientation:i}))})),wV=(St((function(e){return kt("hr",yV(e))})),jt((function(e){var t=e,{store:n}=t,r=x(t,["store"]);const o=$B();return r=yV(v({store:n=n||o},r))}))),_V=St((function(e){return kt("hr",wV(e))}));const SV=.82,CV=.9,kV={IN:"400ms",OUT:"200ms"},jV="cubic-bezier(0.33, 0, 0, 1)",EV=Il(1),PV=Il(2),NV=Il(3),TV=zl.theme.gray[300],IV=zl.theme.gray[200],RV=zl.theme.gray[700],MV=zl.theme.gray[100],AV=zl.theme.foreground,DV=`0 0 0 ${Fl.borderWidth} ${TV}, ${Fl.elevationMedium}`,zV=`0 0 0 ${Fl.borderWidth} ${AV}`,OV="minmax( 0, max-content ) 1fr",LV=yl("div",{target:"e1wg7tti14"})("position:relative;background-color:",zl.ui.background,";border-radius:",Fl.radiusMedium,";",(e=>Nl("box-shadow:","toolbar"===e.variant?zV:DV,";",""))," overflow:hidden;@media not ( prefers-reduced-motion ){transition-property:transform,opacity;transition-timing-function:",jV,";transition-duration:",kV.IN,";will-change:transform,opacity;opacity:0;&:has( [data-enter] ){opacity:1;}&:has( [data-leave] ){transition-duration:",kV.OUT,";}&:has( [data-side='bottom'] ),&:has( [data-side='top'] ){transform:scaleY( ",SV," );}&:has( [data-side='bottom'] ){transform-origin:top;}&:has( [data-side='top'] ){transform-origin:bottom;}&:has( [data-enter][data-side='bottom'] ),&:has( [data-enter][data-side='top'] ),&:has( [data-leave][data-side='bottom'] ),&:has( [data-leave][data-side='top'] ){transform:scaleY( 1 );}}"),FV=yl("div",{target:"e1wg7tti13"})("position:relative;z-index:1000000;display:grid;grid-template-columns:",OV,";grid-template-rows:auto;box-sizing:border-box;min-width:160px;max-width:320px;max-height:var( --popover-available-height );padding:",EV,";overscroll-behavior:contain;overflow:auto;outline:2px solid transparent!important;@media not ( prefers-reduced-motion ){transition:inherit;transform-origin:inherit;&[data-side='bottom'],&[data-side='top']{transform:scaleY(\n\t\t\t\tcalc(\n\t\t\t\t\t1 / ",SV," *\n\t\t\t\t\t\t",CV,"\n\t\t\t\t)\n\t\t\t);}&[data-enter][data-side='bottom'],&[data-enter][data-side='top'],&[data-leave][data-side='bottom'],&[data-leave][data-side='top']{transform:scaleY( 1 );}}"),BV=Nl("all:unset;position:relative;min-height:",Il(10),";box-sizing:border-box;grid-column:1/-1;display:grid;grid-template-columns:",OV,";align-items:center;@supports ( grid-template-columns: subgrid ){grid-template-columns:subgrid;}font-size:",Ix("default.fontSize"),";font-family:inherit;font-weight:normal;line-height:20px;color:",zl.theme.foreground,";border-radius:",Fl.radiusSmall,";padding-block:",PV,";padding-inline:",NV,";scroll-margin:",EV,";user-select:none;outline:none;&[aria-disabled='true']{color:",zl.ui.textDisabled,";cursor:not-allowed;}&[data-active-item]:not( [data-focus-visible] ):not(\n\t\t\t[aria-disabled='true']\n\t\t){background-color:",zl.theme.accent,";color:",zl.theme.accentInverted,";}&[data-focus-visible]{box-shadow:0 0 0 1.5px ",zl.theme.accent,";outline:2px solid transparent;}&:active,&[data-active]{}",FV,':not(:focus) &:not(:focus)[aria-expanded="true"]{background-color:',MV,";color:",zl.theme.foreground,";}svg{fill:currentColor;}",""),VV=yl(tV,{target:"e1wg7tti12"})(BV,";"),$V=yl(pV,{target:"e1wg7tti11"})(BV,";"),HV=yl(mV,{target:"e1wg7tti10"})(BV,";"),WV=yl("span",{target:"e1wg7tti9"})("grid-column:1;",$V,">&,",HV,">&{min-width:",Il(6),";}",$V,">&,",HV,">&,&:not( :empty ){margin-inline-end:",Il(2),";}display:flex;align-items:center;justify-content:center;color:",RV,";[data-active-item]:not( [data-focus-visible] )>&,[aria-disabled='true']>&{color:inherit;}"),UV=yl("div",{target:"e1wg7tti8"})("grid-column:2;display:flex;align-items:center;justify-content:space-between;gap:",Il(3),";pointer-events:none;"),GV=yl("div",{target:"e1wg7tti7"})("flex:1;display:inline-flex;flex-direction:column;gap:",Il(1),";"),KV=yl("span",{target:"e1wg7tti6"})("flex:0 1 fit-content;min-width:0;width:fit-content;display:flex;align-items:center;justify-content:center;gap:",Il(3),";color:",RV,";[data-active-item]:not( [data-focus-visible] ) *:not(",FV,") &,[aria-disabled='true'] *:not(",FV,") &{color:inherit;}"),qV=yl(vV,{target:"e1wg7tti5"})({name:"49aokf",styles:"display:contents"}),YV=yl(xV,{target:"e1wg7tti4"})("grid-column:1/-1;padding-block-start:",Il(3),";padding-block-end:",Il(2),";padding-inline:",NV,";"),XV=yl(_V,{target:"e1wg7tti3"})("grid-column:1/-1;border:none;height:",Fl.borderWidth,";background-color:",(e=>"toolbar"===e.variant?AV:IV),";margin-block:",Il(2),";margin-inline:",NV,";outline:2px solid transparent;"),ZV=yl(Xx,{target:"e1wg7tti2"})("width:",Il(1.5),";",Mg({transform:"scaleX(1)"},{transform:"scaleX(-1)"}),";"),QV=yl(fk,{target:"e1wg7tti1"})("font-size:",Ix("default.fontSize"),";line-height:20px;color:inherit;"),JV=yl(fk,{target:"e1wg7tti0"})("font-size:",Ix("helpText.fontSize"),";line-height:16px;color:",RV,";overflow-wrap:anywhere;[data-active-item]:not( [data-focus-visible] ) *:not( ",FV," ) &,[aria-disabled='true'] *:not( ",FV," ) &{color:inherit;}"),e$=(0,c.forwardRef)((function({prefix:e,suffix:t,children:n,disabled:r=!1,hideOnClick:o=!0,store:i,...s},a){const l=(0,c.useContext)(JB);if(!l?.store)throw new Error("Menu.Item can only be rendered inside a Menu component");const u=null!=i?i:l.store;return(0,_t.jsxs)(VV,{ref:a,...s,accessibleWhenDisabled:!0,disabled:r,hideOnClick:o,store:u,children:[(0,_t.jsx)(WV,{children:e}),(0,_t.jsxs)(UV,{children:[(0,_t.jsx)(GV,{children:n}),t&&(0,_t.jsx)(KV,{children:t})]})]})}));var t$=jt((function(e){var t=e,{store:n,checked:r}=t,o=x(t,["store","checked"]);const i=(0,B.useContext)(KB);return r=null!=r?r:i,o=uI(b(v({},o),{checked:r}))})),n$=St((function(e){return kt("span",t$(e))}));const r$=(0,c.forwardRef)((function({suffix:e,children:t,disabled:n=!1,hideOnClick:r=!1,...o},i){const s=(0,c.useContext)(JB);if(!s?.store)throw new Error("Menu.CheckboxItem can only be rendered inside a Menu component");return(0,_t.jsxs)($V,{ref:i,...o,accessibleWhenDisabled:!0,disabled:n,hideOnClick:r,store:s.store,children:[(0,_t.jsx)(n$,{store:s.store,render:(0,_t.jsx)(WV,{}),style:{width:"auto",height:"auto"},children:(0,_t.jsx)(oS,{icon:ok,size:24})}),(0,_t.jsxs)(UV,{children:[(0,_t.jsx)(GV,{children:t}),e&&(0,_t.jsx)(KV,{children:e})]})]})})),o$=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Circle,{cx:12,cy:12,r:3})}),i$=(0,c.forwardRef)((function({suffix:e,children:t,disabled:n=!1,hideOnClick:r=!1,...o},i){const s=(0,c.useContext)(JB);if(!s?.store)throw new Error("Menu.RadioItem can only be rendered inside a Menu component");return(0,_t.jsxs)(HV,{ref:i,...o,accessibleWhenDisabled:!0,disabled:n,hideOnClick:r,store:s.store,children:[(0,_t.jsx)(n$,{store:s.store,render:(0,_t.jsx)(WV,{}),style:{width:"auto",height:"auto"},children:(0,_t.jsx)(oS,{icon:o$,size:24})}),(0,_t.jsxs)(UV,{children:[(0,_t.jsx)(GV,{children:t}),e&&(0,_t.jsx)(KV,{children:e})]})]})})),s$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(JB);if(!n?.store)throw new Error("Menu.Group can only be rendered inside a Menu component");return(0,_t.jsx)(qV,{ref:t,...e,store:n.store})})),a$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(JB);if(!n?.store)throw new Error("Menu.GroupLabel can only be rendered inside a Menu component");return(0,_t.jsx)(YV,{ref:t,render:(0,_t.jsx)($v,{upperCase:!0,variant:"muted",size:"11px",weight:500,lineHeight:"16px"}),...e,store:n.store})})),l$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(JB);if(!n?.store)throw new Error("Menu.Separator can only be rendered inside a Menu component");return(0,_t.jsx)(XV,{ref:t,...e,store:n.store,variant:n.variant})})),c$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(JB);if(!n?.store)throw new Error("Menu.ItemLabel can only be rendered inside a Menu component");return(0,_t.jsx)(QV,{numberOfLines:1,ref:t,...e})})),u$=(0,c.forwardRef)((function(e,t){const n=(0,c.useContext)(JB);if(!n?.store)throw new Error("Menu.ItemHelpText can only be rendered inside a Menu component");return(0,_t.jsx)(JV,{numberOfLines:2,ref:t,...e})}));function d$(e,t){return!!(null==e?void 0:e.some((e=>!!e.element&&(e.element!==t&&"true"===e.element.getAttribute("aria-expanded")))))}var p$=jt((function(e){var t=e,{store:n,focusable:r,accessibleWhenDisabled:o,showOnHover:i}=t,s=x(t,["store","focusable","accessibleWhenDisabled","showOnHover"]);const a=WB();D(n=n||a,!1);const l=(0,B.useRef)(null),c=n.parent,u=n.menubar,d=!!c,p=!!u&&!d,f=O(s),h=()=>{const e=l.current;e&&(null==n||n.setDisclosureElement(e),null==n||n.setAnchorElement(e),null==n||n.show())},m=s.onFocus,g=ke((e=>{if(null==m||m(e),f)return;if(e.defaultPrevented)return;if(null==n||n.setAutoFocusOnShow(!1),null==n||n.setActiveId(null),!u)return;if(!p)return;const{items:t}=u.getState();d$(t,e.currentTarget)&&h()})),y=et(n,(e=>e.placement.split("-")[0])),w=s.onKeyDown,_=ke((e=>{if(null==w||w(e),f)return;if(e.defaultPrevented)return;const t=function(e,t){return{ArrowDown:("bottom"===t||"top"===t)&&"first",ArrowUp:("bottom"===t||"top"===t)&&"last",ArrowRight:"right"===t&&"first",ArrowLeft:"left"===t&&"first"}[e.key]}(e,y);t&&(e.preventDefault(),h(),null==n||n.setAutoFocusOnShow(!0),null==n||n.setInitialFocus(t))})),S=s.onClick,C=ke((e=>{if(null==S||S(e),e.defaultPrevented)return;if(!n)return;const t=!e.detail,{open:r}=n.getState();r&&!t||(d&&!t||n.setAutoFocusOnShow(!0),n.setInitialFocus(t?"first":"container")),d&&h()}));s=Me(s,(e=>(0,_t.jsx)(UB,{value:n,children:e})),[n]),d&&(s=b(v({},s),{render:(0,_t.jsx)(or.div,{render:s.render})}));const k=Pe(s.id),j=et((null==c?void 0:c.combobox)||c,"contentElement"),E=d||p?oe(j,"menuitem"):void 0,P=n.useState("contentElement");return s=b(v({id:k,role:E,"aria-haspopup":re(P,"menu")},s),{ref:Ee(l,s.ref),onFocus:g,onKeyDown:_,onClick:C}),s=_r(b(v({store:n,focusable:r,accessibleWhenDisabled:o},s),{showOnHover:e=>{if(!(()=>{if("function"==typeof i)return i(e);if(null!=i)return i;if(d)return!0;if(!u)return!1;const{items:t}=u.getState();return p&&d$(t)})())return!1;const t=p?u:c;return!t||(t.setActiveId(e.currentTarget.id),!0)}})),s=qT(v({store:n,toggleOnClick:!d,focusable:r,accessibleWhenDisabled:o},s)),s=Hn(v({store:n,typeahead:p},s))})),f$=St((function(e){return kt("button",p$(e))}));const h$=(0,c.forwardRef)((function({children:e,disabled:t=!1,...n},r){const o=(0,c.useContext)(JB);if(!o?.store)throw new Error("Menu.TriggerButton can only be rendered inside a Menu component");if(o.store.parent)throw new Error("Menu.TriggerButton should not be rendered inside a nested Menu component. Use Menu.SubmenuTriggerItem instead.");return(0,_t.jsx)(f$,{ref:r,...n,disabled:t,store:o.store,children:e})})),m$=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})}),g$=(0,c.forwardRef)((function({suffix:e,...t},n){const r=(0,c.useContext)(JB);if(!r?.store.parent)throw new Error("Menu.SubmenuTriggerItem can only be rendered inside a nested Menu component");return(0,_t.jsx)(f$,{ref:n,accessibleWhenDisabled:!0,store:r.store,render:(0,_t.jsx)(e$,{...t,store:r.store.parent,suffix:(0,_t.jsxs)(_t.Fragment,{children:[e,(0,_t.jsx)(ZV,{"aria-hidden":"true",icon:m$,size:24,preserveAspectRatio:"xMidYMid slice"})]})})})}));var v$=jt((function(e){var t=e,{store:n,alwaysVisible:r,composite:o}=t,i=x(t,["store","alwaysVisible","composite"]);const s=WB();D(n=n||s,!1);const a=n.parent,l=n.menubar,c=!!a,u=Pe(i.id),d=i.onKeyDown,p=n.useState((e=>e.placement.split("-")[0])),f=n.useState((e=>"both"===e.orientation?void 0:e.orientation)),h="vertical"!==f,m=et(l,(e=>!!e&&"vertical"!==e.orientation)),g=ke((e=>{if(null==d||d(e),!e.defaultPrevented){if(c||l&&!h){const t={ArrowRight:()=>"left"===p&&!h,ArrowLeft:()=>"right"===p&&!h,ArrowUp:()=>"bottom"===p&&h,ArrowDown:()=>"top"===p&&h}[e.key];if(null==t?void 0:t())return e.stopPropagation(),e.preventDefault(),null==n?void 0:n.hide()}if(l){const t={ArrowRight:()=>{if(m)return l.next()},ArrowLeft:()=>{if(m)return l.previous()},ArrowDown:()=>{if(!m)return l.next()},ArrowUp:()=>{if(!m)return l.previous()}}[e.key],n=null==t?void 0:t();void 0!==n&&(e.stopPropagation(),e.preventDefault(),l.move(n))}}}));i=Me(i,(e=>(0,_t.jsx)(GB,{value:n,children:e})),[n]);const y=function(e){var t=e,{store:n}=t,r=x(t,["store"]);const[o,i]=(0,B.useState)(void 0),s=r["aria-label"],a=et(n,"disclosureElement"),l=et(n,"contentElement");return(0,B.useEffect)((()=>{const e=a;e&&l&&(s||l.hasAttribute("aria-label")?i(void 0):e.id&&i(e.id))}),[s,a,l]),o}(v({store:n},i)),w=Xr(n.useState("mounted"),i.hidden,r),_=w?b(v({},i.style),{display:"none"}):i.style;i=b(v({id:u,"aria-labelledby":y,hidden:w},i),{ref:Ee(u?n.setContentElement:null,i.ref),style:_,onKeyDown:g});const S=!!n.combobox;return(o=null!=o?o:!S)&&(i=v({role:"menu","aria-orientation":f},i)),i=cn(v({store:n,composite:o},i)),i=Hn(v({store:n,typeahead:!S},i))})),b$=(St((function(e){return kt("div",v$(e))})),jt((function(e){var t=e,{store:n,modal:r=!1,portal:o=!!r,hideOnEscape:i=!0,autoFocusOnShow:s=!0,hideOnHoverOutside:a,alwaysVisible:l}=t,c=x(t,["store","modal","portal","hideOnEscape","autoFocusOnShow","hideOnHoverOutside","alwaysVisible"]);const u=WB();D(n=n||u,!1);const d=(0,B.useRef)(null),p=n.parent,f=n.menubar,h=!!p,m=!!f&&!h;c=b(v({},c),{ref:Ee(d,c.ref)});const g=v$(v({store:n,alwaysVisible:l},c)),{"aria-labelledby":y}=g;c=x(g,["aria-labelledby"]);const[w,_]=(0,B.useState)(),S=n.useState("autoFocusOnShow"),C=n.useState("initialFocus"),k=n.useState("baseElement"),j=n.useState("renderedItems");(0,B.useEffect)((()=>{let e=!1;return _((t=>{var n,r,o;if(e)return;if(!S)return;if(null==(n=null==t?void 0:t.current)?void 0:n.isConnected)return t;const i=(0,B.createRef)();switch(C){case"first":i.current=(null==(r=j.find((e=>!e.disabled&&e.element)))?void 0:r.element)||null;break;case"last":i.current=(null==(o=[...j].reverse().find((e=>!e.disabled&&e.element)))?void 0:o.element)||null;break;default:i.current=k}return i})),()=>{e=!0}}),[n,S,C,j,k]);const E=!h&&r,P=!!s,N=!!w||!!c.initialFocus||!!E,T=et(n.combobox||n,"contentElement"),I=et((null==p?void 0:p.combobox)||p,"contentElement"),R=(0,B.useMemo)((()=>{if(!I)return;if(!T)return;const e=T.getAttribute("role"),t=I.getAttribute("role");return"menu"!==t&&"menubar"!==t||"menu"!==e?I:void 0}),[T,I]);return void 0!==R&&(c=v({preserveTabOrderAnchor:R},c)),c=Gi(b(v({store:n,alwaysVisible:l,initialFocus:w,autoFocusOnShow:P?N&&s:S||!!E},c),{hideOnEscape:e=>!z(i,e)&&(null==n||n.hideAll(),!0),hideOnHoverOutside(e){const t=null==n?void 0:n.getState().disclosureElement;return!!("function"==typeof a?a(e):null!=a?a:h||m&&(!t||!Kt(t)))&&(!!e.defaultPrevented||(!h||(!t||(function(e,t,n){const r=new Event(t,n);e.dispatchEvent(r)}(t,"mouseout",e),!Kt(t)||(requestAnimationFrame((()=>{Kt(t)||null==n||n.hide()})),!1)))))},modal:E,portal:o,backdrop:!h&&c.backdrop})),c=v({"aria-labelledby":y},c)}))),x$=_o(St((function(e){return kt("div",b$(e))})),WB);const y$=(0,c.forwardRef)((function({gutter:e,children:t,shift:n,modal:r=!0,...o},i){const s=(0,c.useContext)(JB),a=et(s?.store,"currentPlacement")?.split("-")[0],l=(0,c.useCallback)((e=>(e.preventDefault(),!0)),[]),u=et(s?.store,"rtl")?"rtl":"ltr",d=(0,c.useMemo)((()=>({dir:u,style:{direction:u}})),[u]);if(!s?.store)throw new Error("Menu.Popover can only be rendered inside a Menu component");return(0,_t.jsx)(x$,{...o,ref:i,modal:r,store:s.store,gutter:null!=e?e:s.store.parent?0:8,shift:null!=n?n:s.store.parent?-4:0,hideOnHoverOutside:!1,"data-side":a,wrapperProps:d,hideOnEscape:l,unmountOnHide:!0,render:e=>(0,_t.jsx)(LV,{variant:s.variant,children:(0,_t.jsx)(FV,{...e})}),children:t})})),w$=Object.assign(ll((e=>{const{children:t,defaultOpen:n=!1,open:r,onOpenChange:o,placement:i,variant:s}=sl(e,"Menu"),l=(0,c.useContext)(JB),u=(0,a.isRTL)();let d=null!=i?i:l?.store?"right-start":"bottom-start";u&&(/right/.test(d)?d=d.replace("right","left"):/left/.test(d)&&(d=d.replace("left","right")));const p=QB({parent:l?.store,open:r,defaultOpen:n,placement:d,focusLoop:!0,setOpen(e){o?.(e)},rtl:u}),f=(0,c.useMemo)((()=>({store:p,variant:s})),[p,s]);return(0,_t.jsx)(JB.Provider,{value:f,children:t})}),"Menu"),{Context:Object.assign(JB,{displayName:"Menu.Context"}),Item:Object.assign(e$,{displayName:"Menu.Item"}),RadioItem:Object.assign(i$,{displayName:"Menu.RadioItem"}),CheckboxItem:Object.assign(r$,{displayName:"Menu.CheckboxItem"}),Group:Object.assign(s$,{displayName:"Menu.Group"}),GroupLabel:Object.assign(a$,{displayName:"Menu.GroupLabel"}),Separator:Object.assign(l$,{displayName:"Menu.Separator"}),ItemLabel:Object.assign(c$,{displayName:"Menu.ItemLabel"}),ItemHelpText:Object.assign(u$,{displayName:"Menu.ItemHelpText"}),Popover:Object.assign(y$,{displayName:"Menu.Popover"}),TriggerButton:Object.assign(h$,{displayName:"Menu.TriggerButton"}),SubmenuTriggerItem:Object.assign(g$,{displayName:"Menu.SubmenuTriggerItem"})});const _$=yl("div",{target:"e1krjpvb0"})({name:"1a3idx0",styles:"color:var( --wp-components-color-foreground, currentColor )"});function S$(e){!function(e){for(const[t,n]of Object.entries(e))void 0!==n&&yv(n).isValid()}(e);const t={...C$(e.accent),...k$(e.background)};return function(e){for(const t of Object.values(e));}(function(e,t){const n=e.background||zl.white,r=e.accent||"#3858e9",o=t.foreground||zl.gray[900],i=t.gray||zl.gray;return{accent:yv(n).isReadable(r)?void 0:`The background color ("${n}") does not have sufficient contrast against the accent color ("${r}").`,foreground:yv(n).isReadable(o)?void 0:`The background color provided ("${n}") does not have sufficient contrast against the standard foreground colors.`,grays:yv(n).contrast(i[600])>=3&&yv(n).contrast(i[700])>=4.5?void 0:`The background color provided ("${n}") cannot generate a set of grayscale foreground colors with sufficient contrast. Try adjusting the color to be lighter or darker.`}}(e,t)),{colors:t}}function C$(e){return e?{accent:e,accentDarker10:yv(e).darken(.1).toHex(),accentDarker20:yv(e).darken(.2).toHex(),accentInverted:j$(e)}:{}}function k$(e){if(!e)return{};const t=j$(e);return{background:e,foreground:t,foregroundInverted:j$(t),gray:E$(e,t)}}function j$(e){return yv(e).isDark()?zl.white:zl.gray[900]}function E$(e,t){const n=yv(e).isDark()?"lighten":"darken",r=Math.abs(yv(e).toHsl().l-yv(t).toHsl().l)/100,o={};return Object.entries({100:.06,200:.121,300:.132,400:.2,600:.42,700:.543,800:.821}).forEach((([t,i])=>{o[parseInt(t)]=yv(e)[n](i/.884*r).toHex()})),o}_v([Sv,$_]);const P$=function({accent:e,background:t,className:n,...r}){const o=il(),i=(0,c.useMemo)((()=>o(...(({colors:e})=>{const t=Object.entries(e.gray||{}).map((([e,t])=>`--wp-components-color-gray-${e}: ${t};`)).join("");return[Nl("--wp-components-color-accent:",e.accent,";--wp-components-color-accent-darker-10:",e.accentDarker10,";--wp-components-color-accent-darker-20:",e.accentDarker20,";--wp-components-color-accent-inverted:",e.accentInverted,";--wp-components-color-background:",e.background,";--wp-components-color-foreground:",e.foreground,";--wp-components-color-foreground-inverted:",e.foregroundInverted,";",t,";","")]})(S$({accent:e,background:t})),n)),[e,t,n,o]);return(0,_t.jsx)(_$,{className:i,...r})},N$=(0,c.createContext)(void 0),T$=()=>(0,c.useContext)(N$);const I$=yl(QL,{target:"enfox0g4"})("display:flex;align-items:stretch;overflow-x:auto;&[aria-orientation='vertical']{flex-direction:column;}:where( [aria-orientation='horizontal'] ){width:fit-content;}--direction-factor:1;--direction-start:left;--direction-end:right;--selected-start:var( --selected-left, 0 );&:dir( rtl ){--direction-factor:-1;--direction-start:right;--direction-end:left;--selected-start:var( --selected-right, 0 );}@media not ( prefers-reduced-motion ){&[data-indicator-animated]::before{transition-property:transform,border-radius,border-block;transition-duration:0.2s;transition-timing-function:ease-out;}}position:relative;&::before{content:'';position:absolute;pointer-events:none;transform-origin:var( --direction-start ) top;outline:2px solid transparent;outline-offset:-1px;}--antialiasing-factor:100;&[aria-orientation='horizontal']{--fade-width:4rem;--fade-gradient-base:transparent 0%,black var( --fade-width );--fade-gradient-composed:var( --fade-gradient-base ),black 60%,transparent 50%;&.is-overflowing-first{mask-image:linear-gradient(\n\t\t\t\tto var( --direction-end ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);}&.is-overflowing-last{mask-image:linear-gradient(\n\t\t\t\tto var( --direction-start ),\n\t\t\t\tvar( --fade-gradient-base )\n\t\t\t);}&.is-overflowing-first.is-overflowing-last{mask-image:linear-gradient(\n\t\t\t\t\tto right,\n\t\t\t\t\tvar( --fade-gradient-composed )\n\t\t\t\t),linear-gradient( to left, var( --fade-gradient-composed ) );}&::before{bottom:0;height:0;width:calc( var( --antialiasing-factor ) * 1px );transform:translateX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-start ) * var( --direction-factor ) *\n\t\t\t\t\t\t\t1px\n\t\t\t\t\t)\n\t\t\t\t) scaleX(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-width, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);border-bottom:var( --wp-admin-border-width-focus ) solid ",zl.theme.accent,";}}&[aria-orientation='vertical']{&::before{border-radius:",Fl.radiusSmall,"/calc(\n\t\t\t\t\t",Fl.radiusSmall," /\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t\t)\n\t\t\t\t);top:0;left:0;width:100%;height:calc( var( --antialiasing-factor ) * 1px );transform:translateY( calc( var( --selected-top, 0 ) * 1px ) ) scaleY(\n\t\t\t\t\tcalc(\n\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t\t);background-color:color-mix(\n\t\t\t\tin srgb,\n\t\t\t\t",zl.theme.accent,",\n\t\t\t\ttransparent 96%\n\t\t\t);}&[data-select-on-move='true']:has(\n\t\t\t\t:is( :focus-visible, [data-focus-visible] )\n\t\t\t)::before{box-sizing:border-box;border:var( --wp-admin-border-width-focus ) solid ",zl.theme.accent,";border-block-width:calc(\n\t\t\t\tvar( --wp-admin-border-width-focus, 1px ) /\n\t\t\t\t\t(\n\t\t\t\t\t\tvar( --selected-height, 0 ) /\n\t\t\t\t\t\t\tvar( --antialiasing-factor )\n\t\t\t\t\t)\n\t\t\t);}}"),R$=yl(eF,{target:"enfox0g3"})("&{border-radius:0;background:transparent;border:none;box-shadow:none;flex:1 0 auto;white-space:nowrap;display:flex;align-items:center;cursor:pointer;line-height:1.2;font-weight:400;color:",zl.theme.foreground,";position:relative;&[aria-disabled='true']{cursor:default;color:",zl.ui.textDisabled,";}&:not( [aria-disabled='true'] ):is( :hover, [data-focus-visible] ){color:",zl.theme.accent,";}&:focus:not( :disabled ){box-shadow:none;outline:none;}&::after{position:absolute;pointer-events:none;outline:var( --wp-admin-border-width-focus ) solid ",zl.theme.accent,";border-radius:",Fl.radiusSmall,";opacity:0;@media not ( prefers-reduced-motion ){transition:opacity 0.1s linear;}}&[data-focus-visible]::after{opacity:1;}}[aria-orientation='horizontal'] &{padding-inline:",Il(4),";height:",Il(12),";scroll-margin:24px;&::after{content:'';inset:",Il(3),";}}[aria-orientation='vertical'] &{padding:",Il(2)," ",Il(3),";min-height:",Il(10),";&[aria-selected='true']{color:",zl.theme.accent,";fill:currentColor;}}[aria-orientation='vertical'][data-select-on-move='false'] &::after{content:'';inset:var( --wp-admin-border-width-focus );}"),M$=yl("span",{target:"enfox0g2"})({name:"9at4z3",styles:"flex-grow:1;display:flex;align-items:center;[aria-orientation='horizontal'] &{justify-content:center;}[aria-orientation='vertical'] &{justify-content:start;}"}),A$=yl(Xx,{target:"enfox0g1"})("flex-shrink:0;margin-inline-end:",Il(-1),";[aria-orientation='horizontal'] &{display:none;}opacity:0;[role='tab']:is( [aria-selected='true'], [data-focus-visible], :hover ) &{opacity:1;}@media not ( prefers-reduced-motion ){[data-select-on-move='true'] [role='tab']:is( [aria-selected='true'], ) &{transition:opacity 0.15s 0.15s linear;}}&:dir( rtl ){rotate:180deg;}"),D$=yl(nF,{target:"enfox0g0"})("&:focus{box-shadow:none;outline:none;}&[data-focus-visible]{box-shadow:0 0 0 var( --wp-admin-border-width-focus ) ",zl.theme.accent,";outline:2px solid transparent;outline-offset:0;}"),z$=(0,c.forwardRef)((function({children:e,tabId:t,disabled:n,render:r,...o},i){var s;const{store:a,instanceId:l}=null!==(s=T$())&&void 0!==s?s:{};if(!a)return null;const c=`${l}-${t}`;return(0,_t.jsxs)(R$,{ref:i,store:a,id:c,disabled:n,render:r,...o,children:[(0,_t.jsx)(M$,{children:e}),(0,_t.jsx)(A$,{icon:GD})]})}));const O$=(0,c.forwardRef)((function({children:e,...t},n){var r;const{store:o}=null!==(r=T$())&&void 0!==r?r:{},i=et(o,"selectedId"),a=et(o,"activeId"),u=et(o,"selectOnMove"),d=et(o,"items"),[p,f]=(0,c.useState)(),h=(0,l.useMergeRefs)([n,f]),m=o?.item(i),g=et(o,"renderedItems"),v=g&&m?g.indexOf(m):-1,b=g_(m?.element,[v]),x=function(e,t){const[n,r]=(0,c.useState)(!1),[o,i]=(0,c.useState)(!1),[s,a]=(0,c.useState)(),u=(0,l.useEvent)((e=>{for(const n of e)n.target===t.first&&r(!n.isIntersecting),n.target===t.last&&i(!n.isIntersecting)}));return(0,c.useEffect)((()=>{if(!e||!window.IntersectionObserver)return;const t=new IntersectionObserver(u,{root:e,threshold:.9});return a(t),()=>t.disconnect()}),[u,e]),(0,c.useEffect)((()=>{if(s)return t.first&&s.observe(t.first),t.last&&s.observe(t.last),()=>{t.first&&s.unobserve(t.first),t.last&&s.unobserve(t.last)}}),[t.first,t.last,s]),{first:n,last:o}}(p,{first:d?.at(0)?.element,last:d?.at(-1)?.element});v_(p,b,{prefix:"selected",dataAttribute:"indicator-animated",transitionEndFilter:e=>"::before"===e.pseudoElement,roundRect:!0}),function(e,t,{margin:n=24}={}){(0,c.useLayoutEffect)((()=>{if(!e||!t)return;const{scrollLeft:r}=e,o=e.getBoundingClientRect().width,{left:i,width:s}=t,a=i+s+n-(r+o),l=r-(i-n);let c=null;l>0?c=r-l:a>0&&(c=r+a),null!==c&&e.scroll?.({left:c})}),[n,e,t])}(p,b);return o?(0,_t.jsx)(I$,{ref:h,store:o,render:e=>{var t;return(0,_t.jsx)("div",{...e,tabIndex:null!==(t=e.tabIndex)&&void 0!==t?t:-1})},onBlur:()=>{u&&i!==a&&o?.setActiveId(i)},"data-select-on-move":u?"true":"false",...t,className:s(x.first&&"is-overflowing-first",x.last&&"is-overflowing-last",t.className),children:e}):null})),L$=(0,c.forwardRef)((function({children:e,tabId:t,focusable:n=!0,...r},o){const i=T$(),s=et(i?.store,"selectedId");if(!i)return null;const{store:a,instanceId:l}=i,c=`${l}-${t}`;return(0,_t.jsx)(D$,{ref:o,store:a,id:`${c}-view`,tabId:c,focusable:n,...r,children:s===c&&e})}));function F$(e,t){return e&&`${t}-${e}`}function B$(e,t){return"string"==typeof e?e.replace(`${t}-`,""):e}const V$=Object.assign((function e({selectOnMove:t=!0,defaultTabId:n,orientation:r="horizontal",onSelect:o,children:i,selectedTabId:s,activeTabId:u,defaultActiveTabId:d,onActiveTabIdChange:p}){const f=(0,l.useInstanceId)(e,"tabs"),h=GL({selectOnMove:t,orientation:r,defaultSelectedId:F$(n,f),setSelectedId:e=>{o?.(B$(e,f))},selectedId:F$(s,f),defaultActiveId:F$(d,f),setActiveId:e=>{p?.(B$(e,f))},activeId:F$(u,f),rtl:(0,a.isRTL)()}),{items:m,activeId:g}=et(h),{setActiveId:v}=h;(0,c.useEffect)((()=>{requestAnimationFrame((()=>{const e=m?.[0]?.element?.ownerDocument.activeElement;e&&m.some((t=>e===t.element))&&g!==e.id&&v(e.id)}))}),[g,m,v]);const b=(0,c.useMemo)((()=>({store:h,instanceId:f})),[h,f]);return(0,_t.jsx)(N$.Provider,{value:b,children:i})}),{Tab:Object.assign(z$,{displayName:"Tabs.Tab"}),TabList:Object.assign(O$,{displayName:"Tabs.TabList"}),TabPanel:Object.assign(L$,{displayName:"Tabs.TabPanel"}),Context:Object.assign(N$,{displayName:"Tabs.Context"})}),$$=window.wp.privateApis,{lock:H$,unlock:W$}=(0,$$.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/components"),U$=(0,_t.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})}),G$=(0,_t.jsx)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z"})}),K$=(0,_t.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z"})}),q$=(0,_t.jsx)(n.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})});const Y$=function({className:e,intent:t="default",children:n,...r}){const o=function(e="default"){switch(e){case"info":return U$;case"success":return G$;case"warning":return K$;case"error":return q$;default:return null}}(t),i=!!o;return(0,_t.jsxs)("span",{className:s("components-badge",e,{[`is-${t}`]:t,"has-icon":i}),...r,children:[i&&(0,_t.jsx)(Xx,{icon:o,size:16,fill:"currentColor",className:"components-badge__icon"}),(0,_t.jsx)("span",{className:"components-badge__content",children:n})]})},X$={};H$(X$,{__experimentalPopoverLegacyPositionToPlacement:Ji,ComponentsContext:hs,Tabs:V$,Theme:P$,Menu:w$,kebabCase:Ty,Badge:Y$})})(),(window.wp=window.wp||{}).components=i})(); i18n.min.js 0000644 00000021665 15013651111 0006447 0 ustar 00 /*! This file is auto-generated */ (()=>{var t={2058:(t,e,r)=>{var n;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function a(t){return function(t,e){var r,n,o,s,l,u,p,c,f,d=1,h=t.length,g="";for(n=0;n<h;n++)if("string"==typeof t[n])g+=t[n];else if("object"==typeof t[n]){if((s=t[n]).keys)for(r=e[d],o=0;o<s.keys.length;o++){if(null==r)throw new Error(a('[sprintf] Cannot access property "%s" of undefined value "%s"',s.keys[o],s.keys[o-1]));r=r[s.keys[o]]}else r=s.param_no?e[s.param_no]:e[d++];if(i.not_type.test(s.type)&&i.not_primitive.test(s.type)&&r instanceof Function&&(r=r()),i.numeric_arg.test(s.type)&&"number"!=typeof r&&isNaN(r))throw new TypeError(a("[sprintf] expecting number but found %T",r));switch(i.number.test(s.type)&&(c=r>=0),s.type){case"b":r=parseInt(r,10).toString(2);break;case"c":r=String.fromCharCode(parseInt(r,10));break;case"d":case"i":r=parseInt(r,10);break;case"j":r=JSON.stringify(r,null,s.width?parseInt(s.width):0);break;case"e":r=s.precision?parseFloat(r).toExponential(s.precision):parseFloat(r).toExponential();break;case"f":r=s.precision?parseFloat(r).toFixed(s.precision):parseFloat(r);break;case"g":r=s.precision?String(Number(r.toPrecision(s.precision))):parseFloat(r);break;case"o":r=(parseInt(r,10)>>>0).toString(8);break;case"s":r=String(r),r=s.precision?r.substring(0,s.precision):r;break;case"t":r=String(!!r),r=s.precision?r.substring(0,s.precision):r;break;case"T":r=Object.prototype.toString.call(r).slice(8,-1).toLowerCase(),r=s.precision?r.substring(0,s.precision):r;break;case"u":r=parseInt(r,10)>>>0;break;case"v":r=r.valueOf(),r=s.precision?r.substring(0,s.precision):r;break;case"x":r=(parseInt(r,10)>>>0).toString(16);break;case"X":r=(parseInt(r,10)>>>0).toString(16).toUpperCase()}i.json.test(s.type)?g+=r:(!i.number.test(s.type)||c&&!s.sign?f="":(f=c?"+":"-",r=r.toString().replace(i.sign,"")),u=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",p=s.width-(f+r).length,l=s.width&&p>0?u.repeat(p):"",g+=s.align?f+r+l:"0"===u?f+l+r:l+f+r)}return g}(function(t){if(s[t])return s[t];var e,r=t,n=[],a=0;for(;r;){if(null!==(e=i.text.exec(r)))n.push(e[0]);else if(null!==(e=i.modulo.exec(r)))n.push("%");else{if(null===(e=i.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){a|=1;var o=[],l=e[2],u=[];if(null===(u=i.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(l=l.substring(u[0].length));)if(null!==(u=i.key_access.exec(l)))o.push(u[1]);else{if(null===(u=i.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}e[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}r=r.substring(e[0].length)}return s[t]=n}(t),arguments)}function o(t,e){return a.apply(null,[t].concat(e||[]))}var s=Object.create(null);e.sprintf=a,e.vsprintf=o,"undefined"!=typeof window&&(window.sprintf=a,window.vsprintf=o,void 0===(n=function(){return{sprintf:a,vsprintf:o}}.call(e,r,e,t))||(t.exports=n))}()}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,r),a.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{__:()=>F,_n:()=>j,_nx:()=>L,_x:()=>S,createI18n:()=>x,defaultI18n:()=>_,getLocaleData:()=>v,hasTranslation:()=>D,isRTL:()=>T,resetLocaleData:()=>w,setLocaleData:()=>m,sprintf:()=>a,subscribe:()=>k});var t=r(2058),e=r.n(t);const i=function(t,e){var r,n,i=0;function a(){var a,o,s=r,l=arguments.length;t:for(;s;){if(s.args.length===arguments.length){for(o=0;o<l;o++)if(s.args[o]!==arguments[o]){s=s.next;continue t}return s!==r&&(s===n&&(n=s.prev),s.prev.next=s.next,s.next&&(s.next.prev=s.prev),s.next=r,s.prev=null,r.prev=s,r=s),s.val}s=s.next}for(a=new Array(l),o=0;o<l;o++)a[o]=arguments[o];return s={args:a,val:t.apply(null,a)},r?(r.prev=s,s.next=r):n=s,i===e.maxSize?(n=n.prev).next=null:i++,r=s,s.val}return e=e||{},a.clear=function(){r=null,n=null,i=0},a}(console.error);function a(t,...r){try{return e().sprintf(t,...r)}catch(e){return e instanceof Error&&i("sprintf error: \n\n"+e.toString()),t}}var o,s,l,u;o={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},s=["(","?"],l={")":["("],":":["?","?:"]},u=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/;var p={"!":function(t){return!t},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"<":function(t,e){return t<e},"<=":function(t,e){return t<=e},">":function(t,e){return t>e},">=":function(t,e){return t>=e},"==":function(t,e){return t===e},"!=":function(t,e){return t!==e},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},"?:":function(t,e,r){if(t)throw e;return r}};function c(t){var e=function(t){for(var e,r,n,i,a=[],p=[];e=t.match(u);){for(r=e[0],(n=t.substr(0,e.index).trim())&&a.push(n);i=p.pop();){if(l[r]){if(l[r][0]===i){r=l[r][1]||r;break}}else if(s.indexOf(i)>=0||o[i]<o[r]){p.push(i);break}a.push(i)}l[r]||p.push(r),t=t.substr(e.index+r.length)}return(t=t.trim())&&a.push(t),a.concat(p.reverse())}(t);return function(t){return function(t,e){var r,n,i,a,o,s,l=[];for(r=0;r<t.length;r++){if(o=t[r],a=p[o]){for(n=a.length,i=Array(n);n--;)i[n]=l.pop();try{s=a.apply(null,i)}catch(t){return t}}else s=e.hasOwnProperty(o)?e[o]:+o;l.push(s)}return l[0]}(e,t)}}var f={contextDelimiter:"",onMissingKey:null};function d(t,e){var r;for(r in this.data=t,this.pluralForms={},this.options={},f)this.options[r]=void 0!==e&&r in e?e[r]:f[r]}d.prototype.getPluralForm=function(t,e){var r,n,i,a=this.pluralForms[t];return a||("function"!=typeof(i=(r=this.data[t][""])["Plural-Forms"]||r["plural-forms"]||r.plural_forms)&&(n=function(t){var e,r,n;for(e=t.split(";"),r=0;r<e.length;r++)if(0===(n=e[r].trim()).indexOf("plural="))return n.substr(7)}(r["Plural-Forms"]||r["plural-forms"]||r.plural_forms),i=function(t){var e=c(t);return function(t){return+e({n:t})}}(n)),a=this.pluralForms[t]=i),a(e)},d.prototype.dcnpgettext=function(t,e,r,n,i){var a,o,s;return a=void 0===i?0:this.getPluralForm(t,i),o=r,e&&(o=e+this.options.contextDelimiter+r),(s=this.data[t][o])&&s[a]?s[a]:(this.options.onMissingKey&&this.options.onMissingKey(r,t),0===a?r:n)};const h={plural_forms:t=>1===t?0:1},g=/^i18n\.(n?gettext|has_translation)(_|$)/,x=(t,e,r)=>{const n=new d({}),i=new Set,a=()=>{i.forEach((t=>t()))},o=(t,e="default")=>{n.data[e]={...n.data[e],...t},n.data[e][""]={...h,...n.data[e]?.[""]},delete n.pluralForms[e]},s=(t,e)=>{o(t,e),a()},l=(t="default",e,r,i,a)=>(n.data[t]||o(void 0,t),n.dcnpgettext(t,e,r,i,a)),u=(t="default")=>t,p=(t,e,n)=>{let i=l(n,e,t);return r?(i=r.applyFilters("i18n.gettext_with_context",i,t,e,n),r.applyFilters("i18n.gettext_with_context_"+u(n),i,t,e,n)):i};if(t&&s(t,e),r){const t=t=>{g.test(t)&&a()};r.addAction("hookAdded","core/i18n",t),r.addAction("hookRemoved","core/i18n",t)}return{getLocaleData:(t="default")=>n.data[t],setLocaleData:s,addLocaleData:(t,e="default")=>{n.data[e]={...n.data[e],...t,"":{...h,...n.data[e]?.[""],...t?.[""]}},delete n.pluralForms[e],a()},resetLocaleData:(t,e)=>{n.data={},n.pluralForms={},s(t,e)},subscribe:t=>(i.add(t),()=>i.delete(t)),__:(t,e)=>{let n=l(e,void 0,t);return r?(n=r.applyFilters("i18n.gettext",n,t,e),r.applyFilters("i18n.gettext_"+u(e),n,t,e)):n},_x:p,_n:(t,e,n,i)=>{let a=l(i,void 0,t,e,n);return r?(a=r.applyFilters("i18n.ngettext",a,t,e,n,i),r.applyFilters("i18n.ngettext_"+u(i),a,t,e,n,i)):a},_nx:(t,e,n,i,a)=>{let o=l(a,i,t,e,n);return r?(o=r.applyFilters("i18n.ngettext_with_context",o,t,e,n,i,a),r.applyFilters("i18n.ngettext_with_context_"+u(a),o,t,e,n,i,a)):o},isRTL:()=>"rtl"===p("ltr","text direction"),hasTranslation:(t,e,i)=>{const a=e?e+""+t:t;let o=!!n.data?.[null!=i?i:"default"]?.[a];return r&&(o=r.applyFilters("i18n.has_translation",o,t,e,i),o=r.applyFilters("i18n.has_translation_"+u(i),o,t,e,i)),o}}},y=window.wp.hooks,b=x(void 0,void 0,y.defaultHooks),_=b,v=b.getLocaleData.bind(b),m=b.setLocaleData.bind(b),w=b.resetLocaleData.bind(b),k=b.subscribe.bind(b),F=b.__.bind(b),S=b._x.bind(b),j=b._n.bind(b),L=b._nx.bind(b),T=b.isRTL.bind(b),D=b.hasTranslation.bind(b)})(),(window.wp=window.wp||{}).i18n=n})(); html-entities.min.js 0000644 00000001424 15013651111 0010445 0 ustar 00 /*! This file is auto-generated */ (()=>{"use strict";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};let n;function o(e){if("string"!=typeof e||-1===e.indexOf("&"))return e;void 0===n&&(n=document.implementation&&document.implementation.createHTMLDocument?document.implementation.createHTMLDocument("").createElement("textarea"):document.createElement("textarea")),n.innerHTML=e;const t=n.textContent;return n.innerHTML="",t}e.r(t),e.d(t,{decodeEntities:()=>o}),(window.wp=window.wp||{}).htmlEntities=t})(); shortcode.min.js 0000644 00000005524 15013651111 0007656 0 ustar 00 /*! This file is auto-generated */ (()=>{"use strict";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};function n(t){return new RegExp("\\[(\\[?)("+t+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}t.d(e,{default:()=>c});const r=function(t,e){var n,r,s=0;function o(){var o,c,i=n,a=arguments.length;t:for(;i;){if(i.args.length===arguments.length){for(c=0;c<a;c++)if(i.args[c]!==arguments[c]){i=i.next;continue t}return i!==n&&(i===r&&(r=i.prev),i.prev.next=i.next,i.next&&(i.next.prev=i.prev),i.next=n,i.prev=null,n.prev=i,n=i),i.val}i=i.next}for(o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return i={args:o,val:t.apply(null,o)},n?(n.prev=i,i.next=n):r=i,s===e.maxSize?(r=r.prev).next=null:s++,n=i,i.val}return e=e||{},o.clear=function(){n=null,r=null,s=0},o}((t=>{const e={},n=[],r=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;let s;for(t=t.replace(/[\u00a0\u200b]/g," ");s=r.exec(t);)s[1]?e[s[1].toLowerCase()]=s[2]:s[3]?e[s[3].toLowerCase()]=s[4]:s[5]?e[s[5].toLowerCase()]=s[6]:s[7]?n.push(s[7]):s[8]?n.push(s[8]):s[9]&&n.push(s[9]);return{named:e,numeric:n}}));function s(t){let e;return e=t[4]?"self-closing":t[6]?"closed":"single",new o({tag:t[2],attrs:t[3],type:e,content:t[5]})}const o=Object.assign((function(t){const{tag:e,attrs:n,type:s,content:o}=t||{};if(Object.assign(this,{tag:e,type:s,content:o}),this.attrs={named:{},numeric:[]},!n)return;const c=["named","numeric"];"string"==typeof n?this.attrs=r(n):n.length===c.length&&c.every(((t,e)=>t===n[e]))?this.attrs=n:Object.entries(n).forEach((([t,e])=>{this.set(t,e)}))}),{next:function t(e,r,o=0){const c=n(e);c.lastIndex=o;const i=c.exec(r);if(!i)return;if("["===i[1]&&"]"===i[7])return t(e,r,c.lastIndex);const a={index:i.index,content:i[0],shortcode:s(i)};return i[1]&&(a.content=a.content.slice(1),a.index++),i[7]&&(a.content=a.content.slice(0,-1)),a},replace:function(t,e,r){return e.replace(n(t),(function(t,e,n,o,c,i,a,u){if("["===e&&"]"===u)return t;const l=r(s(arguments));return l||""===l?e+l+u:t}))},string:function(t){return new o(t).string()},regexp:n,attrs:r,fromMatch:s});Object.assign(o.prototype,{get(t){return this.attrs["number"==typeof t?"numeric":"named"][t]},set(t,e){return this.attrs["number"==typeof t?"numeric":"named"][t]=e,this},string(){let t="["+this.tag;return this.attrs.numeric.forEach((e=>{/\s/.test(e)?t+=' "'+e+'"':t+=" "+e})),Object.entries(this.attrs.named).forEach((([e,n])=>{t+=" "+e+'="'+n+'"'})),"single"===this.type?t+"]":"self-closing"===this.type?t+" /]":(t+="]",this.content&&(t+=this.content),t+"[/"+this.tag+"]")}});const c=o;(window.wp=window.wp||{}).shortcode=e.default})(); list-reusable-blocks.js 0000644 00000075173 15013651111 0011137 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; ;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// ./node_modules/tslib/tslib.es6.mjs /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { var context = {}; for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; for (var p in contextIn.access) context.access[p] = contextIn.access[p]; context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); if (_ = accept(result.get)) descriptor.get = _; if (_ = accept(result.set)) descriptor.set = _; if (_ = accept(result.init)) initializers.unshift(_); } else if (_ = accept(result)) { if (kind === "field") initializers.unshift(_); else descriptor[key] = _; } } if (target) Object.defineProperty(target, contextIn.name, descriptor); done = true; }; function __runInitializers(thisArg, initializers, value) { var useValue = arguments.length > 2; for (var i = 0; i < initializers.length; i++) { value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); } return useValue ? value : void 0; }; function __propKey(x) { return typeof x === "symbol" ? x : "".concat(x); }; function __setFunctionName(f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); }; function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } function __classPrivateFieldIn(state, receiver) { if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); return typeof state === "function" ? receiver === state : state.has(receiver); } function __addDisposableResource(env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); var dispose, inner; if (async) { if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); dispose = value[Symbol.asyncDispose]; } if (dispose === void 0) { if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); dispose = value[Symbol.dispose]; if (async) inner = dispose; } if (typeof dispose !== "function") throw new TypeError("Object not disposable."); if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; env.stack.push({ value: value, dispose: dispose, async: async }); } else if (async) { env.stack.push({ async: true }); } return value; } var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { var e = new Error(message); return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }; function __disposeResources(env) { function fail(e) { env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; env.hasError = true; } var r, s = 0; function next() { while (r = env.stack.pop()) { try { if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); if (r.dispose) { var result = r.dispose.call(r.value); if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); } else s |= 1; } catch (e) { fail(e); } } if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); if (env.hasError) throw env.error; } return next(); } function __rewriteRelativeImportExtension(path, preserveJsx) { if (typeof path === "string" && /^\.\.?\//.test(path)) { return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); }); } return path; } /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources, __rewriteRelativeImportExtension, }); ;// ./node_modules/lower-case/dist.es2015/index.js /** * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt */ var SUPPORTED_LOCALE = { tr: { regexp: /\u0130|\u0049|\u0049\u0307/g, map: { İ: "\u0069", I: "\u0131", İ: "\u0069", }, }, az: { regexp: /\u0130/g, map: { İ: "\u0069", I: "\u0131", İ: "\u0069", }, }, lt: { regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, map: { I: "\u0069\u0307", J: "\u006A\u0307", Į: "\u012F\u0307", Ì: "\u0069\u0307\u0300", Í: "\u0069\u0307\u0301", Ĩ: "\u0069\u0307\u0303", }, }, }; /** * Localized lower case. */ function localeLowerCase(str, locale) { var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; if (lang) return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); return lowerCase(str); } /** * Lower case as a function. */ function lowerCase(str) { return str.toLowerCase(); } ;// ./node_modules/no-case/dist.es2015/index.js // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; // Remove all non-word characters. var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; /** * Normalize the string into something other libraries can manipulate easier. */ function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); var start = 0; var end = result.length; // Trim the delimiter from around the output string. while (result.charAt(start) === "\0") start++; while (result.charAt(end - 1) === "\0") end--; // Transform each token independently. return result.slice(start, end).split("\0").map(transform).join(delimiter); } /** * Replace `re` in the input string with the replacement value. */ function replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function (input, re) { return input.replace(re, value); }, input); } ;// ./node_modules/dot-case/dist.es2015/index.js function dotCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: "." }, options)); } ;// ./node_modules/param-case/dist.es2015/index.js function paramCase(input, options) { if (options === void 0) { options = {}; } return dotCase(input, __assign({ delimiter: "-" }, options)); } ;// external ["wp","apiFetch"] const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); ;// external ["wp","blob"] const external_wp_blob_namespaceObject = window["wp"]["blob"]; ;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/export.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Export a reusable block as a JSON file. * * @param {number} id */ async function exportReusableBlock(id) { const postType = await external_wp_apiFetch_default()({ path: `/wp/v2/types/wp_block` }); const post = await external_wp_apiFetch_default()({ path: `/wp/v2/${postType.rest_base}/${id}?context=edit` }); const title = post.title.raw; const content = post.content.raw; const syncStatus = post.wp_pattern_sync_status; const fileContent = JSON.stringify({ __file: 'wp_block', title, content, syncStatus }, null, 2); const fileName = paramCase(title) + '.json'; (0,external_wp_blob_namespaceObject.downloadBlob)(fileName, fileContent, 'application/json'); } /* harmony default export */ const utils_export = (exportReusableBlock); ;// external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; ;// external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; ;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/file.js /** * Reads the textual content of the given file. * * @param {File} file File. * @return {Promise<string>} Content of the file. */ function readTextFile(file) { const reader = new window.FileReader(); return new Promise(resolve => { reader.onload = () => { resolve(reader.result); }; reader.readAsText(file); }); } ;// ./node_modules/@wordpress/list-reusable-blocks/build-module/utils/import.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Import a reusable block from a JSON file. * * @param {File} file File. * @return {Promise} Promise returning the imported reusable block. */ async function importReusableBlock(file) { const fileContent = await readTextFile(file); let parsedContent; try { parsedContent = JSON.parse(fileContent); } catch (e) { throw new Error('Invalid JSON file'); } if (parsedContent.__file !== 'wp_block' || !parsedContent.title || !parsedContent.content || typeof parsedContent.title !== 'string' || typeof parsedContent.content !== 'string' || parsedContent.syncStatus && typeof parsedContent.syncStatus !== 'string') { throw new Error('Invalid pattern JSON file'); } const postType = await external_wp_apiFetch_default()({ path: `/wp/v2/types/wp_block` }); const reusableBlock = await external_wp_apiFetch_default()({ path: `/wp/v2/${postType.rest_base}`, data: { title: parsedContent.title, content: parsedContent.content, status: 'publish', meta: parsedContent.syncStatus === 'unsynced' ? { wp_pattern_sync_status: parsedContent.syncStatus } : undefined }, method: 'POST' }); return reusableBlock; } /* harmony default export */ const utils_import = (importReusableBlock); ;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-form/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function ImportForm({ instanceId, onUpload }) { const inputId = 'list-reusable-blocks-import-form-' + instanceId; const formRef = (0,external_wp_element_namespaceObject.useRef)(); const [isLoading, setIsLoading] = (0,external_wp_element_namespaceObject.useState)(false); const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null); const [file, setFile] = (0,external_wp_element_namespaceObject.useState)(null); const onChangeFile = event => { setFile(event.target.files[0]); setError(null); }; const onSubmit = event => { event.preventDefault(); if (!file) { return; } setIsLoading({ isLoading: true }); utils_import(file).then(reusableBlock => { if (!formRef) { return; } setIsLoading(false); onUpload(reusableBlock); }).catch(errors => { if (!formRef) { return; } let uiMessage; switch (errors.message) { case 'Invalid JSON file': uiMessage = (0,external_wp_i18n_namespaceObject.__)('Invalid JSON file'); break; case 'Invalid pattern JSON file': uiMessage = (0,external_wp_i18n_namespaceObject.__)('Invalid pattern JSON file'); break; default: uiMessage = (0,external_wp_i18n_namespaceObject.__)('Unknown error'); } setIsLoading(false); setError(uiMessage); }); }; const onDismissError = () => { setError(null); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { className: "list-reusable-blocks-import-form", onSubmit: onSubmit, ref: formRef, children: [error && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "error", onRemove: () => onDismissError(), children: error }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("label", { htmlFor: inputId, className: "list-reusable-blocks-import-form__label", children: (0,external_wp_i18n_namespaceObject.__)('File') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { id: inputId, type: "file", onChange: onChangeFile }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, type: "submit", isBusy: isLoading, accessibleWhenDisabled: true, disabled: !file || isLoading, variant: "secondary", className: "list-reusable-blocks-import-form__button", children: (0,external_wp_i18n_namespaceObject._x)('Import', 'button label') })] }); } /* harmony default export */ const import_form = ((0,external_wp_compose_namespaceObject.withInstanceId)(ImportForm)); ;// ./node_modules/@wordpress/list-reusable-blocks/build-module/components/import-dropdown/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function ImportDropdown({ onUpload }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: { placement: 'bottom-start' }, contentClassName: "list-reusable-blocks-import-dropdown__content", renderToggle: ({ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", className: "list-reusable-blocks-import-dropdown__button", "aria-expanded": isOpen, onClick: onToggle, variant: "primary", children: (0,external_wp_i18n_namespaceObject.__)('Import from JSON') }), renderContent: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(import_form, { onUpload: (0,external_wp_compose_namespaceObject.pipe)(onClose, onUpload) }) }); } /* harmony default export */ const import_dropdown = (ImportDropdown); ;// ./node_modules/@wordpress/list-reusable-blocks/build-module/index.js /** * WordPress dependencies */ /** * Internal dependencies */ // Setup Export Links. document.body.addEventListener('click', event => { if (!event.target.classList.contains('wp-list-reusable-blocks__export')) { return; } event.preventDefault(); utils_export(event.target.dataset.id); }); // Setup Import Form. document.addEventListener('DOMContentLoaded', () => { const button = document.querySelector('.page-title-action'); if (!button) { return; } const showNotice = () => { const notice = document.createElement('div'); notice.className = 'notice notice-success is-dismissible'; notice.innerHTML = `<p>${(0,external_wp_i18n_namespaceObject.__)('Pattern imported successfully!')}</p>`; const headerEnd = document.querySelector('.wp-header-end'); if (!headerEnd) { return; } headerEnd.parentNode.insertBefore(notice, headerEnd); }; const container = document.createElement('div'); container.className = 'list-reusable-blocks__container'; button.parentNode.insertBefore(container, button); (0,external_wp_element_namespaceObject.createRoot)(container).render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(import_dropdown, { onUpload: showNotice }) })); }); (window.wp = window.wp || {}).listReusableBlocks = __webpack_exports__; /******/ })() ; private-apis.js 0000644 00000020467 15013651111 0007511 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { __dangerousOptInToUnstableAPIsOnlyForCoreModules: () => (/* reexport */ __dangerousOptInToUnstableAPIsOnlyForCoreModules) }); ;// ./node_modules/@wordpress/private-apis/build-module/implementation.js /** * wordpress/private-apis – the utilities to enable private cross-package * exports of private APIs. * * This "implementation.ts" file is needed for the sake of the unit tests. It * exports more than the public API of the package to aid in testing. */ /** * The list of core modules allowed to opt-in to the private APIs. */ const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-directory', '@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/format-library', '@wordpress/patterns', '@wordpress/preferences', '@wordpress/reusable-blocks', '@wordpress/router', '@wordpress/dataviews', '@wordpress/fields', '@wordpress/media-utils', '@wordpress/upload-media']; /** * A list of core modules that already opted-in to * the privateApis package. */ const registeredPrivateApis = []; /* * Warning for theme and plugin developers. * * The use of private developer APIs is intended for use by WordPress Core * and the Gutenberg plugin exclusively. * * Dangerously opting in to using these APIs is NOT RECOMMENDED. Furthermore, * the WordPress Core philosophy to strive to maintain backward compatibility * for third-party developers DOES NOT APPLY to private APIs. * * THE CONSENT STRING FOR OPTING IN TO THESE APIS MAY CHANGE AT ANY TIME AND * WITHOUT NOTICE. THIS CHANGE WILL BREAK EXISTING THIRD-PARTY CODE. SUCH A * CHANGE MAY OCCUR IN EITHER A MAJOR OR MINOR RELEASE. */ const requiredConsent = 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.'; // The safety measure is meant for WordPress core where IS_WORDPRESS_CORE is set to true. const allowReRegistration = true ? false : 0; /** * Called by a @wordpress package wishing to opt-in to accessing or exposing * private private APIs. * * @param consent The consent string. * @param moduleName The name of the module that is opting in. * @return An object containing the lock and unlock functions. */ const __dangerousOptInToUnstableAPIsOnlyForCoreModules = (consent, moduleName) => { if (!CORE_MODULES_USING_PRIVATE_APIS.includes(moduleName)) { throw new Error(`You tried to opt-in to unstable APIs as module "${moduleName}". ` + 'This feature is only for JavaScript modules shipped with WordPress core. ' + 'Please do not use it in plugins and themes as the unstable APIs will be removed ' + 'without a warning. If you ignore this error and depend on unstable features, ' + 'your product will inevitably break on one of the next WordPress releases.'); } if (!allowReRegistration && registeredPrivateApis.includes(moduleName)) { // This check doesn't play well with Story Books / Hot Module Reloading // and isn't included in the Gutenberg plugin. It only matters in the // WordPress core release. throw new Error(`You tried to opt-in to unstable APIs as module "${moduleName}" which is already registered. ` + 'This feature is only for JavaScript modules shipped with WordPress core. ' + 'Please do not use it in plugins and themes as the unstable APIs will be removed ' + 'without a warning. If you ignore this error and depend on unstable features, ' + 'your product will inevitably break on one of the next WordPress releases.'); } if (consent !== requiredConsent) { throw new Error(`You tried to opt-in to unstable APIs without confirming you know the consequences. ` + 'This feature is only for JavaScript modules shipped with WordPress core. ' + 'Please do not use it in plugins and themes as the unstable APIs will removed ' + 'without a warning. If you ignore this error and depend on unstable features, ' + 'your product will inevitably break on the next WordPress release.'); } registeredPrivateApis.push(moduleName); return { lock, unlock }; }; /** * Binds private data to an object. * It does not alter the passed object in any way, only * registers it in an internal map of private data. * * The private data can't be accessed by any other means * than the `unlock` function. * * @example * ```js * const object = {}; * const privateData = { a: 1 }; * lock( object, privateData ); * * object * // {} * * unlock( object ); * // { a: 1 } * ``` * * @param object The object to bind the private data to. * @param privateData The private data to bind to the object. */ function lock(object, privateData) { if (!object) { throw new Error('Cannot lock an undefined object.'); } const _object = object; if (!(__private in _object)) { _object[__private] = {}; } lockedData.set(_object[__private], privateData); } /** * Unlocks the private data bound to an object. * * It does not alter the passed object in any way, only * returns the private data paired with it using the `lock()` * function. * * @example * ```js * const object = {}; * const privateData = { a: 1 }; * lock( object, privateData ); * * object * // {} * * unlock( object ); * // { a: 1 } * ``` * * @param object The object to unlock the private data from. * @return The private data bound to the object. */ function unlock(object) { if (!object) { throw new Error('Cannot unlock an undefined object.'); } const _object = object; if (!(__private in _object)) { throw new Error('Cannot unlock an object that was not locked before. '); } return lockedData.get(_object[__private]); } const lockedData = new WeakMap(); /** * Used by lock() and unlock() to uniquely identify the private data * related to a containing object. */ const __private = Symbol('Private API ID'); // Unit tests utilities: /** * Private function to allow the unit tests to allow * a mock module to access the private APIs. * * @param name The name of the module. */ function allowCoreModule(name) { CORE_MODULES_USING_PRIVATE_APIS.push(name); } /** * Private function to allow the unit tests to set * a custom list of allowed modules. */ function resetAllowedCoreModules() { while (CORE_MODULES_USING_PRIVATE_APIS.length) { CORE_MODULES_USING_PRIVATE_APIS.pop(); } } /** * Private function to allow the unit tests to reset * the list of registered private apis. */ function resetRegisteredPrivateApis() { while (registeredPrivateApis.length) { registeredPrivateApis.pop(); } } ;// ./node_modules/@wordpress/private-apis/build-module/index.js (window.wp = window.wp || {}).privateApis = __webpack_exports__; /******/ })() ; edit-widgets.js 0000644 00000526764 15013651111 0007511 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { initialize: () => (/* binding */ initialize), initializeEditor: () => (/* binding */ initializeEditor), reinitializeEditor: () => (/* binding */ reinitializeEditor), store: () => (/* reexport */ store_store) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); __webpack_require__.d(actions_namespaceObject, { closeModal: () => (closeModal), disableComplementaryArea: () => (disableComplementaryArea), enableComplementaryArea: () => (enableComplementaryArea), openModal: () => (openModal), pinItem: () => (pinItem), setDefaultComplementaryArea: () => (setDefaultComplementaryArea), setFeatureDefaults: () => (setFeatureDefaults), setFeatureValue: () => (setFeatureValue), toggleFeature: () => (toggleFeature), unpinItem: () => (unpinItem) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/interface/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); __webpack_require__.d(selectors_namespaceObject, { getActiveComplementaryArea: () => (getActiveComplementaryArea), isComplementaryAreaLoading: () => (isComplementaryAreaLoading), isFeatureActive: () => (isFeatureActive), isItemPinned: () => (isItemPinned), isModalActive: () => (isModalActive) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js var store_actions_namespaceObject = {}; __webpack_require__.r(store_actions_namespaceObject); __webpack_require__.d(store_actions_namespaceObject, { closeGeneralSidebar: () => (closeGeneralSidebar), moveBlockToWidgetArea: () => (moveBlockToWidgetArea), persistStubPost: () => (persistStubPost), saveEditedWidgetAreas: () => (saveEditedWidgetAreas), saveWidgetArea: () => (saveWidgetArea), saveWidgetAreas: () => (saveWidgetAreas), setIsInserterOpened: () => (setIsInserterOpened), setIsListViewOpened: () => (setIsListViewOpened), setIsWidgetAreaOpen: () => (setIsWidgetAreaOpen), setWidgetAreasOpenState: () => (setWidgetAreasOpenState), setWidgetIdForClientId: () => (setWidgetIdForClientId) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js var resolvers_namespaceObject = {}; __webpack_require__.r(resolvers_namespaceObject); __webpack_require__.d(resolvers_namespaceObject, { getWidgetAreas: () => (getWidgetAreas), getWidgets: () => (getWidgets) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js var store_selectors_namespaceObject = {}; __webpack_require__.r(store_selectors_namespaceObject); __webpack_require__.d(store_selectors_namespaceObject, { __experimentalGetInsertionPoint: () => (__experimentalGetInsertionPoint), canInsertBlockInWidgetArea: () => (canInsertBlockInWidgetArea), getEditedWidgetAreas: () => (getEditedWidgetAreas), getIsWidgetAreaOpen: () => (getIsWidgetAreaOpen), getParentWidgetAreaBlock: () => (getParentWidgetAreaBlock), getReferenceWidgetBlocks: () => (getReferenceWidgetBlocks), getWidget: () => (getWidget), getWidgetAreaForWidgetId: () => (getWidgetAreaForWidgetId), getWidgetAreas: () => (selectors_getWidgetAreas), getWidgets: () => (selectors_getWidgets), isInserterOpened: () => (isInserterOpened), isListViewOpened: () => (isListViewOpened), isSavingWidgetAreas: () => (isSavingWidgetAreas) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js var private_selectors_namespaceObject = {}; __webpack_require__.r(private_selectors_namespaceObject); __webpack_require__.d(private_selectors_namespaceObject, { getInserterSidebarToggleRef: () => (getInserterSidebarToggleRef), getListViewToggleRef: () => (getListViewToggleRef) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js var widget_area_namespaceObject = {}; __webpack_require__.r(widget_area_namespaceObject); __webpack_require__.d(widget_area_namespaceObject, { metadata: () => (metadata), name: () => (widget_area_name), settings: () => (settings) }); ;// external ["wp","blocks"] const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; ;// external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// external ["wp","deprecated"] const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); ;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// external ["wp","blockLibrary"] const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; ;// external ["wp","coreData"] const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; ;// external ["wp","widgets"] const external_wp_widgets_namespaceObject = window["wp"]["widgets"]; ;// external ["wp","preferences"] const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; ;// external ["wp","apiFetch"] const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); ;// ./node_modules/@wordpress/edit-widgets/build-module/store/reducer.js /** * WordPress dependencies */ /** * Controls the open state of the widget areas. * * @param {Object} state Redux state. * @param {Object} action Redux action. * * @return {Array} Updated state. */ function widgetAreasOpenState(state = {}, action) { const { type } = action; switch (type) { case 'SET_WIDGET_AREAS_OPEN_STATE': { return action.widgetAreasOpenState; } case 'SET_IS_WIDGET_AREA_OPEN': { const { clientId, isOpen } = action; return { ...state, [clientId]: isOpen }; } default: { return state; } } } /** * Reducer to set the block inserter panel open or closed. * * Note: this reducer interacts with the list view panel reducer * to make sure that only one of the two panels is open at the same time. * * @param {Object} state Current state. * @param {Object} action Dispatched action. */ function blockInserterPanel(state = false, action) { switch (action.type) { case 'SET_IS_LIST_VIEW_OPENED': return action.isOpen ? false : state; case 'SET_IS_INSERTER_OPENED': return action.value; } return state; } /** * Reducer to set the list view panel open or closed. * * Note: this reducer interacts with the inserter panel reducer * to make sure that only one of the two panels is open at the same time. * * @param {Object} state Current state. * @param {Object} action Dispatched action. */ function listViewPanel(state = false, action) { switch (action.type) { case 'SET_IS_INSERTER_OPENED': return action.value ? false : state; case 'SET_IS_LIST_VIEW_OPENED': return action.isOpen; } return state; } /** * This reducer does nothing aside initializing a ref to the list view toggle. * We will have a unique ref per "editor" instance. * * @param {Object} state * @return {Object} Reference to the list view toggle button. */ function listViewToggleRef(state = { current: null }) { return state; } /** * This reducer does nothing aside initializing a ref to the inserter sidebar toggle. * We will have a unique ref per "editor" instance. * * @param {Object} state * @return {Object} Reference to the inserter sidebar toggle button. */ function inserterSidebarToggleRef(state = { current: null }) { return state; } /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ blockInserterPanel, inserterSidebarToggleRef, listViewPanel, listViewToggleRef, widgetAreasOpenState })); ;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// external ["wp","notices"] const external_wp_notices_namespaceObject = window["wp"]["notices"]; ;// ./node_modules/clsx/dist/clsx.mjs function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx); ;// external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; ;// external ["wp","primitives"] const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; ;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// ./node_modules/@wordpress/icons/build-module/library/check.js /** * WordPress dependencies */ const check = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" }) }); /* harmony default export */ const library_check = (check); ;// ./node_modules/@wordpress/icons/build-module/library/star-filled.js /** * WordPress dependencies */ const starFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z" }) }); /* harmony default export */ const star_filled = (starFilled); ;// ./node_modules/@wordpress/icons/build-module/library/star-empty.js /** * WordPress dependencies */ const starEmpty = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z", clipRule: "evenodd" }) }); /* harmony default export */ const star_empty = (starEmpty); ;// external ["wp","viewport"] const external_wp_viewport_namespaceObject = window["wp"]["viewport"]; ;// external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; ;// external ["wp","plugins"] const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; ;// ./node_modules/@wordpress/icons/build-module/library/close-small.js /** * WordPress dependencies */ const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) }); /* harmony default export */ const close_small = (closeSmall); ;// ./node_modules/@wordpress/interface/build-module/store/deprecated.js /** * WordPress dependencies */ function normalizeComplementaryAreaScope(scope) { if (['core/edit-post', 'core/edit-site'].includes(scope)) { external_wp_deprecated_default()(`${scope} interface scope`, { alternative: 'core interface scope', hint: 'core/edit-post and core/edit-site are merging.', version: '6.6' }); return 'core'; } return scope; } function normalizeComplementaryAreaName(scope, name) { if (scope === 'core' && name === 'edit-site/template') { external_wp_deprecated_default()(`edit-site/template sidebar`, { alternative: 'edit-post/document', version: '6.6' }); return 'edit-post/document'; } if (scope === 'core' && name === 'edit-site/block-inspector') { external_wp_deprecated_default()(`edit-site/block-inspector sidebar`, { alternative: 'edit-post/block', version: '6.6' }); return 'edit-post/block'; } return name; } ;// ./node_modules/@wordpress/interface/build-module/store/actions.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Set a default complementary area. * * @param {string} scope Complementary area scope. * @param {string} area Area identifier. * * @return {Object} Action object. */ const setDefaultComplementaryArea = (scope, area) => { scope = normalizeComplementaryAreaScope(scope); area = normalizeComplementaryAreaName(scope, area); return { type: 'SET_DEFAULT_COMPLEMENTARY_AREA', scope, area }; }; /** * Enable the complementary area. * * @param {string} scope Complementary area scope. * @param {string} area Area identifier. */ const enableComplementaryArea = (scope, area) => ({ registry, dispatch }) => { // Return early if there's no area. if (!area) { return; } scope = normalizeComplementaryAreaScope(scope); area = normalizeComplementaryAreaName(scope, area); const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); if (!isComplementaryAreaVisible) { registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', true); } dispatch({ type: 'ENABLE_COMPLEMENTARY_AREA', scope, area }); }; /** * Disable the complementary area. * * @param {string} scope Complementary area scope. */ const disableComplementaryArea = scope => ({ registry }) => { scope = normalizeComplementaryAreaScope(scope); const isComplementaryAreaVisible = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); if (isComplementaryAreaVisible) { registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'isComplementaryAreaVisible', false); } }; /** * Pins an item. * * @param {string} scope Item scope. * @param {string} item Item identifier. * * @return {Object} Action object. */ const pinItem = (scope, item) => ({ registry }) => { // Return early if there's no item. if (!item) { return; } scope = normalizeComplementaryAreaScope(scope); item = normalizeComplementaryAreaName(scope, item); const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); // The item is already pinned, there's nothing to do. if (pinnedItems?.[item] === true) { return; } registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems, [item]: true }); }; /** * Unpins an item. * * @param {string} scope Item scope. * @param {string} item Item identifier. */ const unpinItem = (scope, item) => ({ registry }) => { // Return early if there's no item. if (!item) { return; } scope = normalizeComplementaryAreaScope(scope); item = normalizeComplementaryAreaName(scope, item); const pinnedItems = registry.select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, 'pinnedItems', { ...pinnedItems, [item]: false }); }; /** * Returns an action object used in signalling that a feature should be toggled. * * @param {string} scope The feature scope (e.g. core/edit-post). * @param {string} featureName The feature name. */ function toggleFeature(scope, featureName) { return function ({ registry }) { external_wp_deprecated_default()(`dispatch( 'core/interface' ).toggleFeature`, { since: '6.0', alternative: `dispatch( 'core/preferences' ).toggle` }); registry.dispatch(external_wp_preferences_namespaceObject.store).toggle(scope, featureName); }; } /** * Returns an action object used in signalling that a feature should be set to * a true or false value * * @param {string} scope The feature scope (e.g. core/edit-post). * @param {string} featureName The feature name. * @param {boolean} value The value to set. * * @return {Object} Action object. */ function setFeatureValue(scope, featureName, value) { return function ({ registry }) { external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureValue`, { since: '6.0', alternative: `dispatch( 'core/preferences' ).set` }); registry.dispatch(external_wp_preferences_namespaceObject.store).set(scope, featureName, !!value); }; } /** * Returns an action object used in signalling that defaults should be set for features. * * @param {string} scope The feature scope (e.g. core/edit-post). * @param {Object<string, boolean>} defaults A key/value map of feature names to values. * * @return {Object} Action object. */ function setFeatureDefaults(scope, defaults) { return function ({ registry }) { external_wp_deprecated_default()(`dispatch( 'core/interface' ).setFeatureDefaults`, { since: '6.0', alternative: `dispatch( 'core/preferences' ).setDefaults` }); registry.dispatch(external_wp_preferences_namespaceObject.store).setDefaults(scope, defaults); }; } /** * Returns an action object used in signalling that the user opened a modal. * * @param {string} name A string that uniquely identifies the modal. * * @return {Object} Action object. */ function openModal(name) { return { type: 'OPEN_MODAL', name }; } /** * Returns an action object signalling that the user closed a modal. * * @return {Object} Action object. */ function closeModal() { return { type: 'CLOSE_MODAL' }; } ;// ./node_modules/@wordpress/interface/build-module/store/selectors.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns the complementary area that is active in a given scope. * * @param {Object} state Global application state. * @param {string} scope Item scope. * * @return {string | null | undefined} The complementary area that is active in the given scope. */ const getActiveComplementaryArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => { scope = normalizeComplementaryAreaScope(scope); const isComplementaryAreaVisible = select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); // Return `undefined` to indicate that the user has never toggled // visibility, this is the vanilla default. Other code relies on this // nuance in the return value. if (isComplementaryAreaVisible === undefined) { return undefined; } // Return `null` to indicate the user hid the complementary area. if (isComplementaryAreaVisible === false) { return null; } return state?.complementaryAreas?.[scope]; }); const isComplementaryAreaLoading = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope) => { scope = normalizeComplementaryAreaScope(scope); const isVisible = select(external_wp_preferences_namespaceObject.store).get(scope, 'isComplementaryAreaVisible'); const identifier = state?.complementaryAreas?.[scope]; return isVisible && identifier === undefined; }); /** * Returns a boolean indicating if an item is pinned or not. * * @param {Object} state Global application state. * @param {string} scope Scope. * @param {string} item Item to check. * * @return {boolean} True if the item is pinned and false otherwise. */ const isItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, item) => { var _pinnedItems$item; scope = normalizeComplementaryAreaScope(scope); item = normalizeComplementaryAreaName(scope, item); const pinnedItems = select(external_wp_preferences_namespaceObject.store).get(scope, 'pinnedItems'); return (_pinnedItems$item = pinnedItems?.[item]) !== null && _pinnedItems$item !== void 0 ? _pinnedItems$item : true; }); /** * Returns a boolean indicating whether a feature is active for a particular * scope. * * @param {Object} state The store state. * @param {string} scope The scope of the feature (e.g. core/edit-post). * @param {string} featureName The name of the feature. * * @return {boolean} Is the feature enabled? */ const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, scope, featureName) => { external_wp_deprecated_default()(`select( 'core/interface' ).isFeatureActive( scope, featureName )`, { since: '6.0', alternative: `select( 'core/preferences' ).get( scope, featureName )` }); return !!select(external_wp_preferences_namespaceObject.store).get(scope, featureName); }); /** * Returns true if a modal is active, or false otherwise. * * @param {Object} state Global application state. * @param {string} modalName A string that uniquely identifies the modal. * * @return {boolean} Whether the modal is active. */ function isModalActive(state, modalName) { return state.activeModal === modalName; } ;// ./node_modules/@wordpress/interface/build-module/store/reducer.js /** * WordPress dependencies */ function complementaryAreas(state = {}, action) { switch (action.type) { case 'SET_DEFAULT_COMPLEMENTARY_AREA': { const { scope, area } = action; // If there's already an area, don't overwrite it. if (state[scope]) { return state; } return { ...state, [scope]: area }; } case 'ENABLE_COMPLEMENTARY_AREA': { const { scope, area } = action; return { ...state, [scope]: area }; } } return state; } /** * Reducer for storing the name of the open modal, or null if no modal is open. * * @param {Object} state Previous state. * @param {Object} action Action object containing the `name` of the modal * * @return {Object} Updated state */ function activeModal(state = null, action) { switch (action.type) { case 'OPEN_MODAL': return action.name; case 'CLOSE_MODAL': return null; } return state; } /* harmony default export */ const store_reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ complementaryAreas, activeModal })); ;// ./node_modules/@wordpress/interface/build-module/store/constants.js /** * The identifier for the data store. * * @type {string} */ const STORE_NAME = 'core/interface'; ;// ./node_modules/@wordpress/interface/build-module/store/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Store definition for the interface namespace. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { reducer: store_reducer, actions: actions_namespaceObject, selectors: selectors_namespaceObject }); // Once we build a more generic persistence plugin that works across types of stores // we'd be able to replace this with a register call. (0,external_wp_data_namespaceObject.register)(store); ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-toggle/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Whether the role supports checked state. * * @see https://www.w3.org/TR/wai-aria-1.1/#aria-checked * @param {import('react').AriaRole} role Role. * @return {boolean} Whether the role supports checked state. */ function roleSupportsCheckedState(role) { return ['checkbox', 'option', 'radio', 'switch', 'menuitemcheckbox', 'menuitemradio', 'treeitem'].includes(role); } function ComplementaryAreaToggle({ as = external_wp_components_namespaceObject.Button, scope, identifier: identifierProp, icon: iconProp, selectedIcon, name, shortcut, ...props }) { const ComponentToUse = as; const context = (0,external_wp_plugins_namespaceObject.usePluginContext)(); const icon = iconProp || context.icon; const identifier = identifierProp || `${context.name}/${name}`; const isSelected = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getActiveComplementaryArea(scope) === identifier, [identifier, scope]); const { enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComponentToUse, { icon: selectedIcon && isSelected ? selectedIcon : icon, "aria-controls": identifier.replace('/', ':') // Make sure aria-checked matches spec https://www.w3.org/TR/wai-aria-1.1/#aria-checked , "aria-checked": roleSupportsCheckedState(props.role) ? isSelected : undefined, onClick: () => { if (isSelected) { disableComplementaryArea(scope); } else { enableComplementaryArea(scope, identifier); } }, shortcut: shortcut, ...props }); } ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-header/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const ComplementaryAreaHeader = ({ children, className, toggleButtonProps }) => { const toggleButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { icon: close_small, ...toggleButtonProps }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx('components-panel__header', 'interface-complementary-area-header', className), tabIndex: -1, children: [children, toggleButton] }); }; /* harmony default export */ const complementary_area_header = (ComplementaryAreaHeader); ;// ./node_modules/@wordpress/interface/build-module/components/action-item/index.js /** * WordPress dependencies */ const noop = () => {}; function ActionItemSlot({ name, as: Component = external_wp_components_namespaceObject.MenuGroup, fillProps = {}, bubblesVirtually, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: name, bubblesVirtually: bubblesVirtually, fillProps: fillProps, children: fills => { if (!external_wp_element_namespaceObject.Children.toArray(fills).length) { return null; } // Special handling exists for backward compatibility. // It ensures that menu items created by plugin authors aren't // duplicated with automatically injected menu items coming // from pinnable plugin sidebars. // @see https://github.com/WordPress/gutenberg/issues/14457 const initializedByPlugins = []; external_wp_element_namespaceObject.Children.forEach(fills, ({ props: { __unstableExplicitMenuItem, __unstableTarget } }) => { if (__unstableTarget && __unstableExplicitMenuItem) { initializedByPlugins.push(__unstableTarget); } }); const children = external_wp_element_namespaceObject.Children.map(fills, child => { if (!child.props.__unstableExplicitMenuItem && initializedByPlugins.includes(child.props.__unstableTarget)) { return null; } return child; }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { ...props, children: children }); } }); } function ActionItem({ name, as: Component = external_wp_components_namespaceObject.Button, onClick, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name: name, children: ({ onClick: fpOnClick }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { onClick: onClick || fpOnClick ? (...args) => { (onClick || noop)(...args); (fpOnClick || noop)(...args); } : undefined, ...props }); } }); } ActionItem.Slot = ActionItemSlot; /* harmony default export */ const action_item = (ActionItem); ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area-more-menu-item/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const PluginsMenuItem = ({ // Menu item is marked with unstable prop for backward compatibility. // They are removed so they don't leak to DOM elements. // @see https://github.com/WordPress/gutenberg/issues/14457 __unstableExplicitMenuItem, __unstableTarget, ...restProps }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { ...restProps }); function ComplementaryAreaMoreMenuItem({ scope, target, __unstableExplicitMenuItem, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { as: toggleProps => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(action_item, { __unstableExplicitMenuItem: __unstableExplicitMenuItem, __unstableTarget: `${scope}/${target}`, as: PluginsMenuItem, name: `${scope}/plugin-more-menu`, ...toggleProps }); }, role: "menuitemcheckbox", selectedIcon: library_check, name: target, scope: scope, ...props }); } ;// ./node_modules/@wordpress/interface/build-module/components/pinned-items/index.js /** * External dependencies */ /** * WordPress dependencies */ function PinnedItems({ scope, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name: `PinnedItems/${scope}`, ...props }); } function PinnedItemsSlot({ scope, className, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: `PinnedItems/${scope}`, ...props, children: fills => fills?.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx(className, 'interface-pinned-items'), children: fills }) }); } PinnedItems.Slot = PinnedItemsSlot; /* harmony default export */ const pinned_items = (PinnedItems); ;// ./node_modules/@wordpress/interface/build-module/components/complementary-area/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const ANIMATION_DURATION = 0.3; function ComplementaryAreaSlot({ scope, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: `ComplementaryArea/${scope}`, ...props }); } const SIDEBAR_WIDTH = 280; const variants = { open: { width: SIDEBAR_WIDTH }, closed: { width: 0 }, mobileOpen: { width: '100vw' } }; function ComplementaryAreaFill({ activeArea, isActive, scope, children, className, id }) { const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); // This is used to delay the exit animation to the next tick. // The reason this is done is to allow us to apply the right transition properties // When we switch from an open sidebar to another open sidebar. // we don't want to animate in this case. const previousActiveArea = (0,external_wp_compose_namespaceObject.usePrevious)(activeArea); const previousIsActive = (0,external_wp_compose_namespaceObject.usePrevious)(isActive); const [, setState] = (0,external_wp_element_namespaceObject.useState)({}); (0,external_wp_element_namespaceObject.useEffect)(() => { setState({}); }, [isActive]); const transition = { type: 'tween', duration: disableMotion || isMobileViewport || !!previousActiveArea && !!activeArea && activeArea !== previousActiveArea ? 0 : ANIMATION_DURATION, ease: [0.6, 0, 0.4, 1] }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name: `ComplementaryArea/${scope}`, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: (previousIsActive || isActive) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { variants: variants, initial: "closed", animate: isMobileViewport ? 'mobileOpen' : 'open', exit: "closed", transition: transition, className: "interface-complementary-area__fill", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { id: id, className: className, style: { width: isMobileViewport ? '100vw' : SIDEBAR_WIDTH }, children: children }) }) }) }); } function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) { const previousIsSmallRef = (0,external_wp_element_namespaceObject.useRef)(false); const shouldOpenWhenNotSmallRef = (0,external_wp_element_namespaceObject.useRef)(false); const { enableComplementaryArea, disableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); (0,external_wp_element_namespaceObject.useEffect)(() => { // If the complementary area is active and the editor is switching from // a big to a small window size. if (isActive && isSmall && !previousIsSmallRef.current) { disableComplementaryArea(scope); // Flag the complementary area to be reopened when the window size // goes from small to big. shouldOpenWhenNotSmallRef.current = true; } else if ( // If there is a flag indicating the complementary area should be // enabled when we go from small to big window size and we are going // from a small to big window size. shouldOpenWhenNotSmallRef.current && !isSmall && previousIsSmallRef.current) { // Remove the flag indicating the complementary area should be // enabled. shouldOpenWhenNotSmallRef.current = false; enableComplementaryArea(scope, identifier); } else if ( // If the flag is indicating the current complementary should be // reopened but another complementary area becomes active, remove // the flag. shouldOpenWhenNotSmallRef.current && activeArea && activeArea !== identifier) { shouldOpenWhenNotSmallRef.current = false; } if (isSmall !== previousIsSmallRef.current) { previousIsSmallRef.current = isSmall; } }, [isActive, isSmall, scope, identifier, activeArea, disableComplementaryArea, enableComplementaryArea]); } function ComplementaryArea({ children, className, closeLabel = (0,external_wp_i18n_namespaceObject.__)('Close plugin'), identifier: identifierProp, header, headerClassName, icon: iconProp, isPinnable = true, panelClassName, scope, name, title, toggleShortcut, isActiveByDefault }) { const context = (0,external_wp_plugins_namespaceObject.usePluginContext)(); const icon = iconProp || context.icon; const identifier = identifierProp || `${context.name}/${name}`; // This state is used to delay the rendering of the Fill // until the initial effect runs. // This prevents the animation from running on mount if // the complementary area is active by default. const [isReady, setIsReady] = (0,external_wp_element_namespaceObject.useState)(false); const { isLoading, isActive, isPinned, activeArea, isSmall, isLarge, showIconLabels } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getActiveComplementaryArea, isComplementaryAreaLoading, isItemPinned } = select(store); const { get } = select(external_wp_preferences_namespaceObject.store); const _activeArea = getActiveComplementaryArea(scope); return { isLoading: isComplementaryAreaLoading(scope), isActive: _activeArea === identifier, isPinned: isItemPinned(scope, identifier), activeArea: _activeArea, isSmall: select(external_wp_viewport_namespaceObject.store).isViewportMatch('< medium'), isLarge: select(external_wp_viewport_namespaceObject.store).isViewportMatch('large'), showIconLabels: get('core', 'showIconLabels') }; }, [identifier, scope]); const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall); const { enableComplementaryArea, disableComplementaryArea, pinItem, unpinItem } = (0,external_wp_data_namespaceObject.useDispatch)(store); (0,external_wp_element_namespaceObject.useEffect)(() => { // Set initial visibility: For large screens, enable if it's active by // default. For small screens, always initially disable. if (isActiveByDefault && activeArea === undefined && !isSmall) { enableComplementaryArea(scope, identifier); } else if (activeArea === undefined && isSmall) { disableComplementaryArea(scope, identifier); } setIsReady(true); }, [activeArea, isActiveByDefault, scope, identifier, isSmall, enableComplementaryArea, disableComplementaryArea]); if (!isReady) { return; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isPinnable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items, { scope: scope, children: isPinned && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaToggle, { scope: scope, identifier: identifier, isPressed: isActive && (!showIconLabels || isLarge), "aria-expanded": isActive, "aria-disabled": isLoading, label: title, icon: showIconLabels ? library_check : icon, showTooltip: !showIconLabels, variant: showIconLabels ? 'tertiary' : undefined, size: "compact", shortcut: toggleShortcut }) }), name && isPinnable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComplementaryAreaMoreMenuItem, { target: name, scope: scope, icon: icon, children: title }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ComplementaryAreaFill, { activeArea: activeArea, isActive: isActive, className: dist_clsx('interface-complementary-area', className), scope: scope, id: identifier.replace('/', ':'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area_header, { className: headerClassName, closeLabel: closeLabel, onClose: () => disableComplementaryArea(scope), toggleButtonProps: { label: closeLabel, size: 'compact', shortcut: toggleShortcut, scope, identifier }, children: header || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "interface-complementary-area-header__title", children: title }), isPinnable && !isMobileViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "interface-complementary-area__pin-unpin-item", icon: isPinned ? star_filled : star_empty, label: isPinned ? (0,external_wp_i18n_namespaceObject.__)('Unpin from toolbar') : (0,external_wp_i18n_namespaceObject.__)('Pin to toolbar'), onClick: () => (isPinned ? unpinItem : pinItem)(scope, identifier), isPressed: isPinned, "aria-expanded": isPinned, size: "compact" })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Panel, { className: panelClassName, children: children })] })] }); } ComplementaryArea.Slot = ComplementaryAreaSlot; /* harmony default export */ const complementary_area = (ComplementaryArea); ;// ./node_modules/@wordpress/interface/build-module/components/navigable-region/index.js /** * WordPress dependencies */ /** * External dependencies */ const NavigableRegion = (0,external_wp_element_namespaceObject.forwardRef)(({ children, className, ariaLabel, as: Tag = 'div', ...props }, ref) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ref: ref, className: dist_clsx('interface-navigable-region', className), "aria-label": ariaLabel, role: "region", tabIndex: "-1", ...props, children: children }); }); NavigableRegion.displayName = 'NavigableRegion'; /* harmony default export */ const navigable_region = (NavigableRegion); ;// ./node_modules/@wordpress/interface/build-module/components/interface-skeleton/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const interface_skeleton_ANIMATION_DURATION = 0.25; const commonTransition = { type: 'tween', duration: interface_skeleton_ANIMATION_DURATION, ease: [0.6, 0, 0.4, 1] }; function useHTMLClass(className) { (0,external_wp_element_namespaceObject.useEffect)(() => { const element = document && document.querySelector(`html:not(.${className})`); if (!element) { return; } element.classList.toggle(className); return () => { element.classList.toggle(className); }; }, [className]); } const headerVariants = { hidden: { opacity: 1, marginTop: -60 }, visible: { opacity: 1, marginTop: 0 }, distractionFreeHover: { opacity: 1, marginTop: 0, transition: { ...commonTransition, delay: 0.2, delayChildren: 0.2 } }, distractionFreeHidden: { opacity: 0, marginTop: -60 }, distractionFreeDisabled: { opacity: 0, marginTop: 0, transition: { ...commonTransition, delay: 0.8, delayChildren: 0.8 } } }; function InterfaceSkeleton({ isDistractionFree, footer, header, editorNotices, sidebar, secondarySidebar, content, actions, labels, className }, ref) { const [secondarySidebarResizeListener, secondarySidebarSize] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const defaultTransition = { type: 'tween', duration: disableMotion ? 0 : interface_skeleton_ANIMATION_DURATION, ease: [0.6, 0, 0.4, 1] }; useHTMLClass('interface-interface-skeleton__html-container'); const defaultLabels = { /* translators: accessibility text for the top bar landmark region. */ header: (0,external_wp_i18n_namespaceObject._x)('Header', 'header landmark area'), /* translators: accessibility text for the content landmark region. */ body: (0,external_wp_i18n_namespaceObject.__)('Content'), /* translators: accessibility text for the secondary sidebar landmark region. */ secondarySidebar: (0,external_wp_i18n_namespaceObject.__)('Block Library'), /* translators: accessibility text for the settings landmark region. */ sidebar: (0,external_wp_i18n_namespaceObject._x)('Settings', 'settings landmark area'), /* translators: accessibility text for the publish landmark region. */ actions: (0,external_wp_i18n_namespaceObject.__)('Publish'), /* translators: accessibility text for the footer landmark region. */ footer: (0,external_wp_i18n_namespaceObject.__)('Footer') }; const mergedLabels = { ...defaultLabels, ...labels }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ref: ref, className: dist_clsx(className, 'interface-interface-skeleton', !!footer && 'has-footer'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "interface-interface-skeleton__editor", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: !!header && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, { as: external_wp_components_namespaceObject.__unstableMotion.div, className: "interface-interface-skeleton__header", "aria-label": mergedLabels.header, initial: isDistractionFree && !isMobileViewport ? 'distractionFreeHidden' : 'hidden', whileHover: isDistractionFree && !isMobileViewport ? 'distractionFreeHover' : 'visible', animate: isDistractionFree && !isMobileViewport ? 'distractionFreeDisabled' : 'visible', exit: isDistractionFree && !isMobileViewport ? 'distractionFreeHidden' : 'hidden', variants: headerVariants, transition: defaultTransition, children: header }) }), isDistractionFree && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "interface-interface-skeleton__header", children: editorNotices }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "interface-interface-skeleton__body", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { initial: false, children: !!secondarySidebar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, { className: "interface-interface-skeleton__secondary-sidebar", ariaLabel: mergedLabels.secondarySidebar, as: external_wp_components_namespaceObject.__unstableMotion.div, initial: "closed", animate: "open", exit: "closed", variants: { open: { width: secondarySidebarSize.width }, closed: { width: 0 } }, transition: defaultTransition, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, { style: { position: 'absolute', width: isMobileViewport ? '100vw' : 'fit-content', height: '100%', left: 0 }, variants: { open: { x: 0 }, closed: { x: '-100%' } }, transition: defaultTransition, children: [secondarySidebarResizeListener, secondarySidebar] }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, { className: "interface-interface-skeleton__content", ariaLabel: mergedLabels.body, children: content }), !!sidebar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, { className: "interface-interface-skeleton__sidebar", ariaLabel: mergedLabels.sidebar, children: sidebar }), !!actions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, { className: "interface-interface-skeleton__actions", ariaLabel: mergedLabels.actions, children: actions })] })] }), !!footer && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigable_region, { className: "interface-interface-skeleton__footer", ariaLabel: mergedLabels.footer, children: footer })] }); } /* harmony default export */ const interface_skeleton = ((0,external_wp_element_namespaceObject.forwardRef)(InterfaceSkeleton)); ;// ./node_modules/@wordpress/interface/build-module/components/index.js ;// ./node_modules/@wordpress/interface/build-module/index.js ;// external ["wp","blockEditor"] const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; ;// ./node_modules/@wordpress/edit-widgets/build-module/store/transformers.js /** * WordPress dependencies */ /** * Converts a widget entity record into a block. * * @param {Object} widget The widget entity record. * @return {Object} a block (converted from the entity record). */ function transformWidgetToBlock(widget) { if (widget.id_base === 'block') { const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, { __unstableSkipAutop: true }); if (!parsedBlocks.length) { return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {}, []), widget.id); } return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)(parsedBlocks[0], widget.id); } let attributes; if (widget._embedded.about[0].is_multi) { attributes = { idBase: widget.id_base, instance: widget.instance }; } else { attributes = { id: widget.id }; } return (0,external_wp_widgets_namespaceObject.addWidgetIdToBlock)((0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes, []), widget.id); } /** * Converts a block to a widget entity record. * * @param {Object} block The block. * @param {?Object} relatedWidget A related widget entity record from the API (optional). * @return {Object} the widget object (converted from block). */ function transformBlockToWidget(block, relatedWidget = {}) { let widget; const isValidLegacyWidgetBlock = block.name === 'core/legacy-widget' && (block.attributes.id || block.attributes.instance); if (isValidLegacyWidgetBlock) { var _block$attributes$id, _block$attributes$idB, _block$attributes$ins; widget = { ...relatedWidget, id: (_block$attributes$id = block.attributes.id) !== null && _block$attributes$id !== void 0 ? _block$attributes$id : relatedWidget.id, id_base: (_block$attributes$idB = block.attributes.idBase) !== null && _block$attributes$idB !== void 0 ? _block$attributes$idB : relatedWidget.id_base, instance: (_block$attributes$ins = block.attributes.instance) !== null && _block$attributes$ins !== void 0 ? _block$attributes$ins : relatedWidget.instance }; } else { widget = { ...relatedWidget, id_base: 'block', instance: { raw: { content: (0,external_wp_blocks_namespaceObject.serialize)(block) } } }; } // Delete read-only properties. delete widget.rendered; delete widget.rendered_form; return widget; } ;// ./node_modules/@wordpress/edit-widgets/build-module/store/utils.js /** * "Kind" of the navigation post. * * @type {string} */ const KIND = 'root'; /** * "post type" of the navigation post. * * @type {string} */ const WIDGET_AREA_ENTITY_TYPE = 'sidebar'; /** * "post type" of the widget area post. * * @type {string} */ const POST_TYPE = 'postType'; /** * Builds an ID for a new widget area post. * * @param {number} widgetAreaId Widget area id. * @return {string} An ID. */ const buildWidgetAreaPostId = widgetAreaId => `widget-area-${widgetAreaId}`; /** * Builds an ID for a global widget areas post. * * @return {string} An ID. */ const buildWidgetAreasPostId = () => `widget-areas`; /** * Builds a query to resolve sidebars. * * @return {Object} Query. */ function buildWidgetAreasQuery() { return { per_page: -1 }; } /** * Builds a query to resolve widgets. * * @return {Object} Query. */ function buildWidgetsQuery() { return { per_page: -1, _embed: 'about' }; } /** * Creates a stub post with given id and set of blocks. Used as a governing entity records * for all widget areas. * * @param {string} id Post ID. * @param {Array} blocks The list of blocks. * @return {Object} A stub post object formatted in compliance with the data layer. */ const createStubPost = (id, blocks) => ({ id, slug: id, status: 'draft', type: 'page', blocks, meta: { widgetAreaId: id } }); ;// ./node_modules/@wordpress/edit-widgets/build-module/store/constants.js /** * Module Constants */ const constants_STORE_NAME = 'core/edit-widgets'; ;// ./node_modules/@wordpress/edit-widgets/build-module/store/actions.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Persists a stub post with given ID to core data store. The post is meant to be in-memory only and * shouldn't be saved via the API. * * @param {string} id Post ID. * @param {Array} blocks Blocks the post should consist of. * @return {Object} The post object. */ const persistStubPost = (id, blocks) => ({ registry }) => { const stubPost = createStubPost(id, blocks); registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, stubPost, { id: stubPost.id }, false); return stubPost; }; /** * Converts all the blocks from edited widget areas into widgets, * and submits a batch request to save everything at once. * * Creates a snackbar notice on either success or error. * * @return {Function} An action creator. */ const saveEditedWidgetAreas = () => async ({ select, dispatch, registry }) => { const editedWidgetAreas = select.getEditedWidgetAreas(); if (!editedWidgetAreas?.length) { return; } try { await dispatch.saveWidgetAreas(editedWidgetAreas); registry.dispatch(external_wp_notices_namespaceObject.store).createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Widgets saved.'), { type: 'snackbar' }); } catch (e) { registry.dispatch(external_wp_notices_namespaceObject.store).createErrorNotice(/* translators: %s: The error message. */ (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('There was an error. %s'), e.message), { type: 'snackbar' }); } }; /** * Converts all the blocks from specified widget areas into widgets, * and submits a batch request to save everything at once. * * @param {Object[]} widgetAreas Widget areas to save. * @return {Function} An action creator. */ const saveWidgetAreas = widgetAreas => async ({ dispatch, registry }) => { try { for (const widgetArea of widgetAreas) { await dispatch.saveWidgetArea(widgetArea.id); } } finally { // saveEditedEntityRecord resets the resolution status, let's fix it manually. await registry.dispatch(external_wp_coreData_namespaceObject.store).finishResolution('getEntityRecord', KIND, WIDGET_AREA_ENTITY_TYPE, buildWidgetAreasQuery()); } }; /** * Converts all the blocks from a widget area specified by ID into widgets, * and submits a batch request to save everything at once. * * @param {string} widgetAreaId ID of the widget area to process. * @return {Function} An action creator. */ const saveWidgetArea = widgetAreaId => async ({ dispatch, select, registry }) => { const widgets = select.getWidgets(); const post = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(widgetAreaId)); // Get all widgets from this area const areaWidgets = Object.values(widgets).filter(({ sidebar }) => sidebar === widgetAreaId); // Remove all duplicate reference widget instances for legacy widgets. // Why? We filter out the widgets with duplicate IDs to prevent adding more than one instance of a widget // implemented using a function. WordPress doesn't support having more than one instance of these, if you try to // save multiple instances of these in different sidebars you will run into undefined behaviors. const usedReferenceWidgets = []; const widgetsBlocks = post.blocks.filter(block => { const { id } = block.attributes; if (block.name === 'core/legacy-widget' && id) { if (usedReferenceWidgets.includes(id)) { return false; } usedReferenceWidgets.push(id); } return true; }); // Determine which widgets have been deleted. We can tell if a widget is // deleted and not just moved to a different area by looking to see if // getWidgetAreaForWidgetId() finds something. const deletedWidgets = []; for (const widget of areaWidgets) { const widgetsNewArea = select.getWidgetAreaForWidgetId(widget.id); if (!widgetsNewArea) { deletedWidgets.push(widget); } } const batchMeta = []; const batchTasks = []; const sidebarWidgetsIds = []; for (let i = 0; i < widgetsBlocks.length; i++) { const block = widgetsBlocks[i]; const widgetId = (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block); const oldWidget = widgets[widgetId]; const widget = transformBlockToWidget(block, oldWidget); // We'll replace the null widgetId after save, but we track it here // since order is important. sidebarWidgetsIds.push(widgetId); // Check oldWidget as widgetId might refer to an ID which has been // deleted, e.g. if a deleted block is restored via undo after saving. if (oldWidget) { // Update an existing widget. registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord('root', 'widget', widgetId, { ...widget, sidebar: widgetAreaId }, { undoIgnore: true }); const hasEdits = registry.select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord('root', 'widget', widgetId); if (!hasEdits) { continue; } batchTasks.push(({ saveEditedEntityRecord }) => saveEditedEntityRecord('root', 'widget', widgetId)); } else { // Create a new widget. batchTasks.push(({ saveEntityRecord }) => saveEntityRecord('root', 'widget', { ...widget, sidebar: widgetAreaId })); } batchMeta.push({ block, position: i, clientId: block.clientId }); } for (const widget of deletedWidgets) { batchTasks.push(({ deleteEntityRecord }) => deleteEntityRecord('root', 'widget', widget.id, { force: true })); } const records = await registry.dispatch(external_wp_coreData_namespaceObject.store).__experimentalBatch(batchTasks); const preservedRecords = records.filter(record => !record.hasOwnProperty('deleted')); const failedWidgetNames = []; for (let i = 0; i < preservedRecords.length; i++) { const widget = preservedRecords[i]; const { block, position } = batchMeta[i]; // Set __internalWidgetId on the block. This will be persisted to the // store when we dispatch receiveEntityRecords( post ) below. post.blocks[position].attributes.__internalWidgetId = widget.id; const error = registry.select(external_wp_coreData_namespaceObject.store).getLastEntitySaveError('root', 'widget', widget.id); if (error) { failedWidgetNames.push(block.attributes?.name || block?.name); } if (!sidebarWidgetsIds[position]) { sidebarWidgetsIds[position] = widget.id; } } if (failedWidgetNames.length) { throw new Error((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: List of widget names */ (0,external_wp_i18n_namespaceObject.__)('Could not save the following widgets: %s.'), failedWidgetNames.join(', '))); } registry.dispatch(external_wp_coreData_namespaceObject.store).editEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, { widgets: sidebarWidgetsIds }, { undoIgnore: true }); dispatch(trySaveWidgetArea(widgetAreaId)); registry.dispatch(external_wp_coreData_namespaceObject.store).receiveEntityRecords(KIND, POST_TYPE, post, undefined); }; const trySaveWidgetArea = widgetAreaId => ({ registry }) => { registry.dispatch(external_wp_coreData_namespaceObject.store).saveEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, widgetAreaId, { throwOnError: true }); }; /** * Sets the clientId stored for a particular widgetId. * * @param {number} clientId Client id. * @param {number} widgetId Widget id. * * @return {Object} Action. */ function setWidgetIdForClientId(clientId, widgetId) { return { type: 'SET_WIDGET_ID_FOR_CLIENT_ID', clientId, widgetId }; } /** * Sets the open state of all the widget areas. * * @param {Object} widgetAreasOpenState The open states of all the widget areas. * * @return {Object} Action. */ function setWidgetAreasOpenState(widgetAreasOpenState) { return { type: 'SET_WIDGET_AREAS_OPEN_STATE', widgetAreasOpenState }; } /** * Sets the open state of the widget area. * * @param {string} clientId The clientId of the widget area. * @param {boolean} isOpen Whether the widget area should be opened. * * @return {Object} Action. */ function setIsWidgetAreaOpen(clientId, isOpen) { return { type: 'SET_IS_WIDGET_AREA_OPEN', clientId, isOpen }; } /** * Returns an action object used to open/close the inserter. * * @param {boolean|Object} value Whether the inserter should be * opened (true) or closed (false). * To specify an insertion point, * use an object. * @param {string} value.rootClientId The root client ID to insert at. * @param {number} value.insertionIndex The index to insert at. * * @return {Object} Action object. */ function setIsInserterOpened(value) { return { type: 'SET_IS_INSERTER_OPENED', value }; } /** * Returns an action object used to open/close the list view. * * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed. * @return {Object} Action object. */ function setIsListViewOpened(isOpen) { return { type: 'SET_IS_LIST_VIEW_OPENED', isOpen }; } /** * Returns an action object signalling that the user closed the sidebar. * * @return {Object} Action creator. */ const closeGeneralSidebar = () => ({ registry }) => { registry.dispatch(store).disableComplementaryArea(constants_STORE_NAME); }; /** * Action that handles moving a block between widget areas * * @param {string} clientId The clientId of the block to move. * @param {string} widgetAreaId The id of the widget area to move the block to. */ const moveBlockToWidgetArea = (clientId, widgetAreaId) => async ({ dispatch, select, registry }) => { const sourceRootClientId = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockRootClientId(clientId); // Search the top level blocks (widget areas) for the one with the matching // id attribute. Makes the assumption that all top-level blocks are widget // areas. const widgetAreas = registry.select(external_wp_blockEditor_namespaceObject.store).getBlocks(); const destinationWidgetAreaBlock = widgetAreas.find(({ attributes }) => attributes.id === widgetAreaId); const destinationRootClientId = destinationWidgetAreaBlock.clientId; // Get the index for moving to the end of the destination widget area. const destinationInnerBlocksClientIds = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder(destinationRootClientId); const destinationIndex = destinationInnerBlocksClientIds.length; // Reveal the widget area, if it's not open. const isDestinationWidgetAreaOpen = select.getIsWidgetAreaOpen(destinationRootClientId); if (!isDestinationWidgetAreaOpen) { dispatch.setIsWidgetAreaOpen(destinationRootClientId, true); } // Move the block. registry.dispatch(external_wp_blockEditor_namespaceObject.store).moveBlocksToPosition([clientId], sourceRootClientId, destinationRootClientId, destinationIndex); }; ;// ./node_modules/@wordpress/edit-widgets/build-module/store/resolvers.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Creates a "stub" widgets post reflecting all available widget areas. The * post is meant as a convenient to only exists in runtime and should never be saved. It * enables a convenient way of editing the widgets by using a regular post editor. * * Fetches all widgets from all widgets aras, converts them into blocks, and hydrates a new post with them. * * @return {Function} An action creator. */ const getWidgetAreas = () => async ({ dispatch, registry }) => { const query = buildWidgetAreasQuery(); const widgetAreas = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query); const widgetAreaBlocks = []; const sortedWidgetAreas = widgetAreas.sort((a, b) => { if (a.id === 'wp_inactive_widgets') { return 1; } if (b.id === 'wp_inactive_widgets') { return -1; } return 0; }); for (const widgetArea of sortedWidgetAreas) { widgetAreaBlocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/widget-area', { id: widgetArea.id, name: widgetArea.name })); if (!widgetArea.widgets.length) { // If this widget area has no widgets, it won't get a post setup by // the getWidgets resolver. dispatch(persistStubPost(buildWidgetAreaPostId(widgetArea.id), [])); } } const widgetAreasOpenState = {}; widgetAreaBlocks.forEach((widgetAreaBlock, index) => { // Defaults to open the first widget area. widgetAreasOpenState[widgetAreaBlock.clientId] = index === 0; }); dispatch(setWidgetAreasOpenState(widgetAreasOpenState)); dispatch(persistStubPost(buildWidgetAreasPostId(), widgetAreaBlocks)); }; /** * Fetches all widgets from all widgets ares, and groups them by widget area Id. * * @return {Function} An action creator. */ const getWidgets = () => async ({ dispatch, registry }) => { const query = buildWidgetsQuery(); const widgets = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'widget', query); const groupedBySidebar = {}; for (const widget of widgets) { const block = transformWidgetToBlock(widget); groupedBySidebar[widget.sidebar] = groupedBySidebar[widget.sidebar] || []; groupedBySidebar[widget.sidebar].push(block); } for (const sidebarId in groupedBySidebar) { if (groupedBySidebar.hasOwnProperty(sidebarId)) { // Persist the actual post containing the widget block dispatch(persistStubPost(buildWidgetAreaPostId(sidebarId), groupedBySidebar[sidebarId])); } } }; ;// ./node_modules/@wordpress/edit-widgets/build-module/store/selectors.js /** * WordPress dependencies */ /** * Internal dependencies */ const EMPTY_INSERTION_POINT = { rootClientId: undefined, insertionIndex: undefined }; /** * Returns all API widgets. * * @return {Object[]} API List of widgets. */ const selectors_getWidgets = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(() => { var _widgets$reduce; const widgets = select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'widget', buildWidgetsQuery()); return (// Key widgets by their ID. (_widgets$reduce = widgets?.reduce((allWidgets, widget) => ({ ...allWidgets, [widget.id]: widget }), {})) !== null && _widgets$reduce !== void 0 ? _widgets$reduce : {} ); }, () => [select(external_wp_coreData_namespaceObject.store).getEntityRecords('root', 'widget', buildWidgetsQuery())])); /** * Returns API widget data for a particular widget ID. * * @param {number} id Widget ID. * * @return {Object} API widget data for a particular widget ID. */ const getWidget = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, id) => { const widgets = select(constants_STORE_NAME).getWidgets(); return widgets[id]; }); /** * Returns all API widget areas. * * @return {Object[]} API List of widget areas. */ const selectors_getWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { const query = buildWidgetAreasQuery(); return select(external_wp_coreData_namespaceObject.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query); }); /** * Returns widgetArea containing a block identify by given widgetId * * @param {string} widgetId The ID of the widget. * @return {Object} Containing widget area. */ const getWidgetAreaForWidgetId = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, widgetId) => { const widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); return widgetAreas.find(widgetArea => { const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(widgetArea.id)); const blockWidgetIds = post.blocks.map(block => (0,external_wp_widgets_namespaceObject.getWidgetIdFromBlock)(block)); return blockWidgetIds.includes(widgetId); }); }); /** * Given a child client id, returns the parent widget area block. * * @param {string} clientId The client id of a block in a widget area. * * @return {WPBlock} The widget area block. */ const getParentWidgetAreaBlock = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, clientId) => { const { getBlock, getBlockName, getBlockParents } = select(external_wp_blockEditor_namespaceObject.store); const blockParents = getBlockParents(clientId); const widgetAreaClientId = blockParents.find(parentClientId => getBlockName(parentClientId) === 'core/widget-area'); return getBlock(widgetAreaClientId); }); /** * Returns all edited widget area entity records. * * @return {Object[]} List of edited widget area entity records. */ const getEditedWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, ids) => { let widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); if (!widgetAreas) { return []; } if (ids) { widgetAreas = widgetAreas.filter(({ id }) => ids.includes(id)); } return widgetAreas.filter(({ id }) => select(external_wp_coreData_namespaceObject.store).hasEditsForEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(id))).map(({ id }) => select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id)); }); /** * Returns all blocks representing reference widgets. * * @param {string} referenceWidgetName Optional. If given, only reference widgets with this name will be returned. * @return {Array} List of all blocks representing reference widgets */ const getReferenceWidgetBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, referenceWidgetName = null) => { const results = []; const widgetAreas = select(constants_STORE_NAME).getWidgetAreas(); for (const _widgetArea of widgetAreas) { const post = select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord(KIND, POST_TYPE, buildWidgetAreaPostId(_widgetArea.id)); for (const block of post.blocks) { if (block.name === 'core/legacy-widget' && (!referenceWidgetName || block.attributes?.referenceWidgetName === referenceWidgetName)) { results.push(block); } } } return results; }); /** * Returns true if any widget area is currently being saved. * * @return {boolean} True if any widget area is currently being saved. False otherwise. */ const isSavingWidgetAreas = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { const widgetAreasIds = select(constants_STORE_NAME).getWidgetAreas()?.map(({ id }) => id); if (!widgetAreasIds) { return false; } for (const id of widgetAreasIds) { const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord(KIND, WIDGET_AREA_ENTITY_TYPE, id); if (isSaving) { return true; } } const widgetIds = [...Object.keys(select(constants_STORE_NAME).getWidgets()), undefined // account for new widgets without an ID ]; for (const id of widgetIds) { const isSaving = select(external_wp_coreData_namespaceObject.store).isSavingEntityRecord('root', 'widget', id); if (isSaving) { return true; } } return false; }); /** * Gets whether the widget area is opened. * * @param {Array} state The open state of the widget areas. * @param {string} clientId The clientId of the widget area. * * @return {boolean} True if the widget area is open. */ const getIsWidgetAreaOpen = (state, clientId) => { const { widgetAreasOpenState } = state; return !!widgetAreasOpenState[clientId]; }; /** * Returns true if the inserter is opened. * * @param {Object} state Global application state. * * @return {boolean} Whether the inserter is opened. */ function isInserterOpened(state) { return !!state.blockInserterPanel; } /** * Get the insertion point for the inserter. * * @param {Object} state Global application state. * * @return {Object} The root client ID and index to insert at. */ function __experimentalGetInsertionPoint(state) { if (typeof state.blockInserterPanel === 'boolean') { return EMPTY_INSERTION_POINT; } return state.blockInserterPanel; } /** * Returns true if a block can be inserted into a widget area. * * @param {Array} state The open state of the widget areas. * @param {string} blockName The name of the block being inserted. * * @return {boolean} True if the block can be inserted in a widget area. */ const canInsertBlockInWidgetArea = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, blockName) => { // Widget areas are always top-level blocks, which getBlocks will return. const widgetAreas = select(external_wp_blockEditor_namespaceObject.store).getBlocks(); // Makes an assumption that a block that can be inserted into one // widget area can be inserted into any widget area. Uses the first // widget area for testing whether the block can be inserted. const [firstWidgetArea] = widgetAreas; return select(external_wp_blockEditor_namespaceObject.store).canInsertBlockType(blockName, firstWidgetArea.clientId); }); /** * Returns true if the list view is opened. * * @param {Object} state Global application state. * * @return {boolean} Whether the list view is opened. */ function isListViewOpened(state) { return state.listViewPanel; } ;// ./node_modules/@wordpress/edit-widgets/build-module/store/private-selectors.js function getListViewToggleRef(state) { return state.listViewToggleRef; } function getInserterSidebarToggleRef(state) { return state.inserterSidebarToggleRef; } ;// external ["wp","privateApis"] const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; ;// ./node_modules/@wordpress/edit-widgets/build-module/lock-unlock.js /** * WordPress dependencies */ const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-widgets'); ;// ./node_modules/@wordpress/edit-widgets/build-module/store/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Block editor data store configuration. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#register * * @type {Object} */ const storeConfig = { reducer: reducer, selectors: store_selectors_namespaceObject, resolvers: resolvers_namespaceObject, actions: store_actions_namespaceObject }; /** * Store definition for the edit widgets namespace. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, storeConfig); (0,external_wp_data_namespaceObject.register)(store_store); // This package uses a few in-memory post types as wrappers for convenience. // This middleware prevents any network requests related to these types as they are // bound to fail anyway. external_wp_apiFetch_default().use(function (options, next) { if (options.path?.indexOf('/wp/v2/types/widget-area') === 0) { return Promise.resolve({}); } return next(options); }); unlock(store_store).registerPrivateSelectors(private_selectors_namespaceObject); ;// external ["wp","hooks"] const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; ;// ./node_modules/@wordpress/edit-widgets/build-module/filters/move-to-widget-area.js /** * WordPress dependencies */ /** * Internal dependencies */ const withMoveToWidgetAreaToolbarItem = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { const { clientId, name: blockName } = props; const { widgetAreas, currentWidgetAreaId, canInsertBlockInWidgetArea } = (0,external_wp_data_namespaceObject.useSelect)(select => { // Component won't display for a widget area, so don't run selectors. if (blockName === 'core/widget-area') { return {}; } const selectors = select(store_store); const widgetAreaBlock = selectors.getParentWidgetAreaBlock(clientId); return { widgetAreas: selectors.getWidgetAreas(), currentWidgetAreaId: widgetAreaBlock?.attributes?.id, canInsertBlockInWidgetArea: selectors.canInsertBlockInWidgetArea(blockName) }; }, [clientId, blockName]); const { moveBlockToWidgetArea } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const hasMultipleWidgetAreas = widgetAreas?.length > 1; const isMoveToWidgetAreaVisible = blockName !== 'core/widget-area' && hasMultipleWidgetAreas && canInsertBlockInWidgetArea; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props }, "edit"), isMoveToWidgetAreaVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_widgets_namespaceObject.MoveToWidgetArea, { widgetAreas: widgetAreas, currentWidgetAreaId: currentWidgetAreaId, onSelect: widgetAreaId => { moveBlockToWidgetArea(props.clientId, widgetAreaId); } }) })] }); }, 'withMoveToWidgetAreaToolbarItem'); (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/edit-widgets/block-edit', withMoveToWidgetAreaToolbarItem); ;// external ["wp","mediaUtils"] const external_wp_mediaUtils_namespaceObject = window["wp"]["mediaUtils"]; ;// ./node_modules/@wordpress/edit-widgets/build-module/filters/replace-media-upload.js /** * WordPress dependencies */ const replaceMediaUpload = () => external_wp_mediaUtils_namespaceObject.MediaUpload; (0,external_wp_hooks_namespaceObject.addFilter)('editor.MediaUpload', 'core/edit-widgets/replace-media-upload', replaceMediaUpload); ;// ./node_modules/@wordpress/edit-widgets/build-module/filters/index.js /** * Internal dependencies */ ;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/use-is-dragging-within.js /** * WordPress dependencies */ /** @typedef {import('@wordpress/element').RefObject} RefObject */ /** * A React hook to determine if it's dragging within the target element. * * @param {RefObject<HTMLElement>} elementRef The target elementRef object. * * @return {boolean} Is dragging within the target element. */ const useIsDraggingWithin = elementRef => { const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { const { ownerDocument } = elementRef.current; function handleDragStart(event) { // Check the first time when the dragging starts. handleDragEnter(event); } // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape. function handleDragEnd() { setIsDraggingWithin(false); } function handleDragEnter(event) { // Check if the current target is inside the item element. if (elementRef.current.contains(event.target)) { setIsDraggingWithin(true); } else { setIsDraggingWithin(false); } } // Bind these events to the document to catch all drag events. // Ideally, we can also use `event.relatedTarget`, but sadly that doesn't work in Safari. ownerDocument.addEventListener('dragstart', handleDragStart); ownerDocument.addEventListener('dragend', handleDragEnd); ownerDocument.addEventListener('dragenter', handleDragEnter); return () => { ownerDocument.removeEventListener('dragstart', handleDragStart); ownerDocument.removeEventListener('dragend', handleDragEnd); ownerDocument.removeEventListener('dragenter', handleDragEnter); }; }, []); return isDraggingWithin; }; /* harmony default export */ const use_is_dragging_within = (useIsDraggingWithin); ;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function WidgetAreaInnerBlocks({ id }) { const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('root', 'postType'); const innerBlocksRef = (0,external_wp_element_namespaceObject.useRef)(); const isDraggingWithinInnerBlocks = use_is_dragging_within(innerBlocksRef); const shouldHighlightDropZone = isDraggingWithinInnerBlocks; // Using the experimental hook so that we can control the className of the element. const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ ref: innerBlocksRef }, { value: blocks, onInput, onChange, templateLock: false, renderAppender: external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { "data-widget-area-id": id, className: dist_clsx('wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper', { 'wp-block-widget-area__highlight-drop-zone': shouldHighlightDropZone }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }) }); } ;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/edit/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('@wordpress/element').RefObject} RefObject */ function WidgetAreaEdit({ clientId, className, attributes: { id, name } }) { const isOpen = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getIsWidgetAreaOpen(clientId), [clientId]); const { setIsWidgetAreaOpen } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const wrapper = (0,external_wp_element_namespaceObject.useRef)(); const setOpen = (0,external_wp_element_namespaceObject.useCallback)(openState => setIsWidgetAreaOpen(clientId, openState), [clientId]); const isDragging = useIsDragging(wrapper); const isDraggingWithin = use_is_dragging_within(wrapper); const [openedWhileDragging, setOpenedWhileDragging] = (0,external_wp_element_namespaceObject.useState)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isDragging) { setOpenedWhileDragging(false); return; } if (isDraggingWithin && !isOpen) { setOpen(true); setOpenedWhileDragging(true); } else if (!isDraggingWithin && isOpen && openedWhileDragging) { setOpen(false); } }, [isOpen, isDragging, isDraggingWithin, openedWhileDragging]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Panel, { className: className, ref: wrapper, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: name, opened: isOpen, onToggle: () => { setIsWidgetAreaOpen(clientId, !isOpen); }, scrollAfterOpen: !isDragging, children: ({ opened }) => /*#__PURE__*/ // This is required to ensure LegacyWidget blocks are not // unmounted when the panel is collapsed. Unmounting legacy // widgets may have unintended consequences (e.g. TinyMCE // not being properly reinitialized) (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableDisclosureContent, { className: "wp-block-widget-area__panel-body-content", visible: opened, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, { kind: "root", type: "postType", id: `widget-area-${id}`, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidgetAreaInnerBlocks, { id: id }) }) }) }) }); } /** * A React hook to determine if dragging is active. * * @param {RefObject<HTMLElement>} elementRef The target elementRef object. * * @return {boolean} Is dragging within the entire document. */ const useIsDragging = elementRef => { const [isDragging, setIsDragging] = (0,external_wp_element_namespaceObject.useState)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { const { ownerDocument } = elementRef.current; function handleDragStart() { setIsDragging(true); } function handleDragEnd() { setIsDragging(false); } ownerDocument.addEventListener('dragstart', handleDragStart); ownerDocument.addEventListener('dragend', handleDragEnd); return () => { ownerDocument.removeEventListener('dragstart', handleDragStart); ownerDocument.removeEventListener('dragend', handleDragEnd); }; }, []); return isDragging; }; ;// ./node_modules/@wordpress/edit-widgets/build-module/blocks/widget-area/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const metadata = { $schema: "https://schemas.wp.org/trunk/block.json", name: "core/widget-area", title: "Widget Area", category: "widgets", attributes: { id: { type: "string" }, name: { type: "string" } }, supports: { html: false, inserter: false, customClassName: false, reusable: false, __experimentalToolbar: false, __experimentalParentSelector: false, __experimentalDisableBlockOverlay: true }, editorStyle: "wp-block-widget-area-editor", style: "wp-block-widget-area" }; const { name: widget_area_name } = metadata; const settings = { title: (0,external_wp_i18n_namespaceObject.__)('Widget Area'), description: (0,external_wp_i18n_namespaceObject.__)('A widget area container.'), __experimentalLabel: ({ name: label }) => label, edit: WidgetAreaEdit }; ;// ./node_modules/@wordpress/edit-widgets/build-module/components/error-boundary/index.js /** * WordPress dependencies */ function CopyButton({ text, children }) { const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", ref: ref, children: children }); } function ErrorBoundaryWarning({ message, error }) { const actions = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyButton, { text: error.stack, children: (0,external_wp_i18n_namespaceObject.__)('Copy Error') }, "copy-error")]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { className: "edit-widgets-error-boundary", actions: actions, children: message }); } class ErrorBoundary extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); this.state = { error: null }; } componentDidCatch(error) { (0,external_wp_hooks_namespaceObject.doAction)('editor.ErrorBoundary.errorLogged', error); } static getDerivedStateFromError(error) { return { error }; } render() { if (!this.state.error) { return this.props.children; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorBoundaryWarning, { message: (0,external_wp_i18n_namespaceObject.__)('The editor has encountered an unexpected error.'), error: this.state.error }); } } ;// external ["wp","patterns"] const external_wp_patterns_namespaceObject = window["wp"]["patterns"]; ;// external ["wp","keyboardShortcuts"] const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; ;// external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcuts/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function KeyboardShortcuts() { const { redo, undo } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { saveEditedWidgetAreas } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/undo', event => { undo(); event.preventDefault(); }); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/redo', event => { redo(); event.preventDefault(); }); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/save', event => { event.preventDefault(); saveEditedWidgetAreas(); }); return null; } function KeyboardShortcutsRegister() { // Registering the shortcuts. const { registerShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { registerShortcut({ name: 'core/edit-widgets/undo', category: 'global', description: (0,external_wp_i18n_namespaceObject.__)('Undo your last changes.'), keyCombination: { modifier: 'primary', character: 'z' } }); registerShortcut({ name: 'core/edit-widgets/redo', category: 'global', description: (0,external_wp_i18n_namespaceObject.__)('Redo your last undo.'), keyCombination: { modifier: 'primaryShift', character: 'z' }, // Disable on Apple OS because it conflicts with the browser's // history shortcut. It's a fine alias for both Windows and Linux. // Since there's no conflict for Ctrl+Shift+Z on both Windows and // Linux, we keep it as the default for consistency. aliases: (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? [] : [{ modifier: 'primary', character: 'y' }] }); registerShortcut({ name: 'core/edit-widgets/save', category: 'global', description: (0,external_wp_i18n_namespaceObject.__)('Save your changes.'), keyCombination: { modifier: 'primary', character: 's' } }); registerShortcut({ name: 'core/edit-widgets/keyboard-shortcuts', category: 'main', description: (0,external_wp_i18n_namespaceObject.__)('Display these keyboard shortcuts.'), keyCombination: { modifier: 'access', character: 'h' } }); registerShortcut({ name: 'core/edit-widgets/next-region', category: 'global', description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the next part of the editor.'), keyCombination: { modifier: 'ctrl', character: '`' }, aliases: [{ modifier: 'access', character: 'n' }] }); registerShortcut({ name: 'core/edit-widgets/previous-region', category: 'global', description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the previous part of the editor.'), keyCombination: { modifier: 'ctrlShift', character: '`' }, aliases: [{ modifier: 'access', character: 'p' }, { modifier: 'ctrlShift', character: '~' }] }); }, [registerShortcut]); return null; } KeyboardShortcuts.Register = KeyboardShortcutsRegister; /* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts); ;// ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-last-selected-widget-area.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * A react hook that returns the client id of the last widget area to have * been selected, or to have a selected block within it. * * @return {string} clientId of the widget area last selected. */ const useLastSelectedWidgetArea = () => (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockSelectionEnd, getBlockName } = select(external_wp_blockEditor_namespaceObject.store); const selectionEndClientId = getBlockSelectionEnd(); // If the selected block is a widget area, return its clientId. if (getBlockName(selectionEndClientId) === 'core/widget-area') { return selectionEndClientId; } const { getParentWidgetAreaBlock } = select(store_store); const widgetAreaBlock = getParentWidgetAreaBlock(selectionEndClientId); const widgetAreaBlockClientId = widgetAreaBlock?.clientId; if (widgetAreaBlockClientId) { return widgetAreaBlockClientId; } // If no widget area has been selected, return the clientId of the first // area. const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); const widgetAreasPost = getEntityRecord(KIND, POST_TYPE, buildWidgetAreasPostId()); return widgetAreasPost?.blocks[0]?.clientId; }, []); /* harmony default export */ const use_last_selected_widget_area = (useLastSelectedWidgetArea); ;// ./node_modules/@wordpress/edit-widgets/build-module/constants.js const ALLOW_REUSABLE_BLOCKS = false; const ENABLE_EXPERIMENTAL_FSE_BLOCKS = false; ;// ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-provider/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { ExperimentalBlockEditorProvider } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { PatternsMenuItems } = unlock(external_wp_patterns_namespaceObject.privateApis); const { BlockKeyboardShortcuts } = unlock(external_wp_blockLibrary_namespaceObject.privateApis); const EMPTY_ARRAY = []; function WidgetAreasBlockEditorProvider({ blockEditorSettings, children, ...props }) { const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const { hasUploadPermissions, reusableBlocks, isFixedToolbarActive, keepCaretInsideBlock, pageOnFront, pageForPosts } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _canUser; const { canUser, getEntityRecord, getEntityRecords } = select(external_wp_coreData_namespaceObject.store); const siteSettings = canUser('read', { kind: 'root', name: 'site' }) ? getEntityRecord('root', 'site') : undefined; return { hasUploadPermissions: (_canUser = canUser('create', { kind: 'root', name: 'media' })) !== null && _canUser !== void 0 ? _canUser : true, reusableBlocks: ALLOW_REUSABLE_BLOCKS ? getEntityRecords('postType', 'wp_block') : EMPTY_ARRAY, isFixedToolbarActive: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'fixedToolbar'), keepCaretInsideBlock: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'keepCaretInsideBlock'), pageOnFront: siteSettings?.page_on_front, pageForPosts: siteSettings?.page_for_posts }; }, []); const { setIsInserterOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const settings = (0,external_wp_element_namespaceObject.useMemo)(() => { let mediaUploadBlockEditor; if (hasUploadPermissions) { mediaUploadBlockEditor = ({ onError, ...argumentsObject }) => { (0,external_wp_mediaUtils_namespaceObject.uploadMedia)({ wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes, onError: ({ message }) => onError(message), ...argumentsObject }); }; } return { ...blockEditorSettings, __experimentalReusableBlocks: reusableBlocks, hasFixedToolbar: isFixedToolbarActive || !isLargeViewport, keepCaretInsideBlock, mediaUpload: mediaUploadBlockEditor, templateLock: 'all', __experimentalSetIsInserterOpened: setIsInserterOpened, pageOnFront, pageForPosts, editorTool: 'edit' }; }, [hasUploadPermissions, blockEditorSettings, isFixedToolbarActive, isLargeViewport, keepCaretInsideBlock, reusableBlocks, setIsInserterOpened, pageOnFront, pageForPosts]); const widgetAreaId = use_last_selected_widget_area(); const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)(KIND, POST_TYPE, { id: buildWidgetAreasPostId() }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SlotFillProvider, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts.Register, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ExperimentalBlockEditorProvider, { value: blocks, onInput: onInput, onChange: onChange, settings: settings, useSubRegistry: false, ...props, children: [children, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsMenuItems, { rootClientId: widgetAreaId })] })] }); } ;// ./node_modules/@wordpress/icons/build-module/library/drawer-left.js /** * WordPress dependencies */ const drawerLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z" }) }); /* harmony default export */ const drawer_left = (drawerLeft); ;// ./node_modules/@wordpress/icons/build-module/library/drawer-right.js /** * WordPress dependencies */ const drawerRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z" }) }); /* harmony default export */ const drawer_right = (drawerRight); ;// ./node_modules/@wordpress/icons/build-module/library/block-default.js /** * WordPress dependencies */ const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" }) }); /* harmony default export */ const block_default = (blockDefault); ;// external ["wp","url"] const external_wp_url_namespaceObject = window["wp"]["url"]; ;// external ["wp","dom"] const external_wp_dom_namespaceObject = window["wp"]["dom"]; ;// ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/widget-areas.js /** * WordPress dependencies */ /** * Internal dependencies */ function WidgetAreas({ selectedWidgetAreaId }) { const widgetAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getWidgetAreas(), []); const selectedWidgetArea = (0,external_wp_element_namespaceObject.useMemo)(() => selectedWidgetAreaId && widgetAreas?.find(widgetArea => widgetArea.id === selectedWidgetAreaId), [selectedWidgetAreaId, widgetAreas]); let description; if (!selectedWidgetArea) { description = (0,external_wp_i18n_namespaceObject.__)( // eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts 'Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer.'); } else if (selectedWidgetAreaId === 'wp_inactive_widgets') { description = (0,external_wp_i18n_namespaceObject.__)('Blocks in this Widget Area will not be displayed in your site.'); } else { description = selectedWidgetArea.description; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-widget-areas", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-widget-areas__top-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: block_default }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { // Use `dangerouslySetInnerHTML` to keep backwards // compatibility. Basic markup in the description is an // established feature of WordPress. // @see https://github.com/WordPress/gutenberg/issues/33106 dangerouslySetInnerHTML: { __html: (0,external_wp_dom_namespaceObject.safeHTML)(description) } }), widgetAreas?.length === 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('Your theme does not contain any Widget Areas.') }), !selectedWidgetArea && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, href: (0,external_wp_url_namespaceObject.addQueryArgs)('customize.php', { 'autofocus[panel]': 'widgets', return: window.location.pathname }), variant: "tertiary", children: (0,external_wp_i18n_namespaceObject.__)('Manage with live preview') })] })] }) }); } ;// ./node_modules/@wordpress/edit-widgets/build-module/components/sidebar/index.js /** * WordPress dependencies */ const SIDEBAR_ACTIVE_BY_DEFAULT = external_wp_element_namespaceObject.Platform.select({ web: true, native: false }); const BLOCK_INSPECTOR_IDENTIFIER = 'edit-widgets/block-inspector'; // Widget areas were once called block areas, so use 'edit-widgets/block-areas' // for backwards compatibility. const WIDGET_AREAS_IDENTIFIER = 'edit-widgets/block-areas'; /** * Internal dependencies */ const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis); function SidebarHeader({ selectedWidgetAreaBlock }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.TabList, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { tabId: WIDGET_AREAS_IDENTIFIER, children: selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0,external_wp_i18n_namespaceObject.__)('Widget Areas') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { tabId: BLOCK_INSPECTOR_IDENTIFIER, children: (0,external_wp_i18n_namespaceObject.__)('Block') })] }); } function SidebarContent({ hasSelectedNonAreaBlock, currentArea, isGeneralSidebarOpen, selectedWidgetAreaBlock }) { const { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); (0,external_wp_element_namespaceObject.useEffect)(() => { if (hasSelectedNonAreaBlock && currentArea === WIDGET_AREAS_IDENTIFIER && isGeneralSidebarOpen) { enableComplementaryArea('core/edit-widgets', BLOCK_INSPECTOR_IDENTIFIER); } if (!hasSelectedNonAreaBlock && currentArea === BLOCK_INSPECTOR_IDENTIFIER && isGeneralSidebarOpen) { enableComplementaryArea('core/edit-widgets', WIDGET_AREAS_IDENTIFIER); } // We're intentionally leaving `currentArea` and `isGeneralSidebarOpen` // out of the dep array because we want this effect to run based on // block selection changes, not sidebar state changes. }, [hasSelectedNonAreaBlock, enableComplementaryArea]); const tabsContextValue = (0,external_wp_element_namespaceObject.useContext)(Tabs.Context); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area, { className: "edit-widgets-sidebar", header: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Context.Provider, { value: tabsContextValue, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarHeader, { selectedWidgetAreaBlock: selectedWidgetAreaBlock }) }), headerClassName: "edit-widgets-sidebar__panel-tabs" /* translators: button label text should, if possible, be under 16 characters. */, title: (0,external_wp_i18n_namespaceObject.__)('Settings'), closeLabel: (0,external_wp_i18n_namespaceObject.__)('Close Settings'), scope: "core/edit-widgets", identifier: currentArea, icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? drawer_left : drawer_right, isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.Context.Provider, { value: tabsContextValue, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, { tabId: WIDGET_AREAS_IDENTIFIER, focusable: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidgetAreas, { selectedWidgetAreaId: selectedWidgetAreaBlock?.attributes.id }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, { tabId: BLOCK_INSPECTOR_IDENTIFIER, focusable: false, children: hasSelectedNonAreaBlock ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockInspector, {}) : /*#__PURE__*/ // Pretend that Widget Areas are part of the UI by not // showing the Block Inspector when one is selected. (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-inspector__no-blocks", children: (0,external_wp_i18n_namespaceObject.__)('No block selected.') }) })] }) }); } function Sidebar() { const { currentArea, hasSelectedNonAreaBlock, isGeneralSidebarOpen, selectedWidgetAreaBlock } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSelectedBlock, getBlock, getBlockParentsByBlockName } = select(external_wp_blockEditor_namespaceObject.store); const { getActiveComplementaryArea } = select(store); const selectedBlock = getSelectedBlock(); const activeArea = getActiveComplementaryArea(store_store.name); let currentSelection = activeArea; if (!currentSelection) { if (selectedBlock) { currentSelection = BLOCK_INSPECTOR_IDENTIFIER; } else { currentSelection = WIDGET_AREAS_IDENTIFIER; } } let widgetAreaBlock; if (selectedBlock) { if (selectedBlock.name === 'core/widget-area') { widgetAreaBlock = selectedBlock; } else { widgetAreaBlock = getBlock(getBlockParentsByBlockName(selectedBlock.clientId, 'core/widget-area')[0]); } } return { currentArea: currentSelection, hasSelectedNonAreaBlock: !!(selectedBlock && selectedBlock.name !== 'core/widget-area'), isGeneralSidebarOpen: !!activeArea, selectedWidgetAreaBlock: widgetAreaBlock }; }, []); const { enableComplementaryArea } = (0,external_wp_data_namespaceObject.useDispatch)(store); // `newSelectedTabId` could technically be falsy if no tab is selected (i.e. // the initial render) or when we don't want a tab displayed (i.e. the // sidebar is closed). These cases should both be covered by the `!!` check // below, so we shouldn't need any additional falsy handling. const onTabSelect = (0,external_wp_element_namespaceObject.useCallback)(newSelectedTabId => { if (!!newSelectedTabId) { enableComplementaryArea(store_store.name, newSelectedTabId); } }, [enableComplementaryArea]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs // Due to how this component is controlled (via a value from the // `interfaceStore`), when the sidebar closes the currently selected // tab can't be found. This causes the component to continuously reset // the selection to `null` in an infinite loop. Proactively setting // the selected tab to `null` avoids that. , { selectedTabId: isGeneralSidebarOpen ? currentArea : null, onSelect: onTabSelect, selectOnMove: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, { hasSelectedNonAreaBlock: hasSelectedNonAreaBlock, currentArea: currentArea, isGeneralSidebarOpen: isGeneralSidebarOpen, selectedWidgetAreaBlock: selectedWidgetAreaBlock }) }); } ;// ./node_modules/@wordpress/icons/build-module/library/plus.js /** * WordPress dependencies */ const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) }); /* harmony default export */ const library_plus = (plus); ;// ./node_modules/@wordpress/icons/build-module/library/list-view.js /** * WordPress dependencies */ const listView = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z" }) }); /* harmony default export */ const list_view = (listView); ;// ./node_modules/@wordpress/icons/build-module/library/undo.js /** * WordPress dependencies */ const undo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z" }) }); /* harmony default export */ const library_undo = (undo); ;// ./node_modules/@wordpress/icons/build-module/library/redo.js /** * WordPress dependencies */ const redo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z" }) }); /* harmony default export */ const library_redo = (redo); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/undo.js /** * WordPress dependencies */ function UndoButton(props, ref) { const hasUndo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasUndo(), []); const { undo } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { ...props, ref: ref, icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_undo : library_redo, label: (0,external_wp_i18n_namespaceObject.__)('Undo'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('z') // If there are no undo levels we don't want to actually disable this // button, because it will remove focus for keyboard users. // See: https://github.com/WordPress/gutenberg/issues/3486 , "aria-disabled": !hasUndo, onClick: hasUndo ? undo : undefined, size: "compact" }); } /* harmony default export */ const undo_redo_undo = ((0,external_wp_element_namespaceObject.forwardRef)(UndoButton)); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/header/undo-redo/redo.js /** * WordPress dependencies */ function RedoButton(props, ref) { const shortcut = (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('z') : external_wp_keycodes_namespaceObject.displayShortcut.primary('y'); const hasRedo = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).hasRedo(), []); const { redo } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { ...props, ref: ref, icon: !(0,external_wp_i18n_namespaceObject.isRTL)() ? library_redo : library_undo, label: (0,external_wp_i18n_namespaceObject.__)('Redo'), shortcut: shortcut // If there are no undo levels we don't want to actually disable this // button, because it will remove focus for keyboard users. // See: https://github.com/WordPress/gutenberg/issues/3486 , "aria-disabled": !hasRedo, onClick: hasRedo ? redo : undefined, size: "compact" }); } /* harmony default export */ const undo_redo_redo = ((0,external_wp_element_namespaceObject.forwardRef)(RedoButton)); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/header/document-tools/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function DocumentTools() { const isMediumViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const { isInserterOpen, isListViewOpen, inserterSidebarToggleRef, listViewToggleRef } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isInserterOpened, getInserterSidebarToggleRef, isListViewOpened, getListViewToggleRef } = unlock(select(store_store)); return { isInserterOpen: isInserterOpened(), isListViewOpen: isListViewOpened(), inserterSidebarToggleRef: getInserterSidebarToggleRef(), listViewToggleRef: getListViewToggleRef() }; }, []); const { setIsInserterOpened, setIsListViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const toggleListView = (0,external_wp_element_namespaceObject.useCallback)(() => setIsListViewOpened(!isListViewOpen), [setIsListViewOpened, isListViewOpen]); const toggleInserterSidebar = (0,external_wp_element_namespaceObject.useCallback)(() => setIsInserterOpened(!isInserterOpen), [setIsInserterOpened, isInserterOpen]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.NavigableToolbar, { className: "edit-widgets-header-toolbar", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Document tools'), variant: "unstyled", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { ref: inserterSidebarToggleRef, as: external_wp_components_namespaceObject.Button, className: "edit-widgets-header-toolbar__inserter-toggle", variant: "primary", isPressed: isInserterOpen, onMouseDown: event => { event.preventDefault(); }, onClick: toggleInserterSidebar, icon: library_plus /* translators: button label text should, if possible, be under 16 characters. */, label: (0,external_wp_i18n_namespaceObject._x)('Block Inserter', 'Generic label for block inserter button'), size: "compact" }), isMediumViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { as: undo_redo_undo }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { as: undo_redo_redo }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { as: external_wp_components_namespaceObject.Button, className: "edit-widgets-header-toolbar__list-view-toggle", icon: list_view, isPressed: isListViewOpen /* translators: button label text should, if possible, be under 16 characters. */, label: (0,external_wp_i18n_namespaceObject.__)('List View'), onClick: toggleListView, ref: listViewToggleRef, size: "compact" })] })] }); } /* harmony default export */ const document_tools = (DocumentTools); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/save-button/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function SaveButton() { const { hasEditedWidgetAreaIds, isSaving } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedWidgetAreas, isSavingWidgetAreas } = select(store_store); return { hasEditedWidgetAreaIds: getEditedWidgetAreas()?.length > 0, isSaving: isSavingWidgetAreas() }; }, []); const { saveEditedWidgetAreas } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const isDisabled = isSaving || !hasEditedWidgetAreaIds; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", isBusy: isSaving, "aria-disabled": isDisabled, onClick: isDisabled ? undefined : saveEditedWidgetAreas, size: "compact", children: isSaving ? (0,external_wp_i18n_namespaceObject.__)('Saving…') : (0,external_wp_i18n_namespaceObject.__)('Update') }); } /* harmony default export */ const save_button = (SaveButton); ;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js /** * WordPress dependencies */ const moreVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); /* harmony default export */ const more_vertical = (moreVertical); ;// ./node_modules/@wordpress/icons/build-module/library/external.js /** * WordPress dependencies */ const external = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) }); /* harmony default export */ const library_external = (external); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/config.js /** * WordPress dependencies */ const textFormattingShortcuts = [{ keyCombination: { modifier: 'primary', character: 'b' }, description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text bold.') }, { keyCombination: { modifier: 'primary', character: 'i' }, description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text italic.') }, { keyCombination: { modifier: 'primary', character: 'k' }, description: (0,external_wp_i18n_namespaceObject.__)('Convert the selected text into a link.') }, { keyCombination: { modifier: 'primaryShift', character: 'k' }, description: (0,external_wp_i18n_namespaceObject.__)('Remove a link.') }, { keyCombination: { character: '[[' }, description: (0,external_wp_i18n_namespaceObject.__)('Insert a link to a post or page.') }, { keyCombination: { modifier: 'primary', character: 'u' }, description: (0,external_wp_i18n_namespaceObject.__)('Underline the selected text.') }, { keyCombination: { modifier: 'access', character: 'd' }, description: (0,external_wp_i18n_namespaceObject.__)('Strikethrough the selected text.') }, { keyCombination: { modifier: 'access', character: 'x' }, description: (0,external_wp_i18n_namespaceObject.__)('Make the selected text inline code.') }, { keyCombination: { modifier: 'access', character: '0' }, aliases: [{ modifier: 'access', character: '7' }], description: (0,external_wp_i18n_namespaceObject.__)('Convert the current heading to a paragraph.') }, { keyCombination: { modifier: 'access', character: '1-6' }, description: (0,external_wp_i18n_namespaceObject.__)('Convert the current paragraph or heading to a heading of level 1 to 6.') }, { keyCombination: { modifier: 'primaryShift', character: 'SPACE' }, description: (0,external_wp_i18n_namespaceObject.__)('Add non breaking space.') }]; ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.js /** * WordPress dependencies */ function KeyCombination({ keyCombination, forceAriaLabel }) { const shortcut = keyCombination.modifier ? external_wp_keycodes_namespaceObject.displayShortcutList[keyCombination.modifier](keyCombination.character) : keyCombination.character; const ariaLabel = keyCombination.modifier ? external_wp_keycodes_namespaceObject.shortcutAriaLabel[keyCombination.modifier](keyCombination.character) : keyCombination.character; const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination", "aria-label": forceAriaLabel || ariaLabel, children: shortcuts.map((character, index) => { if (character === '+') { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { children: character }, index); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key", children: character }, index); }) }); } function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description", children: description }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-term", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, { keyCombination: keyCombination, forceAriaLabel: ariaLabel }), aliases.map((alias, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyCombination, { keyCombination: alias, forceAriaLabel: ariaLabel }, index))] })] }); } /* harmony default export */ const keyboard_shortcut_help_modal_shortcut = (Shortcut); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js /** * WordPress dependencies */ /** * Internal dependencies */ function DynamicShortcut({ name }) { const { keyCombination, description, aliases } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getShortcutKeyCombination, getShortcutDescription, getShortcutAliases } = select(external_wp_keyboardShortcuts_namespaceObject.store); return { keyCombination: getShortcutKeyCombination(name), aliases: getShortcutAliases(name), description: getShortcutDescription(name) }; }, [name]); if (!keyCombination) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_shortcut, { keyCombination: keyCombination, description: description, aliases: aliases }); } /* harmony default export */ const dynamic_shortcut = (DynamicShortcut); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/keyboard-shortcut-help-modal/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const ShortcutList = ({ shortcuts }) => /*#__PURE__*/ /* * Disable reason: The `list` ARIA role is redundant but * Safari+VoiceOver won't announce the list otherwise. */ /* eslint-disable jsx-a11y/no-redundant-roles */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list", role: "list", children: shortcuts.map((shortcut, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut", children: typeof shortcut === 'string' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dynamic_shortcut, { name: shortcut }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcut_help_modal_shortcut, { ...shortcut }) }, index)) }) /* eslint-enable jsx-a11y/no-redundant-roles */; const ShortcutSection = ({ title, shortcuts, className }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("section", { className: dist_clsx('edit-widgets-keyboard-shortcut-help-modal__section', className), children: [!!title && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "edit-widgets-keyboard-shortcut-help-modal__section-title", children: title }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutList, { shortcuts: shortcuts })] }); const ShortcutCategorySection = ({ title, categoryName, additionalShortcuts = [] }) => { const categoryShortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_keyboardShortcuts_namespaceObject.store).getCategoryShortcuts(categoryName); }, [categoryName]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { title: title, shortcuts: categoryShortcuts.concat(additionalShortcuts) }); }; function KeyboardShortcutHelpModal({ isModalActive, toggleModal }) { (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/keyboard-shortcuts', toggleModal, { bindGlobal: true }); if (!isModalActive) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { className: "edit-widgets-keyboard-shortcut-help-modal", title: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts'), onRequestClose: toggleModal, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { className: "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts", shortcuts: ['core/edit-widgets/keyboard-shortcuts'] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { title: (0,external_wp_i18n_namespaceObject.__)('Global shortcuts'), categoryName: "global" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { title: (0,external_wp_i18n_namespaceObject.__)('Selection shortcuts'), categoryName: "selection" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { title: (0,external_wp_i18n_namespaceObject.__)('Block shortcuts'), categoryName: "block", additionalShortcuts: [{ keyCombination: { character: '/' }, description: (0,external_wp_i18n_namespaceObject.__)('Change the block type after adding a new paragraph.'), /* translators: The forward-slash character. e.g. '/'. */ ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Forward-slash') }] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutSection, { title: (0,external_wp_i18n_namespaceObject.__)('Text formatting'), shortcuts: textFormattingShortcuts }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShortcutCategorySection, { title: (0,external_wp_i18n_namespaceObject.__)('List View shortcuts'), categoryName: "list-view" })] }); } ;// ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/tools-more-menu-group.js /** * WordPress dependencies */ const { Fill: ToolsMoreMenuGroup, Slot } = (0,external_wp_components_namespaceObject.createSlotFill)('EditWidgetsToolsMoreMenuGroup'); ToolsMoreMenuGroup.Slot = ({ fillProps }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Slot, { fillProps: fillProps, children: fills => fills.length > 0 && fills }); /* harmony default export */ const tools_more_menu_group = (ToolsMoreMenuGroup); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/more-menu/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function MoreMenu() { const [isKeyboardShortcutsModalActive, setIsKeyboardShortcutsModalVisible] = (0,external_wp_element_namespaceObject.useState)(false); const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-widgets/keyboard-shortcuts', toggleKeyboardShortcutsModal); const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Options'), popoverProps: { placement: 'bottom-end', className: 'more-menu-dropdown__content' }, toggleProps: { tooltipPosition: 'bottom', size: 'compact' }, children: onClose => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject._x)('View', 'noun'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core/edit-widgets", name: "fixedToolbar", label: (0,external_wp_i18n_namespaceObject.__)('Top toolbar'), info: (0,external_wp_i18n_namespaceObject.__)('Access all block and document tools in a single place'), messageActivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar activated'), messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Top toolbar deactivated') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Tools'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { setIsKeyboardShortcutsModalVisible(true); }, shortcut: external_wp_keycodes_namespaceObject.displayShortcut.access('h'), children: (0,external_wp_i18n_namespaceObject.__)('Keyboard shortcuts') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core/edit-widgets", name: "welcomeGuide", label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuItem, { role: "menuitem", icon: library_external, href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/block-based-widgets-editor/'), target: "_blank", rel: "noopener noreferrer", children: [(0,external_wp_i18n_namespaceObject.__)('Help'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "span", children: /* translators: accessibility text */ (0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tools_more_menu_group.Slot, { fillProps: { onClose } })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Preferences'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core/edit-widgets", name: "keepCaretInsideBlock", label: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block'), info: (0,external_wp_i18n_namespaceObject.__)('Aids screen readers by stopping text caret from leaving blocks.'), messageActivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block activated'), messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Contain text cursor inside block deactivated') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core/edit-widgets", name: "themeStyles", info: (0,external_wp_i18n_namespaceObject.__)('Make the editor look like your theme.'), label: (0,external_wp_i18n_namespaceObject.__)('Use theme styles') }), isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core/edit-widgets", name: "showBlockBreadcrumbs", label: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs'), info: (0,external_wp_i18n_namespaceObject.__)('Shows block breadcrumbs at the bottom of the editor.'), messageActivated: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs activated'), messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Display block breadcrumbs deactivated') })] })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(KeyboardShortcutHelpModal, { isModalActive: isKeyboardShortcutsModalActive, toggleModal: toggleKeyboardShortcutsModal })] }); } ;// ./node_modules/@wordpress/edit-widgets/build-module/components/header/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function Header() { const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const blockToolbarRef = (0,external_wp_element_namespaceObject.useRef)(); const { hasFixedToolbar } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ hasFixedToolbar: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'fixedToolbar') }), []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-header", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-header__navigable-toolbar-wrapper", children: [isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-header__title", children: (0,external_wp_i18n_namespaceObject.__)('Widgets') }), !isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "h1", className: "edit-widgets-header__title", children: (0,external_wp_i18n_namespaceObject.__)('Widgets') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(document_tools, {}), hasFixedToolbar && isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "selected-block-tools-wrapper", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, { hideDragHandle: true }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover.Slot, { ref: blockToolbarRef, name: "block-toolbar" })] })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-header__actions", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pinned_items.Slot, { scope: "core/edit-widgets" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(save_button, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MoreMenu, {})] })] }) }); } /* harmony default export */ const header = (Header); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/notices/index.js /** * WordPress dependencies */ // Last three notices. Slices from the tail end of the list. const MAX_VISIBLE_NOTICES = -3; function Notices() { const { removeNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { notices } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { notices: select(external_wp_notices_namespaceObject.store).getNotices() }; }, []); const dismissibleNotices = notices.filter(({ isDismissible, type }) => isDismissible && type === 'default'); const nonDismissibleNotices = notices.filter(({ isDismissible, type }) => !isDismissible && type === 'default'); const snackbarNotices = notices.filter(({ type }) => type === 'snackbar').slice(MAX_VISIBLE_NOTICES); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.NoticeList, { notices: nonDismissibleNotices, className: "edit-widgets-notices__pinned" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.NoticeList, { notices: dismissibleNotices, className: "edit-widgets-notices__dismissible", onRemove: removeNotice }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SnackbarList, { notices: snackbarNotices, className: "edit-widgets-notices__snackbar", onRemove: removeNotice })] }); } /* harmony default export */ const notices = (Notices); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/widget-areas-block-editor-content/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function WidgetAreasBlockEditorContent({ blockEditorSettings }) { const hasThemeStyles = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'themeStyles'), []); const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const styles = (0,external_wp_element_namespaceObject.useMemo)(() => { return hasThemeStyles ? blockEditorSettings.styles : []; }, [blockEditorSettings, hasThemeStyles]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-block-editor", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(notices, {}), !isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockToolbar, { hideDragHandle: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockTools, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__unstableEditorStyles, { styles: styles, scope: ":where(.editor-styles-wrapper)" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSelectionClearer, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.WritingFlow, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockList, { className: "edit-widgets-main-block-list" }) }) })] })] }); } ;// ./node_modules/@wordpress/edit-widgets/build-module/hooks/use-widget-library-insertion-point.js /** * WordPress dependencies */ /** * Internal dependencies */ const useWidgetLibraryInsertionPoint = () => { const firstRootId = (0,external_wp_data_namespaceObject.useSelect)(select => { // Default to the first widget area const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); const widgetAreasPost = getEntityRecord(KIND, POST_TYPE, buildWidgetAreasPostId()); return widgetAreasPost?.blocks[0]?.clientId; }, []); return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId, getBlockSelectionEnd, getBlockOrder, getBlockIndex } = select(external_wp_blockEditor_namespaceObject.store); const insertionPoint = select(store_store).__experimentalGetInsertionPoint(); // "Browse all" in the quick inserter will set the rootClientId to the current block. // Otherwise, it will just be undefined, and we'll have to handle it differently below. if (insertionPoint.rootClientId) { return insertionPoint; } const clientId = getBlockSelectionEnd() || firstRootId; const rootClientId = getBlockRootClientId(clientId); // If the selected block is at the root level, it's a widget area and // blocks can't be inserted here. Return this block as the root and the // last child clientId indicating insertion at the end. if (clientId && rootClientId === '') { return { rootClientId: clientId, insertionIndex: getBlockOrder(clientId).length }; } return { rootClientId, insertionIndex: getBlockIndex(clientId) + 1 }; }, [firstRootId]); }; /* harmony default export */ const use_widget_library_insertion_point = (useWidgetLibraryInsertionPoint); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.js /** * WordPress dependencies */ /** * Internal dependencies */ function InserterSidebar() { const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const { rootClientId, insertionIndex } = use_widget_library_insertion_point(); const { setIsInserterOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const closeInserter = (0,external_wp_element_namespaceObject.useCallback)(() => { return setIsInserterOpened(false); }, [setIsInserterOpened]); const [inserterDialogRef, inserterDialogProps] = (0,external_wp_compose_namespaceObject.__experimentalUseDialog)({ onClose: closeInserter, focusOnMount: true }); const libraryRef = (0,external_wp_element_namespaceObject.useRef)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: inserterDialogRef, ...inserterDialogProps, className: "edit-widgets-layout__inserter-panel", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-layout__inserter-panel-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalLibrary, { showInserterHelpPanel: true, shouldFocusBlock: isMobileViewport, rootClientId: rootClientId, __experimentalInsertionIndex: insertionIndex, ref: libraryRef, onClose: closeInserter }) }) }); } ;// ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/list-view-sidebar.js /** * WordPress dependencies */ /** * Internal dependencies */ function ListViewSidebar() { const { setIsListViewOpened } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { getListViewToggleRef } = unlock((0,external_wp_data_namespaceObject.useSelect)(store_store)); // Use internal state instead of a ref to make sure that the component // re-renders when the dropZoneElement updates. const [dropZoneElement, setDropZoneElement] = (0,external_wp_element_namespaceObject.useState)(null); const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement'); // When closing the list view, focus should return to the toggle button. const closeListView = (0,external_wp_element_namespaceObject.useCallback)(() => { setIsListViewOpened(false); getListViewToggleRef().current?.focus(); }, [getListViewToggleRef, setIsListViewOpened]); const closeOnEscape = (0,external_wp_element_namespaceObject.useCallback)(event => { if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && !event.defaultPrevented) { event.preventDefault(); closeListView(); } }, [closeListView]); return ( /*#__PURE__*/ // eslint-disable-next-line jsx-a11y/no-static-element-interactions (0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-editor__list-view-panel", onKeyDown: closeOnEscape, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "edit-widgets-editor__list-view-panel-header", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", { children: (0,external_wp_i18n_namespaceObject.__)('List View') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { icon: close_small, label: (0,external_wp_i18n_namespaceObject.__)('Close'), onClick: closeListView, size: "compact" })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-editor__list-view-panel-content", ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([focusOnMountRef, setDropZoneElement]), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalListView, { dropZoneElement: dropZoneElement }) })] }) ); } ;// ./node_modules/@wordpress/edit-widgets/build-module/components/secondary-sidebar/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Internal dependencies */ function SecondarySidebar() { const { isInserterOpen, isListViewOpen } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isInserterOpened, isListViewOpened } = select(store_store); return { isInserterOpen: isInserterOpened(), isListViewOpen: isListViewOpened() }; }, []); if (isInserterOpen) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InserterSidebar, {}); } if (isListViewOpen) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewSidebar, {}); } return null; } ;// ./node_modules/@wordpress/edit-widgets/build-module/components/layout/interface.js /** * WordPress dependencies */ /** * Internal dependencies */ const interfaceLabels = { /* translators: accessibility text for the widgets screen top bar landmark region. */ header: (0,external_wp_i18n_namespaceObject.__)('Widgets top bar'), /* translators: accessibility text for the widgets screen content landmark region. */ body: (0,external_wp_i18n_namespaceObject.__)('Widgets and blocks'), /* translators: accessibility text for the widgets screen settings landmark region. */ sidebar: (0,external_wp_i18n_namespaceObject.__)('Widgets settings'), /* translators: accessibility text for the widgets screen footer landmark region. */ footer: (0,external_wp_i18n_namespaceObject.__)('Widgets footer') }; function Interface({ blockEditorSettings }) { const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const isHugeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('huge', '>='); const { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } = (0,external_wp_data_namespaceObject.useDispatch)(store_store); const { hasBlockBreadCrumbsEnabled, hasSidebarEnabled, isInserterOpened, isListViewOpened } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ hasSidebarEnabled: !!select(store).getActiveComplementaryArea(store_store.name), isInserterOpened: !!select(store_store).isInserterOpened(), isListViewOpened: !!select(store_store).isListViewOpened(), hasBlockBreadCrumbsEnabled: !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'showBlockBreadcrumbs') }), []); // Inserter and Sidebars are mutually exclusive (0,external_wp_element_namespaceObject.useEffect)(() => { if (hasSidebarEnabled && !isHugeViewport) { setIsInserterOpened(false); setIsListViewOpened(false); } }, [hasSidebarEnabled, isHugeViewport]); (0,external_wp_element_namespaceObject.useEffect)(() => { if ((isInserterOpened || isListViewOpened) && !isHugeViewport) { closeGeneralSidebar(); } }, [isInserterOpened, isListViewOpened, isHugeViewport]); const secondarySidebarLabel = isListViewOpened ? (0,external_wp_i18n_namespaceObject.__)('List View') : (0,external_wp_i18n_namespaceObject.__)('Block Library'); const hasSecondarySidebar = isListViewOpened || isInserterOpened; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(interface_skeleton, { labels: { ...interfaceLabels, secondarySidebar: secondarySidebarLabel }, header: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(header, {}), secondarySidebar: hasSecondarySidebar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SecondarySidebar, {}), sidebar: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(complementary_area.Slot, { scope: "core/edit-widgets" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidgetAreasBlockEditorContent, { blockEditorSettings: blockEditorSettings }) }), footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-widgets-layout__footer", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockBreadcrumb, { rootLabelText: (0,external_wp_i18n_namespaceObject.__)('Widgets') }) }) }); } /* harmony default export */ const layout_interface = (Interface); ;// ./node_modules/@wordpress/edit-widgets/build-module/components/layout/unsaved-changes-warning.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Warns the user if there are unsaved changes before leaving the editor. * * This is a duplicate of the component implemented in the editor package. * Duplicated here as edit-widgets doesn't depend on editor. * * @return {Component} The component. */ function UnsavedChangesWarning() { const isDirty = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedWidgetAreas } = select(store_store); const editedWidgetAreas = getEditedWidgetAreas(); return editedWidgetAreas?.length > 0; }, []); (0,external_wp_element_namespaceObject.useEffect)(() => { /** * Warns the user if there are unsaved changes before leaving the editor. * * @param {Event} event `beforeunload` event. * * @return {string | undefined} Warning prompt message, if unsaved changes exist. */ const warnIfUnsavedChanges = event => { if (isDirty) { event.returnValue = (0,external_wp_i18n_namespaceObject.__)('You have unsaved changes. If you proceed, they will be lost.'); return event.returnValue; } }; window.addEventListener('beforeunload', warnIfUnsavedChanges); return () => { window.removeEventListener('beforeunload', warnIfUnsavedChanges); }; }, [isDirty]); return null; } ;// ./node_modules/@wordpress/edit-widgets/build-module/components/welcome-guide/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function WelcomeGuide() { var _widgetAreas$filter$l; const isActive = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_preferences_namespaceObject.store).get('core/edit-widgets', 'welcomeGuide'), []); const { toggle } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); const widgetAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(store_store).getWidgetAreas({ per_page: -1 }), []); if (!isActive) { return null; } const isEntirelyBlockWidgets = widgetAreas?.every(widgetArea => widgetArea.id === 'wp_inactive_widgets' || widgetArea.widgets.every(widgetId => widgetId.startsWith('block-'))); const numWidgetAreas = (_widgetAreas$filter$l = widgetAreas?.filter(widgetArea => widgetArea.id !== 'wp_inactive_widgets').length) !== null && _widgetAreas$filter$l !== void 0 ? _widgetAreas$filter$l : 0; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, { className: "edit-widgets-welcome-guide", contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets'), finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'), onFinish: () => toggle('core/edit-widgets', 'welcomeGuide'), pages: [{ image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Welcome to block Widgets') }), isEntirelyBlockWidgets ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s: Number of block areas in the current theme. (0,external_wp_i18n_namespaceObject._n)('Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', 'Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.', numWidgetAreas), numWidgetAreas) }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)('You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { className: "edit-widgets-welcome-guide__text", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("strong", { children: (0,external_wp_i18n_namespaceObject.__)('Want to stick with the old widgets?') }), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/plugins/classic-widgets/'), children: (0,external_wp_i18n_namespaceObject.__)('Get the Classic Widgets plugin.') })] })] })] }) }, { image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Customize each block') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.') })] }) }, { image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Explore all blocks') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), { InserterIconImage: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: "edit-widgets-welcome-guide__inserter-icon", alt: (0,external_wp_i18n_namespaceObject.__)('inserter'), src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A" }) }) })] }) }, { image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Learn more') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)("New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"), { a: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/') }) }) })] }) }] }); } function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("picture", { className: "edit-widgets-welcome-guide__image", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("source", { srcSet: nonAnimatedSrc, media: "(prefers-reduced-motion: reduce)" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" })] }); } ;// ./node_modules/@wordpress/edit-widgets/build-module/components/layout/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function Layout({ blockEditorSettings }) { const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); function onPluginAreaError(name) { createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: plugin name */ (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name)); } const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ErrorBoundary, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: navigateRegionsProps.className, ...navigateRegionsProps, ref: navigateRegionsProps.ref, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(WidgetAreasBlockEditorProvider, { blockEditorSettings: blockEditorSettings, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout_interface, { blockEditorSettings: blockEditorSettings }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Sidebar, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { onError: onPluginAreaError }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, {})] }) }) }); } /* harmony default export */ const layout = (Layout); ;// ./node_modules/@wordpress/edit-widgets/build-module/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const disabledBlocks = ['core/more', 'core/freeform', 'core/template-part', ...(ALLOW_REUSABLE_BLOCKS ? [] : ['core/block'])]; /** * Initializes the block editor in the widgets screen. * * @param {string} id ID of the root element to render the screen in. * @param {Object} settings Block editor settings. */ function initializeEditor(id, settings) { const target = document.getElementById(id); const root = (0,external_wp_element_namespaceObject.createRoot)(target); const coreBlocks = (0,external_wp_blockLibrary_namespaceObject.__experimentalGetCoreBlocks)().filter(block => { return !(disabledBlocks.includes(block.name) || block.name.startsWith('core/post') || block.name.startsWith('core/query') || block.name.startsWith('core/site') || block.name.startsWith('core/navigation')); }); (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/edit-widgets', { fixedToolbar: false, welcomeGuide: true, showBlockBreadcrumbs: true, themeStyles: true }); (0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters(); (0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)(coreBlocks); (0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)(); if (false) {} (0,external_wp_widgets_namespaceObject.registerLegacyWidgetVariations)(settings); registerBlock(widget_area_namespaceObject); (0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)(); settings.__experimentalFetchLinkSuggestions = (search, searchOptions) => (0,external_wp_coreData_namespaceObject.__experimentalFetchLinkSuggestions)(search, searchOptions, settings); // As we are unregistering `core/freeform` to avoid the Classic block, we must // replace it with something as the default freeform content handler. Failure to // do this will result in errors in the default block parser. // see: https://github.com/WordPress/gutenberg/issues/33097 (0,external_wp_blocks_namespaceObject.setFreeformContentHandlerName)('core/html'); root.render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout, { blockEditorSettings: settings }) })); return root; } /** * Compatibility export under the old `initialize` name. */ const initialize = initializeEditor; function reinitializeEditor() { external_wp_deprecated_default()('wp.editWidgets.reinitializeEditor', { since: '6.2', version: '6.3' }); } /** * Function to register an individual block. * * @param {Object} block The block to be registered. */ const registerBlock = block => { if (!block) { return; } const { metadata, settings, name } = block; if (metadata) { (0,external_wp_blocks_namespaceObject.unstable__bootstrapServerSideBlockDefinitions)({ [name]: metadata }); } (0,external_wp_blocks_namespaceObject.registerBlockType)(name, settings); }; (window.wp = window.wp || {}).editWidgets = __webpack_exports__; /******/ })() ; edit-post.js 0000644 00000360671 15013651111 0007021 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { PluginBlockSettingsMenuItem: () => (/* reexport */ PluginBlockSettingsMenuItem), PluginDocumentSettingPanel: () => (/* reexport */ PluginDocumentSettingPanel), PluginMoreMenuItem: () => (/* reexport */ PluginMoreMenuItem), PluginPostPublishPanel: () => (/* reexport */ PluginPostPublishPanel), PluginPostStatusInfo: () => (/* reexport */ PluginPostStatusInfo), PluginPrePublishPanel: () => (/* reexport */ PluginPrePublishPanel), PluginSidebar: () => (/* reexport */ PluginSidebar), PluginSidebarMoreMenuItem: () => (/* reexport */ PluginSidebarMoreMenuItem), __experimentalFullscreenModeClose: () => (/* reexport */ fullscreen_mode_close), __experimentalMainDashboardButton: () => (/* binding */ __experimentalMainDashboardButton), __experimentalPluginPostExcerpt: () => (/* reexport */ __experimentalPluginPostExcerpt), initializeEditor: () => (/* binding */ initializeEditor), reinitializeEditor: () => (/* binding */ reinitializeEditor), store: () => (/* reexport */ store) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); __webpack_require__.d(actions_namespaceObject, { __experimentalSetPreviewDeviceType: () => (__experimentalSetPreviewDeviceType), __unstableCreateTemplate: () => (__unstableCreateTemplate), closeGeneralSidebar: () => (closeGeneralSidebar), closeModal: () => (closeModal), closePublishSidebar: () => (closePublishSidebar), hideBlockTypes: () => (hideBlockTypes), initializeMetaBoxes: () => (initializeMetaBoxes), metaBoxUpdatesFailure: () => (metaBoxUpdatesFailure), metaBoxUpdatesSuccess: () => (metaBoxUpdatesSuccess), openGeneralSidebar: () => (openGeneralSidebar), openModal: () => (openModal), openPublishSidebar: () => (openPublishSidebar), removeEditorPanel: () => (removeEditorPanel), requestMetaBoxUpdates: () => (requestMetaBoxUpdates), setAvailableMetaBoxesPerLocation: () => (setAvailableMetaBoxesPerLocation), setIsEditingTemplate: () => (setIsEditingTemplate), setIsInserterOpened: () => (setIsInserterOpened), setIsListViewOpened: () => (setIsListViewOpened), showBlockTypes: () => (showBlockTypes), switchEditorMode: () => (switchEditorMode), toggleDistractionFree: () => (toggleDistractionFree), toggleEditorPanelEnabled: () => (toggleEditorPanelEnabled), toggleEditorPanelOpened: () => (toggleEditorPanelOpened), toggleFeature: () => (toggleFeature), toggleFullscreenMode: () => (toggleFullscreenMode), togglePinnedPluginItem: () => (togglePinnedPluginItem), togglePublishSidebar: () => (togglePublishSidebar), updatePreferredStyleVariations: () => (updatePreferredStyleVariations) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/edit-post/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); __webpack_require__.d(selectors_namespaceObject, { __experimentalGetInsertionPoint: () => (__experimentalGetInsertionPoint), __experimentalGetPreviewDeviceType: () => (__experimentalGetPreviewDeviceType), areMetaBoxesInitialized: () => (areMetaBoxesInitialized), getActiveGeneralSidebarName: () => (getActiveGeneralSidebarName), getActiveMetaBoxLocations: () => (getActiveMetaBoxLocations), getAllMetaBoxes: () => (getAllMetaBoxes), getEditedPostTemplate: () => (getEditedPostTemplate), getEditorMode: () => (getEditorMode), getHiddenBlockTypes: () => (getHiddenBlockTypes), getMetaBoxesPerLocation: () => (getMetaBoxesPerLocation), getPreference: () => (getPreference), getPreferences: () => (getPreferences), hasMetaBoxes: () => (hasMetaBoxes), isEditingTemplate: () => (isEditingTemplate), isEditorPanelEnabled: () => (isEditorPanelEnabled), isEditorPanelOpened: () => (isEditorPanelOpened), isEditorPanelRemoved: () => (isEditorPanelRemoved), isEditorSidebarOpened: () => (isEditorSidebarOpened), isFeatureActive: () => (isFeatureActive), isInserterOpened: () => (isInserterOpened), isListViewOpened: () => (isListViewOpened), isMetaBoxLocationActive: () => (isMetaBoxLocationActive), isMetaBoxLocationVisible: () => (isMetaBoxLocationVisible), isModalActive: () => (isModalActive), isPluginItemPinned: () => (isPluginItemPinned), isPluginSidebarOpened: () => (isPluginSidebarOpened), isPublishSidebarOpened: () => (isPublishSidebarOpened), isSavingMetaBoxes: () => (selectors_isSavingMetaBoxes) }); ;// external ["wp","blocks"] const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; ;// external ["wp","blockLibrary"] const external_wp_blockLibrary_namespaceObject = window["wp"]["blockLibrary"]; ;// external ["wp","deprecated"] const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); ;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// external ["wp","preferences"] const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; ;// external ["wp","widgets"] const external_wp_widgets_namespaceObject = window["wp"]["widgets"]; ;// external ["wp","editor"] const external_wp_editor_namespaceObject = window["wp"]["editor"]; ;// ./node_modules/clsx/dist/clsx.mjs function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx); ;// external ["wp","blockEditor"] const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; ;// external ["wp","plugins"] const external_wp_plugins_namespaceObject = window["wp"]["plugins"]; ;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// external ["wp","primitives"] const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; ;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js /** * WordPress dependencies */ const chevronUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) }); /* harmony default export */ const chevron_up = (chevronUp); ;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js /** * WordPress dependencies */ const chevronDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) }); /* harmony default export */ const chevron_down = (chevronDown); ;// external ["wp","notices"] const external_wp_notices_namespaceObject = window["wp"]["notices"]; ;// external ["wp","commands"] const external_wp_commands_namespaceObject = window["wp"]["commands"]; ;// external ["wp","coreCommands"] const external_wp_coreCommands_namespaceObject = window["wp"]["coreCommands"]; ;// external ["wp","url"] const external_wp_url_namespaceObject = window["wp"]["url"]; ;// external ["wp","htmlEntities"] const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; ;// external ["wp","coreData"] const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; ;// external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; ;// external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; ;// ./node_modules/@wordpress/icons/build-module/library/wordpress.js /** * WordPress dependencies */ const wordpress = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z" }) }); /* harmony default export */ const library_wordpress = (wordpress); ;// ./node_modules/@wordpress/edit-post/build-module/components/back-button/fullscreen-mode-close.js /** * External dependencies */ /** * WordPress dependencies */ function FullscreenModeClose({ showTooltip, icon, href, initialPost }) { var _postType$labels$view; const { isRequestingSiteIcon, postType, siteIconUrl } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentPostType } = select(external_wp_editor_namespaceObject.store); const { getEntityRecord, getPostType, isResolving } = select(external_wp_coreData_namespaceObject.store); const siteData = getEntityRecord('root', '__unstableBase', undefined) || {}; const _postType = initialPost?.type || getCurrentPostType(); return { isRequestingSiteIcon: isResolving('getEntityRecord', ['root', '__unstableBase', undefined]), postType: getPostType(_postType), siteIconUrl: siteData.site_icon_url }; }, []); const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); if (!postType) { return null; } let buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { size: "36px", icon: library_wordpress }); const effect = { expand: { scale: 1.25, transition: { type: 'tween', duration: '0.3' } } }; if (siteIconUrl) { buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.img, { variants: !disableMotion && effect, alt: (0,external_wp_i18n_namespaceObject.__)('Site Icon'), className: "edit-post-fullscreen-mode-close_site-icon", src: siteIconUrl }); } if (isRequestingSiteIcon) { buttonIcon = null; } // Override default icon if custom icon is provided via props. if (icon) { buttonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { size: "36px", icon: icon }); } const classes = dist_clsx('edit-post-fullscreen-mode-close', { 'has-icon': siteIconUrl }); const buttonHref = href !== null && href !== void 0 ? href : (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { post_type: postType.slug }); const buttonLabel = (_postType$labels$view = postType?.labels?.view_items) !== null && _postType$labels$view !== void 0 ? _postType$labels$view : (0,external_wp_i18n_namespaceObject.__)('Back'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { whileHover: "expand", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: classes, href: buttonHref, label: buttonLabel, showTooltip: showTooltip, children: buttonIcon }) }); } /* harmony default export */ const fullscreen_mode_close = (FullscreenModeClose); ;// external ["wp","privateApis"] const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; ;// ./node_modules/@wordpress/edit-post/build-module/lock-unlock.js /** * WordPress dependencies */ const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/edit-post'); ;// ./node_modules/@wordpress/edit-post/build-module/components/back-button/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { BackButton: BackButtonFill } = unlock(external_wp_editor_namespaceObject.privateApis); const slideX = { hidden: { x: '-100%' }, distractionFreeInactive: { x: 0 }, hover: { x: 0, transition: { type: 'tween', delay: 0.2 } } }; function BackButton({ initialPost }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackButtonFill, { children: ({ length }) => length <= 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { variants: slideX, transition: { type: 'tween', delay: 0.8 }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(fullscreen_mode_close, { showTooltip: true, initialPost: initialPost }) }) }); } /* harmony default export */ const back_button = (BackButton); ;// ./node_modules/@wordpress/edit-post/build-module/store/constants.js /** * The identifier for the data store. * * @type {string} */ const STORE_NAME = 'core/edit-post'; /** * CSS selector string for the admin bar view post link anchor tag. * * @type {string} */ const VIEW_AS_LINK_SELECTOR = '#wp-admin-bar-view a'; /** * CSS selector string for the admin bar preview post link anchor tag. * * @type {string} */ const VIEW_AS_PREVIEW_LINK_SELECTOR = '#wp-admin-bar-preview a'; ;// ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/listener-hooks.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * This listener hook monitors any change in permalink and updates the view * post link in the admin bar. */ const useUpdatePostLinkListener = () => { const { newPermalink } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ newPermalink: select(external_wp_editor_namespaceObject.store).getCurrentPost().link }), []); const nodeToUpdateRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { nodeToUpdateRef.current = document.querySelector(VIEW_AS_PREVIEW_LINK_SELECTOR) || document.querySelector(VIEW_AS_LINK_SELECTOR); }, []); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!newPermalink || !nodeToUpdateRef.current) { return; } nodeToUpdateRef.current.setAttribute('href', newPermalink); }, [newPermalink]); }; ;// ./node_modules/@wordpress/edit-post/build-module/components/editor-initialization/index.js /** * Internal dependencies */ /** * Data component used for initializing the editor and re-initializes * when postId changes or on unmount. * * @return {null} This is a data component so does not render any ui. */ function EditorInitialization() { useUpdatePostLinkListener(); return null; } ;// external ["wp","keyboardShortcuts"] const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; ;// ./node_modules/@wordpress/edit-post/build-module/store/reducer.js /** * WordPress dependencies */ /** * Reducer keeping track of the meta boxes isSaving state. * A "true" value means the meta boxes saving request is in-flight. * * * @param {boolean} state Previous state. * @param {Object} action Action Object. * * @return {Object} Updated state. */ function isSavingMetaBoxes(state = false, action) { switch (action.type) { case 'REQUEST_META_BOX_UPDATES': return true; case 'META_BOX_UPDATES_SUCCESS': case 'META_BOX_UPDATES_FAILURE': return false; default: return state; } } function mergeMetaboxes(metaboxes = [], newMetaboxes) { const mergedMetaboxes = [...metaboxes]; for (const metabox of newMetaboxes) { const existing = mergedMetaboxes.findIndex(box => box.id === metabox.id); if (existing !== -1) { mergedMetaboxes[existing] = metabox; } else { mergedMetaboxes.push(metabox); } } return mergedMetaboxes; } /** * Reducer keeping track of the meta boxes per location. * * @param {boolean} state Previous state. * @param {Object} action Action Object. * * @return {Object} Updated state. */ function metaBoxLocations(state = {}, action) { switch (action.type) { case 'SET_META_BOXES_PER_LOCATIONS': { const newState = { ...state }; for (const [location, metaboxes] of Object.entries(action.metaBoxesPerLocation)) { newState[location] = mergeMetaboxes(newState[location], metaboxes); } return newState; } } return state; } /** * Reducer tracking whether meta boxes are initialized. * * @param {boolean} state * @param {Object} action * * @return {boolean} Updated state. */ function metaBoxesInitialized(state = false, action) { switch (action.type) { case 'META_BOXES_INITIALIZED': return true; } return state; } const metaBoxes = (0,external_wp_data_namespaceObject.combineReducers)({ isSaving: isSavingMetaBoxes, locations: metaBoxLocations, initialized: metaBoxesInitialized }); /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ metaBoxes })); ;// external ["wp","apiFetch"] const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); ;// external ["wp","hooks"] const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; ;// ./node_modules/@wordpress/edit-post/build-module/utils/meta-boxes.js /** * Function returning the current Meta Boxes DOM Node in the editor * whether the meta box area is opened or not. * If the MetaBox Area is visible returns it, and returns the original container instead. * * @param {string} location Meta Box location. * * @return {string} HTML content. */ const getMetaBoxContainer = location => { const area = document.querySelector(`.edit-post-meta-boxes-area.is-${location} .metabox-location-${location}`); if (area) { return area; } return document.querySelector('#metaboxes .metabox-location-' + location); }; ;// ./node_modules/@wordpress/edit-post/build-module/store/actions.js /** * WordPress dependencies */ /** * Internal dependencies */ const { interfaceStore } = unlock(external_wp_editor_namespaceObject.privateApis); /** * Returns an action object used in signalling that the user opened an editor sidebar. * * @param {?string} name Sidebar name to be opened. */ const openGeneralSidebar = name => ({ registry }) => { registry.dispatch(interfaceStore).enableComplementaryArea('core', name); }; /** * Returns an action object signalling that the user closed the sidebar. */ const closeGeneralSidebar = () => ({ registry }) => registry.dispatch(interfaceStore).disableComplementaryArea('core'); /** * Returns an action object used in signalling that the user opened a modal. * * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead. * * * @param {string} name A string that uniquely identifies the modal. * * @return {Object} Action object. */ const openModal = name => ({ registry }) => { external_wp_deprecated_default()("select( 'core/edit-post' ).openModal( name )", { since: '6.3', alternative: "select( 'core/interface').openModal( name )" }); return registry.dispatch(interfaceStore).openModal(name); }; /** * Returns an action object signalling that the user closed a modal. * * @deprecated since WP 6.3 use `core/interface` store's action with the same name instead. * * @return {Object} Action object. */ const closeModal = () => ({ registry }) => { external_wp_deprecated_default()("select( 'core/edit-post' ).closeModal()", { since: '6.3', alternative: "select( 'core/interface').closeModal()" }); return registry.dispatch(interfaceStore).closeModal(); }; /** * Returns an action object used in signalling that the user opened the publish * sidebar. * @deprecated * * @return {Object} Action object */ const openPublishSidebar = () => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).openPublishSidebar", { since: '6.6', alternative: "dispatch( 'core/editor').openPublishSidebar" }); registry.dispatch(external_wp_editor_namespaceObject.store).openPublishSidebar(); }; /** * Returns an action object used in signalling that the user closed the * publish sidebar. * @deprecated * * @return {Object} Action object. */ const closePublishSidebar = () => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).closePublishSidebar", { since: '6.6', alternative: "dispatch( 'core/editor').closePublishSidebar" }); registry.dispatch(external_wp_editor_namespaceObject.store).closePublishSidebar(); }; /** * Returns an action object used in signalling that the user toggles the publish sidebar. * @deprecated * * @return {Object} Action object */ const togglePublishSidebar = () => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).togglePublishSidebar", { since: '6.6', alternative: "dispatch( 'core/editor').togglePublishSidebar" }); registry.dispatch(external_wp_editor_namespaceObject.store).togglePublishSidebar(); }; /** * Returns an action object used to enable or disable a panel in the editor. * * @deprecated * * @param {string} panelName A string that identifies the panel to enable or disable. * * @return {Object} Action object. */ const toggleEditorPanelEnabled = panelName => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).toggleEditorPanelEnabled", { since: '6.5', alternative: "dispatch( 'core/editor').toggleEditorPanelEnabled" }); registry.dispatch(external_wp_editor_namespaceObject.store).toggleEditorPanelEnabled(panelName); }; /** * Opens a closed panel and closes an open panel. * * @deprecated * * @param {string} panelName A string that identifies the panel to open or close. */ const toggleEditorPanelOpened = panelName => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).toggleEditorPanelOpened", { since: '6.5', alternative: "dispatch( 'core/editor').toggleEditorPanelOpened" }); registry.dispatch(external_wp_editor_namespaceObject.store).toggleEditorPanelOpened(panelName); }; /** * Returns an action object used to remove a panel from the editor. * * @deprecated * * @param {string} panelName A string that identifies the panel to remove. * * @return {Object} Action object. */ const removeEditorPanel = panelName => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).removeEditorPanel", { since: '6.5', alternative: "dispatch( 'core/editor').removeEditorPanel" }); registry.dispatch(external_wp_editor_namespaceObject.store).removeEditorPanel(panelName); }; /** * Triggers an action used to toggle a feature flag. * * @param {string} feature Feature name. */ const toggleFeature = feature => ({ registry }) => registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-post', feature); /** * Triggers an action used to switch editor mode. * * @deprecated * * @param {string} mode The editor mode. */ const switchEditorMode = mode => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).switchEditorMode", { since: '6.6', alternative: "dispatch( 'core/editor').switchEditorMode" }); registry.dispatch(external_wp_editor_namespaceObject.store).switchEditorMode(mode); }; /** * Triggers an action object used to toggle a plugin name flag. * * @param {string} pluginName Plugin name. */ const togglePinnedPluginItem = pluginName => ({ registry }) => { const isPinned = registry.select(interfaceStore).isItemPinned('core', pluginName); registry.dispatch(interfaceStore)[isPinned ? 'unpinItem' : 'pinItem']('core', pluginName); }; /** * Returns an action object used in signaling that a style should be auto-applied when a block is created. * * @deprecated */ function updatePreferredStyleVariations() { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).updatePreferredStyleVariations", { since: '6.6', hint: 'Preferred Style Variations are not supported anymore.' }); return { type: 'NOTHING' }; } /** * Update the provided block types to be visible. * * @param {string[]} blockNames Names of block types to show. */ const showBlockTypes = blockNames => ({ registry }) => { unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).showBlockTypes(blockNames); }; /** * Update the provided block types to be hidden. * * @param {string[]} blockNames Names of block types to hide. */ const hideBlockTypes = blockNames => ({ registry }) => { unlock(registry.dispatch(external_wp_editor_namespaceObject.store)).hideBlockTypes(blockNames); }; /** * Stores info about which Meta boxes are available in which location. * * @param {Object} metaBoxesPerLocation Meta boxes per location. */ function setAvailableMetaBoxesPerLocation(metaBoxesPerLocation) { return { type: 'SET_META_BOXES_PER_LOCATIONS', metaBoxesPerLocation }; } /** * Update a metabox. */ const requestMetaBoxUpdates = () => async ({ registry, select, dispatch }) => { dispatch({ type: 'REQUEST_META_BOX_UPDATES' }); // Saves the wp_editor fields. if (window.tinyMCE) { window.tinyMCE.triggerSave(); } // We gather the base form data. const baseFormData = new window.FormData(document.querySelector('.metabox-base-form')); const postId = baseFormData.get('post_ID'); const postType = baseFormData.get('post_type'); // Additional data needed for backward compatibility. // If we do not provide this data, the post will be overridden with the default values. // We cannot rely on getCurrentPost because right now on the editor we may be editing a pattern or a template. // We need to retrieve the post that the base form data is referring to. const post = registry.select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId); const additionalData = [post.comment_status ? ['comment_status', post.comment_status] : false, post.ping_status ? ['ping_status', post.ping_status] : false, post.sticky ? ['sticky', post.sticky] : false, post.author ? ['post_author', post.author] : false].filter(Boolean); // We gather all the metaboxes locations. const activeMetaBoxLocations = select.getActiveMetaBoxLocations(); const formDataToMerge = [baseFormData, ...activeMetaBoxLocations.map(location => new window.FormData(getMetaBoxContainer(location)))]; // Merge all form data objects into a single one. const formData = formDataToMerge.reduce((memo, currentFormData) => { for (const [key, value] of currentFormData) { memo.append(key, value); } return memo; }, new window.FormData()); additionalData.forEach(([key, value]) => formData.append(key, value)); try { // Save the metaboxes. await external_wp_apiFetch_default()({ url: window._wpMetaBoxUrl, method: 'POST', body: formData, parse: false }); dispatch.metaBoxUpdatesSuccess(); } catch { dispatch.metaBoxUpdatesFailure(); } }; /** * Returns an action object used to signal a successful meta box update. * * @return {Object} Action object. */ function metaBoxUpdatesSuccess() { return { type: 'META_BOX_UPDATES_SUCCESS' }; } /** * Returns an action object used to signal a failed meta box update. * * @return {Object} Action object. */ function metaBoxUpdatesFailure() { return { type: 'META_BOX_UPDATES_FAILURE' }; } /** * Action that changes the width of the editing canvas. * * @deprecated * * @param {string} deviceType */ const __experimentalSetPreviewDeviceType = deviceType => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).__experimentalSetPreviewDeviceType", { since: '6.5', version: '6.7', hint: 'registry.dispatch( editorStore ).setDeviceType' }); registry.dispatch(external_wp_editor_namespaceObject.store).setDeviceType(deviceType); }; /** * Returns an action object used to open/close the inserter. * * @deprecated * * @param {boolean|Object} value Whether the inserter should be opened (true) or closed (false). */ const setIsInserterOpened = value => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).setIsInserterOpened", { since: '6.5', alternative: "dispatch( 'core/editor').setIsInserterOpened" }); registry.dispatch(external_wp_editor_namespaceObject.store).setIsInserterOpened(value); }; /** * Returns an action object used to open/close the list view. * * @deprecated * * @param {boolean} isOpen A boolean representing whether the list view should be opened or closed. */ const setIsListViewOpened = isOpen => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).setIsListViewOpened", { since: '6.5', alternative: "dispatch( 'core/editor').setIsListViewOpened" }); registry.dispatch(external_wp_editor_namespaceObject.store).setIsListViewOpened(isOpen); }; /** * Returns an action object used to switch to template editing. * * @deprecated */ function setIsEditingTemplate() { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).setIsEditingTemplate", { since: '6.5', alternative: "dispatch( 'core/editor').setRenderingMode" }); return { type: 'NOTHING' }; } /** * Create a block based template. * * @deprecated */ function __unstableCreateTemplate() { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).__unstableCreateTemplate", { since: '6.5' }); return { type: 'NOTHING' }; } let actions_metaBoxesInitialized = false; /** * Initializes WordPress `postboxes` script and the logic for saving meta boxes. */ const initializeMetaBoxes = () => ({ registry, select, dispatch }) => { const isEditorReady = registry.select(external_wp_editor_namespaceObject.store).__unstableIsEditorReady(); if (!isEditorReady) { return; } // Only initialize once. if (actions_metaBoxesInitialized) { return; } const postType = registry.select(external_wp_editor_namespaceObject.store).getCurrentPostType(); if (window.postboxes.page !== postType) { window.postboxes.add_postbox_toggles(postType); } actions_metaBoxesInitialized = true; // Save metaboxes on save completion, except for autosaves. (0,external_wp_hooks_namespaceObject.addAction)('editor.savePost', 'core/edit-post/save-metaboxes', async (post, options) => { if (!options.isAutosave && select.hasMetaBoxes()) { await dispatch.requestMetaBoxUpdates(); } }); dispatch({ type: 'META_BOXES_INITIALIZED' }); }; /** * Action that toggles Distraction free mode. * Distraction free mode expects there are no sidebars, as due to the * z-index values set, you can't close sidebars. * * @deprecated */ const toggleDistractionFree = () => ({ registry }) => { external_wp_deprecated_default()("dispatch( 'core/edit-post' ).toggleDistractionFree", { since: '6.6', alternative: "dispatch( 'core/editor').toggleDistractionFree" }); registry.dispatch(external_wp_editor_namespaceObject.store).toggleDistractionFree(); }; /** * Action that toggles the Fullscreen Mode view option. */ const toggleFullscreenMode = () => ({ registry }) => { const isFullscreen = registry.select(external_wp_preferences_namespaceObject.store).get('core/edit-post', 'fullscreenMode'); registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-post', 'fullscreenMode'); registry.dispatch(external_wp_notices_namespaceObject.store).createInfoNotice(isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode deactivated.') : (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode activated.'), { id: 'core/edit-post/toggle-fullscreen-mode/notice', type: 'snackbar', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Undo'), onClick: () => { registry.dispatch(external_wp_preferences_namespaceObject.store).toggle('core/edit-post', 'fullscreenMode'); } }] }); }; ;// ./node_modules/@wordpress/edit-post/build-module/store/selectors.js /** * WordPress dependencies */ /** * Internal dependencies */ const { interfaceStore: selectors_interfaceStore } = unlock(external_wp_editor_namespaceObject.privateApis); const EMPTY_ARRAY = []; const EMPTY_OBJECT = {}; /** * Returns the current editing mode. * * @param {Object} state Global application state. * * @return {string} Editing mode. */ const getEditorMode = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { var _select$get; return (_select$get = select(external_wp_preferences_namespaceObject.store).get('core', 'editorMode')) !== null && _select$get !== void 0 ? _select$get : 'visual'; }); /** * Returns true if the editor sidebar is opened. * * @param {Object} state Global application state * * @return {boolean} Whether the editor sidebar is opened. */ const isEditorSidebarOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { const activeGeneralSidebar = select(selectors_interfaceStore).getActiveComplementaryArea('core'); return ['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar); }); /** * Returns true if the plugin sidebar is opened. * * @param {Object} state Global application state. * * @return {boolean} Whether the plugin sidebar is opened. */ const isPluginSidebarOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { const activeGeneralSidebar = select(selectors_interfaceStore).getActiveComplementaryArea('core'); return !!activeGeneralSidebar && !['edit-post/document', 'edit-post/block'].includes(activeGeneralSidebar); }); /** * Returns the current active general sidebar name, or null if there is no * general sidebar active. The active general sidebar is a unique name to * identify either an editor or plugin sidebar. * * Examples: * * - `edit-post/document` * - `my-plugin/insert-image-sidebar` * * @param {Object} state Global application state. * * @return {?string} Active general sidebar name. */ const getActiveGeneralSidebarName = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { return select(selectors_interfaceStore).getActiveComplementaryArea('core'); }); /** * Converts panels from the new preferences store format to the old format * that the post editor previously used. * * The resultant converted data should look like this: * { * panelName: { * enabled: false, * opened: true, * }, * anotherPanelName: { * opened: true * }, * } * * @param {string[] | undefined} inactivePanels An array of inactive panel names. * @param {string[] | undefined} openPanels An array of open panel names. * * @return {Object} The converted panel data. */ function convertPanelsToOldFormat(inactivePanels, openPanels) { var _ref; // First reduce the inactive panels. const panelsWithEnabledState = inactivePanels?.reduce((accumulatedPanels, panelName) => ({ ...accumulatedPanels, [panelName]: { enabled: false } }), {}); // Then reduce the open panels, passing in the result of the previous // reduction as the initial value so that both open and inactive // panel state is combined. const panels = openPanels?.reduce((accumulatedPanels, panelName) => { const currentPanelState = accumulatedPanels?.[panelName]; return { ...accumulatedPanels, [panelName]: { ...currentPanelState, opened: true } }; }, panelsWithEnabledState !== null && panelsWithEnabledState !== void 0 ? panelsWithEnabledState : {}); // The panels variable will only be set if openPanels wasn't `undefined`. // If it isn't set just return `panelsWithEnabledState`, and if that isn't // set return an empty object. return (_ref = panels !== null && panels !== void 0 ? panels : panelsWithEnabledState) !== null && _ref !== void 0 ? _ref : EMPTY_OBJECT; } /** * Returns the preferences (these preferences are persisted locally). * * @param {Object} state Global application state. * * @return {Object} Preferences Object. */ const getPreferences = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).getPreferences`, { since: '6.0', alternative: `select( 'core/preferences' ).get` }); const corePreferences = ['editorMode', 'hiddenBlockTypes'].reduce((accumulatedPrefs, preferenceKey) => { const value = select(external_wp_preferences_namespaceObject.store).get('core', preferenceKey); return { ...accumulatedPrefs, [preferenceKey]: value }; }, {}); // Panels were a preference, but the data structure changed when the state // was migrated to the preferences store. They need to be converted from // the new preferences store format to old format to ensure no breaking // changes for plugins. const inactivePanels = select(external_wp_preferences_namespaceObject.store).get('core', 'inactivePanels'); const openPanels = select(external_wp_preferences_namespaceObject.store).get('core', 'openPanels'); const panels = convertPanelsToOldFormat(inactivePanels, openPanels); return { ...corePreferences, panels }; }); /** * * @param {Object} state Global application state. * @param {string} preferenceKey Preference Key. * @param {*} defaultValue Default Value. * * @return {*} Preference Value. */ function getPreference(state, preferenceKey, defaultValue) { external_wp_deprecated_default()(`select( 'core/edit-post' ).getPreference`, { since: '6.0', alternative: `select( 'core/preferences' ).get` }); // Avoid using the `getPreferences` registry selector where possible. const preferences = getPreferences(state); const value = preferences[preferenceKey]; return value === undefined ? defaultValue : value; } /** * Returns an array of blocks that are hidden. * * @return {Array} A list of the hidden block types */ const getHiddenBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { var _select$get2; return (_select$get2 = select(external_wp_preferences_namespaceObject.store).get('core', 'hiddenBlockTypes')) !== null && _select$get2 !== void 0 ? _select$get2 : EMPTY_ARRAY; }); /** * Returns true if the publish sidebar is opened. * * @deprecated * * @param {Object} state Global application state * * @return {boolean} Whether the publish sidebar is open. */ const isPublishSidebarOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isPublishSidebarOpened`, { since: '6.6', alternative: `select( 'core/editor' ).isPublishSidebarOpened` }); return select(external_wp_editor_namespaceObject.store).isPublishSidebarOpened(); }); /** * Returns true if the given panel was programmatically removed, or false otherwise. * All panels are not removed by default. * * @deprecated * * @param {Object} state Global application state. * @param {string} panelName A string that identifies the panel. * * @return {boolean} Whether or not the panel is removed. */ const isEditorPanelRemoved = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, panelName) => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditorPanelRemoved`, { since: '6.5', alternative: `select( 'core/editor' ).isEditorPanelRemoved` }); return select(external_wp_editor_namespaceObject.store).isEditorPanelRemoved(panelName); }); /** * Returns true if the given panel is enabled, or false otherwise. Panels are * enabled by default. * * @deprecated * * @param {Object} state Global application state. * @param {string} panelName A string that identifies the panel. * * @return {boolean} Whether or not the panel is enabled. */ const isEditorPanelEnabled = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, panelName) => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditorPanelEnabled`, { since: '6.5', alternative: `select( 'core/editor' ).isEditorPanelEnabled` }); return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(panelName); }); /** * Returns true if the given panel is open, or false otherwise. Panels are * closed by default. * * @deprecated * * @param {Object} state Global application state. * @param {string} panelName A string that identifies the panel. * * @return {boolean} Whether or not the panel is open. */ const isEditorPanelOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, panelName) => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditorPanelOpened`, { since: '6.5', alternative: `select( 'core/editor' ).isEditorPanelOpened` }); return select(external_wp_editor_namespaceObject.store).isEditorPanelOpened(panelName); }); /** * Returns true if a modal is active, or false otherwise. * * @deprecated since WP 6.3 use `core/interface` store's selector with the same name instead. * * @param {Object} state Global application state. * @param {string} modalName A string that uniquely identifies the modal. * * @return {boolean} Whether the modal is active. */ const isModalActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, modalName) => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isModalActive`, { since: '6.3', alternative: `select( 'core/interface' ).isModalActive` }); return !!select(selectors_interfaceStore).isModalActive(modalName); }); /** * Returns whether the given feature is enabled or not. * * @param {Object} state Global application state. * @param {string} feature Feature slug. * * @return {boolean} Is active. */ const isFeatureActive = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, feature) => { return !!select(external_wp_preferences_namespaceObject.store).get('core/edit-post', feature); }); /** * Returns true if the plugin item is pinned to the header. * When the value is not set it defaults to true. * * @param {Object} state Global application state. * @param {string} pluginName Plugin item name. * * @return {boolean} Whether the plugin item is pinned. */ const isPluginItemPinned = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, pluginName) => { return select(selectors_interfaceStore).isItemPinned('core', pluginName); }); /** * Returns an array of active meta box locations. * * @param {Object} state Post editor state. * * @return {string[]} Active meta box locations. */ const getActiveMetaBoxLocations = (0,external_wp_data_namespaceObject.createSelector)(state => { return Object.keys(state.metaBoxes.locations).filter(location => isMetaBoxLocationActive(state, location)); }, state => [state.metaBoxes.locations]); /** * Returns true if a metabox location is active and visible * * @param {Object} state Post editor state. * @param {string} location Meta box location to test. * * @return {boolean} Whether the meta box location is active and visible. */ const isMetaBoxLocationVisible = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, location) => { return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({ id }) => { return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(`meta-box-${id}`); }); }); /** * Returns true if there is an active meta box in the given location, or false * otherwise. * * @param {Object} state Post editor state. * @param {string} location Meta box location to test. * * @return {boolean} Whether the meta box location is active. */ function isMetaBoxLocationActive(state, location) { const metaBoxes = getMetaBoxesPerLocation(state, location); return !!metaBoxes && metaBoxes.length !== 0; } /** * Returns the list of all the available meta boxes for a given location. * * @param {Object} state Global application state. * @param {string} location Meta box location to test. * * @return {?Array} List of meta boxes. */ function getMetaBoxesPerLocation(state, location) { return state.metaBoxes.locations[location]; } /** * Returns the list of all the available meta boxes. * * @param {Object} state Global application state. * * @return {Array} List of meta boxes. */ const getAllMetaBoxes = (0,external_wp_data_namespaceObject.createSelector)(state => { return Object.values(state.metaBoxes.locations).flat(); }, state => [state.metaBoxes.locations]); /** * Returns true if the post is using Meta Boxes * * @param {Object} state Global application state * * @return {boolean} Whether there are metaboxes or not. */ function hasMetaBoxes(state) { return getActiveMetaBoxLocations(state).length > 0; } /** * Returns true if the Meta Boxes are being saved. * * @param {Object} state Global application state. * * @return {boolean} Whether the metaboxes are being saved. */ function selectors_isSavingMetaBoxes(state) { return state.metaBoxes.isSaving; } /** * Returns the current editing canvas device type. * * @deprecated * * @param {Object} state Global application state. * * @return {string} Device type. */ const __experimentalGetPreviewDeviceType = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`, { since: '6.5', version: '6.7', alternative: `select( 'core/editor' ).getDeviceType` }); return select(external_wp_editor_namespaceObject.store).getDeviceType(); }); /** * Returns true if the inserter is opened. * * @deprecated * * @param {Object} state Global application state. * * @return {boolean} Whether the inserter is opened. */ const isInserterOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isInserterOpened`, { since: '6.5', alternative: `select( 'core/editor' ).isInserterOpened` }); return select(external_wp_editor_namespaceObject.store).isInserterOpened(); }); /** * Get the insertion point for the inserter. * * @deprecated * * @param {Object} state Global application state. * * @return {Object} The root client ID, index to insert at and starting filter value. */ const __experimentalGetInsertionPoint = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).__experimentalGetInsertionPoint`, { since: '6.5', version: '6.7' }); return unlock(select(external_wp_editor_namespaceObject.store)).getInserter(); }); /** * Returns true if the list view is opened. * * @param {Object} state Global application state. * * @return {boolean} Whether the list view is opened. */ const isListViewOpened = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isListViewOpened`, { since: '6.5', alternative: `select( 'core/editor' ).isListViewOpened` }); return select(external_wp_editor_namespaceObject.store).isListViewOpened(); }); /** * Returns true if the template editing mode is enabled. * * @deprecated */ const isEditingTemplate = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { external_wp_deprecated_default()(`select( 'core/edit-post' ).isEditingTemplate`, { since: '6.5', alternative: `select( 'core/editor' ).getRenderingMode` }); return select(external_wp_editor_namespaceObject.store).getCurrentPostType() === 'wp_template'; }); /** * Returns true if meta boxes are initialized. * * @param {Object} state Global application state. * * @return {boolean} Whether meta boxes are initialized. */ function areMetaBoxesInitialized(state) { return state.metaBoxes.initialized; } /** * Retrieves the template of the currently edited post. * * @return {?Object} Post Template. */ const getEditedPostTemplate = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => () => { const { id: postId, type: postType } = select(external_wp_editor_namespaceObject.store).getCurrentPost(); const templateId = unlock(select(external_wp_coreData_namespaceObject.store)).getTemplateId(postType, postId); if (!templateId) { return undefined; } return select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_template', templateId); }); ;// ./node_modules/@wordpress/edit-post/build-module/store/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Store definition for the edit post namespace. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { reducer: reducer, actions: actions_namespaceObject, selectors: selectors_namespaceObject }); (0,external_wp_data_namespaceObject.register)(store); ;// ./node_modules/@wordpress/edit-post/build-module/components/keyboard-shortcuts/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function KeyboardShortcuts() { const { toggleFullscreenMode } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { registerShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { registerShortcut({ name: 'core/edit-post/toggle-fullscreen', category: 'global', description: (0,external_wp_i18n_namespaceObject.__)('Enable or disable fullscreen mode.'), keyCombination: { modifier: 'secondary', character: 'f' } }); }, []); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/edit-post/toggle-fullscreen', () => { toggleFullscreenMode(); }); return null; } /* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts); ;// ./node_modules/@wordpress/edit-post/build-module/components/init-pattern-modal/index.js /** * WordPress dependencies */ function InitPatternModal() { const { editPost } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); const [syncType, setSyncType] = (0,external_wp_element_namespaceObject.useState)(undefined); const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); const { postType, isNewPost } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedPostAttribute, isCleanNewPost } = select(external_wp_editor_namespaceObject.store); return { postType: getEditedPostAttribute('type'), isNewPost: isCleanNewPost() }; }, []); const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(() => isNewPost && postType === 'wp_block'); if (postType !== 'wp_block' || !isNewPost) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Create pattern'), onRequestClose: () => { setIsModalOpen(false); }, overlayClassName: "reusable-blocks-menu-items__convert-modal", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: event => { event.preventDefault(); setIsModalOpen(false); editPost({ title, meta: { wp_pattern_sync_status: syncType } }); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, onChange: setTitle, placeholder: (0,external_wp_i18n_namespaceObject.__)('My pattern'), className: "patterns-create-modal__name-input", __nextHasNoMarginBottom: true, __next40pxDefaultSize: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject._x)('Synced', 'pattern (singular)'), help: (0,external_wp_i18n_namespaceObject.__)('Sync this pattern across multiple locations.'), checked: !syncType, onChange: () => { setSyncType(!syncType ? 'unsynced' : undefined); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", disabled: !title, accessibleWhenDisabled: true, children: (0,external_wp_i18n_namespaceObject.__)('Create') }) })] }) }) }) }); } ;// ./node_modules/@wordpress/edit-post/build-module/components/browser-url/index.js /** * WordPress dependencies */ /** * Returns the Post's Edit URL. * * @param {number} postId Post ID. * * @return {string} Post edit URL. */ function getPostEditURL(postId) { return (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', { post: postId, action: 'edit' }); } class BrowserURL extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); this.state = { historyId: null }; } componentDidUpdate(prevProps) { const { postId, postStatus } = this.props; const { historyId } = this.state; if ((postId !== prevProps.postId || postId !== historyId) && postStatus !== 'auto-draft' && postId) { this.setBrowserURL(postId); } } /** * Replaces the browser URL with a post editor link for the given post ID. * * Note it is important that, since this function may be called when the * editor first loads, the result generated `getPostEditURL` matches that * produced by the server. Otherwise, the URL will change unexpectedly. * * @param {number} postId Post ID for which to generate post editor URL. */ setBrowserURL(postId) { window.history.replaceState({ id: postId }, 'Post ' + postId, getPostEditURL(postId)); this.setState(() => ({ historyId: postId })); } render() { return null; } } /* harmony default export */ const browser_url = ((0,external_wp_data_namespaceObject.withSelect)(select => { const { getCurrentPost } = select(external_wp_editor_namespaceObject.store); const post = getCurrentPost(); let { id, status, type } = post; const isTemplate = ['wp_template', 'wp_template_part'].includes(type); if (isTemplate) { id = post.wp_id; } return { postId: id, postStatus: status }; })(BrowserURL)); ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Render metabox area. * * @param {Object} props Component props. * @param {string} props.location metabox location. * @return {Component} The component to be rendered. */ function MetaBoxesArea({ location }) { const container = (0,external_wp_element_namespaceObject.useRef)(null); const formRef = (0,external_wp_element_namespaceObject.useRef)(null); (0,external_wp_element_namespaceObject.useEffect)(() => { formRef.current = document.querySelector('.metabox-location-' + location); if (formRef.current) { container.current.appendChild(formRef.current); } return () => { if (formRef.current) { document.querySelector('#metaboxes').appendChild(formRef.current); } }; }, [location]); const isSaving = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(store).isSavingMetaBoxes(); }, []); const classes = dist_clsx('edit-post-meta-boxes-area', `is-${location}`, { 'is-loading': isSaving }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: classes, children: [isSaving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-post-meta-boxes-area__container", ref: container }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "edit-post-meta-boxes-area__clear" })] }); } /* harmony default export */ const meta_boxes_area = (MetaBoxesArea); ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/meta-box-visibility.js /** * WordPress dependencies */ function MetaBoxVisibility({ id }) { const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_editor_namespaceObject.store).isEditorPanelEnabled(`meta-box-${id}`); }, [id]); (0,external_wp_element_namespaceObject.useEffect)(() => { const element = document.getElementById(id); if (!element) { return; } if (isVisible) { element.classList.remove('is-hidden'); } else { element.classList.add('is-hidden'); } }, [id, isVisible]); return null; } ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function MetaBoxes({ location }) { const metaBoxes = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getMetaBoxesPerLocation(location), [location]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [(metaBoxes !== null && metaBoxes !== void 0 ? metaBoxes : []).map(({ id }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxVisibility, { id: id }, id)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_boxes_area, { location: location })] }); } ;// external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// ./node_modules/@wordpress/edit-post/build-module/components/more-menu/manage-patterns-menu-item.js /** * WordPress dependencies */ function ManagePatternsMenuItem() { const url = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canUser } = select(external_wp_coreData_namespaceObject.store); const defaultUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { post_type: 'wp_block' }); const patternsUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', { path: '/patterns' }); // The site editor and templates both check whether the user has // edit_theme_options capabilities. We can leverage that here and not // display the manage patterns link if the user can't access it. return canUser('create', { kind: 'postType', name: 'wp_template' }) ? patternsUrl : defaultUrl; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { role: "menuitem", href: url, children: (0,external_wp_i18n_namespaceObject.__)('Manage patterns') }); } /* harmony default export */ const manage_patterns_menu_item = (ManagePatternsMenuItem); ;// ./node_modules/@wordpress/edit-post/build-module/components/more-menu/welcome-guide-menu-item.js /** * WordPress dependencies */ function WelcomeGuideMenuItem() { const isEditingTemplate = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_editor_namespaceObject.store).getCurrentPostType() === 'wp_template', []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core/edit-post", name: isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide', label: (0,external_wp_i18n_namespaceObject.__)('Welcome Guide') }); } ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-custom-fields.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PreferenceBaseOption } = unlock(external_wp_preferences_namespaceObject.privateApis); function submitCustomFieldsForm() { const customFieldsForm = document.getElementById('toggle-custom-fields-form'); // Ensure the referrer values is up to update with any customFieldsForm.querySelector('[name="_wp_http_referer"]').setAttribute('value', (0,external_wp_url_namespaceObject.getPathAndQueryString)(window.location.href)); customFieldsForm.submit(); } function CustomFieldsConfirmation({ willEnable }) { const [isReloading, setIsReloading] = (0,external_wp_element_namespaceObject.useState)(false); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-preferences-modal__custom-fields-confirmation-message", children: (0,external_wp_i18n_namespaceObject.__)('A page reload is required for this change. Make sure your content is saved before reloading.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", isBusy: isReloading, accessibleWhenDisabled: true, disabled: isReloading, onClick: () => { setIsReloading(true); submitCustomFieldsForm(); }, children: willEnable ? (0,external_wp_i18n_namespaceObject.__)('Show & Reload Page') : (0,external_wp_i18n_namespaceObject.__)('Hide & Reload Page') })] }); } function EnableCustomFieldsOption({ label }) { const areCustomFieldsEnabled = (0,external_wp_data_namespaceObject.useSelect)(select => { return !!select(external_wp_editor_namespaceObject.store).getEditorSettings().enableCustomFields; }, []); const [isChecked, setIsChecked] = (0,external_wp_element_namespaceObject.useState)(areCustomFieldsEnabled); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceBaseOption, { label: label, isChecked: isChecked, onChange: setIsChecked, children: isChecked !== areCustomFieldsEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomFieldsConfirmation, { willEnable: isChecked }) }); } ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/enable-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PreferenceBaseOption: enable_panel_PreferenceBaseOption } = unlock(external_wp_preferences_namespaceObject.privateApis); function EnablePanelOption(props) { const { toggleEditorPanelEnabled } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); const { isChecked, isRemoved } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isEditorPanelEnabled, isEditorPanelRemoved } = select(external_wp_editor_namespaceObject.store); return { isChecked: isEditorPanelEnabled(props.panelName), isRemoved: isEditorPanelRemoved(props.panelName) }; }, [props.panelName]); if (isRemoved) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(enable_panel_PreferenceBaseOption, { isChecked: isChecked, onChange: () => toggleEditorPanelEnabled(props.panelName), ...props }); } ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/meta-boxes-section.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PreferencesModalSection } = unlock(external_wp_preferences_namespaceObject.privateApis); function MetaBoxesSection({ areCustomFieldsRegistered, metaBoxes, ...sectionProps }) { // The 'Custom Fields' meta box is a special case that we handle separately. const thirdPartyMetaBoxes = metaBoxes.filter(({ id }) => id !== 'postcustom'); if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(PreferencesModalSection, { ...sectionProps, children: [areCustomFieldsRegistered && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnableCustomFieldsOption, { label: (0,external_wp_i18n_namespaceObject.__)('Custom fields') }), thirdPartyMetaBoxes.map(({ id, title }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnablePanelOption, { label: title, panelName: `meta-box-${id}` }, id))] }); } /* harmony default export */ const meta_boxes_section = ((0,external_wp_data_namespaceObject.withSelect)(select => { const { getEditorSettings } = select(external_wp_editor_namespaceObject.store); const { getAllMetaBoxes } = select(store); return { // This setting should not live in the block editor's store. areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== undefined, metaBoxes: getAllMetaBoxes() }; })(MetaBoxesSection)); ;// ./node_modules/@wordpress/edit-post/build-module/components/preferences-modal/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PreferenceToggleControl } = unlock(external_wp_preferences_namespaceObject.privateApis); const { PreferencesModal } = unlock(external_wp_editor_namespaceObject.privateApis); function EditPostPreferencesModal() { const extraSections = { general: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(meta_boxes_section, { title: (0,external_wp_i18n_namespaceObject.__)('Advanced') }), appearance: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferenceToggleControl, { scope: "core/edit-post", featureName: "themeStyles", help: (0,external_wp_i18n_namespaceObject.__)('Make the editor look like your theme.'), label: (0,external_wp_i18n_namespaceObject.__)('Use theme styles') }) }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreferencesModal, { extraSections: extraSections }); } ;// ./node_modules/@wordpress/edit-post/build-module/components/more-menu/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock(external_wp_editor_namespaceObject.privateApis); const MoreMenu = () => { const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('large'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewMoreMenuGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_preferences_namespaceObject.PreferenceToggleMenuItem, { scope: "core/edit-post", name: "fullscreenMode", label: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode'), info: (0,external_wp_i18n_namespaceObject.__)('Show and hide the admin user interface'), messageActivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode activated.'), messageDeactivated: (0,external_wp_i18n_namespaceObject.__)('Fullscreen mode deactivated.'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.secondary('f') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ToolsMoreMenuGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(manage_patterns_menu_item, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideMenuItem, {})] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditPostPreferencesModal, {})] }); }; /* harmony default export */ const more_menu = (MoreMenu); ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/image.js function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("picture", { className: "edit-post-welcome-guide__image", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("source", { srcSet: nonAnimatedSrc, media: "(prefers-reduced-motion: reduce)" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" })] }); } ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/default.js /** * WordPress dependencies */ /** * Internal dependencies */ function WelcomeGuideDefault() { const { toggleFeature } = (0,external_wp_data_namespaceObject.useDispatch)(store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, { className: "edit-post-welcome-guide", contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to the editor'), finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'), onFinish: () => toggleFeature('welcomeGuide'), pages: [{ image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Welcome to the editor') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)('In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.') })] }) }, { image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Customize each block') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)('Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.') })] }) }, { image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Explore all blocks') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'), { InserterIconImage: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { alt: (0,external_wp_i18n_namespaceObject.__)('inserter'), src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A" }) }) })] }) }, { image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Learn more') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)("New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"), { a: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/wordpress-block-editor/') }) }) })] }) }] }); } ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/template.js /** * WordPress dependencies */ /** * Internal dependencies */ function WelcomeGuideTemplate() { const { toggleFeature } = (0,external_wp_data_namespaceObject.useDispatch)(store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Guide, { className: "edit-template-welcome-guide", contentLabel: (0,external_wp_i18n_namespaceObject.__)('Welcome to the template editor'), finishButtonText: (0,external_wp_i18n_namespaceObject.__)('Get started'), onFinish: () => toggleFeature('welcomeGuideTemplate'), pages: [{ image: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideImage, { nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.svg", animatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.gif" }), content: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0,external_wp_i18n_namespaceObject.__)('Welcome to the template editor') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0,external_wp_i18n_namespaceObject.__)('Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.') })] }) }] }); } ;// ./node_modules/@wordpress/edit-post/build-module/components/welcome-guide/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function WelcomeGuide({ postType }) { const { isActive, isEditingTemplate } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isFeatureActive } = select(store); const _isEditingTemplate = postType === 'wp_template'; const feature = _isEditingTemplate ? 'welcomeGuideTemplate' : 'welcomeGuide'; return { isActive: isFeatureActive(feature), isEditingTemplate: _isEditingTemplate }; }, [postType]); if (!isActive) { return null; } return isEditingTemplate ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideTemplate, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuideDefault, {}); } ;// ./node_modules/@wordpress/icons/build-module/library/fullscreen.js /** * WordPress dependencies */ const fullscreen = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) }); /* harmony default export */ const library_fullscreen = (fullscreen); ;// ./node_modules/@wordpress/edit-post/build-module/commands/use-commands.js /** * WordPress dependencies */ function useCommands() { const { isFullscreen } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { get } = select(external_wp_preferences_namespaceObject.store); return { isFullscreen: get('core/edit-post', 'fullscreenMode') }; }, []); const { toggle } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); const { createInfoNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); (0,external_wp_commands_namespaceObject.useCommand)({ name: 'core/toggle-fullscreen-mode', label: isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Exit fullscreen') : (0,external_wp_i18n_namespaceObject.__)('Enter fullscreen'), icon: library_fullscreen, callback: ({ close }) => { toggle('core/edit-post', 'fullscreenMode'); close(); createInfoNotice(isFullscreen ? (0,external_wp_i18n_namespaceObject.__)('Fullscreen off.') : (0,external_wp_i18n_namespaceObject.__)('Fullscreen on.'), { id: 'core/edit-post/toggle-fullscreen-mode/notice', type: 'snackbar', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Undo'), onClick: () => { toggle('core/edit-post', 'fullscreenMode'); } }] }); } }); } ;// ./node_modules/@wordpress/edit-post/build-module/components/layout/use-padding-appender.js /** * WordPress dependencies */ // Ruleset to add space for the typewriter effect. When typing in the last // block, there needs to be room to scroll up. const CSS = ':root :where(.editor-styles-wrapper)::after {content: ""; display: block; height: 40vh;}'; function usePaddingAppender(enabled) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const effect = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { function onMouseDown(event) { if (event.target !== node && // Tests for the parent element because in the iframed editor if the click is // below the padding the target will be the parent element (html) and should // still be treated as intent to append. event.target !== node.parentElement) { return; } // Only handle clicks under the last child. const lastChild = node.lastElementChild; if (!lastChild) { return; } const lastChildRect = lastChild.getBoundingClientRect(); if (event.clientY < lastChildRect.bottom) { return; } event.preventDefault(); const blockOrder = registry.select(external_wp_blockEditor_namespaceObject.store).getBlockOrder(''); const lastBlockClientId = blockOrder[blockOrder.length - 1]; const lastBlock = registry.select(external_wp_blockEditor_namespaceObject.store).getBlock(lastBlockClientId); const { selectBlock, insertDefaultBlock } = registry.dispatch(external_wp_blockEditor_namespaceObject.store); if (lastBlock && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(lastBlock)) { selectBlock(lastBlockClientId); } else { insertDefaultBlock(); } } const { ownerDocument } = node; // Adds the listener on the document so that in the iframed editor clicks below the // padding can be handled as they too should be treated as intent to append. ownerDocument.addEventListener('mousedown', onMouseDown); return () => { ownerDocument.removeEventListener('mousedown', onMouseDown); }; }, [registry]); return enabled ? [effect, CSS] : []; } ;// ./node_modules/@wordpress/edit-post/build-module/components/layout/use-should-iframe.js /** * WordPress dependencies */ /** * Internal dependencies */ const isGutenbergPlugin = false ? 0 : false; function useShouldIframe() { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditorSettings, getCurrentPostType, getDeviceType } = select(external_wp_editor_namespaceObject.store); return ( // If the theme is block based and the Gutenberg plugin is active, // we ALWAYS use the iframe for consistency across the post and site // editor. isGutenbergPlugin && getEditorSettings().__unstableIsBlockBasedTheme || // We also still want to iframe all the special // editor features and modes such as device previews, zoom out, and // template/pattern editing. getDeviceType() !== 'Desktop' || ['wp_template', 'wp_block'].includes(getCurrentPostType()) || unlock(select(external_wp_blockEditor_namespaceObject.store)).isZoomOut() || // Finally, still iframe the editor if all blocks are v3 (which means // they are marked as iframe-compatible). select(external_wp_blocks_namespaceObject.store).getBlockTypes().every(type => type.apiVersion >= 3) ); }, []); } ;// ./node_modules/@wordpress/edit-post/build-module/hooks/use-navigate-to-entity-record.js /** * WordPress dependencies */ /** * A hook that records the 'entity' history in the post editor as a user * navigates between editing a post and editing the post template or patterns. * * Implemented as a stack, so a little similar to the browser history API. * * Used to control displaying UI elements like the back button. * * @param {number} initialPostId The post id of the post when the editor loaded. * @param {string} initialPostType The post type of the post when the editor loaded. * @param {string} defaultRenderingMode The rendering mode to switch to when navigating. * * @return {Object} An object containing the `currentPost` variable and * `onNavigateToEntityRecord` and `onNavigateToPreviousEntityRecord` functions. */ function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRenderingMode) { const [postHistory, dispatch] = (0,external_wp_element_namespaceObject.useReducer)((historyState, { type, post, previousRenderingMode }) => { if (type === 'push') { return [...historyState, { post, previousRenderingMode }]; } if (type === 'pop') { // Try to leave one item in the history. if (historyState.length > 1) { return historyState.slice(0, -1); } } return historyState; }, [{ post: { postId: initialPostId, postType: initialPostType } }]); const { post, previousRenderingMode } = postHistory[postHistory.length - 1]; const { getRenderingMode } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_editor_namespaceObject.store); const { setRenderingMode } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_editor_namespaceObject.store); const onNavigateToEntityRecord = (0,external_wp_element_namespaceObject.useCallback)(params => { dispatch({ type: 'push', post: { postId: params.postId, postType: params.postType }, // Save the current rendering mode so we can restore it when navigating back. previousRenderingMode: getRenderingMode() }); setRenderingMode(defaultRenderingMode); }, [getRenderingMode, setRenderingMode, defaultRenderingMode]); const onNavigateToPreviousEntityRecord = (0,external_wp_element_namespaceObject.useCallback)(() => { dispatch({ type: 'pop' }); if (previousRenderingMode) { setRenderingMode(previousRenderingMode); } }, [setRenderingMode, previousRenderingMode]); return { currentPost: post, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord: postHistory.length > 1 ? onNavigateToPreviousEntityRecord : undefined }; } ;// ./node_modules/@wordpress/edit-post/build-module/components/meta-boxes/use-meta-box-initialization.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Initializes WordPress `postboxes` script and the logic for saving meta boxes. * * @param { boolean } enabled */ const useMetaBoxInitialization = enabled => { const isEnabledAndEditorReady = (0,external_wp_data_namespaceObject.useSelect)(select => enabled && select(external_wp_editor_namespaceObject.store).__unstableIsEditorReady(), [enabled]); const { initializeMetaBoxes } = (0,external_wp_data_namespaceObject.useDispatch)(store); // The effect has to rerun when the editor is ready because initializeMetaBoxes // will noop until then. (0,external_wp_element_namespaceObject.useEffect)(() => { if (isEnabledAndEditorReady) { initializeMetaBoxes(); } }, [isEnabledAndEditorReady, initializeMetaBoxes]); }; ;// ./node_modules/@wordpress/edit-post/build-module/components/layout/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { getLayoutStyles } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { useCommands: layout_useCommands } = unlock(external_wp_coreCommands_namespaceObject.privateApis); const { useCommandContext } = unlock(external_wp_commands_namespaceObject.privateApis); const { Editor, FullscreenMode, NavigableRegion } = unlock(external_wp_editor_namespaceObject.privateApis); const { BlockKeyboardShortcuts } = unlock(external_wp_blockLibrary_namespaceObject.privateApis); const DESIGN_POST_TYPES = ['wp_template', 'wp_template_part', 'wp_block', 'wp_navigation']; function useEditorStyles(...additionalStyles) { const { hasThemeStyleSupport, editorSettings } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { hasThemeStyleSupport: select(store).isFeatureActive('themeStyles'), editorSettings: select(external_wp_editor_namespaceObject.store).getEditorSettings() }; }, []); const addedStyles = additionalStyles.join('\n'); // Compute the default styles. return (0,external_wp_element_namespaceObject.useMemo)(() => { var _editorSettings$style, _editorSettings$defau, _editorSettings$style2, _editorSettings$style3; const presetStyles = (_editorSettings$style = editorSettings.styles?.filter(style => style.__unstableType && style.__unstableType !== 'theme')) !== null && _editorSettings$style !== void 0 ? _editorSettings$style : []; const defaultEditorStyles = [...((_editorSettings$defau = editorSettings?.defaultEditorStyles) !== null && _editorSettings$defau !== void 0 ? _editorSettings$defau : []), ...presetStyles]; // Has theme styles if the theme supports them and if some styles were not preset styles (in which case they're theme styles). const hasThemeStyles = hasThemeStyleSupport && presetStyles.length !== ((_editorSettings$style2 = editorSettings.styles?.length) !== null && _editorSettings$style2 !== void 0 ? _editorSettings$style2 : 0); // If theme styles are not present or displayed, ensure that // base layout styles are still present in the editor. if (!editorSettings.disableLayoutStyles && !hasThemeStyles) { defaultEditorStyles.push({ css: getLayoutStyles({ style: {}, selector: 'body', hasBlockGapSupport: false, hasFallbackGapSupport: true, fallbackGapValue: '0.5em' }) }); } const baseStyles = hasThemeStyles ? (_editorSettings$style3 = editorSettings.styles) !== null && _editorSettings$style3 !== void 0 ? _editorSettings$style3 : [] : defaultEditorStyles; if (addedStyles) { return [...baseStyles, { css: addedStyles }]; } return baseStyles; }, [editorSettings.defaultEditorStyles, editorSettings.disableLayoutStyles, editorSettings.styles, hasThemeStyleSupport, addedStyles]); } /** * @param {Object} props * @param {boolean} props.isLegacy True when the editor canvas is not in an iframe. */ function MetaBoxesMain({ isLegacy }) { const [isOpen, openHeight, hasAnyVisible] = (0,external_wp_data_namespaceObject.useSelect)(select => { const { get } = select(external_wp_preferences_namespaceObject.store); const { isMetaBoxLocationVisible } = select(store); return [get('core/edit-post', 'metaBoxesMainIsOpen'), get('core/edit-post', 'metaBoxesMainOpenHeight'), isMetaBoxLocationVisible('normal') || isMetaBoxLocationVisible('advanced') || isMetaBoxLocationVisible('side')]; }, []); const { set: setPreference } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); const metaBoxesMainRef = (0,external_wp_element_namespaceObject.useRef)(); const isShort = (0,external_wp_compose_namespaceObject.useMediaQuery)('(max-height: 549px)'); const [{ min, max }, setHeightConstraints] = (0,external_wp_element_namespaceObject.useState)(() => ({})); // Keeps the resizable area’s size constraints updated taking into account // editor notices. The constraints are also used to derive the value for the // aria-valuenow attribute on the separator. const effectSizeConstraints = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { const container = node.closest('.interface-interface-skeleton__content'); const noticeLists = container.querySelectorAll(':scope > .components-notice-list'); const resizeHandle = container.querySelector('.edit-post-meta-boxes-main__presenter'); const deriveConstraints = () => { const fullHeight = container.offsetHeight; let nextMax = fullHeight; for (const element of noticeLists) { nextMax -= element.offsetHeight; } const nextMin = resizeHandle.offsetHeight; setHeightConstraints({ min: nextMin, max: nextMax }); }; const observer = new window.ResizeObserver(deriveConstraints); observer.observe(container); for (const element of noticeLists) { observer.observe(element); } return () => observer.disconnect(); }, []); const separatorRef = (0,external_wp_element_namespaceObject.useRef)(); const separatorHelpId = (0,external_wp_element_namespaceObject.useId)(); const [isUntouched, setIsUntouched] = (0,external_wp_element_namespaceObject.useState)(true); const applyHeight = (candidateHeight, isPersistent, isInstant) => { const nextHeight = Math.min(max, Math.max(min, candidateHeight)); if (isPersistent) { setPreference('core/edit-post', 'metaBoxesMainOpenHeight', nextHeight); } else { separatorRef.current.ariaValueNow = getAriaValueNow(nextHeight); } if (isInstant) { metaBoxesMainRef.current.updateSize({ height: nextHeight, // Oddly, when the event that triggered this was not from the mouse (e.g. keydown), // if `width` is left unspecified a subsequent drag gesture applies a fixed // width and the pane fails to widen/narrow with parent width changes from // sidebars opening/closing or window resizes. width: 'auto' }); } }; if (!hasAnyVisible) { return; } const contents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx( // The class name 'edit-post-layout__metaboxes' is retained because some plugins use it. 'edit-post-layout__metaboxes', !isLegacy && 'edit-post-meta-boxes-main__liner'), hidden: !isLegacy && isShort && !isOpen, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { location: "normal" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { location: "advanced" })] }); if (isLegacy) { return contents; } const isAutoHeight = openHeight === undefined; let usedMax = '50%'; // Approximation before max has a value. if (max !== undefined) { // Halves the available max height until a user height is set. usedMax = isAutoHeight && isUntouched ? max / 2 : max; } const getAriaValueNow = height => Math.round((height - min) / (max - min) * 100); const usedAriaValueNow = max === undefined || isAutoHeight ? 50 : getAriaValueNow(openHeight); const toggle = () => setPreference('core/edit-post', 'metaBoxesMainIsOpen', !isOpen); // TODO: Support more/all keyboard interactions from the window splitter pattern: // https://www.w3.org/WAI/ARIA/apg/patterns/windowsplitter/ const onSeparatorKeyDown = event => { const delta = { ArrowUp: 20, ArrowDown: -20 }[event.key]; if (delta) { const pane = metaBoxesMainRef.current.resizable; const fromHeight = isAutoHeight ? pane.offsetHeight : openHeight; const nextHeight = delta + fromHeight; applyHeight(nextHeight, true, true); event.preventDefault(); } }; const className = 'edit-post-meta-boxes-main'; const paneLabel = (0,external_wp_i18n_namespaceObject.__)('Meta Boxes'); let Pane, paneProps; if (isShort) { Pane = NavigableRegion; paneProps = { className: dist_clsx(className, 'is-toggle-only') }; } else { Pane = external_wp_components_namespaceObject.ResizableBox; paneProps = /** @type {Parameters<typeof ResizableBox>[0]} */{ as: NavigableRegion, ref: metaBoxesMainRef, className: dist_clsx(className, 'is-resizable'), defaultSize: { height: openHeight }, minHeight: min, maxHeight: usedMax, enable: { top: true, right: false, bottom: false, left: false, topLeft: false, topRight: false, bottomRight: false, bottomLeft: false }, handleClasses: { top: 'edit-post-meta-boxes-main__presenter' }, handleComponent: { top: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: (0,external_wp_i18n_namespaceObject.__)('Drag to resize'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { // eslint-disable-line jsx-a11y/role-supports-aria-props ref: separatorRef, role: "separator" // eslint-disable-line jsx-a11y/no-interactive-element-to-noninteractive-role , "aria-valuenow": usedAriaValueNow, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Drag to resize'), "aria-describedby": separatorHelpId, onKeyDown: onSeparatorKeyDown }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: separatorHelpId, children: (0,external_wp_i18n_namespaceObject.__)('Use up and down arrow keys to resize the meta box panel.') })] }) }, // Avoids hiccups while dragging over objects like iframes and ensures that // the event to end the drag is captured by the target (resize handle) // whether or not it’s under the pointer. onPointerDown: ({ pointerId, target }) => { if (separatorRef.current.parentElement.contains(target)) { target.setPointerCapture(pointerId); } }, onResizeStart: (event, direction, elementRef) => { if (isAutoHeight) { // Sets the starting height to avoid visual jumps in height and // aria-valuenow being `NaN` for the first (few) resize events. applyHeight(elementRef.offsetHeight, false, true); setIsUntouched(false); } }, onResize: () => applyHeight(metaBoxesMainRef.current.state.height), onResizeStop: () => applyHeight(metaBoxesMainRef.current.state.height, true) }; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Pane, { "aria-label": paneLabel, ...paneProps, children: [isShort ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("button", { "aria-expanded": isOpen, className: "edit-post-meta-boxes-main__presenter", onClick: toggle, children: [paneLabel, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: isOpen ? chevron_up : chevron_down })] }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("meta", { ref: effectSizeConstraints }), contents] }); } function Layout({ postId: initialPostId, postType: initialPostType, settings, initialEdits }) { layout_useCommands(); useCommands(); const shouldIframe = useShouldIframe(); const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { currentPost: { postId: currentPostId, postType: currentPostType }, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord } = useNavigateToEntityRecord(initialPostId, initialPostType, 'post-only'); const isEditingTemplate = currentPostType === 'wp_template'; const { mode, isFullscreenActive, hasResolvedMode, hasActiveMetaboxes, hasBlockSelected, showIconLabels, isDistractionFree, showMetaBoxes, isWelcomeGuideVisible, templateId, enablePaddingAppender, isDevicePreview } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getPostType$viewable; const { get } = select(external_wp_preferences_namespaceObject.store); const { isFeatureActive, hasMetaBoxes } = select(store); const { canUser, getPostType, getTemplateId } = unlock(select(external_wp_coreData_namespaceObject.store)); const supportsTemplateMode = settings.supportsTemplateMode; const isViewable = (_getPostType$viewable = getPostType(currentPostType)?.viewable) !== null && _getPostType$viewable !== void 0 ? _getPostType$viewable : false; const canViewTemplate = canUser('read', { kind: 'postType', name: 'wp_template' }); const { getBlockSelectionStart, isZoomOut } = unlock(select(external_wp_blockEditor_namespaceObject.store)); const { getEditorMode, getRenderingMode, getDefaultRenderingMode, getDeviceType } = unlock(select(external_wp_editor_namespaceObject.store)); const isRenderingPostOnly = getRenderingMode() === 'post-only'; const isNotDesignPostType = !DESIGN_POST_TYPES.includes(currentPostType); const isDirectlyEditingPattern = currentPostType === 'wp_block' && !onNavigateToPreviousEntityRecord; const _templateId = getTemplateId(currentPostType, currentPostId); const defaultMode = getDefaultRenderingMode(currentPostType); return { mode: getEditorMode(), isFullscreenActive: isFeatureActive('fullscreenMode'), hasActiveMetaboxes: hasMetaBoxes(), hasResolvedMode: defaultMode === 'template-locked' ? !!_templateId : defaultMode !== undefined, hasBlockSelected: !!getBlockSelectionStart(), showIconLabels: get('core', 'showIconLabels'), isDistractionFree: get('core', 'distractionFree'), showMetaBoxes: isNotDesignPostType && !isZoomOut() || isDirectlyEditingPattern, isWelcomeGuideVisible: isFeatureActive('welcomeGuide'), templateId: supportsTemplateMode && isViewable && canViewTemplate && !isEditingTemplate ? _templateId : null, enablePaddingAppender: !isZoomOut() && isRenderingPostOnly && isNotDesignPostType, isDevicePreview: getDeviceType() !== 'Desktop' }; }, [currentPostType, currentPostId, isEditingTemplate, settings.supportsTemplateMode, onNavigateToPreviousEntityRecord]); useMetaBoxInitialization(hasActiveMetaboxes && hasResolvedMode); const [paddingAppenderRef, paddingStyle] = usePaddingAppender(enablePaddingAppender); // Set the right context for the command palette const commandContext = hasBlockSelected ? 'block-selection-edit' : 'entity-edit'; useCommandContext(commandContext); const editorSettings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord, defaultRenderingMode: 'post-only' }), [settings, onNavigateToEntityRecord, onNavigateToPreviousEntityRecord]); const styles = useEditorStyles(paddingStyle); // We need to add the show-icon-labels class to the body element so it is applied to modals. if (showIconLabels) { document.body.classList.add('show-icon-labels'); } else { document.body.classList.remove('show-icon-labels'); } const navigateRegionsProps = (0,external_wp_components_namespaceObject.__unstableUseNavigateRegions)(); const className = dist_clsx('edit-post-layout', 'is-mode-' + mode, { 'has-metaboxes': hasActiveMetaboxes }); function onPluginAreaError(name) { createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: plugin name */ (0,external_wp_i18n_namespaceObject.__)('The "%s" plugin has encountered an error and cannot be rendered.'), name)); } const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const onActionPerformed = (0,external_wp_element_namespaceObject.useCallback)((actionId, items) => { switch (actionId) { case 'move-to-trash': { document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { trashed: 1, post_type: items[0].type, ids: items[0].id }); } break; case 'duplicate-post': { const newItem = items[0]; const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered; createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Title of the created post or template, e.g: "Hello world". (0,external_wp_i18n_namespaceObject.__)('"%s" successfully created.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title)), { type: 'snackbar', id: 'duplicate-post-action', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Edit'), onClick: () => { const postId = newItem.id; document.location.href = (0,external_wp_url_namespaceObject.addQueryArgs)('post.php', { post: postId, action: 'edit' }); } }] }); } break; } }, [createSuccessNotice]); const initialPost = (0,external_wp_element_namespaceObject.useMemo)(() => { return { type: initialPostType, id: initialPostId }; }, [initialPostType, initialPostId]); const backButton = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium') && isFullscreenActive ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(back_button, { initialPost: initialPost }) : null; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SlotFillProvider, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_editor_namespaceObject.ErrorBoundary, { canCopyContent: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_commands_namespaceObject.CommandMenu, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WelcomeGuide, { postType: currentPostType }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: navigateRegionsProps.className, ...navigateRegionsProps, ref: navigateRegionsProps.ref, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Editor, { settings: editorSettings, initialEdits: initialEdits, postType: currentPostType, postId: currentPostId, templateId: templateId, className: className, styles: styles, forceIsDirty: hasActiveMetaboxes, contentRef: paddingAppenderRef, disableIframe: !shouldIframe // We should auto-focus the canvas (title) on load. // eslint-disable-next-line jsx-a11y/no-autofocus , autoFocus: !isWelcomeGuideVisible, onActionPerformed: onActionPerformed, extraSidebarPanels: showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxes, { location: "side" }), extraContent: !isDistractionFree && showMetaBoxes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MetaBoxesMain, { isLegacy: !shouldIframe || isDevicePreview }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PostLockedModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditorInitialization, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FullscreenMode, { isActive: isFullscreenActive }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(browser_url, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.UnsavedChangesWarning, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.AutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.LocalAutosaveMonitor, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorKeyboardShortcutsRegister, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockKeyboardShortcuts, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InitPatternModal, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_plugins_namespaceObject.PluginArea, { onError: onPluginAreaError }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(more_menu, {}), backButton, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {})] }) })] }) }); } /* harmony default export */ const layout = (Layout); ;// ./node_modules/@wordpress/edit-post/build-module/deprecated.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PluginPostExcerpt } = unlock(external_wp_editor_namespaceObject.privateApis); const isSiteEditor = (0,external_wp_url_namespaceObject.getPath)(window.location.href)?.includes('site-editor.php'); const deprecateSlot = name => { external_wp_deprecated_default()(`wp.editPost.${name}`, { since: '6.6', alternative: `wp.editor.${name}` }); }; /* eslint-disable jsdoc/require-param */ /** * @see PluginBlockSettingsMenuItem in @wordpress/editor package. */ function PluginBlockSettingsMenuItem(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginBlockSettingsMenuItem'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginBlockSettingsMenuItem, { ...props }); } /** * @see PluginDocumentSettingPanel in @wordpress/editor package. */ function PluginDocumentSettingPanel(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginDocumentSettingPanel'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginDocumentSettingPanel, { ...props }); } /** * @see PluginMoreMenuItem in @wordpress/editor package. */ function PluginMoreMenuItem(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginMoreMenuItem'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginMoreMenuItem, { ...props }); } /** * @see PluginPrePublishPanel in @wordpress/editor package. */ function PluginPrePublishPanel(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginPrePublishPanel'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginPrePublishPanel, { ...props }); } /** * @see PluginPostPublishPanel in @wordpress/editor package. */ function PluginPostPublishPanel(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginPostPublishPanel'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginPostPublishPanel, { ...props }); } /** * @see PluginPostStatusInfo in @wordpress/editor package. */ function PluginPostStatusInfo(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginPostStatusInfo'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginPostStatusInfo, { ...props }); } /** * @see PluginSidebar in @wordpress/editor package. */ function PluginSidebar(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginSidebar'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginSidebar, { ...props }); } /** * @see PluginSidebarMoreMenuItem in @wordpress/editor package. */ function PluginSidebarMoreMenuItem(props) { if (isSiteEditor) { return null; } deprecateSlot('PluginSidebarMoreMenuItem'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.PluginSidebarMoreMenuItem, { ...props }); } /** * @see PluginPostExcerpt in @wordpress/editor package. */ function __experimentalPluginPostExcerpt() { if (isSiteEditor) { return null; } external_wp_deprecated_default()('wp.editPost.__experimentalPluginPostExcerpt', { since: '6.6', hint: 'Core and custom panels can be access programmatically using their panel name.', link: 'https://developer.wordpress.org/block-editor/reference-guides/slotfills/plugin-document-setting-panel/#accessing-a-panel-programmatically' }); return PluginPostExcerpt; } /* eslint-enable jsdoc/require-param */ ;// ./node_modules/@wordpress/edit-post/build-module/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { BackButton: __experimentalMainDashboardButton, registerCoreBlockBindingsSources } = unlock(external_wp_editor_namespaceObject.privateApis); /** * Initializes and returns an instance of Editor. * * @param {string} id Unique identifier for editor instance. * @param {string} postType Post type of the post to edit. * @param {Object} postId ID of the post to edit. * @param {?Object} settings Editor settings object. * @param {Object} initialEdits Programmatic edits to apply initially, to be * considered as non-user-initiated (bypass for * unsaved changes prompt). */ function initializeEditor(id, postType, postId, settings, initialEdits) { const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches; const target = document.getElementById(id); const root = (0,external_wp_element_namespaceObject.createRoot)(target); (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/edit-post', { fullscreenMode: true, themeStyles: true, welcomeGuide: true, welcomeGuideTemplate: true }); (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core', { allowRightClickOverrides: true, editorMode: 'visual', editorTool: 'edit', fixedToolbar: false, hiddenBlockTypes: [], inactivePanels: [], openPanels: ['post-status'], showBlockBreadcrumbs: true, showIconLabels: false, showListViewByDefault: false, enableChoosePatternModal: true, isPublishSidebarEnabled: true }); if (window.__experimentalMediaProcessing) { (0,external_wp_data_namespaceObject.dispatch)(external_wp_preferences_namespaceObject.store).setDefaults('core/media', { requireApproval: true, optimizeOnUpload: true }); } (0,external_wp_data_namespaceObject.dispatch)(external_wp_blocks_namespaceObject.store).reapplyBlockTypeFilters(); // Check if the block list view should be open by default. // If `distractionFree` mode is enabled, the block list view should not be open. // This behavior is disabled for small viewports. if (isMediumOrBigger && (0,external_wp_data_namespaceObject.select)(external_wp_preferences_namespaceObject.store).get('core', 'showListViewByDefault') && !(0,external_wp_data_namespaceObject.select)(external_wp_preferences_namespaceObject.store).get('core', 'distractionFree')) { (0,external_wp_data_namespaceObject.dispatch)(external_wp_editor_namespaceObject.store).setIsListViewOpened(true); } (0,external_wp_blockLibrary_namespaceObject.registerCoreBlocks)(); registerCoreBlockBindingsSources(); (0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)({ inserter: false }); (0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)({ inserter: false }); if (false) {} // Show a console log warning if the browser is not in Standards rendering mode. const documentMode = document.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks'; if (documentMode !== 'Standards') { // eslint-disable-next-line no-console console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins."); } // This is a temporary fix for a couple of issues specific to Webkit on iOS. // Without this hack the browser scrolls the mobile toolbar off-screen. // Once supported in Safari we can replace this in favor of preventScroll. // For details see issue #18632 and PR #18686 // Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar. // But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar. const isIphone = window.navigator.userAgent.indexOf('iPhone') !== -1; if (isIphone) { window.addEventListener('scroll', event => { const editorScrollContainer = document.getElementsByClassName('interface-interface-skeleton__body')[0]; if (event.target === document) { // Scroll element into view by scrolling the editor container by the same amount // that Mobile Safari tried to scroll the html element upwards. if (window.scrollY > 100) { editorScrollContainer.scrollTop = editorScrollContainer.scrollTop + window.scrollY; } // Undo unwanted scroll on html element, but only in the visual editor. if (document.getElementsByClassName('is-mode-visual')[0]) { window.scrollTo(0, 0); } } }); } // Prevent the default browser action for files dropped outside of dropzones. window.addEventListener('dragover', e => e.preventDefault(), false); window.addEventListener('drop', e => e.preventDefault(), false); root.render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.StrictMode, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layout, { settings: settings, postId: postId, postType: postType, initialEdits: initialEdits }) })); return root; } /** * Used to reinitialize the editor after an error. Now it's a deprecated noop function. */ function reinitializeEditor() { external_wp_deprecated_default()('wp.editPost.reinitializeEditor', { since: '6.2', version: '6.3' }); } (window.wp = window.wp || {}).editPost = __webpack_exports__; /******/ })() ; redux-routine.min.js 0000644 00000021271 15013651111 0010473 0 ustar 00 /*! This file is auto-generated */ (()=>{"use strict";var r={3304:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.cps=e.call=void 0;var n,u=t(6921),o=(n=u)&&n.__esModule?n:{default:n};var a=e.call=function(r,e,t,n,u){if(!o.default.call(r))return!1;try{e(r.func.apply(r.context,r.args))}catch(r){u(r)}return!0},c=e.cps=function(r,e,t,n,u){var a;return!!o.default.cps(r)&&((a=r.func).call.apply(a,[null].concat(function(r){if(Array.isArray(r)){for(var e=0,t=Array(r.length);e<r.length;e++)t[e]=r[e];return t}return Array.from(r)}(r.args),[function(r,t){r?u(r):e(t)}])),!0)};e.default=[a,c]},3524:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createChannel=e.subscribe=e.cps=e.apply=e.call=e.invoke=e.delay=e.race=e.join=e.fork=e.error=e.all=void 0;var n,u=t(4137),o=(n=u)&&n.__esModule?n:{default:n};e.all=function(r){return{type:o.default.all,value:r}},e.error=function(r){return{type:o.default.error,error:r}},e.fork=function(r){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return{type:o.default.fork,iterator:r,args:t}},e.join=function(r){return{type:o.default.join,task:r}},e.race=function(r){return{type:o.default.race,competitors:r}},e.delay=function(r){return new Promise((function(e){setTimeout((function(){return e(!0)}),r)}))},e.invoke=function(r){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return{type:o.default.call,func:r,context:null,args:t}},e.call=function(r,e){for(var t=arguments.length,n=Array(t>2?t-2:0),u=2;u<t;u++)n[u-2]=arguments[u];return{type:o.default.call,func:r,context:e,args:n}},e.apply=function(r,e,t){return{type:o.default.call,func:r,context:e,args:t}},e.cps=function(r){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return{type:o.default.cps,func:r,args:t}},e.subscribe=function(r){return{type:o.default.subscribe,channel:r}},e.createChannel=function(r){var e=[];return r((function(r){return e.forEach((function(e){return e(r)}))})),{subscribe:function(r){return e.push(r),function(){return e.splice(e.indexOf(r),1)}}}}},4137:(r,e)=>{Object.defineProperty(e,"__esModule",{value:!0});var t={all:Symbol("all"),error:Symbol("error"),fork:Symbol("fork"),join:Symbol("join"),race:Symbol("race"),call:Symbol("call"),cps:Symbol("cps"),subscribe:Symbol("subscribe")};e.default=t},5136:(r,e)=>{Object.defineProperty(e,"__esModule",{value:!0});e.default=function(){var r=[];return{subscribe:function(e){return r.push(e),function(){r=r.filter((function(r){return r!==e}))}},dispatch:function(e){r.slice().forEach((function(r){return r(e)}))}}}},5357:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.iterator=e.array=e.object=e.error=e.any=void 0;var n,u=t(6921),o=(n=u)&&n.__esModule?n:{default:n};var a=e.any=function(r,e,t,n){return n(r),!0},c=e.error=function(r,e,t,n,u){return!!o.default.error(r)&&(u(r.error),!0)},f=e.object=function(r,e,t,n,u){if(!o.default.all(r)||!o.default.obj(r.value))return!1;var a={},c=Object.keys(r.value),f=0,i=!1;return c.map((function(e){t(r.value[e],(function(r){return function(r,e){i||(a[r]=e,++f===c.length&&n(a))}(e,r)}),(function(r){return function(r,e){i||(i=!0,u(e))}(0,r)}))})),!0},i=e.array=function(r,e,t,n,u){if(!o.default.all(r)||!o.default.array(r.value))return!1;var a=[],c=0,f=!1;return r.value.map((function(e,o){t(e,(function(e){return function(e,t){f||(a[e]=t,++c===r.value.length&&n(a))}(o,e)}),(function(r){return function(r,e){f||(f=!0,u(e))}(0,r)}))})),!0},l=e.iterator=function(r,e,t,n,u){return!!o.default.iterator(r)&&(t(r,e,u),!0)};e.default=[c,l,i,f,a]},6910:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.race=e.join=e.fork=e.promise=void 0;var n=a(t(6921)),u=t(3524),o=a(t(5136));function a(r){return r&&r.__esModule?r:{default:r}}var c=e.promise=function(r,e,t,u,o){return!!n.default.promise(r)&&(r.then(e,o),!0)},f=new Map,i=e.fork=function(r,e,t){if(!n.default.fork(r))return!1;var a=Symbol("fork"),c=(0,o.default)();f.set(a,c),t(r.iterator.apply(null,r.args),(function(r){return c.dispatch(r)}),(function(r){return c.dispatch((0,u.error)(r))}));var i=c.subscribe((function(){i(),f.delete(a)}));return e(a),!0},l=e.join=function(r,e,t,u,o){if(!n.default.join(r))return!1;var a,c=f.get(r.task);return c?a=c.subscribe((function(r){a(),e(r)})):o("join error : task not found"),!0},s=e.race=function(r,e,t,u,o){if(!n.default.race(r))return!1;var a,c=!1,f=function(r,t,n){c||(c=!0,r[t]=n,e(r))},i=function(r){c||o(r)};return n.default.array(r.competitors)?(a=r.competitors.map((function(){return!1})),r.competitors.forEach((function(r,e){t(r,(function(r){return f(a,e,r)}),i)}))):function(){var e=Object.keys(r.competitors).reduce((function(r,e){return r[e]=!1,r}),{});Object.keys(r.competitors).forEach((function(n){t(r.competitors[n],(function(r){return f(e,n,r)}),i)}))}(),!0};e.default=[c,i,l,s,function(r,e){if(!n.default.subscribe(r))return!1;if(!n.default.channel(r.channel))throw new Error('the first argument of "subscribe" must be a valid channel');var t=r.channel.subscribe((function(r){t&&t(),e(r)}));return!0}]},6921:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n,u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol?"symbol":typeof r},o=t(4137),a=(n=o)&&n.__esModule?n:{default:n};var c={obj:function(r){return"object"===(void 0===r?"undefined":u(r))&&!!r},all:function(r){return c.obj(r)&&r.type===a.default.all},error:function(r){return c.obj(r)&&r.type===a.default.error},array:Array.isArray,func:function(r){return"function"==typeof r},promise:function(r){return r&&c.func(r.then)},iterator:function(r){return r&&c.func(r.next)&&c.func(r.throw)},fork:function(r){return c.obj(r)&&r.type===a.default.fork},join:function(r){return c.obj(r)&&r.type===a.default.join},race:function(r){return c.obj(r)&&r.type===a.default.race},call:function(r){return c.obj(r)&&r.type===a.default.call},cps:function(r){return c.obj(r)&&r.type===a.default.cps},subscribe:function(r){return c.obj(r)&&r.type===a.default.subscribe},channel:function(r){return c.obj(r)&&c.func(r.subscribe)}};e.default=c},8975:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.wrapControls=e.asyncControls=e.create=void 0;var n=t(3524);Object.keys(n).forEach((function(r){"default"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return n[r]}})}));var u=c(t(9127)),o=c(t(6910)),a=c(t(3304));function c(r){return r&&r.__esModule?r:{default:r}}e.create=u.default,e.asyncControls=o.default,e.wrapControls=a.default},9127:(r,e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=o(t(5357)),u=o(t(6921));function o(r){return r&&r.__esModule?r:{default:r}}function a(r){if(Array.isArray(r)){for(var e=0,t=Array(r.length);e<r.length;e++)t[e]=r[e];return t}return Array.from(r)}e.default=function(){var r=[].concat(a(arguments.length<=0||void 0===arguments[0]?[]:arguments[0]),a(n.default));return function e(t){var n,o,a,c=arguments.length<=1||void 0===arguments[1]?function(){}:arguments[1],f=arguments.length<=2||void 0===arguments[2]?function(){}:arguments[2],i=u.default.iterator(t)?t:regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t;case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r,this)}))();n=i,o=function(r){return function(e){try{var t=r?n.throw(e):n.next(e),u=t.value;if(t.done)return c(u);a(u)}catch(r){return f(r)}}},a=function t(n){r.some((function(r){return r(n,t,e,o(!1),o(!0))}))},o(!1)()}}}},e={};function t(n){var u=e[n];if(void 0!==u)return u.exports;var o=e[n]={exports:{}};return r[n](o,o.exports,t),o.exports}t.d=(r,e)=>{for(var n in e)t.o(e,n)&&!t.o(r,n)&&Object.defineProperty(r,n,{enumerable:!0,get:e[n]})},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e);var n={};t.d(n,{default:()=>f});var u=t(8975); /*! * is-plain-object <https://github.com/jonschlinkert/is-plain-object> * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ function o(r){return"[object Object]"===Object.prototype.toString.call(r)}function a(r){return!1!==o(e=r)&&(void 0===(t=e.constructor)||!1!==o(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))&&"string"==typeof r.type;var e,t,n}function c(r={},e){const t=Object.entries(r).map((([r,e])=>(t,n,u,o,c)=>{if(i=r,!a(f=t)||f.type!==i)return!1;var f,i;const l=e(t);var s;return!(s=l)||"object"!=typeof s&&"function"!=typeof s||"function"!=typeof s.then?o(l):l.then(o,c),!0}));t.push(((r,t)=>!!a(r)&&(e(r),t(),!0)));const n=(0,u.create)(t);return r=>new Promise(((t,u)=>n(r,(r=>{a(r)&&e(r),t(r)}),u)))}function f(r={}){return e=>{const t=c(r,e.dispatch);return r=>e=>{return(n=e)&&"function"==typeof n[Symbol.iterator]&&"function"==typeof n.next?t(e):r(e);var n}}}(window.wp=window.wp||{}).reduxRoutine=n.default})(); keyboard-shortcuts.js 0000644 00000057637 15013651111 0010752 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { ShortcutProvider: () => (/* reexport */ ShortcutProvider), __unstableUseShortcutEventMatch: () => (/* reexport */ useShortcutEventMatch), store: () => (/* reexport */ store), useShortcut: () => (/* reexport */ useShortcut) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); __webpack_require__.d(actions_namespaceObject, { registerShortcut: () => (registerShortcut), unregisterShortcut: () => (unregisterShortcut) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); __webpack_require__.d(selectors_namespaceObject, { getAllShortcutKeyCombinations: () => (getAllShortcutKeyCombinations), getAllShortcutRawKeyCombinations: () => (getAllShortcutRawKeyCombinations), getCategoryShortcuts: () => (getCategoryShortcuts), getShortcutAliases: () => (getShortcutAliases), getShortcutDescription: () => (getShortcutDescription), getShortcutKeyCombination: () => (getShortcutKeyCombination), getShortcutRepresentation: () => (getShortcutRepresentation) }); ;// external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/reducer.js /** * Reducer returning the registered shortcuts * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ function reducer(state = {}, action) { switch (action.type) { case 'REGISTER_SHORTCUT': return { ...state, [action.name]: { category: action.category, keyCombination: action.keyCombination, aliases: action.aliases, description: action.description } }; case 'UNREGISTER_SHORTCUT': const { [action.name]: actionName, ...remainingState } = state; return remainingState; } return state; } /* harmony default export */ const store_reducer = (reducer); ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/actions.js /** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */ /** * Keyboard key combination. * * @typedef {Object} WPShortcutKeyCombination * * @property {string} character Character. * @property {WPKeycodeModifier|undefined} modifier Modifier. */ /** * Configuration of a registered keyboard shortcut. * * @typedef {Object} WPShortcutConfig * * @property {string} name Shortcut name. * @property {string} category Shortcut category. * @property {string} description Shortcut description. * @property {WPShortcutKeyCombination} keyCombination Shortcut key combination. * @property {WPShortcutKeyCombination[]} [aliases] Shortcut aliases. */ /** * Returns an action object used to register a new keyboard shortcut. * * @param {WPShortcutConfig} config Shortcut config. * * @example * *```js * import { useEffect } from 'react'; * import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts'; * import { useSelect, useDispatch } from '@wordpress/data'; * import { __ } from '@wordpress/i18n'; * * const ExampleComponent = () => { * const { registerShortcut } = useDispatch( keyboardShortcutsStore ); * * useEffect( () => { * registerShortcut( { * name: 'custom/my-custom-shortcut', * category: 'my-category', * description: __( 'My custom shortcut' ), * keyCombination: { * modifier: 'primary', * character: 'j', * }, * } ); * }, [] ); * * const shortcut = useSelect( * ( select ) => * select( keyboardShortcutsStore ).getShortcutKeyCombination( * 'custom/my-custom-shortcut' * ), * [] * ); * * return shortcut ? ( * <p>{ __( 'Shortcut is registered.' ) }</p> * ) : ( * <p>{ __( 'Shortcut is not registered.' ) }</p> * ); * }; *``` * @return {Object} action. */ function registerShortcut({ name, category, description, keyCombination, aliases }) { return { type: 'REGISTER_SHORTCUT', name, category, keyCombination, aliases, description }; } /** * Returns an action object used to unregister a keyboard shortcut. * * @param {string} name Shortcut name. * * @example * *```js * import { useEffect } from 'react'; * import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts'; * import { useSelect, useDispatch } from '@wordpress/data'; * import { __ } from '@wordpress/i18n'; * * const ExampleComponent = () => { * const { unregisterShortcut } = useDispatch( keyboardShortcutsStore ); * * useEffect( () => { * unregisterShortcut( 'core/editor/next-region' ); * }, [] ); * * const shortcut = useSelect( * ( select ) => * select( keyboardShortcutsStore ).getShortcutKeyCombination( * 'core/editor/next-region' * ), * [] * ); * * return shortcut ? ( * <p>{ __( 'Shortcut is not unregistered.' ) }</p> * ) : ( * <p>{ __( 'Shortcut is unregistered.' ) }</p> * ); * }; *``` * @return {Object} action. */ function unregisterShortcut(name) { return { type: 'UNREGISTER_SHORTCUT', name }; } ;// external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js /** * WordPress dependencies */ /** @typedef {import('./actions').WPShortcutKeyCombination} WPShortcutKeyCombination */ /** @typedef {import('@wordpress/keycodes').WPKeycodeHandlerByModifier} WPKeycodeHandlerByModifier */ /** * Shared reference to an empty array for cases where it is important to avoid * returning a new array reference on every invocation. * * @type {Array<any>} */ const EMPTY_ARRAY = []; /** * Shortcut formatting methods. * * @property {WPKeycodeHandlerByModifier} display Display formatting. * @property {WPKeycodeHandlerByModifier} rawShortcut Raw shortcut formatting. * @property {WPKeycodeHandlerByModifier} ariaLabel ARIA label formatting. */ const FORMATTING_METHODS = { display: external_wp_keycodes_namespaceObject.displayShortcut, raw: external_wp_keycodes_namespaceObject.rawShortcut, ariaLabel: external_wp_keycodes_namespaceObject.shortcutAriaLabel }; /** * Returns a string representing the key combination. * * @param {?WPShortcutKeyCombination} shortcut Key combination. * @param {keyof FORMATTING_METHODS} representation Type of representation * (display, raw, ariaLabel). * * @return {?string} Shortcut representation. */ function getKeyCombinationRepresentation(shortcut, representation) { if (!shortcut) { return null; } return shortcut.modifier ? FORMATTING_METHODS[representation][shortcut.modifier](shortcut.character) : shortcut.character; } /** * Returns the main key combination for a given shortcut name. * * @param {Object} state Global state. * @param {string} name Shortcut name. * * @example * *```js * import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts'; * import { useSelect } from '@wordpress/data'; * import { createInterpolateElement } from '@wordpress/element'; * import { sprintf } from '@wordpress/i18n'; * const ExampleComponent = () => { * const {character, modifier} = useSelect( * ( select ) => * select( keyboardShortcutsStore ).getShortcutKeyCombination( * 'core/editor/next-region' * ), * [] * ); * * return ( * <div> * { createInterpolateElement( * sprintf( * 'Character: <code>%s</code> / Modifier: <code>%s</code>', * character, * modifier * ), * { * code: <code />, * } * ) } * </div> * ); * }; *``` * * @return {WPShortcutKeyCombination?} Key combination. */ function getShortcutKeyCombination(state, name) { return state[name] ? state[name].keyCombination : null; } /** * Returns a string representing the main key combination for a given shortcut name. * * @param {Object} state Global state. * @param {string} name Shortcut name. * @param {keyof FORMATTING_METHODS} representation Type of representation * (display, raw, ariaLabel). * @example * *```js * import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts'; * import { useSelect } from '@wordpress/data'; * import { sprintf } from '@wordpress/i18n'; * * const ExampleComponent = () => { * const {display, raw, ariaLabel} = useSelect( * ( select ) =>{ * return { * display: select( keyboardShortcutsStore ).getShortcutRepresentation('core/editor/next-region' ), * raw: select( keyboardShortcutsStore ).getShortcutRepresentation('core/editor/next-region','raw' ), * ariaLabel: select( keyboardShortcutsStore ).getShortcutRepresentation('core/editor/next-region', 'ariaLabel') * } * }, * [] * ); * * return ( * <ul> * <li>{ sprintf( 'display string: %s', display ) }</li> * <li>{ sprintf( 'raw string: %s', raw ) }</li> * <li>{ sprintf( 'ariaLabel string: %s', ariaLabel ) }</li> * </ul> * ); * }; *``` * * @return {?string} Shortcut representation. */ function getShortcutRepresentation(state, name, representation = 'display') { const shortcut = getShortcutKeyCombination(state, name); return getKeyCombinationRepresentation(shortcut, representation); } /** * Returns the shortcut description given its name. * * @param {Object} state Global state. * @param {string} name Shortcut name. * * @example * *```js * import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts'; * import { useSelect } from '@wordpress/data'; * import { __ } from '@wordpress/i18n'; * const ExampleComponent = () => { * const shortcutDescription = useSelect( * ( select ) => * select( keyboardShortcutsStore ).getShortcutDescription( 'core/editor/next-region' ), * [] * ); * * return shortcutDescription ? ( * <div>{ shortcutDescription }</div> * ) : ( * <div>{ __( 'No description.' ) }</div> * ); * }; *``` * @return {?string} Shortcut description. */ function getShortcutDescription(state, name) { return state[name] ? state[name].description : null; } /** * Returns the aliases for a given shortcut name. * * @param {Object} state Global state. * @param {string} name Shortcut name. * @example * *```js * import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts'; * import { useSelect } from '@wordpress/data'; * import { createInterpolateElement } from '@wordpress/element'; * import { sprintf } from '@wordpress/i18n'; * const ExampleComponent = () => { * const shortcutAliases = useSelect( * ( select ) => * select( keyboardShortcutsStore ).getShortcutAliases( * 'core/editor/next-region' * ), * [] * ); * * return ( * shortcutAliases.length > 0 && ( * <ul> * { shortcutAliases.map( ( { character, modifier }, index ) => ( * <li key={ index }> * { createInterpolateElement( * sprintf( * 'Character: <code>%s</code> / Modifier: <code>%s</code>', * character, * modifier * ), * { * code: <code />, * } * ) } * </li> * ) ) } * </ul> * ) * ); * }; *``` * * @return {WPShortcutKeyCombination[]} Key combinations. */ function getShortcutAliases(state, name) { return state[name] && state[name].aliases ? state[name].aliases : EMPTY_ARRAY; } /** * Returns the shortcuts that include aliases for a given shortcut name. * * @param {Object} state Global state. * @param {string} name Shortcut name. * @example * *```js * import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts'; * import { useSelect } from '@wordpress/data'; * import { createInterpolateElement } from '@wordpress/element'; * import { sprintf } from '@wordpress/i18n'; * * const ExampleComponent = () => { * const allShortcutKeyCombinations = useSelect( * ( select ) => * select( keyboardShortcutsStore ).getAllShortcutKeyCombinations( * 'core/editor/next-region' * ), * [] * ); * * return ( * allShortcutKeyCombinations.length > 0 && ( * <ul> * { allShortcutKeyCombinations.map( * ( { character, modifier }, index ) => ( * <li key={ index }> * { createInterpolateElement( * sprintf( * 'Character: <code>%s</code> / Modifier: <code>%s</code>', * character, * modifier * ), * { * code: <code />, * } * ) } * </li> * ) * ) } * </ul> * ) * ); * }; *``` * * @return {WPShortcutKeyCombination[]} Key combinations. */ const getAllShortcutKeyCombinations = (0,external_wp_data_namespaceObject.createSelector)((state, name) => { return [getShortcutKeyCombination(state, name), ...getShortcutAliases(state, name)].filter(Boolean); }, (state, name) => [state[name]]); /** * Returns the raw representation of all the keyboard combinations of a given shortcut name. * * @param {Object} state Global state. * @param {string} name Shortcut name. * * @example * *```js * import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts'; * import { useSelect } from '@wordpress/data'; * import { createInterpolateElement } from '@wordpress/element'; * import { sprintf } from '@wordpress/i18n'; * * const ExampleComponent = () => { * const allShortcutRawKeyCombinations = useSelect( * ( select ) => * select( keyboardShortcutsStore ).getAllShortcutRawKeyCombinations( * 'core/editor/next-region' * ), * [] * ); * * return ( * allShortcutRawKeyCombinations.length > 0 && ( * <ul> * { allShortcutRawKeyCombinations.map( * ( shortcutRawKeyCombination, index ) => ( * <li key={ index }> * { createInterpolateElement( * sprintf( * ' <code>%s</code>', * shortcutRawKeyCombination * ), * { * code: <code />, * } * ) } * </li> * ) * ) } * </ul> * ) * ); * }; *``` * * @return {string[]} Shortcuts. */ const getAllShortcutRawKeyCombinations = (0,external_wp_data_namespaceObject.createSelector)((state, name) => { return getAllShortcutKeyCombinations(state, name).map(combination => getKeyCombinationRepresentation(combination, 'raw')); }, (state, name) => [state[name]]); /** * Returns the shortcut names list for a given category name. * * @param {Object} state Global state. * @param {string} name Category name. * @example * *```js * import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts'; * import { useSelect } from '@wordpress/data'; * * const ExampleComponent = () => { * const categoryShortcuts = useSelect( * ( select ) => * select( keyboardShortcutsStore ).getCategoryShortcuts( * 'block' * ), * [] * ); * * return ( * categoryShortcuts.length > 0 && ( * <ul> * { categoryShortcuts.map( ( categoryShortcut ) => ( * <li key={ categoryShortcut }>{ categoryShortcut }</li> * ) ) } * </ul> * ) * ); * }; *``` * @return {string[]} Shortcut names. */ const getCategoryShortcuts = (0,external_wp_data_namespaceObject.createSelector)((state, categoryName) => { return Object.entries(state).filter(([, shortcut]) => shortcut.category === categoryName).map(([name]) => name); }, state => [state]); ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const STORE_NAME = 'core/keyboard-shortcuts'; /** * Store definition for the keyboard shortcuts namespace. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { reducer: store_reducer, actions: actions_namespaceObject, selectors: selectors_namespaceObject }); (0,external_wp_data_namespaceObject.register)(store); ;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut-event-match.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns a function to check if a keyboard event matches a shortcut name. * * @return {Function} A function to check if a keyboard event matches a * predefined shortcut combination. */ function useShortcutEventMatch() { const { getAllShortcutKeyCombinations } = (0,external_wp_data_namespaceObject.useSelect)(store); /** * A function to check if a keyboard event matches a predefined shortcut * combination. * * @param {string} name Shortcut name. * @param {KeyboardEvent} event Event to check. * * @return {boolean} True if the event matches any shortcuts, false if not. */ function isMatch(name, event) { return getAllShortcutKeyCombinations(name).some(({ modifier, character }) => { return external_wp_keycodes_namespaceObject.isKeyboardEvent[modifier](event, character); }); } return isMatch; } ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/context.js /** * WordPress dependencies */ const globalShortcuts = new Set(); const globalListener = event => { for (const keyboardShortcut of globalShortcuts) { keyboardShortcut(event); } }; const context = (0,external_wp_element_namespaceObject.createContext)({ add: shortcut => { if (globalShortcuts.size === 0) { document.addEventListener('keydown', globalListener); } globalShortcuts.add(shortcut); }, delete: shortcut => { globalShortcuts.delete(shortcut); if (globalShortcuts.size === 0) { document.removeEventListener('keydown', globalListener); } } }); ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Attach a keyboard shortcut handler. * * @param {string} name Shortcut name. * @param {Function} callback Shortcut callback. * @param {Object} options Shortcut options. * @param {boolean} options.isDisabled Whether to disable to shortut. */ function useShortcut(name, callback, { isDisabled = false } = {}) { const shortcuts = (0,external_wp_element_namespaceObject.useContext)(context); const isMatch = useShortcutEventMatch(); const callbackRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { callbackRef.current = callback; }, [callback]); (0,external_wp_element_namespaceObject.useEffect)(() => { if (isDisabled) { return; } function _callback(event) { if (isMatch(name, event)) { callbackRef.current(event); } } shortcuts.add(_callback); return () => { shortcuts.delete(_callback); }; }, [name, isDisabled, shortcuts]); } ;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/components/shortcut-provider.js /** * WordPress dependencies */ /** * Internal dependencies */ const { Provider } = context; /** * Handles callbacks added to context by `useShortcut`. * Adding a provider allows to register contextual shortcuts * that are only active when a certain part of the UI is focused. * * @param {Object} props Props to pass to `div`. * * @return {Element} Component. */ function ShortcutProvider(props) { const [keyboardShortcuts] = (0,external_wp_element_namespaceObject.useState)(() => new Set()); function onKeyDown(event) { if (props.onKeyDown) { props.onKeyDown(event); } for (const keyboardShortcut of keyboardShortcuts) { keyboardShortcut(event); } } /* eslint-disable jsx-a11y/no-static-element-interactions */ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, { value: keyboardShortcuts, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...props, onKeyDown: onKeyDown }) }); /* eslint-enable jsx-a11y/no-static-element-interactions */ } ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/index.js (window.wp = window.wp || {}).keyboardShortcuts = __webpack_exports__; /******/ })() ; vendor/wp-polyfill-node-contains.min.js 0000644 00000000534 15013651111 0014172 0 ustar 00 (()=>{function e(e){if(!(0 in arguments))throw new TypeError("1 argument is required");do{if(this===e)return!0}while(e=e&&e.parentNode);return!1}if("HTMLElement"in self&&"contains"in HTMLElement.prototype)try{delete HTMLElement.prototype.contains}catch(e){}"Node"in self?Node.prototype.contains=e:document.contains=Element.prototype.contains=e})(); vendor/wp-polyfill-element-closest.min.js 0000644 00000000651 15013651111 0014534 0 ustar 00 !function(){var e=window.Element.prototype;"function"!=typeof e.matches&&(e.matches=e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=0;t[o]&&t[o]!==this;)++o;return Boolean(t[o])}),"function"!=typeof e.closest&&(e.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(); vendor/react-jsx-runtime.min.js.LICENSE.txt 0000644 00000000371 15013651111 0014434 0 ustar 00 /** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ vendor/react-jsx-runtime.js 0000644 00000134254 15013651111 0011763 0 ustar 00 /* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ "./node_modules/react/cjs/react-jsx-runtime.development.js": /*!*****************************************************************!*\ !*** ./node_modules/react/cjs/react-jsx-runtime.development.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { eval("/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n'use strict';\n\nvar React = __webpack_require__(/*! react */ \"react\");\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/react/cjs/react-jsx-runtime.development.js?"); /***/ }), /***/ "./node_modules/react/jsx-runtime.js": /*!*******************************************!*\ !*** ./node_modules/react/jsx-runtime.js ***! \*******************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react-jsx-runtime.development.js */ \"./node_modules/react/cjs/react-jsx-runtime.development.js\");\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/react/jsx-runtime.js?"); /***/ }), /***/ "react": /*!************************!*\ !*** external "React" ***! \************************/ /***/ ((module) => { module.exports = React; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module can't be inlined because the eval devtool is used. /******/ var __webpack_exports__ = __webpack_require__("./node_modules/react/jsx-runtime.js"); /******/ window.ReactJSXRuntime = __webpack_exports__; /******/ /******/ })() ; vendor/wp-polyfill-fetch.js 0000644 00000046547 15013651111 0011756 0 ustar 00 (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (factory((global.WHATWGFetch = {}))); }(this, (function (exports) { 'use strict'; /* eslint-disable no-prototype-builtins */ var g = (typeof globalThis !== 'undefined' && globalThis) || (typeof self !== 'undefined' && self) || // eslint-disable-next-line no-undef (typeof global !== 'undefined' && global) || {}; var support = { searchParams: 'URLSearchParams' in g, iterable: 'Symbol' in g && 'iterator' in Symbol, blob: 'FileReader' in g && 'Blob' in g && (function() { try { new Blob(); return true } catch (e) { return false } })(), formData: 'FormData' in g, arrayBuffer: 'ArrayBuffer' in g }; function isDataView(obj) { return obj && DataView.prototype.isPrototypeOf(obj) } if (support.arrayBuffer) { var viewClasses = [ '[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]' ]; var isArrayBufferView = ArrayBuffer.isView || function(obj) { return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1 }; } function normalizeName(name) { if (typeof name !== 'string') { name = String(name); } if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') { throw new TypeError('Invalid character in header field name: "' + name + '"') } return name.toLowerCase() } function normalizeValue(value) { if (typeof value !== 'string') { value = String(value); } return value } // Build a destructive iterator for the value list function iteratorFor(items) { var iterator = { next: function() { var value = items.shift(); return {done: value === undefined, value: value} } }; if (support.iterable) { iterator[Symbol.iterator] = function() { return iterator }; } return iterator } function Headers(headers) { this.map = {}; if (headers instanceof Headers) { headers.forEach(function(value, name) { this.append(name, value); }, this); } else if (Array.isArray(headers)) { headers.forEach(function(header) { if (header.length != 2) { throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length) } this.append(header[0], header[1]); }, this); } else if (headers) { Object.getOwnPropertyNames(headers).forEach(function(name) { this.append(name, headers[name]); }, this); } } Headers.prototype.append = function(name, value) { name = normalizeName(name); value = normalizeValue(value); var oldValue = this.map[name]; this.map[name] = oldValue ? oldValue + ', ' + value : value; }; Headers.prototype['delete'] = function(name) { delete this.map[normalizeName(name)]; }; Headers.prototype.get = function(name) { name = normalizeName(name); return this.has(name) ? this.map[name] : null }; Headers.prototype.has = function(name) { return this.map.hasOwnProperty(normalizeName(name)) }; Headers.prototype.set = function(name, value) { this.map[normalizeName(name)] = normalizeValue(value); }; Headers.prototype.forEach = function(callback, thisArg) { for (var name in this.map) { if (this.map.hasOwnProperty(name)) { callback.call(thisArg, this.map[name], name, this); } } }; Headers.prototype.keys = function() { var items = []; this.forEach(function(value, name) { items.push(name); }); return iteratorFor(items) }; Headers.prototype.values = function() { var items = []; this.forEach(function(value) { items.push(value); }); return iteratorFor(items) }; Headers.prototype.entries = function() { var items = []; this.forEach(function(value, name) { items.push([name, value]); }); return iteratorFor(items) }; if (support.iterable) { Headers.prototype[Symbol.iterator] = Headers.prototype.entries; } function consumed(body) { if (body._noBody) return if (body.bodyUsed) { return Promise.reject(new TypeError('Already read')) } body.bodyUsed = true; } function fileReaderReady(reader) { return new Promise(function(resolve, reject) { reader.onload = function() { resolve(reader.result); }; reader.onerror = function() { reject(reader.error); }; }) } function readBlobAsArrayBuffer(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); reader.readAsArrayBuffer(blob); return promise } function readBlobAsText(blob) { var reader = new FileReader(); var promise = fileReaderReady(reader); var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type); var encoding = match ? match[1] : 'utf-8'; reader.readAsText(blob, encoding); return promise } function readArrayBufferAsText(buf) { var view = new Uint8Array(buf); var chars = new Array(view.length); for (var i = 0; i < view.length; i++) { chars[i] = String.fromCharCode(view[i]); } return chars.join('') } function bufferClone(buf) { if (buf.slice) { return buf.slice(0) } else { var view = new Uint8Array(buf.byteLength); view.set(new Uint8Array(buf)); return view.buffer } } function Body() { this.bodyUsed = false; this._initBody = function(body) { /* fetch-mock wraps the Response object in an ES6 Proxy to provide useful test harness features such as flush. However, on ES5 browsers without fetch or Proxy support pollyfills must be used; the proxy-pollyfill is unable to proxy an attribute unless it exists on the object before the Proxy is created. This change ensures Response.bodyUsed exists on the instance, while maintaining the semantic of setting Request.bodyUsed in the constructor before _initBody is called. */ // eslint-disable-next-line no-self-assign this.bodyUsed = this.bodyUsed; this._bodyInit = body; if (!body) { this._noBody = true; this._bodyText = ''; } else if (typeof body === 'string') { this._bodyText = body; } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { this._bodyBlob = body; } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { this._bodyFormData = body; } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this._bodyText = body.toString(); } else if (support.arrayBuffer && support.blob && isDataView(body)) { this._bodyArrayBuffer = bufferClone(body.buffer); // IE 10-11 can't handle a DataView body. this._bodyInit = new Blob([this._bodyArrayBuffer]); } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { this._bodyArrayBuffer = bufferClone(body); } else { this._bodyText = body = Object.prototype.toString.call(body); } if (!this.headers.get('content-type')) { if (typeof body === 'string') { this.headers.set('content-type', 'text/plain;charset=UTF-8'); } else if (this._bodyBlob && this._bodyBlob.type) { this.headers.set('content-type', this._bodyBlob.type); } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); } } }; if (support.blob) { this.blob = function() { var rejected = consumed(this); if (rejected) { return rejected } if (this._bodyBlob) { return Promise.resolve(this._bodyBlob) } else if (this._bodyArrayBuffer) { return Promise.resolve(new Blob([this._bodyArrayBuffer])) } else if (this._bodyFormData) { throw new Error('could not read FormData body as blob') } else { return Promise.resolve(new Blob([this._bodyText])) } }; } this.arrayBuffer = function() { if (this._bodyArrayBuffer) { var isConsumed = consumed(this); if (isConsumed) { return isConsumed } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) { return Promise.resolve( this._bodyArrayBuffer.buffer.slice( this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength ) ) } else { return Promise.resolve(this._bodyArrayBuffer) } } else if (support.blob) { return this.blob().then(readBlobAsArrayBuffer) } else { throw new Error('could not read as ArrayBuffer') } }; this.text = function() { var rejected = consumed(this); if (rejected) { return rejected } if (this._bodyBlob) { return readBlobAsText(this._bodyBlob) } else if (this._bodyArrayBuffer) { return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)) } else if (this._bodyFormData) { throw new Error('could not read FormData body as text') } else { return Promise.resolve(this._bodyText) } }; if (support.formData) { this.formData = function() { return this.text().then(decode) }; } this.json = function() { return this.text().then(JSON.parse) }; return this } // HTTP methods whose capitalization should be normalized var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE']; function normalizeMethod(method) { var upcased = method.toUpperCase(); return methods.indexOf(upcased) > -1 ? upcased : method } function Request(input, options) { if (!(this instanceof Request)) { throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') } options = options || {}; var body = options.body; if (input instanceof Request) { if (input.bodyUsed) { throw new TypeError('Already read') } this.url = input.url; this.credentials = input.credentials; if (!options.headers) { this.headers = new Headers(input.headers); } this.method = input.method; this.mode = input.mode; this.signal = input.signal; if (!body && input._bodyInit != null) { body = input._bodyInit; input.bodyUsed = true; } } else { this.url = String(input); } this.credentials = options.credentials || this.credentials || 'same-origin'; if (options.headers || !this.headers) { this.headers = new Headers(options.headers); } this.method = normalizeMethod(options.method || this.method || 'GET'); this.mode = options.mode || this.mode || null; this.signal = options.signal || this.signal || (function () { if ('AbortController' in g) { var ctrl = new AbortController(); return ctrl.signal; } }()); this.referrer = null; if ((this.method === 'GET' || this.method === 'HEAD') && body) { throw new TypeError('Body not allowed for GET or HEAD requests') } this._initBody(body); if (this.method === 'GET' || this.method === 'HEAD') { if (options.cache === 'no-store' || options.cache === 'no-cache') { // Search for a '_' parameter in the query string var reParamSearch = /([?&])_=[^&]*/; if (reParamSearch.test(this.url)) { // If it already exists then set the value with the current time this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime()); } else { // Otherwise add a new '_' parameter to the end with the current time var reQueryString = /\?/; this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime(); } } } } Request.prototype.clone = function() { return new Request(this, {body: this._bodyInit}) }; function decode(body) { var form = new FormData(); body .trim() .split('&') .forEach(function(bytes) { if (bytes) { var split = bytes.split('='); var name = split.shift().replace(/\+/g, ' '); var value = split.join('=').replace(/\+/g, ' '); form.append(decodeURIComponent(name), decodeURIComponent(value)); } }); return form } function parseHeaders(rawHeaders) { var headers = new Headers(); // Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space // https://tools.ietf.org/html/rfc7230#section-3.2 var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill // https://github.com/github/fetch/issues/748 // https://github.com/zloirock/core-js/issues/751 preProcessedHeaders .split('\r') .map(function(header) { return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header }) .forEach(function(line) { var parts = line.split(':'); var key = parts.shift().trim(); if (key) { var value = parts.join(':').trim(); try { headers.append(key, value); } catch (error) { console.warn('Response ' + error.message); } } }); return headers } Body.call(Request.prototype); function Response(bodyInit, options) { if (!(this instanceof Response)) { throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.') } if (!options) { options = {}; } this.type = 'default'; this.status = options.status === undefined ? 200 : options.status; if (this.status < 200 || this.status > 599) { throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].") } this.ok = this.status >= 200 && this.status < 300; this.statusText = options.statusText === undefined ? '' : '' + options.statusText; this.headers = new Headers(options.headers); this.url = options.url || ''; this._initBody(bodyInit); } Body.call(Response.prototype); Response.prototype.clone = function() { return new Response(this._bodyInit, { status: this.status, statusText: this.statusText, headers: new Headers(this.headers), url: this.url }) }; Response.error = function() { var response = new Response(null, {status: 200, statusText: ''}); response.ok = false; response.status = 0; response.type = 'error'; return response }; var redirectStatuses = [301, 302, 303, 307, 308]; Response.redirect = function(url, status) { if (redirectStatuses.indexOf(status) === -1) { throw new RangeError('Invalid status code') } return new Response(null, {status: status, headers: {location: url}}) }; exports.DOMException = g.DOMException; try { new exports.DOMException(); } catch (err) { exports.DOMException = function(message, name) { this.message = message; this.name = name; var error = Error(message); this.stack = error.stack; }; exports.DOMException.prototype = Object.create(Error.prototype); exports.DOMException.prototype.constructor = exports.DOMException; } function fetch(input, init) { return new Promise(function(resolve, reject) { var request = new Request(input, init); if (request.signal && request.signal.aborted) { return reject(new exports.DOMException('Aborted', 'AbortError')) } var xhr = new XMLHttpRequest(); function abortXhr() { xhr.abort(); } xhr.onload = function() { var options = { statusText: xhr.statusText, headers: parseHeaders(xhr.getAllResponseHeaders() || '') }; // This check if specifically for when a user fetches a file locally from the file system // Only if the status is out of a normal range if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) { options.status = 200; } else { options.status = xhr.status; } options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); var body = 'response' in xhr ? xhr.response : xhr.responseText; setTimeout(function() { resolve(new Response(body, options)); }, 0); }; xhr.onerror = function() { setTimeout(function() { reject(new TypeError('Network request failed')); }, 0); }; xhr.ontimeout = function() { setTimeout(function() { reject(new TypeError('Network request timed out')); }, 0); }; xhr.onabort = function() { setTimeout(function() { reject(new exports.DOMException('Aborted', 'AbortError')); }, 0); }; function fixUrl(url) { try { return url === '' && g.location.href ? g.location.href : url } catch (e) { return url } } xhr.open(request.method, fixUrl(request.url), true); if (request.credentials === 'include') { xhr.withCredentials = true; } else if (request.credentials === 'omit') { xhr.withCredentials = false; } if ('responseType' in xhr) { if (support.blob) { xhr.responseType = 'blob'; } else if ( support.arrayBuffer ) { xhr.responseType = 'arraybuffer'; } } if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) { var names = []; Object.getOwnPropertyNames(init.headers).forEach(function(name) { names.push(normalizeName(name)); xhr.setRequestHeader(name, normalizeValue(init.headers[name])); }); request.headers.forEach(function(value, name) { if (names.indexOf(name) === -1) { xhr.setRequestHeader(name, value); } }); } else { request.headers.forEach(function(value, name) { xhr.setRequestHeader(name, value); }); } if (request.signal) { request.signal.addEventListener('abort', abortXhr); xhr.onreadystatechange = function() { // DONE (success or failure) if (xhr.readyState === 4) { request.signal.removeEventListener('abort', abortXhr); } }; } xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); }) } fetch.polyfill = true; if (!g.fetch) { g.fetch = fetch; g.Headers = Headers; g.Request = Request; g.Response = Response; } exports.Headers = Headers; exports.Request = Request; exports.Response = Response; exports.fetch = fetch; Object.defineProperty(exports, '__esModule', { value: true }); }))); vendor/regenerator-runtime.js 0000644 00000061333 15013651111 0012375 0 ustar 00 /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var runtime = (function (exports) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }; var undefined; // More compressible than void 0. var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); return obj[key]; } try { // IE 8 has a broken Object.defineProperty that only works on DOM objects. define({}, ""); } catch (err) { define = function(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }); return generator; } exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = GeneratorFunctionPrototype; defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true }); defineProperty( GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: true } ); GeneratorFunction.displayName = define( GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction" ); // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { define(prototype, method, function(arg) { return this._invoke(method, arg); }); }); } exports.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; exports.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; define(genFun, toStringTagSymbol, "GeneratorFunction"); } genFun.prototype = Object.create(Gp); return genFun; }; // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. exports.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return PromiseImpl.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return PromiseImpl.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. result.value = unwrapped; resolve(result); }, function(error) { // If a rejected Promise was yielded, throw the rejection back // into the async generator function so it can be handled there. return invoke("throw", error, resolve, reject); }); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). defineProperty(this, "_invoke", { value: enqueue }); } defineIteratorMethods(AsyncIterator.prototype); define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }); exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { if (PromiseImpl === void 0) PromiseImpl = Promise; var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl ); return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } // Be forgiving, per GeneratorResume behavior specified since ES2015: // ES2015 spec, step 3: https://262.ecma-international.org/6.0/#sec-generatorresume // Latest spec, step 2: https://tc39.es/ecma262/#sec-generatorresume return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = "throw"; context.arg = record.arg; } } }; } // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate(delegate, context) { var methodName = context.method; var method = delegate.iterator[methodName]; if (method === undefined) { // A .throw or .return when the delegate iterator has no .throw // method, or a missing .next method, always terminate the // yield* loop. context.delegate = null; // Note: ["return"] must be used for ES3 parsing compatibility. if (methodName === "throw" && delegate.iterator["return"]) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel; } } if (methodName !== "return") { context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a '" + methodName + "' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== "return") { context.method = "next"; context.arg = undefined; } } else { // Re-yield the result returned by the delegate method. return info; } // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null; return ContinueSentinel; } // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp); define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. define(Gp, iteratorSymbol, function() { return this; }); define(Gp, "toString", function() { return "[object Generator]"; }); function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } exports.keys = function(val) { var object = Object(val); var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); // Rather than returning an object with a next method, we keep // things simple and return the next function itself. return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. next.done = true; return next; }; }; function values(iterable) { if (iterable != null) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined; next.done = true; return next; }; return next.next = next; } } throw new TypeError(typeof iterable + " is not iterable"); } exports.values = values; function doneResult() { return { value: undefined, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; // Resetting context._sent for legacy support of Babel's // function.sent implementation. this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { // Not sure about the optimal order of these conditions: if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = "next"; context.arg = undefined; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } // The context.catch method must only be called with a location // argument that corresponds to a known catch block. throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined; } return ContinueSentinel; } }; // Regardless of whether this script is executing as a CommonJS module // or not, return the runtime object so that we can declare the variable // regeneratorRuntime in the outer scope, which allows this module to be // injected easily by `bin/regenerator --include-runtime script.js`. return exports; }( // If this script is executing as a CommonJS module, use module.exports // as the regeneratorRuntime namespace. Otherwise create a new empty // object. Either way, the resulting object will be used to initialize // the regeneratorRuntime variable at the top of this file. typeof module === "object" ? module.exports : {} )); try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { // This module should not be running in strict mode, so the above // assignment should always work unless something is misconfigured. Just // in case runtime.js accidentally runs in strict mode, in modern engines // we can explicitly access globalThis. In older engines we can escape // strict mode using a global Function call. This could conceivably fail // if a Content Security Policy forbids using Function, but in that case // the proper solution is to fix the accidental strict mode problem. If // you've misconfigured your bundler to force strict mode and applied a // CSP to forbid Function, and you're not willing to fix either of those // problems, please detail your unique predicament in a GitHub issue. if (typeof globalThis === "object") { globalThis.regeneratorRuntime = runtime; } else { Function("r", "regeneratorRuntime = r")(runtime); } } vendor/wp-polyfill.min.js 0000644 00000120437 15013651111 0011440 0 ustar 00 !function(r){"use strict";var t,e,n;t=[function(r,t,e){e(1),e(73),e(76),e(78),e(80),e(86),e(95),e(96),e(107),e(108),e(113),e(114),e(116),e(118),e(119),e(127),e(128),e(131),e(137),e(146),e(148),e(149),e(150),r.exports=e(151)},function(r,t,e){var n=e(2),o=e(67),a=e(11),i=e(68),c=Array;n({target:"Array",proto:!0},{toReversed:function(){return o(a(this),c)}}),i("toReversed")},function(t,e,n){var o=n(3),a=n(4).f,i=n(42),c=n(46),u=n(36),f=n(54),s=n(66);t.exports=function(t,e){var n,p,l,y,v,h=t.target,g=t.global,d=t.stat;if(n=g?o:d?o[h]||u(h,{}):o[h]&&o[h].prototype)for(p in e){if(y=e[p],l=t.dontCallGetSet?(v=a(n,p))&&v.value:n[p],!s(g?p:h+(d?".":"#")+p,t.forced)&&l!==r){if(typeof y==typeof l)continue;f(y,l)}(t.sham||l&&l.sham)&&i(y,"sham",!0),c(n,p,y,t)}}},function(r,t,e){var n=function(r){return r&&r.Math===Math&&r};r.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},function(r,t,e){var n=e(5),o=e(7),a=e(9),i=e(10),c=e(11),u=e(17),f=e(37),s=e(40),p=Object.getOwnPropertyDescriptor;t.f=n?p:function(r,t){if(r=c(r),t=u(t),s)try{return p(r,t)}catch(r){}if(f(r,t))return i(!o(a.f,r,t),r[t])}},function(r,t,e){var n=e(6);r.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(r,t,e){r.exports=function(r){try{return!!r()}catch(r){return!0}}},function(r,t,e){var n=e(8),o=Function.prototype.call;r.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},function(r,t,e){var n=e(6);r.exports=!n((function(){var r=function(){}.bind();return"function"!=typeof r||r.hasOwnProperty("prototype")}))},function(r,t,e){var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!n.call({1:2},1);t.f=a?function(r){var t=o(this,r);return!!t&&t.enumerable}:n},function(r,t,e){r.exports=function(r,t){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:t}}},function(r,t,e){var n=e(12),o=e(15);r.exports=function(r){return n(o(r))}},function(r,t,e){var n=e(13),o=e(6),a=e(14),i=Object,c=n("".split);r.exports=o((function(){return!i("z").propertyIsEnumerable(0)}))?function(r){return"String"===a(r)?c(r,""):i(r)}:i},function(r,t,e){var n=e(8),o=Function.prototype,a=o.call,i=n&&o.bind.bind(a,a);r.exports=n?i:function(r){return function(){return a.apply(r,arguments)}}},function(r,t,e){var n=e(13),o=n({}.toString),a=n("".slice);r.exports=function(r){return a(o(r),8,-1)}},function(r,t,e){var n=e(16),o=TypeError;r.exports=function(r){if(n(r))throw new o("Can't call method on "+r);return r}},function(t,e,n){t.exports=function(t){return null===t||t===r}},function(r,t,e){var n=e(18),o=e(21);r.exports=function(r){var t=n(r,"string");return o(t)?t:t+""}},function(t,e,n){var o=n(7),a=n(19),i=n(21),c=n(28),u=n(31),f=n(32),s=TypeError,p=f("toPrimitive");t.exports=function(t,e){if(!a(t)||i(t))return t;var n,f=c(t,p);if(f){if(e===r&&(e="default"),n=o(f,t,e),!a(n)||i(n))return n;throw new s("Can't convert object to primitive value")}return e===r&&(e="number"),u(t,e)}},function(r,t,e){var n=e(20);r.exports=function(r){return"object"==typeof r?null!==r:n(r)}},function(t,e,n){var o="object"==typeof document&&document.all;t.exports=void 0===o&&o!==r?function(r){return"function"==typeof r||r===o}:function(r){return"function"==typeof r}},function(r,t,e){var n=e(22),o=e(20),a=e(23),i=e(24),c=Object;r.exports=i?function(r){return"symbol"==typeof r}:function(r){var t=n("Symbol");return o(t)&&a(t.prototype,c(r))}},function(t,e,n){var o=n(3),a=n(20);t.exports=function(t,e){return arguments.length<2?(n=o[t],a(n)?n:r):o[t]&&o[t][e];var n}},function(r,t,e){var n=e(13);r.exports=n({}.isPrototypeOf)},function(r,t,e){var n=e(25);r.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(r,t,e){var n=e(26),o=e(6),a=e(3).String;r.exports=!!Object.getOwnPropertySymbols&&!o((function(){var r=Symbol("symbol detection");return!a(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},function(r,t,e){var n,o,a=e(3),i=e(27),c=a.process,u=a.Deno,f=c&&c.versions||u&&u.version,s=f&&f.v8;s&&(o=(n=s.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&i&&(!(n=i.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=i.match(/Chrome\/(\d+)/))&&(o=+n[1]),r.exports=o},function(r,t,e){var n=e(3).navigator,o=n&&n.userAgent;r.exports=o?String(o):""},function(t,e,n){var o=n(29),a=n(16);t.exports=function(t,e){var n=t[e];return a(n)?r:o(n)}},function(r,t,e){var n=e(20),o=e(30),a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not a function")}},function(r,t,e){var n=String;r.exports=function(r){try{return n(r)}catch(r){return"Object"}}},function(r,t,e){var n=e(7),o=e(20),a=e(19),i=TypeError;r.exports=function(r,t){var e,c;if("string"===t&&o(e=r.toString)&&!a(c=n(e,r)))return c;if(o(e=r.valueOf)&&!a(c=n(e,r)))return c;if("string"!==t&&o(e=r.toString)&&!a(c=n(e,r)))return c;throw new i("Can't convert object to primitive value")}},function(r,t,e){var n=e(3),o=e(33),a=e(37),i=e(39),c=e(25),u=e(24),f=n.Symbol,s=o("wks"),p=u?f.for||f:f&&f.withoutSetter||i;r.exports=function(r){return a(s,r)||(s[r]=c&&a(f,r)?f[r]:p("Symbol."+r)),s[r]}},function(r,t,e){var n=e(34);r.exports=function(r,t){return n[r]||(n[r]=t||{})}},function(r,t,e){var n=e(35),o=e(3),a=e(36),i="__core-js_shared__",c=r.exports=o[i]||a(i,{});(c.versions||(c.versions=[])).push({version:"3.39.0",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(r,t,e){r.exports=!1},function(r,t,e){var n=e(3),o=Object.defineProperty;r.exports=function(r,t){try{o(n,r,{value:t,configurable:!0,writable:!0})}catch(e){n[r]=t}return t}},function(r,t,e){var n=e(13),o=e(38),a=n({}.hasOwnProperty);r.exports=Object.hasOwn||function(r,t){return a(o(r),t)}},function(r,t,e){var n=e(15),o=Object;r.exports=function(r){return o(n(r))}},function(t,e,n){var o=n(13),a=0,i=Math.random(),c=o(1..toString);t.exports=function(t){return"Symbol("+(t===r?"":t)+")_"+c(++a+i,36)}},function(r,t,e){var n=e(5),o=e(6),a=e(41);r.exports=!n&&!o((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(r,t,e){var n=e(3),o=e(19),a=n.document,i=o(a)&&o(a.createElement);r.exports=function(r){return i?a.createElement(r):{}}},function(r,t,e){var n=e(5),o=e(43),a=e(10);r.exports=n?function(r,t,e){return o.f(r,t,a(1,e))}:function(r,t,e){return r[t]=e,r}},function(r,t,e){var n=e(5),o=e(40),a=e(44),i=e(45),c=e(17),u=TypeError,f=Object.defineProperty,s=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",y="writable";t.f=n?a?function(r,t,e){if(i(r),t=c(t),i(e),"function"==typeof r&&"prototype"===t&&"value"in e&&y in e&&!e[y]){var n=s(r,t);n&&n[y]&&(r[t]=e.value,e={configurable:l in e?e[l]:n[l],enumerable:p in e?e[p]:n[p],writable:!1})}return f(r,t,e)}:f:function(r,t,e){if(i(r),t=c(t),i(e),o)try{return f(r,t,e)}catch(r){}if("get"in e||"set"in e)throw new u("Accessors not supported");return"value"in e&&(r[t]=e.value),r}},function(r,t,e){var n=e(5),o=e(6);r.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(r,t,e){var n=e(19),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not an object")}},function(t,e,n){var o=n(20),a=n(43),i=n(47),c=n(36);t.exports=function(t,e,n,u){u||(u={});var f=u.enumerable,s=u.name!==r?u.name:e;if(o(n)&&i(n,s,u),u.global)f?t[e]=n:c(e,n);else{try{u.unsafe?t[e]&&(f=!0):delete t[e]}catch(r){}f?t[e]=n:a.f(t,e,{value:n,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},function(t,e,n){var o=n(13),a=n(6),i=n(20),c=n(37),u=n(5),f=n(48).CONFIGURABLE,s=n(49),p=n(50),l=p.enforce,y=p.get,v=String,h=Object.defineProperty,g=o("".slice),d=o("".replace),b=o([].join),m=u&&!a((function(){return 8!==h((function(){}),"length",{value:8}).length})),w=String(String).split("String"),E=t.exports=function(t,e,n){"Symbol("===g(v(e),0,7)&&(e="["+d(v(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!c(t,"name")||f&&t.name!==e)&&(u?h(t,"name",{value:e,configurable:!0}):t.name=e),m&&n&&c(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&c(n,"constructor")&&n.constructor?u&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=r)}catch(r){}var o=l(t);return c(o,"source")||(o.source=b(w,"string"==typeof e?e:"")),t};Function.prototype.toString=E((function(){return i(this)&&y(this).source||s(this)}),"toString")},function(r,t,e){var n=e(5),o=e(37),a=Function.prototype,i=n&&Object.getOwnPropertyDescriptor,c=o(a,"name"),u=c&&"something"===function(){}.name,f=c&&(!n||n&&i(a,"name").configurable);r.exports={EXISTS:c,PROPER:u,CONFIGURABLE:f}},function(r,t,e){var n=e(13),o=e(20),a=e(34),i=n(Function.toString);o(a.inspectSource)||(a.inspectSource=function(r){return i(r)}),r.exports=a.inspectSource},function(r,t,e){var n,o,a,i=e(51),c=e(3),u=e(19),f=e(42),s=e(37),p=e(34),l=e(52),y=e(53),v="Object already initialized",h=c.TypeError,g=c.WeakMap;if(i||p.state){var d=p.state||(p.state=new g);d.get=d.get,d.has=d.has,d.set=d.set,n=function(r,t){if(d.has(r))throw new h(v);return t.facade=r,d.set(r,t),t},o=function(r){return d.get(r)||{}},a=function(r){return d.has(r)}}else{var b=l("state");y[b]=!0,n=function(r,t){if(s(r,b))throw new h(v);return t.facade=r,f(r,b,t),t},o=function(r){return s(r,b)?r[b]:{}},a=function(r){return s(r,b)}}r.exports={set:n,get:o,has:a,enforce:function(r){return a(r)?o(r):n(r,{})},getterFor:function(r){return function(t){var e;if(!u(t)||(e=o(t)).type!==r)throw new h("Incompatible receiver, "+r+" required");return e}}}},function(r,t,e){var n=e(3),o=e(20),a=n.WeakMap;r.exports=o(a)&&/native code/.test(String(a))},function(r,t,e){var n=e(33),o=e(39),a=n("keys");r.exports=function(r){return a[r]||(a[r]=o(r))}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(37),o=e(55),a=e(4),i=e(43);r.exports=function(r,t,e){for(var c=o(t),u=i.f,f=a.f,s=0;s<c.length;s++){var p=c[s];n(r,p)||e&&n(e,p)||u(r,p,f(t,p))}}},function(r,t,e){var n=e(22),o=e(13),a=e(56),i=e(65),c=e(45),u=o([].concat);r.exports=n("Reflect","ownKeys")||function(r){var t=a.f(c(r)),e=i.f;return e?u(t,e(r)):t}},function(r,t,e){var n=e(57),o=e(64).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(r){return n(r,o)}},function(r,t,e){var n=e(13),o=e(37),a=e(11),i=e(58).indexOf,c=e(53),u=n([].push);r.exports=function(r,t){var e,n=a(r),f=0,s=[];for(e in n)!o(c,e)&&o(n,e)&&u(s,e);for(;t.length>f;)o(n,e=t[f++])&&(~i(s,e)||u(s,e));return s}},function(r,t,e){var n=e(11),o=e(59),a=e(62),i=function(r){return function(t,e,i){var c=n(t),u=a(c);if(0===u)return!r&&-1;var f,s=o(i,u);if(r&&e!=e){for(;u>s;)if((f=c[s++])!=f)return!0}else for(;u>s;s++)if((r||s in c)&&c[s]===e)return r||s||0;return!r&&-1}};r.exports={includes:i(!0),indexOf:i(!1)}},function(r,t,e){var n=e(60),o=Math.max,a=Math.min;r.exports=function(r,t){var e=n(r);return e<0?o(e+t,0):a(e,t)}},function(r,t,e){var n=e(61);r.exports=function(r){var t=+r;return t!=t||0===t?0:n(t)}},function(r,t,e){var n=Math.ceil,o=Math.floor;r.exports=Math.trunc||function(r){var t=+r;return(t>0?o:n)(t)}},function(r,t,e){var n=e(63);r.exports=function(r){return n(r.length)}},function(r,t,e){var n=e(60),o=Math.min;r.exports=function(r){var t=n(r);return t>0?o(t,9007199254740991):0}},function(r,t,e){r.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(r,t,e){t.f=Object.getOwnPropertySymbols},function(r,t,e){var n=e(6),o=e(20),a=/#|\.prototype\./,i=function(r,t){var e=u[c(r)];return e===s||e!==f&&(o(t)?n(t):!!t)},c=i.normalize=function(r){return String(r).replace(a,".").toLowerCase()},u=i.data={},f=i.NATIVE="N",s=i.POLYFILL="P";r.exports=i},function(r,t,e){var n=e(62);r.exports=function(r,t){for(var e=n(r),o=new t(e),a=0;a<e;a++)o[a]=r[e-a-1];return o}},function(t,e,n){var o=n(32),a=n(69),i=n(43).f,c=o("unscopables"),u=Array.prototype;u[c]===r&&i(u,c,{configurable:!0,value:a(null)}),t.exports=function(r){u[c][r]=!0}},function(t,e,n){var o,a=n(45),i=n(70),c=n(64),u=n(53),f=n(72),s=n(41),p=n(52),l="prototype",y="script",v=p("IE_PROTO"),h=function(){},g=function(r){return"<"+y+">"+r+"</"+y+">"},d=function(r){r.write(g("")),r.close();var t=r.parentWindow.Object;return r=null,t},b=function(){try{o=new ActiveXObject("htmlfile")}catch(r){}var r,t,e;b="undefined"!=typeof document?document.domain&&o?d(o):(t=s("iframe"),e="java"+y+":",t.style.display="none",f.appendChild(t),t.src=String(e),(r=t.contentWindow.document).open(),r.write(g("document.F=Object")),r.close(),r.F):d(o);for(var n=c.length;n--;)delete b[l][c[n]];return b()};u[v]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(h[l]=a(t),n=new h,h[l]=null,n[v]=t):n=b(),e===r?n:i.f(n,e)}},function(r,t,e){var n=e(5),o=e(44),a=e(43),i=e(45),c=e(11),u=e(71);t.f=n&&!o?Object.defineProperties:function(r,t){i(r);for(var e,n=c(t),o=u(t),f=o.length,s=0;f>s;)a.f(r,e=o[s++],n[e]);return r}},function(r,t,e){var n=e(57),o=e(64);r.exports=Object.keys||function(r){return n(r,o)}},function(r,t,e){var n=e(22);r.exports=n("document","documentElement")},function(t,e,n){var o=n(2),a=n(13),i=n(29),c=n(11),u=n(74),f=n(75),s=n(68),p=Array,l=a(f("Array","sort"));o({target:"Array",proto:!0},{toSorted:function(t){t!==r&&i(t);var e=c(this),n=u(p,e);return l(n,t)}}),s("toSorted")},function(r,t,e){var n=e(62);r.exports=function(r,t,e){for(var o=0,a=arguments.length>2?e:n(t),i=new r(a);a>o;)i[o]=t[o++];return i}},function(r,t,e){var n=e(3);r.exports=function(r,t){var e=n[r],o=e&&e.prototype;return o&&o[t]}},function(r,t,e){var n=e(2),o=e(68),a=e(77),i=e(62),c=e(59),u=e(11),f=e(60),s=Array,p=Math.max,l=Math.min;n({target:"Array",proto:!0},{toSpliced:function(r,t){var e,n,o,y,v=u(this),h=i(v),g=c(r,h),d=arguments.length,b=0;for(0===d?e=n=0:1===d?(e=0,n=h-g):(e=d-2,n=l(p(f(t),0),h-g)),o=a(h+e-n),y=s(o);b<g;b++)y[b]=v[b];for(;b<g+e;b++)y[b]=arguments[b-g+2];for(;b<o;b++)y[b]=v[b+n-e];return y}}),o("toSpliced")},function(r,t,e){var n=TypeError;r.exports=function(r){if(r>9007199254740991)throw n("Maximum allowed index exceeded");return r}},function(r,t,e){var n=e(2),o=e(79),a=e(11),i=Array;n({target:"Array",proto:!0},{with:function(r,t){return o(a(this),i,r,t)}})},function(r,t,e){var n=e(62),o=e(60),a=RangeError;r.exports=function(r,t,e,i){var c=n(r),u=o(e),f=u<0?c+u:u;if(f>=c||f<0)throw new a("Incorrect index");for(var s=new t(c),p=0;p<c;p++)s[p]=p===f?i:r[p];return s}},function(r,t,e){var n=e(5),o=e(81),a=e(82),i=ArrayBuffer.prototype;n&&!("detached"in i)&&o(i,"detached",{configurable:!0,get:function(){return a(this)}})},function(r,t,e){var n=e(47),o=e(43);r.exports=function(r,t,e){return e.get&&n(e.get,t,{getter:!0}),e.set&&n(e.set,t,{setter:!0}),o.f(r,t,e)}},function(r,t,e){var n=e(3),o=e(83),a=e(84),i=n.ArrayBuffer,c=i&&i.prototype,u=c&&o(c.slice);r.exports=function(r){if(0!==a(r))return!1;if(!u)return!1;try{return u(r,0,0),!1}catch(r){return!0}}},function(r,t,e){var n=e(14),o=e(13);r.exports=function(r){if("Function"===n(r))return o(r)}},function(r,t,e){var n=e(3),o=e(85),a=e(14),i=n.ArrayBuffer,c=n.TypeError;r.exports=i&&o(i.prototype,"byteLength","get")||function(r){if("ArrayBuffer"!==a(r))throw new c("ArrayBuffer expected");return r.byteLength}},function(r,t,e){var n=e(13),o=e(29);r.exports=function(r,t,e){try{return n(o(Object.getOwnPropertyDescriptor(r,t)[e]))}catch(r){}}},function(t,e,n){var o=n(2),a=n(87);a&&o({target:"ArrayBuffer",proto:!0},{transfer:function(){return a(this,arguments.length?arguments[0]:r,!0)}})},function(t,e,n){var o=n(3),a=n(13),i=n(85),c=n(88),u=n(89),f=n(84),s=n(90),p=n(94),l=o.structuredClone,y=o.ArrayBuffer,v=o.DataView,h=Math.min,g=y.prototype,d=v.prototype,b=a(g.slice),m=i(g,"resizable","get"),w=i(g,"maxByteLength","get"),E=a(d.getInt8),x=a(d.setInt8);t.exports=(p||s)&&function(t,e,n){var o,a=f(t),i=e===r?a:c(e),g=!m||!m(t);if(u(t),p&&(t=l(t,{transfer:[t]}),a===i&&(n||g)))return t;if(a>=i&&(!n||g))o=b(t,0,i);else{var d=n&&!g&&w?{maxByteLength:w(t)}:r;o=new y(i,d);for(var A=new v(t),O=new v(o),R=h(i,a),S=0;S<R;S++)x(O,S,E(A,S))}return p||s(t),o}},function(t,e,n){var o=n(60),a=n(63),i=RangeError;t.exports=function(t){if(t===r)return 0;var e=o(t),n=a(e);if(e!==n)throw new i("Wrong length or index");return n}},function(r,t,e){var n=e(82),o=TypeError;r.exports=function(r){if(n(r))throw new o("ArrayBuffer is detached");return r}},function(r,t,e){var n,o,a,i,c=e(3),u=e(91),f=e(94),s=c.structuredClone,p=c.ArrayBuffer,l=c.MessageChannel,y=!1;if(f)y=function(r){s(r,{transfer:[r]})};else if(p)try{l||(n=u("worker_threads"))&&(l=n.MessageChannel),l&&(o=new l,a=new p(2),i=function(r){o.port1.postMessage(null,[r])},2===a.byteLength&&(i(a),0===a.byteLength&&(y=i)))}catch(r){}r.exports=y},function(r,t,e){var n=e(3),o=e(92);r.exports=function(r){if(o){try{return n.process.getBuiltinModule(r)}catch(r){}try{return Function('return require("'+r+'")')()}catch(r){}}}},function(r,t,e){var n=e(93);r.exports="NODE"===n},function(r,t,e){var n=e(3),o=e(27),a=e(14),i=function(r){return o.slice(0,r.length)===r};r.exports=i("Bun/")?"BUN":i("Cloudflare-Workers")?"CLOUDFLARE":i("Deno/")?"DENO":i("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===a(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},function(r,t,e){var n=e(3),o=e(6),a=e(26),i=e(93),c=n.structuredClone;r.exports=!!c&&!o((function(){if("DENO"===i&&a>92||"NODE"===i&&a>94||"BROWSER"===i&&a>97)return!1;var r=new ArrayBuffer(8),t=c(r,{transfer:[r]});return 0!==r.byteLength||8!==t.byteLength}))},function(t,e,n){var o=n(2),a=n(87);a&&o({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return a(this,arguments.length?arguments[0]:r,!1)}})},function(r,t,e){var n=e(2),o=e(13),a=e(29),i=e(15),c=e(97),u=e(106),f=e(35),s=e(6),p=u.Map,l=u.has,y=u.get,v=u.set,h=o([].push),g=f||s((function(){return 1!==p.groupBy("ab",(function(r){return r})).get("a").length}));n({target:"Map",stat:!0,forced:f||g},{groupBy:function(r,t){i(r),a(t);var e=new p,n=0;return c(r,(function(r){var o=t(r,n++);l(e,o)?h(y(e,o),r):v(e,o,[r])})),e}})},function(r,t,e){var n=e(98),o=e(7),a=e(45),i=e(30),c=e(99),u=e(62),f=e(23),s=e(101),p=e(102),l=e(105),y=TypeError,v=function(r,t){this.stopped=r,this.result=t},h=v.prototype;r.exports=function(r,t,e){var g,d,b,m,w,E,x,A=e&&e.that,O=!(!e||!e.AS_ENTRIES),R=!(!e||!e.IS_RECORD),S=!(!e||!e.IS_ITERATOR),T=!(!e||!e.INTERRUPTED),I=n(t,A),_=function(r){return g&&l(g,"normal",r),new v(!0,r)},D=function(r){return O?(a(r),T?I(r[0],r[1],_):I(r[0],r[1])):T?I(r,_):I(r)};if(R)g=r.iterator;else if(S)g=r;else{if(!(d=p(r)))throw new y(i(r)+" is not iterable");if(c(d)){for(b=0,m=u(r);m>b;b++)if((w=D(r[b]))&&f(h,w))return w;return new v(!1)}g=s(r,d)}for(E=R?r.next:g.next;!(x=o(E,g)).done;){try{w=D(x.value)}catch(r){l(g,"throw",r)}if("object"==typeof w&&w&&f(h,w))return w}return new v(!1)}},function(t,e,n){var o=n(83),a=n(29),i=n(8),c=o(o.bind);t.exports=function(t,e){return a(t),e===r?t:i?c(t,e):function(){return t.apply(e,arguments)}}},function(t,e,n){var o=n(32),a=n(100),i=o("iterator"),c=Array.prototype;t.exports=function(t){return t!==r&&(a.Array===t||c[i]===t)}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(7),o=e(29),a=e(45),i=e(30),c=e(102),u=TypeError;r.exports=function(r,t){var e=arguments.length<2?c(r):t;if(o(e))return a(n(e,r));throw new u(i(r)+" is not iterable")}},function(r,t,e){var n=e(103),o=e(28),a=e(16),i=e(100),c=e(32)("iterator");r.exports=function(r){if(!a(r))return o(r,c)||o(r,"@@iterator")||i[n(r)]}},function(t,e,n){var o=n(104),a=n(20),i=n(14),c=n(32)("toStringTag"),u=Object,f="Arguments"===i(function(){return arguments}());t.exports=o?i:function(t){var e,n,o;return t===r?"Undefined":null===t?"Null":"string"==typeof(n=function(r,t){try{return r[t]}catch(r){}}(e=u(t),c))?n:f?i(e):"Object"===(o=i(e))&&a(e.callee)?"Arguments":o}},function(r,t,e){var n={};n[e(32)("toStringTag")]="z",r.exports="[object z]"===String(n)},function(r,t,e){var n=e(7),o=e(45),a=e(28);r.exports=function(r,t,e){var i,c;o(r);try{if(!(i=a(r,"return"))){if("throw"===t)throw e;return e}i=n(i,r)}catch(r){c=!0,i=r}if("throw"===t)throw e;if(c)throw i;return o(i),e}},function(r,t,e){var n=e(13),o=Map.prototype;r.exports={Map,set:n(o.set),get:n(o.get),has:n(o.has),remove:n(o.delete),proto:o}},function(r,t,e){var n=e(2),o=e(22),a=e(13),i=e(29),c=e(15),u=e(17),f=e(97),s=e(6),p=Object.groupBy,l=o("Object","create"),y=a([].push);n({target:"Object",stat:!0,forced:!p||s((function(){return 1!==p("ab",(function(r){return r})).a.length}))},{groupBy:function(r,t){c(r),i(t);var e=l(null),n=0;return f(r,(function(r){var o=u(t(r,n++));o in e?y(e[o],r):e[o]=[r]})),e}})},function(t,e,n){var o=n(2),a=n(3),i=n(109),c=n(110),u=n(111),f=n(29),s=n(112),p=a.Promise,l=!1;o({target:"Promise",stat:!0,forced:!p||!p.try||s((function(){p.try((function(r){l=8===r}),8)})).error||!l},{try:function(t){var e=arguments.length>1?c(arguments,1):[],n=u.f(this),o=s((function(){return i(f(t),r,e)}));return(o.error?n.reject:n.resolve)(o.value),n.promise}})},function(r,t,e){var n=e(8),o=Function.prototype,a=o.apply,i=o.call;r.exports="object"==typeof Reflect&&Reflect.apply||(n?i.bind(a):function(){return i.apply(a,arguments)})},function(r,t,e){var n=e(13);r.exports=n([].slice)},function(t,e,n){var o=n(29),a=TypeError,i=function(t){var e,n;this.promise=new t((function(t,o){if(e!==r||n!==r)throw new a("Bad Promise constructor");e=t,n=o})),this.resolve=o(e),this.reject=o(n)};t.exports.f=function(r){return new i(r)}},function(r,t,e){r.exports=function(r){try{return{error:!1,value:r()}}catch(r){return{error:!0,value:r}}}},function(r,t,e){var n=e(2),o=e(111);n({target:"Promise",stat:!0},{withResolvers:function(){var r=o.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}})},function(r,t,e){var n=e(3),o=e(5),a=e(81),i=e(115),c=e(6),u=n.RegExp,f=u.prototype;o&&c((function(){var r=!0;try{u(".","d")}catch(t){r=!1}var t={},e="",n=r?"dgimsy":"gimsy",o=function(r,n){Object.defineProperty(t,r,{get:function(){return e+=n,!0}})},a={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var i in r&&(a.hasIndices="d"),a)o(i,a[i]);return Object.getOwnPropertyDescriptor(f,"flags").get.call(t)!==n||e!==n}))&&a(f,"flags",{configurable:!0,get:i})},function(r,t,e){var n=e(45);r.exports=function(){var r=n(this),t="";return r.hasIndices&&(t+="d"),r.global&&(t+="g"),r.ignoreCase&&(t+="i"),r.multiline&&(t+="m"),r.dotAll&&(t+="s"),r.unicode&&(t+="u"),r.unicodeSets&&(t+="v"),r.sticky&&(t+="y"),t}},function(r,t,e){var n=e(2),o=e(13),a=e(15),i=e(117),c=o("".charCodeAt);n({target:"String",proto:!0},{isWellFormed:function(){for(var r=i(a(this)),t=r.length,e=0;e<t;e++){var n=c(r,e);if(55296==(63488&n)&&(n>=56320||++e>=t||56320!=(64512&c(r,e))))return!1}return!0}})},function(r,t,e){var n=e(103),o=String;r.exports=function(r){if("Symbol"===n(r))throw new TypeError("Cannot convert a Symbol value to a string");return o(r)}},function(r,t,e){var n=e(2),o=e(7),a=e(13),i=e(15),c=e(117),u=e(6),f=Array,s=a("".charAt),p=a("".charCodeAt),l=a([].join),y="".toWellFormed,v=y&&u((function(){return"1"!==o(y,1)}));n({target:"String",proto:!0,forced:v},{toWellFormed:function(){var r=c(i(this));if(v)return o(y,r);for(var t=r.length,e=f(t),n=0;n<t;n++){var a=p(r,n);55296!=(63488&a)?e[n]=s(r,n):a>=56320||n+1>=t||56320!=(64512&p(r,n+1))?e[n]="�":(e[n]=s(r,n),e[++n]=s(r,n))}return l(e,"")}})},function(r,t,e){var n=e(67),o=e(120),a=o.aTypedArray,i=o.exportTypedArrayMethod,c=o.getTypedArrayConstructor;i("toReversed",(function(){return n(a(this),c(this))}))},function(t,e,n){var o,a,i,c=n(121),u=n(5),f=n(3),s=n(20),p=n(19),l=n(37),y=n(103),v=n(30),h=n(42),g=n(46),d=n(81),b=n(23),m=n(122),w=n(124),E=n(32),x=n(39),A=n(50),O=A.enforce,R=A.get,S=f.Int8Array,T=S&&S.prototype,I=f.Uint8ClampedArray,_=I&&I.prototype,D=S&&m(S),j=T&&m(T),M=Object.prototype,P=f.TypeError,C=E("toStringTag"),k=x("TYPED_ARRAY_TAG"),B="TypedArrayConstructor",L=c&&!!w&&"Opera"!==y(f.opera),U=!1,N={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},F={BigInt64Array:8,BigUint64Array:8},W=function(r){var t=m(r);if(p(t)){var e=R(t);return e&&l(e,B)?e[B]:W(t)}},V=function(r){if(!p(r))return!1;var t=y(r);return l(N,t)||l(F,t)};for(o in N)(i=(a=f[o])&&a.prototype)?O(i)[B]=a:L=!1;for(o in F)(i=(a=f[o])&&a.prototype)&&(O(i)[B]=a);if((!L||!s(D)||D===Function.prototype)&&(D=function(){throw new P("Incorrect invocation")},L))for(o in N)f[o]&&w(f[o],D);if((!L||!j||j===M)&&(j=D.prototype,L))for(o in N)f[o]&&w(f[o].prototype,j);if(L&&m(_)!==j&&w(_,j),u&&!l(j,C))for(o in U=!0,d(j,C,{configurable:!0,get:function(){return p(this)?this[k]:r}}),N)f[o]&&h(f[o],k,o);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:L,TYPED_ARRAY_TAG:U&&k,aTypedArray:function(r){if(V(r))return r;throw new P("Target is not a typed array")},aTypedArrayConstructor:function(r){if(s(r)&&(!w||b(D,r)))return r;throw new P(v(r)+" is not a typed array constructor")},exportTypedArrayMethod:function(r,t,e,n){if(u){if(e)for(var o in N){var a=f[o];if(a&&l(a.prototype,r))try{delete a.prototype[r]}catch(e){try{a.prototype[r]=t}catch(r){}}}j[r]&&!e||g(j,r,e?t:L&&T[r]||t,n)}},exportTypedArrayStaticMethod:function(r,t,e){var n,o;if(u){if(w){if(e)for(n in N)if((o=f[n])&&l(o,r))try{delete o[r]}catch(r){}if(D[r]&&!e)return;try{return g(D,r,e?t:L&&D[r]||t)}catch(r){}}for(n in N)!(o=f[n])||o[r]&&!e||g(o,r,t)}},getTypedArrayConstructor:W,isView:function(r){if(!p(r))return!1;var t=y(r);return"DataView"===t||l(N,t)||l(F,t)},isTypedArray:V,TypedArray:D,TypedArrayPrototype:j}},function(r,t,e){r.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},function(r,t,e){var n=e(37),o=e(20),a=e(38),i=e(52),c=e(123),u=i("IE_PROTO"),f=Object,s=f.prototype;r.exports=c?f.getPrototypeOf:function(r){var t=a(r);if(n(t,u))return t[u];var e=t.constructor;return o(e)&&t instanceof e?e.prototype:t instanceof f?s:null}},function(r,t,e){var n=e(6);r.exports=!n((function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype}))},function(t,e,n){var o=n(85),a=n(19),i=n(15),c=n(125);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,t=!1,e={};try{(r=o(Object.prototype,"__proto__","set"))(e,[]),t=e instanceof Array}catch(r){}return function(e,n){return i(e),c(n),a(e)?(t?r(e,n):e.__proto__=n,e):e}}():r)},function(r,t,e){var n=e(126),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a("Can't set "+o(r)+" as a prototype")}},function(r,t,e){var n=e(19);r.exports=function(r){return n(r)||null===r}},function(t,e,n){var o=n(120),a=n(13),i=n(29),c=n(74),u=o.aTypedArray,f=o.getTypedArrayConstructor,s=o.exportTypedArrayMethod,p=a(o.TypedArrayPrototype.sort);s("toSorted",(function(t){t!==r&&i(t);var e=u(this),n=c(f(e),e);return p(n,t)}))},function(r,t,e){var n=e(79),o=e(120),a=e(129),i=e(60),c=e(130),u=o.aTypedArray,f=o.getTypedArrayConstructor,s=o.exportTypedArrayMethod,p=!!function(){try{new Int8Array(1).with(2,{valueOf:function(){throw 8}})}catch(r){return 8===r}}();s("with",{with:function(r,t){var e=u(this),o=i(r),s=a(e)?c(t):+t;return n(e,f(e),o,s)}}.with,!p)},function(r,t,e){var n=e(103);r.exports=function(r){var t=n(r);return"BigInt64Array"===t||"BigUint64Array"===t}},function(r,t,e){var n=e(18),o=TypeError;r.exports=function(r){var t=n(r,"number");if("number"==typeof t)throw new o("Can't convert number to bigint");return BigInt(t)}},function(t,e,n){var o=n(2),a=n(3),i=n(22),c=n(10),u=n(43).f,f=n(37),s=n(132),p=n(133),l=n(134),y=n(135),v=n(136),h=n(5),g=n(35),d="DOMException",b=i("Error"),m=i(d),w=function(){s(this,E);var t=arguments.length,e=l(t<1?r:arguments[0]),n=l(t<2?r:arguments[1],"Error"),o=new m(e,n),a=new b(e);return a.name=d,u(o,"stack",c(1,v(a.stack,1))),p(o,this,w),o},E=w.prototype=m.prototype,x="stack"in new b(d),A="stack"in new m(1,2),O=m&&h&&Object.getOwnPropertyDescriptor(a,d),R=!(!O||O.writable&&O.configurable),S=x&&!R&&!A;o({global:!0,constructor:!0,forced:g||S},{DOMException:S?w:m});var T=i(d),I=T.prototype;if(I.constructor!==T)for(var _ in g||u(I,"constructor",c(1,T)),y)if(f(y,_)){var D=y[_],j=D.s;f(T,j)||u(T,j,c(6,D.c))}},function(r,t,e){var n=e(23),o=TypeError;r.exports=function(r,t){if(n(t,r))return r;throw new o("Incorrect invocation")}},function(r,t,e){var n=e(20),o=e(19),a=e(124);r.exports=function(r,t,e){var i,c;return a&&n(i=t.constructor)&&i!==e&&o(c=i.prototype)&&c!==e.prototype&&a(r,c),r}},function(t,e,n){var o=n(117);t.exports=function(t,e){return t===r?arguments.length<2?"":e:o(t)}},function(r,t,e){r.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},function(r,t,e){var n=e(13),o=Error,a=n("".replace),i=String(new o("zxcasd").stack),c=/\n\s*at [^:]*:[^\n]*/,u=c.test(i);r.exports=function(r,t){if(u&&"string"==typeof r&&!o.prepareStackTrace)for(;t--;)r=a(r,c,"");return r}},function(t,e,n){var o,a=n(35),i=n(2),c=n(3),u=n(22),f=n(13),s=n(6),p=n(39),l=n(20),y=n(138),v=n(16),h=n(19),g=n(21),d=n(97),b=n(45),m=n(103),w=n(37),E=n(139),x=n(42),A=n(62),O=n(140),R=n(141),S=n(106),T=n(142),I=n(143),_=n(90),D=n(145),j=n(94),M=c.Object,P=c.Array,C=c.Date,k=c.Error,B=c.TypeError,L=c.PerformanceMark,U=u("DOMException"),N=S.Map,F=S.has,W=S.get,V=S.set,z=T.Set,G=T.add,Y=T.has,H=u("Object","keys"),Q=f([].push),X=f((!0).valueOf),q=f(1..valueOf),K=f("".valueOf),Z=f(C.prototype.getTime),$=p("structuredClone"),J="DataCloneError",rr="Transferring",tr=function(r){return!s((function(){var t=new c.Set([7]),e=r(t),n=r(M(7));return e===t||!e.has(7)||!h(n)||7!=+n}))&&r},er=function(r,t){return!s((function(){var e=new t,n=r({a:e,b:e});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===e.stack)}))},nr=c.structuredClone,or=a||!er(nr,k)||!er(nr,U)||(o=nr,!!s((function(){var r=o(new c.AggregateError([1],$,{cause:3}));return"AggregateError"!==r.name||1!==r.errors[0]||r.message!==$||3!==r.cause}))),ar=!nr&&tr((function(r){return new L($,{detail:r}).detail})),ir=tr(nr)||ar,cr=function(r){throw new U("Uncloneable type: "+r,J)},ur=function(r,t){throw new U((t||"Cloning")+" of "+r+" cannot be properly polyfilled in this engine",J)},fr=function(r,t){return ir||ur(t),ir(r)},sr=function(t,e,n){if(F(e,t))return W(e,t);var o,a,i,u,f,s;if("SharedArrayBuffer"===(n||m(t)))o=ir?ir(t):t;else{var p=c.DataView;p||l(t.slice)||ur("ArrayBuffer");try{if(l(t.slice)&&!t.resizable)o=t.slice(0);else{a=t.byteLength,i="maxByteLength"in t?{maxByteLength:t.maxByteLength}:r,o=new ArrayBuffer(a,i),u=new p(t),f=new p(o);for(s=0;s<a;s++)f.setUint8(s,u.getUint8(s))}}catch(r){throw new U("ArrayBuffer is detached",J)}}return V(e,t,o),o},pr=function(t,e){if(g(t)&&cr("Symbol"),!h(t))return t;if(e){if(F(e,t))return W(e,t)}else e=new N;var n,o,a,i,f,s,p,y,v=m(t);switch(v){case"Array":a=P(A(t));break;case"Object":a={};break;case"Map":a=new N;break;case"Set":a=new z;break;case"RegExp":a=new RegExp(t.source,R(t));break;case"Error":switch(o=t.name){case"AggregateError":a=new(u(o))([]);break;case"EvalError":case"RangeError":case"ReferenceError":case"SuppressedError":case"SyntaxError":case"TypeError":case"URIError":a=new(u(o));break;case"CompileError":case"LinkError":case"RuntimeError":a=new(u("WebAssembly",o));break;default:a=new k}break;case"DOMException":a=new U(t.message,t.name);break;case"ArrayBuffer":case"SharedArrayBuffer":a=sr(t,e,v);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":s="DataView"===v?t.byteLength:t.length,a=function(r,t,e,n,o){var a=c[t];return h(a)||ur(t),new a(sr(r.buffer,o),e,n)}(t,v,t.byteOffset,s,e);break;case"DOMQuad":try{a=new DOMQuad(pr(t.p1,e),pr(t.p2,e),pr(t.p3,e),pr(t.p4,e))}catch(r){a=fr(t,v)}break;case"File":if(ir)try{a=ir(t),m(a)!==v&&(a=r)}catch(r){}if(!a)try{a=new File([t],t.name,t)}catch(r){}a||ur(v);break;case"FileList":if(i=function(){var r;try{r=new c.DataTransfer}catch(t){try{r=new c.ClipboardEvent("").clipboardData}catch(r){}}return r&&r.items&&r.files?r:null}()){for(f=0,s=A(t);f<s;f++)i.items.add(pr(t[f],e));a=i.files}else a=fr(t,v);break;case"ImageData":try{a=new ImageData(pr(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch(r){a=fr(t,v)}break;default:if(ir)a=ir(t);else switch(v){case"BigInt":a=M(t.valueOf());break;case"Boolean":a=M(X(t));break;case"Number":a=M(q(t));break;case"String":a=M(K(t));break;case"Date":a=new C(Z(t));break;case"Blob":try{a=t.slice(0,t.size,t.type)}catch(r){ur(v)}break;case"DOMPoint":case"DOMPointReadOnly":n=c[v];try{a=n.fromPoint?n.fromPoint(t):new n(t.x,t.y,t.z,t.w)}catch(r){ur(v)}break;case"DOMRect":case"DOMRectReadOnly":n=c[v];try{a=n.fromRect?n.fromRect(t):new n(t.x,t.y,t.width,t.height)}catch(r){ur(v)}break;case"DOMMatrix":case"DOMMatrixReadOnly":n=c[v];try{a=n.fromMatrix?n.fromMatrix(t):new n(t)}catch(r){ur(v)}break;case"AudioData":case"VideoFrame":l(t.clone)||ur(v);try{a=t.clone()}catch(r){cr(v)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":ur(v);default:cr(v)}}switch(V(e,t,a),v){case"Array":case"Object":for(p=H(t),f=0,s=A(p);f<s;f++)y=p[f],E(a,y,pr(t[y],e));break;case"Map":t.forEach((function(r,t){V(a,pr(t,e),pr(r,e))}));break;case"Set":t.forEach((function(r){G(a,pr(r,e))}));break;case"Error":x(a,"message",pr(t.message,e)),w(t,"cause")&&x(a,"cause",pr(t.cause,e)),"AggregateError"===o?a.errors=pr(t.errors,e):"SuppressedError"===o&&(a.error=pr(t.error,e),a.suppressed=pr(t.suppressed,e));case"DOMException":D&&x(a,"stack",pr(t.stack,e))}return a};i({global:!0,enumerable:!0,sham:!j,forced:or},{structuredClone:function(t){var e,n,o=O(arguments.length,1)>1&&!v(arguments[1])?b(arguments[1]):r,a=o?o.transfer:r;a!==r&&(n=function(t,e){if(!h(t))throw new B("Transfer option cannot be converted to a sequence");var n=[];d(t,(function(r){Q(n,b(r))}));for(var o,a,i,u,f,s=0,p=A(n),v=new z;s<p;){if(o=n[s++],"ArrayBuffer"===(a=m(o))?Y(v,o):F(e,o))throw new U("Duplicate transferable",J);if("ArrayBuffer"!==a){if(j)u=nr(o,{transfer:[o]});else switch(a){case"ImageBitmap":i=c.OffscreenCanvas,y(i)||ur(a,rr);try{(f=new i(o.width,o.height)).getContext("bitmaprenderer").transferFromImageBitmap(o),u=f.transferToImageBitmap()}catch(r){}break;case"AudioData":case"VideoFrame":l(o.clone)&&l(o.close)||ur(a,rr);try{u=o.clone(),o.close()}catch(r){}break;case"MediaSourceHandle":case"MessagePort":case"MIDIAccess":case"OffscreenCanvas":case"ReadableStream":case"RTCDataChannel":case"TransformStream":case"WebTransportReceiveStream":case"WebTransportSendStream":case"WritableStream":ur(a,rr)}if(u===r)throw new U("This object cannot be transferred: "+a,J);V(e,o,u)}else G(v,o)}return v}(a,e=new N));var i=pr(t,e);return n&&function(r){I(r,(function(r){j?ir(r,{transfer:[r]}):l(r.transfer)?r.transfer():_?_(r):ur("ArrayBuffer",rr)}))}(n),i}})},function(r,t,e){var n=e(13),o=e(6),a=e(20),i=e(103),c=e(22),u=e(49),f=function(){},s=c("Reflect","construct"),p=/^\s*(?:class|function)\b/,l=n(p.exec),y=!p.test(f),v=function(r){if(!a(r))return!1;try{return s(f,[],r),!0}catch(r){return!1}},h=function(r){if(!a(r))return!1;switch(i(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return y||!!l(p,u(r))}catch(r){return!0}};h.sham=!0,r.exports=!s||o((function(){var r;return v(v.call)||!v(Object)||!v((function(){r=!0}))||r}))?h:v},function(r,t,e){var n=e(5),o=e(43),a=e(10);r.exports=function(r,t,e){n?o.f(r,t,a(0,e)):r[t]=e}},function(r,t,e){var n=TypeError;r.exports=function(r,t){if(r<t)throw new n("Not enough arguments");return r}},function(t,e,n){var o=n(7),a=n(37),i=n(23),c=n(115),u=RegExp.prototype;t.exports=function(t){var e=t.flags;return e!==r||"flags"in u||a(t,"flags")||!i(u,t)?e:o(c,t)}},function(r,t,e){var n=e(13),o=Set.prototype;r.exports={Set,add:n(o.add),has:n(o.has),remove:n(o.delete),proto:o}},function(r,t,e){var n=e(13),o=e(144),a=e(142),i=a.Set,c=a.proto,u=n(c.forEach),f=n(c.keys),s=f(new i).next;r.exports=function(r,t,e){return e?o({iterator:f(r),next:s},t):u(r,t)}},function(t,e,n){var o=n(7);t.exports=function(t,e,n){for(var a,i,c=n?t:t.iterator,u=t.next;!(a=o(u,c)).done;)if((i=e(a.value))!==r)return i}},function(r,t,e){var n=e(6),o=e(10);r.exports=!n((function(){var r=new Error("a");return!("stack"in r)||(Object.defineProperty(r,"stack",o(1,7)),7!==r.stack)}))},function(t,e,n){var o=n(2),a=n(22),i=n(6),c=n(140),u=n(117),f=n(147),s=a("URL"),p=f&&i((function(){s.canParse()})),l=i((function(){return 1!==s.canParse.length}));o({target:"URL",stat:!0,forced:!p||l},{canParse:function(t){var e=c(arguments.length,1),n=u(t),o=e<2||arguments[1]===r?r:u(arguments[1]);try{return!!new s(n,o)}catch(r){return!1}}})},function(t,e,n){var o=n(6),a=n(32),i=n(5),c=n(35),u=a("iterator");t.exports=!o((function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),o="";return t.pathname="c%20d",e.forEach((function(r,t){e.delete("b"),o+=t+r})),n.delete("a",2),n.delete("b",r),c&&(!t.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",r)||n.has("b"))||!e.size&&(c||!i)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[u]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==o||"x"!==new URL("https://x",r).host}))},function(t,e,n){var o=n(2),a=n(22),i=n(140),c=n(117),u=n(147),f=a("URL");o({target:"URL",stat:!0,forced:!u},{parse:function(t){var e=i(arguments.length,1),n=c(t),o=e<2||arguments[1]===r?r:c(arguments[1]);try{return new f(n,o)}catch(r){return null}}})},function(t,e,n){var o=n(46),a=n(13),i=n(117),c=n(140),u=URLSearchParams,f=u.prototype,s=a(f.append),p=a(f.delete),l=a(f.forEach),y=a([].push),v=new u("a=1&a=2&b=3");v.delete("a",1),v.delete("b",r),v+""!="a=2"&&o(f,"delete",(function(t){var e=arguments.length,n=e<2?r:arguments[1];if(e&&n===r)return p(this,t);var o=[];l(this,(function(r,t){y(o,{key:t,value:r})})),c(e,1);for(var a,u=i(t),f=i(n),v=0,h=0,g=!1,d=o.length;v<d;)a=o[v++],g||a.key===u?(g=!0,p(this,a.key)):h++;for(;h<d;)(a=o[h++]).key===u&&a.value===f||s(this,a.key,a.value)}),{enumerable:!0,unsafe:!0})},function(t,e,n){var o=n(46),a=n(13),i=n(117),c=n(140),u=URLSearchParams,f=u.prototype,s=a(f.getAll),p=a(f.has),l=new u("a=1");!l.has("a",2)&&l.has("a",r)||o(f,"has",(function(t){var e=arguments.length,n=e<2?r:arguments[1];if(e&&n===r)return p(this,t);var o=s(this,t);c(e,1);for(var a=i(n),u=0;u<o.length;)if(o[u++]===a)return!0;return!1}),{enumerable:!0,unsafe:!0})},function(r,t,e){var n=e(5),o=e(13),a=e(81),i=URLSearchParams.prototype,c=o(i.forEach);n&&!("size"in i)&&a(i,"size",{get:function(){var r=0;return c(this,(function(){r++})),r},configurable:!0,enumerable:!0})}],e={},(n=function(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}).m=t,n.c=e,n.d=function(r,t,e){n.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:e})},n.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,t){if(1&t&&(r=n(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var o in r)n.d(e,o,function(t){return r[t]}.bind(null,o));return e},n.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(t,"a",t),t},n.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},n.p="",n(n.s=0)}(); vendor/regenerator-runtime.min.js 0000644 00000014706 15013651111 0013161 0 ustar 00 var runtime=(t=>{var e,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(r){h=function(t,e,r){return t[e]=r}}function l(t,r,n,i){var a,c,u,h;r=r&&r.prototype instanceof d?r:d,r=Object.create(r.prototype),i=new O(i||[]);return o(r,"_invoke",{value:(a=t,c=n,u=i,h=s,function(t,r){if(h===y)throw new Error("Generator is already running");if(h===g){if("throw"===t)throw r;return{value:e,done:!0}}for(u.method=t,u.arg=r;;){var n=u.delegate;if(n&&(n=function t(r,n){var o=n.method,i=r.iterator[o];return i===e?(n.delegate=null,"throw"===o&&r.iterator.return&&(n.method="return",n.arg=e,t(r,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),v):"throw"===(o=f(i,r.iterator,n.arg)).type?(n.method="throw",n.arg=o.arg,n.delegate=null,v):(i=o.arg)?i.done?(n[r.resultName]=i.value,n.next=r.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}(n,u),n)){if(n===v)continue;return n}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(h===s)throw h=g,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);if(h=y,"normal"===(n=f(a,c,u)).type){if(h=u.done?g:p,n.arg!==v)return{value:n.arg,done:u.done}}else"throw"===n.type&&(h=g,u.method="throw",u.arg=n.arg)}})}),r}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var s="suspendedStart",p="suspendedYield",y="executing",g="completed",v={};function d(){}function m(){}function w(){}h(i={},a,(function(){return this}));var b=Object.getPrototypeOf,L=((b=b&&b(b(k([]))))&&b!==r&&n.call(b,a)&&(i=b),w.prototype=d.prototype=Object.create(i));function x(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){var r;o(this,"_invoke",{value:function(o,i){function a(){return new e((function(r,a){!function r(o,i,a,c){var u;if("throw"!==(o=f(t[o],t,i)).type)return(i=(u=o.arg).value)&&"object"==typeof i&&n.call(i,"__await")?e.resolve(i.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(i).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,c)}));c(o.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}})}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function O(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function k(t){if(null!=t){var r,o=t[a];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(o=function o(){for(;++r<t.length;)if(n.call(t,r))return o.value=t[r],o.done=!1,o;return o.value=e,o.done=!0,o}).next=o}throw new TypeError(typeof t+" is not iterable")}return o(L,"constructor",{value:m.prototype=w,configurable:!0}),o(w,"constructor",{value:m,configurable:!0}),m.displayName=h(w,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){return!!(t="function"==typeof t&&t.constructor)&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,h(t,u,"GeneratorFunction")),t.prototype=Object.create(L),t},t.awrap=function(t){return{__await:t}},x(E.prototype),h(E.prototype,c,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new E(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(L),h(L,u,"Generator"),h(L,a,(function(){return this})),h(L,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=k,O.prototype={constructor:O,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(_),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var i=this.tryEntries.length-1;0<=i;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),h=n.call(a,"finallyLoc");if(u&&h){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;0<=r;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}var a=(i=i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc?null:i)?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,o=this.tryEntries[e];if(o.tryLoc===t)return"throw"===(r=o.completion).type&&(n=r.arg,_(o)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:k(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t})("object"==typeof module?module.exports:{});try{regeneratorRuntime=runtime}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=runtime:Function("r","regeneratorRuntime = r")(runtime)} vendor/lodash.js 0000644 00002046542 15013651111 0007660 0 ustar 00 /** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ ;(function() { /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined; /** Used as the semantic version number. */ var VERSION = '4.17.21'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; /** Error message constants. */ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', FUNC_ERROR_TEXT = 'Expected a function', INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as the maximum memoize cache size. */ var MAX_MEMOIZE_SIZE = 500; /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; /** Used to compose bitmasks for function metadata. */ var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; /** Used as default options for `_.truncate`. */ var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = '...'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, HOT_SPAN = 16; /** Used to indicate the type of lazy iteratees. */ var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 1.7976931348623157e+308, NAN = 0 / 0; /** Used as references for the maximum length and index of an array. */ var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; /** Used to associate wrap methods with their bit flags. */ var wrapFlags = [ ['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG] ]; /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', asyncTag = '[object AsyncFunction]', boolTag = '[object Boolean]', dateTag = '[object Date]', domExcTag = '[object DOMException]', errorTag = '[object Error]', funcTag = '[object Function]', genTag = '[object GeneratorFunction]', mapTag = '[object Map]', numberTag = '[object Number]', nullTag = '[object Null]', objectTag = '[object Object]', promiseTag = '[object Promise]', proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', symbolTag = '[object Symbol]', undefinedTag = '[object Undefined]', weakMapTag = '[object WeakMap]', weakSetTag = '[object WeakSet]'; var arrayBufferTag = '[object ArrayBuffer]', dataViewTag = '[object DataView]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]'; /** Used to match empty string literals in compiled template source. */ var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; /** Used to match HTML entities and HTML characters. */ var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); /** Used to match template delimiters. */ var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); /** Used to match leading whitespace. */ var reTrimStart = /^\s+/; /** Used to match a single whitespace character. */ var reWhitespace = /\s/; /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; /** * Used to validate the `validate` option in `_.template` variable. * * Forbids characters which could potentially change the meaning of the function argument definition: * - "()," (modification of function parameters) * - "=" (default value) * - "[]{}" (destructuring of function parameters) * - "/" (beginning of a comment) * - whitespace */ var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Used to match * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; /** Used to detect binary string values. */ var reIsBinary = /^0b[01]+$/i; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Used to detect octal string values. */ var reIsOctal = /^0o[0-7]+$/i; /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; /** Used to match Latin Unicode letters (excluding mathematical operators). */ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; /** Used to ensure capturing order of template delimiters. */ var reNoMatch = /($^)/; /** Used to match unescaped characters in compiled string literals. */ var reUnescapedString = /['\n\r\u2028\u2029\\]/g; /** Used to compose unicode character classes. */ var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = '\\u2700-\\u27bf', rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', rsPunctuationRange = '\\u2000-\\u206f', rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', rsVarRange = '\\ufe0e\\ufe0f', rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; /** Used to compose unicode capture groups. */ var rsApos = "['\u2019]", rsAstral = '[' + rsAstralRange + ']', rsBreak = '[' + rsBreakRange + ']', rsCombo = '[' + rsComboRange + ']', rsDigits = '\\d+', rsDingbat = '[' + rsDingbatRange + ']', rsLower = '[' + rsLowerRange + ']', rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', rsFitz = '\\ud83c[\\udffb-\\udfff]', rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', rsNonAstral = '[^' + rsAstralRange + ']', rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', rsUpper = '[' + rsUpperRange + ']', rsZWJ = '\\u200d'; /** Used to compose unicode regexes. */ var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', reOptMod = rsModifier + '?', rsOptVar = '[' + rsVarRange + ']?', rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; /** Used to match apostrophes. */ var reApos = RegExp(rsApos, 'g'); /** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). */ var reComboMark = RegExp(rsCombo, 'g'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** Used to match complex or compound words. */ var reUnicodeWord = RegExp([ rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, rsUpper + '+' + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join('|'), 'g'); /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); /** Used to detect strings that need a more robust regexp to match words. */ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** Used to assign default `context` object properties. */ var contextProps = [ 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' ]; /** Used to make template sourceURLs easier to identify. */ var templateCounter = -1; /** Used to identify `toStringTag` values of typed arrays. */ var typedArrayTags = {}; typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; /** Used to identify `toStringTag` values supported by `_.clone`. */ var cloneableTags = {}; cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; /** Used to map Latin Unicode letters to basic Latin letters. */ var deburredLetters = { // Latin-1 Supplement block. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', '\xc7': 'C', '\xe7': 'c', '\xd0': 'D', '\xf0': 'd', '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', '\xd1': 'N', '\xf1': 'n', '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', '\xc6': 'Ae', '\xe6': 'ae', '\xde': 'Th', '\xfe': 'th', '\xdf': 'ss', // Latin Extended-A block. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', '\u0134': 'J', '\u0135': 'j', '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', '\u0163': 't', '\u0165': 't', '\u0167': 't', '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', '\u0174': 'W', '\u0175': 'w', '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', '\u0132': 'IJ', '\u0133': 'ij', '\u0152': 'Oe', '\u0153': 'oe', '\u0149': "'n", '\u017f': 's' }; /** Used to map characters to HTML entities. */ var htmlEscapes = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; /** Used to map HTML entities to characters. */ var htmlUnescapes = { '&': '&', '<': '<', '>': '>', '"': '"', ''': "'" }; /** Used to escape characters for inclusion in compiled string literals. */ var stringEscapes = { '\\': '\\', "'": "'", '\n': 'n', '\r': 'r', '\u2028': 'u2028', '\u2029': 'u2029' }; /** Built-in method references without a dependency on `root`. */ var freeParseFloat = parseFloat, freeParseInt = parseInt; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** Detect free variable `exports`. */ var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; /** Detect free variable `process` from Node.js. */ var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ var nodeUtil = (function() { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; if (types) { return types; } // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); } catch (e) {} }()); /* Node.js helper references. */ var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /*--------------------------------------------------------------------------*/ /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * * @private * @param {Function} func The function to invoke. * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); case 3: return func.call(thisArg, args[0], args[1], args[2]); } return func.apply(thisArg, args); } /** * A specialized version of `baseAggregator` for arrays. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; setter(accumulator, value, iteratee(value), array); } return accumulator; } /** * A specialized version of `_.forEach` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEach(array, iteratee) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { break; } } return array; } /** * A specialized version of `_.forEachRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns `array`. */ function arrayEachRight(array, iteratee) { var length = array == null ? 0 : array.length; while (length--) { if (iteratee(array[length], length, array) === false) { break; } } return array; } /** * A specialized version of `_.every` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. */ function arrayEvery(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (!predicate(array[index], index, array)) { return false; } } return true; } /** * A specialized version of `_.filter` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[resIndex++] = value; } } return result; } /** * A specialized version of `_.includes` for arrays without support for * specifying an index to search from. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludes(array, value) { var length = array == null ? 0 : array.length; return !!length && baseIndexOf(array, value, 0) > -1; } /** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ function arrayIncludesWith(array, value, comparator) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { return true; } } return false; } /** * A specialized version of `_.map` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function arrayMap(array, iteratee) { var index = -1, length = array == null ? 0 : array.length, result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); } return result; } /** * Appends the elements of `values` to `array`. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to append. * @returns {Array} Returns `array`. */ function arrayPush(array, values) { var index = -1, length = values.length, offset = array.length; while (++index < length) { array[offset + index] = values[index]; } return array; } /** * A specialized version of `_.reduce` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the first element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; } while (++index < length) { accumulator = iteratee(accumulator, array[index], index, array); } return accumulator; } /** * A specialized version of `_.reduceRight` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} [accumulator] The initial value. * @param {boolean} [initAccum] Specify using the last element of `array` as * the initial value. * @returns {*} Returns the accumulated value. */ function arrayReduceRight(array, iteratee, accumulator, initAccum) { var length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[--length]; } while (length--) { accumulator = iteratee(accumulator, array[length], length, array); } return accumulator; } /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function arraySome(array, predicate) { var index = -1, length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { return true; } } return false; } /** * Gets the size of an ASCII `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ var asciiSize = baseProperty('length'); /** * Converts an ASCII `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function asciiToArray(string) { return string.split(''); } /** * Splits an ASCII `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function asciiWords(string) { return string.match(reAsciiWord) || []; } /** * The base implementation of methods like `_.findKey` and `_.findLastKey`, * without support for iteratee shorthands, which iterates over `collection` * using `eachFunc`. * * @private * @param {Array|Object} collection The collection to inspect. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the found element or its key, else `undefined`. */ function baseFindKey(collection, predicate, eachFunc) { var result; eachFunc(collection, function(value, key, collection) { if (predicate(value, key, collection)) { result = key; return false; } }); return result; } /** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { return index; } } return -1; } /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); } /** * This function is like `baseIndexOf` except that it accepts a comparator. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @param {Function} comparator The comparator invoked per element. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (comparator(array[index], value)) { return index; } } return -1; } /** * The base implementation of `_.isNaN` without support for number objects. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. */ function baseIsNaN(value) { return value !== value; } /** * The base implementation of `_.mean` and `_.meanBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the mean. */ function baseMean(array, iteratee) { var length = array == null ? 0 : array.length; return length ? (baseSum(array, iteratee) / length) : NAN; } /** * The base implementation of `_.property` without support for deep paths. * * @private * @param {string} key The key of the property to get. * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { return function(object) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.propertyOf` without support for deep paths. * * @private * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { return function(key) { return object == null ? undefined : object[key]; }; } /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {*} accumulator The initial value. * @param {boolean} initAccum Specify using the first or last element of * `collection` as the initial value. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the accumulated value. */ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { eachFunc(collection, function(value, index, collection) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); }); return accumulator; } /** * The base implementation of `_.sortBy` which uses `comparer` to define the * sort order of `array` and replaces criteria objects with their corresponding * values. * * @private * @param {Array} array The array to sort. * @param {Function} comparer The function to define sort order. * @returns {Array} Returns `array`. */ function baseSortBy(array, comparer) { var length = array.length; array.sort(comparer); while (length--) { array[length] = array[length].value; } return array; } /** * The base implementation of `_.sum` and `_.sumBy` without support for * iteratee shorthands. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {number} Returns the sum. */ function baseSum(array, iteratee) { var result, index = -1, length = array.length; while (++index < length) { var current = iteratee(array[index]); if (current !== undefined) { result = result === undefined ? current : (result + current); } } return result; } /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. * * @private * @param {number} n The number of times to invoke `iteratee`. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the array of results. */ function baseTimes(n, iteratee) { var index = -1, result = Array(n); while (++index < n) { result[index] = iteratee(index); } return result; } /** * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array * of key-value pairs for `object` corresponding to the property names of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { return arrayMap(props, function(key) { return [key, object[key]]; }); } /** * The base implementation of `_.trim`. * * @private * @param {string} string The string to trim. * @returns {string} Returns the trimmed string. */ function baseTrim(string) { return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string; } /** * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. */ function baseUnary(func) { return function(value) { return func(value); }; } /** * The base implementation of `_.values` and `_.valuesIn` which creates an * array of `object` property values corresponding to the property names * of `props`. * * @private * @param {Object} object The object to query. * @param {Array} props The property names to get values for. * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { return arrayMap(props, function(key) { return object[key]; }); } /** * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function cacheHas(cache, key) { return cache.has(key); } /** * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the first unmatched string symbol. */ function charsStartIndex(strSymbols, chrSymbols) { var index = -1, length = strSymbols.length; while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol * that is not found in the character symbols. * * @private * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the last unmatched string symbol. */ function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} return index; } /** * Gets the number of `placeholder` occurrences in `array`. * * @private * @param {Array} array The array to inspect. * @param {*} placeholder The placeholder to search for. * @returns {number} Returns the placeholder count. */ function countHolders(array, placeholder) { var length = array.length, result = 0; while (length--) { if (array[length] === placeholder) { ++result; } } return result; } /** * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A * letters to basic Latin letters. * * @private * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ var deburrLetter = basePropertyOf(deburredLetters); /** * Used by `_.escape` to convert characters to HTML entities. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ var escapeHtmlChar = basePropertyOf(htmlEscapes); /** * Used by `_.template` to escape characters for inclusion in compiled string literals. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ function escapeStringChar(chr) { return '\\' + stringEscapes[chr]; } /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ function hasUnicode(string) { return reHasUnicode.test(string); } /** * Checks if `string` contains a word composed of Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a word is found, else `false`. */ function hasUnicodeWord(string) { return reHasUnicodeWord.test(string); } /** * Converts `iterator` to an array. * * @private * @param {Object} iterator The iterator to convert. * @returns {Array} Returns the converted array. */ function iteratorToArray(iterator) { var data, result = []; while (!(data = iterator.next()).done) { result.push(data.value); } return result; } /** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. */ function mapToArray(map) { var index = -1, result = Array(map.size); map.forEach(function(value, key) { result[++index] = [key, value]; }); return result; } /** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. */ function overArg(func, transform) { return function(arg) { return func(transform(arg)); }; } /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * * @private * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. */ function replaceHolders(array, placeholder) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value === placeholder || value === PLACEHOLDER) { array[index] = PLACEHOLDER; result[resIndex++] = index; } } return result; } /** * Converts `set` to an array of its values. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the values. */ function setToArray(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = value; }); return result; } /** * Converts `set` to its value-value pairs. * * @private * @param {Object} set The set to convert. * @returns {Array} Returns the value-value pairs. */ function setToPairs(set) { var index = -1, result = Array(set.size); set.forEach(function(value) { result[++index] = [value, value]; }); return result; } /** * A specialized version of `_.indexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (array[index] === value) { return index; } } return -1; } /** * A specialized version of `_.lastIndexOf` which performs strict equality * comparisons of values, i.e. `===`. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function strictLastIndexOf(array, value, fromIndex) { var index = fromIndex + 1; while (index--) { if (array[index] === value) { return index; } } return index; } /** * Gets the number of symbols in `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the string size. */ function stringSize(string) { return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); } /** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function stringToArray(string) { return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } /** * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace * character of `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the index of the last non-whitespace character. */ function trimmedEndIndex(string) { var index = string.length; while (index-- && reWhitespace.test(string.charAt(index))) {} return index; } /** * Used by `_.unescape` to convert HTML entities to characters. * * @private * @param {string} chr The matched character to unescape. * @returns {string} Returns the unescaped character. */ var unescapeHtmlChar = basePropertyOf(htmlUnescapes); /** * Gets the size of a Unicode `string`. * * @private * @param {string} string The string inspect. * @returns {number} Returns the string size. */ function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { ++result; } return result; } /** * Converts a Unicode `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */ function unicodeToArray(string) { return string.match(reUnicode) || []; } /** * Splits a Unicode `string` into an array of its words. * * @private * @param {string} The string to inspect. * @returns {Array} Returns the words of `string`. */ function unicodeWords(string) { return string.match(reUnicodeWord) || []; } /*--------------------------------------------------------------------------*/ /** * Create a new pristine `lodash` function using the `context` object. * * @static * @memberOf _ * @since 1.1.0 * @category Util * @param {Object} [context=root] The context object. * @returns {Function} Returns a new `lodash` function. * @example * * _.mixin({ 'foo': _.constant('foo') }); * * var lodash = _.runInContext(); * lodash.mixin({ 'bar': lodash.constant('bar') }); * * _.isFunction(_.foo); * // => true * _.isFunction(_.bar); * // => false * * lodash.isFunction(lodash.foo); * // => false * lodash.isFunction(lodash.bar); * // => true * * // Create a suped-up `defer` in Node.js. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; */ var runInContext = (function runInContext(context) { context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); /** Built-in constructor references. */ var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError; /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = context['__core-js_shared__']; /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** Used to generate unique IDs. */ var idCounter = 0; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var nativeObjectToString = objectProto.toString; /** Used to infer the `Object` constructor. */ var objectCtorString = funcToString.call(Object); /** Used to restore the original `_` reference in `_.noConflict`. */ var oldDash = root._; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Buffer = moduleExports ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, symIterator = Symbol ? Symbol.iterator : undefined, symToStringTag = Symbol ? Symbol.toStringTag : undefined; var defineProperty = (function() { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; } catch (e) {} }()); /** Mocked built-ins. */ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse; /* Built-in method references that are verified to be native. */ var DataView = getNative(context, 'DataView'), Map = getNative(context, 'Map'), Promise = getNative(context, 'Promise'), Set = getNative(context, 'Set'), WeakMap = getNative(context, 'WeakMap'), nativeCreate = getNative(Object, 'create'); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; /** Used to lookup unminified function names. */ var realNames = {}; /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /*------------------------------------------------------------------------*/ /** * Creates a `lodash` object which wraps `value` to enable implicit method * chain sequences. Methods that operate on and return arrays, collections, * and functions can be chained together. Methods that retrieve a single value * or may return a primitive value will automatically end the chain sequence * and return the unwrapped value. Otherwise, the value must be unwrapped * with `_#value`. * * Explicit chain sequences, which must be unwrapped with `_#value`, may be * enabled using `_.chain`. * * The execution of chained methods is lazy, that is, it's deferred until * `_#value` is implicitly or explicitly called. * * Lazy evaluation allows several methods to support shortcut fusion. * Shortcut fusion is an optimization to merge iteratee calls; this avoids * the creation of intermediate arrays and can greatly reduce the number of * iteratee executions. Sections of a chain sequence qualify for shortcut * fusion if the section is applied to an array and iteratees accept only * one argument. The heuristic for whether a section qualifies for shortcut * fusion is subject to change. * * Chaining is supported in custom builds as long as the `_#value` method is * directly or indirectly included in the build. * * In addition to lodash methods, wrappers have `Array` and `String` methods. * * The wrapper `Array` methods are: * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` * * The wrapper `String` methods are: * `replace` and `split` * * The wrapper methods that support shortcut fusion are: * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` * * The chainable wrapper methods are: * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, * `zipObject`, `zipObjectDeep`, and `zipWith` * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, * `upperFirst`, `value`, and `words` * * @name _ * @constructor * @category Seq * @param {*} value The value to wrap in a `lodash` instance. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2, 3]); * * // Returns an unwrapped value. * wrapped.reduce(_.add); * // => 6 * * // Returns a wrapped value. * var squares = wrapped.map(square); * * _.isArray(squares); * // => false * * _.isArray(squares.value()); * // => true */ function lodash(value) { if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { if (value instanceof LodashWrapper) { return value; } if (hasOwnProperty.call(value, '__wrapped__')) { return wrapperClone(value); } } return new LodashWrapper(value); } /** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ var baseCreate = (function() { function object() {} return function(proto) { if (!isObject(proto)) { return {}; } if (objectCreate) { return objectCreate(proto); } object.prototype = proto; var result = new object; object.prototype = undefined; return result; }; }()); /** * The function whose prototype chain sequence wrappers inherit from. * * @private */ function baseLodash() { // No operation performed. } /** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. */ function LodashWrapper(value, chainAll) { this.__wrapped__ = value; this.__actions__ = []; this.__chain__ = !!chainAll; this.__index__ = 0; this.__values__ = undefined; } /** * By default, the template delimiters used by lodash are like those in * embedded Ruby (ERB) as well as ES2015 template strings. Change the * following template settings to use alternative delimiters. * * @static * @memberOf _ * @type {Object} */ lodash.templateSettings = { /** * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings * @type {RegExp} */ 'escape': reEscape, /** * Used to detect code to be evaluated. * * @memberOf _.templateSettings * @type {RegExp} */ 'evaluate': reEvaluate, /** * Used to detect `data` property values to inject. * * @memberOf _.templateSettings * @type {RegExp} */ 'interpolate': reInterpolate, /** * Used to reference the data object in the template text. * * @memberOf _.templateSettings * @type {string} */ 'variable': '', /** * Used to import variables into the compiled template. * * @memberOf _.templateSettings * @type {Object} */ 'imports': { /** * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports * @type {Function} */ '_': lodash } }; // Ensure wrappers are instances of `baseLodash`. lodash.prototype = baseLodash.prototype; lodash.prototype.constructor = lodash; LodashWrapper.prototype = baseCreate(baseLodash.prototype); LodashWrapper.prototype.constructor = LodashWrapper; /*------------------------------------------------------------------------*/ /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. */ function LazyWrapper(value) { this.__wrapped__ = value; this.__actions__ = []; this.__dir__ = 1; this.__filtered__ = false; this.__iteratees__ = []; this.__takeCount__ = MAX_ARRAY_LENGTH; this.__views__ = []; } /** * Creates a clone of the lazy wrapper object. * * @private * @name clone * @memberOf LazyWrapper * @returns {Object} Returns the cloned `LazyWrapper` object. */ function lazyClone() { var result = new LazyWrapper(this.__wrapped__); result.__actions__ = copyArray(this.__actions__); result.__dir__ = this.__dir__; result.__filtered__ = this.__filtered__; result.__iteratees__ = copyArray(this.__iteratees__); result.__takeCount__ = this.__takeCount__; result.__views__ = copyArray(this.__views__); return result; } /** * Reverses the direction of lazy iteration. * * @private * @name reverse * @memberOf LazyWrapper * @returns {Object} Returns the new reversed `LazyWrapper` object. */ function lazyReverse() { if (this.__filtered__) { var result = new LazyWrapper(this); result.__dir__ = -1; result.__filtered__ = true; } else { result = this.clone(); result.__dir__ *= -1; } return result; } /** * Extracts the unwrapped value from its lazy wrapper. * * @private * @name value * @memberOf LazyWrapper * @returns {*} Returns the unwrapped value. */ function lazyValue() { var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : (start - 1), iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); if (!isArr || (!isRight && arrLength == length && takeCount == length)) { return baseWrapperValue(array, this.__actions__); } var result = []; outer: while (length-- && resIndex < takeCount) { index += dir; var iterIndex = -1, value = array[index]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type, computed = iteratee(value); if (type == LAZY_MAP_FLAG) { value = computed; } else if (!computed) { if (type == LAZY_FILTER_FLAG) { continue outer; } else { break outer; } } } result[resIndex++] = value; } return result; } // Ensure `LazyWrapper` is an instance of `baseLodash`. LazyWrapper.prototype = baseCreate(baseLodash.prototype); LazyWrapper.prototype.constructor = LazyWrapper; /*------------------------------------------------------------------------*/ /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; this.size = 0; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { var result = this.has(key) && delete this.__data__[key]; this.size -= result ? 1 : 0; return result; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /*------------------------------------------------------------------------*/ /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; this.size = 0; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } --this.size; return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { ++this.size; data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /*------------------------------------------------------------------------*/ /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { var result = getMapData(this, key)['delete'](key); this.size -= result ? 1 : 0; return result; } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { var data = getMapData(this, key), size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /*------------------------------------------------------------------------*/ /** * * Creates an array cache object to store unique values. * * @private * @constructor * @param {Array} [values] The values to cache. */ function SetCache(values) { var index = -1, length = values == null ? 0 : values.length; this.__data__ = new MapCache; while (++index < length) { this.add(values[index]); } } /** * Adds `value` to the array cache. * * @private * @name add * @memberOf SetCache * @alias push * @param {*} value The value to cache. * @returns {Object} Returns the cache instance. */ function setCacheAdd(value) { this.__data__.set(value, HASH_UNDEFINED); return this; } /** * Checks if `value` is in the array cache. * * @private * @name has * @memberOf SetCache * @param {*} value The value to search for. * @returns {number} Returns `true` if `value` is found, else `false`. */ function setCacheHas(value) { return this.__data__.has(value); } // Add methods to `SetCache`. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; SetCache.prototype.has = setCacheHas; /*------------------------------------------------------------------------*/ /** * Creates a stack cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { var data = this.__data__ = new ListCache(entries); this.size = data.size; } /** * Removes all key-value entries from the stack. * * @private * @name clear * @memberOf Stack */ function stackClear() { this.__data__ = new ListCache; this.size = 0; } /** * Removes `key` and its value from the stack. * * @private * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { var data = this.__data__, result = data['delete'](key); this.size = data.size; return result; } /** * Gets the stack value for `key`. * * @private * @name get * @memberOf Stack * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function stackGet(key) { return this.__data__.get(key); } /** * Checks if a stack value for `key` exists. * * @private * @name has * @memberOf Stack * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function stackHas(key) { return this.__data__.has(key); } /** * Sets the stack `key` to `value`. * * @private * @name set * @memberOf Stack * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { var data = this.__data__; if (data instanceof ListCache) { var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); this.size = ++data.size; return this; } data = this.__data__ = new MapCache(pairs); } data.set(key, value); this.size = data.size; return this; } // Add methods to `Stack`. Stack.prototype.clear = stackClear; Stack.prototype['delete'] = stackDelete; Stack.prototype.get = stackGet; Stack.prototype.has = stackHas; Stack.prototype.set = stackSet; /*------------------------------------------------------------------------*/ /** * Creates an array of the enumerable property names of the array-like `value`. * * @private * @param {*} value The value to query. * @param {boolean} inherited Specify returning inherited property names. * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode. key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers. (isBuff && (key == 'offset' || key == 'parent')) || // PhantomJS 2 has enumerable non-index properties on typed arrays. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || // Skip index properties. isIndex(key, length) ))) { result.push(key); } } return result; } /** * A specialized version of `_.sample` for arrays. * * @private * @param {Array} array The array to sample. * @returns {*} Returns the random element. */ function arraySample(array) { var length = array.length; return length ? array[baseRandom(0, length - 1)] : undefined; } /** * A specialized version of `_.sampleSize` for arrays. * * @private * @param {Array} array The array to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function arraySampleSize(array, n) { return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); } /** * A specialized version of `_.shuffle` for arrays. * * @private * @param {Array} array The array to shuffle. * @returns {Array} Returns the new shuffled array. */ function arrayShuffle(array) { return shuffleSelf(copyArray(array)); } /** * This function is like `assignValue` except that it doesn't assign * `undefined` values. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Assigns `value` to `key` of `object` if the existing value is not equivalent * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { baseAssignValue(object, key, value); } } /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * Aggregates elements of `collection` on `accumulator` with keys transformed * by `iteratee` and values set by `setter`. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. */ function baseAggregator(collection, setter, iteratee, accumulator) { baseEach(collection, function(value, key, collection) { setter(accumulator, value, iteratee(value), collection); }); return accumulator; } /** * The base implementation of `_.assign` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssign(object, source) { return object && copyObject(source, keys(source), object); } /** * The base implementation of `_.assignIn` without support for multiple sources * or `customizer` functions. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @returns {Object} Returns `object`. */ function baseAssignIn(object, source) { return object && copyObject(source, keysIn(source), object); } /** * The base implementation of `assignValue` and `assignMergeValue` without * value checks. * * @private * @param {Object} object The object to modify. * @param {string} key The key of the property to assign. * @param {*} value The value to assign. */ function baseAssignValue(object, key, value) { if (key == '__proto__' && defineProperty) { defineProperty(object, key, { 'configurable': true, 'enumerable': true, 'value': value, 'writable': true }); } else { object[key] = value; } } /** * The base implementation of `_.at` without support for individual paths. * * @private * @param {Object} object The object to iterate over. * @param {string[]} paths The property paths to pick. * @returns {Array} Returns the picked elements. */ function baseAt(object, paths) { var index = -1, length = paths.length, result = Array(length), skip = object == null; while (++index < length) { result[index] = skip ? undefined : get(object, paths[index]); } return result; } /** * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. */ function baseClamp(number, lower, upper) { if (number === number) { if (upper !== undefined) { number = number <= upper ? number : upper; } if (lower !== undefined) { number = number >= lower ? number : lower; } } return number; } /** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * * @private * @param {*} value The value to clone. * @param {boolean} bitmask The bitmask flags. * 1 - Deep clone * 2 - Flatten inherited properties * 4 - Clone symbols * @param {Function} [customizer] The function to customize cloning. * @param {string} [key] The key of `value`. * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. */ function baseClone(value, bitmask, customizer, key, object, stack) { var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; if (customizer) { result = object ? customizer(value, key, object, stack) : customizer(value); } if (result !== undefined) { return result; } if (!isObject(value)) { return value; } var isArr = isArray(value); if (isArr) { result = initCloneArray(value); if (!isDeep) { return copyArray(value, result); } } else { var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { result = (isFlat || isFunc) ? {} : initCloneObject(value); if (!isDeep) { return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); } } else { if (!cloneableTags[tag]) { return object ? value : {}; } result = initCloneByTag(value, tag, isDeep); } } // Check for circular references and return its corresponding clone. stack || (stack = new Stack); var stacked = stack.get(value); if (stacked) { return stacked; } stack.set(value, result); if (isSet(value)) { value.forEach(function(subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); } else if (isMap(value)) { value.forEach(function(subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); } var keysFunc = isFull ? (isFlat ? getAllKeysIn : getAllKeys) : (isFlat ? keysIn : keys); var props = isArr ? undefined : keysFunc(value); arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); return result; } /** * The base implementation of `_.conforms` which doesn't clone `source`. * * @private * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new spec function. */ function baseConforms(source) { var props = keys(source); return function(object) { return baseConformsTo(object, source, props); }; } /** * The base implementation of `_.conformsTo` which accepts `props` to check. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. */ function baseConformsTo(object, source, props) { var length = props.length; if (object == null) { return !length; } object = Object(object); while (length--) { var key = props[length], predicate = source[key], value = object[key]; if ((value === undefined && !(key in object)) || !predicate(value)) { return false; } } return true; } /** * The base implementation of `_.delay` and `_.defer` which accepts `args` * to provide to `func`. * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {Array} args The arguments to provide to `func`. * @returns {number|Object} Returns the timer id or timeout object. */ function baseDelay(func, wait, args) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return setTimeout(function() { func.apply(undefined, args); }, wait); } /** * The base implementation of methods like `_.difference` without support * for excluding multiple arrays or iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Array} values The values to exclude. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. */ function baseDifference(array, values, iteratee, comparator) { var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length; if (!length) { return result; } if (iteratee) { values = arrayMap(values, baseUnary(iteratee)); } if (comparator) { includes = arrayIncludesWith; isCommon = false; } else if (values.length >= LARGE_ARRAY_SIZE) { includes = cacheHas; isCommon = false; values = new SetCache(values); } outer: while (++index < length) { var value = array[index], computed = iteratee == null ? value : iteratee(value); value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var valuesIndex = valuesLength; while (valuesIndex--) { if (values[valuesIndex] === computed) { continue outer; } } result.push(value); } else if (!includes(values, computed, comparator)) { result.push(value); } } return result; } /** * The base implementation of `_.forEach` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEach = createBaseEach(baseForOwn); /** * The base implementation of `_.forEachRight` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array|Object} Returns `collection`. */ var baseEachRight = createBaseEach(baseForOwnRight, true); /** * The base implementation of `_.every` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false` */ function baseEvery(collection, predicate) { var result = true; baseEach(collection, function(value, index, collection) { result = !!predicate(value, index, collection); return result; }); return result; } /** * The base implementation of methods like `_.max` and `_.min` which accepts a * `comparator` to determine the extremum value. * * @private * @param {Array} array The array to iterate over. * @param {Function} iteratee The iteratee invoked per iteration. * @param {Function} comparator The comparator used to compare values. * @returns {*} Returns the extremum value. */ function baseExtremum(array, iteratee, comparator) { var index = -1, length = array.length; while (++index < length) { var value = array[index], current = iteratee(value); if (current != null && (computed === undefined ? (current === current && !isSymbol(current)) : comparator(current, computed) )) { var computed = current, result = value; } } return result; } /** * The base implementation of `_.fill` without an iteratee call guard. * * @private * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. */ function baseFill(array, value, start, end) { var length = array.length; start = toInteger(start); if (start < 0) { start = -start > length ? 0 : (length + start); } end = (end === undefined || end > length) ? length : toInteger(end); if (end < 0) { end += length; } end = start > end ? 0 : toLength(end); while (start < end) { array[start++] = value; } return array; } /** * The base implementation of `_.filter` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { var result = []; baseEach(collection, function(value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } }); return result; } /** * The base implementation of `_.flatten` with support for restricting flattening. * * @private * @param {Array} array The array to flatten. * @param {number} depth The maximum recursion depth. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. * @param {Array} [result=[]] The initial result value. * @returns {Array} Returns the new flattened array. */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, length = array.length; predicate || (predicate = isFlattenable); result || (result = []); while (++index < length) { var value = array[index]; if (depth > 0 && predicate(value)) { if (depth > 1) { // Recursively flatten arrays (susceptible to call stack limits). baseFlatten(value, depth - 1, predicate, isStrict, result); } else { arrayPush(result, value); } } else if (!isStrict) { result[result.length] = value; } } return result; } /** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseFor = createBaseFor(); /** * This function is like `baseFor` except that it iterates over properties * in the opposite order. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. */ var baseForRight = createBaseFor(true); /** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwn(object, iteratee) { return object && baseFor(object, iteratee, keys); } /** * The base implementation of `_.forOwnRight` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. */ function baseForOwnRight(object, iteratee) { return object && baseForRight(object, iteratee, keys); } /** * The base implementation of `_.functions` which creates an array of * `object` function property names filtered from `props`. * * @private * @param {Object} object The object to inspect. * @param {Array} props The property names to filter. * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { return arrayFilter(props, function(key) { return isFunction(object[key]); }); } /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = castPath(path, object); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } /** * The base implementation of `getAllKeys` and `getAllKeysIn` which uses * `keysFunc` and `symbolsFunc` to get the enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @param {Function} keysFunc The function to get the keys of `object`. * @param {Function} symbolsFunc The function to get the symbols of `object`. * @returns {Array} Returns the array of property names and symbols. */ function baseGetAllKeys(object, keysFunc, symbolsFunc) { var result = keysFunc(object); return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); } /** * The base implementation of `getTag` without fallbacks for buggy environments. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ function baseGetTag(value) { if (value == null) { return value === undefined ? undefinedTag : nullTag; } return (symToStringTag && symToStringTag in Object(value)) ? getRawTag(value) : objectToString(value); } /** * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. */ function baseGt(value, other) { return value > other; } /** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { return object != null && hasOwnProperty.call(object, key); } /** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHasIn(object, key) { return object != null && key in Object(object); } /** * The base implementation of `_.inRange` which doesn't coerce arguments. * * @private * @param {number} number The number to check. * @param {number} start The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. */ function baseInRange(number, start, end) { return number >= nativeMin(start, end) && number < nativeMax(start, end); } /** * The base implementation of methods like `_.intersection`, without support * for iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of shared values. */ function baseIntersection(arrays, iteratee, comparator) { var includes = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = []; while (othIndex--) { var array = arrays[othIndex]; if (othIndex && iteratee) { array = arrayMap(array, baseUnary(iteratee)); } maxLength = nativeMin(array.length, maxLength); caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) : undefined; } array = arrays[0]; var index = -1, seen = caches[0]; outer: while (++index < length && result.length < maxLength) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator) )) { othIndex = othLength; while (--othIndex) { var cache = caches[othIndex]; if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator)) ) { continue outer; } } if (seen) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.invert` and `_.invertBy` which inverts * `object` with values transformed by `iteratee` and set by `setter`. * * @private * @param {Object} object The object to iterate over. * @param {Function} setter The function to set `accumulator` values. * @param {Function} iteratee The iteratee to transform values. * @param {Object} accumulator The initial inverted object. * @returns {Function} Returns `accumulator`. */ function baseInverter(object, setter, iteratee, accumulator) { baseForOwn(object, function(value, key, object) { setter(accumulator, iteratee(value), key, object); }); return accumulator; } /** * The base implementation of `_.invoke` without support for individual * method arguments. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {Array} args The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. */ function baseInvoke(object, path, args) { path = castPath(path, object); object = parent(object, path); var func = object == null ? object : object[toKey(last(path))]; return func == null ? undefined : apply(func, object, args); } /** * The base implementation of `_.isArguments`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, */ function baseIsArguments(value) { return isObjectLike(value) && baseGetTag(value) == argsTag; } /** * The base implementation of `_.isArrayBuffer` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. */ function baseIsArrayBuffer(value) { return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; } /** * The base implementation of `_.isDate` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. */ function baseIsDate(value) { return isObjectLike(value) && baseGetTag(value) == dateTag; } /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {boolean} bitmask The bitmask flags. * 1 - Unordered comparison * 2 - Partial comparison * @param {Function} [customizer] The function to customize comparisons. * @param {Object} [stack] Tracks traversed `value` and `other` objects. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. */ function baseIsEqual(value, other, bitmask, customizer, stack) { if (value === other) { return true; } if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { return value !== value && other !== other; } return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); } /** * A specialized version of `baseIsEqual` for arrays and objects which performs * deep comparisons and tracks traversed objects enabling objects with circular * references to be compared. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} [stack] Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { return false; } objIsArr = true; objIsObj = false; } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); } } if (!isSameTag) { return false; } stack || (stack = new Stack); return equalObjects(object, other, bitmask, customizer, equalFunc, stack); } /** * The base implementation of `_.isMap` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. */ function baseIsMap(value) { return isObjectLike(value) && getTag(value) == mapTag; } /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, length = index, noCustomizer = !customizer; if (object == null) { return !length; } object = Object(object); while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) ? data[1] !== object[data[0]] : !(data[0] in object) ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], objValue = object[key], srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined && !(key in object)) { return false; } } else { var stack = new Stack; if (customizer) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result )) { return false; } } } return true; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.isRegExp` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. */ function baseIsRegExp(value) { return isObjectLike(value) && baseGetTag(value) == regexpTag; } /** * The base implementation of `_.isSet` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. */ function baseIsSet(value) { return isObjectLike(value) && getTag(value) == setTag; } /** * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. */ function baseIsTypedArray(value) { return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; } /** * The base implementation of `_.iteratee`. * * @private * @param {*} [value=_.identity] The value to convert to an iteratee. * @returns {Function} Returns the iteratee. */ function baseIteratee(value) { // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. if (typeof value == 'function') { return value; } if (value == null) { return identity; } if (typeof value == 'object') { return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } return property(value); } /** * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { if (!isPrototype(object)) { return nativeKeys(object); } var result = []; for (var key in Object(object)) { if (hasOwnProperty.call(object, key) && key != 'constructor') { result.push(key); } } return result; } /** * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { if (!isObject(object)) { return nativeKeysIn(object); } var isProto = isPrototype(object), result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } return result; } /** * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. */ function baseLt(value, other) { return value < other; } /** * The base implementation of `_.map` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Array} Returns the new mapped array. */ function baseMap(collection, iteratee) { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; } /** * The base implementation of `_.matches` which doesn't clone `source`. * * @private * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. */ function baseMatches(source) { var matchData = getMatchData(source); if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } return function(object) { return object === source || baseIsMatch(object, source, matchData); }; } /** * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. * * @private * @param {string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function baseMatchesProperty(path, srcValue) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } return function(object) { var objValue = get(object, path); return (objValue === undefined && objValue === srcValue) ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); }; } /** * The base implementation of `_.merge` without support for multiple sources. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {number} srcIndex The index of `source`. * @param {Function} [customizer] The function to customize merged values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMerge(object, source, srcIndex, customizer, stack) { if (object === source) { return; } baseFor(source, function(srcValue, key) { stack || (stack = new Stack); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); } else { var newValue = customizer ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) : undefined; if (newValue === undefined) { newValue = srcValue; } assignMergeValue(object, key, newValue); } }, keysIn); } /** * A specialized version of `baseMerge` for arrays and objects which performs * deep merges and tracks traversed objects enabling objects with circular * references to be merged. * * @private * @param {Object} object The destination object. * @param {Object} source The source object. * @param {string} key The key of the value to merge. * @param {number} srcIndex The index of `source`. * @param {Function} mergeFunc The function to merge values. * @param {Function} [customizer] The function to customize assigned values. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); return; } var newValue = customizer ? customizer(objValue, srcValue, (key + ''), object, source, stack) : undefined; var isCommon = newValue === undefined; if (isCommon) { var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } else if (isBuff) { isCommon = false; newValue = cloneBuffer(srcValue, true); } else if (isTyped) { isCommon = false; newValue = cloneTypedArray(srcValue, true); } else { newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || isFunction(objValue)) { newValue = initCloneObject(srcValue); } } else { isCommon = false; } } if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack['delete'](srcValue); } assignMergeValue(object, key, newValue); } /** * The base implementation of `_.nth` which doesn't coerce arguments. * * @private * @param {Array} array The array to query. * @param {number} n The index of the element to return. * @returns {*} Returns the nth element of `array`. */ function baseNth(array, n) { var length = array.length; if (!length) { return; } n += n < 0 ? length : 0; return isIndex(n, length) ? array[n] : undefined; } /** * The base implementation of `_.orderBy` without param guards. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. * @param {string[]} orders The sort orders of `iteratees`. * @returns {Array} Returns the new sorted array. */ function baseOrderBy(collection, iteratees, orders) { if (iteratees.length) { iteratees = arrayMap(iteratees, function(iteratee) { if (isArray(iteratee)) { return function(value) { return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); } } return iteratee; }); } else { iteratees = [identity]; } var index = -1; iteratees = arrayMap(iteratees, baseUnary(getIteratee())); var result = baseMap(collection, function(value, key, collection) { var criteria = arrayMap(iteratees, function(iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); return baseSortBy(result, function(object, other) { return compareMultiple(object, other, orders); }); } /** * The base implementation of `_.pick` without support for individual * property identifiers. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @returns {Object} Returns the new object. */ function basePick(object, paths) { return basePickBy(object, paths, function(value, path) { return hasIn(object, path); }); } /** * The base implementation of `_.pickBy` without support for iteratee shorthands. * * @private * @param {Object} object The source object. * @param {string[]} paths The property paths to pick. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ function basePickBy(object, paths, predicate) { var index = -1, length = paths.length, result = {}; while (++index < length) { var path = paths[index], value = baseGet(object, path); if (predicate(value, path)) { baseSet(result, castPath(path, object), value); } } return result; } /** * A specialized version of `baseProperty` which supports deep paths. * * @private * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { return function(object) { return baseGet(object, path); }; } /** * The base implementation of `_.pullAllBy` without support for iteratee * shorthands. * * @private * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. */ function basePullAll(array, values, iteratee, comparator) { var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array; if (array === values) { values = copyArray(values); } if (iteratee) { seen = arrayMap(array, baseUnary(iteratee)); } while (++index < length) { var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value; while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { splice.call(seen, fromIndex, 1); } splice.call(array, fromIndex, 1); } } return array; } /** * The base implementation of `_.pullAt` without support for individual * indexes or capturing the removed elements. * * @private * @param {Array} array The array to modify. * @param {number[]} indexes The indexes of elements to remove. * @returns {Array} Returns `array`. */ function basePullAt(array, indexes) { var length = array ? indexes.length : 0, lastIndex = length - 1; while (length--) { var index = indexes[length]; if (length == lastIndex || index !== previous) { var previous = index; if (isIndex(index)) { splice.call(array, index, 1); } else { baseUnset(array, index); } } } return array; } /** * The base implementation of `_.random` without support for returning * floating-point numbers. * * @private * @param {number} lower The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the random number. */ function baseRandom(lower, upper) { return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); } /** * The base implementation of `_.range` and `_.rangeRight` which doesn't * coerce arguments. * * @private * @param {number} start The start of the range. * @param {number} end The end of the range. * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the range of numbers. */ function baseRange(start, end, step, fromRight) { var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length); while (length--) { result[fromRight ? length : ++index] = start; start += step; } return result; } /** * The base implementation of `_.repeat` which doesn't coerce arguments. * * @private * @param {string} string The string to repeat. * @param {number} n The number of times to repeat the string. * @returns {string} Returns the repeated string. */ function baseRepeat(string, n) { var result = ''; if (!string || n < 1 || n > MAX_SAFE_INTEGER) { return result; } // Leverage the exponentiation by squaring algorithm for a faster repeat. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. do { if (n % 2) { result += string; } n = nativeFloor(n / 2); if (n) { string += string; } } while (n); return result; } /** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. */ function baseRest(func, start) { return setToString(overRest(func, start, identity), func + ''); } /** * The base implementation of `_.sample`. * * @private * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. */ function baseSample(collection) { return arraySample(values(collection)); } /** * The base implementation of `_.sampleSize` without param guards. * * @private * @param {Array|Object} collection The collection to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. */ function baseSampleSize(collection, n) { var array = values(collection); return shuffleSelf(array, baseClamp(n, 0, array.length)); } /** * The base implementation of `_.set`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { if (!isObject(object)) { return object; } path = castPath(path, object); var index = -1, length = path.length, lastIndex = length - 1, nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), newValue = value; if (key === '__proto__' || key === 'constructor' || key === 'prototype') { return object; } if (index != lastIndex) { var objValue = nested[key]; newValue = customizer ? customizer(objValue, key, nested) : undefined; if (newValue === undefined) { newValue = isObject(objValue) ? objValue : (isIndex(path[index + 1]) ? [] : {}); } } assignValue(nested, key, newValue); nested = nested[key]; } return object; } /** * The base implementation of `setData` without support for hot loop shorting. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var baseSetData = !metaMap ? identity : function(func, data) { metaMap.set(func, data); return func; }; /** * The base implementation of `setToString` without support for hot loop shorting. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var baseSetToString = !defineProperty ? identity : function(func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, 'value': constant(string), 'writable': true }); }; /** * The base implementation of `_.shuffle`. * * @private * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. */ function baseShuffle(collection) { return shuffleSelf(values(collection)); } /** * The base implementation of `_.slice` without an iteratee call guard. * * @private * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function baseSlice(array, start, end) { var index = -1, length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); } end = end > length ? length : end; if (end < 0) { end += length; } length = start > end ? 0 : ((end - start) >>> 0); start >>>= 0; var result = Array(length); while (++index < length) { result[index] = array[index + start]; } return result; } /** * The base implementation of `_.some` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. */ function baseSome(collection, predicate) { var result; baseEach(collection, function(value, index, collection) { result = predicate(value, index, collection); return !result; }); return !!result; } /** * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which * performs a binary search of `array` to determine the index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndex(array, value, retHighest) { var low = 0, high = array == null ? low : array.length; if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = (low + high) >>> 1, computed = array[mid]; if (computed !== null && !isSymbol(computed) && (retHighest ? (computed <= value) : (computed < value))) { low = mid + 1; } else { high = mid; } } return high; } return baseSortedIndexBy(array, value, identity, retHighest); } /** * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` * which invokes `iteratee` for `value` and each element of `array` to compute * their sort ranking. The iteratee is invoked with one argument; (value). * * @private * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} iteratee The iteratee invoked per element. * @param {boolean} [retHighest] Specify returning the highest qualified index. * @returns {number} Returns the index at which `value` should be inserted * into `array`. */ function baseSortedIndexBy(array, value, iteratee, retHighest) { var low = 0, high = array == null ? 0 : array.length; if (high === 0) { return 0; } value = iteratee(value); var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined; while (low < high) { var mid = nativeFloor((low + high) / 2), computed = iteratee(array[mid]), othIsDefined = computed !== undefined, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed); if (valIsNaN) { var setLow = retHighest || othIsReflexive; } else if (valIsUndefined) { setLow = othIsReflexive && (retHighest || othIsDefined); } else if (valIsNull) { setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); } else if (valIsSymbol) { setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); } else if (othIsNull || othIsSymbol) { setLow = false; } else { setLow = retHighest ? (computed <= value) : (computed < value); } if (setLow) { low = mid + 1; } else { high = mid; } } return nativeMin(high, MAX_ARRAY_INDEX); } /** * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseSortedUniq(array, iteratee) { var index = -1, length = array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; if (!index || !eq(computed, seen)) { var seen = computed; result[resIndex++] = value === 0 ? 0 : value; } } return result; } /** * The base implementation of `_.toNumber` which doesn't ensure correct * conversions of binary, hexadecimal, or octal string values. * * @private * @param {*} value The value to process. * @returns {number} Returns the number. */ function baseToNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } return +value; } /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isArray(value)) { // Recursively convert values (susceptible to call stack limits). return arrayMap(value, baseToString) + ''; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * The base implementation of `_.uniqBy` without support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. */ function baseUniq(array, iteratee, comparator) { var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result; if (comparator) { isCommon = false; includes = arrayIncludesWith; } else if (length >= LARGE_ARRAY_SIZE) { var set = iteratee ? null : createSet(array); if (set) { return setToArray(set); } isCommon = false; includes = cacheHas; seen = new SetCache; } else { seen = iteratee ? [] : result; } outer: while (++index < length) { var value = array[index], computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { var seenIndex = seen.length; while (seenIndex--) { if (seen[seenIndex] === computed) { continue outer; } } if (iteratee) { seen.push(computed); } result.push(value); } else if (!includes(seen, computed, comparator)) { if (seen !== result) { seen.push(computed); } result.push(value); } } return result; } /** * The base implementation of `_.unset`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The property path to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. */ function baseUnset(object, path) { path = castPath(path, object); object = parent(object, path); return object == null || delete object[toKey(last(path))]; } /** * The base implementation of `_.update`. * * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to update. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseUpdate(object, path, updater, customizer) { return baseSet(object, path, updater(baseGet(object, path)), customizer); } /** * The base implementation of methods like `_.dropWhile` and `_.takeWhile` * without support for iteratee shorthands. * * @private * @param {Array} array The array to query. * @param {Function} predicate The function invoked per iteration. * @param {boolean} [isDrop] Specify dropping elements instead of taking them. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the slice of `array`. */ function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); } /** * The base implementation of `wrapperValue` which returns the result of * performing a sequence of actions on the unwrapped `value`, where each * successive action is supplied the return value of the previous. * * @private * @param {*} value The unwrapped value. * @param {Array} actions Actions to perform to resolve the unwrapped value. * @returns {*} Returns the resolved value. */ function baseWrapperValue(value, actions) { var result = value; if (result instanceof LazyWrapper) { result = result.value(); } return arrayReduce(actions, function(result, action) { return action.func.apply(action.thisArg, arrayPush([result], action.args)); }, result); } /** * The base implementation of methods like `_.xor`, without support for * iteratee shorthands, that accepts an array of arrays to inspect. * * @private * @param {Array} arrays The arrays to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of values. */ function baseXor(arrays, iteratee, comparator) { var length = arrays.length; if (length < 2) { return length ? baseUniq(arrays[0]) : []; } var index = -1, result = Array(length); while (++index < length) { var array = arrays[index], othIndex = -1; while (++othIndex < length) { if (othIndex != index) { result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); } } } return baseUniq(baseFlatten(result, 1), iteratee, comparator); } /** * This base implementation of `_.zipObject` which assigns values using `assignFunc`. * * @private * @param {Array} props The property identifiers. * @param {Array} values The property values. * @param {Function} assignFunc The function to assign values. * @returns {Object} Returns the new object. */ function baseZipObject(props, values, assignFunc) { var index = -1, length = props.length, valsLength = values.length, result = {}; while (++index < length) { var value = index < valsLength ? values[index] : undefined; assignFunc(result, props[index], value); } return result; } /** * Casts `value` to an empty array if it's not an array like object. * * @private * @param {*} value The value to inspect. * @returns {Array|Object} Returns the cast array-like object. */ function castArrayLikeObject(value) { return isArrayLikeObject(value) ? value : []; } /** * Casts `value` to `identity` if it's not a function. * * @private * @param {*} value The value to inspect. * @returns {Function} Returns cast function. */ function castFunction(value) { return typeof value == 'function' ? value : identity; } /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @param {Object} [object] The object to query keys on. * @returns {Array} Returns the cast property path array. */ function castPath(value, object) { if (isArray(value)) { return value; } return isKey(value, object) ? [value] : stringToPath(toString(value)); } /** * A `baseRest` alias which can be replaced with `identity` by module * replacement plugins. * * @private * @type {Function} * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ var castRest = baseRest; /** * Casts `array` to a slice if it's needed. * * @private * @param {Array} array The array to inspect. * @param {number} start The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the cast slice. */ function castSlice(array, start, end) { var length = array.length; end = end === undefined ? length : end; return (!start && end >= length) ? array : baseSlice(array, start, end); } /** * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). * * @private * @param {number|Object} id The timer id or timeout object of the timer to clear. */ var clearTimeout = ctxClearTimeout || function(id) { return root.clearTimeout(id); }; /** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. */ function cloneBuffer(buffer, isDeep) { if (isDeep) { return buffer.slice(); } var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; } /** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. */ function cloneArrayBuffer(arrayBuffer) { var result = new arrayBuffer.constructor(arrayBuffer.byteLength); new Uint8Array(result).set(new Uint8Array(arrayBuffer)); return result; } /** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. */ function cloneDataView(dataView, isDeep) { var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); } /** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. */ function cloneRegExp(regexp) { var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); result.lastIndex = regexp.lastIndex; return result; } /** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. */ function cloneSymbol(symbol) { return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; } /** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. */ function cloneTypedArray(typedArray, isDeep) { var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); } /** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other); if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || (valIsNull && othIsDefined && othIsReflexive) || (!valIsDefined && othIsReflexive) || !valIsReflexive) { return 1; } if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || (othIsNull && valIsDefined && valIsReflexive) || (!othIsDefined && valIsReflexive) || !othIsReflexive) { return -1; } } return 0; } /** * Used by `_.orderBy` to compare multiple properties of a value to another * and stable sort them. * * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, * specify an order of "desc" for descending or "asc" for ascending sort order * of corresponding values. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {boolean[]|string[]} orders The order to sort by for each property. * @returns {number} Returns the sort order indicator for `object`. */ function compareMultiple(object, other, orders) { var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); if (result) { if (index >= ordersLength) { return result; } var order = orders[index]; return result * (order == 'desc' ? -1 : 1); } } // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications // that causes it, under certain circumstances, to provide the same value for // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 // for more details. // // This also ensures a stable sort in V8 and other engines. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. return object.index - other.index; } /** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to prepend to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgs(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried; while (++leftIndex < leftLength) { result[leftIndex] = partials[leftIndex]; } while (++argsIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[holders[argsIndex]] = args[argsIndex]; } } while (rangeLength--) { result[leftIndex++] = args[argsIndex++]; } return result; } /** * This function is like `composeArgs` except that the arguments composition * is tailored for `_.partialRight`. * * @private * @param {Array} args The provided arguments. * @param {Array} partials The arguments to append to those provided. * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. */ function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; } var offset = argsIndex; while (++rightIndex < rightLength) { result[offset + rightIndex] = partials[rightIndex]; } while (++holdersIndex < holdersLength) { if (isUncurried || argsIndex < argsLength) { result[offset + holders[holdersIndex]] = args[argsIndex++]; } } return result; } /** * Copies the values of `source` to `array`. * * @private * @param {Array} source The array to copy values from. * @param {Array} [array=[]] The array to copy values to. * @returns {Array} Returns `array`. */ function copyArray(source, array) { var index = -1, length = source.length; array || (array = Array(length)); while (++index < length) { array[index] = source[index]; } return array; } /** * Copies properties of `source` to `object`. * * @private * @param {Object} source The object to copy properties from. * @param {Array} props The property identifiers to copy. * @param {Object} [object={}] The object to copy properties to. * @param {Function} [customizer] The function to customize copied values. * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { var isNew = !object; object || (object = {}); var index = -1, length = props.length; while (++index < length) { var key = props[index]; var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; if (newValue === undefined) { newValue = source[key]; } if (isNew) { baseAssignValue(object, key, newValue); } else { assignValue(object, key, newValue); } } return object; } /** * Copies own symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbols(source, object) { return copyObject(source, getSymbols(source), object); } /** * Copies own and inherited symbols of `source` to `object`. * * @private * @param {Object} source The object to copy symbols from. * @param {Object} [object={}] The object to copy symbols to. * @returns {Object} Returns `object`. */ function copySymbolsIn(source, object) { return copyObject(source, getSymbolsIn(source), object); } /** * Creates a function like `_.groupBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} [initializer] The accumulator object initializer. * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { return function(collection, iteratee) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; return func(collection, setter, getIteratee(iteratee, 2), accumulator); }; } /** * Creates a function like `_.assign`. * * @private * @param {Function} assigner The function to assign values. * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined; customizer = (assigner.length > 3 && typeof customizer == 'function') ? (length--, customizer) : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { customizer = length < 3 ? undefined : customizer; length = 1; } object = Object(object); while (++index < length) { var source = sources[index]; if (source) { assigner(object, source, index, customizer); } } return object; }); } /** * Creates a `baseEach` or `baseEachRight` function. * * @private * @param {Function} eachFunc The function to iterate over a collection. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { return function(collection, iteratee) { if (collection == null) { return collection; } if (!isArrayLike(collection)) { return eachFunc(collection, iteratee); } var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { break; } } return collection; }; } /** * Creates a base function for methods like `_.forIn` and `_.forOwn`. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { return function(object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; if (iteratee(iterable[key], key, iterable) === false) { break; } } return object; }; } /** * Creates a function that wraps `func` to invoke it with the optional `this` * binding of `thisArg`. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return fn.apply(isBind ? thisArg : this, arguments); } return wrapper; } /** * Creates a function like `_.lowerFirst`. * * @private * @param {string} methodName The name of the `String` case method to use. * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { return function(string) { string = toString(string); var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined; var chr = strSymbols ? strSymbols[0] : string.charAt(0); var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1); return chr[methodName]() + trailing; }; } /** * Creates a function like `_.camelCase`. * * @private * @param {Function} callback The function to combine each word. * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { return function(string) { return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } /** * Creates a function that produces an instance of `Ctor` regardless of * whether it was invoked as part of a `new` expression or by `call` or `apply`. * * @private * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { case 0: return new Ctor; case 1: return new Ctor(args[0]); case 2: return new Ctor(args[0], args[1]); case 3: return new Ctor(args[0], args[1], args[2]); case 4: return new Ctor(args[0], args[1], args[2], args[3]); case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. return isObject(result) ? result : thisBinding; }; } /** * Creates a function that wraps `func` to enable currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createCurry(func, bitmask, arity) { var Ctor = createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; } var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) ? [] : replaceHolders(args, placeholder); length -= holders.length; if (length < arity) { return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; return apply(fn, this, args); } return wrapper; } /** * Creates a `_.find` or `_.findLast` function. * * @private * @param {Function} findIndexFunc The function to find the collection index. * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); if (!isArrayLike(collection)) { var iteratee = getIteratee(predicate, 3); collection = keys(collection); predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } var index = findIndexFunc(collection, predicate, fromIndex); return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } /** * Creates a `_.flow` or `_.flowRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { return flatRest(function(funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); } while (index--) { var func = funcs[index]; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (prereq && !wrapper && getFuncName(func) == 'wrapper') { var wrapper = new LodashWrapper([], true); } } index = wrapper ? index : length; while (++index < length) { func = funcs[index]; var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : undefined; if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1 ) { wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); } else { wrapper = (func.length == 1 && isLaziable(func)) ? wrapper[funcName]() : wrapper.thru(func); } } return function() { var args = arguments, value = args[0]; if (wrapper && args.length == 1 && isArray(value)) { return wrapper.plant(value).value(); } var index = 0, result = length ? funcs[index].apply(this, args) : value; while (++index < length) { result = funcs[index].call(this, result); } return result; }; }); } /** * Creates a function that wraps `func` to invoke it with optional `this` * binding of `thisArg`, partial application, and currying. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [partialsRight] The arguments to append to those provided * to the new function. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined : createCtor(func); function wrapper() { var length = arguments.length, args = Array(length), index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); } if (partialsRight) { args = composeArgsRight(args, partialsRight, holdersRight, isCurried); } length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); return createRecurry( func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { args = reorder(args, argPos); } else if (isFlip && length > 1) { args.reverse(); } if (isAry && ary < length) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } return wrapper; } /** * Creates a function like `_.invertBy`. * * @private * @param {Function} setter The function to set accumulator values. * @param {Function} toIteratee The function to resolve iteratees. * @returns {Function} Returns the new inverter function. */ function createInverter(setter, toIteratee) { return function(object, iteratee) { return baseInverter(object, setter, toIteratee(iteratee), {}); }; } /** * Creates a function that performs a mathematical operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @param {number} [defaultValue] The value used for `undefined` arguments. * @returns {Function} Returns the new mathematical operation function. */ function createMathOperation(operator, defaultValue) { return function(value, other) { var result; if (value === undefined && other === undefined) { return defaultValue; } if (value !== undefined) { result = value; } if (other !== undefined) { if (result === undefined) { return other; } if (typeof value == 'string' || typeof other == 'string') { value = baseToString(value); other = baseToString(other); } else { value = baseToNumber(value); other = baseToNumber(other); } result = operator(value, other); } return result; }; } /** * Creates a function like `_.over`. * * @private * @param {Function} arrayFunc The function to iterate over iteratees. * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { return flatRest(function(iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())); return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { return apply(iteratee, thisArg, args); }); }); }); } /** * Creates the padding for `string` based on `length`. The `chars` string * is truncated if the number of characters exceeds `length`. * * @private * @param {number} length The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padding for `string`. */ function createPadding(length, chars) { chars = chars === undefined ? ' ' : baseToString(chars); var charsLength = chars.length; if (charsLength < 2) { return charsLength ? baseRepeat(chars, length) : chars; } var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join('') : result.slice(0, length); } /** * Creates a function that wraps `func` to invoke it with the `this` binding * of `thisArg` and `partials` prepended to the arguments it receives. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); function wrapper() { var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; } while (argsLength--) { args[leftIndex++] = arguments[++argsIndex]; } return apply(fn, isBind ? thisArg : this, args); } return wrapper; } /** * Creates a `_.range` or `_.rangeRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new range function. */ function createRange(fromRight) { return function(start, end, step) { if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { end = step = undefined; } // Ensure the sign of `-0` is preserved. start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); return baseRange(start, end, step, fromRight); }; } /** * Creates a function that performs a relational operation on two values. * * @private * @param {Function} operator The function to perform the operation. * @returns {Function} Returns the new relational operation function. */ function createRelationalOperation(operator) { return function(value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { value = toNumber(value); other = toNumber(other); } return operator(value, other); }; } /** * Creates a function that wraps `func` to continue currying. * * @private * @param {Function} func The function to wrap. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials; bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); } var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ]; var result = wrapFunc.apply(undefined, newData); if (isLaziable(func)) { setData(result, newData); } result.placeholder = placeholder; return setWrapToString(result, func, bitmask); } /** * Creates a function like `_.round`. * * @private * @param {string} methodName The name of the `Math` method to use when rounding. * @returns {Function} Returns the new round function. */ function createRound(methodName) { var func = Math[methodName]; return function(number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); if (precision && nativeIsFinite(number)) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. var pair = (toString(number) + 'e').split('e'), value = func(pair[0] + 'e' + (+pair[1] + precision)); pair = (toString(value) + 'e').split('e'); return +(pair[0] + 'e' + (+pair[1] - precision)); } return func(number); }; } /** * Creates a set object of `values`. * * @private * @param {Array} values The values to add to the set. * @returns {Object} Returns the new set. */ var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { return new Set(values); }; /** * Creates a `_.toPairs` or `_.toPairsIn` function. * * @private * @param {Function} keysFunc The function to get the keys of a given object. * @returns {Function} Returns the new pairs function. */ function createToPairs(keysFunc) { return function(object) { var tag = getTag(object); if (tag == mapTag) { return mapToArray(object); } if (tag == setTag) { return setToPairs(object); } return baseToPairs(object, keysFunc(object)); }; } /** * Creates a function that either curries or invokes `func` with optional * `this` binding and partially applied arguments. * * @private * @param {Function|string} func The function or method name to wrap. * @param {number} bitmask The bitmask flags. * 1 - `_.bind` * 2 - `_.bindKey` * 4 - `_.curry` or `_.curryRight` of a bound function * 8 - `_.curry` * 16 - `_.curryRight` * 32 - `_.partial` * 64 - `_.partialRight` * 128 - `_.rearg` * 256 - `_.ary` * 512 - `_.flip` * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to be partially applied. * @param {Array} [holders] The `partials` placeholder indexes. * @param {Array} [argPos] The argument positions of the new function. * @param {number} [ary] The arity cap of `func`. * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var length = partials ? partials.length : 0; if (!length) { bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); partials = holders = undefined; } ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); arity = arity === undefined ? arity : toInteger(arity); length -= holders ? holders.length : 0; if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, holdersRight = holders; partials = holders = undefined; } var data = isBindKey ? undefined : getData(func); var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ]; if (data) { mergeData(newData, data); } func = newData[0]; bitmask = newData[1]; thisArg = newData[2]; partials = newData[3]; holders = newData[4]; arity = newData[9] = newData[9] === undefined ? (isBindKey ? 0 : func.length) : nativeMax(newData[9] - length, 0); if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == WRAP_BIND_FLAG) { var result = createBind(func, bitmask, thisArg); } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { result = createCurry(func, bitmask, arity); } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { result = createPartial(func, bitmask, thisArg, partials); } else { result = createHybrid.apply(undefined, newData); } var setter = data ? baseSetData : setData; return setWrapToString(setter(result, newData), func, bitmask); } /** * Used by `_.defaults` to customize its `_.assignIn` use to assign properties * of source objects to the destination object for all destination properties * that resolve to `undefined`. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to assign. * @param {Object} object The parent object of `objValue`. * @returns {*} Returns the value to assign. */ function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined || (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { return srcValue; } return objValue; } /** * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source * objects into destination objects that are passed thru. * * @private * @param {*} objValue The destination value. * @param {*} srcValue The source value. * @param {string} key The key of the property to merge. * @param {Object} object The parent object of `objValue`. * @param {Object} source The parent object of `srcValue`. * @param {Object} [stack] Tracks traversed source values and their merged * counterparts. * @returns {*} Returns the value to assign. */ function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { // Recursively merge objects and arrays (susceptible to call stack limits). stack.set(srcValue, objValue); baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); stack['delete'](srcValue); } return objValue; } /** * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain * objects. * * @private * @param {*} value The value to inspect. * @param {string} key The key of the property to inspect. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. */ function customOmitClone(value) { return isPlainObject(value) ? undefined : value; } /** * A specialized version of `baseIsEqualDeep` for arrays with support for * partial deep comparisons. * * @private * @param {Array} array The array to compare. * @param {Array} other The other array to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `array` and `other` objects. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; } // Check that cyclic values are equal. var arrStacked = stack.get(array); var othStacked = stack.get(other); if (arrStacked && othStacked) { return arrStacked == other && othStacked == array; } var index = -1, result = true, seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; stack.set(array, other); stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], othValue = other[index]; if (customizer) { var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } if (compared !== undefined) { if (compared) { continue; } result = false; break; } // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function(othValue, othIndex) { if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { return seen.push(othIndex); } })) { result = false; break; } } else if (!( arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack) )) { result = false; break; } } stack['delete'](array); stack['delete'](other); return result; } /** * A specialized version of `baseIsEqualDeep` for comparing objects of * the same `toStringTag`. * * **Note:** This function only supports comparing values with tags of * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {string} tag The `toStringTag` of the objects to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { switch (tag) { case dataViewTag: if ((object.byteLength != other.byteLength) || (object.byteOffset != other.byteOffset)) { return false; } object = object.buffer; other = other.buffer; case arrayBufferTag: if ((object.byteLength != other.byteLength) || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { return false; } return true; case boolTag: case dateTag: case numberTag: // Coerce booleans to `1` or `0` and dates to milliseconds. // Invalid dates are coerced to `NaN`. return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); case mapTag: var convert = mapToArray; case setTag: var isPartial = bitmask & COMPARE_PARTIAL_FLAG; convert || (convert = setToArray); if (object.size != other.size && !isPartial) { return false; } // Assume cyclic values are equal. var stacked = stack.get(object); if (stacked) { return stacked == other; } bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits). stack.set(object, other); var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); stack['delete'](object); return result; case symbolTag: if (symbolValueOf) { return symbolValueOf.call(object) == symbolValueOf.call(other); } } return false; } /** * A specialized version of `baseIsEqualDeep` for objects with support for * partial deep comparisons. * * @private * @param {Object} object The object to compare. * @param {Object} other The other object to compare. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. * @param {Function} customizer The function to customize comparisons. * @param {Function} equalFunc The function to determine equivalents of values. * @param {Object} stack Tracks traversed `object` and `other` objects. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; } var index = objLength; while (index--) { var key = objProps[index]; if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Check that cyclic values are equal. var objStacked = stack.get(object); var othStacked = stack.get(other); if (objStacked && othStacked) { return objStacked == other && othStacked == object; } var result = true; stack.set(object, other); stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { key = objProps[index]; var objValue = object[key], othValue = other[key]; if (customizer) { var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) : compared )) { result = false; break; } skipCtor || (skipCtor = key == 'constructor'); } if (result && !skipCtor) { var objCtor = object.constructor, othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } stack['delete'](object); stack['delete'](other); return result; } /** * A specialized version of `baseRest` which flattens the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @returns {Function} Returns the new function. */ function flatRest(func) { return setToString(overRest(func, undefined, flatten), func + ''); } /** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); } /** * Creates an array of own and inherited enumerable property names and * symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */ function getAllKeysIn(object) { return baseGetAllKeys(object, keysIn, getSymbolsIn); } /** * Gets metadata for `func`. * * @private * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ var getData = !metaMap ? noop : function(func) { return metaMap.get(func); }; /** * Gets the name of `func`. * * @private * @param {Function} func The function to query. * @returns {string} Returns the function name. */ function getFuncName(func) { var result = (func.name + ''), array = realNames[result], length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } } return result; } /** * Gets the argument placeholder value for `func`. * * @private * @param {Function} func The function to inspect. * @returns {*} Returns the placeholder value. */ function getHolder(func) { var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; return object.placeholder; } /** * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, * this function returns the custom method, otherwise it returns `baseIteratee`. * If arguments are provided, the chosen function is invoked with them and * its result is returned. * * @private * @param {*} [value] The value to convert to an iteratee. * @param {number} [arity] The arity of the created iteratee. * @returns {Function} Returns the chosen function or its result. */ function getIteratee() { var result = lodash.iteratee || iteratee; result = result === iteratee ? baseIteratee : result; return arguments.length ? result(arguments[0], arguments[1]) : result; } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the property names, values, and compare flags of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the match data of `object`. */ function getMatchData(object) { var result = keys(object), length = result.length; while (length--) { var key = result[length], value = object[key]; result[length] = [key, value, isStrictComparable(value)]; } return result; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. * * @private * @param {*} value The value to query. * @returns {string} Returns the raw `toStringTag`. */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined; var unmasked = true; } catch (e) {} var result = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; } else { delete value[symToStringTag]; } } return result; } /** * Creates an array of the own enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbols = !nativeGetSymbols ? stubArray : function(object) { if (object == null) { return []; } object = Object(object); return arrayFilter(nativeGetSymbols(object), function(symbol) { return propertyIsEnumerable.call(object, symbol); }); }; /** * Creates an array of the own and inherited enumerable symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); object = getPrototype(object); } return result; }; /** * Gets the `toStringTag` of `value`. * * @private * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || (Set && getTag(new Set) != setTag) || (WeakMap && getTag(new WeakMap) != weakMapTag)) { getTag = function(value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { case dataViewCtorString: return dataViewTag; case mapCtorString: return mapTag; case promiseCtorString: return promiseTag; case setCtorString: return setTag; case weakMapCtorString: return weakMapTag; } } return result; }; } /** * Gets the view, applying any `transforms` to the `start` and `end` positions. * * @private * @param {number} start The start of the view. * @param {number} end The end of the view. * @param {Array} transforms The transformations to apply to the view. * @returns {Object} Returns an object containing the `start` and `end` * positions of the view. */ function getView(start, end, transforms) { var index = -1, length = transforms.length; while (++index < length) { var data = transforms[index], size = data.size; switch (data.type) { case 'drop': start += size; break; case 'dropRight': end -= size; break; case 'take': end = nativeMin(end, start + size); break; case 'takeRight': start = nativeMax(start, end - size); break; } } return { 'start': start, 'end': end }; } /** * Extracts wrapper details from the `source` body comment. * * @private * @param {string} source The source to inspect. * @returns {Array} Returns the wrapper details. */ function getWrapDetails(source) { var match = source.match(reWrapDetails); return match ? match[1].split(reSplitDetails) : []; } /** * Checks if `path` exists on `object`. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. * @returns {boolean} Returns `true` if `path` exists, else `false`. */ function hasPath(object, path, hasFunc) { path = castPath(path, object); var index = -1, length = path.length, result = false; while (++index < length) { var key = toKey(path[index]); if (!(result = object != null && hasFunc(object, key))) { break; } object = object[key]; } if (result || ++index != length) { return result; } length = object == null ? 0 : object.length; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } /** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */ function initCloneArray(array) { var length = array.length, result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { result.index = array.index; result.input = array.input; } return result; } /** * Initializes an object clone. * * @private * @param {Object} object The object to clone. * @returns {Object} Returns the initialized clone. */ function initCloneObject(object) { return (typeof object.constructor == 'function' && !isPrototype(object)) ? baseCreate(getPrototype(object)) : {}; } /** * Initializes an object clone based on its `toStringTag`. * * **Note:** This function only supports cloning values with tags of * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. * * @private * @param {Object} object The object to clone. * @param {string} tag The `toStringTag` of the object to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the initialized clone. */ function initCloneByTag(object, tag, isDeep) { var Ctor = object.constructor; switch (tag) { case arrayBufferTag: return cloneArrayBuffer(object); case boolTag: case dateTag: return new Ctor(+object); case dataViewTag: return cloneDataView(object, isDeep); case float32Tag: case float64Tag: case int8Tag: case int16Tag: case int32Tag: case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: return cloneTypedArray(object, isDeep); case mapTag: return new Ctor; case numberTag: case stringTag: return new Ctor(object); case regexpTag: return cloneRegExp(object); case setTag: return new Ctor; case symbolTag: return cloneSymbol(object); } } /** * Inserts wrapper `details` in a comment at the top of the `source` body. * * @private * @param {string} source The source to modify. * @returns {Array} details The details to insert. * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { var length = details.length; if (!length) { return source; } var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } /** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); } /** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */ function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); } /** * Checks if the given arguments are from an iteratee call. * * @private * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. * @returns {boolean} Returns `true` if the arguments are from an iteratee call, * else `false`. */ function isIterateeCall(value, index, object) { if (!isObject(object)) { return false; } var type = typeof index; if (type == 'number' ? (isArrayLike(object) && isIndex(index, object.length)) : (type == 'string' && index in object) ) { return eq(object[index], value); } return false; } /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has a lazy counterpart. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` has a lazy counterpart, * else `false`. */ function isLaziable(func) { var funcName = getFuncName(func), other = lodash[funcName]; if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { return false; } if (func === other) { return true; } var data = getData(other); return !!data && func === data[0]; } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Checks if `func` is capable of being masked. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `func` is maskable, else `false`. */ var isMaskable = coreJsData ? isFunction : stubFalse; /** * Checks if `value` is likely a prototype object. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. */ function isPrototype(value) { var Ctor = value && value.constructor, proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } /** * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` if suitable for strict * equality comparisons, else `false`. */ function isStrictComparable(value) { return value === value && !isObject(value); } /** * A specialized version of `matchesProperty` for source values suitable * for strict equality comparisons, i.e. `===`. * * @private * @param {string} key The key of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { return function(object) { if (object == null) { return false; } return object[key] === srcValue && (srcValue !== undefined || (key in Object(object))); }; } /** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; } /** * Merges the function metadata of `source` into `data`. * * Merging metadata reduces the number of wrappers used to invoke a function. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` * may be applied regardless of execution order. Methods like `_.ary` and * `_.rearg` modify function arguments, making the order in which they are * executed important, preventing the merging of metadata. However, we make * an exception for a safe combined case where curried functions have `_.ary` * and or `_.rearg` applied. * * @private * @param {Array} data The destination metadata. * @param {Array} source The source metadata. * @returns {Array} Returns `data`. */ function mergeData(data, source) { var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); // Exit early if metadata can't be merged. if (!(isCommon || isCombo)) { return data; } // Use source `thisArg` if available. if (srcBitmask & WRAP_BIND_FLAG) { data[2] = source[2]; // Set when currying a bound function. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; } // Compose partial arguments. var value = source[3]; if (value) { var partials = data[3]; data[3] = partials ? composeArgs(partials, value, source[4]) : value; data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; } // Compose partial right arguments. value = source[5]; if (value) { partials = data[5]; data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; } // Use source `argPos` if available. value = source[7]; if (value) { data[7] = value; } // Use source `ary` if it's smaller. if (srcBitmask & WRAP_ARY_FLAG) { data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); } // Use source `arity` if one is not provided. if (data[9] == null) { data[9] = source[9]; } // Use source `func` and merge bitmasks. data[0] = source[0]; data[1] = newBitmask; return data; } /** * This function is like * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * except that it includes inherited enumerable properties. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function nativeKeysIn(object) { var result = []; if (object != null) { for (var key in Object(object)) { result.push(key); } } return result; } /** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */ function objectToString(value) { return nativeObjectToString.call(value); } /** * A specialized version of `baseRest` which transforms the rest array. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @param {Function} transform The rest array transform. * @returns {Function} Returns the new function. */ function overRest(func, start, transform) { start = nativeMax(start === undefined ? (func.length - 1) : start, 0); return function() { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length); while (++index < length) { array[index] = args[start + index]; } index = -1; var otherArgs = Array(start + 1); while (++index < start) { otherArgs[index] = args[index]; } otherArgs[start] = transform(array); return apply(func, this, otherArgs); }; } /** * Gets the parent value at `path` of `object`. * * @private * @param {Object} object The object to query. * @param {Array} path The path to get the parent value of. * @returns {*} Returns the parent value. */ function parent(object, path) { return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); } /** * Reorder `array` according to the specified indexes where the element at * the first index is assigned as the first element, the element at * the second index is assigned as the second element, and so on. * * @private * @param {Array} array The array to reorder. * @param {Array} indexes The arranged array indexes. * @returns {Array} Returns `array`. */ function reorder(array, indexes) { var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); while (length--) { var index = indexes[length]; array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; } return array; } /** * Gets the value at `key`, unless `key` is "__proto__" or "constructor". * * @private * @param {Object} object The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function safeGet(object, key) { if (key === 'constructor' && typeof object[key] === 'function') { return; } if (key == '__proto__') { return; } return object[key]; } /** * Sets metadata for `func`. * * **Note:** If this function becomes hot, i.e. is invoked a lot in a short * period of time, it will trip its breaker and transition to an identity * function to avoid garbage collection pauses in V8. See * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) * for more details. * * @private * @param {Function} func The function to associate metadata with. * @param {*} data The metadata. * @returns {Function} Returns `func`. */ var setData = shortOut(baseSetData); /** * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @returns {number|Object} Returns the timer id or timeout object. */ var setTimeout = ctxSetTimeout || function(func, wait) { return root.setTimeout(func, wait); }; /** * Sets the `toString` method of `func` to return `string`. * * @private * @param {Function} func The function to modify. * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ var setToString = shortOut(baseSetToString); /** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. * @param {Function} reference The reference function. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Function} Returns `wrapper`. */ function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); } /** * Creates a function that'll short out and invoke `identity` instead * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` * milliseconds. * * @private * @param {Function} func The function to restrict. * @returns {Function} Returns the new shortable function. */ function shortOut(func) { var count = 0, lastCalled = 0; return function() { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { if (++count >= HOT_COUNT) { return arguments[0]; } } else { count = 0; } return func.apply(undefined, arguments); }; } /** * A specialized version of `_.shuffle` which mutates and sets the size of `array`. * * @private * @param {Array} array The array to shuffle. * @param {number} [size=array.length] The size of `array`. * @returns {Array} Returns `array`. */ function shuffleSelf(array, size) { var index = -1, length = array.length, lastIndex = length - 1; size = size === undefined ? length : size; while (++index < size) { var rand = baseRandom(index, lastIndex), value = array[rand]; array[rand] = array[index]; array[index] = value; } array.length = size; return array; } /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoizeCapped(function(string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } string.replace(rePropName, function(match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to convert. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Updates wrapper `details` based on `bitmask` flags. * * @private * @returns {Array} details The details to modify. * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { arrayEach(wrapFlags, function(pair) { var value = '_.' + pair[0]; if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { details.push(value); } }); return details.sort(); } /** * Creates a clone of `wrapper`. * * @private * @param {Object} wrapper The wrapper to clone. * @returns {Object} Returns the cloned wrapper. */ function wrapperClone(wrapper) { if (wrapper instanceof LazyWrapper) { return wrapper.clone(); } var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = copyArray(wrapper.__actions__); result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } /*------------------------------------------------------------------------*/ /** * Creates an array of elements split into groups the length of `size`. * If `array` can't be split evenly, the final chunk will be the remaining * elements. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to process. * @param {number} [size=1] The length of each chunk * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the new array of chunks. * @example * * _.chunk(['a', 'b', 'c', 'd'], 2); * // => [['a', 'b'], ['c', 'd']] * * _.chunk(['a', 'b', 'c', 'd'], 3); * // => [['a', 'b', 'c'], ['d']] */ function chunk(array, size, guard) { if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { size = 1; } else { size = nativeMax(toInteger(size), 0); } var length = array == null ? 0 : array.length; if (!length || size < 1) { return []; } var index = 0, resIndex = 0, result = Array(nativeCeil(length / size)); while (index < length) { result[resIndex++] = baseSlice(array, index, (index += size)); } return result; } /** * Creates an array with all falsey values removed. The values `false`, `null`, * `0`, `""`, `undefined`, and `NaN` are falsey. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to compact. * @returns {Array} Returns the new array of filtered values. * @example * * _.compact([0, 1, false, 2, '', 3]); * // => [1, 2, 3] */ function compact(array) { var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; while (++index < length) { var value = array[index]; if (value) { result[resIndex++] = value; } } return result; } /** * Creates a new array concatenating `array` with any additional arrays * and/or values. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to concatenate. * @param {...*} [values] The values to concatenate. * @returns {Array} Returns the new concatenated array. * @example * * var array = [1]; * var other = _.concat(array, 2, [3], [[4]]); * * console.log(other); * // => [1, 2, 3, [4]] * * console.log(array); * // => [1] */ function concat() { var length = arguments.length; if (!length) { return []; } var args = Array(length - 1), array = arguments[0], index = length; while (index--) { args[index - 1] = arguments[index]; } return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.without, _.xor * @example * * _.difference([2, 1], [2, 3]); * // => [1] */ var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; }); /** * This method is like `_.difference` except that it accepts `iteratee` which * is invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * **Note:** Unlike `_.pullAllBy`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2] * * // The `_.property` iteratee shorthand. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var differenceBy = baseRest(function(array, values) { var iteratee = last(values); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.difference` except that it accepts `comparator` * which is invoked to compare elements of `array` to `values`. The order and * references of result values are determined by the first array. The comparator * is invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.pullAllWith`, this method returns a new array. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ var differenceWith = baseRest(function(array, values) { var comparator = last(values); if (isArrayLikeObject(comparator)) { comparator = undefined; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; }); /** * Creates a slice of `array` with `n` elements dropped from the beginning. * * @static * @memberOf _ * @since 0.5.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.drop([1, 2, 3]); * // => [2, 3] * * _.drop([1, 2, 3], 2); * // => [3] * * _.drop([1, 2, 3], 5); * // => [] * * _.drop([1, 2, 3], 0); * // => [1, 2, 3] */ function drop(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with `n` elements dropped from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to drop. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.dropRight([1, 2, 3]); * // => [1, 2] * * _.dropRight([1, 2, 3], 2); * // => [1] * * _.dropRight([1, 2, 3], 5); * // => [] * * _.dropRight([1, 2, 3], 0); * // => [1, 2, 3] */ function dropRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` excluding elements dropped from the end. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.dropRightWhile(users, function(o) { return !o.active; }); * // => objects for ['barney'] * * // The `_.matches` iteratee shorthand. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['barney', 'fred'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropRightWhile(users, ['active', false]); * // => objects for ['barney'] * * // The `_.property` iteratee shorthand. * _.dropRightWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; } /** * Creates a slice of `array` excluding elements dropped from the beginning. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.dropWhile(users, function(o) { return !o.active; }); * // => objects for ['pebbles'] * * // The `_.matches` iteratee shorthand. * _.dropWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['fred', 'pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.dropWhile(users, ['active', false]); * // => objects for ['pebbles'] * * // The `_.property` iteratee shorthand. * _.dropWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] */ function dropWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true) : []; } /** * Fills elements of `array` with `value` from `start` up to, but not * including, `end`. * * **Note:** This method mutates `array`. * * @static * @memberOf _ * @since 3.2.0 * @category Array * @param {Array} array The array to fill. * @param {*} value The value to fill `array` with. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.fill(array, 'a'); * console.log(array); * // => ['a', 'a', 'a'] * * _.fill(Array(3), 2); * // => [2, 2, 2] * * _.fill([4, 6, 8, 10], '*', 1, 3); * // => [4, '*', '*', 10] */ function fill(array, value, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { start = 0; end = length; } return baseFill(array, value, start, end); } /** * This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.findIndex(users, function(o) { return o.user == 'barney'; }); * // => 0 * * // The `_.matches` iteratee shorthand. * _.findIndex(users, { 'user': 'fred', 'active': false }); * // => 1 * * // The `_.matchesProperty` iteratee shorthand. * _.findIndex(users, ['active', false]); * // => 0 * * // The `_.property` iteratee shorthand. * _.findIndex(users, 'active'); * // => 2 */ function findIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseFindIndex(array, getIteratee(predicate, 3), index); } /** * This method is like `_.findIndex` except that it iterates over elements * of `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); * // => 2 * * // The `_.matches` iteratee shorthand. * _.findLastIndex(users, { 'user': 'barney', 'active': true }); * // => 0 * * // The `_.matchesProperty` iteratee shorthand. * _.findLastIndex(users, ['active', false]); * // => 2 * * // The `_.property` iteratee shorthand. * _.findLastIndex(users, 'active'); * // => 0 */ function findLastIndex(array, predicate, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length - 1; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return baseFindIndex(array, getIteratee(predicate, 3), index, true); } /** * Flattens `array` a single level deep. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] */ function flatten(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, 1) : []; } /** * Recursively flattens `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to flatten. * @returns {Array} Returns the new flattened array. * @example * * _.flattenDeep([1, [2, [3, [4]], 5]]); * // => [1, 2, 3, 4, 5] */ function flattenDeep(array) { var length = array == null ? 0 : array.length; return length ? baseFlatten(array, INFINITY) : []; } /** * Recursively flatten `array` up to `depth` times. * * @static * @memberOf _ * @since 4.4.0 * @category Array * @param {Array} array The array to flatten. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * var array = [1, [2, [3, [4]], 5]]; * * _.flattenDepth(array, 1); * // => [1, 2, [3, [4]], 5] * * _.flattenDepth(array, 2); * // => [1, 2, 3, [4], 5] */ function flattenDepth(array, depth) { var length = array == null ? 0 : array.length; if (!length) { return []; } depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(array, depth); } /** * The inverse of `_.toPairs`; this method returns an object composed * from key-value `pairs`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} pairs The key-value pairs. * @returns {Object} Returns the new object. * @example * * _.fromPairs([['a', 1], ['b', 2]]); * // => { 'a': 1, 'b': 2 } */ function fromPairs(pairs) { var index = -1, length = pairs == null ? 0 : pairs.length, result = {}; while (++index < length) { var pair = pairs[index]; result[pair[0]] = pair[1]; } return result; } /** * Gets the first element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @alias first * @category Array * @param {Array} array The array to query. * @returns {*} Returns the first element of `array`. * @example * * _.head([1, 2, 3]); * // => 1 * * _.head([]); * // => undefined */ function head(array) { return (array && array.length) ? array[0] : undefined; } /** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the * offset from the end of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.indexOf([1, 2, 1, 2], 2); * // => 1 * * // Search from the `fromIndex`. * _.indexOf([1, 2, 1, 2], 2, 2); * // => 3 */ function indexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = fromIndex == null ? 0 : toInteger(fromIndex); if (index < 0) { index = nativeMax(length + index, 0); } return baseIndexOf(array, value, index); } /** * Gets all but the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.initial([1, 2, 3]); * // => [1, 2] */ function initial(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 0, -1) : []; } /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are * determined by the first array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersection([2, 1], [2, 3]); * // => [2] */ var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) : []; }); /** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion * by which they're compared. The order and references of result values are * determined by the first array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [2.1] * * // The `_.property` iteratee shorthand. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ var intersectionBy = baseRest(function(arrays) { var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee === last(mapped)) { iteratee = undefined; } else { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, getIteratee(iteratee, 2)) : []; }); /** * This method is like `_.intersection` except that it accepts `comparator` * which is invoked to compare elements of `arrays`. The order and references * of result values are determined by the first array. The comparator is * invoked with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] */ var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); comparator = typeof comparator == 'function' ? comparator : undefined; if (comparator) { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped, undefined, comparator) : []; }); /** * Converts all elements in `array` into a string separated by `separator`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to convert. * @param {string} [separator=','] The element separator. * @returns {string} Returns the joined string. * @example * * _.join(['a', 'b', 'c'], '~'); * // => 'a~b~c' */ function join(array, separator) { return array == null ? '' : nativeJoin.call(array, separator); } /** * Gets the last element of `array`. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @returns {*} Returns the last element of `array`. * @example * * _.last([1, 2, 3]); * // => 3 */ function last(array) { var length = array == null ? 0 : array.length; return length ? array[length - 1] : undefined; } /** * This method is like `_.indexOf` except that it iterates over elements of * `array` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.lastIndexOf([1, 2, 1, 2], 2); * // => 3 * * // Search from the `fromIndex`. * _.lastIndexOf([1, 2, 1, 2], 2, 2); * // => 1 */ function lastIndexOf(array, value, fromIndex) { var length = array == null ? 0 : array.length; if (!length) { return -1; } var index = length; if (fromIndex !== undefined) { index = toInteger(fromIndex); index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); } /** * Gets the element at index `n` of `array`. If `n` is negative, the nth * element from the end is returned. * * @static * @memberOf _ * @since 4.11.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=0] The index of the element to return. * @returns {*} Returns the nth element of `array`. * @example * * var array = ['a', 'b', 'c', 'd']; * * _.nth(array, 1); * // => 'b' * * _.nth(array, -2); * // => 'c'; */ function nth(array, n) { return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; } /** * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` * to remove elements from an array by predicate. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {...*} [values] The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pull(array, 'a', 'c'); * console.log(array); * // => ['b', 'b'] */ var pull = baseRest(pullAll); /** * This method is like `_.pull` except that it accepts an array of values to remove. * * **Note:** Unlike `_.difference`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @returns {Array} Returns `array`. * @example * * var array = ['a', 'b', 'c', 'a', 'b', 'c']; * * _.pullAll(array, ['a', 'c']); * console.log(array); * // => ['b', 'b'] */ function pullAll(array, values) { return (array && array.length && values && values.length) ? basePullAll(array, values) : array; } /** * This method is like `_.pullAll` except that it accepts `iteratee` which is * invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The iteratee is invoked with one argument: (value). * * **Note:** Unlike `_.differenceBy`, this method mutates `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; * * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); * console.log(array); * // => [{ 'x': 2 }] */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) ? basePullAll(array, values, getIteratee(iteratee, 2)) : array; } /** * This method is like `_.pullAll` except that it accepts `comparator` which * is invoked to compare elements of `array` to `values`. The comparator is * invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.differenceWith`, this method mutates `array`. * * @static * @memberOf _ * @since 4.6.0 * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns `array`. * @example * * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; * * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); * console.log(array); * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] */ function pullAllWith(array, values, comparator) { return (array && array.length && values && values.length) ? basePullAll(array, values, undefined, comparator) : array; } /** * Removes elements from `array` corresponding to `indexes` and returns an * array of removed elements. * * **Note:** Unlike `_.at`, this method mutates `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to modify. * @param {...(number|number[])} [indexes] The indexes of elements to remove. * @returns {Array} Returns the new array of removed elements. * @example * * var array = ['a', 'b', 'c', 'd']; * var pulled = _.pullAt(array, [1, 3]); * * console.log(array); * // => ['a', 'c'] * * console.log(pulled); * // => ['b', 'd'] */ var pullAt = flatRest(function(array, indexes) { var length = array == null ? 0 : array.length, result = baseAt(array, indexes); basePullAt(array, arrayMap(indexes, function(index) { return isIndex(index, length) ? +index : index; }).sort(compareAscending)); return result; }); /** * Removes all elements from `array` that `predicate` returns truthy for * and returns an array of the removed elements. The predicate is invoked * with three arguments: (value, index, array). * * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` * to pull elements from an array by value. * * @static * @memberOf _ * @since 2.0.0 * @category Array * @param {Array} array The array to modify. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new array of removed elements. * @example * * var array = [1, 2, 3, 4]; * var evens = _.remove(array, function(n) { * return n % 2 == 0; * }); * * console.log(array); * // => [1, 3] * * console.log(evens); * // => [2, 4] */ function remove(array, predicate) { var result = []; if (!(array && array.length)) { return result; } var index = -1, indexes = [], length = array.length; predicate = getIteratee(predicate, 3); while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result.push(value); indexes.push(index); } } basePullAt(array, indexes); return result; } /** * Reverses `array` so that the first element becomes the last, the second * element becomes the second to last, and so on. * * **Note:** This method mutates `array` and is based on * [`Array#reverse`](https://mdn.io/Array/reverse). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to modify. * @returns {Array} Returns `array`. * @example * * var array = [1, 2, 3]; * * _.reverse(array); * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function reverse(array) { return array == null ? array : nativeReverse.call(array); } /** * Creates a slice of `array` from `start` up to, but not including, `end`. * * **Note:** This method is used instead of * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are * returned. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to slice. * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { var length = array == null ? 0 : array.length; if (!length) { return []; } if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { start = 0; end = length; } else { start = start == null ? 0 : toInteger(start); end = end === undefined ? length : toInteger(end); } return baseSlice(array, start, end); } /** * Uses a binary search to determine the lowest index at which `value` * should be inserted into `array` in order to maintain its sort order. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedIndex([30, 50], 40); * // => 1 */ function sortedIndex(array, value) { return baseSortedIndex(array, value); } /** * This method is like `_.sortedIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 0 * * // The `_.property` iteratee shorthand. * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); * // => 0 */ function sortedIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); } /** * This method is like `_.indexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedIndexOf([4, 5, 5, 5, 6], 5); * // => 1 */ function sortedIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value); if (index < length && eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.sortedIndex` except that it returns the highest * index at which `value` should be inserted into `array` in order to * maintain its sort order. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * _.sortedLastIndex([4, 5, 5, 5, 6], 5); * // => 4 */ function sortedLastIndex(array, value) { return baseSortedIndex(array, value, true); } /** * This method is like `_.sortedLastIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. * @example * * var objects = [{ 'x': 4 }, { 'x': 5 }]; * * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); * // => 1 * * // The `_.property` iteratee shorthand. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); } /** * This method is like `_.lastIndexOf` except that it performs a binary * search on a sorted `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example * * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); * // => 3 */ function sortedLastIndexOf(array, value) { var length = array == null ? 0 : array.length; if (length) { var index = baseSortedIndex(array, value, true) - 1; if (eq(array[index], value)) { return index; } } return -1; } /** * This method is like `_.uniq` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniq([1, 1, 2]); * // => [1, 2] */ function sortedUniq(array) { return (array && array.length) ? baseSortedUniq(array) : []; } /** * This method is like `_.uniqBy` except that it's designed and optimized * for sorted arrays. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); * // => [1.1, 2.3] */ function sortedUniqBy(array, iteratee) { return (array && array.length) ? baseSortedUniq(array, getIteratee(iteratee, 2)) : []; } /** * Gets all but the first element of `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to query. * @returns {Array} Returns the slice of `array`. * @example * * _.tail([1, 2, 3]); * // => [2, 3] */ function tail(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 1, length) : []; } /** * Creates a slice of `array` with `n` elements taken from the beginning. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.take([1, 2, 3]); * // => [1] * * _.take([1, 2, 3], 2); * // => [1, 2] * * _.take([1, 2, 3], 5); * // => [1, 2, 3] * * _.take([1, 2, 3], 0); * // => [] */ function take(array, n, guard) { if (!(array && array.length)) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); return baseSlice(array, 0, n < 0 ? 0 : n); } /** * Creates a slice of `array` with `n` elements taken from the end. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {number} [n=1] The number of elements to take. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the slice of `array`. * @example * * _.takeRight([1, 2, 3]); * // => [3] * * _.takeRight([1, 2, 3], 2); * // => [2, 3] * * _.takeRight([1, 2, 3], 5); * // => [1, 2, 3] * * _.takeRight([1, 2, 3], 0); * // => [] */ function takeRight(array, n, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } n = (guard || n === undefined) ? 1 : toInteger(n); n = length - n; return baseSlice(array, n < 0 ? 0 : n, length); } /** * Creates a slice of `array` with elements taken from the end. Elements are * taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': false } * ]; * * _.takeRightWhile(users, function(o) { return !o.active; }); * // => objects for ['fred', 'pebbles'] * * // The `_.matches` iteratee shorthand. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); * // => objects for ['pebbles'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeRightWhile(users, ['active', false]); * // => objects for ['fred', 'pebbles'] * * // The `_.property` iteratee shorthand. * _.takeRightWhile(users, 'active'); * // => [] */ function takeRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; } /** * Creates a slice of `array` with elements taken from the beginning. Elements * are taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to query. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * * var users = [ * { 'user': 'barney', 'active': false }, * { 'user': 'fred', 'active': false }, * { 'user': 'pebbles', 'active': true } * ]; * * _.takeWhile(users, function(o) { return !o.active; }); * // => objects for ['barney', 'fred'] * * // The `_.matches` iteratee shorthand. * _.takeWhile(users, { 'user': 'barney', 'active': false }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.takeWhile(users, ['active', false]); * // => objects for ['barney', 'fred'] * * // The `_.property` iteratee shorthand. * _.takeWhile(users, 'active'); * // => [] */ function takeWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3)) : []; } /** * Creates an array of unique values, in order, from all given arrays using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of combined values. * @example * * _.union([2], [1, 2]); * // => [2, 1] */ var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); /** * This method is like `_.union` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which uniqueness is computed. Result values are chosen from the first * array in which the value occurs. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * _.unionBy([2.1], [1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ var unionBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); }); /** * This method is like `_.union` except that it accepts `comparator` which * is invoked to compare elements of `arrays`. Result values are chosen from * the first array in which the value occurs. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of combined values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var unionWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); }); /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each element * is kept. The order of result values is determined by the order they occur * in the array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniq([2, 1, 2]); * // => [2, 1] */ function uniq(array) { return (array && array.length) ? baseUniq(array) : []; } /** * This method is like `_.uniq` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * uniqueness is computed. The order of result values is determined by the * order they occur in the array. The iteratee is invoked with one argument: * (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * _.uniqBy([2.1, 1.2, 2.3], Math.floor); * // => [2.1, 1.2] * * // The `_.property` iteratee shorthand. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ function uniqBy(array, iteratee) { return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; } /** * This method is like `_.uniq` except that it accepts `comparator` which * is invoked to compare elements of `array`. The order of result values is * determined by the order they occur in the array.The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new duplicate free array. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.uniqWith(objects, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] */ function uniqWith(array, comparator) { comparator = typeof comparator == 'function' ? comparator : undefined; return (array && array.length) ? baseUniq(array, undefined, comparator) : []; } /** * This method is like `_.zip` except that it accepts an array of grouped * elements and creates an array regrouping the elements to their pre-zip * configuration. * * @static * @memberOf _ * @since 1.2.0 * @category Array * @param {Array} array The array of grouped elements to process. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] * * _.unzip(zipped); * // => [['a', 'b'], [1, 2], [true, false]] */ function unzip(array) { if (!(array && array.length)) { return []; } var length = 0; array = arrayFilter(array, function(group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); return baseTimes(length, function(index) { return arrayMap(array, baseProperty(index)); }); } /** * This method is like `_.unzip` except that it accepts `iteratee` to specify * how regrouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {Array} array The array of grouped elements to process. * @param {Function} [iteratee=_.identity] The function to combine * regrouped values. * @returns {Array} Returns the new array of regrouped elements. * @example * * var zipped = _.zip([1, 2], [10, 20], [100, 200]); * // => [[1, 10, 100], [2, 20, 200]] * * _.unzipWith(zipped, _.add); * // => [3, 30, 300] */ function unzipWith(array, iteratee) { if (!(array && array.length)) { return []; } var result = unzip(array); if (iteratee == null) { return result; } return arrayMap(result, function(group) { return apply(iteratee, undefined, group); }); } /** * Creates an array excluding all given values using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.pull`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {Array} array The array to inspect. * @param {...*} [values] The values to exclude. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.xor * @example * * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; }); /** * Creates an array of unique values that is the * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) * of the given arrays. The order of result values is determined by the order * they occur in the arrays. * * @static * @memberOf _ * @since 2.4.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @returns {Array} Returns the new array of filtered values. * @see _.difference, _.without * @example * * _.xor([2, 1], [2, 3]); * // => [1, 3] */ var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); /** * This method is like `_.xor` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which by which they're compared. The order of result values is determined * by the order they occur in the arrays. The iteratee is invoked with one * argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); * // => [1.2, 3.4] * * // The `_.property` iteratee shorthand. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ var xorBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); }); /** * This method is like `_.xor` except that it accepts `comparator` which is * invoked to compare elements of `arrays`. The order of result values is * determined by the order they occur in the arrays. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; * * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ var xorWith = baseRest(function(arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined; return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); }); /** * Creates an array of grouped elements, the first of which contains the * first elements of the given arrays, the second of which contains the * second elements of the given arrays, and so on. * * @static * @memberOf _ * @since 0.1.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] */ var zip = baseRest(unzip); /** * This method is like `_.fromPairs` except that it accepts two arrays, * one of property identifiers and one of corresponding values. * * @static * @memberOf _ * @since 0.4.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObject(['a', 'b'], [1, 2]); * // => { 'a': 1, 'b': 2 } */ function zipObject(props, values) { return baseZipObject(props || [], values || [], assignValue); } /** * This method is like `_.zipObject` except that it supports property paths. * * @static * @memberOf _ * @since 4.1.0 * @category Array * @param {Array} [props=[]] The property identifiers. * @param {Array} [values=[]] The property values. * @returns {Object} Returns the new object. * @example * * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } */ function zipObjectDeep(props, values) { return baseZipObject(props || [], values || [], baseSet); } /** * This method is like `_.zip` except that it accepts `iteratee` to specify * how grouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). * * @static * @memberOf _ * @since 3.8.0 * @category Array * @param {...Array} [arrays] The arrays to process. * @param {Function} [iteratee=_.identity] The function to combine * grouped values. * @returns {Array} Returns the new array of grouped elements. * @example * * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { * return a + b + c; * }); * // => [111, 222] */ var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined; iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; return unzipWith(arrays, iteratee); }); /*------------------------------------------------------------------------*/ /** * Creates a `lodash` wrapper instance that wraps `value` with explicit method * chain sequences enabled. The result of such sequences must be unwrapped * with `_#value`. * * @static * @memberOf _ * @since 1.3.0 * @category Seq * @param {*} value The value to wrap. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'pebbles', 'age': 1 } * ]; * * var youngest = _ * .chain(users) * .sortBy('age') * .map(function(o) { * return o.user + ' is ' + o.age; * }) * .head() * .value(); * // => 'pebbles is 1' */ function chain(value) { var result = lodash(value); result.__chain__ = true; return result; } /** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to * "tap into" a method chain sequence in order to modify intermediate results. * * @static * @memberOf _ * @since 0.1.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns `value`. * @example * * _([1, 2, 3]) * .tap(function(array) { * // Mutate input array. * array.pop(); * }) * .reverse() * .value(); * // => [2, 1] */ function tap(value, interceptor) { interceptor(value); return value; } /** * This method is like `_.tap` except that it returns the result of `interceptor`. * The purpose of this method is to "pass thru" values replacing intermediate * results in a method chain sequence. * * @static * @memberOf _ * @since 3.0.0 * @category Seq * @param {*} value The value to provide to `interceptor`. * @param {Function} interceptor The function to invoke. * @returns {*} Returns the result of `interceptor`. * @example * * _(' abc ') * .chain() * .trim() * .thru(function(value) { * return [value]; * }) * .value(); * // => ['abc'] */ function thru(value, interceptor) { return interceptor(value); } /** * This method is the wrapper version of `_.at`. * * @name at * @memberOf _ * @since 1.0.0 * @category Seq * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ var wrapperAt = flatRest(function(paths) { var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { return baseAt(object, paths); }; if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); return new LodashWrapper(value, this.__chain__).thru(function(array) { if (length && !array.length) { array.push(undefined); } return array; }); }); /** * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * * @name chain * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var users = [ * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 40 } * ]; * * // A sequence without explicit chaining. * _(users).head(); * // => { 'user': 'barney', 'age': 36 } * * // A sequence with explicit chaining. * _(users) * .chain() * .head() * .pick('user') * .value(); * // => { 'user': 'barney' } */ function wrapperChain() { return chain(this); } /** * Executes the chain sequence and returns the wrapped result. * * @name commit * @memberOf _ * @since 3.2.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2]; * var wrapped = _(array).push(3); * * console.log(array); * // => [1, 2] * * wrapped = wrapped.commit(); * console.log(array); * // => [1, 2, 3] * * wrapped.last(); * // => 3 * * console.log(array); * // => [1, 2, 3] */ function wrapperCommit() { return new LodashWrapper(this.value(), this.__chain__); } /** * Gets the next value on a wrapped object following the * [iterator protocol](https://mdn.io/iteration_protocols#iterator). * * @name next * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the next iterator value. * @example * * var wrapped = _([1, 2]); * * wrapped.next(); * // => { 'done': false, 'value': 1 } * * wrapped.next(); * // => { 'done': false, 'value': 2 } * * wrapped.next(); * // => { 'done': true, 'value': undefined } */ function wrapperNext() { if (this.__values__ === undefined) { this.__values__ = toArray(this.value()); } var done = this.__index__ >= this.__values__.length, value = done ? undefined : this.__values__[this.__index__++]; return { 'done': done, 'value': value }; } /** * Enables the wrapper to be iterable. * * @name Symbol.iterator * @memberOf _ * @since 4.0.0 * @category Seq * @returns {Object} Returns the wrapper object. * @example * * var wrapped = _([1, 2]); * * wrapped[Symbol.iterator]() === wrapped; * // => true * * Array.from(wrapped); * // => [1, 2] */ function wrapperToIterator() { return this; } /** * Creates a clone of the chain sequence planting `value` as the wrapped value. * * @name plant * @memberOf _ * @since 3.2.0 * @category Seq * @param {*} value The value to plant. * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * function square(n) { * return n * n; * } * * var wrapped = _([1, 2]).map(square); * var other = wrapped.plant([3, 4]); * * other.value(); * // => [9, 16] * * wrapped.value(); * // => [1, 4] */ function wrapperPlant(value) { var result, parent = this; while (parent instanceof baseLodash) { var clone = wrapperClone(parent); clone.__index__ = 0; clone.__values__ = undefined; if (result) { previous.__wrapped__ = clone; } else { result = clone; } var previous = clone; parent = parent.__wrapped__; } previous.__wrapped__ = value; return result; } /** * This method is the wrapper version of `_.reverse`. * * **Note:** This method mutates the wrapped array. * * @name reverse * @memberOf _ * @since 0.1.0 * @category Seq * @returns {Object} Returns the new `lodash` wrapper instance. * @example * * var array = [1, 2, 3]; * * _(array).reverse().value() * // => [3, 2, 1] * * console.log(array); * // => [3, 2, 1] */ function wrapperReverse() { var value = this.__wrapped__; if (value instanceof LazyWrapper) { var wrapped = value; if (this.__actions__.length) { wrapped = new LazyWrapper(this); } wrapped = wrapped.reverse(); wrapped.__actions__.push({ 'func': thru, 'args': [reverse], 'thisArg': undefined }); return new LodashWrapper(wrapped, this.__chain__); } return this.thru(reverse); } /** * Executes the chain sequence to resolve the unwrapped value. * * @name value * @memberOf _ * @since 0.1.0 * @alias toJSON, valueOf * @category Seq * @returns {*} Returns the resolved unwrapped value. * @example * * _([1, 2, 3]).value(); * // => [1, 2, 3] */ function wrapperValue() { return baseWrapperValue(this.__wrapped__, this.__actions__); } /*------------------------------------------------------------------------*/ /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the number of times the key was returned by `iteratee`. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.5.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.countBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': 1, '6': 2 } * * // The `_.property` iteratee shorthand. * _.countBy(['one', 'two', 'three'], 'length'); * // => { '3': 2, '5': 1 } */ var countBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { ++result[key]; } else { baseAssignValue(result, key, 1); } }); /** * Checks if `predicate` returns truthy for **all** elements of `collection`. * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). * * **Note:** This method returns `true` for * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of * elements of empty collections. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, * else `false`. * @example * * _.every([true, 1, null, 'yes'], Boolean); * // => false * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.every(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.every(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.every(users, 'active'); * // => false */ function every(collection, predicate, guard) { var func = isArray(collection) ? arrayEvery : baseEvery; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * **Note:** Unlike `_.remove`, this method returns a new array. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * _.filter(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.filter(users, { 'age': 36, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.filter(users, 'active'); * // => objects for ['barney'] * * // Combining several predicates using `_.overEvery` or `_.overSome`. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); * // => objects for ['fred', 'barney'] */ function filter(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, getIteratee(predicate, 3)); } /** * Iterates over elements of `collection`, returning the first element * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false }, * { 'user': 'pebbles', 'age': 1, 'active': true } * ]; * * _.find(users, function(o) { return o.age < 40; }); * // => object for 'barney' * * // The `_.matches` iteratee shorthand. * _.find(users, { 'age': 1, 'active': true }); * // => object for 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.find(users, ['active', false]); * // => object for 'fred' * * // The `_.property` iteratee shorthand. * _.find(users, 'active'); * // => object for 'barney' */ var find = createFind(findIndex); /** * This method is like `_.find` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. * @example * * _.findLast([1, 2, 3, 4], function(n) { * return n % 2 == 1; * }); * // => 3 */ var findLast = createFind(findLastIndex); /** * Creates a flattened array of values by running each element in `collection` * thru `iteratee` and flattening the mapped results. The iteratee is invoked * with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [n, n]; * } * * _.flatMap([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMap(collection, iteratee) { return baseFlatten(map(collection, iteratee), 1); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDeep([1, 2], duplicate); * // => [1, 1, 2, 2] */ function flatMapDeep(collection, iteratee) { return baseFlatten(map(collection, iteratee), INFINITY); } /** * This method is like `_.flatMap` except that it recursively flattens the * mapped results up to `depth` times. * * @static * @memberOf _ * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. * @example * * function duplicate(n) { * return [[[n, n]]]; * } * * _.flatMapDepth([1, 2], duplicate, 2); * // => [[1, 1], [2, 2]] */ function flatMapDepth(collection, iteratee, depth) { depth = depth === undefined ? 1 : toInteger(depth); return baseFlatten(map(collection, iteratee), depth); } /** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. * * **Note:** As with other "Collections" methods, objects with a "length" * property are iterated like arrays. To avoid this behavior use `_.forIn` * or `_.forOwn` for object iteration. * * @static * @memberOf _ * @since 0.1.0 * @alias each * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEachRight * @example * * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. * * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forEach(collection, iteratee) { var func = isArray(collection) ? arrayEach : baseEach; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.forEach` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @alias eachRight * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array|Object} Returns `collection`. * @see _.forEach * @example * * _.forEachRight([1, 2], function(value) { * console.log(value); * }); * // => Logs `2` then `1`. */ function forEachRight(collection, iteratee) { var func = isArray(collection) ? arrayEachRight : baseEachRight; return func(collection, getIteratee(iteratee, 3)); } /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The order of grouped values * is determined by the order they occur in `collection`. The corresponding * value of each key is an array of elements responsible for generating the * key. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * _.groupBy([6.1, 4.2, 6.3], Math.floor); * // => { '4': [4.2], '6': [6.1, 6.3] } * * // The `_.property` iteratee shorthand. * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } */ var groupBy = createAggregator(function(result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { baseAssignValue(result, key, [value]); } }); /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {boolean} Returns `true` if `value` is found, else `false`. * @example * * _.includes([1, 2, 3], 1); * // => true * * _.includes([1, 2, 3], 1, 2); * // => false * * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { collection = isArrayLike(collection) ? collection : values(collection); fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; var length = collection.length; if (fromIndex < 0) { fromIndex = nativeMax(length + fromIndex, 0); } return isString(collection) ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) : (!!length && baseIndexOf(collection, value, fromIndex) > -1); } /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments * are provided to each invoked method. If `path` is a function, it's invoked * for, and `this` bound to, each element in `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array|Function|string} path The path of the method to invoke or * the function invoked per iteration. * @param {...*} [args] The arguments to invoke each method with. * @returns {Array} Returns the array of results. * @example * * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); * // => [[1, 5, 7], [1, 2, 3]] * * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ var invokeMap = baseRest(function(collection, path, args) { var index = -1, isFunc = typeof path == 'function', result = isArrayLike(collection) ? Array(collection.length) : []; baseEach(collection, function(value) { result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); }); return result; }); /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the last element responsible for generating the key. The * iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example * * var array = [ * { 'dir': 'left', 'code': 97 }, * { 'dir': 'right', 'code': 100 } * ]; * * _.keyBy(array, function(o) { * return String.fromCharCode(o.code); * }); * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } * * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { baseAssignValue(result, key, value); }); /** * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. * * The guarded methods are: * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, * `template`, `trim`, `trimEnd`, `trimStart`, and `words` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * * function square(n) { * return n * n; * } * * _.map([4, 8], square); * // => [16, 64] * * _.map({ 'a': 4, 'b': 8 }, square); * // => [16, 64] (iteration order is not guaranteed) * * var users = [ * { 'user': 'barney' }, * { 'user': 'fred' } * ]; * * // The `_.property` iteratee shorthand. * _.map(users, 'user'); * // => ['barney', 'fred'] */ function map(collection, iteratee) { var func = isArray(collection) ? arrayMap : baseMap; return func(collection, getIteratee(iteratee, 3)); } /** * This method is like `_.sortBy` except that it allows specifying the sort * orders of the iteratees to sort by. If `orders` is unspecified, all values * are sorted in ascending order. Otherwise, specify an order of "desc" for * descending or "asc" for ascending sort order of corresponding values. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] * The iteratees to sort by. * @param {string[]} [orders] The sort orders of `iteratees`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 34 }, * { 'user': 'fred', 'age': 40 }, * { 'user': 'barney', 'age': 36 } * ]; * * // Sort by `user` in ascending order and by `age` in descending order. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ function orderBy(collection, iteratees, orders, guard) { if (collection == null) { return []; } if (!isArray(iteratees)) { iteratees = iteratees == null ? [] : [iteratees]; } orders = guard ? undefined : orders; if (!isArray(orders)) { orders = orders == null ? [] : [orders]; } return baseOrderBy(collection, iteratees, orders); } /** * Creates an array of elements split into two groups, the first of which * contains elements `predicate` returns truthy for, the second of which * contains elements `predicate` returns falsey for. The predicate is * invoked with one argument: (value). * * @static * @memberOf _ * @since 3.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of grouped elements. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true }, * { 'user': 'pebbles', 'age': 1, 'active': false } * ]; * * _.partition(users, function(o) { return o.active; }); * // => objects for [['fred'], ['barney', 'pebbles']] * * // The `_.matches` iteratee shorthand. * _.partition(users, { 'age': 1, 'active': false }); * // => objects for [['pebbles'], ['barney', 'fred']] * * // The `_.matchesProperty` iteratee shorthand. * _.partition(users, ['active', false]); * // => objects for [['barney', 'pebbles'], ['fred']] * * // The `_.property` iteratee shorthand. * _.partition(users, 'active'); * // => objects for [['fred'], ['barney', 'pebbles']] */ var partition = createAggregator(function(result, value, key) { result[key ? 0 : 1].push(value); }, function() { return [[], []]; }); /** * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` * is not given, the first element of `collection` is used as the initial * value. The iteratee is invoked with four arguments: * (accumulator, value, index|key, collection). * * Many lodash methods are guarded to work as iteratees for methods like * `_.reduce`, `_.reduceRight`, and `_.transform`. * * The guarded methods are: * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, * and `sortBy` * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduceRight * @example * * _.reduce([1, 2], function(sum, n) { * return sum + n; * }, 0); * // => 3 * * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * return result; * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); } /** * This method is like `_.reduce` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The initial value. * @returns {*} Returns the accumulated value. * @see _.reduce * @example * * var array = [[0, 1], [2, 3], [4, 5]]; * * _.reduceRight(array, function(flattened, other) { * return flattened.concat(other); * }, []); * // => [4, 5, 2, 3, 0, 1] */ function reduceRight(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } /** * The opposite of `_.filter`; this method returns the elements of `collection` * that `predicate` does **not** return truthy for. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.filter * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': false }, * { 'user': 'fred', 'age': 40, 'active': true } * ]; * * _.reject(users, function(o) { return !o.active; }); * // => objects for ['fred'] * * // The `_.matches` iteratee shorthand. * _.reject(users, { 'age': 40, 'active': true }); * // => objects for ['barney'] * * // The `_.matchesProperty` iteratee shorthand. * _.reject(users, ['active', false]); * // => objects for ['fred'] * * // The `_.property` iteratee shorthand. * _.reject(users, 'active'); * // => objects for ['barney'] */ function reject(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; return func(collection, negate(getIteratee(predicate, 3))); } /** * Gets a random element from `collection`. * * @static * @memberOf _ * @since 2.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. * @example * * _.sample([1, 2, 3, 4]); * // => 2 */ function sample(collection) { var func = isArray(collection) ? arraySample : baseSample; return func(collection); } /** * Gets `n` random elements at unique keys from `collection` up to the * size of `collection`. * * @static * @memberOf _ * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to sample. * @param {number} [n=1] The number of elements to sample. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the random elements. * @example * * _.sampleSize([1, 2, 3], 2); * // => [3, 1] * * _.sampleSize([1, 2, 3], 4); * // => [2, 3, 1] */ function sampleSize(collection, n, guard) { if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } var func = isArray(collection) ? arraySampleSize : baseSampleSize; return func(collection, n); } /** * Creates an array of shuffled values, using a version of the * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to shuffle. * @returns {Array} Returns the new shuffled array. * @example * * _.shuffle([1, 2, 3, 4]); * // => [4, 1, 3, 2] */ function shuffle(collection) { var func = isArray(collection) ? arrayShuffle : baseShuffle; return func(collection); } /** * Gets the size of `collection` by returning its length for array-like * values or the number of own enumerable string keyed properties for objects. * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object|string} collection The collection to inspect. * @returns {number} Returns the collection size. * @example * * _.size([1, 2, 3]); * // => 3 * * _.size({ 'a': 1, 'b': 2 }); * // => 2 * * _.size('pebbles'); * // => 7 */ function size(collection) { if (collection == null) { return 0; } if (isArrayLike(collection)) { return isString(collection) ? stringSize(collection) : collection.length; } var tag = getTag(collection); if (tag == mapTag || tag == setTag) { return collection.size; } return baseKeys(collection).length; } /** * Checks if `predicate` returns truthy for **any** element of `collection`. * Iteration is stopped once `predicate` returns truthy. The predicate is * invoked with three arguments: (value, index|key, collection). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. * @example * * _.some([null, 0, 'yes', false], Boolean); * // => true * * var users = [ * { 'user': 'barney', 'active': true }, * { 'user': 'fred', 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.some(users, { 'user': 'barney', 'active': false }); * // => false * * // The `_.matchesProperty` iteratee shorthand. * _.some(users, ['active', false]); * // => true * * // The `_.property` iteratee shorthand. * _.some(users, 'active'); * // => true */ function some(collection, predicate, guard) { var func = isArray(collection) ? arraySome : baseSome; if (guard && isIterateeCall(collection, predicate, guard)) { predicate = undefined; } return func(collection, getIteratee(predicate, 3)); } /** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of * equal elements. The iteratees are invoked with one argument: (value). * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * * var users = [ * { 'user': 'fred', 'age': 48 }, * { 'user': 'barney', 'age': 36 }, * { 'user': 'fred', 'age': 30 }, * { 'user': 'barney', 'age': 34 } * ]; * * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } var length = iteratees.length; if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { iteratees = []; } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); /*------------------------------------------------------------------------*/ /** * Gets the timestamp of the number of milliseconds that have elapsed since * the Unix epoch (1 January 1970 00:00:00 UTC). * * @static * @memberOf _ * @since 2.4.0 * @category Date * @returns {number} Returns the timestamp. * @example * * _.defer(function(stamp) { * console.log(_.now() - stamp); * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ var now = ctxNow || function() { return root.Date.now(); }; /*------------------------------------------------------------------------*/ /** * The opposite of `_.before`; this method creates a function that invokes * `func` once it's called `n` or more times. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {number} n The number of calls before `func` is invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var saves = ['profile', 'settings']; * * var done = _.after(saves.length, function() { * console.log('done saving!'); * }); * * _.forEach(saves, function(type) { * asyncSave({ 'type': type, 'complete': done }); * }); * // => Logs 'done saving!' after the two async saves have completed. */ function after(n, func) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n < 1) { return func.apply(this, arguments); } }; } /** * Creates a function that invokes `func`, with up to `n` arguments, * ignoring any additional arguments. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @param {number} [n=func.length] The arity cap. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.ary(parseInt, 1)); * // => [6, 8, 10] */ function ary(func, n, guard) { n = guard ? undefined : n; n = (func && n == null) ? func.length : n; return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); } /** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it's called less than `n` times. Subsequent * calls to the created function return the result of the last `func` invocation. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {number} n The number of calls at which `func` is no longer invoked. * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * jQuery(element).on('click', _.before(5, addContactToList)); * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); return function() { if (--n > 0) { result = func.apply(this, arguments); } if (n <= 1) { func = undefined; } return result; }; } /** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and `partials` prepended to the arguments it receives. * * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for partially applied arguments. * * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" * property of bound functions. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to bind. * @param {*} thisArg The `this` binding of `func`. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * * var object = { 'user': 'fred' }; * * var bound = _.bind(greet, object, 'hi'); * bound('!'); * // => 'hi fred!' * * // Bound with placeholders. * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' */ var bind = baseRest(function(func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(func, bitmask, thisArg, partials, holders); }); /** * Creates a function that invokes the method at `object[key]` with `partials` * prepended to the arguments it receives. * * This method differs from `_.bind` by allowing bound functions to reference * methods that may be redefined or don't yet exist. See * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) * for more details. * * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * @static * @memberOf _ * @since 0.10.0 * @category Function * @param {Object} object The object to invoke the method on. * @param {string} key The key of the method. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new bound function. * @example * * var object = { * 'user': 'fred', * 'greet': function(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; * } * }; * * var bound = _.bindKey(object, 'greet', 'hi'); * bound('!'); * // => 'hi fred!' * * object.greet = function(greeting, punctuation) { * return greeting + 'ya ' + this.user + punctuation; * }; * * bound('!'); * // => 'hiya fred!' * * // Bound with placeholders. * var bound = _.bindKey(object, 'greet', _, '!'); * bound('hi'); * // => 'hiya fred!' */ var bindKey = baseRest(function(object, key, partials) { var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= WRAP_PARTIAL_FLAG; } return createWrap(key, bitmask, object, partials, holders); }); /** * Creates a function that accepts arguments of `func` and either invokes * `func` returning its result, if at least `arity` number of arguments have * been provided, or returns a function that accepts the remaining `func` * arguments, and so on. The arity of `func` may be specified if `func.length` * is not sufficient. * * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, * may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 2.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curry(abc); * * curried(1)(2)(3); * // => [1, 2, 3] * * curried(1, 2)(3); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(1)(_, 3)(2); * // => [1, 2, 3] */ function curry(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curry.placeholder; return result; } /** * This method is like `_.curry` except that arguments are applied to `func` * in the manner of `_.partialRight` instead of `_.partial`. * * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for provided arguments. * * **Note:** This method doesn't set the "length" property of curried functions. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to curry. * @param {number} [arity=func.length] The arity of `func`. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the new curried function. * @example * * var abc = function(a, b, c) { * return [a, b, c]; * }; * * var curried = _.curryRight(abc); * * curried(3)(2)(1); * // => [1, 2, 3] * * curried(2, 3)(1); * // => [1, 2, 3] * * curried(1, 2, 3); * // => [1, 2, 3] * * // Curried with placeholders. * curried(3)(1, _)(2); * // => [1, 2, 3] */ function curryRight(func, arity, guard) { arity = guard ? undefined : arity; var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curryRight.placeholder; return result; } /** * Creates a debounced function that delays invoking `func` until after `wait` * milliseconds have elapsed since the last time the debounced function was * invoked. The debounced function comes with a `cancel` method to cancel * delayed `func` invocations and a `flush` method to immediately invoke them. * Provide `options` to indicate whether `func` should be invoked on the * leading and/or trailing edge of the `wait` timeout. The `func` is invoked * with the last arguments provided to the debounced function. Subsequent * calls to the debounced function return the result of the last `func` * invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the debounced function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to debounce. * @param {number} [wait=0] The number of milliseconds to delay. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=false] * Specify invoking on the leading edge of the timeout. * @param {number} [options.maxWait] * The maximum time `func` is allowed to be delayed before it's invoked. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new debounced function. * @example * * // Avoid costly calculations while the window size is in flux. * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); * * // Invoke `sendMail` when clicked, debouncing subsequent calls. * jQuery(element).on('click', _.debounce(sendMail, 300, { * 'leading': true, * 'trailing': false * })); * * // Ensure `batchLog` is invoked once after 1 second of debounced calls. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); * var source = new EventSource('/stream'); * jQuery(source).on('message', debounced); * * // Cancel the trailing debounced invocation. * jQuery(window).on('popstate', debounced.cancel); */ function debounce(func, wait, options) { var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } wait = toNumber(wait) || 0; if (isObject(options)) { leading = !!options.leading; maxing = 'maxWait' in options; maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; trailing = 'trailing' in options ? !!options.trailing : trailing; } function invokeFunc(time) { var args = lastArgs, thisArg = lastThis; lastArgs = lastThis = undefined; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function leadingEdge(time) { // Reset any `maxWait` timer. lastInvokeTime = time; // Start the timer for the trailing edge. timerId = setTimeout(timerExpired, wait); // Invoke the leading edge. return leading ? invokeFunc(time) : result; } function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; // Either this is the first call, activity has stopped and we're at the // trailing edge, the system time has gone backwards and we're treating // it as the trailing edge, or we've hit the `maxWait` limit. return (lastCallTime === undefined || (timeSinceLastCall >= wait) || (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); } function timerExpired() { var time = now(); if (shouldInvoke(time)) { return trailingEdge(time); } // Restart the timer. timerId = setTimeout(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined; // Only invoke if we have `lastArgs` which means `func` has been // debounced at least once. if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined; return result; } function cancel() { if (timerId !== undefined) { clearTimeout(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } function flush() { return timerId === undefined ? result : trailingEdge(now()); } function debounced() { var time = now(), isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined) { return leadingEdge(lastCallTime); } if (maxing) { // Handle invocations in a tight loop. clearTimeout(timerId); timerId = setTimeout(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined) { timerId = setTimeout(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; return debounced; } /** * Defers invoking the `func` until the current call stack has cleared. Any * additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to defer. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.defer(function(text) { * console.log(text); * }, 'deferred'); * // => Logs 'deferred' after one millisecond. */ var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); /** * Invokes `func` after `wait` milliseconds. Any additional arguments are * provided to `func` when it's invoked. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. * @param {...*} [args] The arguments to invoke `func` with. * @returns {number} Returns the timer id. * @example * * _.delay(function(text) { * console.log(text); * }, 1000, 'later'); * // => Logs 'later' after one second. */ var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); /** * Creates a function that invokes `func` with arguments reversed. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to flip arguments for. * @returns {Function} Returns the new flipped function. * @example * * var flipped = _.flip(function() { * return _.toArray(arguments); * }); * * flipped('a', 'b', 'c', 'd'); * // => ['d', 'c', 'b', 'a'] */ function flip(func) { return createWrap(func, WRAP_FLIP_FLAG); } /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `clear`, `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Expose `MapCache`. memoize.Cache = MapCache; /** * Creates a function that negates the result of the predicate `func`. The * `func` predicate is invoked with the `this` binding and arguments of the * created function. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} predicate The predicate to negate. * @returns {Function} Returns the new negated function. * @example * * function isEven(n) { * return n % 2 == 0; * } * * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); * // => [1, 3, 5] */ function negate(predicate) { if (typeof predicate != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return function() { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); case 1: return !predicate.call(this, args[0]); case 2: return !predicate.call(this, args[0], args[1]); case 3: return !predicate.call(this, args[0], args[1], args[2]); } return !predicate.apply(this, args); }; } /** * Creates a function that is restricted to invoking `func` once. Repeat calls * to the function return the value of the first invocation. The `func` is * invoked with the `this` binding and arguments of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to restrict. * @returns {Function} Returns the new restricted function. * @example * * var initialize = _.once(createApplication); * initialize(); * initialize(); * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } /** * Creates a function that invokes `func` with its arguments transformed. * * @static * @since 4.0.0 * @memberOf _ * @category Function * @param {Function} func The function to wrap. * @param {...(Function|Function[])} [transforms=[_.identity]] * The argument transforms. * @returns {Function} Returns the new function. * @example * * function doubled(n) { * return n * 2; * } * * function square(n) { * return n * n; * } * * var func = _.overArgs(function(x, y) { * return [x, y]; * }, [square, doubled]); * * func(9, 3); * // => [81, 6] * * func(10, 5); * // => [100, 10] */ var overArgs = castRest(function(func, transforms) { transforms = (transforms.length == 1 && isArray(transforms[0])) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; return baseRest(function(args) { var index = -1, length = nativeMin(args.length, funcsLength); while (++index < length) { args[index] = transforms[index].call(this, args[index]); } return apply(func, this, args); }); }); /** * Creates a function that invokes `func` with `partials` prepended to the * arguments it receives. This method is like `_.bind` except it does **not** * alter the `this` binding. * * The `_.partial.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 0.2.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var sayHelloTo = _.partial(greet, 'hello'); * sayHelloTo('fred'); * // => 'hello fred' * * // Partially applied with placeholders. * var greetFred = _.partial(greet, _, 'fred'); * greetFred('hi'); * // => 'hi fred' */ var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); }); /** * This method is like `_.partial` except that partially applied arguments * are appended to the arguments it receives. * * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic * builds, may be used as a placeholder for partially applied arguments. * * **Note:** This method doesn't set the "length" property of partially * applied functions. * * @static * @memberOf _ * @since 1.0.0 * @category Function * @param {Function} func The function to partially apply arguments to. * @param {...*} [partials] The arguments to be partially applied. * @returns {Function} Returns the new partially applied function. * @example * * function greet(greeting, name) { * return greeting + ' ' + name; * } * * var greetFred = _.partialRight(greet, 'fred'); * greetFred('hi'); * // => 'hi fred' * * // Partially applied with placeholders. * var sayHelloTo = _.partialRight(greet, 'hello', _); * sayHelloTo('fred'); * // => 'hello fred' */ var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); /** * Creates a function that invokes `func` with arguments arranged according * to the specified `indexes` where the argument value at the first index is * provided as the first argument, the argument value at the second index is * provided as the second argument, and so on. * * @static * @memberOf _ * @since 3.0.0 * @category Function * @param {Function} func The function to rearrange arguments for. * @param {...(number|number[])} indexes The arranged argument indexes. * @returns {Function} Returns the new function. * @example * * var rearged = _.rearg(function(a, b, c) { * return [a, b, c]; * }, [2, 0, 1]); * * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ var rearg = flatRest(function(func, indexes) { return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); }); /** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as * an array. * * **Note:** This method is based on the * [rest parameter](https://mdn.io/rest_parameters). * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. * @example * * var say = _.rest(function(what, names) { * return what + ' ' + _.initial(names).join(', ') + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); * }); * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' */ function rest(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start === undefined ? start : toInteger(start); return baseRest(func, start); } /** * Creates a function that invokes `func` with the `this` binding of the * create function and an array of arguments much like * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). * * **Note:** This method is based on the * [spread operator](https://mdn.io/spread_operator). * * @static * @memberOf _ * @since 3.2.0 * @category Function * @param {Function} func The function to spread arguments over. * @param {number} [start=0] The start position of the spread. * @returns {Function} Returns the new function. * @example * * var say = _.spread(function(who, what) { * return who + ' says ' + what; * }); * * say(['fred', 'hello']); * // => 'fred says hello' * * var numbers = Promise.all([ * Promise.resolve(40), * Promise.resolve(36) * ]); * * numbers.then(_.spread(function(x, y) { * return x + y; * })); * // => a Promise of 76 */ function spread(func, start) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } start = start == null ? 0 : nativeMax(toInteger(start), 0); return baseRest(function(args) { var array = args[start], otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); } return apply(func, this, otherArgs); }); } /** * Creates a throttled function that only invokes `func` at most once per * every `wait` milliseconds. The throttled function comes with a `cancel` * method to cancel delayed `func` invocations and a `flush` method to * immediately invoke them. Provide `options` to indicate whether `func` * should be invoked on the leading and/or trailing edge of the `wait` * timeout. The `func` is invoked with the last arguments provided to the * throttled function. Subsequent calls to the throttled function return the * result of the last `func` invocation. * * **Note:** If `leading` and `trailing` options are `true`, `func` is * invoked on the trailing edge of the timeout only if the throttled function * is invoked more than once during the `wait` timeout. * * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to throttle. * @param {number} [wait=0] The number of milliseconds to throttle invocations to. * @param {Object} [options={}] The options object. * @param {boolean} [options.leading=true] * Specify invoking on the leading edge of the timeout. * @param {boolean} [options.trailing=true] * Specify invoking on the trailing edge of the timeout. * @returns {Function} Returns the new throttled function. * @example * * // Avoid excessively updating the position while scrolling. * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); * * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); * jQuery(element).on('click', throttled); * * // Cancel the trailing throttled invocation. * jQuery(window).on('popstate', throttled.cancel); */ function throttle(func, wait, options) { var leading = true, trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } if (isObject(options)) { leading = 'leading' in options ? !!options.leading : leading; trailing = 'trailing' in options ? !!options.trailing : trailing; } return debounce(func, wait, { 'leading': leading, 'maxWait': wait, 'trailing': trailing }); } /** * Creates a function that accepts up to one argument, ignoring any * additional arguments. * * @static * @memberOf _ * @since 4.0.0 * @category Function * @param {Function} func The function to cap arguments for. * @returns {Function} Returns the new capped function. * @example * * _.map(['6', '8', '10'], _.unary(parseInt)); * // => [6, 8, 10] */ function unary(func) { return ary(func, 1); } /** * Creates a function that provides `value` to `wrapper` as its first * argument. Any additional arguments provided to the function are appended * to those provided to the `wrapper`. The wrapper is invoked with the `this` * binding of the created function. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {*} value The value to wrap. * @param {Function} [wrapper=identity] The wrapper function. * @returns {Function} Returns the new function. * @example * * var p = _.wrap(_.escape, function(func, text) { * return '<p>' + func(text) + '</p>'; * }); * * p('fred, barney, & pebbles'); * // => '<p>fred, barney, & pebbles</p>' */ function wrap(value, wrapper) { return partial(castFunction(wrapper), value); } /*------------------------------------------------------------------------*/ /** * Casts `value` as an array if it's not one. * * @static * @memberOf _ * @since 4.4.0 * @category Lang * @param {*} value The value to inspect. * @returns {Array} Returns the cast array. * @example * * _.castArray(1); * // => [1] * * _.castArray({ 'a': 1 }); * // => [{ 'a': 1 }] * * _.castArray('abc'); * // => ['abc'] * * _.castArray(null); * // => [null] * * _.castArray(undefined); * // => [undefined] * * _.castArray(); * // => [] * * var array = [1, 2, 3]; * console.log(_.castArray(array) === array); * // => true */ function castArray() { if (!arguments.length) { return []; } var value = arguments[0]; return isArray(value) ? value : [value]; } /** * Creates a shallow clone of `value`. * * **Note:** This method is loosely based on the * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) * and supports cloning arrays, array buffers, booleans, date objects, maps, * numbers, `Object` objects, regexes, sets, strings, symbols, and typed * arrays. The own enumerable properties of `arguments` objects are cloned * as plain objects. An empty object is returned for uncloneable values such * as error objects, functions, DOM nodes, and WeakMaps. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to clone. * @returns {*} Returns the cloned value. * @see _.cloneDeep * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var shallow = _.clone(objects); * console.log(shallow[0] === objects[0]); * // => true */ function clone(value) { return baseClone(value, CLONE_SYMBOLS_FLAG); } /** * This method is like `_.clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with * up to four arguments; (value [, index|key, object, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the cloned value. * @see _.cloneDeepWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(false); * } * } * * var el = _.cloneWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 0 */ function cloneWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); } /** * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. * @see _.clone * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; * * var deep = _.cloneDeep(objects); * console.log(deep[0] === objects[0]); * // => false */ function cloneDeep(value) { return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); } /** * This method is like `_.cloneWith` except that it recursively clones `value`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to recursively clone. * @param {Function} [customizer] The function to customize cloning. * @returns {*} Returns the deep cloned value. * @see _.cloneWith * @example * * function customizer(value) { * if (_.isElement(value)) { * return value.cloneNode(true); * } * } * * var el = _.cloneDeepWith(document.body, customizer); * * console.log(el === document.body); * // => false * console.log(el.nodeName); * // => 'BODY' * console.log(el.childNodes.length); * // => 20 */ function cloneDeepWith(value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); } /** * Checks if `object` conforms to `source` by invoking the predicate * properties of `source` with the corresponding property values of `object`. * * **Note:** This method is equivalent to `_.conforms` when `source` is * partially applied. * * @static * @memberOf _ * @since 4.14.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); * // => true * * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); * // => false */ function conformsTo(object, source) { return source == null || baseConformsTo(object, source, keys(source)); } /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is greater than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than `other`, * else `false`. * @see _.lt * @example * * _.gt(3, 1); * // => true * * _.gt(3, 3); * // => false * * _.gt(1, 3); * // => false */ var gt = createRelationalOperation(baseGt); /** * Checks if `value` is greater than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is greater than or equal to * `other`, else `false`. * @see _.lte * @example * * _.gte(3, 1); * // => true * * _.gte(3, 3); * // => true * * _.gte(1, 3); * // => false */ var gte = createRelationalOperation(function(value, other) { return value >= other; }); /** * Checks if `value` is likely an `arguments` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * * _.isArguments(function() { return arguments; }()); * // => true * * _.isArguments([1, 2, 3]); * // => false */ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is classified as an `ArrayBuffer` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * * _.isArrayBuffer(new ArrayBuffer(2)); * // => true * * _.isArrayBuffer(new Array(2)); * // => false */ var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is array-like, else `false`. * @example * * _.isArrayLike([1, 2, 3]); * // => true * * _.isArrayLike(document.body.children); * // => true * * _.isArrayLike('abc'); * // => true * * _.isArrayLike(_.noop); * // => false */ function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); } /** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array-like object, * else `false`. * @example * * _.isArrayLikeObject([1, 2, 3]); * // => true * * _.isArrayLikeObject(document.body.children); * // => true * * _.isArrayLikeObject('abc'); * // => false * * _.isArrayLikeObject(_.noop); * // => false */ function isArrayLikeObject(value) { return isObjectLike(value) && isArrayLike(value); } /** * Checks if `value` is classified as a boolean primitive or object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * * _.isBoolean(false); * // => true * * _.isBoolean(null); * // => false */ function isBoolean(value) { return value === true || value === false || (isObjectLike(value) && baseGetTag(value) == boolTag); } /** * Checks if `value` is a buffer. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. * @example * * _.isBuffer(new Buffer(2)); * // => true * * _.isBuffer(new Uint8Array(2)); * // => false */ var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Date` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); * // => true * * _.isDate('Mon April 23 2012'); * // => false */ var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; /** * Checks if `value` is likely a DOM element. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * * _.isElement(document.body); * // => true * * _.isElement('<body>'); * // => false */ function isElement(value) { return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); } /** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have a `length` of `0`. * Similarly, maps and sets are considered empty if they have a `size` of `0`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is empty, else `false`. * @example * * _.isEmpty(null); * // => true * * _.isEmpty(true); * // => true * * _.isEmpty(1); * // => true * * _.isEmpty([1, 2, 3]); * // => false * * _.isEmpty({ 'a': 1 }); * // => false */ function isEmpty(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } if (isPrototype(value)) { return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } return true; } /** * Performs a deep comparison between two values to determine if they are * equivalent. * * **Note:** This method supports comparing arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, * sets, strings, symbols, and typed arrays. `Object` objects are compared * by their own, not inherited, enumerable properties. Functions and DOM * nodes are compared by strict equality, i.e. `===`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true * * object === other; * // => false */ function isEqual(value, other) { return baseIsEqual(value, other); } /** * This method is like `_.isEqual` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with up to * six arguments: (objValue, othValue [, index|key, object, other, stack]). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, othValue) { * if (isGreeting(objValue) && isGreeting(othValue)) { * return true; * } * } * * var array = ['hello', 'goodbye']; * var other = ['hi', 'goodbye']; * * _.isEqualWith(array, other, customizer); * // => true */ function isEqualWith(value, other, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; var result = customizer ? customizer(value, other) : undefined; return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; } /** * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, * `SyntaxError`, `TypeError`, or `URIError` object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * * _.isError(new Error); * // => true * * _.isError(Error); * // => false */ function isError(value) { if (!isObjectLike(value)) { return false; } var tag = baseGetTag(value); return tag == errorTag || tag == domExcTag || (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); } /** * Checks if `value` is a finite primitive number. * * **Note:** This method is based on * [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * * _.isFinite(3); * // => true * * _.isFinite(Number.MIN_VALUE); * // => true * * _.isFinite(Infinity); * // => false * * _.isFinite('3'); * // => false */ function isFinite(value) { return typeof value == 'number' && nativeIsFinite(value); } /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { if (!isObject(value)) { return false; } // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 9 which returns 'object' for typed arrays and other constructors. var tag = baseGetTag(value); return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; } /** * Checks if `value` is an integer. * * **Note:** This method is based on * [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an integer, else `false`. * @example * * _.isInteger(3); * // => true * * _.isInteger(Number.MIN_VALUE); * // => false * * _.isInteger(Infinity); * // => false * * _.isInteger('3'); * // => false */ function isInteger(value) { return typeof value == 'number' && value == toInteger(value); } /** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); * // => true * * _.isLength(Number.MIN_VALUE); * // => false * * _.isLength(Infinity); * // => false * * _.isLength('3'); * // => false */ function isLength(value) { return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return value != null && typeof value == 'object'; } /** * Checks if `value` is classified as a `Map` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); * // => true * * _.isMap(new WeakMap); * // => false */ var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; /** * Performs a partial deep comparison between `object` and `source` to * determine if `object` contains equivalent property values. * * **Note:** This method is equivalent to `_.matches` when `source` is * partially applied. * * Partial comparisons will match empty array and empty object `source` * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * var object = { 'a': 1, 'b': 2 }; * * _.isMatch(object, { 'b': 2 }); * // => true * * _.isMatch(object, { 'b': 1 }); * // => false */ function isMatch(object, source) { return object === source || baseIsMatch(object, source, getMatchData(source)); } /** * This method is like `_.isMatch` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five * arguments: (objValue, srcValue, index|key, object, source). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {Object} object The object to inspect. * @param {Object} source The object of property values to match. * @param {Function} [customizer] The function to customize comparisons. * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * * function isGreeting(value) { * return /^h(?:i|ello)$/.test(value); * } * * function customizer(objValue, srcValue) { * if (isGreeting(objValue) && isGreeting(srcValue)) { * return true; * } * } * * var object = { 'greeting': 'hello' }; * var source = { 'greeting': 'hi' }; * * _.isMatchWith(object, source, customizer); * // => true */ function isMatchWith(object, source, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return baseIsMatch(object, source, getMatchData(source), customizer); } /** * Checks if `value` is `NaN`. * * **Note:** This method is based on * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for * `undefined` and other non-number values. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. * @example * * _.isNaN(NaN); * // => true * * _.isNaN(new Number(NaN)); * // => true * * isNaN(undefined); * // => true * * _.isNaN(undefined); * // => false */ function isNaN(value) { // An `NaN` primitive is the only value that is not equal to itself. // Perform the `toStringTag` check first to avoid errors with some // ActiveX objects in IE. return isNumber(value) && value != +value; } /** * Checks if `value` is a pristine native function. * * **Note:** This method can't reliably detect native functions in the presence * of the core-js package because core-js circumvents this kind of detection. * Despite multiple requests, the core-js maintainer has made it clear: any * attempt to fix the detection will be obstructed. As a result, we're left * with little choice but to throw an error. Unfortunately, this also affects * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), * which rely on core-js. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. * @example * * _.isNative(Array.prototype.push); * // => true * * _.isNative(_); * // => false */ function isNative(value) { if (isMaskable(value)) { throw new Error(CORE_ERROR_TEXT); } return baseIsNative(value); } /** * Checks if `value` is `null`. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `null`, else `false`. * @example * * _.isNull(null); * // => true * * _.isNull(void 0); * // => false */ function isNull(value) { return value === null; } /** * Checks if `value` is `null` or `undefined`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is nullish, else `false`. * @example * * _.isNil(null); * // => true * * _.isNil(void 0); * // => true * * _.isNil(NaN); * // => false */ function isNil(value) { return value == null; } /** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are * classified as numbers, use the `_.isFinite` method. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); * // => true * * _.isNumber(Number.MIN_VALUE); * // => true * * _.isNumber(Infinity); * // => true * * _.isNumber('3'); * // => false */ function isNumber(value) { return typeof value == 'number' || (isObjectLike(value) && baseGetTag(value) == numberTag); } /** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @since 0.8.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { * this.a = 1; * } * * _.isPlainObject(new Foo); * // => false * * _.isPlainObject([1, 2, 3]); * // => false * * _.isPlainObject({ 'x': 0, 'y': 0 }); * // => true * * _.isPlainObject(Object.create(null)); * // => true */ function isPlainObject(value) { if (!isObjectLike(value) || baseGetTag(value) != objectTag) { return false; } var proto = getPrototype(value); if (proto === null) { return true; } var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; } /** * Checks if `value` is classified as a `RegExp` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * * _.isRegExp(/abc/); * // => true * * _.isRegExp('/abc/'); * // => false */ var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; /** * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 * double precision number which isn't the result of a rounded unsafe integer. * * **Note:** This method is based on * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. * @example * * _.isSafeInteger(3); * // => true * * _.isSafeInteger(Number.MIN_VALUE); * // => false * * _.isSafeInteger(Infinity); * // => false * * _.isSafeInteger('3'); * // => false */ function isSafeInteger(value) { return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; } /** * Checks if `value` is classified as a `Set` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); * // => true * * _.isSet(new WeakSet); * // => false */ var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; /** * Checks if `value` is classified as a `String` primitive or object. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); * // => true * * _.isString(1); * // => false */ function isString(value) { return typeof value == 'string' || (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && baseGetTag(value) == symbolTag); } /** * Checks if `value` is classified as a typed array. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); * // => true * * _.isTypedArray([]); * // => false */ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** * Checks if `value` is `undefined`. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. * @example * * _.isUndefined(void 0); * // => true * * _.isUndefined(null); * // => false */ function isUndefined(value) { return value === undefined; } /** * Checks if `value` is classified as a `WeakMap` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. * @example * * _.isWeakMap(new WeakMap); * // => true * * _.isWeakMap(new Map); * // => false */ function isWeakMap(value) { return isObjectLike(value) && getTag(value) == weakMapTag; } /** * Checks if `value` is classified as a `WeakSet` object. * * @static * @memberOf _ * @since 4.3.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. * @example * * _.isWeakSet(new WeakSet); * // => true * * _.isWeakSet(new Set); * // => false */ function isWeakSet(value) { return isObjectLike(value) && baseGetTag(value) == weakSetTag; } /** * Checks if `value` is less than `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. * @see _.gt * @example * * _.lt(1, 3); * // => true * * _.lt(3, 3); * // => false * * _.lt(3, 1); * // => false */ var lt = createRelationalOperation(baseLt); /** * Checks if `value` is less than or equal to `other`. * * @static * @memberOf _ * @since 3.9.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than or equal to * `other`, else `false`. * @see _.gte * @example * * _.lte(1, 3); * // => true * * _.lte(3, 3); * // => true * * _.lte(3, 1); * // => false */ var lte = createRelationalOperation(function(value, other) { return value <= other; }); /** * Converts `value` to an array. * * @static * @since 0.1.0 * @memberOf _ * @category Lang * @param {*} value The value to convert. * @returns {Array} Returns the converted array. * @example * * _.toArray({ 'a': 1, 'b': 2 }); * // => [1, 2] * * _.toArray('abc'); * // => ['a', 'b', 'c'] * * _.toArray(1); * // => [] * * _.toArray(null); * // => [] */ function toArray(value) { if (!value) { return []; } if (isArrayLike(value)) { return isString(value) ? stringToArray(value) : copyArray(value); } if (symIterator && value[symIterator]) { return iteratorToArray(value[symIterator]()); } var tag = getTag(value), func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); return func(value); } /** * Converts `value` to a finite number. * * @static * @memberOf _ * @since 4.12.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted number. * @example * * _.toFinite(3.2); * // => 3.2 * * _.toFinite(Number.MIN_VALUE); * // => 5e-324 * * _.toFinite(Infinity); * // => 1.7976931348623157e+308 * * _.toFinite('3.2'); * // => 3.2 */ function toFinite(value) { if (!value) { return value === 0 ? value : 0; } value = toNumber(value); if (value === INFINITY || value === -INFINITY) { var sign = (value < 0 ? -1 : 1); return sign * MAX_INTEGER; } return value === value ? value : 0; } /** * Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toInteger(3.2); * // => 3 * * _.toInteger(Number.MIN_VALUE); * // => 0 * * _.toInteger(Infinity); * // => 1.7976931348623157e+308 * * _.toInteger('3.2'); * // => 3 */ function toInteger(value) { var result = toFinite(value), remainder = result % 1; return result === result ? (remainder ? result - remainder : result) : 0; } /** * Converts `value` to an integer suitable for use as the length of an * array-like object. * * **Note:** This method is based on * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toLength(3.2); * // => 3 * * _.toLength(Number.MIN_VALUE); * // => 0 * * _.toLength(Infinity); * // => 4294967295 * * _.toLength('3.2'); * // => 3 */ function toLength(value) { return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; } /** * Converts `value` to a number. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {number} Returns the number. * @example * * _.toNumber(3.2); * // => 3.2 * * _.toNumber(Number.MIN_VALUE); * // => 5e-324 * * _.toNumber(Infinity); * // => Infinity * * _.toNumber('3.2'); * // => 3.2 */ function toNumber(value) { if (typeof value == 'number') { return value; } if (isSymbol(value)) { return NAN; } if (isObject(value)) { var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { return value === 0 ? value : +value; } value = baseTrim(value); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : (reIsBadHex.test(value) ? NAN : +value); } /** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * * @static * @memberOf _ * @since 3.0.0 * @category Lang * @param {*} value The value to convert. * @returns {Object} Returns the converted plain object. * @example * * function Foo() { * this.b = 2; * } * * Foo.prototype.c = 3; * * _.assign({ 'a': 1 }, new Foo); * // => { 'a': 1, 'b': 2 } * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } */ function toPlainObject(value) { return copyObject(value, keysIn(value)); } /** * Converts `value` to a safe integer. A safe integer can be compared and * represented correctly. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {number} Returns the converted integer. * @example * * _.toSafeInteger(3.2); * // => 3 * * _.toSafeInteger(Number.MIN_VALUE); * // => 0 * * _.toSafeInteger(Infinity); * // => 9007199254740991 * * _.toSafeInteger('3.2'); * // => 3 */ function toSafeInteger(value) { return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : (value === 0 ? value : 0); } /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to convert. * @returns {string} Returns the converted string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /*------------------------------------------------------------------------*/ /** * Assigns own enumerable string keyed properties of source objects to the * destination object. Source objects are applied from left to right. * Subsequent sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object` and is loosely based on * [`Object.assign`](https://mdn.io/Object/assign). * * @static * @memberOf _ * @since 0.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assignIn * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { if (hasOwnProperty.call(source, key)) { assignValue(object, key, source[key]); } } }); /** * This method is like `_.assign` except that it iterates over own and * inherited source properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extend * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.assign * @example * * function Foo() { * this.a = 1; * } * * function Bar() { * this.c = 3; * } * * Foo.prototype.b = 2; * Bar.prototype.d = 4; * * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { copyObject(source, keysIn(source), object); }); /** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @alias extendWith * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignInWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); /** * This method is like `_.assign` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` * is invoked with five arguments: (objValue, srcValue, key, object, source). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @see _.assignInWith * @example * * function customizer(objValue, srcValue) { * return _.isUndefined(objValue) ? srcValue : objValue; * } * * var defaults = _.partialRight(_.assignWith, customizer); * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var assignWith = createAssigner(function(object, source, srcIndex, customizer) { copyObject(source, keys(source), object, customizer); }); /** * Creates an array of values corresponding to `paths` of `object`. * * @static * @memberOf _ * @since 1.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Array} Returns the picked values. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; * * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] */ var at = flatRest(baseAt); /** * Creates an object that inherits from the `prototype` object. If a * `properties` object is given, its own enumerable string keyed properties * are assigned to the created object. * * @static * @memberOf _ * @since 2.3.0 * @category Object * @param {Object} prototype The object to inherit from. * @param {Object} [properties] The properties to assign to the object. * @returns {Object} Returns the new object. * @example * * function Shape() { * this.x = 0; * this.y = 0; * } * * function Circle() { * Shape.call(this); * } * * Circle.prototype = _.create(Shape.prototype, { * 'constructor': Circle * }); * * var circle = new Circle; * circle instanceof Circle; * // => true * * circle instanceof Shape; * // => true */ function create(prototype, properties) { var result = baseCreate(prototype); return properties == null ? result : baseAssign(result, properties); } /** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. * Once a property is set, additional values of the same property are ignored. * * **Note:** This method mutates `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaultsDeep * @example * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ var defaults = baseRest(function(object, sources) { object = Object(object); var index = -1; var length = sources.length; var guard = length > 2 ? sources[2] : undefined; if (guard && isIterateeCall(sources[0], sources[1], guard)) { length = 1; } while (++index < length) { var source = sources[index]; var props = keysIn(source); var propsIndex = -1; var propsLength = props.length; while (++propsIndex < propsLength) { var key = props[propsIndex]; var value = object[key]; if (value === undefined || (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { object[key] = source[key]; } } } return object; }); /** * This method is like `_.defaults` except that it recursively assigns * default properties. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.10.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @see _.defaults * @example * * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); * // => { 'a': { 'b': 2, 'c': 3 } } */ var defaultsDeep = baseRest(function(args) { args.push(undefined, customDefaultsMerge); return apply(mergeWith, undefined, args); }); /** * This method is like `_.find` except that it returns the key of the first * element `predicate` returns truthy for instead of the element itself. * * @static * @memberOf _ * @since 1.1.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findKey(users, function(o) { return o.age < 40; }); * // => 'barney' (iteration order is not guaranteed) * * // The `_.matches` iteratee shorthand. * _.findKey(users, { 'age': 1, 'active': true }); * // => 'pebbles' * * // The `_.matchesProperty` iteratee shorthand. * _.findKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findKey(users, 'active'); * // => 'barney' */ function findKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); } /** * This method is like `_.findKey` except that it iterates over elements of * a collection in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to inspect. * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example * * var users = { * 'barney': { 'age': 36, 'active': true }, * 'fred': { 'age': 40, 'active': false }, * 'pebbles': { 'age': 1, 'active': true } * }; * * _.findLastKey(users, function(o) { return o.age < 40; }); * // => returns 'pebbles' assuming `_.findKey` returns 'barney' * * // The `_.matches` iteratee shorthand. * _.findLastKey(users, { 'age': 36, 'active': true }); * // => 'barney' * * // The `_.matchesProperty` iteratee shorthand. * _.findLastKey(users, ['active', false]); * // => 'fred' * * // The `_.property` iteratee shorthand. * _.findLastKey(users, 'active'); * // => 'pebbles' */ function findLastKey(object, predicate) { return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); } /** * Iterates over own and inherited enumerable string keyed properties of an * object and invokes `iteratee` for each property. The iteratee is invoked * with three arguments: (value, key, object). Iteratee functions may exit * iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forInRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forIn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). */ function forIn(object, iteratee) { return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn); } /** * This method is like `_.forIn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forIn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forInRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. */ function forInRight(object, iteratee) { return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn); } /** * Iterates over own enumerable string keyed properties of an object and * invokes `iteratee` for each property. The iteratee is invoked with three * arguments: (value, key, object). Iteratee functions may exit iteration * early by explicitly returning `false`. * * @static * @memberOf _ * @since 0.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwnRight * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwn(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). */ function forOwn(object, iteratee) { return object && baseForOwn(object, getIteratee(iteratee, 3)); } /** * This method is like `_.forOwn` except that it iterates over properties of * `object` in the opposite order. * * @static * @memberOf _ * @since 2.0.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns `object`. * @see _.forOwn * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.forOwnRight(new Foo, function(value, key) { * console.log(key); * }); * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. */ function forOwnRight(object, iteratee) { return object && baseForOwnRight(object, getIteratee(iteratee, 3)); } /** * Creates an array of function property names from own enumerable properties * of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functionsIn * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functions(new Foo); * // => ['a', 'b'] */ function functions(object) { return object == null ? [] : baseFunctions(object, keys(object)); } /** * Creates an array of function property names from own and inherited * enumerable properties of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to inspect. * @returns {Array} Returns the function names. * @see _.functions * @example * * function Foo() { * this.a = _.constant('a'); * this.b = _.constant('b'); * } * * Foo.prototype.c = _.constant('c'); * * _.functionsIn(new Foo); * // => ['a', 'b', 'c'] */ function functionsIn(object) { return object == null ? [] : baseFunctions(object, keysIn(object)); } /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } /** * Checks if `path` is a direct property of `object`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = { 'a': { 'b': 2 } }; * var other = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.has(object, 'a'); * // => true * * _.has(object, 'a.b'); * // => true * * _.has(object, ['a', 'b']); * // => true * * _.has(other, 'a'); * // => false */ function has(object, path) { return object != null && hasPath(object, path, baseHas); } /** * Checks if `path` is a direct or inherited property of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @returns {boolean} Returns `true` if `path` exists, else `false`. * @example * * var object = _.create({ 'a': _.create({ 'b': 2 }) }); * * _.hasIn(object, 'a'); * // => true * * _.hasIn(object, 'a.b'); * // => true * * _.hasIn(object, ['a', 'b']); * // => true * * _.hasIn(object, 'b'); * // => false */ function hasIn(object, path) { return object != null && hasPath(object, path, baseHasIn); } /** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite * property assignments of previous values. * * @static * @memberOf _ * @since 0.7.0 * @category Object * @param {Object} object The object to invert. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invert(object); * // => { '1': 'c', '2': 'b' } */ var invert = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } result[value] = key; }, constant(identity)); /** * This method is like `_.invert` except that the inverted object is generated * from the results of running each element of `object` thru `iteratee`. The * corresponding inverted value of each inverted key is an array of keys * responsible for generating the inverted value. The iteratee is invoked * with one argument: (value). * * @static * @memberOf _ * @since 4.1.0 * @category Object * @param {Object} object The object to invert. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Object} Returns the new inverted object. * @example * * var object = { 'a': 1, 'b': 2, 'c': 1 }; * * _.invertBy(object); * // => { '1': ['a', 'c'], '2': ['b'] } * * _.invertBy(object, function(value) { * return 'group' + value; * }); * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ var invertBy = createInverter(function(result, value, key) { if (value != null && typeof value.toString != 'function') { value = nativeObjectToString.call(value); } if (hasOwnProperty.call(result, value)) { result[value].push(key); } else { result[value] = [key]; } }, getIteratee); /** * Invokes the method at `path` of `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. * @returns {*} Returns the result of the invoked method. * @example * * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; * * _.invoke(object, 'a[0].b.c.slice', 1, 3); * // => [2, 3] */ var invoke = baseRest(baseInvoke); /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keys(new Foo); * // => ['a', 'b'] (iteration order is not guaranteed) * * _.keys('hi'); * // => ['0', '1'] */ function keys(object) { return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } /** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** * The opposite of `_.mapValues`; this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked * with three arguments: (value, key, object). * * @static * @memberOf _ * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapValues * @example * * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { * return key + value; * }); * // => { 'a1': 1, 'b2': 2 } */ function mapKeys(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, iteratee(value, key, object), value); }); return result; } /** * Creates an object with the same keys as `object` and values generated * by running each own enumerable string keyed property of `object` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, key, object). * * @static * @memberOf _ * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example * * var users = { * 'fred': { 'user': 'fred', 'age': 40 }, * 'pebbles': { 'user': 'pebbles', 'age': 1 } * }; * * _.mapValues(users, function(o) { return o.age; }); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) * * // The `_.property` iteratee shorthand. * _.mapValues(users, 'age'); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) */ function mapValues(object, iteratee) { var result = {}; iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { baseAssignValue(result, key, iteratee(value, key, object)); }); return result; } /** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are * skipped if a destination value exists. Array and plain object properties * are merged recursively. Other objects and value types are overridden by * assignment. Source objects are applied from left to right. Subsequent * sources overwrite property assignments of previous sources. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 0.5.0 * @category Object * @param {Object} object The destination object. * @param {...Object} [sources] The source objects. * @returns {Object} Returns `object`. * @example * * var object = { * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * * var other = { * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); }); /** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source * properties. If `customizer` returns `undefined`, merging is handled by the * method instead. The `customizer` is invoked with six arguments: * (objValue, srcValue, key, object, source, stack). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The destination object. * @param {...Object} sources The source objects. * @param {Function} customizer The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * function customizer(objValue, srcValue) { * if (_.isArray(objValue)) { * return objValue.concat(srcValue); * } * } * * var object = { 'a': [1], 'b': [2] }; * var other = { 'a': [3], 'b': [4] }; * * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); /** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable property paths of `object` that are not omitted. * * **Note:** This method is considerably slower than `_.pick`. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to omit. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ var omit = flatRest(function(object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; paths = arrayMap(paths, function(path) { path = castPath(path, object); isDeep || (isDeep = path.length > 1); return path; }); copyObject(object, getAllKeysIn(object), result); if (isDeep) { result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); } var length = paths.length; while (length--) { baseUnset(result, paths[length]); } return result; }); /** * The opposite of `_.pickBy`; this method creates an object composed of * the own and inherited enumerable string keyed properties of `object` that * `predicate` doesn't return truthy for. The predicate is invoked with two * arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.omitBy(object, _.isNumber); * // => { 'b': '2' } */ function omitBy(object, predicate) { return pickBy(object, negate(getIteratee(predicate))); } /** * Creates an object composed of the picked `object` properties. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The source object. * @param {...(string|string[])} [paths] The property paths to pick. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ var pick = flatRest(function(object, paths) { return object == null ? {} : basePick(object, paths); }); /** * Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The source object. * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * * var object = { 'a': 1, 'b': '2', 'c': 3 }; * * _.pickBy(object, _.isNumber); * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { if (object == null) { return {}; } var props = arrayMap(getAllKeysIn(object), function(prop) { return [prop]; }); predicate = getIteratee(predicate); return basePickBy(object, props, function(value, path) { return predicate(value, path[0]); }); } /** * This method is like `_.get` except that if the resolved value is a * function it's invoked with the `this` binding of its parent object and * its result is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to resolve. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; * * _.result(object, 'a[0].b.c1'); * // => 3 * * _.result(object, 'a[0].b.c2'); * // => 4 * * _.result(object, 'a[0].b.c3', 'default'); * // => 'default' * * _.result(object, 'a[0].b.c3', _.constant('default')); * // => 'default' */ function result(object, path, defaultValue) { path = castPath(path, object); var index = -1, length = path.length; // Ensure the loop is entered when path is empty. if (!length) { length = 1; object = undefined; } while (++index < length) { var value = object == null ? undefined : object[toKey(path[index])]; if (value === undefined) { index = length; value = defaultValue; } object = isFunction(value) ? value.call(object) : value; } return object; } /** * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, * it's created. Arrays are created for missing index properties while objects * are created for all other missing properties. Use `_.setWith` to customize * `path` creation. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.set(object, 'a[0].b.c', 4); * console.log(object.a[0].b.c); * // => 4 * * _.set(object, ['x', '0', 'y', 'z'], 5); * console.log(object.x[0].y.z); * // => 5 */ function set(object, path, value) { return object == null ? object : baseSet(object, path, value); } /** * This method is like `_.set` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.setWith(object, '[0][1]', 'a', Object); * // => { '0': { '1': 'a' } } */ function setWith(object, path, value, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseSet(object, path, value, customizer); } /** * Creates an array of own enumerable string keyed-value pairs for `object` * which can be consumed by `_.fromPairs`. If `object` is a map or set, its * entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entries * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairs(new Foo); * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) */ var toPairs = createToPairs(keys); /** * Creates an array of own and inherited enumerable string keyed-value pairs * for `object` which can be consumed by `_.fromPairs`. If `object` is a map * or set, its entries are returned. * * @static * @memberOf _ * @since 4.0.0 * @alias entriesIn * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the key-value pairs. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.toPairsIn(new Foo); * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) */ var toPairsIn = createToPairs(keysIn); /** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own * enumerable string keyed properties thru `iteratee`, with each invocation * potentially mutating the `accumulator` object. If `accumulator` is not * provided, a new object with the same `[[Prototype]]` will be used. The * iteratee is invoked with four arguments: (accumulator, value, key, object). * Iteratee functions may exit iteration early by explicitly returning `false`. * * @static * @memberOf _ * @since 1.3.0 * @category Object * @param {Object} object The object to iterate over. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @param {*} [accumulator] The custom accumulator value. * @returns {*} Returns the accumulated value. * @example * * _.transform([2, 3, 4], function(result, n) { * result.push(n *= n); * return n % 2 == 0; * }, []); * // => [4, 9] * * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { * (result[value] || (result[value] = [])).push(key); * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee = getIteratee(iteratee, 4); if (accumulator == null) { var Ctor = object && object.constructor; if (isArrLike) { accumulator = isArr ? new Ctor : []; } else if (isObject(object)) { accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; } else { accumulator = {}; } } (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; } /** * Removes the property at `path` of `object`. * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.0.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to unset. * @returns {boolean} Returns `true` if the property is deleted, else `false`. * @example * * var object = { 'a': [{ 'b': { 'c': 7 } }] }; * _.unset(object, 'a[0].b.c'); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; * * _.unset(object, ['a', '0', 'b', 'c']); * // => true * * console.log(object); * // => { 'a': [{ 'b': {} }] }; */ function unset(object, path) { return object == null ? true : baseUnset(object, path); } /** * This method is like `_.set` except that accepts `updater` to produce the * value to set. Use `_.updateWith` to customize `path` creation. The `updater` * is invoked with one argument: (value). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @returns {Object} Returns `object`. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.update(object, 'a[0].b.c', function(n) { return n * n; }); * console.log(object.a[0].b.c); * // => 9 * * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); * console.log(object.x[0].y.z); * // => 0 */ function update(object, path, updater) { return object == null ? object : baseUpdate(object, path, castFunction(updater)); } /** * This method is like `_.update` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked * with three arguments: (nsValue, key, nsObject). * * **Note:** This method mutates `object`. * * @static * @memberOf _ * @since 4.6.0 * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize assigned values. * @returns {Object} Returns `object`. * @example * * var object = {}; * * _.updateWith(object, '[0][1]', _.constant('a'), Object); * // => { '0': { '1': 'a' } } */ function updateWith(object, path, updater, customizer) { customizer = typeof customizer == 'function' ? customizer : undefined; return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); } /** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @since 0.1.0 * @memberOf _ * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.values(new Foo); * // => [1, 2] (iteration order is not guaranteed) * * _.values('hi'); * // => ['h', 'i'] */ function values(object) { return object == null ? [] : baseValues(object, keys(object)); } /** * Creates an array of the own and inherited enumerable string keyed property * values of `object`. * * **Note:** Non-object values are coerced to objects. * * @static * @memberOf _ * @since 3.0.0 * @category Object * @param {Object} object The object to query. * @returns {Array} Returns the array of property values. * @example * * function Foo() { * this.a = 1; * this.b = 2; * } * * Foo.prototype.c = 3; * * _.valuesIn(new Foo); * // => [1, 2, 3] (iteration order is not guaranteed) */ function valuesIn(object) { return object == null ? [] : baseValues(object, keysIn(object)); } /*------------------------------------------------------------------------*/ /** * Clamps `number` within the inclusive `lower` and `upper` bounds. * * @static * @memberOf _ * @since 4.0.0 * @category Number * @param {number} number The number to clamp. * @param {number} [lower] The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the clamped number. * @example * * _.clamp(-10, -5, 5); * // => -5 * * _.clamp(10, -5, 5); * // => 5 */ function clamp(number, lower, upper) { if (upper === undefined) { upper = lower; lower = undefined; } if (upper !== undefined) { upper = toNumber(upper); upper = upper === upper ? upper : 0; } if (lower !== undefined) { lower = toNumber(lower); lower = lower === lower ? lower : 0; } return baseClamp(toNumber(number), lower, upper); } /** * Checks if `n` is between `start` and up to, but not including, `end`. If * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support * negative ranges. * * @static * @memberOf _ * @since 3.3.0 * @category Number * @param {number} number The number to check. * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. * @see _.range, _.rangeRight * @example * * _.inRange(3, 2, 4); * // => true * * _.inRange(4, 8); * // => true * * _.inRange(4, 2); * // => false * * _.inRange(2, 2); * // => false * * _.inRange(1.2, 2); * // => true * * _.inRange(5.2, 4); * // => false * * _.inRange(-3, -2, -6); * // => true */ function inRange(number, start, end) { start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { end = toFinite(end); } number = toNumber(number); return baseInRange(number, start, end); } /** * Produces a random number between the inclusive `lower` and `upper` bounds. * If only one argument is provided a number between `0` and the given number * is returned. If `floating` is `true`, or either `lower` or `upper` are * floats, a floating-point number is returned instead of an integer. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @memberOf _ * @since 0.7.0 * @category Number * @param {number} [lower=0] The lower bound. * @param {number} [upper=1] The upper bound. * @param {boolean} [floating] Specify returning a floating-point number. * @returns {number} Returns the random number. * @example * * _.random(0, 5); * // => an integer between 0 and 5 * * _.random(5); * // => also an integer between 0 and 5 * * _.random(5, true); * // => a floating-point number between 0 and 5 * * _.random(1.2, 5.2); * // => a floating-point number between 1.2 and 5.2 */ function random(lower, upper, floating) { if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { upper = floating = undefined; } if (floating === undefined) { if (typeof upper == 'boolean') { floating = upper; upper = undefined; } else if (typeof lower == 'boolean') { floating = lower; lower = undefined; } } if (lower === undefined && upper === undefined) { lower = 0; upper = 1; } else { lower = toFinite(lower); if (upper === undefined) { upper = lower; lower = 0; } else { upper = toFinite(upper); } } if (lower > upper) { var temp = lower; lower = upper; upper = temp; } if (floating || lower % 1 || upper % 1) { var rand = nativeRandom(); return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); } return baseRandom(lower, upper); } /*------------------------------------------------------------------------*/ /** * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the camel cased string. * @example * * _.camelCase('Foo Bar'); * // => 'fooBar' * * _.camelCase('--foo-bar--'); * // => 'fooBar' * * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ var camelCase = createCompounder(function(result, word, index) { word = word.toLowerCase(); return result + (index ? capitalize(word) : word); }); /** * Converts the first character of `string` to upper case and the remaining * to lower case. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to capitalize. * @returns {string} Returns the capitalized string. * @example * * _.capitalize('FRED'); * // => 'Fred' */ function capitalize(string) { return upperFirst(toString(string).toLowerCase()); } /** * Deburrs `string` by converting * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) * letters to basic Latin letters and removing * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to deburr. * @returns {string} Returns the deburred string. * @example * * _.deburr('déjà vu'); * // => 'deja vu' */ function deburr(string) { string = toString(string); return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); } /** * Checks if `string` ends with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search up to. * @returns {boolean} Returns `true` if `string` ends with `target`, * else `false`. * @example * * _.endsWith('abc', 'c'); * // => true * * _.endsWith('abc', 'b'); * // => false * * _.endsWith('abc', 'b', 2); * // => true */ function endsWith(string, target, position) { string = toString(string); target = baseToString(target); var length = string.length; position = position === undefined ? length : baseClamp(toInteger(position), 0, length); var end = position; position -= target.length; return position >= 0 && string.slice(position, end) == target; } /** * Converts the characters "&", "<", ">", '"', and "'" in `string` to their * corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional * characters use a third-party library like [_he_](https://mths.be/he). * * Though the ">" character is escaped for symmetry, characters like * ">" and "/" don't need escaping in HTML and have no special meaning * unless they're part of a tag or unquoted attribute value. See * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * * When working with HTML you should always * [quote attribute values](http://wonko.com/post/html-escaping) to reduce * XSS vectors. * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' */ function escape(string) { string = toString(string); return (string && reHasUnescapedHtml.test(string)) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } /** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to escape. * @returns {string} Returns the escaped string. * @example * * _.escapeRegExp('[lodash](https://lodash.com/)'); * // => '\[lodash\]\(https://lodash\.com/\)' */ function escapeRegExp(string) { string = toString(string); return (string && reHasRegExpChar.test(string)) ? string.replace(reRegExpChar, '\\$&') : string; } /** * Converts `string` to * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the kebab cased string. * @example * * _.kebabCase('Foo Bar'); * // => 'foo-bar' * * _.kebabCase('fooBar'); * // => 'foo-bar' * * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ var kebabCase = createCompounder(function(result, word, index) { return result + (index ? '-' : '') + word.toLowerCase(); }); /** * Converts `string`, as space separated words, to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * * _.lowerCase('--Foo-Bar--'); * // => 'foo bar' * * _.lowerCase('fooBar'); * // => 'foo bar' * * _.lowerCase('__FOO_BAR__'); * // => 'foo bar' */ var lowerCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + word.toLowerCase(); }); /** * Converts the first character of `string` to lower case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.lowerFirst('Fred'); * // => 'fred' * * _.lowerFirst('FRED'); * // => 'fRED' */ var lowerFirst = createCaseFirst('toLowerCase'); /** * Pads `string` on the left and right sides if it's shorter than `length`. * Padding characters are truncated if they can't be evenly divided by `length`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.pad('abc', 8); * // => ' abc ' * * _.pad('abc', 8, '_-'); * // => '_-abc_-_' * * _.pad('abc', 3); * // => 'abc' */ function pad(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; if (!length || strLength >= length) { return string; } var mid = (length - strLength) / 2; return ( createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars) ); } /** * Pads `string` on the right side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padEnd('abc', 6); * // => 'abc ' * * _.padEnd('abc', 6, '_-'); * // => 'abc_-_' * * _.padEnd('abc', 3); * // => 'abc' */ function padEnd(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (string + createPadding(length - strLength, chars)) : string; } /** * Pads `string` on the left side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to pad. * @param {number} [length=0] The padding length. * @param {string} [chars=' '] The string used as padding. * @returns {string} Returns the padded string. * @example * * _.padStart('abc', 6); * // => ' abc' * * _.padStart('abc', 6, '_-'); * // => '_-_abc' * * _.padStart('abc', 3); * // => 'abc' */ function padStart(string, length, chars) { string = toString(string); length = toInteger(length); var strLength = length ? stringSize(string) : 0; return (length && strLength < length) ? (createPadding(length - strLength, chars) + string) : string; } /** * Converts `string` to an integer of the specified radix. If `radix` is * `undefined` or `0`, a `radix` of `10` is used unless `value` is a * hexadecimal, in which case a `radix` of `16` is used. * * **Note:** This method aligns with the * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. * * @static * @memberOf _ * @since 1.1.0 * @category String * @param {string} string The string to convert. * @param {number} [radix=10] The radix to interpret `value` by. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {number} Returns the converted integer. * @example * * _.parseInt('08'); * // => 8 * * _.map(['6', '08', '10'], _.parseInt); * // => [6, 8, 10] */ function parseInt(string, radix, guard) { if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); } /** * Repeats the given string `n` times. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to repeat. * @param {number} [n=1] The number of times to repeat the string. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the repeated string. * @example * * _.repeat('*', 3); * // => '***' * * _.repeat('abc', 2); * // => 'abcabc' * * _.repeat('abc', 0); * // => '' */ function repeat(string, n, guard) { if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { n = 1; } else { n = toInteger(n); } return baseRepeat(toString(string), n); } /** * Replaces matches for `pattern` in `string` with `replacement`. * * **Note:** This method is based on * [`String#replace`](https://mdn.io/String/replace). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to modify. * @param {RegExp|string} pattern The pattern to replace. * @param {Function|string} replacement The match replacement. * @returns {string} Returns the modified string. * @example * * _.replace('Hi Fred', 'Fred', 'Barney'); * // => 'Hi Barney' */ function replace() { var args = arguments, string = toString(args[0]); return args.length < 3 ? string : string.replace(args[1], args[2]); } /** * Converts `string` to * [snake case](https://en.wikipedia.org/wiki/Snake_case). * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the snake cased string. * @example * * _.snakeCase('Foo Bar'); * // => 'foo_bar' * * _.snakeCase('fooBar'); * // => 'foo_bar' * * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ var snakeCase = createCompounder(function(result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); /** * Splits `string` by `separator`. * * **Note:** This method is based on * [`String#split`](https://mdn.io/String/split). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to split. * @param {RegExp|string} separator The separator pattern to split by. * @param {number} [limit] The length to truncate results to. * @returns {Array} Returns the string segments. * @example * * _.split('a-b-c', '-', 2); * // => ['a', 'b'] */ function split(string, separator, limit) { if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { separator = limit = undefined; } limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; if (!limit) { return []; } string = toString(string); if (string && ( typeof separator == 'string' || (separator != null && !isRegExp(separator)) )) { separator = baseToString(separator); if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); } } return string.split(separator, limit); } /** * Converts `string` to * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * * @static * @memberOf _ * @since 3.1.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the start cased string. * @example * * _.startCase('--foo-bar--'); * // => 'Foo Bar' * * _.startCase('fooBar'); * // => 'Foo Bar' * * _.startCase('__FOO_BAR__'); * // => 'FOO BAR' */ var startCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + upperFirst(word); }); /** * Checks if `string` starts with the given target string. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, * else `false`. * @example * * _.startsWith('abc', 'a'); * // => true * * _.startsWith('abc', 'b'); * // => false * * _.startsWith('abc', 'b', 1); * // => true */ function startsWith(string, target, position) { string = toString(string); position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); target = baseToString(target); return string.slice(position, position + target.length) == target; } /** * Creates a compiled template function that can interpolate data properties * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data * properties may be accessed as free variables in the template. If a setting * object is given, it takes precedence over `_.templateSettings` values. * * **Note:** In the development build `_.template` utilizes * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) * for easier debugging. * * For more information on precompiling templates see * [lodash's custom builds documentation](https://lodash.com/custom-builds). * * For more information on Chrome extension sandboxes see * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). * * @static * @since 0.1.0 * @memberOf _ * @category String * @param {string} [string=''] The template string. * @param {Object} [options={}] The options object. * @param {RegExp} [options.escape=_.templateSettings.escape] * The HTML "escape" delimiter. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] * The "evaluate" delimiter. * @param {Object} [options.imports=_.templateSettings.imports] * An object to import into the template as free variables. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] * The "interpolate" delimiter. * @param {string} [options.sourceURL='lodash.templateSources[n]'] * The sourceURL of the compiled template. * @param {string} [options.variable='obj'] * The data object variable name. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Function} Returns the compiled template function. * @example * * // Use the "interpolate" delimiter to create a compiled template. * var compiled = _.template('hello <%= user %>!'); * compiled({ 'user': 'fred' }); * // => 'hello fred!' * * // Use the HTML "escape" delimiter to escape data property values. * var compiled = _.template('<b><%- value %></b>'); * compiled({ 'value': '<script>' }); * // => '<b><script></b>' * * // Use the "evaluate" delimiter to execute JavaScript and generate HTML. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); * compiled({ 'users': ['fred', 'barney'] }); * // => '<li>fred</li><li>barney</li>' * * // Use the internal `print` function in "evaluate" delimiters. * var compiled = _.template('<% print("hello " + user); %>!'); * compiled({ 'user': 'barney' }); * // => 'hello barney!' * * // Use the ES template literal delimiter as an "interpolate" delimiter. * // Disable support by replacing the "interpolate" delimiter. * var compiled = _.template('hello ${ user }!'); * compiled({ 'user': 'pebbles' }); * // => 'hello pebbles!' * * // Use backslashes to treat delimiters as plain text. * var compiled = _.template('<%= "\\<%- value %\\>" %>'); * compiled({ 'value': 'ignored' }); * // => '<%- value %>' * * // Use the `imports` option to import `jQuery` as `jq`. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; * var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); * compiled({ 'users': ['fred', 'barney'] }); * // => '<li>fred</li><li>barney</li>' * * // Use the `sourceURL` option to specify a custom sourceURL for the template. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); * compiled(data); * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. * * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); * compiled.source; * // => function(data) { * // var __t, __p = ''; * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; * // return __p; * // } * * // Use custom template delimiters. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; * var compiled = _.template('hello {{ user }}!'); * compiled({ 'user': 'mustache' }); * // => 'hello mustache!' * * // Use the `source` property to inline compiled templates for meaningful * // line numbers in error messages and stack traces. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ * var JST = {\ * "main": ' + _.template(mainText).source + '\ * };\ * '); */ function template(string, options, guard) { // Based on John Resig's `tmpl` implementation // (http://ejohn.org/blog/javascript-micro-templating/) // and Laura Doktorova's doT.js (https://github.com/olado/doT). var settings = lodash.templateSettings; if (guard && isIterateeCall(string, options, guard)) { options = undefined; } string = toString(string); options = assignInWith({}, options, settings, customDefaultsAssignIn); var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys); var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '"; // Compile the regexp to match each delimiter. var reDelimiters = RegExp( (options.escape || reNoMatch).source + '|' + interpolate.source + '|' + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + (options.evaluate || reNoMatch).source + '|$' , 'g'); // Use a sourceURL for easier debugging. // The sourceURL gets injected into the source that's eval-ed, so be careful // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in // and escape the comment, thus injecting code that gets evaled. var sourceURL = '//# sourceURL=' + (hasOwnProperty.call(options, 'sourceURL') ? (options.sourceURL + '').replace(/\s/g, ' ') : ('lodash.templateSources[' + (++templateCounter) + ']') ) + '\n'; string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { interpolateValue || (interpolateValue = esTemplateValue); // Escape characters that can't be included in string literals. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); // Replace delimiters with snippets. if (escapeValue) { isEscaping = true; source += "' +\n__e(" + escapeValue + ") +\n'"; } if (evaluateValue) { isEvaluating = true; source += "';\n" + evaluateValue + ";\n__p += '"; } if (interpolateValue) { source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; } index = offset + match.length; // The JS engine embedded in Adobe products needs `match` returned in // order to produce the correct `offset` value. return match; }); source += "';\n"; // If `variable` is not specified wrap a with-statement around the generated // code to add the data object to the top of the scope chain. var variable = hasOwnProperty.call(options, 'variable') && options.variable; if (!variable) { source = 'with (obj) {\n' + source + '\n}\n'; } // Throw an error if a forbidden character was found in `variable`, to prevent // potential command injection attacks. else if (reForbiddenIdentifierChars.test(variable)) { throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); } // Cleanup code by stripping empty strings. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) .replace(reEmptyStringMiddle, '$1') .replace(reEmptyStringTrailing, '$1;'); // Frame code as the function body. source = 'function(' + (variable || 'obj') + ') {\n' + (variable ? '' : 'obj || (obj = {});\n' ) + "var __t, __p = ''" + (isEscaping ? ', __e = _.escape' : '' ) + (isEvaluating ? ', __j = Array.prototype.join;\n' + "function print() { __p += __j.call(arguments, '') }\n" : ';\n' ) + source + 'return __p\n}'; var result = attempt(function() { return Function(importsKeys, sourceURL + 'return ' + source) .apply(undefined, importsValues); }); // Provide the compiled function's source by its `toString` method or // the `source` property as a convenience for inlining compiled templates. result.source = source; if (isError(result)) { throw result; } return result; } /** * Converts `string`, as a whole, to lower case just like * [String#toLowerCase](https://mdn.io/toLowerCase). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the lower cased string. * @example * * _.toLower('--Foo-Bar--'); * // => '--foo-bar--' * * _.toLower('fooBar'); * // => 'foobar' * * _.toLower('__FOO_BAR__'); * // => '__foo_bar__' */ function toLower(value) { return toString(value).toLowerCase(); } /** * Converts `string`, as a whole, to upper case just like * [String#toUpperCase](https://mdn.io/toUpperCase). * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the upper cased string. * @example * * _.toUpper('--foo-bar--'); * // => '--FOO-BAR--' * * _.toUpper('fooBar'); * // => 'FOOBAR' * * _.toUpper('__foo_bar__'); * // => '__FOO_BAR__' */ function toUpper(value) { return toString(value).toUpperCase(); } /** * Removes leading and trailing whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trim(' abc '); * // => 'abc' * * _.trim('-_-abc-_-', '_-'); * // => 'abc' * * _.map([' foo ', ' bar '], _.trim); * // => ['foo', 'bar'] */ function trim(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { return baseTrim(string); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1; return castSlice(strSymbols, start, end).join(''); } /** * Removes trailing whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trimEnd(' abc '); * // => ' abc' * * _.trimEnd('-_-abc-_-', '_-'); * // => '-_-abc' */ function trimEnd(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { return string.slice(0, trimmedEndIndex(string) + 1); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; return castSlice(strSymbols, 0, end).join(''); } /** * Removes leading whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to trim. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {string} Returns the trimmed string. * @example * * _.trimStart(' abc '); * // => 'abc ' * * _.trimStart('-_-abc-_-', '_-'); * // => 'abc-_-' */ function trimStart(string, chars, guard) { string = toString(string); if (string && (guard || chars === undefined)) { return string.replace(reTrimStart, ''); } if (!string || !(chars = baseToString(chars))) { return string; } var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars)); return castSlice(strSymbols, start).join(''); } /** * Truncates `string` if it's longer than the given maximum string length. * The last characters of the truncated string are replaced with the omission * string which defaults to "...". * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to truncate. * @param {Object} [options={}] The options object. * @param {number} [options.length=30] The maximum string length. * @param {string} [options.omission='...'] The string to indicate text is omitted. * @param {RegExp|string} [options.separator] The separator pattern to truncate to. * @returns {string} Returns the truncated string. * @example * * _.truncate('hi-diddly-ho there, neighborino'); * // => 'hi-diddly-ho there, neighbo...' * * _.truncate('hi-diddly-ho there, neighborino', { * 'length': 24, * 'separator': ' ' * }); * // => 'hi-diddly-ho there,...' * * _.truncate('hi-diddly-ho there, neighborino', { * 'length': 24, * 'separator': /,? +/ * }); * // => 'hi-diddly-ho there...' * * _.truncate('hi-diddly-ho there, neighborino', { * 'omission': ' [...]' * }); * // => 'hi-diddly-ho there, neig [...]' */ function truncate(string, options) { var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; if (isObject(options)) { var separator = 'separator' in options ? options.separator : separator; length = 'length' in options ? toInteger(options.length) : length; omission = 'omission' in options ? baseToString(options.omission) : omission; } string = toString(string); var strLength = string.length; if (hasUnicode(string)) { var strSymbols = stringToArray(string); strLength = strSymbols.length; } if (length >= strLength) { return string; } var end = length - stringSize(omission); if (end < 1) { return omission; } var result = strSymbols ? castSlice(strSymbols, 0, end).join('') : string.slice(0, end); if (separator === undefined) { return result + omission; } if (strSymbols) { end += (result.length - end); } if (isRegExp(separator)) { if (string.slice(end).search(separator)) { var match, substring = result; if (!separator.global) { separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); } separator.lastIndex = 0; while ((match = separator.exec(substring))) { var newEnd = match.index; } result = result.slice(0, newEnd === undefined ? end : newEnd); } } else if (string.indexOf(baseToString(separator), end) != end) { var index = result.lastIndexOf(separator); if (index > -1) { result = result.slice(0, index); } } return result + omission; } /** * The inverse of `_.escape`; this method converts the HTML entities * `&`, `<`, `>`, `"`, and `'` in `string` to * their corresponding characters. * * **Note:** No other HTML entities are unescaped. To unescape additional * HTML entities use a third-party library like [_he_](https://mths.be/he). * * @static * @memberOf _ * @since 0.6.0 * @category String * @param {string} [string=''] The string to unescape. * @returns {string} Returns the unescaped string. * @example * * _.unescape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' */ function unescape(string) { string = toString(string); return (string && reHasEscapedHtml.test(string)) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; } /** * Converts `string`, as space separated words, to upper case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the upper cased string. * @example * * _.upperCase('--foo-bar'); * // => 'FOO BAR' * * _.upperCase('fooBar'); * // => 'FOO BAR' * * _.upperCase('__foo_bar__'); * // => 'FOO BAR' */ var upperCase = createCompounder(function(result, word, index) { return result + (index ? ' ' : '') + word.toUpperCase(); }); /** * Converts the first character of `string` to upper case. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to convert. * @returns {string} Returns the converted string. * @example * * _.upperFirst('fred'); * // => 'Fred' * * _.upperFirst('FRED'); * // => 'FRED' */ var upperFirst = createCaseFirst('toUpperCase'); /** * Splits `string` into an array of its words. * * @static * @memberOf _ * @since 3.0.0 * @category String * @param {string} [string=''] The string to inspect. * @param {RegExp|string} [pattern] The pattern to match words. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {Array} Returns the words of `string`. * @example * * _.words('fred, barney, & pebbles'); * // => ['fred', 'barney', 'pebbles'] * * _.words('fred, barney, & pebbles', /[^, ]+/g); * // => ['fred', 'barney', '&', 'pebbles'] */ function words(string, pattern, guard) { string = toString(string); pattern = guard ? undefined : pattern; if (pattern === undefined) { return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } return string.match(pattern) || []; } /*------------------------------------------------------------------------*/ /** * Attempts to invoke `func`, returning either the result or the caught error * object. Any additional arguments are provided to `func` when it's invoked. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {Function} func The function to attempt. * @param {...*} [args] The arguments to invoke `func` with. * @returns {*} Returns the `func` result or error object. * @example * * // Avoid throwing errors for invalid selectors. * var elements = _.attempt(function(selector) { * return document.querySelectorAll(selector); * }, '>_>'); * * if (_.isError(elements)) { * elements = []; * } */ var attempt = baseRest(function(func, args) { try { return apply(func, undefined, args); } catch (e) { return isError(e) ? e : new Error(e); } }); /** * Binds methods of an object to the object itself, overwriting the existing * method. * * **Note:** This method doesn't set the "length" property of bound functions. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {Object} object The object to bind and assign the bound methods to. * @param {...(string|string[])} methodNames The object method names to bind. * @returns {Object} Returns `object`. * @example * * var view = { * 'label': 'docs', * 'click': function() { * console.log('clicked ' + this.label); * } * }; * * _.bindAll(view, ['click']); * jQuery(element).on('click', view.click); * // => Logs 'clicked docs' when clicked. */ var bindAll = flatRest(function(object, methodNames) { arrayEach(methodNames, function(key) { key = toKey(key); baseAssignValue(object, key, bind(object[key], object)); }); return object; }); /** * Creates a function that iterates over `pairs` and invokes the corresponding * function of the first predicate to return truthy. The predicate-function * pairs are invoked with the `this` binding and arguments of the created * function. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {Array} pairs The predicate-function pairs. * @returns {Function} Returns the new composite function. * @example * * var func = _.cond([ * [_.matches({ 'a': 1 }), _.constant('matches A')], * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], * [_.stubTrue, _.constant('no match')] * ]); * * func({ 'a': 1, 'b': 2 }); * // => 'matches A' * * func({ 'a': 0, 'b': 1 }); * // => 'matches B' * * func({ 'a': '1', 'b': '2' }); * // => 'no match' */ function cond(pairs) { var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee(); pairs = !length ? [] : arrayMap(pairs, function(pair) { if (typeof pair[1] != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } return [toIteratee(pair[0]), pair[1]]; }); return baseRest(function(args) { var index = -1; while (++index < length) { var pair = pairs[index]; if (apply(pair[0], this, args)) { return apply(pair[1], this, args); } } }); } /** * Creates a function that invokes the predicate properties of `source` with * the corresponding property values of a given object, returning `true` if * all predicates return truthy, else `false`. * * **Note:** The created function is equivalent to `_.conformsTo` with * `source` partially applied. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new spec function. * @example * * var objects = [ * { 'a': 2, 'b': 1 }, * { 'a': 1, 'b': 2 } * ]; * * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); * // => [{ 'a': 1, 'b': 2 }] */ function conforms(source) { return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); } /** * Creates a function that returns `value`. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {*} value The value to return from the new function. * @returns {Function} Returns the new constant function. * @example * * var objects = _.times(2, _.constant({ 'a': 1 })); * * console.log(objects); * // => [{ 'a': 1 }, { 'a': 1 }] * * console.log(objects[0] === objects[1]); * // => true */ function constant(value) { return function() { return value; }; } /** * Checks `value` to determine whether a default value should be returned in * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, * or `undefined`. * * @static * @memberOf _ * @since 4.14.0 * @category Util * @param {*} value The value to check. * @param {*} defaultValue The default value. * @returns {*} Returns the resolved value. * @example * * _.defaultTo(1, 10); * // => 1 * * _.defaultTo(undefined, 10); * // => 10 */ function defaultTo(value, defaultValue) { return (value == null || value !== value) ? defaultValue : value; } /** * Creates a function that returns the result of invoking the given functions * with the `this` binding of the created function, where each successive * invocation is supplied the return value of the previous. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flowRight * @example * * function square(n) { * return n * n; * } * * var addSquare = _.flow([_.add, square]); * addSquare(1, 2); * // => 9 */ var flow = createFlow(); /** * This method is like `_.flow` except that it creates a function that * invokes the given functions from right to left. * * @static * @since 3.0.0 * @memberOf _ * @category Util * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flow * @example * * function square(n) { * return n * n; * } * * var addSquare = _.flowRight([square, _.add]); * addSquare(1, 2); * // => 9 */ var flowRight = createFlow(true); /** * This method returns the first argument it receives. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {*} value Any value. * @returns {*} Returns `value`. * @example * * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true */ function identity(value) { return value; } /** * Creates a function that invokes `func` with the arguments of the created * function. If `func` is a property name, the created function returns the * property value for a given element. If `func` is an array or object, the * created function returns `true` for elements that contain the equivalent * source properties, otherwise it returns `false`. * * @static * @since 4.0.0 * @memberOf _ * @category Util * @param {*} [func=_.identity] The value to convert to a callback. * @returns {Function} Returns the callback. * @example * * var users = [ * { 'user': 'barney', 'age': 36, 'active': true }, * { 'user': 'fred', 'age': 40, 'active': false } * ]; * * // The `_.matches` iteratee shorthand. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); * // => [{ 'user': 'barney', 'age': 36, 'active': true }] * * // The `_.matchesProperty` iteratee shorthand. * _.filter(users, _.iteratee(['user', 'fred'])); * // => [{ 'user': 'fred', 'age': 40 }] * * // The `_.property` iteratee shorthand. * _.map(users, _.iteratee('user')); * // => ['barney', 'fred'] * * // Create custom iteratee shorthands. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { * return !_.isRegExp(func) ? iteratee(func) : function(string) { * return func.test(string); * }; * }); * * _.filter(['abc', 'def'], /ef/); * // => ['def'] */ function iteratee(func) { return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); } /** * Creates a function that performs a partial deep comparison between a given * object and `source`, returning `true` if the given object has equivalent * property values, else `false`. * * **Note:** The created function is equivalent to `_.isMatch` with `source` * partially applied. * * Partial comparisons will match empty array and empty object `source` * values against any array or object value, respectively. See `_.isEqual` * for a list of supported value comparisons. * * **Note:** Multiple values can be checked by combining several matchers * using `_.overSome` * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {Object} source The object of property values to match. * @returns {Function} Returns the new spec function. * @example * * var objects = [ * { 'a': 1, 'b': 2, 'c': 3 }, * { 'a': 4, 'b': 5, 'c': 6 } * ]; * * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); * // => [{ 'a': 4, 'b': 5, 'c': 6 }] * * // Checking for several possible values * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] */ function matches(source) { return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); } /** * Creates a function that performs a partial deep comparison between the * value at `path` of a given object to `srcValue`, returning `true` if the * object value is equivalent, else `false`. * * **Note:** Partial comparisons will match empty array and empty object * `srcValue` values against any array or object value, respectively. See * `_.isEqual` for a list of supported value comparisons. * * **Note:** Multiple values can be checked by combining several matchers * using `_.overSome` * * @static * @memberOf _ * @since 3.2.0 * @category Util * @param {Array|string} path The path of the property to get. * @param {*} srcValue The value to match. * @returns {Function} Returns the new spec function. * @example * * var objects = [ * { 'a': 1, 'b': 2, 'c': 3 }, * { 'a': 4, 'b': 5, 'c': 6 } * ]; * * _.find(objects, _.matchesProperty('a', 4)); * // => { 'a': 4, 'b': 5, 'c': 6 } * * // Checking for several possible values * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] */ function matchesProperty(path, srcValue) { return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); } /** * Creates a function that invokes the method at `path` of a given object. * Any additional arguments are provided to the invoked method. * * @static * @memberOf _ * @since 3.7.0 * @category Util * @param {Array|string} path The path of the method to invoke. * @param {...*} [args] The arguments to invoke the method with. * @returns {Function} Returns the new invoker function. * @example * * var objects = [ * { 'a': { 'b': _.constant(2) } }, * { 'a': { 'b': _.constant(1) } } * ]; * * _.map(objects, _.method('a.b')); * // => [2, 1] * * _.map(objects, _.method(['a', 'b'])); * // => [2, 1] */ var method = baseRest(function(path, args) { return function(object) { return baseInvoke(object, path, args); }; }); /** * The opposite of `_.method`; this method creates a function that invokes * the method at a given path of `object`. Any additional arguments are * provided to the invoked method. * * @static * @memberOf _ * @since 3.7.0 * @category Util * @param {Object} object The object to query. * @param {...*} [args] The arguments to invoke the method with. * @returns {Function} Returns the new invoker function. * @example * * var array = _.times(3, _.constant), * object = { 'a': array, 'b': array, 'c': array }; * * _.map(['a[2]', 'c[0]'], _.methodOf(object)); * // => [2, 0] * * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); * // => [2, 0] */ var methodOf = baseRest(function(object, args) { return function(path) { return baseInvoke(object, path, args); }; }); /** * Adds all own enumerable string keyed function properties of a source * object to the destination object. If `object` is a function, then methods * are added to its prototype as well. * * **Note:** Use `_.runInContext` to create a pristine `lodash` function to * avoid conflicts caused by modifying the original. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {Function|Object} [object=lodash] The destination object. * @param {Object} source The object of functions to add. * @param {Object} [options={}] The options object. * @param {boolean} [options.chain=true] Specify whether mixins are chainable. * @returns {Function|Object} Returns `object`. * @example * * function vowels(string) { * return _.filter(string, function(v) { * return /[aeiou]/i.test(v); * }); * } * * _.mixin({ 'vowels': vowels }); * _.vowels('fred'); * // => ['e'] * * _('fred').vowels().value(); * // => ['e'] * * _.mixin({ 'vowels': vowels }, { 'chain': false }); * _('fred').vowels(); * // => ['e'] */ function mixin(object, source, options) { var props = keys(source), methodNames = baseFunctions(source, props); if (options == null && !(isObject(source) && (methodNames.length || !props.length))) { options = source; source = object; object = this; methodNames = baseFunctions(source, keys(source)); } var chain = !(isObject(options) && 'chain' in options) || !!options.chain, isFunc = isFunction(object); arrayEach(methodNames, function(methodName) { var func = source[methodName]; object[methodName] = func; if (isFunc) { object.prototype[methodName] = function() { var chainAll = this.__chain__; if (chain || chainAll) { var result = object(this.__wrapped__), actions = result.__actions__ = copyArray(this.__actions__); actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); result.__chain__ = chainAll; return result; } return func.apply(object, arrayPush([this.value()], arguments)); }; } }); return object; } /** * Reverts the `_` variable to its previous value and returns a reference to * the `lodash` function. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @returns {Function} Returns the `lodash` function. * @example * * var lodash = _.noConflict(); */ function noConflict() { if (root._ === this) { root._ = oldDash; } return this; } /** * This method returns `undefined`. * * @static * @memberOf _ * @since 2.3.0 * @category Util * @example * * _.times(2, _.noop); * // => [undefined, undefined] */ function noop() { // No operation performed. } /** * Creates a function that gets the argument at index `n`. If `n` is negative, * the nth argument from the end is returned. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {number} [n=0] The index of the argument to return. * @returns {Function} Returns the new pass-thru function. * @example * * var func = _.nthArg(1); * func('a', 'b', 'c', 'd'); * // => 'b' * * var func = _.nthArg(-2); * func('a', 'b', 'c', 'd'); * // => 'c' */ function nthArg(n) { n = toInteger(n); return baseRest(function(args) { return baseNth(args, n); }); } /** * Creates a function that invokes `iteratees` with the arguments it receives * and returns their results. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {...(Function|Function[])} [iteratees=[_.identity]] * The iteratees to invoke. * @returns {Function} Returns the new function. * @example * * var func = _.over([Math.max, Math.min]); * * func(1, 2, 3, 4); * // => [4, 1] */ var over = createOver(arrayMap); /** * Creates a function that checks if **all** of the `predicates` return * truthy when invoked with the arguments it receives. * * Following shorthands are possible for providing predicates. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {...(Function|Function[])} [predicates=[_.identity]] * The predicates to check. * @returns {Function} Returns the new function. * @example * * var func = _.overEvery([Boolean, isFinite]); * * func('1'); * // => true * * func(null); * // => false * * func(NaN); * // => false */ var overEvery = createOver(arrayEvery); /** * Creates a function that checks if **any** of the `predicates` return * truthy when invoked with the arguments it receives. * * Following shorthands are possible for providing predicates. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {...(Function|Function[])} [predicates=[_.identity]] * The predicates to check. * @returns {Function} Returns the new function. * @example * * var func = _.overSome([Boolean, isFinite]); * * func('1'); * // => true * * func(null); * // => true * * func(NaN); * // => false * * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) */ var overSome = createOver(arraySome); /** * Creates a function that returns the value at `path` of a given object. * * @static * @memberOf _ * @since 2.4.0 * @category Util * @param {Array|string} path The path of the property to get. * @returns {Function} Returns the new accessor function. * @example * * var objects = [ * { 'a': { 'b': 2 } }, * { 'a': { 'b': 1 } } * ]; * * _.map(objects, _.property('a.b')); * // => [2, 1] * * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] */ function property(path) { return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); } /** * The opposite of `_.property`; this method creates a function that returns * the value at a given path of `object`. * * @static * @memberOf _ * @since 3.0.0 * @category Util * @param {Object} object The object to query. * @returns {Function} Returns the new accessor function. * @example * * var array = [0, 1, 2], * object = { 'a': array, 'b': array, 'c': array }; * * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); * // => [2, 0] * * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); * // => [2, 0] */ function propertyOf(object) { return function(path) { return object == null ? undefined : baseGet(object, path); }; } /** * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative * `start` is specified without an `end` or `step`. If `end` is not specified, * it's set to `start` with `start` then set to `0`. * * **Note:** JavaScript follows the IEEE-754 standard for resolving * floating-point values which can produce unexpected results. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. * @returns {Array} Returns the range of numbers. * @see _.inRange, _.rangeRight * @example * * _.range(4); * // => [0, 1, 2, 3] * * _.range(-4); * // => [0, -1, -2, -3] * * _.range(1, 5); * // => [1, 2, 3, 4] * * _.range(0, 20, 5); * // => [0, 5, 10, 15] * * _.range(0, -4, -1); * // => [0, -1, -2, -3] * * _.range(1, 4, 0); * // => [1, 1, 1] * * _.range(0); * // => [] */ var range = createRange(); /** * This method is like `_.range` except that it populates values in * descending order. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. * @param {number} [step=1] The value to increment or decrement by. * @returns {Array} Returns the range of numbers. * @see _.inRange, _.range * @example * * _.rangeRight(4); * // => [3, 2, 1, 0] * * _.rangeRight(-4); * // => [-3, -2, -1, 0] * * _.rangeRight(1, 5); * // => [4, 3, 2, 1] * * _.rangeRight(0, 20, 5); * // => [15, 10, 5, 0] * * _.rangeRight(0, -4, -1); * // => [-3, -2, -1, 0] * * _.rangeRight(1, 4, 0); * // => [1, 1, 1] * * _.rangeRight(0); * // => [] */ var rangeRight = createRange(true); /** * This method returns a new empty array. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Array} Returns the new empty array. * @example * * var arrays = _.times(2, _.stubArray); * * console.log(arrays); * // => [[], []] * * console.log(arrays[0] === arrays[1]); * // => false */ function stubArray() { return []; } /** * This method returns `false`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `false`. * @example * * _.times(2, _.stubFalse); * // => [false, false] */ function stubFalse() { return false; } /** * This method returns a new empty object. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {Object} Returns the new empty object. * @example * * var objects = _.times(2, _.stubObject); * * console.log(objects); * // => [{}, {}] * * console.log(objects[0] === objects[1]); * // => false */ function stubObject() { return {}; } /** * This method returns an empty string. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {string} Returns the empty string. * @example * * _.times(2, _.stubString); * // => ['', ''] */ function stubString() { return ''; } /** * This method returns `true`. * * @static * @memberOf _ * @since 4.13.0 * @category Util * @returns {boolean} Returns `true`. * @example * * _.times(2, _.stubTrue); * // => [true, true] */ function stubTrue() { return true; } /** * Invokes the iteratee `n` times, returning an array of the results of * each invocation. The iteratee is invoked with one argument; (index). * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {number} n The number of times to invoke `iteratee`. * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of results. * @example * * _.times(3, String); * // => ['0', '1', '2'] * * _.times(4, _.constant(0)); * // => [0, 0, 0, 0] */ function times(n, iteratee) { n = toInteger(n); if (n < 1 || n > MAX_SAFE_INTEGER) { return []; } var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH); iteratee = getIteratee(iteratee); n -= MAX_ARRAY_LENGTH; var result = baseTimes(length, iteratee); while (++index < n) { iteratee(index); } return result; } /** * Converts `value` to a property path array. * * @static * @memberOf _ * @since 4.0.0 * @category Util * @param {*} value The value to convert. * @returns {Array} Returns the new property path array. * @example * * _.toPath('a.b.c'); * // => ['a', 'b', 'c'] * * _.toPath('a[0].b.c'); * // => ['a', '0', 'b', 'c'] */ function toPath(value) { if (isArray(value)) { return arrayMap(value, toKey); } return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); } /** * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static * @since 0.1.0 * @memberOf _ * @category Util * @param {string} [prefix=''] The value to prefix the ID with. * @returns {string} Returns the unique ID. * @example * * _.uniqueId('contact_'); * // => 'contact_104' * * _.uniqueId(); * // => '105' */ function uniqueId(prefix) { var id = ++idCounter; return toString(prefix) + id; } /*------------------------------------------------------------------------*/ /** * Adds two numbers. * * @static * @memberOf _ * @since 3.4.0 * @category Math * @param {number} augend The first number in an addition. * @param {number} addend The second number in an addition. * @returns {number} Returns the total. * @example * * _.add(6, 4); * // => 10 */ var add = createMathOperation(function(augend, addend) { return augend + addend; }, 0); /** * Computes `number` rounded up to `precision`. * * @static * @memberOf _ * @since 3.10.0 * @category Math * @param {number} number The number to round up. * @param {number} [precision=0] The precision to round up to. * @returns {number} Returns the rounded up number. * @example * * _.ceil(4.006); * // => 5 * * _.ceil(6.004, 2); * // => 6.01 * * _.ceil(6040, -2); * // => 6100 */ var ceil = createRound('ceil'); /** * Divide two numbers. * * @static * @memberOf _ * @since 4.7.0 * @category Math * @param {number} dividend The first number in a division. * @param {number} divisor The second number in a division. * @returns {number} Returns the quotient. * @example * * _.divide(6, 4); * // => 1.5 */ var divide = createMathOperation(function(dividend, divisor) { return dividend / divisor; }, 1); /** * Computes `number` rounded down to `precision`. * * @static * @memberOf _ * @since 3.10.0 * @category Math * @param {number} number The number to round down. * @param {number} [precision=0] The precision to round down to. * @returns {number} Returns the rounded down number. * @example * * _.floor(4.006); * // => 4 * * _.floor(0.046, 2); * // => 0.04 * * _.floor(4060, -2); * // => 4000 */ var floor = createRound('floor'); /** * Computes the maximum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. * @returns {*} Returns the maximum value. * @example * * _.max([4, 2, 8, 6]); * // => 8 * * _.max([]); * // => undefined */ function max(array) { return (array && array.length) ? baseExtremum(array, identity, baseGt) : undefined; } /** * This method is like `_.max` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the maximum value. * @example * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * * _.maxBy(objects, function(o) { return o.n; }); * // => { 'n': 2 } * * // The `_.property` iteratee shorthand. * _.maxBy(objects, 'n'); * // => { 'n': 2 } */ function maxBy(array, iteratee) { return (array && array.length) ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) : undefined; } /** * Computes the mean of the values in `array`. * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @returns {number} Returns the mean. * @example * * _.mean([4, 2, 8, 6]); * // => 5 */ function mean(array) { return baseMean(array, identity); } /** * This method is like `_.mean` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be averaged. * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.7.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the mean. * @example * * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * * _.meanBy(objects, function(o) { return o.n; }); * // => 5 * * // The `_.property` iteratee shorthand. * _.meanBy(objects, 'n'); * // => 5 */ function meanBy(array, iteratee) { return baseMean(array, getIteratee(iteratee, 2)); } /** * Computes the minimum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * * @static * @since 0.1.0 * @memberOf _ * @category Math * @param {Array} array The array to iterate over. * @returns {*} Returns the minimum value. * @example * * _.min([4, 2, 8, 6]); * // => 2 * * _.min([]); * // => undefined */ function min(array) { return (array && array.length) ? baseExtremum(array, identity, baseLt) : undefined; } /** * This method is like `_.min` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the minimum value. * @example * * var objects = [{ 'n': 1 }, { 'n': 2 }]; * * _.minBy(objects, function(o) { return o.n; }); * // => { 'n': 1 } * * // The `_.property` iteratee shorthand. * _.minBy(objects, 'n'); * // => { 'n': 1 } */ function minBy(array, iteratee) { return (array && array.length) ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) : undefined; } /** * Multiply two numbers. * * @static * @memberOf _ * @since 4.7.0 * @category Math * @param {number} multiplier The first number in a multiplication. * @param {number} multiplicand The second number in a multiplication. * @returns {number} Returns the product. * @example * * _.multiply(6, 4); * // => 24 */ var multiply = createMathOperation(function(multiplier, multiplicand) { return multiplier * multiplicand; }, 1); /** * Computes `number` rounded to `precision`. * * @static * @memberOf _ * @since 3.10.0 * @category Math * @param {number} number The number to round. * @param {number} [precision=0] The precision to round to. * @returns {number} Returns the rounded number. * @example * * _.round(4.006); * // => 4 * * _.round(4.006, 2); * // => 4.01 * * _.round(4060, -2); * // => 4100 */ var round = createRound('round'); /** * Subtract two numbers. * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {number} minuend The first number in a subtraction. * @param {number} subtrahend The second number in a subtraction. * @returns {number} Returns the difference. * @example * * _.subtract(6, 4); * // => 2 */ var subtract = createMathOperation(function(minuend, subtrahend) { return minuend - subtrahend; }, 0); /** * Computes the sum of the values in `array`. * * @static * @memberOf _ * @since 3.4.0 * @category Math * @param {Array} array The array to iterate over. * @returns {number} Returns the sum. * @example * * _.sum([4, 2, 8, 6]); * // => 20 */ function sum(array) { return (array && array.length) ? baseSum(array, identity) : 0; } /** * This method is like `_.sum` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be summed. * The iteratee is invoked with one argument: (value). * * @static * @memberOf _ * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the sum. * @example * * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; * * _.sumBy(objects, function(o) { return o.n; }); * // => 20 * * // The `_.property` iteratee shorthand. * _.sumBy(objects, 'n'); * // => 20 */ function sumBy(array, iteratee) { return (array && array.length) ? baseSum(array, getIteratee(iteratee, 2)) : 0; } /*------------------------------------------------------------------------*/ // Add methods that return wrapped values in chain sequences. lodash.after = after; lodash.ary = ary; lodash.assign = assign; lodash.assignIn = assignIn; lodash.assignInWith = assignInWith; lodash.assignWith = assignWith; lodash.at = at; lodash.before = before; lodash.bind = bind; lodash.bindAll = bindAll; lodash.bindKey = bindKey; lodash.castArray = castArray; lodash.chain = chain; lodash.chunk = chunk; lodash.compact = compact; lodash.concat = concat; lodash.cond = cond; lodash.conforms = conforms; lodash.constant = constant; lodash.countBy = countBy; lodash.create = create; lodash.curry = curry; lodash.curryRight = curryRight; lodash.debounce = debounce; lodash.defaults = defaults; lodash.defaultsDeep = defaultsDeep; lodash.defer = defer; lodash.delay = delay; lodash.difference = difference; lodash.differenceBy = differenceBy; lodash.differenceWith = differenceWith; lodash.drop = drop; lodash.dropRight = dropRight; lodash.dropRightWhile = dropRightWhile; lodash.dropWhile = dropWhile; lodash.fill = fill; lodash.filter = filter; lodash.flatMap = flatMap; lodash.flatMapDeep = flatMapDeep; lodash.flatMapDepth = flatMapDepth; lodash.flatten = flatten; lodash.flattenDeep = flattenDeep; lodash.flattenDepth = flattenDepth; lodash.flip = flip; lodash.flow = flow; lodash.flowRight = flowRight; lodash.fromPairs = fromPairs; lodash.functions = functions; lodash.functionsIn = functionsIn; lodash.groupBy = groupBy; lodash.initial = initial; lodash.intersection = intersection; lodash.intersectionBy = intersectionBy; lodash.intersectionWith = intersectionWith; lodash.invert = invert; lodash.invertBy = invertBy; lodash.invokeMap = invokeMap; lodash.iteratee = iteratee; lodash.keyBy = keyBy; lodash.keys = keys; lodash.keysIn = keysIn; lodash.map = map; lodash.mapKeys = mapKeys; lodash.mapValues = mapValues; lodash.matches = matches; lodash.matchesProperty = matchesProperty; lodash.memoize = memoize; lodash.merge = merge; lodash.mergeWith = mergeWith; lodash.method = method; lodash.methodOf = methodOf; lodash.mixin = mixin; lodash.negate = negate; lodash.nthArg = nthArg; lodash.omit = omit; lodash.omitBy = omitBy; lodash.once = once; lodash.orderBy = orderBy; lodash.over = over; lodash.overArgs = overArgs; lodash.overEvery = overEvery; lodash.overSome = overSome; lodash.partial = partial; lodash.partialRight = partialRight; lodash.partition = partition; lodash.pick = pick; lodash.pickBy = pickBy; lodash.property = property; lodash.propertyOf = propertyOf; lodash.pull = pull; lodash.pullAll = pullAll; lodash.pullAllBy = pullAllBy; lodash.pullAllWith = pullAllWith; lodash.pullAt = pullAt; lodash.range = range; lodash.rangeRight = rangeRight; lodash.rearg = rearg; lodash.reject = reject; lodash.remove = remove; lodash.rest = rest; lodash.reverse = reverse; lodash.sampleSize = sampleSize; lodash.set = set; lodash.setWith = setWith; lodash.shuffle = shuffle; lodash.slice = slice; lodash.sortBy = sortBy; lodash.sortedUniq = sortedUniq; lodash.sortedUniqBy = sortedUniqBy; lodash.split = split; lodash.spread = spread; lodash.tail = tail; lodash.take = take; lodash.takeRight = takeRight; lodash.takeRightWhile = takeRightWhile; lodash.takeWhile = takeWhile; lodash.tap = tap; lodash.throttle = throttle; lodash.thru = thru; lodash.toArray = toArray; lodash.toPairs = toPairs; lodash.toPairsIn = toPairsIn; lodash.toPath = toPath; lodash.toPlainObject = toPlainObject; lodash.transform = transform; lodash.unary = unary; lodash.union = union; lodash.unionBy = unionBy; lodash.unionWith = unionWith; lodash.uniq = uniq; lodash.uniqBy = uniqBy; lodash.uniqWith = uniqWith; lodash.unset = unset; lodash.unzip = unzip; lodash.unzipWith = unzipWith; lodash.update = update; lodash.updateWith = updateWith; lodash.values = values; lodash.valuesIn = valuesIn; lodash.without = without; lodash.words = words; lodash.wrap = wrap; lodash.xor = xor; lodash.xorBy = xorBy; lodash.xorWith = xorWith; lodash.zip = zip; lodash.zipObject = zipObject; lodash.zipObjectDeep = zipObjectDeep; lodash.zipWith = zipWith; // Add aliases. lodash.entries = toPairs; lodash.entriesIn = toPairsIn; lodash.extend = assignIn; lodash.extendWith = assignInWith; // Add methods to `lodash.prototype`. mixin(lodash, lodash); /*------------------------------------------------------------------------*/ // Add methods that return unwrapped values in chain sequences. lodash.add = add; lodash.attempt = attempt; lodash.camelCase = camelCase; lodash.capitalize = capitalize; lodash.ceil = ceil; lodash.clamp = clamp; lodash.clone = clone; lodash.cloneDeep = cloneDeep; lodash.cloneDeepWith = cloneDeepWith; lodash.cloneWith = cloneWith; lodash.conformsTo = conformsTo; lodash.deburr = deburr; lodash.defaultTo = defaultTo; lodash.divide = divide; lodash.endsWith = endsWith; lodash.eq = eq; lodash.escape = escape; lodash.escapeRegExp = escapeRegExp; lodash.every = every; lodash.find = find; lodash.findIndex = findIndex; lodash.findKey = findKey; lodash.findLast = findLast; lodash.findLastIndex = findLastIndex; lodash.findLastKey = findLastKey; lodash.floor = floor; lodash.forEach = forEach; lodash.forEachRight = forEachRight; lodash.forIn = forIn; lodash.forInRight = forInRight; lodash.forOwn = forOwn; lodash.forOwnRight = forOwnRight; lodash.get = get; lodash.gt = gt; lodash.gte = gte; lodash.has = has; lodash.hasIn = hasIn; lodash.head = head; lodash.identity = identity; lodash.includes = includes; lodash.indexOf = indexOf; lodash.inRange = inRange; lodash.invoke = invoke; lodash.isArguments = isArguments; lodash.isArray = isArray; lodash.isArrayBuffer = isArrayBuffer; lodash.isArrayLike = isArrayLike; lodash.isArrayLikeObject = isArrayLikeObject; lodash.isBoolean = isBoolean; lodash.isBuffer = isBuffer; lodash.isDate = isDate; lodash.isElement = isElement; lodash.isEmpty = isEmpty; lodash.isEqual = isEqual; lodash.isEqualWith = isEqualWith; lodash.isError = isError; lodash.isFinite = isFinite; lodash.isFunction = isFunction; lodash.isInteger = isInteger; lodash.isLength = isLength; lodash.isMap = isMap; lodash.isMatch = isMatch; lodash.isMatchWith = isMatchWith; lodash.isNaN = isNaN; lodash.isNative = isNative; lodash.isNil = isNil; lodash.isNull = isNull; lodash.isNumber = isNumber; lodash.isObject = isObject; lodash.isObjectLike = isObjectLike; lodash.isPlainObject = isPlainObject; lodash.isRegExp = isRegExp; lodash.isSafeInteger = isSafeInteger; lodash.isSet = isSet; lodash.isString = isString; lodash.isSymbol = isSymbol; lodash.isTypedArray = isTypedArray; lodash.isUndefined = isUndefined; lodash.isWeakMap = isWeakMap; lodash.isWeakSet = isWeakSet; lodash.join = join; lodash.kebabCase = kebabCase; lodash.last = last; lodash.lastIndexOf = lastIndexOf; lodash.lowerCase = lowerCase; lodash.lowerFirst = lowerFirst; lodash.lt = lt; lodash.lte = lte; lodash.max = max; lodash.maxBy = maxBy; lodash.mean = mean; lodash.meanBy = meanBy; lodash.min = min; lodash.minBy = minBy; lodash.stubArray = stubArray; lodash.stubFalse = stubFalse; lodash.stubObject = stubObject; lodash.stubString = stubString; lodash.stubTrue = stubTrue; lodash.multiply = multiply; lodash.nth = nth; lodash.noConflict = noConflict; lodash.noop = noop; lodash.now = now; lodash.pad = pad; lodash.padEnd = padEnd; lodash.padStart = padStart; lodash.parseInt = parseInt; lodash.random = random; lodash.reduce = reduce; lodash.reduceRight = reduceRight; lodash.repeat = repeat; lodash.replace = replace; lodash.result = result; lodash.round = round; lodash.runInContext = runInContext; lodash.sample = sample; lodash.size = size; lodash.snakeCase = snakeCase; lodash.some = some; lodash.sortedIndex = sortedIndex; lodash.sortedIndexBy = sortedIndexBy; lodash.sortedIndexOf = sortedIndexOf; lodash.sortedLastIndex = sortedLastIndex; lodash.sortedLastIndexBy = sortedLastIndexBy; lodash.sortedLastIndexOf = sortedLastIndexOf; lodash.startCase = startCase; lodash.startsWith = startsWith; lodash.subtract = subtract; lodash.sum = sum; lodash.sumBy = sumBy; lodash.template = template; lodash.times = times; lodash.toFinite = toFinite; lodash.toInteger = toInteger; lodash.toLength = toLength; lodash.toLower = toLower; lodash.toNumber = toNumber; lodash.toSafeInteger = toSafeInteger; lodash.toString = toString; lodash.toUpper = toUpper; lodash.trim = trim; lodash.trimEnd = trimEnd; lodash.trimStart = trimStart; lodash.truncate = truncate; lodash.unescape = unescape; lodash.uniqueId = uniqueId; lodash.upperCase = upperCase; lodash.upperFirst = upperFirst; // Add aliases. lodash.each = forEach; lodash.eachRight = forEachRight; lodash.first = head; mixin(lodash, (function() { var source = {}; baseForOwn(lodash, function(func, methodName) { if (!hasOwnProperty.call(lodash.prototype, methodName)) { source[methodName] = func; } }); return source; }()), { 'chain': false }); /*------------------------------------------------------------------------*/ /** * The semantic version number. * * @static * @memberOf _ * @type {string} */ lodash.VERSION = VERSION; // Assign default placeholders. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { lodash[methodName].placeholder = lodash; }); // Add `LazyWrapper` methods for `_.drop` and `_.take` variants. arrayEach(['drop', 'take'], function(methodName, index) { LazyWrapper.prototype[methodName] = function(n) { n = n === undefined ? 1 : nativeMax(toInteger(n), 0); var result = (this.__filtered__ && !index) ? new LazyWrapper(this) : this.clone(); if (result.__filtered__) { result.__takeCount__ = nativeMin(n, result.__takeCount__); } else { result.__views__.push({ 'size': nativeMin(n, MAX_ARRAY_LENGTH), 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') }); } return result; }; LazyWrapper.prototype[methodName + 'Right'] = function(n) { return this.reverse()[methodName](n).reverse(); }; }); // Add `LazyWrapper` methods that accept an `iteratee` value. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) { var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; LazyWrapper.prototype[methodName] = function(iteratee) { var result = this.clone(); result.__iteratees__.push({ 'iteratee': getIteratee(iteratee, 3), 'type': type }); result.__filtered__ = result.__filtered__ || isFilter; return result; }; }); // Add `LazyWrapper` methods for `_.head` and `_.last`. arrayEach(['head', 'last'], function(methodName, index) { var takeName = 'take' + (index ? 'Right' : ''); LazyWrapper.prototype[methodName] = function() { return this[takeName](1).value()[0]; }; }); // Add `LazyWrapper` methods for `_.initial` and `_.tail`. arrayEach(['initial', 'tail'], function(methodName, index) { var dropName = 'drop' + (index ? '' : 'Right'); LazyWrapper.prototype[methodName] = function() { return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); }; }); LazyWrapper.prototype.compact = function() { return this.filter(identity); }; LazyWrapper.prototype.find = function(predicate) { return this.filter(predicate).head(); }; LazyWrapper.prototype.findLast = function(predicate) { return this.reverse().find(predicate); }; LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { if (typeof path == 'function') { return new LazyWrapper(this); } return this.map(function(value) { return baseInvoke(value, path, args); }); }); LazyWrapper.prototype.reject = function(predicate) { return this.filter(negate(getIteratee(predicate))); }; LazyWrapper.prototype.slice = function(start, end) { start = toInteger(start); var result = this; if (result.__filtered__ && (start > 0 || end < 0)) { return new LazyWrapper(result); } if (start < 0) { result = result.takeRight(-start); } else if (start) { result = result.drop(start); } if (end !== undefined) { end = toInteger(end); result = end < 0 ? result.dropRight(-end) : result.take(end - start); } return result; }; LazyWrapper.prototype.takeRightWhile = function(predicate) { return this.reverse().takeWhile(predicate).reverse(); }; LazyWrapper.prototype.toArray = function() { return this.take(MAX_ARRAY_LENGTH); }; // Add `LazyWrapper` methods to `lodash.prototype`. baseForOwn(LazyWrapper.prototype, function(func, methodName) { var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName], retUnwrapped = isTaker || /^find/.test(methodName); if (!lodashFunc) { return; } lodash.prototype[methodName] = function() { var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee = args[0], useLazy = isLazy || isArray(value); var interceptor = function(value) { var result = lodashFunc.apply(lodash, arrayPush([value], args)); return (isTaker && chainAll) ? result[0] : result; }; if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { // Avoid lazy use if the iteratee has a "length" value other than `1`. isLazy = useLazy = false; } var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid; if (!retUnwrapped && useLazy) { value = onlyLazy ? value : new LazyWrapper(this); var result = func.apply(value, args); result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); return new LodashWrapper(result, chainAll); } if (isUnwrapped && onlyLazy) { return func.apply(this, args); } result = this.thru(interceptor); return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result; }; }); // Add `Array` methods to `lodash.prototype`. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', retUnwrapped = /^(?:pop|shift)$/.test(methodName); lodash.prototype[methodName] = function() { var args = arguments; if (retUnwrapped && !this.__chain__) { var value = this.value(); return func.apply(isArray(value) ? value : [], args); } return this[chainName](function(value) { return func.apply(isArray(value) ? value : [], args); }); }; }); // Map minified method names to their real names. baseForOwn(LazyWrapper.prototype, function(func, methodName) { var lodashFunc = lodash[methodName]; if (lodashFunc) { var key = lodashFunc.name + ''; if (!hasOwnProperty.call(realNames, key)) { realNames[key] = []; } realNames[key].push({ 'name': methodName, 'func': lodashFunc }); } }); realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }]; // Add methods to `LazyWrapper`. LazyWrapper.prototype.clone = lazyClone; LazyWrapper.prototype.reverse = lazyReverse; LazyWrapper.prototype.value = lazyValue; // Add chain sequence methods to the `lodash` wrapper. lodash.prototype.at = wrapperAt; lodash.prototype.chain = wrapperChain; lodash.prototype.commit = wrapperCommit; lodash.prototype.next = wrapperNext; lodash.prototype.plant = wrapperPlant; lodash.prototype.reverse = wrapperReverse; lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; // Add lazy aliases. lodash.prototype.first = lodash.prototype.head; if (symIterator) { lodash.prototype[symIterator] = wrapperToIterator; } return lodash; }); /*--------------------------------------------------------------------------*/ // Export lodash. var _ = runInContext(); // Some AMD build optimizers, like r.js, check for condition patterns like: if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { // Expose Lodash on the global object to prevent errors when Lodash is // loaded by a script tag in the presence of an AMD loader. // See http://requirejs.org/docs/errors.html#mismatch for more details. // Use `_.noConflict` to remove Lodash from the global object. root._ = _; // Define as an anonymous module so, through path mapping, it can be // referenced as the "underscore" module. define(function() { return _; }); } // Check for `exports` after `define` in case a build optimizer adds it. else if (freeModule) { // Export for Node.js. (freeModule.exports = _)._ = _; // Export for CommonJS support. freeExports._ = _; } else { // Export to the global object. root._ = _; } }.call(this)); vendor/wp-polyfill-object-fit.js 0000644 00000021741 15013651111 0012700 0 ustar 00 /*---------------------------------------- * objectFitPolyfill 2.3.5 * * Made by Constance Chen * Released under the ISC license * * https://github.com/constancecchen/object-fit-polyfill *--------------------------------------*/ (function() { 'use strict'; // if the page is being rendered on the server, don't continue if (typeof window === 'undefined') return; // Workaround for Edge 16-18, which only implemented object-fit for <img> tags var edgeMatch = window.navigator.userAgent.match(/Edge\/(\d{2})\./); var edgeVersion = edgeMatch ? parseInt(edgeMatch[1], 10) : null; var edgePartialSupport = edgeVersion ? edgeVersion >= 16 && edgeVersion <= 18 : false; // If the browser does support object-fit, we don't need to continue var hasSupport = 'objectFit' in document.documentElement.style !== false; if (hasSupport && !edgePartialSupport) { window.objectFitPolyfill = function() { return false; }; return; } /** * Check the container's parent element to make sure it will * correctly handle and clip absolutely positioned children * * @param {node} $container - parent element */ var checkParentContainer = function($container) { var styles = window.getComputedStyle($container, null); var position = styles.getPropertyValue('position'); var overflow = styles.getPropertyValue('overflow'); var display = styles.getPropertyValue('display'); if (!position || position === 'static') { $container.style.position = 'relative'; } if (overflow !== 'hidden') { $container.style.overflow = 'hidden'; } // Guesstimating that people want the parent to act like full width/height wrapper here. // Mostly attempts to target <picture> elements, which default to inline. if (!display || display === 'inline') { $container.style.display = 'block'; } if ($container.clientHeight === 0) { $container.style.height = '100%'; } // Add a CSS class hook, in case people need to override styles for any reason. if ($container.className.indexOf('object-fit-polyfill') === -1) { $container.className = $container.className + ' object-fit-polyfill'; } }; /** * Check for pre-set max-width/height, min-width/height, * positioning, or margins, which can mess up image calculations * * @param {node} $media - img/video element */ var checkMediaProperties = function($media) { var styles = window.getComputedStyle($media, null); var constraints = { 'max-width': 'none', 'max-height': 'none', 'min-width': '0px', 'min-height': '0px', top: 'auto', right: 'auto', bottom: 'auto', left: 'auto', 'margin-top': '0px', 'margin-right': '0px', 'margin-bottom': '0px', 'margin-left': '0px', }; for (var property in constraints) { var constraint = styles.getPropertyValue(property); if (constraint !== constraints[property]) { $media.style[property] = constraints[property]; } } }; /** * Calculate & set object-position * * @param {string} axis - either "x" or "y" * @param {node} $media - img or video element * @param {string} objectPosition - e.g. "50% 50%", "top left" */ var setPosition = function(axis, $media, objectPosition) { var position, other, start, end, side; objectPosition = objectPosition.split(' '); if (objectPosition.length < 2) { objectPosition[1] = objectPosition[0]; } /* istanbul ignore else */ if (axis === 'x') { position = objectPosition[0]; other = objectPosition[1]; start = 'left'; end = 'right'; side = $media.clientWidth; } else if (axis === 'y') { position = objectPosition[1]; other = objectPosition[0]; start = 'top'; end = 'bottom'; side = $media.clientHeight; } else { return; // Neither x or y axis specified } if (position === start || other === start) { $media.style[start] = '0'; return; } if (position === end || other === end) { $media.style[end] = '0'; return; } if (position === 'center' || position === '50%') { $media.style[start] = '50%'; $media.style['margin-' + start] = side / -2 + 'px'; return; } // Percentage values (e.g., 30% 10%) if (position.indexOf('%') >= 0) { position = parseInt(position, 10); if (position < 50) { $media.style[start] = position + '%'; $media.style['margin-' + start] = side * (position / -100) + 'px'; } else { position = 100 - position; $media.style[end] = position + '%'; $media.style['margin-' + end] = side * (position / -100) + 'px'; } return; } // Length-based values (e.g. 10px / 10em) else { $media.style[start] = position; } }; /** * Calculate & set object-fit * * @param {node} $media - img/video/picture element */ var objectFit = function($media) { // IE 10- data polyfill var fit = $media.dataset ? $media.dataset.objectFit : $media.getAttribute('data-object-fit'); var position = $media.dataset ? $media.dataset.objectPosition : $media.getAttribute('data-object-position'); // Default fallbacks fit = fit || 'cover'; position = position || '50% 50%'; // If necessary, make the parent container work with absolutely positioned elements var $container = $media.parentNode; checkParentContainer($container); // Check for any pre-set CSS which could mess up image calculations checkMediaProperties($media); // Reset any pre-set width/height CSS and handle fit positioning $media.style.position = 'absolute'; $media.style.width = 'auto'; $media.style.height = 'auto'; // `scale-down` chooses either `none` or `contain`, whichever is smaller if (fit === 'scale-down') { if ( $media.clientWidth < $container.clientWidth && $media.clientHeight < $container.clientHeight ) { fit = 'none'; } else { fit = 'contain'; } } // `none` (width/height auto) and `fill` (100%) and are straightforward if (fit === 'none') { setPosition('x', $media, position); setPosition('y', $media, position); return; } if (fit === 'fill') { $media.style.width = '100%'; $media.style.height = '100%'; setPosition('x', $media, position); setPosition('y', $media, position); return; } // `cover` and `contain` must figure out which side needs covering, and add CSS positioning & centering $media.style.height = '100%'; if ( (fit === 'cover' && $media.clientWidth > $container.clientWidth) || (fit === 'contain' && $media.clientWidth < $container.clientWidth) ) { $media.style.top = '0'; $media.style.marginTop = '0'; setPosition('x', $media, position); } else { $media.style.width = '100%'; $media.style.height = 'auto'; $media.style.left = '0'; $media.style.marginLeft = '0'; setPosition('y', $media, position); } }; /** * Initialize plugin * * @param {node} media - Optional specific DOM node(s) to be polyfilled */ var objectFitPolyfill = function(media) { if (typeof media === 'undefined' || media instanceof Event) { // If left blank, or a default event, all media on the page will be polyfilled. media = document.querySelectorAll('[data-object-fit]'); } else if (media && media.nodeName) { // If it's a single node, wrap it in an array so it works. media = [media]; } else if (typeof media === 'object' && media.length && media[0].nodeName) { // If it's an array of DOM nodes (e.g. a jQuery selector), it's fine as-is. media = media; } else { // Otherwise, if it's invalid or an incorrect type, return false to let people know. return false; } for (var i = 0; i < media.length; i++) { if (!media[i].nodeName) continue; var mediaType = media[i].nodeName.toLowerCase(); if (mediaType === 'img') { if (edgePartialSupport) continue; // Edge supports object-fit for images (but nothing else), so no need to polyfill if (media[i].complete) { objectFit(media[i]); } else { media[i].addEventListener('load', function() { objectFit(this); }); } } else if (mediaType === 'video') { if (media[i].readyState > 0) { objectFit(media[i]); } else { media[i].addEventListener('loadedmetadata', function() { objectFit(this); }); } } else { objectFit(media[i]); } } return true; }; if (document.readyState === 'loading') { // Loading hasn't finished yet document.addEventListener('DOMContentLoaded', objectFitPolyfill); } else { // `DOMContentLoaded` has already fired objectFitPolyfill(); } window.addEventListener('resize', objectFitPolyfill); window.objectFitPolyfill = objectFitPolyfill; })(); vendor/wp-polyfill-formdata.js 0000644 00000027142 15013651111 0012450 0 ustar 00 /* formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */ /* global FormData self Blob File */ /* eslint-disable no-inner-declarations */ if (typeof Blob !== 'undefined' && (typeof FormData === 'undefined' || !FormData.prototype.keys)) { const global = typeof globalThis === 'object' ? globalThis : typeof window === 'object' ? window : typeof self === 'object' ? self : this // keep a reference to native implementation const _FormData = global.FormData // To be monkey patched const _send = global.XMLHttpRequest && global.XMLHttpRequest.prototype.send const _fetch = global.Request && global.fetch const _sendBeacon = global.navigator && global.navigator.sendBeacon // Might be a worker thread... const _match = global.Element && global.Element.prototype // Unable to patch Request/Response constructor correctly #109 // only way is to use ES6 class extend // https://github.com/babel/babel/issues/1966 const stringTag = global.Symbol && Symbol.toStringTag // Add missing stringTags to blob and files if (stringTag) { if (!Blob.prototype[stringTag]) { Blob.prototype[stringTag] = 'Blob' } if ('File' in global && !File.prototype[stringTag]) { File.prototype[stringTag] = 'File' } } // Fix so you can construct your own File try { new File([], '') // eslint-disable-line } catch (a) { global.File = function File (b, d, c) { const blob = new Blob(b, c || {}) const t = c && void 0 !== c.lastModified ? new Date(c.lastModified) : new Date() Object.defineProperties(blob, { name: { value: d }, lastModified: { value: +t }, toString: { value () { return '[object File]' } } }) if (stringTag) { Object.defineProperty(blob, stringTag, { value: 'File' }) } return blob } } function ensureArgs (args, expected) { if (args.length < expected) { throw new TypeError(`${expected} argument required, but only ${args.length} present.`) } } /** * @param {string} name * @param {string | undefined} filename * @returns {[string, File|string]} */ function normalizeArgs (name, value, filename) { if (value instanceof Blob) { filename = filename !== undefined ? String(filename + '') : typeof value.name === 'string' ? value.name : 'blob' if (value.name !== filename || Object.prototype.toString.call(value) === '[object Blob]') { value = new File([value], filename) } return [String(name), value] } return [String(name), String(value)] } // normalize line feeds for textarea // https://html.spec.whatwg.org/multipage/form-elements.html#textarea-line-break-normalisation-transformation function normalizeLinefeeds (value) { return value.replace(/\r?\n|\r/g, '\r\n') } /** * @template T * @param {ArrayLike<T>} arr * @param {{ (elm: T): void; }} cb */ function each (arr, cb) { for (let i = 0; i < arr.length; i++) { cb(arr[i]) } } const escape = str => str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22') /** * @implements {Iterable} */ class FormDataPolyfill { /** * FormData class * * @param {HTMLFormElement=} form */ constructor (form) { /** @type {[string, string|File][]} */ this._data = [] const self = this form && each(form.elements, (/** @type {HTMLInputElement} */ elm) => { if ( !elm.name || elm.disabled || elm.type === 'submit' || elm.type === 'button' || elm.matches('form fieldset[disabled] *') ) return if (elm.type === 'file') { const files = elm.files && elm.files.length ? elm.files : [new File([], '', { type: 'application/octet-stream' })] // #78 each(files, file => { self.append(elm.name, file) }) } else if (elm.type === 'select-multiple' || elm.type === 'select-one') { each(elm.options, opt => { !opt.disabled && opt.selected && self.append(elm.name, opt.value) }) } else if (elm.type === 'checkbox' || elm.type === 'radio') { if (elm.checked) self.append(elm.name, elm.value) } else { const value = elm.type === 'textarea' ? normalizeLinefeeds(elm.value) : elm.value self.append(elm.name, value) } }) } /** * Append a field * * @param {string} name field name * @param {string|Blob|File} value string / blob / file * @param {string=} filename filename to use with blob * @return {undefined} */ append (name, value, filename) { ensureArgs(arguments, 2) this._data.push(normalizeArgs(name, value, filename)) } /** * Delete all fields values given name * * @param {string} name Field name * @return {undefined} */ delete (name) { ensureArgs(arguments, 1) const result = [] name = String(name) each(this._data, entry => { entry[0] !== name && result.push(entry) }) this._data = result } /** * Iterate over all fields as [name, value] * * @return {Iterator} */ * entries () { for (var i = 0; i < this._data.length; i++) { yield this._data[i] } } /** * Iterate over all fields * * @param {Function} callback Executed for each item with parameters (value, name, thisArg) * @param {Object=} thisArg `this` context for callback function */ forEach (callback, thisArg) { ensureArgs(arguments, 1) for (const [name, value] of this) { callback.call(thisArg, value, name, this) } } /** * Return first field value given name * or null if non existent * * @param {string} name Field name * @return {string|File|null} value Fields value */ get (name) { ensureArgs(arguments, 1) const entries = this._data name = String(name) for (let i = 0; i < entries.length; i++) { if (entries[i][0] === name) { return entries[i][1] } } return null } /** * Return all fields values given name * * @param {string} name Fields name * @return {Array} [{String|File}] */ getAll (name) { ensureArgs(arguments, 1) const result = [] name = String(name) each(this._data, data => { data[0] === name && result.push(data[1]) }) return result } /** * Check for field name existence * * @param {string} name Field name * @return {boolean} */ has (name) { ensureArgs(arguments, 1) name = String(name) for (let i = 0; i < this._data.length; i++) { if (this._data[i][0] === name) { return true } } return false } /** * Iterate over all fields name * * @return {Iterator} */ * keys () { for (const [name] of this) { yield name } } /** * Overwrite all values given name * * @param {string} name Filed name * @param {string} value Field value * @param {string=} filename Filename (optional) */ set (name, value, filename) { ensureArgs(arguments, 2) name = String(name) /** @type {[string, string|File][]} */ const result = [] const args = normalizeArgs(name, value, filename) let replace = true // - replace the first occurrence with same name // - discards the remaining with same name // - while keeping the same order items where added each(this._data, data => { data[0] === name ? replace && (replace = !result.push(args)) : result.push(data) }) replace && result.push(args) this._data = result } /** * Iterate over all fields * * @return {Iterator} */ * values () { for (const [, value] of this) { yield value } } /** * Return a native (perhaps degraded) FormData with only a `append` method * Can throw if it's not supported * * @return {FormData} */ ['_asNative'] () { const fd = new _FormData() for (const [name, value] of this) { fd.append(name, value) } return fd } /** * [_blob description] * * @return {Blob} [description] */ ['_blob'] () { const boundary = '----formdata-polyfill-' + Math.random(), chunks = [], p = `--${boundary}\r\nContent-Disposition: form-data; name="` this.forEach((value, name) => typeof value == 'string' ? chunks.push(p + escape(normalizeLinefeeds(name)) + `"\r\n\r\n${normalizeLinefeeds(value)}\r\n`) : chunks.push(p + escape(normalizeLinefeeds(name)) + `"; filename="${escape(value.name)}"\r\nContent-Type: ${value.type||"application/octet-stream"}\r\n\r\n`, value, `\r\n`)) chunks.push(`--${boundary}--`) return new Blob(chunks, { type: "multipart/form-data; boundary=" + boundary }) } /** * The class itself is iterable * alias for formdata.entries() * * @return {Iterator} */ [Symbol.iterator] () { return this.entries() } /** * Create the default string description. * * @return {string} [object FormData] */ toString () { return '[object FormData]' } } if (_match && !_match.matches) { _match.matches = _match.matchesSelector || _match.mozMatchesSelector || _match.msMatchesSelector || _match.oMatchesSelector || _match.webkitMatchesSelector || function (s) { var matches = (this.document || this.ownerDocument).querySelectorAll(s) var i = matches.length while (--i >= 0 && matches.item(i) !== this) {} return i > -1 } } if (stringTag) { /** * Create the default string description. * It is accessed internally by the Object.prototype.toString(). */ FormDataPolyfill.prototype[stringTag] = 'FormData' } // Patch xhr's send method to call _blob transparently if (_send) { const setRequestHeader = global.XMLHttpRequest.prototype.setRequestHeader global.XMLHttpRequest.prototype.setRequestHeader = function (name, value) { setRequestHeader.call(this, name, value) if (name.toLowerCase() === 'content-type') this._hasContentType = true } global.XMLHttpRequest.prototype.send = function (data) { // need to patch send b/c old IE don't send blob's type (#44) if (data instanceof FormDataPolyfill) { const blob = data['_blob']() if (!this._hasContentType) this.setRequestHeader('Content-Type', blob.type) _send.call(this, blob) } else { _send.call(this, data) } } } // Patch fetch's function to call _blob transparently if (_fetch) { global.fetch = function (input, init) { if (init && init.body && init.body instanceof FormDataPolyfill) { init.body = init.body['_blob']() } return _fetch.call(this, input, init) } } // Patch navigator.sendBeacon to use native FormData if (_sendBeacon) { global.navigator.sendBeacon = function (url, data) { if (data instanceof FormDataPolyfill) { data = data['_asNative']() } return _sendBeacon.call(this, url, data) } } global['FormData'] = FormDataPolyfill } vendor/wp-polyfill-dom-rect.js 0000644 00000003607 15013651111 0012365 0 ustar 00 // DOMRect (function (global) { function number(v) { return v === undefined ? 0 : Number(v); } function different(u, v) { return u !== v && !(isNaN(u) && isNaN(v)); } function DOMRect(xArg, yArg, wArg, hArg) { var x, y, width, height, left, right, top, bottom; x = number(xArg); y = number(yArg); width = number(wArg); height = number(hArg); Object.defineProperties(this, { x: { get: function () { return x; }, set: function (newX) { if (different(x, newX)) { x = newX; left = right = undefined; } }, enumerable: true }, y: { get: function () { return y; }, set: function (newY) { if (different(y, newY)) { y = newY; top = bottom = undefined; } }, enumerable: true }, width: { get: function () { return width; }, set: function (newWidth) { if (different(width, newWidth)) { width = newWidth; left = right = undefined; } }, enumerable: true }, height: { get: function () { return height; }, set: function (newHeight) { if (different(height, newHeight)) { height = newHeight; top = bottom = undefined; } }, enumerable: true }, left: { get: function () { if (left === undefined) { left = x + Math.min(0, width); } return left; }, enumerable: true }, right: { get: function () { if (right === undefined) { right = x + Math.max(0, width); } return right; }, enumerable: true }, top: { get: function () { if (top === undefined) { top = y + Math.min(0, height); } return top; }, enumerable: true }, bottom: { get: function () { if (bottom === undefined) { bottom = y + Math.max(0, height); } return bottom; }, enumerable: true } }); } global.DOMRect = DOMRect; }(self)); vendor/wp-polyfill-element-closest.js 0000644 00000000654 15013651111 0013755 0 ustar 00 !function(e){var t=e.Element.prototype;"function"!=typeof t.matches&&(t.matches=t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),o=0;t[o]&&t[o]!==this;)++o;return Boolean(t[o])}),"function"!=typeof t.closest&&(t.closest=function(e){for(var t=this;t&&1===t.nodeType;){if(t.matches(e))return t;t=t.parentNode}return null})}(window); vendor/wp-polyfill-url.min.js 0000644 00000133743 15013651111 0012244 0 ustar 00 !function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[o]={exports:{}};t[o][0].call(u.exports,(function(e){return i(t[o][1][e]||e)}),u,u.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){t.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},{}],2:[function(e,t,n){var r=e("../internals/is-object");t.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},{"../internals/is-object":37}],3:[function(e,t,n){var r=e("../internals/well-known-symbol"),i=e("../internals/object-create"),a=e("../internals/object-define-property"),o=r("unscopables"),s=Array.prototype;null==s[o]&&a.f(s,o,{configurable:!0,value:i(null)}),t.exports=function(e){s[o][e]=!0}},{"../internals/object-create":45,"../internals/object-define-property":47,"../internals/well-known-symbol":77}],4:[function(e,t,n){t.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},{}],5:[function(e,t,n){var r=e("../internals/is-object");t.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},{"../internals/is-object":37}],6:[function(e,t,n){"use strict";var r=e("../internals/function-bind-context"),i=e("../internals/to-object"),a=e("../internals/call-with-safe-iteration-closing"),o=e("../internals/is-array-iterator-method"),s=e("../internals/to-length"),l=e("../internals/create-property"),c=e("../internals/get-iterator-method");t.exports=function(e){var t,n,u,f,p,h,b=i(e),d="function"==typeof this?this:Array,y=arguments.length,g=y>1?arguments[1]:void 0,v=void 0!==g,m=c(b),w=0;if(v&&(g=r(g,y>2?arguments[2]:void 0,2)),null==m||d==Array&&o(m))for(n=new d(t=s(b.length));t>w;w++)h=v?g(b[w],w):b[w],l(n,w,h);else for(p=(f=m.call(b)).next,n=new d;!(u=p.call(f)).done;w++)h=v?a(f,g,[u.value,w],!0):u.value,l(n,w,h);return n.length=w,n}},{"../internals/call-with-safe-iteration-closing":8,"../internals/create-property":16,"../internals/function-bind-context":23,"../internals/get-iterator-method":25,"../internals/is-array-iterator-method":35,"../internals/to-length":71,"../internals/to-object":72}],7:[function(e,t,n){var r=e("../internals/to-indexed-object"),i=e("../internals/to-length"),a=e("../internals/to-absolute-index"),o=function(e){return function(t,n,o){var s,l=r(t),c=i(l.length),u=a(o,c);if(e&&n!=n){for(;c>u;)if((s=l[u++])!=s)return!0}else for(;c>u;u++)if((e||u in l)&&l[u]===n)return e||u||0;return!e&&-1}};t.exports={includes:o(!0),indexOf:o(!1)}},{"../internals/to-absolute-index":68,"../internals/to-indexed-object":69,"../internals/to-length":71}],8:[function(e,t,n){var r=e("../internals/an-object");t.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var a=e.return;throw void 0!==a&&r(a.call(e)),t}}},{"../internals/an-object":5}],9:[function(e,t,n){var r={}.toString;t.exports=function(e){return r.call(e).slice(8,-1)}},{}],10:[function(e,t,n){var r=e("../internals/to-string-tag-support"),i=e("../internals/classof-raw"),a=e("../internals/well-known-symbol")("toStringTag"),o="Arguments"==i(function(){return arguments}());t.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),a))?n:o?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r}},{"../internals/classof-raw":9,"../internals/to-string-tag-support":74,"../internals/well-known-symbol":77}],11:[function(e,t,n){var r=e("../internals/has"),i=e("../internals/own-keys"),a=e("../internals/object-get-own-property-descriptor"),o=e("../internals/object-define-property");t.exports=function(e,t){for(var n=i(t),s=o.f,l=a.f,c=0;c<n.length;c++){var u=n[c];r(e,u)||s(e,u,l(t,u))}}},{"../internals/has":28,"../internals/object-define-property":47,"../internals/object-get-own-property-descriptor":48,"../internals/own-keys":56}],12:[function(e,t,n){var r=e("../internals/fails");t.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},{"../internals/fails":22}],13:[function(e,t,n){"use strict";var r=e("../internals/iterators-core").IteratorPrototype,i=e("../internals/object-create"),a=e("../internals/create-property-descriptor"),o=e("../internals/set-to-string-tag"),s=e("../internals/iterators"),l=function(){return this};t.exports=function(e,t,n){var c=t+" Iterator";return e.prototype=i(r,{next:a(1,n)}),o(e,c,!1,!0),s[c]=l,e}},{"../internals/create-property-descriptor":15,"../internals/iterators":40,"../internals/iterators-core":39,"../internals/object-create":45,"../internals/set-to-string-tag":62}],14:[function(e,t,n){var r=e("../internals/descriptors"),i=e("../internals/object-define-property"),a=e("../internals/create-property-descriptor");t.exports=r?function(e,t,n){return i.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},{"../internals/create-property-descriptor":15,"../internals/descriptors":18,"../internals/object-define-property":47}],15:[function(e,t,n){t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},{}],16:[function(e,t,n){"use strict";var r=e("../internals/to-primitive"),i=e("../internals/object-define-property"),a=e("../internals/create-property-descriptor");t.exports=function(e,t,n){var o=r(t);o in e?i.f(e,o,a(0,n)):e[o]=n}},{"../internals/create-property-descriptor":15,"../internals/object-define-property":47,"../internals/to-primitive":73}],17:[function(e,t,n){"use strict";var r=e("../internals/export"),i=e("../internals/create-iterator-constructor"),a=e("../internals/object-get-prototype-of"),o=e("../internals/object-set-prototype-of"),s=e("../internals/set-to-string-tag"),l=e("../internals/create-non-enumerable-property"),c=e("../internals/redefine"),u=e("../internals/well-known-symbol"),f=e("../internals/is-pure"),p=e("../internals/iterators"),h=e("../internals/iterators-core"),b=h.IteratorPrototype,d=h.BUGGY_SAFARI_ITERATORS,y=u("iterator"),g=function(){return this};t.exports=function(e,t,n,u,h,v,m){i(n,t,u);var w,j,x,k=function(e){if(e===h&&L)return L;if(!d&&e in O)return O[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},S=t+" Iterator",A=!1,O=e.prototype,R=O[y]||O["@@iterator"]||h&&O[h],L=!d&&R||k(h),U="Array"==t&&O.entries||R;if(U&&(w=a(U.call(new e)),b!==Object.prototype&&w.next&&(f||a(w)===b||(o?o(w,b):"function"!=typeof w[y]&&l(w,y,g)),s(w,S,!0,!0),f&&(p[S]=g))),"values"==h&&R&&"values"!==R.name&&(A=!0,L=function(){return R.call(this)}),f&&!m||O[y]===L||l(O,y,L),p[t]=L,h)if(j={values:k("values"),keys:v?L:k("keys"),entries:k("entries")},m)for(x in j)!d&&!A&&x in O||c(O,x,j[x]);else r({target:t,proto:!0,forced:d||A},j);return j}},{"../internals/create-iterator-constructor":13,"../internals/create-non-enumerable-property":14,"../internals/export":21,"../internals/is-pure":38,"../internals/iterators":40,"../internals/iterators-core":39,"../internals/object-get-prototype-of":51,"../internals/object-set-prototype-of":55,"../internals/redefine":59,"../internals/set-to-string-tag":62,"../internals/well-known-symbol":77}],18:[function(e,t,n){var r=e("../internals/fails");t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},{"../internals/fails":22}],19:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/is-object"),a=r.document,o=i(a)&&i(a.createElement);t.exports=function(e){return o?a.createElement(e):{}}},{"../internals/global":27,"../internals/is-object":37}],20:[function(e,t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},{}],21:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/object-get-own-property-descriptor").f,a=e("../internals/create-non-enumerable-property"),o=e("../internals/redefine"),s=e("../internals/set-global"),l=e("../internals/copy-constructor-properties"),c=e("../internals/is-forced");t.exports=function(e,t){var n,u,f,p,h,b=e.target,d=e.global,y=e.stat;if(n=d?r:y?r[b]||s(b,{}):(r[b]||{}).prototype)for(u in t){if(p=t[u],f=e.noTargetGet?(h=i(n,u))&&h.value:n[u],!c(d?u:b+(y?".":"#")+u,e.forced)&&void 0!==f){if(typeof p==typeof f)continue;l(p,f)}(e.sham||f&&f.sham)&&a(p,"sham",!0),o(n,u,p,e)}}},{"../internals/copy-constructor-properties":11,"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/is-forced":36,"../internals/object-get-own-property-descriptor":48,"../internals/redefine":59,"../internals/set-global":61}],22:[function(e,t,n){t.exports=function(e){try{return!!e()}catch(e){return!0}}},{}],23:[function(e,t,n){var r=e("../internals/a-function");t.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},{"../internals/a-function":1}],24:[function(e,t,n){var r=e("../internals/path"),i=e("../internals/global"),a=function(e){return"function"==typeof e?e:void 0};t.exports=function(e,t){return arguments.length<2?a(r[e])||a(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]}},{"../internals/global":27,"../internals/path":57}],25:[function(e,t,n){var r=e("../internals/classof"),i=e("../internals/iterators"),a=e("../internals/well-known-symbol")("iterator");t.exports=function(e){if(null!=e)return e[a]||e["@@iterator"]||i[r(e)]}},{"../internals/classof":10,"../internals/iterators":40,"../internals/well-known-symbol":77}],26:[function(e,t,n){var r=e("../internals/an-object"),i=e("../internals/get-iterator-method");t.exports=function(e){var t=i(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return r(t.call(e))}},{"../internals/an-object":5,"../internals/get-iterator-method":25}],27:[function(e,t,n){(function(e){var n=function(e){return e&&e.Math==Math&&e};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")()}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(e,t,n){var r={}.hasOwnProperty;t.exports=function(e,t){return r.call(e,t)}},{}],29:[function(e,t,n){t.exports={}},{}],30:[function(e,t,n){var r=e("../internals/get-built-in");t.exports=r("document","documentElement")},{"../internals/get-built-in":24}],31:[function(e,t,n){var r=e("../internals/descriptors"),i=e("../internals/fails"),a=e("../internals/document-create-element");t.exports=!r&&!i((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},{"../internals/descriptors":18,"../internals/document-create-element":19,"../internals/fails":22}],32:[function(e,t,n){var r=e("../internals/fails"),i=e("../internals/classof-raw"),a="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==i(e)?a.call(e,""):Object(e)}:Object},{"../internals/classof-raw":9,"../internals/fails":22}],33:[function(e,t,n){var r=e("../internals/shared-store"),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return i.call(e)}),t.exports=r.inspectSource},{"../internals/shared-store":64}],34:[function(e,t,n){var r,i,a,o=e("../internals/native-weak-map"),s=e("../internals/global"),l=e("../internals/is-object"),c=e("../internals/create-non-enumerable-property"),u=e("../internals/has"),f=e("../internals/shared-key"),p=e("../internals/hidden-keys"),h=s.WeakMap;if(o){var b=new h,d=b.get,y=b.has,g=b.set;r=function(e,t){return g.call(b,e,t),t},i=function(e){return d.call(b,e)||{}},a=function(e){return y.call(b,e)}}else{var v=f("state");p[v]=!0,r=function(e,t){return c(e,v,t),t},i=function(e){return u(e,v)?e[v]:{}},a=function(e){return u(e,v)}}t.exports={set:r,get:i,has:a,enforce:function(e){return a(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!l(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},{"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/has":28,"../internals/hidden-keys":29,"../internals/is-object":37,"../internals/native-weak-map":43,"../internals/shared-key":63}],35:[function(e,t,n){var r=e("../internals/well-known-symbol"),i=e("../internals/iterators"),a=r("iterator"),o=Array.prototype;t.exports=function(e){return void 0!==e&&(i.Array===e||o[a]===e)}},{"../internals/iterators":40,"../internals/well-known-symbol":77}],36:[function(e,t,n){var r=e("../internals/fails"),i=/#|\.prototype\./,a=function(e,t){var n=s[o(e)];return n==c||n!=l&&("function"==typeof t?r(t):!!t)},o=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},s=a.data={},l=a.NATIVE="N",c=a.POLYFILL="P";t.exports=a},{"../internals/fails":22}],37:[function(e,t,n){t.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},{}],38:[function(e,t,n){t.exports=!1},{}],39:[function(e,t,n){"use strict";var r,i,a,o=e("../internals/object-get-prototype-of"),s=e("../internals/create-non-enumerable-property"),l=e("../internals/has"),c=e("../internals/well-known-symbol"),u=e("../internals/is-pure"),f=c("iterator"),p=!1;[].keys&&("next"in(a=[].keys())?(i=o(o(a)))!==Object.prototype&&(r=i):p=!0),null==r&&(r={}),u||l(r,f)||s(r,f,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},{"../internals/create-non-enumerable-property":14,"../internals/has":28,"../internals/is-pure":38,"../internals/object-get-prototype-of":51,"../internals/well-known-symbol":77}],40:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{dup:29}],41:[function(e,t,n){var r=e("../internals/fails");t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},{"../internals/fails":22}],42:[function(e,t,n){var r=e("../internals/fails"),i=e("../internals/well-known-symbol"),a=e("../internals/is-pure"),o=i("iterator");t.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),a&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[o]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},{"../internals/fails":22,"../internals/is-pure":38,"../internals/well-known-symbol":77}],43:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/inspect-source"),a=r.WeakMap;t.exports="function"==typeof a&&/native code/.test(i(a))},{"../internals/global":27,"../internals/inspect-source":33}],44:[function(e,t,n){"use strict";var r=e("../internals/descriptors"),i=e("../internals/fails"),a=e("../internals/object-keys"),o=e("../internals/object-get-own-property-symbols"),s=e("../internals/object-property-is-enumerable"),l=e("../internals/to-object"),c=e("../internals/indexed-object"),u=Object.assign,f=Object.defineProperty;t.exports=!u||i((function(){if(r&&1!==u({b:1},u(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=u({},e)[n]||"abcdefghijklmnopqrst"!=a(u({},t)).join("")}))?function(e,t){for(var n=l(e),i=arguments.length,u=1,f=o.f,p=s.f;i>u;)for(var h,b=c(arguments[u++]),d=f?a(b).concat(f(b)):a(b),y=d.length,g=0;y>g;)h=d[g++],r&&!p.call(b,h)||(n[h]=b[h]);return n}:u},{"../internals/descriptors":18,"../internals/fails":22,"../internals/indexed-object":32,"../internals/object-get-own-property-symbols":50,"../internals/object-keys":53,"../internals/object-property-is-enumerable":54,"../internals/to-object":72}],45:[function(e,t,n){var r,i=e("../internals/an-object"),a=e("../internals/object-define-properties"),o=e("../internals/enum-bug-keys"),s=e("../internals/hidden-keys"),l=e("../internals/html"),c=e("../internals/document-create-element"),u=e("../internals/shared-key")("IE_PROTO"),f=function(){},p=function(e){return"<script>"+e+"<\/script>"},h=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;h=r?function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):((t=c("iframe")).style.display="none",l.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F);for(var n=o.length;n--;)delete h.prototype[o[n]];return h()};s[u]=!0,t.exports=Object.create||function(e,t){var n;return null!==e?(f.prototype=i(e),n=new f,f.prototype=null,n[u]=e):n=h(),void 0===t?n:a(n,t)}},{"../internals/an-object":5,"../internals/document-create-element":19,"../internals/enum-bug-keys":20,"../internals/hidden-keys":29,"../internals/html":30,"../internals/object-define-properties":46,"../internals/shared-key":63}],46:[function(e,t,n){var r=e("../internals/descriptors"),i=e("../internals/object-define-property"),a=e("../internals/an-object"),o=e("../internals/object-keys");t.exports=r?Object.defineProperties:function(e,t){a(e);for(var n,r=o(t),s=r.length,l=0;s>l;)i.f(e,n=r[l++],t[n]);return e}},{"../internals/an-object":5,"../internals/descriptors":18,"../internals/object-define-property":47,"../internals/object-keys":53}],47:[function(e,t,n){var r=e("../internals/descriptors"),i=e("../internals/ie8-dom-define"),a=e("../internals/an-object"),o=e("../internals/to-primitive"),s=Object.defineProperty;n.f=r?s:function(e,t,n){if(a(e),t=o(t,!0),a(n),i)try{return s(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},{"../internals/an-object":5,"../internals/descriptors":18,"../internals/ie8-dom-define":31,"../internals/to-primitive":73}],48:[function(e,t,n){var r=e("../internals/descriptors"),i=e("../internals/object-property-is-enumerable"),a=e("../internals/create-property-descriptor"),o=e("../internals/to-indexed-object"),s=e("../internals/to-primitive"),l=e("../internals/has"),c=e("../internals/ie8-dom-define"),u=Object.getOwnPropertyDescriptor;n.f=r?u:function(e,t){if(e=o(e),t=s(t,!0),c)try{return u(e,t)}catch(e){}if(l(e,t))return a(!i.f.call(e,t),e[t])}},{"../internals/create-property-descriptor":15,"../internals/descriptors":18,"../internals/has":28,"../internals/ie8-dom-define":31,"../internals/object-property-is-enumerable":54,"../internals/to-indexed-object":69,"../internals/to-primitive":73}],49:[function(e,t,n){var r=e("../internals/object-keys-internal"),i=e("../internals/enum-bug-keys").concat("length","prototype");n.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},{"../internals/enum-bug-keys":20,"../internals/object-keys-internal":52}],50:[function(e,t,n){n.f=Object.getOwnPropertySymbols},{}],51:[function(e,t,n){var r=e("../internals/has"),i=e("../internals/to-object"),a=e("../internals/shared-key"),o=e("../internals/correct-prototype-getter"),s=a("IE_PROTO"),l=Object.prototype;t.exports=o?Object.getPrototypeOf:function(e){return e=i(e),r(e,s)?e[s]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?l:null}},{"../internals/correct-prototype-getter":12,"../internals/has":28,"../internals/shared-key":63,"../internals/to-object":72}],52:[function(e,t,n){var r=e("../internals/has"),i=e("../internals/to-indexed-object"),a=e("../internals/array-includes").indexOf,o=e("../internals/hidden-keys");t.exports=function(e,t){var n,s=i(e),l=0,c=[];for(n in s)!r(o,n)&&r(s,n)&&c.push(n);for(;t.length>l;)r(s,n=t[l++])&&(~a(c,n)||c.push(n));return c}},{"../internals/array-includes":7,"../internals/has":28,"../internals/hidden-keys":29,"../internals/to-indexed-object":69}],53:[function(e,t,n){var r=e("../internals/object-keys-internal"),i=e("../internals/enum-bug-keys");t.exports=Object.keys||function(e){return r(e,i)}},{"../internals/enum-bug-keys":20,"../internals/object-keys-internal":52}],54:[function(e,t,n){"use strict";var r={}.propertyIsEnumerable,i=Object.getOwnPropertyDescriptor,a=i&&!r.call({1:2},1);n.f=a?function(e){var t=i(this,e);return!!t&&t.enumerable}:r},{}],55:[function(e,t,n){var r=e("../internals/an-object"),i=e("../internals/a-possible-prototype");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,a){return r(n),i(a),t?e.call(n,a):n.__proto__=a,n}}():void 0)},{"../internals/a-possible-prototype":2,"../internals/an-object":5}],56:[function(e,t,n){var r=e("../internals/get-built-in"),i=e("../internals/object-get-own-property-names"),a=e("../internals/object-get-own-property-symbols"),o=e("../internals/an-object");t.exports=r("Reflect","ownKeys")||function(e){var t=i.f(o(e)),n=a.f;return n?t.concat(n(e)):t}},{"../internals/an-object":5,"../internals/get-built-in":24,"../internals/object-get-own-property-names":49,"../internals/object-get-own-property-symbols":50}],57:[function(e,t,n){var r=e("../internals/global");t.exports=r},{"../internals/global":27}],58:[function(e,t,n){var r=e("../internals/redefine");t.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},{"../internals/redefine":59}],59:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/create-non-enumerable-property"),a=e("../internals/has"),o=e("../internals/set-global"),s=e("../internals/inspect-source"),l=e("../internals/internal-state"),c=l.get,u=l.enforce,f=String(String).split("String");(t.exports=function(e,t,n,s){var l=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||a(n,"name")||i(n,"name",t),u(n).source=f.join("string"==typeof t?t:"")),e!==r?(l?!p&&e[t]&&(c=!0):delete e[t],c?e[t]=n:i(e,t,n)):c?e[t]=n:o(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&c(this).source||s(this)}))},{"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/has":28,"../internals/inspect-source":33,"../internals/internal-state":34,"../internals/set-global":61}],60:[function(e,t,n){t.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},{}],61:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/create-non-enumerable-property");t.exports=function(e,t){try{i(r,e,t)}catch(n){r[e]=t}return t}},{"../internals/create-non-enumerable-property":14,"../internals/global":27}],62:[function(e,t,n){var r=e("../internals/object-define-property").f,i=e("../internals/has"),a=e("../internals/well-known-symbol")("toStringTag");t.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,a)&&r(e,a,{configurable:!0,value:t})}},{"../internals/has":28,"../internals/object-define-property":47,"../internals/well-known-symbol":77}],63:[function(e,t,n){var r=e("../internals/shared"),i=e("../internals/uid"),a=r("keys");t.exports=function(e){return a[e]||(a[e]=i(e))}},{"../internals/shared":65,"../internals/uid":75}],64:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/set-global"),a=r["__core-js_shared__"]||i("__core-js_shared__",{});t.exports=a},{"../internals/global":27,"../internals/set-global":61}],65:[function(e,t,n){var r=e("../internals/is-pure"),i=e("../internals/shared-store");(t.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.4",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},{"../internals/is-pure":38,"../internals/shared-store":64}],66:[function(e,t,n){var r=e("../internals/to-integer"),i=e("../internals/require-object-coercible"),a=function(e){return function(t,n){var a,o,s=String(i(t)),l=r(n),c=s.length;return l<0||l>=c?e?"":void 0:(a=s.charCodeAt(l))<55296||a>56319||l+1===c||(o=s.charCodeAt(l+1))<56320||o>57343?e?s.charAt(l):a:e?s.slice(l,l+2):o-56320+(a-55296<<10)+65536}};t.exports={codeAt:a(!1),charAt:a(!0)}},{"../internals/require-object-coercible":60,"../internals/to-integer":70}],67:[function(e,t,n){"use strict";var r=/[^\0-\u007E]/,i=/[.\u3002\uFF0E\uFF61]/g,a="Overflow: input needs wider integers to process",o=Math.floor,s=String.fromCharCode,l=function(e){return e+22+75*(e<26)},c=function(e,t,n){var r=0;for(e=n?o(e/700):e>>1,e+=o(e/t);e>455;r+=36)e=o(e/35);return o(r+36*e/(e+38))},u=function(e){var t,n,r=[],i=(e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){var a=e.charCodeAt(n++);56320==(64512&a)?t.push(((1023&i)<<10)+(1023&a)+65536):(t.push(i),n--)}else t.push(i)}return t}(e)).length,u=128,f=0,p=72;for(t=0;t<e.length;t++)(n=e[t])<128&&r.push(s(n));var h=r.length,b=h;for(h&&r.push("-");b<i;){var d=2147483647;for(t=0;t<e.length;t++)(n=e[t])>=u&&n<d&&(d=n);var y=b+1;if(d-u>o((2147483647-f)/y))throw RangeError(a);for(f+=(d-u)*y,u=d,t=0;t<e.length;t++){if((n=e[t])<u&&++f>2147483647)throw RangeError(a);if(n==u){for(var g=f,v=36;;v+=36){var m=v<=p?1:v>=p+26?26:v-p;if(g<m)break;var w=g-m,j=36-m;r.push(s(l(m+w%j))),g=o(w/j)}r.push(s(l(g))),p=c(f,y,b==h),f=0,++b}}++f,++u}return r.join("")};t.exports=function(e){var t,n,a=[],o=e.toLowerCase().replace(i,".").split(".");for(t=0;t<o.length;t++)n=o[t],a.push(r.test(n)?"xn--"+u(n):n);return a.join(".")}},{}],68:[function(e,t,n){var r=e("../internals/to-integer"),i=Math.max,a=Math.min;t.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):a(n,t)}},{"../internals/to-integer":70}],69:[function(e,t,n){var r=e("../internals/indexed-object"),i=e("../internals/require-object-coercible");t.exports=function(e){return r(i(e))}},{"../internals/indexed-object":32,"../internals/require-object-coercible":60}],70:[function(e,t,n){var r=Math.ceil,i=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(e>0?i:r)(e)}},{}],71:[function(e,t,n){var r=e("../internals/to-integer"),i=Math.min;t.exports=function(e){return e>0?i(r(e),9007199254740991):0}},{"../internals/to-integer":70}],72:[function(e,t,n){var r=e("../internals/require-object-coercible");t.exports=function(e){return Object(r(e))}},{"../internals/require-object-coercible":60}],73:[function(e,t,n){var r=e("../internals/is-object");t.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},{"../internals/is-object":37}],74:[function(e,t,n){var r={};r[e("../internals/well-known-symbol")("toStringTag")]="z",t.exports="[object z]"===String(r)},{"../internals/well-known-symbol":77}],75:[function(e,t,n){var r=0,i=Math.random();t.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++r+i).toString(36)}},{}],76:[function(e,t,n){var r=e("../internals/native-symbol");t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},{"../internals/native-symbol":41}],77:[function(e,t,n){var r=e("../internals/global"),i=e("../internals/shared"),a=e("../internals/has"),o=e("../internals/uid"),s=e("../internals/native-symbol"),l=e("../internals/use-symbol-as-uid"),c=i("wks"),u=r.Symbol,f=l?u:u&&u.withoutSetter||o;t.exports=function(e){return a(c,e)||(s&&a(u,e)?c[e]=u[e]:c[e]=f("Symbol."+e)),c[e]}},{"../internals/global":27,"../internals/has":28,"../internals/native-symbol":41,"../internals/shared":65,"../internals/uid":75,"../internals/use-symbol-as-uid":76}],78:[function(e,t,n){"use strict";var r=e("../internals/to-indexed-object"),i=e("../internals/add-to-unscopables"),a=e("../internals/iterators"),o=e("../internals/internal-state"),s=e("../internals/define-iterator"),l=o.set,c=o.getterFor("Array Iterator");t.exports=s(Array,"Array",(function(e,t){l(this,{type:"Array Iterator",target:r(e),index:0,kind:t})}),(function(){var e=c(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),a.Arguments=a.Array,i("keys"),i("values"),i("entries")},{"../internals/add-to-unscopables":3,"../internals/define-iterator":17,"../internals/internal-state":34,"../internals/iterators":40,"../internals/to-indexed-object":69}],79:[function(e,t,n){"use strict";var r=e("../internals/string-multibyte").charAt,i=e("../internals/internal-state"),a=e("../internals/define-iterator"),o=i.set,s=i.getterFor("String Iterator");a(String,"String",(function(e){o(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=s(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=r(n,i),t.index+=e.length,{value:e,done:!1})}))},{"../internals/define-iterator":17,"../internals/internal-state":34,"../internals/string-multibyte":66}],80:[function(e,t,n){"use strict";e("../modules/es.array.iterator");var r=e("../internals/export"),i=e("../internals/get-built-in"),a=e("../internals/native-url"),o=e("../internals/redefine"),s=e("../internals/redefine-all"),l=e("../internals/set-to-string-tag"),c=e("../internals/create-iterator-constructor"),u=e("../internals/internal-state"),f=e("../internals/an-instance"),p=e("../internals/has"),h=e("../internals/function-bind-context"),b=e("../internals/classof"),d=e("../internals/an-object"),y=e("../internals/is-object"),g=e("../internals/object-create"),v=e("../internals/create-property-descriptor"),m=e("../internals/get-iterator"),w=e("../internals/get-iterator-method"),j=e("../internals/well-known-symbol"),x=i("fetch"),k=i("Headers"),S=j("iterator"),A=u.set,O=u.getterFor("URLSearchParams"),R=u.getterFor("URLSearchParamsIterator"),L=/\+/g,U=Array(4),P=function(e){return U[e-1]||(U[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},I=function(e){try{return decodeURIComponent(e)}catch(t){return e}},q=function(e){var t=e.replace(L," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(P(n--),I);return t}},E=/[!'()~]|%20/g,_={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},T=function(e){return _[e]},B=function(e){return encodeURIComponent(e).replace(E,T)},F=function(e,t){if(t)for(var n,r,i=t.split("&"),a=0;a<i.length;)(n=i[a++]).length&&(r=n.split("="),e.push({key:q(r.shift()),value:q(r.join("="))}))},C=function(e){this.entries.length=0,F(this.entries,e)},M=function(e,t){if(e<t)throw TypeError("Not enough arguments")},N=c((function(e,t){A(this,{type:"URLSearchParamsIterator",iterator:m(O(e).entries),kind:t})}),"Iterator",(function(){var e=R(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),D=function(){f(this,D,"URLSearchParams");var e,t,n,r,i,a,o,s,l,c=arguments.length>0?arguments[0]:void 0,u=[];if(A(this,{type:"URLSearchParams",entries:u,updateURL:function(){},updateSearchParams:C}),void 0!==c)if(y(c))if("function"==typeof(e=w(c)))for(n=(t=e.call(c)).next;!(r=n.call(t)).done;){if((o=(a=(i=m(d(r.value))).next).call(i)).done||(s=a.call(i)).done||!a.call(i).done)throw TypeError("Expected sequence with length 2");u.push({key:o.value+"",value:s.value+""})}else for(l in c)p(c,l)&&u.push({key:l,value:c[l]+""});else F(u,"string"==typeof c?"?"===c.charAt(0)?c.slice(1):c:c+"")},z=D.prototype;s(z,{append:function(e,t){M(arguments.length,2);var n=O(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){M(arguments.length,1);for(var t=O(this),n=t.entries,r=e+"",i=0;i<n.length;)n[i].key===r?n.splice(i,1):i++;t.updateURL()},get:function(e){M(arguments.length,1);for(var t=O(this).entries,n=e+"",r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){M(arguments.length,1);for(var t=O(this).entries,n=e+"",r=[],i=0;i<t.length;i++)t[i].key===n&&r.push(t[i].value);return r},has:function(e){M(arguments.length,1);for(var t=O(this).entries,n=e+"",r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){M(arguments.length,1);for(var n,r=O(this),i=r.entries,a=!1,o=e+"",s=t+"",l=0;l<i.length;l++)(n=i[l]).key===o&&(a?i.splice(l--,1):(a=!0,n.value=s));a||i.push({key:o,value:s}),r.updateURL()},sort:function(){var e,t,n,r=O(this),i=r.entries,a=i.slice();for(i.length=0,n=0;n<a.length;n++){for(e=a[n],t=0;t<n;t++)if(i[t].key>e.key){i.splice(t,0,e);break}t===n&&i.push(e)}r.updateURL()},forEach:function(e){for(var t,n=O(this).entries,r=h(e,arguments.length>1?arguments[1]:void 0,3),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new N(this,"keys")},values:function(){return new N(this,"values")},entries:function(){return new N(this,"entries")}},{enumerable:!0}),o(z,S,z.entries),o(z,"toString",(function(){for(var e,t=O(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(B(e.key)+"="+B(e.value));return n.join("&")}),{enumerable:!0}),l(D,"URLSearchParams"),r({global:!0,forced:!a},{URLSearchParams:D}),a||"function"!=typeof x||"function"!=typeof k||r({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,r,i=[e];return arguments.length>1&&(y(t=arguments[1])&&(n=t.body,"URLSearchParams"===b(n)&&((r=t.headers?new k(t.headers):new k).has("content-type")||r.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=g(t,{body:v(0,String(n)),headers:v(0,r)}))),i.push(t)),x.apply(this,i)}}),t.exports={URLSearchParams:D,getState:O}},{"../internals/an-instance":4,"../internals/an-object":5,"../internals/classof":10,"../internals/create-iterator-constructor":13,"../internals/create-property-descriptor":15,"../internals/export":21,"../internals/function-bind-context":23,"../internals/get-built-in":24,"../internals/get-iterator":26,"../internals/get-iterator-method":25,"../internals/has":28,"../internals/internal-state":34,"../internals/is-object":37,"../internals/native-url":42,"../internals/object-create":45,"../internals/redefine":59,"../internals/redefine-all":58,"../internals/set-to-string-tag":62,"../internals/well-known-symbol":77,"../modules/es.array.iterator":78}],81:[function(e,t,n){"use strict";e("../modules/es.string.iterator");var r,i=e("../internals/export"),a=e("../internals/descriptors"),o=e("../internals/native-url"),s=e("../internals/global"),l=e("../internals/object-define-properties"),c=e("../internals/redefine"),u=e("../internals/an-instance"),f=e("../internals/has"),p=e("../internals/object-assign"),h=e("../internals/array-from"),b=e("../internals/string-multibyte").codeAt,d=e("../internals/string-punycode-to-ascii"),y=e("../internals/set-to-string-tag"),g=e("../modules/web.url-search-params"),v=e("../internals/internal-state"),m=s.URL,w=g.URLSearchParams,j=g.getState,x=v.set,k=v.getterFor("URL"),S=Math.floor,A=Math.pow,O=/[A-Za-z]/,R=/[\d+\-.A-Za-z]/,L=/\d/,U=/^(0x|0X)/,P=/^[0-7]+$/,I=/^\d+$/,q=/^[\dA-Fa-f]+$/,E=/[\u0000\u0009\u000A\u000D #%/:?@[\\]]/,_=/[\u0000\u0009\u000A\u000D #/:?@[\\]]/,T=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,B=/[\u0009\u000A\u000D]/g,F=function(e,t){var n,r,i;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return"Invalid host";if(!(n=M(t.slice(1,-1))))return"Invalid host";e.host=n}else if(Y(e)){if(t=d(t),E.test(t))return"Invalid host";if(null===(n=C(t)))return"Invalid host";e.host=n}else{if(_.test(t))return"Invalid host";for(n="",r=h(t),i=0;i<r.length;i++)n+=$(r[i],D);e.host=n}},C=function(e){var t,n,r,i,a,o,s,l=e.split(".");if(l.length&&""==l[l.length-1]&&l.pop(),(t=l.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=l[r]))return e;if(a=10,i.length>1&&"0"==i.charAt(0)&&(a=U.test(i)?16:8,i=i.slice(8==a?1:2)),""===i)o=0;else{if(!(10==a?I:8==a?P:q).test(i))return e;o=parseInt(i,a)}n.push(o)}for(r=0;r<t;r++)if(o=n[r],r==t-1){if(o>=A(256,5-t))return null}else if(o>255)return null;for(s=n.pop(),r=0;r<n.length;r++)s+=n[r]*A(256,3-r);return s},M=function(e){var t,n,r,i,a,o,s,l=[0,0,0,0,0,0,0,0],c=0,u=null,f=0,p=function(){return e.charAt(f)};if(":"==p()){if(":"!=e.charAt(1))return;f+=2,u=++c}for(;p();){if(8==c)return;if(":"!=p()){for(t=n=0;n<4&&q.test(p());)t=16*t+parseInt(p(),16),f++,n++;if("."==p()){if(0==n)return;if(f-=n,c>6)return;for(r=0;p();){if(i=null,r>0){if(!("."==p()&&r<4))return;f++}if(!L.test(p()))return;for(;L.test(p());){if(a=parseInt(p(),10),null===i)i=a;else{if(0==i)return;i=10*i+a}if(i>255)return;f++}l[c]=256*l[c]+i,2!=++r&&4!=r||c++}if(4!=r)return;break}if(":"==p()){if(f++,!p())return}else if(p())return;l[c++]=t}else{if(null!==u)return;f++,u=++c}}if(null!==u)for(o=c-u,c=7;0!=c&&o>0;)s=l[c],l[c--]=l[u+o-1],l[u+--o]=s;else if(8!=c)return;return l},N=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=S(e/256);return t.join(".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,a=0;a<8;a++)0!==e[a]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=a),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},D={},z=p({},D,{" ":1,'"':1,"<":1,">":1,"`":1}),G=p({},z,{"#":1,"?":1,"{":1,"}":1}),W=p({},G,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),$=function(e,t){var n=b(e,0);return n>32&&n<127&&!f(t,e)?e:encodeURIComponent(e)},J={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Y=function(e){return f(J,e.scheme)},X=function(e){return""!=e.username||""!=e.password},Z=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},H=function(e,t){var n;return 2==e.length&&O.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},K=function(e){var t;return e.length>1&&H(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},V=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&H(t[0],!0)||t.pop()},Q=function(e){return"."===e||"%2e"===e.toLowerCase()},ee={},te={},ne={},re={},ie={},ae={},oe={},se={},le={},ce={},ue={},fe={},pe={},he={},be={},de={},ye={},ge={},ve={},me={},we={},je=function(e,t,n,i){var a,o,s,l,c,u=n||ee,p=0,b="",d=!1,y=!1,g=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(T,"")),t=t.replace(B,""),a=h(t);p<=a.length;){switch(o=a[p],u){case ee:if(!o||!O.test(o)){if(n)return"Invalid scheme";u=ne;continue}b+=o.toLowerCase(),u=te;break;case te:if(o&&(R.test(o)||"+"==o||"-"==o||"."==o))b+=o.toLowerCase();else{if(":"!=o){if(n)return"Invalid scheme";b="",u=ne,p=0;continue}if(n&&(Y(e)!=f(J,b)||"file"==b&&(X(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=b,n)return void(Y(e)&&J[e.scheme]==e.port&&(e.port=null));b="","file"==e.scheme?u=he:Y(e)&&i&&i.scheme==e.scheme?u=re:Y(e)?u=se:"/"==a[p+1]?(u=ie,p++):(e.cannotBeABaseURL=!0,e.path.push(""),u=ve)}break;case ne:if(!i||i.cannotBeABaseURL&&"#"!=o)return"Invalid scheme";if(i.cannotBeABaseURL&&"#"==o){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,u=we;break}u="file"==i.scheme?he:ae;continue;case re:if("/"!=o||"/"!=a[p+1]){u=ae;continue}u=le,p++;break;case ie:if("/"==o){u=ce;break}u=ge;continue;case ae:if(e.scheme=i.scheme,o==r)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==o||"\\"==o&&Y(e))u=oe;else if("?"==o)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",u=me;else{if("#"!=o){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),u=ge;continue}e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",u=we}break;case oe:if(!Y(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,u=ge;continue}u=ce}else u=le;break;case se:if(u=le,"/"!=o||"/"!=b.charAt(p+1))continue;p++;break;case le:if("/"!=o&&"\\"!=o){u=ce;continue}break;case ce:if("@"==o){d&&(b="%40"+b),d=!0,s=h(b);for(var v=0;v<s.length;v++){var m=s[v];if(":"!=m||g){var w=$(m,W);g?e.password+=w:e.username+=w}else g=!0}b=""}else if(o==r||"/"==o||"?"==o||"#"==o||"\\"==o&&Y(e)){if(d&&""==b)return"Invalid authority";p-=h(b).length+1,b="",u=ue}else b+=o;break;case ue:case fe:if(n&&"file"==e.scheme){u=de;continue}if(":"!=o||y){if(o==r||"/"==o||"?"==o||"#"==o||"\\"==o&&Y(e)){if(Y(e)&&""==b)return"Invalid host";if(n&&""==b&&(X(e)||null!==e.port))return;if(l=F(e,b))return l;if(b="",u=ye,n)return;continue}"["==o?y=!0:"]"==o&&(y=!1),b+=o}else{if(""==b)return"Invalid host";if(l=F(e,b))return l;if(b="",u=pe,n==fe)return}break;case pe:if(!L.test(o)){if(o==r||"/"==o||"?"==o||"#"==o||"\\"==o&&Y(e)||n){if(""!=b){var j=parseInt(b,10);if(j>65535)return"Invalid port";e.port=Y(e)&&j===J[e.scheme]?null:j,b=""}if(n)return;u=ye;continue}return"Invalid port"}b+=o;break;case he:if(e.scheme="file","/"==o||"\\"==o)u=be;else{if(!i||"file"!=i.scheme){u=ge;continue}if(o==r)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==o)e.host=i.host,e.path=i.path.slice(),e.query="",u=me;else{if("#"!=o){K(a.slice(p).join(""))||(e.host=i.host,e.path=i.path.slice(),V(e)),u=ge;continue}e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",u=we}}break;case be:if("/"==o||"\\"==o){u=de;break}i&&"file"==i.scheme&&!K(a.slice(p).join(""))&&(H(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),u=ge;continue;case de:if(o==r||"/"==o||"\\"==o||"?"==o||"#"==o){if(!n&&H(b))u=ge;else if(""==b){if(e.host="",n)return;u=ye}else{if(l=F(e,b))return l;if("localhost"==e.host&&(e.host=""),n)return;b="",u=ye}continue}b+=o;break;case ye:if(Y(e)){if(u=ge,"/"!=o&&"\\"!=o)continue}else if(n||"?"!=o)if(n||"#"!=o){if(o!=r&&(u=ge,"/"!=o))continue}else e.fragment="",u=we;else e.query="",u=me;break;case ge:if(o==r||"/"==o||"\\"==o&&Y(e)||!n&&("?"==o||"#"==o)){if(".."===(c=(c=b).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(V(e),"/"==o||"\\"==o&&Y(e)||e.path.push("")):Q(b)?"/"==o||"\\"==o&&Y(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&H(b)&&(e.host&&(e.host=""),b=b.charAt(0)+":"),e.path.push(b)),b="","file"==e.scheme&&(o==r||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",u=me):"#"==o&&(e.fragment="",u=we)}else b+=$(o,G);break;case ve:"?"==o?(e.query="",u=me):"#"==o?(e.fragment="",u=we):o!=r&&(e.path[0]+=$(o,D));break;case me:n||"#"!=o?o!=r&&("'"==o&&Y(e)?e.query+="%27":e.query+="#"==o?"%23":$(o,D)):(e.fragment="",u=we);break;case we:o!=r&&(e.fragment+=$(o,z))}p++}},xe=function(e){var t,n,r=u(this,xe,"URL"),i=arguments.length>1?arguments[1]:void 0,o=String(e),s=x(r,{type:"URL"});if(void 0!==i)if(i instanceof xe)t=k(i);else if(n=je(t={},String(i)))throw TypeError(n);if(n=je(s,o,null,t))throw TypeError(n);var l=s.searchParams=new w,c=j(l);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(l)||null},a||(r.href=Se.call(r),r.origin=Ae.call(r),r.protocol=Oe.call(r),r.username=Re.call(r),r.password=Le.call(r),r.host=Ue.call(r),r.hostname=Pe.call(r),r.port=Ie.call(r),r.pathname=qe.call(r),r.search=Ee.call(r),r.searchParams=_e.call(r),r.hash=Te.call(r))},ke=xe.prototype,Se=function(){var e=k(this),t=e.scheme,n=e.username,r=e.password,i=e.host,a=e.port,o=e.path,s=e.query,l=e.fragment,c=t+":";return null!==i?(c+="//",X(e)&&(c+=n+(r?":"+r:"")+"@"),c+=N(i),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?o[0]:o.length?"/"+o.join("/"):"",null!==s&&(c+="?"+s),null!==l&&(c+="#"+l),c},Ae=function(){var e=k(this),t=e.scheme,n=e.port;if("blob"==t)try{return new URL(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Y(e)?t+"://"+N(e.host)+(null!==n?":"+n:""):"null"},Oe=function(){return k(this).scheme+":"},Re=function(){return k(this).username},Le=function(){return k(this).password},Ue=function(){var e=k(this),t=e.host,n=e.port;return null===t?"":null===n?N(t):N(t)+":"+n},Pe=function(){var e=k(this).host;return null===e?"":N(e)},Ie=function(){var e=k(this).port;return null===e?"":String(e)},qe=function(){var e=k(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},Ee=function(){var e=k(this).query;return e?"?"+e:""},_e=function(){return k(this).searchParams},Te=function(){var e=k(this).fragment;return e?"#"+e:""},Be=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(a&&l(ke,{href:Be(Se,(function(e){var t=k(this),n=String(e),r=je(t,n);if(r)throw TypeError(r);j(t.searchParams).updateSearchParams(t.query)})),origin:Be(Ae),protocol:Be(Oe,(function(e){var t=k(this);je(t,String(e)+":",ee)})),username:Be(Re,(function(e){var t=k(this),n=h(String(e));if(!Z(t)){t.username="";for(var r=0;r<n.length;r++)t.username+=$(n[r],W)}})),password:Be(Le,(function(e){var t=k(this),n=h(String(e));if(!Z(t)){t.password="";for(var r=0;r<n.length;r++)t.password+=$(n[r],W)}})),host:Be(Ue,(function(e){var t=k(this);t.cannotBeABaseURL||je(t,String(e),ue)})),hostname:Be(Pe,(function(e){var t=k(this);t.cannotBeABaseURL||je(t,String(e),fe)})),port:Be(Ie,(function(e){var t=k(this);Z(t)||(""==(e=String(e))?t.port=null:je(t,e,pe))})),pathname:Be(qe,(function(e){var t=k(this);t.cannotBeABaseURL||(t.path=[],je(t,e+"",ye))})),search:Be(Ee,(function(e){var t=k(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",je(t,e,me)),j(t.searchParams).updateSearchParams(t.query)})),searchParams:Be(_e),hash:Be(Te,(function(e){var t=k(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",je(t,e,we)):t.fragment=null}))}),c(ke,"toJSON",(function(){return Se.call(this)}),{enumerable:!0}),c(ke,"toString",(function(){return Se.call(this)}),{enumerable:!0}),m){var Fe=m.createObjectURL,Ce=m.revokeObjectURL;Fe&&c(xe,"createObjectURL",(function(e){return Fe.apply(m,arguments)})),Ce&&c(xe,"revokeObjectURL",(function(e){return Ce.apply(m,arguments)}))}y(xe,"URL"),i({global:!0,forced:!o,sham:!a},{URL:xe})},{"../internals/an-instance":4,"../internals/array-from":6,"../internals/descriptors":18,"../internals/export":21,"../internals/global":27,"../internals/has":28,"../internals/internal-state":34,"../internals/native-url":42,"../internals/object-assign":44,"../internals/object-define-properties":46,"../internals/redefine":59,"../internals/set-to-string-tag":62,"../internals/string-multibyte":66,"../internals/string-punycode-to-ascii":67,"../modules/es.string.iterator":79,"../modules/web.url-search-params":80}],82:[function(e,t,n){"use strict";e("../internals/export")({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},{"../internals/export":21}],83:[function(e,t,n){e("../modules/web.url"),e("../modules/web.url.to-json"),e("../modules/web.url-search-params");var r=e("../internals/path");t.exports=r.URL},{"../internals/path":57,"../modules/web.url":81,"../modules/web.url-search-params":80,"../modules/web.url.to-json":82}]},{},[83]); vendor/moment.min.js 0000644 00000162674 15013651111 0010472 0 ustar 00 !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.moment=t()}(this,function(){"use strict";var H;function _(){return H.apply(null,arguments)}function y(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function F(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function c(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function L(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;for(var t in e)if(c(e,t))return;return 1}function g(e){return void 0===e}function w(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function V(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function G(e,t){for(var n=[],s=e.length,i=0;i<s;++i)n.push(t(e[i],i));return n}function E(e,t){for(var n in t)c(t,n)&&(e[n]=t[n]);return c(t,"toString")&&(e.toString=t.toString),c(t,"valueOf")&&(e.valueOf=t.valueOf),e}function l(e,t,n,s){return Wt(e,t,n,s,!0).utc()}function p(e){return null==e._pf&&(e._pf={empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}),e._pf}function A(e){var t,n,s=e._d&&!isNaN(e._d.getTime());return s&&(t=p(e),n=j.call(t.parsedDateParts,function(e){return null!=e}),s=t.overflow<0&&!t.empty&&!t.invalidEra&&!t.invalidMonth&&!t.invalidWeekday&&!t.weekdayMismatch&&!t.nullInput&&!t.invalidFormat&&!t.userInvalidated&&(!t.meridiem||(t.meridiem,n)),e._strict)&&(s=s&&0===t.charsLeftOver&&0===t.unusedTokens.length&&void 0===t.bigHour),null!=Object.isFrozen&&Object.isFrozen(e)?s:(e._isValid=s,e._isValid)}function I(e){var t=l(NaN);return null!=e?E(p(t),e):p(t).userInvalidated=!0,t}var j=Array.prototype.some||function(e){for(var t=Object(this),n=t.length>>>0,s=0;s<n;s++)if(s in t&&e.call(this,t[s],s,t))return!0;return!1},Z=_.momentProperties=[],z=!1;function q(e,t){var n,s,i,r=Z.length;if(g(t._isAMomentObject)||(e._isAMomentObject=t._isAMomentObject),g(t._i)||(e._i=t._i),g(t._f)||(e._f=t._f),g(t._l)||(e._l=t._l),g(t._strict)||(e._strict=t._strict),g(t._tzm)||(e._tzm=t._tzm),g(t._isUTC)||(e._isUTC=t._isUTC),g(t._offset)||(e._offset=t._offset),g(t._pf)||(e._pf=p(t)),g(t._locale)||(e._locale=t._locale),0<r)for(n=0;n<r;n++)g(i=t[s=Z[n]])||(e[s]=i);return e}function $(e){q(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===z&&(z=!0,_.updateOffset(this),z=!1)}function k(e){return e instanceof $||null!=e&&null!=e._isAMomentObject}function B(e){!1===_.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+e)}function e(r,a){var o=!0;return E(function(){if(null!=_.deprecationHandler&&_.deprecationHandler(null,r),o){for(var e,t,n=[],s=arguments.length,i=0;i<s;i++){if(e="","object"==typeof arguments[i]){for(t in e+="\n["+i+"] ",arguments[0])c(arguments[0],t)&&(e+=t+": "+arguments[0][t]+", ");e=e.slice(0,-2)}else e=arguments[i];n.push(e)}B(r+"\nArguments: "+Array.prototype.slice.call(n).join("")+"\n"+(new Error).stack),o=!1}return a.apply(this,arguments)},a)}var J={};function Q(e,t){null!=_.deprecationHandler&&_.deprecationHandler(e,t),J[e]||(B(t),J[e]=!0)}function a(e){return"undefined"!=typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}function X(e,t){var n,s=E({},e);for(n in t)c(t,n)&&(F(e[n])&&F(t[n])?(s[n]={},E(s[n],e[n]),E(s[n],t[n])):null!=t[n]?s[n]=t[n]:delete s[n]);for(n in e)c(e,n)&&!c(t,n)&&F(e[n])&&(s[n]=E({},s[n]));return s}function K(e){null!=e&&this.set(e)}_.suppressDeprecationWarnings=!1,_.deprecationHandler=null;var ee=Object.keys||function(e){var t,n=[];for(t in e)c(e,t)&&n.push(t);return n};function r(e,t,n){var s=""+Math.abs(e);return(0<=e?n?"+":"":"-")+Math.pow(10,Math.max(0,t-s.length)).toString().substr(1)+s}var te=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ne=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,se={},ie={};function s(e,t,n,s){var i="string"==typeof s?function(){return this[s]()}:s;e&&(ie[e]=i),t&&(ie[t[0]]=function(){return r(i.apply(this,arguments),t[1],t[2])}),n&&(ie[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function re(e,t){return e.isValid()?(t=ae(t,e.localeData()),se[t]=se[t]||function(s){for(var e,i=s.match(te),t=0,r=i.length;t<r;t++)ie[i[t]]?i[t]=ie[i[t]]:i[t]=(e=i[t]).match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"");return function(e){for(var t="",n=0;n<r;n++)t+=a(i[n])?i[n].call(e,s):i[n];return t}}(t),se[t](e)):e.localeData().invalidDate()}function ae(e,t){var n=5;function s(e){return t.longDateFormat(e)||e}for(ne.lastIndex=0;0<=n&&ne.test(e);)e=e.replace(ne,s),ne.lastIndex=0,--n;return e}var oe={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function o(e){return"string"==typeof e?oe[e]||oe[e.toLowerCase()]:void 0}function ue(e){var t,n,s={};for(n in e)c(e,n)&&(t=o(n))&&(s[t]=e[n]);return s}var le={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};var de=/\d/,t=/\d\d/,he=/\d{3}/,ce=/\d{4}/,fe=/[+-]?\d{6}/,n=/\d\d?/,me=/\d\d\d\d?/,_e=/\d\d\d\d\d\d?/,ye=/\d{1,3}/,ge=/\d{1,4}/,we=/[+-]?\d{1,6}/,pe=/\d+/,ke=/[+-]?\d+/,Me=/Z|[+-]\d\d:?\d\d/gi,ve=/Z|[+-]\d\d(?::?\d\d)?/gi,i=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,u=/^[1-9]\d?/,d=/^([1-9]\d|\d)/;function h(e,n,s){Ye[e]=a(n)?n:function(e,t){return e&&s?s:n}}function De(e,t){return c(Ye,e)?Ye[e](t._strict,t._locale):new RegExp(f(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,s,i){return t||n||s||i})))}function f(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function m(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function M(e){var e=+e,t=0;return t=0!=e&&isFinite(e)?m(e):t}var Ye={},Se={};function v(e,n){var t,s,i=n;for("string"==typeof e&&(e=[e]),w(n)&&(i=function(e,t){t[n]=M(e)}),s=e.length,t=0;t<s;t++)Se[e[t]]=i}function Oe(e,i){v(e,function(e,t,n,s){n._w=n._w||{},i(e,n._w,n,s)})}function be(e){return e%4==0&&e%100!=0||e%400==0}var D=0,Y=1,S=2,O=3,b=4,T=5,Te=6,xe=7,Ne=8;function We(e){return be(e)?366:365}s("Y",0,0,function(){var e=this.year();return e<=9999?r(e,4):"+"+e}),s(0,["YY",2],0,function(){return this.year()%100}),s(0,["YYYY",4],0,"year"),s(0,["YYYYY",5],0,"year"),s(0,["YYYYYY",6,!0],0,"year"),h("Y",ke),h("YY",n,t),h("YYYY",ge,ce),h("YYYYY",we,fe),h("YYYYYY",we,fe),v(["YYYYY","YYYYYY"],D),v("YYYY",function(e,t){t[D]=2===e.length?_.parseTwoDigitYear(e):M(e)}),v("YY",function(e,t){t[D]=_.parseTwoDigitYear(e)}),v("Y",function(e,t){t[D]=parseInt(e,10)}),_.parseTwoDigitYear=function(e){return M(e)+(68<M(e)?1900:2e3)};var x,Pe=Re("FullYear",!0);function Re(t,n){return function(e){return null!=e?(Ue(this,t,e),_.updateOffset(this,n),this):Ce(this,t)}}function Ce(e,t){if(!e.isValid())return NaN;var n=e._d,s=e._isUTC;switch(t){case"Milliseconds":return s?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return s?n.getUTCSeconds():n.getSeconds();case"Minutes":return s?n.getUTCMinutes():n.getMinutes();case"Hours":return s?n.getUTCHours():n.getHours();case"Date":return s?n.getUTCDate():n.getDate();case"Day":return s?n.getUTCDay():n.getDay();case"Month":return s?n.getUTCMonth():n.getMonth();case"FullYear":return s?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Ue(e,t,n){var s,i,r;if(e.isValid()&&!isNaN(n)){switch(s=e._d,i=e._isUTC,t){case"Milliseconds":return i?s.setUTCMilliseconds(n):s.setMilliseconds(n);case"Seconds":return i?s.setUTCSeconds(n):s.setSeconds(n);case"Minutes":return i?s.setUTCMinutes(n):s.setMinutes(n);case"Hours":return i?s.setUTCHours(n):s.setHours(n);case"Date":return i?s.setUTCDate(n):s.setDate(n);case"FullYear":break;default:return}t=n,r=e.month(),e=29!==(e=e.date())||1!==r||be(t)?e:28,i?s.setUTCFullYear(t,r,e):s.setFullYear(t,r,e)}}function He(e,t){var n;return isNaN(e)||isNaN(t)?NaN:(n=(t%(n=12)+n)%n,e+=(t-n)/12,1==n?be(e)?29:28:31-n%7%2)}x=Array.prototype.indexOf||function(e){for(var t=0;t<this.length;++t)if(this[t]===e)return t;return-1},s("M",["MM",2],"Mo",function(){return this.month()+1}),s("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)}),s("MMMM",0,0,function(e){return this.localeData().months(this,e)}),h("M",n,u),h("MM",n,t),h("MMM",function(e,t){return t.monthsShortRegex(e)}),h("MMMM",function(e,t){return t.monthsRegex(e)}),v(["M","MM"],function(e,t){t[Y]=M(e)-1}),v(["MMM","MMMM"],function(e,t,n,s){s=n._locale.monthsParse(e,s,n._strict);null!=s?t[Y]=s:p(n).invalidMonth=e});var Fe="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Le="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ve=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,Ge=i,Ee=i;function Ae(e,t){if(e.isValid()){if("string"==typeof t)if(/^\d+$/.test(t))t=M(t);else if(!w(t=e.localeData().monthsParse(t)))return;var n=(n=e.date())<29?n:Math.min(n,He(e.year(),t));e._isUTC?e._d.setUTCMonth(t,n):e._d.setMonth(t,n)}}function Ie(e){return null!=e?(Ae(this,e),_.updateOffset(this,!0),this):Ce(this,"Month")}function je(){function e(e,t){return t.length-e.length}for(var t,n,s=[],i=[],r=[],a=0;a<12;a++)n=l([2e3,a]),t=f(this.monthsShort(n,"")),n=f(this.months(n,"")),s.push(t),i.push(n),r.push(n),r.push(t);s.sort(e),i.sort(e),r.sort(e),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Ze(e,t,n,s,i,r,a){var o;return e<100&&0<=e?(o=new Date(e+400,t,n,s,i,r,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,s,i,r,a),o}function ze(e){var t;return e<100&&0<=e?((t=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,t)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function qe(e,t,n){n=7+t-n;return n-(7+ze(e,0,n).getUTCDay()-t)%7-1}function $e(e,t,n,s,i){var r,t=1+7*(t-1)+(7+n-s)%7+qe(e,s,i),n=t<=0?We(r=e-1)+t:t>We(e)?(r=e+1,t-We(e)):(r=e,t);return{year:r,dayOfYear:n}}function Be(e,t,n){var s,i,r=qe(e.year(),t,n),r=Math.floor((e.dayOfYear()-r-1)/7)+1;return r<1?s=r+N(i=e.year()-1,t,n):r>N(e.year(),t,n)?(s=r-N(e.year(),t,n),i=e.year()+1):(i=e.year(),s=r),{week:s,year:i}}function N(e,t,n){var s=qe(e,t,n),t=qe(e+1,t,n);return(We(e)-s+t)/7}s("w",["ww",2],"wo","week"),s("W",["WW",2],"Wo","isoWeek"),h("w",n,u),h("ww",n,t),h("W",n,u),h("WW",n,t),Oe(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=M(e)});function Je(e,t){return e.slice(t,7).concat(e.slice(0,t))}s("d",0,"do","day"),s("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),s("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),s("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),s("e",0,0,"weekday"),s("E",0,0,"isoWeekday"),h("d",n),h("e",n),h("E",n),h("dd",function(e,t){return t.weekdaysMinRegex(e)}),h("ddd",function(e,t){return t.weekdaysShortRegex(e)}),h("dddd",function(e,t){return t.weekdaysRegex(e)}),Oe(["dd","ddd","dddd"],function(e,t,n,s){s=n._locale.weekdaysParse(e,s,n._strict);null!=s?t.d=s:p(n).invalidWeekday=e}),Oe(["d","e","E"],function(e,t,n,s){t[s]=M(e)});var Qe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Xe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ke="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),et=i,tt=i,nt=i;function st(){function e(e,t){return t.length-e.length}for(var t,n,s,i=[],r=[],a=[],o=[],u=0;u<7;u++)s=l([2e3,1]).day(u),t=f(this.weekdaysMin(s,"")),n=f(this.weekdaysShort(s,"")),s=f(this.weekdays(s,"")),i.push(t),r.push(n),a.push(s),o.push(t),o.push(n),o.push(s);i.sort(e),r.sort(e),a.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function it(){return this.hours()%12||12}function rt(e,t){s(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function at(e,t){return t._meridiemParse}s("H",["HH",2],0,"hour"),s("h",["hh",2],0,it),s("k",["kk",2],0,function(){return this.hours()||24}),s("hmm",0,0,function(){return""+it.apply(this)+r(this.minutes(),2)}),s("hmmss",0,0,function(){return""+it.apply(this)+r(this.minutes(),2)+r(this.seconds(),2)}),s("Hmm",0,0,function(){return""+this.hours()+r(this.minutes(),2)}),s("Hmmss",0,0,function(){return""+this.hours()+r(this.minutes(),2)+r(this.seconds(),2)}),rt("a",!0),rt("A",!1),h("a",at),h("A",at),h("H",n,d),h("h",n,u),h("k",n,u),h("HH",n,t),h("hh",n,t),h("kk",n,t),h("hmm",me),h("hmmss",_e),h("Hmm",me),h("Hmmss",_e),v(["H","HH"],O),v(["k","kk"],function(e,t,n){e=M(e);t[O]=24===e?0:e}),v(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),v(["h","hh"],function(e,t,n){t[O]=M(e),p(n).bigHour=!0}),v("hmm",function(e,t,n){var s=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s)),p(n).bigHour=!0}),v("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s,2)),t[T]=M(e.substr(i)),p(n).bigHour=!0}),v("Hmm",function(e,t,n){var s=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s))}),v("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[O]=M(e.substr(0,s)),t[b]=M(e.substr(s,2)),t[T]=M(e.substr(i))});i=Re("Hours",!0);var ot,ut={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Fe,monthsShort:Le,week:{dow:0,doy:6},weekdays:Qe,weekdaysMin:Ke,weekdaysShort:Xe,meridiemParse:/[ap]\.?m?\.?/i},W={},lt={};function dt(e){return e&&e.toLowerCase().replace("_","-")}function ht(e){for(var t,n,s,i,r=0;r<e.length;){for(t=(i=dt(e[r]).split("-")).length,n=(n=dt(e[r+1]))?n.split("-"):null;0<t;){if(s=ct(i.slice(0,t).join("-")))return s;if(n&&n.length>=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s<n;s+=1)if(e[s]!==t[s])return s;return n}(i,n)>=t-1)break;t--}r++}return ot}function ct(t){var e,n;if(void 0===W[t]&&"undefined"!=typeof module&&module&&module.exports&&(n=t)&&n.match("^[^/\\\\]*$"))try{e=ot._abbr,require("./locale/"+t),ft(e)}catch(e){W[t]=null}return W[t]}function ft(e,t){return e&&((t=g(t)?P(e):mt(e,t))?ot=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),ot._abbr}function mt(e,t){if(null===t)return delete W[e],null;var n,s=ut;if(t.abbr=e,null!=W[e])Q("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=W[e]._config;else if(null!=t.parentLocale)if(null!=W[t.parentLocale])s=W[t.parentLocale]._config;else{if(null==(n=ct(t.parentLocale)))return lt[t.parentLocale]||(lt[t.parentLocale]=[]),lt[t.parentLocale].push({name:e,config:t}),null;s=n._config}return W[e]=new K(X(s,t)),lt[e]&<[e].forEach(function(e){mt(e.name,e.config)}),ft(e),W[e]}function P(e){var t;if(!(e=e&&e._locale&&e._locale._abbr?e._locale._abbr:e))return ot;if(!y(e)){if(t=ct(e))return t;e=[e]}return ht(e)}function _t(e){var t=e._a;return t&&-2===p(e).overflow&&(t=t[Y]<0||11<t[Y]?Y:t[S]<1||t[S]>He(t[D],t[Y])?S:t[O]<0||24<t[O]||24===t[O]&&(0!==t[b]||0!==t[T]||0!==t[Te])?O:t[b]<0||59<t[b]?b:t[T]<0||59<t[T]?T:t[Te]<0||999<t[Te]?Te:-1,p(e)._overflowDayOfYear&&(t<D||S<t)&&(t=S),p(e)._overflowWeeks&&-1===t&&(t=xe),p(e)._overflowWeekday&&-1===t&&(t=Ne),p(e).overflow=t),e}var yt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wt=/Z|[+-]\d\d(?::?\d\d)?/,pt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],kt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Mt=/^\/?Date\((-?\d+)/i,vt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Yt(e){var t,n,s,i,r,a,o=e._i,u=yt.exec(o)||gt.exec(o),o=pt.length,l=kt.length;if(u){for(p(e).iso=!0,t=0,n=o;t<n;t++)if(pt[t][1].exec(u[1])){i=pt[t][0],s=!1!==pt[t][2];break}if(null==i)e._isValid=!1;else{if(u[3]){for(t=0,n=l;t<n;t++)if(kt[t][1].exec(u[3])){r=(u[2]||" ")+kt[t][0];break}if(null==r)return void(e._isValid=!1)}if(s||null==r){if(u[4]){if(!wt.exec(u[4]))return void(e._isValid=!1);a="Z"}e._f=i+(r||"")+(a||""),xt(e)}else e._isValid=!1}}else e._isValid=!1}function St(e,t,n,s,i,r){e=[function(e){e=parseInt(e,10);{if(e<=49)return 2e3+e;if(e<=999)return 1900+e}return e}(e),Le.indexOf(t),parseInt(n,10),parseInt(s,10),parseInt(i,10)];return r&&e.push(parseInt(r,10)),e}function Ot(e){var t,n,s=vt.exec(e._i.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,""));s?(t=St(s[4],s[3],s[2],s[5],s[6],s[7]),function(e,t,n){if(!e||Xe.indexOf(e)===new Date(t[0],t[1],t[2]).getDay())return 1;p(n).weekdayMismatch=!0,n._isValid=!1}(s[1],t,e)&&(e._a=t,e._tzm=(t=s[8],n=s[9],s=s[10],t?Dt[t]:n?0:60*(((t=parseInt(s,10))-(n=t%100))/100)+n),e._d=ze.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),p(e).rfc2822=!0)):e._isValid=!1}function bt(e,t,n){return null!=e?e:null!=t?t:n}function Tt(e){var t,n,s,i,r,a,o,u,l,d,h,c=[];if(!e._d){for(s=e,i=new Date(_.now()),n=s._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()],e._w&&null==e._a[S]&&null==e._a[Y]&&(null!=(i=(s=e)._w).GG||null!=i.W||null!=i.E?(u=1,l=4,r=bt(i.GG,s._a[D],Be(R(),1,4).year),a=bt(i.W,1),((o=bt(i.E,1))<1||7<o)&&(d=!0)):(u=s._locale._week.dow,l=s._locale._week.doy,h=Be(R(),u,l),r=bt(i.gg,s._a[D],h.year),a=bt(i.w,h.week),null!=i.d?((o=i.d)<0||6<o)&&(d=!0):null!=i.e?(o=i.e+u,(i.e<0||6<i.e)&&(d=!0)):o=u),a<1||a>N(r,u,l)?p(s)._overflowWeeks=!0:null!=d?p(s)._overflowWeekday=!0:(h=$e(r,a,o,u,l),s._a[D]=h.year,s._dayOfYear=h.dayOfYear)),null!=e._dayOfYear&&(i=bt(e._a[D],n[D]),(e._dayOfYear>We(i)||0===e._dayOfYear)&&(p(e)._overflowDayOfYear=!0),d=ze(i,0,e._dayOfYear),e._a[Y]=d.getUTCMonth(),e._a[S]=d.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=c[t]=n[t];for(;t<7;t++)e._a[t]=c[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[O]&&0===e._a[b]&&0===e._a[T]&&0===e._a[Te]&&(e._nextDay=!0,e._a[O]=0),e._d=(e._useUTC?ze:Ze).apply(null,c),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[O]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(p(e).weekdayMismatch=!0)}}function xt(e){if(e._f===_.ISO_8601)Yt(e);else if(e._f===_.RFC_2822)Ot(e);else{e._a=[],p(e).empty=!0;for(var t,n,s,i,r,a=""+e._i,o=a.length,u=0,l=ae(e._f,e._locale).match(te)||[],d=l.length,h=0;h<d;h++)n=l[h],(t=(a.match(De(n,e))||[])[0])&&(0<(s=a.substr(0,a.indexOf(t))).length&&p(e).unusedInput.push(s),a=a.slice(a.indexOf(t)+t.length),u+=t.length),ie[n]?(t?p(e).empty=!1:p(e).unusedTokens.push(n),s=n,r=e,null!=(i=t)&&c(Se,s)&&Se[s](i,r._a,r,s)):e._strict&&!t&&p(e).unusedTokens.push(n);p(e).charsLeftOver=o-u,0<a.length&&p(e).unusedInput.push(a),e._a[O]<=12&&!0===p(e).bigHour&&0<e._a[O]&&(p(e).bigHour=void 0),p(e).parsedDateParts=e._a.slice(0),p(e).meridiem=e._meridiem,e._a[O]=function(e,t,n){if(null==n)return t;return null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((e=e.isPM(n))&&t<12&&(t+=12),t=e||12!==t?t:0):t}(e._locale,e._a[O],e._meridiem),null!==(o=p(e).era)&&(e._a[D]=e._locale.erasConvertYear(o,e._a[D])),Tt(e),_t(e)}}function Nt(e){var t,n,s,i=e._i,r=e._f;if(e._locale=e._locale||P(e._l),null===i||void 0===r&&""===i)return I({nullInput:!0});if("string"==typeof i&&(e._i=i=e._locale.preparse(i)),k(i))return new $(_t(i));if(V(i))e._d=i;else if(y(r)){var a,o,u,l,d,h,c=e,f=!1,m=c._f.length;if(0===m)p(c).invalidFormat=!0,c._d=new Date(NaN);else{for(l=0;l<m;l++)d=0,h=!1,a=q({},c),null!=c._useUTC&&(a._useUTC=c._useUTC),a._f=c._f[l],xt(a),A(a)&&(h=!0),d=(d+=p(a).charsLeftOver)+10*p(a).unusedTokens.length,p(a).score=d,f?d<u&&(u=d,o=a):(null==u||d<u||h)&&(u=d,o=a,h)&&(f=!0);E(c,o||a)}}else if(r)xt(e);else if(g(r=(i=e)._i))i._d=new Date(_.now());else V(r)?i._d=new Date(r.valueOf()):"string"==typeof r?(n=i,null!==(t=Mt.exec(n._i))?n._d=new Date(+t[1]):(Yt(n),!1===n._isValid&&(delete n._isValid,Ot(n),!1===n._isValid)&&(delete n._isValid,n._strict?n._isValid=!1:_.createFromInputFallback(n)))):y(r)?(i._a=G(r.slice(0),function(e){return parseInt(e,10)}),Tt(i)):F(r)?(t=i)._d||(s=void 0===(n=ue(t._i)).day?n.date:n.day,t._a=G([n.year,n.month,s,n.hour,n.minute,n.second,n.millisecond],function(e){return e&&parseInt(e,10)}),Tt(t)):w(r)?i._d=new Date(r):_.createFromInputFallback(i);return A(e)||(e._d=null),e}function Wt(e,t,n,s,i){var r={};return!0!==t&&!1!==t||(s=t,t=void 0),!0!==n&&!1!==n||(s=n,n=void 0),(F(e)&&L(e)||y(e)&&0===e.length)&&(e=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=n,r._i=e,r._f=t,r._strict=s,(i=new $(_t(Nt(i=r))))._nextDay&&(i.add(1,"d"),i._nextDay=void 0),i}function R(e,t,n,s){return Wt(e,t,n,s,!1)}_.createFromInputFallback=e("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))}),_.ISO_8601=function(){},_.RFC_2822=function(){};me=e("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=R.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:I()}),_e=e("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=R.apply(null,arguments);return this.isValid()&&e.isValid()?this<e?this:e:I()});function Pt(e,t){var n,s;if(!(t=1===t.length&&y(t[0])?t[0]:t).length)return R();for(n=t[0],s=1;s<t.length;++s)t[s].isValid()&&!t[s][e](n)||(n=t[s]);return n}var Rt=["year","quarter","month","week","day","hour","minute","second","millisecond"];function Ct(e){var e=ue(e),t=e.year||0,n=e.quarter||0,s=e.month||0,i=e.week||e.isoWeek||0,r=e.day||0,a=e.hour||0,o=e.minute||0,u=e.second||0,l=e.millisecond||0;this._isValid=function(e){var t,n,s=!1,i=Rt.length;for(t in e)if(c(e,t)&&(-1===x.call(Rt,t)||null!=e[t]&&isNaN(e[t])))return!1;for(n=0;n<i;++n)if(e[Rt[n]]){if(s)return!1;parseFloat(e[Rt[n]])!==M(e[Rt[n]])&&(s=!0)}return!0}(e),this._milliseconds=+l+1e3*u+6e4*o+1e3*a*60*60,this._days=+r+7*i,this._months=+s+3*n+12*t,this._data={},this._locale=P(),this._bubble()}function Ut(e){return e instanceof Ct}function Ht(e){return e<0?-1*Math.round(-1*e):Math.round(e)}function Ft(e,n){s(e,0,0,function(){var e=this.utcOffset(),t="+";return e<0&&(e=-e,t="-"),t+r(~~(e/60),2)+n+r(~~e%60,2)})}Ft("Z",":"),Ft("ZZ",""),h("Z",ve),h("ZZ",ve),v(["Z","ZZ"],function(e,t,n){n._useUTC=!0,n._tzm=Vt(ve,e)});var Lt=/([\+\-]|\d\d)/gi;function Vt(e,t){var t=(t||"").match(e);return null===t?null:0===(t=60*(e=((t[t.length-1]||[])+"").match(Lt)||["-",0,0])[1]+M(e[2]))?0:"+"===e[0]?t:-t}function Gt(e,t){var n;return t._isUTC?(t=t.clone(),n=(k(e)||V(e)?e:R(e)).valueOf()-t.valueOf(),t._d.setTime(t._d.valueOf()+n),_.updateOffset(t,!1),t):R(e).local()}function Et(e){return-Math.round(e._d.getTimezoneOffset())}function At(){return!!this.isValid()&&this._isUTC&&0===this._offset}_.updateOffset=function(){};var It=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,jt=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function C(e,t){var n,s=e;return Ut(e)?s={ms:e._milliseconds,d:e._days,M:e._months}:w(e)||!isNaN(+e)?(s={},t?s[t]=+e:s.milliseconds=+e):(t=It.exec(e))?(n="-"===t[1]?-1:1,s={y:0,d:M(t[S])*n,h:M(t[O])*n,m:M(t[b])*n,s:M(t[T])*n,ms:M(Ht(1e3*t[Te]))*n}):(t=jt.exec(e))?(n="-"===t[1]?-1:1,s={y:Zt(t[2],n),M:Zt(t[3],n),w:Zt(t[4],n),d:Zt(t[5],n),h:Zt(t[6],n),m:Zt(t[7],n),s:Zt(t[8],n)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(t=function(e,t){var n;if(!e.isValid()||!t.isValid())return{milliseconds:0,months:0};t=Gt(t,e),e.isBefore(t)?n=zt(e,t):((n=zt(t,e)).milliseconds=-n.milliseconds,n.months=-n.months);return n}(R(s.from),R(s.to)),(s={}).ms=t.milliseconds,s.M=t.months),n=new Ct(s),Ut(e)&&c(e,"_locale")&&(n._locale=e._locale),Ut(e)&&c(e,"_isValid")&&(n._isValid=e._isValid),n}function Zt(e,t){e=e&&parseFloat(e.replace(",","."));return(isNaN(e)?0:e)*t}function zt(e,t){var n={};return n.months=t.month()-e.month()+12*(t.year()-e.year()),e.clone().add(n.months,"M").isAfter(t)&&--n.months,n.milliseconds=+t-+e.clone().add(n.months,"M"),n}function qt(s,i){return function(e,t){var n;return null===t||isNaN(+t)||(Q(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),n=e,e=t,t=n),$t(this,C(e,t),s),this}}function $t(e,t,n,s){var i=t._milliseconds,r=Ht(t._days),t=Ht(t._months);e.isValid()&&(s=null==s||s,t&&Ae(e,Ce(e,"Month")+t*n),r&&Ue(e,"Date",Ce(e,"Date")+r*n),i&&e._d.setTime(e._d.valueOf()+i*n),s)&&_.updateOffset(e,r||t)}C.fn=Ct.prototype,C.invalid=function(){return C(NaN)};Fe=qt(1,"add"),Qe=qt(-1,"subtract");function Bt(e){return"string"==typeof e||e instanceof String}function Jt(e){return k(e)||V(e)||Bt(e)||w(e)||function(t){var e=y(t),n=!1;e&&(n=0===t.filter(function(e){return!w(e)&&Bt(t)}).length);return e&&n}(e)||function(e){var t,n,s=F(e)&&!L(e),i=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],a=r.length;for(t=0;t<a;t+=1)n=r[t],i=i||c(e,n);return s&&i}(e)||null==e}function Qt(e,t){var n,s;return e.date()<t.date()?-Qt(t,e):-((n=12*(t.year()-e.year())+(t.month()-e.month()))+(t-(s=e.clone().add(n,"months"))<0?(t-s)/(s-e.clone().add(n-1,"months")):(t-s)/(e.clone().add(1+n,"months")-s)))||0}function Xt(e){return void 0===e?this._locale._abbr:(null!=(e=P(e))&&(this._locale=e),this)}_.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",_.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";Ke=e("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return void 0===e?this.localeData():this.locale(e)});function Kt(){return this._locale}var en=126227808e5;function tn(e,t){return(e%t+t)%t}function nn(e,t,n){return e<100&&0<=e?new Date(e+400,t,n)-en:new Date(e,t,n).valueOf()}function sn(e,t,n){return e<100&&0<=e?Date.UTC(e+400,t,n)-en:Date.UTC(e,t,n)}function rn(e,t){return t.erasAbbrRegex(e)}function an(){for(var e,t,n,s=[],i=[],r=[],a=[],o=this.eras(),u=0,l=o.length;u<l;++u)e=f(o[u].name),t=f(o[u].abbr),n=f(o[u].narrow),i.push(e),s.push(t),r.push(n),a.push(e),a.push(t),a.push(n);this._erasRegex=new RegExp("^("+a.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+i.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}function on(e,t){s(0,[e,e.length],0,t)}function un(e,t,n,s,i){var r;return null==e?Be(this,s,i).year:(r=N(e,s,i),function(e,t,n,s,i){e=$e(e,t,n,s,i),t=ze(e.year,0,e.dayOfYear);return this.year(t.getUTCFullYear()),this.month(t.getUTCMonth()),this.date(t.getUTCDate()),this}.call(this,e,t=r<t?r:t,n,s,i))}s("N",0,0,"eraAbbr"),s("NN",0,0,"eraAbbr"),s("NNN",0,0,"eraAbbr"),s("NNNN",0,0,"eraName"),s("NNNNN",0,0,"eraNarrow"),s("y",["y",1],"yo","eraYear"),s("y",["yy",2],0,"eraYear"),s("y",["yyy",3],0,"eraYear"),s("y",["yyyy",4],0,"eraYear"),h("N",rn),h("NN",rn),h("NNN",rn),h("NNNN",function(e,t){return t.erasNameRegex(e)}),h("NNNNN",function(e,t){return t.erasNarrowRegex(e)}),v(["N","NN","NNN","NNNN","NNNNN"],function(e,t,n,s){s=n._locale.erasParse(e,s,n._strict);s?p(n).era=s:p(n).invalidEra=e}),h("y",pe),h("yy",pe),h("yyy",pe),h("yyyy",pe),h("yo",function(e,t){return t._eraYearOrdinalRegex||pe}),v(["y","yy","yyy","yyyy"],D),v(["yo"],function(e,t,n,s){var i;n._locale._eraYearOrdinalRegex&&(i=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[D]=n._locale.eraYearOrdinalParse(e,i):t[D]=parseInt(e,10)}),s(0,["gg",2],0,function(){return this.weekYear()%100}),s(0,["GG",2],0,function(){return this.isoWeekYear()%100}),on("gggg","weekYear"),on("ggggg","weekYear"),on("GGGG","isoWeekYear"),on("GGGGG","isoWeekYear"),h("G",ke),h("g",ke),h("GG",n,t),h("gg",n,t),h("GGGG",ge,ce),h("gggg",ge,ce),h("GGGGG",we,fe),h("ggggg",we,fe),Oe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,s){t[s.substr(0,2)]=M(e)}),Oe(["gg","GG"],function(e,t,n,s){t[s]=_.parseTwoDigitYear(e)}),s("Q",0,"Qo","quarter"),h("Q",de),v("Q",function(e,t){t[Y]=3*(M(e)-1)}),s("D",["DD",2],"Do","date"),h("D",n,u),h("DD",n,t),h("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),v(["D","DD"],S),v("Do",function(e,t){t[S]=M(e.match(n)[0])});ge=Re("Date",!0);s("DDD",["DDDD",3],"DDDo","dayOfYear"),h("DDD",ye),h("DDDD",he),v(["DDD","DDDD"],function(e,t,n){n._dayOfYear=M(e)}),s("m",["mm",2],0,"minute"),h("m",n,d),h("mm",n,t),v(["m","mm"],b);var ln,ce=Re("Minutes",!1),we=(s("s",["ss",2],0,"second"),h("s",n,d),h("ss",n,t),v(["s","ss"],T),Re("Seconds",!1));for(s("S",0,0,function(){return~~(this.millisecond()/100)}),s(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),s(0,["SSS",3],0,"millisecond"),s(0,["SSSS",4],0,function(){return 10*this.millisecond()}),s(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),s(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),s(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),s(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),s(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),h("S",ye,de),h("SS",ye,t),h("SSS",ye,he),ln="SSSS";ln.length<=9;ln+="S")h(ln,pe);function dn(e,t){t[Te]=M(1e3*("0."+e))}for(ln="S";ln.length<=9;ln+="S")v(ln,dn);fe=Re("Milliseconds",!1),s("z",0,0,"zoneAbbr"),s("zz",0,0,"zoneName");u=$.prototype;function hn(e){return e}u.add=Fe,u.calendar=function(e,t){1===arguments.length&&(arguments[0]?Jt(arguments[0])?(e=arguments[0],t=void 0):function(e){for(var t=F(e)&&!L(e),n=!1,s=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i=0;i<s.length;i+=1)n=n||c(e,s[i]);return t&&n}(arguments[0])&&(t=arguments[0],e=void 0):t=e=void 0);var e=e||R(),n=Gt(e,this).startOf("day"),n=_.calendarFormat(this,n)||"sameElse",t=t&&(a(t[n])?t[n].call(this,e):t[n]);return this.format(t||this.localeData().calendar(n,this,R(e)))},u.clone=function(){return new $(this)},u.diff=function(e,t,n){var s,i,r;if(!this.isValid())return NaN;if(!(s=Gt(e,this)).isValid())return NaN;switch(i=6e4*(s.utcOffset()-this.utcOffset()),t=o(t)){case"year":r=Qt(this,s)/12;break;case"month":r=Qt(this,s);break;case"quarter":r=Qt(this,s)/3;break;case"second":r=(this-s)/1e3;break;case"minute":r=(this-s)/6e4;break;case"hour":r=(this-s)/36e5;break;case"day":r=(this-s-i)/864e5;break;case"week":r=(this-s-i)/6048e5;break;default:r=this-s}return n?r:m(r)},u.endOf=function(e){var t,n;if(void 0!==(e=o(e))&&"millisecond"!==e&&this.isValid()){switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-tn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-tn(t,1e3)-1}this._d.setTime(t),_.updateOffset(this,!0)}return this},u.format=function(e){return e=e||(this.isUtc()?_.defaultFormatUtc:_.defaultFormat),e=re(this,e),this.localeData().postformat(e)},u.from=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||R(e).isValid())?C({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},u.fromNow=function(e){return this.from(R(),e)},u.to=function(e,t){return this.isValid()&&(k(e)&&e.isValid()||R(e).isValid())?C({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},u.toNow=function(e){return this.to(R(),e)},u.get=function(e){return a(this[e=o(e)])?this[e]():this},u.invalidAt=function(){return p(this).overflow},u.isAfter=function(e,t){return e=k(e)?e:R(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()>e.valueOf():e.valueOf()<this.clone().startOf(t).valueOf())},u.isBefore=function(e,t){return e=k(e)?e:R(e),!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()<e.valueOf():this.clone().endOf(t).valueOf()<e.valueOf())},u.isBetween=function(e,t,n,s){return e=k(e)?e:R(e),t=k(t)?t:R(t),!!(this.isValid()&&e.isValid()&&t.isValid())&&("("===(s=s||"()")[0]?this.isAfter(e,n):!this.isBefore(e,n))&&(")"===s[1]?this.isBefore(t,n):!this.isAfter(t,n))},u.isSame=function(e,t){var e=k(e)?e:R(e);return!(!this.isValid()||!e.isValid())&&("millisecond"===(t=o(t)||"millisecond")?this.valueOf()===e.valueOf():(e=e.valueOf(),this.clone().startOf(t).valueOf()<=e&&e<=this.clone().endOf(t).valueOf()))},u.isSameOrAfter=function(e,t){return this.isSame(e,t)||this.isAfter(e,t)},u.isSameOrBefore=function(e,t){return this.isSame(e,t)||this.isBefore(e,t)},u.isValid=function(){return A(this)},u.lang=Ke,u.locale=Xt,u.localeData=Kt,u.max=_e,u.min=me,u.parsingFlags=function(){return E({},p(this))},u.set=function(e,t){if("object"==typeof e)for(var n=function(e){var t,n=[];for(t in e)c(e,t)&&n.push({unit:t,priority:le[t]});return n.sort(function(e,t){return e.priority-t.priority}),n}(e=ue(e)),s=n.length,i=0;i<s;i++)this[n[i].unit](e[n[i].unit]);else if(a(this[e=o(e)]))return this[e](t);return this},u.startOf=function(e){var t,n;if(void 0!==(e=o(e))&&"millisecond"!==e&&this.isValid()){switch(n=this._isUTC?sn:nn,e){case"year":t=n(this.year(),0,1);break;case"quarter":t=n(this.year(),this.month()-this.month()%3,1);break;case"month":t=n(this.year(),this.month(),1);break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=n(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=tn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5);break;case"minute":t=this._d.valueOf(),t-=tn(t,6e4);break;case"second":t=this._d.valueOf(),t-=tn(t,1e3)}this._d.setTime(t),_.updateOffset(this,!0)}return this},u.subtract=Qe,u.toArray=function(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]},u.toObject=function(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}},u.toDate=function(){return new Date(this.valueOf())},u.toISOString=function(e){var t;return this.isValid()?(t=(e=!0!==e)?this.clone().utc():this).year()<0||9999<t.year()?re(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):a(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",re(t,"Z")):re(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ"):null},u.inspect=function(){var e,t,n;return this.isValid()?(t="moment",e="",this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z"),t="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",this.format(t+n+"-MM-DD[T]HH:mm:ss.SSS"+(e+'[")]'))):"moment.invalid(/* "+this._i+" */)"},"undefined"!=typeof Symbol&&null!=Symbol.for&&(u[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),u.toJSON=function(){return this.isValid()?this.toISOString():null},u.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},u.unix=function(){return Math.floor(this.valueOf()/1e3)},u.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},u.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},u.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].name;if(t[n].until<=e&&e<=t[n].since)return t[n].name}return""},u.eraNarrow=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].narrow;if(t[n].until<=e&&e<=t[n].since)return t[n].narrow}return""},u.eraAbbr=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;n<s;++n){if(e=this.clone().startOf("day").valueOf(),t[n].since<=e&&e<=t[n].until)return t[n].abbr;if(t[n].until<=e&&e<=t[n].since)return t[n].abbr}return""},u.eraYear=function(){for(var e,t,n=this.localeData().eras(),s=0,i=n.length;s<i;++s)if(e=n[s].since<=n[s].until?1:-1,t=this.clone().startOf("day").valueOf(),n[s].since<=t&&t<=n[s].until||n[s].until<=t&&t<=n[s].since)return(this.year()-_(n[s].since).year())*e+n[s].offset;return this.year()},u.year=Pe,u.isLeapYear=function(){return be(this.year())},u.weekYear=function(e){return un.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)},u.isoWeekYear=function(e){return un.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},u.quarter=u.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},u.month=Ie,u.daysInMonth=function(){return He(this.year(),this.month())},u.week=u.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},u.isoWeek=u.isoWeeks=function(e){var t=Be(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},u.weeksInYear=function(){var e=this.localeData()._week;return N(this.year(),e.dow,e.doy)},u.weeksInWeekYear=function(){var e=this.localeData()._week;return N(this.weekYear(),e.dow,e.doy)},u.isoWeeksInYear=function(){return N(this.year(),1,4)},u.isoWeeksInISOWeekYear=function(){return N(this.isoWeekYear(),1,4)},u.date=ge,u.day=u.days=function(e){var t,n,s;return this.isValid()?(t=Ce(this,"Day"),null!=e?(n=e,s=this.localeData(),e="string"!=typeof n?n:isNaN(n)?"number"==typeof(n=s.weekdaysParse(n))?n:null:parseInt(n,10),this.add(e-t,"d")):t):null!=e?this:NaN},u.weekday=function(e){var t;return this.isValid()?(t=(this.day()+7-this.localeData()._week.dow)%7,null==e?t:this.add(e-t,"d")):null!=e?this:NaN},u.isoWeekday=function(e){var t,n;return this.isValid()?null!=e?(t=e,n=this.localeData(),n="string"==typeof t?n.weekdaysParse(t)%7||7:isNaN(t)?null:t,this.day(this.day()%7?n:n-7)):this.day()||7:null!=e?this:NaN},u.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},u.hour=u.hours=i,u.minute=u.minutes=ce,u.second=u.seconds=we,u.millisecond=u.milliseconds=fe,u.utcOffset=function(e,t,n){var s,i=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null==e)return this._isUTC?i:Et(this);if("string"==typeof e){if(null===(e=Vt(ve,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(s=Et(this)),this._offset=e,this._isUTC=!0,null!=s&&this.add(s,"m"),i!==e&&(!t||this._changeInProgress?$t(this,C(e-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,_.updateOffset(this,!0),this._changeInProgress=null)),this},u.utc=function(e){return this.utcOffset(0,e)},u.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e)&&this.subtract(Et(this),"m"),this},u.parseZone=function(){var e;return null!=this._tzm?this.utcOffset(this._tzm,!1,!0):"string"==typeof this._i&&(null!=(e=Vt(Me,this._i))?this.utcOffset(e):this.utcOffset(0,!0)),this},u.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?R(e).utcOffset():0,(this.utcOffset()-e)%60==0)},u.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},u.isLocal=function(){return!!this.isValid()&&!this._isUTC},u.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},u.isUtc=At,u.isUTC=At,u.zoneAbbr=function(){return this._isUTC?"UTC":""},u.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},u.dates=e("dates accessor is deprecated. Use date instead.",ge),u.months=e("months accessor is deprecated. Use month instead",Ie),u.years=e("years accessor is deprecated. Use year instead",Pe),u.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?(this.utcOffset(e="string"!=typeof e?-e:e,t),this):-this.utcOffset()}),u.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){var e,t;return g(this._isDSTShifted)&&(q(e={},this),(e=Nt(e))._a?(t=(e._isUTC?l:R)(e._a),this._isDSTShifted=this.isValid()&&0<function(e,t,n){for(var s=Math.min(e.length,t.length),i=Math.abs(e.length-t.length),r=0,a=0;a<s;a++)(n&&e[a]!==t[a]||!n&&M(e[a])!==M(t[a]))&&r++;return r+i}(e._a,t.toArray())):this._isDSTShifted=!1),this._isDSTShifted});d=K.prototype;function cn(e,t,n,s){var i=P(),s=l().set(s,t);return i[n](s,e)}function fn(e,t,n){if(w(e)&&(t=e,e=void 0),e=e||"",null!=t)return cn(e,t,n,"month");for(var s=[],i=0;i<12;i++)s[i]=cn(e,i,n,"month");return s}function mn(e,t,n,s){t=("boolean"==typeof e?w(t)&&(n=t,t=void 0):(t=e,e=!1,w(n=t)&&(n=t,t=void 0)),t||"");var i,r=P(),a=e?r._week.dow:0,o=[];if(null!=n)return cn(t,(n+a)%7,s,"day");for(i=0;i<7;i++)o[i]=cn(t,(i+a)%7,s,"day");return o}d.calendar=function(e,t,n){return a(e=this._calendar[e]||this._calendar.sameElse)?e.call(t,n):e},d.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(te).map(function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e}).join(""),this._longDateFormat[e])},d.invalidDate=function(){return this._invalidDate},d.ordinal=function(e){return this._ordinal.replace("%d",e)},d.preparse=hn,d.postformat=hn,d.relativeTime=function(e,t,n,s){var i=this._relativeTime[n];return a(i)?i(e,t,n,s):i.replace(/%d/i,e)},d.pastFuture=function(e,t){return a(e=this._relativeTime[0<e?"future":"past"])?e(t):e.replace(/%s/i,t)},d.set=function(e){var t,n;for(n in e)c(e,n)&&(a(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},d.eras=function(e,t){for(var n,s=this._eras||P("en")._eras,i=0,r=s.length;i<r;++i)switch("string"==typeof s[i].since&&(n=_(s[i].since).startOf("day"),s[i].since=n.valueOf()),typeof s[i].until){case"undefined":s[i].until=1/0;break;case"string":n=_(s[i].until).startOf("day").valueOf(),s[i].until=n.valueOf()}return s},d.erasParse=function(e,t,n){var s,i,r,a,o,u=this.eras();for(e=e.toUpperCase(),s=0,i=u.length;s<i;++s)if(r=u[s].name.toUpperCase(),a=u[s].abbr.toUpperCase(),o=u[s].narrow.toUpperCase(),n)switch(t){case"N":case"NN":case"NNN":if(a===e)return u[s];break;case"NNNN":if(r===e)return u[s];break;case"NNNNN":if(o===e)return u[s]}else if(0<=[r,a,o].indexOf(e))return u[s]},d.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?_(e.since).year():_(e.since).year()+(t-e.offset)*n},d.erasAbbrRegex=function(e){return c(this,"_erasAbbrRegex")||an.call(this),e?this._erasAbbrRegex:this._erasRegex},d.erasNameRegex=function(e){return c(this,"_erasNameRegex")||an.call(this),e?this._erasNameRegex:this._erasRegex},d.erasNarrowRegex=function(e){return c(this,"_erasNarrowRegex")||an.call(this),e?this._erasNarrowRegex:this._erasRegex},d.months=function(e,t){return e?(y(this._months)?this._months:this._months[(this._months.isFormat||Ve).test(t)?"format":"standalone"])[e.month()]:y(this._months)?this._months:this._months.standalone},d.monthsShort=function(e,t){return e?(y(this._monthsShort)?this._monthsShort:this._monthsShort[Ve.test(t)?"format":"standalone"])[e.month()]:y(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},d.monthsParse=function(e,t,n){var s,i;if(this._monthsParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],s=0;s<12;++s)r=l([2e3,s]),this._shortMonthsParse[s]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[s]=this.months(r,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=x.call(this._shortMonthsParse,e))?i:null:-1!==(i=x.call(this._longMonthsParse,e))?i:null:"MMM"===t?-1!==(i=x.call(this._shortMonthsParse,e))||-1!==(i=x.call(this._longMonthsParse,e))?i:null:-1!==(i=x.call(this._longMonthsParse,e))||-1!==(i=x.call(this._shortMonthsParse,e))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),s=0;s<12;s++){if(i=l([2e3,s]),n&&!this._longMonthsParse[s]&&(this._longMonthsParse[s]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[s]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[s]||(i="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[s]=new RegExp(i.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[s].test(e))return s;if(n&&"MMM"===t&&this._shortMonthsParse[s].test(e))return s;if(!n&&this._monthsParse[s].test(e))return s}},d.monthsRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||je.call(this),e?this._monthsStrictRegex:this._monthsRegex):(c(this,"_monthsRegex")||(this._monthsRegex=Ee),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},d.monthsShortRegex=function(e){return this._monthsParseExact?(c(this,"_monthsRegex")||je.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(c(this,"_monthsShortRegex")||(this._monthsShortRegex=Ge),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},d.week=function(e){return Be(e,this._week.dow,this._week.doy).week},d.firstDayOfYear=function(){return this._week.doy},d.firstDayOfWeek=function(){return this._week.dow},d.weekdays=function(e,t){return t=y(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"],!0===e?Je(t,this._week.dow):e?t[e.day()]:t},d.weekdaysMin=function(e){return!0===e?Je(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},d.weekdaysShort=function(e){return!0===e?Je(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},d.weekdaysParse=function(e,t,n){var s,i;if(this._weekdaysParseExact)return function(e,t,n){var s,i,r,e=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],s=0;s<7;++s)r=l([2e3,1]).day(s),this._minWeekdaysParse[s]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[s]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[s]=this.weekdays(r,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=x.call(this._weekdaysParse,e))?i:null:"ddd"===t?-1!==(i=x.call(this._shortWeekdaysParse,e))?i:null:-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:"dddd"===t?-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._shortWeekdaysParse,e))||-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:"ddd"===t?-1!==(i=x.call(this._shortWeekdaysParse,e))||-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._minWeekdaysParse,e))?i:null:-1!==(i=x.call(this._minWeekdaysParse,e))||-1!==(i=x.call(this._weekdaysParse,e))||-1!==(i=x.call(this._shortWeekdaysParse,e))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),s=0;s<7;s++){if(i=l([2e3,1]).day(s),n&&!this._fullWeekdaysParse[s]&&(this._fullWeekdaysParse[s]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[s]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[s]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[s]||(i="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[s]=new RegExp(i.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[s].test(e))return s;if(n&&"ddd"===t&&this._shortWeekdaysParse[s].test(e))return s;if(n&&"dd"===t&&this._minWeekdaysParse[s].test(e))return s;if(!n&&this._weekdaysParse[s].test(e))return s}},d.weekdaysRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(c(this,"_weekdaysRegex")||(this._weekdaysRegex=et),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},d.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(c(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=tt),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},d.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(c(this,"_weekdaysRegex")||st.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(c(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=nt),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},d.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},d.meridiem=function(e,t,n){return 11<e?n?"pm":"PM":n?"am":"AM"},ft("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===M(e%100/10)?"th":1==t?"st":2==t?"nd":3==t?"rd":"th")}}),_.lang=e("moment.lang is deprecated. Use moment.locale instead.",ft),_.langData=e("moment.langData is deprecated. Use moment.localeData instead.",P);var _n=Math.abs;function yn(e,t,n,s){t=C(t,n);return e._milliseconds+=s*t._milliseconds,e._days+=s*t._days,e._months+=s*t._months,e._bubble()}function gn(e){return e<0?Math.floor(e):Math.ceil(e)}function wn(e){return 4800*e/146097}function pn(e){return 146097*e/4800}function kn(e){return function(){return this.as(e)}}de=kn("ms"),t=kn("s"),ye=kn("m"),he=kn("h"),Fe=kn("d"),_e=kn("w"),me=kn("M"),Qe=kn("Q"),i=kn("y"),ce=de;function Mn(e){return function(){return this.isValid()?this._data[e]:NaN}}var we=Mn("milliseconds"),fe=Mn("seconds"),ge=Mn("minutes"),Pe=Mn("hours"),d=Mn("days"),vn=Mn("months"),Dn=Mn("years");var Yn=Math.round,Sn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function On(e,t,n,s){var i=C(e).abs(),r=Yn(i.as("s")),a=Yn(i.as("m")),o=Yn(i.as("h")),u=Yn(i.as("d")),l=Yn(i.as("M")),d=Yn(i.as("w")),i=Yn(i.as("y")),r=(r<=n.ss?["s",r]:r<n.s&&["ss",r])||(a<=1?["m"]:a<n.m&&["mm",a])||(o<=1?["h"]:o<n.h&&["hh",o])||(u<=1?["d"]:u<n.d&&["dd",u]);return(r=(r=null!=n.w?r||(d<=1?["w"]:d<n.w&&["ww",d]):r)||(l<=1?["M"]:l<n.M&&["MM",l])||(i<=1?["y"]:["yy",i]))[2]=t,r[3]=0<+e,r[4]=s,function(e,t,n,s,i){return i.relativeTime(t||1,!!n,e,s)}.apply(null,r)}var bn=Math.abs;function Tn(e){return(0<e)-(e<0)||+e}function xn(){var e,t,n,s,i,r,a,o,u,l,d;return this.isValid()?(e=bn(this._milliseconds)/1e3,t=bn(this._days),n=bn(this._months),(o=this.asSeconds())?(s=m(e/60),i=m(s/60),e%=60,s%=60,r=m(n/12),n%=12,a=e?e.toFixed(3).replace(/\.?0+$/,""):"",u=Tn(this._months)!==Tn(o)?"-":"",l=Tn(this._days)!==Tn(o)?"-":"",d=Tn(this._milliseconds)!==Tn(o)?"-":"",(o<0?"-":"")+"P"+(r?u+r+"Y":"")+(n?u+n+"M":"")+(t?l+t+"D":"")+(i||s||e?"T":"")+(i?d+i+"H":"")+(s?d+s+"M":"")+(e?d+a+"S":"")):"P0D"):this.localeData().invalidDate()}var U=Ct.prototype;return U.isValid=function(){return this._isValid},U.abs=function(){var e=this._data;return this._milliseconds=_n(this._milliseconds),this._days=_n(this._days),this._months=_n(this._months),e.milliseconds=_n(e.milliseconds),e.seconds=_n(e.seconds),e.minutes=_n(e.minutes),e.hours=_n(e.hours),e.months=_n(e.months),e.years=_n(e.years),this},U.add=function(e,t){return yn(this,e,t,1)},U.subtract=function(e,t){return yn(this,e,t,-1)},U.as=function(e){if(!this.isValid())return NaN;var t,n,s=this._milliseconds;if("month"===(e=o(e))||"quarter"===e||"year"===e)switch(t=this._days+s/864e5,n=this._months+wn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(pn(this._months)),e){case"week":return t/7+s/6048e5;case"day":return t+s/864e5;case"hour":return 24*t+s/36e5;case"minute":return 1440*t+s/6e4;case"second":return 86400*t+s/1e3;case"millisecond":return Math.floor(864e5*t)+s;default:throw new Error("Unknown unit "+e)}},U.asMilliseconds=de,U.asSeconds=t,U.asMinutes=ye,U.asHours=he,U.asDays=Fe,U.asWeeks=_e,U.asMonths=me,U.asQuarters=Qe,U.asYears=i,U.valueOf=ce,U._bubble=function(){var e=this._milliseconds,t=this._days,n=this._months,s=this._data;return 0<=e&&0<=t&&0<=n||e<=0&&t<=0&&n<=0||(e+=864e5*gn(pn(n)+t),n=t=0),s.milliseconds=e%1e3,e=m(e/1e3),s.seconds=e%60,e=m(e/60),s.minutes=e%60,e=m(e/60),s.hours=e%24,t+=m(e/24),n+=e=m(wn(t)),t-=gn(pn(e)),e=m(n/12),n%=12,s.days=t,s.months=n,s.years=e,this},U.clone=function(){return C(this)},U.get=function(e){return e=o(e),this.isValid()?this[e+"s"]():NaN},U.milliseconds=we,U.seconds=fe,U.minutes=ge,U.hours=Pe,U.days=d,U.weeks=function(){return m(this.days()/7)},U.months=vn,U.years=Dn,U.humanize=function(e,t){var n,s;return this.isValid()?(n=!1,s=Sn,"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(n=e),"object"==typeof t&&(s=Object.assign({},Sn,t),null!=t.s)&&null==t.ss&&(s.ss=t.s-1),e=this.localeData(),t=On(this,!n,s,e),n&&(t=e.pastFuture(+this,t)),e.postformat(t)):this.localeData().invalidDate()},U.toISOString=xn,U.toString=xn,U.toJSON=xn,U.locale=Xt,U.localeData=Kt,U.toIsoString=e("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",xn),U.lang=Ke,s("X",0,0,"unix"),s("x",0,0,"valueOf"),h("x",ke),h("X",/[+-]?\d+(\.\d{1,3})?/),v("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e))}),v("x",function(e,t,n){n._d=new Date(M(e))}),_.version="2.30.1",H=R,_.fn=u,_.min=function(){return Pt("isBefore",[].slice.call(arguments,0))},_.max=function(){return Pt("isAfter",[].slice.call(arguments,0))},_.now=function(){return Date.now?Date.now():+new Date},_.utc=l,_.unix=function(e){return R(1e3*e)},_.months=function(e,t){return fn(e,t,"months")},_.isDate=V,_.locale=ft,_.invalid=I,_.duration=C,_.isMoment=k,_.weekdays=function(e,t,n){return mn(e,t,n,"weekdays")},_.parseZone=function(){return R.apply(null,arguments).parseZone()},_.localeData=P,_.isDuration=Ut,_.monthsShort=function(e,t){return fn(e,t,"monthsShort")},_.weekdaysMin=function(e,t,n){return mn(e,t,n,"weekdaysMin")},_.defineLocale=mt,_.updateLocale=function(e,t){var n,s;return null!=t?(s=ut,null!=W[e]&&null!=W[e].parentLocale?W[e].set(X(W[e]._config,t)):(t=X(s=null!=(n=ct(e))?n._config:s,t),null==n&&(t.abbr=e),(s=new K(t)).parentLocale=W[e],W[e]=s),ft(e)):null!=W[e]&&(null!=W[e].parentLocale?(W[e]=W[e].parentLocale,e===ft()&&ft(e)):null!=W[e]&&delete W[e]),W[e]},_.locales=function(){return ee(W)},_.weekdaysShort=function(e,t,n){return mn(e,t,n,"weekdaysShort")},_.normalizeUnits=o,_.relativeTimeRounding=function(e){return void 0===e?Yn:"function"==typeof e&&(Yn=e,!0)},_.relativeTimeThreshold=function(e,t){return void 0!==Sn[e]&&(void 0===t?Sn[e]:(Sn[e]=t,"s"===e&&(Sn.ss=t-1),!0))},_.calendarFormat=function(e,t){return(e=e.diff(t,"days",!0))<-6?"sameElse":e<-1?"lastWeek":e<0?"lastDay":e<1?"sameDay":e<2?"nextDay":e<7?"nextWeek":"sameElse"},_.prototype=u,_.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},_}); vendor/wp-polyfill-fetch.min.js 0000644 00000023430 15013651111 0012522 0 ustar 00 ((t,e)=>{"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.WHATWGFetch={})})(this,(function(t){var e,r,o="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||"undefined"!=typeof global&&global||{},n="URLSearchParams"in o,s="Symbol"in o&&"iterator"in Symbol,i="FileReader"in o&&"Blob"in o&&(()=>{try{return new Blob,!0}catch(t){return!1}})(),a="FormData"in o,h="ArrayBuffer"in o;function u(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function f(t){return"string"!=typeof t?String(t):t}function d(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return s&&(e[Symbol.iterator]=function(){return e}),e}function c(t){this.map={},t instanceof c?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function y(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function l(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function p(t){var e=new FileReader,r=l(e);return e.readAsArrayBuffer(t),r}function b(t){var e;return t.slice?t.slice(0):((e=new Uint8Array(t.byteLength)).set(new Uint8Array(t)),e.buffer)}function m(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,(this._bodyInit=t)?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:n&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():h&&i&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=b(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):h&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=b(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=y(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer)return y(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer));if(i)return this.blob().then(p);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,r,o=y(this);if(o)return o;if(this._bodyBlob)return o=this._bodyBlob,e=l(t=new FileReader),r=(r=/charset=([A-Za-z0-9_-]+)/.exec(o.type))?r[1]:"utf-8",t.readAsText(o,r),e;if(this._bodyArrayBuffer)return Promise.resolve((t=>{for(var e=new Uint8Array(t),r=new Array(e.length),o=0;o<e.length;o++)r[o]=String.fromCharCode(e[o]);return r.join("")})(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(A)}),this.json=function(){return this.text().then(JSON.parse)},this}h&&(e=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(t){return t&&-1<e.indexOf(Object.prototype.toString.call(t))}),c.prototype.append=function(t,e){t=u(t),e=f(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},c.prototype.delete=function(t){delete this.map[u(t)]},c.prototype.get=function(t){return t=u(t),this.has(t)?this.map[t]:null},c.prototype.has=function(t){return this.map.hasOwnProperty(u(t))},c.prototype.set=function(t,e){this.map[u(t)]=f(e)},c.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},c.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),d(t)},c.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),d(t)},c.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),d(t)},s&&(c.prototype[Symbol.iterator]=c.prototype.entries);var w=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function E(t,e){if(!(this instanceof E))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,n=(e=e||{}).body;if(t instanceof E){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new c(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new c(e.headers)),this.method=(r=(t=e.method||this.method||"GET").toUpperCase(),-1<w.indexOf(r)?r:t),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||(()=>{if("AbortController"in o)return(new AbortController).signal})(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n),"GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache||((r=/([?&])_=[^&]*/).test(this.url)?this.url=this.url.replace(r,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime())}function A(t){var e=new FormData;return t.trim().split("&").forEach((function(t){var r;t&&(r=(t=t.split("=")).shift().replace(/\+/g," "),t=t.join("=").replace(/\+/g," "),e.append(decodeURIComponent(r),decodeURIComponent(t)))})),e}function g(t,e){if(!(this instanceof g))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e=e||{},this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||599<this.status)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=200<=this.status&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new c(e.headers),this.url=e.url||"",this._initBody(t)}E.prototype.clone=function(){return new E(this,{body:this._bodyInit})},m.call(E.prototype),m.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},g.error=function(){var t=new g(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var T=[301,302,303,307,308];g.redirect=function(t,e){if(-1===T.indexOf(e))throw new RangeError("Invalid status code");return new g(null,{status:e,headers:{location:t}})},t.DOMException=o.DOMException;try{new t.DOMException}catch(d){t.DOMException=function(t,e){this.message=t,this.name=e,e=Error(t),this.stack=e.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function _(e,r){return new Promise((function(n,s){var a=new E(e,r);if(a.signal&&a.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var d,y=new XMLHttpRequest;function l(){y.abort()}y.onload=function(){var t,e,r={statusText:y.statusText,headers:(t=y.getAllResponseHeaders()||"",e=new c,t.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t})).forEach((function(t){var r=(t=t.split(":")).shift().trim();if(r){t=t.join(":").trim();try{e.append(r,t)}catch(t){console.warn("Response "+t.message)}}})),e)},o=(0===a.url.indexOf("file://")&&(y.status<200||599<y.status)?r.status=200:r.status=y.status,r.url="responseURL"in y?y.responseURL:r.headers.get("X-Request-URL"),"response"in y?y.response:y.responseText);setTimeout((function(){n(new g(o,r))}),0)},y.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},y.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request timed out"))}),0)},y.onabort=function(){setTimeout((function(){s(new t.DOMException("Aborted","AbortError"))}),0)},y.open(a.method,(t=>{try{return""===t&&o.location.href?o.location.href:t}catch(e){return t}})(a.url),!0),"include"===a.credentials?y.withCredentials=!0:"omit"===a.credentials&&(y.withCredentials=!1),"responseType"in y&&(i?y.responseType="blob":h&&(y.responseType="arraybuffer")),r&&"object"==typeof r.headers&&!(r.headers instanceof c||o.Headers&&r.headers instanceof o.Headers)?(d=[],Object.getOwnPropertyNames(r.headers).forEach((function(t){d.push(u(t)),y.setRequestHeader(t,f(r.headers[t]))})),a.headers.forEach((function(t,e){-1===d.indexOf(e)&&y.setRequestHeader(e,t)}))):a.headers.forEach((function(t,e){y.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",l),y.onreadystatechange=function(){4===y.readyState&&a.signal.removeEventListener("abort",l)}),y.send(void 0===a._bodyInit?null:a._bodyInit)}))}_.polyfill=!0,o.fetch||(o.fetch=_,o.Headers=c,o.Request=E,o.Response=g),t.Headers=c,t.Request=E,t.Response=g,t.fetch=_,Object.defineProperty(t,"__esModule",{value:!0})})); vendor/wp-polyfill.js 0000644 00000413371 15013651111 0010660 0 ustar 00 /** * core-js 3.39.0 * © 2014-2024 Denis Pushkarev (zloirock.ru) * license: https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE * source: https://github.com/zloirock/core-js */ !function (undefined) { 'use strict'; /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ var __webpack_require__ = function (moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports, __webpack_require__) { __webpack_require__(1); __webpack_require__(73); __webpack_require__(76); __webpack_require__(78); __webpack_require__(80); __webpack_require__(86); __webpack_require__(95); __webpack_require__(96); __webpack_require__(107); __webpack_require__(108); __webpack_require__(113); __webpack_require__(114); __webpack_require__(116); __webpack_require__(118); __webpack_require__(119); __webpack_require__(127); __webpack_require__(128); __webpack_require__(131); __webpack_require__(137); __webpack_require__(146); __webpack_require__(148); __webpack_require__(149); __webpack_require__(150); module.exports = __webpack_require__(151); /***/ }), /* 1 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var arrayToReversed = __webpack_require__(67); var toIndexedObject = __webpack_require__(11); var addToUnscopables = __webpack_require__(68); var $Array = Array; // `Array.prototype.toReversed` method // https://tc39.es/ecma262/#sec-array.prototype.toreversed $({ target: 'Array', proto: true }, { toReversed: function toReversed() { return arrayToReversed(toIndexedObject(this), $Array); } }); addToUnscopables('toReversed'); /***/ }), /* 2 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var getOwnPropertyDescriptor = __webpack_require__(4).f; var createNonEnumerableProperty = __webpack_require__(42); var defineBuiltIn = __webpack_require__(46); var defineGlobalProperty = __webpack_require__(36); var copyConstructorProperties = __webpack_require__(54); var isForced = __webpack_require__(66); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.dontCallGetSet - prevent calling a getter on target options.name - the .name of the function if it does not match the key */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = globalThis; } else if (STATIC) { target = globalThis[TARGET] || defineGlobalProperty(TARGET, {}); } else { target = globalThis[TARGET] && globalThis[TARGET].prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.dontCallGetSet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty == typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } defineBuiltIn(target, key, sourceProperty, options); } }; /***/ }), /* 3 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var check = function (it) { return it && it.Math === Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line es/no-global-this -- safe check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || check(typeof this == 'object' && this) || // eslint-disable-next-line no-new-func -- fallback (function () { return this; })() || Function('return this')(); /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(5); var call = __webpack_require__(7); var propertyIsEnumerableModule = __webpack_require__(9); var createPropertyDescriptor = __webpack_require__(10); var toIndexedObject = __webpack_require__(11); var toPropertyKey = __webpack_require__(17); var hasOwn = __webpack_require__(37); var IE8_DOM_DEFINE = __webpack_require__(40); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPropertyKey(P); if (IE8_DOM_DEFINE) try { return $getOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]); }; /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(6); // Detect IE8's incomplete defineProperty implementation module.exports = !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; }); /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; /***/ }), /* 7 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var NATIVE_BIND = __webpack_require__(8); var call = Function.prototype.call; module.exports = NATIVE_BIND ? call.bind(call) : function () { return call.apply(call, arguments); }; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(6); module.exports = !fails(function () { // eslint-disable-next-line es/no-function-prototype-bind -- safe var test = (function () { /* empty */ }).bind(); // eslint-disable-next-line no-prototype-builtins -- safe return typeof test != 'function' || test.hasOwnProperty('prototype'); }); /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $propertyIsEnumerable = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable; /***/ }), /* 10 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; /***/ }), /* 11 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // toObject with fallback for non-array-like ES3 strings var IndexedObject = __webpack_require__(12); var requireObjectCoercible = __webpack_require__(15); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; /***/ }), /* 12 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); var fails = __webpack_require__(6); var classof = __webpack_require__(14); var $Object = Object; var split = uncurryThis(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins -- safe return !$Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) === 'String' ? split(it, '') : $Object(it); } : $Object; /***/ }), /* 13 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var NATIVE_BIND = __webpack_require__(8); var FunctionPrototype = Function.prototype; var call = FunctionPrototype.call; var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call); module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) { return function () { return call.apply(fn, arguments); }; }; /***/ }), /* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); var toString = uncurryThis({}.toString); var stringSlice = uncurryThis(''.slice); module.exports = function (it) { return stringSlice(toString(it), 8, -1); }; /***/ }), /* 15 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isNullOrUndefined = __webpack_require__(16); var $TypeError = TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it); return it; }; /***/ }), /* 16 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // we can't use just `it == null` since of `document.all` special case // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec module.exports = function (it) { return it === null || it === undefined; }; /***/ }), /* 17 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toPrimitive = __webpack_require__(18); var isSymbol = __webpack_require__(21); // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey module.exports = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol(key) ? key : key + ''; }; /***/ }), /* 18 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(7); var isObject = __webpack_require__(19); var isSymbol = __webpack_require__(21); var getMethod = __webpack_require__(28); var ordinaryToPrimitive = __webpack_require__(31); var wellKnownSymbol = __webpack_require__(32); var $TypeError = TypeError; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive module.exports = function (input, pref) { if (!isObject(input) || isSymbol(input)) return input; var exoticToPrim = getMethod(input, TO_PRIMITIVE); var result; if (exoticToPrim) { if (pref === undefined) pref = 'default'; result = call(exoticToPrim, input, pref); if (!isObject(result) || isSymbol(result)) return result; throw new $TypeError("Can't convert object to primitive value"); } if (pref === undefined) pref = 'number'; return ordinaryToPrimitive(input, pref); }; /***/ }), /* 19 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isCallable = __webpack_require__(20); module.exports = function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; /***/ }), /* 20 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot var documentAll = typeof document == 'object' && document.all; // `IsCallable` abstract operation // https://tc39.es/ecma262/#sec-iscallable // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) { return typeof argument == 'function' || argument === documentAll; } : function (argument) { return typeof argument == 'function'; }; /***/ }), /* 21 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var getBuiltIn = __webpack_require__(22); var isCallable = __webpack_require__(20); var isPrototypeOf = __webpack_require__(23); var USE_SYMBOL_AS_UID = __webpack_require__(24); var $Object = Object; module.exports = USE_SYMBOL_AS_UID ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn('Symbol'); return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); }; /***/ }), /* 22 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var isCallable = __webpack_require__(20); var aFunction = function (argument) { return isCallable(argument) ? argument : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method]; }; /***/ }), /* 23 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); module.exports = uncurryThis({}.isPrototypeOf); /***/ }), /* 24 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL = __webpack_require__(25); module.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; /***/ }), /* 25 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION = __webpack_require__(26); var fails = __webpack_require__(6); var globalThis = __webpack_require__(3); var $String = globalThis.String; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing module.exports = !!Object.getOwnPropertySymbols && !fails(function () { var symbol = Symbol('symbol detection'); // Chrome 38 Symbol has incorrect toString conversion // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will, // of course, fail. return !$String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances !Symbol.sham && V8_VERSION && V8_VERSION < 41; }); /***/ }), /* 26 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var userAgent = __webpack_require__(27); var process = globalThis.process; var Deno = globalThis.Deno; var versions = process && process.versions || Deno && Deno.version; var v8 = versions && versions.v8; var match, version; if (v8) { match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10 // but their correct versions are not interesting for us version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]); } // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0` // so check `userAgent` even if `.v8` exists, but 0 if (!version && userAgent) { match = userAgent.match(/Edge\/(\d+)/); if (!match || match[1] >= 74) { match = userAgent.match(/Chrome\/(\d+)/); if (match) version = +match[1]; } } module.exports = version; /***/ }), /* 27 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var navigator = globalThis.navigator; var userAgent = navigator && navigator.userAgent; module.exports = userAgent ? String(userAgent) : ''; /***/ }), /* 28 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var aCallable = __webpack_require__(29); var isNullOrUndefined = __webpack_require__(16); // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod module.exports = function (V, P) { var func = V[P]; return isNullOrUndefined(func) ? undefined : aCallable(func); }; /***/ }), /* 29 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isCallable = __webpack_require__(20); var tryToString = __webpack_require__(30); var $TypeError = TypeError; // `Assert: IsCallable(argument) is true` module.exports = function (argument) { if (isCallable(argument)) return argument; throw new $TypeError(tryToString(argument) + ' is not a function'); }; /***/ }), /* 30 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $String = String; module.exports = function (argument) { try { return $String(argument); } catch (error) { return 'Object'; } }; /***/ }), /* 31 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(7); var isCallable = __webpack_require__(20); var isObject = __webpack_require__(19); var $TypeError = TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive module.exports = function (input, pref) { var fn, val; if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val; if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val; throw new $TypeError("Can't convert object to primitive value"); }; /***/ }), /* 32 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var shared = __webpack_require__(33); var hasOwn = __webpack_require__(37); var uid = __webpack_require__(39); var NATIVE_SYMBOL = __webpack_require__(25); var USE_SYMBOL_AS_UID = __webpack_require__(24); var Symbol = globalThis.Symbol; var WellKnownSymbolsStore = shared('wks'); var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { if (!hasOwn(WellKnownSymbolsStore, name)) { WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name) ? Symbol[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; /***/ }), /* 33 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var store = __webpack_require__(34); module.exports = function (key, value) { return store[key] || (store[key] = value || {}); }; /***/ }), /* 34 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var IS_PURE = __webpack_require__(35); var globalThis = __webpack_require__(3); var defineGlobalProperty = __webpack_require__(36); var SHARED = '__core-js_shared__'; var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {}); (store.versions || (store.versions = [])).push({ version: '3.39.0', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)', license: 'https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); /***/ }), /* 35 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = false; /***/ }), /* 36 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; module.exports = function (key, value) { try { defineProperty(globalThis, key, { value: value, configurable: true, writable: true }); } catch (error) { globalThis[key] = value; } return value; }; /***/ }), /* 37 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); var toObject = __webpack_require__(38); var hasOwnProperty = uncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty // eslint-disable-next-line es/no-object-hasown -- safe module.exports = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject(it), key); }; /***/ }), /* 38 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var requireObjectCoercible = __webpack_require__(15); var $Object = Object; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject module.exports = function (argument) { return $Object(requireObjectCoercible(argument)); }; /***/ }), /* 39 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); var id = 0; var postfix = Math.random(); var toString = uncurryThis(1.0.toString); module.exports = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; /***/ }), /* 40 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(5); var fails = __webpack_require__(6); var createElement = __webpack_require__(41); // Thanks to IE8 for its funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a !== 7; }); /***/ }), /* 41 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var isObject = __webpack_require__(19); var document = globalThis.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; /***/ }), /* 42 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(5); var definePropertyModule = __webpack_require__(43); var createPropertyDescriptor = __webpack_require__(10); module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; /***/ }), /* 43 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(5); var IE8_DOM_DEFINE = __webpack_require__(40); var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(44); var anObject = __webpack_require__(45); var toPropertyKey = __webpack_require__(17); var $TypeError = TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe var $defineProperty = Object.defineProperty; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; var ENUMERABLE = 'enumerable'; var CONFIGURABLE = 'configurable'; var WRITABLE = 'writable'; // `Object.defineProperty` method // https://tc39.es/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) { var current = $getOwnPropertyDescriptor(O, P); if (current && current[WRITABLE]) { O[P] = Attributes.value; Attributes = { configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE], enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE], writable: false }; } } return $defineProperty(O, P, Attributes); } : $defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPropertyKey(P); anObject(Attributes); if (IE8_DOM_DEFINE) try { return $defineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; /***/ }), /* 44 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(5); var fails = __webpack_require__(6); // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 module.exports = DESCRIPTORS && fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty(function () { /* empty */ }, 'prototype', { value: 42, writable: false }).prototype !== 42; }); /***/ }), /* 45 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isObject = __webpack_require__(19); var $String = String; var $TypeError = TypeError; // `Assert: Type(argument) is Object` module.exports = function (argument) { if (isObject(argument)) return argument; throw new $TypeError($String(argument) + ' is not an object'); }; /***/ }), /* 46 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isCallable = __webpack_require__(20); var definePropertyModule = __webpack_require__(43); var makeBuiltIn = __webpack_require__(47); var defineGlobalProperty = __webpack_require__(36); module.exports = function (O, key, value, options) { if (!options) options = {}; var simple = options.enumerable; var name = options.name !== undefined ? options.name : key; if (isCallable(value)) makeBuiltIn(value, name, options); if (options.global) { if (simple) O[key] = value; else defineGlobalProperty(key, value); } else { try { if (!options.unsafe) delete O[key]; else if (O[key]) simple = true; } catch (error) { /* empty */ } if (simple) O[key] = value; else definePropertyModule.f(O, key, { value: value, enumerable: false, configurable: !options.nonConfigurable, writable: !options.nonWritable }); } return O; }; /***/ }), /* 47 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); var fails = __webpack_require__(6); var isCallable = __webpack_require__(20); var hasOwn = __webpack_require__(37); var DESCRIPTORS = __webpack_require__(5); var CONFIGURABLE_FUNCTION_NAME = __webpack_require__(48).CONFIGURABLE; var inspectSource = __webpack_require__(49); var InternalStateModule = __webpack_require__(50); var enforceInternalState = InternalStateModule.enforce; var getInternalState = InternalStateModule.get; var $String = String; // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; var stringSlice = uncurryThis(''.slice); var replace = uncurryThis(''.replace); var join = uncurryThis([].join); var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () { return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8; }); var TEMPLATE = String(String).split('String'); var makeBuiltIn = module.exports = function (value, name, options) { if (stringSlice($String(name), 0, 7) === 'Symbol(') { name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']'; } if (options && options.getter) name = 'get ' + name; if (options && options.setter) name = 'set ' + name; if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) { if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true }); else value.name = name; } if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) { defineProperty(value, 'length', { value: options.arity }); } try { if (options && hasOwn(options, 'constructor') && options.constructor) { if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false }); // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable } else if (value.prototype) value.prototype = undefined; } catch (error) { /* empty */ } var state = enforceInternalState(value); if (!hasOwn(state, 'source')) { state.source = join(TEMPLATE, typeof name == 'string' ? name : ''); } return value; }; // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative // eslint-disable-next-line no-extend-native -- required Function.prototype.toString = makeBuiltIn(function toString() { return isCallable(this) && getInternalState(this).source || inspectSource(this); }, 'toString'); /***/ }), /* 48 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(5); var hasOwn = __webpack_require__(37); var FunctionPrototype = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor; var EXISTS = hasOwn(FunctionPrototype, 'name'); // additional protection from minified / mangled / dropped function names var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something'; var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable)); module.exports = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; /***/ }), /* 49 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); var isCallable = __webpack_require__(20); var store = __webpack_require__(34); var functionToString = uncurryThis(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper if (!isCallable(store.inspectSource)) { store.inspectSource = function (it) { return functionToString(it); }; } module.exports = store.inspectSource; /***/ }), /* 50 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var NATIVE_WEAK_MAP = __webpack_require__(51); var globalThis = __webpack_require__(3); var isObject = __webpack_require__(19); var createNonEnumerableProperty = __webpack_require__(42); var hasOwn = __webpack_require__(37); var shared = __webpack_require__(34); var sharedKey = __webpack_require__(52); var hiddenKeys = __webpack_require__(53); var OBJECT_ALREADY_INITIALIZED = 'Object already initialized'; var TypeError = globalThis.TypeError; var WeakMap = globalThis.WeakMap; var set, get, has; var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw new TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP || shared.state) { var store = shared.state || (shared.state = new WeakMap()); /* eslint-disable no-self-assign -- prototype methods protection */ store.get = store.get; store.has = store.has; store.set = store.set; /* eslint-enable no-self-assign -- prototype methods protection */ set = function (it, metadata) { if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; store.set(it, metadata); return metadata; }; get = function (it) { return store.get(it) || {}; }; has = function (it) { return store.has(it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED); metadata.facade = it; createNonEnumerableProperty(it, STATE, metadata); return metadata; }; get = function (it) { return hasOwn(it, STATE) ? it[STATE] : {}; }; has = function (it) { return hasOwn(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; /***/ }), /* 51 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var isCallable = __webpack_require__(20); var WeakMap = globalThis.WeakMap; module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap)); /***/ }), /* 52 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var shared = __webpack_require__(33); var uid = __webpack_require__(39); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; /***/ }), /* 53 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = {}; /***/ }), /* 54 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var hasOwn = __webpack_require__(37); var ownKeys = __webpack_require__(55); var getOwnPropertyDescriptorModule = __webpack_require__(4); var definePropertyModule = __webpack_require__(43); module.exports = function (target, source, exceptions) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) { defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } } }; /***/ }), /* 55 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var getBuiltIn = __webpack_require__(22); var uncurryThis = __webpack_require__(13); var getOwnPropertyNamesModule = __webpack_require__(56); var getOwnPropertySymbolsModule = __webpack_require__(65); var anObject = __webpack_require__(45); var concat = uncurryThis([].concat); // all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys; }; /***/ }), /* 56 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var internalObjectKeys = __webpack_require__(57); var enumBugKeys = __webpack_require__(64); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.es/ecma262/#sec-object.getownpropertynames // eslint-disable-next-line es/no-object-getownpropertynames -- safe exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; /***/ }), /* 57 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); var hasOwn = __webpack_require__(37); var toIndexedObject = __webpack_require__(11); var indexOf = __webpack_require__(58).indexOf; var hiddenKeys = __webpack_require__(53); var push = uncurryThis([].push); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key); // Don't enum bug & hidden keys while (names.length > i) if (hasOwn(O, key = names[i++])) { ~indexOf(result, key) || push(result, key); } return result; }; /***/ }), /* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toIndexedObject = __webpack_require__(11); var toAbsoluteIndex = __webpack_require__(59); var lengthOfArrayLike = __webpack_require__(62); // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = lengthOfArrayLike(O); if (length === 0) return !IS_INCLUDES && -1; var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare -- NaN check if (IS_INCLUDES && el !== el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check if (value !== value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; module.exports = { // `Array.prototype.includes` method // https://tc39.es/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.es/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; /***/ }), /* 59 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toIntegerOrInfinity = __webpack_require__(60); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). module.exports = function (index, length) { var integer = toIntegerOrInfinity(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; /***/ }), /* 60 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var trunc = __webpack_require__(61); // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity module.exports = function (argument) { var number = +argument; // eslint-disable-next-line no-self-compare -- NaN check return number !== number || number === 0 ? 0 : trunc(number); }; /***/ }), /* 61 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ceil = Math.ceil; var floor = Math.floor; // `Math.trunc` method // https://tc39.es/ecma262/#sec-math.trunc // eslint-disable-next-line es/no-math-trunc -- safe module.exports = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor : ceil)(n); }; /***/ }), /* 62 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toLength = __webpack_require__(63); // `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike module.exports = function (obj) { return toLength(obj.length); }; /***/ }), /* 63 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toIntegerOrInfinity = __webpack_require__(60); var min = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength module.exports = function (argument) { var len = toIntegerOrInfinity(argument); return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; /***/ }), /* 64 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // IE8- don't enum bug keys module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; /***/ }), /* 65 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe exports.f = Object.getOwnPropertySymbols; /***/ }), /* 66 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(6); var isCallable = __webpack_require__(20); var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; /***/ }), /* 67 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var lengthOfArrayLike = __webpack_require__(62); // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed module.exports = function (O, C) { var len = lengthOfArrayLike(O); var A = new C(len); var k = 0; for (; k < len; k++) A[k] = O[len - k - 1]; return A; }; /***/ }), /* 68 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var wellKnownSymbol = __webpack_require__(32); var create = __webpack_require__(69); var defineProperty = __webpack_require__(43).f; var UNSCOPABLES = wellKnownSymbol('unscopables'); var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype[UNSCOPABLES] === undefined) { defineProperty(ArrayPrototype, UNSCOPABLES, { configurable: true, value: create(null) }); } // add a key to Array.prototype[@@unscopables] module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; /***/ }), /* 69 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* global ActiveXObject -- old IE, WSH */ var anObject = __webpack_require__(45); var definePropertiesModule = __webpack_require__(70); var enumBugKeys = __webpack_require__(64); var hiddenKeys = __webpack_require__(53); var html = __webpack_require__(72); var documentCreateElement = __webpack_require__(41); var sharedKey = __webpack_require__(52); var GT = '>'; var LT = '<'; var PROTOTYPE = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey('IE_PROTO'); var EmptyConstructor = function () { /* empty */ }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; // eslint-disable-next-line no-useless-assignment -- avoid memory leak activeXDocument = null; return temp; }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; }; // Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug var activeXDocument; var NullProtoObject = function () { try { activeXDocument = new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; return NullProtoObject(); }; hiddenKeys[IE_PROTO] = true; // `Object.create` method // https://tc39.es/ecma262/#sec-object.create // eslint-disable-next-line es/no-object-create -- safe module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE] = anObject(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = NullProtoObject(); return Properties === undefined ? result : definePropertiesModule.f(result, Properties); }; /***/ }), /* 70 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(5); var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(44); var definePropertyModule = __webpack_require__(43); var anObject = __webpack_require__(45); var toIndexedObject = __webpack_require__(11); var objectKeys = __webpack_require__(71); // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var props = toIndexedObject(Properties); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]); return O; }; /***/ }), /* 71 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var internalObjectKeys = __webpack_require__(57); var enumBugKeys = __webpack_require__(64); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys // eslint-disable-next-line es/no-object-keys -- safe module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; /***/ }), /* 72 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var getBuiltIn = __webpack_require__(22); module.exports = getBuiltIn('document', 'documentElement'); /***/ }), /* 73 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var uncurryThis = __webpack_require__(13); var aCallable = __webpack_require__(29); var toIndexedObject = __webpack_require__(11); var arrayFromConstructorAndList = __webpack_require__(74); var getBuiltInPrototypeMethod = __webpack_require__(75); var addToUnscopables = __webpack_require__(68); var $Array = Array; var sort = uncurryThis(getBuiltInPrototypeMethod('Array', 'sort')); // `Array.prototype.toSorted` method // https://tc39.es/ecma262/#sec-array.prototype.tosorted $({ target: 'Array', proto: true }, { toSorted: function toSorted(compareFn) { if (compareFn !== undefined) aCallable(compareFn); var O = toIndexedObject(this); var A = arrayFromConstructorAndList($Array, O); return sort(A, compareFn); } }); addToUnscopables('toSorted'); /***/ }), /* 74 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var lengthOfArrayLike = __webpack_require__(62); module.exports = function (Constructor, list, $length) { var index = 0; var length = arguments.length > 2 ? $length : lengthOfArrayLike(list); var result = new Constructor(length); while (length > index) result[index] = list[index++]; return result; }; /***/ }), /* 75 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); module.exports = function (CONSTRUCTOR, METHOD) { var Constructor = globalThis[CONSTRUCTOR]; var Prototype = Constructor && Constructor.prototype; return Prototype && Prototype[METHOD]; }; /***/ }), /* 76 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var addToUnscopables = __webpack_require__(68); var doesNotExceedSafeInteger = __webpack_require__(77); var lengthOfArrayLike = __webpack_require__(62); var toAbsoluteIndex = __webpack_require__(59); var toIndexedObject = __webpack_require__(11); var toIntegerOrInfinity = __webpack_require__(60); var $Array = Array; var max = Math.max; var min = Math.min; // `Array.prototype.toSpliced` method // https://tc39.es/ecma262/#sec-array.prototype.tospliced $({ target: 'Array', proto: true }, { toSpliced: function toSpliced(start, deleteCount /* , ...items */) { var O = toIndexedObject(this); var len = lengthOfArrayLike(O); var actualStart = toAbsoluteIndex(start, len); var argumentsLength = arguments.length; var k = 0; var insertCount, actualDeleteCount, newLen, A; if (argumentsLength === 0) { insertCount = actualDeleteCount = 0; } else if (argumentsLength === 1) { insertCount = 0; actualDeleteCount = len - actualStart; } else { insertCount = argumentsLength - 2; actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart); } newLen = doesNotExceedSafeInteger(len + insertCount - actualDeleteCount); A = $Array(newLen); for (; k < actualStart; k++) A[k] = O[k]; for (; k < actualStart + insertCount; k++) A[k] = arguments[k - actualStart + 2]; for (; k < newLen; k++) A[k] = O[k + actualDeleteCount - insertCount]; return A; } }); addToUnscopables('toSpliced'); /***/ }), /* 77 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $TypeError = TypeError; var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991 module.exports = function (it) { if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded'); return it; }; /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var arrayWith = __webpack_require__(79); var toIndexedObject = __webpack_require__(11); var $Array = Array; // `Array.prototype.with` method // https://tc39.es/ecma262/#sec-array.prototype.with $({ target: 'Array', proto: true }, { 'with': function (index, value) { return arrayWith(toIndexedObject(this), $Array, index, value); } }); /***/ }), /* 79 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var lengthOfArrayLike = __webpack_require__(62); var toIntegerOrInfinity = __webpack_require__(60); var $RangeError = RangeError; // https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with // https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with module.exports = function (O, C, index, value) { var len = lengthOfArrayLike(O); var relativeIndex = toIntegerOrInfinity(index); var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex; if (actualIndex >= len || actualIndex < 0) throw new $RangeError('Incorrect index'); var A = new C(len); var k = 0; for (; k < len; k++) A[k] = k === actualIndex ? value : O[k]; return A; }; /***/ }), /* 80 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(5); var defineBuiltInAccessor = __webpack_require__(81); var isDetached = __webpack_require__(82); var ArrayBufferPrototype = ArrayBuffer.prototype; // `ArrayBuffer.prototype.detached` getter // https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.detached if (DESCRIPTORS && !('detached' in ArrayBufferPrototype)) { defineBuiltInAccessor(ArrayBufferPrototype, 'detached', { configurable: true, get: function detached() { return isDetached(this); } }); } /***/ }), /* 81 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var makeBuiltIn = __webpack_require__(47); var defineProperty = __webpack_require__(43); module.exports = function (target, name, descriptor) { if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true }); if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true }); return defineProperty.f(target, name, descriptor); }; /***/ }), /* 82 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var uncurryThis = __webpack_require__(83); var arrayBufferByteLength = __webpack_require__(84); var ArrayBuffer = globalThis.ArrayBuffer; var ArrayBufferPrototype = ArrayBuffer && ArrayBuffer.prototype; var slice = ArrayBufferPrototype && uncurryThis(ArrayBufferPrototype.slice); module.exports = function (O) { if (arrayBufferByteLength(O) !== 0) return false; if (!slice) return false; try { slice(O, 0, 0); return false; } catch (error) { return true; } }; /***/ }), /* 83 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var classofRaw = __webpack_require__(14); var uncurryThis = __webpack_require__(13); module.exports = function (fn) { // Nashorn bug: // https://github.com/zloirock/core-js/issues/1128 // https://github.com/zloirock/core-js/issues/1130 if (classofRaw(fn) === 'Function') return uncurryThis(fn); }; /***/ }), /* 84 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var uncurryThisAccessor = __webpack_require__(85); var classof = __webpack_require__(14); var ArrayBuffer = globalThis.ArrayBuffer; var TypeError = globalThis.TypeError; // Includes // - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]). // - If IsSharedArrayBuffer(O) is true, throw a TypeError exception. module.exports = ArrayBuffer && uncurryThisAccessor(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) { if (classof(O) !== 'ArrayBuffer') throw new TypeError('ArrayBuffer expected'); return O.byteLength; }; /***/ }), /* 85 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); var aCallable = __webpack_require__(29); module.exports = function (object, key, method) { try { // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method])); } catch (error) { /* empty */ } }; /***/ }), /* 86 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var $transfer = __webpack_require__(87); // `ArrayBuffer.prototype.transfer` method // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfer if ($transfer) $({ target: 'ArrayBuffer', proto: true }, { transfer: function transfer() { return $transfer(this, arguments.length ? arguments[0] : undefined, true); } }); /***/ }), /* 87 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var uncurryThis = __webpack_require__(13); var uncurryThisAccessor = __webpack_require__(85); var toIndex = __webpack_require__(88); var notDetached = __webpack_require__(89); var arrayBufferByteLength = __webpack_require__(84); var detachTransferable = __webpack_require__(90); var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(94); var structuredClone = globalThis.structuredClone; var ArrayBuffer = globalThis.ArrayBuffer; var DataView = globalThis.DataView; var min = Math.min; var ArrayBufferPrototype = ArrayBuffer.prototype; var DataViewPrototype = DataView.prototype; var slice = uncurryThis(ArrayBufferPrototype.slice); var isResizable = uncurryThisAccessor(ArrayBufferPrototype, 'resizable', 'get'); var maxByteLength = uncurryThisAccessor(ArrayBufferPrototype, 'maxByteLength', 'get'); var getInt8 = uncurryThis(DataViewPrototype.getInt8); var setInt8 = uncurryThis(DataViewPrototype.setInt8); module.exports = (PROPER_STRUCTURED_CLONE_TRANSFER || detachTransferable) && function (arrayBuffer, newLength, preserveResizability) { var byteLength = arrayBufferByteLength(arrayBuffer); var newByteLength = newLength === undefined ? byteLength : toIndex(newLength); var fixedLength = !isResizable || !isResizable(arrayBuffer); var newBuffer; notDetached(arrayBuffer); if (PROPER_STRUCTURED_CLONE_TRANSFER) { arrayBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] }); if (byteLength === newByteLength && (preserveResizability || fixedLength)) return arrayBuffer; } if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) { newBuffer = slice(arrayBuffer, 0, newByteLength); } else { var options = preserveResizability && !fixedLength && maxByteLength ? { maxByteLength: maxByteLength(arrayBuffer) } : undefined; newBuffer = new ArrayBuffer(newByteLength, options); var a = new DataView(arrayBuffer); var b = new DataView(newBuffer); var copyLength = min(newByteLength, byteLength); for (var i = 0; i < copyLength; i++) setInt8(b, i, getInt8(a, i)); } if (!PROPER_STRUCTURED_CLONE_TRANSFER) detachTransferable(arrayBuffer); return newBuffer; }; /***/ }), /* 88 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toIntegerOrInfinity = __webpack_require__(60); var toLength = __webpack_require__(63); var $RangeError = RangeError; // `ToIndex` abstract operation // https://tc39.es/ecma262/#sec-toindex module.exports = function (it) { if (it === undefined) return 0; var number = toIntegerOrInfinity(it); var length = toLength(number); if (number !== length) throw new $RangeError('Wrong length or index'); return length; }; /***/ }), /* 89 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isDetached = __webpack_require__(82); var $TypeError = TypeError; module.exports = function (it) { if (isDetached(it)) throw new $TypeError('ArrayBuffer is detached'); return it; }; /***/ }), /* 90 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var getBuiltInNodeModule = __webpack_require__(91); var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(94); var structuredClone = globalThis.structuredClone; var $ArrayBuffer = globalThis.ArrayBuffer; var $MessageChannel = globalThis.MessageChannel; var detach = false; var WorkerThreads, channel, buffer, $detach; if (PROPER_STRUCTURED_CLONE_TRANSFER) { detach = function (transferable) { structuredClone(transferable, { transfer: [transferable] }); }; } else if ($ArrayBuffer) try { if (!$MessageChannel) { WorkerThreads = getBuiltInNodeModule('worker_threads'); if (WorkerThreads) $MessageChannel = WorkerThreads.MessageChannel; } if ($MessageChannel) { channel = new $MessageChannel(); buffer = new $ArrayBuffer(2); $detach = function (transferable) { channel.port1.postMessage(null, [transferable]); }; if (buffer.byteLength === 2) { $detach(buffer); if (buffer.byteLength === 0) detach = $detach; } } } catch (error) { /* empty */ } module.exports = detach; /***/ }), /* 91 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var IS_NODE = __webpack_require__(92); module.exports = function (name) { if (IS_NODE) { try { return globalThis.process.getBuiltinModule(name); } catch (error) { /* empty */ } try { // eslint-disable-next-line no-new-func -- safe return Function('return require("' + name + '")')(); } catch (error) { /* empty */ } } }; /***/ }), /* 92 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ENVIRONMENT = __webpack_require__(93); module.exports = ENVIRONMENT === 'NODE'; /***/ }), /* 93 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* global Bun, Deno -- detection */ var globalThis = __webpack_require__(3); var userAgent = __webpack_require__(27); var classof = __webpack_require__(14); var userAgentStartsWith = function (string) { return userAgent.slice(0, string.length) === string; }; module.exports = (function () { if (userAgentStartsWith('Bun/')) return 'BUN'; if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE'; if (userAgentStartsWith('Deno/')) return 'DENO'; if (userAgentStartsWith('Node.js/')) return 'NODE'; if (globalThis.Bun && typeof Bun.version == 'string') return 'BUN'; if (globalThis.Deno && typeof Deno.version == 'object') return 'DENO'; if (classof(globalThis.process) === 'process') return 'NODE'; if (globalThis.window && globalThis.document) return 'BROWSER'; return 'REST'; })(); /***/ }), /* 94 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var fails = __webpack_require__(6); var V8 = __webpack_require__(26); var ENVIRONMENT = __webpack_require__(93); var structuredClone = globalThis.structuredClone; module.exports = !!structuredClone && !fails(function () { // prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation // https://github.com/zloirock/core-js/issues/679 if ((ENVIRONMENT === 'DENO' && V8 > 92) || (ENVIRONMENT === 'NODE' && V8 > 94) || (ENVIRONMENT === 'BROWSER' && V8 > 97)) return false; var buffer = new ArrayBuffer(8); var clone = structuredClone(buffer, { transfer: [buffer] }); return buffer.byteLength !== 0 || clone.byteLength !== 8; }); /***/ }), /* 95 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var $transfer = __webpack_require__(87); // `ArrayBuffer.prototype.transferToFixedLength` method // https://tc39.es/proposal-arraybuffer-transfer/#sec-arraybuffer.prototype.transfertofixedlength if ($transfer) $({ target: 'ArrayBuffer', proto: true }, { transferToFixedLength: function transferToFixedLength() { return $transfer(this, arguments.length ? arguments[0] : undefined, false); } }); /***/ }), /* 96 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var uncurryThis = __webpack_require__(13); var aCallable = __webpack_require__(29); var requireObjectCoercible = __webpack_require__(15); var iterate = __webpack_require__(97); var MapHelpers = __webpack_require__(106); var IS_PURE = __webpack_require__(35); var fails = __webpack_require__(6); var Map = MapHelpers.Map; var has = MapHelpers.has; var get = MapHelpers.get; var set = MapHelpers.set; var push = uncurryThis([].push); var DOES_NOT_WORK_WITH_PRIMITIVES = IS_PURE || fails(function () { return Map.groupBy('ab', function (it) { return it; }).get('a').length !== 1; }); // `Map.groupBy` method // https://tc39.es/ecma262/#sec-map.groupby $({ target: 'Map', stat: true, forced: IS_PURE || DOES_NOT_WORK_WITH_PRIMITIVES }, { groupBy: function groupBy(items, callbackfn) { requireObjectCoercible(items); aCallable(callbackfn); var map = new Map(); var k = 0; iterate(items, function (value) { var key = callbackfn(value, k++); if (!has(map, key)) set(map, key, [value]); else push(get(map, key), value); }); return map; } }); /***/ }), /* 97 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var bind = __webpack_require__(98); var call = __webpack_require__(7); var anObject = __webpack_require__(45); var tryToString = __webpack_require__(30); var isArrayIteratorMethod = __webpack_require__(99); var lengthOfArrayLike = __webpack_require__(62); var isPrototypeOf = __webpack_require__(23); var getIterator = __webpack_require__(101); var getIteratorMethod = __webpack_require__(102); var iteratorClose = __webpack_require__(105); var $TypeError = TypeError; var Result = function (stopped, result) { this.stopped = stopped; this.result = result; }; var ResultPrototype = Result.prototype; module.exports = function (iterable, unboundFunction, options) { var that = options && options.that; var AS_ENTRIES = !!(options && options.AS_ENTRIES); var IS_RECORD = !!(options && options.IS_RECORD); var IS_ITERATOR = !!(options && options.IS_ITERATOR); var INTERRUPTED = !!(options && options.INTERRUPTED); var fn = bind(unboundFunction, that); var iterator, iterFn, index, length, result, next, step; var stop = function (condition) { if (iterator) iteratorClose(iterator, 'normal', condition); return new Result(true, condition); }; var callFn = function (value) { if (AS_ENTRIES) { anObject(value); return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]); } return INTERRUPTED ? fn(value, stop) : fn(value); }; if (IS_RECORD) { iterator = iterable.iterator; } else if (IS_ITERATOR) { iterator = iterable; } else { iterFn = getIteratorMethod(iterable); if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable'); // optimisation for array iterators if (isArrayIteratorMethod(iterFn)) { for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) { result = callFn(iterable[index]); if (result && isPrototypeOf(ResultPrototype, result)) return result; } return new Result(false); } iterator = getIterator(iterable, iterFn); } next = IS_RECORD ? iterable.next : iterator.next; while (!(step = call(next, iterator)).done) { try { result = callFn(step.value); } catch (error) { iteratorClose(iterator, 'throw', error); } if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result; } return new Result(false); }; /***/ }), /* 98 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(83); var aCallable = __webpack_require__(29); var NATIVE_BIND = __webpack_require__(8); var bind = uncurryThis(uncurryThis.bind); // optional / simple context binding module.exports = function (fn, that) { aCallable(fn); return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) { return fn.apply(that, arguments); }; }; /***/ }), /* 99 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var wellKnownSymbol = __webpack_require__(32); var Iterators = __webpack_require__(100); var ITERATOR = wellKnownSymbol('iterator'); var ArrayPrototype = Array.prototype; // check on default Array iterator module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); }; /***/ }), /* 100 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = {}; /***/ }), /* 101 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(7); var aCallable = __webpack_require__(29); var anObject = __webpack_require__(45); var tryToString = __webpack_require__(30); var getIteratorMethod = __webpack_require__(102); var $TypeError = TypeError; module.exports = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument)); throw new $TypeError(tryToString(argument) + ' is not iterable'); }; /***/ }), /* 102 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var classof = __webpack_require__(103); var getMethod = __webpack_require__(28); var isNullOrUndefined = __webpack_require__(16); var Iterators = __webpack_require__(100); var wellKnownSymbol = __webpack_require__(32); var ITERATOR = wellKnownSymbol('iterator'); module.exports = function (it) { if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)]; }; /***/ }), /* 103 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var TO_STRING_TAG_SUPPORT = __webpack_require__(104); var isCallable = __webpack_require__(20); var classofRaw = __webpack_require__(14); var wellKnownSymbol = __webpack_require__(32); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var $Object = Object; // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result; }; /***/ }), /* 104 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var wellKnownSymbol = __webpack_require__(32); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; /***/ }), /* 105 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(7); var anObject = __webpack_require__(45); var getMethod = __webpack_require__(28); module.exports = function (iterator, kind, value) { var innerResult, innerError; anObject(iterator); try { innerResult = getMethod(iterator, 'return'); if (!innerResult) { if (kind === 'throw') throw value; return value; } innerResult = call(innerResult, iterator); } catch (error) { innerError = true; innerResult = error; } if (kind === 'throw') throw value; if (innerError) throw innerResult; anObject(innerResult); return value; }; /***/ }), /* 106 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); // eslint-disable-next-line es/no-map -- safe var MapPrototype = Map.prototype; module.exports = { // eslint-disable-next-line es/no-map -- safe Map: Map, set: uncurryThis(MapPrototype.set), get: uncurryThis(MapPrototype.get), has: uncurryThis(MapPrototype.has), remove: uncurryThis(MapPrototype['delete']), proto: MapPrototype }; /***/ }), /* 107 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var getBuiltIn = __webpack_require__(22); var uncurryThis = __webpack_require__(13); var aCallable = __webpack_require__(29); var requireObjectCoercible = __webpack_require__(15); var toPropertyKey = __webpack_require__(17); var iterate = __webpack_require__(97); var fails = __webpack_require__(6); // eslint-disable-next-line es/no-object-groupby -- testing var nativeGroupBy = Object.groupBy; var create = getBuiltIn('Object', 'create'); var push = uncurryThis([].push); var DOES_NOT_WORK_WITH_PRIMITIVES = !nativeGroupBy || fails(function () { return nativeGroupBy('ab', function (it) { return it; }).a.length !== 1; }); // `Object.groupBy` method // https://tc39.es/ecma262/#sec-object.groupby $({ target: 'Object', stat: true, forced: DOES_NOT_WORK_WITH_PRIMITIVES }, { groupBy: function groupBy(items, callbackfn) { requireObjectCoercible(items); aCallable(callbackfn); var obj = create(null); var k = 0; iterate(items, function (value) { var key = toPropertyKey(callbackfn(value, k++)); // in some IE versions, `hasOwnProperty` returns incorrect result on integer keys // but since it's a `null` prototype object, we can safely use `in` if (key in obj) push(obj[key], value); else obj[key] = [value]; }); return obj; } }); /***/ }), /* 108 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var globalThis = __webpack_require__(3); var apply = __webpack_require__(109); var slice = __webpack_require__(110); var newPromiseCapabilityModule = __webpack_require__(111); var aCallable = __webpack_require__(29); var perform = __webpack_require__(112); var Promise = globalThis.Promise; var ACCEPT_ARGUMENTS = false; // Avoiding the use of polyfills of the previous iteration of this proposal // that does not accept arguments of the callback var FORCED = !Promise || !Promise['try'] || perform(function () { Promise['try'](function (argument) { ACCEPT_ARGUMENTS = argument === 8; }, 8); }).error || !ACCEPT_ARGUMENTS; // `Promise.try` method // https://tc39.es/ecma262/#sec-promise.try $({ target: 'Promise', stat: true, forced: FORCED }, { 'try': function (callbackfn /* , ...args */) { var args = arguments.length > 1 ? slice(arguments, 1) : []; var promiseCapability = newPromiseCapabilityModule.f(this); var result = perform(function () { return apply(aCallable(callbackfn), undefined, args); }); (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value); return promiseCapability.promise; } }); /***/ }), /* 109 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var NATIVE_BIND = __webpack_require__(8); var FunctionPrototype = Function.prototype; var apply = FunctionPrototype.apply; var call = FunctionPrototype.call; // eslint-disable-next-line es/no-reflect -- safe module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () { return call.apply(apply, arguments); }); /***/ }), /* 110 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); module.exports = uncurryThis([].slice); /***/ }), /* 111 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var aCallable = __webpack_require__(29); var $TypeError = TypeError; var PromiseCapability = function (C) { var resolve, reject; this.promise = new C(function ($$resolve, $$reject) { if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor'); resolve = $$resolve; reject = $$reject; }); this.resolve = aCallable(resolve); this.reject = aCallable(reject); }; // `NewPromiseCapability` abstract operation // https://tc39.es/ecma262/#sec-newpromisecapability module.exports.f = function (C) { return new PromiseCapability(C); }; /***/ }), /* 112 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function (exec) { try { return { error: false, value: exec() }; } catch (error) { return { error: true, value: error }; } }; /***/ }), /* 113 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var newPromiseCapabilityModule = __webpack_require__(111); // `Promise.withResolvers` method // https://tc39.es/ecma262/#sec-promise.withResolvers $({ target: 'Promise', stat: true }, { withResolvers: function withResolvers() { var promiseCapability = newPromiseCapabilityModule.f(this); return { promise: promiseCapability.promise, resolve: promiseCapability.resolve, reject: promiseCapability.reject }; } }); /***/ }), /* 114 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var globalThis = __webpack_require__(3); var DESCRIPTORS = __webpack_require__(5); var defineBuiltInAccessor = __webpack_require__(81); var regExpFlags = __webpack_require__(115); var fails = __webpack_require__(6); // babel-minify and Closure Compiler transpiles RegExp('.', 'd') -> /./d and it causes SyntaxError var RegExp = globalThis.RegExp; var RegExpPrototype = RegExp.prototype; var FORCED = DESCRIPTORS && fails(function () { var INDICES_SUPPORT = true; try { RegExp('.', 'd'); } catch (error) { INDICES_SUPPORT = false; } var O = {}; // modern V8 bug var calls = ''; var expected = INDICES_SUPPORT ? 'dgimsy' : 'gimsy'; var addGetter = function (key, chr) { // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(O, key, { get: function () { calls += chr; return true; } }); }; var pairs = { dotAll: 's', global: 'g', ignoreCase: 'i', multiline: 'm', sticky: 'y' }; if (INDICES_SUPPORT) pairs.hasIndices = 'd'; for (var key in pairs) addGetter(key, pairs[key]); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var result = Object.getOwnPropertyDescriptor(RegExpPrototype, 'flags').get.call(O); return result !== expected || calls !== expected; }); // `RegExp.prototype.flags` getter // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags if (FORCED) defineBuiltInAccessor(RegExpPrototype, 'flags', { configurable: true, get: regExpFlags }); /***/ }), /* 115 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var anObject = __webpack_require__(45); // `RegExp.prototype.flags` getter implementation // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags module.exports = function () { var that = anObject(this); var result = ''; if (that.hasIndices) result += 'd'; if (that.global) result += 'g'; if (that.ignoreCase) result += 'i'; if (that.multiline) result += 'm'; if (that.dotAll) result += 's'; if (that.unicode) result += 'u'; if (that.unicodeSets) result += 'v'; if (that.sticky) result += 'y'; return result; }; /***/ }), /* 116 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var uncurryThis = __webpack_require__(13); var requireObjectCoercible = __webpack_require__(15); var toString = __webpack_require__(117); var charCodeAt = uncurryThis(''.charCodeAt); // `String.prototype.isWellFormed` method // https://tc39.es/ecma262/#sec-string.prototype.iswellformed $({ target: 'String', proto: true }, { isWellFormed: function isWellFormed() { var S = toString(requireObjectCoercible(this)); var length = S.length; for (var i = 0; i < length; i++) { var charCode = charCodeAt(S, i); // single UTF-16 code unit if ((charCode & 0xF800) !== 0xD800) continue; // unpaired surrogate if (charCode >= 0xDC00 || ++i >= length || (charCodeAt(S, i) & 0xFC00) !== 0xDC00) return false; } return true; } }); /***/ }), /* 117 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var classof = __webpack_require__(103); var $String = String; module.exports = function (argument) { if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string'); return $String(argument); }; /***/ }), /* 118 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var call = __webpack_require__(7); var uncurryThis = __webpack_require__(13); var requireObjectCoercible = __webpack_require__(15); var toString = __webpack_require__(117); var fails = __webpack_require__(6); var $Array = Array; var charAt = uncurryThis(''.charAt); var charCodeAt = uncurryThis(''.charCodeAt); var join = uncurryThis([].join); // eslint-disable-next-line es/no-string-prototype-towellformed -- safe var $toWellFormed = ''.toWellFormed; var REPLACEMENT_CHARACTER = '\uFFFD'; // Safari bug var TO_STRING_CONVERSION_BUG = $toWellFormed && fails(function () { return call($toWellFormed, 1) !== '1'; }); // `String.prototype.toWellFormed` method // https://tc39.es/ecma262/#sec-string.prototype.towellformed $({ target: 'String', proto: true, forced: TO_STRING_CONVERSION_BUG }, { toWellFormed: function toWellFormed() { var S = toString(requireObjectCoercible(this)); if (TO_STRING_CONVERSION_BUG) return call($toWellFormed, S); var length = S.length; var result = $Array(length); for (var i = 0; i < length; i++) { var charCode = charCodeAt(S, i); // single UTF-16 code unit if ((charCode & 0xF800) !== 0xD800) result[i] = charAt(S, i); // unpaired surrogate else if (charCode >= 0xDC00 || i + 1 >= length || (charCodeAt(S, i + 1) & 0xFC00) !== 0xDC00) result[i] = REPLACEMENT_CHARACTER; // surrogate pair else { result[i] = charAt(S, i); result[++i] = charAt(S, i); } } return join(result, ''); } }); /***/ }), /* 119 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var arrayToReversed = __webpack_require__(67); var ArrayBufferViewCore = __webpack_require__(120); var aTypedArray = ArrayBufferViewCore.aTypedArray; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; // `%TypedArray%.prototype.toReversed` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.toreversed exportTypedArrayMethod('toReversed', function toReversed() { return arrayToReversed(aTypedArray(this), getTypedArrayConstructor(this)); }); /***/ }), /* 120 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var NATIVE_ARRAY_BUFFER = __webpack_require__(121); var DESCRIPTORS = __webpack_require__(5); var globalThis = __webpack_require__(3); var isCallable = __webpack_require__(20); var isObject = __webpack_require__(19); var hasOwn = __webpack_require__(37); var classof = __webpack_require__(103); var tryToString = __webpack_require__(30); var createNonEnumerableProperty = __webpack_require__(42); var defineBuiltIn = __webpack_require__(46); var defineBuiltInAccessor = __webpack_require__(81); var isPrototypeOf = __webpack_require__(23); var getPrototypeOf = __webpack_require__(122); var setPrototypeOf = __webpack_require__(124); var wellKnownSymbol = __webpack_require__(32); var uid = __webpack_require__(39); var InternalStateModule = __webpack_require__(50); var enforceInternalState = InternalStateModule.enforce; var getInternalState = InternalStateModule.get; var Int8Array = globalThis.Int8Array; var Int8ArrayPrototype = Int8Array && Int8Array.prototype; var Uint8ClampedArray = globalThis.Uint8ClampedArray; var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype; var TypedArray = Int8Array && getPrototypeOf(Int8Array); var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype); var ObjectPrototype = Object.prototype; var TypeError = globalThis.TypeError; var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG'); var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor'; // Fixing native typed arrays in Opera Presto crashes the browser, see #595 var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(globalThis.opera) !== 'Opera'; var TYPED_ARRAY_TAG_REQUIRED = false; var NAME, Constructor, Prototype; var TypedArrayConstructorsList = { Int8Array: 1, Uint8Array: 1, Uint8ClampedArray: 1, Int16Array: 2, Uint16Array: 2, Int32Array: 4, Uint32Array: 4, Float32Array: 4, Float64Array: 8 }; var BigIntArrayConstructorsList = { BigInt64Array: 8, BigUint64Array: 8 }; var isView = function isView(it) { if (!isObject(it)) return false; var klass = classof(it); return klass === 'DataView' || hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass); }; var getTypedArrayConstructor = function (it) { var proto = getPrototypeOf(it); if (!isObject(proto)) return; var state = getInternalState(proto); return (state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto); }; var isTypedArray = function (it) { if (!isObject(it)) return false; var klass = classof(it); return hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass); }; var aTypedArray = function (it) { if (isTypedArray(it)) return it; throw new TypeError('Target is not a typed array'); }; var aTypedArrayConstructor = function (C) { if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C; throw new TypeError(tryToString(C) + ' is not a typed array constructor'); }; var exportTypedArrayMethod = function (KEY, property, forced, options) { if (!DESCRIPTORS) return; if (forced) for (var ARRAY in TypedArrayConstructorsList) { var TypedArrayConstructor = globalThis[ARRAY]; if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try { delete TypedArrayConstructor.prototype[KEY]; } catch (error) { // old WebKit bug - some methods are non-configurable try { TypedArrayConstructor.prototype[KEY] = property; } catch (error2) { /* empty */ } } } if (!TypedArrayPrototype[KEY] || forced) { defineBuiltIn(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options); } }; var exportTypedArrayStaticMethod = function (KEY, property, forced) { var ARRAY, TypedArrayConstructor; if (!DESCRIPTORS) return; if (setPrototypeOf) { if (forced) for (ARRAY in TypedArrayConstructorsList) { TypedArrayConstructor = globalThis[ARRAY]; if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try { delete TypedArrayConstructor[KEY]; } catch (error) { /* empty */ } } if (!TypedArray[KEY] || forced) { // V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable try { return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property); } catch (error) { /* empty */ } } else return; } for (ARRAY in TypedArrayConstructorsList) { TypedArrayConstructor = globalThis[ARRAY]; if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) { defineBuiltIn(TypedArrayConstructor, KEY, property); } } }; for (NAME in TypedArrayConstructorsList) { Constructor = globalThis[NAME]; Prototype = Constructor && Constructor.prototype; if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; else NATIVE_ARRAY_BUFFER_VIEWS = false; } for (NAME in BigIntArrayConstructorsList) { Constructor = globalThis[NAME]; Prototype = Constructor && Constructor.prototype; if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor; } // WebKit bug - typed arrays constructors prototype is Object.prototype if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) { // eslint-disable-next-line no-shadow -- safe TypedArray = function TypedArray() { throw new TypeError('Incorrect invocation'); }; if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { if (globalThis[NAME]) setPrototypeOf(globalThis[NAME], TypedArray); } } if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) { TypedArrayPrototype = TypedArray.prototype; if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) { if (globalThis[NAME]) setPrototypeOf(globalThis[NAME].prototype, TypedArrayPrototype); } } // WebKit bug - one more object in Uint8ClampedArray prototype chain if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) { setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype); } if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) { TYPED_ARRAY_TAG_REQUIRED = true; defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, { configurable: true, get: function () { return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined; } }); for (NAME in TypedArrayConstructorsList) if (globalThis[NAME]) { createNonEnumerableProperty(globalThis[NAME], TYPED_ARRAY_TAG, NAME); } } module.exports = { NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS, TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG, aTypedArray: aTypedArray, aTypedArrayConstructor: aTypedArrayConstructor, exportTypedArrayMethod: exportTypedArrayMethod, exportTypedArrayStaticMethod: exportTypedArrayStaticMethod, getTypedArrayConstructor: getTypedArrayConstructor, isView: isView, isTypedArray: isTypedArray, TypedArray: TypedArray, TypedArrayPrototype: TypedArrayPrototype }; /***/ }), /* 121 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // eslint-disable-next-line es/no-typed-arrays -- safe module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined'; /***/ }), /* 122 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var hasOwn = __webpack_require__(37); var isCallable = __webpack_require__(20); var toObject = __webpack_require__(38); var sharedKey = __webpack_require__(52); var CORRECT_PROTOTYPE_GETTER = __webpack_require__(123); var IE_PROTO = sharedKey('IE_PROTO'); var $Object = Object; var ObjectPrototype = $Object.prototype; // `Object.getPrototypeOf` method // https://tc39.es/ecma262/#sec-object.getprototypeof // eslint-disable-next-line es/no-object-getprototypeof -- safe module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) { var object = toObject(O); if (hasOwn(object, IE_PROTO)) return object[IE_PROTO]; var constructor = object.constructor; if (isCallable(constructor) && object instanceof constructor) { return constructor.prototype; } return object instanceof $Object ? ObjectPrototype : null; }; /***/ }), /* 123 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(6); module.exports = !fails(function () { function F() { /* empty */ } F.prototype.constructor = null; // eslint-disable-next-line es/no-object-getprototypeof -- required for testing return Object.getPrototypeOf(new F()) !== F.prototype; }); /***/ }), /* 124 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint-disable no-proto -- safe */ var uncurryThisAccessor = __webpack_require__(85); var isObject = __webpack_require__(19); var requireObjectCoercible = __webpack_require__(15); var aPossiblePrototype = __webpack_require__(125); // `Object.setPrototypeOf` method // https://tc39.es/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. // eslint-disable-next-line es/no-object-setprototypeof -- safe module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set'); setter(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { requireObjectCoercible(O); aPossiblePrototype(proto); if (!isObject(O)) return O; if (CORRECT_SETTER) setter(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); /***/ }), /* 125 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isPossiblePrototype = __webpack_require__(126); var $String = String; var $TypeError = TypeError; module.exports = function (argument) { if (isPossiblePrototype(argument)) return argument; throw new $TypeError("Can't set " + $String(argument) + ' as a prototype'); }; /***/ }), /* 126 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isObject = __webpack_require__(19); module.exports = function (argument) { return isObject(argument) || argument === null; }; /***/ }), /* 127 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ArrayBufferViewCore = __webpack_require__(120); var uncurryThis = __webpack_require__(13); var aCallable = __webpack_require__(29); var arrayFromConstructorAndList = __webpack_require__(74); var aTypedArray = ArrayBufferViewCore.aTypedArray; var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var sort = uncurryThis(ArrayBufferViewCore.TypedArrayPrototype.sort); // `%TypedArray%.prototype.toSorted` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.tosorted exportTypedArrayMethod('toSorted', function toSorted(compareFn) { if (compareFn !== undefined) aCallable(compareFn); var O = aTypedArray(this); var A = arrayFromConstructorAndList(getTypedArrayConstructor(O), O); return sort(A, compareFn); }); /***/ }), /* 128 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var arrayWith = __webpack_require__(79); var ArrayBufferViewCore = __webpack_require__(120); var isBigIntArray = __webpack_require__(129); var toIntegerOrInfinity = __webpack_require__(60); var toBigInt = __webpack_require__(130); var aTypedArray = ArrayBufferViewCore.aTypedArray; var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor; var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; var PROPER_ORDER = !!function () { try { // eslint-disable-next-line no-throw-literal, es/no-typed-arrays, es/no-array-prototype-with -- required for testing new Int8Array(1)['with'](2, { valueOf: function () { throw 8; } }); } catch (error) { // some early implementations, like WebKit, does not follow the final semantic // https://github.com/tc39/proposal-change-array-by-copy/pull/86 return error === 8; } }(); // `%TypedArray%.prototype.with` method // https://tc39.es/ecma262/#sec-%typedarray%.prototype.with exportTypedArrayMethod('with', { 'with': function (index, value) { var O = aTypedArray(this); var relativeIndex = toIntegerOrInfinity(index); var actualValue = isBigIntArray(O) ? toBigInt(value) : +value; return arrayWith(O, getTypedArrayConstructor(O), relativeIndex, actualValue); } }['with'], !PROPER_ORDER); /***/ }), /* 129 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var classof = __webpack_require__(103); module.exports = function (it) { var klass = classof(it); return klass === 'BigInt64Array' || klass === 'BigUint64Array'; }; /***/ }), /* 130 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toPrimitive = __webpack_require__(18); var $TypeError = TypeError; // `ToBigInt` abstract operation // https://tc39.es/ecma262/#sec-tobigint module.exports = function (argument) { var prim = toPrimitive(argument, 'number'); if (typeof prim == 'number') throw new $TypeError("Can't convert number to bigint"); // eslint-disable-next-line es/no-bigint -- safe return BigInt(prim); }; /***/ }), /* 131 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var globalThis = __webpack_require__(3); var getBuiltIn = __webpack_require__(22); var createPropertyDescriptor = __webpack_require__(10); var defineProperty = __webpack_require__(43).f; var hasOwn = __webpack_require__(37); var anInstance = __webpack_require__(132); var inheritIfRequired = __webpack_require__(133); var normalizeStringArgument = __webpack_require__(134); var DOMExceptionConstants = __webpack_require__(135); var clearErrorStack = __webpack_require__(136); var DESCRIPTORS = __webpack_require__(5); var IS_PURE = __webpack_require__(35); var DOM_EXCEPTION = 'DOMException'; var Error = getBuiltIn('Error'); var NativeDOMException = getBuiltIn(DOM_EXCEPTION); var $DOMException = function DOMException() { anInstance(this, DOMExceptionPrototype); var argumentsLength = arguments.length; var message = normalizeStringArgument(argumentsLength < 1 ? undefined : arguments[0]); var name = normalizeStringArgument(argumentsLength < 2 ? undefined : arguments[1], 'Error'); var that = new NativeDOMException(message, name); var error = new Error(message); error.name = DOM_EXCEPTION; defineProperty(that, 'stack', createPropertyDescriptor(1, clearErrorStack(error.stack, 1))); inheritIfRequired(that, this, $DOMException); return that; }; var DOMExceptionPrototype = $DOMException.prototype = NativeDOMException.prototype; var ERROR_HAS_STACK = 'stack' in new Error(DOM_EXCEPTION); var DOM_EXCEPTION_HAS_STACK = 'stack' in new NativeDOMException(1, 2); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis, DOM_EXCEPTION); // Bun ~ 0.1.1 DOMException have incorrect descriptor and we can't redefine it // https://github.com/Jarred-Sumner/bun/issues/399 var BUGGY_DESCRIPTOR = !!descriptor && !(descriptor.writable && descriptor.configurable); var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK; // `DOMException` constructor patch for `.stack` where it's required // https://webidl.spec.whatwg.org/#es-DOMException-specialness $({ global: true, constructor: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException }); var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION); var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype; if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) { if (!IS_PURE) { defineProperty(PolyfilledDOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, PolyfilledDOMException)); } for (var key in DOMExceptionConstants) if (hasOwn(DOMExceptionConstants, key)) { var constant = DOMExceptionConstants[key]; var constantName = constant.s; if (!hasOwn(PolyfilledDOMException, constantName)) { defineProperty(PolyfilledDOMException, constantName, createPropertyDescriptor(6, constant.c)); } } } /***/ }), /* 132 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isPrototypeOf = __webpack_require__(23); var $TypeError = TypeError; module.exports = function (it, Prototype) { if (isPrototypeOf(Prototype, it)) return it; throw new $TypeError('Incorrect invocation'); }; /***/ }), /* 133 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var isCallable = __webpack_require__(20); var isObject = __webpack_require__(19); var setPrototypeOf = __webpack_require__(124); // makes subclassing work correct for wrapped built-ins module.exports = function ($this, dummy, Wrapper) { var NewTarget, NewTargetPrototype; if ( // it can work only with native `setPrototypeOf` setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype ) setPrototypeOf($this, NewTargetPrototype); return $this; }; /***/ }), /* 134 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toString = __webpack_require__(117); module.exports = function (argument, $default) { return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument); }; /***/ }), /* 135 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = { IndexSizeError: { s: 'INDEX_SIZE_ERR', c: 1, m: 1 }, DOMStringSizeError: { s: 'DOMSTRING_SIZE_ERR', c: 2, m: 0 }, HierarchyRequestError: { s: 'HIERARCHY_REQUEST_ERR', c: 3, m: 1 }, WrongDocumentError: { s: 'WRONG_DOCUMENT_ERR', c: 4, m: 1 }, InvalidCharacterError: { s: 'INVALID_CHARACTER_ERR', c: 5, m: 1 }, NoDataAllowedError: { s: 'NO_DATA_ALLOWED_ERR', c: 6, m: 0 }, NoModificationAllowedError: { s: 'NO_MODIFICATION_ALLOWED_ERR', c: 7, m: 1 }, NotFoundError: { s: 'NOT_FOUND_ERR', c: 8, m: 1 }, NotSupportedError: { s: 'NOT_SUPPORTED_ERR', c: 9, m: 1 }, InUseAttributeError: { s: 'INUSE_ATTRIBUTE_ERR', c: 10, m: 1 }, InvalidStateError: { s: 'INVALID_STATE_ERR', c: 11, m: 1 }, SyntaxError: { s: 'SYNTAX_ERR', c: 12, m: 1 }, InvalidModificationError: { s: 'INVALID_MODIFICATION_ERR', c: 13, m: 1 }, NamespaceError: { s: 'NAMESPACE_ERR', c: 14, m: 1 }, InvalidAccessError: { s: 'INVALID_ACCESS_ERR', c: 15, m: 1 }, ValidationError: { s: 'VALIDATION_ERR', c: 16, m: 0 }, TypeMismatchError: { s: 'TYPE_MISMATCH_ERR', c: 17, m: 1 }, SecurityError: { s: 'SECURITY_ERR', c: 18, m: 1 }, NetworkError: { s: 'NETWORK_ERR', c: 19, m: 1 }, AbortError: { s: 'ABORT_ERR', c: 20, m: 1 }, URLMismatchError: { s: 'URL_MISMATCH_ERR', c: 21, m: 1 }, QuotaExceededError: { s: 'QUOTA_EXCEEDED_ERR', c: 22, m: 1 }, TimeoutError: { s: 'TIMEOUT_ERR', c: 23, m: 1 }, InvalidNodeTypeError: { s: 'INVALID_NODE_TYPE_ERR', c: 24, m: 1 }, DataCloneError: { s: 'DATA_CLONE_ERR', c: 25, m: 1 } }; /***/ }), /* 136 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); var $Error = Error; var replace = uncurryThis(''.replace); var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd'); // eslint-disable-next-line redos/no-vulnerable, sonarjs/slow-regex -- safe var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/; var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST); module.exports = function (stack, dropEntries) { if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) { while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, ''); } return stack; }; /***/ }), /* 137 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var IS_PURE = __webpack_require__(35); var $ = __webpack_require__(2); var globalThis = __webpack_require__(3); var getBuiltIn = __webpack_require__(22); var uncurryThis = __webpack_require__(13); var fails = __webpack_require__(6); var uid = __webpack_require__(39); var isCallable = __webpack_require__(20); var isConstructor = __webpack_require__(138); var isNullOrUndefined = __webpack_require__(16); var isObject = __webpack_require__(19); var isSymbol = __webpack_require__(21); var iterate = __webpack_require__(97); var anObject = __webpack_require__(45); var classof = __webpack_require__(103); var hasOwn = __webpack_require__(37); var createProperty = __webpack_require__(139); var createNonEnumerableProperty = __webpack_require__(42); var lengthOfArrayLike = __webpack_require__(62); var validateArgumentsLength = __webpack_require__(140); var getRegExpFlags = __webpack_require__(141); var MapHelpers = __webpack_require__(106); var SetHelpers = __webpack_require__(142); var setIterate = __webpack_require__(143); var detachTransferable = __webpack_require__(90); var ERROR_STACK_INSTALLABLE = __webpack_require__(145); var PROPER_STRUCTURED_CLONE_TRANSFER = __webpack_require__(94); var Object = globalThis.Object; var Array = globalThis.Array; var Date = globalThis.Date; var Error = globalThis.Error; var TypeError = globalThis.TypeError; var PerformanceMark = globalThis.PerformanceMark; var DOMException = getBuiltIn('DOMException'); var Map = MapHelpers.Map; var mapHas = MapHelpers.has; var mapGet = MapHelpers.get; var mapSet = MapHelpers.set; var Set = SetHelpers.Set; var setAdd = SetHelpers.add; var setHas = SetHelpers.has; var objectKeys = getBuiltIn('Object', 'keys'); var push = uncurryThis([].push); var thisBooleanValue = uncurryThis(true.valueOf); var thisNumberValue = uncurryThis(1.0.valueOf); var thisStringValue = uncurryThis(''.valueOf); var thisTimeValue = uncurryThis(Date.prototype.getTime); var PERFORMANCE_MARK = uid('structuredClone'); var DATA_CLONE_ERROR = 'DataCloneError'; var TRANSFERRING = 'Transferring'; var checkBasicSemantic = function (structuredCloneImplementation) { return !fails(function () { var set1 = new globalThis.Set([7]); var set2 = structuredCloneImplementation(set1); var number = structuredCloneImplementation(Object(7)); return set2 === set1 || !set2.has(7) || !isObject(number) || +number !== 7; }) && structuredCloneImplementation; }; var checkErrorsCloning = function (structuredCloneImplementation, $Error) { return !fails(function () { var error = new $Error(); var test = structuredCloneImplementation({ a: error, b: error }); return !(test && test.a === test.b && test.a instanceof $Error && test.a.stack === error.stack); }); }; // https://github.com/whatwg/html/pull/5749 var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) { return !fails(function () { var test = structuredCloneImplementation(new globalThis.AggregateError([1], PERFORMANCE_MARK, { cause: 3 })); return test.name !== 'AggregateError' || test.errors[0] !== 1 || test.message !== PERFORMANCE_MARK || test.cause !== 3; }); }; // FF94+, Safari 15.4+, Chrome 98+, NodeJS 17.0+, Deno 1.13+ // FF<103 and Safari implementations can't clone errors // https://bugzilla.mozilla.org/show_bug.cgi?id=1556604 // FF103 can clone errors, but `.stack` of clone is an empty string // https://bugzilla.mozilla.org/show_bug.cgi?id=1778762 // FF104+ fixed it on usual errors, but not on DOMExceptions // https://bugzilla.mozilla.org/show_bug.cgi?id=1777321 // Chrome <102 returns `null` if cloned object contains multiple references to one error // https://bugs.chromium.org/p/v8/issues/detail?id=12542 // NodeJS implementation can't clone DOMExceptions // https://github.com/nodejs/node/issues/41038 // only FF103+ supports new (html/5749) error cloning semantic var nativeStructuredClone = globalThis.structuredClone; var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone, Error) || !checkErrorsCloning(nativeStructuredClone, DOMException) || !checkNewErrorsCloningSemantic(nativeStructuredClone); // Chrome 82+, Safari 14.1+, Deno 1.11+ // Chrome 78-81 implementation swaps `.name` and `.message` of cloned `DOMException` // Chrome returns `null` if cloned object contains multiple references to one error // Safari 14.1 implementation doesn't clone some `RegExp` flags, so requires a workaround // Safari implementation can't clone errors // Deno 1.2-1.10 implementations too naive // NodeJS 16.0+ does not have `PerformanceMark` constructor // NodeJS <17.2 structured cloning implementation from `performance.mark` is too naive // and can't clone, for example, `RegExp` or some boxed primitives // https://github.com/nodejs/node/issues/40840 // no one of those implementations supports new (html/5749) error cloning semantic var structuredCloneFromMark = !nativeStructuredClone && checkBasicSemantic(function (value) { return new PerformanceMark(PERFORMANCE_MARK, { detail: value }).detail; }); var nativeRestrictedStructuredClone = checkBasicSemantic(nativeStructuredClone) || structuredCloneFromMark; var throwUncloneable = function (type) { throw new DOMException('Uncloneable type: ' + type, DATA_CLONE_ERROR); }; var throwUnpolyfillable = function (type, action) { throw new DOMException((action || 'Cloning') + ' of ' + type + ' cannot be properly polyfilled in this engine', DATA_CLONE_ERROR); }; var tryNativeRestrictedStructuredClone = function (value, type) { if (!nativeRestrictedStructuredClone) throwUnpolyfillable(type); return nativeRestrictedStructuredClone(value); }; var createDataTransfer = function () { var dataTransfer; try { dataTransfer = new globalThis.DataTransfer(); } catch (error) { try { dataTransfer = new globalThis.ClipboardEvent('').clipboardData; } catch (error2) { /* empty */ } } return dataTransfer && dataTransfer.items && dataTransfer.files ? dataTransfer : null; }; var cloneBuffer = function (value, map, $type) { if (mapHas(map, value)) return mapGet(map, value); var type = $type || classof(value); var clone, length, options, source, target, i; if (type === 'SharedArrayBuffer') { if (nativeRestrictedStructuredClone) clone = nativeRestrictedStructuredClone(value); // SharedArrayBuffer should use shared memory, we can't polyfill it, so return the original else clone = value; } else { var DataView = globalThis.DataView; // `ArrayBuffer#slice` is not available in IE10 // `ArrayBuffer#slice` and `DataView` are not available in old FF if (!DataView && !isCallable(value.slice)) throwUnpolyfillable('ArrayBuffer'); // detached buffers throws in `DataView` and `.slice` try { if (isCallable(value.slice) && !value.resizable) { clone = value.slice(0); } else { length = value.byteLength; options = 'maxByteLength' in value ? { maxByteLength: value.maxByteLength } : undefined; // eslint-disable-next-line es/no-resizable-and-growable-arraybuffers -- safe clone = new ArrayBuffer(length, options); source = new DataView(value); target = new DataView(clone); for (i = 0; i < length; i++) { target.setUint8(i, source.getUint8(i)); } } } catch (error) { throw new DOMException('ArrayBuffer is detached', DATA_CLONE_ERROR); } } mapSet(map, value, clone); return clone; }; var cloneView = function (value, type, offset, length, map) { var C = globalThis[type]; // in some old engines like Safari 9, typeof C is 'object' // on Uint8ClampedArray or some other constructors if (!isObject(C)) throwUnpolyfillable(type); return new C(cloneBuffer(value.buffer, map), offset, length); }; var structuredCloneInternal = function (value, map) { if (isSymbol(value)) throwUncloneable('Symbol'); if (!isObject(value)) return value; // effectively preserves circular references if (map) { if (mapHas(map, value)) return mapGet(map, value); } else map = new Map(); var type = classof(value); var C, name, cloned, dataTransfer, i, length, keys, key; switch (type) { case 'Array': cloned = Array(lengthOfArrayLike(value)); break; case 'Object': cloned = {}; break; case 'Map': cloned = new Map(); break; case 'Set': cloned = new Set(); break; case 'RegExp': // in this block because of a Safari 14.1 bug // old FF does not clone regexes passed to the constructor, so get the source and flags directly cloned = new RegExp(value.source, getRegExpFlags(value)); break; case 'Error': name = value.name; switch (name) { case 'AggregateError': cloned = new (getBuiltIn(name))([]); break; case 'EvalError': case 'RangeError': case 'ReferenceError': case 'SuppressedError': case 'SyntaxError': case 'TypeError': case 'URIError': cloned = new (getBuiltIn(name))(); break; case 'CompileError': case 'LinkError': case 'RuntimeError': cloned = new (getBuiltIn('WebAssembly', name))(); break; default: cloned = new Error(); } break; case 'DOMException': cloned = new DOMException(value.message, value.name); break; case 'ArrayBuffer': case 'SharedArrayBuffer': cloned = cloneBuffer(value, map, type); break; case 'DataView': case 'Int8Array': case 'Uint8Array': case 'Uint8ClampedArray': case 'Int16Array': case 'Uint16Array': case 'Int32Array': case 'Uint32Array': case 'Float16Array': case 'Float32Array': case 'Float64Array': case 'BigInt64Array': case 'BigUint64Array': length = type === 'DataView' ? value.byteLength : value.length; cloned = cloneView(value, type, value.byteOffset, length, map); break; case 'DOMQuad': try { cloned = new DOMQuad( structuredCloneInternal(value.p1, map), structuredCloneInternal(value.p2, map), structuredCloneInternal(value.p3, map), structuredCloneInternal(value.p4, map) ); } catch (error) { cloned = tryNativeRestrictedStructuredClone(value, type); } break; case 'File': if (nativeRestrictedStructuredClone) try { cloned = nativeRestrictedStructuredClone(value); // NodeJS 20.0.0 bug, https://github.com/nodejs/node/issues/47612 if (classof(cloned) !== type) cloned = undefined; } catch (error) { /* empty */ } if (!cloned) try { cloned = new File([value], value.name, value); } catch (error) { /* empty */ } if (!cloned) throwUnpolyfillable(type); break; case 'FileList': dataTransfer = createDataTransfer(); if (dataTransfer) { for (i = 0, length = lengthOfArrayLike(value); i < length; i++) { dataTransfer.items.add(structuredCloneInternal(value[i], map)); } cloned = dataTransfer.files; } else cloned = tryNativeRestrictedStructuredClone(value, type); break; case 'ImageData': // Safari 9 ImageData is a constructor, but typeof ImageData is 'object' try { cloned = new ImageData( structuredCloneInternal(value.data, map), value.width, value.height, { colorSpace: value.colorSpace } ); } catch (error) { cloned = tryNativeRestrictedStructuredClone(value, type); } break; default: if (nativeRestrictedStructuredClone) { cloned = nativeRestrictedStructuredClone(value); } else switch (type) { case 'BigInt': // can be a 3rd party polyfill cloned = Object(value.valueOf()); break; case 'Boolean': cloned = Object(thisBooleanValue(value)); break; case 'Number': cloned = Object(thisNumberValue(value)); break; case 'String': cloned = Object(thisStringValue(value)); break; case 'Date': cloned = new Date(thisTimeValue(value)); break; case 'Blob': try { cloned = value.slice(0, value.size, value.type); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMPoint': case 'DOMPointReadOnly': C = globalThis[type]; try { cloned = C.fromPoint ? C.fromPoint(value) : new C(value.x, value.y, value.z, value.w); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMRect': case 'DOMRectReadOnly': C = globalThis[type]; try { cloned = C.fromRect ? C.fromRect(value) : new C(value.x, value.y, value.width, value.height); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMMatrix': case 'DOMMatrixReadOnly': C = globalThis[type]; try { cloned = C.fromMatrix ? C.fromMatrix(value) : new C(value); } catch (error) { throwUnpolyfillable(type); } break; case 'AudioData': case 'VideoFrame': if (!isCallable(value.clone)) throwUnpolyfillable(type); try { cloned = value.clone(); } catch (error) { throwUncloneable(type); } break; case 'CropTarget': case 'CryptoKey': case 'FileSystemDirectoryHandle': case 'FileSystemFileHandle': case 'FileSystemHandle': case 'GPUCompilationInfo': case 'GPUCompilationMessage': case 'ImageBitmap': case 'RTCCertificate': case 'WebAssembly.Module': throwUnpolyfillable(type); // break omitted default: throwUncloneable(type); } } mapSet(map, value, cloned); switch (type) { case 'Array': case 'Object': keys = objectKeys(value); for (i = 0, length = lengthOfArrayLike(keys); i < length; i++) { key = keys[i]; createProperty(cloned, key, structuredCloneInternal(value[key], map)); } break; case 'Map': value.forEach(function (v, k) { mapSet(cloned, structuredCloneInternal(k, map), structuredCloneInternal(v, map)); }); break; case 'Set': value.forEach(function (v) { setAdd(cloned, structuredCloneInternal(v, map)); }); break; case 'Error': createNonEnumerableProperty(cloned, 'message', structuredCloneInternal(value.message, map)); if (hasOwn(value, 'cause')) { createNonEnumerableProperty(cloned, 'cause', structuredCloneInternal(value.cause, map)); } if (name === 'AggregateError') { cloned.errors = structuredCloneInternal(value.errors, map); } else if (name === 'SuppressedError') { cloned.error = structuredCloneInternal(value.error, map); cloned.suppressed = structuredCloneInternal(value.suppressed, map); } // break omitted case 'DOMException': if (ERROR_STACK_INSTALLABLE) { createNonEnumerableProperty(cloned, 'stack', structuredCloneInternal(value.stack, map)); } } return cloned; }; var tryToTransfer = function (rawTransfer, map) { if (!isObject(rawTransfer)) throw new TypeError('Transfer option cannot be converted to a sequence'); var transfer = []; iterate(rawTransfer, function (value) { push(transfer, anObject(value)); }); var i = 0; var length = lengthOfArrayLike(transfer); var buffers = new Set(); var value, type, C, transferred, canvas, context; while (i < length) { value = transfer[i++]; type = classof(value); if (type === 'ArrayBuffer' ? setHas(buffers, value) : mapHas(map, value)) { throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR); } if (type === 'ArrayBuffer') { setAdd(buffers, value); continue; } if (PROPER_STRUCTURED_CLONE_TRANSFER) { transferred = nativeStructuredClone(value, { transfer: [value] }); } else switch (type) { case 'ImageBitmap': C = globalThis.OffscreenCanvas; if (!isConstructor(C)) throwUnpolyfillable(type, TRANSFERRING); try { canvas = new C(value.width, value.height); context = canvas.getContext('bitmaprenderer'); context.transferFromImageBitmap(value); transferred = canvas.transferToImageBitmap(); } catch (error) { /* empty */ } break; case 'AudioData': case 'VideoFrame': if (!isCallable(value.clone) || !isCallable(value.close)) throwUnpolyfillable(type, TRANSFERRING); try { transferred = value.clone(); value.close(); } catch (error) { /* empty */ } break; case 'MediaSourceHandle': case 'MessagePort': case 'MIDIAccess': case 'OffscreenCanvas': case 'ReadableStream': case 'RTCDataChannel': case 'TransformStream': case 'WebTransportReceiveStream': case 'WebTransportSendStream': case 'WritableStream': throwUnpolyfillable(type, TRANSFERRING); } if (transferred === undefined) throw new DOMException('This object cannot be transferred: ' + type, DATA_CLONE_ERROR); mapSet(map, value, transferred); } return buffers; }; var detachBuffers = function (buffers) { setIterate(buffers, function (buffer) { if (PROPER_STRUCTURED_CLONE_TRANSFER) { nativeRestrictedStructuredClone(buffer, { transfer: [buffer] }); } else if (isCallable(buffer.transfer)) { buffer.transfer(); } else if (detachTransferable) { detachTransferable(buffer); } else { throwUnpolyfillable('ArrayBuffer', TRANSFERRING); } }); }; // `structuredClone` method // https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone $({ global: true, enumerable: true, sham: !PROPER_STRUCTURED_CLONE_TRANSFER, forced: FORCED_REPLACEMENT }, { structuredClone: function structuredClone(value /* , { transfer } */) { var options = validateArgumentsLength(arguments.length, 1) > 1 && !isNullOrUndefined(arguments[1]) ? anObject(arguments[1]) : undefined; var transfer = options ? options.transfer : undefined; var map, buffers; if (transfer !== undefined) { map = new Map(); buffers = tryToTransfer(transfer, map); } var clone = structuredCloneInternal(value, map); // since of an issue with cloning views of transferred buffers, we a forced to detach them later // https://github.com/zloirock/core-js/issues/1265 if (buffers) detachBuffers(buffers); return clone; } }); /***/ }), /* 138 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); var fails = __webpack_require__(6); var isCallable = __webpack_require__(20); var classof = __webpack_require__(103); var getBuiltIn = __webpack_require__(22); var inspectSource = __webpack_require__(49); var noop = function () { /* empty */ }; var construct = getBuiltIn('Reflect', 'construct'); var constructorRegExp = /^\s*(?:class|function)\b/; var exec = uncurryThis(constructorRegExp.exec); var INCORRECT_TO_STRING = !constructorRegExp.test(noop); var isConstructorModern = function isConstructor(argument) { if (!isCallable(argument)) return false; try { construct(noop, [], argument); return true; } catch (error) { return false; } }; var isConstructorLegacy = function isConstructor(argument) { if (!isCallable(argument)) return false; switch (classof(argument)) { case 'AsyncFunction': case 'GeneratorFunction': case 'AsyncGeneratorFunction': return false; } try { // we can't check .prototype since constructors produced by .bind haven't it // `Function#toString` throws on some built-it function in some legacy engines // (for example, `DOMQuad` and similar in FF41-) return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument)); } catch (error) { return true; } }; isConstructorLegacy.sham = true; // `IsConstructor` abstract operation // https://tc39.es/ecma262/#sec-isconstructor module.exports = !construct || fails(function () { var called; return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () { called = true; }) || called; }) ? isConstructorLegacy : isConstructorModern; /***/ }), /* 139 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(5); var definePropertyModule = __webpack_require__(43); var createPropertyDescriptor = __webpack_require__(10); module.exports = function (object, key, value) { if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value)); else object[key] = value; }; /***/ }), /* 140 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $TypeError = TypeError; module.exports = function (passed, required) { if (passed < required) throw new $TypeError('Not enough arguments'); return passed; }; /***/ }), /* 141 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(7); var hasOwn = __webpack_require__(37); var isPrototypeOf = __webpack_require__(23); var regExpFlags = __webpack_require__(115); var RegExpPrototype = RegExp.prototype; module.exports = function (R) { var flags = R.flags; return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R) ? call(regExpFlags, R) : flags; }; /***/ }), /* 142 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); // eslint-disable-next-line es/no-set -- safe var SetPrototype = Set.prototype; module.exports = { // eslint-disable-next-line es/no-set -- safe Set: Set, add: uncurryThis(SetPrototype.add), has: uncurryThis(SetPrototype.has), remove: uncurryThis(SetPrototype['delete']), proto: SetPrototype }; /***/ }), /* 143 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var uncurryThis = __webpack_require__(13); var iterateSimple = __webpack_require__(144); var SetHelpers = __webpack_require__(142); var Set = SetHelpers.Set; var SetPrototype = SetHelpers.proto; var forEach = uncurryThis(SetPrototype.forEach); var keys = uncurryThis(SetPrototype.keys); var next = keys(new Set()).next; module.exports = function (set, fn, interruptible) { return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn); }; /***/ }), /* 144 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var call = __webpack_require__(7); module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) { var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator; var next = record.next; var step, result; while (!(step = call(next, iterator)).done) { result = fn(step.value); if (result !== undefined) return result; } }; /***/ }), /* 145 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(6); var createPropertyDescriptor = __webpack_require__(10); module.exports = !fails(function () { var error = new Error('a'); if (!('stack' in error)) return true; // eslint-disable-next-line es/no-object-defineproperty -- safe Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7)); return error.stack !== 7; }); /***/ }), /* 146 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var getBuiltIn = __webpack_require__(22); var fails = __webpack_require__(6); var validateArgumentsLength = __webpack_require__(140); var toString = __webpack_require__(117); var USE_NATIVE_URL = __webpack_require__(147); var URL = getBuiltIn('URL'); // https://github.com/nodejs/node/issues/47505 // https://github.com/denoland/deno/issues/18893 var THROWS_WITHOUT_ARGUMENTS = USE_NATIVE_URL && fails(function () { URL.canParse(); }); // Bun ~ 1.0.30 bug // https://github.com/oven-sh/bun/issues/9250 var WRONG_ARITY = fails(function () { return URL.canParse.length !== 1; }); // `URL.canParse` method // https://url.spec.whatwg.org/#dom-url-canparse $({ target: 'URL', stat: true, forced: !THROWS_WITHOUT_ARGUMENTS || WRONG_ARITY }, { canParse: function canParse(url) { var length = validateArgumentsLength(arguments.length, 1); var urlString = toString(url); var base = length < 2 || arguments[1] === undefined ? undefined : toString(arguments[1]); try { return !!new URL(urlString, base); } catch (error) { return false; } } }); /***/ }), /* 147 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fails = __webpack_require__(6); var wellKnownSymbol = __webpack_require__(32); var DESCRIPTORS = __webpack_require__(5); var IS_PURE = __webpack_require__(35); var ITERATOR = wellKnownSymbol('iterator'); module.exports = !fails(function () { // eslint-disable-next-line unicorn/relative-url-style -- required for testing var url = new URL('b?a=1&b=2&c=3', 'https://a'); var params = url.searchParams; var params2 = new URLSearchParams('a=1&a=2&b=3'); var result = ''; url.pathname = 'c%20d'; params.forEach(function (value, key) { params['delete']('b'); result += key + value; }); params2['delete']('a', 2); // `undefined` case is a Chromium 117 bug // https://bugs.chromium.org/p/v8/issues/detail?id=14222 params2['delete']('b', undefined); return (IS_PURE && (!url.toJSON || !params2.has('a', 1) || params2.has('a', 2) || !params2.has('a', undefined) || params2.has('b'))) || (!params.size && (IS_PURE || !DESCRIPTORS)) || !params.sort || url.href !== 'https://a/c%20d?a=1&c=3' || params.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !params[ITERATOR] // throws in Edge || new URL('https://a@b').username !== 'a' || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' // not punycoded in Edge || new URL('https://тест').host !== 'xn--e1aybc' // not escaped in Chrome 62- || new URL('https://a#б').hash !== '#%D0%B1' // fails in Chrome 66- || result !== 'a1c3' // throws in Safari || new URL('https://x', undefined).host !== 'x'; }); /***/ }), /* 148 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $ = __webpack_require__(2); var getBuiltIn = __webpack_require__(22); var validateArgumentsLength = __webpack_require__(140); var toString = __webpack_require__(117); var USE_NATIVE_URL = __webpack_require__(147); var URL = getBuiltIn('URL'); // `URL.parse` method // https://url.spec.whatwg.org/#dom-url-canparse $({ target: 'URL', stat: true, forced: !USE_NATIVE_URL }, { parse: function parse(url) { var length = validateArgumentsLength(arguments.length, 1); var urlString = toString(url); var base = length < 2 || arguments[1] === undefined ? undefined : toString(arguments[1]); try { return new URL(urlString, base); } catch (error) { return null; } } }); /***/ }), /* 149 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var defineBuiltIn = __webpack_require__(46); var uncurryThis = __webpack_require__(13); var toString = __webpack_require__(117); var validateArgumentsLength = __webpack_require__(140); var $URLSearchParams = URLSearchParams; var URLSearchParamsPrototype = $URLSearchParams.prototype; var append = uncurryThis(URLSearchParamsPrototype.append); var $delete = uncurryThis(URLSearchParamsPrototype['delete']); var forEach = uncurryThis(URLSearchParamsPrototype.forEach); var push = uncurryThis([].push); var params = new $URLSearchParams('a=1&a=2&b=3'); params['delete']('a', 1); // `undefined` case is a Chromium 117 bug // https://bugs.chromium.org/p/v8/issues/detail?id=14222 params['delete']('b', undefined); if (params + '' !== 'a=2') { defineBuiltIn(URLSearchParamsPrototype, 'delete', function (name /* , value */) { var length = arguments.length; var $value = length < 2 ? undefined : arguments[1]; if (length && $value === undefined) return $delete(this, name); var entries = []; forEach(this, function (v, k) { // also validates `this` push(entries, { key: k, value: v }); }); validateArgumentsLength(length, 1); var key = toString(name); var value = toString($value); var index = 0; var dindex = 0; var found = false; var entriesLength = entries.length; var entry; while (index < entriesLength) { entry = entries[index++]; if (found || entry.key === key) { found = true; $delete(this, entry.key); } else dindex++; } while (dindex < entriesLength) { entry = entries[dindex++]; if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value); } }, { enumerable: true, unsafe: true }); } /***/ }), /* 150 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var defineBuiltIn = __webpack_require__(46); var uncurryThis = __webpack_require__(13); var toString = __webpack_require__(117); var validateArgumentsLength = __webpack_require__(140); var $URLSearchParams = URLSearchParams; var URLSearchParamsPrototype = $URLSearchParams.prototype; var getAll = uncurryThis(URLSearchParamsPrototype.getAll); var $has = uncurryThis(URLSearchParamsPrototype.has); var params = new $URLSearchParams('a=1'); // `undefined` case is a Chromium 117 bug // https://bugs.chromium.org/p/v8/issues/detail?id=14222 if (params.has('a', 2) || !params.has('a', undefined)) { defineBuiltIn(URLSearchParamsPrototype, 'has', function has(name /* , value */) { var length = arguments.length; var $value = length < 2 ? undefined : arguments[1]; if (length && $value === undefined) return $has(this, name); var values = getAll(this, name); // also validates `this` validateArgumentsLength(length, 1); var value = toString($value); var index = 0; while (index < values.length) { if (values[index++] === value) return true; } return false; }, { enumerable: true, unsafe: true }); } /***/ }), /* 151 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var DESCRIPTORS = __webpack_require__(5); var uncurryThis = __webpack_require__(13); var defineBuiltInAccessor = __webpack_require__(81); var URLSearchParamsPrototype = URLSearchParams.prototype; var forEach = uncurryThis(URLSearchParamsPrototype.forEach); // `URLSearchParams.prototype.size` getter // https://github.com/whatwg/url/pull/734 if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) { defineBuiltInAccessor(URLSearchParamsPrototype, 'size', { get: function size() { var count = 0; forEach(this, function () { count++; }); return count; }, configurable: true, enumerable: true }); } /***/ }) /******/ ]); }(); vendor/wp-polyfill-inert.js 0000644 00000073016 15013651111 0011775 0 ustar 00 (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory() : typeof define === 'function' && define.amd ? define('inert', factory) : (factory()); }(this, (function () { 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /** * This work is licensed under the W3C Software and Document License * (http://www.w3.org/Consortium/Legal/2015/copyright-software-and-document). */ (function () { // Return early if we're not running inside of the browser. if (typeof window === 'undefined' || typeof Element === 'undefined') { return; } // Convenience function for converting NodeLists. /** @type {typeof Array.prototype.slice} */ var slice = Array.prototype.slice; /** * IE has a non-standard name for "matches". * @type {typeof Element.prototype.matches} */ var matches = Element.prototype.matches || Element.prototype.msMatchesSelector; /** @type {string} */ var _focusableElementsString = ['a[href]', 'area[href]', 'input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'button:not([disabled])', 'details', 'summary', 'iframe', 'object', 'embed', 'video', '[contenteditable]'].join(','); /** * `InertRoot` manages a single inert subtree, i.e. a DOM subtree whose root element has an `inert` * attribute. * * Its main functions are: * * - to create and maintain a set of managed `InertNode`s, including when mutations occur in the * subtree. The `makeSubtreeUnfocusable()` method handles collecting `InertNode`s via registering * each focusable node in the subtree with the singleton `InertManager` which manages all known * focusable nodes within inert subtrees. `InertManager` ensures that a single `InertNode` * instance exists for each focusable node which has at least one inert root as an ancestor. * * - to notify all managed `InertNode`s when this subtree stops being inert (i.e. when the `inert` * attribute is removed from the root node). This is handled in the destructor, which calls the * `deregister` method on `InertManager` for each managed inert node. */ var InertRoot = function () { /** * @param {!HTMLElement} rootElement The HTMLElement at the root of the inert subtree. * @param {!InertManager} inertManager The global singleton InertManager object. */ function InertRoot(rootElement, inertManager) { _classCallCheck(this, InertRoot); /** @type {!InertManager} */ this._inertManager = inertManager; /** @type {!HTMLElement} */ this._rootElement = rootElement; /** * @type {!Set<!InertNode>} * All managed focusable nodes in this InertRoot's subtree. */ this._managedNodes = new Set(); // Make the subtree hidden from assistive technology if (this._rootElement.hasAttribute('aria-hidden')) { /** @type {?string} */ this._savedAriaHidden = this._rootElement.getAttribute('aria-hidden'); } else { this._savedAriaHidden = null; } this._rootElement.setAttribute('aria-hidden', 'true'); // Make all focusable elements in the subtree unfocusable and add them to _managedNodes this._makeSubtreeUnfocusable(this._rootElement); // Watch for: // - any additions in the subtree: make them unfocusable too // - any removals from the subtree: remove them from this inert root's managed nodes // - attribute changes: if `tabindex` is added, or removed from an intrinsically focusable // element, make that node a managed node. this._observer = new MutationObserver(this._onMutation.bind(this)); this._observer.observe(this._rootElement, { attributes: true, childList: true, subtree: true }); } /** * Call this whenever this object is about to become obsolete. This unwinds all of the state * stored in this object and updates the state of all of the managed nodes. */ _createClass(InertRoot, [{ key: 'destructor', value: function destructor() { this._observer.disconnect(); if (this._rootElement) { if (this._savedAriaHidden !== null) { this._rootElement.setAttribute('aria-hidden', this._savedAriaHidden); } else { this._rootElement.removeAttribute('aria-hidden'); } } this._managedNodes.forEach(function (inertNode) { this._unmanageNode(inertNode.node); }, this); // Note we cast the nulls to the ANY type here because: // 1) We want the class properties to be declared as non-null, or else we // need even more casts throughout this code. All bets are off if an // instance has been destroyed and a method is called. // 2) We don't want to cast "this", because we want type-aware optimizations // to know which properties we're setting. this._observer = /** @type {?} */null; this._rootElement = /** @type {?} */null; this._managedNodes = /** @type {?} */null; this._inertManager = /** @type {?} */null; } /** * @return {!Set<!InertNode>} A copy of this InertRoot's managed nodes set. */ }, { key: '_makeSubtreeUnfocusable', /** * @param {!Node} startNode */ value: function _makeSubtreeUnfocusable(startNode) { var _this2 = this; composedTreeWalk(startNode, function (node) { return _this2._visitNode(node); }); var activeElement = document.activeElement; if (!document.body.contains(startNode)) { // startNode may be in shadow DOM, so find its nearest shadowRoot to get the activeElement. var node = startNode; /** @type {!ShadowRoot|undefined} */ var root = undefined; while (node) { if (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { root = /** @type {!ShadowRoot} */node; break; } node = node.parentNode; } if (root) { activeElement = root.activeElement; } } if (startNode.contains(activeElement)) { activeElement.blur(); // In IE11, if an element is already focused, and then set to tabindex=-1 // calling blur() will not actually move the focus. // To work around this we call focus() on the body instead. if (activeElement === document.activeElement) { document.body.focus(); } } } /** * @param {!Node} node */ }, { key: '_visitNode', value: function _visitNode(node) { if (node.nodeType !== Node.ELEMENT_NODE) { return; } var element = /** @type {!HTMLElement} */node; // If a descendant inert root becomes un-inert, its descendants will still be inert because of // this inert root, so all of its managed nodes need to be adopted by this InertRoot. if (element !== this._rootElement && element.hasAttribute('inert')) { this._adoptInertRoot(element); } if (matches.call(element, _focusableElementsString) || element.hasAttribute('tabindex')) { this._manageNode(element); } } /** * Register the given node with this InertRoot and with InertManager. * @param {!Node} node */ }, { key: '_manageNode', value: function _manageNode(node) { var inertNode = this._inertManager.register(node, this); this._managedNodes.add(inertNode); } /** * Unregister the given node with this InertRoot and with InertManager. * @param {!Node} node */ }, { key: '_unmanageNode', value: function _unmanageNode(node) { var inertNode = this._inertManager.deregister(node, this); if (inertNode) { this._managedNodes['delete'](inertNode); } } /** * Unregister the entire subtree starting at `startNode`. * @param {!Node} startNode */ }, { key: '_unmanageSubtree', value: function _unmanageSubtree(startNode) { var _this3 = this; composedTreeWalk(startNode, function (node) { return _this3._unmanageNode(node); }); } /** * If a descendant node is found with an `inert` attribute, adopt its managed nodes. * @param {!HTMLElement} node */ }, { key: '_adoptInertRoot', value: function _adoptInertRoot(node) { var inertSubroot = this._inertManager.getInertRoot(node); // During initialisation this inert root may not have been registered yet, // so register it now if need be. if (!inertSubroot) { this._inertManager.setInert(node, true); inertSubroot = this._inertManager.getInertRoot(node); } inertSubroot.managedNodes.forEach(function (savedInertNode) { this._manageNode(savedInertNode.node); }, this); } /** * Callback used when mutation observer detects subtree additions, removals, or attribute changes. * @param {!Array<!MutationRecord>} records * @param {!MutationObserver} self */ }, { key: '_onMutation', value: function _onMutation(records, self) { records.forEach(function (record) { var target = /** @type {!HTMLElement} */record.target; if (record.type === 'childList') { // Manage added nodes slice.call(record.addedNodes).forEach(function (node) { this._makeSubtreeUnfocusable(node); }, this); // Un-manage removed nodes slice.call(record.removedNodes).forEach(function (node) { this._unmanageSubtree(node); }, this); } else if (record.type === 'attributes') { if (record.attributeName === 'tabindex') { // Re-initialise inert node if tabindex changes this._manageNode(target); } else if (target !== this._rootElement && record.attributeName === 'inert' && target.hasAttribute('inert')) { // If a new inert root is added, adopt its managed nodes and make sure it knows about the // already managed nodes from this inert subroot. this._adoptInertRoot(target); var inertSubroot = this._inertManager.getInertRoot(target); this._managedNodes.forEach(function (managedNode) { if (target.contains(managedNode.node)) { inertSubroot._manageNode(managedNode.node); } }); } } }, this); } }, { key: 'managedNodes', get: function get() { return new Set(this._managedNodes); } /** @return {boolean} */ }, { key: 'hasSavedAriaHidden', get: function get() { return this._savedAriaHidden !== null; } /** @param {?string} ariaHidden */ }, { key: 'savedAriaHidden', set: function set(ariaHidden) { this._savedAriaHidden = ariaHidden; } /** @return {?string} */ , get: function get() { return this._savedAriaHidden; } }]); return InertRoot; }(); /** * `InertNode` initialises and manages a single inert node. * A node is inert if it is a descendant of one or more inert root elements. * * On construction, `InertNode` saves the existing `tabindex` value for the node, if any, and * either removes the `tabindex` attribute or sets it to `-1`, depending on whether the element * is intrinsically focusable or not. * * `InertNode` maintains a set of `InertRoot`s which are descendants of this `InertNode`. When an * `InertRoot` is destroyed, and calls `InertManager.deregister()`, the `InertManager` notifies the * `InertNode` via `removeInertRoot()`, which in turn destroys the `InertNode` if no `InertRoot`s * remain in the set. On destruction, `InertNode` reinstates the stored `tabindex` if one exists, * or removes the `tabindex` attribute if the element is intrinsically focusable. */ var InertNode = function () { /** * @param {!Node} node A focusable element to be made inert. * @param {!InertRoot} inertRoot The inert root element associated with this inert node. */ function InertNode(node, inertRoot) { _classCallCheck(this, InertNode); /** @type {!Node} */ this._node = node; /** @type {boolean} */ this._overrodeFocusMethod = false; /** * @type {!Set<!InertRoot>} The set of descendant inert roots. * If and only if this set becomes empty, this node is no longer inert. */ this._inertRoots = new Set([inertRoot]); /** @type {?number} */ this._savedTabIndex = null; /** @type {boolean} */ this._destroyed = false; // Save any prior tabindex info and make this node untabbable this.ensureUntabbable(); } /** * Call this whenever this object is about to become obsolete. * This makes the managed node focusable again and deletes all of the previously stored state. */ _createClass(InertNode, [{ key: 'destructor', value: function destructor() { this._throwIfDestroyed(); if (this._node && this._node.nodeType === Node.ELEMENT_NODE) { var element = /** @type {!HTMLElement} */this._node; if (this._savedTabIndex !== null) { element.setAttribute('tabindex', this._savedTabIndex); } else { element.removeAttribute('tabindex'); } // Use `delete` to restore native focus method. if (this._overrodeFocusMethod) { delete element.focus; } } // See note in InertRoot.destructor for why we cast these nulls to ANY. this._node = /** @type {?} */null; this._inertRoots = /** @type {?} */null; this._destroyed = true; } /** * @type {boolean} Whether this object is obsolete because the managed node is no longer inert. * If the object has been destroyed, any attempt to access it will cause an exception. */ }, { key: '_throwIfDestroyed', /** * Throw if user tries to access destroyed InertNode. */ value: function _throwIfDestroyed() { if (this.destroyed) { throw new Error('Trying to access destroyed InertNode'); } } /** @return {boolean} */ }, { key: 'ensureUntabbable', /** Save the existing tabindex value and make the node untabbable and unfocusable */ value: function ensureUntabbable() { if (this.node.nodeType !== Node.ELEMENT_NODE) { return; } var element = /** @type {!HTMLElement} */this.node; if (matches.call(element, _focusableElementsString)) { if ( /** @type {!HTMLElement} */element.tabIndex === -1 && this.hasSavedTabIndex) { return; } if (element.hasAttribute('tabindex')) { this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex; } element.setAttribute('tabindex', '-1'); if (element.nodeType === Node.ELEMENT_NODE) { element.focus = function () {}; this._overrodeFocusMethod = true; } } else if (element.hasAttribute('tabindex')) { this._savedTabIndex = /** @type {!HTMLElement} */element.tabIndex; element.removeAttribute('tabindex'); } } /** * Add another inert root to this inert node's set of managing inert roots. * @param {!InertRoot} inertRoot */ }, { key: 'addInertRoot', value: function addInertRoot(inertRoot) { this._throwIfDestroyed(); this._inertRoots.add(inertRoot); } /** * Remove the given inert root from this inert node's set of managing inert roots. * If the set of managing inert roots becomes empty, this node is no longer inert, * so the object should be destroyed. * @param {!InertRoot} inertRoot */ }, { key: 'removeInertRoot', value: function removeInertRoot(inertRoot) { this._throwIfDestroyed(); this._inertRoots['delete'](inertRoot); if (this._inertRoots.size === 0) { this.destructor(); } } }, { key: 'destroyed', get: function get() { return (/** @type {!InertNode} */this._destroyed ); } }, { key: 'hasSavedTabIndex', get: function get() { return this._savedTabIndex !== null; } /** @return {!Node} */ }, { key: 'node', get: function get() { this._throwIfDestroyed(); return this._node; } /** @param {?number} tabIndex */ }, { key: 'savedTabIndex', set: function set(tabIndex) { this._throwIfDestroyed(); this._savedTabIndex = tabIndex; } /** @return {?number} */ , get: function get() { this._throwIfDestroyed(); return this._savedTabIndex; } }]); return InertNode; }(); /** * InertManager is a per-document singleton object which manages all inert roots and nodes. * * When an element becomes an inert root by having an `inert` attribute set and/or its `inert` * property set to `true`, the `setInert` method creates an `InertRoot` object for the element. * The `InertRoot` in turn registers itself as managing all of the element's focusable descendant * nodes via the `register()` method. The `InertManager` ensures that a single `InertNode` instance * is created for each such node, via the `_managedNodes` map. */ var InertManager = function () { /** * @param {!Document} document */ function InertManager(document) { _classCallCheck(this, InertManager); if (!document) { throw new Error('Missing required argument; InertManager needs to wrap a document.'); } /** @type {!Document} */ this._document = document; /** * All managed nodes known to this InertManager. In a map to allow looking up by Node. * @type {!Map<!Node, !InertNode>} */ this._managedNodes = new Map(); /** * All inert roots known to this InertManager. In a map to allow looking up by Node. * @type {!Map<!Node, !InertRoot>} */ this._inertRoots = new Map(); /** * Observer for mutations on `document.body`. * @type {!MutationObserver} */ this._observer = new MutationObserver(this._watchForInert.bind(this)); // Add inert style. addInertStyle(document.head || document.body || document.documentElement); // Wait for document to be loaded. if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', this._onDocumentLoaded.bind(this)); } else { this._onDocumentLoaded(); } } /** * Set whether the given element should be an inert root or not. * @param {!HTMLElement} root * @param {boolean} inert */ _createClass(InertManager, [{ key: 'setInert', value: function setInert(root, inert) { if (inert) { if (this._inertRoots.has(root)) { // element is already inert return; } var inertRoot = new InertRoot(root, this); root.setAttribute('inert', ''); this._inertRoots.set(root, inertRoot); // If not contained in the document, it must be in a shadowRoot. // Ensure inert styles are added there. if (!this._document.body.contains(root)) { var parent = root.parentNode; while (parent) { if (parent.nodeType === 11) { addInertStyle(parent); } parent = parent.parentNode; } } } else { if (!this._inertRoots.has(root)) { // element is already non-inert return; } var _inertRoot = this._inertRoots.get(root); _inertRoot.destructor(); this._inertRoots['delete'](root); root.removeAttribute('inert'); } } /** * Get the InertRoot object corresponding to the given inert root element, if any. * @param {!Node} element * @return {!InertRoot|undefined} */ }, { key: 'getInertRoot', value: function getInertRoot(element) { return this._inertRoots.get(element); } /** * Register the given InertRoot as managing the given node. * In the case where the node has a previously existing inert root, this inert root will * be added to its set of inert roots. * @param {!Node} node * @param {!InertRoot} inertRoot * @return {!InertNode} inertNode */ }, { key: 'register', value: function register(node, inertRoot) { var inertNode = this._managedNodes.get(node); if (inertNode !== undefined) { // node was already in an inert subtree inertNode.addInertRoot(inertRoot); } else { inertNode = new InertNode(node, inertRoot); } this._managedNodes.set(node, inertNode); return inertNode; } /** * De-register the given InertRoot as managing the given inert node. * Removes the inert root from the InertNode's set of managing inert roots, and remove the inert * node from the InertManager's set of managed nodes if it is destroyed. * If the node is not currently managed, this is essentially a no-op. * @param {!Node} node * @param {!InertRoot} inertRoot * @return {?InertNode} The potentially destroyed InertNode associated with this node, if any. */ }, { key: 'deregister', value: function deregister(node, inertRoot) { var inertNode = this._managedNodes.get(node); if (!inertNode) { return null; } inertNode.removeInertRoot(inertRoot); if (inertNode.destroyed) { this._managedNodes['delete'](node); } return inertNode; } /** * Callback used when document has finished loading. */ }, { key: '_onDocumentLoaded', value: function _onDocumentLoaded() { // Find all inert roots in document and make them actually inert. var inertElements = slice.call(this._document.querySelectorAll('[inert]')); inertElements.forEach(function (inertElement) { this.setInert(inertElement, true); }, this); // Comment this out to use programmatic API only. this._observer.observe(this._document.body || this._document.documentElement, { attributes: true, subtree: true, childList: true }); } /** * Callback used when mutation observer detects attribute changes. * @param {!Array<!MutationRecord>} records * @param {!MutationObserver} self */ }, { key: '_watchForInert', value: function _watchForInert(records, self) { var _this = this; records.forEach(function (record) { switch (record.type) { case 'childList': slice.call(record.addedNodes).forEach(function (node) { if (node.nodeType !== Node.ELEMENT_NODE) { return; } var inertElements = slice.call(node.querySelectorAll('[inert]')); if (matches.call(node, '[inert]')) { inertElements.unshift(node); } inertElements.forEach(function (inertElement) { this.setInert(inertElement, true); }, _this); }, _this); break; case 'attributes': if (record.attributeName !== 'inert') { return; } var target = /** @type {!HTMLElement} */record.target; var inert = target.hasAttribute('inert'); _this.setInert(target, inert); break; } }, this); } }]); return InertManager; }(); /** * Recursively walk the composed tree from |node|. * @param {!Node} node * @param {(function (!HTMLElement))=} callback Callback to be called for each element traversed, * before descending into child nodes. * @param {?ShadowRoot=} shadowRootAncestor The nearest ShadowRoot ancestor, if any. */ function composedTreeWalk(node, callback, shadowRootAncestor) { if (node.nodeType == Node.ELEMENT_NODE) { var element = /** @type {!HTMLElement} */node; if (callback) { callback(element); } // Descend into node: // If it has a ShadowRoot, ignore all child elements - these will be picked // up by the <content> or <shadow> elements. Descend straight into the // ShadowRoot. var shadowRoot = /** @type {!HTMLElement} */element.shadowRoot; if (shadowRoot) { composedTreeWalk(shadowRoot, callback, shadowRoot); return; } // If it is a <content> element, descend into distributed elements - these // are elements from outside the shadow root which are rendered inside the // shadow DOM. if (element.localName == 'content') { var content = /** @type {!HTMLContentElement} */element; // Verifies if ShadowDom v0 is supported. var distributedNodes = content.getDistributedNodes ? content.getDistributedNodes() : []; for (var i = 0; i < distributedNodes.length; i++) { composedTreeWalk(distributedNodes[i], callback, shadowRootAncestor); } return; } // If it is a <slot> element, descend into assigned nodes - these // are elements from outside the shadow root which are rendered inside the // shadow DOM. if (element.localName == 'slot') { var slot = /** @type {!HTMLSlotElement} */element; // Verify if ShadowDom v1 is supported. var _distributedNodes = slot.assignedNodes ? slot.assignedNodes({ flatten: true }) : []; for (var _i = 0; _i < _distributedNodes.length; _i++) { composedTreeWalk(_distributedNodes[_i], callback, shadowRootAncestor); } return; } } // If it is neither the parent of a ShadowRoot, a <content> element, a <slot> // element, nor a <shadow> element recurse normally. var child = node.firstChild; while (child != null) { composedTreeWalk(child, callback, shadowRootAncestor); child = child.nextSibling; } } /** * Adds a style element to the node containing the inert specific styles * @param {!Node} node */ function addInertStyle(node) { if (node.querySelector('style#inert-style, link#inert-style')) { return; } var style = document.createElement('style'); style.setAttribute('id', 'inert-style'); style.textContent = '\n' + '[inert] {\n' + ' pointer-events: none;\n' + ' cursor: default;\n' + '}\n' + '\n' + '[inert], [inert] * {\n' + ' -webkit-user-select: none;\n' + ' -moz-user-select: none;\n' + ' -ms-user-select: none;\n' + ' user-select: none;\n' + '}\n'; node.appendChild(style); } if (!HTMLElement.prototype.hasOwnProperty('inert')) { /** @type {!InertManager} */ var inertManager = new InertManager(document); Object.defineProperty(HTMLElement.prototype, 'inert', { enumerable: true, /** @this {!HTMLElement} */ get: function get() { return this.hasAttribute('inert'); }, /** @this {!HTMLElement} */ set: function set(inert) { inertManager.setInert(this, inert); } }); } })(); }))); vendor/moment.js 0000644 00000530463 15013651111 0007703 0 ustar 00 //! moment.js //! version : 2.30.1 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors //! license : MIT //! momentjs.com ;(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory() }(this, (function () { 'use strict'; var hookCallback; function hooks() { return hookCallback.apply(null, arguments); } // This is done to register the method called with moment() // without creating circular dependencies. function setHookCallback(callback) { hookCallback = callback; } function isArray(input) { return ( input instanceof Array || Object.prototype.toString.call(input) === '[object Array]' ); } function isObject(input) { // IE8 will treat undefined and null as object if it wasn't for // input != null return ( input != null && Object.prototype.toString.call(input) === '[object Object]' ); } function hasOwnProp(a, b) { return Object.prototype.hasOwnProperty.call(a, b); } function isObjectEmpty(obj) { if (Object.getOwnPropertyNames) { return Object.getOwnPropertyNames(obj).length === 0; } else { var k; for (k in obj) { if (hasOwnProp(obj, k)) { return false; } } return true; } } function isUndefined(input) { return input === void 0; } function isNumber(input) { return ( typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]' ); } function isDate(input) { return ( input instanceof Date || Object.prototype.toString.call(input) === '[object Date]' ); } function map(arr, fn) { var res = [], i, arrLen = arr.length; for (i = 0; i < arrLen; ++i) { res.push(fn(arr[i], i)); } return res; } function extend(a, b) { for (var i in b) { if (hasOwnProp(b, i)) { a[i] = b[i]; } } if (hasOwnProp(b, 'toString')) { a.toString = b.toString; } if (hasOwnProp(b, 'valueOf')) { a.valueOf = b.valueOf; } return a; } function createUTC(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, true).utc(); } function defaultParsingFlags() { // We need to deep clone this object. return { empty: false, unusedTokens: [], unusedInput: [], overflow: -2, charsLeftOver: 0, nullInput: false, invalidEra: null, invalidMonth: null, invalidFormat: false, userInvalidated: false, iso: false, parsedDateParts: [], era: null, meridiem: null, rfc2822: false, weekdayMismatch: false, }; } function getParsingFlags(m) { if (m._pf == null) { m._pf = defaultParsingFlags(); } return m._pf; } var some; if (Array.prototype.some) { some = Array.prototype.some; } else { some = function (fun) { var t = Object(this), len = t.length >>> 0, i; for (i = 0; i < len; i++) { if (i in t && fun.call(this, t[i], i, t)) { return true; } } return false; }; } function isValid(m) { var flags = null, parsedParts = false, isNowValid = m._d && !isNaN(m._d.getTime()); if (isNowValid) { flags = getParsingFlags(m); parsedParts = some.call(flags.parsedDateParts, function (i) { return i != null; }); isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || (flags.meridiem && parsedParts)); if (m._strict) { isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; } } if (Object.isFrozen == null || !Object.isFrozen(m)) { m._isValid = isNowValid; } else { return isNowValid; } return m._isValid; } function createInvalid(flags) { var m = createUTC(NaN); if (flags != null) { extend(getParsingFlags(m), flags); } else { getParsingFlags(m).userInvalidated = true; } return m; } // Plugins that add properties should also add the key here (null value), // so we can properly clone ourselves. var momentProperties = (hooks.momentProperties = []), updateInProgress = false; function copyConfig(to, from) { var i, prop, val, momentPropertiesLen = momentProperties.length; if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } if (!isUndefined(from._i)) { to._i = from._i; } if (!isUndefined(from._f)) { to._f = from._f; } if (!isUndefined(from._l)) { to._l = from._l; } if (!isUndefined(from._strict)) { to._strict = from._strict; } if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } if (!isUndefined(from._offset)) { to._offset = from._offset; } if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } if (!isUndefined(from._locale)) { to._locale = from._locale; } if (momentPropertiesLen > 0) { for (i = 0; i < momentPropertiesLen; i++) { prop = momentProperties[i]; val = from[prop]; if (!isUndefined(val)) { to[prop] = val; } } } return to; } // Moment prototype object function Moment(config) { copyConfig(this, config); this._d = new Date(config._d != null ? config._d.getTime() : NaN); if (!this.isValid()) { this._d = new Date(NaN); } // Prevent infinite loop in case updateOffset creates new moment // objects. if (updateInProgress === false) { updateInProgress = true; hooks.updateOffset(this); updateInProgress = false; } } function isMoment(obj) { return ( obj instanceof Moment || (obj != null && obj._isAMomentObject != null) ); } function warn(msg) { if ( hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn ) { console.warn('Deprecation warning: ' + msg); } } function deprecate(msg, fn) { var firstTime = true; return extend(function () { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(null, msg); } if (firstTime) { var args = [], arg, i, key, argLen = arguments.length; for (i = 0; i < argLen; i++) { arg = ''; if (typeof arguments[i] === 'object') { arg += '\n[' + i + '] '; for (key in arguments[0]) { if (hasOwnProp(arguments[0], key)) { arg += key + ': ' + arguments[0][key] + ', '; } } arg = arg.slice(0, -2); // Remove trailing comma and space } else { arg = arguments[i]; } args.push(arg); } warn( msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack ); firstTime = false; } return fn.apply(this, arguments); }, fn); } var deprecations = {}; function deprecateSimple(name, msg) { if (hooks.deprecationHandler != null) { hooks.deprecationHandler(name, msg); } if (!deprecations[name]) { warn(msg); deprecations[name] = true; } } hooks.suppressDeprecationWarnings = false; hooks.deprecationHandler = null; function isFunction(input) { return ( (typeof Function !== 'undefined' && input instanceof Function) || Object.prototype.toString.call(input) === '[object Function]' ); } function set(config) { var prop, i; for (i in config) { if (hasOwnProp(config, i)) { prop = config[i]; if (isFunction(prop)) { this[i] = prop; } else { this['_' + i] = prop; } } } this._config = config; // Lenient ordinal parsing accepts just a number in addition to // number + (possibly) stuff coming from _dayOfMonthOrdinalParse. // TODO: Remove "ordinalParse" fallback in next major release. this._dayOfMonthOrdinalParseLenient = new RegExp( (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\d{1,2}/.source ); } function mergeConfigs(parentConfig, childConfig) { var res = extend({}, parentConfig), prop; for (prop in childConfig) { if (hasOwnProp(childConfig, prop)) { if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { res[prop] = {}; extend(res[prop], parentConfig[prop]); extend(res[prop], childConfig[prop]); } else if (childConfig[prop] != null) { res[prop] = childConfig[prop]; } else { delete res[prop]; } } } for (prop in parentConfig) { if ( hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop]) ) { // make sure changes to properties don't modify parent config res[prop] = extend({}, res[prop]); } } return res; } function Locale(config) { if (config != null) { this.set(config); } } var keys; if (Object.keys) { keys = Object.keys; } else { keys = function (obj) { var i, res = []; for (i in obj) { if (hasOwnProp(obj, i)) { res.push(i); } } return res; }; } var defaultCalendar = { sameDay: '[Today at] LT', nextDay: '[Tomorrow at] LT', nextWeek: 'dddd [at] LT', lastDay: '[Yesterday at] LT', lastWeek: '[Last] dddd [at] LT', sameElse: 'L', }; function calendar(key, mom, now) { var output = this._calendar[key] || this._calendar['sameElse']; return isFunction(output) ? output.call(mom, now) : output; } function zeroFill(number, targetLength, forceSign) { var absNumber = '' + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign = number >= 0; return ( (sign ? (forceSign ? '+' : '') : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber ); } var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {}; // token: 'M' // padded: ['MM', 2] // ordinal: 'Mo' // callback: function () { this.month() + 1 } function addFormatToken(token, padded, ordinal, callback) { var func = callback; if (typeof callback === 'string') { func = function () { return this[callback](); }; } if (token) { formatTokenFunctions[token] = func; } if (padded) { formatTokenFunctions[padded[0]] = function () { return zeroFill(func.apply(this, arguments), padded[1], padded[2]); }; } if (ordinal) { formatTokenFunctions[ordinal] = function () { return this.localeData().ordinal( func.apply(this, arguments), token ); }; } } function removeFormattingTokens(input) { if (input.match(/\[[\s\S]/)) { return input.replace(/^\[|\]$/g, ''); } return input.replace(/\\/g, ''); } function makeFormatFunction(format) { var array = format.match(formattingTokens), i, length; for (i = 0, length = array.length; i < length; i++) { if (formatTokenFunctions[array[i]]) { array[i] = formatTokenFunctions[array[i]]; } else { array[i] = removeFormattingTokens(array[i]); } } return function (mom) { var output = '', i; for (i = 0; i < length; i++) { output += isFunction(array[i]) ? array[i].call(mom, format) : array[i]; } return output; }; } // format date using native date object function formatMoment(m, format) { if (!m.isValid()) { return m.localeData().invalidDate(); } format = expandFormat(format, m.localeData()); formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); return formatFunctions[format](m); } function expandFormat(format, locale) { var i = 5; function replaceLongDateFormatTokens(input) { return locale.longDateFormat(input) || input; } localFormattingTokens.lastIndex = 0; while (i >= 0 && localFormattingTokens.test(format)) { format = format.replace( localFormattingTokens, replaceLongDateFormatTokens ); localFormattingTokens.lastIndex = 0; i -= 1; } return format; } var defaultLongDateFormat = { LTS: 'h:mm:ss A', LT: 'h:mm A', L: 'MM/DD/YYYY', LL: 'MMMM D, YYYY', LLL: 'MMMM D, YYYY h:mm A', LLLL: 'dddd, MMMM D, YYYY h:mm A', }; function longDateFormat(key) { var format = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()]; if (format || !formatUpper) { return format; } this._longDateFormat[key] = formatUpper .match(formattingTokens) .map(function (tok) { if ( tok === 'MMMM' || tok === 'MM' || tok === 'DD' || tok === 'dddd' ) { return tok.slice(1); } return tok; }) .join(''); return this._longDateFormat[key]; } var defaultInvalidDate = 'Invalid date'; function invalidDate() { return this._invalidDate; } var defaultOrdinal = '%d', defaultDayOfMonthOrdinalParse = /\d{1,2}/; function ordinal(number) { return this._ordinal.replace('%d', number); } var defaultRelativeTime = { future: 'in %s', past: '%s ago', s: 'a few seconds', ss: '%d seconds', m: 'a minute', mm: '%d minutes', h: 'an hour', hh: '%d hours', d: 'a day', dd: '%d days', w: 'a week', ww: '%d weeks', M: 'a month', MM: '%d months', y: 'a year', yy: '%d years', }; function relativeTime(number, withoutSuffix, string, isFuture) { var output = this._relativeTime[string]; return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); } function pastFuture(diff, output) { var format = this._relativeTime[diff > 0 ? 'future' : 'past']; return isFunction(format) ? format(output) : format.replace(/%s/i, output); } var aliases = { D: 'date', dates: 'date', date: 'date', d: 'day', days: 'day', day: 'day', e: 'weekday', weekdays: 'weekday', weekday: 'weekday', E: 'isoWeekday', isoweekdays: 'isoWeekday', isoweekday: 'isoWeekday', DDD: 'dayOfYear', dayofyears: 'dayOfYear', dayofyear: 'dayOfYear', h: 'hour', hours: 'hour', hour: 'hour', ms: 'millisecond', milliseconds: 'millisecond', millisecond: 'millisecond', m: 'minute', minutes: 'minute', minute: 'minute', M: 'month', months: 'month', month: 'month', Q: 'quarter', quarters: 'quarter', quarter: 'quarter', s: 'second', seconds: 'second', second: 'second', gg: 'weekYear', weekyears: 'weekYear', weekyear: 'weekYear', GG: 'isoWeekYear', isoweekyears: 'isoWeekYear', isoweekyear: 'isoWeekYear', w: 'week', weeks: 'week', week: 'week', W: 'isoWeek', isoweeks: 'isoWeek', isoweek: 'isoWeek', y: 'year', years: 'year', year: 'year', }; function normalizeUnits(units) { return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; } function normalizeObjectUnits(inputObject) { var normalizedInput = {}, normalizedProp, prop; for (prop in inputObject) { if (hasOwnProp(inputObject, prop)) { normalizedProp = normalizeUnits(prop); if (normalizedProp) { normalizedInput[normalizedProp] = inputObject[prop]; } } } return normalizedInput; } var priorities = { date: 9, day: 11, weekday: 11, isoWeekday: 11, dayOfYear: 4, hour: 13, millisecond: 16, minute: 14, month: 8, quarter: 7, second: 15, weekYear: 1, isoWeekYear: 1, week: 5, isoWeek: 5, year: 1, }; function getPrioritizedUnits(unitsObj) { var units = [], u; for (u in unitsObj) { if (hasOwnProp(unitsObj, u)) { units.push({ unit: u, priority: priorities[u] }); } } units.sort(function (a, b) { return a.priority - b.priority; }); return units; } var match1 = /\d/, // 0 - 9 match2 = /\d\d/, // 00 - 99 match3 = /\d{3}/, // 000 - 999 match4 = /\d{4}/, // 0000 - 9999 match6 = /[+-]?\d{6}/, // -999999 - 999999 match1to2 = /\d\d?/, // 0 - 99 match3to4 = /\d\d\d\d?/, // 999 - 9999 match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999 match1to3 = /\d{1,3}/, // 0 - 999 match1to4 = /\d{1,4}/, // 0 - 9999 match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999 matchUnsigned = /\d+/, // 0 - inf matchSigned = /[+-]?\d+/, // -inf - inf matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123 // any word (or two) characters or numbers including two/three word month in arabic. // includes scottish gaelic two word and hyphenated months matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, match1to2NoLeadingZero = /^[1-9]\d?/, // 1-99 match1to2HasZero = /^([1-9]\d|\d)/, // 0-99 regexes; regexes = {}; function addRegexToken(token, regex, strictRegex) { regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { return isStrict && strictRegex ? strictRegex : regex; }; } function getParseRegexForToken(token, config) { if (!hasOwnProp(regexes, token)) { return new RegExp(unescapeFormat(token)); } return regexes[token](config._strict, config._locale); } // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript function unescapeFormat(s) { return regexEscape( s .replace('\\', '') .replace( /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; } ) ); } function regexEscape(s) { return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); } function absFloor(number) { if (number < 0) { // -0 -> 0 return Math.ceil(number) || 0; } else { return Math.floor(number); } } function toInt(argumentForCoercion) { var coercedNumber = +argumentForCoercion, value = 0; if (coercedNumber !== 0 && isFinite(coercedNumber)) { value = absFloor(coercedNumber); } return value; } var tokens = {}; function addParseToken(token, callback) { var i, func = callback, tokenLen; if (typeof token === 'string') { token = [token]; } if (isNumber(callback)) { func = function (input, array) { array[callback] = toInt(input); }; } tokenLen = token.length; for (i = 0; i < tokenLen; i++) { tokens[token[i]] = func; } } function addWeekParseToken(token, callback) { addParseToken(token, function (input, array, config, token) { config._w = config._w || {}; callback(input, config._w, config, token); }); } function addTimeToArrayFromToken(token, input, config) { if (input != null && hasOwnProp(tokens, token)) { tokens[token](input, config._a, config, token); } } function isLeapYear(year) { return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; } var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8; // FORMATTING addFormatToken('Y', 0, 0, function () { var y = this.year(); return y <= 9999 ? zeroFill(y, 4) : '+' + y; }); addFormatToken(0, ['YY', 2], 0, function () { return this.year() % 100; }); addFormatToken(0, ['YYYY', 4], 0, 'year'); addFormatToken(0, ['YYYYY', 5], 0, 'year'); addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); // PARSING addRegexToken('Y', matchSigned); addRegexToken('YY', match1to2, match2); addRegexToken('YYYY', match1to4, match4); addRegexToken('YYYYY', match1to6, match6); addRegexToken('YYYYYY', match1to6, match6); addParseToken(['YYYYY', 'YYYYYY'], YEAR); addParseToken('YYYY', function (input, array) { array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); }); addParseToken('YY', function (input, array) { array[YEAR] = hooks.parseTwoDigitYear(input); }); addParseToken('Y', function (input, array) { array[YEAR] = parseInt(input, 10); }); // HELPERS function daysInYear(year) { return isLeapYear(year) ? 366 : 365; } // HOOKS hooks.parseTwoDigitYear = function (input) { return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); }; // MOMENTS var getSetYear = makeGetSet('FullYear', true); function getIsLeapYear() { return isLeapYear(this.year()); } function makeGetSet(unit, keepTime) { return function (value) { if (value != null) { set$1(this, unit, value); hooks.updateOffset(this, keepTime); return this; } else { return get(this, unit); } }; } function get(mom, unit) { if (!mom.isValid()) { return NaN; } var d = mom._d, isUTC = mom._isUTC; switch (unit) { case 'Milliseconds': return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds(); case 'Seconds': return isUTC ? d.getUTCSeconds() : d.getSeconds(); case 'Minutes': return isUTC ? d.getUTCMinutes() : d.getMinutes(); case 'Hours': return isUTC ? d.getUTCHours() : d.getHours(); case 'Date': return isUTC ? d.getUTCDate() : d.getDate(); case 'Day': return isUTC ? d.getUTCDay() : d.getDay(); case 'Month': return isUTC ? d.getUTCMonth() : d.getMonth(); case 'FullYear': return isUTC ? d.getUTCFullYear() : d.getFullYear(); default: return NaN; // Just in case } } function set$1(mom, unit, value) { var d, isUTC, year, month, date; if (!mom.isValid() || isNaN(value)) { return; } d = mom._d; isUTC = mom._isUTC; switch (unit) { case 'Milliseconds': return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value)); case 'Seconds': return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value)); case 'Minutes': return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value)); case 'Hours': return void (isUTC ? d.setUTCHours(value) : d.setHours(value)); case 'Date': return void (isUTC ? d.setUTCDate(value) : d.setDate(value)); // case 'Day': // Not real // return void (isUTC ? d.setUTCDay(value) : d.setDay(value)); // case 'Month': // Not used because we need to pass two variables // return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value)); case 'FullYear': break; // See below ... default: return; // Just in case } year = value; month = mom.month(); date = mom.date(); date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date; void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date)); } // MOMENTS function stringGet(units) { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](); } return this; } function stringSet(units, value) { if (typeof units === 'object') { units = normalizeObjectUnits(units); var prioritized = getPrioritizedUnits(units), i, prioritizedLen = prioritized.length; for (i = 0; i < prioritizedLen; i++) { this[prioritized[i].unit](units[prioritized[i].unit]); } } else { units = normalizeUnits(units); if (isFunction(this[units])) { return this[units](value); } } return this; } function mod(n, x) { return ((n % x) + x) % x; } var indexOf; if (Array.prototype.indexOf) { indexOf = Array.prototype.indexOf; } else { indexOf = function (o) { // I know var i; for (i = 0; i < this.length; ++i) { if (this[i] === o) { return i; } } return -1; }; } function daysInMonth(year, month) { if (isNaN(year) || isNaN(month)) { return NaN; } var modMonth = mod(month, 12); year += (month - modMonth) / 12; return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - ((modMonth % 7) % 2); } // FORMATTING addFormatToken('M', ['MM', 2], 'Mo', function () { return this.month() + 1; }); addFormatToken('MMM', 0, 0, function (format) { return this.localeData().monthsShort(this, format); }); addFormatToken('MMMM', 0, 0, function (format) { return this.localeData().months(this, format); }); // PARSING addRegexToken('M', match1to2, match1to2NoLeadingZero); addRegexToken('MM', match1to2, match2); addRegexToken('MMM', function (isStrict, locale) { return locale.monthsShortRegex(isStrict); }); addRegexToken('MMMM', function (isStrict, locale) { return locale.monthsRegex(isStrict); }); addParseToken(['M', 'MM'], function (input, array) { array[MONTH] = toInt(input) - 1; }); addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { var month = config._locale.monthsParse(input, token, config._strict); // if we didn't find a month name, mark the date as invalid. if (month != null) { array[MONTH] = month; } else { getParsingFlags(config).invalidMonth = input; } }); // LOCALES var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split( '_' ), defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord; function localeMonths(m, format) { if (!m) { return isArray(this._months) ? this._months : this._months['standalone']; } return isArray(this._months) ? this._months[m.month()] : this._months[ (this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone' ][m.month()]; } function localeMonthsShort(m, format) { if (!m) { return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone']; } return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[ MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone' ][m.month()]; } function handleStrictParse(monthName, format, strict) { var i, ii, mom, llc = monthName.toLocaleLowerCase(); if (!this._monthsParse) { // this is not used this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; for (i = 0; i < 12; ++i) { mom = createUTC([2000, i]); this._shortMonthsParse[i] = this.monthsShort( mom, '' ).toLocaleLowerCase(); this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'MMM') { ii = indexOf.call(this._shortMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._longMonthsParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._longMonthsParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortMonthsParse, llc); return ii !== -1 ? ii : null; } } } function localeMonthsParse(monthName, format, strict) { var i, mom, regex; if (this._monthsParseExact) { return handleStrictParse.call(this, monthName, format, strict); } if (!this._monthsParse) { this._monthsParse = []; this._longMonthsParse = []; this._shortMonthsParse = []; } // TODO: add sorting // Sorting makes sure if one month (or abbr) is a prefix of another // see sorting in computeMonthsParse for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = createUTC([2000, i]); if (strict && !this._longMonthsParse[i]) { this._longMonthsParse[i] = new RegExp( '^' + this.months(mom, '').replace('.', '') + '$', 'i' ); this._shortMonthsParse[i] = new RegExp( '^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i' ); } if (!strict && !this._monthsParse[i]) { regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if ( strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName) ) { return i; } else if ( strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName) ) { return i; } else if (!strict && this._monthsParse[i].test(monthName)) { return i; } } } // MOMENTS function setMonth(mom, value) { if (!mom.isValid()) { // No op return mom; } if (typeof value === 'string') { if (/^\d+$/.test(value)) { value = toInt(value); } else { value = mom.localeData().monthsParse(value); // TODO: Another silent failure? if (!isNumber(value)) { return mom; } } } var month = value, date = mom.date(); date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month)); void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date)); return mom; } function getSetMonth(value) { if (value != null) { setMonth(this, value); hooks.updateOffset(this, true); return this; } else { return get(this, 'Month'); } } function getDaysInMonth() { return daysInMonth(this.year(), this.month()); } function monthsShortRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsShortStrictRegex; } else { return this._monthsShortRegex; } } else { if (!hasOwnProp(this, '_monthsShortRegex')) { this._monthsShortRegex = defaultMonthsShortRegex; } return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex; } } function monthsRegex(isStrict) { if (this._monthsParseExact) { if (!hasOwnProp(this, '_monthsRegex')) { computeMonthsParse.call(this); } if (isStrict) { return this._monthsStrictRegex; } else { return this._monthsRegex; } } else { if (!hasOwnProp(this, '_monthsRegex')) { this._monthsRegex = defaultMonthsRegex; } return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex; } } function computeMonthsParse() { function cmpLenRev(a, b) { return b.length - a.length; } var shortPieces = [], longPieces = [], mixedPieces = [], i, mom, shortP, longP; for (i = 0; i < 12; i++) { // make the regex if we don't have it already mom = createUTC([2000, i]); shortP = regexEscape(this.monthsShort(mom, '')); longP = regexEscape(this.months(mom, '')); shortPieces.push(shortP); longPieces.push(longP); mixedPieces.push(longP); mixedPieces.push(shortP); } // Sorting makes sure if one month (or abbr) is a prefix of another it // will match the longer piece. shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._monthsShortRegex = this._monthsRegex; this._monthsStrictRegex = new RegExp( '^(' + longPieces.join('|') + ')', 'i' ); this._monthsShortStrictRegex = new RegExp( '^(' + shortPieces.join('|') + ')', 'i' ); } function createDate(y, m, d, h, M, s, ms) { // can't just apply() to create a date: // https://stackoverflow.com/q/181348 var date; // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset date = new Date(y + 400, m, d, h, M, s, ms); if (isFinite(date.getFullYear())) { date.setFullYear(y); } } else { date = new Date(y, m, d, h, M, s, ms); } return date; } function createUTCDate(y) { var date, args; // the Date.UTC function remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { args = Array.prototype.slice.call(arguments); // preserve leap years using a full 400 year cycle, then reset args[0] = y + 400; date = new Date(Date.UTC.apply(null, args)); if (isFinite(date.getUTCFullYear())) { date.setUTCFullYear(y); } } else { date = new Date(Date.UTC.apply(null, arguments)); } return date; } // start-of-first-week - start-of-year function firstWeekOffset(year, dow, doy) { var // first-week day -- which january is always in the first week (4 for iso, 1 for other) fwd = 7 + dow - doy, // first-week day local weekday -- which local weekday is fwd fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; return -fwdlw + fwd - 1; } // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday function dayOfYearFromWeeks(year, week, weekday, dow, doy) { var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear; if (dayOfYear <= 0) { resYear = year - 1; resDayOfYear = daysInYear(resYear) + dayOfYear; } else if (dayOfYear > daysInYear(year)) { resYear = year + 1; resDayOfYear = dayOfYear - daysInYear(year); } else { resYear = year; resDayOfYear = dayOfYear; } return { year: resYear, dayOfYear: resDayOfYear, }; } function weekOfYear(mom, dow, doy) { var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear; if (week < 1) { resYear = mom.year() - 1; resWeek = week + weeksInYear(resYear, dow, doy); } else if (week > weeksInYear(mom.year(), dow, doy)) { resWeek = week - weeksInYear(mom.year(), dow, doy); resYear = mom.year() + 1; } else { resYear = mom.year(); resWeek = week; } return { week: resWeek, year: resYear, }; } function weeksInYear(year, dow, doy) { var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy); return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; } // FORMATTING addFormatToken('w', ['ww', 2], 'wo', 'week'); addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); // PARSING addRegexToken('w', match1to2, match1to2NoLeadingZero); addRegexToken('ww', match1to2, match2); addRegexToken('W', match1to2, match1to2NoLeadingZero); addRegexToken('WW', match1to2, match2); addWeekParseToken( ['w', 'ww', 'W', 'WW'], function (input, week, config, token) { week[token.substr(0, 1)] = toInt(input); } ); // HELPERS // LOCALES function localeWeek(mom) { return weekOfYear(mom, this._week.dow, this._week.doy).week; } var defaultLocaleWeek = { dow: 0, // Sunday is the first day of the week. doy: 6, // The week that contains Jan 6th is the first week of the year. }; function localeFirstDayOfWeek() { return this._week.dow; } function localeFirstDayOfYear() { return this._week.doy; } // MOMENTS function getSetWeek(input) { var week = this.localeData().week(this); return input == null ? week : this.add((input - week) * 7, 'd'); } function getSetISOWeek(input) { var week = weekOfYear(this, 1, 4).week; return input == null ? week : this.add((input - week) * 7, 'd'); } // FORMATTING addFormatToken('d', 0, 'do', 'day'); addFormatToken('dd', 0, 0, function (format) { return this.localeData().weekdaysMin(this, format); }); addFormatToken('ddd', 0, 0, function (format) { return this.localeData().weekdaysShort(this, format); }); addFormatToken('dddd', 0, 0, function (format) { return this.localeData().weekdays(this, format); }); addFormatToken('e', 0, 0, 'weekday'); addFormatToken('E', 0, 0, 'isoWeekday'); // PARSING addRegexToken('d', match1to2); addRegexToken('e', match1to2); addRegexToken('E', match1to2); addRegexToken('dd', function (isStrict, locale) { return locale.weekdaysMinRegex(isStrict); }); addRegexToken('ddd', function (isStrict, locale) { return locale.weekdaysShortRegex(isStrict); }); addRegexToken('dddd', function (isStrict, locale) { return locale.weekdaysRegex(isStrict); }); addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { var weekday = config._locale.weekdaysParse(input, token, config._strict); // if we didn't get a weekday name, mark the date as invalid if (weekday != null) { week.d = weekday; } else { getParsingFlags(config).invalidWeekday = input; } }); addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { week[token] = toInt(input); }); // HELPERS function parseWeekday(input, locale) { if (typeof input !== 'string') { return input; } if (!isNaN(input)) { return parseInt(input, 10); } input = locale.weekdaysParse(input); if (typeof input === 'number') { return input; } return null; } function parseIsoWeekday(input, locale) { if (typeof input === 'string') { return locale.weekdaysParse(input) % 7 || 7; } return isNaN(input) ? null : input; } // LOCALES function shiftWeekdays(ws, n) { return ws.slice(n, 7).concat(ws.slice(0, n)); } var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord; function localeWeekdays(m, format) { var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[ m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone' ]; return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays; } function localeWeekdaysShort(m) { return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort; } function localeWeekdaysMin(m) { return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin; } function handleStrictParse$1(weekdayName, format, strict) { var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); if (!this._weekdaysParse) { this._weekdaysParse = []; this._shortWeekdaysParse = []; this._minWeekdaysParse = []; for (i = 0; i < 7; ++i) { mom = createUTC([2000, 1]).day(i); this._minWeekdaysParse[i] = this.weekdaysMin( mom, '' ).toLocaleLowerCase(); this._shortWeekdaysParse[i] = this.weekdaysShort( mom, '' ).toLocaleLowerCase(); this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); } } if (strict) { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } } else { if (format === 'dddd') { ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else if (format === 'ddd') { ii = indexOf.call(this._shortWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._minWeekdaysParse, llc); return ii !== -1 ? ii : null; } else { ii = indexOf.call(this._minWeekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._weekdaysParse, llc); if (ii !== -1) { return ii; } ii = indexOf.call(this._shortWeekdaysParse, llc); return ii !== -1 ? ii : null; } } } function localeWeekdaysParse(weekdayName, format, strict) { var i, mom, regex; if (this._weekdaysParseExact) { return handleStrictParse$1.call(this, weekdayName, format, strict); } if (!this._weekdaysParse) { this._weekdaysParse = []; this._minWeekdaysParse = []; this._shortWeekdaysParse = []; this._fullWeekdaysParse = []; } for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = createUTC([2000, 1]).day(i); if (strict && !this._fullWeekdaysParse[i]) { this._fullWeekdaysParse[i] = new RegExp( '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i' ); this._shortWeekdaysParse[i] = new RegExp( '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i' ); this._minWeekdaysParse[i] = new RegExp( '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i' ); } if (!this._weekdaysParse[i]) { regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); } // test the regex if ( strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName) ) { return i; } else if ( strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName) ) { return i; } else if ( strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName) ) { return i; } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { return i; } } } // MOMENTS function getSetDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var day = get(this, 'Day'); if (input != null) { input = parseWeekday(input, this.localeData()); return this.add(input - day, 'd'); } else { return day; } } function getSetLocaleDayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; return input == null ? weekday : this.add(input - weekday, 'd'); } function getSetISODayOfWeek(input) { if (!this.isValid()) { return input != null ? this : NaN; } // behaves the same as moment#day except // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) // as a setter, sunday should belong to the previous week. if (input != null) { var weekday = parseIsoWeekday(input, this.localeData()); return this.day(this.day() % 7 ? weekday : weekday - 7); } else { return this.day() || 7; } } function weekdaysRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysStrictRegex; } else { return this._weekdaysRegex; } } else { if (!hasOwnProp(this, '_weekdaysRegex')) { this._weekdaysRegex = defaultWeekdaysRegex; } return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex; } } function weekdaysShortRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysShortStrictRegex; } else { return this._weekdaysShortRegex; } } else { if (!hasOwnProp(this, '_weekdaysShortRegex')) { this._weekdaysShortRegex = defaultWeekdaysShortRegex; } return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex; } } function weekdaysMinRegex(isStrict) { if (this._weekdaysParseExact) { if (!hasOwnProp(this, '_weekdaysRegex')) { computeWeekdaysParse.call(this); } if (isStrict) { return this._weekdaysMinStrictRegex; } else { return this._weekdaysMinRegex; } } else { if (!hasOwnProp(this, '_weekdaysMinRegex')) { this._weekdaysMinRegex = defaultWeekdaysMinRegex; } return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex; } } function computeWeekdaysParse() { function cmpLenRev(a, b) { return b.length - a.length; } var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], i, mom, minp, shortp, longp; for (i = 0; i < 7; i++) { // make the regex if we don't have it already mom = createUTC([2000, 1]).day(i); minp = regexEscape(this.weekdaysMin(mom, '')); shortp = regexEscape(this.weekdaysShort(mom, '')); longp = regexEscape(this.weekdays(mom, '')); minPieces.push(minp); shortPieces.push(shortp); longPieces.push(longp); mixedPieces.push(minp); mixedPieces.push(shortp); mixedPieces.push(longp); } // Sorting makes sure if one weekday (or abbr) is a prefix of another it // will match the longer piece. minPieces.sort(cmpLenRev); shortPieces.sort(cmpLenRev); longPieces.sort(cmpLenRev); mixedPieces.sort(cmpLenRev); this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._weekdaysShortRegex = this._weekdaysRegex; this._weekdaysMinRegex = this._weekdaysRegex; this._weekdaysStrictRegex = new RegExp( '^(' + longPieces.join('|') + ')', 'i' ); this._weekdaysShortStrictRegex = new RegExp( '^(' + shortPieces.join('|') + ')', 'i' ); this._weekdaysMinStrictRegex = new RegExp( '^(' + minPieces.join('|') + ')', 'i' ); } // FORMATTING function hFormat() { return this.hours() % 12 || 12; } function kFormat() { return this.hours() || 24; } addFormatToken('H', ['HH', 2], 0, 'hour'); addFormatToken('h', ['hh', 2], 0, hFormat); addFormatToken('k', ['kk', 2], 0, kFormat); addFormatToken('hmm', 0, 0, function () { return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); }); addFormatToken('hmmss', 0, 0, function () { return ( '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2) ); }); addFormatToken('Hmm', 0, 0, function () { return '' + this.hours() + zeroFill(this.minutes(), 2); }); addFormatToken('Hmmss', 0, 0, function () { return ( '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2) ); }); function meridiem(token, lowercase) { addFormatToken(token, 0, 0, function () { return this.localeData().meridiem( this.hours(), this.minutes(), lowercase ); }); } meridiem('a', true); meridiem('A', false); // PARSING function matchMeridiem(isStrict, locale) { return locale._meridiemParse; } addRegexToken('a', matchMeridiem); addRegexToken('A', matchMeridiem); addRegexToken('H', match1to2, match1to2HasZero); addRegexToken('h', match1to2, match1to2NoLeadingZero); addRegexToken('k', match1to2, match1to2NoLeadingZero); addRegexToken('HH', match1to2, match2); addRegexToken('hh', match1to2, match2); addRegexToken('kk', match1to2, match2); addRegexToken('hmm', match3to4); addRegexToken('hmmss', match5to6); addRegexToken('Hmm', match3to4); addRegexToken('Hmmss', match5to6); addParseToken(['H', 'HH'], HOUR); addParseToken(['k', 'kk'], function (input, array, config) { var kInput = toInt(input); array[HOUR] = kInput === 24 ? 0 : kInput; }); addParseToken(['a', 'A'], function (input, array, config) { config._isPm = config._locale.isPM(input); config._meridiem = input; }); addParseToken(['h', 'hh'], function (input, array, config) { array[HOUR] = toInt(input); getParsingFlags(config).bigHour = true; }); addParseToken('hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); getParsingFlags(config).bigHour = true; }); addParseToken('hmmss', function (input, array, config) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); getParsingFlags(config).bigHour = true; }); addParseToken('Hmm', function (input, array, config) { var pos = input.length - 2; array[HOUR] = toInt(input.substr(0, pos)); array[MINUTE] = toInt(input.substr(pos)); }); addParseToken('Hmmss', function (input, array, config) { var pos1 = input.length - 4, pos2 = input.length - 2; array[HOUR] = toInt(input.substr(0, pos1)); array[MINUTE] = toInt(input.substr(pos1, 2)); array[SECOND] = toInt(input.substr(pos2)); }); // LOCALES function localeIsPM(input) { // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays // Using charAt should be more compatible. return (input + '').toLowerCase().charAt(0) === 'p'; } var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, // Setting the hour should keep the time, because the user explicitly // specified which hour they want. So trying to maintain the same hour (in // a new timezone) makes sense. Adding/subtracting hours does not follow // this rule. getSetHour = makeGetSet('Hours', true); function localeMeridiem(hours, minutes, isLower) { if (hours > 11) { return isLower ? 'pm' : 'PM'; } else { return isLower ? 'am' : 'AM'; } } var baseConfig = { calendar: defaultCalendar, longDateFormat: defaultLongDateFormat, invalidDate: defaultInvalidDate, ordinal: defaultOrdinal, dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, relativeTime: defaultRelativeTime, months: defaultLocaleMonths, monthsShort: defaultLocaleMonthsShort, week: defaultLocaleWeek, weekdays: defaultLocaleWeekdays, weekdaysMin: defaultLocaleWeekdaysMin, weekdaysShort: defaultLocaleWeekdaysShort, meridiemParse: defaultLocaleMeridiemParse, }; // internal storage for locale config files var locales = {}, localeFamilies = {}, globalLocale; function commonPrefix(arr1, arr2) { var i, minl = Math.min(arr1.length, arr2.length); for (i = 0; i < minl; i += 1) { if (arr1[i] !== arr2[i]) { return i; } } return minl; } function normalizeLocale(key) { return key ? key.toLowerCase().replace('_', '-') : key; } // pick the locale from the array // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root function chooseLocale(names) { var i = 0, j, next, locale, split; while (i < names.length) { split = normalizeLocale(names[i]).split('-'); j = split.length; next = normalizeLocale(names[i + 1]); next = next ? next.split('-') : null; while (j > 0) { locale = loadLocale(split.slice(0, j).join('-')); if (locale) { return locale; } if ( next && next.length >= j && commonPrefix(split, next) >= j - 1 ) { //the next array item is better than a shallower substring of this one break; } j--; } i++; } return globalLocale; } function isLocaleNameSane(name) { // Prevent names that look like filesystem paths, i.e contain '/' or '\' // Ensure name is available and function returns boolean return !!(name && name.match('^[^/\\\\]*$')); } function loadLocale(name) { var oldLocale = null, aliasedRequire; // TODO: Find a better way to register and load all the locales in Node if ( locales[name] === undefined && typeof module !== 'undefined' && module && module.exports && isLocaleNameSane(name) ) { try { oldLocale = globalLocale._abbr; aliasedRequire = require; aliasedRequire('./locale/' + name); getSetGlobalLocale(oldLocale); } catch (e) { // mark as not found to avoid repeating expensive file require call causing high CPU // when trying to find en-US, en_US, en-us for every format call locales[name] = null; // null means not found } } return locales[name]; } // This function will load locale and then set the global locale. If // no arguments are passed in, it will simply return the current global // locale key. function getSetGlobalLocale(key, values) { var data; if (key) { if (isUndefined(values)) { data = getLocale(key); } else { data = defineLocale(key, values); } if (data) { // moment.duration._locale = moment._locale = data; globalLocale = data; } else { if (typeof console !== 'undefined' && console.warn) { //warn user if arguments are passed but the locale could not be set console.warn( 'Locale ' + key + ' not found. Did you forget to load it?' ); } } } return globalLocale._abbr; } function defineLocale(name, config) { if (config !== null) { var locale, parentConfig = baseConfig; config.abbr = name; if (locales[name] != null) { deprecateSimple( 'defineLocaleOverride', 'use moment.updateLocale(localeName, config) to change ' + 'an existing locale. moment.defineLocale(localeName, ' + 'config) should only be used for creating a new locale ' + 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.' ); parentConfig = locales[name]._config; } else if (config.parentLocale != null) { if (locales[config.parentLocale] != null) { parentConfig = locales[config.parentLocale]._config; } else { locale = loadLocale(config.parentLocale); if (locale != null) { parentConfig = locale._config; } else { if (!localeFamilies[config.parentLocale]) { localeFamilies[config.parentLocale] = []; } localeFamilies[config.parentLocale].push({ name: name, config: config, }); return null; } } } locales[name] = new Locale(mergeConfigs(parentConfig, config)); if (localeFamilies[name]) { localeFamilies[name].forEach(function (x) { defineLocale(x.name, x.config); }); } // backwards compat for now: also set the locale // make sure we set the locale AFTER all child locales have been // created, so we won't end up with the child locale set. getSetGlobalLocale(name); return locales[name]; } else { // useful for testing delete locales[name]; return null; } } function updateLocale(name, config) { if (config != null) { var locale, tmpLocale, parentConfig = baseConfig; if (locales[name] != null && locales[name].parentLocale != null) { // Update existing child locale in-place to avoid memory-leaks locales[name].set(mergeConfigs(locales[name]._config, config)); } else { // MERGE tmpLocale = loadLocale(name); if (tmpLocale != null) { parentConfig = tmpLocale._config; } config = mergeConfigs(parentConfig, config); if (tmpLocale == null) { // updateLocale is called for creating a new locale // Set abbr so it will have a name (getters return // undefined otherwise). config.abbr = name; } locale = new Locale(config); locale.parentLocale = locales[name]; locales[name] = locale; } // backwards compat for now: also set the locale getSetGlobalLocale(name); } else { // pass null for config to unupdate, useful for tests if (locales[name] != null) { if (locales[name].parentLocale != null) { locales[name] = locales[name].parentLocale; if (name === getSetGlobalLocale()) { getSetGlobalLocale(name); } } else if (locales[name] != null) { delete locales[name]; } } } return locales[name]; } // returns locale data function getLocale(key) { var locale; if (key && key._locale && key._locale._abbr) { key = key._locale._abbr; } if (!key) { return globalLocale; } if (!isArray(key)) { //short-circuit everything else locale = loadLocale(key); if (locale) { return locale; } key = [key]; } return chooseLocale(key); } function listLocales() { return keys(locales); } function checkOverflow(m) { var overflow, a = m._a; if (a && getParsingFlags(m).overflow === -2) { overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1; if ( getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE) ) { overflow = DATE; } if (getParsingFlags(m)._overflowWeeks && overflow === -1) { overflow = WEEK; } if (getParsingFlags(m)._overflowWeekday && overflow === -1) { overflow = WEEKDAY; } getParsingFlags(m).overflow = overflow; } return m; } // iso 8601 regex // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, isoDates = [ ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/], ['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/], ['YYYYMM', /\d{6}/, false], ['YYYY', /\d{4}/, false], ], // iso time formats and regexes isoTimes = [ ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/], ], aspNetJsonRegex = /^\/?Date\((-?\d+)/i, // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3 rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, obsOffsets = { UT: 0, GMT: 0, EDT: -4 * 60, EST: -5 * 60, CDT: -5 * 60, CST: -6 * 60, MDT: -6 * 60, MST: -7 * 60, PDT: -7 * 60, PST: -8 * 60, }; // date from iso format function configFromISO(config) { var i, l, string = config._i, match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), allowTime, dateFormat, timeFormat, tzFormat, isoDatesLen = isoDates.length, isoTimesLen = isoTimes.length; if (match) { getParsingFlags(config).iso = true; for (i = 0, l = isoDatesLen; i < l; i++) { if (isoDates[i][1].exec(match[1])) { dateFormat = isoDates[i][0]; allowTime = isoDates[i][2] !== false; break; } } if (dateFormat == null) { config._isValid = false; return; } if (match[3]) { for (i = 0, l = isoTimesLen; i < l; i++) { if (isoTimes[i][1].exec(match[3])) { // match[2] should be 'T' or space timeFormat = (match[2] || ' ') + isoTimes[i][0]; break; } } if (timeFormat == null) { config._isValid = false; return; } } if (!allowTime && timeFormat != null) { config._isValid = false; return; } if (match[4]) { if (tzRegex.exec(match[4])) { tzFormat = 'Z'; } else { config._isValid = false; return; } } config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); configFromStringAndFormat(config); } else { config._isValid = false; } } function extractFromRFC2822Strings( yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr ) { var result = [ untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10), ]; if (secondStr) { result.push(parseInt(secondStr, 10)); } return result; } function untruncateYear(yearStr) { var year = parseInt(yearStr, 10); if (year <= 49) { return 2000 + year; } else if (year <= 999) { return 1900 + year; } return year; } function preprocessRFC2822(s) { // Remove comments and folding whitespace and replace multiple-spaces with a single space return s .replace(/\([^()]*\)|[\n\t]/g, ' ') .replace(/(\s\s+)/g, ' ') .replace(/^\s\s*/, '') .replace(/\s\s*$/, ''); } function checkWeekday(weekdayStr, parsedInput, config) { if (weekdayStr) { // TODO: Replace the vanilla JS Date object with an independent day-of-week check. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), weekdayActual = new Date( parsedInput[0], parsedInput[1], parsedInput[2] ).getDay(); if (weekdayProvided !== weekdayActual) { getParsingFlags(config).weekdayMismatch = true; config._isValid = false; return false; } } return true; } function calculateOffset(obsOffset, militaryOffset, numOffset) { if (obsOffset) { return obsOffsets[obsOffset]; } else if (militaryOffset) { // the only allowed military tz is Z return 0; } else { var hm = parseInt(numOffset, 10), m = hm % 100, h = (hm - m) / 100; return h * 60 + m; } } // date and time from ref 2822 format function configFromRFC2822(config) { var match = rfc2822.exec(preprocessRFC2822(config._i)), parsedArray; if (match) { parsedArray = extractFromRFC2822Strings( match[4], match[3], match[2], match[5], match[6], match[7] ); if (!checkWeekday(match[1], parsedArray, config)) { return; } config._a = parsedArray; config._tzm = calculateOffset(match[8], match[9], match[10]); config._d = createUTCDate.apply(null, config._a); config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); getParsingFlags(config).rfc2822 = true; } else { config._isValid = false; } } // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict function configFromString(config) { var matched = aspNetJsonRegex.exec(config._i); if (matched !== null) { config._d = new Date(+matched[1]); return; } configFromISO(config); if (config._isValid === false) { delete config._isValid; } else { return; } configFromRFC2822(config); if (config._isValid === false) { delete config._isValid; } else { return; } if (config._strict) { config._isValid = false; } else { // Final attempt, use Input Fallback hooks.createFromInputFallback(config); } } hooks.createFromInputFallback = deprecate( 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' + 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' + 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.', function (config) { config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); } ); // Pick the first defined of two or three arguments. function defaults(a, b, c) { if (a != null) { return a; } if (b != null) { return b; } return c; } function currentDateArray(config) { // hooks is actually the exported moment object var nowValue = new Date(hooks.now()); if (config._useUTC) { return [ nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate(), ]; } return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; } // convert an array to a date. // the array should mirror the parameters below // note: all values past the year are optional and will default to the lowest possible value. // [year, month, day , hour, minute, second, millisecond] function configFromArray(config) { var i, date, input = [], currentDate, expectedWeekday, yearToUse; if (config._d) { return; } currentDate = currentDateArray(config); //compute day of the year from weeks and weekdays if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { dayOfYearFromWeekInfo(config); } //if the day of the year is set, figure out what it is if (config._dayOfYear != null) { yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); if ( config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0 ) { getParsingFlags(config)._overflowDayOfYear = true; } date = createUTCDate(yearToUse, 0, config._dayOfYear); config._a[MONTH] = date.getUTCMonth(); config._a[DATE] = date.getUTCDate(); } // Default to current date. // * if no year, month, day of month are given, default to today // * if day of month is given, default month and year // * if month is given, default only year // * if year is given, don't default anything for (i = 0; i < 3 && config._a[i] == null; ++i) { config._a[i] = input[i] = currentDate[i]; } // Zero out whatever was not defaulted, including time for (; i < 7; i++) { config._a[i] = input[i] = config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i]; } // Check for 24:00:00.000 if ( config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0 ) { config._nextDay = true; config._a[HOUR] = 0; } config._d = (config._useUTC ? createUTCDate : createDate).apply( null, input ); expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); // Apply timezone offset from input. The actual utcOffset can be changed // with parseZone. if (config._tzm != null) { config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); } if (config._nextDay) { config._a[HOUR] = 24; } // check for mismatching day of week if ( config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday ) { getParsingFlags(config).weekdayMismatch = true; } } function dayOfYearFromWeekInfo(config) { var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; w = config._w; if (w.GG != null || w.W != null || w.E != null) { dow = 1; doy = 4; // TODO: We need to take the current isoWeekYear, but that depends on // how we interpret now (local, utc, fixed offset). So create // a now version of current config (take local/utc/offset flags, and // create now). weekYear = defaults( w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year ); week = defaults(w.W, 1); weekday = defaults(w.E, 1); if (weekday < 1 || weekday > 7) { weekdayOverflow = true; } } else { dow = config._locale._week.dow; doy = config._locale._week.doy; curWeek = weekOfYear(createLocal(), dow, doy); weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); // Default to current week. week = defaults(w.w, curWeek.week); if (w.d != null) { // weekday -- low day numbers are considered next week weekday = w.d; if (weekday < 0 || weekday > 6) { weekdayOverflow = true; } } else if (w.e != null) { // local weekday -- counting starts from beginning of week weekday = w.e + dow; if (w.e < 0 || w.e > 6) { weekdayOverflow = true; } } else { // default to beginning of week weekday = dow; } } if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { getParsingFlags(config)._overflowWeeks = true; } else if (weekdayOverflow != null) { getParsingFlags(config)._overflowWeekday = true; } else { temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); config._a[YEAR] = temp.year; config._dayOfYear = temp.dayOfYear; } } // constant that refers to the ISO standard hooks.ISO_8601 = function () {}; // constant that refers to the RFC 2822 form hooks.RFC_2822 = function () {}; // date from string and format string function configFromStringAndFormat(config) { // TODO: Move this to another part of the creation flow to prevent circular deps if (config._f === hooks.ISO_8601) { configFromISO(config); return; } if (config._f === hooks.RFC_2822) { configFromRFC2822(config); return; } config._a = []; getParsingFlags(config).empty = true; // This array is used to make a Date, either with `new Date` or `Date.UTC` var string = '' + config._i, i, parsedInput, tokens, token, skipped, stringLength = string.length, totalParsedInputLength = 0, era, tokenLen; tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; tokenLen = tokens.length; for (i = 0; i < tokenLen; i++) { token = tokens[i]; parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; if (parsedInput) { skipped = string.substr(0, string.indexOf(parsedInput)); if (skipped.length > 0) { getParsingFlags(config).unusedInput.push(skipped); } string = string.slice( string.indexOf(parsedInput) + parsedInput.length ); totalParsedInputLength += parsedInput.length; } // don't parse if it's not a known token if (formatTokenFunctions[token]) { if (parsedInput) { getParsingFlags(config).empty = false; } else { getParsingFlags(config).unusedTokens.push(token); } addTimeToArrayFromToken(token, parsedInput, config); } else if (config._strict && !parsedInput) { getParsingFlags(config).unusedTokens.push(token); } } // add remaining unparsed input length to the string getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; if (string.length > 0) { getParsingFlags(config).unusedInput.push(string); } // clear _12h flag if hour is <= 12 if ( config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0 ) { getParsingFlags(config).bigHour = undefined; } getParsingFlags(config).parsedDateParts = config._a.slice(0); getParsingFlags(config).meridiem = config._meridiem; // handle meridiem config._a[HOUR] = meridiemFixWrap( config._locale, config._a[HOUR], config._meridiem ); // handle era era = getParsingFlags(config).era; if (era !== null) { config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]); } configFromArray(config); checkOverflow(config); } function meridiemFixWrap(locale, hour, meridiem) { var isPm; if (meridiem == null) { // nothing to do return hour; } if (locale.meridiemHour != null) { return locale.meridiemHour(hour, meridiem); } else if (locale.isPM != null) { // Fallback isPm = locale.isPM(meridiem); if (isPm && hour < 12) { hour += 12; } if (!isPm && hour === 12) { hour = 0; } return hour; } else { // this is not supposed to happen return hour; } } // date from string and array of format strings function configFromStringAndArray(config) { var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config._f.length; if (configfLen === 0) { getParsingFlags(config).invalidFormat = true; config._d = new Date(NaN); return; } for (i = 0; i < configfLen; i++) { currentScore = 0; validFormatFound = false; tempConfig = copyConfig({}, config); if (config._useUTC != null) { tempConfig._useUTC = config._useUTC; } tempConfig._f = config._f[i]; configFromStringAndFormat(tempConfig); if (isValid(tempConfig)) { validFormatFound = true; } // if there is any input that was not parsed add a penalty for that format currentScore += getParsingFlags(tempConfig).charsLeftOver; //or tokens currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; getParsingFlags(tempConfig).score = currentScore; if (!bestFormatIsValid) { if ( scoreToBeat == null || currentScore < scoreToBeat || validFormatFound ) { scoreToBeat = currentScore; bestMoment = tempConfig; if (validFormatFound) { bestFormatIsValid = true; } } } else { if (currentScore < scoreToBeat) { scoreToBeat = currentScore; bestMoment = tempConfig; } } } extend(config, bestMoment || tempConfig); } function configFromObject(config) { if (config._d) { return; } var i = normalizeObjectUnits(config._i), dayOrDate = i.day === undefined ? i.date : i.day; config._a = map( [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], function (obj) { return obj && parseInt(obj, 10); } ); configFromArray(config); } function createFromConfig(config) { var res = new Moment(checkOverflow(prepareConfig(config))); if (res._nextDay) { // Adding is smart enough around DST res.add(1, 'd'); res._nextDay = undefined; } return res; } function prepareConfig(config) { var input = config._i, format = config._f; config._locale = config._locale || getLocale(config._l); if (input === null || (format === undefined && input === '')) { return createInvalid({ nullInput: true }); } if (typeof input === 'string') { config._i = input = config._locale.preparse(input); } if (isMoment(input)) { return new Moment(checkOverflow(input)); } else if (isDate(input)) { config._d = input; } else if (isArray(format)) { configFromStringAndArray(config); } else if (format) { configFromStringAndFormat(config); } else { configFromInput(config); } if (!isValid(config)) { config._d = null; } return config; } function configFromInput(config) { var input = config._i; if (isUndefined(input)) { config._d = new Date(hooks.now()); } else if (isDate(input)) { config._d = new Date(input.valueOf()); } else if (typeof input === 'string') { configFromString(config); } else if (isArray(input)) { config._a = map(input.slice(0), function (obj) { return parseInt(obj, 10); }); configFromArray(config); } else if (isObject(input)) { configFromObject(config); } else if (isNumber(input)) { // from milliseconds config._d = new Date(input); } else { hooks.createFromInputFallback(config); } } function createLocalOrUTC(input, format, locale, strict, isUTC) { var c = {}; if (format === true || format === false) { strict = format; format = undefined; } if (locale === true || locale === false) { strict = locale; locale = undefined; } if ( (isObject(input) && isObjectEmpty(input)) || (isArray(input) && input.length === 0) ) { input = undefined; } // object construction must be done this way. // https://github.com/moment/moment/issues/1423 c._isAMomentObject = true; c._useUTC = c._isUTC = isUTC; c._l = locale; c._i = input; c._f = format; c._strict = strict; return createFromConfig(c); } function createLocal(input, format, locale, strict) { return createLocalOrUTC(input, format, locale, strict, false); } var prototypeMin = deprecate( 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other < this ? this : other; } else { return createInvalid(); } } ), prototypeMax = deprecate( 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () { var other = createLocal.apply(null, arguments); if (this.isValid() && other.isValid()) { return other > this ? this : other; } else { return createInvalid(); } } ); // Pick a moment m from moments so that m[fn](other) is true for all // other. This relies on the function fn to be transitive. // // moments should either be an array of moment objects or an array, whose // first element is an array of moment objects. function pickBy(fn, moments) { var res, i; if (moments.length === 1 && isArray(moments[0])) { moments = moments[0]; } if (!moments.length) { return createLocal(); } res = moments[0]; for (i = 1; i < moments.length; ++i) { if (!moments[i].isValid() || moments[i][fn](res)) { res = moments[i]; } } return res; } // TODO: Use [].sort instead? function min() { var args = [].slice.call(arguments, 0); return pickBy('isBefore', args); } function max() { var args = [].slice.call(arguments, 0); return pickBy('isAfter', args); } var now = function () { return Date.now ? Date.now() : +new Date(); }; var ordering = [ 'year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond', ]; function isDurationValid(m) { var key, unitHasDecimal = false, i, orderLen = ordering.length; for (key in m) { if ( hasOwnProp(m, key) && !( indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])) ) ) { return false; } } for (i = 0; i < orderLen; ++i) { if (m[ordering[i]]) { if (unitHasDecimal) { return false; // only allow non-integers for smallest unit } if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { unitHasDecimal = true; } } } return true; } function isValid$1() { return this._isValid; } function createInvalid$1() { return createDuration(NaN); } function Duration(duration) { var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || normalizedInput.isoWeek || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0; this._isValid = isDurationValid(normalizedInput); // representation for dateAddRemove this._milliseconds = +milliseconds + seconds * 1e3 + // 1000 minutes * 6e4 + // 1000 * 60 hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 // Because of dateAddRemove treats 24 hours as different from a // day when working around DST, we need to store them separately this._days = +days + weeks * 7; // It is impossible to translate months into days without knowing // which months you are are talking about, so we have to store // it separately. this._months = +months + quarters * 3 + years * 12; this._data = {}; this._locale = getLocale(); this._bubble(); } function isDuration(obj) { return obj instanceof Duration; } function absRound(number) { if (number < 0) { return Math.round(-1 * number) * -1; } else { return Math.round(number); } } // compare two arrays, return the number of differences function compareArrays(array1, array2, dontConvert) { var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i; for (i = 0; i < len; i++) { if ( (dontConvert && array1[i] !== array2[i]) || (!dontConvert && toInt(array1[i]) !== toInt(array2[i])) ) { diffs++; } } return diffs + lengthDiff; } // FORMATTING function offset(token, separator) { addFormatToken(token, 0, 0, function () { var offset = this.utcOffset(), sign = '+'; if (offset < 0) { offset = -offset; sign = '-'; } return ( sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2) ); }); } offset('Z', ':'); offset('ZZ', ''); // PARSING addRegexToken('Z', matchShortOffset); addRegexToken('ZZ', matchShortOffset); addParseToken(['Z', 'ZZ'], function (input, array, config) { config._useUTC = true; config._tzm = offsetFromString(matchShortOffset, input); }); // HELPERS // timezone chunker // '+10:00' > ['10', '00'] // '-1530' > ['-15', '30'] var chunkOffset = /([\+\-]|\d\d)/gi; function offsetFromString(matcher, string) { var matches = (string || '').match(matcher), chunk, parts, minutes; if (matches === null) { return null; } chunk = matches[matches.length - 1] || []; parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; minutes = +(parts[1] * 60) + toInt(parts[2]); return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes; } // Return a moment from input, that is local/utc/zone equivalent to model. function cloneWithOffset(input, model) { var res, diff; if (model._isUTC) { res = model.clone(); diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); // Use low-level api, because this fn is low-level api. res._d.setTime(res._d.valueOf() + diff); hooks.updateOffset(res, false); return res; } else { return createLocal(input).local(); } } function getDateOffset(m) { // On Firefox.24 Date#getTimezoneOffset returns a floating point. // https://github.com/moment/moment/pull/1871 return -Math.round(m._d.getTimezoneOffset()); } // HOOKS // This function will be called whenever a moment is mutated. // It is intended to keep the offset in sync with the timezone. hooks.updateOffset = function () {}; // MOMENTS // keepLocalTime = true means only change the timezone, without // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset // +0200, so we adjust the time as needed, to be valid. // // Keeping the time actually adds/subtracts (one hour) // from the actual represented time. That is why we call updateOffset // a second time. In case it wants us to change the offset again // _changeInProgress == true case, then we have to adjust, because // there is no such time in the given timezone. function getSetOffset(input, keepLocalTime, keepMinutes) { var offset = this._offset || 0, localAdjust; if (!this.isValid()) { return input != null ? this : NaN; } if (input != null) { if (typeof input === 'string') { input = offsetFromString(matchShortOffset, input); if (input === null) { return this; } } else if (Math.abs(input) < 16 && !keepMinutes) { input = input * 60; } if (!this._isUTC && keepLocalTime) { localAdjust = getDateOffset(this); } this._offset = input; this._isUTC = true; if (localAdjust != null) { this.add(localAdjust, 'm'); } if (offset !== input) { if (!keepLocalTime || this._changeInProgress) { addSubtract( this, createDuration(input - offset, 'm'), 1, false ); } else if (!this._changeInProgress) { this._changeInProgress = true; hooks.updateOffset(this, true); this._changeInProgress = null; } } return this; } else { return this._isUTC ? offset : getDateOffset(this); } } function getSetZone(input, keepLocalTime) { if (input != null) { if (typeof input !== 'string') { input = -input; } this.utcOffset(input, keepLocalTime); return this; } else { return -this.utcOffset(); } } function setOffsetToUTC(keepLocalTime) { return this.utcOffset(0, keepLocalTime); } function setOffsetToLocal(keepLocalTime) { if (this._isUTC) { this.utcOffset(0, keepLocalTime); this._isUTC = false; if (keepLocalTime) { this.subtract(getDateOffset(this), 'm'); } } return this; } function setOffsetToParsedOffset() { if (this._tzm != null) { this.utcOffset(this._tzm, false, true); } else if (typeof this._i === 'string') { var tZone = offsetFromString(matchOffset, this._i); if (tZone != null) { this.utcOffset(tZone); } else { this.utcOffset(0, true); } } return this; } function hasAlignedHourOffset(input) { if (!this.isValid()) { return false; } input = input ? createLocal(input).utcOffset() : 0; return (this.utcOffset() - input) % 60 === 0; } function isDaylightSavingTime() { return ( this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset() ); } function isDaylightSavingTimeShifted() { if (!isUndefined(this._isDSTShifted)) { return this._isDSTShifted; } var c = {}, other; copyConfig(c, this); c = prepareConfig(c); if (c._a) { other = c._isUTC ? createUTC(c._a) : createLocal(c._a); this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; } else { this._isDSTShifted = false; } return this._isDSTShifted; } function isLocal() { return this.isValid() ? !this._isUTC : false; } function isUtcOffset() { return this.isValid() ? this._isUTC : false; } function isUtc() { return this.isValid() ? this._isUTC && this._offset === 0 : false; } // ASP.NET json date format regex var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere // and further modified to allow for strings containing both week and day isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; function createDuration(input, key) { var duration = input, // matching against regexp is expensive, do it on demand match = null, sign, ret, diffRes; if (isDuration(input)) { duration = { ms: input._milliseconds, d: input._days, M: input._months, }; } else if (isNumber(input) || !isNaN(+input)) { duration = {}; if (key) { duration[key] = +input; } else { duration.milliseconds = +input; } } else if ((match = aspNetRegex.exec(input))) { sign = match[1] === '-' ? -1 : 1; duration = { y: 0, d: toInt(match[DATE]) * sign, h: toInt(match[HOUR]) * sign, m: toInt(match[MINUTE]) * sign, s: toInt(match[SECOND]) * sign, ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match }; } else if ((match = isoRegex.exec(input))) { sign = match[1] === '-' ? -1 : 1; duration = { y: parseIso(match[2], sign), M: parseIso(match[3], sign), w: parseIso(match[4], sign), d: parseIso(match[5], sign), h: parseIso(match[6], sign), m: parseIso(match[7], sign), s: parseIso(match[8], sign), }; } else if (duration == null) { // checks for null or undefined duration = {}; } else if ( typeof duration === 'object' && ('from' in duration || 'to' in duration) ) { diffRes = momentsDifference( createLocal(duration.from), createLocal(duration.to) ); duration = {}; duration.ms = diffRes.milliseconds; duration.M = diffRes.months; } ret = new Duration(duration); if (isDuration(input) && hasOwnProp(input, '_locale')) { ret._locale = input._locale; } if (isDuration(input) && hasOwnProp(input, '_isValid')) { ret._isValid = input._isValid; } return ret; } createDuration.fn = Duration.prototype; createDuration.invalid = createInvalid$1; function parseIso(inp, sign) { // We'd normally use ~~inp for this, but unfortunately it also // converts floats to ints. // inp may be undefined, so careful calling replace on it. var res = inp && parseFloat(inp.replace(',', '.')); // apply sign while we're at it return (isNaN(res) ? 0 : res) * sign; } function positiveMomentsDifference(base, other) { var res = {}; res.months = other.month() - base.month() + (other.year() - base.year()) * 12; if (base.clone().add(res.months, 'M').isAfter(other)) { --res.months; } res.milliseconds = +other - +base.clone().add(res.months, 'M'); return res; } function momentsDifference(base, other) { var res; if (!(base.isValid() && other.isValid())) { return { milliseconds: 0, months: 0 }; } other = cloneWithOffset(other, base); if (base.isBefore(other)) { res = positiveMomentsDifference(base, other); } else { res = positiveMomentsDifference(other, base); res.milliseconds = -res.milliseconds; res.months = -res.months; } return res; } // TODO: remove 'name' arg after deprecation is removed function createAdder(direction, name) { return function (val, period) { var dur, tmp; //invert the arguments, but complain about it if (period !== null && !isNaN(+period)) { deprecateSimple( name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.' ); tmp = val; val = period; period = tmp; } dur = createDuration(val, period); addSubtract(this, dur, direction); return this; }; } function addSubtract(mom, duration, isAdding, updateOffset) { var milliseconds = duration._milliseconds, days = absRound(duration._days), months = absRound(duration._months); if (!mom.isValid()) { // No op return; } updateOffset = updateOffset == null ? true : updateOffset; if (months) { setMonth(mom, get(mom, 'Month') + months * isAdding); } if (days) { set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); } if (milliseconds) { mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); } if (updateOffset) { hooks.updateOffset(mom, days || months); } } var add = createAdder(1, 'add'), subtract = createAdder(-1, 'subtract'); function isString(input) { return typeof input === 'string' || input instanceof String; } // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined function isMomentInput(input) { return ( isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === undefined ); } function isMomentInputObject(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ 'years', 'year', 'y', 'months', 'month', 'M', 'days', 'day', 'd', 'dates', 'date', 'D', 'hours', 'hour', 'h', 'minutes', 'minute', 'm', 'seconds', 'second', 's', 'milliseconds', 'millisecond', 'ms', ], i, property, propertyLen = properties.length; for (i = 0; i < propertyLen; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } function isNumberOrStringArray(input) { var arrayTest = isArray(input), dataTypeTest = false; if (arrayTest) { dataTypeTest = input.filter(function (item) { return !isNumber(item) && isString(input); }).length === 0; } return arrayTest && dataTypeTest; } function isCalendarSpec(input) { var objectTest = isObject(input) && !isObjectEmpty(input), propertyTest = false, properties = [ 'sameDay', 'nextDay', 'lastDay', 'nextWeek', 'lastWeek', 'sameElse', ], i, property; for (i = 0; i < properties.length; i += 1) { property = properties[i]; propertyTest = propertyTest || hasOwnProp(input, property); } return objectTest && propertyTest; } function getCalendarFormat(myMoment, now) { var diff = myMoment.diff(now, 'days', true); return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; } function calendar$1(time, formats) { // Support for single parameter, formats only overload to the calendar function if (arguments.length === 1) { if (!arguments[0]) { time = undefined; formats = undefined; } else if (isMomentInput(arguments[0])) { time = arguments[0]; formats = undefined; } else if (isCalendarSpec(arguments[0])) { formats = arguments[0]; time = undefined; } } // We want to compare the start of today, vs this. // Getting start-of-today depends on whether we're local/utc/offset or not. var now = time || createLocal(), sod = cloneWithOffset(now, this).startOf('day'), format = hooks.calendarFormat(this, sod) || 'sameElse', output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); return this.format( output || this.localeData().calendar(format, this, createLocal(now)) ); } function clone() { return new Moment(this); } function isAfter(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() > localInput.valueOf(); } else { return localInput.valueOf() < this.clone().startOf(units).valueOf(); } } function isBefore(input, units) { var localInput = isMoment(input) ? input : createLocal(input); if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() < localInput.valueOf(); } else { return this.clone().endOf(units).valueOf() < localInput.valueOf(); } } function isBetween(from, to, units, inclusivity) { var localFrom = isMoment(from) ? from : createLocal(from), localTo = isMoment(to) ? to : createLocal(to); if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { return false; } inclusivity = inclusivity || '()'; return ( (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)) ); } function isSame(input, units) { var localInput = isMoment(input) ? input : createLocal(input), inputMs; if (!(this.isValid() && localInput.isValid())) { return false; } units = normalizeUnits(units) || 'millisecond'; if (units === 'millisecond') { return this.valueOf() === localInput.valueOf(); } else { inputMs = localInput.valueOf(); return ( this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf() ); } } function isSameOrAfter(input, units) { return this.isSame(input, units) || this.isAfter(input, units); } function isSameOrBefore(input, units) { return this.isSame(input, units) || this.isBefore(input, units); } function diff(input, units, asFloat) { var that, zoneDelta, output; if (!this.isValid()) { return NaN; } that = cloneWithOffset(input, this); if (!that.isValid()) { return NaN; } zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; units = normalizeUnits(units); switch (units) { case 'year': output = monthDiff(this, that) / 12; break; case 'month': output = monthDiff(this, that); break; case 'quarter': output = monthDiff(this, that) / 3; break; case 'second': output = (this - that) / 1e3; break; // 1000 case 'minute': output = (this - that) / 6e4; break; // 1000 * 60 case 'hour': output = (this - that) / 36e5; break; // 1000 * 60 * 60 case 'day': output = (this - that - zoneDelta) / 864e5; break; // 1000 * 60 * 60 * 24, negate dst case 'week': output = (this - that - zoneDelta) / 6048e5; break; // 1000 * 60 * 60 * 24 * 7, negate dst default: output = this - that; } return asFloat ? output : absFloor(output); } function monthDiff(a, b) { if (a.date() < b.date()) { // end-of-month calculations work correct when the start month has more // days than the end month. return -monthDiff(b, a); } // difference in months var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), // b is in (anchor - 1 month, anchor + 1 month) anchor = a.clone().add(wholeMonthDiff, 'months'), anchor2, adjust; if (b - anchor < 0) { anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor - anchor2); } else { anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); // linear across the month adjust = (b - anchor) / (anchor2 - anchor); } //check for negative zero, return zero if negative zero return -(wholeMonthDiff + adjust) || 0; } hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; function toString() { return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); } function toISOString(keepOffset) { if (!this.isValid()) { return null; } var utc = keepOffset !== true, m = utc ? this.clone().utc() : this; if (m.year() < 0 || m.year() > 9999) { return formatMoment( m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ' ); } if (isFunction(Date.prototype.toISOString)) { // native implementation is ~50x faster, use it when we can if (utc) { return this.toDate().toISOString(); } else { return new Date(this.valueOf() + this.utcOffset() * 60 * 1000) .toISOString() .replace('Z', formatMoment(m, 'Z')); } } return formatMoment( m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ' ); } /** * Return a human readable representation of a moment that can * also be evaluated to get a new moment which is the same * * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects */ function inspect() { if (!this.isValid()) { return 'moment.invalid(/* ' + this._i + ' */)'; } var func = 'moment', zone = '', prefix, year, datetime, suffix; if (!this.isLocal()) { func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; zone = 'Z'; } prefix = '[' + func + '("]'; year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; datetime = '-MM-DD[T]HH:mm:ss.SSS'; suffix = zone + '[")]'; return this.format(prefix + year + datetime + suffix); } function format(inputString) { if (!inputString) { inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; } var output = formatMoment(this, inputString); return this.localeData().postformat(output); } function from(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ to: this, from: time }) .locale(this.locale()) .humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function fromNow(withoutSuffix) { return this.from(createLocal(), withoutSuffix); } function to(time, withoutSuffix) { if ( this.isValid() && ((isMoment(time) && time.isValid()) || createLocal(time).isValid()) ) { return createDuration({ from: this, to: time }) .locale(this.locale()) .humanize(!withoutSuffix); } else { return this.localeData().invalidDate(); } } function toNow(withoutSuffix) { return this.to(createLocal(), withoutSuffix); } // If passed a locale key, it will set the locale for this // instance. Otherwise, it will return the locale configuration // variables for this instance. function locale(key) { var newLocaleData; if (key === undefined) { return this._locale._abbr; } else { newLocaleData = getLocale(key); if (newLocaleData != null) { this._locale = newLocaleData; } return this; } } var lang = deprecate( 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) { if (key === undefined) { return this.localeData(); } else { return this.locale(key); } } ); function localeData() { return this._locale; } var MS_PER_SECOND = 1000, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR; // actual modulo - handles negative numbers (for dates before 1970): function mod$1(dividend, divisor) { return ((dividend % divisor) + divisor) % divisor; } function localStartOfDate(y, m, d) { // the date constructor remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return new Date(y + 400, m, d) - MS_PER_400_YEARS; } else { return new Date(y, m, d).valueOf(); } } function utcStartOfDate(y, m, d) { // Date.UTC remaps years 0-99 to 1900-1999 if (y < 100 && y >= 0) { // preserve leap years using a full 400 year cycle, then reset return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; } else { return Date.UTC(y, m, d); } } function startOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case 'year': time = startOfDate(this.year(), 0, 1); break; case 'quarter': time = startOfDate( this.year(), this.month() - (this.month() % 3), 1 ); break; case 'month': time = startOfDate(this.year(), this.month(), 1); break; case 'week': time = startOfDate( this.year(), this.month(), this.date() - this.weekday() ); break; case 'isoWeek': time = startOfDate( this.year(), this.month(), this.date() - (this.isoWeekday() - 1) ); break; case 'day': case 'date': time = startOfDate(this.year(), this.month(), this.date()); break; case 'hour': time = this._d.valueOf(); time -= mod$1( time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR ); break; case 'minute': time = this._d.valueOf(); time -= mod$1(time, MS_PER_MINUTE); break; case 'second': time = this._d.valueOf(); time -= mod$1(time, MS_PER_SECOND); break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } function endOf(units) { var time, startOfDate; units = normalizeUnits(units); if (units === undefined || units === 'millisecond' || !this.isValid()) { return this; } startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; switch (units) { case 'year': time = startOfDate(this.year() + 1, 0, 1) - 1; break; case 'quarter': time = startOfDate( this.year(), this.month() - (this.month() % 3) + 3, 1 ) - 1; break; case 'month': time = startOfDate(this.year(), this.month() + 1, 1) - 1; break; case 'week': time = startOfDate( this.year(), this.month(), this.date() - this.weekday() + 7 ) - 1; break; case 'isoWeek': time = startOfDate( this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7 ) - 1; break; case 'day': case 'date': time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; break; case 'hour': time = this._d.valueOf(); time += MS_PER_HOUR - mod$1( time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR ) - 1; break; case 'minute': time = this._d.valueOf(); time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; break; case 'second': time = this._d.valueOf(); time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; break; } this._d.setTime(time); hooks.updateOffset(this, true); return this; } function valueOf() { return this._d.valueOf() - (this._offset || 0) * 60000; } function unix() { return Math.floor(this.valueOf() / 1000); } function toDate() { return new Date(this.valueOf()); } function toArray() { var m = this; return [ m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond(), ]; } function toObject() { var m = this; return { years: m.year(), months: m.month(), date: m.date(), hours: m.hours(), minutes: m.minutes(), seconds: m.seconds(), milliseconds: m.milliseconds(), }; } function toJSON() { // new Date(NaN).toJSON() === null return this.isValid() ? this.toISOString() : null; } function isValid$2() { return isValid(this); } function parsingFlags() { return extend({}, getParsingFlags(this)); } function invalidAt() { return getParsingFlags(this).overflow; } function creationData() { return { input: this._i, format: this._f, locale: this._locale, isUTC: this._isUTC, strict: this._strict, }; } addFormatToken('N', 0, 0, 'eraAbbr'); addFormatToken('NN', 0, 0, 'eraAbbr'); addFormatToken('NNN', 0, 0, 'eraAbbr'); addFormatToken('NNNN', 0, 0, 'eraName'); addFormatToken('NNNNN', 0, 0, 'eraNarrow'); addFormatToken('y', ['y', 1], 'yo', 'eraYear'); addFormatToken('y', ['yy', 2], 0, 'eraYear'); addFormatToken('y', ['yyy', 3], 0, 'eraYear'); addFormatToken('y', ['yyyy', 4], 0, 'eraYear'); addRegexToken('N', matchEraAbbr); addRegexToken('NN', matchEraAbbr); addRegexToken('NNN', matchEraAbbr); addRegexToken('NNNN', matchEraName); addRegexToken('NNNNN', matchEraNarrow); addParseToken( ['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (input, array, config, token) { var era = config._locale.erasParse(input, token, config._strict); if (era) { getParsingFlags(config).era = era; } else { getParsingFlags(config).invalidEra = input; } } ); addRegexToken('y', matchUnsigned); addRegexToken('yy', matchUnsigned); addRegexToken('yyy', matchUnsigned); addRegexToken('yyyy', matchUnsigned); addRegexToken('yo', matchEraYearOrdinal); addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR); addParseToken(['yo'], function (input, array, config, token) { var match; if (config._locale._eraYearOrdinalRegex) { match = input.match(config._locale._eraYearOrdinalRegex); } if (config._locale.eraYearOrdinalParse) { array[YEAR] = config._locale.eraYearOrdinalParse(input, match); } else { array[YEAR] = parseInt(input, 10); } }); function localeEras(m, format) { var i, l, date, eras = this._eras || getLocale('en')._eras; for (i = 0, l = eras.length; i < l; ++i) { switch (typeof eras[i].since) { case 'string': // truncate time date = hooks(eras[i].since).startOf('day'); eras[i].since = date.valueOf(); break; } switch (typeof eras[i].until) { case 'undefined': eras[i].until = +Infinity; break; case 'string': // truncate time date = hooks(eras[i].until).startOf('day').valueOf(); eras[i].until = date.valueOf(); break; } } return eras; } function localeErasParse(eraName, format, strict) { var i, l, eras = this.eras(), name, abbr, narrow; eraName = eraName.toUpperCase(); for (i = 0, l = eras.length; i < l; ++i) { name = eras[i].name.toUpperCase(); abbr = eras[i].abbr.toUpperCase(); narrow = eras[i].narrow.toUpperCase(); if (strict) { switch (format) { case 'N': case 'NN': case 'NNN': if (abbr === eraName) { return eras[i]; } break; case 'NNNN': if (name === eraName) { return eras[i]; } break; case 'NNNNN': if (narrow === eraName) { return eras[i]; } break; } } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { return eras[i]; } } } function localeErasConvertYear(era, year) { var dir = era.since <= era.until ? +1 : -1; if (year === undefined) { return hooks(era.since).year(); } else { return hooks(era.since).year() + (year - era.offset) * dir; } } function getEraName() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].name; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].name; } } return ''; } function getEraNarrow() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].narrow; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].narrow; } } return ''; } function getEraAbbr() { var i, l, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { // truncate time val = this.clone().startOf('day').valueOf(); if (eras[i].since <= val && val <= eras[i].until) { return eras[i].abbr; } if (eras[i].until <= val && val <= eras[i].since) { return eras[i].abbr; } } return ''; } function getEraYear() { var i, l, dir, val, eras = this.localeData().eras(); for (i = 0, l = eras.length; i < l; ++i) { dir = eras[i].since <= eras[i].until ? +1 : -1; // truncate time val = this.clone().startOf('day').valueOf(); if ( (eras[i].since <= val && val <= eras[i].until) || (eras[i].until <= val && val <= eras[i].since) ) { return ( (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset ); } } return this.year(); } function erasNameRegex(isStrict) { if (!hasOwnProp(this, '_erasNameRegex')) { computeErasParse.call(this); } return isStrict ? this._erasNameRegex : this._erasRegex; } function erasAbbrRegex(isStrict) { if (!hasOwnProp(this, '_erasAbbrRegex')) { computeErasParse.call(this); } return isStrict ? this._erasAbbrRegex : this._erasRegex; } function erasNarrowRegex(isStrict) { if (!hasOwnProp(this, '_erasNarrowRegex')) { computeErasParse.call(this); } return isStrict ? this._erasNarrowRegex : this._erasRegex; } function matchEraAbbr(isStrict, locale) { return locale.erasAbbrRegex(isStrict); } function matchEraName(isStrict, locale) { return locale.erasNameRegex(isStrict); } function matchEraNarrow(isStrict, locale) { return locale.erasNarrowRegex(isStrict); } function matchEraYearOrdinal(isStrict, locale) { return locale._eraYearOrdinalRegex || matchUnsigned; } function computeErasParse() { var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, erasName, erasAbbr, erasNarrow, eras = this.eras(); for (i = 0, l = eras.length; i < l; ++i) { erasName = regexEscape(eras[i].name); erasAbbr = regexEscape(eras[i].abbr); erasNarrow = regexEscape(eras[i].narrow); namePieces.push(erasName); abbrPieces.push(erasAbbr); narrowPieces.push(erasNarrow); mixedPieces.push(erasName); mixedPieces.push(erasAbbr); mixedPieces.push(erasNarrow); } this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i'); this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i'); this._erasNarrowRegex = new RegExp( '^(' + narrowPieces.join('|') + ')', 'i' ); } // FORMATTING addFormatToken(0, ['gg', 2], 0, function () { return this.weekYear() % 100; }); addFormatToken(0, ['GG', 2], 0, function () { return this.isoWeekYear() % 100; }); function addWeekYearFormatToken(token, getter) { addFormatToken(0, [token, token.length], 0, getter); } addWeekYearFormatToken('gggg', 'weekYear'); addWeekYearFormatToken('ggggg', 'weekYear'); addWeekYearFormatToken('GGGG', 'isoWeekYear'); addWeekYearFormatToken('GGGGG', 'isoWeekYear'); // ALIASES // PARSING addRegexToken('G', matchSigned); addRegexToken('g', matchSigned); addRegexToken('GG', match1to2, match2); addRegexToken('gg', match1to2, match2); addRegexToken('GGGG', match1to4, match4); addRegexToken('gggg', match1to4, match4); addRegexToken('GGGGG', match1to6, match6); addRegexToken('ggggg', match1to6, match6); addWeekParseToken( ['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { week[token.substr(0, 2)] = toInt(input); } ); addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { week[token] = hooks.parseTwoDigitYear(input); }); // MOMENTS function getSetWeekYear(input) { return getSetWeekYearHelper.call( this, input, this.week(), this.weekday() + this.localeData()._week.dow, this.localeData()._week.dow, this.localeData()._week.doy ); } function getSetISOWeekYear(input) { return getSetWeekYearHelper.call( this, input, this.isoWeek(), this.isoWeekday(), 1, 4 ); } function getISOWeeksInYear() { return weeksInYear(this.year(), 1, 4); } function getISOWeeksInISOWeekYear() { return weeksInYear(this.isoWeekYear(), 1, 4); } function getWeeksInYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); } function getWeeksInWeekYear() { var weekInfo = this.localeData()._week; return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); } function getSetWeekYearHelper(input, week, weekday, dow, doy) { var weeksTarget; if (input == null) { return weekOfYear(this, dow, doy).year; } else { weeksTarget = weeksInYear(input, dow, doy); if (week > weeksTarget) { week = weeksTarget; } return setWeekAll.call(this, input, week, weekday, dow, doy); } } function setWeekAll(weekYear, week, weekday, dow, doy) { var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); this.year(date.getUTCFullYear()); this.month(date.getUTCMonth()); this.date(date.getUTCDate()); return this; } // FORMATTING addFormatToken('Q', 0, 'Qo', 'quarter'); // PARSING addRegexToken('Q', match1); addParseToken('Q', function (input, array) { array[MONTH] = (toInt(input) - 1) * 3; }); // MOMENTS function getSetQuarter(input) { return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + (this.month() % 3)); } // FORMATTING addFormatToken('D', ['DD', 2], 'Do', 'date'); // PARSING addRegexToken('D', match1to2, match1to2NoLeadingZero); addRegexToken('DD', match1to2, match2); addRegexToken('Do', function (isStrict, locale) { // TODO: Remove "ordinalParse" fallback in next major release. return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient; }); addParseToken(['D', 'DD'], DATE); addParseToken('Do', function (input, array) { array[DATE] = toInt(input.match(match1to2)[0]); }); // MOMENTS var getSetDayOfMonth = makeGetSet('Date', true); // FORMATTING addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); // PARSING addRegexToken('DDD', match1to3); addRegexToken('DDDD', match3); addParseToken(['DDD', 'DDDD'], function (input, array, config) { config._dayOfYear = toInt(input); }); // HELPERS // MOMENTS function getSetDayOfYear(input) { var dayOfYear = Math.round( (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5 ) + 1; return input == null ? dayOfYear : this.add(input - dayOfYear, 'd'); } // FORMATTING addFormatToken('m', ['mm', 2], 0, 'minute'); // PARSING addRegexToken('m', match1to2, match1to2HasZero); addRegexToken('mm', match1to2, match2); addParseToken(['m', 'mm'], MINUTE); // MOMENTS var getSetMinute = makeGetSet('Minutes', false); // FORMATTING addFormatToken('s', ['ss', 2], 0, 'second'); // PARSING addRegexToken('s', match1to2, match1to2HasZero); addRegexToken('ss', match1to2, match2); addParseToken(['s', 'ss'], SECOND); // MOMENTS var getSetSecond = makeGetSet('Seconds', false); // FORMATTING addFormatToken('S', 0, 0, function () { return ~~(this.millisecond() / 100); }); addFormatToken(0, ['SS', 2], 0, function () { return ~~(this.millisecond() / 10); }); addFormatToken(0, ['SSS', 3], 0, 'millisecond'); addFormatToken(0, ['SSSS', 4], 0, function () { return this.millisecond() * 10; }); addFormatToken(0, ['SSSSS', 5], 0, function () { return this.millisecond() * 100; }); addFormatToken(0, ['SSSSSS', 6], 0, function () { return this.millisecond() * 1000; }); addFormatToken(0, ['SSSSSSS', 7], 0, function () { return this.millisecond() * 10000; }); addFormatToken(0, ['SSSSSSSS', 8], 0, function () { return this.millisecond() * 100000; }); addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { return this.millisecond() * 1000000; }); // PARSING addRegexToken('S', match1to3, match1); addRegexToken('SS', match1to3, match2); addRegexToken('SSS', match1to3, match3); var token, getSetMillisecond; for (token = 'SSSS'; token.length <= 9; token += 'S') { addRegexToken(token, matchUnsigned); } function parseMs(input, array) { array[MILLISECOND] = toInt(('0.' + input) * 1000); } for (token = 'S'; token.length <= 9; token += 'S') { addParseToken(token, parseMs); } getSetMillisecond = makeGetSet('Milliseconds', false); // FORMATTING addFormatToken('z', 0, 0, 'zoneAbbr'); addFormatToken('zz', 0, 0, 'zoneName'); // MOMENTS function getZoneAbbr() { return this._isUTC ? 'UTC' : ''; } function getZoneName() { return this._isUTC ? 'Coordinated Universal Time' : ''; } var proto = Moment.prototype; proto.add = add; proto.calendar = calendar$1; proto.clone = clone; proto.diff = diff; proto.endOf = endOf; proto.format = format; proto.from = from; proto.fromNow = fromNow; proto.to = to; proto.toNow = toNow; proto.get = stringGet; proto.invalidAt = invalidAt; proto.isAfter = isAfter; proto.isBefore = isBefore; proto.isBetween = isBetween; proto.isSame = isSame; proto.isSameOrAfter = isSameOrAfter; proto.isSameOrBefore = isSameOrBefore; proto.isValid = isValid$2; proto.lang = lang; proto.locale = locale; proto.localeData = localeData; proto.max = prototypeMax; proto.min = prototypeMin; proto.parsingFlags = parsingFlags; proto.set = stringSet; proto.startOf = startOf; proto.subtract = subtract; proto.toArray = toArray; proto.toObject = toObject; proto.toDate = toDate; proto.toISOString = toISOString; proto.inspect = inspect; if (typeof Symbol !== 'undefined' && Symbol.for != null) { proto[Symbol.for('nodejs.util.inspect.custom')] = function () { return 'Moment<' + this.format() + '>'; }; } proto.toJSON = toJSON; proto.toString = toString; proto.unix = unix; proto.valueOf = valueOf; proto.creationData = creationData; proto.eraName = getEraName; proto.eraNarrow = getEraNarrow; proto.eraAbbr = getEraAbbr; proto.eraYear = getEraYear; proto.year = getSetYear; proto.isLeapYear = getIsLeapYear; proto.weekYear = getSetWeekYear; proto.isoWeekYear = getSetISOWeekYear; proto.quarter = proto.quarters = getSetQuarter; proto.month = getSetMonth; proto.daysInMonth = getDaysInMonth; proto.week = proto.weeks = getSetWeek; proto.isoWeek = proto.isoWeeks = getSetISOWeek; proto.weeksInYear = getWeeksInYear; proto.weeksInWeekYear = getWeeksInWeekYear; proto.isoWeeksInYear = getISOWeeksInYear; proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; proto.date = getSetDayOfMonth; proto.day = proto.days = getSetDayOfWeek; proto.weekday = getSetLocaleDayOfWeek; proto.isoWeekday = getSetISODayOfWeek; proto.dayOfYear = getSetDayOfYear; proto.hour = proto.hours = getSetHour; proto.minute = proto.minutes = getSetMinute; proto.second = proto.seconds = getSetSecond; proto.millisecond = proto.milliseconds = getSetMillisecond; proto.utcOffset = getSetOffset; proto.utc = setOffsetToUTC; proto.local = setOffsetToLocal; proto.parseZone = setOffsetToParsedOffset; proto.hasAlignedHourOffset = hasAlignedHourOffset; proto.isDST = isDaylightSavingTime; proto.isLocal = isLocal; proto.isUtcOffset = isUtcOffset; proto.isUtc = isUtc; proto.isUTC = isUtc; proto.zoneAbbr = getZoneAbbr; proto.zoneName = getZoneName; proto.dates = deprecate( 'dates accessor is deprecated. Use date instead.', getSetDayOfMonth ); proto.months = deprecate( 'months accessor is deprecated. Use month instead', getSetMonth ); proto.years = deprecate( 'years accessor is deprecated. Use year instead', getSetYear ); proto.zone = deprecate( 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone ); proto.isDSTShifted = deprecate( 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted ); function createUnix(input) { return createLocal(input * 1000); } function createInZone() { return createLocal.apply(null, arguments).parseZone(); } function preParsePostFormat(string) { return string; } var proto$1 = Locale.prototype; proto$1.calendar = calendar; proto$1.longDateFormat = longDateFormat; proto$1.invalidDate = invalidDate; proto$1.ordinal = ordinal; proto$1.preparse = preParsePostFormat; proto$1.postformat = preParsePostFormat; proto$1.relativeTime = relativeTime; proto$1.pastFuture = pastFuture; proto$1.set = set; proto$1.eras = localeEras; proto$1.erasParse = localeErasParse; proto$1.erasConvertYear = localeErasConvertYear; proto$1.erasAbbrRegex = erasAbbrRegex; proto$1.erasNameRegex = erasNameRegex; proto$1.erasNarrowRegex = erasNarrowRegex; proto$1.months = localeMonths; proto$1.monthsShort = localeMonthsShort; proto$1.monthsParse = localeMonthsParse; proto$1.monthsRegex = monthsRegex; proto$1.monthsShortRegex = monthsShortRegex; proto$1.week = localeWeek; proto$1.firstDayOfYear = localeFirstDayOfYear; proto$1.firstDayOfWeek = localeFirstDayOfWeek; proto$1.weekdays = localeWeekdays; proto$1.weekdaysMin = localeWeekdaysMin; proto$1.weekdaysShort = localeWeekdaysShort; proto$1.weekdaysParse = localeWeekdaysParse; proto$1.weekdaysRegex = weekdaysRegex; proto$1.weekdaysShortRegex = weekdaysShortRegex; proto$1.weekdaysMinRegex = weekdaysMinRegex; proto$1.isPM = localeIsPM; proto$1.meridiem = localeMeridiem; function get$1(format, index, field, setter) { var locale = getLocale(), utc = createUTC().set(setter, index); return locale[field](utc, format); } function listMonthsImpl(format, index, field) { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; if (index != null) { return get$1(format, index, field, 'month'); } var i, out = []; for (i = 0; i < 12; i++) { out[i] = get$1(format, i, field, 'month'); } return out; } // () // (5) // (fmt, 5) // (fmt) // (true) // (true, 5) // (true, fmt, 5) // (true, fmt) function listWeekdaysImpl(localeSorted, format, index, field) { if (typeof localeSorted === 'boolean') { if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } else { format = localeSorted; index = format; localeSorted = false; if (isNumber(format)) { index = format; format = undefined; } format = format || ''; } var locale = getLocale(), shift = localeSorted ? locale._week.dow : 0, i, out = []; if (index != null) { return get$1(format, (index + shift) % 7, field, 'day'); } for (i = 0; i < 7; i++) { out[i] = get$1(format, (i + shift) % 7, field, 'day'); } return out; } function listMonths(format, index) { return listMonthsImpl(format, index, 'months'); } function listMonthsShort(format, index) { return listMonthsImpl(format, index, 'monthsShort'); } function listWeekdays(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); } function listWeekdaysShort(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); } function listWeekdaysMin(localeSorted, format, index) { return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); } getSetGlobalLocale('en', { eras: [ { since: '0001-01-01', until: +Infinity, offset: 1, name: 'Anno Domini', narrow: 'AD', abbr: 'AD', }, { since: '0000-12-31', until: -Infinity, offset: 1, name: 'Before Christ', narrow: 'BC', abbr: 'BC', }, ], dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, ordinal: function (number) { var b = number % 10, output = toInt((number % 100) / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; return number + output; }, }); // Side effect imports hooks.lang = deprecate( 'moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale ); hooks.langData = deprecate( 'moment.langData is deprecated. Use moment.localeData instead.', getLocale ); var mathAbs = Math.abs; function abs() { var data = this._data; this._milliseconds = mathAbs(this._milliseconds); this._days = mathAbs(this._days); this._months = mathAbs(this._months); data.milliseconds = mathAbs(data.milliseconds); data.seconds = mathAbs(data.seconds); data.minutes = mathAbs(data.minutes); data.hours = mathAbs(data.hours); data.months = mathAbs(data.months); data.years = mathAbs(data.years); return this; } function addSubtract$1(duration, input, value, direction) { var other = createDuration(input, value); duration._milliseconds += direction * other._milliseconds; duration._days += direction * other._days; duration._months += direction * other._months; return duration._bubble(); } // supports only 2.0-style add(1, 's') or add(duration) function add$1(input, value) { return addSubtract$1(this, input, value, 1); } // supports only 2.0-style subtract(1, 's') or subtract(duration) function subtract$1(input, value) { return addSubtract$1(this, input, value, -1); } function absCeil(number) { if (number < 0) { return Math.floor(number); } else { return Math.ceil(number); } } function bubble() { var milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data, seconds, minutes, hours, years, monthsFromDays; // if we have a mix of positive and negative values, bubble down first // check: https://github.com/moment/moment/issues/2166 if ( !( (milliseconds >= 0 && days >= 0 && months >= 0) || (milliseconds <= 0 && days <= 0 && months <= 0) ) ) { milliseconds += absCeil(monthsToDays(months) + days) * 864e5; days = 0; months = 0; } // The following code bubbles up values, see the tests for // examples of what that means. data.milliseconds = milliseconds % 1000; seconds = absFloor(milliseconds / 1000); data.seconds = seconds % 60; minutes = absFloor(seconds / 60); data.minutes = minutes % 60; hours = absFloor(minutes / 60); data.hours = hours % 24; days += absFloor(hours / 24); // convert days to months monthsFromDays = absFloor(daysToMonths(days)); months += monthsFromDays; days -= absCeil(monthsToDays(monthsFromDays)); // 12 months -> 1 year years = absFloor(months / 12); months %= 12; data.days = days; data.months = months; data.years = years; return this; } function daysToMonths(days) { // 400 years have 146097 days (taking into account leap year rules) // 400 years have 12 months === 4800 return (days * 4800) / 146097; } function monthsToDays(months) { // the reverse of daysToMonths return (months * 146097) / 4800; } function as(units) { if (!this.isValid()) { return NaN; } var days, months, milliseconds = this._milliseconds; units = normalizeUnits(units); if (units === 'month' || units === 'quarter' || units === 'year') { days = this._days + milliseconds / 864e5; months = this._months + daysToMonths(days); switch (units) { case 'month': return months; case 'quarter': return months / 3; case 'year': return months / 12; } } else { // handle milliseconds separately because of floating point math errors (issue #1867) days = this._days + Math.round(monthsToDays(this._months)); switch (units) { case 'week': return days / 7 + milliseconds / 6048e5; case 'day': return days + milliseconds / 864e5; case 'hour': return days * 24 + milliseconds / 36e5; case 'minute': return days * 1440 + milliseconds / 6e4; case 'second': return days * 86400 + milliseconds / 1000; // Math.floor prevents floating point math errors here case 'millisecond': return Math.floor(days * 864e5) + milliseconds; default: throw new Error('Unknown unit ' + units); } } } function makeAs(alias) { return function () { return this.as(alias); }; } var asMilliseconds = makeAs('ms'), asSeconds = makeAs('s'), asMinutes = makeAs('m'), asHours = makeAs('h'), asDays = makeAs('d'), asWeeks = makeAs('w'), asMonths = makeAs('M'), asQuarters = makeAs('Q'), asYears = makeAs('y'), valueOf$1 = asMilliseconds; function clone$1() { return createDuration(this); } function get$2(units) { units = normalizeUnits(units); return this.isValid() ? this[units + 's']() : NaN; } function makeGetter(name) { return function () { return this.isValid() ? this._data[name] : NaN; }; } var milliseconds = makeGetter('milliseconds'), seconds = makeGetter('seconds'), minutes = makeGetter('minutes'), hours = makeGetter('hours'), days = makeGetter('days'), months = makeGetter('months'), years = makeGetter('years'); function weeks() { return absFloor(this.days() / 7); } var round = Math.round, thresholds = { ss: 44, // a few seconds to seconds s: 45, // seconds to minute m: 45, // minutes to hour h: 22, // hours to day d: 26, // days to month/week w: null, // weeks to month M: 11, // months to year }; // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); } function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) { var duration = createDuration(posNegDuration).abs(), seconds = round(duration.as('s')), minutes = round(duration.as('m')), hours = round(duration.as('h')), days = round(duration.as('d')), months = round(duration.as('M')), weeks = round(duration.as('w')), years = round(duration.as('y')), a = (seconds <= thresholds.ss && ['s', seconds]) || (seconds < thresholds.s && ['ss', seconds]) || (minutes <= 1 && ['m']) || (minutes < thresholds.m && ['mm', minutes]) || (hours <= 1 && ['h']) || (hours < thresholds.h && ['hh', hours]) || (days <= 1 && ['d']) || (days < thresholds.d && ['dd', days]); if (thresholds.w != null) { a = a || (weeks <= 1 && ['w']) || (weeks < thresholds.w && ['ww', weeks]); } a = a || (months <= 1 && ['M']) || (months < thresholds.M && ['MM', months]) || (years <= 1 && ['y']) || ['yy', years]; a[2] = withoutSuffix; a[3] = +posNegDuration > 0; a[4] = locale; return substituteTimeAgo.apply(null, a); } // This function allows you to set the rounding function for relative time strings function getSetRelativeTimeRounding(roundingFunction) { if (roundingFunction === undefined) { return round; } if (typeof roundingFunction === 'function') { round = roundingFunction; return true; } return false; } // This function allows you to set a threshold for relative time strings function getSetRelativeTimeThreshold(threshold, limit) { if (thresholds[threshold] === undefined) { return false; } if (limit === undefined) { return thresholds[threshold]; } thresholds[threshold] = limit; if (threshold === 's') { thresholds.ss = limit - 1; } return true; } function humanize(argWithSuffix, argThresholds) { if (!this.isValid()) { return this.localeData().invalidDate(); } var withSuffix = false, th = thresholds, locale, output; if (typeof argWithSuffix === 'object') { argThresholds = argWithSuffix; argWithSuffix = false; } if (typeof argWithSuffix === 'boolean') { withSuffix = argWithSuffix; } if (typeof argThresholds === 'object') { th = Object.assign({}, thresholds, argThresholds); if (argThresholds.s != null && argThresholds.ss == null) { th.ss = argThresholds.s - 1; } } locale = this.localeData(); output = relativeTime$1(this, !withSuffix, th, locale); if (withSuffix) { output = locale.pastFuture(+this, output); } return locale.postformat(output); } var abs$1 = Math.abs; function sign(x) { return (x > 0) - (x < 0) || +x; } function toISOString$1() { // for ISO strings we do not use the normal bubbling rules: // * milliseconds bubble up until they become hours // * days do not bubble at all // * months bubble up until they become years // This is because there is no context-free conversion between hours and days // (think of clock changes) // and also not between days and months (28-31 days per month) if (!this.isValid()) { return this.localeData().invalidDate(); } var seconds = abs$1(this._milliseconds) / 1000, days = abs$1(this._days), months = abs$1(this._months), minutes, hours, years, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign; if (!total) { // this is the same as C#'s (Noda) and python (isodate)... // but not other JS (goog.date) return 'P0D'; } // 3600 seconds -> 60 minutes -> 1 hour minutes = absFloor(seconds / 60); hours = absFloor(minutes / 60); seconds %= 60; minutes %= 60; // 12 months -> 1 year years = absFloor(months / 12); months %= 12; // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; totalSign = total < 0 ? '-' : ''; ymSign = sign(this._months) !== sign(total) ? '-' : ''; daysSign = sign(this._days) !== sign(total) ? '-' : ''; hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; return ( totalSign + 'P' + (years ? ymSign + years + 'Y' : '') + (months ? ymSign + months + 'M' : '') + (days ? daysSign + days + 'D' : '') + (hours || minutes || seconds ? 'T' : '') + (hours ? hmsSign + hours + 'H' : '') + (minutes ? hmsSign + minutes + 'M' : '') + (seconds ? hmsSign + s + 'S' : '') ); } var proto$2 = Duration.prototype; proto$2.isValid = isValid$1; proto$2.abs = abs; proto$2.add = add$1; proto$2.subtract = subtract$1; proto$2.as = as; proto$2.asMilliseconds = asMilliseconds; proto$2.asSeconds = asSeconds; proto$2.asMinutes = asMinutes; proto$2.asHours = asHours; proto$2.asDays = asDays; proto$2.asWeeks = asWeeks; proto$2.asMonths = asMonths; proto$2.asQuarters = asQuarters; proto$2.asYears = asYears; proto$2.valueOf = valueOf$1; proto$2._bubble = bubble; proto$2.clone = clone$1; proto$2.get = get$2; proto$2.milliseconds = milliseconds; proto$2.seconds = seconds; proto$2.minutes = minutes; proto$2.hours = hours; proto$2.days = days; proto$2.weeks = weeks; proto$2.months = months; proto$2.years = years; proto$2.humanize = humanize; proto$2.toISOString = toISOString$1; proto$2.toString = toISOString$1; proto$2.toJSON = toISOString$1; proto$2.locale = locale; proto$2.localeData = localeData; proto$2.toIsoString = deprecate( 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1 ); proto$2.lang = lang; // FORMATTING addFormatToken('X', 0, 0, 'unix'); addFormatToken('x', 0, 0, 'valueOf'); // PARSING addRegexToken('x', matchSigned); addRegexToken('X', matchTimestamp); addParseToken('X', function (input, array, config) { config._d = new Date(parseFloat(input) * 1000); }); addParseToken('x', function (input, array, config) { config._d = new Date(toInt(input)); }); //! moment.js hooks.version = '2.30.1'; setHookCallback(createLocal); hooks.fn = proto; hooks.min = min; hooks.max = max; hooks.now = now; hooks.utc = createUTC; hooks.unix = createUnix; hooks.months = listMonths; hooks.isDate = isDate; hooks.locale = getSetGlobalLocale; hooks.invalid = createInvalid; hooks.duration = createDuration; hooks.isMoment = isMoment; hooks.weekdays = listWeekdays; hooks.parseZone = createInZone; hooks.localeData = getLocale; hooks.isDuration = isDuration; hooks.monthsShort = listMonthsShort; hooks.weekdaysMin = listWeekdaysMin; hooks.defineLocale = defineLocale; hooks.updateLocale = updateLocale; hooks.locales = listLocales; hooks.weekdaysShort = listWeekdaysShort; hooks.normalizeUnits = normalizeUnits; hooks.relativeTimeRounding = getSetRelativeTimeRounding; hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; hooks.calendarFormat = getCalendarFormat; hooks.prototype = proto; // currently HTML5 input type only supports 24-hour formats hooks.HTML5_FMT = { DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" /> DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" /> DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" /> DATE: 'YYYY-MM-DD', // <input type="date" /> TIME: 'HH:mm', // <input type="time" /> TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" /> TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" /> WEEK: 'GGGG-[W]WW', // <input type="week" /> MONTH: 'YYYY-MM', // <input type="month" /> }; return hooks; }))); vendor/react-dom.js 0000644 00004075643 15013651111 0010267 0 ustar 00 /** * @license React * react-dom.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) : typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) : (global = global || self, factory(global.ReactDOM = {}, global.React)); }(this, (function (exports, React) { 'use strict'; var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; var suppressWarning = false; function setSuppressWarning(newSuppressWarning) { { suppressWarning = newSuppressWarning; } } // In DEV, calls to console.warn and console.error get replaced // by calls to these methods by a Babel plugin. // // In PROD (or in packages without access to React internals), // they are left as they are instead. function warn(format) { { if (!suppressWarning) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } printWarning('warn', format, args); } } } function error(format) { { if (!suppressWarning) { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning('error', format, args); } } } function printWarning(level, format, args) { // When changing this logic, you might want to also // update consoleWithStackDev.www.js as well. { var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame.getStackAddendum(); if (stack !== '') { format += '%s'; args = args.concat([stack]); } // eslint-disable-next-line react-internal/safe-string-coercion var argsWithFormat = args.map(function (item) { return String(item); }); // Careful: RN currently depends on this prefix argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it // breaks IE9: https://github.com/facebook/react/issues/13610 // eslint-disable-next-line react-internal/no-production-logging Function.prototype.apply.call(console[level], console, argsWithFormat); } } var FunctionComponent = 0; var ClassComponent = 1; var IndeterminateComponent = 2; // Before we know whether it is function or class var HostRoot = 3; // Root of a host tree. Could be nested inside another node. var HostPortal = 4; // A subtree. Could be an entry point to a different renderer. var HostComponent = 5; var HostText = 6; var Fragment = 7; var Mode = 8; var ContextConsumer = 9; var ContextProvider = 10; var ForwardRef = 11; var Profiler = 12; var SuspenseComponent = 13; var MemoComponent = 14; var SimpleMemoComponent = 15; var LazyComponent = 16; var IncompleteClassComponent = 17; var DehydratedFragment = 18; var SuspenseListComponent = 19; var ScopeComponent = 21; var OffscreenComponent = 22; var LegacyHiddenComponent = 23; var CacheComponent = 24; var TracingMarkerComponent = 25; // ----------------------------------------------------------------------------- var enableClientRenderFallbackOnTextMismatch = true; // TODO: Need to review this code one more time before landing // the react-reconciler package. var enableNewReconciler = false; // Support legacy Primer support on internal FB www var enableLazyContextPropagation = false; // FB-only usage. The new API has different semantics. var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber var enableSuspenseAvoidThisFallback = false; // Enables unstable_avoidThisFallback feature in Fizz // React DOM Chopping Block // // Similar to main Chopping Block but only flags related to React DOM. These are // grouped because we will likely batch all of them into a single major release. // ----------------------------------------------------------------------------- // Disable support for comment nodes as React DOM containers. Already disabled // in open source, but www codebase still relies on it. Need to remove. var disableCommentsAsDOMContainers = true; // Disable javascript: URL strings in href for XSS protection. // and client rendering, mostly to allow JSX attributes to apply to the custom // element's object properties instead of only HTML attributes. // https://github.com/facebook/react/issues/11347 var enableCustomElementPropertySupport = false; // Disables children for <textarea> elements var warnAboutStringRefs = true; // ----------------------------------------------------------------------------- // Debugging and DevTools // ----------------------------------------------------------------------------- // Adds user timing marks for e.g. state updates, suspense, and work loop stuff, // for an experimental timeline tool. var enableSchedulingProfiler = true; // Helps identify side effects in render-phase lifecycle hooks and setState var enableProfilerTimer = true; // Record durations for commit and passive effects phases. var enableProfilerCommitHooks = true; // Phase param passed to onRender callback differentiates between an "update" and a "cascading-update". var allNativeEvents = new Set(); /** * Mapping from registration name to event name */ var registrationNameDependencies = {}; /** * Mapping from lowercase registration names to the properly cased version, * used to warn in the case of missing event handlers. Available * only in true. * @type {Object} */ var possibleRegistrationNames = {} ; // Trust the developer to only use possibleRegistrationNames in true function registerTwoPhaseEvent(registrationName, dependencies) { registerDirectEvent(registrationName, dependencies); registerDirectEvent(registrationName + 'Capture', dependencies); } function registerDirectEvent(registrationName, dependencies) { { if (registrationNameDependencies[registrationName]) { error('EventRegistry: More than one plugin attempted to publish the same ' + 'registration name, `%s`.', registrationName); } } registrationNameDependencies[registrationName] = dependencies; { var lowerCasedName = registrationName.toLowerCase(); possibleRegistrationNames[lowerCasedName] = registrationName; if (registrationName === 'onDoubleClick') { possibleRegistrationNames.ondblclick = registrationName; } } for (var i = 0; i < dependencies.length; i++) { allNativeEvents.add(dependencies[i]); } } var canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined'); var hasOwnProperty = Object.prototype.hasOwnProperty; /* * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol * and Temporal.* types. See https://github.com/facebook/react/pull/22064. * * The functions in this module will throw an easier-to-understand, * easier-to-debug exception with a clear errors message message explaining the * problem. (Instead of a confusing exception thrown inside the implementation * of the `value` object). */ // $FlowFixMe only called in DEV, so void return is not possible. function typeName(value) { { // toStringTag is needed for namespaced types like Temporal.Instant var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; return type; } } // $FlowFixMe only called in DEV, so void return is not possible. function willCoercionThrow(value) { { try { testStringCoercion(value); return false; } catch (e) { return true; } } } function testStringCoercion(value) { // If you ended up here by following an exception call stack, here's what's // happened: you supplied an object or symbol value to React (as a prop, key, // DOM attribute, CSS property, string ref, etc.) and when React tried to // coerce it to a string using `'' + value`, an exception was thrown. // // The most common types that will cause this exception are `Symbol` instances // and Temporal objects like `Temporal.Instant`. But any object that has a // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this // exception. (Library authors do this to prevent users from using built-in // numeric operators like `+` or comparison operators like `>=` because custom // methods are needed to perform accurate arithmetic or comparison.) // // To fix the problem, coerce this object or symbol value to a string before // passing it to React. The most reliable way is usually `String(value)`. // // To find which value is throwing, check the browser or debugger console. // Before this exception was thrown, there should be `console.error` output // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the // problem and how that type was used: key, atrribute, input value prop, etc. // In most cases, this console output also shows the component and its // ancestor components where the exception happened. // // eslint-disable-next-line react-internal/safe-string-coercion return '' + value; } function checkAttributeStringCoercion(value, attributeName) { { if (willCoercionThrow(value)) { error('The provided `%s` attribute is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', attributeName, typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function checkKeyStringCoercion(value) { { if (willCoercionThrow(value)) { error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function checkPropStringCoercion(value, propName) { { if (willCoercionThrow(value)) { error('The provided `%s` prop is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function checkCSSPropertyStringCoercion(value, propName) { { if (willCoercionThrow(value)) { error('The provided `%s` CSS property is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', propName, typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function checkHtmlStringCoercion(value) { { if (willCoercionThrow(value)) { error('The provided HTML markup uses a value of unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function checkFormFieldValueStringCoercion(value) { { if (willCoercionThrow(value)) { error('Form field values (value, checked, defaultValue, or defaultChecked props)' + ' must be strings, not %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } // A reserved attribute. // It is handled by React separately and shouldn't be written to the DOM. var RESERVED = 0; // A simple string attribute. // Attributes that aren't in the filter are presumed to have this type. var STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called // "enumerated" attributes with "true" and "false" as possible values. // When true, it should be set to a "true" string. // When false, it should be set to a "false" string. var BOOLEANISH_STRING = 2; // A real boolean attribute. // When true, it should be present (set either to an empty string or its name). // When false, it should be omitted. var BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value. // When true, it should be present (set either to an empty string or its name). // When false, it should be omitted. // For any other value, should be present with that value. var OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric. // When falsy, it should be removed. var NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric. // When falsy, it should be removed. var POSITIVE_NUMERIC = 6; /* eslint-disable max-len */ var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; /* eslint-enable max-len */ var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; var VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$'); var illegalAttributeNameCache = {}; var validatedAttributeNameCache = {}; function isAttributeNameSafe(attributeName) { if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) { return true; } if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) { return false; } if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) { validatedAttributeNameCache[attributeName] = true; return true; } illegalAttributeNameCache[attributeName] = true; { error('Invalid attribute name: `%s`', attributeName); } return false; } function shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null) { return propertyInfo.type === RESERVED; } if (isCustomComponentTag) { return false; } if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) { return true; } return false; } function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) { if (propertyInfo !== null && propertyInfo.type === RESERVED) { return false; } switch (typeof value) { case 'function': // $FlowIssue symbol is perfectly valid here case 'symbol': // eslint-disable-line return true; case 'boolean': { if (isCustomComponentTag) { return false; } if (propertyInfo !== null) { return !propertyInfo.acceptsBooleans; } else { var prefix = name.toLowerCase().slice(0, 5); return prefix !== 'data-' && prefix !== 'aria-'; } } default: return false; } } function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) { if (value === null || typeof value === 'undefined') { return true; } if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) { return true; } if (isCustomComponentTag) { return false; } if (propertyInfo !== null) { switch (propertyInfo.type) { case BOOLEAN: return !value; case OVERLOADED_BOOLEAN: return value === false; case NUMERIC: return isNaN(value); case POSITIVE_NUMERIC: return isNaN(value) || value < 1; } } return false; } function getPropertyInfo(name) { return properties.hasOwnProperty(name) ? properties[name] : null; } function PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; this.attributeName = attributeName; this.attributeNamespace = attributeNamespace; this.mustUseProperty = mustUseProperty; this.propertyName = name; this.type = type; this.sanitizeURL = sanitizeURL; this.removeEmptyString = removeEmptyString; } // When adding attributes to this list, be sure to also add them to // the `possibleStandardNames` module to ensure casing and incorrect // name warnings. var properties = {}; // These props are reserved by React. They shouldn't be written to the DOM. var reservedProps = ['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular // elements (not just inputs). Now that ReactDOMInput assigns to the // defaultValue property -- do we need this? 'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style']; reservedProps.forEach(function (name) { properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // A few React string attributes have a different name. // This is a mapping from React prop names to the attribute names. [['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) { var name = _ref[0], attributeName = _ref[1]; properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are "enumerated" HTML attributes that accept "true" and "false". // In React, we let users pass `true` and `false` even though technically // these aren't boolean attributes (they are coerced to strings). ['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are "enumerated" SVG attributes that accept "true" and "false". // In React, we let users pass `true` and `false` even though technically // these aren't boolean attributes (they are coerced to strings). // Since these are SVG attributes, their attribute names are case-sensitive. ['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML boolean attributes. ['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM // on the client side because the browsers are inconsistent. Instead we call focus(). 'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'disableRemotePlayback', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata 'itemScope'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are the few React props that we set as DOM properties // rather than attributes. These are all booleans. ['checked', // Note: `option.selected` is not updated if `select.multiple` is // disabled with `removeAttribute`. We have special logic for handling this. 'multiple', 'muted', 'selected' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML attributes that are "overloaded booleans": they behave like // booleans, but can also accept a string value. ['capture', 'download' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML attributes that must be positive numbers. ['cols', 'rows', 'size', 'span' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty name, // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These are HTML attributes that must be numbers. ['rowSpan', 'start'].forEach(function (name) { properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty name.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); var CAMELIZE = /[\-\:]([a-z])/g; var capitalize = function (token) { return token[1].toUpperCase(); }; // This is a list of all SVG attributes that need special casing, namespacing, // or boolean value assignment. Regular attributes that just accept strings // and have the same names are omitted, just like in the HTML attribute filter. // Some of these attributes can be hard to find. This list was created by // scraping the MDN documentation. ['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, null, // attributeNamespace false, // sanitizeURL false); }); // String SVG attributes with the xlink namespace. ['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, 'http://www.w3.org/1999/xlink', false, // sanitizeURL false); }); // String SVG attributes with the xml namespace. ['xml:base', 'xml:lang', 'xml:space' // NOTE: if you add a camelCased prop to this list, // you'll need to set attributeName to name.toLowerCase() // instead in the assignment below. ].forEach(function (attributeName) { var name = attributeName.replace(CAMELIZE, capitalize); properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty attributeName, 'http://www.w3.org/XML/1998/namespace', false, // sanitizeURL false); }); // These attribute exists both in HTML and SVG. // The attribute name is case-sensitive in SVG so we can't just use // the React name like we do for attributes that exist only in HTML. ['tabIndex', 'crossOrigin'].forEach(function (attributeName) { properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty attributeName.toLowerCase(), // attributeName null, // attributeNamespace false, // sanitizeURL false); }); // These attributes accept URLs. These must not allow javascript: URLS. // These will also need to accept Trusted Types object in the future. var xlinkHref = 'xlinkHref'; properties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty 'xlink:href', 'http://www.w3.org/1999/xlink', true, // sanitizeURL false); ['src', 'href', 'action', 'formAction'].forEach(function (attributeName) { properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty attributeName.toLowerCase(), // attributeName null, // attributeNamespace true, // sanitizeURL true); }); // and any newline or tab are filtered out as if they're not part of the URL. // https://url.spec.whatwg.org/#url-parsing // Tab or newline are defined as \r\n\t: // https://infra.spec.whatwg.org/#ascii-tab-or-newline // A C0 control is a code point in the range \u0000 NULL to \u001F // INFORMATION SEPARATOR ONE, inclusive: // https://infra.spec.whatwg.org/#c0-control-or-space /* eslint-disable max-len */ var isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i; var didWarn = false; function sanitizeURL(url) { { if (!didWarn && isJavaScriptProtocol.test(url)) { didWarn = true; error('A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url)); } } } /** * Get the value for a property on a node. Only used in DEV for SSR validation. * The "expected" argument is used as a hint of what the expected value is. * Some properties have multiple equivalent values. */ function getValueForProperty(node, name, expected, propertyInfo) { { if (propertyInfo.mustUseProperty) { var propertyName = propertyInfo.propertyName; return node[propertyName]; } else { // This check protects multiple uses of `expected`, which is why the // react-internal/safe-string-coercion rule is disabled in several spots // below. { checkAttributeStringCoercion(expected, name); } if ( propertyInfo.sanitizeURL) { // If we haven't fully disabled javascript: URLs, and if // the hydration is successful of a javascript: URL, we // still want to warn on the client. // eslint-disable-next-line react-internal/safe-string-coercion sanitizeURL('' + expected); } var attributeName = propertyInfo.attributeName; var stringValue = null; if (propertyInfo.type === OVERLOADED_BOOLEAN) { if (node.hasAttribute(attributeName)) { var value = node.getAttribute(attributeName); if (value === '') { return true; } if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { return value; } // eslint-disable-next-line react-internal/safe-string-coercion if (value === '' + expected) { return expected; } return value; } } else if (node.hasAttribute(attributeName)) { if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { // We had an attribute but shouldn't have had one, so read it // for the error message. return node.getAttribute(attributeName); } if (propertyInfo.type === BOOLEAN) { // If this was a boolean, it doesn't matter what the value is // the fact that we have it is the same as the expected. return expected; } // Even if this property uses a namespace we use getAttribute // because we assume its namespaced name is the same as our config. // To use getAttributeNS we need the local name which we don't have // in our config atm. stringValue = node.getAttribute(attributeName); } if (shouldRemoveAttribute(name, expected, propertyInfo, false)) { return stringValue === null ? expected : stringValue; // eslint-disable-next-line react-internal/safe-string-coercion } else if (stringValue === '' + expected) { return expected; } else { return stringValue; } } } } /** * Get the value for a attribute on a node. Only used in DEV for SSR validation. * The third argument is used as a hint of what the expected value is. Some * attributes have multiple equivalent values. */ function getValueForAttribute(node, name, expected, isCustomComponentTag) { { if (!isAttributeNameSafe(name)) { return; } if (!node.hasAttribute(name)) { return expected === undefined ? undefined : null; } var value = node.getAttribute(name); { checkAttributeStringCoercion(expected, name); } if (value === '' + expected) { return expected; } return value; } } /** * Sets the value for a property on a node. * * @param {DOMElement} node * @param {string} name * @param {*} value */ function setValueForProperty(node, name, value, isCustomComponentTag) { var propertyInfo = getPropertyInfo(name); if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) { return; } if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) { value = null; } if (isCustomComponentTag || propertyInfo === null) { if (isAttributeNameSafe(name)) { var _attributeName = name; if (value === null) { node.removeAttribute(_attributeName); } else { { checkAttributeStringCoercion(value, name); } node.setAttribute(_attributeName, '' + value); } } return; } var mustUseProperty = propertyInfo.mustUseProperty; if (mustUseProperty) { var propertyName = propertyInfo.propertyName; if (value === null) { var type = propertyInfo.type; node[propertyName] = type === BOOLEAN ? false : ''; } else { // Contrary to `setAttribute`, object properties are properly // `toString`ed by IE8/9. node[propertyName] = value; } return; } // The rest are treated as attributes with special cases. var attributeName = propertyInfo.attributeName, attributeNamespace = propertyInfo.attributeNamespace; if (value === null) { node.removeAttribute(attributeName); } else { var _type = propertyInfo.type; var attributeValue; if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) { // If attribute type is boolean, we know for sure it won't be an execution sink // and we won't require Trusted Type here. attributeValue = ''; } else { // `setAttribute` with objects becomes only `[object]` in IE8/9, // ('' + value) makes it output the correct toString()-value. { { checkAttributeStringCoercion(value, attributeName); } attributeValue = '' + value; } if (propertyInfo.sanitizeURL) { sanitizeURL(attributeValue.toString()); } } if (attributeNamespace) { node.setAttributeNS(attributeNamespace, attributeName, attributeValue); } else { node.setAttribute(attributeName, attributeValue); } } } // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' // The Symbol used to tag the ReactElement-like types. var REACT_ELEMENT_TYPE = Symbol.for('react.element'); var REACT_PORTAL_TYPE = Symbol.for('react.portal'); var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); var REACT_CONTEXT_TYPE = Symbol.for('react.context'); var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); var REACT_MEMO_TYPE = Symbol.for('react.memo'); var REACT_LAZY_TYPE = Symbol.for('react.lazy'); var REACT_SCOPE_TYPE = Symbol.for('react.scope'); var REACT_DEBUG_TRACING_MODE_TYPE = Symbol.for('react.debug_trace_mode'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var REACT_LEGACY_HIDDEN_TYPE = Symbol.for('react.legacy_hidden'); var REACT_CACHE_TYPE = Symbol.for('react.cache'); var REACT_TRACING_MARKER_TYPE = Symbol.for('react.tracing_marker'); var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== 'object') { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === 'function') { return maybeIterator; } return null; } var assign = Object.assign; // Helpers to patch console.logs to avoid logging during side-effect free // replaying on render function. This currently only patches the object // lazily which won't cover if the log function was extracted eagerly. // We could also eagerly patch the method. var disabledDepth = 0; var prevLog; var prevInfo; var prevWarn; var prevError; var prevGroup; var prevGroupCollapsed; var prevGroupEnd; function disabledLog() {} disabledLog.__reactDisabledLog = true; function disableLogs() { { if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); /* eslint-enable react-internal/no-production-logging */ } disabledDepth++; } } function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ var props = { configurable: true, enumerable: true, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { log: assign({}, props, { value: prevLog }), info: assign({}, props, { value: prevInfo }), warn: assign({}, props, { value: prevWarn }), error: assign({}, props, { value: prevError }), group: assign({}, props, { value: prevGroup }), groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), groupEnd: assign({}, props, { value: prevGroupEnd }) }); /* eslint-enable react-internal/no-production-logging */ } if (disabledDepth < 0) { error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); } } } var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix === undefined) { // Extract the VM specific prefix used by each line. try { throw Error(); } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = match && match[1] || ''; } } // We use the prefix to ensure our stacks line up with native stack frames. return '\n' + prefix + name; } } var reentry = false; var componentFrameCache; { var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; componentFrameCache = new PossiblyWeakMap(); } function describeNativeComponentFrame(fn, construct) { // If something asked for a stack inside a fake render, it should get ignored. if ( !fn || reentry) { return ''; } { var frame = componentFrameCache.get(fn); if (frame !== undefined) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. Error.prepareStackTrace = undefined; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function // for warnings. ReactCurrentDispatcher.current = null; disableLogs(); } try { // This should throw. if (construct) { // Something should be setting the props in the constructor. var Fake = function () { throw Error(); }; // $FlowFixMe Object.defineProperty(Fake.prototype, 'props', { set: function () { // We use a throwing setter instead of frozen or non-writable props // because that won't throw in a non-strict mode function. throw Error(); } }); if (typeof Reflect === 'object' && Reflect.construct) { // We construct a different control for this case to include any extra // frames added by the construct call. try { Reflect.construct(Fake, []); } catch (x) { control = x; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x) { control = x; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x) { control = x; } fn(); } } catch (sample) { // This is inlined manually because closure doesn't do it for us. if (sample && control && typeof sample.stack === 'string') { // This extracts the first frame from the sample that isn't also in the control. // Skipping one frame that we assume is the frame that calls the two. var sampleLines = sample.stack.split('\n'); var controlLines = control.stack.split('\n'); var s = sampleLines.length - 1; var c = controlLines.length - 1; while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { // We expect at least one stack frame to be shared. // Typically this will be the root most one. However, stack frames may be // cut off due to maximum stack limits. In this case, one maybe cut off // earlier than the other. We assume that the sample is longer or the same // and there for cut off earlier. So we should find the root most frame in // the sample somewhere in the control. c--; } for (; s >= 1 && c >= 0; s--, c--) { // Next we find the first one that isn't the same which should be the // frame that called our sample function and the control. if (sampleLines[s] !== controlLines[c]) { // In V8, the first line is describing the message but other VMs don't. // If we're about to return the first line, and the control is also on the same // line, that's a pretty good indicator that our sample threw at same line as // the control. I.e. before we entered the sample frame. So we ignore this result. // This can happen if you passed a class to function component, or non-function. if (s !== 1 || c !== 1) { do { s--; c--; // We may still have similar intermediate frames from the construct call. // The next one that isn't the same should be our match though. if (c < 0 || sampleLines[s] !== controlLines[c]) { // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>" // but we have a user-provided "displayName" // splice it in to make the stack more readable. if (fn.displayName && _frame.includes('<anonymous>')) { _frame = _frame.replace('<anonymous>', fn.displayName); } { if (typeof fn === 'function') { componentFrameCache.set(fn, _frame); } } // Return the line we found. return _frame; } } while (s >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } // Fallback to just using the name if we couldn't make it throw. var name = fn ? fn.displayName || fn.name : ''; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; { if (typeof fn === 'function') { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; } function describeClassComponentFrame(ctor, source, ownerFn) { { return describeNativeComponentFrame(ctor, true); } } function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } } function shouldConstruct(Component) { var prototype = Component.prototype; return !!(prototype && prototype.isReactComponent); } function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ''; } if (typeof type === 'function') { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === 'string') { return describeBuiltInComponentFrame(type); } switch (type) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame('Suspense'); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame('SuspenseList'); } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: // Memo may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { // Lazy may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); } catch (x) {} } } } return ''; } function describeFiber(fiber) { var owner = fiber._debugOwner ? fiber._debugOwner.type : null ; var source = fiber._debugSource ; switch (fiber.tag) { case HostComponent: return describeBuiltInComponentFrame(fiber.type); case LazyComponent: return describeBuiltInComponentFrame('Lazy'); case SuspenseComponent: return describeBuiltInComponentFrame('Suspense'); case SuspenseListComponent: return describeBuiltInComponentFrame('SuspenseList'); case FunctionComponent: case IndeterminateComponent: case SimpleMemoComponent: return describeFunctionComponentFrame(fiber.type); case ForwardRef: return describeFunctionComponentFrame(fiber.type.render); case ClassComponent: return describeClassComponentFrame(fiber.type); default: return ''; } } function getStackByFiberInDevAndProd(workInProgress) { try { var info = ''; var node = workInProgress; do { info += describeFiber(node); node = node.return; } while (node); return info; } catch (x) { return '\nError generating stack: ' + x.message + '\n' + x.stack; } } function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { return displayName; } var functionName = innerType.displayName || innerType.name || ''; return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName; } // Keep in sync with react-reconciler/getComponentNameFromFiber function getContextName(type) { return type.displayName || 'Context'; } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. function getComponentNameFromType(type) { if (type == null) { // Host root, text node or just invalid type. return null; } { if (typeof type.tag === 'number') { error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.'); } } if (typeof type === 'function') { return type.displayName || type.name || null; } if (typeof type === 'string') { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return 'Fragment'; case REACT_PORTAL_TYPE: return 'Portal'; case REACT_PROFILER_TYPE: return 'Profiler'; case REACT_STRICT_MODE_TYPE: return 'StrictMode'; case REACT_SUSPENSE_TYPE: return 'Suspense'; case REACT_SUSPENSE_LIST_TYPE: return 'SuspenseList'; } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: var context = type; return getContextName(context) + '.Consumer'; case REACT_PROVIDER_TYPE: var provider = type; return getContextName(provider._context) + '.Provider'; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, 'ForwardRef'); case REACT_MEMO_TYPE: var outerName = type.displayName || null; if (outerName !== null) { return outerName; } return getComponentNameFromType(type.type) || 'Memo'; case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentNameFromType(init(payload)); } catch (x) { return null; } } // eslint-disable-next-line no-fallthrough } } return null; } function getWrappedName$1(outerType, innerType, wrapperName) { var functionName = innerType.displayName || innerType.name || ''; return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName); } // Keep in sync with shared/getComponentNameFromType function getContextName$1(type) { return type.displayName || 'Context'; } function getComponentNameFromFiber(fiber) { var tag = fiber.tag, type = fiber.type; switch (tag) { case CacheComponent: return 'Cache'; case ContextConsumer: var context = type; return getContextName$1(context) + '.Consumer'; case ContextProvider: var provider = type; return getContextName$1(provider._context) + '.Provider'; case DehydratedFragment: return 'DehydratedFragment'; case ForwardRef: return getWrappedName$1(type, type.render, 'ForwardRef'); case Fragment: return 'Fragment'; case HostComponent: // Host component type is the display name (e.g. "div", "View") return type; case HostPortal: return 'Portal'; case HostRoot: return 'Root'; case HostText: return 'Text'; case LazyComponent: // Name comes from the type in this case; we don't have a tag. return getComponentNameFromType(type); case Mode: if (type === REACT_STRICT_MODE_TYPE) { // Don't be less specific than shared/getComponentNameFromType return 'StrictMode'; } return 'Mode'; case OffscreenComponent: return 'Offscreen'; case Profiler: return 'Profiler'; case ScopeComponent: return 'Scope'; case SuspenseComponent: return 'Suspense'; case SuspenseListComponent: return 'SuspenseList'; case TracingMarkerComponent: return 'TracingMarker'; // The display name for this tags come from the user-provided type: case ClassComponent: case FunctionComponent: case IncompleteClassComponent: case IndeterminateComponent: case MemoComponent: case SimpleMemoComponent: if (typeof type === 'function') { return type.displayName || type.name || null; } if (typeof type === 'string') { return type; } break; } return null; } var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var current = null; var isRendering = false; function getCurrentFiberOwnerNameInDevOrNull() { { if (current === null) { return null; } var owner = current._debugOwner; if (owner !== null && typeof owner !== 'undefined') { return getComponentNameFromFiber(owner); } } return null; } function getCurrentFiberStackInDev() { { if (current === null) { return ''; } // Safe because if current fiber exists, we are reconciling, // and it is guaranteed to be the work-in-progress version. return getStackByFiberInDevAndProd(current); } } function resetCurrentFiber() { { ReactDebugCurrentFrame.getCurrentStack = null; current = null; isRendering = false; } } function setCurrentFiber(fiber) { { ReactDebugCurrentFrame.getCurrentStack = fiber === null ? null : getCurrentFiberStackInDev; current = fiber; isRendering = false; } } function getCurrentFiber() { { return current; } } function setIsRendering(rendering) { { isRendering = rendering; } } // Flow does not allow string concatenation of most non-string types. To work // around this limitation, we use an opaque type that can only be obtained by // passing the value through getToStringValue first. function toString(value) { // The coercion safety check is performed in getToStringValue(). // eslint-disable-next-line react-internal/safe-string-coercion return '' + value; } function getToStringValue(value) { switch (typeof value) { case 'boolean': case 'number': case 'string': case 'undefined': return value; case 'object': { checkFormFieldValueStringCoercion(value); } return value; default: // function, symbol are assigned as empty strings return ''; } } var hasReadOnlyValue = { button: true, checkbox: true, image: true, hidden: true, radio: true, reset: true, submit: true }; function checkControlledValueProps(tagName, props) { { if (!(hasReadOnlyValue[props.type] || props.onChange || props.onInput || props.readOnly || props.disabled || props.value == null)) { error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); } if (!(props.onChange || props.readOnly || props.disabled || props.checked == null)) { error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.'); } } } function isCheckable(elem) { var type = elem.type; var nodeName = elem.nodeName; return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio'); } function getTracker(node) { return node._valueTracker; } function detachTracker(node) { node._valueTracker = null; } function getValueFromNode(node) { var value = ''; if (!node) { return value; } if (isCheckable(node)) { value = node.checked ? 'true' : 'false'; } else { value = node.value; } return value; } function trackValueOnNode(node) { var valueField = isCheckable(node) ? 'checked' : 'value'; var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField); { checkFormFieldValueStringCoercion(node[valueField]); } var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail // and don't track value will cause over reporting of changes, // but it's better then a hard failure // (needed for certain tests that spyOn input values and Safari) if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') { return; } var get = descriptor.get, set = descriptor.set; Object.defineProperty(node, valueField, { configurable: true, get: function () { return get.call(this); }, set: function (value) { { checkFormFieldValueStringCoercion(value); } currentValue = '' + value; set.call(this, value); } }); // We could've passed this the first time // but it triggers a bug in IE11 and Edge 14/15. // Calling defineProperty() again should be equivalent. // https://github.com/facebook/react/issues/11768 Object.defineProperty(node, valueField, { enumerable: descriptor.enumerable }); var tracker = { getValue: function () { return currentValue; }, setValue: function (value) { { checkFormFieldValueStringCoercion(value); } currentValue = '' + value; }, stopTracking: function () { detachTracker(node); delete node[valueField]; } }; return tracker; } function track(node) { if (getTracker(node)) { return; } // TODO: Once it's just Fiber we can move this to node._wrapperState node._valueTracker = trackValueOnNode(node); } function updateValueIfChanged(node) { if (!node) { return false; } var tracker = getTracker(node); // if there is no tracker at this point it's unlikely // that trying again will succeed if (!tracker) { return true; } var lastValue = tracker.getValue(); var nextValue = getValueFromNode(node); if (nextValue !== lastValue) { tracker.setValue(nextValue); return true; } return false; } function getActiveElement(doc) { doc = doc || (typeof document !== 'undefined' ? document : undefined); if (typeof doc === 'undefined') { return null; } try { return doc.activeElement || doc.body; } catch (e) { return doc.body; } } var didWarnValueDefaultValue = false; var didWarnCheckedDefaultChecked = false; var didWarnControlledToUncontrolled = false; var didWarnUncontrolledToControlled = false; function isControlled(props) { var usesChecked = props.type === 'checkbox' || props.type === 'radio'; return usesChecked ? props.checked != null : props.value != null; } /** * Implements an <input> host component that allows setting these optional * props: `checked`, `value`, `defaultChecked`, and `defaultValue`. * * If `checked` or `value` are not supplied (or null/undefined), user actions * that affect the checked state or value will trigger updates to the element. * * If they are supplied (and not null/undefined), the rendered element will not * trigger updates to the element. Instead, the props must change in order for * the rendered element to be updated. * * The rendered element will be initialized as unchecked (or `defaultChecked`) * with an empty value (or `defaultValue`). * * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html */ function getHostProps(element, props) { var node = element; var checked = props.checked; var hostProps = assign({}, props, { defaultChecked: undefined, defaultValue: undefined, value: undefined, checked: checked != null ? checked : node._wrapperState.initialChecked }); return hostProps; } function initWrapperState(element, props) { { checkControlledValueProps('input', props); if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) { error('%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); didWarnCheckedDefaultChecked = true; } if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) { error('%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type); didWarnValueDefaultValue = true; } } var node = element; var defaultValue = props.defaultValue == null ? '' : props.defaultValue; node._wrapperState = { initialChecked: props.checked != null ? props.checked : props.defaultChecked, initialValue: getToStringValue(props.value != null ? props.value : defaultValue), controlled: isControlled(props) }; } function updateChecked(element, props) { var node = element; var checked = props.checked; if (checked != null) { setValueForProperty(node, 'checked', checked, false); } } function updateWrapper(element, props) { var node = element; { var controlled = isControlled(props); if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) { error('A component is changing an uncontrolled input to be controlled. ' + 'This is likely caused by the value changing from undefined to ' + 'a defined value, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components'); didWarnUncontrolledToControlled = true; } if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) { error('A component is changing a controlled input to be uncontrolled. ' + 'This is likely caused by the value changing from a defined to ' + 'undefined, which should not happen. ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components'); didWarnControlledToUncontrolled = true; } } updateChecked(element, props); var value = getToStringValue(props.value); var type = props.type; if (value != null) { if (type === 'number') { if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible. // eslint-disable-next-line node.value != value) { node.value = toString(value); } } else if (node.value !== toString(value)) { node.value = toString(value); } } else if (type === 'submit' || type === 'reset') { // Submit/reset inputs need the attribute removed completely to avoid // blank-text buttons. node.removeAttribute('value'); return; } { // When syncing the value attribute, the value comes from a cascade of // properties: // 1. The value React property // 2. The defaultValue React property // 3. Otherwise there should be no change if (props.hasOwnProperty('value')) { setDefaultValue(node, props.type, value); } else if (props.hasOwnProperty('defaultValue')) { setDefaultValue(node, props.type, getToStringValue(props.defaultValue)); } } { // When syncing the checked attribute, it only changes when it needs // to be removed, such as transitioning from a checkbox into a text input if (props.checked == null && props.defaultChecked != null) { node.defaultChecked = !!props.defaultChecked; } } } function postMountWrapper(element, props, isHydrating) { var node = element; // Do not assign value if it is already set. This prevents user text input // from being lost during SSR hydration. if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) { var type = props.type; var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the // default value provided by the browser. See: #12872 if (isButton && (props.value === undefined || props.value === null)) { return; } var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input // from being lost during SSR hydration. if (!isHydrating) { { // When syncing the value attribute, the value property should use // the wrapperState._initialValue property. This uses: // // 1. The value React property when present // 2. The defaultValue React property when present // 3. An empty string if (initialValue !== node.value) { node.value = initialValue; } } } { // Otherwise, the value attribute is synchronized to the property, // so we assign defaultValue to the same thing as the value property // assignment step above. node.defaultValue = initialValue; } } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug // this is needed to work around a chrome bug where setting defaultChecked // will sometimes influence the value of checked (even after detachment). // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416 // We need to temporarily unset name to avoid disrupting radio button groups. var name = node.name; if (name !== '') { node.name = ''; } { // When syncing the checked attribute, both the checked property and // attribute are assigned at the same time using defaultChecked. This uses: // // 1. The checked React property when present // 2. The defaultChecked React property when present // 3. Otherwise, false node.defaultChecked = !node.defaultChecked; node.defaultChecked = !!node._wrapperState.initialChecked; } if (name !== '') { node.name = name; } } function restoreControlledState(element, props) { var node = element; updateWrapper(node, props); updateNamedCousins(node, props); } function updateNamedCousins(rootNode, props) { var name = props.name; if (props.type === 'radio' && name != null) { var queryRoot = rootNode; while (queryRoot.parentNode) { queryRoot = queryRoot.parentNode; } // If `rootNode.form` was non-null, then we could try `form.elements`, // but that sometimes behaves strangely in IE8. We could also try using // `form.getElementsByName`, but that will only return direct children // and won't include inputs that use the HTML5 `form=` attribute. Since // the input might not even be in a form. It might not even be in the // document. Let's just use the local `querySelectorAll` to ensure we don't // miss anything. { checkAttributeStringCoercion(name, 'name'); } var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type="radio"]'); for (var i = 0; i < group.length; i++) { var otherNode = group[i]; if (otherNode === rootNode || otherNode.form !== rootNode.form) { continue; } // This will throw if radio buttons rendered by different copies of React // and the same name are rendered into the same form (same as #1939). // That's probably okay; we don't support it just as we don't support // mixing React radio buttons with non-React ones. var otherProps = getFiberCurrentPropsFromNode(otherNode); if (!otherProps) { throw new Error('ReactDOMInput: Mixing React and non-React radio inputs with the ' + 'same `name` is not supported.'); } // We need update the tracked value on the named cousin since the value // was changed but the input saw no event or value set updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that // was previously checked to update will cause it to be come re-checked // as appropriate. updateWrapper(otherNode, otherProps); } } } // In Chrome, assigning defaultValue to certain input types triggers input validation. // For number inputs, the display value loses trailing decimal points. For email inputs, // Chrome raises "The specified value <x> is not a valid email address". // // Here we check to see if the defaultValue has actually changed, avoiding these problems // when the user is inputting text // // https://github.com/facebook/react/issues/7253 function setDefaultValue(node, type, value) { if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js type !== 'number' || getActiveElement(node.ownerDocument) !== node) { if (value == null) { node.defaultValue = toString(node._wrapperState.initialValue); } else if (node.defaultValue !== toString(value)) { node.defaultValue = toString(value); } } } var didWarnSelectedSetOnOption = false; var didWarnInvalidChild = false; var didWarnInvalidInnerHTML = false; /** * Implements an <option> host component that warns when `selected` is set. */ function validateProps(element, props) { { // If a value is not provided, then the children must be simple. if (props.value == null) { if (typeof props.children === 'object' && props.children !== null) { React.Children.forEach(props.children, function (child) { if (child == null) { return; } if (typeof child === 'string' || typeof child === 'number') { return; } if (!didWarnInvalidChild) { didWarnInvalidChild = true; error('Cannot infer the option value of complex children. ' + 'Pass a `value` prop or use a plain string as children to <option>.'); } }); } else if (props.dangerouslySetInnerHTML != null) { if (!didWarnInvalidInnerHTML) { didWarnInvalidInnerHTML = true; error('Pass a `value` prop if you set dangerouslyInnerHTML so React knows ' + 'which value should be selected.'); } } } // TODO: Remove support for `selected` in <option>. if (props.selected != null && !didWarnSelectedSetOnOption) { error('Use the `defaultValue` or `value` props on <select> instead of ' + 'setting `selected` on <option>.'); didWarnSelectedSetOnOption = true; } } } function postMountWrapper$1(element, props) { // value="" should make a value attribute (#6219) if (props.value != null) { element.setAttribute('value', toString(getToStringValue(props.value))); } } var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare function isArray(a) { return isArrayImpl(a); } var didWarnValueDefaultValue$1; { didWarnValueDefaultValue$1 = false; } function getDeclarationErrorAddendum() { var ownerName = getCurrentFiberOwnerNameInDevOrNull(); if (ownerName) { return '\n\nCheck the render method of `' + ownerName + '`.'; } return ''; } var valuePropNames = ['value', 'defaultValue']; /** * Validation function for `value` and `defaultValue`. */ function checkSelectPropTypes(props) { { checkControlledValueProps('select', props); for (var i = 0; i < valuePropNames.length; i++) { var propName = valuePropNames[i]; if (props[propName] == null) { continue; } var propNameIsArray = isArray(props[propName]); if (props.multiple && !propNameIsArray) { error('The `%s` prop supplied to <select> must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum()); } else if (!props.multiple && propNameIsArray) { error('The `%s` prop supplied to <select> must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum()); } } } } function updateOptions(node, multiple, propValue, setDefaultSelected) { var options = node.options; if (multiple) { var selectedValues = propValue; var selectedValue = {}; for (var i = 0; i < selectedValues.length; i++) { // Prefix to avoid chaos with special keys. selectedValue['$' + selectedValues[i]] = true; } for (var _i = 0; _i < options.length; _i++) { var selected = selectedValue.hasOwnProperty('$' + options[_i].value); if (options[_i].selected !== selected) { options[_i].selected = selected; } if (selected && setDefaultSelected) { options[_i].defaultSelected = true; } } } else { // Do not set `select.value` as exact behavior isn't consistent across all // browsers for all cases. var _selectedValue = toString(getToStringValue(propValue)); var defaultSelected = null; for (var _i2 = 0; _i2 < options.length; _i2++) { if (options[_i2].value === _selectedValue) { options[_i2].selected = true; if (setDefaultSelected) { options[_i2].defaultSelected = true; } return; } if (defaultSelected === null && !options[_i2].disabled) { defaultSelected = options[_i2]; } } if (defaultSelected !== null) { defaultSelected.selected = true; } } } /** * Implements a <select> host component that allows optionally setting the * props `value` and `defaultValue`. If `multiple` is false, the prop must be a * stringable. If `multiple` is true, the prop must be an array of stringables. * * If `value` is not supplied (or null/undefined), user actions that change the * selected option will trigger updates to the rendered options. * * If it is supplied (and not null/undefined), the rendered options will not * update in response to user actions. Instead, the `value` prop must change in * order for the rendered options to update. * * If `defaultValue` is provided, any options with the supplied values will be * selected. */ function getHostProps$1(element, props) { return assign({}, props, { value: undefined }); } function initWrapperState$1(element, props) { var node = element; { checkSelectPropTypes(props); } node._wrapperState = { wasMultiple: !!props.multiple }; { if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) { error('Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components'); didWarnValueDefaultValue$1 = true; } } } function postMountWrapper$2(element, props) { var node = element; node.multiple = !!props.multiple; var value = props.value; if (value != null) { updateOptions(node, !!props.multiple, value, false); } else if (props.defaultValue != null) { updateOptions(node, !!props.multiple, props.defaultValue, true); } } function postUpdateWrapper(element, props) { var node = element; var wasMultiple = node._wrapperState.wasMultiple; node._wrapperState.wasMultiple = !!props.multiple; var value = props.value; if (value != null) { updateOptions(node, !!props.multiple, value, false); } else if (wasMultiple !== !!props.multiple) { // For simplicity, reapply `defaultValue` if `multiple` is toggled. if (props.defaultValue != null) { updateOptions(node, !!props.multiple, props.defaultValue, true); } else { // Revert the select back to its default unselected state. updateOptions(node, !!props.multiple, props.multiple ? [] : '', false); } } } function restoreControlledState$1(element, props) { var node = element; var value = props.value; if (value != null) { updateOptions(node, !!props.multiple, value, false); } } var didWarnValDefaultVal = false; /** * Implements a <textarea> host component that allows setting `value`, and * `defaultValue`. This differs from the traditional DOM API because value is * usually set as PCDATA children. * * If `value` is not supplied (or null/undefined), user actions that affect the * value will trigger updates to the element. * * If `value` is supplied (and not null/undefined), the rendered element will * not trigger updates to the element. Instead, the `value` prop must change in * order for the rendered element to be updated. * * The rendered element will be initialized with an empty value, the prop * `defaultValue` if specified, or the children content (deprecated). */ function getHostProps$2(element, props) { var node = element; if (props.dangerouslySetInnerHTML != null) { throw new Error('`dangerouslySetInnerHTML` does not make sense on <textarea>.'); } // Always set children to the same thing. In IE9, the selection range will // get reset if `textContent` is mutated. We could add a check in setTextContent // to only set the value if/when the value differs from the node value (which would // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this // solution. The value can be a boolean or object so that's why it's forced // to be a string. var hostProps = assign({}, props, { value: undefined, defaultValue: undefined, children: toString(node._wrapperState.initialValue) }); return hostProps; } function initWrapperState$2(element, props) { var node = element; { checkControlledValueProps('textarea', props); if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) { error('%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://reactjs.org/link/controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component'); didWarnValDefaultVal = true; } } var initialValue = props.value; // Only bother fetching default value if we're going to use it if (initialValue == null) { var children = props.children, defaultValue = props.defaultValue; if (children != null) { { error('Use the `defaultValue` or `value` props instead of setting ' + 'children on <textarea>.'); } { if (defaultValue != null) { throw new Error('If you supply `defaultValue` on a <textarea>, do not pass children.'); } if (isArray(children)) { if (children.length > 1) { throw new Error('<textarea> can only have at most one child.'); } children = children[0]; } defaultValue = children; } } if (defaultValue == null) { defaultValue = ''; } initialValue = defaultValue; } node._wrapperState = { initialValue: getToStringValue(initialValue) }; } function updateWrapper$1(element, props) { var node = element; var value = getToStringValue(props.value); var defaultValue = getToStringValue(props.defaultValue); if (value != null) { // Cast `value` to a string to ensure the value is set correctly. While // browsers typically do this as necessary, jsdom doesn't. var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed if (newValue !== node.value) { node.value = newValue; } if (props.defaultValue == null && node.defaultValue !== newValue) { node.defaultValue = newValue; } } if (defaultValue != null) { node.defaultValue = toString(defaultValue); } } function postMountWrapper$3(element, props) { var node = element; // This is in postMount because we need access to the DOM node, which is not // available until after the component has mounted. var textContent = node.textContent; // Only set node.value if textContent is equal to the expected // initial value. In IE10/IE11 there is a bug where the placeholder attribute // will populate textContent as well. // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/ if (textContent === node._wrapperState.initialValue) { if (textContent !== '' && textContent !== null) { node.value = textContent; } } } function restoreControlledState$2(element, props) { // DOM component is still mounted; update updateWrapper$1(element, props); } var HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml'; var MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML'; var SVG_NAMESPACE = 'http://www.w3.org/2000/svg'; // Assumes there is no parent namespace. function getIntrinsicNamespace(type) { switch (type) { case 'svg': return SVG_NAMESPACE; case 'math': return MATH_NAMESPACE; default: return HTML_NAMESPACE; } } function getChildNamespace(parentNamespace, type) { if (parentNamespace == null || parentNamespace === HTML_NAMESPACE) { // No (or default) parent namespace: potential entry point. return getIntrinsicNamespace(type); } if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') { // We're leaving SVG. return HTML_NAMESPACE; } // By default, pass namespace below. return parentNamespace; } /* globals MSApp */ /** * Create a function which has 'unsafe' privileges (required by windows8 apps) */ var createMicrosoftUnsafeLocalFunction = function (func) { if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) { return function (arg0, arg1, arg2, arg3) { MSApp.execUnsafeLocalFunction(function () { return func(arg0, arg1, arg2, arg3); }); }; } else { return func; } }; var reusableSVGContainer; /** * Set the innerHTML property of a node * * @param {DOMElement} node * @param {string} html * @internal */ var setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) { if (node.namespaceURI === SVG_NAMESPACE) { if (!('innerHTML' in node)) { // IE does not have innerHTML for SVG nodes, so instead we inject the // new markup in a temp node and then move the child nodes across into // the target node reusableSVGContainer = reusableSVGContainer || document.createElement('div'); reusableSVGContainer.innerHTML = '<svg>' + html.valueOf().toString() + '</svg>'; var svgNode = reusableSVGContainer.firstChild; while (node.firstChild) { node.removeChild(node.firstChild); } while (svgNode.firstChild) { node.appendChild(svgNode.firstChild); } return; } } node.innerHTML = html; }); /** * HTML nodeType values that represent the type of the node */ var ELEMENT_NODE = 1; var TEXT_NODE = 3; var COMMENT_NODE = 8; var DOCUMENT_NODE = 9; var DOCUMENT_FRAGMENT_NODE = 11; /** * Set the textContent property of a node. For text updates, it's faster * to set the `nodeValue` of the Text node directly instead of using * `.textContent` which will remove the existing node and create a new one. * * @param {DOMElement} node * @param {string} text * @internal */ var setTextContent = function (node, text) { if (text) { var firstChild = node.firstChild; if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) { firstChild.nodeValue = text; return; } } node.textContent = text; }; // List derived from Gecko source code: // https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js var shorthandToLonghand = { animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'], background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'], backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'], border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'], borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'], borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'], borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'], borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'], borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'], borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'], borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'], borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'], borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'], borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'], borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'], borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'], borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'], columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'], columns: ['columnCount', 'columnWidth'], flex: ['flexBasis', 'flexGrow', 'flexShrink'], flexFlow: ['flexDirection', 'flexWrap'], font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'], fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'], gap: ['columnGap', 'rowGap'], grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'], gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'], gridColumn: ['gridColumnEnd', 'gridColumnStart'], gridColumnGap: ['columnGap'], gridGap: ['columnGap', 'rowGap'], gridRow: ['gridRowEnd', 'gridRowStart'], gridRowGap: ['rowGap'], gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'], listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'], margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'], marker: ['markerEnd', 'markerMid', 'markerStart'], mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'], maskPosition: ['maskPositionX', 'maskPositionY'], outline: ['outlineColor', 'outlineStyle', 'outlineWidth'], overflow: ['overflowX', 'overflowY'], padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'], placeContent: ['alignContent', 'justifyContent'], placeItems: ['alignItems', 'justifyItems'], placeSelf: ['alignSelf', 'justifySelf'], textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'], textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'], transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'], wordWrap: ['overflowWrap'] }; /** * CSS properties which accept numbers but are not in units of "px". */ var isUnitlessNumber = { animationIterationCount: true, aspectRatio: true, borderImageOutset: true, borderImageSlice: true, borderImageWidth: true, boxFlex: true, boxFlexGroup: true, boxOrdinalGroup: true, columnCount: true, columns: true, flex: true, flexGrow: true, flexPositive: true, flexShrink: true, flexNegative: true, flexOrder: true, gridArea: true, gridRow: true, gridRowEnd: true, gridRowSpan: true, gridRowStart: true, gridColumn: true, gridColumnEnd: true, gridColumnSpan: true, gridColumnStart: true, fontWeight: true, lineClamp: true, lineHeight: true, opacity: true, order: true, orphans: true, tabSize: true, widows: true, zIndex: true, zoom: true, // SVG-related properties fillOpacity: true, floodOpacity: true, stopOpacity: true, strokeDasharray: true, strokeDashoffset: true, strokeMiterlimit: true, strokeOpacity: true, strokeWidth: true }; /** * @param {string} prefix vendor-specific prefix, eg: Webkit * @param {string} key style name, eg: transitionDuration * @return {string} style name prefixed with `prefix`, properly camelCased, eg: * WebkitTransitionDuration */ function prefixKey(prefix, key) { return prefix + key.charAt(0).toUpperCase() + key.substring(1); } /** * Support style names that may come passed in prefixed by adding permutations * of vendor prefixes. */ var prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an // infinite loop, because it iterates over the newly added props too. Object.keys(isUnitlessNumber).forEach(function (prop) { prefixes.forEach(function (prefix) { isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop]; }); }); /** * Convert a value into the proper css writable value. The style name `name` * should be logical (no hyphens), as specified * in `CSSProperty.isUnitlessNumber`. * * @param {string} name CSS property name such as `topMargin`. * @param {*} value CSS property value such as `10px`. * @return {string} Normalized style value with dimensions applied. */ function dangerousStyleValue(name, value, isCustomProperty) { // Note that we've removed escapeTextForBrowser() calls here since the // whole string will be escaped when the attribute is injected into // the markup. If you provide unsafe user data here they can inject // arbitrary CSS which may be problematic (I couldn't repro this): // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/ // This is not an XSS hole but instead a potential CSS injection issue // which has lead to a greater discussion about how we're going to // trust URLs moving forward. See #2115901 var isEmpty = value == null || typeof value === 'boolean' || value === ''; if (isEmpty) { return ''; } if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) { return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers } { checkCSSPropertyStringCoercion(value, name); } return ('' + value).trim(); } var uppercasePattern = /([A-Z])/g; var msPattern = /^ms-/; /** * Hyphenates a camelcased CSS property name, for example: * * > hyphenateStyleName('backgroundColor') * < "background-color" * > hyphenateStyleName('MozTransition') * < "-moz-transition" * > hyphenateStyleName('msTransition') * < "-ms-transition" * * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix * is converted to `-ms-`. */ function hyphenateStyleName(name) { return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-'); } var warnValidStyle = function () {}; { // 'msTransform' is correct, but the other prefixes should be capitalized var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/; var msPattern$1 = /^-ms-/; var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon var badStyleValueWithSemicolonPattern = /;\s*$/; var warnedStyleNames = {}; var warnedStyleValues = {}; var warnedForNaNValue = false; var warnedForInfinityValue = false; var camelize = function (string) { return string.replace(hyphenPattern, function (_, character) { return character.toUpperCase(); }); }; var warnHyphenatedStyleName = function (name) { if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { return; } warnedStyleNames[name] = true; error('Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix // is converted to lowercase `ms`. camelize(name.replace(msPattern$1, 'ms-'))); }; var warnBadVendoredStyleName = function (name) { if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) { return; } warnedStyleNames[name] = true; error('Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1)); }; var warnStyleValueWithSemicolon = function (name, value) { if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) { return; } warnedStyleValues[value] = true; error("Style property values shouldn't contain a semicolon. " + 'Try "%s: %s" instead.', name, value.replace(badStyleValueWithSemicolonPattern, '')); }; var warnStyleValueIsNaN = function (name, value) { if (warnedForNaNValue) { return; } warnedForNaNValue = true; error('`NaN` is an invalid value for the `%s` css style property.', name); }; var warnStyleValueIsInfinity = function (name, value) { if (warnedForInfinityValue) { return; } warnedForInfinityValue = true; error('`Infinity` is an invalid value for the `%s` css style property.', name); }; warnValidStyle = function (name, value) { if (name.indexOf('-') > -1) { warnHyphenatedStyleName(name); } else if (badVendoredStyleNamePattern.test(name)) { warnBadVendoredStyleName(name); } else if (badStyleValueWithSemicolonPattern.test(value)) { warnStyleValueWithSemicolon(name, value); } if (typeof value === 'number') { if (isNaN(value)) { warnStyleValueIsNaN(name, value); } else if (!isFinite(value)) { warnStyleValueIsInfinity(name, value); } } }; } var warnValidStyle$1 = warnValidStyle; /** * Operations for dealing with CSS properties. */ /** * This creates a string that is expected to be equivalent to the style * attribute generated by server-side rendering. It by-passes warnings and * security checks so it's not safe to use this value for anything other than * comparison. It is only used in DEV for SSR validation. */ function createDangerousStringForStyles(styles) { { var serialized = ''; var delimiter = ''; for (var styleName in styles) { if (!styles.hasOwnProperty(styleName)) { continue; } var styleValue = styles[styleName]; if (styleValue != null) { var isCustomProperty = styleName.indexOf('--') === 0; serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':'; serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty); delimiter = ';'; } } return serialized || null; } } /** * Sets the value for multiple styles on a node. If a value is specified as * '' (empty string), the corresponding style property will be unset. * * @param {DOMElement} node * @param {object} styles */ function setValueForStyles(node, styles) { var style = node.style; for (var styleName in styles) { if (!styles.hasOwnProperty(styleName)) { continue; } var isCustomProperty = styleName.indexOf('--') === 0; { if (!isCustomProperty) { warnValidStyle$1(styleName, styles[styleName]); } } var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty); if (styleName === 'float') { styleName = 'cssFloat'; } if (isCustomProperty) { style.setProperty(styleName, styleValue); } else { style[styleName] = styleValue; } } } function isValueEmpty(value) { return value == null || typeof value === 'boolean' || value === ''; } /** * Given {color: 'red', overflow: 'hidden'} returns { * color: 'color', * overflowX: 'overflow', * overflowY: 'overflow', * }. This can be read as "the overflowY property was set by the overflow * shorthand". That is, the values are the property that each was derived from. */ function expandShorthandMap(styles) { var expanded = {}; for (var key in styles) { var longhands = shorthandToLonghand[key] || [key]; for (var i = 0; i < longhands.length; i++) { expanded[longhands[i]] = key; } } return expanded; } /** * When mixing shorthand and longhand property names, we warn during updates if * we expect an incorrect result to occur. In particular, we warn for: * * Updating a shorthand property (longhand gets overwritten): * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'} * becomes .style.font = 'baz' * Removing a shorthand property (longhand gets lost too): * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'} * becomes .style.font = '' * Removing a longhand property (should revert to shorthand; doesn't): * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'} * becomes .style.fontVariant = '' */ function validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) { { if (!nextStyles) { return; } var expandedUpdates = expandShorthandMap(styleUpdates); var expandedStyles = expandShorthandMap(nextStyles); var warnedAbout = {}; for (var key in expandedUpdates) { var originalKey = expandedUpdates[key]; var correctOriginalKey = expandedStyles[key]; if (correctOriginalKey && originalKey !== correctOriginalKey) { var warningKey = originalKey + ',' + correctOriginalKey; if (warnedAbout[warningKey]) { continue; } warnedAbout[warningKey] = true; error('%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + "avoid this, don't mix shorthand and non-shorthand properties " + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey); } } } } // For HTML, certain tags should omit their close tag. We keep a list for // those special-case tags. var omittedCloseTags = { area: true, base: true, br: true, col: true, embed: true, hr: true, img: true, input: true, keygen: true, link: true, meta: true, param: true, source: true, track: true, wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems. }; // `omittedCloseTags` except that `menuitem` should still have its closing tag. var voidElementTags = assign({ menuitem: true }, omittedCloseTags); var HTML = '__html'; function assertValidProps(tag, props) { if (!props) { return; } // Note the use of `==` which checks for null or undefined. if (voidElementTags[tag]) { if (props.children != null || props.dangerouslySetInnerHTML != null) { throw new Error(tag + " is a void element tag and must neither have `children` nor " + 'use `dangerouslySetInnerHTML`.'); } } if (props.dangerouslySetInnerHTML != null) { if (props.children != null) { throw new Error('Can only set one of `children` or `props.dangerouslySetInnerHTML`.'); } if (typeof props.dangerouslySetInnerHTML !== 'object' || !(HTML in props.dangerouslySetInnerHTML)) { throw new Error('`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' + 'Please visit https://reactjs.org/link/dangerously-set-inner-html ' + 'for more information.'); } } { if (!props.suppressContentEditableWarning && props.contentEditable && props.children != null) { error('A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.'); } } if (props.style != null && typeof props.style !== 'object') { throw new Error('The `style` prop expects a mapping from style properties to values, ' + "not a string. For example, style={{marginRight: spacing + 'em'}} when " + 'using JSX.'); } } function isCustomComponent(tagName, props) { if (tagName.indexOf('-') === -1) { return typeof props.is === 'string'; } switch (tagName) { // These are reserved SVG and MathML elements. // We don't mind this list too much because we expect it to never grow. // The alternative is to track the namespace in a few places which is convoluted. // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts case 'annotation-xml': case 'color-profile': case 'font-face': case 'font-face-src': case 'font-face-uri': case 'font-face-format': case 'font-face-name': case 'missing-glyph': return false; default: return true; } } // When adding attributes to the HTML or SVG allowed attribute list, be sure to // also add them to this module to ensure casing and incorrect name // warnings. var possibleStandardNames = { // HTML accept: 'accept', acceptcharset: 'acceptCharset', 'accept-charset': 'acceptCharset', accesskey: 'accessKey', action: 'action', allowfullscreen: 'allowFullScreen', alt: 'alt', as: 'as', async: 'async', autocapitalize: 'autoCapitalize', autocomplete: 'autoComplete', autocorrect: 'autoCorrect', autofocus: 'autoFocus', autoplay: 'autoPlay', autosave: 'autoSave', capture: 'capture', cellpadding: 'cellPadding', cellspacing: 'cellSpacing', challenge: 'challenge', charset: 'charSet', checked: 'checked', children: 'children', cite: 'cite', class: 'className', classid: 'classID', classname: 'className', cols: 'cols', colspan: 'colSpan', content: 'content', contenteditable: 'contentEditable', contextmenu: 'contextMenu', controls: 'controls', controlslist: 'controlsList', coords: 'coords', crossorigin: 'crossOrigin', dangerouslysetinnerhtml: 'dangerouslySetInnerHTML', data: 'data', datetime: 'dateTime', default: 'default', defaultchecked: 'defaultChecked', defaultvalue: 'defaultValue', defer: 'defer', dir: 'dir', disabled: 'disabled', disablepictureinpicture: 'disablePictureInPicture', disableremoteplayback: 'disableRemotePlayback', download: 'download', draggable: 'draggable', enctype: 'encType', enterkeyhint: 'enterKeyHint', for: 'htmlFor', form: 'form', formmethod: 'formMethod', formaction: 'formAction', formenctype: 'formEncType', formnovalidate: 'formNoValidate', formtarget: 'formTarget', frameborder: 'frameBorder', headers: 'headers', height: 'height', hidden: 'hidden', high: 'high', href: 'href', hreflang: 'hrefLang', htmlfor: 'htmlFor', httpequiv: 'httpEquiv', 'http-equiv': 'httpEquiv', icon: 'icon', id: 'id', imagesizes: 'imageSizes', imagesrcset: 'imageSrcSet', innerhtml: 'innerHTML', inputmode: 'inputMode', integrity: 'integrity', is: 'is', itemid: 'itemID', itemprop: 'itemProp', itemref: 'itemRef', itemscope: 'itemScope', itemtype: 'itemType', keyparams: 'keyParams', keytype: 'keyType', kind: 'kind', label: 'label', lang: 'lang', list: 'list', loop: 'loop', low: 'low', manifest: 'manifest', marginwidth: 'marginWidth', marginheight: 'marginHeight', max: 'max', maxlength: 'maxLength', media: 'media', mediagroup: 'mediaGroup', method: 'method', min: 'min', minlength: 'minLength', multiple: 'multiple', muted: 'muted', name: 'name', nomodule: 'noModule', nonce: 'nonce', novalidate: 'noValidate', open: 'open', optimum: 'optimum', pattern: 'pattern', placeholder: 'placeholder', playsinline: 'playsInline', poster: 'poster', preload: 'preload', profile: 'profile', radiogroup: 'radioGroup', readonly: 'readOnly', referrerpolicy: 'referrerPolicy', rel: 'rel', required: 'required', reversed: 'reversed', role: 'role', rows: 'rows', rowspan: 'rowSpan', sandbox: 'sandbox', scope: 'scope', scoped: 'scoped', scrolling: 'scrolling', seamless: 'seamless', selected: 'selected', shape: 'shape', size: 'size', sizes: 'sizes', span: 'span', spellcheck: 'spellCheck', src: 'src', srcdoc: 'srcDoc', srclang: 'srcLang', srcset: 'srcSet', start: 'start', step: 'step', style: 'style', summary: 'summary', tabindex: 'tabIndex', target: 'target', title: 'title', type: 'type', usemap: 'useMap', value: 'value', width: 'width', wmode: 'wmode', wrap: 'wrap', // SVG about: 'about', accentheight: 'accentHeight', 'accent-height': 'accentHeight', accumulate: 'accumulate', additive: 'additive', alignmentbaseline: 'alignmentBaseline', 'alignment-baseline': 'alignmentBaseline', allowreorder: 'allowReorder', alphabetic: 'alphabetic', amplitude: 'amplitude', arabicform: 'arabicForm', 'arabic-form': 'arabicForm', ascent: 'ascent', attributename: 'attributeName', attributetype: 'attributeType', autoreverse: 'autoReverse', azimuth: 'azimuth', basefrequency: 'baseFrequency', baselineshift: 'baselineShift', 'baseline-shift': 'baselineShift', baseprofile: 'baseProfile', bbox: 'bbox', begin: 'begin', bias: 'bias', by: 'by', calcmode: 'calcMode', capheight: 'capHeight', 'cap-height': 'capHeight', clip: 'clip', clippath: 'clipPath', 'clip-path': 'clipPath', clippathunits: 'clipPathUnits', cliprule: 'clipRule', 'clip-rule': 'clipRule', color: 'color', colorinterpolation: 'colorInterpolation', 'color-interpolation': 'colorInterpolation', colorinterpolationfilters: 'colorInterpolationFilters', 'color-interpolation-filters': 'colorInterpolationFilters', colorprofile: 'colorProfile', 'color-profile': 'colorProfile', colorrendering: 'colorRendering', 'color-rendering': 'colorRendering', contentscripttype: 'contentScriptType', contentstyletype: 'contentStyleType', cursor: 'cursor', cx: 'cx', cy: 'cy', d: 'd', datatype: 'datatype', decelerate: 'decelerate', descent: 'descent', diffuseconstant: 'diffuseConstant', direction: 'direction', display: 'display', divisor: 'divisor', dominantbaseline: 'dominantBaseline', 'dominant-baseline': 'dominantBaseline', dur: 'dur', dx: 'dx', dy: 'dy', edgemode: 'edgeMode', elevation: 'elevation', enablebackground: 'enableBackground', 'enable-background': 'enableBackground', end: 'end', exponent: 'exponent', externalresourcesrequired: 'externalResourcesRequired', fill: 'fill', fillopacity: 'fillOpacity', 'fill-opacity': 'fillOpacity', fillrule: 'fillRule', 'fill-rule': 'fillRule', filter: 'filter', filterres: 'filterRes', filterunits: 'filterUnits', floodopacity: 'floodOpacity', 'flood-opacity': 'floodOpacity', floodcolor: 'floodColor', 'flood-color': 'floodColor', focusable: 'focusable', fontfamily: 'fontFamily', 'font-family': 'fontFamily', fontsize: 'fontSize', 'font-size': 'fontSize', fontsizeadjust: 'fontSizeAdjust', 'font-size-adjust': 'fontSizeAdjust', fontstretch: 'fontStretch', 'font-stretch': 'fontStretch', fontstyle: 'fontStyle', 'font-style': 'fontStyle', fontvariant: 'fontVariant', 'font-variant': 'fontVariant', fontweight: 'fontWeight', 'font-weight': 'fontWeight', format: 'format', from: 'from', fx: 'fx', fy: 'fy', g1: 'g1', g2: 'g2', glyphname: 'glyphName', 'glyph-name': 'glyphName', glyphorientationhorizontal: 'glyphOrientationHorizontal', 'glyph-orientation-horizontal': 'glyphOrientationHorizontal', glyphorientationvertical: 'glyphOrientationVertical', 'glyph-orientation-vertical': 'glyphOrientationVertical', glyphref: 'glyphRef', gradienttransform: 'gradientTransform', gradientunits: 'gradientUnits', hanging: 'hanging', horizadvx: 'horizAdvX', 'horiz-adv-x': 'horizAdvX', horizoriginx: 'horizOriginX', 'horiz-origin-x': 'horizOriginX', ideographic: 'ideographic', imagerendering: 'imageRendering', 'image-rendering': 'imageRendering', in2: 'in2', in: 'in', inlist: 'inlist', intercept: 'intercept', k1: 'k1', k2: 'k2', k3: 'k3', k4: 'k4', k: 'k', kernelmatrix: 'kernelMatrix', kernelunitlength: 'kernelUnitLength', kerning: 'kerning', keypoints: 'keyPoints', keysplines: 'keySplines', keytimes: 'keyTimes', lengthadjust: 'lengthAdjust', letterspacing: 'letterSpacing', 'letter-spacing': 'letterSpacing', lightingcolor: 'lightingColor', 'lighting-color': 'lightingColor', limitingconeangle: 'limitingConeAngle', local: 'local', markerend: 'markerEnd', 'marker-end': 'markerEnd', markerheight: 'markerHeight', markermid: 'markerMid', 'marker-mid': 'markerMid', markerstart: 'markerStart', 'marker-start': 'markerStart', markerunits: 'markerUnits', markerwidth: 'markerWidth', mask: 'mask', maskcontentunits: 'maskContentUnits', maskunits: 'maskUnits', mathematical: 'mathematical', mode: 'mode', numoctaves: 'numOctaves', offset: 'offset', opacity: 'opacity', operator: 'operator', order: 'order', orient: 'orient', orientation: 'orientation', origin: 'origin', overflow: 'overflow', overlineposition: 'overlinePosition', 'overline-position': 'overlinePosition', overlinethickness: 'overlineThickness', 'overline-thickness': 'overlineThickness', paintorder: 'paintOrder', 'paint-order': 'paintOrder', panose1: 'panose1', 'panose-1': 'panose1', pathlength: 'pathLength', patterncontentunits: 'patternContentUnits', patterntransform: 'patternTransform', patternunits: 'patternUnits', pointerevents: 'pointerEvents', 'pointer-events': 'pointerEvents', points: 'points', pointsatx: 'pointsAtX', pointsaty: 'pointsAtY', pointsatz: 'pointsAtZ', prefix: 'prefix', preservealpha: 'preserveAlpha', preserveaspectratio: 'preserveAspectRatio', primitiveunits: 'primitiveUnits', property: 'property', r: 'r', radius: 'radius', refx: 'refX', refy: 'refY', renderingintent: 'renderingIntent', 'rendering-intent': 'renderingIntent', repeatcount: 'repeatCount', repeatdur: 'repeatDur', requiredextensions: 'requiredExtensions', requiredfeatures: 'requiredFeatures', resource: 'resource', restart: 'restart', result: 'result', results: 'results', rotate: 'rotate', rx: 'rx', ry: 'ry', scale: 'scale', security: 'security', seed: 'seed', shaperendering: 'shapeRendering', 'shape-rendering': 'shapeRendering', slope: 'slope', spacing: 'spacing', specularconstant: 'specularConstant', specularexponent: 'specularExponent', speed: 'speed', spreadmethod: 'spreadMethod', startoffset: 'startOffset', stddeviation: 'stdDeviation', stemh: 'stemh', stemv: 'stemv', stitchtiles: 'stitchTiles', stopcolor: 'stopColor', 'stop-color': 'stopColor', stopopacity: 'stopOpacity', 'stop-opacity': 'stopOpacity', strikethroughposition: 'strikethroughPosition', 'strikethrough-position': 'strikethroughPosition', strikethroughthickness: 'strikethroughThickness', 'strikethrough-thickness': 'strikethroughThickness', string: 'string', stroke: 'stroke', strokedasharray: 'strokeDasharray', 'stroke-dasharray': 'strokeDasharray', strokedashoffset: 'strokeDashoffset', 'stroke-dashoffset': 'strokeDashoffset', strokelinecap: 'strokeLinecap', 'stroke-linecap': 'strokeLinecap', strokelinejoin: 'strokeLinejoin', 'stroke-linejoin': 'strokeLinejoin', strokemiterlimit: 'strokeMiterlimit', 'stroke-miterlimit': 'strokeMiterlimit', strokewidth: 'strokeWidth', 'stroke-width': 'strokeWidth', strokeopacity: 'strokeOpacity', 'stroke-opacity': 'strokeOpacity', suppresscontenteditablewarning: 'suppressContentEditableWarning', suppresshydrationwarning: 'suppressHydrationWarning', surfacescale: 'surfaceScale', systemlanguage: 'systemLanguage', tablevalues: 'tableValues', targetx: 'targetX', targety: 'targetY', textanchor: 'textAnchor', 'text-anchor': 'textAnchor', textdecoration: 'textDecoration', 'text-decoration': 'textDecoration', textlength: 'textLength', textrendering: 'textRendering', 'text-rendering': 'textRendering', to: 'to', transform: 'transform', typeof: 'typeof', u1: 'u1', u2: 'u2', underlineposition: 'underlinePosition', 'underline-position': 'underlinePosition', underlinethickness: 'underlineThickness', 'underline-thickness': 'underlineThickness', unicode: 'unicode', unicodebidi: 'unicodeBidi', 'unicode-bidi': 'unicodeBidi', unicoderange: 'unicodeRange', 'unicode-range': 'unicodeRange', unitsperem: 'unitsPerEm', 'units-per-em': 'unitsPerEm', unselectable: 'unselectable', valphabetic: 'vAlphabetic', 'v-alphabetic': 'vAlphabetic', values: 'values', vectoreffect: 'vectorEffect', 'vector-effect': 'vectorEffect', version: 'version', vertadvy: 'vertAdvY', 'vert-adv-y': 'vertAdvY', vertoriginx: 'vertOriginX', 'vert-origin-x': 'vertOriginX', vertoriginy: 'vertOriginY', 'vert-origin-y': 'vertOriginY', vhanging: 'vHanging', 'v-hanging': 'vHanging', videographic: 'vIdeographic', 'v-ideographic': 'vIdeographic', viewbox: 'viewBox', viewtarget: 'viewTarget', visibility: 'visibility', vmathematical: 'vMathematical', 'v-mathematical': 'vMathematical', vocab: 'vocab', widths: 'widths', wordspacing: 'wordSpacing', 'word-spacing': 'wordSpacing', writingmode: 'writingMode', 'writing-mode': 'writingMode', x1: 'x1', x2: 'x2', x: 'x', xchannelselector: 'xChannelSelector', xheight: 'xHeight', 'x-height': 'xHeight', xlinkactuate: 'xlinkActuate', 'xlink:actuate': 'xlinkActuate', xlinkarcrole: 'xlinkArcrole', 'xlink:arcrole': 'xlinkArcrole', xlinkhref: 'xlinkHref', 'xlink:href': 'xlinkHref', xlinkrole: 'xlinkRole', 'xlink:role': 'xlinkRole', xlinkshow: 'xlinkShow', 'xlink:show': 'xlinkShow', xlinktitle: 'xlinkTitle', 'xlink:title': 'xlinkTitle', xlinktype: 'xlinkType', 'xlink:type': 'xlinkType', xmlbase: 'xmlBase', 'xml:base': 'xmlBase', xmllang: 'xmlLang', 'xml:lang': 'xmlLang', xmlns: 'xmlns', 'xml:space': 'xmlSpace', xmlnsxlink: 'xmlnsXlink', 'xmlns:xlink': 'xmlnsXlink', xmlspace: 'xmlSpace', y1: 'y1', y2: 'y2', y: 'y', ychannelselector: 'yChannelSelector', z: 'z', zoomandpan: 'zoomAndPan' }; var ariaProperties = { 'aria-current': 0, // state 'aria-description': 0, 'aria-details': 0, 'aria-disabled': 0, // state 'aria-hidden': 0, // state 'aria-invalid': 0, // state 'aria-keyshortcuts': 0, 'aria-label': 0, 'aria-roledescription': 0, // Widget Attributes 'aria-autocomplete': 0, 'aria-checked': 0, 'aria-expanded': 0, 'aria-haspopup': 0, 'aria-level': 0, 'aria-modal': 0, 'aria-multiline': 0, 'aria-multiselectable': 0, 'aria-orientation': 0, 'aria-placeholder': 0, 'aria-pressed': 0, 'aria-readonly': 0, 'aria-required': 0, 'aria-selected': 0, 'aria-sort': 0, 'aria-valuemax': 0, 'aria-valuemin': 0, 'aria-valuenow': 0, 'aria-valuetext': 0, // Live Region Attributes 'aria-atomic': 0, 'aria-busy': 0, 'aria-live': 0, 'aria-relevant': 0, // Drag-and-Drop Attributes 'aria-dropeffect': 0, 'aria-grabbed': 0, // Relationship Attributes 'aria-activedescendant': 0, 'aria-colcount': 0, 'aria-colindex': 0, 'aria-colspan': 0, 'aria-controls': 0, 'aria-describedby': 0, 'aria-errormessage': 0, 'aria-flowto': 0, 'aria-labelledby': 0, 'aria-owns': 0, 'aria-posinset': 0, 'aria-rowcount': 0, 'aria-rowindex': 0, 'aria-rowspan': 0, 'aria-setsize': 0 }; var warnedProperties = {}; var rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); var rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); function validateProperty(tagName, name) { { if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) { return true; } if (rARIACamel.test(name)) { var ariaName = 'aria-' + name.slice(4).toLowerCase(); var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM // DOM properties, then it is an invalid aria-* attribute. if (correctName == null) { error('Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name); warnedProperties[name] = true; return true; } // aria-* attributes should be lowercase; suggest the lowercase version. if (name !== correctName) { error('Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName); warnedProperties[name] = true; return true; } } if (rARIA.test(name)) { var lowerCasedName = name.toLowerCase(); var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM // DOM properties, then it is an invalid aria-* attribute. if (standardName == null) { warnedProperties[name] = true; return false; } // aria-* attributes should be lowercase; suggest the lowercase version. if (name !== standardName) { error('Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName); warnedProperties[name] = true; return true; } } } return true; } function warnInvalidARIAProps(type, props) { { var invalidProps = []; for (var key in props) { var isValid = validateProperty(type, key); if (!isValid) { invalidProps.push(key); } } var unknownPropString = invalidProps.map(function (prop) { return '`' + prop + '`'; }).join(', '); if (invalidProps.length === 1) { error('Invalid aria prop %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type); } else if (invalidProps.length > 1) { error('Invalid aria props %s on <%s> tag. ' + 'For details, see https://reactjs.org/link/invalid-aria-props', unknownPropString, type); } } } function validateProperties(type, props) { if (isCustomComponent(type, props)) { return; } warnInvalidARIAProps(type, props); } var didWarnValueNull = false; function validateProperties$1(type, props) { { if (type !== 'input' && type !== 'textarea' && type !== 'select') { return; } if (props != null && props.value === null && !didWarnValueNull) { didWarnValueNull = true; if (type === 'select' && props.multiple) { error('`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type); } else { error('`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type); } } } } var validateProperty$1 = function () {}; { var warnedProperties$1 = {}; var EVENT_NAME_REGEX = /^on./; var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/; var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$'); var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$'); validateProperty$1 = function (tagName, name, value, eventRegistry) { if (hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) { return true; } var lowerCasedName = name.toLowerCase(); if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') { error('React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.'); warnedProperties$1[name] = true; return true; } // We can't rely on the event system being injected on the server. if (eventRegistry != null) { var registrationNameDependencies = eventRegistry.registrationNameDependencies, possibleRegistrationNames = eventRegistry.possibleRegistrationNames; if (registrationNameDependencies.hasOwnProperty(name)) { return true; } var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null; if (registrationName != null) { error('Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName); warnedProperties$1[name] = true; return true; } if (EVENT_NAME_REGEX.test(name)) { error('Unknown event handler property `%s`. It will be ignored.', name); warnedProperties$1[name] = true; return true; } } else if (EVENT_NAME_REGEX.test(name)) { // If no event plugins have been injected, we are in a server environment. // So we can't tell if the event name is correct for sure, but we can filter // out known bad ones like `onclick`. We can't suggest a specific replacement though. if (INVALID_EVENT_NAME_REGEX.test(name)) { error('Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name); } warnedProperties$1[name] = true; return true; } // Let the ARIA attribute hook validate ARIA attributes if (rARIA$1.test(name) || rARIACamel$1.test(name)) { return true; } if (lowerCasedName === 'innerhtml') { error('Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.'); warnedProperties$1[name] = true; return true; } if (lowerCasedName === 'aria') { error('The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.'); warnedProperties$1[name] = true; return true; } if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') { error('Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value); warnedProperties$1[name] = true; return true; } if (typeof value === 'number' && isNaN(value)) { error('Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name); warnedProperties$1[name] = true; return true; } var propertyInfo = getPropertyInfo(name); var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config. if (possibleStandardNames.hasOwnProperty(lowerCasedName)) { var standardName = possibleStandardNames[lowerCasedName]; if (standardName !== name) { error('Invalid DOM property `%s`. Did you mean `%s`?', name, standardName); warnedProperties$1[name] = true; return true; } } else if (!isReserved && name !== lowerCasedName) { // Unknown attributes should have lowercase casing since that's how they // will be cased anyway with server rendering. error('React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName); warnedProperties$1[name] = true; return true; } if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { if (value) { error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.', value, name, name, value, name); } else { error('Received `%s` for a non-boolean attribute `%s`.\n\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s="%s" or %s={value.toString()}.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name); } warnedProperties$1[name] = true; return true; } // Now that we've validated casing, do not validate // data types for reserved props if (isReserved) { return true; } // Warn when a known attribute is a bad type if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) { warnedProperties$1[name] = true; return false; } // Warn when passing the strings 'false' or 'true' into a boolean prop if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) { error('Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string "false".', name, value); warnedProperties$1[name] = true; return true; } return true; }; } var warnUnknownProperties = function (type, props, eventRegistry) { { var unknownProps = []; for (var key in props) { var isValid = validateProperty$1(type, key, props[key], eventRegistry); if (!isValid) { unknownProps.push(key); } } var unknownPropString = unknownProps.map(function (prop) { return '`' + prop + '`'; }).join(', '); if (unknownProps.length === 1) { error('Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type); } else if (unknownProps.length > 1) { error('Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://reactjs.org/link/attribute-behavior ', unknownPropString, type); } } }; function validateProperties$2(type, props, eventRegistry) { if (isCustomComponent(type, props)) { return; } warnUnknownProperties(type, props, eventRegistry); } var IS_EVENT_HANDLE_NON_MANAGED_NODE = 1; var IS_NON_DELEGATED = 1 << 1; var IS_CAPTURE_PHASE = 1 << 2; // set to LEGACY_FB_SUPPORT. LEGACY_FB_SUPPORT only gets set when // we call willDeferLaterForLegacyFBSupport, thus not bailing out // will result in endless cycles like an infinite loop. // We also don't want to defer during event replaying. var SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS = IS_EVENT_HANDLE_NON_MANAGED_NODE | IS_NON_DELEGATED | IS_CAPTURE_PHASE; // This exists to avoid circular dependency between ReactDOMEventReplaying // and DOMPluginEventSystem. var currentReplayingEvent = null; function setReplayingEvent(event) { { if (currentReplayingEvent !== null) { error('Expected currently replaying event to be null. This error ' + 'is likely caused by a bug in React. Please file an issue.'); } } currentReplayingEvent = event; } function resetReplayingEvent() { { if (currentReplayingEvent === null) { error('Expected currently replaying event to not be null. This error ' + 'is likely caused by a bug in React. Please file an issue.'); } } currentReplayingEvent = null; } function isReplayingEvent(event) { return event === currentReplayingEvent; } /** * Gets the target node from a native browser event by accounting for * inconsistencies in browser DOM APIs. * * @param {object} nativeEvent Native browser event. * @return {DOMEventTarget} Target node. */ function getEventTarget(nativeEvent) { // Fallback to nativeEvent.srcElement for IE9 // https://github.com/facebook/react/issues/12506 var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG <use> element events #4963 if (target.correspondingUseElement) { target = target.correspondingUseElement; } // Safari may fire events on text nodes (Node.TEXT_NODE is 3). // @see http://www.quirksmode.org/js/events_properties.html return target.nodeType === TEXT_NODE ? target.parentNode : target; } var restoreImpl = null; var restoreTarget = null; var restoreQueue = null; function restoreStateOfTarget(target) { // We perform this translation at the end of the event loop so that we // always receive the correct fiber here var internalInstance = getInstanceFromNode(target); if (!internalInstance) { // Unmounted return; } if (typeof restoreImpl !== 'function') { throw new Error('setRestoreImplementation() needs to be called to handle a target for controlled ' + 'events. This error is likely caused by a bug in React. Please file an issue.'); } var stateNode = internalInstance.stateNode; // Guard against Fiber being unmounted. if (stateNode) { var _props = getFiberCurrentPropsFromNode(stateNode); restoreImpl(internalInstance.stateNode, internalInstance.type, _props); } } function setRestoreImplementation(impl) { restoreImpl = impl; } function enqueueStateRestore(target) { if (restoreTarget) { if (restoreQueue) { restoreQueue.push(target); } else { restoreQueue = [target]; } } else { restoreTarget = target; } } function needsStateRestore() { return restoreTarget !== null || restoreQueue !== null; } function restoreStateIfNeeded() { if (!restoreTarget) { return; } var target = restoreTarget; var queuedTargets = restoreQueue; restoreTarget = null; restoreQueue = null; restoreStateOfTarget(target); if (queuedTargets) { for (var i = 0; i < queuedTargets.length; i++) { restoreStateOfTarget(queuedTargets[i]); } } } // the renderer. Such as when we're dispatching events or if third party // libraries need to call batchedUpdates. Eventually, this API will go away when // everything is batched by default. We'll then have a similar API to opt-out of // scheduled work and instead do synchronous work. // Defaults var batchedUpdatesImpl = function (fn, bookkeeping) { return fn(bookkeeping); }; var flushSyncImpl = function () {}; var isInsideEventHandler = false; function finishEventHandler() { // Here we wait until all updates have propagated, which is important // when using controlled components within layers: // https://github.com/facebook/react/issues/1698 // Then we restore state of any controlled component. var controlledComponentsHavePendingUpdates = needsStateRestore(); if (controlledComponentsHavePendingUpdates) { // If a controlled event was fired, we may need to restore the state of // the DOM node back to the controlled value. This is necessary when React // bails out of the update without touching the DOM. // TODO: Restore state in the microtask, after the discrete updates flush, // instead of early flushing them here. flushSyncImpl(); restoreStateIfNeeded(); } } function batchedUpdates(fn, a, b) { if (isInsideEventHandler) { // If we are currently inside another batch, we need to wait until it // fully completes before restoring state. return fn(a, b); } isInsideEventHandler = true; try { return batchedUpdatesImpl(fn, a, b); } finally { isInsideEventHandler = false; finishEventHandler(); } } // TODO: Replace with flushSync function setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushSyncImpl) { batchedUpdatesImpl = _batchedUpdatesImpl; flushSyncImpl = _flushSyncImpl; } function isInteractive(tag) { return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea'; } function shouldPreventMouseEvent(name, type, props) { switch (name) { case 'onClick': case 'onClickCapture': case 'onDoubleClick': case 'onDoubleClickCapture': case 'onMouseDown': case 'onMouseDownCapture': case 'onMouseMove': case 'onMouseMoveCapture': case 'onMouseUp': case 'onMouseUpCapture': case 'onMouseEnter': return !!(props.disabled && isInteractive(type)); default: return false; } } /** * @param {object} inst The instance, which is the source of events. * @param {string} registrationName Name of listener (e.g. `onClick`). * @return {?function} The stored callback. */ function getListener(inst, registrationName) { var stateNode = inst.stateNode; if (stateNode === null) { // Work in progress (ex: onload events in incremental mode). return null; } var props = getFiberCurrentPropsFromNode(stateNode); if (props === null) { // Work in progress. return null; } var listener = props[registrationName]; if (shouldPreventMouseEvent(registrationName, inst.type, props)) { return null; } if (listener && typeof listener !== 'function') { throw new Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type."); } return listener; } var passiveBrowserEventsSupported = false; // Check if browser support events with passive listeners // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support if (canUseDOM) { try { var options = {}; // $FlowFixMe: Ignore Flow complaining about needing a value Object.defineProperty(options, 'passive', { get: function () { passiveBrowserEventsSupported = true; } }); window.addEventListener('test', options, options); window.removeEventListener('test', options, options); } catch (e) { passiveBrowserEventsSupported = false; } } function invokeGuardedCallbackProd(name, func, context, a, b, c, d, e, f) { var funcArgs = Array.prototype.slice.call(arguments, 3); try { func.apply(context, funcArgs); } catch (error) { this.onError(error); } } var invokeGuardedCallbackImpl = invokeGuardedCallbackProd; { // In DEV mode, we swap out invokeGuardedCallback for a special version // that plays more nicely with the browser's DevTools. The idea is to preserve // "Pause on exceptions" behavior. Because React wraps all user-provided // functions in invokeGuardedCallback, and the production version of // invokeGuardedCallback uses a try-catch, all user exceptions are treated // like caught exceptions, and the DevTools won't pause unless the developer // takes the extra step of enabling pause on caught exceptions. This is // unintuitive, though, because even though React has caught the error, from // the developer's perspective, the error is uncaught. // // To preserve the expected "Pause on exceptions" behavior, we don't use a // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake // DOM node, and call the user-provided callback from inside an event handler // for that fake event. If the callback throws, the error is "captured" using // a global event handler. But because the error happens in a different // event loop context, it does not interrupt the normal program flow. // Effectively, this gives us try-catch behavior without actually using // try-catch. Neat! // Check that the browser supports the APIs we need to implement our special // DEV version of invokeGuardedCallback if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') { var fakeNode = document.createElement('react'); invokeGuardedCallbackImpl = function invokeGuardedCallbackDev(name, func, context, a, b, c, d, e, f) { // If document doesn't exist we know for sure we will crash in this method // when we call document.createEvent(). However this can cause confusing // errors: https://github.com/facebook/create-react-app/issues/3482 // So we preemptively throw with a better message instead. if (typeof document === 'undefined' || document === null) { throw new Error('The `document` global was defined when React was initialized, but is not ' + 'defined anymore. This can happen in a test environment if a component ' + 'schedules an update from an asynchronous callback, but the test has already ' + 'finished running. To solve this, you can either unmount the component at ' + 'the end of your test (and ensure that any asynchronous operations get ' + 'canceled in `componentWillUnmount`), or you can change the test itself ' + 'to be asynchronous.'); } var evt = document.createEvent('Event'); var didCall = false; // Keeps track of whether the user-provided callback threw an error. We // set this to true at the beginning, then set it to false right after // calling the function. If the function errors, `didError` will never be // set to false. This strategy works even if the browser is flaky and // fails to call our global error handler, because it doesn't rely on // the error event at all. var didError = true; // Keeps track of the value of window.event so that we can reset it // during the callback to let user code access window.event in the // browsers that support it. var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event // dispatching: https://github.com/facebook/react/issues/13688 var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); function restoreAfterDispatch() { // We immediately remove the callback from event listeners so that // nested `invokeGuardedCallback` calls do not clash. Otherwise, a // nested call would trigger the fake event handlers of any call higher // in the stack. fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the // window.event assignment in both IE <= 10 as they throw an error // "Member not found" in strict mode, and in Firefox which does not // support window.event. if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) { window.event = windowEvent; } } // Create an event handler for our fake event. We will synchronously // dispatch our fake event using `dispatchEvent`. Inside the handler, we // call the user-provided callback. var funcArgs = Array.prototype.slice.call(arguments, 3); function callCallback() { didCall = true; restoreAfterDispatch(); func.apply(context, funcArgs); didError = false; } // Create a global error event handler. We use this to capture the value // that was thrown. It's possible that this error handler will fire more // than once; for example, if non-React code also calls `dispatchEvent` // and a handler for that event throws. We should be resilient to most of // those cases. Even if our error event handler fires more than once, the // last error event is always used. If the callback actually does error, // we know that the last error event is the correct one, because it's not // possible for anything else to have happened in between our callback // erroring and the code that follows the `dispatchEvent` call below. If // the callback doesn't error, but the error event was fired, we know to // ignore it because `didError` will be false, as described above. var error; // Use this to track whether the error event is ever called. var didSetError = false; var isCrossOriginError = false; function handleWindowError(event) { error = event.error; didSetError = true; if (error === null && event.colno === 0 && event.lineno === 0) { isCrossOriginError = true; } if (event.defaultPrevented) { // Some other error handler has prevented default. // Browsers silence the error report if this happens. // We'll remember this to later decide whether to log it or not. if (error != null && typeof error === 'object') { try { error._suppressLogging = true; } catch (inner) {// Ignore. } } } } // Create a fake event type. var evtType = "react-" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers window.addEventListener('error', handleWindowError); fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function // errors, it will trigger our global error handler. evt.initEvent(evtType, false, false); fakeNode.dispatchEvent(evt); if (windowEventDescriptor) { Object.defineProperty(window, 'event', windowEventDescriptor); } if (didCall && didError) { if (!didSetError) { // The callback errored, but the error event never fired. // eslint-disable-next-line react-internal/prod-error-codes error = new Error('An error was thrown inside one of your components, but React ' + "doesn't know what it was. This is likely due to browser " + 'flakiness. React does its best to preserve the "Pause on ' + 'exceptions" behavior of the DevTools, which requires some ' + "DEV-mode only tricks. It's possible that these don't work in " + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.'); } else if (isCrossOriginError) { // eslint-disable-next-line react-internal/prod-error-codes error = new Error("A cross-origin error was thrown. React doesn't have access to " + 'the actual error object in development. ' + 'See https://reactjs.org/link/crossorigin-error for more information.'); } this.onError(error); } // Remove our event listeners window.removeEventListener('error', handleWindowError); if (!didCall) { // Something went really wrong, and our event was not dispatched. // https://github.com/facebook/react/issues/16734 // https://github.com/facebook/react/issues/16585 // Fall back to the production implementation. restoreAfterDispatch(); return invokeGuardedCallbackProd.apply(this, arguments); } }; } } var invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl; var hasError = false; var caughtError = null; // Used by event system to capture/rethrow the first error. var hasRethrowError = false; var rethrowError = null; var reporter = { onError: function (error) { hasError = true; caughtError = error; } }; /** * Call a function while guarding against errors that happens within it. * Returns an error if it throws, otherwise null. * * In production, this is implemented using a try-catch. The reason we don't * use a try-catch directly is so that we can swap out a different * implementation in DEV mode. * * @param {String} name of the guard to use for logging or debugging * @param {Function} func The function to invoke * @param {*} context The context to use when calling the function * @param {...*} args Arguments for function */ function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { hasError = false; caughtError = null; invokeGuardedCallbackImpl$1.apply(reporter, arguments); } /** * Same as invokeGuardedCallback, but instead of returning an error, it stores * it in a global so it can be rethrown by `rethrowCaughtError` later. * TODO: See if caughtError and rethrowError can be unified. * * @param {String} name of the guard to use for logging or debugging * @param {Function} func The function to invoke * @param {*} context The context to use when calling the function * @param {...*} args Arguments for function */ function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { invokeGuardedCallback.apply(this, arguments); if (hasError) { var error = clearCaughtError(); if (!hasRethrowError) { hasRethrowError = true; rethrowError = error; } } } /** * During execution of guarded functions we will capture the first error which * we will rethrow to be handled by the top level error handler. */ function rethrowCaughtError() { if (hasRethrowError) { var error = rethrowError; hasRethrowError = false; rethrowError = null; throw error; } } function hasCaughtError() { return hasError; } function clearCaughtError() { if (hasError) { var error = caughtError; hasError = false; caughtError = null; return error; } else { throw new Error('clearCaughtError was called but no error was captured. This error ' + 'is likely caused by a bug in React. Please file an issue.'); } } var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; var _ReactInternals$Sched = ReactInternals.Scheduler, unstable_cancelCallback = _ReactInternals$Sched.unstable_cancelCallback, unstable_now = _ReactInternals$Sched.unstable_now, unstable_scheduleCallback = _ReactInternals$Sched.unstable_scheduleCallback, unstable_shouldYield = _ReactInternals$Sched.unstable_shouldYield, unstable_requestPaint = _ReactInternals$Sched.unstable_requestPaint, unstable_getFirstCallbackNode = _ReactInternals$Sched.unstable_getFirstCallbackNode, unstable_runWithPriority = _ReactInternals$Sched.unstable_runWithPriority, unstable_next = _ReactInternals$Sched.unstable_next, unstable_continueExecution = _ReactInternals$Sched.unstable_continueExecution, unstable_pauseExecution = _ReactInternals$Sched.unstable_pauseExecution, unstable_getCurrentPriorityLevel = _ReactInternals$Sched.unstable_getCurrentPriorityLevel, unstable_ImmediatePriority = _ReactInternals$Sched.unstable_ImmediatePriority, unstable_UserBlockingPriority = _ReactInternals$Sched.unstable_UserBlockingPriority, unstable_NormalPriority = _ReactInternals$Sched.unstable_NormalPriority, unstable_LowPriority = _ReactInternals$Sched.unstable_LowPriority, unstable_IdlePriority = _ReactInternals$Sched.unstable_IdlePriority, unstable_forceFrameRate = _ReactInternals$Sched.unstable_forceFrameRate, unstable_flushAllWithoutAsserting = _ReactInternals$Sched.unstable_flushAllWithoutAsserting, unstable_yieldValue = _ReactInternals$Sched.unstable_yieldValue, unstable_setDisableYieldValue = _ReactInternals$Sched.unstable_setDisableYieldValue; /** * `ReactInstanceMap` maintains a mapping from a public facing stateful * instance (key) and the internal representation (value). This allows public * methods to accept the user facing instance as an argument and map them back * to internal methods. * * Note that this module is currently shared and assumed to be stateless. * If this becomes an actual Map, that will break. */ function get(key) { return key._reactInternals; } function has(key) { return key._reactInternals !== undefined; } function set(key, value) { key._reactInternals = value; } // Don't change these two values. They're used by React Dev Tools. var NoFlags = /* */ 0; var PerformedWork = /* */ 1; // You can change the rest (and add more). var Placement = /* */ 2; var Update = /* */ 4; var ChildDeletion = /* */ 16; var ContentReset = /* */ 32; var Callback = /* */ 64; var DidCapture = /* */ 128; var ForceClientRender = /* */ 256; var Ref = /* */ 512; var Snapshot = /* */ 1024; var Passive = /* */ 2048; var Hydrating = /* */ 4096; var Visibility = /* */ 8192; var StoreConsistency = /* */ 16384; var LifecycleEffectMask = Passive | Update | Callback | Ref | Snapshot | StoreConsistency; // Union of all commit flags (flags with the lifetime of a particular commit) var HostEffectMask = /* */ 32767; // These are not really side effects, but we still reuse this field. var Incomplete = /* */ 32768; var ShouldCapture = /* */ 65536; var ForceUpdateForLegacySuspense = /* */ 131072; var Forked = /* */ 1048576; // Static tags describe aspects of a fiber that are not specific to a render, // e.g. a fiber uses a passive effect (even if there are no updates on this particular render). // This enables us to defer more work in the unmount case, // since we can defer traversing the tree during layout to look for Passive effects, // and instead rely on the static flag as a signal that there may be cleanup work. var RefStatic = /* */ 2097152; var LayoutStatic = /* */ 4194304; var PassiveStatic = /* */ 8388608; // These flags allow us to traverse to fibers that have effects on mount // without traversing the entire tree after every commit for // double invoking var MountLayoutDev = /* */ 16777216; var MountPassiveDev = /* */ 33554432; // Groups of flags that are used in the commit phase to skip over trees that // don't contain effects, by checking subtreeFlags. var BeforeMutationMask = // TODO: Remove Update flag from before mutation phase by re-landing Visibility // flag logic (see #20043) Update | Snapshot | ( 0); var MutationMask = Placement | Update | ChildDeletion | ContentReset | Ref | Hydrating | Visibility; var LayoutMask = Update | Callback | Ref | Visibility; // TODO: Split into PassiveMountMask and PassiveUnmountMask var PassiveMask = Passive | ChildDeletion; // Union of tags that don't get reset on clones. // This allows certain concepts to persist without recalculating them, // e.g. whether a subtree contains passive effects or portals. var StaticMask = LayoutStatic | PassiveStatic | RefStatic; var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; function getNearestMountedFiber(fiber) { var node = fiber; var nearestMounted = fiber; if (!fiber.alternate) { // If there is no alternate, this might be a new tree that isn't inserted // yet. If it is, then it will have a pending insertion effect on it. var nextNode = node; do { node = nextNode; if ((node.flags & (Placement | Hydrating)) !== NoFlags) { // This is an insertion or in-progress hydration. The nearest possible // mounted fiber is the parent but we need to continue to figure out // if that one is still mounted. nearestMounted = node.return; } nextNode = node.return; } while (nextNode); } else { while (node.return) { node = node.return; } } if (node.tag === HostRoot) { // TODO: Check if this was a nested HostRoot when used with // renderContainerIntoSubtree. return nearestMounted; } // If we didn't hit the root, that means that we're in an disconnected tree // that has been unmounted. return null; } function getSuspenseInstanceFromFiber(fiber) { if (fiber.tag === SuspenseComponent) { var suspenseState = fiber.memoizedState; if (suspenseState === null) { var current = fiber.alternate; if (current !== null) { suspenseState = current.memoizedState; } } if (suspenseState !== null) { return suspenseState.dehydrated; } } return null; } function getContainerFromFiber(fiber) { return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null; } function isFiberMounted(fiber) { return getNearestMountedFiber(fiber) === fiber; } function isMounted(component) { { var owner = ReactCurrentOwner.current; if (owner !== null && owner.tag === ClassComponent) { var ownerFiber = owner; var instance = ownerFiber.stateNode; if (!instance._warnedAboutRefsInRender) { error('%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentNameFromFiber(ownerFiber) || 'A component'); } instance._warnedAboutRefsInRender = true; } } var fiber = get(component); if (!fiber) { return false; } return getNearestMountedFiber(fiber) === fiber; } function assertIsMounted(fiber) { if (getNearestMountedFiber(fiber) !== fiber) { throw new Error('Unable to find node on an unmounted component.'); } } function findCurrentFiberUsingSlowPath(fiber) { var alternate = fiber.alternate; if (!alternate) { // If there is no alternate, then we only need to check if it is mounted. var nearestMounted = getNearestMountedFiber(fiber); if (nearestMounted === null) { throw new Error('Unable to find node on an unmounted component.'); } if (nearestMounted !== fiber) { return null; } return fiber; } // If we have two possible branches, we'll walk backwards up to the root // to see what path the root points to. On the way we may hit one of the // special cases and we'll deal with them. var a = fiber; var b = alternate; while (true) { var parentA = a.return; if (parentA === null) { // We're at the root. break; } var parentB = parentA.alternate; if (parentB === null) { // There is no alternate. This is an unusual case. Currently, it only // happens when a Suspense component is hidden. An extra fragment fiber // is inserted in between the Suspense fiber and its children. Skip // over this extra fragment fiber and proceed to the next parent. var nextParent = parentA.return; if (nextParent !== null) { a = b = nextParent; continue; } // If there's no parent, we're at the root. break; } // If both copies of the parent fiber point to the same child, we can // assume that the child is current. This happens when we bailout on low // priority: the bailed out fiber's child reuses the current child. if (parentA.child === parentB.child) { var child = parentA.child; while (child) { if (child === a) { // We've determined that A is the current branch. assertIsMounted(parentA); return fiber; } if (child === b) { // We've determined that B is the current branch. assertIsMounted(parentA); return alternate; } child = child.sibling; } // We should never have an alternate for any mounting node. So the only // way this could possibly happen is if this was unmounted, if at all. throw new Error('Unable to find node on an unmounted component.'); } if (a.return !== b.return) { // The return pointer of A and the return pointer of B point to different // fibers. We assume that return pointers never criss-cross, so A must // belong to the child set of A.return, and B must belong to the child // set of B.return. a = parentA; b = parentB; } else { // The return pointers point to the same fiber. We'll have to use the // default, slow path: scan the child sets of each parent alternate to see // which child belongs to which set. // // Search parent A's child set var didFindChild = false; var _child = parentA.child; while (_child) { if (_child === a) { didFindChild = true; a = parentA; b = parentB; break; } if (_child === b) { didFindChild = true; b = parentA; a = parentB; break; } _child = _child.sibling; } if (!didFindChild) { // Search parent B's child set _child = parentB.child; while (_child) { if (_child === a) { didFindChild = true; a = parentB; b = parentA; break; } if (_child === b) { didFindChild = true; b = parentB; a = parentA; break; } _child = _child.sibling; } if (!didFindChild) { throw new Error('Child was not found in either parent set. This indicates a bug ' + 'in React related to the return pointer. Please file an issue.'); } } } if (a.alternate !== b) { throw new Error("Return fibers should always be each others' alternates. " + 'This error is likely caused by a bug in React. Please file an issue.'); } } // If the root is not a host container, we're in a disconnected tree. I.e. // unmounted. if (a.tag !== HostRoot) { throw new Error('Unable to find node on an unmounted component.'); } if (a.stateNode.current === a) { // We've determined that A is the current branch. return fiber; } // Otherwise B has to be current branch. return alternate; } function findCurrentHostFiber(parent) { var currentParent = findCurrentFiberUsingSlowPath(parent); return currentParent !== null ? findCurrentHostFiberImpl(currentParent) : null; } function findCurrentHostFiberImpl(node) { // Next we'll drill down this component to find the first HostComponent/Text. if (node.tag === HostComponent || node.tag === HostText) { return node; } var child = node.child; while (child !== null) { var match = findCurrentHostFiberImpl(child); if (match !== null) { return match; } child = child.sibling; } return null; } function findCurrentHostFiberWithNoPortals(parent) { var currentParent = findCurrentFiberUsingSlowPath(parent); return currentParent !== null ? findCurrentHostFiberWithNoPortalsImpl(currentParent) : null; } function findCurrentHostFiberWithNoPortalsImpl(node) { // Next we'll drill down this component to find the first HostComponent/Text. if (node.tag === HostComponent || node.tag === HostText) { return node; } var child = node.child; while (child !== null) { if (child.tag !== HostPortal) { var match = findCurrentHostFiberWithNoPortalsImpl(child); if (match !== null) { return match; } } child = child.sibling; } return null; } // This module only exists as an ESM wrapper around the external CommonJS var scheduleCallback = unstable_scheduleCallback; var cancelCallback = unstable_cancelCallback; var shouldYield = unstable_shouldYield; var requestPaint = unstable_requestPaint; var now = unstable_now; var getCurrentPriorityLevel = unstable_getCurrentPriorityLevel; var ImmediatePriority = unstable_ImmediatePriority; var UserBlockingPriority = unstable_UserBlockingPriority; var NormalPriority = unstable_NormalPriority; var LowPriority = unstable_LowPriority; var IdlePriority = unstable_IdlePriority; // this doesn't actually exist on the scheduler, but it *does* // on scheduler/unstable_mock, which we'll need for internal testing var unstable_yieldValue$1 = unstable_yieldValue; var unstable_setDisableYieldValue$1 = unstable_setDisableYieldValue; var rendererID = null; var injectedHook = null; var injectedProfilingHooks = null; var hasLoggedError = false; var isDevToolsPresent = typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined'; function injectInternals(internals) { if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') { // No DevTools return false; } var hook = __REACT_DEVTOOLS_GLOBAL_HOOK__; if (hook.isDisabled) { // This isn't a real property on the hook, but it can be set to opt out // of DevTools integration and associated warnings and logs. // https://github.com/facebook/react/issues/3877 return true; } if (!hook.supportsFiber) { { error('The installed version of React DevTools is too old and will not work ' + 'with the current version of React. Please update React DevTools. ' + 'https://reactjs.org/link/react-devtools'); } // DevTools exists, even though it doesn't support Fiber. return true; } try { if (enableSchedulingProfiler) { // Conditionally inject these hooks only if Timeline profiler is supported by this build. // This gives DevTools a way to feature detect that isn't tied to version number // (since profiling and timeline are controlled by different feature flags). internals = assign({}, internals, { getLaneLabelMap: getLaneLabelMap, injectProfilingHooks: injectProfilingHooks }); } rendererID = hook.inject(internals); // We have successfully injected, so now it is safe to set up hooks. injectedHook = hook; } catch (err) { // Catch all errors because it is unsafe to throw during initialization. { error('React instrumentation encountered an error: %s.', err); } } if (hook.checkDCE) { // This is the real DevTools. return true; } else { // This is likely a hook installed by Fast Refresh runtime. return false; } } function onScheduleRoot(root, children) { { if (injectedHook && typeof injectedHook.onScheduleFiberRoot === 'function') { try { injectedHook.onScheduleFiberRoot(rendererID, root, children); } catch (err) { if ( !hasLoggedError) { hasLoggedError = true; error('React instrumentation encountered an error: %s', err); } } } } } function onCommitRoot(root, eventPriority) { if (injectedHook && typeof injectedHook.onCommitFiberRoot === 'function') { try { var didError = (root.current.flags & DidCapture) === DidCapture; if (enableProfilerTimer) { var schedulerPriority; switch (eventPriority) { case DiscreteEventPriority: schedulerPriority = ImmediatePriority; break; case ContinuousEventPriority: schedulerPriority = UserBlockingPriority; break; case DefaultEventPriority: schedulerPriority = NormalPriority; break; case IdleEventPriority: schedulerPriority = IdlePriority; break; default: schedulerPriority = NormalPriority; break; } injectedHook.onCommitFiberRoot(rendererID, root, schedulerPriority, didError); } else { injectedHook.onCommitFiberRoot(rendererID, root, undefined, didError); } } catch (err) { { if (!hasLoggedError) { hasLoggedError = true; error('React instrumentation encountered an error: %s', err); } } } } } function onPostCommitRoot(root) { if (injectedHook && typeof injectedHook.onPostCommitFiberRoot === 'function') { try { injectedHook.onPostCommitFiberRoot(rendererID, root); } catch (err) { { if (!hasLoggedError) { hasLoggedError = true; error('React instrumentation encountered an error: %s', err); } } } } } function onCommitUnmount(fiber) { if (injectedHook && typeof injectedHook.onCommitFiberUnmount === 'function') { try { injectedHook.onCommitFiberUnmount(rendererID, fiber); } catch (err) { { if (!hasLoggedError) { hasLoggedError = true; error('React instrumentation encountered an error: %s', err); } } } } } function setIsStrictModeForDevtools(newIsStrictMode) { { if (typeof unstable_yieldValue$1 === 'function') { // We're in a test because Scheduler.unstable_yieldValue only exists // in SchedulerMock. To reduce the noise in strict mode tests, // suppress warnings and disable scheduler yielding during the double render unstable_setDisableYieldValue$1(newIsStrictMode); setSuppressWarning(newIsStrictMode); } if (injectedHook && typeof injectedHook.setStrictMode === 'function') { try { injectedHook.setStrictMode(rendererID, newIsStrictMode); } catch (err) { { if (!hasLoggedError) { hasLoggedError = true; error('React instrumentation encountered an error: %s', err); } } } } } } // Profiler API hooks function injectProfilingHooks(profilingHooks) { injectedProfilingHooks = profilingHooks; } function getLaneLabelMap() { { var map = new Map(); var lane = 1; for (var index = 0; index < TotalLanes; index++) { var label = getLabelForLane(lane); map.set(lane, label); lane *= 2; } return map; } } function markCommitStarted(lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStarted === 'function') { injectedProfilingHooks.markCommitStarted(lanes); } } } function markCommitStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markCommitStopped === 'function') { injectedProfilingHooks.markCommitStopped(); } } } function markComponentRenderStarted(fiber) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStarted === 'function') { injectedProfilingHooks.markComponentRenderStarted(fiber); } } } function markComponentRenderStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentRenderStopped === 'function') { injectedProfilingHooks.markComponentRenderStopped(); } } } function markComponentPassiveEffectMountStarted(fiber) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStarted === 'function') { injectedProfilingHooks.markComponentPassiveEffectMountStarted(fiber); } } } function markComponentPassiveEffectMountStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectMountStopped === 'function') { injectedProfilingHooks.markComponentPassiveEffectMountStopped(); } } } function markComponentPassiveEffectUnmountStarted(fiber) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStarted === 'function') { injectedProfilingHooks.markComponentPassiveEffectUnmountStarted(fiber); } } } function markComponentPassiveEffectUnmountStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentPassiveEffectUnmountStopped === 'function') { injectedProfilingHooks.markComponentPassiveEffectUnmountStopped(); } } } function markComponentLayoutEffectMountStarted(fiber) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStarted === 'function') { injectedProfilingHooks.markComponentLayoutEffectMountStarted(fiber); } } } function markComponentLayoutEffectMountStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectMountStopped === 'function') { injectedProfilingHooks.markComponentLayoutEffectMountStopped(); } } } function markComponentLayoutEffectUnmountStarted(fiber) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStarted === 'function') { injectedProfilingHooks.markComponentLayoutEffectUnmountStarted(fiber); } } } function markComponentLayoutEffectUnmountStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentLayoutEffectUnmountStopped === 'function') { injectedProfilingHooks.markComponentLayoutEffectUnmountStopped(); } } } function markComponentErrored(fiber, thrownValue, lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentErrored === 'function') { injectedProfilingHooks.markComponentErrored(fiber, thrownValue, lanes); } } } function markComponentSuspended(fiber, wakeable, lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markComponentSuspended === 'function') { injectedProfilingHooks.markComponentSuspended(fiber, wakeable, lanes); } } } function markLayoutEffectsStarted(lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStarted === 'function') { injectedProfilingHooks.markLayoutEffectsStarted(lanes); } } } function markLayoutEffectsStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markLayoutEffectsStopped === 'function') { injectedProfilingHooks.markLayoutEffectsStopped(); } } } function markPassiveEffectsStarted(lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStarted === 'function') { injectedProfilingHooks.markPassiveEffectsStarted(lanes); } } } function markPassiveEffectsStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markPassiveEffectsStopped === 'function') { injectedProfilingHooks.markPassiveEffectsStopped(); } } } function markRenderStarted(lanes) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStarted === 'function') { injectedProfilingHooks.markRenderStarted(lanes); } } } function markRenderYielded() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderYielded === 'function') { injectedProfilingHooks.markRenderYielded(); } } } function markRenderStopped() { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderStopped === 'function') { injectedProfilingHooks.markRenderStopped(); } } } function markRenderScheduled(lane) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markRenderScheduled === 'function') { injectedProfilingHooks.markRenderScheduled(lane); } } } function markForceUpdateScheduled(fiber, lane) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markForceUpdateScheduled === 'function') { injectedProfilingHooks.markForceUpdateScheduled(fiber, lane); } } } function markStateUpdateScheduled(fiber, lane) { { if (injectedProfilingHooks !== null && typeof injectedProfilingHooks.markStateUpdateScheduled === 'function') { injectedProfilingHooks.markStateUpdateScheduled(fiber, lane); } } } var NoMode = /* */ 0; // TODO: Remove ConcurrentMode by reading from the root tag instead var ConcurrentMode = /* */ 1; var ProfileMode = /* */ 2; var StrictLegacyMode = /* */ 8; var StrictEffectsMode = /* */ 16; // TODO: This is pretty well supported by browsers. Maybe we can drop it. var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback; // Count leading zeros. // Based on: // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32 var log = Math.log; var LN2 = Math.LN2; function clz32Fallback(x) { var asUint = x >>> 0; if (asUint === 0) { return 32; } return 31 - (log(asUint) / LN2 | 0) | 0; } // If those values are changed that package should be rebuilt and redeployed. var TotalLanes = 31; var NoLanes = /* */ 0; var NoLane = /* */ 0; var SyncLane = /* */ 1; var InputContinuousHydrationLane = /* */ 2; var InputContinuousLane = /* */ 4; var DefaultHydrationLane = /* */ 8; var DefaultLane = /* */ 16; var TransitionHydrationLane = /* */ 32; var TransitionLanes = /* */ 4194240; var TransitionLane1 = /* */ 64; var TransitionLane2 = /* */ 128; var TransitionLane3 = /* */ 256; var TransitionLane4 = /* */ 512; var TransitionLane5 = /* */ 1024; var TransitionLane6 = /* */ 2048; var TransitionLane7 = /* */ 4096; var TransitionLane8 = /* */ 8192; var TransitionLane9 = /* */ 16384; var TransitionLane10 = /* */ 32768; var TransitionLane11 = /* */ 65536; var TransitionLane12 = /* */ 131072; var TransitionLane13 = /* */ 262144; var TransitionLane14 = /* */ 524288; var TransitionLane15 = /* */ 1048576; var TransitionLane16 = /* */ 2097152; var RetryLanes = /* */ 130023424; var RetryLane1 = /* */ 4194304; var RetryLane2 = /* */ 8388608; var RetryLane3 = /* */ 16777216; var RetryLane4 = /* */ 33554432; var RetryLane5 = /* */ 67108864; var SomeRetryLane = RetryLane1; var SelectiveHydrationLane = /* */ 134217728; var NonIdleLanes = /* */ 268435455; var IdleHydrationLane = /* */ 268435456; var IdleLane = /* */ 536870912; var OffscreenLane = /* */ 1073741824; // This function is used for the experimental timeline (react-devtools-timeline) // It should be kept in sync with the Lanes values above. function getLabelForLane(lane) { { if (lane & SyncLane) { return 'Sync'; } if (lane & InputContinuousHydrationLane) { return 'InputContinuousHydration'; } if (lane & InputContinuousLane) { return 'InputContinuous'; } if (lane & DefaultHydrationLane) { return 'DefaultHydration'; } if (lane & DefaultLane) { return 'Default'; } if (lane & TransitionHydrationLane) { return 'TransitionHydration'; } if (lane & TransitionLanes) { return 'Transition'; } if (lane & RetryLanes) { return 'Retry'; } if (lane & SelectiveHydrationLane) { return 'SelectiveHydration'; } if (lane & IdleHydrationLane) { return 'IdleHydration'; } if (lane & IdleLane) { return 'Idle'; } if (lane & OffscreenLane) { return 'Offscreen'; } } } var NoTimestamp = -1; var nextTransitionLane = TransitionLane1; var nextRetryLane = RetryLane1; function getHighestPriorityLanes(lanes) { switch (getHighestPriorityLane(lanes)) { case SyncLane: return SyncLane; case InputContinuousHydrationLane: return InputContinuousHydrationLane; case InputContinuousLane: return InputContinuousLane; case DefaultHydrationLane: return DefaultHydrationLane; case DefaultLane: return DefaultLane; case TransitionHydrationLane: return TransitionHydrationLane; case TransitionLane1: case TransitionLane2: case TransitionLane3: case TransitionLane4: case TransitionLane5: case TransitionLane6: case TransitionLane7: case TransitionLane8: case TransitionLane9: case TransitionLane10: case TransitionLane11: case TransitionLane12: case TransitionLane13: case TransitionLane14: case TransitionLane15: case TransitionLane16: return lanes & TransitionLanes; case RetryLane1: case RetryLane2: case RetryLane3: case RetryLane4: case RetryLane5: return lanes & RetryLanes; case SelectiveHydrationLane: return SelectiveHydrationLane; case IdleHydrationLane: return IdleHydrationLane; case IdleLane: return IdleLane; case OffscreenLane: return OffscreenLane; default: { error('Should have found matching lanes. This is a bug in React.'); } // This shouldn't be reachable, but as a fallback, return the entire bitmask. return lanes; } } function getNextLanes(root, wipLanes) { // Early bailout if there's no pending work left. var pendingLanes = root.pendingLanes; if (pendingLanes === NoLanes) { return NoLanes; } var nextLanes = NoLanes; var suspendedLanes = root.suspendedLanes; var pingedLanes = root.pingedLanes; // Do not work on any idle work until all the non-idle work has finished, // even if the work is suspended. var nonIdlePendingLanes = pendingLanes & NonIdleLanes; if (nonIdlePendingLanes !== NoLanes) { var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes; if (nonIdleUnblockedLanes !== NoLanes) { nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes); } else { var nonIdlePingedLanes = nonIdlePendingLanes & pingedLanes; if (nonIdlePingedLanes !== NoLanes) { nextLanes = getHighestPriorityLanes(nonIdlePingedLanes); } } } else { // The only remaining work is Idle. var unblockedLanes = pendingLanes & ~suspendedLanes; if (unblockedLanes !== NoLanes) { nextLanes = getHighestPriorityLanes(unblockedLanes); } else { if (pingedLanes !== NoLanes) { nextLanes = getHighestPriorityLanes(pingedLanes); } } } if (nextLanes === NoLanes) { // This should only be reachable if we're suspended // TODO: Consider warning in this path if a fallback timer is not scheduled. return NoLanes; } // If we're already in the middle of a render, switching lanes will interrupt // it and we'll lose our progress. We should only do this if the new lanes are // higher priority. if (wipLanes !== NoLanes && wipLanes !== nextLanes && // If we already suspended with a delay, then interrupting is fine. Don't // bother waiting until the root is complete. (wipLanes & suspendedLanes) === NoLanes) { var nextLane = getHighestPriorityLane(nextLanes); var wipLane = getHighestPriorityLane(wipLanes); if ( // Tests whether the next lane is equal or lower priority than the wip // one. This works because the bits decrease in priority as you go left. nextLane >= wipLane || // Default priority updates should not interrupt transition updates. The // only difference between default updates and transition updates is that // default updates do not support refresh transitions. nextLane === DefaultLane && (wipLane & TransitionLanes) !== NoLanes) { // Keep working on the existing in-progress tree. Do not interrupt. return wipLanes; } } if ((nextLanes & InputContinuousLane) !== NoLanes) { // When updates are sync by default, we entangle continuous priority updates // and default updates, so they render in the same batch. The only reason // they use separate lanes is because continuous updates should interrupt // transitions, but default updates should not. nextLanes |= pendingLanes & DefaultLane; } // Check for entangled lanes and add them to the batch. // // A lane is said to be entangled with another when it's not allowed to render // in a batch that does not also include the other lane. Typically we do this // when multiple updates have the same source, and we only want to respond to // the most recent event from that source. // // Note that we apply entanglements *after* checking for partial work above. // This means that if a lane is entangled during an interleaved event while // it's already rendering, we won't interrupt it. This is intentional, since // entanglement is usually "best effort": we'll try our best to render the // lanes in the same batch, but it's not worth throwing out partially // completed work in order to do it. // TODO: Reconsider this. The counter-argument is that the partial work // represents an intermediate state, which we don't want to show to the user. // And by spending extra time finishing it, we're increasing the amount of // time it takes to show the final state, which is what they are actually // waiting for. // // For those exceptions where entanglement is semantically important, like // useMutableSource, we should ensure that there is no partial work at the // time we apply the entanglement. var entangledLanes = root.entangledLanes; if (entangledLanes !== NoLanes) { var entanglements = root.entanglements; var lanes = nextLanes & entangledLanes; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; nextLanes |= entanglements[index]; lanes &= ~lane; } } return nextLanes; } function getMostRecentEventTime(root, lanes) { var eventTimes = root.eventTimes; var mostRecentEventTime = NoTimestamp; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; var eventTime = eventTimes[index]; if (eventTime > mostRecentEventTime) { mostRecentEventTime = eventTime; } lanes &= ~lane; } return mostRecentEventTime; } function computeExpirationTime(lane, currentTime) { switch (lane) { case SyncLane: case InputContinuousHydrationLane: case InputContinuousLane: // User interactions should expire slightly more quickly. // // NOTE: This is set to the corresponding constant as in Scheduler.js. // When we made it larger, a product metric in www regressed, suggesting // there's a user interaction that's being starved by a series of // synchronous updates. If that theory is correct, the proper solution is // to fix the starvation. However, this scenario supports the idea that // expiration times are an important safeguard when starvation // does happen. return currentTime + 250; case DefaultHydrationLane: case DefaultLane: case TransitionHydrationLane: case TransitionLane1: case TransitionLane2: case TransitionLane3: case TransitionLane4: case TransitionLane5: case TransitionLane6: case TransitionLane7: case TransitionLane8: case TransitionLane9: case TransitionLane10: case TransitionLane11: case TransitionLane12: case TransitionLane13: case TransitionLane14: case TransitionLane15: case TransitionLane16: return currentTime + 5000; case RetryLane1: case RetryLane2: case RetryLane3: case RetryLane4: case RetryLane5: // TODO: Retries should be allowed to expire if they are CPU bound for // too long, but when I made this change it caused a spike in browser // crashes. There must be some other underlying bug; not super urgent but // ideally should figure out why and fix it. Unfortunately we don't have // a repro for the crashes, only detected via production metrics. return NoTimestamp; case SelectiveHydrationLane: case IdleHydrationLane: case IdleLane: case OffscreenLane: // Anything idle priority or lower should never expire. return NoTimestamp; default: { error('Should have found matching lanes. This is a bug in React.'); } return NoTimestamp; } } function markStarvedLanesAsExpired(root, currentTime) { // TODO: This gets called every time we yield. We can optimize by storing // the earliest expiration time on the root. Then use that to quickly bail out // of this function. var pendingLanes = root.pendingLanes; var suspendedLanes = root.suspendedLanes; var pingedLanes = root.pingedLanes; var expirationTimes = root.expirationTimes; // Iterate through the pending lanes and check if we've reached their // expiration time. If so, we'll assume the update is being starved and mark // it as expired to force it to finish. var lanes = pendingLanes; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; var expirationTime = expirationTimes[index]; if (expirationTime === NoTimestamp) { // Found a pending lane with no expiration time. If it's not suspended, or // if it's pinged, assume it's CPU-bound. Compute a new expiration time // using the current time. if ((lane & suspendedLanes) === NoLanes || (lane & pingedLanes) !== NoLanes) { // Assumes timestamps are monotonically increasing. expirationTimes[index] = computeExpirationTime(lane, currentTime); } } else if (expirationTime <= currentTime) { // This lane expired root.expiredLanes |= lane; } lanes &= ~lane; } } // This returns the highest priority pending lanes regardless of whether they // are suspended. function getHighestPriorityPendingLanes(root) { return getHighestPriorityLanes(root.pendingLanes); } function getLanesToRetrySynchronouslyOnError(root) { var everythingButOffscreen = root.pendingLanes & ~OffscreenLane; if (everythingButOffscreen !== NoLanes) { return everythingButOffscreen; } if (everythingButOffscreen & OffscreenLane) { return OffscreenLane; } return NoLanes; } function includesSyncLane(lanes) { return (lanes & SyncLane) !== NoLanes; } function includesNonIdleWork(lanes) { return (lanes & NonIdleLanes) !== NoLanes; } function includesOnlyRetries(lanes) { return (lanes & RetryLanes) === lanes; } function includesOnlyNonUrgentLanes(lanes) { var UrgentLanes = SyncLane | InputContinuousLane | DefaultLane; return (lanes & UrgentLanes) === NoLanes; } function includesOnlyTransitions(lanes) { return (lanes & TransitionLanes) === lanes; } function includesBlockingLane(root, lanes) { var SyncDefaultLanes = InputContinuousHydrationLane | InputContinuousLane | DefaultHydrationLane | DefaultLane; return (lanes & SyncDefaultLanes) !== NoLanes; } function includesExpiredLane(root, lanes) { // This is a separate check from includesBlockingLane because a lane can // expire after a render has already started. return (lanes & root.expiredLanes) !== NoLanes; } function isTransitionLane(lane) { return (lane & TransitionLanes) !== NoLanes; } function claimNextTransitionLane() { // Cycle through the lanes, assigning each new transition to the next lane. // In most cases, this means every transition gets its own lane, until we // run out of lanes and cycle back to the beginning. var lane = nextTransitionLane; nextTransitionLane <<= 1; if ((nextTransitionLane & TransitionLanes) === NoLanes) { nextTransitionLane = TransitionLane1; } return lane; } function claimNextRetryLane() { var lane = nextRetryLane; nextRetryLane <<= 1; if ((nextRetryLane & RetryLanes) === NoLanes) { nextRetryLane = RetryLane1; } return lane; } function getHighestPriorityLane(lanes) { return lanes & -lanes; } function pickArbitraryLane(lanes) { // This wrapper function gets inlined. Only exists so to communicate that it // doesn't matter which bit is selected; you can pick any bit without // affecting the algorithms where its used. Here I'm using // getHighestPriorityLane because it requires the fewest operations. return getHighestPriorityLane(lanes); } function pickArbitraryLaneIndex(lanes) { return 31 - clz32(lanes); } function laneToIndex(lane) { return pickArbitraryLaneIndex(lane); } function includesSomeLane(a, b) { return (a & b) !== NoLanes; } function isSubsetOfLanes(set, subset) { return (set & subset) === subset; } function mergeLanes(a, b) { return a | b; } function removeLanes(set, subset) { return set & ~subset; } function intersectLanes(a, b) { return a & b; } // Seems redundant, but it changes the type from a single lane (used for // updates) to a group of lanes (used for flushing work). function laneToLanes(lane) { return lane; } function higherPriorityLane(a, b) { // This works because the bit ranges decrease in priority as you go left. return a !== NoLane && a < b ? a : b; } function createLaneMap(initial) { // Intentionally pushing one by one. // https://v8.dev/blog/elements-kinds#avoid-creating-holes var laneMap = []; for (var i = 0; i < TotalLanes; i++) { laneMap.push(initial); } return laneMap; } function markRootUpdated(root, updateLane, eventTime) { root.pendingLanes |= updateLane; // If there are any suspended transitions, it's possible this new update // could unblock them. Clear the suspended lanes so that we can try rendering // them again. // // TODO: We really only need to unsuspend only lanes that are in the // `subtreeLanes` of the updated fiber, or the update lanes of the return // path. This would exclude suspended updates in an unrelated sibling tree, // since there's no way for this update to unblock it. // // We don't do this if the incoming update is idle, because we never process // idle updates until after all the regular updates have finished; there's no // way it could unblock a transition. if (updateLane !== IdleLane) { root.suspendedLanes = NoLanes; root.pingedLanes = NoLanes; } var eventTimes = root.eventTimes; var index = laneToIndex(updateLane); // We can always overwrite an existing timestamp because we prefer the most // recent event, and we assume time is monotonically increasing. eventTimes[index] = eventTime; } function markRootSuspended(root, suspendedLanes) { root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; // The suspended lanes are no longer CPU-bound. Clear their expiration times. var expirationTimes = root.expirationTimes; var lanes = suspendedLanes; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; expirationTimes[index] = NoTimestamp; lanes &= ~lane; } } function markRootPinged(root, pingedLanes, eventTime) { root.pingedLanes |= root.suspendedLanes & pingedLanes; } function markRootFinished(root, remainingLanes) { var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; root.pendingLanes = remainingLanes; // Let's try everything again root.suspendedLanes = NoLanes; root.pingedLanes = NoLanes; root.expiredLanes &= remainingLanes; root.mutableReadLanes &= remainingLanes; root.entangledLanes &= remainingLanes; var entanglements = root.entanglements; var eventTimes = root.eventTimes; var expirationTimes = root.expirationTimes; // Clear the lanes that no longer have pending work var lanes = noLongerPendingLanes; while (lanes > 0) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; entanglements[index] = NoLanes; eventTimes[index] = NoTimestamp; expirationTimes[index] = NoTimestamp; lanes &= ~lane; } } function markRootEntangled(root, entangledLanes) { // In addition to entangling each of the given lanes with each other, we also // have to consider _transitive_ entanglements. For each lane that is already // entangled with *any* of the given lanes, that lane is now transitively // entangled with *all* the given lanes. // // Translated: If C is entangled with A, then entangling A with B also // entangles C with B. // // If this is hard to grasp, it might help to intentionally break this // function and look at the tests that fail in ReactTransition-test.js. Try // commenting out one of the conditions below. var rootEntangledLanes = root.entangledLanes |= entangledLanes; var entanglements = root.entanglements; var lanes = rootEntangledLanes; while (lanes) { var index = pickArbitraryLaneIndex(lanes); var lane = 1 << index; if ( // Is this one of the newly entangled lanes? lane & entangledLanes | // Is this lane transitively entangled with the newly entangled lanes? entanglements[index] & entangledLanes) { entanglements[index] |= entangledLanes; } lanes &= ~lane; } } function getBumpedLaneForHydration(root, renderLanes) { var renderLane = getHighestPriorityLane(renderLanes); var lane; switch (renderLane) { case InputContinuousLane: lane = InputContinuousHydrationLane; break; case DefaultLane: lane = DefaultHydrationLane; break; case TransitionLane1: case TransitionLane2: case TransitionLane3: case TransitionLane4: case TransitionLane5: case TransitionLane6: case TransitionLane7: case TransitionLane8: case TransitionLane9: case TransitionLane10: case TransitionLane11: case TransitionLane12: case TransitionLane13: case TransitionLane14: case TransitionLane15: case TransitionLane16: case RetryLane1: case RetryLane2: case RetryLane3: case RetryLane4: case RetryLane5: lane = TransitionHydrationLane; break; case IdleLane: lane = IdleHydrationLane; break; default: // Everything else is already either a hydration lane, or shouldn't // be retried at a hydration lane. lane = NoLane; break; } // Check if the lane we chose is suspended. If so, that indicates that we // already attempted and failed to hydrate at that level. Also check if we're // already rendering that lane, which is rare but could happen. if ((lane & (root.suspendedLanes | renderLanes)) !== NoLane) { // Give up trying to hydrate and fall back to client render. return NoLane; } return lane; } function addFiberToLanesMap(root, fiber, lanes) { if (!isDevToolsPresent) { return; } var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap; while (lanes > 0) { var index = laneToIndex(lanes); var lane = 1 << index; var updaters = pendingUpdatersLaneMap[index]; updaters.add(fiber); lanes &= ~lane; } } function movePendingFibersToMemoized(root, lanes) { if (!isDevToolsPresent) { return; } var pendingUpdatersLaneMap = root.pendingUpdatersLaneMap; var memoizedUpdaters = root.memoizedUpdaters; while (lanes > 0) { var index = laneToIndex(lanes); var lane = 1 << index; var updaters = pendingUpdatersLaneMap[index]; if (updaters.size > 0) { updaters.forEach(function (fiber) { var alternate = fiber.alternate; if (alternate === null || !memoizedUpdaters.has(alternate)) { memoizedUpdaters.add(fiber); } }); updaters.clear(); } lanes &= ~lane; } } function getTransitionsForLanes(root, lanes) { { return null; } } var DiscreteEventPriority = SyncLane; var ContinuousEventPriority = InputContinuousLane; var DefaultEventPriority = DefaultLane; var IdleEventPriority = IdleLane; var currentUpdatePriority = NoLane; function getCurrentUpdatePriority() { return currentUpdatePriority; } function setCurrentUpdatePriority(newPriority) { currentUpdatePriority = newPriority; } function runWithPriority(priority, fn) { var previousPriority = currentUpdatePriority; try { currentUpdatePriority = priority; return fn(); } finally { currentUpdatePriority = previousPriority; } } function higherEventPriority(a, b) { return a !== 0 && a < b ? a : b; } function lowerEventPriority(a, b) { return a === 0 || a > b ? a : b; } function isHigherEventPriority(a, b) { return a !== 0 && a < b; } function lanesToEventPriority(lanes) { var lane = getHighestPriorityLane(lanes); if (!isHigherEventPriority(DiscreteEventPriority, lane)) { return DiscreteEventPriority; } if (!isHigherEventPriority(ContinuousEventPriority, lane)) { return ContinuousEventPriority; } if (includesNonIdleWork(lane)) { return DefaultEventPriority; } return IdleEventPriority; } // This is imported by the event replaying implementation in React DOM. It's // in a separate file to break a circular dependency between the renderer and // the reconciler. function isRootDehydrated(root) { var currentState = root.current.memoizedState; return currentState.isDehydrated; } var _attemptSynchronousHydration; function setAttemptSynchronousHydration(fn) { _attemptSynchronousHydration = fn; } function attemptSynchronousHydration(fiber) { _attemptSynchronousHydration(fiber); } var attemptContinuousHydration; function setAttemptContinuousHydration(fn) { attemptContinuousHydration = fn; } var attemptHydrationAtCurrentPriority; function setAttemptHydrationAtCurrentPriority(fn) { attemptHydrationAtCurrentPriority = fn; } var getCurrentUpdatePriority$1; function setGetCurrentUpdatePriority(fn) { getCurrentUpdatePriority$1 = fn; } var attemptHydrationAtPriority; function setAttemptHydrationAtPriority(fn) { attemptHydrationAtPriority = fn; } // TODO: Upgrade this definition once we're on a newer version of Flow that // has this definition built-in. var hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed. var queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout. // if the last target was dehydrated. var queuedFocus = null; var queuedDrag = null; var queuedMouse = null; // For pointer events there can be one latest event per pointerId. var queuedPointers = new Map(); var queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too. var queuedExplicitHydrationTargets = []; var discreteReplayableEvents = ['mousedown', 'mouseup', 'touchcancel', 'touchend', 'touchstart', 'auxclick', 'dblclick', 'pointercancel', 'pointerdown', 'pointerup', 'dragend', 'dragstart', 'drop', 'compositionend', 'compositionstart', 'keydown', 'keypress', 'keyup', 'input', 'textInput', // Intentionally camelCase 'copy', 'cut', 'paste', 'click', 'change', 'contextmenu', 'reset', 'submit']; function isDiscreteEventThatRequiresHydration(eventType) { return discreteReplayableEvents.indexOf(eventType) > -1; } function createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) { return { blockedOn: blockedOn, domEventName: domEventName, eventSystemFlags: eventSystemFlags, nativeEvent: nativeEvent, targetContainers: [targetContainer] }; } function clearIfContinuousEvent(domEventName, nativeEvent) { switch (domEventName) { case 'focusin': case 'focusout': queuedFocus = null; break; case 'dragenter': case 'dragleave': queuedDrag = null; break; case 'mouseover': case 'mouseout': queuedMouse = null; break; case 'pointerover': case 'pointerout': { var pointerId = nativeEvent.pointerId; queuedPointers.delete(pointerId); break; } case 'gotpointercapture': case 'lostpointercapture': { var _pointerId = nativeEvent.pointerId; queuedPointerCaptures.delete(_pointerId); break; } } } function accumulateOrCreateContinuousQueuedReplayableEvent(existingQueuedEvent, blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) { if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) { var queuedEvent = createQueuedReplayableEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent); if (blockedOn !== null) { var _fiber2 = getInstanceFromNode(blockedOn); if (_fiber2 !== null) { // Attempt to increase the priority of this target. attemptContinuousHydration(_fiber2); } } return queuedEvent; } // If we have already queued this exact event, then it's because // the different event systems have different DOM event listeners. // We can accumulate the flags, and the targetContainers, and // store a single event to be replayed. existingQueuedEvent.eventSystemFlags |= eventSystemFlags; var targetContainers = existingQueuedEvent.targetContainers; if (targetContainer !== null && targetContainers.indexOf(targetContainer) === -1) { targetContainers.push(targetContainer); } return existingQueuedEvent; } function queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent) { // These set relatedTarget to null because the replayed event will be treated as if we // moved from outside the window (no target) onto the target once it hydrates. // Instead of mutating we could clone the event. switch (domEventName) { case 'focusin': { var focusEvent = nativeEvent; queuedFocus = accumulateOrCreateContinuousQueuedReplayableEvent(queuedFocus, blockedOn, domEventName, eventSystemFlags, targetContainer, focusEvent); return true; } case 'dragenter': { var dragEvent = nativeEvent; queuedDrag = accumulateOrCreateContinuousQueuedReplayableEvent(queuedDrag, blockedOn, domEventName, eventSystemFlags, targetContainer, dragEvent); return true; } case 'mouseover': { var mouseEvent = nativeEvent; queuedMouse = accumulateOrCreateContinuousQueuedReplayableEvent(queuedMouse, blockedOn, domEventName, eventSystemFlags, targetContainer, mouseEvent); return true; } case 'pointerover': { var pointerEvent = nativeEvent; var pointerId = pointerEvent.pointerId; queuedPointers.set(pointerId, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, pointerEvent)); return true; } case 'gotpointercapture': { var _pointerEvent = nativeEvent; var _pointerId2 = _pointerEvent.pointerId; queuedPointerCaptures.set(_pointerId2, accumulateOrCreateContinuousQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, domEventName, eventSystemFlags, targetContainer, _pointerEvent)); return true; } } return false; } // Check if this target is unblocked. Returns true if it's unblocked. function attemptExplicitHydrationTarget(queuedTarget) { // TODO: This function shares a lot of logic with findInstanceBlockingEvent. // Try to unify them. It's a bit tricky since it would require two return // values. var targetInst = getClosestInstanceFromNode(queuedTarget.target); if (targetInst !== null) { var nearestMounted = getNearestMountedFiber(targetInst); if (nearestMounted !== null) { var tag = nearestMounted.tag; if (tag === SuspenseComponent) { var instance = getSuspenseInstanceFromFiber(nearestMounted); if (instance !== null) { // We're blocked on hydrating this boundary. // Increase its priority. queuedTarget.blockedOn = instance; attemptHydrationAtPriority(queuedTarget.priority, function () { attemptHydrationAtCurrentPriority(nearestMounted); }); return; } } else if (tag === HostRoot) { var root = nearestMounted.stateNode; if (isRootDehydrated(root)) { queuedTarget.blockedOn = getContainerFromFiber(nearestMounted); // We don't currently have a way to increase the priority of // a root other than sync. return; } } } } queuedTarget.blockedOn = null; } function queueExplicitHydrationTarget(target) { // TODO: This will read the priority if it's dispatched by the React // event system but not native events. Should read window.event.type, like // we do for updates (getCurrentEventPriority). var updatePriority = getCurrentUpdatePriority$1(); var queuedTarget = { blockedOn: null, target: target, priority: updatePriority }; var i = 0; for (; i < queuedExplicitHydrationTargets.length; i++) { // Stop once we hit the first target with lower priority than if (!isHigherEventPriority(updatePriority, queuedExplicitHydrationTargets[i].priority)) { break; } } queuedExplicitHydrationTargets.splice(i, 0, queuedTarget); if (i === 0) { attemptExplicitHydrationTarget(queuedTarget); } } function attemptReplayContinuousQueuedEvent(queuedEvent) { if (queuedEvent.blockedOn !== null) { return false; } var targetContainers = queuedEvent.targetContainers; while (targetContainers.length > 0) { var targetContainer = targetContainers[0]; var nextBlockedOn = findInstanceBlockingEvent(queuedEvent.domEventName, queuedEvent.eventSystemFlags, targetContainer, queuedEvent.nativeEvent); if (nextBlockedOn === null) { { var nativeEvent = queuedEvent.nativeEvent; var nativeEventClone = new nativeEvent.constructor(nativeEvent.type, nativeEvent); setReplayingEvent(nativeEventClone); nativeEvent.target.dispatchEvent(nativeEventClone); resetReplayingEvent(); } } else { // We're still blocked. Try again later. var _fiber3 = getInstanceFromNode(nextBlockedOn); if (_fiber3 !== null) { attemptContinuousHydration(_fiber3); } queuedEvent.blockedOn = nextBlockedOn; return false; } // This target container was successfully dispatched. Try the next. targetContainers.shift(); } return true; } function attemptReplayContinuousQueuedEventInMap(queuedEvent, key, map) { if (attemptReplayContinuousQueuedEvent(queuedEvent)) { map.delete(key); } } function replayUnblockedEvents() { hasScheduledReplayAttempt = false; if (queuedFocus !== null && attemptReplayContinuousQueuedEvent(queuedFocus)) { queuedFocus = null; } if (queuedDrag !== null && attemptReplayContinuousQueuedEvent(queuedDrag)) { queuedDrag = null; } if (queuedMouse !== null && attemptReplayContinuousQueuedEvent(queuedMouse)) { queuedMouse = null; } queuedPointers.forEach(attemptReplayContinuousQueuedEventInMap); queuedPointerCaptures.forEach(attemptReplayContinuousQueuedEventInMap); } function scheduleCallbackIfUnblocked(queuedEvent, unblocked) { if (queuedEvent.blockedOn === unblocked) { queuedEvent.blockedOn = null; if (!hasScheduledReplayAttempt) { hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are // now unblocked. This first might not actually be unblocked yet. // We could check it early to avoid scheduling an unnecessary callback. unstable_scheduleCallback(unstable_NormalPriority, replayUnblockedEvents); } } } function retryIfBlockedOn(unblocked) { // Mark anything that was blocked on this as no longer blocked // and eligible for a replay. if (queuedDiscreteEvents.length > 0) { scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's // worth it because we expect very few discrete events to queue up and once // we are actually fully unblocked it will be fast to replay them. for (var i = 1; i < queuedDiscreteEvents.length; i++) { var queuedEvent = queuedDiscreteEvents[i]; if (queuedEvent.blockedOn === unblocked) { queuedEvent.blockedOn = null; } } } if (queuedFocus !== null) { scheduleCallbackIfUnblocked(queuedFocus, unblocked); } if (queuedDrag !== null) { scheduleCallbackIfUnblocked(queuedDrag, unblocked); } if (queuedMouse !== null) { scheduleCallbackIfUnblocked(queuedMouse, unblocked); } var unblock = function (queuedEvent) { return scheduleCallbackIfUnblocked(queuedEvent, unblocked); }; queuedPointers.forEach(unblock); queuedPointerCaptures.forEach(unblock); for (var _i = 0; _i < queuedExplicitHydrationTargets.length; _i++) { var queuedTarget = queuedExplicitHydrationTargets[_i]; if (queuedTarget.blockedOn === unblocked) { queuedTarget.blockedOn = null; } } while (queuedExplicitHydrationTargets.length > 0) { var nextExplicitTarget = queuedExplicitHydrationTargets[0]; if (nextExplicitTarget.blockedOn !== null) { // We're still blocked. break; } else { attemptExplicitHydrationTarget(nextExplicitTarget); if (nextExplicitTarget.blockedOn === null) { // We're unblocked. queuedExplicitHydrationTargets.shift(); } } } } var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; // TODO: can we stop exporting these? var _enabled = true; // This is exported in FB builds for use by legacy FB layer infra. // We'd like to remove this but it's not clear if this is safe. function setEnabled(enabled) { _enabled = !!enabled; } function isEnabled() { return _enabled; } function createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags) { var eventPriority = getEventPriority(domEventName); var listenerWrapper; switch (eventPriority) { case DiscreteEventPriority: listenerWrapper = dispatchDiscreteEvent; break; case ContinuousEventPriority: listenerWrapper = dispatchContinuousEvent; break; case DefaultEventPriority: default: listenerWrapper = dispatchEvent; break; } return listenerWrapper.bind(null, domEventName, eventSystemFlags, targetContainer); } function dispatchDiscreteEvent(domEventName, eventSystemFlags, container, nativeEvent) { var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; try { setCurrentUpdatePriority(DiscreteEventPriority); dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig.transition = prevTransition; } } function dispatchContinuousEvent(domEventName, eventSystemFlags, container, nativeEvent) { var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = null; try { setCurrentUpdatePriority(ContinuousEventPriority); dispatchEvent(domEventName, eventSystemFlags, container, nativeEvent); } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig.transition = prevTransition; } } function dispatchEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) { if (!_enabled) { return; } { dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent); } } function dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay(domEventName, eventSystemFlags, targetContainer, nativeEvent) { var blockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent); if (blockedOn === null) { dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer); clearIfContinuousEvent(domEventName, nativeEvent); return; } if (queueIfContinuousEvent(blockedOn, domEventName, eventSystemFlags, targetContainer, nativeEvent)) { nativeEvent.stopPropagation(); return; } // We need to clear only if we didn't queue because // queueing is accumulative. clearIfContinuousEvent(domEventName, nativeEvent); if (eventSystemFlags & IS_CAPTURE_PHASE && isDiscreteEventThatRequiresHydration(domEventName)) { while (blockedOn !== null) { var fiber = getInstanceFromNode(blockedOn); if (fiber !== null) { attemptSynchronousHydration(fiber); } var nextBlockedOn = findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent); if (nextBlockedOn === null) { dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, return_targetInst, targetContainer); } if (nextBlockedOn === blockedOn) { break; } blockedOn = nextBlockedOn; } if (blockedOn !== null) { nativeEvent.stopPropagation(); } return; } // This is not replayable so we'll invoke it but without a target, // in case the event system needs to trace it. dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, null, targetContainer); } var return_targetInst = null; // Returns a SuspenseInstance or Container if it's blocked. // The return_targetInst field above is conceptually part of the return value. function findInstanceBlockingEvent(domEventName, eventSystemFlags, targetContainer, nativeEvent) { // TODO: Warn if _enabled is false. return_targetInst = null; var nativeEventTarget = getEventTarget(nativeEvent); var targetInst = getClosestInstanceFromNode(nativeEventTarget); if (targetInst !== null) { var nearestMounted = getNearestMountedFiber(targetInst); if (nearestMounted === null) { // This tree has been unmounted already. Dispatch without a target. targetInst = null; } else { var tag = nearestMounted.tag; if (tag === SuspenseComponent) { var instance = getSuspenseInstanceFromFiber(nearestMounted); if (instance !== null) { // Queue the event to be replayed later. Abort dispatching since we // don't want this event dispatched twice through the event system. // TODO: If this is the first discrete event in the queue. Schedule an increased // priority for this boundary. return instance; } // This shouldn't happen, something went wrong but to avoid blocking // the whole system, dispatch the event without a target. // TODO: Warn. targetInst = null; } else if (tag === HostRoot) { var root = nearestMounted.stateNode; if (isRootDehydrated(root)) { // If this happens during a replay something went wrong and it might block // the whole system. return getContainerFromFiber(nearestMounted); } targetInst = null; } else if (nearestMounted !== targetInst) { // If we get an event (ex: img onload) before committing that // component's mount, ignore it for now (that is, treat it as if it was an // event on a non-React tree). We might also consider queueing events and // dispatching them after the mount. targetInst = null; } } } return_targetInst = targetInst; // We're not blocked on anything. return null; } function getEventPriority(domEventName) { switch (domEventName) { // Used by SimpleEventPlugin: case 'cancel': case 'click': case 'close': case 'contextmenu': case 'copy': case 'cut': case 'auxclick': case 'dblclick': case 'dragend': case 'dragstart': case 'drop': case 'focusin': case 'focusout': case 'input': case 'invalid': case 'keydown': case 'keypress': case 'keyup': case 'mousedown': case 'mouseup': case 'paste': case 'pause': case 'play': case 'pointercancel': case 'pointerdown': case 'pointerup': case 'ratechange': case 'reset': case 'resize': case 'seeked': case 'submit': case 'touchcancel': case 'touchend': case 'touchstart': case 'volumechange': // Used by polyfills: // eslint-disable-next-line no-fallthrough case 'change': case 'selectionchange': case 'textInput': case 'compositionstart': case 'compositionend': case 'compositionupdate': // Only enableCreateEventHandleAPI: // eslint-disable-next-line no-fallthrough case 'beforeblur': case 'afterblur': // Not used by React but could be by user code: // eslint-disable-next-line no-fallthrough case 'beforeinput': case 'blur': case 'fullscreenchange': case 'focus': case 'hashchange': case 'popstate': case 'select': case 'selectstart': return DiscreteEventPriority; case 'drag': case 'dragenter': case 'dragexit': case 'dragleave': case 'dragover': case 'mousemove': case 'mouseout': case 'mouseover': case 'pointermove': case 'pointerout': case 'pointerover': case 'scroll': case 'toggle': case 'touchmove': case 'wheel': // Not used by React but could be by user code: // eslint-disable-next-line no-fallthrough case 'mouseenter': case 'mouseleave': case 'pointerenter': case 'pointerleave': return ContinuousEventPriority; case 'message': { // We might be in the Scheduler callback. // Eventually this mechanism will be replaced by a check // of the current priority on the native scheduler. var schedulerPriority = getCurrentPriorityLevel(); switch (schedulerPriority) { case ImmediatePriority: return DiscreteEventPriority; case UserBlockingPriority: return ContinuousEventPriority; case NormalPriority: case LowPriority: // TODO: Handle LowSchedulerPriority, somehow. Maybe the same lane as hydration. return DefaultEventPriority; case IdlePriority: return IdleEventPriority; default: return DefaultEventPriority; } } default: return DefaultEventPriority; } } function addEventBubbleListener(target, eventType, listener) { target.addEventListener(eventType, listener, false); return listener; } function addEventCaptureListener(target, eventType, listener) { target.addEventListener(eventType, listener, true); return listener; } function addEventCaptureListenerWithPassiveFlag(target, eventType, listener, passive) { target.addEventListener(eventType, listener, { capture: true, passive: passive }); return listener; } function addEventBubbleListenerWithPassiveFlag(target, eventType, listener, passive) { target.addEventListener(eventType, listener, { passive: passive }); return listener; } /** * These variables store information about text content of a target node, * allowing comparison of content before and after a given event. * * Identify the node where selection currently begins, then observe * both its text content and its current position in the DOM. Since the * browser may natively replace the target node during composition, we can * use its position to find its replacement. * * */ var root = null; var startText = null; var fallbackText = null; function initialize(nativeEventTarget) { root = nativeEventTarget; startText = getText(); return true; } function reset() { root = null; startText = null; fallbackText = null; } function getData() { if (fallbackText) { return fallbackText; } var start; var startValue = startText; var startLength = startValue.length; var end; var endValue = getText(); var endLength = endValue.length; for (start = 0; start < startLength; start++) { if (startValue[start] !== endValue[start]) { break; } } var minEnd = startLength - start; for (end = 1; end <= minEnd; end++) { if (startValue[startLength - end] !== endValue[endLength - end]) { break; } } var sliceTail = end > 1 ? 1 - end : undefined; fallbackText = endValue.slice(start, sliceTail); return fallbackText; } function getText() { if ('value' in root) { return root.value; } return root.textContent; } /** * `charCode` represents the actual "character code" and is safe to use with * `String.fromCharCode`. As such, only keys that correspond to printable * characters produce a valid `charCode`, the only exception to this is Enter. * The Tab-key is considered non-printable and does not have a `charCode`, * presumably because it does not produce a tab-character in browsers. * * @param {object} nativeEvent Native browser event. * @return {number} Normalized `charCode` property. */ function getEventCharCode(nativeEvent) { var charCode; var keyCode = nativeEvent.keyCode; if ('charCode' in nativeEvent) { charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`. if (charCode === 0 && keyCode === 13) { charCode = 13; } } else { // IE8 does not implement `charCode`, but `keyCode` has the correct value. charCode = keyCode; } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux) // report Enter as charCode 10 when ctrl is pressed. if (charCode === 10) { charCode = 13; } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them. // Must not discard the (non-)printable Enter-key. if (charCode >= 32 || charCode === 13) { return charCode; } return 0; } function functionThatReturnsTrue() { return true; } function functionThatReturnsFalse() { return false; } // This is intentionally a factory so that we have different returned constructors. // If we had a single constructor, it would be megamorphic and engines would deopt. function createSyntheticEvent(Interface) { /** * Synthetic events are dispatched by event plugins, typically in response to a * top-level event delegation handler. * * These systems should generally use pooling to reduce the frequency of garbage * collection. The system should check `isPersistent` to determine whether the * event should be released into the pool after being dispatched. Users that * need a persisted event should invoke `persist`. * * Synthetic events (and subclasses) implement the DOM Level 3 Events API by * normalizing browser quirks. Subclasses do not necessarily have to implement a * DOM interface; custom application-specific events can also subclass this. */ function SyntheticBaseEvent(reactName, reactEventType, targetInst, nativeEvent, nativeEventTarget) { this._reactName = reactName; this._targetInst = targetInst; this.type = reactEventType; this.nativeEvent = nativeEvent; this.target = nativeEventTarget; this.currentTarget = null; for (var _propName in Interface) { if (!Interface.hasOwnProperty(_propName)) { continue; } var normalize = Interface[_propName]; if (normalize) { this[_propName] = normalize(nativeEvent); } else { this[_propName] = nativeEvent[_propName]; } } var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false; if (defaultPrevented) { this.isDefaultPrevented = functionThatReturnsTrue; } else { this.isDefaultPrevented = functionThatReturnsFalse; } this.isPropagationStopped = functionThatReturnsFalse; return this; } assign(SyntheticBaseEvent.prototype, { preventDefault: function () { this.defaultPrevented = true; var event = this.nativeEvent; if (!event) { return; } if (event.preventDefault) { event.preventDefault(); // $FlowFixMe - flow is not aware of `unknown` in IE } else if (typeof event.returnValue !== 'unknown') { event.returnValue = false; } this.isDefaultPrevented = functionThatReturnsTrue; }, stopPropagation: function () { var event = this.nativeEvent; if (!event) { return; } if (event.stopPropagation) { event.stopPropagation(); // $FlowFixMe - flow is not aware of `unknown` in IE } else if (typeof event.cancelBubble !== 'unknown') { // The ChangeEventPlugin registers a "propertychange" event for // IE. This event does not support bubbling or cancelling, and // any references to cancelBubble throw "Member not found". A // typeof check of "unknown" circumvents this issue (and is also // IE specific). event.cancelBubble = true; } this.isPropagationStopped = functionThatReturnsTrue; }, /** * We release all dispatched `SyntheticEvent`s after each event loop, adding * them back into the pool. This allows a way to hold onto a reference that * won't be added back into the pool. */ persist: function () {// Modern event system doesn't use pooling. }, /** * Checks if this event should be released back into the pool. * * @return {boolean} True if this should not be released, false otherwise. */ isPersistent: functionThatReturnsTrue }); return SyntheticBaseEvent; } /** * @interface Event * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var EventInterface = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: function (event) { return event.timeStamp || Date.now(); }, defaultPrevented: 0, isTrusted: 0 }; var SyntheticEvent = createSyntheticEvent(EventInterface); var UIEventInterface = assign({}, EventInterface, { view: 0, detail: 0 }); var SyntheticUIEvent = createSyntheticEvent(UIEventInterface); var lastMovementX; var lastMovementY; var lastMouseEvent; function updateMouseMovementPolyfillState(event) { if (event !== lastMouseEvent) { if (lastMouseEvent && event.type === 'mousemove') { lastMovementX = event.screenX - lastMouseEvent.screenX; lastMovementY = event.screenY - lastMouseEvent.screenY; } else { lastMovementX = 0; lastMovementY = 0; } lastMouseEvent = event; } } /** * @interface MouseEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var MouseEventInterface = assign({}, UIEventInterface, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: getEventModifierState, button: 0, buttons: 0, relatedTarget: function (event) { if (event.relatedTarget === undefined) return event.fromElement === event.srcElement ? event.toElement : event.fromElement; return event.relatedTarget; }, movementX: function (event) { if ('movementX' in event) { return event.movementX; } updateMouseMovementPolyfillState(event); return lastMovementX; }, movementY: function (event) { if ('movementY' in event) { return event.movementY; } // Don't need to call updateMouseMovementPolyfillState() here // because it's guaranteed to have already run when movementX // was copied. return lastMovementY; } }); var SyntheticMouseEvent = createSyntheticEvent(MouseEventInterface); /** * @interface DragEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var DragEventInterface = assign({}, MouseEventInterface, { dataTransfer: 0 }); var SyntheticDragEvent = createSyntheticEvent(DragEventInterface); /** * @interface FocusEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var FocusEventInterface = assign({}, UIEventInterface, { relatedTarget: 0 }); var SyntheticFocusEvent = createSyntheticEvent(FocusEventInterface); /** * @interface Event * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent */ var AnimationEventInterface = assign({}, EventInterface, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }); var SyntheticAnimationEvent = createSyntheticEvent(AnimationEventInterface); /** * @interface Event * @see http://www.w3.org/TR/clipboard-apis/ */ var ClipboardEventInterface = assign({}, EventInterface, { clipboardData: function (event) { return 'clipboardData' in event ? event.clipboardData : window.clipboardData; } }); var SyntheticClipboardEvent = createSyntheticEvent(ClipboardEventInterface); /** * @interface Event * @see http://www.w3.org/TR/DOM-Level-3-Events/#events-compositionevents */ var CompositionEventInterface = assign({}, EventInterface, { data: 0 }); var SyntheticCompositionEvent = createSyntheticEvent(CompositionEventInterface); /** * @interface Event * @see http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105 * /#events-inputevents */ // Happens to share the same list for now. var SyntheticInputEvent = SyntheticCompositionEvent; /** * Normalization of deprecated HTML5 `key` values * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names */ var normalizeKey = { Esc: 'Escape', Spacebar: ' ', Left: 'ArrowLeft', Up: 'ArrowUp', Right: 'ArrowRight', Down: 'ArrowDown', Del: 'Delete', Win: 'OS', Menu: 'ContextMenu', Apps: 'ContextMenu', Scroll: 'ScrollLock', MozPrintableKey: 'Unidentified' }; /** * Translation from legacy `keyCode` to HTML5 `key` * Only special keys supported, all others depend on keyboard layout or browser * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names */ var translateToKey = { '8': 'Backspace', '9': 'Tab', '12': 'Clear', '13': 'Enter', '16': 'Shift', '17': 'Control', '18': 'Alt', '19': 'Pause', '20': 'CapsLock', '27': 'Escape', '32': ' ', '33': 'PageUp', '34': 'PageDown', '35': 'End', '36': 'Home', '37': 'ArrowLeft', '38': 'ArrowUp', '39': 'ArrowRight', '40': 'ArrowDown', '45': 'Insert', '46': 'Delete', '112': 'F1', '113': 'F2', '114': 'F3', '115': 'F4', '116': 'F5', '117': 'F6', '118': 'F7', '119': 'F8', '120': 'F9', '121': 'F10', '122': 'F11', '123': 'F12', '144': 'NumLock', '145': 'ScrollLock', '224': 'Meta' }; /** * @param {object} nativeEvent Native browser event. * @return {string} Normalized `key` property. */ function getEventKey(nativeEvent) { if (nativeEvent.key) { // Normalize inconsistent values reported by browsers due to // implementations of a working draft specification. // FireFox implements `key` but returns `MozPrintableKey` for all // printable characters (normalized to `Unidentified`), ignore it. var key = normalizeKey[nativeEvent.key] || nativeEvent.key; if (key !== 'Unidentified') { return key; } } // Browser does not implement `key`, polyfill as much of it as we can. if (nativeEvent.type === 'keypress') { var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can // thus be captured by `keypress`, no other non-printable key should. return charCode === 13 ? 'Enter' : String.fromCharCode(charCode); } if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') { // While user keyboard layout determines the actual meaning of each // `keyCode` value, almost all function keys have a universal value. return translateToKey[nativeEvent.keyCode] || 'Unidentified'; } return ''; } /** * Translation from modifier key to the associated property in the event. * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers */ var modifierKeyToProp = { Alt: 'altKey', Control: 'ctrlKey', Meta: 'metaKey', Shift: 'shiftKey' }; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support // getModifierState. If getModifierState is not supported, we map it to a set of // modifier keys exposed by the event. In this case, Lock-keys are not supported. function modifierStateGetter(keyArg) { var syntheticEvent = this; var nativeEvent = syntheticEvent.nativeEvent; if (nativeEvent.getModifierState) { return nativeEvent.getModifierState(keyArg); } var keyProp = modifierKeyToProp[keyArg]; return keyProp ? !!nativeEvent[keyProp] : false; } function getEventModifierState(nativeEvent) { return modifierStateGetter; } /** * @interface KeyboardEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var KeyboardEventInterface = assign({}, UIEventInterface, { key: getEventKey, code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: getEventModifierState, // Legacy Interface charCode: function (event) { // `charCode` is the result of a KeyPress event and represents the value of // the actual printable character. // KeyPress is deprecated, but its replacement is not yet final and not // implemented in any major browser. Only KeyPress has charCode. if (event.type === 'keypress') { return getEventCharCode(event); } return 0; }, keyCode: function (event) { // `keyCode` is the result of a KeyDown/Up event and represents the value of // physical keyboard key. // The actual meaning of the value depends on the users' keyboard layout // which cannot be detected. Assuming that it is a US keyboard layout // provides a surprisingly accurate mapping for US and European users. // Due to this, it is left to the user to implement at this time. if (event.type === 'keydown' || event.type === 'keyup') { return event.keyCode; } return 0; }, which: function (event) { // `which` is an alias for either `keyCode` or `charCode` depending on the // type of the event. if (event.type === 'keypress') { return getEventCharCode(event); } if (event.type === 'keydown' || event.type === 'keyup') { return event.keyCode; } return 0; } }); var SyntheticKeyboardEvent = createSyntheticEvent(KeyboardEventInterface); /** * @interface PointerEvent * @see http://www.w3.org/TR/pointerevents/ */ var PointerEventInterface = assign({}, MouseEventInterface, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, pointerType: 0, isPrimary: 0 }); var SyntheticPointerEvent = createSyntheticEvent(PointerEventInterface); /** * @interface TouchEvent * @see http://www.w3.org/TR/touch-events/ */ var TouchEventInterface = assign({}, UIEventInterface, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, shiftKey: 0, getModifierState: getEventModifierState }); var SyntheticTouchEvent = createSyntheticEvent(TouchEventInterface); /** * @interface Event * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events- * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent */ var TransitionEventInterface = assign({}, EventInterface, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }); var SyntheticTransitionEvent = createSyntheticEvent(TransitionEventInterface); /** * @interface WheelEvent * @see http://www.w3.org/TR/DOM-Level-3-Events/ */ var WheelEventInterface = assign({}, MouseEventInterface, { deltaX: function (event) { return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive). 'wheelDeltaX' in event ? -event.wheelDeltaX : 0; }, deltaY: function (event) { return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive). 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive). 'wheelDelta' in event ? -event.wheelDelta : 0; }, deltaZ: 0, // Browsers without "deltaMode" is reporting in raw wheel delta where one // notch on the scroll is always +/- 120, roughly equivalent to pixels. // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size. deltaMode: 0 }); var SyntheticWheelEvent = createSyntheticEvent(WheelEventInterface); var END_KEYCODES = [9, 13, 27, 32]; // Tab, Return, Esc, Space var START_KEYCODE = 229; var canUseCompositionEvent = canUseDOM && 'CompositionEvent' in window; var documentMode = null; if (canUseDOM && 'documentMode' in document) { documentMode = document.documentMode; } // Webkit offers a very useful `textInput` event that can be used to // directly represent `beforeInput`. The IE `textinput` event is not as // useful, so we don't use it. var canUseTextInputEvent = canUseDOM && 'TextEvent' in window && !documentMode; // In IE9+, we have access to composition events, but the data supplied // by the native compositionend event may be incorrect. Japanese ideographic // spaces, for instance (\u3000) are not recorded correctly. var useFallbackCompositionData = canUseDOM && (!canUseCompositionEvent || documentMode && documentMode > 8 && documentMode <= 11); var SPACEBAR_CODE = 32; var SPACEBAR_CHAR = String.fromCharCode(SPACEBAR_CODE); function registerEvents() { registerTwoPhaseEvent('onBeforeInput', ['compositionend', 'keypress', 'textInput', 'paste']); registerTwoPhaseEvent('onCompositionEnd', ['compositionend', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']); registerTwoPhaseEvent('onCompositionStart', ['compositionstart', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']); registerTwoPhaseEvent('onCompositionUpdate', ['compositionupdate', 'focusout', 'keydown', 'keypress', 'keyup', 'mousedown']); } // Track whether we've ever handled a keypress on the space key. var hasSpaceKeypress = false; /** * Return whether a native keypress event is assumed to be a command. * This is required because Firefox fires `keypress` events for key commands * (cut, copy, select-all, etc.) even though no character is inserted. */ function isKeypressCommand(nativeEvent) { return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && // ctrlKey && altKey is equivalent to AltGr, and is not a command. !(nativeEvent.ctrlKey && nativeEvent.altKey); } /** * Translate native top level events into event types. */ function getCompositionEventType(domEventName) { switch (domEventName) { case 'compositionstart': return 'onCompositionStart'; case 'compositionend': return 'onCompositionEnd'; case 'compositionupdate': return 'onCompositionUpdate'; } } /** * Does our fallback best-guess model think this event signifies that * composition has begun? */ function isFallbackCompositionStart(domEventName, nativeEvent) { return domEventName === 'keydown' && nativeEvent.keyCode === START_KEYCODE; } /** * Does our fallback mode think that this event is the end of composition? */ function isFallbackCompositionEnd(domEventName, nativeEvent) { switch (domEventName) { case 'keyup': // Command keys insert or clear IME input. return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; case 'keydown': // Expect IME keyCode on each keydown. If we get any other // code we must have exited earlier. return nativeEvent.keyCode !== START_KEYCODE; case 'keypress': case 'mousedown': case 'focusout': // Events are not possible without cancelling IME. return true; default: return false; } } /** * Google Input Tools provides composition data via a CustomEvent, * with the `data` property populated in the `detail` object. If this * is available on the event object, use it. If not, this is a plain * composition event and we have nothing special to extract. * * @param {object} nativeEvent * @return {?string} */ function getDataFromCustomEvent(nativeEvent) { var detail = nativeEvent.detail; if (typeof detail === 'object' && 'data' in detail) { return detail.data; } return null; } /** * Check if a composition event was triggered by Korean IME. * Our fallback mode does not work well with IE's Korean IME, * so just use native composition events when Korean IME is used. * Although CompositionEvent.locale property is deprecated, * it is available in IE, where our fallback mode is enabled. * * @param {object} nativeEvent * @return {boolean} */ function isUsingKoreanIME(nativeEvent) { return nativeEvent.locale === 'ko'; } // Track the current IME composition status, if any. var isComposing = false; /** * @return {?object} A SyntheticCompositionEvent. */ function extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) { var eventType; var fallbackData; if (canUseCompositionEvent) { eventType = getCompositionEventType(domEventName); } else if (!isComposing) { if (isFallbackCompositionStart(domEventName, nativeEvent)) { eventType = 'onCompositionStart'; } } else if (isFallbackCompositionEnd(domEventName, nativeEvent)) { eventType = 'onCompositionEnd'; } if (!eventType) { return null; } if (useFallbackCompositionData && !isUsingKoreanIME(nativeEvent)) { // The current composition is stored statically and must not be // overwritten while composition continues. if (!isComposing && eventType === 'onCompositionStart') { isComposing = initialize(nativeEventTarget); } else if (eventType === 'onCompositionEnd') { if (isComposing) { fallbackData = getData(); } } } var listeners = accumulateTwoPhaseListeners(targetInst, eventType); if (listeners.length > 0) { var event = new SyntheticCompositionEvent(eventType, domEventName, null, nativeEvent, nativeEventTarget); dispatchQueue.push({ event: event, listeners: listeners }); if (fallbackData) { // Inject data generated from fallback path into the synthetic event. // This matches the property of native CompositionEventInterface. event.data = fallbackData; } else { var customData = getDataFromCustomEvent(nativeEvent); if (customData !== null) { event.data = customData; } } } } function getNativeBeforeInputChars(domEventName, nativeEvent) { switch (domEventName) { case 'compositionend': return getDataFromCustomEvent(nativeEvent); case 'keypress': /** * If native `textInput` events are available, our goal is to make * use of them. However, there is a special case: the spacebar key. * In Webkit, preventing default on a spacebar `textInput` event * cancels character insertion, but it *also* causes the browser * to fall back to its default spacebar behavior of scrolling the * page. * * Tracking at: * https://code.google.com/p/chromium/issues/detail?id=355103 * * To avoid this issue, use the keypress event as if no `textInput` * event is available. */ var which = nativeEvent.which; if (which !== SPACEBAR_CODE) { return null; } hasSpaceKeypress = true; return SPACEBAR_CHAR; case 'textInput': // Record the characters to be added to the DOM. var chars = nativeEvent.data; // If it's a spacebar character, assume that we have already handled // it at the keypress level and bail immediately. Android Chrome // doesn't give us keycodes, so we need to ignore it. if (chars === SPACEBAR_CHAR && hasSpaceKeypress) { return null; } return chars; default: // For other native event types, do nothing. return null; } } /** * For browsers that do not provide the `textInput` event, extract the * appropriate string to use for SyntheticInputEvent. */ function getFallbackBeforeInputChars(domEventName, nativeEvent) { // If we are currently composing (IME) and using a fallback to do so, // try to extract the composed characters from the fallback object. // If composition event is available, we extract a string only at // compositionevent, otherwise extract it at fallback events. if (isComposing) { if (domEventName === 'compositionend' || !canUseCompositionEvent && isFallbackCompositionEnd(domEventName, nativeEvent)) { var chars = getData(); reset(); isComposing = false; return chars; } return null; } switch (domEventName) { case 'paste': // If a paste event occurs after a keypress, throw out the input // chars. Paste events should not lead to BeforeInput events. return null; case 'keypress': /** * As of v27, Firefox may fire keypress events even when no character * will be inserted. A few possibilities: * * - `which` is `0`. Arrow keys, Esc key, etc. * * - `which` is the pressed key code, but no char is available. * Ex: 'AltGr + d` in Polish. There is no modified character for * this key combination and no character is inserted into the * document, but FF fires the keypress for char code `100` anyway. * No `input` event will occur. * * - `which` is the pressed key code, but a command combination is * being used. Ex: `Cmd+C`. No character is inserted, and no * `input` event will occur. */ if (!isKeypressCommand(nativeEvent)) { // IE fires the `keypress` event when a user types an emoji via // Touch keyboard of Windows. In such a case, the `char` property // holds an emoji character like `\uD83D\uDE0A`. Because its length // is 2, the property `which` does not represent an emoji correctly. // In such a case, we directly return the `char` property instead of // using `which`. if (nativeEvent.char && nativeEvent.char.length > 1) { return nativeEvent.char; } else if (nativeEvent.which) { return String.fromCharCode(nativeEvent.which); } } return null; case 'compositionend': return useFallbackCompositionData && !isUsingKoreanIME(nativeEvent) ? null : nativeEvent.data; default: return null; } } /** * Extract a SyntheticInputEvent for `beforeInput`, based on either native * `textInput` or fallback behavior. * * @return {?object} A SyntheticInputEvent. */ function extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget) { var chars; if (canUseTextInputEvent) { chars = getNativeBeforeInputChars(domEventName, nativeEvent); } else { chars = getFallbackBeforeInputChars(domEventName, nativeEvent); } // If no characters are being inserted, no BeforeInput event should // be fired. if (!chars) { return null; } var listeners = accumulateTwoPhaseListeners(targetInst, 'onBeforeInput'); if (listeners.length > 0) { var event = new SyntheticInputEvent('onBeforeInput', 'beforeinput', null, nativeEvent, nativeEventTarget); dispatchQueue.push({ event: event, listeners: listeners }); event.data = chars; } } /** * Create an `onBeforeInput` event to match * http://www.w3.org/TR/2013/WD-DOM-Level-3-Events-20131105/#events-inputevents. * * This event plugin is based on the native `textInput` event * available in Chrome, Safari, Opera, and IE. This event fires after * `onKeyPress` and `onCompositionEnd`, but before `onInput`. * * `beforeInput` is spec'd but not implemented in any browsers, and * the `input` event does not provide any useful information about what has * actually been added, contrary to the spec. Thus, `textInput` is the best * available event to identify the characters that have actually been inserted * into the target node. * * This plugin is also responsible for emitting `composition` events, thus * allowing us to share composition fallback code for both `beforeInput` and * `composition` event types. */ function extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { extractCompositionEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); extractBeforeInputEvent(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); } /** * @see http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary */ var supportedInputTypes = { color: true, date: true, datetime: true, 'datetime-local': true, email: true, month: true, number: true, password: true, range: true, search: true, tel: true, text: true, time: true, url: true, week: true }; function isTextInputElement(elem) { var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); if (nodeName === 'input') { return !!supportedInputTypes[elem.type]; } if (nodeName === 'textarea') { return true; } return false; } /** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, * `reset`, `load`, `error`, and `select`. * * Borrows from Modernizr. * * @param {string} eventNameSuffix Event name, e.g. "click". * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT */ function isEventSupported(eventNameSuffix) { if (!canUseDOM) { return false; } var eventName = 'on' + eventNameSuffix; var isSupported = (eventName in document); if (!isSupported) { var element = document.createElement('div'); element.setAttribute(eventName, 'return;'); isSupported = typeof element[eventName] === 'function'; } return isSupported; } function registerEvents$1() { registerTwoPhaseEvent('onChange', ['change', 'click', 'focusin', 'focusout', 'input', 'keydown', 'keyup', 'selectionchange']); } function createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, target) { // Flag this event loop as needing state restore. enqueueStateRestore(target); var listeners = accumulateTwoPhaseListeners(inst, 'onChange'); if (listeners.length > 0) { var event = new SyntheticEvent('onChange', 'change', null, nativeEvent, target); dispatchQueue.push({ event: event, listeners: listeners }); } } /** * For IE shims */ var activeElement = null; var activeElementInst = null; /** * SECTION: handle `change` event */ function shouldUseChangeEvent(elem) { var nodeName = elem.nodeName && elem.nodeName.toLowerCase(); return nodeName === 'select' || nodeName === 'input' && elem.type === 'file'; } function manualDispatchChangeEvent(nativeEvent) { var dispatchQueue = []; createAndAccumulateChangeEvent(dispatchQueue, activeElementInst, nativeEvent, getEventTarget(nativeEvent)); // If change and propertychange bubbled, we'd just bind to it like all the // other events and have it go through ReactBrowserEventEmitter. Since it // doesn't, we manually listen for the events and so we have to enqueue and // process the abstract event manually. // // Batching is necessary here in order to ensure that all event handlers run // before the next rerender (including event handlers attached to ancestor // elements instead of directly on the input). Without this, controlled // components don't work properly in conjunction with event bubbling because // the component is rerendered and the value reverted before all the event // handlers can run. See https://github.com/facebook/react/issues/708. batchedUpdates(runEventInBatch, dispatchQueue); } function runEventInBatch(dispatchQueue) { processDispatchQueue(dispatchQueue, 0); } function getInstIfValueChanged(targetInst) { var targetNode = getNodeFromInstance(targetInst); if (updateValueIfChanged(targetNode)) { return targetInst; } } function getTargetInstForChangeEvent(domEventName, targetInst) { if (domEventName === 'change') { return targetInst; } } /** * SECTION: handle `input` event */ var isInputEventSupported = false; if (canUseDOM) { // IE9 claims to support the input event but fails to trigger it when // deleting text, so we ignore its input events. isInputEventSupported = isEventSupported('input') && (!document.documentMode || document.documentMode > 9); } /** * (For IE <=9) Starts tracking propertychange events on the passed-in element * and override the value property so that we can distinguish user events from * value changes in JS. */ function startWatchingForValueChange(target, targetInst) { activeElement = target; activeElementInst = targetInst; activeElement.attachEvent('onpropertychange', handlePropertyChange); } /** * (For IE <=9) Removes the event listeners from the currently-tracked element, * if any exists. */ function stopWatchingForValueChange() { if (!activeElement) { return; } activeElement.detachEvent('onpropertychange', handlePropertyChange); activeElement = null; activeElementInst = null; } /** * (For IE <=9) Handles a propertychange event, sending a `change` event if * the value of the active element has changed. */ function handlePropertyChange(nativeEvent) { if (nativeEvent.propertyName !== 'value') { return; } if (getInstIfValueChanged(activeElementInst)) { manualDispatchChangeEvent(nativeEvent); } } function handleEventsForInputEventPolyfill(domEventName, target, targetInst) { if (domEventName === 'focusin') { // In IE9, propertychange fires for most input events but is buggy and // doesn't fire when text is deleted, but conveniently, selectionchange // appears to fire in all of the remaining cases so we catch those and // forward the event if the value has changed // In either case, we don't want to call the event handler if the value // is changed from JS so we redefine a setter for `.value` that updates // our activeElementValue variable, allowing us to ignore those changes // // stopWatching() should be a noop here but we call it just in case we // missed a blur event somehow. stopWatchingForValueChange(); startWatchingForValueChange(target, targetInst); } else if (domEventName === 'focusout') { stopWatchingForValueChange(); } } // For IE8 and IE9. function getTargetInstForInputEventPolyfill(domEventName, targetInst) { if (domEventName === 'selectionchange' || domEventName === 'keyup' || domEventName === 'keydown') { // On the selectionchange event, the target is just document which isn't // helpful for us so just check activeElement instead. // // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire // propertychange on the first input event after setting `value` from a // script and fires only keydown, keypress, keyup. Catching keyup usually // gets it and catching keydown lets us fire an event for the first // keystroke if user does a key repeat (it'll be a little delayed: right // before the second keystroke). Other input methods (e.g., paste) seem to // fire selectionchange normally. return getInstIfValueChanged(activeElementInst); } } /** * SECTION: handle `click` event */ function shouldUseClickEvent(elem) { // Use the `click` event to detect changes to checkbox and radio inputs. // This approach works across all browsers, whereas `change` does not fire // until `blur` in IE8. var nodeName = elem.nodeName; return nodeName && nodeName.toLowerCase() === 'input' && (elem.type === 'checkbox' || elem.type === 'radio'); } function getTargetInstForClickEvent(domEventName, targetInst) { if (domEventName === 'click') { return getInstIfValueChanged(targetInst); } } function getTargetInstForInputOrChangeEvent(domEventName, targetInst) { if (domEventName === 'input' || domEventName === 'change') { return getInstIfValueChanged(targetInst); } } function handleControlledInputBlur(node) { var state = node._wrapperState; if (!state || !state.controlled || node.type !== 'number') { return; } { // If controlled, assign the value attribute to the current value on blur setDefaultValue(node, 'number', node.value); } } /** * This plugin creates an `onChange` event that normalizes change events * across form elements. This event fires at a time when it's possible to * change the element's value without seeing a flicker. * * Supported elements are: * - input (see `isTextInputElement`) * - textarea * - select */ function extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { var targetNode = targetInst ? getNodeFromInstance(targetInst) : window; var getTargetInstFunc, handleEventFunc; if (shouldUseChangeEvent(targetNode)) { getTargetInstFunc = getTargetInstForChangeEvent; } else if (isTextInputElement(targetNode)) { if (isInputEventSupported) { getTargetInstFunc = getTargetInstForInputOrChangeEvent; } else { getTargetInstFunc = getTargetInstForInputEventPolyfill; handleEventFunc = handleEventsForInputEventPolyfill; } } else if (shouldUseClickEvent(targetNode)) { getTargetInstFunc = getTargetInstForClickEvent; } if (getTargetInstFunc) { var inst = getTargetInstFunc(domEventName, targetInst); if (inst) { createAndAccumulateChangeEvent(dispatchQueue, inst, nativeEvent, nativeEventTarget); return; } } if (handleEventFunc) { handleEventFunc(domEventName, targetNode, targetInst); } // When blurring, set the value attribute for number inputs if (domEventName === 'focusout') { handleControlledInputBlur(targetNode); } } function registerEvents$2() { registerDirectEvent('onMouseEnter', ['mouseout', 'mouseover']); registerDirectEvent('onMouseLeave', ['mouseout', 'mouseover']); registerDirectEvent('onPointerEnter', ['pointerout', 'pointerover']); registerDirectEvent('onPointerLeave', ['pointerout', 'pointerover']); } /** * For almost every interaction we care about, there will be both a top-level * `mouseover` and `mouseout` event that occurs. Only use `mouseout` so that * we do not extract duplicate events. However, moving the mouse into the * browser from outside will not fire a `mouseout` event. In this case, we use * the `mouseover` top-level event. */ function extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { var isOverEvent = domEventName === 'mouseover' || domEventName === 'pointerover'; var isOutEvent = domEventName === 'mouseout' || domEventName === 'pointerout'; if (isOverEvent && !isReplayingEvent(nativeEvent)) { // If this is an over event with a target, we might have already dispatched // the event in the out event of the other target. If this is replayed, // then it's because we couldn't dispatch against this target previously // so we have to do it now instead. var related = nativeEvent.relatedTarget || nativeEvent.fromElement; if (related) { // If the related node is managed by React, we can assume that we have // already dispatched the corresponding events during its mouseout. if (getClosestInstanceFromNode(related) || isContainerMarkedAsRoot(related)) { return; } } } if (!isOutEvent && !isOverEvent) { // Must not be a mouse or pointer in or out - ignoring. return; } var win; // TODO: why is this nullable in the types but we read from it? if (nativeEventTarget.window === nativeEventTarget) { // `nativeEventTarget` is probably a window object. win = nativeEventTarget; } else { // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8. var doc = nativeEventTarget.ownerDocument; if (doc) { win = doc.defaultView || doc.parentWindow; } else { win = window; } } var from; var to; if (isOutEvent) { var _related = nativeEvent.relatedTarget || nativeEvent.toElement; from = targetInst; to = _related ? getClosestInstanceFromNode(_related) : null; if (to !== null) { var nearestMounted = getNearestMountedFiber(to); if (to !== nearestMounted || to.tag !== HostComponent && to.tag !== HostText) { to = null; } } } else { // Moving to a node from outside the window. from = null; to = targetInst; } if (from === to) { // Nothing pertains to our managed components. return; } var SyntheticEventCtor = SyntheticMouseEvent; var leaveEventType = 'onMouseLeave'; var enterEventType = 'onMouseEnter'; var eventTypePrefix = 'mouse'; if (domEventName === 'pointerout' || domEventName === 'pointerover') { SyntheticEventCtor = SyntheticPointerEvent; leaveEventType = 'onPointerLeave'; enterEventType = 'onPointerEnter'; eventTypePrefix = 'pointer'; } var fromNode = from == null ? win : getNodeFromInstance(from); var toNode = to == null ? win : getNodeFromInstance(to); var leave = new SyntheticEventCtor(leaveEventType, eventTypePrefix + 'leave', from, nativeEvent, nativeEventTarget); leave.target = fromNode; leave.relatedTarget = toNode; var enter = null; // We should only process this nativeEvent if we are processing // the first ancestor. Next time, we will ignore the event. var nativeTargetInst = getClosestInstanceFromNode(nativeEventTarget); if (nativeTargetInst === targetInst) { var enterEvent = new SyntheticEventCtor(enterEventType, eventTypePrefix + 'enter', to, nativeEvent, nativeEventTarget); enterEvent.target = toNode; enterEvent.relatedTarget = fromNode; enter = enterEvent; } accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leave, enter, from, to); } /** * inlined Object.is polyfill to avoid requiring consumers ship their own * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is */ function is(x, y) { return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare ; } var objectIs = typeof Object.is === 'function' ? Object.is : is; /** * Performs equality by iterating through keys on an object and returning false * when any key has values which are not strictly equal between the arguments. * Returns true when the values of all keys are strictly equal. */ function shallowEqual(objA, objB) { if (objectIs(objA, objB)) { return true; } if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) { return false; } var keysA = Object.keys(objA); var keysB = Object.keys(objB); if (keysA.length !== keysB.length) { return false; } // Test for A's keys different from B. for (var i = 0; i < keysA.length; i++) { var currentKey = keysA[i]; if (!hasOwnProperty.call(objB, currentKey) || !objectIs(objA[currentKey], objB[currentKey])) { return false; } } return true; } /** * Given any node return the first leaf node without children. * * @param {DOMElement|DOMTextNode} node * @return {DOMElement|DOMTextNode} */ function getLeafNode(node) { while (node && node.firstChild) { node = node.firstChild; } return node; } /** * Get the next sibling within a container. This will walk up the * DOM if a node's siblings have been exhausted. * * @param {DOMElement|DOMTextNode} node * @return {?DOMElement|DOMTextNode} */ function getSiblingNode(node) { while (node) { if (node.nextSibling) { return node.nextSibling; } node = node.parentNode; } } /** * Get object describing the nodes which contain characters at offset. * * @param {DOMElement|DOMTextNode} root * @param {number} offset * @return {?object} */ function getNodeForCharacterOffset(root, offset) { var node = getLeafNode(root); var nodeStart = 0; var nodeEnd = 0; while (node) { if (node.nodeType === TEXT_NODE) { nodeEnd = nodeStart + node.textContent.length; if (nodeStart <= offset && nodeEnd >= offset) { return { node: node, offset: offset - nodeStart }; } nodeStart = nodeEnd; } node = getLeafNode(getSiblingNode(node)); } } /** * @param {DOMElement} outerNode * @return {?object} */ function getOffsets(outerNode) { var ownerDocument = outerNode.ownerDocument; var win = ownerDocument && ownerDocument.defaultView || window; var selection = win.getSelection && win.getSelection(); if (!selection || selection.rangeCount === 0) { return null; } var anchorNode = selection.anchorNode, anchorOffset = selection.anchorOffset, focusNode = selection.focusNode, focusOffset = selection.focusOffset; // In Firefox, anchorNode and focusNode can be "anonymous divs", e.g. the // up/down buttons on an <input type="number">. Anonymous divs do not seem to // expose properties, triggering a "Permission denied error" if any of its // properties are accessed. The only seemingly possible way to avoid erroring // is to access a property that typically works for non-anonymous divs and // catch any error that may otherwise arise. See // https://bugzilla.mozilla.org/show_bug.cgi?id=208427 try { /* eslint-disable no-unused-expressions */ anchorNode.nodeType; focusNode.nodeType; /* eslint-enable no-unused-expressions */ } catch (e) { return null; } return getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset); } /** * Returns {start, end} where `start` is the character/codepoint index of * (anchorNode, anchorOffset) within the textContent of `outerNode`, and * `end` is the index of (focusNode, focusOffset). * * Returns null if you pass in garbage input but we should probably just crash. * * Exported only for testing. */ function getModernOffsetsFromPoints(outerNode, anchorNode, anchorOffset, focusNode, focusOffset) { var length = 0; var start = -1; var end = -1; var indexWithinAnchor = 0; var indexWithinFocus = 0; var node = outerNode; var parentNode = null; outer: while (true) { var next = null; while (true) { if (node === anchorNode && (anchorOffset === 0 || node.nodeType === TEXT_NODE)) { start = length + anchorOffset; } if (node === focusNode && (focusOffset === 0 || node.nodeType === TEXT_NODE)) { end = length + focusOffset; } if (node.nodeType === TEXT_NODE) { length += node.nodeValue.length; } if ((next = node.firstChild) === null) { break; } // Moving from `node` to its first child `next`. parentNode = node; node = next; } while (true) { if (node === outerNode) { // If `outerNode` has children, this is always the second time visiting // it. If it has no children, this is still the first loop, and the only // valid selection is anchorNode and focusNode both equal to this node // and both offsets 0, in which case we will have handled above. break outer; } if (parentNode === anchorNode && ++indexWithinAnchor === anchorOffset) { start = length; } if (parentNode === focusNode && ++indexWithinFocus === focusOffset) { end = length; } if ((next = node.nextSibling) !== null) { break; } node = parentNode; parentNode = node.parentNode; } // Moving from `node` to its next sibling `next`. node = next; } if (start === -1 || end === -1) { // This should never happen. (Would happen if the anchor/focus nodes aren't // actually inside the passed-in node.) return null; } return { start: start, end: end }; } /** * In modern non-IE browsers, we can support both forward and backward * selections. * * Note: IE10+ supports the Selection object, but it does not support * the `extend` method, which means that even in modern IE, it's not possible * to programmatically create a backward selection. Thus, for all IE * versions, we use the old IE API to create our selections. * * @param {DOMElement|DOMTextNode} node * @param {object} offsets */ function setOffsets(node, offsets) { var doc = node.ownerDocument || document; var win = doc && doc.defaultView || window; // Edge fails with "Object expected" in some scenarios. // (For instance: TinyMCE editor used in a list component that supports pasting to add more, // fails when pasting 100+ items) if (!win.getSelection) { return; } var selection = win.getSelection(); var length = node.textContent.length; var start = Math.min(offsets.start, length); var end = offsets.end === undefined ? start : Math.min(offsets.end, length); // IE 11 uses modern selection, but doesn't support the extend method. // Flip backward selections, so we can set with a single range. if (!selection.extend && start > end) { var temp = end; end = start; start = temp; } var startMarker = getNodeForCharacterOffset(node, start); var endMarker = getNodeForCharacterOffset(node, end); if (startMarker && endMarker) { if (selection.rangeCount === 1 && selection.anchorNode === startMarker.node && selection.anchorOffset === startMarker.offset && selection.focusNode === endMarker.node && selection.focusOffset === endMarker.offset) { return; } var range = doc.createRange(); range.setStart(startMarker.node, startMarker.offset); selection.removeAllRanges(); if (start > end) { selection.addRange(range); selection.extend(endMarker.node, endMarker.offset); } else { range.setEnd(endMarker.node, endMarker.offset); selection.addRange(range); } } } function isTextNode(node) { return node && node.nodeType === TEXT_NODE; } function containsNode(outerNode, innerNode) { if (!outerNode || !innerNode) { return false; } else if (outerNode === innerNode) { return true; } else if (isTextNode(outerNode)) { return false; } else if (isTextNode(innerNode)) { return containsNode(outerNode, innerNode.parentNode); } else if ('contains' in outerNode) { return outerNode.contains(innerNode); } else if (outerNode.compareDocumentPosition) { return !!(outerNode.compareDocumentPosition(innerNode) & 16); } else { return false; } } function isInDocument(node) { return node && node.ownerDocument && containsNode(node.ownerDocument.documentElement, node); } function isSameOriginFrame(iframe) { try { // Accessing the contentDocument of a HTMLIframeElement can cause the browser // to throw, e.g. if it has a cross-origin src attribute. // Safari will show an error in the console when the access results in "Blocked a frame with origin". e.g: // iframe.contentDocument.defaultView; // A safety way is to access one of the cross origin properties: Window or Location // Which might result in "SecurityError" DOM Exception and it is compatible to Safari. // https://html.spec.whatwg.org/multipage/browsers.html#integration-with-idl return typeof iframe.contentWindow.location.href === 'string'; } catch (err) { return false; } } function getActiveElementDeep() { var win = window; var element = getActiveElement(); while (element instanceof win.HTMLIFrameElement) { if (isSameOriginFrame(element)) { win = element.contentWindow; } else { return element; } element = getActiveElement(win.document); } return element; } /** * @ReactInputSelection: React input selection module. Based on Selection.js, * but modified to be suitable for react and has a couple of bug fixes (doesn't * assume buttons have range selections allowed). * Input selection module for React. */ /** * @hasSelectionCapabilities: we get the element types that support selection * from https://html.spec.whatwg.org/#do-not-apply, looking at `selectionStart` * and `selectionEnd` rows. */ function hasSelectionCapabilities(elem) { var nodeName = elem && elem.nodeName && elem.nodeName.toLowerCase(); return nodeName && (nodeName === 'input' && (elem.type === 'text' || elem.type === 'search' || elem.type === 'tel' || elem.type === 'url' || elem.type === 'password') || nodeName === 'textarea' || elem.contentEditable === 'true'); } function getSelectionInformation() { var focusedElem = getActiveElementDeep(); return { focusedElem: focusedElem, selectionRange: hasSelectionCapabilities(focusedElem) ? getSelection(focusedElem) : null }; } /** * @restoreSelection: If any selection information was potentially lost, * restore it. This is useful when performing operations that could remove dom * nodes and place them back in, resulting in focus being lost. */ function restoreSelection(priorSelectionInformation) { var curFocusedElem = getActiveElementDeep(); var priorFocusedElem = priorSelectionInformation.focusedElem; var priorSelectionRange = priorSelectionInformation.selectionRange; if (curFocusedElem !== priorFocusedElem && isInDocument(priorFocusedElem)) { if (priorSelectionRange !== null && hasSelectionCapabilities(priorFocusedElem)) { setSelection(priorFocusedElem, priorSelectionRange); } // Focusing a node can change the scroll position, which is undesirable var ancestors = []; var ancestor = priorFocusedElem; while (ancestor = ancestor.parentNode) { if (ancestor.nodeType === ELEMENT_NODE) { ancestors.push({ element: ancestor, left: ancestor.scrollLeft, top: ancestor.scrollTop }); } } if (typeof priorFocusedElem.focus === 'function') { priorFocusedElem.focus(); } for (var i = 0; i < ancestors.length; i++) { var info = ancestors[i]; info.element.scrollLeft = info.left; info.element.scrollTop = info.top; } } } /** * @getSelection: Gets the selection bounds of a focused textarea, input or * contentEditable node. * -@input: Look up selection bounds of this input * -@return {start: selectionStart, end: selectionEnd} */ function getSelection(input) { var selection; if ('selectionStart' in input) { // Modern browser with input or textarea. selection = { start: input.selectionStart, end: input.selectionEnd }; } else { // Content editable or old IE textarea. selection = getOffsets(input); } return selection || { start: 0, end: 0 }; } /** * @setSelection: Sets the selection bounds of a textarea or input and focuses * the input. * -@input Set selection bounds of this input or textarea * -@offsets Object of same form that is returned from get* */ function setSelection(input, offsets) { var start = offsets.start; var end = offsets.end; if (end === undefined) { end = start; } if ('selectionStart' in input) { input.selectionStart = start; input.selectionEnd = Math.min(end, input.value.length); } else { setOffsets(input, offsets); } } var skipSelectionChangeEvent = canUseDOM && 'documentMode' in document && document.documentMode <= 11; function registerEvents$3() { registerTwoPhaseEvent('onSelect', ['focusout', 'contextmenu', 'dragend', 'focusin', 'keydown', 'keyup', 'mousedown', 'mouseup', 'selectionchange']); } var activeElement$1 = null; var activeElementInst$1 = null; var lastSelection = null; var mouseDown = false; /** * Get an object which is a unique representation of the current selection. * * The return value will not be consistent across nodes or browsers, but * two identical selections on the same node will return identical objects. */ function getSelection$1(node) { if ('selectionStart' in node && hasSelectionCapabilities(node)) { return { start: node.selectionStart, end: node.selectionEnd }; } else { var win = node.ownerDocument && node.ownerDocument.defaultView || window; var selection = win.getSelection(); return { anchorNode: selection.anchorNode, anchorOffset: selection.anchorOffset, focusNode: selection.focusNode, focusOffset: selection.focusOffset }; } } /** * Get document associated with the event target. */ function getEventTargetDocument(eventTarget) { return eventTarget.window === eventTarget ? eventTarget.document : eventTarget.nodeType === DOCUMENT_NODE ? eventTarget : eventTarget.ownerDocument; } /** * Poll selection to see whether it's changed. * * @param {object} nativeEvent * @param {object} nativeEventTarget * @return {?SyntheticEvent} */ function constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget) { // Ensure we have the right element, and that the user is not dragging a // selection (this matches native `select` event behavior). In HTML5, select // fires only on input and textarea thus if there's no focused element we // won't dispatch. var doc = getEventTargetDocument(nativeEventTarget); if (mouseDown || activeElement$1 == null || activeElement$1 !== getActiveElement(doc)) { return; } // Only fire when selection has actually changed. var currentSelection = getSelection$1(activeElement$1); if (!lastSelection || !shallowEqual(lastSelection, currentSelection)) { lastSelection = currentSelection; var listeners = accumulateTwoPhaseListeners(activeElementInst$1, 'onSelect'); if (listeners.length > 0) { var event = new SyntheticEvent('onSelect', 'select', null, nativeEvent, nativeEventTarget); dispatchQueue.push({ event: event, listeners: listeners }); event.target = activeElement$1; } } } /** * This plugin creates an `onSelect` event that normalizes select events * across form elements. * * Supported elements are: * - input (see `isTextInputElement`) * - textarea * - contentEditable * * This differs from native browser implementations in the following ways: * - Fires on contentEditable fields as well as inputs. * - Fires for collapsed selection. * - Fires after user input. */ function extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { var targetNode = targetInst ? getNodeFromInstance(targetInst) : window; switch (domEventName) { // Track the input node that has focus. case 'focusin': if (isTextInputElement(targetNode) || targetNode.contentEditable === 'true') { activeElement$1 = targetNode; activeElementInst$1 = targetInst; lastSelection = null; } break; case 'focusout': activeElement$1 = null; activeElementInst$1 = null; lastSelection = null; break; // Don't fire the event while the user is dragging. This matches the // semantics of the native select event. case 'mousedown': mouseDown = true; break; case 'contextmenu': case 'mouseup': case 'dragend': mouseDown = false; constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget); break; // Chrome and IE fire non-standard event when selection is changed (and // sometimes when it hasn't). IE's event fires out of order with respect // to key and input events on deletion, so we discard it. // // Firefox doesn't support selectionchange, so check selection status // after each key entry. The selection changes after keydown and before // keyup, but we check on keydown as well in the case of holding down a // key, when multiple keydown events are fired but only one keyup is. // This is also our approach for IE handling, for the reason above. case 'selectionchange': if (skipSelectionChangeEvent) { break; } // falls through case 'keydown': case 'keyup': constructSelectEvent(dispatchQueue, nativeEvent, nativeEventTarget); } } /** * Generate a mapping of standard vendor prefixes using the defined style property and event name. * * @param {string} styleProp * @param {string} eventName * @returns {object} */ function makePrefixMap(styleProp, eventName) { var prefixes = {}; prefixes[styleProp.toLowerCase()] = eventName.toLowerCase(); prefixes['Webkit' + styleProp] = 'webkit' + eventName; prefixes['Moz' + styleProp] = 'moz' + eventName; return prefixes; } /** * A list of event names to a configurable list of vendor prefixes. */ var vendorPrefixes = { animationend: makePrefixMap('Animation', 'AnimationEnd'), animationiteration: makePrefixMap('Animation', 'AnimationIteration'), animationstart: makePrefixMap('Animation', 'AnimationStart'), transitionend: makePrefixMap('Transition', 'TransitionEnd') }; /** * Event names that have already been detected and prefixed (if applicable). */ var prefixedEventNames = {}; /** * Element to check for prefixes on. */ var style = {}; /** * Bootstrap if a DOM exists. */ if (canUseDOM) { style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x, // the un-prefixed "animation" and "transition" properties are defined on the // style object but the events that fire will still be prefixed, so we need // to check if the un-prefixed events are usable, and if not remove them from the map. if (!('AnimationEvent' in window)) { delete vendorPrefixes.animationend.animation; delete vendorPrefixes.animationiteration.animation; delete vendorPrefixes.animationstart.animation; } // Same as above if (!('TransitionEvent' in window)) { delete vendorPrefixes.transitionend.transition; } } /** * Attempts to determine the correct vendor prefixed event name. * * @param {string} eventName * @returns {string} */ function getVendorPrefixedEventName(eventName) { if (prefixedEventNames[eventName]) { return prefixedEventNames[eventName]; } else if (!vendorPrefixes[eventName]) { return eventName; } var prefixMap = vendorPrefixes[eventName]; for (var styleProp in prefixMap) { if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) { return prefixedEventNames[eventName] = prefixMap[styleProp]; } } return eventName; } var ANIMATION_END = getVendorPrefixedEventName('animationend'); var ANIMATION_ITERATION = getVendorPrefixedEventName('animationiteration'); var ANIMATION_START = getVendorPrefixedEventName('animationstart'); var TRANSITION_END = getVendorPrefixedEventName('transitionend'); var topLevelEventsToReactNames = new Map(); // NOTE: Capitalization is important in this list! // // E.g. it needs "pointerDown", not "pointerdown". // This is because we derive both React name ("onPointerDown") // and DOM name ("pointerdown") from the same list. // // Exceptions that don't match this convention are listed separately. // // prettier-ignore var simpleEventPluginEvents = ['abort', 'auxClick', 'cancel', 'canPlay', 'canPlayThrough', 'click', 'close', 'contextMenu', 'copy', 'cut', 'drag', 'dragEnd', 'dragEnter', 'dragExit', 'dragLeave', 'dragOver', 'dragStart', 'drop', 'durationChange', 'emptied', 'encrypted', 'ended', 'error', 'gotPointerCapture', 'input', 'invalid', 'keyDown', 'keyPress', 'keyUp', 'load', 'loadedData', 'loadedMetadata', 'loadStart', 'lostPointerCapture', 'mouseDown', 'mouseMove', 'mouseOut', 'mouseOver', 'mouseUp', 'paste', 'pause', 'play', 'playing', 'pointerCancel', 'pointerDown', 'pointerMove', 'pointerOut', 'pointerOver', 'pointerUp', 'progress', 'rateChange', 'reset', 'resize', 'seeked', 'seeking', 'stalled', 'submit', 'suspend', 'timeUpdate', 'touchCancel', 'touchEnd', 'touchStart', 'volumeChange', 'scroll', 'toggle', 'touchMove', 'waiting', 'wheel']; function registerSimpleEvent(domEventName, reactName) { topLevelEventsToReactNames.set(domEventName, reactName); registerTwoPhaseEvent(reactName, [domEventName]); } function registerSimpleEvents() { for (var i = 0; i < simpleEventPluginEvents.length; i++) { var eventName = simpleEventPluginEvents[i]; var domEventName = eventName.toLowerCase(); var capitalizedEvent = eventName[0].toUpperCase() + eventName.slice(1); registerSimpleEvent(domEventName, 'on' + capitalizedEvent); } // Special cases where event names don't match. registerSimpleEvent(ANIMATION_END, 'onAnimationEnd'); registerSimpleEvent(ANIMATION_ITERATION, 'onAnimationIteration'); registerSimpleEvent(ANIMATION_START, 'onAnimationStart'); registerSimpleEvent('dblclick', 'onDoubleClick'); registerSimpleEvent('focusin', 'onFocus'); registerSimpleEvent('focusout', 'onBlur'); registerSimpleEvent(TRANSITION_END, 'onTransitionEnd'); } function extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { var reactName = topLevelEventsToReactNames.get(domEventName); if (reactName === undefined) { return; } var SyntheticEventCtor = SyntheticEvent; var reactEventType = domEventName; switch (domEventName) { case 'keypress': // Firefox creates a keypress event for function keys too. This removes // the unwanted keypress events. Enter is however both printable and // non-printable. One would expect Tab to be as well (but it isn't). if (getEventCharCode(nativeEvent) === 0) { return; } /* falls through */ case 'keydown': case 'keyup': SyntheticEventCtor = SyntheticKeyboardEvent; break; case 'focusin': reactEventType = 'focus'; SyntheticEventCtor = SyntheticFocusEvent; break; case 'focusout': reactEventType = 'blur'; SyntheticEventCtor = SyntheticFocusEvent; break; case 'beforeblur': case 'afterblur': SyntheticEventCtor = SyntheticFocusEvent; break; case 'click': // Firefox creates a click event on right mouse clicks. This removes the // unwanted click events. if (nativeEvent.button === 2) { return; } /* falls through */ case 'auxclick': case 'dblclick': case 'mousedown': case 'mousemove': case 'mouseup': // TODO: Disabled elements should not respond to mouse events /* falls through */ case 'mouseout': case 'mouseover': case 'contextmenu': SyntheticEventCtor = SyntheticMouseEvent; break; case 'drag': case 'dragend': case 'dragenter': case 'dragexit': case 'dragleave': case 'dragover': case 'dragstart': case 'drop': SyntheticEventCtor = SyntheticDragEvent; break; case 'touchcancel': case 'touchend': case 'touchmove': case 'touchstart': SyntheticEventCtor = SyntheticTouchEvent; break; case ANIMATION_END: case ANIMATION_ITERATION: case ANIMATION_START: SyntheticEventCtor = SyntheticAnimationEvent; break; case TRANSITION_END: SyntheticEventCtor = SyntheticTransitionEvent; break; case 'scroll': SyntheticEventCtor = SyntheticUIEvent; break; case 'wheel': SyntheticEventCtor = SyntheticWheelEvent; break; case 'copy': case 'cut': case 'paste': SyntheticEventCtor = SyntheticClipboardEvent; break; case 'gotpointercapture': case 'lostpointercapture': case 'pointercancel': case 'pointerdown': case 'pointermove': case 'pointerout': case 'pointerover': case 'pointerup': SyntheticEventCtor = SyntheticPointerEvent; break; } var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0; { // Some events don't bubble in the browser. // In the past, React has always bubbled them, but this can be surprising. // We're going to try aligning closer to the browser behavior by not bubbling // them in React either. We'll start by not bubbling onScroll, and then expand. var accumulateTargetOnly = !inCapturePhase && // TODO: ideally, we'd eventually add all events from // nonDelegatedEvents list in DOMPluginEventSystem. // Then we can remove this special list. // This is a breaking change that can wait until React 18. domEventName === 'scroll'; var _listeners = accumulateSinglePhaseListeners(targetInst, reactName, nativeEvent.type, inCapturePhase, accumulateTargetOnly); if (_listeners.length > 0) { // Intentionally create event lazily. var _event = new SyntheticEventCtor(reactName, reactEventType, null, nativeEvent, nativeEventTarget); dispatchQueue.push({ event: _event, listeners: _listeners }); } } } // TODO: remove top-level side effect. registerSimpleEvents(); registerEvents$2(); registerEvents$1(); registerEvents$3(); registerEvents(); function extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags, targetContainer) { // TODO: we should remove the concept of a "SimpleEventPlugin". // This is the basic functionality of the event system. All // the other plugins are essentially polyfills. So the plugin // should probably be inlined somewhere and have its logic // be core the to event system. This would potentially allow // us to ship builds of React without the polyfilled plugins below. extractEvents$4(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); var shouldProcessPolyfillPlugins = (eventSystemFlags & SHOULD_NOT_PROCESS_POLYFILL_EVENT_PLUGINS) === 0; // We don't process these events unless we are in the // event's native "bubble" phase, which means that we're // not in the capture phase. That's because we emulate // the capture phase here still. This is a trade-off, // because in an ideal world we would not emulate and use // the phases properly, like we do with the SimpleEvent // plugin. However, the plugins below either expect // emulation (EnterLeave) or use state localized to that // plugin (BeforeInput, Change, Select). The state in // these modules complicates things, as you'll essentially // get the case where the capture phase event might change // state, only for the following bubble event to come in // later and not trigger anything as the state now // invalidates the heuristics of the event plugin. We // could alter all these plugins to work in such ways, but // that might cause other unknown side-effects that we // can't foresee right now. if (shouldProcessPolyfillPlugins) { extractEvents$2(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); extractEvents$1(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); extractEvents$3(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); extractEvents(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget); } } // List of events that need to be individually attached to media elements. var mediaEventTypes = ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', 'encrypted', 'ended', 'error', 'loadeddata', 'loadedmetadata', 'loadstart', 'pause', 'play', 'playing', 'progress', 'ratechange', 'resize', 'seeked', 'seeking', 'stalled', 'suspend', 'timeupdate', 'volumechange', 'waiting']; // We should not delegate these events to the container, but rather // set them on the actual target element itself. This is primarily // because these events do not consistently bubble in the DOM. var nonDelegatedEvents = new Set(['cancel', 'close', 'invalid', 'load', 'scroll', 'toggle'].concat(mediaEventTypes)); function executeDispatch(event, listener, currentTarget) { var type = event.type || 'unknown-event'; event.currentTarget = currentTarget; invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); event.currentTarget = null; } function processDispatchQueueItemsInOrder(event, dispatchListeners, inCapturePhase) { var previousInstance; if (inCapturePhase) { for (var i = dispatchListeners.length - 1; i >= 0; i--) { var _dispatchListeners$i = dispatchListeners[i], instance = _dispatchListeners$i.instance, currentTarget = _dispatchListeners$i.currentTarget, listener = _dispatchListeners$i.listener; if (instance !== previousInstance && event.isPropagationStopped()) { return; } executeDispatch(event, listener, currentTarget); previousInstance = instance; } } else { for (var _i = 0; _i < dispatchListeners.length; _i++) { var _dispatchListeners$_i = dispatchListeners[_i], _instance = _dispatchListeners$_i.instance, _currentTarget = _dispatchListeners$_i.currentTarget, _listener = _dispatchListeners$_i.listener; if (_instance !== previousInstance && event.isPropagationStopped()) { return; } executeDispatch(event, _listener, _currentTarget); previousInstance = _instance; } } } function processDispatchQueue(dispatchQueue, eventSystemFlags) { var inCapturePhase = (eventSystemFlags & IS_CAPTURE_PHASE) !== 0; for (var i = 0; i < dispatchQueue.length; i++) { var _dispatchQueue$i = dispatchQueue[i], event = _dispatchQueue$i.event, listeners = _dispatchQueue$i.listeners; processDispatchQueueItemsInOrder(event, listeners, inCapturePhase); // event system doesn't use pooling. } // This would be a good time to rethrow if any of the event handlers threw. rethrowCaughtError(); } function dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) { var nativeEventTarget = getEventTarget(nativeEvent); var dispatchQueue = []; extractEvents$5(dispatchQueue, domEventName, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags); processDispatchQueue(dispatchQueue, eventSystemFlags); } function listenToNonDelegatedEvent(domEventName, targetElement) { { if (!nonDelegatedEvents.has(domEventName)) { error('Did not expect a listenToNonDelegatedEvent() call for "%s". ' + 'This is a bug in React. Please file an issue.', domEventName); } } var isCapturePhaseListener = false; var listenerSet = getEventListenerSet(targetElement); var listenerSetKey = getListenerSetKey(domEventName, isCapturePhaseListener); if (!listenerSet.has(listenerSetKey)) { addTrappedEventListener(targetElement, domEventName, IS_NON_DELEGATED, isCapturePhaseListener); listenerSet.add(listenerSetKey); } } function listenToNativeEvent(domEventName, isCapturePhaseListener, target) { { if (nonDelegatedEvents.has(domEventName) && !isCapturePhaseListener) { error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. ' + 'This is a bug in React. Please file an issue.', domEventName); } } var eventSystemFlags = 0; if (isCapturePhaseListener) { eventSystemFlags |= IS_CAPTURE_PHASE; } addTrappedEventListener(target, domEventName, eventSystemFlags, isCapturePhaseListener); } // This is only used by createEventHandle when the var listeningMarker = '_reactListening' + Math.random().toString(36).slice(2); function listenToAllSupportedEvents(rootContainerElement) { if (!rootContainerElement[listeningMarker]) { rootContainerElement[listeningMarker] = true; allNativeEvents.forEach(function (domEventName) { // We handle selectionchange separately because it // doesn't bubble and needs to be on the document. if (domEventName !== 'selectionchange') { if (!nonDelegatedEvents.has(domEventName)) { listenToNativeEvent(domEventName, false, rootContainerElement); } listenToNativeEvent(domEventName, true, rootContainerElement); } }); var ownerDocument = rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument; if (ownerDocument !== null) { // The selectionchange event also needs deduplication // but it is attached to the document. if (!ownerDocument[listeningMarker]) { ownerDocument[listeningMarker] = true; listenToNativeEvent('selectionchange', false, ownerDocument); } } } } function addTrappedEventListener(targetContainer, domEventName, eventSystemFlags, isCapturePhaseListener, isDeferredListenerForLegacyFBSupport) { var listener = createEventListenerWrapperWithPriority(targetContainer, domEventName, eventSystemFlags); // If passive option is not supported, then the event will be // active and not passive. var isPassiveListener = undefined; if (passiveBrowserEventsSupported) { // Browsers introduced an intervention, making these events // passive by default on document. React doesn't bind them // to document anymore, but changing this now would undo // the performance wins from the change. So we emulate // the existing behavior manually on the roots now. // https://github.com/facebook/react/issues/19651 if (domEventName === 'touchstart' || domEventName === 'touchmove' || domEventName === 'wheel') { isPassiveListener = true; } } targetContainer = targetContainer; var unsubscribeListener; // When legacyFBSupport is enabled, it's for when we if (isCapturePhaseListener) { if (isPassiveListener !== undefined) { unsubscribeListener = addEventCaptureListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener); } else { unsubscribeListener = addEventCaptureListener(targetContainer, domEventName, listener); } } else { if (isPassiveListener !== undefined) { unsubscribeListener = addEventBubbleListenerWithPassiveFlag(targetContainer, domEventName, listener, isPassiveListener); } else { unsubscribeListener = addEventBubbleListener(targetContainer, domEventName, listener); } } } function isMatchingRootContainer(grandContainer, targetContainer) { return grandContainer === targetContainer || grandContainer.nodeType === COMMENT_NODE && grandContainer.parentNode === targetContainer; } function dispatchEventForPluginEventSystem(domEventName, eventSystemFlags, nativeEvent, targetInst, targetContainer) { var ancestorInst = targetInst; if ((eventSystemFlags & IS_EVENT_HANDLE_NON_MANAGED_NODE) === 0 && (eventSystemFlags & IS_NON_DELEGATED) === 0) { var targetContainerNode = targetContainer; // If we are using the legacy FB support flag, we if (targetInst !== null) { // The below logic attempts to work out if we need to change // the target fiber to a different ancestor. We had similar logic // in the legacy event system, except the big difference between // systems is that the modern event system now has an event listener // attached to each React Root and React Portal Root. Together, // the DOM nodes representing these roots are the "rootContainer". // To figure out which ancestor instance we should use, we traverse // up the fiber tree from the target instance and attempt to find // root boundaries that match that of our current "rootContainer". // If we find that "rootContainer", we find the parent fiber // sub-tree for that root and make that our ancestor instance. var node = targetInst; mainLoop: while (true) { if (node === null) { return; } var nodeTag = node.tag; if (nodeTag === HostRoot || nodeTag === HostPortal) { var container = node.stateNode.containerInfo; if (isMatchingRootContainer(container, targetContainerNode)) { break; } if (nodeTag === HostPortal) { // The target is a portal, but it's not the rootContainer we're looking for. // Normally portals handle their own events all the way down to the root. // So we should be able to stop now. However, we don't know if this portal // was part of *our* root. var grandNode = node.return; while (grandNode !== null) { var grandTag = grandNode.tag; if (grandTag === HostRoot || grandTag === HostPortal) { var grandContainer = grandNode.stateNode.containerInfo; if (isMatchingRootContainer(grandContainer, targetContainerNode)) { // This is the rootContainer we're looking for and we found it as // a parent of the Portal. That means we can ignore it because the // Portal will bubble through to us. return; } } grandNode = grandNode.return; } } // Now we need to find it's corresponding host fiber in the other // tree. To do this we can use getClosestInstanceFromNode, but we // need to validate that the fiber is a host instance, otherwise // we need to traverse up through the DOM till we find the correct // node that is from the other tree. while (container !== null) { var parentNode = getClosestInstanceFromNode(container); if (parentNode === null) { return; } var parentTag = parentNode.tag; if (parentTag === HostComponent || parentTag === HostText) { node = ancestorInst = parentNode; continue mainLoop; } container = container.parentNode; } } node = node.return; } } } batchedUpdates(function () { return dispatchEventsForPlugins(domEventName, eventSystemFlags, nativeEvent, ancestorInst); }); } function createDispatchListener(instance, listener, currentTarget) { return { instance: instance, listener: listener, currentTarget: currentTarget }; } function accumulateSinglePhaseListeners(targetFiber, reactName, nativeEventType, inCapturePhase, accumulateTargetOnly, nativeEvent) { var captureName = reactName !== null ? reactName + 'Capture' : null; var reactEventName = inCapturePhase ? captureName : reactName; var listeners = []; var instance = targetFiber; var lastHostComponent = null; // Accumulate all instances and listeners via the target -> root path. while (instance !== null) { var _instance2 = instance, stateNode = _instance2.stateNode, tag = _instance2.tag; // Handle listeners that are on HostComponents (i.e. <div>) if (tag === HostComponent && stateNode !== null) { lastHostComponent = stateNode; // createEventHandle listeners if (reactEventName !== null) { var listener = getListener(instance, reactEventName); if (listener != null) { listeners.push(createDispatchListener(instance, listener, lastHostComponent)); } } } // If we are only accumulating events for the target, then we don't // continue to propagate through the React fiber tree to find other // listeners. if (accumulateTargetOnly) { break; } // If we are processing the onBeforeBlur event, then we need to take instance = instance.return; } return listeners; } // We should only use this function for: // - BeforeInputEventPlugin // - ChangeEventPlugin // - SelectEventPlugin // This is because we only process these plugins // in the bubble phase, so we need to accumulate two // phase event listeners (via emulation). function accumulateTwoPhaseListeners(targetFiber, reactName) { var captureName = reactName + 'Capture'; var listeners = []; var instance = targetFiber; // Accumulate all instances and listeners via the target -> root path. while (instance !== null) { var _instance3 = instance, stateNode = _instance3.stateNode, tag = _instance3.tag; // Handle listeners that are on HostComponents (i.e. <div>) if (tag === HostComponent && stateNode !== null) { var currentTarget = stateNode; var captureListener = getListener(instance, captureName); if (captureListener != null) { listeners.unshift(createDispatchListener(instance, captureListener, currentTarget)); } var bubbleListener = getListener(instance, reactName); if (bubbleListener != null) { listeners.push(createDispatchListener(instance, bubbleListener, currentTarget)); } } instance = instance.return; } return listeners; } function getParent(inst) { if (inst === null) { return null; } do { inst = inst.return; // TODO: If this is a HostRoot we might want to bail out. // That is depending on if we want nested subtrees (layers) to bubble // events to their parent. We could also go through parentNode on the // host node but that wouldn't work for React Native and doesn't let us // do the portal feature. } while (inst && inst.tag !== HostComponent); if (inst) { return inst; } return null; } /** * Return the lowest common ancestor of A and B, or null if they are in * different trees. */ function getLowestCommonAncestor(instA, instB) { var nodeA = instA; var nodeB = instB; var depthA = 0; for (var tempA = nodeA; tempA; tempA = getParent(tempA)) { depthA++; } var depthB = 0; for (var tempB = nodeB; tempB; tempB = getParent(tempB)) { depthB++; } // If A is deeper, crawl up. while (depthA - depthB > 0) { nodeA = getParent(nodeA); depthA--; } // If B is deeper, crawl up. while (depthB - depthA > 0) { nodeB = getParent(nodeB); depthB--; } // Walk in lockstep until we find a match. var depth = depthA; while (depth--) { if (nodeA === nodeB || nodeB !== null && nodeA === nodeB.alternate) { return nodeA; } nodeA = getParent(nodeA); nodeB = getParent(nodeB); } return null; } function accumulateEnterLeaveListenersForEvent(dispatchQueue, event, target, common, inCapturePhase) { var registrationName = event._reactName; var listeners = []; var instance = target; while (instance !== null) { if (instance === common) { break; } var _instance4 = instance, alternate = _instance4.alternate, stateNode = _instance4.stateNode, tag = _instance4.tag; if (alternate !== null && alternate === common) { break; } if (tag === HostComponent && stateNode !== null) { var currentTarget = stateNode; if (inCapturePhase) { var captureListener = getListener(instance, registrationName); if (captureListener != null) { listeners.unshift(createDispatchListener(instance, captureListener, currentTarget)); } } else if (!inCapturePhase) { var bubbleListener = getListener(instance, registrationName); if (bubbleListener != null) { listeners.push(createDispatchListener(instance, bubbleListener, currentTarget)); } } } instance = instance.return; } if (listeners.length !== 0) { dispatchQueue.push({ event: event, listeners: listeners }); } } // We should only use this function for: // - EnterLeaveEventPlugin // This is because we only process this plugin // in the bubble phase, so we need to accumulate two // phase event listeners. function accumulateEnterLeaveTwoPhaseListeners(dispatchQueue, leaveEvent, enterEvent, from, to) { var common = from && to ? getLowestCommonAncestor(from, to) : null; if (from !== null) { accumulateEnterLeaveListenersForEvent(dispatchQueue, leaveEvent, from, common, false); } if (to !== null && enterEvent !== null) { accumulateEnterLeaveListenersForEvent(dispatchQueue, enterEvent, to, common, true); } } function getListenerSetKey(domEventName, capture) { return domEventName + "__" + (capture ? 'capture' : 'bubble'); } var didWarnInvalidHydration = false; var DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML'; var SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning'; var SUPPRESS_HYDRATION_WARNING = 'suppressHydrationWarning'; var AUTOFOCUS = 'autoFocus'; var CHILDREN = 'children'; var STYLE = 'style'; var HTML$1 = '__html'; var warnedUnknownTags; var validatePropertiesInDevelopment; var warnForPropDifference; var warnForExtraAttributes; var warnForInvalidEventListener; var canDiffStyleForHydrationWarning; var normalizeHTML; { warnedUnknownTags = { // There are working polyfills for <dialog>. Let people use it. dialog: true, // Electron ships a custom <webview> tag to display external web content in // an isolated frame and process. // This tag is not present in non Electron environments such as JSDom which // is often used for testing purposes. // @see https://electronjs.org/docs/api/webview-tag webview: true }; validatePropertiesInDevelopment = function (type, props) { validateProperties(type, props); validateProperties$1(type, props); validateProperties$2(type, props, { registrationNameDependencies: registrationNameDependencies, possibleRegistrationNames: possibleRegistrationNames }); }; // IE 11 parses & normalizes the style attribute as opposed to other // browsers. It adds spaces and sorts the properties in some // non-alphabetical order. Handling that would require sorting CSS // properties in the client & server versions or applying // `expectedStyle` to a temporary DOM node to read its `style` attribute // normalized. Since it only affects IE, we're skipping style warnings // in that browser completely in favor of doing all that work. // See https://github.com/facebook/react/issues/11807 canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; warnForPropDifference = function (propName, serverValue, clientValue) { if (didWarnInvalidHydration) { return; } var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue); var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue); if (normalizedServerValue === normalizedClientValue) { return; } didWarnInvalidHydration = true; error('Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue)); }; warnForExtraAttributes = function (attributeNames) { if (didWarnInvalidHydration) { return; } didWarnInvalidHydration = true; var names = []; attributeNames.forEach(function (name) { names.push(name); }); error('Extra attributes from the server: %s', names); }; warnForInvalidEventListener = function (registrationName, listener) { if (listener === false) { error('Expected `%s` listener to be a function, instead got `false`.\n\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName); } else { error('Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener); } }; // Parse the HTML and read it back to normalize the HTML string so that it // can be used for comparison. normalizeHTML = function (parent, html) { // We could have created a separate document here to avoid // re-initializing custom elements if they exist. But this breaks // how <noscript> is being handled. So we use the same document. // See the discussion in https://github.com/facebook/react/pull/11157. var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName); testElement.innerHTML = html; return testElement.innerHTML; }; } // HTML parsing normalizes CR and CRLF to LF. // It also can turn \u0000 into \uFFFD inside attributes. // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream // If we have a mismatch, it might be caused by that. // We will still patch up in this case but not fire the warning. var NORMALIZE_NEWLINES_REGEX = /\r\n?/g; var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\u0000|\uFFFD/g; function normalizeMarkupForTextOrAttribute(markup) { { checkHtmlStringCoercion(markup); } var markupString = typeof markup === 'string' ? markup : '' + markup; return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, ''); } function checkForUnmatchedText(serverText, clientText, isConcurrentMode, shouldWarnDev) { var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText); var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText); if (normalizedServerText === normalizedClientText) { return; } if (shouldWarnDev) { { if (!didWarnInvalidHydration) { didWarnInvalidHydration = true; error('Text content did not match. Server: "%s" Client: "%s"', normalizedServerText, normalizedClientText); } } } if (isConcurrentMode && enableClientRenderFallbackOnTextMismatch) { // In concurrent roots, we throw when there's a text mismatch and revert to // client rendering, up to the nearest Suspense boundary. throw new Error('Text content does not match server-rendered HTML.'); } } function getOwnerDocumentFromRootContainer(rootContainerElement) { return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument; } function noop() {} function trapClickOnNonInteractiveElement(node) { // Mobile Safari does not fire properly bubble click events on // non-interactive elements, which means delegated click listeners do not // fire. The workaround for this bug involves attaching an empty click // listener on the target node. // https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html // Just set it using the onclick property so that we don't have to manage any // bookkeeping for it. Not sure if we need to clear it when the listener is // removed. // TODO: Only do this for the relevant Safaris maybe? node.onclick = noop; } function setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) { for (var propKey in nextProps) { if (!nextProps.hasOwnProperty(propKey)) { continue; } var nextProp = nextProps[propKey]; if (propKey === STYLE) { { if (nextProp) { // Freeze the next style object so that we can assume it won't be // mutated. We have already warned for this in the past. Object.freeze(nextProp); } } // Relies on `updateStylesByID` not mutating `styleUpdates`. setValueForStyles(domElement, nextProp); } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { var nextHtml = nextProp ? nextProp[HTML$1] : undefined; if (nextHtml != null) { setInnerHTML(domElement, nextHtml); } } else if (propKey === CHILDREN) { if (typeof nextProp === 'string') { // Avoid setting initial textContent when the text is empty. In IE11 setting // textContent on a <textarea> will cause the placeholder to not // show within the <textarea> until it has been focused and blurred again. // https://github.com/facebook/react/issues/6731#issuecomment-254874553 var canSetTextContent = tag !== 'textarea' || nextProp !== ''; if (canSetTextContent) { setTextContent(domElement, nextProp); } } else if (typeof nextProp === 'number') { setTextContent(domElement, '' + nextProp); } } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) { if (nextProp != null) { if ( typeof nextProp !== 'function') { warnForInvalidEventListener(propKey, nextProp); } if (propKey === 'onScroll') { listenToNonDelegatedEvent('scroll', domElement); } } } else if (nextProp != null) { setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag); } } } function updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) { // TODO: Handle wasCustomComponentTag for (var i = 0; i < updatePayload.length; i += 2) { var propKey = updatePayload[i]; var propValue = updatePayload[i + 1]; if (propKey === STYLE) { setValueForStyles(domElement, propValue); } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { setInnerHTML(domElement, propValue); } else if (propKey === CHILDREN) { setTextContent(domElement, propValue); } else { setValueForProperty(domElement, propKey, propValue, isCustomComponentTag); } } } function createElement(type, props, rootContainerElement, parentNamespace) { var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML // tags get no namespace. var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement); var domElement; var namespaceURI = parentNamespace; if (namespaceURI === HTML_NAMESPACE) { namespaceURI = getIntrinsicNamespace(type); } if (namespaceURI === HTML_NAMESPACE) { { isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to // allow <SVG> or <mATH>. if (!isCustomComponentTag && type !== type.toLowerCase()) { error('<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type); } } if (type === 'script') { // Create the script via .innerHTML so its "parser-inserted" flag is // set to true and it does not execute var div = ownerDocument.createElement('div'); div.innerHTML = '<script><' + '/script>'; // eslint-disable-line // This is guaranteed to yield a script element. var firstChild = div.firstChild; domElement = div.removeChild(firstChild); } else if (typeof props.is === 'string') { // $FlowIssue `createElement` should be updated for Web Components domElement = ownerDocument.createElement(type, { is: props.is }); } else { // Separate else branch instead of using `props.is || undefined` above because of a Firefox bug. // See discussion in https://github.com/facebook/react/pull/6896 // and discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=1276240 domElement = ownerDocument.createElement(type); // Normally attributes are assigned in `setInitialDOMProperties`, however the `multiple` and `size` // attributes on `select`s needs to be added before `option`s are inserted. // This prevents: // - a bug where the `select` does not scroll to the correct option because singular // `select` elements automatically pick the first item #13222 // - a bug where the `select` set the first item as selected despite the `size` attribute #14239 // See https://github.com/facebook/react/issues/13222 // and https://github.com/facebook/react/issues/14239 if (type === 'select') { var node = domElement; if (props.multiple) { node.multiple = true; } else if (props.size) { // Setting a size greater than 1 causes a select to behave like `multiple=true`, where // it is possible that no option is selected. // // This is only necessary when a select in "single selection mode". node.size = props.size; } } } } else { domElement = ownerDocument.createElementNS(namespaceURI, type); } { if (namespaceURI === HTML_NAMESPACE) { if (!isCustomComponentTag && Object.prototype.toString.call(domElement) === '[object HTMLUnknownElement]' && !hasOwnProperty.call(warnedUnknownTags, type)) { warnedUnknownTags[type] = true; error('The tag <%s> is unrecognized in this browser. ' + 'If you meant to render a React component, start its name with ' + 'an uppercase letter.', type); } } } return domElement; } function createTextNode(text, rootContainerElement) { return getOwnerDocumentFromRootContainer(rootContainerElement).createTextNode(text); } function setInitialProperties(domElement, tag, rawProps, rootContainerElement) { var isCustomComponentTag = isCustomComponent(tag, rawProps); { validatePropertiesInDevelopment(tag, rawProps); } // TODO: Make sure that we check isMounted before firing any of these events. var props; switch (tag) { case 'dialog': listenToNonDelegatedEvent('cancel', domElement); listenToNonDelegatedEvent('close', domElement); props = rawProps; break; case 'iframe': case 'object': case 'embed': // We listen to this event in case to ensure emulated bubble // listeners still fire for the load event. listenToNonDelegatedEvent('load', domElement); props = rawProps; break; case 'video': case 'audio': // We listen to these events in case to ensure emulated bubble // listeners still fire for all the media events. for (var i = 0; i < mediaEventTypes.length; i++) { listenToNonDelegatedEvent(mediaEventTypes[i], domElement); } props = rawProps; break; case 'source': // We listen to this event in case to ensure emulated bubble // listeners still fire for the error event. listenToNonDelegatedEvent('error', domElement); props = rawProps; break; case 'img': case 'image': case 'link': // We listen to these events in case to ensure emulated bubble // listeners still fire for error and load events. listenToNonDelegatedEvent('error', domElement); listenToNonDelegatedEvent('load', domElement); props = rawProps; break; case 'details': // We listen to this event in case to ensure emulated bubble // listeners still fire for the toggle event. listenToNonDelegatedEvent('toggle', domElement); props = rawProps; break; case 'input': initWrapperState(domElement, rawProps); props = getHostProps(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; case 'option': validateProps(domElement, rawProps); props = rawProps; break; case 'select': initWrapperState$1(domElement, rawProps); props = getHostProps$1(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; case 'textarea': initWrapperState$2(domElement, rawProps); props = getHostProps$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; default: props = rawProps; } assertValidProps(tag, props); setInitialDOMProperties(tag, domElement, rootContainerElement, props, isCustomComponentTag); switch (tag) { case 'input': // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. track(domElement); postMountWrapper(domElement, rawProps, false); break; case 'textarea': // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. track(domElement); postMountWrapper$3(domElement); break; case 'option': postMountWrapper$1(domElement, rawProps); break; case 'select': postMountWrapper$2(domElement, rawProps); break; default: if (typeof props.onClick === 'function') { // TODO: This cast may not be sound for SVG, MathML or custom elements. trapClickOnNonInteractiveElement(domElement); } break; } } // Calculate the diff between the two objects. function diffProperties(domElement, tag, lastRawProps, nextRawProps, rootContainerElement) { { validatePropertiesInDevelopment(tag, nextRawProps); } var updatePayload = null; var lastProps; var nextProps; switch (tag) { case 'input': lastProps = getHostProps(domElement, lastRawProps); nextProps = getHostProps(domElement, nextRawProps); updatePayload = []; break; case 'select': lastProps = getHostProps$1(domElement, lastRawProps); nextProps = getHostProps$1(domElement, nextRawProps); updatePayload = []; break; case 'textarea': lastProps = getHostProps$2(domElement, lastRawProps); nextProps = getHostProps$2(domElement, nextRawProps); updatePayload = []; break; default: lastProps = lastRawProps; nextProps = nextRawProps; if (typeof lastProps.onClick !== 'function' && typeof nextProps.onClick === 'function') { // TODO: This cast may not be sound for SVG, MathML or custom elements. trapClickOnNonInteractiveElement(domElement); } break; } assertValidProps(tag, nextProps); var propKey; var styleName; var styleUpdates = null; for (propKey in lastProps) { if (nextProps.hasOwnProperty(propKey) || !lastProps.hasOwnProperty(propKey) || lastProps[propKey] == null) { continue; } if (propKey === STYLE) { var lastStyle = lastProps[propKey]; for (styleName in lastStyle) { if (lastStyle.hasOwnProperty(styleName)) { if (!styleUpdates) { styleUpdates = {}; } styleUpdates[styleName] = ''; } } } else if (propKey === DANGEROUSLY_SET_INNER_HTML || propKey === CHILDREN) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (propKey === AUTOFOCUS) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) { // This is a special case. If any listener updates we need to ensure // that the "current" fiber pointer gets updated so we need a commit // to update this element. if (!updatePayload) { updatePayload = []; } } else { // For all other deleted properties we add it to the queue. We use // the allowed property list in the commit phase instead. (updatePayload = updatePayload || []).push(propKey, null); } } for (propKey in nextProps) { var nextProp = nextProps[propKey]; var lastProp = lastProps != null ? lastProps[propKey] : undefined; if (!nextProps.hasOwnProperty(propKey) || nextProp === lastProp || nextProp == null && lastProp == null) { continue; } if (propKey === STYLE) { { if (nextProp) { // Freeze the next style object so that we can assume it won't be // mutated. We have already warned for this in the past. Object.freeze(nextProp); } } if (lastProp) { // Unset styles on `lastProp` but not on `nextProp`. for (styleName in lastProp) { if (lastProp.hasOwnProperty(styleName) && (!nextProp || !nextProp.hasOwnProperty(styleName))) { if (!styleUpdates) { styleUpdates = {}; } styleUpdates[styleName] = ''; } } // Update styles that changed since `lastProp`. for (styleName in nextProp) { if (nextProp.hasOwnProperty(styleName) && lastProp[styleName] !== nextProp[styleName]) { if (!styleUpdates) { styleUpdates = {}; } styleUpdates[styleName] = nextProp[styleName]; } } } else { // Relies on `updateStylesByID` not mutating `styleUpdates`. if (!styleUpdates) { if (!updatePayload) { updatePayload = []; } updatePayload.push(propKey, styleUpdates); } styleUpdates = nextProp; } } else if (propKey === DANGEROUSLY_SET_INNER_HTML) { var nextHtml = nextProp ? nextProp[HTML$1] : undefined; var lastHtml = lastProp ? lastProp[HTML$1] : undefined; if (nextHtml != null) { if (lastHtml !== nextHtml) { (updatePayload = updatePayload || []).push(propKey, nextHtml); } } } else if (propKey === CHILDREN) { if (typeof nextProp === 'string' || typeof nextProp === 'number') { (updatePayload = updatePayload || []).push(propKey, '' + nextProp); } } else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING) ; else if (registrationNameDependencies.hasOwnProperty(propKey)) { if (nextProp != null) { // We eagerly listen to this even though we haven't committed yet. if ( typeof nextProp !== 'function') { warnForInvalidEventListener(propKey, nextProp); } if (propKey === 'onScroll') { listenToNonDelegatedEvent('scroll', domElement); } } if (!updatePayload && lastProp !== nextProp) { // This is a special case. If any listener updates we need to ensure // that the "current" props pointer gets updated so we need a commit // to update this element. updatePayload = []; } } else { // For any other property we always add it to the queue and then we // filter it out using the allowed property list during the commit. (updatePayload = updatePayload || []).push(propKey, nextProp); } } if (styleUpdates) { { validateShorthandPropertyCollisionInDev(styleUpdates, nextProps[STYLE]); } (updatePayload = updatePayload || []).push(STYLE, styleUpdates); } return updatePayload; } // Apply the diff. function updateProperties(domElement, updatePayload, tag, lastRawProps, nextRawProps) { // Update checked *before* name. // In the middle of an update, it is possible to have multiple checked. // When a checked radio tries to change name, browser makes another radio's checked false. if (tag === 'input' && nextRawProps.type === 'radio' && nextRawProps.name != null) { updateChecked(domElement, nextRawProps); } var wasCustomComponentTag = isCustomComponent(tag, lastRawProps); var isCustomComponentTag = isCustomComponent(tag, nextRawProps); // Apply the diff. updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag); // TODO: Ensure that an update gets scheduled if any of the special props // changed. switch (tag) { case 'input': // Update the wrapper around inputs *after* updating props. This has to // happen after `updateDOMProperties`. Otherwise HTML5 input validations // raise warnings and prevent the new value from being assigned. updateWrapper(domElement, nextRawProps); break; case 'textarea': updateWrapper$1(domElement, nextRawProps); break; case 'select': // <select> value update needs to occur after <option> children // reconciliation postUpdateWrapper(domElement, nextRawProps); break; } } function getPossibleStandardName(propName) { { var lowerCasedName = propName.toLowerCase(); if (!possibleStandardNames.hasOwnProperty(lowerCasedName)) { return null; } return possibleStandardNames[lowerCasedName] || null; } } function diffHydratedProperties(domElement, tag, rawProps, parentNamespace, rootContainerElement, isConcurrentMode, shouldWarnDev) { var isCustomComponentTag; var extraAttributeNames; { isCustomComponentTag = isCustomComponent(tag, rawProps); validatePropertiesInDevelopment(tag, rawProps); } // TODO: Make sure that we check isMounted before firing any of these events. switch (tag) { case 'dialog': listenToNonDelegatedEvent('cancel', domElement); listenToNonDelegatedEvent('close', domElement); break; case 'iframe': case 'object': case 'embed': // We listen to this event in case to ensure emulated bubble // listeners still fire for the load event. listenToNonDelegatedEvent('load', domElement); break; case 'video': case 'audio': // We listen to these events in case to ensure emulated bubble // listeners still fire for all the media events. for (var i = 0; i < mediaEventTypes.length; i++) { listenToNonDelegatedEvent(mediaEventTypes[i], domElement); } break; case 'source': // We listen to this event in case to ensure emulated bubble // listeners still fire for the error event. listenToNonDelegatedEvent('error', domElement); break; case 'img': case 'image': case 'link': // We listen to these events in case to ensure emulated bubble // listeners still fire for error and load events. listenToNonDelegatedEvent('error', domElement); listenToNonDelegatedEvent('load', domElement); break; case 'details': // We listen to this event in case to ensure emulated bubble // listeners still fire for the toggle event. listenToNonDelegatedEvent('toggle', domElement); break; case 'input': initWrapperState(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; case 'option': validateProps(domElement, rawProps); break; case 'select': initWrapperState$1(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; case 'textarea': initWrapperState$2(domElement, rawProps); // We listen to this event in case to ensure emulated bubble // listeners still fire for the invalid event. listenToNonDelegatedEvent('invalid', domElement); break; } assertValidProps(tag, rawProps); { extraAttributeNames = new Set(); var attributes = domElement.attributes; for (var _i = 0; _i < attributes.length; _i++) { var name = attributes[_i].name.toLowerCase(); switch (name) { // Controlled attributes are not validated // TODO: Only ignore them on controlled tags. case 'value': break; case 'checked': break; case 'selected': break; default: // Intentionally use the original name. // See discussion in https://github.com/facebook/react/pull/10676. extraAttributeNames.add(attributes[_i].name); } } } var updatePayload = null; for (var propKey in rawProps) { if (!rawProps.hasOwnProperty(propKey)) { continue; } var nextProp = rawProps[propKey]; if (propKey === CHILDREN) { // For text content children we compare against textContent. This // might match additional HTML that is hidden when we read it using // textContent. E.g. "foo" will match "f<span>oo</span>" but that still // satisfies our requirement. Our requirement is not to produce perfect // HTML and attributes. Ideally we should preserve structure but it's // ok not to if the visible content is still enough to indicate what // even listeners these nodes might be wired up to. // TODO: Warn if there is more than a single textNode as a child. // TODO: Should we use domElement.firstChild.nodeValue to compare? if (typeof nextProp === 'string') { if (domElement.textContent !== nextProp) { if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) { checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev); } updatePayload = [CHILDREN, nextProp]; } } else if (typeof nextProp === 'number') { if (domElement.textContent !== '' + nextProp) { if (rawProps[SUPPRESS_HYDRATION_WARNING] !== true) { checkForUnmatchedText(domElement.textContent, nextProp, isConcurrentMode, shouldWarnDev); } updatePayload = [CHILDREN, '' + nextProp]; } } } else if (registrationNameDependencies.hasOwnProperty(propKey)) { if (nextProp != null) { if ( typeof nextProp !== 'function') { warnForInvalidEventListener(propKey, nextProp); } if (propKey === 'onScroll') { listenToNonDelegatedEvent('scroll', domElement); } } } else if (shouldWarnDev && true && // Convince Flow we've calculated it (it's DEV-only in this method.) typeof isCustomComponentTag === 'boolean') { // Validate that the properties correspond to their expected values. var serverValue = void 0; var propertyInfo = isCustomComponentTag && enableCustomElementPropertySupport ? null : getPropertyInfo(propKey); if (rawProps[SUPPRESS_HYDRATION_WARNING] === true) ; else if (propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING || // Controlled attributes are not validated // TODO: Only ignore them on controlled tags. propKey === 'value' || propKey === 'checked' || propKey === 'selected') ; else if (propKey === DANGEROUSLY_SET_INNER_HTML) { var serverHTML = domElement.innerHTML; var nextHtml = nextProp ? nextProp[HTML$1] : undefined; if (nextHtml != null) { var expectedHTML = normalizeHTML(domElement, nextHtml); if (expectedHTML !== serverHTML) { warnForPropDifference(propKey, serverHTML, expectedHTML); } } } else if (propKey === STYLE) { // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(propKey); if (canDiffStyleForHydrationWarning) { var expectedStyle = createDangerousStringForStyles(nextProp); serverValue = domElement.getAttribute('style'); if (expectedStyle !== serverValue) { warnForPropDifference(propKey, serverValue, expectedStyle); } } } else if (isCustomComponentTag && !enableCustomElementPropertySupport) { // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(propKey.toLowerCase()); serverValue = getValueForAttribute(domElement, propKey, nextProp); if (nextProp !== serverValue) { warnForPropDifference(propKey, serverValue, nextProp); } } else if (!shouldIgnoreAttribute(propKey, propertyInfo, isCustomComponentTag) && !shouldRemoveAttribute(propKey, nextProp, propertyInfo, isCustomComponentTag)) { var isMismatchDueToBadCasing = false; if (propertyInfo !== null) { // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(propertyInfo.attributeName); serverValue = getValueForProperty(domElement, propKey, nextProp, propertyInfo); } else { var ownNamespace = parentNamespace; if (ownNamespace === HTML_NAMESPACE) { ownNamespace = getIntrinsicNamespace(tag); } if (ownNamespace === HTML_NAMESPACE) { // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(propKey.toLowerCase()); } else { var standardName = getPossibleStandardName(propKey); if (standardName !== null && standardName !== propKey) { // If an SVG prop is supplied with bad casing, it will // be successfully parsed from HTML, but will produce a mismatch // (and would be incorrectly rendered on the client). // However, we already warn about bad casing elsewhere. // So we'll skip the misleading extra mismatch warning in this case. isMismatchDueToBadCasing = true; // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(standardName); } // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.delete(propKey); } serverValue = getValueForAttribute(domElement, propKey, nextProp); } var dontWarnCustomElement = enableCustomElementPropertySupport ; if (!dontWarnCustomElement && nextProp !== serverValue && !isMismatchDueToBadCasing) { warnForPropDifference(propKey, serverValue, nextProp); } } } } { if (shouldWarnDev) { if ( // $FlowFixMe - Should be inferred as not undefined. extraAttributeNames.size > 0 && rawProps[SUPPRESS_HYDRATION_WARNING] !== true) { // $FlowFixMe - Should be inferred as not undefined. warnForExtraAttributes(extraAttributeNames); } } } switch (tag) { case 'input': // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. track(domElement); postMountWrapper(domElement, rawProps, true); break; case 'textarea': // TODO: Make sure we check if this is still unmounted or do any clean // up necessary since we never stop tracking anymore. track(domElement); postMountWrapper$3(domElement); break; case 'select': case 'option': // For input and textarea we current always set the value property at // post mount to force it to diverge from attributes. However, for // option and select we don't quite do the same thing and select // is not resilient to the DOM state changing so we don't do that here. // TODO: Consider not doing this for input and textarea. break; default: if (typeof rawProps.onClick === 'function') { // TODO: This cast may not be sound for SVG, MathML or custom elements. trapClickOnNonInteractiveElement(domElement); } break; } return updatePayload; } function diffHydratedText(textNode, text, isConcurrentMode) { var isDifferent = textNode.nodeValue !== text; return isDifferent; } function warnForDeletedHydratableElement(parentNode, child) { { if (didWarnInvalidHydration) { return; } didWarnInvalidHydration = true; error('Did not expect server HTML to contain a <%s> in <%s>.', child.nodeName.toLowerCase(), parentNode.nodeName.toLowerCase()); } } function warnForDeletedHydratableText(parentNode, child) { { if (didWarnInvalidHydration) { return; } didWarnInvalidHydration = true; error('Did not expect server HTML to contain the text node "%s" in <%s>.', child.nodeValue, parentNode.nodeName.toLowerCase()); } } function warnForInsertedHydratedElement(parentNode, tag, props) { { if (didWarnInvalidHydration) { return; } didWarnInvalidHydration = true; error('Expected server HTML to contain a matching <%s> in <%s>.', tag, parentNode.nodeName.toLowerCase()); } } function warnForInsertedHydratedText(parentNode, text) { { if (text === '') { // We expect to insert empty text nodes since they're not represented in // the HTML. // TODO: Remove this special case if we can just avoid inserting empty // text nodes. return; } if (didWarnInvalidHydration) { return; } didWarnInvalidHydration = true; error('Expected server HTML to contain a matching text node for "%s" in <%s>.', text, parentNode.nodeName.toLowerCase()); } } function restoreControlledState$3(domElement, tag, props) { switch (tag) { case 'input': restoreControlledState(domElement, props); return; case 'textarea': restoreControlledState$2(domElement, props); return; case 'select': restoreControlledState$1(domElement, props); return; } } var validateDOMNesting = function () {}; var updatedAncestorInfo = function () {}; { // This validation code was written based on the HTML5 parsing spec: // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope // // Note: this does not catch all invalid nesting, nor does it try to (as it's // not clear what practical benefit doing so provides); instead, we warn only // for cases where the parser will give a parse tree differing from what React // intended. For example, <b><div></div></b> is invalid but we don't warn // because it still parses correctly; we do warn for other cases like nested // <p> tags where the beginning of the second element implicitly closes the // first, causing a confusing mess. // https://html.spec.whatwg.org/multipage/syntax.html#special var specialTags = ['address', 'applet', 'area', 'article', 'aside', 'base', 'basefont', 'bgsound', 'blockquote', 'body', 'br', 'button', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dir', 'div', 'dl', 'dt', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'iframe', 'img', 'input', 'isindex', 'li', 'link', 'listing', 'main', 'marquee', 'menu', 'menuitem', 'meta', 'nav', 'noembed', 'noframes', 'noscript', 'object', 'ol', 'p', 'param', 'plaintext', 'pre', 'script', 'section', 'select', 'source', 'style', 'summary', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul', 'wbr', 'xmp']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-scope var inScopeTags = ['applet', 'caption', 'html', 'table', 'td', 'th', 'marquee', 'object', 'template', // https://html.spec.whatwg.org/multipage/syntax.html#html-integration-point // TODO: Distinguish by namespace here -- for <title>, including it here // errs on the side of fewer warnings 'foreignObject', 'desc', 'title']; // https://html.spec.whatwg.org/multipage/syntax.html#has-an-element-in-button-scope var buttonScopeTags = inScopeTags.concat(['button']); // https://html.spec.whatwg.org/multipage/syntax.html#generate-implied-end-tags var impliedEndTags = ['dd', 'dt', 'li', 'option', 'optgroup', 'p', 'rp', 'rt']; var emptyAncestorInfo = { current: null, formTag: null, aTagInScope: null, buttonTagInScope: null, nobrTagInScope: null, pTagInButtonScope: null, listItemTagAutoclosing: null, dlItemTagAutoclosing: null }; updatedAncestorInfo = function (oldInfo, tag) { var ancestorInfo = assign({}, oldInfo || emptyAncestorInfo); var info = { tag: tag }; if (inScopeTags.indexOf(tag) !== -1) { ancestorInfo.aTagInScope = null; ancestorInfo.buttonTagInScope = null; ancestorInfo.nobrTagInScope = null; } if (buttonScopeTags.indexOf(tag) !== -1) { ancestorInfo.pTagInButtonScope = null; } // See rules for 'li', 'dd', 'dt' start tags in // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody if (specialTags.indexOf(tag) !== -1 && tag !== 'address' && tag !== 'div' && tag !== 'p') { ancestorInfo.listItemTagAutoclosing = null; ancestorInfo.dlItemTagAutoclosing = null; } ancestorInfo.current = info; if (tag === 'form') { ancestorInfo.formTag = info; } if (tag === 'a') { ancestorInfo.aTagInScope = info; } if (tag === 'button') { ancestorInfo.buttonTagInScope = info; } if (tag === 'nobr') { ancestorInfo.nobrTagInScope = info; } if (tag === 'p') { ancestorInfo.pTagInButtonScope = info; } if (tag === 'li') { ancestorInfo.listItemTagAutoclosing = info; } if (tag === 'dd' || tag === 'dt') { ancestorInfo.dlItemTagAutoclosing = info; } return ancestorInfo; }; /** * Returns whether */ var isTagValidWithParent = function (tag, parentTag) { // First, let's check if we're in an unusual parsing mode... switch (parentTag) { // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inselect case 'select': return tag === 'option' || tag === 'optgroup' || tag === '#text'; case 'optgroup': return tag === 'option' || tag === '#text'; // Strictly speaking, seeing an <option> doesn't mean we're in a <select> // but case 'option': return tag === '#text'; // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intd // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incaption // No special behavior since these rules fall back to "in body" mode for // all except special table nodes which cause bad parsing behavior anyway. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intr case 'tr': return tag === 'th' || tag === 'td' || tag === 'style' || tag === 'script' || tag === 'template'; // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intbody case 'tbody': case 'thead': case 'tfoot': return tag === 'tr' || tag === 'style' || tag === 'script' || tag === 'template'; // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-incolgroup case 'colgroup': return tag === 'col' || tag === 'template'; // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-intable case 'table': return tag === 'caption' || tag === 'colgroup' || tag === 'tbody' || tag === 'tfoot' || tag === 'thead' || tag === 'style' || tag === 'script' || tag === 'template'; // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inhead case 'head': return tag === 'base' || tag === 'basefont' || tag === 'bgsound' || tag === 'link' || tag === 'meta' || tag === 'title' || tag === 'noscript' || tag === 'noframes' || tag === 'style' || tag === 'script' || tag === 'template'; // https://html.spec.whatwg.org/multipage/semantics.html#the-html-element case 'html': return tag === 'head' || tag === 'body' || tag === 'frameset'; case 'frameset': return tag === 'frame'; case '#document': return tag === 'html'; } // Probably in the "in body" parsing mode, so we outlaw only tag combos // where the parsing rules cause implicit opens or closes to be added. // https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody switch (tag) { case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': return parentTag !== 'h1' && parentTag !== 'h2' && parentTag !== 'h3' && parentTag !== 'h4' && parentTag !== 'h5' && parentTag !== 'h6'; case 'rp': case 'rt': return impliedEndTags.indexOf(parentTag) === -1; case 'body': case 'caption': case 'col': case 'colgroup': case 'frameset': case 'frame': case 'head': case 'html': case 'tbody': case 'td': case 'tfoot': case 'th': case 'thead': case 'tr': // These tags are only valid with a few parents that have special child // parsing rules -- if we're down here, then none of those matched and // so we allow it only if we don't know what the parent is, as all other // cases are invalid. return parentTag == null; } return true; }; /** * Returns whether */ var findInvalidAncestorForTag = function (tag, ancestorInfo) { switch (tag) { case 'address': case 'article': case 'aside': case 'blockquote': case 'center': case 'details': case 'dialog': case 'dir': case 'div': case 'dl': case 'fieldset': case 'figcaption': case 'figure': case 'footer': case 'header': case 'hgroup': case 'main': case 'menu': case 'nav': case 'ol': case 'p': case 'section': case 'summary': case 'ul': case 'pre': case 'listing': case 'table': case 'hr': case 'xmp': case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': return ancestorInfo.pTagInButtonScope; case 'form': return ancestorInfo.formTag || ancestorInfo.pTagInButtonScope; case 'li': return ancestorInfo.listItemTagAutoclosing; case 'dd': case 'dt': return ancestorInfo.dlItemTagAutoclosing; case 'button': return ancestorInfo.buttonTagInScope; case 'a': // Spec says something about storing a list of markers, but it sounds // equivalent to this check. return ancestorInfo.aTagInScope; case 'nobr': return ancestorInfo.nobrTagInScope; } return null; }; var didWarn$1 = {}; validateDOMNesting = function (childTag, childText, ancestorInfo) { ancestorInfo = ancestorInfo || emptyAncestorInfo; var parentInfo = ancestorInfo.current; var parentTag = parentInfo && parentInfo.tag; if (childText != null) { if (childTag != null) { error('validateDOMNesting: when childText is passed, childTag should be null'); } childTag = '#text'; } var invalidParent = isTagValidWithParent(childTag, parentTag) ? null : parentInfo; var invalidAncestor = invalidParent ? null : findInvalidAncestorForTag(childTag, ancestorInfo); var invalidParentOrAncestor = invalidParent || invalidAncestor; if (!invalidParentOrAncestor) { return; } var ancestorTag = invalidParentOrAncestor.tag; var warnKey = !!invalidParent + '|' + childTag + '|' + ancestorTag; if (didWarn$1[warnKey]) { return; } didWarn$1[warnKey] = true; var tagDisplayName = childTag; var whitespaceInfo = ''; if (childTag === '#text') { if (/\S/.test(childText)) { tagDisplayName = 'Text nodes'; } else { tagDisplayName = 'Whitespace text nodes'; whitespaceInfo = " Make sure you don't have any extra whitespace between tags on " + 'each line of your source code.'; } } else { tagDisplayName = '<' + childTag + '>'; } if (invalidParent) { var info = ''; if (ancestorTag === 'table' && childTag === 'tr') { info += ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' + 'the browser.'; } error('validateDOMNesting(...): %s cannot appear as a child of <%s>.%s%s', tagDisplayName, ancestorTag, whitespaceInfo, info); } else { error('validateDOMNesting(...): %s cannot appear as a descendant of ' + '<%s>.', tagDisplayName, ancestorTag); } }; } var SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning'; var SUSPENSE_START_DATA = '$'; var SUSPENSE_END_DATA = '/$'; var SUSPENSE_PENDING_START_DATA = '$?'; var SUSPENSE_FALLBACK_START_DATA = '$!'; var STYLE$1 = 'style'; var eventsEnabled = null; var selectionInformation = null; function getRootHostContext(rootContainerInstance) { var type; var namespace; var nodeType = rootContainerInstance.nodeType; switch (nodeType) { case DOCUMENT_NODE: case DOCUMENT_FRAGMENT_NODE: { type = nodeType === DOCUMENT_NODE ? '#document' : '#fragment'; var root = rootContainerInstance.documentElement; namespace = root ? root.namespaceURI : getChildNamespace(null, ''); break; } default: { var container = nodeType === COMMENT_NODE ? rootContainerInstance.parentNode : rootContainerInstance; var ownNamespace = container.namespaceURI || null; type = container.tagName; namespace = getChildNamespace(ownNamespace, type); break; } } { var validatedTag = type.toLowerCase(); var ancestorInfo = updatedAncestorInfo(null, validatedTag); return { namespace: namespace, ancestorInfo: ancestorInfo }; } } function getChildHostContext(parentHostContext, type, rootContainerInstance) { { var parentHostContextDev = parentHostContext; var namespace = getChildNamespace(parentHostContextDev.namespace, type); var ancestorInfo = updatedAncestorInfo(parentHostContextDev.ancestorInfo, type); return { namespace: namespace, ancestorInfo: ancestorInfo }; } } function getPublicInstance(instance) { return instance; } function prepareForCommit(containerInfo) { eventsEnabled = isEnabled(); selectionInformation = getSelectionInformation(); var activeInstance = null; setEnabled(false); return activeInstance; } function resetAfterCommit(containerInfo) { restoreSelection(selectionInformation); setEnabled(eventsEnabled); eventsEnabled = null; selectionInformation = null; } function createInstance(type, props, rootContainerInstance, hostContext, internalInstanceHandle) { var parentNamespace; { // TODO: take namespace into account when validating. var hostContextDev = hostContext; validateDOMNesting(type, null, hostContextDev.ancestorInfo); if (typeof props.children === 'string' || typeof props.children === 'number') { var string = '' + props.children; var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type); validateDOMNesting(null, string, ownAncestorInfo); } parentNamespace = hostContextDev.namespace; } var domElement = createElement(type, props, rootContainerInstance, parentNamespace); precacheFiberNode(internalInstanceHandle, domElement); updateFiberProps(domElement, props); return domElement; } function appendInitialChild(parentInstance, child) { parentInstance.appendChild(child); } function finalizeInitialChildren(domElement, type, props, rootContainerInstance, hostContext) { setInitialProperties(domElement, type, props, rootContainerInstance); switch (type) { case 'button': case 'input': case 'select': case 'textarea': return !!props.autoFocus; case 'img': return true; default: return false; } } function prepareUpdate(domElement, type, oldProps, newProps, rootContainerInstance, hostContext) { { var hostContextDev = hostContext; if (typeof newProps.children !== typeof oldProps.children && (typeof newProps.children === 'string' || typeof newProps.children === 'number')) { var string = '' + newProps.children; var ownAncestorInfo = updatedAncestorInfo(hostContextDev.ancestorInfo, type); validateDOMNesting(null, string, ownAncestorInfo); } } return diffProperties(domElement, type, oldProps, newProps); } function shouldSetTextContent(type, props) { return type === 'textarea' || type === 'noscript' || typeof props.children === 'string' || typeof props.children === 'number' || typeof props.dangerouslySetInnerHTML === 'object' && props.dangerouslySetInnerHTML !== null && props.dangerouslySetInnerHTML.__html != null; } function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) { { var hostContextDev = hostContext; validateDOMNesting(null, text, hostContextDev.ancestorInfo); } var textNode = createTextNode(text, rootContainerInstance); precacheFiberNode(internalInstanceHandle, textNode); return textNode; } function getCurrentEventPriority() { var currentEvent = window.event; if (currentEvent === undefined) { return DefaultEventPriority; } return getEventPriority(currentEvent.type); } // if a component just imports ReactDOM (e.g. for findDOMNode). // Some environments might not have setTimeout or clearTimeout. var scheduleTimeout = typeof setTimeout === 'function' ? setTimeout : undefined; var cancelTimeout = typeof clearTimeout === 'function' ? clearTimeout : undefined; var noTimeout = -1; var localPromise = typeof Promise === 'function' ? Promise : undefined; // ------------------- var scheduleMicrotask = typeof queueMicrotask === 'function' ? queueMicrotask : typeof localPromise !== 'undefined' ? function (callback) { return localPromise.resolve(null).then(callback).catch(handleErrorInNextTick); } : scheduleTimeout; // TODO: Determine the best fallback here. function handleErrorInNextTick(error) { setTimeout(function () { throw error; }); } // ------------------- function commitMount(domElement, type, newProps, internalInstanceHandle) { // Despite the naming that might imply otherwise, this method only // fires if there is an `Update` effect scheduled during mounting. // This happens if `finalizeInitialChildren` returns `true` (which it // does to implement the `autoFocus` attribute on the client). But // there are also other cases when this might happen (such as patching // up text content during hydration mismatch). So we'll check this again. switch (type) { case 'button': case 'input': case 'select': case 'textarea': if (newProps.autoFocus) { domElement.focus(); } return; case 'img': { if (newProps.src) { domElement.src = newProps.src; } return; } } } function commitUpdate(domElement, updatePayload, type, oldProps, newProps, internalInstanceHandle) { // Apply the diff to the DOM node. updateProperties(domElement, updatePayload, type, oldProps, newProps); // Update the props handle so that we know which props are the ones with // with current event handlers. updateFiberProps(domElement, newProps); } function resetTextContent(domElement) { setTextContent(domElement, ''); } function commitTextUpdate(textInstance, oldText, newText) { textInstance.nodeValue = newText; } function appendChild(parentInstance, child) { parentInstance.appendChild(child); } function appendChildToContainer(container, child) { var parentNode; if (container.nodeType === COMMENT_NODE) { parentNode = container.parentNode; parentNode.insertBefore(child, container); } else { parentNode = container; parentNode.appendChild(child); } // This container might be used for a portal. // If something inside a portal is clicked, that click should bubble // through the React tree. However, on Mobile Safari the click would // never bubble through the *DOM* tree unless an ancestor with onclick // event exists. So we wouldn't see it and dispatch it. // This is why we ensure that non React root containers have inline onclick // defined. // https://github.com/facebook/react/issues/11918 var reactRootContainer = container._reactRootContainer; if ((reactRootContainer === null || reactRootContainer === undefined) && parentNode.onclick === null) { // TODO: This cast may not be sound for SVG, MathML or custom elements. trapClickOnNonInteractiveElement(parentNode); } } function insertBefore(parentInstance, child, beforeChild) { parentInstance.insertBefore(child, beforeChild); } function insertInContainerBefore(container, child, beforeChild) { if (container.nodeType === COMMENT_NODE) { container.parentNode.insertBefore(child, beforeChild); } else { container.insertBefore(child, beforeChild); } } function removeChild(parentInstance, child) { parentInstance.removeChild(child); } function removeChildFromContainer(container, child) { if (container.nodeType === COMMENT_NODE) { container.parentNode.removeChild(child); } else { container.removeChild(child); } } function clearSuspenseBoundary(parentInstance, suspenseInstance) { var node = suspenseInstance; // Delete all nodes within this suspense boundary. // There might be nested nodes so we need to keep track of how // deep we are and only break out when we're back on top. var depth = 0; do { var nextNode = node.nextSibling; parentInstance.removeChild(node); if (nextNode && nextNode.nodeType === COMMENT_NODE) { var data = nextNode.data; if (data === SUSPENSE_END_DATA) { if (depth === 0) { parentInstance.removeChild(nextNode); // Retry if any event replaying was blocked on this. retryIfBlockedOn(suspenseInstance); return; } else { depth--; } } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_PENDING_START_DATA || data === SUSPENSE_FALLBACK_START_DATA) { depth++; } } node = nextNode; } while (node); // TODO: Warn, we didn't find the end comment boundary. // Retry if any event replaying was blocked on this. retryIfBlockedOn(suspenseInstance); } function clearSuspenseBoundaryFromContainer(container, suspenseInstance) { if (container.nodeType === COMMENT_NODE) { clearSuspenseBoundary(container.parentNode, suspenseInstance); } else if (container.nodeType === ELEMENT_NODE) { clearSuspenseBoundary(container, suspenseInstance); } // Retry if any event replaying was blocked on this. retryIfBlockedOn(container); } function hideInstance(instance) { // TODO: Does this work for all element types? What about MathML? Should we // pass host context to this method? instance = instance; var style = instance.style; if (typeof style.setProperty === 'function') { style.setProperty('display', 'none', 'important'); } else { style.display = 'none'; } } function hideTextInstance(textInstance) { textInstance.nodeValue = ''; } function unhideInstance(instance, props) { instance = instance; var styleProp = props[STYLE$1]; var display = styleProp !== undefined && styleProp !== null && styleProp.hasOwnProperty('display') ? styleProp.display : null; instance.style.display = dangerousStyleValue('display', display); } function unhideTextInstance(textInstance, text) { textInstance.nodeValue = text; } function clearContainer(container) { if (container.nodeType === ELEMENT_NODE) { container.textContent = ''; } else if (container.nodeType === DOCUMENT_NODE) { if (container.documentElement) { container.removeChild(container.documentElement); } } } // ------------------- function canHydrateInstance(instance, type, props) { if (instance.nodeType !== ELEMENT_NODE || type.toLowerCase() !== instance.nodeName.toLowerCase()) { return null; } // This has now been refined to an element node. return instance; } function canHydrateTextInstance(instance, text) { if (text === '' || instance.nodeType !== TEXT_NODE) { // Empty strings are not parsed by HTML so there won't be a correct match here. return null; } // This has now been refined to a text node. return instance; } function canHydrateSuspenseInstance(instance) { if (instance.nodeType !== COMMENT_NODE) { // Empty strings are not parsed by HTML so there won't be a correct match here. return null; } // This has now been refined to a suspense node. return instance; } function isSuspenseInstancePending(instance) { return instance.data === SUSPENSE_PENDING_START_DATA; } function isSuspenseInstanceFallback(instance) { return instance.data === SUSPENSE_FALLBACK_START_DATA; } function getSuspenseInstanceFallbackErrorDetails(instance) { var dataset = instance.nextSibling && instance.nextSibling.dataset; var digest, message, stack; if (dataset) { digest = dataset.dgst; { message = dataset.msg; stack = dataset.stck; } } { return { message: message, digest: digest, stack: stack }; } // let value = {message: undefined, hash: undefined}; // const nextSibling = instance.nextSibling; // if (nextSibling) { // const dataset = ((nextSibling: any): HTMLTemplateElement).dataset; // value.message = dataset.msg; // value.hash = dataset.hash; // if (true) { // value.stack = dataset.stack; // } // } // return value; } function registerSuspenseInstanceRetry(instance, callback) { instance._reactRetry = callback; } function getNextHydratable(node) { // Skip non-hydratable nodes. for (; node != null; node = node.nextSibling) { var nodeType = node.nodeType; if (nodeType === ELEMENT_NODE || nodeType === TEXT_NODE) { break; } if (nodeType === COMMENT_NODE) { var nodeData = node.data; if (nodeData === SUSPENSE_START_DATA || nodeData === SUSPENSE_FALLBACK_START_DATA || nodeData === SUSPENSE_PENDING_START_DATA) { break; } if (nodeData === SUSPENSE_END_DATA) { return null; } } } return node; } function getNextHydratableSibling(instance) { return getNextHydratable(instance.nextSibling); } function getFirstHydratableChild(parentInstance) { return getNextHydratable(parentInstance.firstChild); } function getFirstHydratableChildWithinContainer(parentContainer) { return getNextHydratable(parentContainer.firstChild); } function getFirstHydratableChildWithinSuspenseInstance(parentInstance) { return getNextHydratable(parentInstance.nextSibling); } function hydrateInstance(instance, type, props, rootContainerInstance, hostContext, internalInstanceHandle, shouldWarnDev) { precacheFiberNode(internalInstanceHandle, instance); // TODO: Possibly defer this until the commit phase where all the events // get attached. updateFiberProps(instance, props); var parentNamespace; { var hostContextDev = hostContext; parentNamespace = hostContextDev.namespace; } // TODO: Temporary hack to check if we're in a concurrent root. We can delete // when the legacy root API is removed. var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode; return diffHydratedProperties(instance, type, props, parentNamespace, rootContainerInstance, isConcurrentMode, shouldWarnDev); } function hydrateTextInstance(textInstance, text, internalInstanceHandle, shouldWarnDev) { precacheFiberNode(internalInstanceHandle, textInstance); // TODO: Temporary hack to check if we're in a concurrent root. We can delete // when the legacy root API is removed. var isConcurrentMode = (internalInstanceHandle.mode & ConcurrentMode) !== NoMode; return diffHydratedText(textInstance, text); } function hydrateSuspenseInstance(suspenseInstance, internalInstanceHandle) { precacheFiberNode(internalInstanceHandle, suspenseInstance); } function getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance) { var node = suspenseInstance.nextSibling; // Skip past all nodes within this suspense boundary. // There might be nested nodes so we need to keep track of how // deep we are and only break out when we're back on top. var depth = 0; while (node) { if (node.nodeType === COMMENT_NODE) { var data = node.data; if (data === SUSPENSE_END_DATA) { if (depth === 0) { return getNextHydratableSibling(node); } else { depth--; } } else if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) { depth++; } } node = node.nextSibling; } // TODO: Warn, we didn't find the end comment boundary. return null; } // Returns the SuspenseInstance if this node is a direct child of a // SuspenseInstance. I.e. if its previous sibling is a Comment with // SUSPENSE_x_START_DATA. Otherwise, null. function getParentSuspenseInstance(targetInstance) { var node = targetInstance.previousSibling; // Skip past all nodes within this suspense boundary. // There might be nested nodes so we need to keep track of how // deep we are and only break out when we're back on top. var depth = 0; while (node) { if (node.nodeType === COMMENT_NODE) { var data = node.data; if (data === SUSPENSE_START_DATA || data === SUSPENSE_FALLBACK_START_DATA || data === SUSPENSE_PENDING_START_DATA) { if (depth === 0) { return node; } else { depth--; } } else if (data === SUSPENSE_END_DATA) { depth++; } } node = node.previousSibling; } return null; } function commitHydratedContainer(container) { // Retry if any event replaying was blocked on this. retryIfBlockedOn(container); } function commitHydratedSuspenseInstance(suspenseInstance) { // Retry if any event replaying was blocked on this. retryIfBlockedOn(suspenseInstance); } function shouldDeleteUnhydratedTailInstances(parentType) { return parentType !== 'head' && parentType !== 'body'; } function didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, text, isConcurrentMode) { var shouldWarnDev = true; checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev); } function didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, text, isConcurrentMode) { if (parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { var shouldWarnDev = true; checkForUnmatchedText(textInstance.nodeValue, text, isConcurrentMode, shouldWarnDev); } } function didNotHydrateInstanceWithinContainer(parentContainer, instance) { { if (instance.nodeType === ELEMENT_NODE) { warnForDeletedHydratableElement(parentContainer, instance); } else if (instance.nodeType === COMMENT_NODE) ; else { warnForDeletedHydratableText(parentContainer, instance); } } } function didNotHydrateInstanceWithinSuspenseInstance(parentInstance, instance) { { // $FlowFixMe: Only Element or Document can be parent nodes. var parentNode = parentInstance.parentNode; if (parentNode !== null) { if (instance.nodeType === ELEMENT_NODE) { warnForDeletedHydratableElement(parentNode, instance); } else if (instance.nodeType === COMMENT_NODE) ; else { warnForDeletedHydratableText(parentNode, instance); } } } } function didNotHydrateInstance(parentType, parentProps, parentInstance, instance, isConcurrentMode) { { if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { if (instance.nodeType === ELEMENT_NODE) { warnForDeletedHydratableElement(parentInstance, instance); } else if (instance.nodeType === COMMENT_NODE) ; else { warnForDeletedHydratableText(parentInstance, instance); } } } } function didNotFindHydratableInstanceWithinContainer(parentContainer, type, props) { { warnForInsertedHydratedElement(parentContainer, type); } } function didNotFindHydratableTextInstanceWithinContainer(parentContainer, text) { { warnForInsertedHydratedText(parentContainer, text); } } function didNotFindHydratableInstanceWithinSuspenseInstance(parentInstance, type, props) { { // $FlowFixMe: Only Element or Document can be parent nodes. var parentNode = parentInstance.parentNode; if (parentNode !== null) warnForInsertedHydratedElement(parentNode, type); } } function didNotFindHydratableTextInstanceWithinSuspenseInstance(parentInstance, text) { { // $FlowFixMe: Only Element or Document can be parent nodes. var parentNode = parentInstance.parentNode; if (parentNode !== null) warnForInsertedHydratedText(parentNode, text); } } function didNotFindHydratableInstance(parentType, parentProps, parentInstance, type, props, isConcurrentMode) { { if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { warnForInsertedHydratedElement(parentInstance, type); } } } function didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, text, isConcurrentMode) { { if (isConcurrentMode || parentProps[SUPPRESS_HYDRATION_WARNING$1] !== true) { warnForInsertedHydratedText(parentInstance, text); } } } function errorHydratingContainer(parentContainer) { { // TODO: This gets logged by onRecoverableError, too, so we should be // able to remove it. error('An error occurred during hydration. The server HTML was replaced with client content in <%s>.', parentContainer.nodeName.toLowerCase()); } } function preparePortalMount(portalInstance) { listenToAllSupportedEvents(portalInstance); } var randomKey = Math.random().toString(36).slice(2); var internalInstanceKey = '__reactFiber$' + randomKey; var internalPropsKey = '__reactProps$' + randomKey; var internalContainerInstanceKey = '__reactContainer$' + randomKey; var internalEventHandlersKey = '__reactEvents$' + randomKey; var internalEventHandlerListenersKey = '__reactListeners$' + randomKey; var internalEventHandlesSetKey = '__reactHandles$' + randomKey; function detachDeletedInstance(node) { // TODO: This function is only called on host components. I don't think all of // these fields are relevant. delete node[internalInstanceKey]; delete node[internalPropsKey]; delete node[internalEventHandlersKey]; delete node[internalEventHandlerListenersKey]; delete node[internalEventHandlesSetKey]; } function precacheFiberNode(hostInst, node) { node[internalInstanceKey] = hostInst; } function markContainerAsRoot(hostRoot, node) { node[internalContainerInstanceKey] = hostRoot; } function unmarkContainerAsRoot(node) { node[internalContainerInstanceKey] = null; } function isContainerMarkedAsRoot(node) { return !!node[internalContainerInstanceKey]; } // Given a DOM node, return the closest HostComponent or HostText fiber ancestor. // If the target node is part of a hydrated or not yet rendered subtree, then // this may also return a SuspenseComponent or HostRoot to indicate that. // Conceptually the HostRoot fiber is a child of the Container node. So if you // pass the Container node as the targetNode, you will not actually get the // HostRoot back. To get to the HostRoot, you need to pass a child of it. // The same thing applies to Suspense boundaries. function getClosestInstanceFromNode(targetNode) { var targetInst = targetNode[internalInstanceKey]; if (targetInst) { // Don't return HostRoot or SuspenseComponent here. return targetInst; } // If the direct event target isn't a React owned DOM node, we need to look // to see if one of its parents is a React owned DOM node. var parentNode = targetNode.parentNode; while (parentNode) { // We'll check if this is a container root that could include // React nodes in the future. We need to check this first because // if we're a child of a dehydrated container, we need to first // find that inner container before moving on to finding the parent // instance. Note that we don't check this field on the targetNode // itself because the fibers are conceptually between the container // node and the first child. It isn't surrounding the container node. // If it's not a container, we check if it's an instance. targetInst = parentNode[internalContainerInstanceKey] || parentNode[internalInstanceKey]; if (targetInst) { // Since this wasn't the direct target of the event, we might have // stepped past dehydrated DOM nodes to get here. However they could // also have been non-React nodes. We need to answer which one. // If we the instance doesn't have any children, then there can't be // a nested suspense boundary within it. So we can use this as a fast // bailout. Most of the time, when people add non-React children to // the tree, it is using a ref to a child-less DOM node. // Normally we'd only need to check one of the fibers because if it // has ever gone from having children to deleting them or vice versa // it would have deleted the dehydrated boundary nested inside already. // However, since the HostRoot starts out with an alternate it might // have one on the alternate so we need to check in case this was a // root. var alternate = targetInst.alternate; if (targetInst.child !== null || alternate !== null && alternate.child !== null) { // Next we need to figure out if the node that skipped past is // nested within a dehydrated boundary and if so, which one. var suspenseInstance = getParentSuspenseInstance(targetNode); while (suspenseInstance !== null) { // We found a suspense instance. That means that we haven't // hydrated it yet. Even though we leave the comments in the // DOM after hydrating, and there are boundaries in the DOM // that could already be hydrated, we wouldn't have found them // through this pass since if the target is hydrated it would // have had an internalInstanceKey on it. // Let's get the fiber associated with the SuspenseComponent // as the deepest instance. var targetSuspenseInst = suspenseInstance[internalInstanceKey]; if (targetSuspenseInst) { return targetSuspenseInst; } // If we don't find a Fiber on the comment, it might be because // we haven't gotten to hydrate it yet. There might still be a // parent boundary that hasn't above this one so we need to find // the outer most that is known. suspenseInstance = getParentSuspenseInstance(suspenseInstance); // If we don't find one, then that should mean that the parent // host component also hasn't hydrated yet. We can return it // below since it will bail out on the isMounted check later. } } return targetInst; } targetNode = parentNode; parentNode = targetNode.parentNode; } return null; } /** * Given a DOM node, return the ReactDOMComponent or ReactDOMTextComponent * instance, or null if the node was not rendered by this React. */ function getInstanceFromNode(node) { var inst = node[internalInstanceKey] || node[internalContainerInstanceKey]; if (inst) { if (inst.tag === HostComponent || inst.tag === HostText || inst.tag === SuspenseComponent || inst.tag === HostRoot) { return inst; } else { return null; } } return null; } /** * Given a ReactDOMComponent or ReactDOMTextComponent, return the corresponding * DOM node. */ function getNodeFromInstance(inst) { if (inst.tag === HostComponent || inst.tag === HostText) { // In Fiber this, is just the state node right now. We assume it will be // a host component or host text. return inst.stateNode; } // Without this first invariant, passing a non-DOM-component triggers the next // invariant for a missing parent, which is super confusing. throw new Error('getNodeFromInstance: Invalid argument.'); } function getFiberCurrentPropsFromNode(node) { return node[internalPropsKey] || null; } function updateFiberProps(node, props) { node[internalPropsKey] = props; } function getEventListenerSet(node) { var elementListenerSet = node[internalEventHandlersKey]; if (elementListenerSet === undefined) { elementListenerSet = node[internalEventHandlersKey] = new Set(); } return elementListenerSet; } var loggedTypeFailures = {}; var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); ReactDebugCurrentFrame$1.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame$1.setExtraStackFrame(null); } } } function checkPropTypes(typeSpecs, values, location, componentName, element) { { // $FlowFixMe This is okay but Flow doesn't know it. var has = Function.call.bind(hasOwnProperty); for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. if (typeof typeSpecs[typeSpecName] !== 'function') { // eslint-disable-next-line react-internal/prod-error-codes var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); err.name = 'Invariant Violation'; throw err; } error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); } catch (ex) { error$1 = ex; } if (error$1 && !(error$1 instanceof Error)) { setCurrentlyValidatingElement(element); error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); setCurrentlyValidatingElement(null); } if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error$1.message] = true; setCurrentlyValidatingElement(element); error('Failed %s type: %s', location, error$1.message); setCurrentlyValidatingElement(null); } } } } } var valueStack = []; var fiberStack; { fiberStack = []; } var index = -1; function createCursor(defaultValue) { return { current: defaultValue }; } function pop(cursor, fiber) { if (index < 0) { { error('Unexpected pop.'); } return; } { if (fiber !== fiberStack[index]) { error('Unexpected Fiber popped.'); } } cursor.current = valueStack[index]; valueStack[index] = null; { fiberStack[index] = null; } index--; } function push(cursor, value, fiber) { index++; valueStack[index] = cursor.current; { fiberStack[index] = fiber; } cursor.current = value; } var warnedAboutMissingGetChildContext; { warnedAboutMissingGetChildContext = {}; } var emptyContextObject = {}; { Object.freeze(emptyContextObject); } // A cursor to the current merged context object on the stack. var contextStackCursor = createCursor(emptyContextObject); // A cursor to a boolean indicating whether the context has changed. var didPerformWorkStackCursor = createCursor(false); // Keep track of the previous context object that was on the stack. // We use this to get access to the parent context after we have already // pushed the next context provider, and now need to merge their contexts. var previousContext = emptyContextObject; function getUnmaskedContext(workInProgress, Component, didPushOwnContextIfProvider) { { if (didPushOwnContextIfProvider && isContextProvider(Component)) { // If the fiber is a context provider itself, when we read its context // we may have already pushed its own child context on the stack. A context // provider should not "see" its own child context. Therefore we read the // previous (parent) context instead for a context provider. return previousContext; } return contextStackCursor.current; } } function cacheContext(workInProgress, unmaskedContext, maskedContext) { { var instance = workInProgress.stateNode; instance.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext; instance.__reactInternalMemoizedMaskedChildContext = maskedContext; } } function getMaskedContext(workInProgress, unmaskedContext) { { var type = workInProgress.type; var contextTypes = type.contextTypes; if (!contextTypes) { return emptyContextObject; } // Avoid recreating masked context unless unmasked context has changed. // Failing to do this will result in unnecessary calls to componentWillReceiveProps. // This may trigger infinite loops if componentWillReceiveProps calls setState. var instance = workInProgress.stateNode; if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) { return instance.__reactInternalMemoizedMaskedChildContext; } var context = {}; for (var key in contextTypes) { context[key] = unmaskedContext[key]; } { var name = getComponentNameFromFiber(workInProgress) || 'Unknown'; checkPropTypes(contextTypes, context, 'context', name); } // Cache unmasked context so we can avoid recreating masked context unless necessary. // Context is created before the class component is instantiated so check for instance. if (instance) { cacheContext(workInProgress, unmaskedContext, context); } return context; } } function hasContextChanged() { { return didPerformWorkStackCursor.current; } } function isContextProvider(type) { { var childContextTypes = type.childContextTypes; return childContextTypes !== null && childContextTypes !== undefined; } } function popContext(fiber) { { pop(didPerformWorkStackCursor, fiber); pop(contextStackCursor, fiber); } } function popTopLevelContextObject(fiber) { { pop(didPerformWorkStackCursor, fiber); pop(contextStackCursor, fiber); } } function pushTopLevelContextObject(fiber, context, didChange) { { if (contextStackCursor.current !== emptyContextObject) { throw new Error('Unexpected context found on stack. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } push(contextStackCursor, context, fiber); push(didPerformWorkStackCursor, didChange, fiber); } } function processChildContext(fiber, type, parentContext) { { var instance = fiber.stateNode; var childContextTypes = type.childContextTypes; // TODO (bvaughn) Replace this behavior with an invariant() in the future. // It has only been added in Fiber to match the (unintentional) behavior in Stack. if (typeof instance.getChildContext !== 'function') { { var componentName = getComponentNameFromFiber(fiber) || 'Unknown'; if (!warnedAboutMissingGetChildContext[componentName]) { warnedAboutMissingGetChildContext[componentName] = true; error('%s.childContextTypes is specified but there is no getChildContext() method ' + 'on the instance. You can either define getChildContext() on %s or remove ' + 'childContextTypes from it.', componentName, componentName); } } return parentContext; } var childContext = instance.getChildContext(); for (var contextKey in childContext) { if (!(contextKey in childContextTypes)) { throw new Error((getComponentNameFromFiber(fiber) || 'Unknown') + ".getChildContext(): key \"" + contextKey + "\" is not defined in childContextTypes."); } } { var name = getComponentNameFromFiber(fiber) || 'Unknown'; checkPropTypes(childContextTypes, childContext, 'child context', name); } return assign({}, parentContext, childContext); } } function pushContextProvider(workInProgress) { { var instance = workInProgress.stateNode; // We push the context as early as possible to ensure stack integrity. // If the instance does not exist yet, we will push null at first, // and replace it on the stack later when invalidating the context. var memoizedMergedChildContext = instance && instance.__reactInternalMemoizedMergedChildContext || emptyContextObject; // Remember the parent context so we can merge with it later. // Inherit the parent's did-perform-work value to avoid inadvertently blocking updates. previousContext = contextStackCursor.current; push(contextStackCursor, memoizedMergedChildContext, workInProgress); push(didPerformWorkStackCursor, didPerformWorkStackCursor.current, workInProgress); return true; } } function invalidateContextProvider(workInProgress, type, didChange) { { var instance = workInProgress.stateNode; if (!instance) { throw new Error('Expected to have an instance by this point. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } if (didChange) { // Merge parent and own context. // Skip this if we're not updating due to sCU. // This avoids unnecessarily recomputing memoized values. var mergedContext = processChildContext(workInProgress, type, previousContext); instance.__reactInternalMemoizedMergedChildContext = mergedContext; // Replace the old (or empty) context with the new one. // It is important to unwind the context in the reverse order. pop(didPerformWorkStackCursor, workInProgress); pop(contextStackCursor, workInProgress); // Now push the new context and mark that it has changed. push(contextStackCursor, mergedContext, workInProgress); push(didPerformWorkStackCursor, didChange, workInProgress); } else { pop(didPerformWorkStackCursor, workInProgress); push(didPerformWorkStackCursor, didChange, workInProgress); } } } function findCurrentUnmaskedContext(fiber) { { // Currently this is only used with renderSubtreeIntoContainer; not sure if it // makes sense elsewhere if (!isFiberMounted(fiber) || fiber.tag !== ClassComponent) { throw new Error('Expected subtree parent to be a mounted class component. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } var node = fiber; do { switch (node.tag) { case HostRoot: return node.stateNode.context; case ClassComponent: { var Component = node.type; if (isContextProvider(Component)) { return node.stateNode.__reactInternalMemoizedMergedChildContext; } break; } } node = node.return; } while (node !== null); throw new Error('Found unexpected detached subtree parent. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } } var LegacyRoot = 0; var ConcurrentRoot = 1; var syncQueue = null; var includesLegacySyncCallbacks = false; var isFlushingSyncQueue = false; function scheduleSyncCallback(callback) { // Push this callback into an internal queue. We'll flush these either in // the next tick, or earlier if something calls `flushSyncCallbackQueue`. if (syncQueue === null) { syncQueue = [callback]; } else { // Push onto existing queue. Don't need to schedule a callback because // we already scheduled one when we created the queue. syncQueue.push(callback); } } function scheduleLegacySyncCallback(callback) { includesLegacySyncCallbacks = true; scheduleSyncCallback(callback); } function flushSyncCallbacksOnlyInLegacyMode() { // Only flushes the queue if there's a legacy sync callback scheduled. // TODO: There's only a single type of callback: performSyncOnWorkOnRoot. So // it might make more sense for the queue to be a list of roots instead of a // list of generic callbacks. Then we can have two: one for legacy roots, one // for concurrent roots. And this method would only flush the legacy ones. if (includesLegacySyncCallbacks) { flushSyncCallbacks(); } } function flushSyncCallbacks() { if (!isFlushingSyncQueue && syncQueue !== null) { // Prevent re-entrance. isFlushingSyncQueue = true; var i = 0; var previousUpdatePriority = getCurrentUpdatePriority(); try { var isSync = true; var queue = syncQueue; // TODO: Is this necessary anymore? The only user code that runs in this // queue is in the render or commit phases. setCurrentUpdatePriority(DiscreteEventPriority); for (; i < queue.length; i++) { var callback = queue[i]; do { callback = callback(isSync); } while (callback !== null); } syncQueue = null; includesLegacySyncCallbacks = false; } catch (error) { // If something throws, leave the remaining callbacks on the queue. if (syncQueue !== null) { syncQueue = syncQueue.slice(i + 1); } // Resume flushing in the next tick scheduleCallback(ImmediatePriority, flushSyncCallbacks); throw error; } finally { setCurrentUpdatePriority(previousUpdatePriority); isFlushingSyncQueue = false; } } return null; } // TODO: Use the unified fiber stack module instead of this local one? // Intentionally not using it yet to derisk the initial implementation, because // the way we push/pop these values is a bit unusual. If there's a mistake, I'd // rather the ids be wrong than crash the whole reconciler. var forkStack = []; var forkStackIndex = 0; var treeForkProvider = null; var treeForkCount = 0; var idStack = []; var idStackIndex = 0; var treeContextProvider = null; var treeContextId = 1; var treeContextOverflow = ''; function isForkedChild(workInProgress) { warnIfNotHydrating(); return (workInProgress.flags & Forked) !== NoFlags; } function getForksAtLevel(workInProgress) { warnIfNotHydrating(); return treeForkCount; } function getTreeId() { var overflow = treeContextOverflow; var idWithLeadingBit = treeContextId; var id = idWithLeadingBit & ~getLeadingBit(idWithLeadingBit); return id.toString(32) + overflow; } function pushTreeFork(workInProgress, totalChildren) { // This is called right after we reconcile an array (or iterator) of child // fibers, because that's the only place where we know how many children in // the whole set without doing extra work later, or storing addtional // information on the fiber. // // That's why this function is separate from pushTreeId — it's called during // the render phase of the fork parent, not the child, which is where we push // the other context values. // // In the Fizz implementation this is much simpler because the child is // rendered in the same callstack as the parent. // // It might be better to just add a `forks` field to the Fiber type. It would // make this module simpler. warnIfNotHydrating(); forkStack[forkStackIndex++] = treeForkCount; forkStack[forkStackIndex++] = treeForkProvider; treeForkProvider = workInProgress; treeForkCount = totalChildren; } function pushTreeId(workInProgress, totalChildren, index) { warnIfNotHydrating(); idStack[idStackIndex++] = treeContextId; idStack[idStackIndex++] = treeContextOverflow; idStack[idStackIndex++] = treeContextProvider; treeContextProvider = workInProgress; var baseIdWithLeadingBit = treeContextId; var baseOverflow = treeContextOverflow; // The leftmost 1 marks the end of the sequence, non-inclusive. It's not part // of the id; we use it to account for leading 0s. var baseLength = getBitLength(baseIdWithLeadingBit) - 1; var baseId = baseIdWithLeadingBit & ~(1 << baseLength); var slot = index + 1; var length = getBitLength(totalChildren) + baseLength; // 30 is the max length we can store without overflowing, taking into // consideration the leading 1 we use to mark the end of the sequence. if (length > 30) { // We overflowed the bitwise-safe range. Fall back to slower algorithm. // This branch assumes the length of the base id is greater than 5; it won't // work for smaller ids, because you need 5 bits per character. // // We encode the id in multiple steps: first the base id, then the // remaining digits. // // Each 5 bit sequence corresponds to a single base 32 character. So for // example, if the current id is 23 bits long, we can convert 20 of those // bits into a string of 4 characters, with 3 bits left over. // // First calculate how many bits in the base id represent a complete // sequence of characters. var numberOfOverflowBits = baseLength - baseLength % 5; // Then create a bitmask that selects only those bits. var newOverflowBits = (1 << numberOfOverflowBits) - 1; // Select the bits, and convert them to a base 32 string. var newOverflow = (baseId & newOverflowBits).toString(32); // Now we can remove those bits from the base id. var restOfBaseId = baseId >> numberOfOverflowBits; var restOfBaseLength = baseLength - numberOfOverflowBits; // Finally, encode the rest of the bits using the normal algorithm. Because // we made more room, this time it won't overflow. var restOfLength = getBitLength(totalChildren) + restOfBaseLength; var restOfNewBits = slot << restOfBaseLength; var id = restOfNewBits | restOfBaseId; var overflow = newOverflow + baseOverflow; treeContextId = 1 << restOfLength | id; treeContextOverflow = overflow; } else { // Normal path var newBits = slot << baseLength; var _id = newBits | baseId; var _overflow = baseOverflow; treeContextId = 1 << length | _id; treeContextOverflow = _overflow; } } function pushMaterializedTreeId(workInProgress) { warnIfNotHydrating(); // This component materialized an id. This will affect any ids that appear // in its children. var returnFiber = workInProgress.return; if (returnFiber !== null) { var numberOfForks = 1; var slotIndex = 0; pushTreeFork(workInProgress, numberOfForks); pushTreeId(workInProgress, numberOfForks, slotIndex); } } function getBitLength(number) { return 32 - clz32(number); } function getLeadingBit(id) { return 1 << getBitLength(id) - 1; } function popTreeContext(workInProgress) { // Restore the previous values. // This is a bit more complicated than other context-like modules in Fiber // because the same Fiber may appear on the stack multiple times and for // different reasons. We have to keep popping until the work-in-progress is // no longer at the top of the stack. while (workInProgress === treeForkProvider) { treeForkProvider = forkStack[--forkStackIndex]; forkStack[forkStackIndex] = null; treeForkCount = forkStack[--forkStackIndex]; forkStack[forkStackIndex] = null; } while (workInProgress === treeContextProvider) { treeContextProvider = idStack[--idStackIndex]; idStack[idStackIndex] = null; treeContextOverflow = idStack[--idStackIndex]; idStack[idStackIndex] = null; treeContextId = idStack[--idStackIndex]; idStack[idStackIndex] = null; } } function getSuspendedTreeContext() { warnIfNotHydrating(); if (treeContextProvider !== null) { return { id: treeContextId, overflow: treeContextOverflow }; } else { return null; } } function restoreSuspendedTreeContext(workInProgress, suspendedContext) { warnIfNotHydrating(); idStack[idStackIndex++] = treeContextId; idStack[idStackIndex++] = treeContextOverflow; idStack[idStackIndex++] = treeContextProvider; treeContextId = suspendedContext.id; treeContextOverflow = suspendedContext.overflow; treeContextProvider = workInProgress; } function warnIfNotHydrating() { { if (!getIsHydrating()) { error('Expected to be hydrating. This is a bug in React. Please file ' + 'an issue.'); } } } // This may have been an insertion or a hydration. var hydrationParentFiber = null; var nextHydratableInstance = null; var isHydrating = false; // This flag allows for warning supression when we expect there to be mismatches // due to earlier mismatches or a suspended fiber. var didSuspendOrErrorDEV = false; // Hydration errors that were thrown inside this boundary var hydrationErrors = null; function warnIfHydrating() { { if (isHydrating) { error('We should not be hydrating here. This is a bug in React. Please file a bug.'); } } } function markDidThrowWhileHydratingDEV() { { didSuspendOrErrorDEV = true; } } function didSuspendOrErrorWhileHydratingDEV() { { return didSuspendOrErrorDEV; } } function enterHydrationState(fiber) { var parentInstance = fiber.stateNode.containerInfo; nextHydratableInstance = getFirstHydratableChildWithinContainer(parentInstance); hydrationParentFiber = fiber; isHydrating = true; hydrationErrors = null; didSuspendOrErrorDEV = false; return true; } function reenterHydrationStateFromDehydratedSuspenseInstance(fiber, suspenseInstance, treeContext) { nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(suspenseInstance); hydrationParentFiber = fiber; isHydrating = true; hydrationErrors = null; didSuspendOrErrorDEV = false; if (treeContext !== null) { restoreSuspendedTreeContext(fiber, treeContext); } return true; } function warnUnhydratedInstance(returnFiber, instance) { { switch (returnFiber.tag) { case HostRoot: { didNotHydrateInstanceWithinContainer(returnFiber.stateNode.containerInfo, instance); break; } case HostComponent: { var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode; didNotHydrateInstance(returnFiber.type, returnFiber.memoizedProps, returnFiber.stateNode, instance, // TODO: Delete this argument when we remove the legacy root API. isConcurrentMode); break; } case SuspenseComponent: { var suspenseState = returnFiber.memoizedState; if (suspenseState.dehydrated !== null) didNotHydrateInstanceWithinSuspenseInstance(suspenseState.dehydrated, instance); break; } } } } function deleteHydratableInstance(returnFiber, instance) { warnUnhydratedInstance(returnFiber, instance); var childToDelete = createFiberFromHostInstanceForDeletion(); childToDelete.stateNode = instance; childToDelete.return = returnFiber; var deletions = returnFiber.deletions; if (deletions === null) { returnFiber.deletions = [childToDelete]; returnFiber.flags |= ChildDeletion; } else { deletions.push(childToDelete); } } function warnNonhydratedInstance(returnFiber, fiber) { { if (didSuspendOrErrorDEV) { // Inside a boundary that already suspended. We're currently rendering the // siblings of a suspended node. The mismatch may be due to the missing // data, so it's probably a false positive. return; } switch (returnFiber.tag) { case HostRoot: { var parentContainer = returnFiber.stateNode.containerInfo; switch (fiber.tag) { case HostComponent: var type = fiber.type; var props = fiber.pendingProps; didNotFindHydratableInstanceWithinContainer(parentContainer, type); break; case HostText: var text = fiber.pendingProps; didNotFindHydratableTextInstanceWithinContainer(parentContainer, text); break; } break; } case HostComponent: { var parentType = returnFiber.type; var parentProps = returnFiber.memoizedProps; var parentInstance = returnFiber.stateNode; switch (fiber.tag) { case HostComponent: { var _type = fiber.type; var _props = fiber.pendingProps; var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode; didNotFindHydratableInstance(parentType, parentProps, parentInstance, _type, _props, // TODO: Delete this argument when we remove the legacy root API. isConcurrentMode); break; } case HostText: { var _text = fiber.pendingProps; var _isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode; didNotFindHydratableTextInstance(parentType, parentProps, parentInstance, _text, // TODO: Delete this argument when we remove the legacy root API. _isConcurrentMode); break; } } break; } case SuspenseComponent: { var suspenseState = returnFiber.memoizedState; var _parentInstance = suspenseState.dehydrated; if (_parentInstance !== null) switch (fiber.tag) { case HostComponent: var _type2 = fiber.type; var _props2 = fiber.pendingProps; didNotFindHydratableInstanceWithinSuspenseInstance(_parentInstance, _type2); break; case HostText: var _text2 = fiber.pendingProps; didNotFindHydratableTextInstanceWithinSuspenseInstance(_parentInstance, _text2); break; } break; } default: return; } } } function insertNonHydratedInstance(returnFiber, fiber) { fiber.flags = fiber.flags & ~Hydrating | Placement; warnNonhydratedInstance(returnFiber, fiber); } function tryHydrate(fiber, nextInstance) { switch (fiber.tag) { case HostComponent: { var type = fiber.type; var props = fiber.pendingProps; var instance = canHydrateInstance(nextInstance, type); if (instance !== null) { fiber.stateNode = instance; hydrationParentFiber = fiber; nextHydratableInstance = getFirstHydratableChild(instance); return true; } return false; } case HostText: { var text = fiber.pendingProps; var textInstance = canHydrateTextInstance(nextInstance, text); if (textInstance !== null) { fiber.stateNode = textInstance; hydrationParentFiber = fiber; // Text Instances don't have children so there's nothing to hydrate. nextHydratableInstance = null; return true; } return false; } case SuspenseComponent: { var suspenseInstance = canHydrateSuspenseInstance(nextInstance); if (suspenseInstance !== null) { var suspenseState = { dehydrated: suspenseInstance, treeContext: getSuspendedTreeContext(), retryLane: OffscreenLane }; fiber.memoizedState = suspenseState; // Store the dehydrated fragment as a child fiber. // This simplifies the code for getHostSibling and deleting nodes, // since it doesn't have to consider all Suspense boundaries and // check if they're dehydrated ones or not. var dehydratedFragment = createFiberFromDehydratedFragment(suspenseInstance); dehydratedFragment.return = fiber; fiber.child = dehydratedFragment; hydrationParentFiber = fiber; // While a Suspense Instance does have children, we won't step into // it during the first pass. Instead, we'll reenter it later. nextHydratableInstance = null; return true; } return false; } default: return false; } } function shouldClientRenderOnMismatch(fiber) { return (fiber.mode & ConcurrentMode) !== NoMode && (fiber.flags & DidCapture) === NoFlags; } function throwOnHydrationMismatch(fiber) { throw new Error('Hydration failed because the initial UI does not match what was ' + 'rendered on the server.'); } function tryToClaimNextHydratableInstance(fiber) { if (!isHydrating) { return; } var nextInstance = nextHydratableInstance; if (!nextInstance) { if (shouldClientRenderOnMismatch(fiber)) { warnNonhydratedInstance(hydrationParentFiber, fiber); throwOnHydrationMismatch(); } // Nothing to hydrate. Make it an insertion. insertNonHydratedInstance(hydrationParentFiber, fiber); isHydrating = false; hydrationParentFiber = fiber; return; } var firstAttemptedInstance = nextInstance; if (!tryHydrate(fiber, nextInstance)) { if (shouldClientRenderOnMismatch(fiber)) { warnNonhydratedInstance(hydrationParentFiber, fiber); throwOnHydrationMismatch(); } // If we can't hydrate this instance let's try the next one. // We use this as a heuristic. It's based on intuition and not data so it // might be flawed or unnecessary. nextInstance = getNextHydratableSibling(firstAttemptedInstance); var prevHydrationParentFiber = hydrationParentFiber; if (!nextInstance || !tryHydrate(fiber, nextInstance)) { // Nothing to hydrate. Make it an insertion. insertNonHydratedInstance(hydrationParentFiber, fiber); isHydrating = false; hydrationParentFiber = fiber; return; } // We matched the next one, we'll now assume that the first one was // superfluous and we'll delete it. Since we can't eagerly delete it // we'll have to schedule a deletion. To do that, this node needs a dummy // fiber associated with it. deleteHydratableInstance(prevHydrationParentFiber, firstAttemptedInstance); } } function prepareToHydrateHostInstance(fiber, rootContainerInstance, hostContext) { var instance = fiber.stateNode; var shouldWarnIfMismatchDev = !didSuspendOrErrorDEV; var updatePayload = hydrateInstance(instance, fiber.type, fiber.memoizedProps, rootContainerInstance, hostContext, fiber, shouldWarnIfMismatchDev); // TODO: Type this specific to this type of component. fiber.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there // is a new ref we mark this as an update. if (updatePayload !== null) { return true; } return false; } function prepareToHydrateHostTextInstance(fiber) { var textInstance = fiber.stateNode; var textContent = fiber.memoizedProps; var shouldUpdate = hydrateTextInstance(textInstance, textContent, fiber); if (shouldUpdate) { // We assume that prepareToHydrateHostTextInstance is called in a context where the // hydration parent is the parent host component of this host text. var returnFiber = hydrationParentFiber; if (returnFiber !== null) { switch (returnFiber.tag) { case HostRoot: { var parentContainer = returnFiber.stateNode.containerInfo; var isConcurrentMode = (returnFiber.mode & ConcurrentMode) !== NoMode; didNotMatchHydratedContainerTextInstance(parentContainer, textInstance, textContent, // TODO: Delete this argument when we remove the legacy root API. isConcurrentMode); break; } case HostComponent: { var parentType = returnFiber.type; var parentProps = returnFiber.memoizedProps; var parentInstance = returnFiber.stateNode; var _isConcurrentMode2 = (returnFiber.mode & ConcurrentMode) !== NoMode; didNotMatchHydratedTextInstance(parentType, parentProps, parentInstance, textInstance, textContent, // TODO: Delete this argument when we remove the legacy root API. _isConcurrentMode2); break; } } } } return shouldUpdate; } function prepareToHydrateHostSuspenseInstance(fiber) { var suspenseState = fiber.memoizedState; var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null; if (!suspenseInstance) { throw new Error('Expected to have a hydrated suspense instance. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } hydrateSuspenseInstance(suspenseInstance, fiber); } function skipPastDehydratedSuspenseInstance(fiber) { var suspenseState = fiber.memoizedState; var suspenseInstance = suspenseState !== null ? suspenseState.dehydrated : null; if (!suspenseInstance) { throw new Error('Expected to have a hydrated suspense instance. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance); } function popToNextHostParent(fiber) { var parent = fiber.return; while (parent !== null && parent.tag !== HostComponent && parent.tag !== HostRoot && parent.tag !== SuspenseComponent) { parent = parent.return; } hydrationParentFiber = parent; } function popHydrationState(fiber) { if (fiber !== hydrationParentFiber) { // We're deeper than the current hydration context, inside an inserted // tree. return false; } if (!isHydrating) { // If we're not currently hydrating but we're in a hydration context, then // we were an insertion and now need to pop up reenter hydration of our // siblings. popToNextHostParent(fiber); isHydrating = true; return false; } // If we have any remaining hydratable nodes, we need to delete them now. // We only do this deeper than head and body since they tend to have random // other nodes in them. We also ignore components with pure text content in // side of them. We also don't delete anything inside the root container. if (fiber.tag !== HostRoot && (fiber.tag !== HostComponent || shouldDeleteUnhydratedTailInstances(fiber.type) && !shouldSetTextContent(fiber.type, fiber.memoizedProps))) { var nextInstance = nextHydratableInstance; if (nextInstance) { if (shouldClientRenderOnMismatch(fiber)) { warnIfUnhydratedTailNodes(fiber); throwOnHydrationMismatch(); } else { while (nextInstance) { deleteHydratableInstance(fiber, nextInstance); nextInstance = getNextHydratableSibling(nextInstance); } } } } popToNextHostParent(fiber); if (fiber.tag === SuspenseComponent) { nextHydratableInstance = skipPastDehydratedSuspenseInstance(fiber); } else { nextHydratableInstance = hydrationParentFiber ? getNextHydratableSibling(fiber.stateNode) : null; } return true; } function hasUnhydratedTailNodes() { return isHydrating && nextHydratableInstance !== null; } function warnIfUnhydratedTailNodes(fiber) { var nextInstance = nextHydratableInstance; while (nextInstance) { warnUnhydratedInstance(fiber, nextInstance); nextInstance = getNextHydratableSibling(nextInstance); } } function resetHydrationState() { hydrationParentFiber = null; nextHydratableInstance = null; isHydrating = false; didSuspendOrErrorDEV = false; } function upgradeHydrationErrorsToRecoverable() { if (hydrationErrors !== null) { // Successfully completed a forced client render. The errors that occurred // during the hydration attempt are now recovered. We will log them in // commit phase, once the entire tree has finished. queueRecoverableErrors(hydrationErrors); hydrationErrors = null; } } function getIsHydrating() { return isHydrating; } function queueHydrationError(error) { if (hydrationErrors === null) { hydrationErrors = [error]; } else { hydrationErrors.push(error); } } var ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig; var NoTransition = null; function requestCurrentTransition() { return ReactCurrentBatchConfig$1.transition; } var ReactStrictModeWarnings = { recordUnsafeLifecycleWarnings: function (fiber, instance) {}, flushPendingUnsafeLifecycleWarnings: function () {}, recordLegacyContextWarning: function (fiber, instance) {}, flushLegacyContextWarning: function () {}, discardPendingWarnings: function () {} }; { var findStrictRoot = function (fiber) { var maybeStrictRoot = null; var node = fiber; while (node !== null) { if (node.mode & StrictLegacyMode) { maybeStrictRoot = node; } node = node.return; } return maybeStrictRoot; }; var setToSortedString = function (set) { var array = []; set.forEach(function (value) { array.push(value); }); return array.sort().join(', '); }; var pendingComponentWillMountWarnings = []; var pendingUNSAFE_ComponentWillMountWarnings = []; var pendingComponentWillReceivePropsWarnings = []; var pendingUNSAFE_ComponentWillReceivePropsWarnings = []; var pendingComponentWillUpdateWarnings = []; var pendingUNSAFE_ComponentWillUpdateWarnings = []; // Tracks components we have already warned about. var didWarnAboutUnsafeLifecycles = new Set(); ReactStrictModeWarnings.recordUnsafeLifecycleWarnings = function (fiber, instance) { // Dedupe strategy: Warn once per component. if (didWarnAboutUnsafeLifecycles.has(fiber.type)) { return; } if (typeof instance.componentWillMount === 'function' && // Don't warn about react-lifecycles-compat polyfilled components. instance.componentWillMount.__suppressDeprecationWarning !== true) { pendingComponentWillMountWarnings.push(fiber); } if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillMount === 'function') { pendingUNSAFE_ComponentWillMountWarnings.push(fiber); } if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { pendingComponentWillReceivePropsWarnings.push(fiber); } if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillReceiveProps === 'function') { pendingUNSAFE_ComponentWillReceivePropsWarnings.push(fiber); } if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { pendingComponentWillUpdateWarnings.push(fiber); } if (fiber.mode & StrictLegacyMode && typeof instance.UNSAFE_componentWillUpdate === 'function') { pendingUNSAFE_ComponentWillUpdateWarnings.push(fiber); } }; ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings = function () { // We do an initial pass to gather component names var componentWillMountUniqueNames = new Set(); if (pendingComponentWillMountWarnings.length > 0) { pendingComponentWillMountWarnings.forEach(function (fiber) { componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingComponentWillMountWarnings = []; } var UNSAFE_componentWillMountUniqueNames = new Set(); if (pendingUNSAFE_ComponentWillMountWarnings.length > 0) { pendingUNSAFE_ComponentWillMountWarnings.forEach(function (fiber) { UNSAFE_componentWillMountUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingUNSAFE_ComponentWillMountWarnings = []; } var componentWillReceivePropsUniqueNames = new Set(); if (pendingComponentWillReceivePropsWarnings.length > 0) { pendingComponentWillReceivePropsWarnings.forEach(function (fiber) { componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingComponentWillReceivePropsWarnings = []; } var UNSAFE_componentWillReceivePropsUniqueNames = new Set(); if (pendingUNSAFE_ComponentWillReceivePropsWarnings.length > 0) { pendingUNSAFE_ComponentWillReceivePropsWarnings.forEach(function (fiber) { UNSAFE_componentWillReceivePropsUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingUNSAFE_ComponentWillReceivePropsWarnings = []; } var componentWillUpdateUniqueNames = new Set(); if (pendingComponentWillUpdateWarnings.length > 0) { pendingComponentWillUpdateWarnings.forEach(function (fiber) { componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingComponentWillUpdateWarnings = []; } var UNSAFE_componentWillUpdateUniqueNames = new Set(); if (pendingUNSAFE_ComponentWillUpdateWarnings.length > 0) { pendingUNSAFE_ComponentWillUpdateWarnings.forEach(function (fiber) { UNSAFE_componentWillUpdateUniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutUnsafeLifecycles.add(fiber.type); }); pendingUNSAFE_ComponentWillUpdateWarnings = []; } // Finally, we flush all the warnings // UNSAFE_ ones before the deprecated ones, since they'll be 'louder' if (UNSAFE_componentWillMountUniqueNames.size > 0) { var sortedNames = setToSortedString(UNSAFE_componentWillMountUniqueNames); error('Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '\nPlease update the following components: %s', sortedNames); } if (UNSAFE_componentWillReceivePropsUniqueNames.size > 0) { var _sortedNames = setToSortedString(UNSAFE_componentWillReceivePropsUniqueNames); error('Using UNSAFE_componentWillReceiveProps in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, " + 'refactor your code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n' + '\nPlease update the following components: %s', _sortedNames); } if (UNSAFE_componentWillUpdateUniqueNames.size > 0) { var _sortedNames2 = setToSortedString(UNSAFE_componentWillUpdateUniqueNames); error('Using UNSAFE_componentWillUpdate in strict mode is not recommended ' + 'and may indicate bugs in your code. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '\nPlease update the following components: %s', _sortedNames2); } if (componentWillMountUniqueNames.size > 0) { var _sortedNames3 = setToSortedString(componentWillMountUniqueNames); warn('componentWillMount has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move code with side effects to componentDidMount, and set initial state in the constructor.\n' + '* Rename componentWillMount to UNSAFE_componentWillMount to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames3); } if (componentWillReceivePropsUniqueNames.size > 0) { var _sortedNames4 = setToSortedString(componentWillReceivePropsUniqueNames); warn('componentWillReceiveProps has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + "* If you're updating state whenever props change, refactor your " + 'code to use memoization techniques or move it to ' + 'static getDerivedStateFromProps. Learn more at: https://reactjs.org/link/derived-state\n' + '* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames4); } if (componentWillUpdateUniqueNames.size > 0) { var _sortedNames5 = setToSortedString(componentWillUpdateUniqueNames); warn('componentWillUpdate has been renamed, and is not recommended for use. ' + 'See https://reactjs.org/link/unsafe-component-lifecycles for details.\n\n' + '* Move data fetching code or side effects to componentDidUpdate.\n' + '* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress ' + 'this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. ' + 'To rename all deprecated lifecycles to their new names, you can run ' + '`npx react-codemod rename-unsafe-lifecycles` in your project source folder.\n' + '\nPlease update the following components: %s', _sortedNames5); } }; var pendingLegacyContextWarning = new Map(); // Tracks components we have already warned about. var didWarnAboutLegacyContext = new Set(); ReactStrictModeWarnings.recordLegacyContextWarning = function (fiber, instance) { var strictRoot = findStrictRoot(fiber); if (strictRoot === null) { error('Expected to find a StrictMode component in a strict mode tree. ' + 'This error is likely caused by a bug in React. Please file an issue.'); return; } // Dedup strategy: Warn once per component. if (didWarnAboutLegacyContext.has(fiber.type)) { return; } var warningsForRoot = pendingLegacyContextWarning.get(strictRoot); if (fiber.type.contextTypes != null || fiber.type.childContextTypes != null || instance !== null && typeof instance.getChildContext === 'function') { if (warningsForRoot === undefined) { warningsForRoot = []; pendingLegacyContextWarning.set(strictRoot, warningsForRoot); } warningsForRoot.push(fiber); } }; ReactStrictModeWarnings.flushLegacyContextWarning = function () { pendingLegacyContextWarning.forEach(function (fiberArray, strictRoot) { if (fiberArray.length === 0) { return; } var firstFiber = fiberArray[0]; var uniqueNames = new Set(); fiberArray.forEach(function (fiber) { uniqueNames.add(getComponentNameFromFiber(fiber) || 'Component'); didWarnAboutLegacyContext.add(fiber.type); }); var sortedNames = setToSortedString(uniqueNames); try { setCurrentFiber(firstFiber); error('Legacy context API has been detected within a strict-mode tree.' + '\n\nThe old API will be supported in all 16.x releases, but applications ' + 'using it should migrate to the new version.' + '\n\nPlease update the following components: %s' + '\n\nLearn more about this warning here: https://reactjs.org/link/legacy-context', sortedNames); } finally { resetCurrentFiber(); } }); }; ReactStrictModeWarnings.discardPendingWarnings = function () { pendingComponentWillMountWarnings = []; pendingUNSAFE_ComponentWillMountWarnings = []; pendingComponentWillReceivePropsWarnings = []; pendingUNSAFE_ComponentWillReceivePropsWarnings = []; pendingComponentWillUpdateWarnings = []; pendingUNSAFE_ComponentWillUpdateWarnings = []; pendingLegacyContextWarning = new Map(); }; } var didWarnAboutMaps; var didWarnAboutGenerators; var didWarnAboutStringRefs; var ownerHasKeyUseWarning; var ownerHasFunctionTypeWarning; var warnForMissingKey = function (child, returnFiber) {}; { didWarnAboutMaps = false; didWarnAboutGenerators = false; didWarnAboutStringRefs = {}; /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between * updates. */ ownerHasKeyUseWarning = {}; ownerHasFunctionTypeWarning = {}; warnForMissingKey = function (child, returnFiber) { if (child === null || typeof child !== 'object') { return; } if (!child._store || child._store.validated || child.key != null) { return; } if (typeof child._store !== 'object') { throw new Error('React Component in warnForMissingKey should have a _store. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } child._store.validated = true; var componentName = getComponentNameFromFiber(returnFiber) || 'Component'; if (ownerHasKeyUseWarning[componentName]) { return; } ownerHasKeyUseWarning[componentName] = true; error('Each child in a list should have a unique ' + '"key" prop. See https://reactjs.org/link/warning-keys for ' + 'more information.'); }; } function isReactClass(type) { return type.prototype && type.prototype.isReactComponent; } function coerceRef(returnFiber, current, element) { var mixedRef = element.ref; if (mixedRef !== null && typeof mixedRef !== 'function' && typeof mixedRef !== 'object') { { // TODO: Clean this up once we turn on the string ref warning for // everyone, because the strict mode case will no longer be relevant if ((returnFiber.mode & StrictLegacyMode || warnAboutStringRefs) && // We warn in ReactElement.js if owner and self are equal for string refs // because these cannot be automatically converted to an arrow function // using a codemod. Therefore, we don't have to warn about string refs again. !(element._owner && element._self && element._owner.stateNode !== element._self) && // Will already throw with "Function components cannot have string refs" !(element._owner && element._owner.tag !== ClassComponent) && // Will already warn with "Function components cannot be given refs" !(typeof element.type === 'function' && !isReactClass(element.type)) && // Will already throw with "Element ref was specified as a string (someStringRef) but no owner was set" element._owner) { var componentName = getComponentNameFromFiber(returnFiber) || 'Component'; if (!didWarnAboutStringRefs[componentName]) { { error('Component "%s" contains the string ref "%s". Support for string refs ' + 'will be removed in a future major release. We recommend using ' + 'useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, mixedRef); } didWarnAboutStringRefs[componentName] = true; } } } if (element._owner) { var owner = element._owner; var inst; if (owner) { var ownerFiber = owner; if (ownerFiber.tag !== ClassComponent) { throw new Error('Function components cannot have string refs. ' + 'We recommend using useRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref'); } inst = ownerFiber.stateNode; } if (!inst) { throw new Error("Missing owner for string ref " + mixedRef + ". This error is likely caused by a " + 'bug in React. Please file an issue.'); } // Assigning this to a const so Flow knows it won't change in the closure var resolvedInst = inst; { checkPropStringCoercion(mixedRef, 'ref'); } var stringRef = '' + mixedRef; // Check if previous string ref matches new string ref if (current !== null && current.ref !== null && typeof current.ref === 'function' && current.ref._stringRef === stringRef) { return current.ref; } var ref = function (value) { var refs = resolvedInst.refs; if (value === null) { delete refs[stringRef]; } else { refs[stringRef] = value; } }; ref._stringRef = stringRef; return ref; } else { if (typeof mixedRef !== 'string') { throw new Error('Expected ref to be a function, a string, an object returned by React.createRef(), or null.'); } if (!element._owner) { throw new Error("Element ref was specified as a string (" + mixedRef + ") but no owner was set. This could happen for one of" + ' the following reasons:\n' + '1. You may be adding a ref to a function component\n' + "2. You may be adding a ref to a component that was not created inside a component's render method\n" + '3. You have multiple copies of React loaded\n' + 'See https://reactjs.org/link/refs-must-have-owner for more information.'); } } } return mixedRef; } function throwOnInvalidObjectType(returnFiber, newChild) { var childString = Object.prototype.toString.call(newChild); throw new Error("Objects are not valid as a React child (found: " + (childString === '[object Object]' ? 'object with keys {' + Object.keys(newChild).join(', ') + '}' : childString) + "). " + 'If you meant to render a collection of children, use an array ' + 'instead.'); } function warnOnFunctionType(returnFiber) { { var componentName = getComponentNameFromFiber(returnFiber) || 'Component'; if (ownerHasFunctionTypeWarning[componentName]) { return; } ownerHasFunctionTypeWarning[componentName] = true; error('Functions are not valid as a React child. This may happen if ' + 'you return a Component instead of <Component /> from render. ' + 'Or maybe you meant to call this function rather than return it.'); } } function resolveLazy(lazyType) { var payload = lazyType._payload; var init = lazyType._init; return init(payload); } // This wrapper function exists because I expect to clone the code in each path // to be able to optimize each path individually by branching early. This needs // a compiler or we can do it manually. Helpers that don't need this branching // live outside of this function. function ChildReconciler(shouldTrackSideEffects) { function deleteChild(returnFiber, childToDelete) { if (!shouldTrackSideEffects) { // Noop. return; } var deletions = returnFiber.deletions; if (deletions === null) { returnFiber.deletions = [childToDelete]; returnFiber.flags |= ChildDeletion; } else { deletions.push(childToDelete); } } function deleteRemainingChildren(returnFiber, currentFirstChild) { if (!shouldTrackSideEffects) { // Noop. return null; } // TODO: For the shouldClone case, this could be micro-optimized a bit by // assuming that after the first child we've already added everything. var childToDelete = currentFirstChild; while (childToDelete !== null) { deleteChild(returnFiber, childToDelete); childToDelete = childToDelete.sibling; } return null; } function mapRemainingChildren(returnFiber, currentFirstChild) { // Add the remaining children to a temporary map so that we can find them by // keys quickly. Implicit (null) keys get added to this set with their index // instead. var existingChildren = new Map(); var existingChild = currentFirstChild; while (existingChild !== null) { if (existingChild.key !== null) { existingChildren.set(existingChild.key, existingChild); } else { existingChildren.set(existingChild.index, existingChild); } existingChild = existingChild.sibling; } return existingChildren; } function useFiber(fiber, pendingProps) { // We currently set sibling to null and index to 0 here because it is easy // to forget to do before returning it. E.g. for the single child case. var clone = createWorkInProgress(fiber, pendingProps); clone.index = 0; clone.sibling = null; return clone; } function placeChild(newFiber, lastPlacedIndex, newIndex) { newFiber.index = newIndex; if (!shouldTrackSideEffects) { // During hydration, the useId algorithm needs to know which fibers are // part of a list of children (arrays, iterators). newFiber.flags |= Forked; return lastPlacedIndex; } var current = newFiber.alternate; if (current !== null) { var oldIndex = current.index; if (oldIndex < lastPlacedIndex) { // This is a move. newFiber.flags |= Placement; return lastPlacedIndex; } else { // This item can stay in place. return oldIndex; } } else { // This is an insertion. newFiber.flags |= Placement; return lastPlacedIndex; } } function placeSingleChild(newFiber) { // This is simpler for the single child case. We only need to do a // placement for inserting new children. if (shouldTrackSideEffects && newFiber.alternate === null) { newFiber.flags |= Placement; } return newFiber; } function updateTextNode(returnFiber, current, textContent, lanes) { if (current === null || current.tag !== HostText) { // Insert var created = createFiberFromText(textContent, returnFiber.mode, lanes); created.return = returnFiber; return created; } else { // Update var existing = useFiber(current, textContent); existing.return = returnFiber; return existing; } } function updateElement(returnFiber, current, element, lanes) { var elementType = element.type; if (elementType === REACT_FRAGMENT_TYPE) { return updateFragment(returnFiber, current, element.props.children, lanes, element.key); } if (current !== null) { if (current.elementType === elementType || ( // Keep this check inline so it only runs on the false path: isCompatibleFamilyForHotReloading(current, element) ) || // Lazy types should reconcile their resolved type. // We need to do this after the Hot Reloading check above, // because hot reloading has different semantics than prod because // it doesn't resuspend. So we can't let the call below suspend. typeof elementType === 'object' && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === current.type) { // Move based on index var existing = useFiber(current, element.props); existing.ref = coerceRef(returnFiber, current, element); existing.return = returnFiber; { existing._debugSource = element._source; existing._debugOwner = element._owner; } return existing; } } // Insert var created = createFiberFromElement(element, returnFiber.mode, lanes); created.ref = coerceRef(returnFiber, current, element); created.return = returnFiber; return created; } function updatePortal(returnFiber, current, portal, lanes) { if (current === null || current.tag !== HostPortal || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) { // Insert var created = createFiberFromPortal(portal, returnFiber.mode, lanes); created.return = returnFiber; return created; } else { // Update var existing = useFiber(current, portal.children || []); existing.return = returnFiber; return existing; } } function updateFragment(returnFiber, current, fragment, lanes, key) { if (current === null || current.tag !== Fragment) { // Insert var created = createFiberFromFragment(fragment, returnFiber.mode, lanes, key); created.return = returnFiber; return created; } else { // Update var existing = useFiber(current, fragment); existing.return = returnFiber; return existing; } } function createChild(returnFiber, newChild, lanes) { if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') { // Text nodes don't have keys. If the previous node is implicitly keyed // we can continue to replace it without aborting even if it is not a text // node. var created = createFiberFromText('' + newChild, returnFiber.mode, lanes); created.return = returnFiber; return created; } if (typeof newChild === 'object' && newChild !== null) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: { var _created = createFiberFromElement(newChild, returnFiber.mode, lanes); _created.ref = coerceRef(returnFiber, null, newChild); _created.return = returnFiber; return _created; } case REACT_PORTAL_TYPE: { var _created2 = createFiberFromPortal(newChild, returnFiber.mode, lanes); _created2.return = returnFiber; return _created2; } case REACT_LAZY_TYPE: { var payload = newChild._payload; var init = newChild._init; return createChild(returnFiber, init(payload), lanes); } } if (isArray(newChild) || getIteratorFn(newChild)) { var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null); _created3.return = returnFiber; return _created3; } throwOnInvalidObjectType(returnFiber, newChild); } { if (typeof newChild === 'function') { warnOnFunctionType(returnFiber); } } return null; } function updateSlot(returnFiber, oldFiber, newChild, lanes) { // Update the fiber if the keys match, otherwise return null. var key = oldFiber !== null ? oldFiber.key : null; if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') { // Text nodes don't have keys. If the previous node is implicitly keyed // we can continue to replace it without aborting even if it is not a text // node. if (key !== null) { return null; } return updateTextNode(returnFiber, oldFiber, '' + newChild, lanes); } if (typeof newChild === 'object' && newChild !== null) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: { if (newChild.key === key) { return updateElement(returnFiber, oldFiber, newChild, lanes); } else { return null; } } case REACT_PORTAL_TYPE: { if (newChild.key === key) { return updatePortal(returnFiber, oldFiber, newChild, lanes); } else { return null; } } case REACT_LAZY_TYPE: { var payload = newChild._payload; var init = newChild._init; return updateSlot(returnFiber, oldFiber, init(payload), lanes); } } if (isArray(newChild) || getIteratorFn(newChild)) { if (key !== null) { return null; } return updateFragment(returnFiber, oldFiber, newChild, lanes, null); } throwOnInvalidObjectType(returnFiber, newChild); } { if (typeof newChild === 'function') { warnOnFunctionType(returnFiber); } } return null; } function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) { if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') { // Text nodes don't have keys, so we neither have to check the old nor // new node for the key. If both are text nodes, they match. var matchedFiber = existingChildren.get(newIdx) || null; return updateTextNode(returnFiber, matchedFiber, '' + newChild, lanes); } if (typeof newChild === 'object' && newChild !== null) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: { var _matchedFiber = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; return updateElement(returnFiber, _matchedFiber, newChild, lanes); } case REACT_PORTAL_TYPE: { var _matchedFiber2 = existingChildren.get(newChild.key === null ? newIdx : newChild.key) || null; return updatePortal(returnFiber, _matchedFiber2, newChild, lanes); } case REACT_LAZY_TYPE: var payload = newChild._payload; var init = newChild._init; return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes); } if (isArray(newChild) || getIteratorFn(newChild)) { var _matchedFiber3 = existingChildren.get(newIdx) || null; return updateFragment(returnFiber, _matchedFiber3, newChild, lanes, null); } throwOnInvalidObjectType(returnFiber, newChild); } { if (typeof newChild === 'function') { warnOnFunctionType(returnFiber); } } return null; } /** * Warns if there is a duplicate or missing key */ function warnOnInvalidKey(child, knownKeys, returnFiber) { { if (typeof child !== 'object' || child === null) { return knownKeys; } switch (child.$$typeof) { case REACT_ELEMENT_TYPE: case REACT_PORTAL_TYPE: warnForMissingKey(child, returnFiber); var key = child.key; if (typeof key !== 'string') { break; } if (knownKeys === null) { knownKeys = new Set(); knownKeys.add(key); break; } if (!knownKeys.has(key)) { knownKeys.add(key); break; } error('Encountered two children with the same key, `%s`. ' + 'Keys should be unique so that components maintain their identity ' + 'across updates. Non-unique keys may cause children to be ' + 'duplicated and/or omitted — the behavior is unsupported and ' + 'could change in a future version.', key); break; case REACT_LAZY_TYPE: var payload = child._payload; var init = child._init; warnOnInvalidKey(init(payload), knownKeys, returnFiber); break; } } return knownKeys; } function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) { // This algorithm can't optimize by searching from both ends since we // don't have backpointers on fibers. I'm trying to see how far we can get // with that model. If it ends up not being worth the tradeoffs, we can // add it later. // Even with a two ended optimization, we'd want to optimize for the case // where there are few changes and brute force the comparison instead of // going for the Map. It'd like to explore hitting that path first in // forward-only mode and only go for the Map once we notice that we need // lots of look ahead. This doesn't handle reversal as well as two ended // search but that's unusual. Besides, for the two ended optimization to // work on Iterables, we'd need to copy the whole set. // In this first iteration, we'll just live with hitting the bad case // (adding everything to a Map) in for every insert/move. // If you change this code, also update reconcileChildrenIterator() which // uses the same algorithm. { // First, validate keys. var knownKeys = null; for (var i = 0; i < newChildren.length; i++) { var child = newChildren[i]; knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber); } } var resultingFirstChild = null; var previousNewFiber = null; var oldFiber = currentFirstChild; var lastPlacedIndex = 0; var newIdx = 0; var nextOldFiber = null; for (; oldFiber !== null && newIdx < newChildren.length; newIdx++) { if (oldFiber.index > newIdx) { nextOldFiber = oldFiber; oldFiber = null; } else { nextOldFiber = oldFiber.sibling; } var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes); if (newFiber === null) { // TODO: This breaks on empty slots like null children. That's // unfortunate because it triggers the slow path all the time. We need // a better way to communicate whether this was a miss or null, // boolean, undefined, etc. if (oldFiber === null) { oldFiber = nextOldFiber; } break; } if (shouldTrackSideEffects) { if (oldFiber && newFiber.alternate === null) { // We matched the slot, but we didn't reuse the existing fiber, so we // need to delete the existing child. deleteChild(returnFiber, oldFiber); } } lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); if (previousNewFiber === null) { // TODO: Move out of the loop. This only happens for the first run. resultingFirstChild = newFiber; } else { // TODO: Defer siblings if we're not at the right index for this slot. // I.e. if we had null values before, then we want to defer this // for each null value. However, we also don't want to call updateSlot // with the previous one. previousNewFiber.sibling = newFiber; } previousNewFiber = newFiber; oldFiber = nextOldFiber; } if (newIdx === newChildren.length) { // We've reached the end of the new children. We can delete the rest. deleteRemainingChildren(returnFiber, oldFiber); if (getIsHydrating()) { var numberOfForks = newIdx; pushTreeFork(returnFiber, numberOfForks); } return resultingFirstChild; } if (oldFiber === null) { // If we don't have any more existing children we can choose a fast path // since the rest will all be insertions. for (; newIdx < newChildren.length; newIdx++) { var _newFiber = createChild(returnFiber, newChildren[newIdx], lanes); if (_newFiber === null) { continue; } lastPlacedIndex = placeChild(_newFiber, lastPlacedIndex, newIdx); if (previousNewFiber === null) { // TODO: Move out of the loop. This only happens for the first run. resultingFirstChild = _newFiber; } else { previousNewFiber.sibling = _newFiber; } previousNewFiber = _newFiber; } if (getIsHydrating()) { var _numberOfForks = newIdx; pushTreeFork(returnFiber, _numberOfForks); } return resultingFirstChild; } // Add all children to a key map for quick lookups. var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves. for (; newIdx < newChildren.length; newIdx++) { var _newFiber2 = updateFromMap(existingChildren, returnFiber, newIdx, newChildren[newIdx], lanes); if (_newFiber2 !== null) { if (shouldTrackSideEffects) { if (_newFiber2.alternate !== null) { // The new fiber is a work in progress, but if there exists a // current, that means that we reused the fiber. We need to delete // it from the child list so that we don't add it to the deletion // list. existingChildren.delete(_newFiber2.key === null ? newIdx : _newFiber2.key); } } lastPlacedIndex = placeChild(_newFiber2, lastPlacedIndex, newIdx); if (previousNewFiber === null) { resultingFirstChild = _newFiber2; } else { previousNewFiber.sibling = _newFiber2; } previousNewFiber = _newFiber2; } } if (shouldTrackSideEffects) { // Any existing children that weren't consumed above were deleted. We need // to add them to the deletion list. existingChildren.forEach(function (child) { return deleteChild(returnFiber, child); }); } if (getIsHydrating()) { var _numberOfForks2 = newIdx; pushTreeFork(returnFiber, _numberOfForks2); } return resultingFirstChild; } function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) { // This is the same implementation as reconcileChildrenArray(), // but using the iterator instead. var iteratorFn = getIteratorFn(newChildrenIterable); if (typeof iteratorFn !== 'function') { throw new Error('An object is not an iterable. This error is likely caused by a bug in ' + 'React. Please file an issue.'); } { // We don't support rendering Generators because it's a mutation. // See https://github.com/facebook/react/issues/12995 if (typeof Symbol === 'function' && // $FlowFixMe Flow doesn't know about toStringTag newChildrenIterable[Symbol.toStringTag] === 'Generator') { if (!didWarnAboutGenerators) { error('Using Generators as children is unsupported and will likely yield ' + 'unexpected results because enumerating a generator mutates it. ' + 'You may convert it to an array with `Array.from()` or the ' + '`[...spread]` operator before rendering. Keep in mind ' + 'you might need to polyfill these features for older browsers.'); } didWarnAboutGenerators = true; } // Warn about using Maps as children if (newChildrenIterable.entries === iteratorFn) { if (!didWarnAboutMaps) { error('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.'); } didWarnAboutMaps = true; } // First, validate keys. // We'll get a different iterator later for the main pass. var _newChildren = iteratorFn.call(newChildrenIterable); if (_newChildren) { var knownKeys = null; var _step = _newChildren.next(); for (; !_step.done; _step = _newChildren.next()) { var child = _step.value; knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber); } } } var newChildren = iteratorFn.call(newChildrenIterable); if (newChildren == null) { throw new Error('An iterable object provided no iterator.'); } var resultingFirstChild = null; var previousNewFiber = null; var oldFiber = currentFirstChild; var lastPlacedIndex = 0; var newIdx = 0; var nextOldFiber = null; var step = newChildren.next(); for (; oldFiber !== null && !step.done; newIdx++, step = newChildren.next()) { if (oldFiber.index > newIdx) { nextOldFiber = oldFiber; oldFiber = null; } else { nextOldFiber = oldFiber.sibling; } var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); if (newFiber === null) { // TODO: This breaks on empty slots like null children. That's // unfortunate because it triggers the slow path all the time. We need // a better way to communicate whether this was a miss or null, // boolean, undefined, etc. if (oldFiber === null) { oldFiber = nextOldFiber; } break; } if (shouldTrackSideEffects) { if (oldFiber && newFiber.alternate === null) { // We matched the slot, but we didn't reuse the existing fiber, so we // need to delete the existing child. deleteChild(returnFiber, oldFiber); } } lastPlacedIndex = placeChild(newFiber, lastPlacedIndex, newIdx); if (previousNewFiber === null) { // TODO: Move out of the loop. This only happens for the first run. resultingFirstChild = newFiber; } else { // TODO: Defer siblings if we're not at the right index for this slot. // I.e. if we had null values before, then we want to defer this // for each null value. However, we also don't want to call updateSlot // with the previous one. previousNewFiber.sibling = newFiber; } previousNewFiber = newFiber; oldFiber = nextOldFiber; } if (step.done) { // We've reached the end of the new children. We can delete the rest. deleteRemainingChildren(returnFiber, oldFiber); if (getIsHydrating()) { var numberOfForks = newIdx; pushTreeFork(returnFiber, numberOfForks); } return resultingFirstChild; } if (oldFiber === null) { // If we don't have any more existing children we can choose a fast path // since the rest will all be insertions. for (; !step.done; newIdx++, step = newChildren.next()) { var _newFiber3 = createChild(returnFiber, step.value, lanes); if (_newFiber3 === null) { continue; } lastPlacedIndex = placeChild(_newFiber3, lastPlacedIndex, newIdx); if (previousNewFiber === null) { // TODO: Move out of the loop. This only happens for the first run. resultingFirstChild = _newFiber3; } else { previousNewFiber.sibling = _newFiber3; } previousNewFiber = _newFiber3; } if (getIsHydrating()) { var _numberOfForks3 = newIdx; pushTreeFork(returnFiber, _numberOfForks3); } return resultingFirstChild; } // Add all children to a key map for quick lookups. var existingChildren = mapRemainingChildren(returnFiber, oldFiber); // Keep scanning and use the map to restore deleted items as moves. for (; !step.done; newIdx++, step = newChildren.next()) { var _newFiber4 = updateFromMap(existingChildren, returnFiber, newIdx, step.value, lanes); if (_newFiber4 !== null) { if (shouldTrackSideEffects) { if (_newFiber4.alternate !== null) { // The new fiber is a work in progress, but if there exists a // current, that means that we reused the fiber. We need to delete // it from the child list so that we don't add it to the deletion // list. existingChildren.delete(_newFiber4.key === null ? newIdx : _newFiber4.key); } } lastPlacedIndex = placeChild(_newFiber4, lastPlacedIndex, newIdx); if (previousNewFiber === null) { resultingFirstChild = _newFiber4; } else { previousNewFiber.sibling = _newFiber4; } previousNewFiber = _newFiber4; } } if (shouldTrackSideEffects) { // Any existing children that weren't consumed above were deleted. We need // to add them to the deletion list. existingChildren.forEach(function (child) { return deleteChild(returnFiber, child); }); } if (getIsHydrating()) { var _numberOfForks4 = newIdx; pushTreeFork(returnFiber, _numberOfForks4); } return resultingFirstChild; } function reconcileSingleTextNode(returnFiber, currentFirstChild, textContent, lanes) { // There's no need to check for keys on text nodes since we don't have a // way to define them. if (currentFirstChild !== null && currentFirstChild.tag === HostText) { // We already have an existing node so let's just update it and delete // the rest. deleteRemainingChildren(returnFiber, currentFirstChild.sibling); var existing = useFiber(currentFirstChild, textContent); existing.return = returnFiber; return existing; } // The existing first child is not a text node so we need to create one // and delete the existing ones. deleteRemainingChildren(returnFiber, currentFirstChild); var created = createFiberFromText(textContent, returnFiber.mode, lanes); created.return = returnFiber; return created; } function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) { var key = element.key; var child = currentFirstChild; while (child !== null) { // TODO: If key === null and child.key === null, then this only applies to // the first item in the list. if (child.key === key) { var elementType = element.type; if (elementType === REACT_FRAGMENT_TYPE) { if (child.tag === Fragment) { deleteRemainingChildren(returnFiber, child.sibling); var existing = useFiber(child, element.props.children); existing.return = returnFiber; { existing._debugSource = element._source; existing._debugOwner = element._owner; } return existing; } } else { if (child.elementType === elementType || ( // Keep this check inline so it only runs on the false path: isCompatibleFamilyForHotReloading(child, element) ) || // Lazy types should reconcile their resolved type. // We need to do this after the Hot Reloading check above, // because hot reloading has different semantics than prod because // it doesn't resuspend. So we can't let the call below suspend. typeof elementType === 'object' && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) { deleteRemainingChildren(returnFiber, child.sibling); var _existing = useFiber(child, element.props); _existing.ref = coerceRef(returnFiber, child, element); _existing.return = returnFiber; { _existing._debugSource = element._source; _existing._debugOwner = element._owner; } return _existing; } } // Didn't match. deleteRemainingChildren(returnFiber, child); break; } else { deleteChild(returnFiber, child); } child = child.sibling; } if (element.type === REACT_FRAGMENT_TYPE) { var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key); created.return = returnFiber; return created; } else { var _created4 = createFiberFromElement(element, returnFiber.mode, lanes); _created4.ref = coerceRef(returnFiber, currentFirstChild, element); _created4.return = returnFiber; return _created4; } } function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) { var key = portal.key; var child = currentFirstChild; while (child !== null) { // TODO: If key === null and child.key === null, then this only applies to // the first item in the list. if (child.key === key) { if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) { deleteRemainingChildren(returnFiber, child.sibling); var existing = useFiber(child, portal.children || []); existing.return = returnFiber; return existing; } else { deleteRemainingChildren(returnFiber, child); break; } } else { deleteChild(returnFiber, child); } child = child.sibling; } var created = createFiberFromPortal(portal, returnFiber.mode, lanes); created.return = returnFiber; return created; } // This API will tag the children with the side-effect of the reconciliation // itself. They will be added to the side-effect list as we pass through the // children and the parent. function reconcileChildFibers(returnFiber, currentFirstChild, newChild, lanes) { // This function is not recursive. // If the top level item is an array, we treat it as a set of children, // not as a fragment. Nested arrays on the other hand will be treated as // fragment nodes. Recursion happens at the normal flow. // Handle top level unkeyed fragments as if they were arrays. // This leads to an ambiguity between <>{[...]}</> and <>...</>. // We treat the ambiguous cases above the same. var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null; if (isUnkeyedTopLevelFragment) { newChild = newChild.props.children; } // Handle object types if (typeof newChild === 'object' && newChild !== null) { switch (newChild.$$typeof) { case REACT_ELEMENT_TYPE: return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, lanes)); case REACT_PORTAL_TYPE: return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, lanes)); case REACT_LAZY_TYPE: var payload = newChild._payload; var init = newChild._init; // TODO: This function is supposed to be non-recursive. return reconcileChildFibers(returnFiber, currentFirstChild, init(payload), lanes); } if (isArray(newChild)) { return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes); } if (getIteratorFn(newChild)) { return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes); } throwOnInvalidObjectType(returnFiber, newChild); } if (typeof newChild === 'string' && newChild !== '' || typeof newChild === 'number') { return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, lanes)); } { if (typeof newChild === 'function') { warnOnFunctionType(returnFiber); } } // Remaining cases are all treated as empty. return deleteRemainingChildren(returnFiber, currentFirstChild); } return reconcileChildFibers; } var reconcileChildFibers = ChildReconciler(true); var mountChildFibers = ChildReconciler(false); function cloneChildFibers(current, workInProgress) { if (current !== null && workInProgress.child !== current.child) { throw new Error('Resuming work not yet implemented.'); } if (workInProgress.child === null) { return; } var currentChild = workInProgress.child; var newChild = createWorkInProgress(currentChild, currentChild.pendingProps); workInProgress.child = newChild; newChild.return = workInProgress; while (currentChild.sibling !== null) { currentChild = currentChild.sibling; newChild = newChild.sibling = createWorkInProgress(currentChild, currentChild.pendingProps); newChild.return = workInProgress; } newChild.sibling = null; } // Reset a workInProgress child set to prepare it for a second pass. function resetChildFibers(workInProgress, lanes) { var child = workInProgress.child; while (child !== null) { resetWorkInProgress(child, lanes); child = child.sibling; } } var valueCursor = createCursor(null); var rendererSigil; { // Use this to detect multiple renderers using the same context rendererSigil = {}; } var currentlyRenderingFiber = null; var lastContextDependency = null; var lastFullyObservedContext = null; var isDisallowedContextReadInDEV = false; function resetContextDependencies() { // This is called right before React yields execution, to ensure `readContext` // cannot be called outside the render phase. currentlyRenderingFiber = null; lastContextDependency = null; lastFullyObservedContext = null; { isDisallowedContextReadInDEV = false; } } function enterDisallowedContextReadInDEV() { { isDisallowedContextReadInDEV = true; } } function exitDisallowedContextReadInDEV() { { isDisallowedContextReadInDEV = false; } } function pushProvider(providerFiber, context, nextValue) { { push(valueCursor, context._currentValue, providerFiber); context._currentValue = nextValue; { if (context._currentRenderer !== undefined && context._currentRenderer !== null && context._currentRenderer !== rendererSigil) { error('Detected multiple renderers concurrently rendering the ' + 'same context provider. This is currently unsupported.'); } context._currentRenderer = rendererSigil; } } } function popProvider(context, providerFiber) { var currentValue = valueCursor.current; pop(valueCursor, providerFiber); { { context._currentValue = currentValue; } } } function scheduleContextWorkOnParentPath(parent, renderLanes, propagationRoot) { // Update the child lanes of all the ancestors, including the alternates. var node = parent; while (node !== null) { var alternate = node.alternate; if (!isSubsetOfLanes(node.childLanes, renderLanes)) { node.childLanes = mergeLanes(node.childLanes, renderLanes); if (alternate !== null) { alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes); } } else if (alternate !== null && !isSubsetOfLanes(alternate.childLanes, renderLanes)) { alternate.childLanes = mergeLanes(alternate.childLanes, renderLanes); } if (node === propagationRoot) { break; } node = node.return; } { if (node !== propagationRoot) { error('Expected to find the propagation root when scheduling context work. ' + 'This error is likely caused by a bug in React. Please file an issue.'); } } } function propagateContextChange(workInProgress, context, renderLanes) { { propagateContextChange_eager(workInProgress, context, renderLanes); } } function propagateContextChange_eager(workInProgress, context, renderLanes) { var fiber = workInProgress.child; if (fiber !== null) { // Set the return pointer of the child to the work-in-progress fiber. fiber.return = workInProgress; } while (fiber !== null) { var nextFiber = void 0; // Visit this fiber. var list = fiber.dependencies; if (list !== null) { nextFiber = fiber.child; var dependency = list.firstContext; while (dependency !== null) { // Check if the context matches. if (dependency.context === context) { // Match! Schedule an update on this fiber. if (fiber.tag === ClassComponent) { // Schedule a force update on the work-in-progress. var lane = pickArbitraryLane(renderLanes); var update = createUpdate(NoTimestamp, lane); update.tag = ForceUpdate; // TODO: Because we don't have a work-in-progress, this will add the // update to the current fiber, too, which means it will persist even if // this render is thrown away. Since it's a race condition, not sure it's // worth fixing. // Inlined `enqueueUpdate` to remove interleaved update check var updateQueue = fiber.updateQueue; if (updateQueue === null) ; else { var sharedQueue = updateQueue.shared; var pending = sharedQueue.pending; if (pending === null) { // This is the first update. Create a circular list. update.next = update; } else { update.next = pending.next; pending.next = update; } sharedQueue.pending = update; } } fiber.lanes = mergeLanes(fiber.lanes, renderLanes); var alternate = fiber.alternate; if (alternate !== null) { alternate.lanes = mergeLanes(alternate.lanes, renderLanes); } scheduleContextWorkOnParentPath(fiber.return, renderLanes, workInProgress); // Mark the updated lanes on the list, too. list.lanes = mergeLanes(list.lanes, renderLanes); // Since we already found a match, we can stop traversing the // dependency list. break; } dependency = dependency.next; } } else if (fiber.tag === ContextProvider) { // Don't scan deeper if this is a matching provider nextFiber = fiber.type === workInProgress.type ? null : fiber.child; } else if (fiber.tag === DehydratedFragment) { // If a dehydrated suspense boundary is in this subtree, we don't know // if it will have any context consumers in it. The best we can do is // mark it as having updates. var parentSuspense = fiber.return; if (parentSuspense === null) { throw new Error('We just came from a parent so we must have had a parent. This is a bug in React.'); } parentSuspense.lanes = mergeLanes(parentSuspense.lanes, renderLanes); var _alternate = parentSuspense.alternate; if (_alternate !== null) { _alternate.lanes = mergeLanes(_alternate.lanes, renderLanes); } // This is intentionally passing this fiber as the parent // because we want to schedule this fiber as having work // on its children. We'll use the childLanes on // this fiber to indicate that a context has changed. scheduleContextWorkOnParentPath(parentSuspense, renderLanes, workInProgress); nextFiber = fiber.sibling; } else { // Traverse down. nextFiber = fiber.child; } if (nextFiber !== null) { // Set the return pointer of the child to the work-in-progress fiber. nextFiber.return = fiber; } else { // No child. Traverse to next sibling. nextFiber = fiber; while (nextFiber !== null) { if (nextFiber === workInProgress) { // We're back to the root of this subtree. Exit. nextFiber = null; break; } var sibling = nextFiber.sibling; if (sibling !== null) { // Set the return pointer of the sibling to the work-in-progress fiber. sibling.return = nextFiber.return; nextFiber = sibling; break; } // No more siblings. Traverse up. nextFiber = nextFiber.return; } } fiber = nextFiber; } } function prepareToReadContext(workInProgress, renderLanes) { currentlyRenderingFiber = workInProgress; lastContextDependency = null; lastFullyObservedContext = null; var dependencies = workInProgress.dependencies; if (dependencies !== null) { { var firstContext = dependencies.firstContext; if (firstContext !== null) { if (includesSomeLane(dependencies.lanes, renderLanes)) { // Context list has a pending update. Mark that this fiber performed work. markWorkInProgressReceivedUpdate(); } // Reset the work-in-progress list dependencies.firstContext = null; } } } } function readContext(context) { { // This warning would fire if you read context inside a Hook like useMemo. // Unlike the class check below, it's not enforced in production for perf. if (isDisallowedContextReadInDEV) { error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().'); } } var value = context._currentValue ; if (lastFullyObservedContext === context) ; else { var contextItem = { context: context, memoizedValue: value, next: null }; if (lastContextDependency === null) { if (currentlyRenderingFiber === null) { throw new Error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().'); } // This is the first dependency for this component. Create a new list. lastContextDependency = contextItem; currentlyRenderingFiber.dependencies = { lanes: NoLanes, firstContext: contextItem }; } else { // Append a new context item. lastContextDependency = lastContextDependency.next = contextItem; } } return value; } // render. When this render exits, either because it finishes or because it is // interrupted, the interleaved updates will be transferred onto the main part // of the queue. var concurrentQueues = null; function pushConcurrentUpdateQueue(queue) { if (concurrentQueues === null) { concurrentQueues = [queue]; } else { concurrentQueues.push(queue); } } function finishQueueingConcurrentUpdates() { // Transfer the interleaved updates onto the main queue. Each queue has a // `pending` field and an `interleaved` field. When they are not null, they // point to the last node in a circular linked list. We need to append the // interleaved list to the end of the pending list by joining them into a // single, circular list. if (concurrentQueues !== null) { for (var i = 0; i < concurrentQueues.length; i++) { var queue = concurrentQueues[i]; var lastInterleavedUpdate = queue.interleaved; if (lastInterleavedUpdate !== null) { queue.interleaved = null; var firstInterleavedUpdate = lastInterleavedUpdate.next; var lastPendingUpdate = queue.pending; if (lastPendingUpdate !== null) { var firstPendingUpdate = lastPendingUpdate.next; lastPendingUpdate.next = firstInterleavedUpdate; lastInterleavedUpdate.next = firstPendingUpdate; } queue.pending = lastInterleavedUpdate; } } concurrentQueues = null; } } function enqueueConcurrentHookUpdate(fiber, queue, update, lane) { var interleaved = queue.interleaved; if (interleaved === null) { // This is the first update. Create a circular list. update.next = update; // At the end of the current render, this queue's interleaved updates will // be transferred to the pending queue. pushConcurrentUpdateQueue(queue); } else { update.next = interleaved.next; interleaved.next = update; } queue.interleaved = update; return markUpdateLaneFromFiberToRoot(fiber, lane); } function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane) { var interleaved = queue.interleaved; if (interleaved === null) { // This is the first update. Create a circular list. update.next = update; // At the end of the current render, this queue's interleaved updates will // be transferred to the pending queue. pushConcurrentUpdateQueue(queue); } else { update.next = interleaved.next; interleaved.next = update; } queue.interleaved = update; } function enqueueConcurrentClassUpdate(fiber, queue, update, lane) { var interleaved = queue.interleaved; if (interleaved === null) { // This is the first update. Create a circular list. update.next = update; // At the end of the current render, this queue's interleaved updates will // be transferred to the pending queue. pushConcurrentUpdateQueue(queue); } else { update.next = interleaved.next; interleaved.next = update; } queue.interleaved = update; return markUpdateLaneFromFiberToRoot(fiber, lane); } function enqueueConcurrentRenderForLane(fiber, lane) { return markUpdateLaneFromFiberToRoot(fiber, lane); } // Calling this function outside this module should only be done for backwards // compatibility and should always be accompanied by a warning. var unsafe_markUpdateLaneFromFiberToRoot = markUpdateLaneFromFiberToRoot; function markUpdateLaneFromFiberToRoot(sourceFiber, lane) { // Update the source fiber's lanes sourceFiber.lanes = mergeLanes(sourceFiber.lanes, lane); var alternate = sourceFiber.alternate; if (alternate !== null) { alternate.lanes = mergeLanes(alternate.lanes, lane); } { if (alternate === null && (sourceFiber.flags & (Placement | Hydrating)) !== NoFlags) { warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); } } // Walk the parent path to the root and update the child lanes. var node = sourceFiber; var parent = sourceFiber.return; while (parent !== null) { parent.childLanes = mergeLanes(parent.childLanes, lane); alternate = parent.alternate; if (alternate !== null) { alternate.childLanes = mergeLanes(alternate.childLanes, lane); } else { { if ((parent.flags & (Placement | Hydrating)) !== NoFlags) { warnAboutUpdateOnNotYetMountedFiberInDEV(sourceFiber); } } } node = parent; parent = parent.return; } if (node.tag === HostRoot) { var root = node.stateNode; return root; } else { return null; } } var UpdateState = 0; var ReplaceState = 1; var ForceUpdate = 2; var CaptureUpdate = 3; // Global state that is reset at the beginning of calling `processUpdateQueue`. // It should only be read right after calling `processUpdateQueue`, via // `checkHasForceUpdateAfterProcessing`. var hasForceUpdate = false; var didWarnUpdateInsideUpdate; var currentlyProcessingQueue; { didWarnUpdateInsideUpdate = false; currentlyProcessingQueue = null; } function initializeUpdateQueue(fiber) { var queue = { baseState: fiber.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: NoLanes }, effects: null }; fiber.updateQueue = queue; } function cloneUpdateQueue(current, workInProgress) { // Clone the update queue from current. Unless it's already a clone. var queue = workInProgress.updateQueue; var currentQueue = current.updateQueue; if (queue === currentQueue) { var clone = { baseState: currentQueue.baseState, firstBaseUpdate: currentQueue.firstBaseUpdate, lastBaseUpdate: currentQueue.lastBaseUpdate, shared: currentQueue.shared, effects: currentQueue.effects }; workInProgress.updateQueue = clone; } } function createUpdate(eventTime, lane) { var update = { eventTime: eventTime, lane: lane, tag: UpdateState, payload: null, callback: null, next: null }; return update; } function enqueueUpdate(fiber, update, lane) { var updateQueue = fiber.updateQueue; if (updateQueue === null) { // Only occurs if the fiber has been unmounted. return null; } var sharedQueue = updateQueue.shared; { if (currentlyProcessingQueue === sharedQueue && !didWarnUpdateInsideUpdate) { error('An update (setState, replaceState, or forceUpdate) was scheduled ' + 'from inside an update function. Update functions should be pure, ' + 'with zero side-effects. Consider using componentDidUpdate or a ' + 'callback.'); didWarnUpdateInsideUpdate = true; } } if (isUnsafeClassRenderPhaseUpdate()) { // This is an unsafe render phase update. Add directly to the update // queue so we can process it immediately during the current render. var pending = sharedQueue.pending; if (pending === null) { // This is the first update. Create a circular list. update.next = update; } else { update.next = pending.next; pending.next = update; } sharedQueue.pending = update; // Update the childLanes even though we're most likely already rendering // this fiber. This is for backwards compatibility in the case where you // update a different component during render phase than the one that is // currently renderings (a pattern that is accompanied by a warning). return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane); } else { return enqueueConcurrentClassUpdate(fiber, sharedQueue, update, lane); } } function entangleTransitions(root, fiber, lane) { var updateQueue = fiber.updateQueue; if (updateQueue === null) { // Only occurs if the fiber has been unmounted. return; } var sharedQueue = updateQueue.shared; if (isTransitionLane(lane)) { var queueLanes = sharedQueue.lanes; // If any entangled lanes are no longer pending on the root, then they must // have finished. We can remove them from the shared queue, which represents // a superset of the actually pending lanes. In some cases we may entangle // more than we need to, but that's OK. In fact it's worse if we *don't* // entangle when we should. queueLanes = intersectLanes(queueLanes, root.pendingLanes); // Entangle the new transition lane with the other transition lanes. var newQueueLanes = mergeLanes(queueLanes, lane); sharedQueue.lanes = newQueueLanes; // Even if queue.lanes already include lane, we don't know for certain if // the lane finished since the last time we entangled it. So we need to // entangle it again, just to be sure. markRootEntangled(root, newQueueLanes); } } function enqueueCapturedUpdate(workInProgress, capturedUpdate) { // Captured updates are updates that are thrown by a child during the render // phase. They should be discarded if the render is aborted. Therefore, // we should only put them on the work-in-progress queue, not the current one. var queue = workInProgress.updateQueue; // Check if the work-in-progress queue is a clone. var current = workInProgress.alternate; if (current !== null) { var currentQueue = current.updateQueue; if (queue === currentQueue) { // The work-in-progress queue is the same as current. This happens when // we bail out on a parent fiber that then captures an error thrown by // a child. Since we want to append the update only to the work-in // -progress queue, we need to clone the updates. We usually clone during // processUpdateQueue, but that didn't happen in this case because we // skipped over the parent when we bailed out. var newFirst = null; var newLast = null; var firstBaseUpdate = queue.firstBaseUpdate; if (firstBaseUpdate !== null) { // Loop through the updates and clone them. var update = firstBaseUpdate; do { var clone = { eventTime: update.eventTime, lane: update.lane, tag: update.tag, payload: update.payload, callback: update.callback, next: null }; if (newLast === null) { newFirst = newLast = clone; } else { newLast.next = clone; newLast = clone; } update = update.next; } while (update !== null); // Append the captured update the end of the cloned list. if (newLast === null) { newFirst = newLast = capturedUpdate; } else { newLast.next = capturedUpdate; newLast = capturedUpdate; } } else { // There are no base updates. newFirst = newLast = capturedUpdate; } queue = { baseState: currentQueue.baseState, firstBaseUpdate: newFirst, lastBaseUpdate: newLast, shared: currentQueue.shared, effects: currentQueue.effects }; workInProgress.updateQueue = queue; return; } } // Append the update to the end of the list. var lastBaseUpdate = queue.lastBaseUpdate; if (lastBaseUpdate === null) { queue.firstBaseUpdate = capturedUpdate; } else { lastBaseUpdate.next = capturedUpdate; } queue.lastBaseUpdate = capturedUpdate; } function getStateFromUpdate(workInProgress, queue, update, prevState, nextProps, instance) { switch (update.tag) { case ReplaceState: { var payload = update.payload; if (typeof payload === 'function') { // Updater function { enterDisallowedContextReadInDEV(); } var nextState = payload.call(instance, prevState, nextProps); { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { payload.call(instance, prevState, nextProps); } finally { setIsStrictModeForDevtools(false); } } exitDisallowedContextReadInDEV(); } return nextState; } // State object return payload; } case CaptureUpdate: { workInProgress.flags = workInProgress.flags & ~ShouldCapture | DidCapture; } // Intentional fallthrough case UpdateState: { var _payload = update.payload; var partialState; if (typeof _payload === 'function') { // Updater function { enterDisallowedContextReadInDEV(); } partialState = _payload.call(instance, prevState, nextProps); { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { _payload.call(instance, prevState, nextProps); } finally { setIsStrictModeForDevtools(false); } } exitDisallowedContextReadInDEV(); } } else { // Partial state object partialState = _payload; } if (partialState === null || partialState === undefined) { // Null and undefined are treated as no-ops. return prevState; } // Merge the partial state and the previous state. return assign({}, prevState, partialState); } case ForceUpdate: { hasForceUpdate = true; return prevState; } } return prevState; } function processUpdateQueue(workInProgress, props, instance, renderLanes) { // This is always non-null on a ClassComponent or HostRoot var queue = workInProgress.updateQueue; hasForceUpdate = false; { currentlyProcessingQueue = queue.shared; } var firstBaseUpdate = queue.firstBaseUpdate; var lastBaseUpdate = queue.lastBaseUpdate; // Check if there are pending updates. If so, transfer them to the base queue. var pendingQueue = queue.shared.pending; if (pendingQueue !== null) { queue.shared.pending = null; // The pending queue is circular. Disconnect the pointer between first // and last so that it's non-circular. var lastPendingUpdate = pendingQueue; var firstPendingUpdate = lastPendingUpdate.next; lastPendingUpdate.next = null; // Append pending updates to base queue if (lastBaseUpdate === null) { firstBaseUpdate = firstPendingUpdate; } else { lastBaseUpdate.next = firstPendingUpdate; } lastBaseUpdate = lastPendingUpdate; // If there's a current queue, and it's different from the base queue, then // we need to transfer the updates to that queue, too. Because the base // queue is a singly-linked list with no cycles, we can append to both // lists and take advantage of structural sharing. // TODO: Pass `current` as argument var current = workInProgress.alternate; if (current !== null) { // This is always non-null on a ClassComponent or HostRoot var currentQueue = current.updateQueue; var currentLastBaseUpdate = currentQueue.lastBaseUpdate; if (currentLastBaseUpdate !== lastBaseUpdate) { if (currentLastBaseUpdate === null) { currentQueue.firstBaseUpdate = firstPendingUpdate; } else { currentLastBaseUpdate.next = firstPendingUpdate; } currentQueue.lastBaseUpdate = lastPendingUpdate; } } } // These values may change as we process the queue. if (firstBaseUpdate !== null) { // Iterate through the list of updates to compute the result. var newState = queue.baseState; // TODO: Don't need to accumulate this. Instead, we can remove renderLanes // from the original lanes. var newLanes = NoLanes; var newBaseState = null; var newFirstBaseUpdate = null; var newLastBaseUpdate = null; var update = firstBaseUpdate; do { var updateLane = update.lane; var updateEventTime = update.eventTime; if (!isSubsetOfLanes(renderLanes, updateLane)) { // Priority is insufficient. Skip this update. If this is the first // skipped update, the previous update/state is the new base // update/state. var clone = { eventTime: updateEventTime, lane: updateLane, tag: update.tag, payload: update.payload, callback: update.callback, next: null }; if (newLastBaseUpdate === null) { newFirstBaseUpdate = newLastBaseUpdate = clone; newBaseState = newState; } else { newLastBaseUpdate = newLastBaseUpdate.next = clone; } // Update the remaining priority in the queue. newLanes = mergeLanes(newLanes, updateLane); } else { // This update does have sufficient priority. if (newLastBaseUpdate !== null) { var _clone = { eventTime: updateEventTime, // This update is going to be committed so we never want uncommit // it. Using NoLane works because 0 is a subset of all bitmasks, so // this will never be skipped by the check above. lane: NoLane, tag: update.tag, payload: update.payload, callback: update.callback, next: null }; newLastBaseUpdate = newLastBaseUpdate.next = _clone; } // Process this update. newState = getStateFromUpdate(workInProgress, queue, update, newState, props, instance); var callback = update.callback; if (callback !== null && // If the update was already committed, we should not queue its // callback again. update.lane !== NoLane) { workInProgress.flags |= Callback; var effects = queue.effects; if (effects === null) { queue.effects = [update]; } else { effects.push(update); } } } update = update.next; if (update === null) { pendingQueue = queue.shared.pending; if (pendingQueue === null) { break; } else { // An update was scheduled from inside a reducer. Add the new // pending updates to the end of the list and keep processing. var _lastPendingUpdate = pendingQueue; // Intentionally unsound. Pending updates form a circular list, but we // unravel them when transferring them to the base queue. var _firstPendingUpdate = _lastPendingUpdate.next; _lastPendingUpdate.next = null; update = _firstPendingUpdate; queue.lastBaseUpdate = _lastPendingUpdate; queue.shared.pending = null; } } } while (true); if (newLastBaseUpdate === null) { newBaseState = newState; } queue.baseState = newBaseState; queue.firstBaseUpdate = newFirstBaseUpdate; queue.lastBaseUpdate = newLastBaseUpdate; // Interleaved updates are stored on a separate queue. We aren't going to // process them during this render, but we do need to track which lanes // are remaining. var lastInterleaved = queue.shared.interleaved; if (lastInterleaved !== null) { var interleaved = lastInterleaved; do { newLanes = mergeLanes(newLanes, interleaved.lane); interleaved = interleaved.next; } while (interleaved !== lastInterleaved); } else if (firstBaseUpdate === null) { // `queue.lanes` is used for entangling transitions. We can set it back to // zero once the queue is empty. queue.shared.lanes = NoLanes; } // Set the remaining expiration time to be whatever is remaining in the queue. // This should be fine because the only two other things that contribute to // expiration time are props and context. We're already in the middle of the // begin phase by the time we start processing the queue, so we've already // dealt with the props. Context in components that specify // shouldComponentUpdate is tricky; but we'll have to account for // that regardless. markSkippedUpdateLanes(newLanes); workInProgress.lanes = newLanes; workInProgress.memoizedState = newState; } { currentlyProcessingQueue = null; } } function callCallback(callback, context) { if (typeof callback !== 'function') { throw new Error('Invalid argument passed as callback. Expected a function. Instead ' + ("received: " + callback)); } callback.call(context); } function resetHasForceUpdateBeforeProcessing() { hasForceUpdate = false; } function checkHasForceUpdateAfterProcessing() { return hasForceUpdate; } function commitUpdateQueue(finishedWork, finishedQueue, instance) { // Commit the effects var effects = finishedQueue.effects; finishedQueue.effects = null; if (effects !== null) { for (var i = 0; i < effects.length; i++) { var effect = effects[i]; var callback = effect.callback; if (callback !== null) { effect.callback = null; callCallback(callback, instance); } } } } var NO_CONTEXT = {}; var contextStackCursor$1 = createCursor(NO_CONTEXT); var contextFiberStackCursor = createCursor(NO_CONTEXT); var rootInstanceStackCursor = createCursor(NO_CONTEXT); function requiredContext(c) { if (c === NO_CONTEXT) { throw new Error('Expected host context to exist. This error is likely caused by a bug ' + 'in React. Please file an issue.'); } return c; } function getRootHostContainer() { var rootInstance = requiredContext(rootInstanceStackCursor.current); return rootInstance; } function pushHostContainer(fiber, nextRootInstance) { // Push current root instance onto the stack; // This allows us to reset root when portals are popped. push(rootInstanceStackCursor, nextRootInstance, fiber); // Track the context and the Fiber that provided it. // This enables us to pop only Fibers that provide unique contexts. push(contextFiberStackCursor, fiber, fiber); // Finally, we need to push the host context to the stack. // However, we can't just call getRootHostContext() and push it because // we'd have a different number of entries on the stack depending on // whether getRootHostContext() throws somewhere in renderer code or not. // So we push an empty value first. This lets us safely unwind on errors. push(contextStackCursor$1, NO_CONTEXT, fiber); var nextRootContext = getRootHostContext(nextRootInstance); // Now that we know this function doesn't throw, replace it. pop(contextStackCursor$1, fiber); push(contextStackCursor$1, nextRootContext, fiber); } function popHostContainer(fiber) { pop(contextStackCursor$1, fiber); pop(contextFiberStackCursor, fiber); pop(rootInstanceStackCursor, fiber); } function getHostContext() { var context = requiredContext(contextStackCursor$1.current); return context; } function pushHostContext(fiber) { var rootInstance = requiredContext(rootInstanceStackCursor.current); var context = requiredContext(contextStackCursor$1.current); var nextContext = getChildHostContext(context, fiber.type); // Don't push this Fiber's context unless it's unique. if (context === nextContext) { return; } // Track the context and the Fiber that provided it. // This enables us to pop only Fibers that provide unique contexts. push(contextFiberStackCursor, fiber, fiber); push(contextStackCursor$1, nextContext, fiber); } function popHostContext(fiber) { // Do not pop unless this Fiber provided the current context. // pushHostContext() only pushes Fibers that provide unique contexts. if (contextFiberStackCursor.current !== fiber) { return; } pop(contextStackCursor$1, fiber); pop(contextFiberStackCursor, fiber); } var DefaultSuspenseContext = 0; // The Suspense Context is split into two parts. The lower bits is // inherited deeply down the subtree. The upper bits only affect // this immediate suspense boundary and gets reset each new // boundary or suspense list. var SubtreeSuspenseContextMask = 1; // Subtree Flags: // InvisibleParentSuspenseContext indicates that one of our parent Suspense // boundaries is not currently showing visible main content. // Either because it is already showing a fallback or is not mounted at all. // We can use this to determine if it is desirable to trigger a fallback at // the parent. If not, then we might need to trigger undesirable boundaries // and/or suspend the commit to avoid hiding the parent content. var InvisibleParentSuspenseContext = 1; // Shallow Flags: // ForceSuspenseFallback can be used by SuspenseList to force newly added // items into their fallback state during one of the render passes. var ForceSuspenseFallback = 2; var suspenseStackCursor = createCursor(DefaultSuspenseContext); function hasSuspenseContext(parentContext, flag) { return (parentContext & flag) !== 0; } function setDefaultShallowSuspenseContext(parentContext) { return parentContext & SubtreeSuspenseContextMask; } function setShallowSuspenseContext(parentContext, shallowContext) { return parentContext & SubtreeSuspenseContextMask | shallowContext; } function addSubtreeSuspenseContext(parentContext, subtreeContext) { return parentContext | subtreeContext; } function pushSuspenseContext(fiber, newContext) { push(suspenseStackCursor, newContext, fiber); } function popSuspenseContext(fiber) { pop(suspenseStackCursor, fiber); } function shouldCaptureSuspense(workInProgress, hasInvisibleParent) { // If it was the primary children that just suspended, capture and render the // fallback. Otherwise, don't capture and bubble to the next boundary. var nextState = workInProgress.memoizedState; if (nextState !== null) { if (nextState.dehydrated !== null) { // A dehydrated boundary always captures. return true; } return false; } var props = workInProgress.memoizedProps; // Regular boundaries always capture. { return true; } // If it's a boundary we should avoid, then we prefer to bubble up to the } function findFirstSuspended(row) { var node = row; while (node !== null) { if (node.tag === SuspenseComponent) { var state = node.memoizedState; if (state !== null) { var dehydrated = state.dehydrated; if (dehydrated === null || isSuspenseInstancePending(dehydrated) || isSuspenseInstanceFallback(dehydrated)) { return node; } } } else if (node.tag === SuspenseListComponent && // revealOrder undefined can't be trusted because it don't // keep track of whether it suspended or not. node.memoizedProps.revealOrder !== undefined) { var didSuspend = (node.flags & DidCapture) !== NoFlags; if (didSuspend) { return node; } } else if (node.child !== null) { node.child.return = node; node = node.child; continue; } if (node === row) { return null; } while (node.sibling === null) { if (node.return === null || node.return === row) { return null; } node = node.return; } node.sibling.return = node.return; node = node.sibling; } return null; } var NoFlags$1 = /* */ 0; // Represents whether effect should fire. var HasEffect = /* */ 1; // Represents the phase in which the effect (not the clean-up) fires. var Insertion = /* */ 2; var Layout = /* */ 4; var Passive$1 = /* */ 8; // and should be reset before starting a new render. // This tracks which mutable sources need to be reset after a render. var workInProgressSources = []; function resetWorkInProgressVersions() { for (var i = 0; i < workInProgressSources.length; i++) { var mutableSource = workInProgressSources[i]; { mutableSource._workInProgressVersionPrimary = null; } } workInProgressSources.length = 0; } // This ensures that the version used for server rendering matches the one // that is eventually read during hydration. // If they don't match there's a potential tear and a full deopt render is required. function registerMutableSourceForHydration(root, mutableSource) { var getVersion = mutableSource._getVersion; var version = getVersion(mutableSource._source); // TODO Clear this data once all pending hydration work is finished. // Retaining it forever may interfere with GC. if (root.mutableSourceEagerHydrationData == null) { root.mutableSourceEagerHydrationData = [mutableSource, version]; } else { root.mutableSourceEagerHydrationData.push(mutableSource, version); } } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig; var didWarnAboutMismatchedHooksForComponent; var didWarnUncachedGetSnapshot; { didWarnAboutMismatchedHooksForComponent = new Set(); } // These are set right before calling the component. var renderLanes = NoLanes; // The work-in-progress fiber. I've named it differently to distinguish it from // the work-in-progress hook. var currentlyRenderingFiber$1 = null; // Hooks are stored as a linked list on the fiber's memoizedState field. The // current hook list is the list that belongs to the current fiber. The // work-in-progress hook list is a new list that will be added to the // work-in-progress fiber. var currentHook = null; var workInProgressHook = null; // Whether an update was scheduled at any point during the render phase. This // does not get reset if we do another render pass; only when we're completely // finished evaluating this component. This is an optimization so we know // whether we need to clear render phase updates after a throw. var didScheduleRenderPhaseUpdate = false; // Where an update was scheduled only during the current render pass. This // gets reset after each attempt. // TODO: Maybe there's some way to consolidate this with // `didScheduleRenderPhaseUpdate`. Or with `numberOfReRenders`. var didScheduleRenderPhaseUpdateDuringThisPass = false; // Counts the number of useId hooks in this component. var localIdCounter = 0; // Used for ids that are generated completely client-side (i.e. not during // hydration). This counter is global, so client ids are not stable across // render attempts. var globalClientIdCounter = 0; var RE_RENDER_LIMIT = 25; // In DEV, this is the name of the currently executing primitive hook var currentHookNameInDev = null; // In DEV, this list ensures that hooks are called in the same order between renders. // The list stores the order of hooks used during the initial render (mount). // Subsequent renders (updates) reference this list. var hookTypesDev = null; var hookTypesUpdateIndexDev = -1; // In DEV, this tracks whether currently rendering component needs to ignore // the dependencies for Hooks that need them (e.g. useEffect or useMemo). // When true, such Hooks will always be "remounted". Only used during hot reload. var ignorePreviousDependencies = false; function mountHookTypesDev() { { var hookName = currentHookNameInDev; if (hookTypesDev === null) { hookTypesDev = [hookName]; } else { hookTypesDev.push(hookName); } } } function updateHookTypesDev() { { var hookName = currentHookNameInDev; if (hookTypesDev !== null) { hookTypesUpdateIndexDev++; if (hookTypesDev[hookTypesUpdateIndexDev] !== hookName) { warnOnHookMismatchInDev(hookName); } } } } function checkDepsAreArrayDev(deps) { { if (deps !== undefined && deps !== null && !isArray(deps)) { // Verify deps, but only on mount to avoid extra checks. // It's unlikely their type would change as usually you define them inline. error('%s received a final argument that is not an array (instead, received `%s`). When ' + 'specified, the final argument must be an array.', currentHookNameInDev, typeof deps); } } } function warnOnHookMismatchInDev(currentHookName) { { var componentName = getComponentNameFromFiber(currentlyRenderingFiber$1); if (!didWarnAboutMismatchedHooksForComponent.has(componentName)) { didWarnAboutMismatchedHooksForComponent.add(componentName); if (hookTypesDev !== null) { var table = ''; var secondColumnStart = 30; for (var i = 0; i <= hookTypesUpdateIndexDev; i++) { var oldHookName = hookTypesDev[i]; var newHookName = i === hookTypesUpdateIndexDev ? currentHookName : oldHookName; var row = i + 1 + ". " + oldHookName; // Extra space so second column lines up // lol @ IE not supporting String#repeat while (row.length < secondColumnStart) { row += ' '; } row += newHookName + '\n'; table += row; } error('React has detected a change in the order of Hooks called by %s. ' + 'This will lead to bugs and errors if not fixed. ' + 'For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks\n\n' + ' Previous render Next render\n' + ' ------------------------------------------------------\n' + '%s' + ' ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n', componentName, table); } } } } function throwInvalidHookError() { throw new Error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.'); } function areHookInputsEqual(nextDeps, prevDeps) { { if (ignorePreviousDependencies) { // Only true when this component is being hot reloaded. return false; } } if (prevDeps === null) { { error('%s received a final argument during this render, but not during ' + 'the previous render. Even though the final argument is optional, ' + 'its type cannot change between renders.', currentHookNameInDev); } return false; } { // Don't bother comparing lengths in prod because these arrays should be // passed inline. if (nextDeps.length !== prevDeps.length) { error('The final argument passed to %s changed size between renders. The ' + 'order and size of this array must remain constant.\n\n' + 'Previous: %s\n' + 'Incoming: %s', currentHookNameInDev, "[" + prevDeps.join(', ') + "]", "[" + nextDeps.join(', ') + "]"); } } for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { if (objectIs(nextDeps[i], prevDeps[i])) { continue; } return false; } return true; } function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) { renderLanes = nextRenderLanes; currentlyRenderingFiber$1 = workInProgress; { hookTypesDev = current !== null ? current._debugHookTypes : null; hookTypesUpdateIndexDev = -1; // Used for hot reloading: ignorePreviousDependencies = current !== null && current.type !== workInProgress.type; } workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.lanes = NoLanes; // The following should have already been reset // currentHook = null; // workInProgressHook = null; // didScheduleRenderPhaseUpdate = false; // localIdCounter = 0; // TODO Warn if no hooks are used at all during mount, then some are used during update. // Currently we will identify the update render as a mount because memoizedState === null. // This is tricky because it's valid for certain types of components (e.g. React.lazy) // Using memoizedState to differentiate between mount/update only works if at least one stateful hook is used. // Non-stateful hooks (e.g. context) don't get added to memoizedState, // so memoizedState would be null during updates and mounts. { if (current !== null && current.memoizedState !== null) { ReactCurrentDispatcher$1.current = HooksDispatcherOnUpdateInDEV; } else if (hookTypesDev !== null) { // This dispatcher handles an edge case where a component is updating, // but no stateful hooks have been used. // We want to match the production code behavior (which will use HooksDispatcherOnMount), // but with the extra DEV validation to ensure hooks ordering hasn't changed. // This dispatcher does that. ReactCurrentDispatcher$1.current = HooksDispatcherOnMountWithHookTypesInDEV; } else { ReactCurrentDispatcher$1.current = HooksDispatcherOnMountInDEV; } } var children = Component(props, secondArg); // Check if there was a render phase update if (didScheduleRenderPhaseUpdateDuringThisPass) { // Keep rendering in a loop for as long as render phase updates continue to // be scheduled. Use a counter to prevent infinite loops. var numberOfReRenders = 0; do { didScheduleRenderPhaseUpdateDuringThisPass = false; localIdCounter = 0; if (numberOfReRenders >= RE_RENDER_LIMIT) { throw new Error('Too many re-renders. React limits the number of renders to prevent ' + 'an infinite loop.'); } numberOfReRenders += 1; { // Even when hot reloading, allow dependencies to stabilize // after first render to prevent infinite render phase updates. ignorePreviousDependencies = false; } // Start over from the beginning of the list currentHook = null; workInProgressHook = null; workInProgress.updateQueue = null; { // Also validate hook order for cascading updates. hookTypesUpdateIndexDev = -1; } ReactCurrentDispatcher$1.current = HooksDispatcherOnRerenderInDEV ; children = Component(props, secondArg); } while (didScheduleRenderPhaseUpdateDuringThisPass); } // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; { workInProgress._debugHookTypes = hookTypesDev; } // This check uses currentHook so that it works the same in DEV and prod bundles. // hookTypesDev could catch more cases (e.g. context) but only in DEV bundles. var didRenderTooFewHooks = currentHook !== null && currentHook.next !== null; renderLanes = NoLanes; currentlyRenderingFiber$1 = null; currentHook = null; workInProgressHook = null; { currentHookNameInDev = null; hookTypesDev = null; hookTypesUpdateIndexDev = -1; // Confirm that a static flag was not added or removed since the last // render. If this fires, it suggests that we incorrectly reset the static // flags in some other part of the codebase. This has happened before, for // example, in the SuspenseList implementation. if (current !== null && (current.flags & StaticMask) !== (workInProgress.flags & StaticMask) && // Disable this warning in legacy mode, because legacy Suspense is weird // and creates false positives. To make this work in legacy mode, we'd // need to mark fibers that commit in an incomplete state, somehow. For // now I'll disable the warning that most of the bugs that would trigger // it are either exclusive to concurrent mode or exist in both. (current.mode & ConcurrentMode) !== NoMode) { error('Internal React error: Expected static flag was missing. Please ' + 'notify the React team.'); } } didScheduleRenderPhaseUpdate = false; // This is reset by checkDidRenderIdHook // localIdCounter = 0; if (didRenderTooFewHooks) { throw new Error('Rendered fewer hooks than expected. This may be caused by an accidental ' + 'early return statement.'); } return children; } function checkDidRenderIdHook() { // This should be called immediately after every renderWithHooks call. // Conceptually, it's part of the return value of renderWithHooks; it's only a // separate function to avoid using an array tuple. var didRenderIdHook = localIdCounter !== 0; localIdCounter = 0; return didRenderIdHook; } function bailoutHooks(current, workInProgress, lanes) { workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the // complete phase (bubbleProperties). if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) { workInProgress.flags &= ~(MountPassiveDev | MountLayoutDev | Passive | Update); } else { workInProgress.flags &= ~(Passive | Update); } current.lanes = removeLanes(current.lanes, lanes); } function resetHooksAfterThrow() { // We can assume the previous dispatcher is always this one, since we set it // at the beginning of the render phase and there's no re-entrance. ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; if (didScheduleRenderPhaseUpdate) { // There were render phase updates. These are only valid for this render // phase, which we are now aborting. Remove the updates from the queues so // they do not persist to the next render. Do not remove updates from hooks // that weren't processed. // // Only reset the updates from the queue if it has a clone. If it does // not have a clone, that means it wasn't processed, and the updates were // scheduled before we entered the render phase. var hook = currentlyRenderingFiber$1.memoizedState; while (hook !== null) { var queue = hook.queue; if (queue !== null) { queue.pending = null; } hook = hook.next; } didScheduleRenderPhaseUpdate = false; } renderLanes = NoLanes; currentlyRenderingFiber$1 = null; currentHook = null; workInProgressHook = null; { hookTypesDev = null; hookTypesUpdateIndexDev = -1; currentHookNameInDev = null; isUpdatingOpaqueValueInRenderPhase = false; } didScheduleRenderPhaseUpdateDuringThisPass = false; localIdCounter = 0; } function mountWorkInProgressHook() { var hook = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; if (workInProgressHook === null) { // This is the first hook in the list currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook; } else { // Append to the end of the list workInProgressHook = workInProgressHook.next = hook; } return workInProgressHook; } function updateWorkInProgressHook() { // This function is used both for updates and for re-renders triggered by a // render phase update. It assumes there is either a current hook we can // clone, or a work-in-progress hook from a previous render pass that we can // use as a base. When we reach the end of the base list, we must switch to // the dispatcher used for mounts. var nextCurrentHook; if (currentHook === null) { var current = currentlyRenderingFiber$1.alternate; if (current !== null) { nextCurrentHook = current.memoizedState; } else { nextCurrentHook = null; } } else { nextCurrentHook = currentHook.next; } var nextWorkInProgressHook; if (workInProgressHook === null) { nextWorkInProgressHook = currentlyRenderingFiber$1.memoizedState; } else { nextWorkInProgressHook = workInProgressHook.next; } if (nextWorkInProgressHook !== null) { // There's already a work-in-progress. Reuse it. workInProgressHook = nextWorkInProgressHook; nextWorkInProgressHook = workInProgressHook.next; currentHook = nextCurrentHook; } else { // Clone from the current hook. if (nextCurrentHook === null) { throw new Error('Rendered more hooks than during the previous render.'); } currentHook = nextCurrentHook; var newHook = { memoizedState: currentHook.memoizedState, baseState: currentHook.baseState, baseQueue: currentHook.baseQueue, queue: currentHook.queue, next: null }; if (workInProgressHook === null) { // This is the first hook in the list. currentlyRenderingFiber$1.memoizedState = workInProgressHook = newHook; } else { // Append to the end of the list. workInProgressHook = workInProgressHook.next = newHook; } } return workInProgressHook; } function createFunctionComponentUpdateQueue() { return { lastEffect: null, stores: null }; } function basicStateReducer(state, action) { // $FlowFixMe: Flow doesn't like mixed types return typeof action === 'function' ? action(state) : action; } function mountReducer(reducer, initialArg, init) { var hook = mountWorkInProgressHook(); var initialState; if (init !== undefined) { initialState = init(initialArg); } else { initialState = initialArg; } hook.memoizedState = hook.baseState = initialState; var queue = { pending: null, interleaved: null, lanes: NoLanes, dispatch: null, lastRenderedReducer: reducer, lastRenderedState: initialState }; hook.queue = queue; var dispatch = queue.dispatch = dispatchReducerAction.bind(null, currentlyRenderingFiber$1, queue); return [hook.memoizedState, dispatch]; } function updateReducer(reducer, initialArg, init) { var hook = updateWorkInProgressHook(); var queue = hook.queue; if (queue === null) { throw new Error('Should have a queue. This is likely a bug in React. Please file an issue.'); } queue.lastRenderedReducer = reducer; var current = currentHook; // The last rebase update that is NOT part of the base state. var baseQueue = current.baseQueue; // The last pending update that hasn't been processed yet. var pendingQueue = queue.pending; if (pendingQueue !== null) { // We have new updates that haven't been processed yet. // We'll add them to the base queue. if (baseQueue !== null) { // Merge the pending queue and the base queue. var baseFirst = baseQueue.next; var pendingFirst = pendingQueue.next; baseQueue.next = pendingFirst; pendingQueue.next = baseFirst; } { if (current.baseQueue !== baseQueue) { // Internal invariant that should never happen, but feasibly could in // the future if we implement resuming, or some form of that. error('Internal error: Expected work-in-progress queue to be a clone. ' + 'This is a bug in React.'); } } current.baseQueue = baseQueue = pendingQueue; queue.pending = null; } if (baseQueue !== null) { // We have a queue to process. var first = baseQueue.next; var newState = current.baseState; var newBaseState = null; var newBaseQueueFirst = null; var newBaseQueueLast = null; var update = first; do { var updateLane = update.lane; if (!isSubsetOfLanes(renderLanes, updateLane)) { // Priority is insufficient. Skip this update. If this is the first // skipped update, the previous update/state is the new base // update/state. var clone = { lane: updateLane, action: update.action, hasEagerState: update.hasEagerState, eagerState: update.eagerState, next: null }; if (newBaseQueueLast === null) { newBaseQueueFirst = newBaseQueueLast = clone; newBaseState = newState; } else { newBaseQueueLast = newBaseQueueLast.next = clone; } // Update the remaining priority in the queue. // TODO: Don't need to accumulate this. Instead, we can remove // renderLanes from the original lanes. currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane); markSkippedUpdateLanes(updateLane); } else { // This update does have sufficient priority. if (newBaseQueueLast !== null) { var _clone = { // This update is going to be committed so we never want uncommit // it. Using NoLane works because 0 is a subset of all bitmasks, so // this will never be skipped by the check above. lane: NoLane, action: update.action, hasEagerState: update.hasEagerState, eagerState: update.eagerState, next: null }; newBaseQueueLast = newBaseQueueLast.next = _clone; } // Process this update. if (update.hasEagerState) { // If this update is a state update (not a reducer) and was processed eagerly, // we can use the eagerly computed state newState = update.eagerState; } else { var action = update.action; newState = reducer(newState, action); } } update = update.next; } while (update !== null && update !== first); if (newBaseQueueLast === null) { newBaseState = newState; } else { newBaseQueueLast.next = newBaseQueueFirst; } // Mark that the fiber performed work, but only if the new state is // different from the current state. if (!objectIs(newState, hook.memoizedState)) { markWorkInProgressReceivedUpdate(); } hook.memoizedState = newState; hook.baseState = newBaseState; hook.baseQueue = newBaseQueueLast; queue.lastRenderedState = newState; } // Interleaved updates are stored on a separate queue. We aren't going to // process them during this render, but we do need to track which lanes // are remaining. var lastInterleaved = queue.interleaved; if (lastInterleaved !== null) { var interleaved = lastInterleaved; do { var interleavedLane = interleaved.lane; currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, interleavedLane); markSkippedUpdateLanes(interleavedLane); interleaved = interleaved.next; } while (interleaved !== lastInterleaved); } else if (baseQueue === null) { // `queue.lanes` is used for entangling transitions. We can set it back to // zero once the queue is empty. queue.lanes = NoLanes; } var dispatch = queue.dispatch; return [hook.memoizedState, dispatch]; } function rerenderReducer(reducer, initialArg, init) { var hook = updateWorkInProgressHook(); var queue = hook.queue; if (queue === null) { throw new Error('Should have a queue. This is likely a bug in React. Please file an issue.'); } queue.lastRenderedReducer = reducer; // This is a re-render. Apply the new render phase updates to the previous // work-in-progress hook. var dispatch = queue.dispatch; var lastRenderPhaseUpdate = queue.pending; var newState = hook.memoizedState; if (lastRenderPhaseUpdate !== null) { // The queue doesn't persist past this render pass. queue.pending = null; var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next; var update = firstRenderPhaseUpdate; do { // Process this render phase update. We don't have to check the // priority because it will always be the same as the current // render's. var action = update.action; newState = reducer(newState, action); update = update.next; } while (update !== firstRenderPhaseUpdate); // Mark that the fiber performed work, but only if the new state is // different from the current state. if (!objectIs(newState, hook.memoizedState)) { markWorkInProgressReceivedUpdate(); } hook.memoizedState = newState; // Don't persist the state accumulated from the render phase updates to // the base state unless the queue is empty. // TODO: Not sure if this is the desired semantics, but it's what we // do for gDSFP. I can't remember why. if (hook.baseQueue === null) { hook.baseState = newState; } queue.lastRenderedState = newState; } return [newState, dispatch]; } function mountMutableSource(source, getSnapshot, subscribe) { { return undefined; } } function updateMutableSource(source, getSnapshot, subscribe) { { return undefined; } } function mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { var fiber = currentlyRenderingFiber$1; var hook = mountWorkInProgressHook(); var nextSnapshot; var isHydrating = getIsHydrating(); if (isHydrating) { if (getServerSnapshot === undefined) { throw new Error('Missing getServerSnapshot, which is required for ' + 'server-rendered content. Will revert to client rendering.'); } nextSnapshot = getServerSnapshot(); { if (!didWarnUncachedGetSnapshot) { if (nextSnapshot !== getServerSnapshot()) { error('The result of getServerSnapshot should be cached to avoid an infinite loop'); didWarnUncachedGetSnapshot = true; } } } } else { nextSnapshot = getSnapshot(); { if (!didWarnUncachedGetSnapshot) { var cachedSnapshot = getSnapshot(); if (!objectIs(nextSnapshot, cachedSnapshot)) { error('The result of getSnapshot should be cached to avoid an infinite loop'); didWarnUncachedGetSnapshot = true; } } } // Unless we're rendering a blocking lane, schedule a consistency check. // Right before committing, we will walk the tree and check if any of the // stores were mutated. // // We won't do this if we're hydrating server-rendered content, because if // the content is stale, it's already visible anyway. Instead we'll patch // it up in a passive effect. var root = getWorkInProgressRoot(); if (root === null) { throw new Error('Expected a work-in-progress root. This is a bug in React. Please file an issue.'); } if (!includesBlockingLane(root, renderLanes)) { pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } } // Read the current snapshot from the store on every render. This breaks the // normal rules of React, and only works because store updates are // always synchronous. hook.memoizedState = nextSnapshot; var inst = { value: nextSnapshot, getSnapshot: getSnapshot }; hook.queue = inst; // Schedule an effect to subscribe to the store. mountEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); // Schedule an effect to update the mutable instance fields. We will update // this whenever subscribe, getSnapshot, or value changes. Because there's no // clean-up function, and we track the deps correctly, we can call pushEffect // directly, without storing any additional state. For the same reason, we // don't need to set a static flag, either. // TODO: We can move this to the passive phase once we add a pre-commit // consistency check. See the next comment. fiber.flags |= Passive; pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), undefined, null); return nextSnapshot; } function updateSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { var fiber = currentlyRenderingFiber$1; var hook = updateWorkInProgressHook(); // Read the current snapshot from the store on every render. This breaks the // normal rules of React, and only works because store updates are // always synchronous. var nextSnapshot = getSnapshot(); { if (!didWarnUncachedGetSnapshot) { var cachedSnapshot = getSnapshot(); if (!objectIs(nextSnapshot, cachedSnapshot)) { error('The result of getSnapshot should be cached to avoid an infinite loop'); didWarnUncachedGetSnapshot = true; } } } var prevSnapshot = hook.memoizedState; var snapshotChanged = !objectIs(prevSnapshot, nextSnapshot); if (snapshotChanged) { hook.memoizedState = nextSnapshot; markWorkInProgressReceivedUpdate(); } var inst = hook.queue; updateEffect(subscribeToStore.bind(null, fiber, inst, subscribe), [subscribe]); // Whenever getSnapshot or subscribe changes, we need to check in the // commit phase if there was an interleaved mutation. In concurrent mode // this can happen all the time, but even in synchronous mode, an earlier // effect may have mutated the store. if (inst.getSnapshot !== getSnapshot || snapshotChanged || // Check if the susbcribe function changed. We can save some memory by // checking whether we scheduled a subscription effect above. workInProgressHook !== null && workInProgressHook.memoizedState.tag & HasEffect) { fiber.flags |= Passive; pushEffect(HasEffect | Passive$1, updateStoreInstance.bind(null, fiber, inst, nextSnapshot, getSnapshot), undefined, null); // Unless we're rendering a blocking lane, schedule a consistency check. // Right before committing, we will walk the tree and check if any of the // stores were mutated. var root = getWorkInProgressRoot(); if (root === null) { throw new Error('Expected a work-in-progress root. This is a bug in React. Please file an issue.'); } if (!includesBlockingLane(root, renderLanes)) { pushStoreConsistencyCheck(fiber, getSnapshot, nextSnapshot); } } return nextSnapshot; } function pushStoreConsistencyCheck(fiber, getSnapshot, renderedSnapshot) { fiber.flags |= StoreConsistency; var check = { getSnapshot: getSnapshot, value: renderedSnapshot }; var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; if (componentUpdateQueue === null) { componentUpdateQueue = createFunctionComponentUpdateQueue(); currentlyRenderingFiber$1.updateQueue = componentUpdateQueue; componentUpdateQueue.stores = [check]; } else { var stores = componentUpdateQueue.stores; if (stores === null) { componentUpdateQueue.stores = [check]; } else { stores.push(check); } } } function updateStoreInstance(fiber, inst, nextSnapshot, getSnapshot) { // These are updated in the passive phase inst.value = nextSnapshot; inst.getSnapshot = getSnapshot; // Something may have been mutated in between render and commit. This could // have been in an event that fired before the passive effects, or it could // have been in a layout effect. In that case, we would have used the old // snapsho and getSnapshot values to bail out. We need to check one more time. if (checkIfSnapshotChanged(inst)) { // Force a re-render. forceStoreRerender(fiber); } } function subscribeToStore(fiber, inst, subscribe) { var handleStoreChange = function () { // The store changed. Check if the snapshot changed since the last time we // read from the store. if (checkIfSnapshotChanged(inst)) { // Force a re-render. forceStoreRerender(fiber); } }; // Subscribe to the store and return a clean-up function. return subscribe(handleStoreChange); } function checkIfSnapshotChanged(inst) { var latestGetSnapshot = inst.getSnapshot; var prevValue = inst.value; try { var nextValue = latestGetSnapshot(); return !objectIs(prevValue, nextValue); } catch (error) { return true; } } function forceStoreRerender(fiber) { var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } } function mountState(initialState) { var hook = mountWorkInProgressHook(); if (typeof initialState === 'function') { // $FlowFixMe: Flow doesn't like mixed types initialState = initialState(); } hook.memoizedState = hook.baseState = initialState; var queue = { pending: null, interleaved: null, lanes: NoLanes, dispatch: null, lastRenderedReducer: basicStateReducer, lastRenderedState: initialState }; hook.queue = queue; var dispatch = queue.dispatch = dispatchSetState.bind(null, currentlyRenderingFiber$1, queue); return [hook.memoizedState, dispatch]; } function updateState(initialState) { return updateReducer(basicStateReducer); } function rerenderState(initialState) { return rerenderReducer(basicStateReducer); } function pushEffect(tag, create, destroy, deps) { var effect = { tag: tag, create: create, destroy: destroy, deps: deps, // Circular next: null }; var componentUpdateQueue = currentlyRenderingFiber$1.updateQueue; if (componentUpdateQueue === null) { componentUpdateQueue = createFunctionComponentUpdateQueue(); currentlyRenderingFiber$1.updateQueue = componentUpdateQueue; componentUpdateQueue.lastEffect = effect.next = effect; } else { var lastEffect = componentUpdateQueue.lastEffect; if (lastEffect === null) { componentUpdateQueue.lastEffect = effect.next = effect; } else { var firstEffect = lastEffect.next; lastEffect.next = effect; effect.next = firstEffect; componentUpdateQueue.lastEffect = effect; } } return effect; } function mountRef(initialValue) { var hook = mountWorkInProgressHook(); { var _ref2 = { current: initialValue }; hook.memoizedState = _ref2; return _ref2; } } function updateRef(initialValue) { var hook = updateWorkInProgressHook(); return hook.memoizedState; } function mountEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = mountWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; currentlyRenderingFiber$1.flags |= fiberFlags; hook.memoizedState = pushEffect(HasEffect | hookFlags, create, undefined, nextDeps); } function updateEffectImpl(fiberFlags, hookFlags, create, deps) { var hook = updateWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; var destroy = undefined; if (currentHook !== null) { var prevEffect = currentHook.memoizedState; destroy = prevEffect.destroy; if (nextDeps !== null) { var prevDeps = prevEffect.deps; if (areHookInputsEqual(nextDeps, prevDeps)) { hook.memoizedState = pushEffect(hookFlags, create, destroy, nextDeps); return; } } } currentlyRenderingFiber$1.flags |= fiberFlags; hook.memoizedState = pushEffect(HasEffect | hookFlags, create, destroy, nextDeps); } function mountEffect(create, deps) { if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create, deps); } else { return mountEffectImpl(Passive | PassiveStatic, Passive$1, create, deps); } } function updateEffect(create, deps) { return updateEffectImpl(Passive, Passive$1, create, deps); } function mountInsertionEffect(create, deps) { return mountEffectImpl(Update, Insertion, create, deps); } function updateInsertionEffect(create, deps) { return updateEffectImpl(Update, Insertion, create, deps); } function mountLayoutEffect(create, deps) { var fiberFlags = Update; { fiberFlags |= LayoutStatic; } if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } return mountEffectImpl(fiberFlags, Layout, create, deps); } function updateLayoutEffect(create, deps) { return updateEffectImpl(Update, Layout, create, deps); } function imperativeHandleEffect(create, ref) { if (typeof ref === 'function') { var refCallback = ref; var _inst = create(); refCallback(_inst); return function () { refCallback(null); }; } else if (ref !== null && ref !== undefined) { var refObject = ref; { if (!refObject.hasOwnProperty('current')) { error('Expected useImperativeHandle() first argument to either be a ' + 'ref callback or React.createRef() object. Instead received: %s.', 'an object with keys {' + Object.keys(refObject).join(', ') + '}'); } } var _inst2 = create(); refObject.current = _inst2; return function () { refObject.current = null; }; } } function mountImperativeHandle(ref, create, deps) { { if (typeof create !== 'function') { error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null'); } } // TODO: If deps are provided, should we skip comparing the ref itself? var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; var fiberFlags = Update; { fiberFlags |= LayoutStatic; } if ( (currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); } function updateImperativeHandle(ref, create, deps) { { if (typeof create !== 'function') { error('Expected useImperativeHandle() second argument to be a function ' + 'that creates a handle. Instead received: %s.', create !== null ? typeof create : 'null'); } } // TODO: If deps are provided, should we skip comparing the ref itself? var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null; return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create, ref), effectDeps); } function mountDebugValue(value, formatterFn) {// This hook is normally a no-op. // The react-debug-hooks package injects its own implementation // so that e.g. DevTools can display custom hook values. } var updateDebugValue = mountDebugValue; function mountCallback(callback, deps) { var hook = mountWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; hook.memoizedState = [callback, nextDeps]; return callback; } function updateCallback(callback, deps) { var hook = updateWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; var prevState = hook.memoizedState; if (prevState !== null) { if (nextDeps !== null) { var prevDeps = prevState[1]; if (areHookInputsEqual(nextDeps, prevDeps)) { return prevState[0]; } } } hook.memoizedState = [callback, nextDeps]; return callback; } function mountMemo(nextCreate, deps) { var hook = mountWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; var nextValue = nextCreate(); hook.memoizedState = [nextValue, nextDeps]; return nextValue; } function updateMemo(nextCreate, deps) { var hook = updateWorkInProgressHook(); var nextDeps = deps === undefined ? null : deps; var prevState = hook.memoizedState; if (prevState !== null) { // Assume these are defined. If they're not, areHookInputsEqual will warn. if (nextDeps !== null) { var prevDeps = prevState[1]; if (areHookInputsEqual(nextDeps, prevDeps)) { return prevState[0]; } } } var nextValue = nextCreate(); hook.memoizedState = [nextValue, nextDeps]; return nextValue; } function mountDeferredValue(value) { var hook = mountWorkInProgressHook(); hook.memoizedState = value; return value; } function updateDeferredValue(value) { var hook = updateWorkInProgressHook(); var resolvedCurrentHook = currentHook; var prevValue = resolvedCurrentHook.memoizedState; return updateDeferredValueImpl(hook, prevValue, value); } function rerenderDeferredValue(value) { var hook = updateWorkInProgressHook(); if (currentHook === null) { // This is a rerender during a mount. hook.memoizedState = value; return value; } else { // This is a rerender during an update. var prevValue = currentHook.memoizedState; return updateDeferredValueImpl(hook, prevValue, value); } } function updateDeferredValueImpl(hook, prevValue, value) { var shouldDeferValue = !includesOnlyNonUrgentLanes(renderLanes); if (shouldDeferValue) { // This is an urgent update. If the value has changed, keep using the // previous value and spawn a deferred render to update it later. if (!objectIs(value, prevValue)) { // Schedule a deferred render var deferredLane = claimNextTransitionLane(); currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, deferredLane); markSkippedUpdateLanes(deferredLane); // Set this to true to indicate that the rendered value is inconsistent // from the latest value. The name "baseState" doesn't really match how we // use it because we're reusing a state hook field instead of creating a // new one. hook.baseState = true; } // Reuse the previous value return prevValue; } else { // This is not an urgent update, so we can use the latest value regardless // of what it is. No need to defer it. // However, if we're currently inside a spawned render, then we need to mark // this as an update to prevent the fiber from bailing out. // // `baseState` is true when the current value is different from the rendered // value. The name doesn't really match how we use it because we're reusing // a state hook field instead of creating a new one. if (hook.baseState) { // Flip this back to false. hook.baseState = false; markWorkInProgressReceivedUpdate(); } hook.memoizedState = value; return value; } } function startTransition(setPending, callback, options) { var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(higherEventPriority(previousPriority, ContinuousEventPriority)); setPending(true); var prevTransition = ReactCurrentBatchConfig$2.transition; ReactCurrentBatchConfig$2.transition = {}; var currentTransition = ReactCurrentBatchConfig$2.transition; { ReactCurrentBatchConfig$2.transition._updatedFibers = new Set(); } try { setPending(false); callback(); } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig$2.transition = prevTransition; { if (prevTransition === null && currentTransition._updatedFibers) { var updatedFibersCount = currentTransition._updatedFibers.size; if (updatedFibersCount > 10) { warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); } currentTransition._updatedFibers.clear(); } } } } function mountTransition() { var _mountState = mountState(false), isPending = _mountState[0], setPending = _mountState[1]; // The `start` method never changes. var start = startTransition.bind(null, setPending); var hook = mountWorkInProgressHook(); hook.memoizedState = start; return [isPending, start]; } function updateTransition() { var _updateState = updateState(), isPending = _updateState[0]; var hook = updateWorkInProgressHook(); var start = hook.memoizedState; return [isPending, start]; } function rerenderTransition() { var _rerenderState = rerenderState(), isPending = _rerenderState[0]; var hook = updateWorkInProgressHook(); var start = hook.memoizedState; return [isPending, start]; } var isUpdatingOpaqueValueInRenderPhase = false; function getIsUpdatingOpaqueValueInRenderPhaseInDEV() { { return isUpdatingOpaqueValueInRenderPhase; } } function mountId() { var hook = mountWorkInProgressHook(); var root = getWorkInProgressRoot(); // TODO: In Fizz, id generation is specific to each server config. Maybe we // should do this in Fiber, too? Deferring this decision for now because // there's no other place to store the prefix except for an internal field on // the public createRoot object, which the fiber tree does not currently have // a reference to. var identifierPrefix = root.identifierPrefix; var id; if (getIsHydrating()) { var treeId = getTreeId(); // Use a captial R prefix for server-generated ids. id = ':' + identifierPrefix + 'R' + treeId; // Unless this is the first id at this level, append a number at the end // that represents the position of this useId hook among all the useId // hooks for this fiber. var localId = localIdCounter++; if (localId > 0) { id += 'H' + localId.toString(32); } id += ':'; } else { // Use a lowercase r prefix for client-generated ids. var globalClientId = globalClientIdCounter++; id = ':' + identifierPrefix + 'r' + globalClientId.toString(32) + ':'; } hook.memoizedState = id; return id; } function updateId() { var hook = updateWorkInProgressHook(); var id = hook.memoizedState; return id; } function dispatchReducerAction(fiber, queue, action) { { if (typeof arguments[3] === 'function') { error("State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().'); } } var lane = requestUpdateLane(fiber); var update = { lane: lane, action: action, hasEagerState: false, eagerState: null, next: null }; if (isRenderPhaseUpdate(fiber)) { enqueueRenderPhaseUpdate(queue, update); } else { var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane); if (root !== null) { var eventTime = requestEventTime(); scheduleUpdateOnFiber(root, fiber, lane, eventTime); entangleTransitionUpdate(root, queue, lane); } } markUpdateInDevTools(fiber, lane); } function dispatchSetState(fiber, queue, action) { { if (typeof arguments[3] === 'function') { error("State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().'); } } var lane = requestUpdateLane(fiber); var update = { lane: lane, action: action, hasEagerState: false, eagerState: null, next: null }; if (isRenderPhaseUpdate(fiber)) { enqueueRenderPhaseUpdate(queue, update); } else { var alternate = fiber.alternate; if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) { // The queue is currently empty, which means we can eagerly compute the // next state before entering the render phase. If the new state is the // same as the current state, we may be able to bail out entirely. var lastRenderedReducer = queue.lastRenderedReducer; if (lastRenderedReducer !== null) { var prevDispatcher; { prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; } try { var currentState = queue.lastRenderedState; var eagerState = lastRenderedReducer(currentState, action); // Stash the eagerly computed state, and the reducer used to compute // it, on the update object. If the reducer hasn't changed by the // time we enter the render phase, then the eager state can be used // without calling the reducer again. update.hasEagerState = true; update.eagerState = eagerState; if (objectIs(eagerState, currentState)) { // Fast path. We can bail out without scheduling React to re-render. // It's still possible that we'll need to rebase this update later, // if the component re-renders for a different reason and by that // time the reducer has changed. // TODO: Do we still need to entangle transitions in this case? enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update, lane); return; } } catch (error) {// Suppress the error. It will throw again in the render phase. } finally { { ReactCurrentDispatcher$1.current = prevDispatcher; } } } } var root = enqueueConcurrentHookUpdate(fiber, queue, update, lane); if (root !== null) { var eventTime = requestEventTime(); scheduleUpdateOnFiber(root, fiber, lane, eventTime); entangleTransitionUpdate(root, queue, lane); } } markUpdateInDevTools(fiber, lane); } function isRenderPhaseUpdate(fiber) { var alternate = fiber.alternate; return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1; } function enqueueRenderPhaseUpdate(queue, update) { // This is a render phase update. Stash it in a lazily-created map of // queue -> linked list of updates. After this render pass, we'll restart // and apply the stashed updates on top of the work-in-progress hook. didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true; var pending = queue.pending; if (pending === null) { // This is the first update. Create a circular list. update.next = update; } else { update.next = pending.next; pending.next = update; } queue.pending = update; } // TODO: Move to ReactFiberConcurrentUpdates? function entangleTransitionUpdate(root, queue, lane) { if (isTransitionLane(lane)) { var queueLanes = queue.lanes; // If any entangled lanes are no longer pending on the root, then they // must have finished. We can remove them from the shared queue, which // represents a superset of the actually pending lanes. In some cases we // may entangle more than we need to, but that's OK. In fact it's worse if // we *don't* entangle when we should. queueLanes = intersectLanes(queueLanes, root.pendingLanes); // Entangle the new transition lane with the other transition lanes. var newQueueLanes = mergeLanes(queueLanes, lane); queue.lanes = newQueueLanes; // Even if queue.lanes already include lane, we don't know for certain if // the lane finished since the last time we entangled it. So we need to // entangle it again, just to be sure. markRootEntangled(root, newQueueLanes); } } function markUpdateInDevTools(fiber, lane, action) { { markStateUpdateScheduled(fiber, lane); } } var ContextOnlyDispatcher = { readContext: readContext, useCallback: throwInvalidHookError, useContext: throwInvalidHookError, useEffect: throwInvalidHookError, useImperativeHandle: throwInvalidHookError, useInsertionEffect: throwInvalidHookError, useLayoutEffect: throwInvalidHookError, useMemo: throwInvalidHookError, useReducer: throwInvalidHookError, useRef: throwInvalidHookError, useState: throwInvalidHookError, useDebugValue: throwInvalidHookError, useDeferredValue: throwInvalidHookError, useTransition: throwInvalidHookError, useMutableSource: throwInvalidHookError, useSyncExternalStore: throwInvalidHookError, useId: throwInvalidHookError, unstable_isNewReconciler: enableNewReconciler }; var HooksDispatcherOnMountInDEV = null; var HooksDispatcherOnMountWithHookTypesInDEV = null; var HooksDispatcherOnUpdateInDEV = null; var HooksDispatcherOnRerenderInDEV = null; var InvalidNestedHooksDispatcherOnMountInDEV = null; var InvalidNestedHooksDispatcherOnUpdateInDEV = null; var InvalidNestedHooksDispatcherOnRerenderInDEV = null; { var warnInvalidContextAccess = function () { error('Context can only be read while React is rendering. ' + 'In classes, you can read it in the render method or getDerivedStateFromProps. ' + 'In function components, you can read it directly in the function body, but not ' + 'inside Hooks like useReducer() or useMemo().'); }; var warnInvalidHookAccess = function () { error('Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. ' + 'You can only call Hooks at the top level of your React function. ' + 'For more information, see ' + 'https://reactjs.org/link/rules-of-hooks'); }; HooksDispatcherOnMountInDEV = { readContext: function (context) { return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; mountHookTypesDev(); checkDepsAreArrayDev(deps); return mountCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; mountHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; mountHookTypesDev(); checkDepsAreArrayDev(deps); return mountEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; mountHookTypesDev(); checkDepsAreArrayDev(deps); return mountImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; mountHookTypesDev(); checkDepsAreArrayDev(deps); return mountInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; mountHookTypesDev(); checkDepsAreArrayDev(deps); return mountLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; mountHookTypesDev(); checkDepsAreArrayDev(deps); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; mountHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; mountHookTypesDev(); return mountRef(initialValue); }, useState: function (initialState) { currentHookNameInDev = 'useState'; mountHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; mountHookTypesDev(); return mountDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; mountHookTypesDev(); return mountDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; mountHookTypesDev(); return mountTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; mountHookTypesDev(); return mountMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; mountHookTypesDev(); return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; mountHookTypesDev(); return mountId(); }, unstable_isNewReconciler: enableNewReconciler }; HooksDispatcherOnMountWithHookTypesInDEV = { readContext: function (context) { return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; updateHookTypesDev(); return mountCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; updateHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; updateHookTypesDev(); return mountEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; updateHookTypesDev(); return mountImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; updateHookTypesDev(); return mountInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; updateHookTypesDev(); return mountLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; updateHookTypesDev(); return mountRef(initialValue); }, useState: function (initialState) { currentHookNameInDev = 'useState'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; updateHookTypesDev(); return mountDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; updateHookTypesDev(); return mountDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; updateHookTypesDev(); return mountTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; updateHookTypesDev(); return mountMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; updateHookTypesDev(); return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; updateHookTypesDev(); return mountId(); }, unstable_isNewReconciler: enableNewReconciler }; HooksDispatcherOnUpdateInDEV = { readContext: function (context) { return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; updateHookTypesDev(); return updateCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; updateHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; updateHookTypesDev(); return updateEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; updateHookTypesDev(); return updateImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; updateHookTypesDev(); return updateInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; updateHookTypesDev(); return updateLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; updateHookTypesDev(); return updateRef(); }, useState: function (initialState) { currentHookNameInDev = 'useState'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; updateHookTypesDev(); return updateDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; updateHookTypesDev(); return updateDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; updateHookTypesDev(); return updateTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; updateHookTypesDev(); return updateMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; updateHookTypesDev(); return updateSyncExternalStore(subscribe, getSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; updateHookTypesDev(); return updateId(); }, unstable_isNewReconciler: enableNewReconciler }; HooksDispatcherOnRerenderInDEV = { readContext: function (context) { return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; updateHookTypesDev(); return updateCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; updateHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; updateHookTypesDev(); return updateEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; updateHookTypesDev(); return updateImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; updateHookTypesDev(); return updateInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; updateHookTypesDev(); return updateLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; try { return updateMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; try { return rerenderReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; updateHookTypesDev(); return updateRef(); }, useState: function (initialState) { currentHookNameInDev = 'useState'; updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV; try { return rerenderState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; updateHookTypesDev(); return updateDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; updateHookTypesDev(); return rerenderDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; updateHookTypesDev(); return rerenderTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; updateHookTypesDev(); return updateMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; updateHookTypesDev(); return updateSyncExternalStore(subscribe, getSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; updateHookTypesDev(); return updateId(); }, unstable_isNewReconciler: enableNewReconciler }; InvalidNestedHooksDispatcherOnMountInDEV = { readContext: function (context) { warnInvalidContextAccess(); return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; warnInvalidHookAccess(); mountHookTypesDev(); return mountCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; warnInvalidHookAccess(); mountHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; warnInvalidHookAccess(); mountHookTypesDev(); return mountEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; warnInvalidHookAccess(); mountHookTypesDev(); return mountImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; warnInvalidHookAccess(); mountHookTypesDev(); return mountInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; warnInvalidHookAccess(); mountHookTypesDev(); return mountLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; warnInvalidHookAccess(); mountHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; warnInvalidHookAccess(); mountHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; warnInvalidHookAccess(); mountHookTypesDev(); return mountRef(initialValue); }, useState: function (initialState) { currentHookNameInDev = 'useState'; warnInvalidHookAccess(); mountHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV; try { return mountState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; warnInvalidHookAccess(); mountHookTypesDev(); return mountDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; warnInvalidHookAccess(); mountHookTypesDev(); return mountDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; warnInvalidHookAccess(); mountHookTypesDev(); return mountTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; warnInvalidHookAccess(); mountHookTypesDev(); return mountMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; warnInvalidHookAccess(); mountHookTypesDev(); return mountSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; warnInvalidHookAccess(); mountHookTypesDev(); return mountId(); }, unstable_isNewReconciler: enableNewReconciler }; InvalidNestedHooksDispatcherOnUpdateInDEV = { readContext: function (context) { warnInvalidContextAccess(); return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; warnInvalidHookAccess(); updateHookTypesDev(); return updateCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; warnInvalidHookAccess(); updateHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; warnInvalidHookAccess(); updateHookTypesDev(); return updateImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; warnInvalidHookAccess(); updateHookTypesDev(); return updateRef(); }, useState: function (initialState) { currentHookNameInDev = 'useState'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; warnInvalidHookAccess(); updateHookTypesDev(); return updateDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; warnInvalidHookAccess(); updateHookTypesDev(); return updateDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; warnInvalidHookAccess(); updateHookTypesDev(); return updateTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; warnInvalidHookAccess(); updateHookTypesDev(); return updateMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; warnInvalidHookAccess(); updateHookTypesDev(); return updateSyncExternalStore(subscribe, getSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; warnInvalidHookAccess(); updateHookTypesDev(); return updateId(); }, unstable_isNewReconciler: enableNewReconciler }; InvalidNestedHooksDispatcherOnRerenderInDEV = { readContext: function (context) { warnInvalidContextAccess(); return readContext(context); }, useCallback: function (callback, deps) { currentHookNameInDev = 'useCallback'; warnInvalidHookAccess(); updateHookTypesDev(); return updateCallback(callback, deps); }, useContext: function (context) { currentHookNameInDev = 'useContext'; warnInvalidHookAccess(); updateHookTypesDev(); return readContext(context); }, useEffect: function (create, deps) { currentHookNameInDev = 'useEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateEffect(create, deps); }, useImperativeHandle: function (ref, create, deps) { currentHookNameInDev = 'useImperativeHandle'; warnInvalidHookAccess(); updateHookTypesDev(); return updateImperativeHandle(ref, create, deps); }, useInsertionEffect: function (create, deps) { currentHookNameInDev = 'useInsertionEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateInsertionEffect(create, deps); }, useLayoutEffect: function (create, deps) { currentHookNameInDev = 'useLayoutEffect'; warnInvalidHookAccess(); updateHookTypesDev(); return updateLayoutEffect(create, deps); }, useMemo: function (create, deps) { currentHookNameInDev = 'useMemo'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return updateMemo(create, deps); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useReducer: function (reducer, initialArg, init) { currentHookNameInDev = 'useReducer'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return rerenderReducer(reducer, initialArg, init); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useRef: function (initialValue) { currentHookNameInDev = 'useRef'; warnInvalidHookAccess(); updateHookTypesDev(); return updateRef(); }, useState: function (initialState) { currentHookNameInDev = 'useState'; warnInvalidHookAccess(); updateHookTypesDev(); var prevDispatcher = ReactCurrentDispatcher$1.current; ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV; try { return rerenderState(initialState); } finally { ReactCurrentDispatcher$1.current = prevDispatcher; } }, useDebugValue: function (value, formatterFn) { currentHookNameInDev = 'useDebugValue'; warnInvalidHookAccess(); updateHookTypesDev(); return updateDebugValue(); }, useDeferredValue: function (value) { currentHookNameInDev = 'useDeferredValue'; warnInvalidHookAccess(); updateHookTypesDev(); return rerenderDeferredValue(value); }, useTransition: function () { currentHookNameInDev = 'useTransition'; warnInvalidHookAccess(); updateHookTypesDev(); return rerenderTransition(); }, useMutableSource: function (source, getSnapshot, subscribe) { currentHookNameInDev = 'useMutableSource'; warnInvalidHookAccess(); updateHookTypesDev(); return updateMutableSource(); }, useSyncExternalStore: function (subscribe, getSnapshot, getServerSnapshot) { currentHookNameInDev = 'useSyncExternalStore'; warnInvalidHookAccess(); updateHookTypesDev(); return updateSyncExternalStore(subscribe, getSnapshot); }, useId: function () { currentHookNameInDev = 'useId'; warnInvalidHookAccess(); updateHookTypesDev(); return updateId(); }, unstable_isNewReconciler: enableNewReconciler }; } var now$1 = unstable_now; var commitTime = 0; var layoutEffectStartTime = -1; var profilerStartTime = -1; var passiveEffectStartTime = -1; /** * Tracks whether the current update was a nested/cascading update (scheduled from a layout effect). * * The overall sequence is: * 1. render * 2. commit (and call `onRender`, `onCommit`) * 3. check for nested updates * 4. flush passive effects (and call `onPostCommit`) * * Nested updates are identified in step 3 above, * but step 4 still applies to the work that was just committed. * We use two flags to track nested updates then: * one tracks whether the upcoming update is a nested update, * and the other tracks whether the current update was a nested update. * The first value gets synced to the second at the start of the render phase. */ var currentUpdateIsNested = false; var nestedUpdateScheduled = false; function isCurrentUpdateNested() { return currentUpdateIsNested; } function markNestedUpdateScheduled() { { nestedUpdateScheduled = true; } } function resetNestedUpdateFlag() { { currentUpdateIsNested = false; nestedUpdateScheduled = false; } } function syncNestedUpdateFlag() { { currentUpdateIsNested = nestedUpdateScheduled; nestedUpdateScheduled = false; } } function getCommitTime() { return commitTime; } function recordCommitTime() { commitTime = now$1(); } function startProfilerTimer(fiber) { profilerStartTime = now$1(); if (fiber.actualStartTime < 0) { fiber.actualStartTime = now$1(); } } function stopProfilerTimerIfRunning(fiber) { profilerStartTime = -1; } function stopProfilerTimerIfRunningAndRecordDelta(fiber, overrideBaseTime) { if (profilerStartTime >= 0) { var elapsedTime = now$1() - profilerStartTime; fiber.actualDuration += elapsedTime; if (overrideBaseTime) { fiber.selfBaseDuration = elapsedTime; } profilerStartTime = -1; } } function recordLayoutEffectDuration(fiber) { if (layoutEffectStartTime >= 0) { var elapsedTime = now$1() - layoutEffectStartTime; layoutEffectStartTime = -1; // Store duration on the next nearest Profiler ancestor // Or the root (for the DevTools Profiler to read) var parentFiber = fiber.return; while (parentFiber !== null) { switch (parentFiber.tag) { case HostRoot: var root = parentFiber.stateNode; root.effectDuration += elapsedTime; return; case Profiler: var parentStateNode = parentFiber.stateNode; parentStateNode.effectDuration += elapsedTime; return; } parentFiber = parentFiber.return; } } } function recordPassiveEffectDuration(fiber) { if (passiveEffectStartTime >= 0) { var elapsedTime = now$1() - passiveEffectStartTime; passiveEffectStartTime = -1; // Store duration on the next nearest Profiler ancestor // Or the root (for the DevTools Profiler to read) var parentFiber = fiber.return; while (parentFiber !== null) { switch (parentFiber.tag) { case HostRoot: var root = parentFiber.stateNode; if (root !== null) { root.passiveEffectDuration += elapsedTime; } return; case Profiler: var parentStateNode = parentFiber.stateNode; if (parentStateNode !== null) { // Detached fibers have their state node cleared out. // In this case, the return pointer is also cleared out, // so we won't be able to report the time spent in this Profiler's subtree. parentStateNode.passiveEffectDuration += elapsedTime; } return; } parentFiber = parentFiber.return; } } } function startLayoutEffectTimer() { layoutEffectStartTime = now$1(); } function startPassiveEffectTimer() { passiveEffectStartTime = now$1(); } function transferActualDuration(fiber) { // Transfer time spent rendering these children so we don't lose it // after we rerender. This is used as a helper in special cases // where we should count the work of multiple passes. var child = fiber.child; while (child) { fiber.actualDuration += child.actualDuration; child = child.sibling; } } function resolveDefaultProps(Component, baseProps) { if (Component && Component.defaultProps) { // Resolve default props. Taken from ReactElement var props = assign({}, baseProps); var defaultProps = Component.defaultProps; for (var propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } return props; } return baseProps; } var fakeInternalInstance = {}; var didWarnAboutStateAssignmentForComponent; var didWarnAboutUninitializedState; var didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate; var didWarnAboutLegacyLifecyclesAndDerivedState; var didWarnAboutUndefinedDerivedState; var warnOnUndefinedDerivedState; var warnOnInvalidCallback; var didWarnAboutDirectlyAssigningPropsToState; var didWarnAboutContextTypeAndContextTypes; var didWarnAboutInvalidateContextType; var didWarnAboutLegacyContext$1; { didWarnAboutStateAssignmentForComponent = new Set(); didWarnAboutUninitializedState = new Set(); didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate = new Set(); didWarnAboutLegacyLifecyclesAndDerivedState = new Set(); didWarnAboutDirectlyAssigningPropsToState = new Set(); didWarnAboutUndefinedDerivedState = new Set(); didWarnAboutContextTypeAndContextTypes = new Set(); didWarnAboutInvalidateContextType = new Set(); didWarnAboutLegacyContext$1 = new Set(); var didWarnOnInvalidCallback = new Set(); warnOnInvalidCallback = function (callback, callerName) { if (callback === null || typeof callback === 'function') { return; } var key = callerName + '_' + callback; if (!didWarnOnInvalidCallback.has(key)) { didWarnOnInvalidCallback.add(key); error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); } }; warnOnUndefinedDerivedState = function (type, partialState) { if (partialState === undefined) { var componentName = getComponentNameFromType(type) || 'Component'; if (!didWarnAboutUndefinedDerivedState.has(componentName)) { didWarnAboutUndefinedDerivedState.add(componentName); error('%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. ' + 'You have returned undefined.', componentName); } } }; // This is so gross but it's at least non-critical and can be removed if // it causes problems. This is meant to give a nicer error message for // ReactDOM15.unstable_renderSubtreeIntoContainer(reactDOM16Component, // ...)) which otherwise throws a "_processChildContext is not a function" // exception. Object.defineProperty(fakeInternalInstance, '_processChildContext', { enumerable: false, value: function () { throw new Error('_processChildContext is not available in React 16+. This likely ' + 'means you have multiple copies of React and are attempting to nest ' + 'a React 15 tree inside a React 16 tree using ' + "unstable_renderSubtreeIntoContainer, which isn't supported. Try " + 'to make sure you have only one copy of React (and ideally, switch ' + 'to ReactDOM.createPortal).'); } }); Object.freeze(fakeInternalInstance); } function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { var prevState = workInProgress.memoizedState; var partialState = getDerivedStateFromProps(nextProps, prevState); { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { // Invoke the function an extra time to help detect side-effects. partialState = getDerivedStateFromProps(nextProps, prevState); } finally { setIsStrictModeForDevtools(false); } } warnOnUndefinedDerivedState(ctor, partialState); } // Merge the partial state and the previous state. var memoizedState = partialState === null || partialState === undefined ? prevState : assign({}, prevState, partialState); workInProgress.memoizedState = memoizedState; // Once the update queue is empty, persist the derived state onto the // base state. if (workInProgress.lanes === NoLanes) { // Queue is always non-null for classes var updateQueue = workInProgress.updateQueue; updateQueue.baseState = memoizedState; } } var classComponentUpdater = { isMounted: isMounted, enqueueSetState: function (inst, payload, callback) { var fiber = get(inst); var eventTime = requestEventTime(); var lane = requestUpdateLane(fiber); var update = createUpdate(eventTime, lane); update.payload = payload; if (callback !== undefined && callback !== null) { { warnOnInvalidCallback(callback, 'setState'); } update.callback = callback; } var root = enqueueUpdate(fiber, update, lane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, lane, eventTime); entangleTransitions(root, fiber, lane); } { markStateUpdateScheduled(fiber, lane); } }, enqueueReplaceState: function (inst, payload, callback) { var fiber = get(inst); var eventTime = requestEventTime(); var lane = requestUpdateLane(fiber); var update = createUpdate(eventTime, lane); update.tag = ReplaceState; update.payload = payload; if (callback !== undefined && callback !== null) { { warnOnInvalidCallback(callback, 'replaceState'); } update.callback = callback; } var root = enqueueUpdate(fiber, update, lane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, lane, eventTime); entangleTransitions(root, fiber, lane); } { markStateUpdateScheduled(fiber, lane); } }, enqueueForceUpdate: function (inst, callback) { var fiber = get(inst); var eventTime = requestEventTime(); var lane = requestUpdateLane(fiber); var update = createUpdate(eventTime, lane); update.tag = ForceUpdate; if (callback !== undefined && callback !== null) { { warnOnInvalidCallback(callback, 'forceUpdate'); } update.callback = callback; } var root = enqueueUpdate(fiber, update, lane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, lane, eventTime); entangleTransitions(root, fiber, lane); } { markForceUpdateScheduled(fiber, lane); } } }; function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { var instance = workInProgress.stateNode; if (typeof instance.shouldComponentUpdate === 'function') { var shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { // Invoke the function an extra time to help detect side-effects. shouldUpdate = instance.shouldComponentUpdate(newProps, newState, nextContext); } finally { setIsStrictModeForDevtools(false); } } if (shouldUpdate === undefined) { error('%s.shouldComponentUpdate(): Returned undefined instead of a ' + 'boolean value. Make sure to return true or false.', getComponentNameFromType(ctor) || 'Component'); } } return shouldUpdate; } if (ctor.prototype && ctor.prototype.isPureReactComponent) { return !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState); } return true; } function checkClassInstance(workInProgress, ctor, newProps) { var instance = workInProgress.stateNode; { var name = getComponentNameFromType(ctor) || 'Component'; var renderPresent = instance.render; if (!renderPresent) { if (ctor.prototype && typeof ctor.prototype.render === 'function') { error('%s(...): No `render` method found on the returned component ' + 'instance: did you accidentally return an object from the constructor?', name); } else { error('%s(...): No `render` method found on the returned component ' + 'instance: you may have forgotten to define `render`.', name); } } if (instance.getInitialState && !instance.getInitialState.isReactClassApproved && !instance.state) { error('getInitialState was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Did you mean to define a state property instead?', name); } if (instance.getDefaultProps && !instance.getDefaultProps.isReactClassApproved) { error('getDefaultProps was defined on %s, a plain JavaScript class. ' + 'This is only supported for classes created using React.createClass. ' + 'Use a static property to define defaultProps instead.', name); } if (instance.propTypes) { error('propTypes was defined as an instance property on %s. Use a static ' + 'property to define propTypes instead.', name); } if (instance.contextType) { error('contextType was defined as an instance property on %s. Use a static ' + 'property to define contextType instead.', name); } { if (ctor.childContextTypes && !didWarnAboutLegacyContext$1.has(ctor) && // Strict Mode has its own warning for legacy context, so we can skip // this one. (workInProgress.mode & StrictLegacyMode) === NoMode) { didWarnAboutLegacyContext$1.add(ctor); error('%s uses the legacy childContextTypes API which is no longer ' + 'supported and will be removed in the next major release. Use ' + 'React.createContext() instead\n\n.' + 'Learn more about this warning here: https://reactjs.org/link/legacy-context', name); } if (ctor.contextTypes && !didWarnAboutLegacyContext$1.has(ctor) && // Strict Mode has its own warning for legacy context, so we can skip // this one. (workInProgress.mode & StrictLegacyMode) === NoMode) { didWarnAboutLegacyContext$1.add(ctor); error('%s uses the legacy contextTypes API which is no longer supported ' + 'and will be removed in the next major release. Use ' + 'React.createContext() with static contextType instead.\n\n' + 'Learn more about this warning here: https://reactjs.org/link/legacy-context', name); } if (instance.contextTypes) { error('contextTypes was defined as an instance property on %s. Use a static ' + 'property to define contextTypes instead.', name); } if (ctor.contextType && ctor.contextTypes && !didWarnAboutContextTypeAndContextTypes.has(ctor)) { didWarnAboutContextTypeAndContextTypes.add(ctor); error('%s declares both contextTypes and contextType static properties. ' + 'The legacy contextTypes property will be ignored.', name); } } if (typeof instance.componentShouldUpdate === 'function') { error('%s has a method called ' + 'componentShouldUpdate(). Did you mean shouldComponentUpdate()? ' + 'The name is phrased as a question because the function is ' + 'expected to return a value.', name); } if (ctor.prototype && ctor.prototype.isPureReactComponent && typeof instance.shouldComponentUpdate !== 'undefined') { error('%s has a method called shouldComponentUpdate(). ' + 'shouldComponentUpdate should not be used when extending React.PureComponent. ' + 'Please extend React.Component if shouldComponentUpdate is used.', getComponentNameFromType(ctor) || 'A pure component'); } if (typeof instance.componentDidUnmount === 'function') { error('%s has a method called ' + 'componentDidUnmount(). But there is no such lifecycle method. ' + 'Did you mean componentWillUnmount()?', name); } if (typeof instance.componentDidReceiveProps === 'function') { error('%s has a method called ' + 'componentDidReceiveProps(). But there is no such lifecycle method. ' + 'If you meant to update the state in response to changing props, ' + 'use componentWillReceiveProps(). If you meant to fetch data or ' + 'run side-effects or mutations after React has updated the UI, use componentDidUpdate().', name); } if (typeof instance.componentWillRecieveProps === 'function') { error('%s has a method called ' + 'componentWillRecieveProps(). Did you mean componentWillReceiveProps()?', name); } if (typeof instance.UNSAFE_componentWillRecieveProps === 'function') { error('%s has a method called ' + 'UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?', name); } var hasMutatedProps = instance.props !== newProps; if (instance.props !== undefined && hasMutatedProps) { error('%s(...): When calling super() in `%s`, make sure to pass ' + "up the same props that your component's constructor was passed.", name, name); } if (instance.defaultProps) { error('Setting defaultProps as an instance property on %s is not supported and will be ignored.' + ' Instead, define defaultProps as a static property on %s.', name, name); } if (typeof instance.getSnapshotBeforeUpdate === 'function' && typeof instance.componentDidUpdate !== 'function' && !didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.has(ctor)) { didWarnAboutGetSnapshotBeforeUpdateWithoutDidUpdate.add(ctor); error('%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' + 'This component defines getSnapshotBeforeUpdate() only.', getComponentNameFromType(ctor)); } if (typeof instance.getDerivedStateFromProps === 'function') { error('%s: getDerivedStateFromProps() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name); } if (typeof instance.getDerivedStateFromError === 'function') { error('%s: getDerivedStateFromError() is defined as an instance method ' + 'and will be ignored. Instead, declare it as a static method.', name); } if (typeof ctor.getSnapshotBeforeUpdate === 'function') { error('%s: getSnapshotBeforeUpdate() is defined as a static method ' + 'and will be ignored. Instead, declare it as an instance method.', name); } var _state = instance.state; if (_state && (typeof _state !== 'object' || isArray(_state))) { error('%s.state: must be set to an object or null', name); } if (typeof instance.getChildContext === 'function' && typeof ctor.childContextTypes !== 'object') { error('%s.getChildContext(): childContextTypes must be defined in order to ' + 'use getChildContext().', name); } } } function adoptClassInstance(workInProgress, instance) { instance.updater = classComponentUpdater; workInProgress.stateNode = instance; // The instance needs access to the fiber so that it can schedule updates set(instance, workInProgress); { instance._reactInternalInstance = fakeInternalInstance; } } function constructClassInstance(workInProgress, ctor, props) { var isLegacyContextConsumer = false; var unmaskedContext = emptyContextObject; var context = emptyContextObject; var contextType = ctor.contextType; { if ('contextType' in ctor) { var isValid = // Allow null for conditional declaration contextType === null || contextType !== undefined && contextType.$$typeof === REACT_CONTEXT_TYPE && contextType._context === undefined; // Not a <Context.Consumer> if (!isValid && !didWarnAboutInvalidateContextType.has(ctor)) { didWarnAboutInvalidateContextType.add(ctor); var addendum = ''; if (contextType === undefined) { addendum = ' However, it is set to undefined. ' + 'This can be caused by a typo or by mixing up named and default imports. ' + 'This can also happen due to a circular dependency, so ' + 'try moving the createContext() call to a separate file.'; } else if (typeof contextType !== 'object') { addendum = ' However, it is set to a ' + typeof contextType + '.'; } else if (contextType.$$typeof === REACT_PROVIDER_TYPE) { addendum = ' Did you accidentally pass the Context.Provider instead?'; } else if (contextType._context !== undefined) { // <Context.Consumer> addendum = ' Did you accidentally pass the Context.Consumer instead?'; } else { addendum = ' However, it is set to an object with keys {' + Object.keys(contextType).join(', ') + '}.'; } error('%s defines an invalid contextType. ' + 'contextType should point to the Context object returned by React.createContext().%s', getComponentNameFromType(ctor) || 'Component', addendum); } } } if (typeof contextType === 'object' && contextType !== null) { context = readContext(contextType); } else { unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); var contextTypes = ctor.contextTypes; isLegacyContextConsumer = contextTypes !== null && contextTypes !== undefined; context = isLegacyContextConsumer ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject; } var instance = new ctor(props, context); // Instantiate twice to help detect side-effects. { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { instance = new ctor(props, context); // eslint-disable-line no-new } finally { setIsStrictModeForDevtools(false); } } } var state = workInProgress.memoizedState = instance.state !== null && instance.state !== undefined ? instance.state : null; adoptClassInstance(workInProgress, instance); { if (typeof ctor.getDerivedStateFromProps === 'function' && state === null) { var componentName = getComponentNameFromType(ctor) || 'Component'; if (!didWarnAboutUninitializedState.has(componentName)) { didWarnAboutUninitializedState.add(componentName); error('`%s` uses `getDerivedStateFromProps` but its initial state is ' + '%s. This is not recommended. Instead, define the initial state by ' + 'assigning an object to `this.state` in the constructor of `%s`. ' + 'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.', componentName, instance.state === null ? 'null' : 'undefined', componentName); } } // If new component APIs are defined, "unsafe" lifecycles won't be called. // Warn about these lifecycles if they are present. // Don't warn about react-lifecycles-compat polyfilled methods though. if (typeof ctor.getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function') { var foundWillMountName = null; var foundWillReceivePropsName = null; var foundWillUpdateName = null; if (typeof instance.componentWillMount === 'function' && instance.componentWillMount.__suppressDeprecationWarning !== true) { foundWillMountName = 'componentWillMount'; } else if (typeof instance.UNSAFE_componentWillMount === 'function') { foundWillMountName = 'UNSAFE_componentWillMount'; } if (typeof instance.componentWillReceiveProps === 'function' && instance.componentWillReceiveProps.__suppressDeprecationWarning !== true) { foundWillReceivePropsName = 'componentWillReceiveProps'; } else if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps'; } if (typeof instance.componentWillUpdate === 'function' && instance.componentWillUpdate.__suppressDeprecationWarning !== true) { foundWillUpdateName = 'componentWillUpdate'; } else if (typeof instance.UNSAFE_componentWillUpdate === 'function') { foundWillUpdateName = 'UNSAFE_componentWillUpdate'; } if (foundWillMountName !== null || foundWillReceivePropsName !== null || foundWillUpdateName !== null) { var _componentName = getComponentNameFromType(ctor) || 'Component'; var newApiName = typeof ctor.getDerivedStateFromProps === 'function' ? 'getDerivedStateFromProps()' : 'getSnapshotBeforeUpdate()'; if (!didWarnAboutLegacyLifecyclesAndDerivedState.has(_componentName)) { didWarnAboutLegacyLifecyclesAndDerivedState.add(_componentName); error('Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' + '%s uses %s but also contains the following legacy lifecycles:%s%s%s\n\n' + 'The above lifecycles should be removed. Learn more about this warning here:\n' + 'https://reactjs.org/link/unsafe-component-lifecycles', _componentName, newApiName, foundWillMountName !== null ? "\n " + foundWillMountName : '', foundWillReceivePropsName !== null ? "\n " + foundWillReceivePropsName : '', foundWillUpdateName !== null ? "\n " + foundWillUpdateName : ''); } } } } // Cache unmasked context so we can avoid recreating masked context unless necessary. // ReactFiberContext usually updates this cache but can't for newly-created instances. if (isLegacyContextConsumer) { cacheContext(workInProgress, unmaskedContext, context); } return instance; } function callComponentWillMount(workInProgress, instance) { var oldState = instance.state; if (typeof instance.componentWillMount === 'function') { instance.componentWillMount(); } if (typeof instance.UNSAFE_componentWillMount === 'function') { instance.UNSAFE_componentWillMount(); } if (oldState !== instance.state) { { error('%s.componentWillMount(): Assigning directly to this.state is ' + "deprecated (except inside a component's " + 'constructor). Use setState instead.', getComponentNameFromFiber(workInProgress) || 'Component'); } classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } } function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { var oldState = instance.state; if (typeof instance.componentWillReceiveProps === 'function') { instance.componentWillReceiveProps(newProps, nextContext); } if (typeof instance.UNSAFE_componentWillReceiveProps === 'function') { instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); } if (instance.state !== oldState) { { var componentName = getComponentNameFromFiber(workInProgress) || 'Component'; if (!didWarnAboutStateAssignmentForComponent.has(componentName)) { didWarnAboutStateAssignmentForComponent.add(componentName); error('%s.componentWillReceiveProps(): Assigning directly to ' + "this.state is deprecated (except inside a component's " + 'constructor). Use setState instead.', componentName); } } classComponentUpdater.enqueueReplaceState(instance, instance.state, null); } } // Invokes the mount life-cycles on a previously never rendered instance. function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { { checkClassInstance(workInProgress, ctor, newProps); } var instance = workInProgress.stateNode; instance.props = newProps; instance.state = workInProgress.memoizedState; instance.refs = {}; initializeUpdateQueue(workInProgress); var contextType = ctor.contextType; if (typeof contextType === 'object' && contextType !== null) { instance.context = readContext(contextType); } else { var unmaskedContext = getUnmaskedContext(workInProgress, ctor, true); instance.context = getMaskedContext(workInProgress, unmaskedContext); } { if (instance.state === newProps) { var componentName = getComponentNameFromType(ctor) || 'Component'; if (!didWarnAboutDirectlyAssigningPropsToState.has(componentName)) { didWarnAboutDirectlyAssigningPropsToState.add(componentName); error('%s: It is not recommended to assign props directly to state ' + "because updates to props won't be reflected in state. " + 'In most cases, it is better to use props directly.', componentName); } } if (workInProgress.mode & StrictLegacyMode) { ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, instance); } { ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(workInProgress, instance); } } instance.state = workInProgress.memoizedState; var getDerivedStateFromProps = ctor.getDerivedStateFromProps; if (typeof getDerivedStateFromProps === 'function') { applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); instance.state = workInProgress.memoizedState; } // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if (typeof ctor.getDerivedStateFromProps !== 'function' && typeof instance.getSnapshotBeforeUpdate !== 'function' && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { callComponentWillMount(workInProgress, instance); // If we had additional state updates during this life-cycle, let's // process them now. processUpdateQueue(workInProgress, newProps, instance, renderLanes); instance.state = workInProgress.memoizedState; } if (typeof instance.componentDidMount === 'function') { var fiberFlags = Update; { fiberFlags |= LayoutStatic; } if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; } } function resumeMountClassInstance(workInProgress, ctor, newProps, renderLanes) { var instance = workInProgress.stateNode; var oldProps = workInProgress.memoizedProps; instance.props = oldProps; var oldContext = instance.context; var contextType = ctor.contextType; var nextContext = emptyContextObject; if (typeof contextType === 'object' && contextType !== null) { nextContext = readContext(contextType); } else { var nextLegacyUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); nextContext = getMaskedContext(workInProgress, nextLegacyUnmaskedContext); } var getDerivedStateFromProps = ctor.getDerivedStateFromProps; var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what // ever the previously attempted to render - not the "current". However, // during componentDidUpdate we pass the "current" props. // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { if (oldProps !== newProps || oldContext !== nextContext) { callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); } } resetHasForceUpdateBeforeProcessing(); var oldState = workInProgress.memoizedState; var newState = instance.state = oldState; processUpdateQueue(workInProgress, newProps, instance, renderLanes); newState = workInProgress.memoizedState; if (oldProps === newProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()) { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { var fiberFlags = Update; { fiberFlags |= LayoutStatic; } if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; } return false; } if (typeof getDerivedStateFromProps === 'function') { applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); newState = workInProgress.memoizedState; } var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext); if (shouldUpdate) { // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillMount === 'function' || typeof instance.componentWillMount === 'function')) { if (typeof instance.componentWillMount === 'function') { instance.componentWillMount(); } if (typeof instance.UNSAFE_componentWillMount === 'function') { instance.UNSAFE_componentWillMount(); } } if (typeof instance.componentDidMount === 'function') { var _fiberFlags = Update; { _fiberFlags |= LayoutStatic; } if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) { _fiberFlags |= MountLayoutDev; } workInProgress.flags |= _fiberFlags; } } else { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { var _fiberFlags2 = Update; { _fiberFlags2 |= LayoutStatic; } if ( (workInProgress.mode & StrictEffectsMode) !== NoMode) { _fiberFlags2 |= MountLayoutDev; } workInProgress.flags |= _fiberFlags2; } // If shouldComponentUpdate returned false, we should still update the // memoized state to indicate that this work can be reused. workInProgress.memoizedProps = newProps; workInProgress.memoizedState = newState; } // Update the existing instance's state, props, and context pointers even // if shouldComponentUpdate returns false. instance.props = newProps; instance.state = newState; instance.context = nextContext; return shouldUpdate; } // Invokes the update life-cycles and returns false if it shouldn't rerender. function updateClassInstance(current, workInProgress, ctor, newProps, renderLanes) { var instance = workInProgress.stateNode; cloneUpdateQueue(current, workInProgress); var unresolvedOldProps = workInProgress.memoizedProps; var oldProps = workInProgress.type === workInProgress.elementType ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps); instance.props = oldProps; var unresolvedNewProps = workInProgress.pendingProps; var oldContext = instance.context; var contextType = ctor.contextType; var nextContext = emptyContextObject; if (typeof contextType === 'object' && contextType !== null) { nextContext = readContext(contextType); } else { var nextUnmaskedContext = getUnmaskedContext(workInProgress, ctor, true); nextContext = getMaskedContext(workInProgress, nextUnmaskedContext); } var getDerivedStateFromProps = ctor.getDerivedStateFromProps; var hasNewLifecycles = typeof getDerivedStateFromProps === 'function' || typeof instance.getSnapshotBeforeUpdate === 'function'; // Note: During these life-cycles, instance.props/instance.state are what // ever the previously attempted to render - not the "current". However, // during componentDidUpdate we pass the "current" props. // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function')) { if (unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext) { callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext); } } resetHasForceUpdateBeforeProcessing(); var oldState = workInProgress.memoizedState; var newState = instance.state = oldState; processUpdateQueue(workInProgress, newProps, instance, renderLanes); newState = workInProgress.memoizedState; if (unresolvedOldProps === unresolvedNewProps && oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing() && !(enableLazyContextPropagation )) { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidUpdate === 'function') { if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { workInProgress.flags |= Update; } } if (typeof instance.getSnapshotBeforeUpdate === 'function') { if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { workInProgress.flags |= Snapshot; } } return false; } if (typeof getDerivedStateFromProps === 'function') { applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, newProps); newState = workInProgress.memoizedState; } var shouldUpdate = checkHasForceUpdateAfterProcessing() || checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) || // TODO: In some cases, we'll end up checking if context has changed twice, // both before and after `shouldComponentUpdate` has been called. Not ideal, // but I'm loath to refactor this function. This only happens for memoized // components so it's not that common. enableLazyContextPropagation ; if (shouldUpdate) { // In order to support react-lifecycles-compat polyfilled components, // Unsafe lifecycles should not be invoked for components using the new APIs. if (!hasNewLifecycles && (typeof instance.UNSAFE_componentWillUpdate === 'function' || typeof instance.componentWillUpdate === 'function')) { if (typeof instance.componentWillUpdate === 'function') { instance.componentWillUpdate(newProps, newState, nextContext); } if (typeof instance.UNSAFE_componentWillUpdate === 'function') { instance.UNSAFE_componentWillUpdate(newProps, newState, nextContext); } } if (typeof instance.componentDidUpdate === 'function') { workInProgress.flags |= Update; } if (typeof instance.getSnapshotBeforeUpdate === 'function') { workInProgress.flags |= Snapshot; } } else { // If an update was already in progress, we should schedule an Update // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidUpdate === 'function') { if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { workInProgress.flags |= Update; } } if (typeof instance.getSnapshotBeforeUpdate === 'function') { if (unresolvedOldProps !== current.memoizedProps || oldState !== current.memoizedState) { workInProgress.flags |= Snapshot; } } // If shouldComponentUpdate returned false, we should still update the // memoized props/state to indicate that this work can be reused. workInProgress.memoizedProps = newProps; workInProgress.memoizedState = newState; } // Update the existing instance's state, props, and context pointers even // if shouldComponentUpdate returns false. instance.props = newProps; instance.state = newState; instance.context = nextContext; return shouldUpdate; } function createCapturedValueAtFiber(value, source) { // If the value is an error, call this function immediately after it is thrown // so the stack is accurate. return { value: value, source: source, stack: getStackByFiberInDevAndProd(source), digest: null }; } function createCapturedValue(value, digest, stack) { return { value: value, source: null, stack: stack != null ? stack : null, digest: digest != null ? digest : null }; } // This module is forked in different environments. // By default, return `true` to log errors to the console. // Forks can return `false` if this isn't desirable. function showErrorDialog(boundary, errorInfo) { return true; } function logCapturedError(boundary, errorInfo) { try { var logError = showErrorDialog(boundary, errorInfo); // Allow injected showErrorDialog() to prevent default console.error logging. // This enables renderers like ReactNative to better manage redbox behavior. if (logError === false) { return; } var error = errorInfo.value; if (true) { var source = errorInfo.source; var stack = errorInfo.stack; var componentStack = stack !== null ? stack : ''; // Browsers support silencing uncaught errors by calling // `preventDefault()` in window `error` handler. // We record this information as an expando on the error. if (error != null && error._suppressLogging) { if (boundary.tag === ClassComponent) { // The error is recoverable and was silenced. // Ignore it and don't print the stack addendum. // This is handy for testing error boundaries without noise. return; } // The error is fatal. Since the silencing might have // been accidental, we'll surface it anyway. // However, the browser would have silenced the original error // so we'll print it first, and then print the stack addendum. console['error'](error); // Don't transform to our wrapper // For a more detailed description of this block, see: // https://github.com/facebook/react/pull/13384 } var componentName = source ? getComponentNameFromFiber(source) : null; var componentNameMessage = componentName ? "The above error occurred in the <" + componentName + "> component:" : 'The above error occurred in one of your React components:'; var errorBoundaryMessage; if (boundary.tag === HostRoot) { errorBoundaryMessage = 'Consider adding an error boundary to your tree to customize error handling behavior.\n' + 'Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.'; } else { var errorBoundaryName = getComponentNameFromFiber(boundary) || 'Anonymous'; errorBoundaryMessage = "React will try to recreate this component tree from scratch " + ("using the error boundary you provided, " + errorBoundaryName + "."); } var combinedMessage = componentNameMessage + "\n" + componentStack + "\n\n" + ("" + errorBoundaryMessage); // In development, we provide our own message with just the component stack. // We don't include the original error message and JS stack because the browser // has already printed it. Even if the application swallows the error, it is still // displayed by the browser thanks to the DEV-only fake event trick in ReactErrorUtils. console['error'](combinedMessage); // Don't transform to our wrapper } else { // In production, we print the error directly. // This will include the message, the JS stack, and anything the browser wants to show. // We pass the error object instead of custom message so that the browser displays the error natively. console['error'](error); // Don't transform to our wrapper } } catch (e) { // This method must not throw, or React internal state will get messed up. // If console.error is overridden, or logCapturedError() shows a dialog that throws, // we want to report this error outside of the normal stack as a last resort. // https://github.com/facebook/react/issues/13188 setTimeout(function () { throw e; }); } } var PossiblyWeakMap$1 = typeof WeakMap === 'function' ? WeakMap : Map; function createRootErrorUpdate(fiber, errorInfo, lane) { var update = createUpdate(NoTimestamp, lane); // Unmount the root by rendering null. update.tag = CaptureUpdate; // Caution: React DevTools currently depends on this property // being called "element". update.payload = { element: null }; var error = errorInfo.value; update.callback = function () { onUncaughtError(error); logCapturedError(fiber, errorInfo); }; return update; } function createClassErrorUpdate(fiber, errorInfo, lane) { var update = createUpdate(NoTimestamp, lane); update.tag = CaptureUpdate; var getDerivedStateFromError = fiber.type.getDerivedStateFromError; if (typeof getDerivedStateFromError === 'function') { var error$1 = errorInfo.value; update.payload = function () { return getDerivedStateFromError(error$1); }; update.callback = function () { { markFailedErrorBoundaryForHotReloading(fiber); } logCapturedError(fiber, errorInfo); }; } var inst = fiber.stateNode; if (inst !== null && typeof inst.componentDidCatch === 'function') { update.callback = function callback() { { markFailedErrorBoundaryForHotReloading(fiber); } logCapturedError(fiber, errorInfo); if (typeof getDerivedStateFromError !== 'function') { // To preserve the preexisting retry behavior of error boundaries, // we keep track of which ones already failed during this batch. // This gets reset before we yield back to the browser. // TODO: Warn in strict mode if getDerivedStateFromError is // not defined. markLegacyErrorBoundaryAsFailed(this); } var error$1 = errorInfo.value; var stack = errorInfo.stack; this.componentDidCatch(error$1, { componentStack: stack !== null ? stack : '' }); { if (typeof getDerivedStateFromError !== 'function') { // If componentDidCatch is the only error boundary method defined, // then it needs to call setState to recover from errors. // If no state update is scheduled then the boundary will swallow the error. if (!includesSomeLane(fiber.lanes, SyncLane)) { error('%s: Error boundaries should implement getDerivedStateFromError(). ' + 'In that method, return a state update to display an error message or fallback UI.', getComponentNameFromFiber(fiber) || 'Unknown'); } } } }; } return update; } function attachPingListener(root, wakeable, lanes) { // Attach a ping listener // // The data might resolve before we have a chance to commit the fallback. Or, // in the case of a refresh, we'll never commit a fallback. So we need to // attach a listener now. When it resolves ("pings"), we can decide whether to // try rendering the tree again. // // Only attach a listener if one does not already exist for the lanes // we're currently rendering (which acts like a "thread ID" here). // // We only need to do this in concurrent mode. Legacy Suspense always // commits fallbacks synchronously, so there are no pings. var pingCache = root.pingCache; var threadIDs; if (pingCache === null) { pingCache = root.pingCache = new PossiblyWeakMap$1(); threadIDs = new Set(); pingCache.set(wakeable, threadIDs); } else { threadIDs = pingCache.get(wakeable); if (threadIDs === undefined) { threadIDs = new Set(); pingCache.set(wakeable, threadIDs); } } if (!threadIDs.has(lanes)) { // Memoize using the thread ID to prevent redundant listeners. threadIDs.add(lanes); var ping = pingSuspendedRoot.bind(null, root, wakeable, lanes); { if (isDevToolsPresent) { // If we have pending work still, restore the original updaters restorePendingUpdaters(root, lanes); } } wakeable.then(ping, ping); } } function attachRetryListener(suspenseBoundary, root, wakeable, lanes) { // Retry listener // // If the fallback does commit, we need to attach a different type of // listener. This one schedules an update on the Suspense boundary to turn // the fallback state off. // // Stash the wakeable on the boundary fiber so we can access it in the // commit phase. // // When the wakeable resolves, we'll attempt to render the boundary // again ("retry"). var wakeables = suspenseBoundary.updateQueue; if (wakeables === null) { var updateQueue = new Set(); updateQueue.add(wakeable); suspenseBoundary.updateQueue = updateQueue; } else { wakeables.add(wakeable); } } function resetSuspendedComponent(sourceFiber, rootRenderLanes) { // A legacy mode Suspense quirk, only relevant to hook components. var tag = sourceFiber.tag; if ((sourceFiber.mode & ConcurrentMode) === NoMode && (tag === FunctionComponent || tag === ForwardRef || tag === SimpleMemoComponent)) { var currentSource = sourceFiber.alternate; if (currentSource) { sourceFiber.updateQueue = currentSource.updateQueue; sourceFiber.memoizedState = currentSource.memoizedState; sourceFiber.lanes = currentSource.lanes; } else { sourceFiber.updateQueue = null; sourceFiber.memoizedState = null; } } } function getNearestSuspenseBoundaryToCapture(returnFiber) { var node = returnFiber; do { if (node.tag === SuspenseComponent && shouldCaptureSuspense(node)) { return node; } // This boundary already captured during this render. Continue to the next // boundary. node = node.return; } while (node !== null); return null; } function markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes) { // This marks a Suspense boundary so that when we're unwinding the stack, // it captures the suspended "exception" and does a second (fallback) pass. if ((suspenseBoundary.mode & ConcurrentMode) === NoMode) { // Legacy Mode Suspense // // If the boundary is in legacy mode, we should *not* // suspend the commit. Pretend as if the suspended component rendered // null and keep rendering. When the Suspense boundary completes, // we'll do a second pass to render the fallback. if (suspenseBoundary === returnFiber) { // Special case where we suspended while reconciling the children of // a Suspense boundary's inner Offscreen wrapper fiber. This happens // when a React.lazy component is a direct child of a // Suspense boundary. // // Suspense boundaries are implemented as multiple fibers, but they // are a single conceptual unit. The legacy mode behavior where we // pretend the suspended fiber committed as `null` won't work, // because in this case the "suspended" fiber is the inner // Offscreen wrapper. // // Because the contents of the boundary haven't started rendering // yet (i.e. nothing in the tree has partially rendered) we can // switch to the regular, concurrent mode behavior: mark the // boundary with ShouldCapture and enter the unwind phase. suspenseBoundary.flags |= ShouldCapture; } else { suspenseBoundary.flags |= DidCapture; sourceFiber.flags |= ForceUpdateForLegacySuspense; // We're going to commit this fiber even though it didn't complete. // But we shouldn't call any lifecycle methods or callbacks. Remove // all lifecycle effect tags. sourceFiber.flags &= ~(LifecycleEffectMask | Incomplete); if (sourceFiber.tag === ClassComponent) { var currentSourceFiber = sourceFiber.alternate; if (currentSourceFiber === null) { // This is a new mount. Change the tag so it's not mistaken for a // completed class component. For example, we should not call // componentWillUnmount if it is deleted. sourceFiber.tag = IncompleteClassComponent; } else { // When we try rendering again, we should not reuse the current fiber, // since it's known to be in an inconsistent state. Use a force update to // prevent a bail out. var update = createUpdate(NoTimestamp, SyncLane); update.tag = ForceUpdate; enqueueUpdate(sourceFiber, update, SyncLane); } } // The source fiber did not complete. Mark it with Sync priority to // indicate that it still has pending work. sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane); } return suspenseBoundary; } // Confirmed that the boundary is in a concurrent mode tree. Continue // with the normal suspend path. // // After this we'll use a set of heuristics to determine whether this // render pass will run to completion or restart or "suspend" the commit. // The actual logic for this is spread out in different places. // // This first principle is that if we're going to suspend when we complete // a root, then we should also restart if we get an update or ping that // might unsuspend it, and vice versa. The only reason to suspend is // because you think you might want to restart before committing. However, // it doesn't make sense to restart only while in the period we're suspended. // // Restarting too aggressively is also not good because it starves out any // intermediate loading state. So we use heuristics to determine when. // Suspense Heuristics // // If nothing threw a Promise or all the same fallbacks are already showing, // then don't suspend/restart. // // If this is an initial render of a new tree of Suspense boundaries and // those trigger a fallback, then don't suspend/restart. We want to ensure // that we can show the initial loading state as quickly as possible. // // If we hit a "Delayed" case, such as when we'd switch from content back into // a fallback, then we should always suspend/restart. Transitions apply // to this case. If none is defined, JND is used instead. // // If we're already showing a fallback and it gets "retried", allowing us to show // another level, but there's still an inner boundary that would show a fallback, // then we suspend/restart for 500ms since the last time we showed a fallback // anywhere in the tree. This effectively throttles progressive loading into a // consistent train of commits. This also gives us an opportunity to restart to // get to the completed state slightly earlier. // // If there's ambiguity due to batching it's resolved in preference of: // 1) "delayed", 2) "initial render", 3) "retry". // // We want to ensure that a "busy" state doesn't get force committed. We want to // ensure that new initial loading states can commit as soon as possible. suspenseBoundary.flags |= ShouldCapture; // TODO: I think we can remove this, since we now use `DidCapture` in // the begin phase to prevent an early bailout. suspenseBoundary.lanes = rootRenderLanes; return suspenseBoundary; } function throwException(root, returnFiber, sourceFiber, value, rootRenderLanes) { // The source fiber did not complete. sourceFiber.flags |= Incomplete; { if (isDevToolsPresent) { // If we have pending work still, restore the original updaters restorePendingUpdaters(root, rootRenderLanes); } } if (value !== null && typeof value === 'object' && typeof value.then === 'function') { // This is a wakeable. The component suspended. var wakeable = value; resetSuspendedComponent(sourceFiber); { if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) { markDidThrowWhileHydratingDEV(); } } var suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber); if (suspenseBoundary !== null) { suspenseBoundary.flags &= ~ForceClientRender; markSuspenseBoundaryShouldCapture(suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes); // We only attach ping listeners in concurrent mode. Legacy Suspense always // commits fallbacks synchronously, so there are no pings. if (suspenseBoundary.mode & ConcurrentMode) { attachPingListener(root, wakeable, rootRenderLanes); } attachRetryListener(suspenseBoundary, root, wakeable); return; } else { // No boundary was found. Unless this is a sync update, this is OK. // We can suspend and wait for more data to arrive. if (!includesSyncLane(rootRenderLanes)) { // This is not a sync update. Suspend. Since we're not activating a // Suspense boundary, this will unwind all the way to the root without // performing a second pass to render a fallback. (This is arguably how // refresh transitions should work, too, since we're not going to commit // the fallbacks anyway.) // // This case also applies to initial hydration. attachPingListener(root, wakeable, rootRenderLanes); renderDidSuspendDelayIfPossible(); return; } // This is a sync/discrete update. We treat this case like an error // because discrete renders are expected to produce a complete tree // synchronously to maintain consistency with external state. var uncaughtSuspenseError = new Error('A component suspended while responding to synchronous input. This ' + 'will cause the UI to be replaced with a loading indicator. To ' + 'fix, updates that suspend should be wrapped ' + 'with startTransition.'); // If we're outside a transition, fall through to the regular error path. // The error will be caught by the nearest suspense boundary. value = uncaughtSuspenseError; } } else { // This is a regular error, not a Suspense wakeable. if (getIsHydrating() && sourceFiber.mode & ConcurrentMode) { markDidThrowWhileHydratingDEV(); var _suspenseBoundary = getNearestSuspenseBoundaryToCapture(returnFiber); // If the error was thrown during hydration, we may be able to recover by // discarding the dehydrated content and switching to a client render. // Instead of surfacing the error, find the nearest Suspense boundary // and render it again without hydration. if (_suspenseBoundary !== null) { if ((_suspenseBoundary.flags & ShouldCapture) === NoFlags) { // Set a flag to indicate that we should try rendering the normal // children again, not the fallback. _suspenseBoundary.flags |= ForceClientRender; } markSuspenseBoundaryShouldCapture(_suspenseBoundary, returnFiber, sourceFiber, root, rootRenderLanes); // Even though the user may not be affected by this error, we should // still log it so it can be fixed. queueHydrationError(createCapturedValueAtFiber(value, sourceFiber)); return; } } } value = createCapturedValueAtFiber(value, sourceFiber); renderDidError(value); // We didn't find a boundary that could handle this type of exception. Start // over and traverse parent path again, this time treating the exception // as an error. var workInProgress = returnFiber; do { switch (workInProgress.tag) { case HostRoot: { var _errorInfo = value; workInProgress.flags |= ShouldCapture; var lane = pickArbitraryLane(rootRenderLanes); workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); var update = createRootErrorUpdate(workInProgress, _errorInfo, lane); enqueueCapturedUpdate(workInProgress, update); return; } case ClassComponent: // Capture and retry var errorInfo = value; var ctor = workInProgress.type; var instance = workInProgress.stateNode; if ((workInProgress.flags & DidCapture) === NoFlags && (typeof ctor.getDerivedStateFromError === 'function' || instance !== null && typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance))) { workInProgress.flags |= ShouldCapture; var _lane = pickArbitraryLane(rootRenderLanes); workInProgress.lanes = mergeLanes(workInProgress.lanes, _lane); // Schedule the error boundary to re-render using updated state var _update = createClassErrorUpdate(workInProgress, errorInfo, _lane); enqueueCapturedUpdate(workInProgress, _update); return; } break; } workInProgress = workInProgress.return; } while (workInProgress !== null); } function getSuspendedCache() { { return null; } // This function is called when a Suspense boundary suspends. It returns the } var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner; var didReceiveUpdate = false; var didWarnAboutBadClass; var didWarnAboutModulePatternComponent; var didWarnAboutContextTypeOnFunctionComponent; var didWarnAboutGetDerivedStateOnFunctionComponent; var didWarnAboutFunctionRefs; var didWarnAboutReassigningProps; var didWarnAboutRevealOrder; var didWarnAboutTailOptions; var didWarnAboutDefaultPropsOnFunctionComponent; { didWarnAboutBadClass = {}; didWarnAboutModulePatternComponent = {}; didWarnAboutContextTypeOnFunctionComponent = {}; didWarnAboutGetDerivedStateOnFunctionComponent = {}; didWarnAboutFunctionRefs = {}; didWarnAboutReassigningProps = false; didWarnAboutRevealOrder = {}; didWarnAboutTailOptions = {}; didWarnAboutDefaultPropsOnFunctionComponent = {}; } function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { if (current === null) { // If this is a fresh new component that hasn't been rendered yet, we // won't update its child set by applying minimal side-effects. Instead, // we will add them all to the child before it gets rendered. That means // we can optimize this reconciliation pass by not tracking side-effects. workInProgress.child = mountChildFibers(workInProgress, null, nextChildren, renderLanes); } else { // If the current child is the same as the work in progress, it means that // we haven't yet started any work on these children. Therefore, we use // the clone algorithm to create a copy of all the current children. // If we had any progressed work already, that is invalid at this point so // let's throw it out. workInProgress.child = reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes); } } function forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes) { // This function is fork of reconcileChildren. It's used in cases where we // want to reconcile without matching against the existing set. This has the // effect of all current children being unmounted; even if the type and key // are the same, the old child is unmounted and a new child is created. // // To do this, we're going to go through the reconcile algorithm twice. In // the first pass, we schedule a deletion for all the current children by // passing null. workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes); // In the second pass, we mount the new children. The trick here is that we // pass null in place of where we usually pass the current child set. This has // the effect of remounting all children regardless of whether their // identities match. workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes); } function updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) { // TODO: current can be non-null here even if the component // hasn't yet mounted. This happens after the first render suspends. // We'll need to figure out if this is fine or can cause issues. { if (workInProgress.type !== workInProgress.elementType) { // Lazy component props can't be validated in createElement // because they're only guaranteed to be resolved here. var innerPropTypes = Component.propTypes; if (innerPropTypes) { checkPropTypes(innerPropTypes, nextProps, // Resolved props 'prop', getComponentNameFromType(Component)); } } } var render = Component.render; var ref = workInProgress.ref; // The rest is a fork of updateFunctionComponent var nextChildren; var hasId; prepareToReadContext(workInProgress, renderLanes); { markComponentRenderStarted(workInProgress); } { ReactCurrentOwner$1.current = workInProgress; setIsRendering(true); nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes); hasId = checkDidRenderIdHook(); if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { nextChildren = renderWithHooks(current, workInProgress, render, nextProps, ref, renderLanes); hasId = checkDidRenderIdHook(); } finally { setIsStrictModeForDevtools(false); } } setIsRendering(false); } { markComponentRenderStopped(); } if (current !== null && !didReceiveUpdate) { bailoutHooks(current, workInProgress, renderLanes); return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } if (getIsHydrating() && hasId) { pushMaterializedTreeId(workInProgress); } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { if (current === null) { var type = Component.type; if (isSimpleFunctionComponent(type) && Component.compare === null && // SimpleMemoComponent codepath doesn't resolve outer props either. Component.defaultProps === undefined) { var resolvedType = type; { resolvedType = resolveFunctionForHotReloading(type); } // If this is a plain function component without default props, // and with only the default shallow comparison, we upgrade it // to a SimpleMemoComponent to allow fast path updates. workInProgress.tag = SimpleMemoComponent; workInProgress.type = resolvedType; { validateFunctionComponentInDev(workInProgress, type); } return updateSimpleMemoComponent(current, workInProgress, resolvedType, nextProps, renderLanes); } { var innerPropTypes = type.propTypes; if (innerPropTypes) { // Inner memo component props aren't currently validated in createElement. // We could move it there, but we'd still need this for lazy code path. checkPropTypes(innerPropTypes, nextProps, // Resolved props 'prop', getComponentNameFromType(type)); } if ( Component.defaultProps !== undefined) { var componentName = getComponentNameFromType(type) || 'Unknown'; if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) { error('%s: Support for defaultProps will be removed from memo components ' + 'in a future major release. Use JavaScript default parameters instead.', componentName); didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true; } } } var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes); child.ref = workInProgress.ref; child.return = workInProgress; workInProgress.child = child; return child; } { var _type = Component.type; var _innerPropTypes = _type.propTypes; if (_innerPropTypes) { // Inner memo component props aren't currently validated in createElement. // We could move it there, but we'd still need this for lazy code path. checkPropTypes(_innerPropTypes, nextProps, // Resolved props 'prop', getComponentNameFromType(_type)); } } var currentChild = current.child; // This is always exactly one child var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes); if (!hasScheduledUpdateOrContext) { // This will be the props with resolved defaultProps, // unlike current.memoizedProps which will be the unresolved ones. var prevProps = currentChild.memoizedProps; // Default to shallow comparison var compare = Component.compare; compare = compare !== null ? compare : shallowEqual; if (compare(prevProps, nextProps) && current.ref === workInProgress.ref) { return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; var newChild = createWorkInProgress(currentChild, nextProps); newChild.ref = workInProgress.ref; newChild.return = workInProgress; workInProgress.child = newChild; return newChild; } function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, renderLanes) { // TODO: current can be non-null here even if the component // hasn't yet mounted. This happens when the inner render suspends. // We'll need to figure out if this is fine or can cause issues. { if (workInProgress.type !== workInProgress.elementType) { // Lazy component props can't be validated in createElement // because they're only guaranteed to be resolved here. var outerMemoType = workInProgress.elementType; if (outerMemoType.$$typeof === REACT_LAZY_TYPE) { // We warn when you define propTypes on lazy() // so let's just skip over it to find memo() outer wrapper. // Inner props for memo are validated later. var lazyComponent = outerMemoType; var payload = lazyComponent._payload; var init = lazyComponent._init; try { outerMemoType = init(payload); } catch (x) { outerMemoType = null; } // Inner propTypes will be validated in the function component path. var outerPropTypes = outerMemoType && outerMemoType.propTypes; if (outerPropTypes) { checkPropTypes(outerPropTypes, nextProps, // Resolved (SimpleMemoComponent has no defaultProps) 'prop', getComponentNameFromType(outerMemoType)); } } } } if (current !== null) { var prevProps = current.memoizedProps; if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress.ref && ( // Prevent bailout if the implementation changed due to hot reload. workInProgress.type === current.type )) { didReceiveUpdate = false; // The props are shallowly equal. Reuse the previous props object, like we // would during a normal fiber bailout. // // We don't have strong guarantees that the props object is referentially // equal during updates where we can't bail out anyway — like if the props // are shallowly equal, but there's a local state or context update in the // same batch. // // However, as a principle, we should aim to make the behavior consistent // across different ways of memoizing a component. For example, React.memo // has a different internal Fiber layout if you pass a normal function // component (SimpleMemoComponent) versus if you pass a different type // like forwardRef (MemoComponent). But this is an implementation detail. // Wrapping a component in forwardRef (or React.lazy, etc) shouldn't // affect whether the props object is reused during a bailout. workInProgress.pendingProps = nextProps = prevProps; if (!checkScheduledUpdateOrContext(current, renderLanes)) { // The pending lanes were cleared at the beginning of beginWork. We're // about to bail out, but there might be other lanes that weren't // included in the current render. Usually, the priority level of the // remaining updates is accumulated during the evaluation of the // component (i.e. when processing the update queue). But since since // we're bailing out early *without* evaluating the component, we need // to account for it here, too. Reset to the value of the current fiber. // NOTE: This only applies to SimpleMemoComponent, not MemoComponent, // because a MemoComponent fiber does not have hooks or an update queue; // rather, it wraps around an inner component, which may or may not // contains hooks. // TODO: Move the reset at in beginWork out of the common path so that // this is no longer necessary. workInProgress.lanes = current.lanes; return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } else if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { // This is a special case that only exists for legacy mode. // See https://github.com/facebook/react/pull/19216. didReceiveUpdate = true; } } } return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes); } function updateOffscreenComponent(current, workInProgress, renderLanes) { var nextProps = workInProgress.pendingProps; var nextChildren = nextProps.children; var prevState = current !== null ? current.memoizedState : null; if (nextProps.mode === 'hidden' || enableLegacyHidden ) { // Rendering a hidden tree. if ((workInProgress.mode & ConcurrentMode) === NoMode) { // In legacy sync mode, don't defer the subtree. Render it now. // TODO: Consider how Offscreen should work with transitions in the future var nextState = { baseLanes: NoLanes, cachePool: null, transitions: null }; workInProgress.memoizedState = nextState; pushRenderLanes(workInProgress, renderLanes); } else if (!includesSomeLane(renderLanes, OffscreenLane)) { var spawnedCachePool = null; // We're hidden, and we're not rendering at Offscreen. We will bail out // and resume this tree later. var nextBaseLanes; if (prevState !== null) { var prevBaseLanes = prevState.baseLanes; nextBaseLanes = mergeLanes(prevBaseLanes, renderLanes); } else { nextBaseLanes = renderLanes; } // Schedule this fiber to re-render at offscreen priority. Then bailout. workInProgress.lanes = workInProgress.childLanes = laneToLanes(OffscreenLane); var _nextState = { baseLanes: nextBaseLanes, cachePool: spawnedCachePool, transitions: null }; workInProgress.memoizedState = _nextState; workInProgress.updateQueue = null; // to avoid a push/pop misalignment. pushRenderLanes(workInProgress, nextBaseLanes); return null; } else { // This is the second render. The surrounding visible content has already // committed. Now we resume rendering the hidden tree. // Rendering at offscreen, so we can clear the base lanes. var _nextState2 = { baseLanes: NoLanes, cachePool: null, transitions: null }; workInProgress.memoizedState = _nextState2; // Push the lanes that were skipped when we bailed out. var subtreeRenderLanes = prevState !== null ? prevState.baseLanes : renderLanes; pushRenderLanes(workInProgress, subtreeRenderLanes); } } else { // Rendering a visible tree. var _subtreeRenderLanes; if (prevState !== null) { // We're going from hidden -> visible. _subtreeRenderLanes = mergeLanes(prevState.baseLanes, renderLanes); workInProgress.memoizedState = null; } else { // We weren't previously hidden, and we still aren't, so there's nothing // special to do. Need to push to the stack regardless, though, to avoid // a push/pop misalignment. _subtreeRenderLanes = renderLanes; } pushRenderLanes(workInProgress, _subtreeRenderLanes); } reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } // Note: These happen to have identical begin phases, for now. We shouldn't hold function updateFragment(current, workInProgress, renderLanes) { var nextChildren = workInProgress.pendingProps; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateMode(current, workInProgress, renderLanes) { var nextChildren = workInProgress.pendingProps.children; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateProfiler(current, workInProgress, renderLanes) { { workInProgress.flags |= Update; { // Reset effect durations for the next eventual effect phase. // These are reset during render to allow the DevTools commit hook a chance to read them, var stateNode = workInProgress.stateNode; stateNode.effectDuration = 0; stateNode.passiveEffectDuration = 0; } } var nextProps = workInProgress.pendingProps; var nextChildren = nextProps.children; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function markRef(current, workInProgress) { var ref = workInProgress.ref; if (current === null && ref !== null || current !== null && current.ref !== ref) { // Schedule a Ref effect workInProgress.flags |= Ref; { workInProgress.flags |= RefStatic; } } } function updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) { { if (workInProgress.type !== workInProgress.elementType) { // Lazy component props can't be validated in createElement // because they're only guaranteed to be resolved here. var innerPropTypes = Component.propTypes; if (innerPropTypes) { checkPropTypes(innerPropTypes, nextProps, // Resolved props 'prop', getComponentNameFromType(Component)); } } } var context; { var unmaskedContext = getUnmaskedContext(workInProgress, Component, true); context = getMaskedContext(workInProgress, unmaskedContext); } var nextChildren; var hasId; prepareToReadContext(workInProgress, renderLanes); { markComponentRenderStarted(workInProgress); } { ReactCurrentOwner$1.current = workInProgress; setIsRendering(true); nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes); hasId = checkDidRenderIdHook(); if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { nextChildren = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes); hasId = checkDidRenderIdHook(); } finally { setIsStrictModeForDevtools(false); } } setIsRendering(false); } { markComponentRenderStopped(); } if (current !== null && !didReceiveUpdate) { bailoutHooks(current, workInProgress, renderLanes); return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } if (getIsHydrating() && hasId) { pushMaterializedTreeId(workInProgress); } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) { { // This is used by DevTools to force a boundary to error. switch (shouldError(workInProgress)) { case false: { var _instance = workInProgress.stateNode; var ctor = workInProgress.type; // TODO This way of resetting the error boundary state is a hack. // Is there a better way to do this? var tempInstance = new ctor(workInProgress.memoizedProps, _instance.context); var state = tempInstance.state; _instance.updater.enqueueSetState(_instance, state, null); break; } case true: { workInProgress.flags |= DidCapture; workInProgress.flags |= ShouldCapture; // eslint-disable-next-line react-internal/prod-error-codes var error$1 = new Error('Simulated error coming from DevTools'); var lane = pickArbitraryLane(renderLanes); workInProgress.lanes = mergeLanes(workInProgress.lanes, lane); // Schedule the error boundary to re-render using updated state var update = createClassErrorUpdate(workInProgress, createCapturedValueAtFiber(error$1, workInProgress), lane); enqueueCapturedUpdate(workInProgress, update); break; } } if (workInProgress.type !== workInProgress.elementType) { // Lazy component props can't be validated in createElement // because they're only guaranteed to be resolved here. var innerPropTypes = Component.propTypes; if (innerPropTypes) { checkPropTypes(innerPropTypes, nextProps, // Resolved props 'prop', getComponentNameFromType(Component)); } } } // Push context providers early to prevent context stack mismatches. // During mounting we don't know the child context yet as the instance doesn't exist. // We will invalidate the child context in finishClassComponent() right after rendering. var hasContext; if (isContextProvider(Component)) { hasContext = true; pushContextProvider(workInProgress); } else { hasContext = false; } prepareToReadContext(workInProgress, renderLanes); var instance = workInProgress.stateNode; var shouldUpdate; if (instance === null) { resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress); // In the initial pass we might need to construct the instance. constructClassInstance(workInProgress, Component, nextProps); mountClassInstance(workInProgress, Component, nextProps, renderLanes); shouldUpdate = true; } else if (current === null) { // In a resume, we'll already have an instance we can reuse. shouldUpdate = resumeMountClassInstance(workInProgress, Component, nextProps, renderLanes); } else { shouldUpdate = updateClassInstance(current, workInProgress, Component, nextProps, renderLanes); } var nextUnitOfWork = finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes); { var inst = workInProgress.stateNode; if (shouldUpdate && inst.props !== nextProps) { if (!didWarnAboutReassigningProps) { error('It looks like %s is reassigning its own `this.props` while rendering. ' + 'This is not supported and can lead to confusing bugs.', getComponentNameFromFiber(workInProgress) || 'a component'); } didWarnAboutReassigningProps = true; } } return nextUnitOfWork; } function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) { // Refs should update even if shouldComponentUpdate returns false markRef(current, workInProgress); var didCaptureError = (workInProgress.flags & DidCapture) !== NoFlags; if (!shouldUpdate && !didCaptureError) { // Context providers should defer to sCU for rendering if (hasContext) { invalidateContextProvider(workInProgress, Component, false); } return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } var instance = workInProgress.stateNode; // Rerender ReactCurrentOwner$1.current = workInProgress; var nextChildren; if (didCaptureError && typeof Component.getDerivedStateFromError !== 'function') { // If we captured an error, but getDerivedStateFromError is not defined, // unmount all the children. componentDidCatch will schedule an update to // re-render a fallback. This is temporary until we migrate everyone to // the new API. // TODO: Warn in a future release. nextChildren = null; { stopProfilerTimerIfRunning(); } } else { { markComponentRenderStarted(workInProgress); } { setIsRendering(true); nextChildren = instance.render(); if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { instance.render(); } finally { setIsStrictModeForDevtools(false); } } setIsRendering(false); } { markComponentRenderStopped(); } } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; if (current !== null && didCaptureError) { // If we're recovering from an error, reconcile without reusing any of // the existing children. Conceptually, the normal children and the children // that are shown on error are two different sets, so we shouldn't reuse // normal children even if their identities match. forceUnmountCurrentAndReconcile(current, workInProgress, nextChildren, renderLanes); } else { reconcileChildren(current, workInProgress, nextChildren, renderLanes); } // Memoize state using the values we just used to render. // TODO: Restructure so we never read values from the instance. workInProgress.memoizedState = instance.state; // The context might have changed so we need to recalculate it. if (hasContext) { invalidateContextProvider(workInProgress, Component, true); } return workInProgress.child; } function pushHostRootContext(workInProgress) { var root = workInProgress.stateNode; if (root.pendingContext) { pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context); } else if (root.context) { // Should always be set pushTopLevelContextObject(workInProgress, root.context, false); } pushHostContainer(workInProgress, root.containerInfo); } function updateHostRoot(current, workInProgress, renderLanes) { pushHostRootContext(workInProgress); if (current === null) { throw new Error('Should have a current fiber. This is a bug in React.'); } var nextProps = workInProgress.pendingProps; var prevState = workInProgress.memoizedState; var prevChildren = prevState.element; cloneUpdateQueue(current, workInProgress); processUpdateQueue(workInProgress, nextProps, null, renderLanes); var nextState = workInProgress.memoizedState; var root = workInProgress.stateNode; // being called "element". var nextChildren = nextState.element; if ( prevState.isDehydrated) { // This is a hydration root whose shell has not yet hydrated. We should // attempt to hydrate. // Flip isDehydrated to false to indicate that when this render // finishes, the root will no longer be dehydrated. var overrideState = { element: nextChildren, isDehydrated: false, cache: nextState.cache, pendingSuspenseBoundaries: nextState.pendingSuspenseBoundaries, transitions: nextState.transitions }; var updateQueue = workInProgress.updateQueue; // `baseState` can always be the last state because the root doesn't // have reducer functions so it doesn't need rebasing. updateQueue.baseState = overrideState; workInProgress.memoizedState = overrideState; if (workInProgress.flags & ForceClientRender) { // Something errored during a previous attempt to hydrate the shell, so we // forced a client render. var recoverableError = createCapturedValueAtFiber(new Error('There was an error while hydrating. Because the error happened outside ' + 'of a Suspense boundary, the entire root will switch to ' + 'client rendering.'), workInProgress); return mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, recoverableError); } else if (nextChildren !== prevChildren) { var _recoverableError = createCapturedValueAtFiber(new Error('This root received an early update, before anything was able ' + 'hydrate. Switched the entire root to client rendering.'), workInProgress); return mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, _recoverableError); } else { // The outermost shell has not hydrated yet. Start hydrating. enterHydrationState(workInProgress); var child = mountChildFibers(workInProgress, null, nextChildren, renderLanes); workInProgress.child = child; var node = child; while (node) { // Mark each child as hydrating. This is a fast path to know whether this // tree is part of a hydrating tree. This is used to determine if a child // node has fully mounted yet, and for scheduling event replaying. // Conceptually this is similar to Placement in that a new subtree is // inserted into the React tree here. It just happens to not need DOM // mutations because it already exists. node.flags = node.flags & ~Placement | Hydrating; node = node.sibling; } } } else { // Root is not dehydrated. Either this is a client-only root, or it // already hydrated. resetHydrationState(); if (nextChildren === prevChildren) { return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } reconcileChildren(current, workInProgress, nextChildren, renderLanes); } return workInProgress.child; } function mountHostRootWithoutHydrating(current, workInProgress, nextChildren, renderLanes, recoverableError) { // Revert to client rendering. resetHydrationState(); queueHydrationError(recoverableError); workInProgress.flags |= ForceClientRender; reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateHostComponent(current, workInProgress, renderLanes) { pushHostContext(workInProgress); if (current === null) { tryToClaimNextHydratableInstance(workInProgress); } var type = workInProgress.type; var nextProps = workInProgress.pendingProps; var prevProps = current !== null ? current.memoizedProps : null; var nextChildren = nextProps.children; var isDirectTextChild = shouldSetTextContent(type, nextProps); if (isDirectTextChild) { // We special case a direct text child of a host node. This is a common // case. We won't handle it as a reified child. We will instead handle // this in the host environment that also has access to this prop. That // avoids allocating another HostText fiber and traversing it. nextChildren = null; } else if (prevProps !== null && shouldSetTextContent(type, prevProps)) { // If we're switching from a direct text child to a normal child, or to // empty, we need to schedule the text content to be reset. workInProgress.flags |= ContentReset; } markRef(current, workInProgress); reconcileChildren(current, workInProgress, nextChildren, renderLanes); return workInProgress.child; } function updateHostText(current, workInProgress) { if (current === null) { tryToClaimNextHydratableInstance(workInProgress); } // Nothing to do here. This is terminal. We'll do the completion step // immediately after. return null; } function mountLazyComponent(_current, workInProgress, elementType, renderLanes) { resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); var props = workInProgress.pendingProps; var lazyComponent = elementType; var payload = lazyComponent._payload; var init = lazyComponent._init; var Component = init(payload); // Store the unwrapped component in the type. workInProgress.type = Component; var resolvedTag = workInProgress.tag = resolveLazyComponentTag(Component); var resolvedProps = resolveDefaultProps(Component, props); var child; switch (resolvedTag) { case FunctionComponent: { { validateFunctionComponentInDev(workInProgress, Component); workInProgress.type = Component = resolveFunctionForHotReloading(Component); } child = updateFunctionComponent(null, workInProgress, Component, resolvedProps, renderLanes); return child; } case ClassComponent: { { workInProgress.type = Component = resolveClassForHotReloading(Component); } child = updateClassComponent(null, workInProgress, Component, resolvedProps, renderLanes); return child; } case ForwardRef: { { workInProgress.type = Component = resolveForwardRefForHotReloading(Component); } child = updateForwardRef(null, workInProgress, Component, resolvedProps, renderLanes); return child; } case MemoComponent: { { if (workInProgress.type !== workInProgress.elementType) { var outerPropTypes = Component.propTypes; if (outerPropTypes) { checkPropTypes(outerPropTypes, resolvedProps, // Resolved for outer only 'prop', getComponentNameFromType(Component)); } } } child = updateMemoComponent(null, workInProgress, Component, resolveDefaultProps(Component.type, resolvedProps), // The inner type can have defaults too renderLanes); return child; } } var hint = ''; { if (Component !== null && typeof Component === 'object' && Component.$$typeof === REACT_LAZY_TYPE) { hint = ' Did you wrap a component in React.lazy() more than once?'; } } // This message intentionally doesn't mention ForwardRef or MemoComponent // because the fact that it's a separate type of work is an // implementation detail. throw new Error("Element type is invalid. Received a promise that resolves to: " + Component + ". " + ("Lazy element type must resolve to a class or function." + hint)); } function mountIncompleteClassComponent(_current, workInProgress, Component, nextProps, renderLanes) { resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); // Promote the fiber to a class and try rendering again. workInProgress.tag = ClassComponent; // The rest of this function is a fork of `updateClassComponent` // Push context providers early to prevent context stack mismatches. // During mounting we don't know the child context yet as the instance doesn't exist. // We will invalidate the child context in finishClassComponent() right after rendering. var hasContext; if (isContextProvider(Component)) { hasContext = true; pushContextProvider(workInProgress); } else { hasContext = false; } prepareToReadContext(workInProgress, renderLanes); constructClassInstance(workInProgress, Component, nextProps); mountClassInstance(workInProgress, Component, nextProps, renderLanes); return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes); } function mountIndeterminateComponent(_current, workInProgress, Component, renderLanes) { resetSuspendedCurrentOnMountInLegacyMode(_current, workInProgress); var props = workInProgress.pendingProps; var context; { var unmaskedContext = getUnmaskedContext(workInProgress, Component, false); context = getMaskedContext(workInProgress, unmaskedContext); } prepareToReadContext(workInProgress, renderLanes); var value; var hasId; { markComponentRenderStarted(workInProgress); } { if (Component.prototype && typeof Component.prototype.render === 'function') { var componentName = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutBadClass[componentName]) { error("The <%s /> component appears to have a render method, but doesn't extend React.Component. " + 'This is likely to cause errors. Change %s to extend React.Component instead.', componentName, componentName); didWarnAboutBadClass[componentName] = true; } } if (workInProgress.mode & StrictLegacyMode) { ReactStrictModeWarnings.recordLegacyContextWarning(workInProgress, null); } setIsRendering(true); ReactCurrentOwner$1.current = workInProgress; value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes); hasId = checkDidRenderIdHook(); setIsRendering(false); } { markComponentRenderStopped(); } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; { // Support for module components is deprecated and is removed behind a flag. // Whether or not it would crash later, we want to show a good message in DEV first. if (typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) { var _componentName = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutModulePatternComponent[_componentName]) { error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName, _componentName, _componentName); didWarnAboutModulePatternComponent[_componentName] = true; } } } if ( // Run these checks in production only if the flag is off. // Eventually we'll delete this branch altogether. typeof value === 'object' && value !== null && typeof value.render === 'function' && value.$$typeof === undefined) { { var _componentName2 = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutModulePatternComponent[_componentName2]) { error('The <%s /> component appears to be a function component that returns a class instance. ' + 'Change %s to a class that extends React.Component instead. ' + "If you can't use a class try assigning the prototype on the function as a workaround. " + "`%s.prototype = React.Component.prototype`. Don't use an arrow function since it " + 'cannot be called with `new` by React.', _componentName2, _componentName2, _componentName2); didWarnAboutModulePatternComponent[_componentName2] = true; } } // Proceed under the assumption that this is a class instance workInProgress.tag = ClassComponent; // Throw out any hooks that were used. workInProgress.memoizedState = null; workInProgress.updateQueue = null; // Push context providers early to prevent context stack mismatches. // During mounting we don't know the child context yet as the instance doesn't exist. // We will invalidate the child context in finishClassComponent() right after rendering. var hasContext = false; if (isContextProvider(Component)) { hasContext = true; pushContextProvider(workInProgress); } else { hasContext = false; } workInProgress.memoizedState = value.state !== null && value.state !== undefined ? value.state : null; initializeUpdateQueue(workInProgress); adoptClassInstance(workInProgress, value); mountClassInstance(workInProgress, Component, props, renderLanes); return finishClassComponent(null, workInProgress, Component, true, hasContext, renderLanes); } else { // Proceed under the assumption that this is a function component workInProgress.tag = FunctionComponent; { if ( workInProgress.mode & StrictLegacyMode) { setIsStrictModeForDevtools(true); try { value = renderWithHooks(null, workInProgress, Component, props, context, renderLanes); hasId = checkDidRenderIdHook(); } finally { setIsStrictModeForDevtools(false); } } } if (getIsHydrating() && hasId) { pushMaterializedTreeId(workInProgress); } reconcileChildren(null, workInProgress, value, renderLanes); { validateFunctionComponentInDev(workInProgress, Component); } return workInProgress.child; } } function validateFunctionComponentInDev(workInProgress, Component) { { if (Component) { if (Component.childContextTypes) { error('%s(...): childContextTypes cannot be defined on a function component.', Component.displayName || Component.name || 'Component'); } } if (workInProgress.ref !== null) { var info = ''; var ownerName = getCurrentFiberOwnerNameInDevOrNull(); if (ownerName) { info += '\n\nCheck the render method of `' + ownerName + '`.'; } var warningKey = ownerName || ''; var debugSource = workInProgress._debugSource; if (debugSource) { warningKey = debugSource.fileName + ':' + debugSource.lineNumber; } if (!didWarnAboutFunctionRefs[warningKey]) { didWarnAboutFunctionRefs[warningKey] = true; error('Function components cannot be given refs. ' + 'Attempts to access this ref will fail. ' + 'Did you mean to use React.forwardRef()?%s', info); } } if ( Component.defaultProps !== undefined) { var componentName = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutDefaultPropsOnFunctionComponent[componentName]) { error('%s: Support for defaultProps will be removed from function components ' + 'in a future major release. Use JavaScript default parameters instead.', componentName); didWarnAboutDefaultPropsOnFunctionComponent[componentName] = true; } } if (typeof Component.getDerivedStateFromProps === 'function') { var _componentName3 = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3]) { error('%s: Function components do not support getDerivedStateFromProps.', _componentName3); didWarnAboutGetDerivedStateOnFunctionComponent[_componentName3] = true; } } if (typeof Component.contextType === 'object' && Component.contextType !== null) { var _componentName4 = getComponentNameFromType(Component) || 'Unknown'; if (!didWarnAboutContextTypeOnFunctionComponent[_componentName4]) { error('%s: Function components do not support contextType.', _componentName4); didWarnAboutContextTypeOnFunctionComponent[_componentName4] = true; } } } } var SUSPENDED_MARKER = { dehydrated: null, treeContext: null, retryLane: NoLane }; function mountSuspenseOffscreenState(renderLanes) { return { baseLanes: renderLanes, cachePool: getSuspendedCache(), transitions: null }; } function updateSuspenseOffscreenState(prevOffscreenState, renderLanes) { var cachePool = null; return { baseLanes: mergeLanes(prevOffscreenState.baseLanes, renderLanes), cachePool: cachePool, transitions: prevOffscreenState.transitions }; } // TODO: Probably should inline this back function shouldRemainOnFallback(suspenseContext, current, workInProgress, renderLanes) { // If we're already showing a fallback, there are cases where we need to // remain on that fallback regardless of whether the content has resolved. // For example, SuspenseList coordinates when nested content appears. if (current !== null) { var suspenseState = current.memoizedState; if (suspenseState === null) { // Currently showing content. Don't hide it, even if ForceSuspenseFallback // is true. More precise name might be "ForceRemainSuspenseFallback". // Note: This is a factoring smell. Can't remain on a fallback if there's // no fallback to remain on. return false; } } // Not currently showing content. Consult the Suspense context. return hasSuspenseContext(suspenseContext, ForceSuspenseFallback); } function getRemainingWorkInPrimaryTree(current, renderLanes) { // TODO: Should not remove render lanes that were pinged during this render return removeLanes(current.childLanes, renderLanes); } function updateSuspenseComponent(current, workInProgress, renderLanes) { var nextProps = workInProgress.pendingProps; // This is used by DevTools to force a boundary to suspend. { if (shouldSuspend(workInProgress)) { workInProgress.flags |= DidCapture; } } var suspenseContext = suspenseStackCursor.current; var showFallback = false; var didSuspend = (workInProgress.flags & DidCapture) !== NoFlags; if (didSuspend || shouldRemainOnFallback(suspenseContext, current)) { // Something in this boundary's subtree already suspended. Switch to // rendering the fallback children. showFallback = true; workInProgress.flags &= ~DidCapture; } else { // Attempting the main content if (current === null || current.memoizedState !== null) { // This is a new mount or this boundary is already showing a fallback state. // Mark this subtree context as having at least one invisible parent that could // handle the fallback state. // Avoided boundaries are not considered since they cannot handle preferred fallback states. { suspenseContext = addSubtreeSuspenseContext(suspenseContext, InvisibleParentSuspenseContext); } } } suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); pushSuspenseContext(workInProgress, suspenseContext); // OK, the next part is confusing. We're about to reconcile the Suspense // boundary's children. This involves some custom reconciliation logic. Two // main reasons this is so complicated. // // First, Legacy Mode has different semantics for backwards compatibility. The // primary tree will commit in an inconsistent state, so when we do the // second pass to render the fallback, we do some exceedingly, uh, clever // hacks to make that not totally break. Like transferring effects and // deletions from hidden tree. In Concurrent Mode, it's much simpler, // because we bailout on the primary tree completely and leave it in its old // state, no effects. Same as what we do for Offscreen (except that // Offscreen doesn't have the first render pass). // // Second is hydration. During hydration, the Suspense fiber has a slightly // different layout, where the child points to a dehydrated fragment, which // contains the DOM rendered by the server. // // Third, even if you set all that aside, Suspense is like error boundaries in // that we first we try to render one tree, and if that fails, we render again // and switch to a different tree. Like a try/catch block. So we have to track // which branch we're currently rendering. Ideally we would model this using // a stack. if (current === null) { // Initial mount // Special path for hydration // If we're currently hydrating, try to hydrate this boundary. tryToClaimNextHydratableInstance(workInProgress); // This could've been a dehydrated suspense component. var suspenseState = workInProgress.memoizedState; if (suspenseState !== null) { var dehydrated = suspenseState.dehydrated; if (dehydrated !== null) { return mountDehydratedSuspenseComponent(workInProgress, dehydrated); } } var nextPrimaryChildren = nextProps.children; var nextFallbackChildren = nextProps.fallback; if (showFallback) { var fallbackFragment = mountSuspenseFallbackChildren(workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes); var primaryChildFragment = workInProgress.child; primaryChildFragment.memoizedState = mountSuspenseOffscreenState(renderLanes); workInProgress.memoizedState = SUSPENDED_MARKER; return fallbackFragment; } else { return mountSuspensePrimaryChildren(workInProgress, nextPrimaryChildren); } } else { // This is an update. // Special path for hydration var prevState = current.memoizedState; if (prevState !== null) { var _dehydrated = prevState.dehydrated; if (_dehydrated !== null) { return updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, _dehydrated, prevState, renderLanes); } } if (showFallback) { var _nextFallbackChildren = nextProps.fallback; var _nextPrimaryChildren = nextProps.children; var fallbackChildFragment = updateSuspenseFallbackChildren(current, workInProgress, _nextPrimaryChildren, _nextFallbackChildren, renderLanes); var _primaryChildFragment2 = workInProgress.child; var prevOffscreenState = current.child.memoizedState; _primaryChildFragment2.memoizedState = prevOffscreenState === null ? mountSuspenseOffscreenState(renderLanes) : updateSuspenseOffscreenState(prevOffscreenState, renderLanes); _primaryChildFragment2.childLanes = getRemainingWorkInPrimaryTree(current, renderLanes); workInProgress.memoizedState = SUSPENDED_MARKER; return fallbackChildFragment; } else { var _nextPrimaryChildren2 = nextProps.children; var _primaryChildFragment3 = updateSuspensePrimaryChildren(current, workInProgress, _nextPrimaryChildren2, renderLanes); workInProgress.memoizedState = null; return _primaryChildFragment3; } } } function mountSuspensePrimaryChildren(workInProgress, primaryChildren, renderLanes) { var mode = workInProgress.mode; var primaryChildProps = { mode: 'visible', children: primaryChildren }; var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode); primaryChildFragment.return = workInProgress; workInProgress.child = primaryChildFragment; return primaryChildFragment; } function mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) { var mode = workInProgress.mode; var progressedPrimaryFragment = workInProgress.child; var primaryChildProps = { mode: 'hidden', children: primaryChildren }; var primaryChildFragment; var fallbackChildFragment; if ((mode & ConcurrentMode) === NoMode && progressedPrimaryFragment !== null) { // In legacy mode, we commit the primary tree as if it successfully // completed, even though it's in an inconsistent state. primaryChildFragment = progressedPrimaryFragment; primaryChildFragment.childLanes = NoLanes; primaryChildFragment.pendingProps = primaryChildProps; if ( workInProgress.mode & ProfileMode) { // Reset the durations from the first pass so they aren't included in the // final amounts. This seems counterintuitive, since we're intentionally // not measuring part of the render phase, but this makes it match what we // do in Concurrent Mode. primaryChildFragment.actualDuration = 0; primaryChildFragment.actualStartTime = -1; primaryChildFragment.selfBaseDuration = 0; primaryChildFragment.treeBaseDuration = 0; } fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); } else { primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, mode); fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); } primaryChildFragment.return = workInProgress; fallbackChildFragment.return = workInProgress; primaryChildFragment.sibling = fallbackChildFragment; workInProgress.child = primaryChildFragment; return fallbackChildFragment; } function mountWorkInProgressOffscreenFiber(offscreenProps, mode, renderLanes) { // The props argument to `createFiberFromOffscreen` is `any` typed, so we use // this wrapper function to constrain it. return createFiberFromOffscreen(offscreenProps, mode, NoLanes, null); } function updateWorkInProgressOffscreenFiber(current, offscreenProps) { // The props argument to `createWorkInProgress` is `any` typed, so we use this // wrapper function to constrain it. return createWorkInProgress(current, offscreenProps); } function updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) { var currentPrimaryChildFragment = current.child; var currentFallbackChildFragment = currentPrimaryChildFragment.sibling; var primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, { mode: 'visible', children: primaryChildren }); if ((workInProgress.mode & ConcurrentMode) === NoMode) { primaryChildFragment.lanes = renderLanes; } primaryChildFragment.return = workInProgress; primaryChildFragment.sibling = null; if (currentFallbackChildFragment !== null) { // Delete the fallback child fragment var deletions = workInProgress.deletions; if (deletions === null) { workInProgress.deletions = [currentFallbackChildFragment]; workInProgress.flags |= ChildDeletion; } else { deletions.push(currentFallbackChildFragment); } } workInProgress.child = primaryChildFragment; return primaryChildFragment; } function updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { var mode = workInProgress.mode; var currentPrimaryChildFragment = current.child; var currentFallbackChildFragment = currentPrimaryChildFragment.sibling; var primaryChildProps = { mode: 'hidden', children: primaryChildren }; var primaryChildFragment; if ( // In legacy mode, we commit the primary tree as if it successfully // completed, even though it's in an inconsistent state. (mode & ConcurrentMode) === NoMode && // Make sure we're on the second pass, i.e. the primary child fragment was // already cloned. In legacy mode, the only case where this isn't true is // when DevTools forces us to display a fallback; we skip the first render // pass entirely and go straight to rendering the fallback. (In Concurrent // Mode, SuspenseList can also trigger this scenario, but this is a legacy- // only codepath.) workInProgress.child !== currentPrimaryChildFragment) { var progressedPrimaryFragment = workInProgress.child; primaryChildFragment = progressedPrimaryFragment; primaryChildFragment.childLanes = NoLanes; primaryChildFragment.pendingProps = primaryChildProps; if ( workInProgress.mode & ProfileMode) { // Reset the durations from the first pass so they aren't included in the // final amounts. This seems counterintuitive, since we're intentionally // not measuring part of the render phase, but this makes it match what we // do in Concurrent Mode. primaryChildFragment.actualDuration = 0; primaryChildFragment.actualStartTime = -1; primaryChildFragment.selfBaseDuration = currentPrimaryChildFragment.selfBaseDuration; primaryChildFragment.treeBaseDuration = currentPrimaryChildFragment.treeBaseDuration; } // The fallback fiber was added as a deletion during the first pass. // However, since we're going to remain on the fallback, we no longer want // to delete it. workInProgress.deletions = null; } else { primaryChildFragment = updateWorkInProgressOffscreenFiber(currentPrimaryChildFragment, primaryChildProps); // Since we're reusing a current tree, we need to reuse the flags, too. // (We don't do this in legacy mode, because in legacy mode we don't re-use // the current tree; see previous branch.) primaryChildFragment.subtreeFlags = currentPrimaryChildFragment.subtreeFlags & StaticMask; } var fallbackChildFragment; if (currentFallbackChildFragment !== null) { fallbackChildFragment = createWorkInProgress(currentFallbackChildFragment, fallbackChildren); } else { fallbackChildFragment = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); // Needs a placement effect because the parent (the Suspense boundary) already // mounted but this is a new fiber. fallbackChildFragment.flags |= Placement; } fallbackChildFragment.return = workInProgress; primaryChildFragment.return = workInProgress; primaryChildFragment.sibling = fallbackChildFragment; workInProgress.child = primaryChildFragment; return fallbackChildFragment; } function retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, recoverableError) { // Falling back to client rendering. Because this has performance // implications, it's considered a recoverable error, even though the user // likely won't observe anything wrong with the UI. // // The error is passed in as an argument to enforce that every caller provide // a custom message, or explicitly opt out (currently the only path that opts // out is legacy mode; every concurrent path provides an error). if (recoverableError !== null) { queueHydrationError(recoverableError); } // This will add the old fiber to the deletion list reconcileChildFibers(workInProgress, current.child, null, renderLanes); // We're now not suspended nor dehydrated. var nextProps = workInProgress.pendingProps; var primaryChildren = nextProps.children; var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); // Needs a placement effect because the parent (the Suspense boundary) already // mounted but this is a new fiber. primaryChildFragment.flags |= Placement; workInProgress.memoizedState = null; return primaryChildFragment; } function mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { var fiberMode = workInProgress.mode; var primaryChildProps = { mode: 'visible', children: primaryChildren }; var primaryChildFragment = mountWorkInProgressOffscreenFiber(primaryChildProps, fiberMode); var fallbackChildFragment = createFiberFromFragment(fallbackChildren, fiberMode, renderLanes, null); // Needs a placement effect because the parent (the Suspense // boundary) already mounted but this is a new fiber. fallbackChildFragment.flags |= Placement; primaryChildFragment.return = workInProgress; fallbackChildFragment.return = workInProgress; primaryChildFragment.sibling = fallbackChildFragment; workInProgress.child = primaryChildFragment; if ((workInProgress.mode & ConcurrentMode) !== NoMode) { // We will have dropped the effect list which contains the // deletion. We need to reconcile to delete the current child. reconcileChildFibers(workInProgress, current.child, null, renderLanes); } return fallbackChildFragment; } function mountDehydratedSuspenseComponent(workInProgress, suspenseInstance, renderLanes) { // During the first pass, we'll bail out and not drill into the children. // Instead, we'll leave the content in place and try to hydrate it later. if ((workInProgress.mode & ConcurrentMode) === NoMode) { { error('Cannot hydrate Suspense in legacy mode. Switch from ' + 'ReactDOM.hydrate(element, container) to ' + 'ReactDOMClient.hydrateRoot(container, <App />)' + '.render(element) or remove the Suspense components from ' + 'the server rendered components.'); } workInProgress.lanes = laneToLanes(SyncLane); } else if (isSuspenseInstanceFallback(suspenseInstance)) { // This is a client-only boundary. Since we won't get any content from the server // for this, we need to schedule that at a higher priority based on when it would // have timed out. In theory we could render it in this pass but it would have the // wrong priority associated with it and will prevent hydration of parent path. // Instead, we'll leave work left on it to render it in a separate commit. // TODO This time should be the time at which the server rendered response that is // a parent to this boundary was displayed. However, since we currently don't have // a protocol to transfer that time, we'll just estimate it by using the current // time. This will mean that Suspense timeouts are slightly shifted to later than // they should be. // Schedule a normal pri update to render this content. workInProgress.lanes = laneToLanes(DefaultHydrationLane); } else { // We'll continue hydrating the rest at offscreen priority since we'll already // be showing the right content coming from the server, it is no rush. workInProgress.lanes = laneToLanes(OffscreenLane); } return null; } function updateDehydratedSuspenseComponent(current, workInProgress, didSuspend, nextProps, suspenseInstance, suspenseState, renderLanes) { if (!didSuspend) { // This is the first render pass. Attempt to hydrate. // We should never be hydrating at this point because it is the first pass, // but after we've already committed once. warnIfHydrating(); if ((workInProgress.mode & ConcurrentMode) === NoMode) { return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, // TODO: When we delete legacy mode, we should make this error argument // required — every concurrent mode path that causes hydration to // de-opt to client rendering should have an error message. null); } if (isSuspenseInstanceFallback(suspenseInstance)) { // This boundary is in a permanent fallback state. In this case, we'll never // get an update and we'll never be able to hydrate the final content. Let's just try the // client side render instead. var digest, message, stack; { var _getSuspenseInstanceF = getSuspenseInstanceFallbackErrorDetails(suspenseInstance); digest = _getSuspenseInstanceF.digest; message = _getSuspenseInstanceF.message; stack = _getSuspenseInstanceF.stack; } var error; if (message) { // eslint-disable-next-line react-internal/prod-error-codes error = new Error(message); } else { error = new Error('The server could not finish this Suspense boundary, likely ' + 'due to an error during server rendering. Switched to ' + 'client rendering.'); } var capturedValue = createCapturedValue(error, digest, stack); return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, capturedValue); } // any context has changed, we need to treat is as if the input might have changed. var hasContextChanged = includesSomeLane(renderLanes, current.childLanes); if (didReceiveUpdate || hasContextChanged) { // This boundary has changed since the first render. This means that we are now unable to // hydrate it. We might still be able to hydrate it using a higher priority lane. var root = getWorkInProgressRoot(); if (root !== null) { var attemptHydrationAtLane = getBumpedLaneForHydration(root, renderLanes); if (attemptHydrationAtLane !== NoLane && attemptHydrationAtLane !== suspenseState.retryLane) { // Intentionally mutating since this render will get interrupted. This // is one of the very rare times where we mutate the current tree // during the render phase. suspenseState.retryLane = attemptHydrationAtLane; // TODO: Ideally this would inherit the event time of the current render var eventTime = NoTimestamp; enqueueConcurrentRenderForLane(current, attemptHydrationAtLane); scheduleUpdateOnFiber(root, current, attemptHydrationAtLane, eventTime); } } // If we have scheduled higher pri work above, this will probably just abort the render // since we now have higher priority work, but in case it doesn't, we need to prepare to // render something, if we time out. Even if that requires us to delete everything and // skip hydration. // Delay having to do this as long as the suspense timeout allows us. renderDidSuspendDelayIfPossible(); var _capturedValue = createCapturedValue(new Error('This Suspense boundary received an update before it finished ' + 'hydrating. This caused the boundary to switch to client rendering. ' + 'The usual way to fix this is to wrap the original update ' + 'in startTransition.')); return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, _capturedValue); } else if (isSuspenseInstancePending(suspenseInstance)) { // This component is still pending more data from the server, so we can't hydrate its // content. We treat it as if this component suspended itself. It might seem as if // we could just try to render it client-side instead. However, this will perform a // lot of unnecessary work and is unlikely to complete since it often will suspend // on missing data anyway. Additionally, the server might be able to render more // than we can on the client yet. In that case we'd end up with more fallback states // on the client than if we just leave it alone. If the server times out or errors // these should update this boundary to the permanent Fallback state instead. // Mark it as having captured (i.e. suspended). workInProgress.flags |= DidCapture; // Leave the child in place. I.e. the dehydrated fragment. workInProgress.child = current.child; // Register a callback to retry this boundary once the server has sent the result. var retry = retryDehydratedSuspenseBoundary.bind(null, current); registerSuspenseInstanceRetry(suspenseInstance, retry); return null; } else { // This is the first attempt. reenterHydrationStateFromDehydratedSuspenseInstance(workInProgress, suspenseInstance, suspenseState.treeContext); var primaryChildren = nextProps.children; var primaryChildFragment = mountSuspensePrimaryChildren(workInProgress, primaryChildren); // Mark the children as hydrating. This is a fast path to know whether this // tree is part of a hydrating tree. This is used to determine if a child // node has fully mounted yet, and for scheduling event replaying. // Conceptually this is similar to Placement in that a new subtree is // inserted into the React tree here. It just happens to not need DOM // mutations because it already exists. primaryChildFragment.flags |= Hydrating; return primaryChildFragment; } } else { // This is the second render pass. We already attempted to hydrated, but // something either suspended or errored. if (workInProgress.flags & ForceClientRender) { // Something errored during hydration. Try again without hydrating. workInProgress.flags &= ~ForceClientRender; var _capturedValue2 = createCapturedValue(new Error('There was an error while hydrating this Suspense boundary. ' + 'Switched to client rendering.')); return retrySuspenseComponentWithoutHydrating(current, workInProgress, renderLanes, _capturedValue2); } else if (workInProgress.memoizedState !== null) { // Something suspended and we should still be in dehydrated mode. // Leave the existing child in place. workInProgress.child = current.child; // The dehydrated completion pass expects this flag to be there // but the normal suspense pass doesn't. workInProgress.flags |= DidCapture; return null; } else { // Suspended but we should no longer be in dehydrated mode. // Therefore we now have to render the fallback. var nextPrimaryChildren = nextProps.children; var nextFallbackChildren = nextProps.fallback; var fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(current, workInProgress, nextPrimaryChildren, nextFallbackChildren, renderLanes); var _primaryChildFragment4 = workInProgress.child; _primaryChildFragment4.memoizedState = mountSuspenseOffscreenState(renderLanes); workInProgress.memoizedState = SUSPENDED_MARKER; return fallbackChildFragment; } } } function scheduleSuspenseWorkOnFiber(fiber, renderLanes, propagationRoot) { fiber.lanes = mergeLanes(fiber.lanes, renderLanes); var alternate = fiber.alternate; if (alternate !== null) { alternate.lanes = mergeLanes(alternate.lanes, renderLanes); } scheduleContextWorkOnParentPath(fiber.return, renderLanes, propagationRoot); } function propagateSuspenseContextChange(workInProgress, firstChild, renderLanes) { // Mark any Suspense boundaries with fallbacks as having work to do. // If they were previously forced into fallbacks, they may now be able // to unblock. var node = firstChild; while (node !== null) { if (node.tag === SuspenseComponent) { var state = node.memoizedState; if (state !== null) { scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress); } } else if (node.tag === SuspenseListComponent) { // If the tail is hidden there might not be an Suspense boundaries // to schedule work on. In this case we have to schedule it on the // list itself. // We don't have to traverse to the children of the list since // the list will propagate the change when it rerenders. scheduleSuspenseWorkOnFiber(node, renderLanes, workInProgress); } else if (node.child !== null) { node.child.return = node; node = node.child; continue; } if (node === workInProgress) { return; } while (node.sibling === null) { if (node.return === null || node.return === workInProgress) { return; } node = node.return; } node.sibling.return = node.return; node = node.sibling; } } function findLastContentRow(firstChild) { // This is going to find the last row among these children that is already // showing content on the screen, as opposed to being in fallback state or // new. If a row has multiple Suspense boundaries, any of them being in the // fallback state, counts as the whole row being in a fallback state. // Note that the "rows" will be workInProgress, but any nested children // will still be current since we haven't rendered them yet. The mounted // order may not be the same as the new order. We use the new order. var row = firstChild; var lastContentRow = null; while (row !== null) { var currentRow = row.alternate; // New rows can't be content rows. if (currentRow !== null && findFirstSuspended(currentRow) === null) { lastContentRow = row; } row = row.sibling; } return lastContentRow; } function validateRevealOrder(revealOrder) { { if (revealOrder !== undefined && revealOrder !== 'forwards' && revealOrder !== 'backwards' && revealOrder !== 'together' && !didWarnAboutRevealOrder[revealOrder]) { didWarnAboutRevealOrder[revealOrder] = true; if (typeof revealOrder === 'string') { switch (revealOrder.toLowerCase()) { case 'together': case 'forwards': case 'backwards': { error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'Use lowercase "%s" instead.', revealOrder, revealOrder.toLowerCase()); break; } case 'forward': case 'backward': { error('"%s" is not a valid value for revealOrder on <SuspenseList />. ' + 'React uses the -s suffix in the spelling. Use "%ss" instead.', revealOrder, revealOrder.toLowerCase()); break; } default: error('"%s" is not a supported revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder); break; } } else { error('%s is not a supported value for revealOrder on <SuspenseList />. ' + 'Did you mean "together", "forwards" or "backwards"?', revealOrder); } } } } function validateTailOptions(tailMode, revealOrder) { { if (tailMode !== undefined && !didWarnAboutTailOptions[tailMode]) { if (tailMode !== 'collapsed' && tailMode !== 'hidden') { didWarnAboutTailOptions[tailMode] = true; error('"%s" is not a supported value for tail on <SuspenseList />. ' + 'Did you mean "collapsed" or "hidden"?', tailMode); } else if (revealOrder !== 'forwards' && revealOrder !== 'backwards') { didWarnAboutTailOptions[tailMode] = true; error('<SuspenseList tail="%s" /> is only valid if revealOrder is ' + '"forwards" or "backwards". ' + 'Did you mean to specify revealOrder="forwards"?', tailMode); } } } } function validateSuspenseListNestedChild(childSlot, index) { { var isAnArray = isArray(childSlot); var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === 'function'; if (isAnArray || isIterable) { var type = isAnArray ? 'array' : 'iterable'; error('A nested %s was passed to row #%s in <SuspenseList />. Wrap it in ' + 'an additional SuspenseList to configure its revealOrder: ' + '<SuspenseList revealOrder=...> ... ' + '<SuspenseList revealOrder=...>{%s}</SuspenseList> ... ' + '</SuspenseList>', type, index, type); return false; } } return true; } function validateSuspenseListChildren(children, revealOrder) { { if ((revealOrder === 'forwards' || revealOrder === 'backwards') && children !== undefined && children !== null && children !== false) { if (isArray(children)) { for (var i = 0; i < children.length; i++) { if (!validateSuspenseListNestedChild(children[i], i)) { return; } } } else { var iteratorFn = getIteratorFn(children); if (typeof iteratorFn === 'function') { var childrenIterator = iteratorFn.call(children); if (childrenIterator) { var step = childrenIterator.next(); var _i = 0; for (; !step.done; step = childrenIterator.next()) { if (!validateSuspenseListNestedChild(step.value, _i)) { return; } _i++; } } } else { error('A single row was passed to a <SuspenseList revealOrder="%s" />. ' + 'This is not useful since it needs multiple rows. ' + 'Did you mean to pass multiple children or an array?', revealOrder); } } } } } function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode) { var renderState = workInProgress.memoizedState; if (renderState === null) { workInProgress.memoizedState = { isBackwards: isBackwards, rendering: null, renderingStartTime: 0, last: lastContentRow, tail: tail, tailMode: tailMode }; } else { // We can reuse the existing object from previous renders. renderState.isBackwards = isBackwards; renderState.rendering = null; renderState.renderingStartTime = 0; renderState.last = lastContentRow; renderState.tail = tail; renderState.tailMode = tailMode; } } // This can end up rendering this component multiple passes. // The first pass splits the children fibers into two sets. A head and tail. // We first render the head. If anything is in fallback state, we do another // pass through beginWork to rerender all children (including the tail) with // the force suspend context. If the first render didn't have anything in // in fallback state. Then we render each row in the tail one-by-one. // That happens in the completeWork phase without going back to beginWork. function updateSuspenseListComponent(current, workInProgress, renderLanes) { var nextProps = workInProgress.pendingProps; var revealOrder = nextProps.revealOrder; var tailMode = nextProps.tail; var newChildren = nextProps.children; validateRevealOrder(revealOrder); validateTailOptions(tailMode, revealOrder); validateSuspenseListChildren(newChildren, revealOrder); reconcileChildren(current, workInProgress, newChildren, renderLanes); var suspenseContext = suspenseStackCursor.current; var shouldForceFallback = hasSuspenseContext(suspenseContext, ForceSuspenseFallback); if (shouldForceFallback) { suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); workInProgress.flags |= DidCapture; } else { var didSuspendBefore = current !== null && (current.flags & DidCapture) !== NoFlags; if (didSuspendBefore) { // If we previously forced a fallback, we need to schedule work // on any nested boundaries to let them know to try to render // again. This is the same as context updating. propagateSuspenseContextChange(workInProgress, workInProgress.child, renderLanes); } suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); } pushSuspenseContext(workInProgress, suspenseContext); if ((workInProgress.mode & ConcurrentMode) === NoMode) { // In legacy mode, SuspenseList doesn't work so we just // use make it a noop by treating it as the default revealOrder. workInProgress.memoizedState = null; } else { switch (revealOrder) { case 'forwards': { var lastContentRow = findLastContentRow(workInProgress.child); var tail; if (lastContentRow === null) { // The whole list is part of the tail. // TODO: We could fast path by just rendering the tail now. tail = workInProgress.child; workInProgress.child = null; } else { // Disconnect the tail rows after the content row. // We're going to render them separately later. tail = lastContentRow.sibling; lastContentRow.sibling = null; } initSuspenseListRenderState(workInProgress, false, // isBackwards tail, lastContentRow, tailMode); break; } case 'backwards': { // We're going to find the first row that has existing content. // At the same time we're going to reverse the list of everything // we pass in the meantime. That's going to be our tail in reverse // order. var _tail = null; var row = workInProgress.child; workInProgress.child = null; while (row !== null) { var currentRow = row.alternate; // New rows can't be content rows. if (currentRow !== null && findFirstSuspended(currentRow) === null) { // This is the beginning of the main content. workInProgress.child = row; break; } var nextRow = row.sibling; row.sibling = _tail; _tail = row; row = nextRow; } // TODO: If workInProgress.child is null, we can continue on the tail immediately. initSuspenseListRenderState(workInProgress, true, // isBackwards _tail, null, // last tailMode); break; } case 'together': { initSuspenseListRenderState(workInProgress, false, // isBackwards null, // tail null, // last undefined); break; } default: { // The default reveal order is the same as not having // a boundary. workInProgress.memoizedState = null; } } } return workInProgress.child; } function updatePortalComponent(current, workInProgress, renderLanes) { pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); var nextChildren = workInProgress.pendingProps; if (current === null) { // Portals are special because we don't append the children during mount // but at commit. Therefore we need to track insertions which the normal // flow doesn't do during mount. This doesn't happen at the root because // the root always starts with a "current" with a null child. // TODO: Consider unifying this with how the root works. workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes); } else { reconcileChildren(current, workInProgress, nextChildren, renderLanes); } return workInProgress.child; } var hasWarnedAboutUsingNoValuePropOnContextProvider = false; function updateContextProvider(current, workInProgress, renderLanes) { var providerType = workInProgress.type; var context = providerType._context; var newProps = workInProgress.pendingProps; var oldProps = workInProgress.memoizedProps; var newValue = newProps.value; { if (!('value' in newProps)) { if (!hasWarnedAboutUsingNoValuePropOnContextProvider) { hasWarnedAboutUsingNoValuePropOnContextProvider = true; error('The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?'); } } var providerPropTypes = workInProgress.type.propTypes; if (providerPropTypes) { checkPropTypes(providerPropTypes, newProps, 'prop', 'Context.Provider'); } } pushProvider(workInProgress, context, newValue); { if (oldProps !== null) { var oldValue = oldProps.value; if (objectIs(oldValue, newValue)) { // No change. Bailout early if children are the same. if (oldProps.children === newProps.children && !hasContextChanged()) { return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } } else { // The context value changed. Search for matching consumers and schedule // them to update. propagateContextChange(workInProgress, context, renderLanes); } } } var newChildren = newProps.children; reconcileChildren(current, workInProgress, newChildren, renderLanes); return workInProgress.child; } var hasWarnedAboutUsingContextAsConsumer = false; function updateContextConsumer(current, workInProgress, renderLanes) { var context = workInProgress.type; // The logic below for Context differs depending on PROD or DEV mode. In // DEV mode, we create a separate object for Context.Consumer that acts // like a proxy to Context. This proxy object adds unnecessary code in PROD // so we use the old behaviour (Context.Consumer references Context) to // reduce size and overhead. The separate object references context via // a property called "_context", which also gives us the ability to check // in DEV mode if this property exists or not and warn if it does not. { if (context._context === undefined) { // This may be because it's a Context (rather than a Consumer). // Or it may be because it's older React where they're the same thing. // We only want to warn if we're sure it's a new React. if (context !== context.Consumer) { if (!hasWarnedAboutUsingContextAsConsumer) { hasWarnedAboutUsingContextAsConsumer = true; error('Rendering <Context> directly is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?'); } } } else { context = context._context; } } var newProps = workInProgress.pendingProps; var render = newProps.children; { if (typeof render !== 'function') { error('A context consumer was rendered with multiple children, or a child ' + "that isn't a function. A context consumer expects a single child " + 'that is a function. If you did pass a function, make sure there ' + 'is no trailing or leading whitespace around it.'); } } prepareToReadContext(workInProgress, renderLanes); var newValue = readContext(context); { markComponentRenderStarted(workInProgress); } var newChildren; { ReactCurrentOwner$1.current = workInProgress; setIsRendering(true); newChildren = render(newValue); setIsRendering(false); } { markComponentRenderStopped(); } // React DevTools reads this flag. workInProgress.flags |= PerformedWork; reconcileChildren(current, workInProgress, newChildren, renderLanes); return workInProgress.child; } function markWorkInProgressReceivedUpdate() { didReceiveUpdate = true; } function resetSuspendedCurrentOnMountInLegacyMode(current, workInProgress) { if ((workInProgress.mode & ConcurrentMode) === NoMode) { if (current !== null) { // A lazy component only mounts if it suspended inside a non- // concurrent tree, in an inconsistent state. We want to treat it like // a new mount, even though an empty version of it already committed. // Disconnect the alternate pointers. current.alternate = null; workInProgress.alternate = null; // Since this is conceptually a new fiber, schedule a Placement effect workInProgress.flags |= Placement; } } } function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { if (current !== null) { // Reuse previous dependencies workInProgress.dependencies = current.dependencies; } { // Don't update "base" render times for bailouts. stopProfilerTimerIfRunning(); } markSkippedUpdateLanes(workInProgress.lanes); // Check if the children have any pending work. if (!includesSomeLane(renderLanes, workInProgress.childLanes)) { // The children don't have any work either. We can skip them. // TODO: Once we add back resuming, we should check if the children are // a work-in-progress set. If so, we need to transfer their effects. { return null; } } // This fiber doesn't have work, but its subtree does. Clone the child // fibers and continue. cloneChildFibers(current, workInProgress); return workInProgress.child; } function remountFiber(current, oldWorkInProgress, newWorkInProgress) { { var returnFiber = oldWorkInProgress.return; if (returnFiber === null) { // eslint-disable-next-line react-internal/prod-error-codes throw new Error('Cannot swap the root fiber.'); } // Disconnect from the old current. // It will get deleted. current.alternate = null; oldWorkInProgress.alternate = null; // Connect to the new tree. newWorkInProgress.index = oldWorkInProgress.index; newWorkInProgress.sibling = oldWorkInProgress.sibling; newWorkInProgress.return = oldWorkInProgress.return; newWorkInProgress.ref = oldWorkInProgress.ref; // Replace the child/sibling pointers above it. if (oldWorkInProgress === returnFiber.child) { returnFiber.child = newWorkInProgress; } else { var prevSibling = returnFiber.child; if (prevSibling === null) { // eslint-disable-next-line react-internal/prod-error-codes throw new Error('Expected parent to have a child.'); } while (prevSibling.sibling !== oldWorkInProgress) { prevSibling = prevSibling.sibling; if (prevSibling === null) { // eslint-disable-next-line react-internal/prod-error-codes throw new Error('Expected to find the previous sibling.'); } } prevSibling.sibling = newWorkInProgress; } // Delete the old fiber and place the new one. // Since the old fiber is disconnected, we have to schedule it manually. var deletions = returnFiber.deletions; if (deletions === null) { returnFiber.deletions = [current]; returnFiber.flags |= ChildDeletion; } else { deletions.push(current); } newWorkInProgress.flags |= Placement; // Restart work from the new fiber. return newWorkInProgress; } } function checkScheduledUpdateOrContext(current, renderLanes) { // Before performing an early bailout, we must check if there are pending // updates or context. var updateLanes = current.lanes; if (includesSomeLane(updateLanes, renderLanes)) { return true; } // No pending update, but because context is propagated lazily, we need return false; } function attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes) { // This fiber does not have any pending work. Bailout without entering // the begin phase. There's still some bookkeeping we that needs to be done // in this optimized path, mostly pushing stuff onto the stack. switch (workInProgress.tag) { case HostRoot: pushHostRootContext(workInProgress); var root = workInProgress.stateNode; resetHydrationState(); break; case HostComponent: pushHostContext(workInProgress); break; case ClassComponent: { var Component = workInProgress.type; if (isContextProvider(Component)) { pushContextProvider(workInProgress); } break; } case HostPortal: pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); break; case ContextProvider: { var newValue = workInProgress.memoizedProps.value; var context = workInProgress.type._context; pushProvider(workInProgress, context, newValue); break; } case Profiler: { // Profiler should only call onRender when one of its descendants actually rendered. var hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes); if (hasChildWork) { workInProgress.flags |= Update; } { // Reset effect durations for the next eventual effect phase. // These are reset during render to allow the DevTools commit hook a chance to read them, var stateNode = workInProgress.stateNode; stateNode.effectDuration = 0; stateNode.passiveEffectDuration = 0; } } break; case SuspenseComponent: { var state = workInProgress.memoizedState; if (state !== null) { if (state.dehydrated !== null) { pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // We know that this component will suspend again because if it has // been unsuspended it has committed as a resolved Suspense component. // If it needs to be retried, it should have work scheduled on it. workInProgress.flags |= DidCapture; // We should never render the children of a dehydrated boundary until we // upgrade it. We return null instead of bailoutOnAlreadyFinishedWork. return null; } // If this boundary is currently timed out, we need to decide // whether to retry the primary children, or to skip over it and // go straight to the fallback. Check the priority of the primary // child fragment. var primaryChildFragment = workInProgress.child; var primaryChildLanes = primaryChildFragment.childLanes; if (includesSomeLane(renderLanes, primaryChildLanes)) { // The primary children have pending work. Use the normal path // to attempt to render the primary children again. return updateSuspenseComponent(current, workInProgress, renderLanes); } else { // The primary child fragment does not have pending work marked // on it pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); // The primary children do not have pending work with sufficient // priority. Bailout. var child = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); if (child !== null) { // The fallback children have pending work. Skip over the // primary children and work on the fallback. return child.sibling; } else { // Note: We can return `null` here because we already checked // whether there were nested context consumers, via the call to // `bailoutOnAlreadyFinishedWork` above. return null; } } } else { pushSuspenseContext(workInProgress, setDefaultShallowSuspenseContext(suspenseStackCursor.current)); } break; } case SuspenseListComponent: { var didSuspendBefore = (current.flags & DidCapture) !== NoFlags; var _hasChildWork = includesSomeLane(renderLanes, workInProgress.childLanes); if (didSuspendBefore) { if (_hasChildWork) { // If something was in fallback state last time, and we have all the // same children then we're still in progressive loading state. // Something might get unblocked by state updates or retries in the // tree which will affect the tail. So we need to use the normal // path to compute the correct tail. return updateSuspenseListComponent(current, workInProgress, renderLanes); } // If none of the children had any work, that means that none of // them got retried so they'll still be blocked in the same way // as before. We can fast bail out. workInProgress.flags |= DidCapture; } // If nothing suspended before and we're rendering the same children, // then the tail doesn't matter. Anything new that suspends will work // in the "together" mode, so we can continue from the state we had. var renderState = workInProgress.memoizedState; if (renderState !== null) { // Reset to the "together" mode in case we've started a different // update in the past but didn't complete it. renderState.rendering = null; renderState.tail = null; renderState.lastEffect = null; } pushSuspenseContext(workInProgress, suspenseStackCursor.current); if (_hasChildWork) { break; } else { // If none of the children had any work, that means that none of // them got retried so they'll still be blocked in the same way // as before. We can fast bail out. return null; } } case OffscreenComponent: case LegacyHiddenComponent: { // Need to check if the tree still needs to be deferred. This is // almost identical to the logic used in the normal update path, // so we'll just enter that. The only difference is we'll bail out // at the next level instead of this one, because the child props // have not changed. Which is fine. // TODO: Probably should refactor `beginWork` to split the bailout // path from the normal path. I'm tempted to do a labeled break here // but I won't :) workInProgress.lanes = NoLanes; return updateOffscreenComponent(current, workInProgress, renderLanes); } } return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); } function beginWork(current, workInProgress, renderLanes) { { if (workInProgress._debugNeedsRemount && current !== null) { // This will restart the begin phase with a new fiber. return remountFiber(current, workInProgress, createFiberFromTypeAndProps(workInProgress.type, workInProgress.key, workInProgress.pendingProps, workInProgress._debugOwner || null, workInProgress.mode, workInProgress.lanes)); } } if (current !== null) { var oldProps = current.memoizedProps; var newProps = workInProgress.pendingProps; if (oldProps !== newProps || hasContextChanged() || ( // Force a re-render if the implementation changed due to hot reload: workInProgress.type !== current.type )) { // If props or context changed, mark the fiber as having performed work. // This may be unset if the props are determined to be equal later (memo). didReceiveUpdate = true; } else { // Neither props nor legacy context changes. Check if there's a pending // update or context change. var hasScheduledUpdateOrContext = checkScheduledUpdateOrContext(current, renderLanes); if (!hasScheduledUpdateOrContext && // If this is the second pass of an error or suspense boundary, there // may not be work scheduled on `current`, so we check for this flag. (workInProgress.flags & DidCapture) === NoFlags) { // No pending updates or context. Bail out now. didReceiveUpdate = false; return attemptEarlyBailoutIfNoScheduledUpdate(current, workInProgress, renderLanes); } if ((current.flags & ForceUpdateForLegacySuspense) !== NoFlags) { // This is a special case that only exists for legacy mode. // See https://github.com/facebook/react/pull/19216. didReceiveUpdate = true; } else { // An update was scheduled on this fiber, but there are no new props // nor legacy context. Set this to false. If an update queue or context // consumer produces a changed value, it will set this to true. Otherwise, // the component will assume the children have not changed and bail out. didReceiveUpdate = false; } } } else { didReceiveUpdate = false; if (getIsHydrating() && isForkedChild(workInProgress)) { // Check if this child belongs to a list of muliple children in // its parent. // // In a true multi-threaded implementation, we would render children on // parallel threads. This would represent the beginning of a new render // thread for this subtree. // // We only use this for id generation during hydration, which is why the // logic is located in this special branch. var slotIndex = workInProgress.index; var numberOfForks = getForksAtLevel(); pushTreeId(workInProgress, numberOfForks, slotIndex); } } // Before entering the begin phase, clear pending update priority. // TODO: This assumes that we're about to evaluate the component and process // the update queue. However, there's an exception: SimpleMemoComponent // sometimes bails out later in the begin phase. This indicates that we should // move this assignment out of the common path and into each branch. workInProgress.lanes = NoLanes; switch (workInProgress.tag) { case IndeterminateComponent: { return mountIndeterminateComponent(current, workInProgress, workInProgress.type, renderLanes); } case LazyComponent: { var elementType = workInProgress.elementType; return mountLazyComponent(current, workInProgress, elementType, renderLanes); } case FunctionComponent: { var Component = workInProgress.type; var unresolvedProps = workInProgress.pendingProps; var resolvedProps = workInProgress.elementType === Component ? unresolvedProps : resolveDefaultProps(Component, unresolvedProps); return updateFunctionComponent(current, workInProgress, Component, resolvedProps, renderLanes); } case ClassComponent: { var _Component = workInProgress.type; var _unresolvedProps = workInProgress.pendingProps; var _resolvedProps = workInProgress.elementType === _Component ? _unresolvedProps : resolveDefaultProps(_Component, _unresolvedProps); return updateClassComponent(current, workInProgress, _Component, _resolvedProps, renderLanes); } case HostRoot: return updateHostRoot(current, workInProgress, renderLanes); case HostComponent: return updateHostComponent(current, workInProgress, renderLanes); case HostText: return updateHostText(current, workInProgress); case SuspenseComponent: return updateSuspenseComponent(current, workInProgress, renderLanes); case HostPortal: return updatePortalComponent(current, workInProgress, renderLanes); case ForwardRef: { var type = workInProgress.type; var _unresolvedProps2 = workInProgress.pendingProps; var _resolvedProps2 = workInProgress.elementType === type ? _unresolvedProps2 : resolveDefaultProps(type, _unresolvedProps2); return updateForwardRef(current, workInProgress, type, _resolvedProps2, renderLanes); } case Fragment: return updateFragment(current, workInProgress, renderLanes); case Mode: return updateMode(current, workInProgress, renderLanes); case Profiler: return updateProfiler(current, workInProgress, renderLanes); case ContextProvider: return updateContextProvider(current, workInProgress, renderLanes); case ContextConsumer: return updateContextConsumer(current, workInProgress, renderLanes); case MemoComponent: { var _type2 = workInProgress.type; var _unresolvedProps3 = workInProgress.pendingProps; // Resolve outer props first, then resolve inner props. var _resolvedProps3 = resolveDefaultProps(_type2, _unresolvedProps3); { if (workInProgress.type !== workInProgress.elementType) { var outerPropTypes = _type2.propTypes; if (outerPropTypes) { checkPropTypes(outerPropTypes, _resolvedProps3, // Resolved for outer only 'prop', getComponentNameFromType(_type2)); } } } _resolvedProps3 = resolveDefaultProps(_type2.type, _resolvedProps3); return updateMemoComponent(current, workInProgress, _type2, _resolvedProps3, renderLanes); } case SimpleMemoComponent: { return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, renderLanes); } case IncompleteClassComponent: { var _Component2 = workInProgress.type; var _unresolvedProps4 = workInProgress.pendingProps; var _resolvedProps4 = workInProgress.elementType === _Component2 ? _unresolvedProps4 : resolveDefaultProps(_Component2, _unresolvedProps4); return mountIncompleteClassComponent(current, workInProgress, _Component2, _resolvedProps4, renderLanes); } case SuspenseListComponent: { return updateSuspenseListComponent(current, workInProgress, renderLanes); } case ScopeComponent: { break; } case OffscreenComponent: { return updateOffscreenComponent(current, workInProgress, renderLanes); } } throw new Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in " + 'React. Please file an issue.'); } function markUpdate(workInProgress) { // Tag the fiber with an update effect. This turns a Placement into // a PlacementAndUpdate. workInProgress.flags |= Update; } function markRef$1(workInProgress) { workInProgress.flags |= Ref; { workInProgress.flags |= RefStatic; } } var appendAllChildren; var updateHostContainer; var updateHostComponent$1; var updateHostText$1; { // Mutation mode appendAllChildren = function (parent, workInProgress, needsVisibilityToggle, isHidden) { // We only have the top Fiber that was created but we need recurse down its // children to find all the terminal nodes. var node = workInProgress.child; while (node !== null) { if (node.tag === HostComponent || node.tag === HostText) { appendInitialChild(parent, node.stateNode); } else if (node.tag === HostPortal) ; else if (node.child !== null) { node.child.return = node; node = node.child; continue; } if (node === workInProgress) { return; } while (node.sibling === null) { if (node.return === null || node.return === workInProgress) { return; } node = node.return; } node.sibling.return = node.return; node = node.sibling; } }; updateHostContainer = function (current, workInProgress) {// Noop }; updateHostComponent$1 = function (current, workInProgress, type, newProps, rootContainerInstance) { // If we have an alternate, that means this is an update and we need to // schedule a side-effect to do the updates. var oldProps = current.memoizedProps; if (oldProps === newProps) { // In mutation mode, this is sufficient for a bailout because // we won't touch this node even if children changed. return; } // If we get updated because one of our children updated, we don't // have newProps so we'll have to reuse them. // TODO: Split the update API as separate for the props vs. children. // Even better would be if children weren't special cased at all tho. var instance = workInProgress.stateNode; var currentHostContext = getHostContext(); // TODO: Experiencing an error where oldProps is null. Suggests a host // component is hitting the resume path. Figure out why. Possibly // related to `hidden`. var updatePayload = prepareUpdate(instance, type, oldProps, newProps, rootContainerInstance, currentHostContext); // TODO: Type this specific to this type of component. workInProgress.updateQueue = updatePayload; // If the update payload indicates that there is a change or if there // is a new ref we mark this as an update. All the work is done in commitWork. if (updatePayload) { markUpdate(workInProgress); } }; updateHostText$1 = function (current, workInProgress, oldText, newText) { // If the text differs, mark it as an update. All the work in done in commitWork. if (oldText !== newText) { markUpdate(workInProgress); } }; } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (getIsHydrating()) { // If we're hydrating, we should consume as many items as we can // so we don't leave any behind. return; } switch (renderState.tailMode) { case 'hidden': { // Any insertions at the end of the tail list after this point // should be invisible. If there are already mounted boundaries // anything before them are not considered for collapsing. // Therefore we need to go through the whole tail to find if // there are any. var tailNode = renderState.tail; var lastTailNode = null; while (tailNode !== null) { if (tailNode.alternate !== null) { lastTailNode = tailNode; } tailNode = tailNode.sibling; } // Next we're simply going to delete all insertions after the // last rendered item. if (lastTailNode === null) { // All remaining items in the tail are insertions. renderState.tail = null; } else { // Detach the insertion after the last node that was already // inserted. lastTailNode.sibling = null; } break; } case 'collapsed': { // Any insertions at the end of the tail list after this point // should be invisible. If there are already mounted boundaries // anything before them are not considered for collapsing. // Therefore we need to go through the whole tail to find if // there are any. var _tailNode = renderState.tail; var _lastTailNode = null; while (_tailNode !== null) { if (_tailNode.alternate !== null) { _lastTailNode = _tailNode; } _tailNode = _tailNode.sibling; } // Next we're simply going to delete all insertions after the // last rendered item. if (_lastTailNode === null) { // All remaining items in the tail are insertions. if (!hasRenderedATailFallback && renderState.tail !== null) { // We suspended during the head. We want to show at least one // row at the tail. So we'll keep on and cut off the rest. renderState.tail.sibling = null; } else { renderState.tail = null; } } else { // Detach the insertion after the last node that was already // inserted. _lastTailNode.sibling = null; } break; } } } function bubbleProperties(completedWork) { var didBailout = completedWork.alternate !== null && completedWork.alternate.child === completedWork.child; var newChildLanes = NoLanes; var subtreeFlags = NoFlags; if (!didBailout) { // Bubble up the earliest expiration time. if ( (completedWork.mode & ProfileMode) !== NoMode) { // In profiling mode, resetChildExpirationTime is also used to reset // profiler durations. var actualDuration = completedWork.actualDuration; var treeBaseDuration = completedWork.selfBaseDuration; var child = completedWork.child; while (child !== null) { newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes)); subtreeFlags |= child.subtreeFlags; subtreeFlags |= child.flags; // When a fiber is cloned, its actualDuration is reset to 0. This value will // only be updated if work is done on the fiber (i.e. it doesn't bailout). // When work is done, it should bubble to the parent's actualDuration. If // the fiber has not been cloned though, (meaning no work was done), then // this value will reflect the amount of time spent working on a previous // render. In that case it should not bubble. We determine whether it was // cloned by comparing the child pointer. actualDuration += child.actualDuration; treeBaseDuration += child.treeBaseDuration; child = child.sibling; } completedWork.actualDuration = actualDuration; completedWork.treeBaseDuration = treeBaseDuration; } else { var _child = completedWork.child; while (_child !== null) { newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child.lanes, _child.childLanes)); subtreeFlags |= _child.subtreeFlags; subtreeFlags |= _child.flags; // Update the return pointer so the tree is consistent. This is a code // smell because it assumes the commit phase is never concurrent with // the render phase. Will address during refactor to alternate model. _child.return = completedWork; _child = _child.sibling; } } completedWork.subtreeFlags |= subtreeFlags; } else { // Bubble up the earliest expiration time. if ( (completedWork.mode & ProfileMode) !== NoMode) { // In profiling mode, resetChildExpirationTime is also used to reset // profiler durations. var _treeBaseDuration = completedWork.selfBaseDuration; var _child2 = completedWork.child; while (_child2 !== null) { newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child2.lanes, _child2.childLanes)); // "Static" flags share the lifetime of the fiber/hook they belong to, // so we should bubble those up even during a bailout. All the other // flags have a lifetime only of a single render + commit, so we should // ignore them. subtreeFlags |= _child2.subtreeFlags & StaticMask; subtreeFlags |= _child2.flags & StaticMask; _treeBaseDuration += _child2.treeBaseDuration; _child2 = _child2.sibling; } completedWork.treeBaseDuration = _treeBaseDuration; } else { var _child3 = completedWork.child; while (_child3 !== null) { newChildLanes = mergeLanes(newChildLanes, mergeLanes(_child3.lanes, _child3.childLanes)); // "Static" flags share the lifetime of the fiber/hook they belong to, // so we should bubble those up even during a bailout. All the other // flags have a lifetime only of a single render + commit, so we should // ignore them. subtreeFlags |= _child3.subtreeFlags & StaticMask; subtreeFlags |= _child3.flags & StaticMask; // Update the return pointer so the tree is consistent. This is a code // smell because it assumes the commit phase is never concurrent with // the render phase. Will address during refactor to alternate model. _child3.return = completedWork; _child3 = _child3.sibling; } } completedWork.subtreeFlags |= subtreeFlags; } completedWork.childLanes = newChildLanes; return didBailout; } function completeDehydratedSuspenseBoundary(current, workInProgress, nextState) { if (hasUnhydratedTailNodes() && (workInProgress.mode & ConcurrentMode) !== NoMode && (workInProgress.flags & DidCapture) === NoFlags) { warnIfUnhydratedTailNodes(workInProgress); resetHydrationState(); workInProgress.flags |= ForceClientRender | Incomplete | ShouldCapture; return false; } var wasHydrated = popHydrationState(workInProgress); if (nextState !== null && nextState.dehydrated !== null) { // We might be inside a hydration state the first time we're picking up this // Suspense boundary, and also after we've reentered it for further hydration. if (current === null) { if (!wasHydrated) { throw new Error('A dehydrated suspense component was completed without a hydrated node. ' + 'This is probably a bug in React.'); } prepareToHydrateHostSuspenseInstance(workInProgress); bubbleProperties(workInProgress); { if ((workInProgress.mode & ProfileMode) !== NoMode) { var isTimedOutSuspense = nextState !== null; if (isTimedOutSuspense) { // Don't count time spent in a timed out Suspense subtree as part of the base duration. var primaryChildFragment = workInProgress.child; if (primaryChildFragment !== null) { // $FlowFixMe Flow doesn't support type casting in combination with the -= operator workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration; } } } } return false; } else { // We might have reentered this boundary to hydrate it. If so, we need to reset the hydration // state since we're now exiting out of it. popHydrationState doesn't do that for us. resetHydrationState(); if ((workInProgress.flags & DidCapture) === NoFlags) { // This boundary did not suspend so it's now hydrated and unsuspended. workInProgress.memoizedState = null; } // If nothing suspended, we need to schedule an effect to mark this boundary // as having hydrated so events know that they're free to be invoked. // It's also a signal to replay events and the suspense callback. // If something suspended, schedule an effect to attach retry listeners. // So we might as well always mark this. workInProgress.flags |= Update; bubbleProperties(workInProgress); { if ((workInProgress.mode & ProfileMode) !== NoMode) { var _isTimedOutSuspense = nextState !== null; if (_isTimedOutSuspense) { // Don't count time spent in a timed out Suspense subtree as part of the base duration. var _primaryChildFragment = workInProgress.child; if (_primaryChildFragment !== null) { // $FlowFixMe Flow doesn't support type casting in combination with the -= operator workInProgress.treeBaseDuration -= _primaryChildFragment.treeBaseDuration; } } } } return false; } } else { // Successfully completed this tree. If this was a forced client render, // there may have been recoverable errors during first hydration // attempt. If so, add them to a queue so we can log them in the // commit phase. upgradeHydrationErrorsToRecoverable(); // Fall through to normal Suspense path return true; } } function completeWork(current, workInProgress, renderLanes) { var newProps = workInProgress.pendingProps; // Note: This intentionally doesn't check if we're hydrating because comparing // to the current tree provider fiber is just as fast and less error-prone. // Ideally we would have a special version of the work loop only // for hydration. popTreeContext(workInProgress); switch (workInProgress.tag) { case IndeterminateComponent: case LazyComponent: case SimpleMemoComponent: case FunctionComponent: case ForwardRef: case Fragment: case Mode: case Profiler: case ContextConsumer: case MemoComponent: bubbleProperties(workInProgress); return null; case ClassComponent: { var Component = workInProgress.type; if (isContextProvider(Component)) { popContext(workInProgress); } bubbleProperties(workInProgress); return null; } case HostRoot: { var fiberRoot = workInProgress.stateNode; popHostContainer(workInProgress); popTopLevelContextObject(workInProgress); resetWorkInProgressVersions(); if (fiberRoot.pendingContext) { fiberRoot.context = fiberRoot.pendingContext; fiberRoot.pendingContext = null; } if (current === null || current.child === null) { // If we hydrated, pop so that we can delete any remaining children // that weren't hydrated. var wasHydrated = popHydrationState(workInProgress); if (wasHydrated) { // If we hydrated, then we'll need to schedule an update for // the commit side-effects on the root. markUpdate(workInProgress); } else { if (current !== null) { var prevState = current.memoizedState; if ( // Check if this is a client root !prevState.isDehydrated || // Check if we reverted to client rendering (e.g. due to an error) (workInProgress.flags & ForceClientRender) !== NoFlags) { // Schedule an effect to clear this container at the start of the // next commit. This handles the case of React rendering into a // container with previous children. It's also safe to do for // updates too, because current.child would only be null if the // previous render was null (so the container would already // be empty). workInProgress.flags |= Snapshot; // If this was a forced client render, there may have been // recoverable errors during first hydration attempt. If so, add // them to a queue so we can log them in the commit phase. upgradeHydrationErrorsToRecoverable(); } } } } updateHostContainer(current, workInProgress); bubbleProperties(workInProgress); return null; } case HostComponent: { popHostContext(workInProgress); var rootContainerInstance = getRootHostContainer(); var type = workInProgress.type; if (current !== null && workInProgress.stateNode != null) { updateHostComponent$1(current, workInProgress, type, newProps, rootContainerInstance); if (current.ref !== workInProgress.ref) { markRef$1(workInProgress); } } else { if (!newProps) { if (workInProgress.stateNode === null) { throw new Error('We must have new props for new mounts. This error is likely ' + 'caused by a bug in React. Please file an issue.'); } // This can happen when we abort work. bubbleProperties(workInProgress); return null; } var currentHostContext = getHostContext(); // TODO: Move createInstance to beginWork and keep it on a context // "stack" as the parent. Then append children as we go in beginWork // or completeWork depending on whether we want to add them top->down or // bottom->up. Top->down is faster in IE11. var _wasHydrated = popHydrationState(workInProgress); if (_wasHydrated) { // TODO: Move this and createInstance step into the beginPhase // to consolidate. if (prepareToHydrateHostInstance(workInProgress, rootContainerInstance, currentHostContext)) { // If changes to the hydrated node need to be applied at the // commit-phase we mark this as such. markUpdate(workInProgress); } } else { var instance = createInstance(type, newProps, rootContainerInstance, currentHostContext, workInProgress); appendAllChildren(instance, workInProgress, false, false); workInProgress.stateNode = instance; // Certain renderers require commit-time effects for initial mount. // (eg DOM renderer supports auto-focus for certain elements). // Make sure such renderers get scheduled for later work. if (finalizeInitialChildren(instance, type, newProps, rootContainerInstance)) { markUpdate(workInProgress); } } if (workInProgress.ref !== null) { // If there is a ref on a host node we need to schedule a callback markRef$1(workInProgress); } } bubbleProperties(workInProgress); return null; } case HostText: { var newText = newProps; if (current && workInProgress.stateNode != null) { var oldText = current.memoizedProps; // If we have an alternate, that means this is an update and we need // to schedule a side-effect to do the updates. updateHostText$1(current, workInProgress, oldText, newText); } else { if (typeof newText !== 'string') { if (workInProgress.stateNode === null) { throw new Error('We must have new props for new mounts. This error is likely ' + 'caused by a bug in React. Please file an issue.'); } // This can happen when we abort work. } var _rootContainerInstance = getRootHostContainer(); var _currentHostContext = getHostContext(); var _wasHydrated2 = popHydrationState(workInProgress); if (_wasHydrated2) { if (prepareToHydrateHostTextInstance(workInProgress)) { markUpdate(workInProgress); } } else { workInProgress.stateNode = createTextInstance(newText, _rootContainerInstance, _currentHostContext, workInProgress); } } bubbleProperties(workInProgress); return null; } case SuspenseComponent: { popSuspenseContext(workInProgress); var nextState = workInProgress.memoizedState; // Special path for dehydrated boundaries. We may eventually move this // to its own fiber type so that we can add other kinds of hydration // boundaries that aren't associated with a Suspense tree. In anticipation // of such a refactor, all the hydration logic is contained in // this branch. if (current === null || current.memoizedState !== null && current.memoizedState.dehydrated !== null) { var fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(current, workInProgress, nextState); if (!fallthroughToNormalSuspensePath) { if (workInProgress.flags & ShouldCapture) { // Special case. There were remaining unhydrated nodes. We treat // this as a mismatch. Revert to client rendering. return workInProgress; } else { // Did not finish hydrating, either because this is the initial // render or because something suspended. return null; } } // Continue with the normal Suspense path. } if ((workInProgress.flags & DidCapture) !== NoFlags) { // Something suspended. Re-render with the fallback children. workInProgress.lanes = renderLanes; // Do not reset the effect list. if ( (workInProgress.mode & ProfileMode) !== NoMode) { transferActualDuration(workInProgress); } // Don't bubble properties in this case. return workInProgress; } var nextDidTimeout = nextState !== null; var prevDidTimeout = current !== null && current.memoizedState !== null; // a passive effect, which is when we process the transitions if (nextDidTimeout !== prevDidTimeout) { // an effect to toggle the subtree's visibility. When we switch from // fallback -> primary, the inner Offscreen fiber schedules this effect // as part of its normal complete phase. But when we switch from // primary -> fallback, the inner Offscreen fiber does not have a complete // phase. So we need to schedule its effect here. // // We also use this flag to connect/disconnect the effects, but the same // logic applies: when re-connecting, the Offscreen fiber's complete // phase will handle scheduling the effect. It's only when the fallback // is active that we have to do anything special. if (nextDidTimeout) { var _offscreenFiber2 = workInProgress.child; _offscreenFiber2.flags |= Visibility; // TODO: This will still suspend a synchronous tree if anything // in the concurrent tree already suspended during this render. // This is a known bug. if ((workInProgress.mode & ConcurrentMode) !== NoMode) { // TODO: Move this back to throwException because this is too late // if this is a large tree which is common for initial loads. We // don't know if we should restart a render or not until we get // this marker, and this is too late. // If this render already had a ping or lower pri updates, // and this is the first time we know we're going to suspend we // should be able to immediately restart from within throwException. var hasInvisibleChildContext = current === null && (workInProgress.memoizedProps.unstable_avoidThisFallback !== true || !enableSuspenseAvoidThisFallback); if (hasInvisibleChildContext || hasSuspenseContext(suspenseStackCursor.current, InvisibleParentSuspenseContext)) { // If this was in an invisible tree or a new render, then showing // this boundary is ok. renderDidSuspend(); } else { // Otherwise, we're going to have to hide content so we should // suspend for longer if possible. renderDidSuspendDelayIfPossible(); } } } } var wakeables = workInProgress.updateQueue; if (wakeables !== null) { // Schedule an effect to attach a retry listener to the promise. // TODO: Move to passive phase workInProgress.flags |= Update; } bubbleProperties(workInProgress); { if ((workInProgress.mode & ProfileMode) !== NoMode) { if (nextDidTimeout) { // Don't count time spent in a timed out Suspense subtree as part of the base duration. var primaryChildFragment = workInProgress.child; if (primaryChildFragment !== null) { // $FlowFixMe Flow doesn't support type casting in combination with the -= operator workInProgress.treeBaseDuration -= primaryChildFragment.treeBaseDuration; } } } } return null; } case HostPortal: popHostContainer(workInProgress); updateHostContainer(current, workInProgress); if (current === null) { preparePortalMount(workInProgress.stateNode.containerInfo); } bubbleProperties(workInProgress); return null; case ContextProvider: // Pop provider fiber var context = workInProgress.type._context; popProvider(context, workInProgress); bubbleProperties(workInProgress); return null; case IncompleteClassComponent: { // Same as class component case. I put it down here so that the tags are // sequential to ensure this switch is compiled to a jump table. var _Component = workInProgress.type; if (isContextProvider(_Component)) { popContext(workInProgress); } bubbleProperties(workInProgress); return null; } case SuspenseListComponent: { popSuspenseContext(workInProgress); var renderState = workInProgress.memoizedState; if (renderState === null) { // We're running in the default, "independent" mode. // We don't do anything in this mode. bubbleProperties(workInProgress); return null; } var didSuspendAlready = (workInProgress.flags & DidCapture) !== NoFlags; var renderedTail = renderState.rendering; if (renderedTail === null) { // We just rendered the head. if (!didSuspendAlready) { // This is the first pass. We need to figure out if anything is still // suspended in the rendered set. // If new content unsuspended, but there's still some content that // didn't. Then we need to do a second pass that forces everything // to keep showing their fallbacks. // We might be suspended if something in this render pass suspended, or // something in the previous committed pass suspended. Otherwise, // there's no chance so we can skip the expensive call to // findFirstSuspended. var cannotBeSuspended = renderHasNotSuspendedYet() && (current === null || (current.flags & DidCapture) === NoFlags); if (!cannotBeSuspended) { var row = workInProgress.child; while (row !== null) { var suspended = findFirstSuspended(row); if (suspended !== null) { didSuspendAlready = true; workInProgress.flags |= DidCapture; cutOffTailIfNeeded(renderState, false); // If this is a newly suspended tree, it might not get committed as // part of the second pass. In that case nothing will subscribe to // its thenables. Instead, we'll transfer its thenables to the // SuspenseList so that it can retry if they resolve. // There might be multiple of these in the list but since we're // going to wait for all of them anyway, it doesn't really matter // which ones gets to ping. In theory we could get clever and keep // track of how many dependencies remain but it gets tricky because // in the meantime, we can add/remove/change items and dependencies. // We might bail out of the loop before finding any but that // doesn't matter since that means that the other boundaries that // we did find already has their listeners attached. var newThenables = suspended.updateQueue; if (newThenables !== null) { workInProgress.updateQueue = newThenables; workInProgress.flags |= Update; } // Rerender the whole list, but this time, we'll force fallbacks // to stay in place. // Reset the effect flags before doing the second pass since that's now invalid. // Reset the child fibers to their original state. workInProgress.subtreeFlags = NoFlags; resetChildFibers(workInProgress, renderLanes); // Set up the Suspense Context to force suspense and immediately // rerender the children. pushSuspenseContext(workInProgress, setShallowSuspenseContext(suspenseStackCursor.current, ForceSuspenseFallback)); // Don't bubble properties in this case. return workInProgress.child; } row = row.sibling; } } if (renderState.tail !== null && now() > getRenderTargetTime()) { // We have already passed our CPU deadline but we still have rows // left in the tail. We'll just give up further attempts to render // the main content and only render fallbacks. workInProgress.flags |= DidCapture; didSuspendAlready = true; cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this // to get it started back up to attempt the next item. While in terms // of priority this work has the same priority as this current render, // it's not part of the same transition once the transition has // committed. If it's sync, we still want to yield so that it can be // painted. Conceptually, this is really the same as pinging. // We can use any RetryLane even if it's the one currently rendering // since we're leaving it behind on this node. workInProgress.lanes = SomeRetryLane; } } else { cutOffTailIfNeeded(renderState, false); } // Next we're going to render the tail. } else { // Append the rendered row to the child list. if (!didSuspendAlready) { var _suspended = findFirstSuspended(renderedTail); if (_suspended !== null) { workInProgress.flags |= DidCapture; didSuspendAlready = true; // Ensure we transfer the update queue to the parent so that it doesn't // get lost if this row ends up dropped during a second pass. var _newThenables = _suspended.updateQueue; if (_newThenables !== null) { workInProgress.updateQueue = _newThenables; workInProgress.flags |= Update; } cutOffTailIfNeeded(renderState, true); // This might have been modified. if (renderState.tail === null && renderState.tailMode === 'hidden' && !renderedTail.alternate && !getIsHydrating() // We don't cut it if we're hydrating. ) { // We're done. bubbleProperties(workInProgress); return null; } } else if ( // The time it took to render last row is greater than the remaining // time we have to render. So rendering one more row would likely // exceed it. now() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes !== OffscreenLane) { // We have now passed our CPU deadline and we'll just give up further // attempts to render the main content and only render fallbacks. // The assumption is that this is usually faster. workInProgress.flags |= DidCapture; didSuspendAlready = true; cutOffTailIfNeeded(renderState, false); // Since nothing actually suspended, there will nothing to ping this // to get it started back up to attempt the next item. While in terms // of priority this work has the same priority as this current render, // it's not part of the same transition once the transition has // committed. If it's sync, we still want to yield so that it can be // painted. Conceptually, this is really the same as pinging. // We can use any RetryLane even if it's the one currently rendering // since we're leaving it behind on this node. workInProgress.lanes = SomeRetryLane; } } if (renderState.isBackwards) { // The effect list of the backwards tail will have been added // to the end. This breaks the guarantee that life-cycles fire in // sibling order but that isn't a strong guarantee promised by React. // Especially since these might also just pop in during future commits. // Append to the beginning of the list. renderedTail.sibling = workInProgress.child; workInProgress.child = renderedTail; } else { var previousSibling = renderState.last; if (previousSibling !== null) { previousSibling.sibling = renderedTail; } else { workInProgress.child = renderedTail; } renderState.last = renderedTail; } } if (renderState.tail !== null) { // We still have tail rows to render. // Pop a row. var next = renderState.tail; renderState.rendering = next; renderState.tail = next.sibling; renderState.renderingStartTime = now(); next.sibling = null; // Restore the context. // TODO: We can probably just avoid popping it instead and only // setting it the first time we go from not suspended to suspended. var suspenseContext = suspenseStackCursor.current; if (didSuspendAlready) { suspenseContext = setShallowSuspenseContext(suspenseContext, ForceSuspenseFallback); } else { suspenseContext = setDefaultShallowSuspenseContext(suspenseContext); } pushSuspenseContext(workInProgress, suspenseContext); // Do a pass over the next row. // Don't bubble properties in this case. return next; } bubbleProperties(workInProgress); return null; } case ScopeComponent: { break; } case OffscreenComponent: case LegacyHiddenComponent: { popRenderLanes(workInProgress); var _nextState = workInProgress.memoizedState; var nextIsHidden = _nextState !== null; if (current !== null) { var _prevState = current.memoizedState; var prevIsHidden = _prevState !== null; if (prevIsHidden !== nextIsHidden && ( // LegacyHidden doesn't do any hiding — it only pre-renders. !enableLegacyHidden )) { workInProgress.flags |= Visibility; } } if (!nextIsHidden || (workInProgress.mode & ConcurrentMode) === NoMode) { bubbleProperties(workInProgress); } else { // Don't bubble properties for hidden children unless we're rendering // at offscreen priority. if (includesSomeLane(subtreeRenderLanes, OffscreenLane)) { bubbleProperties(workInProgress); { // Check if there was an insertion or update in the hidden subtree. // If so, we need to hide those nodes in the commit phase, so // schedule a visibility effect. if ( workInProgress.subtreeFlags & (Placement | Update)) { workInProgress.flags |= Visibility; } } } } return null; } case CacheComponent: { return null; } case TracingMarkerComponent: { return null; } } throw new Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in " + 'React. Please file an issue.'); } function unwindWork(current, workInProgress, renderLanes) { // Note: This intentionally doesn't check if we're hydrating because comparing // to the current tree provider fiber is just as fast and less error-prone. // Ideally we would have a special version of the work loop only // for hydration. popTreeContext(workInProgress); switch (workInProgress.tag) { case ClassComponent: { var Component = workInProgress.type; if (isContextProvider(Component)) { popContext(workInProgress); } var flags = workInProgress.flags; if (flags & ShouldCapture) { workInProgress.flags = flags & ~ShouldCapture | DidCapture; if ( (workInProgress.mode & ProfileMode) !== NoMode) { transferActualDuration(workInProgress); } return workInProgress; } return null; } case HostRoot: { var root = workInProgress.stateNode; popHostContainer(workInProgress); popTopLevelContextObject(workInProgress); resetWorkInProgressVersions(); var _flags = workInProgress.flags; if ((_flags & ShouldCapture) !== NoFlags && (_flags & DidCapture) === NoFlags) { // There was an error during render that wasn't captured by a suspense // boundary. Do a second pass on the root to unmount the children. workInProgress.flags = _flags & ~ShouldCapture | DidCapture; return workInProgress; } // We unwound to the root without completing it. Exit. return null; } case HostComponent: { // TODO: popHydrationState popHostContext(workInProgress); return null; } case SuspenseComponent: { popSuspenseContext(workInProgress); var suspenseState = workInProgress.memoizedState; if (suspenseState !== null && suspenseState.dehydrated !== null) { if (workInProgress.alternate === null) { throw new Error('Threw in newly mounted dehydrated component. This is likely a bug in ' + 'React. Please file an issue.'); } resetHydrationState(); } var _flags2 = workInProgress.flags; if (_flags2 & ShouldCapture) { workInProgress.flags = _flags2 & ~ShouldCapture | DidCapture; // Captured a suspense effect. Re-render the boundary. if ( (workInProgress.mode & ProfileMode) !== NoMode) { transferActualDuration(workInProgress); } return workInProgress; } return null; } case SuspenseListComponent: { popSuspenseContext(workInProgress); // SuspenseList doesn't actually catch anything. It should've been // caught by a nested boundary. If not, it should bubble through. return null; } case HostPortal: popHostContainer(workInProgress); return null; case ContextProvider: var context = workInProgress.type._context; popProvider(context, workInProgress); return null; case OffscreenComponent: case LegacyHiddenComponent: popRenderLanes(workInProgress); return null; case CacheComponent: return null; default: return null; } } function unwindInterruptedWork(current, interruptedWork, renderLanes) { // Note: This intentionally doesn't check if we're hydrating because comparing // to the current tree provider fiber is just as fast and less error-prone. // Ideally we would have a special version of the work loop only // for hydration. popTreeContext(interruptedWork); switch (interruptedWork.tag) { case ClassComponent: { var childContextTypes = interruptedWork.type.childContextTypes; if (childContextTypes !== null && childContextTypes !== undefined) { popContext(interruptedWork); } break; } case HostRoot: { var root = interruptedWork.stateNode; popHostContainer(interruptedWork); popTopLevelContextObject(interruptedWork); resetWorkInProgressVersions(); break; } case HostComponent: { popHostContext(interruptedWork); break; } case HostPortal: popHostContainer(interruptedWork); break; case SuspenseComponent: popSuspenseContext(interruptedWork); break; case SuspenseListComponent: popSuspenseContext(interruptedWork); break; case ContextProvider: var context = interruptedWork.type._context; popProvider(context, interruptedWork); break; case OffscreenComponent: case LegacyHiddenComponent: popRenderLanes(interruptedWork); break; } } var didWarnAboutUndefinedSnapshotBeforeUpdate = null; { didWarnAboutUndefinedSnapshotBeforeUpdate = new Set(); } // Used during the commit phase to track the state of the Offscreen component stack. // Allows us to avoid traversing the return path to find the nearest Offscreen ancestor. // Only used when enableSuspenseLayoutEffectSemantics is enabled. var offscreenSubtreeIsHidden = false; var offscreenSubtreeWasHidden = false; var PossiblyWeakSet = typeof WeakSet === 'function' ? WeakSet : Set; var nextEffect = null; // Used for Profiling builds to track updaters. var inProgressLanes = null; var inProgressRoot = null; function reportUncaughtErrorInDEV(error) { // Wrapping each small part of the commit phase into a guarded // callback is a bit too slow (https://github.com/facebook/react/pull/21666). // But we rely on it to surface errors to DEV tools like overlays // (https://github.com/facebook/react/issues/21712). // As a compromise, rethrow only caught errors in a guard. { invokeGuardedCallback(null, function () { throw error; }); clearCaughtError(); } } var callComponentWillUnmountWithTimer = function (current, instance) { instance.props = current.memoizedProps; instance.state = current.memoizedState; if ( current.mode & ProfileMode) { try { startLayoutEffectTimer(); instance.componentWillUnmount(); } finally { recordLayoutEffectDuration(current); } } else { instance.componentWillUnmount(); } }; // Capture errors so they don't interrupt mounting. function safelyCallCommitHookLayoutEffectListMount(current, nearestMountedAncestor) { try { commitHookEffectListMount(Layout, current); } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } // Capture errors so they don't interrupt unmounting. function safelyCallComponentWillUnmount(current, nearestMountedAncestor, instance) { try { callComponentWillUnmountWithTimer(current, instance); } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } // Capture errors so they don't interrupt mounting. function safelyCallComponentDidMount(current, nearestMountedAncestor, instance) { try { instance.componentDidMount(); } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } // Capture errors so they don't interrupt mounting. function safelyAttachRef(current, nearestMountedAncestor) { try { commitAttachRef(current); } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } function safelyDetachRef(current, nearestMountedAncestor) { var ref = current.ref; if (ref !== null) { if (typeof ref === 'function') { var retVal; try { if (enableProfilerTimer && enableProfilerCommitHooks && current.mode & ProfileMode) { try { startLayoutEffectTimer(); retVal = ref(null); } finally { recordLayoutEffectDuration(current); } } else { retVal = ref(null); } } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } { if (typeof retVal === 'function') { error('Unexpected return value from a callback ref in %s. ' + 'A callback ref should not return a function.', getComponentNameFromFiber(current)); } } } else { ref.current = null; } } } function safelyCallDestroy(current, nearestMountedAncestor, destroy) { try { destroy(); } catch (error) { captureCommitPhaseError(current, nearestMountedAncestor, error); } } var focusedInstanceHandle = null; var shouldFireAfterActiveInstanceBlur = false; function commitBeforeMutationEffects(root, firstChild) { focusedInstanceHandle = prepareForCommit(root.containerInfo); nextEffect = firstChild; commitBeforeMutationEffects_begin(); // We no longer need to track the active instance fiber var shouldFire = shouldFireAfterActiveInstanceBlur; shouldFireAfterActiveInstanceBlur = false; focusedInstanceHandle = null; return shouldFire; } function commitBeforeMutationEffects_begin() { while (nextEffect !== null) { var fiber = nextEffect; // This phase is only used for beforeActiveInstanceBlur. var child = fiber.child; if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) { child.return = fiber; nextEffect = child; } else { commitBeforeMutationEffects_complete(); } } } function commitBeforeMutationEffects_complete() { while (nextEffect !== null) { var fiber = nextEffect; setCurrentFiber(fiber); try { commitBeforeMutationEffectsOnFiber(fiber); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } resetCurrentFiber(); var sibling = fiber.sibling; if (sibling !== null) { sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function commitBeforeMutationEffectsOnFiber(finishedWork) { var current = finishedWork.alternate; var flags = finishedWork.flags; if ((flags & Snapshot) !== NoFlags) { setCurrentFiber(finishedWork); switch (finishedWork.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { break; } case ClassComponent: { if (current !== null) { var prevProps = current.memoizedProps; var prevState = current.memoizedState; var instance = finishedWork.stateNode; // We could update instance props and state here, // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { if (instance.props !== finishedWork.memoizedProps) { error('Expected %s props to match memoized props before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } if (instance.state !== finishedWork.memoizedState) { error('Expected %s state to match memoized state before ' + 'getSnapshotBeforeUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } } } var snapshot = instance.getSnapshotBeforeUpdate(finishedWork.elementType === finishedWork.type ? prevProps : resolveDefaultProps(finishedWork.type, prevProps), prevState); { var didWarnSet = didWarnAboutUndefinedSnapshotBeforeUpdate; if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) { didWarnSet.add(finishedWork.type); error('%s.getSnapshotBeforeUpdate(): A snapshot value (or null) ' + 'must be returned. You have returned undefined.', getComponentNameFromFiber(finishedWork)); } } instance.__reactInternalSnapshotBeforeUpdate = snapshot; } break; } case HostRoot: { { var root = finishedWork.stateNode; clearContainer(root.containerInfo); } break; } case HostComponent: case HostText: case HostPortal: case IncompleteClassComponent: // Nothing to do for these component types break; default: { throw new Error('This unit of work tag should not have side-effects. This error is ' + 'likely caused by a bug in React. Please file an issue.'); } } resetCurrentFiber(); } } function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor) { var updateQueue = finishedWork.updateQueue; var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; if (lastEffect !== null) { var firstEffect = lastEffect.next; var effect = firstEffect; do { if ((effect.tag & flags) === flags) { // Unmount var destroy = effect.destroy; effect.destroy = undefined; if (destroy !== undefined) { { if ((flags & Passive$1) !== NoFlags$1) { markComponentPassiveEffectUnmountStarted(finishedWork); } else if ((flags & Layout) !== NoFlags$1) { markComponentLayoutEffectUnmountStarted(finishedWork); } } { if ((flags & Insertion) !== NoFlags$1) { setIsRunningInsertionEffect(true); } } safelyCallDestroy(finishedWork, nearestMountedAncestor, destroy); { if ((flags & Insertion) !== NoFlags$1) { setIsRunningInsertionEffect(false); } } { if ((flags & Passive$1) !== NoFlags$1) { markComponentPassiveEffectUnmountStopped(); } else if ((flags & Layout) !== NoFlags$1) { markComponentLayoutEffectUnmountStopped(); } } } } effect = effect.next; } while (effect !== firstEffect); } } function commitHookEffectListMount(flags, finishedWork) { var updateQueue = finishedWork.updateQueue; var lastEffect = updateQueue !== null ? updateQueue.lastEffect : null; if (lastEffect !== null) { var firstEffect = lastEffect.next; var effect = firstEffect; do { if ((effect.tag & flags) === flags) { { if ((flags & Passive$1) !== NoFlags$1) { markComponentPassiveEffectMountStarted(finishedWork); } else if ((flags & Layout) !== NoFlags$1) { markComponentLayoutEffectMountStarted(finishedWork); } } // Mount var create = effect.create; { if ((flags & Insertion) !== NoFlags$1) { setIsRunningInsertionEffect(true); } } effect.destroy = create(); { if ((flags & Insertion) !== NoFlags$1) { setIsRunningInsertionEffect(false); } } { if ((flags & Passive$1) !== NoFlags$1) { markComponentPassiveEffectMountStopped(); } else if ((flags & Layout) !== NoFlags$1) { markComponentLayoutEffectMountStopped(); } } { var destroy = effect.destroy; if (destroy !== undefined && typeof destroy !== 'function') { var hookName = void 0; if ((effect.tag & Layout) !== NoFlags) { hookName = 'useLayoutEffect'; } else if ((effect.tag & Insertion) !== NoFlags) { hookName = 'useInsertionEffect'; } else { hookName = 'useEffect'; } var addendum = void 0; if (destroy === null) { addendum = ' You returned null. If your effect does not require clean ' + 'up, return undefined (or nothing).'; } else if (typeof destroy.then === 'function') { addendum = '\n\nIt looks like you wrote ' + hookName + '(async () => ...) or returned a Promise. ' + 'Instead, write the async function inside your effect ' + 'and call it immediately:\n\n' + hookName + '(() => {\n' + ' async function fetchData() {\n' + ' // You can await here\n' + ' const response = await MyAPI.getData(someId);\n' + ' // ...\n' + ' }\n' + ' fetchData();\n' + "}, [someId]); // Or [] if effect doesn't need props or state\n\n" + 'Learn more about data fetching with Hooks: https://reactjs.org/link/hooks-data-fetching'; } else { addendum = ' You returned: ' + destroy; } error('%s must not return anything besides a function, ' + 'which is used for clean-up.%s', hookName, addendum); } } } effect = effect.next; } while (effect !== firstEffect); } } function commitPassiveEffectDurations(finishedRoot, finishedWork) { { // Only Profilers with work in their subtree will have an Update effect scheduled. if ((finishedWork.flags & Update) !== NoFlags) { switch (finishedWork.tag) { case Profiler: { var passiveEffectDuration = finishedWork.stateNode.passiveEffectDuration; var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onPostCommit = _finishedWork$memoize.onPostCommit; // This value will still reflect the previous commit phase. // It does not get reset until the start of the next commit phase. var commitTime = getCommitTime(); var phase = finishedWork.alternate === null ? 'mount' : 'update'; { if (isCurrentUpdateNested()) { phase = 'nested-update'; } } if (typeof onPostCommit === 'function') { onPostCommit(id, phase, passiveEffectDuration, commitTime); } // Bubble times to the next nearest ancestor Profiler. // After we process that Profiler, we'll bubble further up. var parentFiber = finishedWork.return; outer: while (parentFiber !== null) { switch (parentFiber.tag) { case HostRoot: var root = parentFiber.stateNode; root.passiveEffectDuration += passiveEffectDuration; break outer; case Profiler: var parentStateNode = parentFiber.stateNode; parentStateNode.passiveEffectDuration += passiveEffectDuration; break outer; } parentFiber = parentFiber.return; } break; } } } } } function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork, committedLanes) { if ((finishedWork.flags & LayoutMask) !== NoFlags) { switch (finishedWork.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { if ( !offscreenSubtreeWasHidden) { // At this point layout effects have already been destroyed (during mutation phase). // This is done to prevent sibling component effects from interfering with each other, // e.g. a destroy function in one component should never override a ref set // by a create function in another component during the same commit. if ( finishedWork.mode & ProfileMode) { try { startLayoutEffectTimer(); commitHookEffectListMount(Layout | HasEffect, finishedWork); } finally { recordLayoutEffectDuration(finishedWork); } } else { commitHookEffectListMount(Layout | HasEffect, finishedWork); } } break; } case ClassComponent: { var instance = finishedWork.stateNode; if (finishedWork.flags & Update) { if (!offscreenSubtreeWasHidden) { if (current === null) { // We could update instance props and state here, // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { if (instance.props !== finishedWork.memoizedProps) { error('Expected %s props to match memoized props before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } if (instance.state !== finishedWork.memoizedState) { error('Expected %s state to match memoized state before ' + 'componentDidMount. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } } } if ( finishedWork.mode & ProfileMode) { try { startLayoutEffectTimer(); instance.componentDidMount(); } finally { recordLayoutEffectDuration(finishedWork); } } else { instance.componentDidMount(); } } else { var prevProps = finishedWork.elementType === finishedWork.type ? current.memoizedProps : resolveDefaultProps(finishedWork.type, current.memoizedProps); var prevState = current.memoizedState; // We could update instance props and state here, // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. { if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { if (instance.props !== finishedWork.memoizedProps) { error('Expected %s props to match memoized props before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } if (instance.state !== finishedWork.memoizedState) { error('Expected %s state to match memoized state before ' + 'componentDidUpdate. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } } } if ( finishedWork.mode & ProfileMode) { try { startLayoutEffectTimer(); instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); } finally { recordLayoutEffectDuration(finishedWork); } } else { instance.componentDidUpdate(prevProps, prevState, instance.__reactInternalSnapshotBeforeUpdate); } } } } // TODO: I think this is now always non-null by the time it reaches the // commit phase. Consider removing the type check. var updateQueue = finishedWork.updateQueue; if (updateQueue !== null) { { if (finishedWork.type === finishedWork.elementType && !didWarnAboutReassigningProps) { if (instance.props !== finishedWork.memoizedProps) { error('Expected %s props to match memoized props before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.props`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } if (instance.state !== finishedWork.memoizedState) { error('Expected %s state to match memoized state before ' + 'processing the update queue. ' + 'This might either be because of a bug in React, or because ' + 'a component reassigns its own `this.state`. ' + 'Please file an issue.', getComponentNameFromFiber(finishedWork) || 'instance'); } } } // We could update instance props and state here, // but instead we rely on them being set during last render. // TODO: revisit this when we implement resuming. commitUpdateQueue(finishedWork, updateQueue, instance); } break; } case HostRoot: { // TODO: I think this is now always non-null by the time it reaches the // commit phase. Consider removing the type check. var _updateQueue = finishedWork.updateQueue; if (_updateQueue !== null) { var _instance = null; if (finishedWork.child !== null) { switch (finishedWork.child.tag) { case HostComponent: _instance = getPublicInstance(finishedWork.child.stateNode); break; case ClassComponent: _instance = finishedWork.child.stateNode; break; } } commitUpdateQueue(finishedWork, _updateQueue, _instance); } break; } case HostComponent: { var _instance2 = finishedWork.stateNode; // Renderers may schedule work to be done after host components are mounted // (eg DOM renderer may schedule auto-focus for inputs and form controls). // These effects should only be committed when components are first mounted, // aka when there is no current/alternate. if (current === null && finishedWork.flags & Update) { var type = finishedWork.type; var props = finishedWork.memoizedProps; commitMount(_instance2, type, props); } break; } case HostText: { // We have no life-cycles associated with text. break; } case HostPortal: { // We have no life-cycles associated with portals. break; } case Profiler: { { var _finishedWork$memoize2 = finishedWork.memoizedProps, onCommit = _finishedWork$memoize2.onCommit, onRender = _finishedWork$memoize2.onRender; var effectDuration = finishedWork.stateNode.effectDuration; var commitTime = getCommitTime(); var phase = current === null ? 'mount' : 'update'; { if (isCurrentUpdateNested()) { phase = 'nested-update'; } } if (typeof onRender === 'function') { onRender(finishedWork.memoizedProps.id, phase, finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, commitTime); } { if (typeof onCommit === 'function') { onCommit(finishedWork.memoizedProps.id, phase, effectDuration, commitTime); } // Schedule a passive effect for this Profiler to call onPostCommit hooks. // This effect should be scheduled even if there is no onPostCommit callback for this Profiler, // because the effect is also where times bubble to parent Profilers. enqueuePendingPassiveProfilerEffect(finishedWork); // Propagate layout effect durations to the next nearest Profiler ancestor. // Do not reset these values until the next render so DevTools has a chance to read them first. var parentFiber = finishedWork.return; outer: while (parentFiber !== null) { switch (parentFiber.tag) { case HostRoot: var root = parentFiber.stateNode; root.effectDuration += effectDuration; break outer; case Profiler: var parentStateNode = parentFiber.stateNode; parentStateNode.effectDuration += effectDuration; break outer; } parentFiber = parentFiber.return; } } } break; } case SuspenseComponent: { commitSuspenseHydrationCallbacks(finishedRoot, finishedWork); break; } case SuspenseListComponent: case IncompleteClassComponent: case ScopeComponent: case OffscreenComponent: case LegacyHiddenComponent: case TracingMarkerComponent: { break; } default: throw new Error('This unit of work tag should not have side-effects. This error is ' + 'likely caused by a bug in React. Please file an issue.'); } } if ( !offscreenSubtreeWasHidden) { { if (finishedWork.flags & Ref) { commitAttachRef(finishedWork); } } } } function reappearLayoutEffectsOnFiber(node) { // Turn on layout effects in a tree that previously disappeared. // TODO (Offscreen) Check: flags & LayoutStatic switch (node.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { if ( node.mode & ProfileMode) { try { startLayoutEffectTimer(); safelyCallCommitHookLayoutEffectListMount(node, node.return); } finally { recordLayoutEffectDuration(node); } } else { safelyCallCommitHookLayoutEffectListMount(node, node.return); } break; } case ClassComponent: { var instance = node.stateNode; if (typeof instance.componentDidMount === 'function') { safelyCallComponentDidMount(node, node.return, instance); } safelyAttachRef(node, node.return); break; } case HostComponent: { safelyAttachRef(node, node.return); break; } } } function hideOrUnhideAllChildren(finishedWork, isHidden) { // Only hide or unhide the top-most host nodes. var hostSubtreeRoot = null; { // We only have the top Fiber that was inserted but we need to recurse down its // children to find all the terminal nodes. var node = finishedWork; while (true) { if (node.tag === HostComponent) { if (hostSubtreeRoot === null) { hostSubtreeRoot = node; try { var instance = node.stateNode; if (isHidden) { hideInstance(instance); } else { unhideInstance(node.stateNode, node.memoizedProps); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } else if (node.tag === HostText) { if (hostSubtreeRoot === null) { try { var _instance3 = node.stateNode; if (isHidden) { hideTextInstance(_instance3); } else { unhideTextInstance(_instance3, node.memoizedProps); } } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } else if ((node.tag === OffscreenComponent || node.tag === LegacyHiddenComponent) && node.memoizedState !== null && node !== finishedWork) ; else if (node.child !== null) { node.child.return = node; node = node.child; continue; } if (node === finishedWork) { return; } while (node.sibling === null) { if (node.return === null || node.return === finishedWork) { return; } if (hostSubtreeRoot === node) { hostSubtreeRoot = null; } node = node.return; } if (hostSubtreeRoot === node) { hostSubtreeRoot = null; } node.sibling.return = node.return; node = node.sibling; } } } function commitAttachRef(finishedWork) { var ref = finishedWork.ref; if (ref !== null) { var instance = finishedWork.stateNode; var instanceToUse; switch (finishedWork.tag) { case HostComponent: instanceToUse = getPublicInstance(instance); break; default: instanceToUse = instance; } // Moved outside to ensure DCE works with this flag if (typeof ref === 'function') { var retVal; if ( finishedWork.mode & ProfileMode) { try { startLayoutEffectTimer(); retVal = ref(instanceToUse); } finally { recordLayoutEffectDuration(finishedWork); } } else { retVal = ref(instanceToUse); } { if (typeof retVal === 'function') { error('Unexpected return value from a callback ref in %s. ' + 'A callback ref should not return a function.', getComponentNameFromFiber(finishedWork)); } } } else { { if (!ref.hasOwnProperty('current')) { error('Unexpected ref object provided for %s. ' + 'Use either a ref-setter function or React.createRef().', getComponentNameFromFiber(finishedWork)); } } ref.current = instanceToUse; } } } function detachFiberMutation(fiber) { // Cut off the return pointer to disconnect it from the tree. // This enables us to detect and warn against state updates on an unmounted component. // It also prevents events from bubbling from within disconnected components. // // Ideally, we should also clear the child pointer of the parent alternate to let this // get GC:ed but we don't know which for sure which parent is the current // one so we'll settle for GC:ing the subtree of this child. // This child itself will be GC:ed when the parent updates the next time. // // Note that we can't clear child or sibling pointers yet. // They're needed for passive effects and for findDOMNode. // We defer those fields, and all other cleanup, to the passive phase (see detachFiberAfterEffects). // // Don't reset the alternate yet, either. We need that so we can detach the // alternate's fields in the passive phase. Clearing the return pointer is // sufficient for findDOMNode semantics. var alternate = fiber.alternate; if (alternate !== null) { alternate.return = null; } fiber.return = null; } function detachFiberAfterEffects(fiber) { var alternate = fiber.alternate; if (alternate !== null) { fiber.alternate = null; detachFiberAfterEffects(alternate); } // Note: Defensively using negation instead of < in case // `deletedTreeCleanUpLevel` is undefined. { // Clear cyclical Fiber fields. This level alone is designed to roughly // approximate the planned Fiber refactor. In that world, `setState` will be // bound to a special "instance" object instead of a Fiber. The Instance // object will not have any of these fields. It will only be connected to // the fiber tree via a single link at the root. So if this level alone is // sufficient to fix memory issues, that bodes well for our plans. fiber.child = null; fiber.deletions = null; fiber.sibling = null; // The `stateNode` is cyclical because on host nodes it points to the host // tree, which has its own pointers to children, parents, and siblings. // The other host nodes also point back to fibers, so we should detach that // one, too. if (fiber.tag === HostComponent) { var hostInstance = fiber.stateNode; if (hostInstance !== null) { detachDeletedInstance(hostInstance); } } fiber.stateNode = null; // I'm intentionally not clearing the `return` field in this level. We // already disconnect the `return` pointer at the root of the deleted // subtree (in `detachFiberMutation`). Besides, `return` by itself is not // cyclical — it's only cyclical when combined with `child`, `sibling`, and // `alternate`. But we'll clear it in the next level anyway, just in case. { fiber._debugOwner = null; } { // Theoretically, nothing in here should be necessary, because we already // disconnected the fiber from the tree. So even if something leaks this // particular fiber, it won't leak anything else // // The purpose of this branch is to be super aggressive so we can measure // if there's any difference in memory impact. If there is, that could // indicate a React leak we don't know about. fiber.return = null; fiber.dependencies = null; fiber.memoizedProps = null; fiber.memoizedState = null; fiber.pendingProps = null; fiber.stateNode = null; // TODO: Move to `commitPassiveUnmountInsideDeletedTreeOnFiber` instead. fiber.updateQueue = null; } } } function getHostParentFiber(fiber) { var parent = fiber.return; while (parent !== null) { if (isHostParent(parent)) { return parent; } parent = parent.return; } throw new Error('Expected to find a host parent. This error is likely caused by a bug ' + 'in React. Please file an issue.'); } function isHostParent(fiber) { return fiber.tag === HostComponent || fiber.tag === HostRoot || fiber.tag === HostPortal; } function getHostSibling(fiber) { // We're going to search forward into the tree until we find a sibling host // node. Unfortunately, if multiple insertions are done in a row we have to // search past them. This leads to exponential search for the next sibling. // TODO: Find a more efficient way to do this. var node = fiber; siblings: while (true) { // If we didn't find anything, let's try the next sibling. while (node.sibling === null) { if (node.return === null || isHostParent(node.return)) { // If we pop out of the root or hit the parent the fiber we are the // last sibling. return null; } node = node.return; } node.sibling.return = node.return; node = node.sibling; while (node.tag !== HostComponent && node.tag !== HostText && node.tag !== DehydratedFragment) { // If it is not host node and, we might have a host node inside it. // Try to search down until we find one. if (node.flags & Placement) { // If we don't have a child, try the siblings instead. continue siblings; } // If we don't have a child, try the siblings instead. // We also skip portals because they are not part of this host tree. if (node.child === null || node.tag === HostPortal) { continue siblings; } else { node.child.return = node; node = node.child; } } // Check if this host node is stable or about to be placed. if (!(node.flags & Placement)) { // Found it! return node.stateNode; } } } function commitPlacement(finishedWork) { var parentFiber = getHostParentFiber(finishedWork); // Note: these two variables *must* always be updated together. switch (parentFiber.tag) { case HostComponent: { var parent = parentFiber.stateNode; if (parentFiber.flags & ContentReset) { // Reset the text content of the parent before doing any insertions resetTextContent(parent); // Clear ContentReset from the effect tag parentFiber.flags &= ~ContentReset; } var before = getHostSibling(finishedWork); // We only have the top Fiber that was inserted but we need to recurse down its // children to find all the terminal nodes. insertOrAppendPlacementNode(finishedWork, before, parent); break; } case HostRoot: case HostPortal: { var _parent = parentFiber.stateNode.containerInfo; var _before = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer(finishedWork, _before, _parent); break; } // eslint-disable-next-line-no-fallthrough default: throw new Error('Invalid host parent fiber. This error is likely caused by a bug ' + 'in React. Please file an issue.'); } } function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { var tag = node.tag; var isHost = tag === HostComponent || tag === HostText; if (isHost) { var stateNode = node.stateNode; if (before) { insertInContainerBefore(parent, stateNode, before); } else { appendChildToContainer(parent, stateNode); } } else if (tag === HostPortal) ; else { var child = node.child; if (child !== null) { insertOrAppendPlacementNodeIntoContainer(child, before, parent); var sibling = child.sibling; while (sibling !== null) { insertOrAppendPlacementNodeIntoContainer(sibling, before, parent); sibling = sibling.sibling; } } } } function insertOrAppendPlacementNode(node, before, parent) { var tag = node.tag; var isHost = tag === HostComponent || tag === HostText; if (isHost) { var stateNode = node.stateNode; if (before) { insertBefore(parent, stateNode, before); } else { appendChild(parent, stateNode); } } else if (tag === HostPortal) ; else { var child = node.child; if (child !== null) { insertOrAppendPlacementNode(child, before, parent); var sibling = child.sibling; while (sibling !== null) { insertOrAppendPlacementNode(sibling, before, parent); sibling = sibling.sibling; } } } } // These are tracked on the stack as we recursively traverse a // deleted subtree. // TODO: Update these during the whole mutation phase, not just during // a deletion. var hostParent = null; var hostParentIsContainer = false; function commitDeletionEffects(root, returnFiber, deletedFiber) { { // We only have the top Fiber that was deleted but we need to recurse down its // children to find all the terminal nodes. // Recursively delete all host nodes from the parent, detach refs, clean // up mounted layout effects, and call componentWillUnmount. // We only need to remove the topmost host child in each branch. But then we // still need to keep traversing to unmount effects, refs, and cWU. TODO: We // could split this into two separate traversals functions, where the second // one doesn't include any removeChild logic. This is maybe the same // function as "disappearLayoutEffects" (or whatever that turns into after // the layout phase is refactored to use recursion). // Before starting, find the nearest host parent on the stack so we know // which instance/container to remove the children from. // TODO: Instead of searching up the fiber return path on every deletion, we // can track the nearest host component on the JS stack as we traverse the // tree during the commit phase. This would make insertions faster, too. var parent = returnFiber; findParent: while (parent !== null) { switch (parent.tag) { case HostComponent: { hostParent = parent.stateNode; hostParentIsContainer = false; break findParent; } case HostRoot: { hostParent = parent.stateNode.containerInfo; hostParentIsContainer = true; break findParent; } case HostPortal: { hostParent = parent.stateNode.containerInfo; hostParentIsContainer = true; break findParent; } } parent = parent.return; } if (hostParent === null) { throw new Error('Expected to find a host parent. This error is likely caused by ' + 'a bug in React. Please file an issue.'); } commitDeletionEffectsOnFiber(root, returnFiber, deletedFiber); hostParent = null; hostParentIsContainer = false; } detachFiberMutation(deletedFiber); } function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) { // TODO: Use a static flag to skip trees that don't have unmount effects var child = parent.child; while (child !== null) { commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child); child = child.sibling; } } function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) { onCommitUnmount(deletedFiber); // The cases in this outer switch modify the stack before they traverse // into their subtree. There are simpler cases in the inner switch // that don't modify the stack. switch (deletedFiber.tag) { case HostComponent: { if (!offscreenSubtreeWasHidden) { safelyDetachRef(deletedFiber, nearestMountedAncestor); } // Intentional fallthrough to next branch } // eslint-disable-next-line-no-fallthrough case HostText: { // We only need to remove the nearest host child. Set the host parent // to `null` on the stack to indicate that nested children don't // need to be removed. { var prevHostParent = hostParent; var prevHostParentIsContainer = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); hostParent = prevHostParent; hostParentIsContainer = prevHostParentIsContainer; if (hostParent !== null) { // Now that all the child effects have unmounted, we can remove the // node from the tree. if (hostParentIsContainer) { removeChildFromContainer(hostParent, deletedFiber.stateNode); } else { removeChild(hostParent, deletedFiber.stateNode); } } } return; } case DehydratedFragment: { // Delete the dehydrated suspense boundary and all of its content. { if (hostParent !== null) { if (hostParentIsContainer) { clearSuspenseBoundaryFromContainer(hostParent, deletedFiber.stateNode); } else { clearSuspenseBoundary(hostParent, deletedFiber.stateNode); } } } return; } case HostPortal: { { // When we go into a portal, it becomes the parent to remove from. var _prevHostParent = hostParent; var _prevHostParentIsContainer = hostParentIsContainer; hostParent = deletedFiber.stateNode.containerInfo; hostParentIsContainer = true; recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); hostParent = _prevHostParent; hostParentIsContainer = _prevHostParentIsContainer; } return; } case FunctionComponent: case ForwardRef: case MemoComponent: case SimpleMemoComponent: { if (!offscreenSubtreeWasHidden) { var updateQueue = deletedFiber.updateQueue; if (updateQueue !== null) { var lastEffect = updateQueue.lastEffect; if (lastEffect !== null) { var firstEffect = lastEffect.next; var effect = firstEffect; do { var _effect = effect, destroy = _effect.destroy, tag = _effect.tag; if (destroy !== undefined) { if ((tag & Insertion) !== NoFlags$1) { safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); } else if ((tag & Layout) !== NoFlags$1) { { markComponentLayoutEffectUnmountStarted(deletedFiber); } if ( deletedFiber.mode & ProfileMode) { startLayoutEffectTimer(); safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); recordLayoutEffectDuration(deletedFiber); } else { safelyCallDestroy(deletedFiber, nearestMountedAncestor, destroy); } { markComponentLayoutEffectUnmountStopped(); } } } effect = effect.next; } while (effect !== firstEffect); } } } recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); return; } case ClassComponent: { if (!offscreenSubtreeWasHidden) { safelyDetachRef(deletedFiber, nearestMountedAncestor); var instance = deletedFiber.stateNode; if (typeof instance.componentWillUnmount === 'function') { safelyCallComponentWillUnmount(deletedFiber, nearestMountedAncestor, instance); } } recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); return; } case ScopeComponent: { recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); return; } case OffscreenComponent: { if ( // TODO: Remove this dead flag deletedFiber.mode & ConcurrentMode) { // If this offscreen component is hidden, we already unmounted it. Before // deleting the children, track that it's already unmounted so that we // don't attempt to unmount the effects again. // TODO: If the tree is hidden, in most cases we should be able to skip // over the nested children entirely. An exception is we haven't yet found // the topmost host node to delete, which we already track on the stack. // But the other case is portals, which need to be detached no matter how // deeply they are nested. We should use a subtree flag to track whether a // subtree includes a nested portal. var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || deletedFiber.memoizedState !== null; recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } else { recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); } break; } default: { recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, deletedFiber); return; } } } function commitSuspenseCallback(finishedWork) { // TODO: Move this to passive phase var newState = finishedWork.memoizedState; } function commitSuspenseHydrationCallbacks(finishedRoot, finishedWork) { var newState = finishedWork.memoizedState; if (newState === null) { var current = finishedWork.alternate; if (current !== null) { var prevState = current.memoizedState; if (prevState !== null) { var suspenseInstance = prevState.dehydrated; if (suspenseInstance !== null) { commitHydratedSuspenseInstance(suspenseInstance); } } } } } function attachSuspenseRetryListeners(finishedWork) { // If this boundary just timed out, then it will have a set of wakeables. // For each wakeable, attach a listener so that when it resolves, React // attempts to re-render the boundary in the primary (pre-timeout) state. var wakeables = finishedWork.updateQueue; if (wakeables !== null) { finishedWork.updateQueue = null; var retryCache = finishedWork.stateNode; if (retryCache === null) { retryCache = finishedWork.stateNode = new PossiblyWeakSet(); } wakeables.forEach(function (wakeable) { // Memoize using the boundary fiber to prevent redundant listeners. var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); if (!retryCache.has(wakeable)) { retryCache.add(wakeable); { if (isDevToolsPresent) { if (inProgressLanes !== null && inProgressRoot !== null) { // If we have pending work still, associate the original updaters with it. restorePendingUpdaters(inProgressRoot, inProgressLanes); } else { throw Error('Expected finished root and lanes to be set. This is a bug in React.'); } } } wakeable.then(retry, retry); } }); } } // This function detects when a Suspense boundary goes from visible to hidden. function commitMutationEffects(root, finishedWork, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; setCurrentFiber(finishedWork); commitMutationEffectsOnFiber(finishedWork, root); setCurrentFiber(finishedWork); inProgressLanes = null; inProgressRoot = null; } function recursivelyTraverseMutationEffects(root, parentFiber, lanes) { // Deletions effects can be scheduled on any fiber type. They need to happen // before the children effects hae fired. var deletions = parentFiber.deletions; if (deletions !== null) { for (var i = 0; i < deletions.length; i++) { var childToDelete = deletions[i]; try { commitDeletionEffects(root, parentFiber, childToDelete); } catch (error) { captureCommitPhaseError(childToDelete, parentFiber, error); } } } var prevDebugFiber = getCurrentFiber(); if (parentFiber.subtreeFlags & MutationMask) { var child = parentFiber.child; while (child !== null) { setCurrentFiber(child); commitMutationEffectsOnFiber(child, root); child = child.sibling; } } setCurrentFiber(prevDebugFiber); } function commitMutationEffectsOnFiber(finishedWork, root, lanes) { var current = finishedWork.alternate; var flags = finishedWork.flags; // The effect flag should be checked *after* we refine the type of fiber, // because the fiber tag is more specific. An exception is any flag related // to reconcilation, because those can be set on all fiber types. switch (finishedWork.tag) { case FunctionComponent: case ForwardRef: case MemoComponent: case SimpleMemoComponent: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Update) { try { commitHookEffectListUnmount(Insertion | HasEffect, finishedWork, finishedWork.return); commitHookEffectListMount(Insertion | HasEffect, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } // Layout effects are destroyed during the mutation phase so that all // destroy functions for all fibers are called before any create functions. // This prevents sibling component effects from interfering with each other, // e.g. a destroy function in one component should never override a ref set // by a create function in another component during the same commit. if ( finishedWork.mode & ProfileMode) { try { startLayoutEffectTimer(); commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } recordLayoutEffectDuration(finishedWork); } else { try { commitHookEffectListUnmount(Layout | HasEffect, finishedWork, finishedWork.return); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } return; } case ClassComponent: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Ref) { if (current !== null) { safelyDetachRef(current, current.return); } } return; } case HostComponent: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Ref) { if (current !== null) { safelyDetachRef(current, current.return); } } { // TODO: ContentReset gets cleared by the children during the commit // phase. This is a refactor hazard because it means we must read // flags the flags after `commitReconciliationEffects` has already run; // the order matters. We should refactor so that ContentReset does not // rely on mutating the flag during commit. Like by setting a flag // during the render phase instead. if (finishedWork.flags & ContentReset) { var instance = finishedWork.stateNode; try { resetTextContent(instance); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } if (flags & Update) { var _instance4 = finishedWork.stateNode; if (_instance4 != null) { // Commit the work prepared earlier. var newProps = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps // as the newProps. The updatePayload will contain the real change in // this case. var oldProps = current !== null ? current.memoizedProps : newProps; var type = finishedWork.type; // TODO: Type the updateQueue to be specific to host components. var updatePayload = finishedWork.updateQueue; finishedWork.updateQueue = null; if (updatePayload !== null) { try { commitUpdate(_instance4, updatePayload, type, oldProps, newProps, finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } } } return; } case HostText: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Update) { { if (finishedWork.stateNode === null) { throw new Error('This should have a text node initialized. This error is likely ' + 'caused by a bug in React. Please file an issue.'); } var textInstance = finishedWork.stateNode; var newText = finishedWork.memoizedProps; // For hydration we reuse the update path but we treat the oldProps // as the newProps. The updatePayload will contain the real change in // this case. var oldText = current !== null ? current.memoizedProps : newText; try { commitTextUpdate(textInstance, oldText, newText); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } return; } case HostRoot: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Update) { { if (current !== null) { var prevRootState = current.memoizedState; if (prevRootState.isDehydrated) { try { commitHydratedContainer(root.containerInfo); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } } } } } return; } case HostPortal: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); return; } case SuspenseComponent: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); var offscreenFiber = finishedWork.child; if (offscreenFiber.flags & Visibility) { var offscreenInstance = offscreenFiber.stateNode; var newState = offscreenFiber.memoizedState; var isHidden = newState !== null; // Track the current state on the Offscreen instance so we can // read it during an event offscreenInstance.isHidden = isHidden; if (isHidden) { var wasHidden = offscreenFiber.alternate !== null && offscreenFiber.alternate.memoizedState !== null; if (!wasHidden) { // TODO: Move to passive phase markCommitTimeOfFallback(); } } } if (flags & Update) { try { commitSuspenseCallback(finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } attachSuspenseRetryListeners(finishedWork); } return; } case OffscreenComponent: { var _wasHidden = current !== null && current.memoizedState !== null; if ( // TODO: Remove this dead flag finishedWork.mode & ConcurrentMode) { // Before committing the children, track on the stack whether this // offscreen subtree was already hidden, so that we don't unmount the // effects again. var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden || _wasHidden; recursivelyTraverseMutationEffects(root, finishedWork); offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; } else { recursivelyTraverseMutationEffects(root, finishedWork); } commitReconciliationEffects(finishedWork); if (flags & Visibility) { var _offscreenInstance = finishedWork.stateNode; var _newState = finishedWork.memoizedState; var _isHidden = _newState !== null; var offscreenBoundary = finishedWork; // Track the current state on the Offscreen instance so we can // read it during an event _offscreenInstance.isHidden = _isHidden; { if (_isHidden) { if (!_wasHidden) { if ((offscreenBoundary.mode & ConcurrentMode) !== NoMode) { nextEffect = offscreenBoundary; var offscreenChild = offscreenBoundary.child; while (offscreenChild !== null) { nextEffect = offscreenChild; disappearLayoutEffects_begin(offscreenChild); offscreenChild = offscreenChild.sibling; } } } } } { // TODO: This needs to run whenever there's an insertion or update // inside a hidden Offscreen tree. hideOrUnhideAllChildren(offscreenBoundary, _isHidden); } } return; } case SuspenseListComponent: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); if (flags & Update) { attachSuspenseRetryListeners(finishedWork); } return; } case ScopeComponent: { return; } default: { recursivelyTraverseMutationEffects(root, finishedWork); commitReconciliationEffects(finishedWork); return; } } } function commitReconciliationEffects(finishedWork) { // Placement effects (insertions, reorders) can be scheduled on any fiber // type. They needs to happen after the children effects have fired, but // before the effects on this fiber have fired. var flags = finishedWork.flags; if (flags & Placement) { try { commitPlacement(finishedWork); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); } // Clear the "placement" from effect tag so that we know that this is // inserted, before any life-cycles like componentDidMount gets called. // TODO: findDOMNode doesn't rely on this any more but isMounted does // and isMounted is deprecated anyway so we should be able to kill this. finishedWork.flags &= ~Placement; } if (flags & Hydrating) { finishedWork.flags &= ~Hydrating; } } function commitLayoutEffects(finishedWork, root, committedLanes) { inProgressLanes = committedLanes; inProgressRoot = root; nextEffect = finishedWork; commitLayoutEffects_begin(finishedWork, root, committedLanes); inProgressLanes = null; inProgressRoot = null; } function commitLayoutEffects_begin(subtreeRoot, root, committedLanes) { // Suspense layout effects semantics don't change for legacy roots. var isModernRoot = (subtreeRoot.mode & ConcurrentMode) !== NoMode; while (nextEffect !== null) { var fiber = nextEffect; var firstChild = fiber.child; if ( fiber.tag === OffscreenComponent && isModernRoot) { // Keep track of the current Offscreen stack's state. var isHidden = fiber.memoizedState !== null; var newOffscreenSubtreeIsHidden = isHidden || offscreenSubtreeIsHidden; if (newOffscreenSubtreeIsHidden) { // The Offscreen tree is hidden. Skip over its layout effects. commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes); continue; } else { // TODO (Offscreen) Also check: subtreeFlags & LayoutMask var current = fiber.alternate; var wasHidden = current !== null && current.memoizedState !== null; var newOffscreenSubtreeWasHidden = wasHidden || offscreenSubtreeWasHidden; var prevOffscreenSubtreeIsHidden = offscreenSubtreeIsHidden; var prevOffscreenSubtreeWasHidden = offscreenSubtreeWasHidden; // Traverse the Offscreen subtree with the current Offscreen as the root. offscreenSubtreeIsHidden = newOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = newOffscreenSubtreeWasHidden; if (offscreenSubtreeWasHidden && !prevOffscreenSubtreeWasHidden) { // This is the root of a reappearing boundary. Turn its layout effects // back on. nextEffect = fiber; reappearLayoutEffects_begin(fiber); } var child = firstChild; while (child !== null) { nextEffect = child; commitLayoutEffects_begin(child, // New root; bubble back up to here and stop. root, committedLanes); child = child.sibling; } // Restore Offscreen state and resume in our-progress traversal. nextEffect = fiber; offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden; offscreenSubtreeWasHidden = prevOffscreenSubtreeWasHidden; commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes); continue; } } if ((fiber.subtreeFlags & LayoutMask) !== NoFlags && firstChild !== null) { firstChild.return = fiber; nextEffect = firstChild; } else { commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes); } } } function commitLayoutMountEffects_complete(subtreeRoot, root, committedLanes) { while (nextEffect !== null) { var fiber = nextEffect; if ((fiber.flags & LayoutMask) !== NoFlags) { var current = fiber.alternate; setCurrentFiber(fiber); try { commitLayoutEffectOnFiber(root, current, fiber, committedLanes); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } resetCurrentFiber(); } if (fiber === subtreeRoot) { nextEffect = null; return; } var sibling = fiber.sibling; if (sibling !== null) { sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function disappearLayoutEffects_begin(subtreeRoot) { while (nextEffect !== null) { var fiber = nextEffect; var firstChild = fiber.child; // TODO (Offscreen) Check: flags & (RefStatic | LayoutStatic) switch (fiber.tag) { case FunctionComponent: case ForwardRef: case MemoComponent: case SimpleMemoComponent: { if ( fiber.mode & ProfileMode) { try { startLayoutEffectTimer(); commitHookEffectListUnmount(Layout, fiber, fiber.return); } finally { recordLayoutEffectDuration(fiber); } } else { commitHookEffectListUnmount(Layout, fiber, fiber.return); } break; } case ClassComponent: { // TODO (Offscreen) Check: flags & RefStatic safelyDetachRef(fiber, fiber.return); var instance = fiber.stateNode; if (typeof instance.componentWillUnmount === 'function') { safelyCallComponentWillUnmount(fiber, fiber.return, instance); } break; } case HostComponent: { safelyDetachRef(fiber, fiber.return); break; } case OffscreenComponent: { // Check if this is a var isHidden = fiber.memoizedState !== null; if (isHidden) { // Nested Offscreen tree is already hidden. Don't disappear // its effects. disappearLayoutEffects_complete(subtreeRoot); continue; } break; } } // TODO (Offscreen) Check: subtreeFlags & LayoutStatic if (firstChild !== null) { firstChild.return = fiber; nextEffect = firstChild; } else { disappearLayoutEffects_complete(subtreeRoot); } } } function disappearLayoutEffects_complete(subtreeRoot) { while (nextEffect !== null) { var fiber = nextEffect; if (fiber === subtreeRoot) { nextEffect = null; return; } var sibling = fiber.sibling; if (sibling !== null) { sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function reappearLayoutEffects_begin(subtreeRoot) { while (nextEffect !== null) { var fiber = nextEffect; var firstChild = fiber.child; if (fiber.tag === OffscreenComponent) { var isHidden = fiber.memoizedState !== null; if (isHidden) { // Nested Offscreen tree is still hidden. Don't re-appear its effects. reappearLayoutEffects_complete(subtreeRoot); continue; } } // TODO (Offscreen) Check: subtreeFlags & LayoutStatic if (firstChild !== null) { // This node may have been reused from a previous render, so we can't // assume its return pointer is correct. firstChild.return = fiber; nextEffect = firstChild; } else { reappearLayoutEffects_complete(subtreeRoot); } } } function reappearLayoutEffects_complete(subtreeRoot) { while (nextEffect !== null) { var fiber = nextEffect; // TODO (Offscreen) Check: flags & LayoutStatic setCurrentFiber(fiber); try { reappearLayoutEffectsOnFiber(fiber); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } resetCurrentFiber(); if (fiber === subtreeRoot) { nextEffect = null; return; } var sibling = fiber.sibling; if (sibling !== null) { // This node may have been reused from a previous render, so we can't // assume its return pointer is correct. sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function commitPassiveMountEffects(root, finishedWork, committedLanes, committedTransitions) { nextEffect = finishedWork; commitPassiveMountEffects_begin(finishedWork, root, committedLanes, committedTransitions); } function commitPassiveMountEffects_begin(subtreeRoot, root, committedLanes, committedTransitions) { while (nextEffect !== null) { var fiber = nextEffect; var firstChild = fiber.child; if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && firstChild !== null) { firstChild.return = fiber; nextEffect = firstChild; } else { commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions); } } } function commitPassiveMountEffects_complete(subtreeRoot, root, committedLanes, committedTransitions) { while (nextEffect !== null) { var fiber = nextEffect; if ((fiber.flags & Passive) !== NoFlags) { setCurrentFiber(fiber); try { commitPassiveMountOnFiber(root, fiber, committedLanes, committedTransitions); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } resetCurrentFiber(); } if (fiber === subtreeRoot) { nextEffect = null; return; } var sibling = fiber.sibling; if (sibling !== null) { sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function commitPassiveMountOnFiber(finishedRoot, finishedWork, committedLanes, committedTransitions) { switch (finishedWork.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { if ( finishedWork.mode & ProfileMode) { startPassiveEffectTimer(); try { commitHookEffectListMount(Passive$1 | HasEffect, finishedWork); } finally { recordPassiveEffectDuration(finishedWork); } } else { commitHookEffectListMount(Passive$1 | HasEffect, finishedWork); } break; } } } function commitPassiveUnmountEffects(firstChild) { nextEffect = firstChild; commitPassiveUnmountEffects_begin(); } function commitPassiveUnmountEffects_begin() { while (nextEffect !== null) { var fiber = nextEffect; var child = fiber.child; if ((nextEffect.flags & ChildDeletion) !== NoFlags) { var deletions = fiber.deletions; if (deletions !== null) { for (var i = 0; i < deletions.length; i++) { var fiberToDelete = deletions[i]; nextEffect = fiberToDelete; commitPassiveUnmountEffectsInsideOfDeletedTree_begin(fiberToDelete, fiber); } { // A fiber was deleted from this parent fiber, but it's still part of // the previous (alternate) parent fiber's list of children. Because // children are a linked list, an earlier sibling that's still alive // will be connected to the deleted fiber via its `alternate`: // // live fiber // --alternate--> previous live fiber // --sibling--> deleted fiber // // We can't disconnect `alternate` on nodes that haven't been deleted // yet, but we can disconnect the `sibling` and `child` pointers. var previousFiber = fiber.alternate; if (previousFiber !== null) { var detachedChild = previousFiber.child; if (detachedChild !== null) { previousFiber.child = null; do { var detachedSibling = detachedChild.sibling; detachedChild.sibling = null; detachedChild = detachedSibling; } while (detachedChild !== null); } } } nextEffect = fiber; } } if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) { child.return = fiber; nextEffect = child; } else { commitPassiveUnmountEffects_complete(); } } } function commitPassiveUnmountEffects_complete() { while (nextEffect !== null) { var fiber = nextEffect; if ((fiber.flags & Passive) !== NoFlags) { setCurrentFiber(fiber); commitPassiveUnmountOnFiber(fiber); resetCurrentFiber(); } var sibling = fiber.sibling; if (sibling !== null) { sibling.return = fiber.return; nextEffect = sibling; return; } nextEffect = fiber.return; } } function commitPassiveUnmountOnFiber(finishedWork) { switch (finishedWork.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { if ( finishedWork.mode & ProfileMode) { startPassiveEffectTimer(); commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return); recordPassiveEffectDuration(finishedWork); } else { commitHookEffectListUnmount(Passive$1 | HasEffect, finishedWork, finishedWork.return); } break; } } } function commitPassiveUnmountEffectsInsideOfDeletedTree_begin(deletedSubtreeRoot, nearestMountedAncestor) { while (nextEffect !== null) { var fiber = nextEffect; // Deletion effects fire in parent -> child order // TODO: Check if fiber has a PassiveStatic flag setCurrentFiber(fiber); commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor); resetCurrentFiber(); var child = fiber.child; // TODO: Only traverse subtree if it has a PassiveStatic flag. (But, if we // do this, still need to handle `deletedTreeCleanUpLevel` correctly.) if (child !== null) { child.return = fiber; nextEffect = child; } else { commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot); } } } function commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot) { while (nextEffect !== null) { var fiber = nextEffect; var sibling = fiber.sibling; var returnFiber = fiber.return; { // Recursively traverse the entire deleted tree and clean up fiber fields. // This is more aggressive than ideal, and the long term goal is to only // have to detach the deleted tree at the root. detachFiberAfterEffects(fiber); if (fiber === deletedSubtreeRoot) { nextEffect = null; return; } } if (sibling !== null) { sibling.return = returnFiber; nextEffect = sibling; return; } nextEffect = returnFiber; } } function commitPassiveUnmountInsideDeletedTreeOnFiber(current, nearestMountedAncestor) { switch (current.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { if ( current.mode & ProfileMode) { startPassiveEffectTimer(); commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor); recordPassiveEffectDuration(current); } else { commitHookEffectListUnmount(Passive$1, current, nearestMountedAncestor); } break; } } } // TODO: Reuse reappearLayoutEffects traversal here? function invokeLayoutEffectMountInDEV(fiber) { { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { try { commitHookEffectListMount(Layout | HasEffect, fiber); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } break; } case ClassComponent: { var instance = fiber.stateNode; try { instance.componentDidMount(); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } break; } } } } function invokePassiveEffectMountInDEV(fiber) { { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { try { commitHookEffectListMount(Passive$1 | HasEffect, fiber); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } break; } } } } function invokeLayoutEffectUnmountInDEV(fiber) { { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { try { commitHookEffectListUnmount(Layout | HasEffect, fiber, fiber.return); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } break; } case ClassComponent: { var instance = fiber.stateNode; if (typeof instance.componentWillUnmount === 'function') { safelyCallComponentWillUnmount(fiber, fiber.return, instance); } break; } } } } function invokePassiveEffectUnmountInDEV(fiber) { { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { try { commitHookEffectListUnmount(Passive$1 | HasEffect, fiber, fiber.return); } catch (error) { captureCommitPhaseError(fiber, fiber.return, error); } } } } } var COMPONENT_TYPE = 0; var HAS_PSEUDO_CLASS_TYPE = 1; var ROLE_TYPE = 2; var TEST_NAME_TYPE = 3; var TEXT_TYPE = 4; if (typeof Symbol === 'function' && Symbol.for) { var symbolFor = Symbol.for; COMPONENT_TYPE = symbolFor('selector.component'); HAS_PSEUDO_CLASS_TYPE = symbolFor('selector.has_pseudo_class'); ROLE_TYPE = symbolFor('selector.role'); TEST_NAME_TYPE = symbolFor('selector.test_id'); TEXT_TYPE = symbolFor('selector.text'); } var commitHooks = []; function onCommitRoot$1() { { commitHooks.forEach(function (commitHook) { return commitHook(); }); } } var ReactCurrentActQueue = ReactSharedInternals.ReactCurrentActQueue; function isLegacyActEnvironment(fiber) { { // Legacy mode. We preserve the behavior of React 17's act. It assumes an // act environment whenever `jest` is defined, but you can still turn off // spurious warnings by setting IS_REACT_ACT_ENVIRONMENT explicitly // to false. var isReactActEnvironmentGlobal = // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined' ? IS_REACT_ACT_ENVIRONMENT : undefined; // $FlowExpectedError - Flow doesn't know about jest var jestIsDefined = typeof jest !== 'undefined'; return jestIsDefined && isReactActEnvironmentGlobal !== false; } } function isConcurrentActEnvironment() { { var isReactActEnvironmentGlobal = // $FlowExpectedError – Flow doesn't know about IS_REACT_ACT_ENVIRONMENT global typeof IS_REACT_ACT_ENVIRONMENT !== 'undefined' ? IS_REACT_ACT_ENVIRONMENT : undefined; if (!isReactActEnvironmentGlobal && ReactCurrentActQueue.current !== null) { // TODO: Include link to relevant documentation page. error('The current testing environment is not configured to support ' + 'act(...)'); } return isReactActEnvironmentGlobal; } } var ceil = Math.ceil; var ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, ReactCurrentBatchConfig$3 = ReactSharedInternals.ReactCurrentBatchConfig, ReactCurrentActQueue$1 = ReactSharedInternals.ReactCurrentActQueue; var NoContext = /* */ 0; var BatchedContext = /* */ 1; var RenderContext = /* */ 2; var CommitContext = /* */ 4; var RootInProgress = 0; var RootFatalErrored = 1; var RootErrored = 2; var RootSuspended = 3; var RootSuspendedWithDelay = 4; var RootCompleted = 5; var RootDidNotComplete = 6; // Describes where we are in the React execution stack var executionContext = NoContext; // The root we're working on var workInProgressRoot = null; // The fiber we're working on var workInProgress = null; // The lanes we're rendering var workInProgressRootRenderLanes = NoLanes; // Stack that allows components to change the render lanes for its subtree // This is a superset of the lanes we started working on at the root. The only // case where it's different from `workInProgressRootRenderLanes` is when we // enter a subtree that is hidden and needs to be unhidden: Suspense and // Offscreen component. // // Most things in the work loop should deal with workInProgressRootRenderLanes. // Most things in begin/complete phases should deal with subtreeRenderLanes. var subtreeRenderLanes = NoLanes; var subtreeRenderLanesCursor = createCursor(NoLanes); // Whether to root completed, errored, suspended, etc. var workInProgressRootExitStatus = RootInProgress; // A fatal error, if one is thrown var workInProgressRootFatalError = null; // "Included" lanes refer to lanes that were worked on during this render. It's // slightly different than `renderLanes` because `renderLanes` can change as you // enter and exit an Offscreen tree. This value is the combination of all render // lanes for the entire render phase. var workInProgressRootIncludedLanes = NoLanes; // The work left over by components that were visited during this render. Only // includes unprocessed updates, not work in bailed out children. var workInProgressRootSkippedLanes = NoLanes; // Lanes that were updated (in an interleaved event) during this render. var workInProgressRootInterleavedUpdatedLanes = NoLanes; // Lanes that were updated during the render phase (*not* an interleaved event). var workInProgressRootPingedLanes = NoLanes; // Errors that are thrown during the render phase. var workInProgressRootConcurrentErrors = null; // These are errors that we recovered from without surfacing them to the UI. // We will log them once the tree commits. var workInProgressRootRecoverableErrors = null; // The most recent time we committed a fallback. This lets us ensure a train // model where we don't commit new loading states in too quick succession. var globalMostRecentFallbackTime = 0; var FALLBACK_THROTTLE_MS = 500; // The absolute time for when we should start giving up on rendering // more and prefer CPU suspense heuristics instead. var workInProgressRootRenderTargetTime = Infinity; // How long a render is supposed to take before we start following CPU // suspense heuristics and opt out of rendering more content. var RENDER_TIMEOUT_MS = 500; var workInProgressTransitions = null; function resetRenderTimer() { workInProgressRootRenderTargetTime = now() + RENDER_TIMEOUT_MS; } function getRenderTargetTime() { return workInProgressRootRenderTargetTime; } var hasUncaughtError = false; var firstUncaughtError = null; var legacyErrorBoundariesThatAlreadyFailed = null; // Only used when enableProfilerNestedUpdateScheduledHook is true; var rootDoesHavePassiveEffects = false; var rootWithPendingPassiveEffects = null; var pendingPassiveEffectsLanes = NoLanes; var pendingPassiveProfilerEffects = []; var pendingPassiveTransitions = null; // Use these to prevent an infinite loop of nested updates var NESTED_UPDATE_LIMIT = 50; var nestedUpdateCount = 0; var rootWithNestedUpdates = null; var isFlushingPassiveEffects = false; var didScheduleUpdateDuringPassiveEffects = false; var NESTED_PASSIVE_UPDATE_LIMIT = 50; var nestedPassiveUpdateCount = 0; var rootWithPassiveNestedUpdates = null; // If two updates are scheduled within the same event, we should treat their // event times as simultaneous, even if the actual clock time has advanced // between the first and second call. var currentEventTime = NoTimestamp; var currentEventTransitionLane = NoLanes; var isRunningInsertionEffect = false; function getWorkInProgressRoot() { return workInProgressRoot; } function requestEventTime() { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { // We're inside React, so it's fine to read the actual time. return now(); } // We're not inside React, so we may be in the middle of a browser event. if (currentEventTime !== NoTimestamp) { // Use the same start time for all updates until we enter React again. return currentEventTime; } // This is the first update since React yielded. Compute a new start time. currentEventTime = now(); return currentEventTime; } function requestUpdateLane(fiber) { // Special cases var mode = fiber.mode; if ((mode & ConcurrentMode) === NoMode) { return SyncLane; } else if ( (executionContext & RenderContext) !== NoContext && workInProgressRootRenderLanes !== NoLanes) { // This is a render phase update. These are not officially supported. The // old behavior is to give this the same "thread" (lanes) as // whatever is currently rendering. So if you call `setState` on a component // that happens later in the same render, it will flush. Ideally, we want to // remove the special case and treat them as if they came from an // interleaved event. Regardless, this pattern is not officially supported. // This behavior is only a fallback. The flag only exists until we can roll // out the setState warning, since existing code might accidentally rely on // the current behavior. return pickArbitraryLane(workInProgressRootRenderLanes); } var isTransition = requestCurrentTransition() !== NoTransition; if (isTransition) { if ( ReactCurrentBatchConfig$3.transition !== null) { var transition = ReactCurrentBatchConfig$3.transition; if (!transition._updatedFibers) { transition._updatedFibers = new Set(); } transition._updatedFibers.add(fiber); } // The algorithm for assigning an update to a lane should be stable for all // updates at the same priority within the same event. To do this, the // inputs to the algorithm must be the same. // // The trick we use is to cache the first of each of these inputs within an // event. Then reset the cached values once we can be sure the event is // over. Our heuristic for that is whenever we enter a concurrent work loop. if (currentEventTransitionLane === NoLane) { // All transitions within the same event are assigned the same lane. currentEventTransitionLane = claimNextTransitionLane(); } return currentEventTransitionLane; } // Updates originating inside certain React methods, like flushSync, have // their priority set by tracking it with a context variable. // // The opaque type returned by the host config is internally a lane, so we can // use that directly. // TODO: Move this type conversion to the event priority module. var updateLane = getCurrentUpdatePriority(); if (updateLane !== NoLane) { return updateLane; } // This update originated outside React. Ask the host environment for an // appropriate priority, based on the type of event. // // The opaque type returned by the host config is internally a lane, so we can // use that directly. // TODO: Move this type conversion to the event priority module. var eventLane = getCurrentEventPriority(); return eventLane; } function requestRetryLane(fiber) { // This is a fork of `requestUpdateLane` designed specifically for Suspense // "retries" — a special update that attempts to flip a Suspense boundary // from its placeholder state to its primary/resolved state. // Special cases var mode = fiber.mode; if ((mode & ConcurrentMode) === NoMode) { return SyncLane; } return claimNextRetryLane(); } function scheduleUpdateOnFiber(root, fiber, lane, eventTime) { checkForNestedUpdates(); { if (isRunningInsertionEffect) { error('useInsertionEffect must not schedule updates.'); } } { if (isFlushingPassiveEffects) { didScheduleUpdateDuringPassiveEffects = true; } } // Mark that the root has a pending update. markRootUpdated(root, lane, eventTime); if ((executionContext & RenderContext) !== NoLanes && root === workInProgressRoot) { // This update was dispatched during the render phase. This is a mistake // if the update originates from user space (with the exception of local // hook updates, which are handled differently and don't reach this // function), but there are some internal React features that use this as // an implementation detail, like selective hydration. warnAboutRenderPhaseUpdatesInDEV(fiber); // Track lanes that were updated during the render phase } else { // This is a normal update, scheduled from outside the render phase. For // example, during an input event. { if (isDevToolsPresent) { addFiberToLanesMap(root, fiber, lane); } } warnIfUpdatesNotWrappedWithActDEV(fiber); if (root === workInProgressRoot) { // Received an update to a tree that's in the middle of rendering. Mark // that there was an interleaved update work on this root. Unless the // `deferRenderPhaseUpdateToNextBatch` flag is off and this is a render // phase update. In that case, we don't treat render phase updates as if // they were interleaved, for backwards compat reasons. if ( (executionContext & RenderContext) === NoContext) { workInProgressRootInterleavedUpdatedLanes = mergeLanes(workInProgressRootInterleavedUpdatedLanes, lane); } if (workInProgressRootExitStatus === RootSuspendedWithDelay) { // The root already suspended with a delay, which means this render // definitely won't finish. Since we have a new update, let's mark it as // suspended now, right before marking the incoming update. This has the // effect of interrupting the current render and switching to the update. // TODO: Make sure this doesn't override pings that happen while we've // already started rendering. markRootSuspended$1(root, workInProgressRootRenderLanes); } } ensureRootIsScheduled(root, eventTime); if (lane === SyncLane && executionContext === NoContext && (fiber.mode & ConcurrentMode) === NoMode && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode. !( ReactCurrentActQueue$1.isBatchingLegacy)) { // Flush the synchronous work now, unless we're already working or inside // a batch. This is intentionally inside scheduleUpdateOnFiber instead of // scheduleCallbackForFiber to preserve the ability to schedule a callback // without immediately flushing it. We only do this for user-initiated // updates, to preserve historical behavior of legacy mode. resetRenderTimer(); flushSyncCallbacksOnlyInLegacyMode(); } } } function scheduleInitialHydrationOnRoot(root, lane, eventTime) { // This is a special fork of scheduleUpdateOnFiber that is only used to // schedule the initial hydration of a root that has just been created. Most // of the stuff in scheduleUpdateOnFiber can be skipped. // // The main reason for this separate path, though, is to distinguish the // initial children from subsequent updates. In fully client-rendered roots // (createRoot instead of hydrateRoot), all top-level renders are modeled as // updates, but hydration roots are special because the initial render must // match what was rendered on the server. var current = root.current; current.lanes = lane; markRootUpdated(root, lane, eventTime); ensureRootIsScheduled(root, eventTime); } function isUnsafeClassRenderPhaseUpdate(fiber) { // Check if this is a render phase update. Only called by class components, // which special (deprecated) behavior for UNSAFE_componentWillReceive props. return (// TODO: Remove outdated deferRenderPhaseUpdateToNextBatch experiment. We // decided not to enable it. (executionContext & RenderContext) !== NoContext ); } // Use this function to schedule a task for a root. There's only one task per // root; if a task was already scheduled, we'll check to make sure the priority // of the existing task is the same as the priority of the next level that the // root has work on. This function is called on every update, and right before // exiting a task. function ensureRootIsScheduled(root, currentTime) { var existingCallbackNode = root.callbackNode; // Check if any lanes are being starved by other work. If so, mark them as // expired so we know to work on those next. markStarvedLanesAsExpired(root, currentTime); // Determine the next lanes to work on, and their priority. var nextLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); if (nextLanes === NoLanes) { // Special case: There's nothing to work on. if (existingCallbackNode !== null) { cancelCallback$1(existingCallbackNode); } root.callbackNode = null; root.callbackPriority = NoLane; return; } // We use the highest priority lane to represent the priority of the callback. var newCallbackPriority = getHighestPriorityLane(nextLanes); // Check if there's an existing task. We may be able to reuse it. var existingCallbackPriority = root.callbackPriority; if (existingCallbackPriority === newCallbackPriority && // Special case related to `act`. If the currently scheduled task is a // Scheduler task, rather than an `act` task, cancel it and re-scheduled // on the `act` queue. !( ReactCurrentActQueue$1.current !== null && existingCallbackNode !== fakeActCallbackNode)) { { // If we're going to re-use an existing task, it needs to exist. // Assume that discrete update microtasks are non-cancellable and null. // TODO: Temporary until we confirm this warning is not fired. if (existingCallbackNode == null && existingCallbackPriority !== SyncLane) { error('Expected scheduled callback to exist. This error is likely caused by a bug in React. Please file an issue.'); } } // The priority hasn't changed. We can reuse the existing task. Exit. return; } if (existingCallbackNode != null) { // Cancel the existing callback. We'll schedule a new one below. cancelCallback$1(existingCallbackNode); } // Schedule a new callback. var newCallbackNode; if (newCallbackPriority === SyncLane) { // Special case: Sync React callbacks are scheduled on a special // internal queue if (root.tag === LegacyRoot) { if ( ReactCurrentActQueue$1.isBatchingLegacy !== null) { ReactCurrentActQueue$1.didScheduleLegacyUpdate = true; } scheduleLegacySyncCallback(performSyncWorkOnRoot.bind(null, root)); } else { scheduleSyncCallback(performSyncWorkOnRoot.bind(null, root)); } { // Flush the queue in a microtask. if ( ReactCurrentActQueue$1.current !== null) { // Inside `act`, use our internal `act` queue so that these get flushed // at the end of the current scope even when using the sync version // of `act`. ReactCurrentActQueue$1.current.push(flushSyncCallbacks); } else { scheduleMicrotask(function () { // In Safari, appending an iframe forces microtasks to run. // https://github.com/facebook/react/issues/22459 // We don't support running callbacks in the middle of render // or commit so we need to check against that. if ((executionContext & (RenderContext | CommitContext)) === NoContext) { // Note that this would still prematurely flush the callbacks // if this happens outside render or commit phase (e.g. in an event). flushSyncCallbacks(); } }); } } newCallbackNode = null; } else { var schedulerPriorityLevel; switch (lanesToEventPriority(nextLanes)) { case DiscreteEventPriority: schedulerPriorityLevel = ImmediatePriority; break; case ContinuousEventPriority: schedulerPriorityLevel = UserBlockingPriority; break; case DefaultEventPriority: schedulerPriorityLevel = NormalPriority; break; case IdleEventPriority: schedulerPriorityLevel = IdlePriority; break; default: schedulerPriorityLevel = NormalPriority; break; } newCallbackNode = scheduleCallback$1(schedulerPriorityLevel, performConcurrentWorkOnRoot.bind(null, root)); } root.callbackPriority = newCallbackPriority; root.callbackNode = newCallbackNode; } // This is the entry point for every concurrent task, i.e. anything that // goes through Scheduler. function performConcurrentWorkOnRoot(root, didTimeout) { { resetNestedUpdateFlag(); } // Since we know we're in a React event, we can clear the current // event time. The next update will compute a new event time. currentEventTime = NoTimestamp; currentEventTransitionLane = NoLanes; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { throw new Error('Should not already be working.'); } // Flush any pending passive effects before deciding which lanes to work on, // in case they schedule additional work. var originalCallbackNode = root.callbackNode; var didFlushPassiveEffects = flushPassiveEffects(); if (didFlushPassiveEffects) { // Something in the passive effect phase may have canceled the current task. // Check if the task node for this root was changed. if (root.callbackNode !== originalCallbackNode) { // The current task was canceled. Exit. We don't need to call // `ensureRootIsScheduled` because the check above implies either that // there's a new task, or that there's no remaining work on this root. return null; } } // Determine the next lanes to work on, using the fields stored // on the root. var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes); if (lanes === NoLanes) { // Defensive coding. This is never expected to happen. return null; } // We disable time-slicing in some cases: if the work has been CPU-bound // for too long ("expired" work, to prevent starvation), or we're in // sync-updates-by-default mode. // TODO: We only check `didTimeout` defensively, to account for a Scheduler // bug we're still investigating. Once the bug in Scheduler is fixed, // we can remove this, since we track expiration ourselves. var shouldTimeSlice = !includesBlockingLane(root, lanes) && !includesExpiredLane(root, lanes) && ( !didTimeout); var exitStatus = shouldTimeSlice ? renderRootConcurrent(root, lanes) : renderRootSync(root, lanes); if (exitStatus !== RootInProgress) { if (exitStatus === RootErrored) { // If something threw an error, try rendering one more time. We'll // render synchronously to block concurrent data mutations, and we'll // includes all pending updates are included. If it still fails after // the second attempt, we'll give up and commit the resulting tree. var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); if (errorRetryLanes !== NoLanes) { lanes = errorRetryLanes; exitStatus = recoverFromConcurrentError(root, errorRetryLanes); } } if (exitStatus === RootFatalErrored) { var fatalError = workInProgressRootFatalError; prepareFreshStack(root, NoLanes); markRootSuspended$1(root, lanes); ensureRootIsScheduled(root, now()); throw fatalError; } if (exitStatus === RootDidNotComplete) { // The render unwound without completing the tree. This happens in special // cases where need to exit the current render without producing a // consistent tree or committing. // // This should only happen during a concurrent render, not a discrete or // synchronous update. We should have already checked for this when we // unwound the stack. markRootSuspended$1(root, lanes); } else { // The render completed. // Check if this render may have yielded to a concurrent event, and if so, // confirm that any newly rendered stores are consistent. // TODO: It's possible that even a concurrent render may never have yielded // to the main thread, if it was fast enough, or if it expired. We could // skip the consistency check in that case, too. var renderWasConcurrent = !includesBlockingLane(root, lanes); var finishedWork = root.current.alternate; if (renderWasConcurrent && !isRenderConsistentWithExternalStores(finishedWork)) { // A store was mutated in an interleaved event. Render again, // synchronously, to block further mutations. exitStatus = renderRootSync(root, lanes); // We need to check again if something threw if (exitStatus === RootErrored) { var _errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); if (_errorRetryLanes !== NoLanes) { lanes = _errorRetryLanes; exitStatus = recoverFromConcurrentError(root, _errorRetryLanes); // We assume the tree is now consistent because we didn't yield to any // concurrent events. } } if (exitStatus === RootFatalErrored) { var _fatalError = workInProgressRootFatalError; prepareFreshStack(root, NoLanes); markRootSuspended$1(root, lanes); ensureRootIsScheduled(root, now()); throw _fatalError; } } // We now have a consistent tree. The next step is either to commit it, // or, if something suspended, wait to commit it after a timeout. root.finishedWork = finishedWork; root.finishedLanes = lanes; finishConcurrentRender(root, exitStatus, lanes); } } ensureRootIsScheduled(root, now()); if (root.callbackNode === originalCallbackNode) { // The task node scheduled for this root is the same one that's // currently executed. Need to return a continuation. return performConcurrentWorkOnRoot.bind(null, root); } return null; } function recoverFromConcurrentError(root, errorRetryLanes) { // If an error occurred during hydration, discard server response and fall // back to client side render. // Before rendering again, save the errors from the previous attempt. var errorsFromFirstAttempt = workInProgressRootConcurrentErrors; if (isRootDehydrated(root)) { // The shell failed to hydrate. Set a flag to force a client rendering // during the next attempt. To do this, we call prepareFreshStack now // to create the root work-in-progress fiber. This is a bit weird in terms // of factoring, because it relies on renderRootSync not calling // prepareFreshStack again in the call below, which happens because the // root and lanes haven't changed. // // TODO: I think what we should do is set ForceClientRender inside // throwException, like we do for nested Suspense boundaries. The reason // it's here instead is so we can switch to the synchronous work loop, too. // Something to consider for a future refactor. var rootWorkInProgress = prepareFreshStack(root, errorRetryLanes); rootWorkInProgress.flags |= ForceClientRender; { errorHydratingContainer(root.containerInfo); } } var exitStatus = renderRootSync(root, errorRetryLanes); if (exitStatus !== RootErrored) { // Successfully finished rendering on retry // The errors from the failed first attempt have been recovered. Add // them to the collection of recoverable errors. We'll log them in the // commit phase. var errorsFromSecondAttempt = workInProgressRootRecoverableErrors; workInProgressRootRecoverableErrors = errorsFromFirstAttempt; // The errors from the second attempt should be queued after the errors // from the first attempt, to preserve the causal sequence. if (errorsFromSecondAttempt !== null) { queueRecoverableErrors(errorsFromSecondAttempt); } } return exitStatus; } function queueRecoverableErrors(errors) { if (workInProgressRootRecoverableErrors === null) { workInProgressRootRecoverableErrors = errors; } else { workInProgressRootRecoverableErrors.push.apply(workInProgressRootRecoverableErrors, errors); } } function finishConcurrentRender(root, exitStatus, lanes) { switch (exitStatus) { case RootInProgress: case RootFatalErrored: { throw new Error('Root did not complete. This is a bug in React.'); } // Flow knows about invariant, so it complains if I add a break // statement, but eslint doesn't know about invariant, so it complains // if I do. eslint-disable-next-line no-fallthrough case RootErrored: { // We should have already attempted to retry this tree. If we reached // this point, it errored again. Commit it. commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); break; } case RootSuspended: { markRootSuspended$1(root, lanes); // We have an acceptable loading state. We need to figure out if we // should immediately commit it or wait a bit. if (includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope !shouldForceFlushFallbacksInDEV()) { // This render only included retries, no updates. Throttle committing // retries so that we don't show too many loading states too quickly. var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now(); // Don't bother with a very short suspense time. if (msUntilTimeout > 10) { var nextLanes = getNextLanes(root, NoLanes); if (nextLanes !== NoLanes) { // There's additional work on this root. break; } var suspendedLanes = root.suspendedLanes; if (!isSubsetOfLanes(suspendedLanes, lanes)) { // We should prefer to render the fallback of at the last // suspended level. Ping the last suspended level to try // rendering it again. // FIXME: What if the suspended lanes are Idle? Should not restart. var eventTime = requestEventTime(); markRootPinged(root, suspendedLanes); break; } // The render is suspended, it hasn't timed out, and there's no // lower priority work to do. Instead of committing the fallback // immediately, wait for more data to arrive. root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), msUntilTimeout); break; } } // The work expired. Commit immediately. commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); break; } case RootSuspendedWithDelay: { markRootSuspended$1(root, lanes); if (includesOnlyTransitions(lanes)) { // This is a transition, so we should exit without committing a // placeholder and without scheduling a timeout. Delay indefinitely // until we receive more data. break; } if (!shouldForceFlushFallbacksInDEV()) { // This is not a transition, but we did trigger an avoided state. // Schedule a placeholder to display after a short delay, using the Just // Noticeable Difference. // TODO: Is the JND optimization worth the added complexity? If this is // the only reason we track the event time, then probably not. // Consider removing. var mostRecentEventTime = getMostRecentEventTime(root, lanes); var eventTimeMs = mostRecentEventTime; var timeElapsedMs = now() - eventTimeMs; var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs; // Don't bother with a very short suspense time. if (_msUntilTimeout > 10) { // Instead of committing the fallback immediately, wait for more data // to arrive. root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout); break; } } // Commit the placeholder. commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); break; } case RootCompleted: { // The work completed. Ready to commit. commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); break; } default: { throw new Error('Unknown root exit status.'); } } } function isRenderConsistentWithExternalStores(finishedWork) { // Search the rendered tree for external store reads, and check whether the // stores were mutated in a concurrent event. Intentionally using an iterative // loop instead of recursion so we can exit early. var node = finishedWork; while (true) { if (node.flags & StoreConsistency) { var updateQueue = node.updateQueue; if (updateQueue !== null) { var checks = updateQueue.stores; if (checks !== null) { for (var i = 0; i < checks.length; i++) { var check = checks[i]; var getSnapshot = check.getSnapshot; var renderedValue = check.value; try { if (!objectIs(getSnapshot(), renderedValue)) { // Found an inconsistent store. return false; } } catch (error) { // If `getSnapshot` throws, return `false`. This will schedule // a re-render, and the error will be rethrown during render. return false; } } } } } var child = node.child; if (node.subtreeFlags & StoreConsistency && child !== null) { child.return = node; node = child; continue; } if (node === finishedWork) { return true; } while (node.sibling === null) { if (node.return === null || node.return === finishedWork) { return true; } node = node.return; } node.sibling.return = node.return; node = node.sibling; } // Flow doesn't know this is unreachable, but eslint does // eslint-disable-next-line no-unreachable return true; } function markRootSuspended$1(root, suspendedLanes) { // When suspending, we should always exclude lanes that were pinged or (more // rarely, since we try to avoid it) updated during the render phase. // TODO: Lol maybe there's a better way to factor this besides this // obnoxiously named function :) suspendedLanes = removeLanes(suspendedLanes, workInProgressRootPingedLanes); suspendedLanes = removeLanes(suspendedLanes, workInProgressRootInterleavedUpdatedLanes); markRootSuspended(root, suspendedLanes); } // This is the entry point for synchronous tasks that don't go // through Scheduler function performSyncWorkOnRoot(root) { { syncNestedUpdateFlag(); } if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { throw new Error('Should not already be working.'); } flushPassiveEffects(); var lanes = getNextLanes(root, NoLanes); if (!includesSomeLane(lanes, SyncLane)) { // There's no remaining sync work left. ensureRootIsScheduled(root, now()); return null; } var exitStatus = renderRootSync(root, lanes); if (root.tag !== LegacyRoot && exitStatus === RootErrored) { // If something threw an error, try rendering one more time. We'll render // synchronously to block concurrent data mutations, and we'll includes // all pending updates are included. If it still fails after the second // attempt, we'll give up and commit the resulting tree. var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); if (errorRetryLanes !== NoLanes) { lanes = errorRetryLanes; exitStatus = recoverFromConcurrentError(root, errorRetryLanes); } } if (exitStatus === RootFatalErrored) { var fatalError = workInProgressRootFatalError; prepareFreshStack(root, NoLanes); markRootSuspended$1(root, lanes); ensureRootIsScheduled(root, now()); throw fatalError; } if (exitStatus === RootDidNotComplete) { throw new Error('Root did not complete. This is a bug in React.'); } // We now have a consistent tree. Because this is a sync render, we // will commit it even if something suspended. var finishedWork = root.current.alternate; root.finishedWork = finishedWork; root.finishedLanes = lanes; commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions); // Before exiting, make sure there's a callback scheduled for the next // pending level. ensureRootIsScheduled(root, now()); return null; } function flushRoot(root, lanes) { if (lanes !== NoLanes) { markRootEntangled(root, mergeLanes(lanes, SyncLane)); ensureRootIsScheduled(root, now()); if ((executionContext & (RenderContext | CommitContext)) === NoContext) { resetRenderTimer(); flushSyncCallbacks(); } } } function batchedUpdates$1(fn, a) { var prevExecutionContext = executionContext; executionContext |= BatchedContext; try { return fn(a); } finally { executionContext = prevExecutionContext; // If there were legacy sync updates, flush them at the end of the outer // most batchedUpdates-like method. if (executionContext === NoContext && // Treat `act` as if it's inside `batchedUpdates`, even in legacy mode. !( ReactCurrentActQueue$1.isBatchingLegacy)) { resetRenderTimer(); flushSyncCallbacksOnlyInLegacyMode(); } } } function discreteUpdates(fn, a, b, c, d) { var previousPriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig$3.transition; try { ReactCurrentBatchConfig$3.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); return fn(a, b, c, d); } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig$3.transition = prevTransition; if (executionContext === NoContext) { resetRenderTimer(); } } } // Overload the definition to the two valid signatures. // Warning, this opts-out of checking the function body. // eslint-disable-next-line no-redeclare function flushSync(fn) { // In legacy mode, we flush pending passive effects at the beginning of the // next event, not at the end of the previous one. if (rootWithPendingPassiveEffects !== null && rootWithPendingPassiveEffects.tag === LegacyRoot && (executionContext & (RenderContext | CommitContext)) === NoContext) { flushPassiveEffects(); } var prevExecutionContext = executionContext; executionContext |= BatchedContext; var prevTransition = ReactCurrentBatchConfig$3.transition; var previousPriority = getCurrentUpdatePriority(); try { ReactCurrentBatchConfig$3.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); if (fn) { return fn(); } else { return undefined; } } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig$3.transition = prevTransition; executionContext = prevExecutionContext; // Flush the immediate callbacks that were scheduled during this batch. // Note that this will happen even if batchedUpdates is higher up // the stack. if ((executionContext & (RenderContext | CommitContext)) === NoContext) { flushSyncCallbacks(); } } } function isAlreadyRendering() { // Used by the renderer to print a warning if certain APIs are called from // the wrong context. return (executionContext & (RenderContext | CommitContext)) !== NoContext; } function pushRenderLanes(fiber, lanes) { push(subtreeRenderLanesCursor, subtreeRenderLanes, fiber); subtreeRenderLanes = mergeLanes(subtreeRenderLanes, lanes); workInProgressRootIncludedLanes = mergeLanes(workInProgressRootIncludedLanes, lanes); } function popRenderLanes(fiber) { subtreeRenderLanes = subtreeRenderLanesCursor.current; pop(subtreeRenderLanesCursor, fiber); } function prepareFreshStack(root, lanes) { root.finishedWork = null; root.finishedLanes = NoLanes; var timeoutHandle = root.timeoutHandle; if (timeoutHandle !== noTimeout) { // The root previous suspended and scheduled a timeout to commit a fallback // state. Now that we have additional work, cancel the timeout. root.timeoutHandle = noTimeout; // $FlowFixMe Complains noTimeout is not a TimeoutID, despite the check above cancelTimeout(timeoutHandle); } if (workInProgress !== null) { var interruptedWork = workInProgress.return; while (interruptedWork !== null) { var current = interruptedWork.alternate; unwindInterruptedWork(current, interruptedWork); interruptedWork = interruptedWork.return; } } workInProgressRoot = root; var rootWorkInProgress = createWorkInProgress(root.current, null); workInProgress = rootWorkInProgress; workInProgressRootRenderLanes = subtreeRenderLanes = workInProgressRootIncludedLanes = lanes; workInProgressRootExitStatus = RootInProgress; workInProgressRootFatalError = null; workInProgressRootSkippedLanes = NoLanes; workInProgressRootInterleavedUpdatedLanes = NoLanes; workInProgressRootPingedLanes = NoLanes; workInProgressRootConcurrentErrors = null; workInProgressRootRecoverableErrors = null; finishQueueingConcurrentUpdates(); { ReactStrictModeWarnings.discardPendingWarnings(); } return rootWorkInProgress; } function handleError(root, thrownValue) { do { var erroredWork = workInProgress; try { // Reset module-level state that was set during the render phase. resetContextDependencies(); resetHooksAfterThrow(); resetCurrentFiber(); // TODO: I found and added this missing line while investigating a // separate issue. Write a regression test using string refs. ReactCurrentOwner$2.current = null; if (erroredWork === null || erroredWork.return === null) { // Expected to be working on a non-root fiber. This is a fatal error // because there's no ancestor that can handle it; the root is // supposed to capture all errors that weren't caught by an error // boundary. workInProgressRootExitStatus = RootFatalErrored; workInProgressRootFatalError = thrownValue; // Set `workInProgress` to null. This represents advancing to the next // sibling, or the parent if there are no siblings. But since the root // has no siblings nor a parent, we set it to null. Usually this is // handled by `completeUnitOfWork` or `unwindWork`, but since we're // intentionally not calling those, we need set it here. // TODO: Consider calling `unwindWork` to pop the contexts. workInProgress = null; return; } if (enableProfilerTimer && erroredWork.mode & ProfileMode) { // Record the time spent rendering before an error was thrown. This // avoids inaccurate Profiler durations in the case of a // suspended render. stopProfilerTimerIfRunningAndRecordDelta(erroredWork, true); } if (enableSchedulingProfiler) { markComponentRenderStopped(); if (thrownValue !== null && typeof thrownValue === 'object' && typeof thrownValue.then === 'function') { var wakeable = thrownValue; markComponentSuspended(erroredWork, wakeable, workInProgressRootRenderLanes); } else { markComponentErrored(erroredWork, thrownValue, workInProgressRootRenderLanes); } } throwException(root, erroredWork.return, erroredWork, thrownValue, workInProgressRootRenderLanes); completeUnitOfWork(erroredWork); } catch (yetAnotherThrownValue) { // Something in the return path also threw. thrownValue = yetAnotherThrownValue; if (workInProgress === erroredWork && erroredWork !== null) { // If this boundary has already errored, then we had trouble processing // the error. Bubble it to the next boundary. erroredWork = erroredWork.return; workInProgress = erroredWork; } else { erroredWork = workInProgress; } continue; } // Return to the normal work loop. return; } while (true); } function pushDispatcher() { var prevDispatcher = ReactCurrentDispatcher$2.current; ReactCurrentDispatcher$2.current = ContextOnlyDispatcher; if (prevDispatcher === null) { // The React isomorphic package does not include a default dispatcher. // Instead the first renderer will lazily attach one, in order to give // nicer error messages. return ContextOnlyDispatcher; } else { return prevDispatcher; } } function popDispatcher(prevDispatcher) { ReactCurrentDispatcher$2.current = prevDispatcher; } function markCommitTimeOfFallback() { globalMostRecentFallbackTime = now(); } function markSkippedUpdateLanes(lane) { workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes); } function renderDidSuspend() { if (workInProgressRootExitStatus === RootInProgress) { workInProgressRootExitStatus = RootSuspended; } } function renderDidSuspendDelayIfPossible() { if (workInProgressRootExitStatus === RootInProgress || workInProgressRootExitStatus === RootSuspended || workInProgressRootExitStatus === RootErrored) { workInProgressRootExitStatus = RootSuspendedWithDelay; } // Check if there are updates that we skipped tree that might have unblocked // this render. if (workInProgressRoot !== null && (includesNonIdleWork(workInProgressRootSkippedLanes) || includesNonIdleWork(workInProgressRootInterleavedUpdatedLanes))) { // Mark the current render as suspended so that we switch to working on // the updates that were skipped. Usually we only suspend at the end of // the render phase. // TODO: We should probably always mark the root as suspended immediately // (inside this function), since by suspending at the end of the render // phase introduces a potential mistake where we suspend lanes that were // pinged or updated while we were rendering. markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes); } } function renderDidError(error) { if (workInProgressRootExitStatus !== RootSuspendedWithDelay) { workInProgressRootExitStatus = RootErrored; } if (workInProgressRootConcurrentErrors === null) { workInProgressRootConcurrentErrors = [error]; } else { workInProgressRootConcurrentErrors.push(error); } } // Called during render to determine if anything has suspended. // Returns false if we're not sure. function renderHasNotSuspendedYet() { // If something errored or completed, we can't really be sure, // so those are false. return workInProgressRootExitStatus === RootInProgress; } function renderRootSync(root, lanes) { var prevExecutionContext = executionContext; executionContext |= RenderContext; var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack // and prepare a fresh one. Otherwise we'll continue where we left off. if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { { if (isDevToolsPresent) { var memoizedUpdaters = root.memoizedUpdaters; if (memoizedUpdaters.size > 0) { restorePendingUpdaters(root, workInProgressRootRenderLanes); memoizedUpdaters.clear(); } // At this point, move Fibers that scheduled the upcoming work from the Map to the Set. // If we bailout on this work, we'll move them back (like above). // It's important to move them now in case the work spawns more work at the same priority with different updaters. // That way we can keep the current update and future updates separate. movePendingFibersToMemoized(root, lanes); } } workInProgressTransitions = getTransitionsForLanes(); prepareFreshStack(root, lanes); } { markRenderStarted(lanes); } do { try { workLoopSync(); break; } catch (thrownValue) { handleError(root, thrownValue); } } while (true); resetContextDependencies(); executionContext = prevExecutionContext; popDispatcher(prevDispatcher); if (workInProgress !== null) { // This is a sync render, so we should have finished the whole tree. throw new Error('Cannot commit an incomplete root. This error is likely caused by a ' + 'bug in React. Please file an issue.'); } { markRenderStopped(); } // Set this to null to indicate there's no in-progress render. workInProgressRoot = null; workInProgressRootRenderLanes = NoLanes; return workInProgressRootExitStatus; } // The work loop is an extremely hot path. Tell Closure not to inline it. /** @noinline */ function workLoopSync() { // Already timed out, so perform work without checking if we need to yield. while (workInProgress !== null) { performUnitOfWork(workInProgress); } } function renderRootConcurrent(root, lanes) { var prevExecutionContext = executionContext; executionContext |= RenderContext; var prevDispatcher = pushDispatcher(); // If the root or lanes have changed, throw out the existing stack // and prepare a fresh one. Otherwise we'll continue where we left off. if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) { { if (isDevToolsPresent) { var memoizedUpdaters = root.memoizedUpdaters; if (memoizedUpdaters.size > 0) { restorePendingUpdaters(root, workInProgressRootRenderLanes); memoizedUpdaters.clear(); } // At this point, move Fibers that scheduled the upcoming work from the Map to the Set. // If we bailout on this work, we'll move them back (like above). // It's important to move them now in case the work spawns more work at the same priority with different updaters. // That way we can keep the current update and future updates separate. movePendingFibersToMemoized(root, lanes); } } workInProgressTransitions = getTransitionsForLanes(); resetRenderTimer(); prepareFreshStack(root, lanes); } { markRenderStarted(lanes); } do { try { workLoopConcurrent(); break; } catch (thrownValue) { handleError(root, thrownValue); } } while (true); resetContextDependencies(); popDispatcher(prevDispatcher); executionContext = prevExecutionContext; if (workInProgress !== null) { // Still work remaining. { markRenderYielded(); } return RootInProgress; } else { // Completed the tree. { markRenderStopped(); } // Set this to null to indicate there's no in-progress render. workInProgressRoot = null; workInProgressRootRenderLanes = NoLanes; // Return the final exit status. return workInProgressRootExitStatus; } } /** @noinline */ function workLoopConcurrent() { // Perform work until Scheduler asks us to yield while (workInProgress !== null && !shouldYield()) { performUnitOfWork(workInProgress); } } function performUnitOfWork(unitOfWork) { // The current, flushed, state of this fiber is the alternate. Ideally // nothing should rely on this, but relying on it here means that we don't // need an additional field on the work in progress. var current = unitOfWork.alternate; setCurrentFiber(unitOfWork); var next; if ( (unitOfWork.mode & ProfileMode) !== NoMode) { startProfilerTimer(unitOfWork); next = beginWork$1(current, unitOfWork, subtreeRenderLanes); stopProfilerTimerIfRunningAndRecordDelta(unitOfWork, true); } else { next = beginWork$1(current, unitOfWork, subtreeRenderLanes); } resetCurrentFiber(); unitOfWork.memoizedProps = unitOfWork.pendingProps; if (next === null) { // If this doesn't spawn new work, complete the current work. completeUnitOfWork(unitOfWork); } else { workInProgress = next; } ReactCurrentOwner$2.current = null; } function completeUnitOfWork(unitOfWork) { // Attempt to complete the current unit of work, then move to the next // sibling. If there are no more siblings, return to the parent fiber. var completedWork = unitOfWork; do { // The current, flushed, state of this fiber is the alternate. Ideally // nothing should rely on this, but relying on it here means that we don't // need an additional field on the work in progress. var current = completedWork.alternate; var returnFiber = completedWork.return; // Check if the work completed or if something threw. if ((completedWork.flags & Incomplete) === NoFlags) { setCurrentFiber(completedWork); var next = void 0; if ( (completedWork.mode & ProfileMode) === NoMode) { next = completeWork(current, completedWork, subtreeRenderLanes); } else { startProfilerTimer(completedWork); next = completeWork(current, completedWork, subtreeRenderLanes); // Update render duration assuming we didn't error. stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); } resetCurrentFiber(); if (next !== null) { // Completing this fiber spawned new work. Work on that next. workInProgress = next; return; } } else { // This fiber did not complete because something threw. Pop values off // the stack without entering the complete phase. If this is a boundary, // capture values if possible. var _next = unwindWork(current, completedWork); // Because this fiber did not complete, don't reset its lanes. if (_next !== null) { // If completing this work spawned new work, do that next. We'll come // back here again. // Since we're restarting, remove anything that is not a host effect // from the effect tag. _next.flags &= HostEffectMask; workInProgress = _next; return; } if ( (completedWork.mode & ProfileMode) !== NoMode) { // Record the render duration for the fiber that errored. stopProfilerTimerIfRunningAndRecordDelta(completedWork, false); // Include the time spent working on failed children before continuing. var actualDuration = completedWork.actualDuration; var child = completedWork.child; while (child !== null) { actualDuration += child.actualDuration; child = child.sibling; } completedWork.actualDuration = actualDuration; } if (returnFiber !== null) { // Mark the parent fiber as incomplete and clear its subtree flags. returnFiber.flags |= Incomplete; returnFiber.subtreeFlags = NoFlags; returnFiber.deletions = null; } else { // We've unwound all the way to the root. workInProgressRootExitStatus = RootDidNotComplete; workInProgress = null; return; } } var siblingFiber = completedWork.sibling; if (siblingFiber !== null) { // If there is more work to do in this returnFiber, do that next. workInProgress = siblingFiber; return; } // Otherwise, return to the parent completedWork = returnFiber; // Update the next thing we're working on in case something throws. workInProgress = completedWork; } while (completedWork !== null); // We've reached the root. if (workInProgressRootExitStatus === RootInProgress) { workInProgressRootExitStatus = RootCompleted; } } function commitRoot(root, recoverableErrors, transitions) { // TODO: This no longer makes any sense. We already wrap the mutation and // layout phases. Should be able to remove. var previousUpdateLanePriority = getCurrentUpdatePriority(); var prevTransition = ReactCurrentBatchConfig$3.transition; try { ReactCurrentBatchConfig$3.transition = null; setCurrentUpdatePriority(DiscreteEventPriority); commitRootImpl(root, recoverableErrors, transitions, previousUpdateLanePriority); } finally { ReactCurrentBatchConfig$3.transition = prevTransition; setCurrentUpdatePriority(previousUpdateLanePriority); } return null; } function commitRootImpl(root, recoverableErrors, transitions, renderPriorityLevel) { do { // `flushPassiveEffects` will call `flushSyncUpdateQueue` at the end, which // means `flushPassiveEffects` will sometimes result in additional // passive effects. So we need to keep flushing in a loop until there are // no more pending effects. // TODO: Might be better if `flushPassiveEffects` did not automatically // flush synchronous work at the end, to avoid factoring hazards like this. flushPassiveEffects(); } while (rootWithPendingPassiveEffects !== null); flushRenderPhaseStrictModeWarningsInDEV(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { throw new Error('Should not already be working.'); } var finishedWork = root.finishedWork; var lanes = root.finishedLanes; { markCommitStarted(lanes); } if (finishedWork === null) { { markCommitStopped(); } return null; } else { { if (lanes === NoLanes) { error('root.finishedLanes should not be empty during a commit. This is a ' + 'bug in React.'); } } } root.finishedWork = null; root.finishedLanes = NoLanes; if (finishedWork === root.current) { throw new Error('Cannot commit the same tree as before. This error is likely caused by ' + 'a bug in React. Please file an issue.'); } // commitRoot never returns a continuation; it always finishes synchronously. // So we can clear these now to allow a new callback to be scheduled. root.callbackNode = null; root.callbackPriority = NoLane; // Update the first and last pending times on this root. The new first // pending time is whatever is left on the root fiber. var remainingLanes = mergeLanes(finishedWork.lanes, finishedWork.childLanes); markRootFinished(root, remainingLanes); if (root === workInProgressRoot) { // We can reset these now that they are finished. workInProgressRoot = null; workInProgress = null; workInProgressRootRenderLanes = NoLanes; } // If there are pending passive effects, schedule a callback to process them. // Do this as early as possible, so it is queued before anything else that // might get scheduled in the commit phase. (See #16714.) // TODO: Delete all other places that schedule the passive effect callback // They're redundant. if ((finishedWork.subtreeFlags & PassiveMask) !== NoFlags || (finishedWork.flags & PassiveMask) !== NoFlags) { if (!rootDoesHavePassiveEffects) { rootDoesHavePassiveEffects = true; // to store it in pendingPassiveTransitions until they get processed // We need to pass this through as an argument to commitRoot // because workInProgressTransitions might have changed between // the previous render and commit if we throttle the commit // with setTimeout pendingPassiveTransitions = transitions; scheduleCallback$1(NormalPriority, function () { flushPassiveEffects(); // This render triggered passive effects: release the root cache pool // *after* passive effects fire to avoid freeing a cache pool that may // be referenced by a node in the tree (HostRoot, Cache boundary etc) return null; }); } } // Check if there are any effects in the whole tree. // TODO: This is left over from the effect list implementation, where we had // to check for the existence of `firstEffect` to satisfy Flow. I think the // only other reason this optimization exists is because it affects profiling. // Reconsider whether this is necessary. var subtreeHasEffects = (finishedWork.subtreeFlags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags; var rootHasEffect = (finishedWork.flags & (BeforeMutationMask | MutationMask | LayoutMask | PassiveMask)) !== NoFlags; if (subtreeHasEffects || rootHasEffect) { var prevTransition = ReactCurrentBatchConfig$3.transition; ReactCurrentBatchConfig$3.transition = null; var previousPriority = getCurrentUpdatePriority(); setCurrentUpdatePriority(DiscreteEventPriority); var prevExecutionContext = executionContext; executionContext |= CommitContext; // Reset this to null before calling lifecycles ReactCurrentOwner$2.current = null; // The commit phase is broken into several sub-phases. We do a separate pass // of the effect list for each phase: all mutation effects come before all // layout effects, and so on. // The first phase a "before mutation" phase. We use this phase to read the // state of the host tree right before we mutate it. This is where // getSnapshotBeforeUpdate is called. var shouldFireAfterActiveInstanceBlur = commitBeforeMutationEffects(root, finishedWork); { // Mark the current commit time to be shared by all Profilers in this // batch. This enables them to be grouped later. recordCommitTime(); } commitMutationEffects(root, finishedWork, lanes); resetAfterCommit(root.containerInfo); // The work-in-progress tree is now the current tree. This must come after // the mutation phase, so that the previous tree is still current during // componentWillUnmount, but before the layout phase, so that the finished // work is current during componentDidMount/Update. root.current = finishedWork; // The next phase is the layout phase, where we call effects that read { markLayoutEffectsStarted(lanes); } commitLayoutEffects(finishedWork, root, lanes); { markLayoutEffectsStopped(); } // opportunity to paint. requestPaint(); executionContext = prevExecutionContext; // Reset the priority to the previous non-sync value. setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig$3.transition = prevTransition; } else { // No effects. root.current = finishedWork; // Measure these anyway so the flamegraph explicitly shows that there were // no effects. // TODO: Maybe there's a better way to report this. { recordCommitTime(); } } var rootDidHavePassiveEffects = rootDoesHavePassiveEffects; if (rootDoesHavePassiveEffects) { // This commit has passive effects. Stash a reference to them. But don't // schedule a callback until after flushing layout work. rootDoesHavePassiveEffects = false; rootWithPendingPassiveEffects = root; pendingPassiveEffectsLanes = lanes; } else { { nestedPassiveUpdateCount = 0; rootWithPassiveNestedUpdates = null; } } // Read this again, since an effect might have updated it remainingLanes = root.pendingLanes; // Check if there's remaining work on this root // TODO: This is part of the `componentDidCatch` implementation. Its purpose // is to detect whether something might have called setState inside // `componentDidCatch`. The mechanism is known to be flawed because `setState` // inside `componentDidCatch` is itself flawed — that's why we recommend // `getDerivedStateFromError` instead. However, it could be improved by // checking if remainingLanes includes Sync work, instead of whether there's // any work remaining at all (which would also include stuff like Suspense // retries or transitions). It's been like this for a while, though, so fixing // it probably isn't that urgent. if (remainingLanes === NoLanes) { // If there's no remaining work, we can clear the set of already failed // error boundaries. legacyErrorBoundariesThatAlreadyFailed = null; } { if (!rootDidHavePassiveEffects) { commitDoubleInvokeEffectsInDEV(root.current, false); } } onCommitRoot(finishedWork.stateNode, renderPriorityLevel); { if (isDevToolsPresent) { root.memoizedUpdaters.clear(); } } { onCommitRoot$1(); } // Always call this before exiting `commitRoot`, to ensure that any // additional work on this root is scheduled. ensureRootIsScheduled(root, now()); if (recoverableErrors !== null) { // There were errors during this render, but recovered from them without // needing to surface it to the UI. We log them here. var onRecoverableError = root.onRecoverableError; for (var i = 0; i < recoverableErrors.length; i++) { var recoverableError = recoverableErrors[i]; var componentStack = recoverableError.stack; var digest = recoverableError.digest; onRecoverableError(recoverableError.value, { componentStack: componentStack, digest: digest }); } } if (hasUncaughtError) { hasUncaughtError = false; var error$1 = firstUncaughtError; firstUncaughtError = null; throw error$1; } // If the passive effects are the result of a discrete render, flush them // synchronously at the end of the current task so that the result is // immediately observable. Otherwise, we assume that they are not // order-dependent and do not need to be observed by external systems, so we // can wait until after paint. // TODO: We can optimize this by not scheduling the callback earlier. Since we // currently schedule the callback in multiple places, will wait until those // are consolidated. if (includesSomeLane(pendingPassiveEffectsLanes, SyncLane) && root.tag !== LegacyRoot) { flushPassiveEffects(); } // Read this again, since a passive effect might have updated it remainingLanes = root.pendingLanes; if (includesSomeLane(remainingLanes, SyncLane)) { { markNestedUpdateScheduled(); } // Count the number of times the root synchronously re-renders without // finishing. If there are too many, it indicates an infinite update loop. if (root === rootWithNestedUpdates) { nestedUpdateCount++; } else { nestedUpdateCount = 0; rootWithNestedUpdates = root; } } else { nestedUpdateCount = 0; } // If layout work was scheduled, flush it now. flushSyncCallbacks(); { markCommitStopped(); } return null; } function flushPassiveEffects() { // Returns whether passive effects were flushed. // TODO: Combine this check with the one in flushPassiveEFfectsImpl. We should // probably just combine the two functions. I believe they were only separate // in the first place because we used to wrap it with // `Scheduler.runWithPriority`, which accepts a function. But now we track the // priority within React itself, so we can mutate the variable directly. if (rootWithPendingPassiveEffects !== null) { var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes); var priority = lowerEventPriority(DefaultEventPriority, renderPriority); var prevTransition = ReactCurrentBatchConfig$3.transition; var previousPriority = getCurrentUpdatePriority(); try { ReactCurrentBatchConfig$3.transition = null; setCurrentUpdatePriority(priority); return flushPassiveEffectsImpl(); } finally { setCurrentUpdatePriority(previousPriority); ReactCurrentBatchConfig$3.transition = prevTransition; // Once passive effects have run for the tree - giving components a } } return false; } function enqueuePendingPassiveProfilerEffect(fiber) { { pendingPassiveProfilerEffects.push(fiber); if (!rootDoesHavePassiveEffects) { rootDoesHavePassiveEffects = true; scheduleCallback$1(NormalPriority, function () { flushPassiveEffects(); return null; }); } } } function flushPassiveEffectsImpl() { if (rootWithPendingPassiveEffects === null) { return false; } // Cache and clear the transitions flag var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; var root = rootWithPendingPassiveEffects; var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; // TODO: This is sometimes out of sync with rootWithPendingPassiveEffects. // Figure out why and fix it. It's not causing any known issues (probably // because it's only used for profiling), but it's a refactor hazard. pendingPassiveEffectsLanes = NoLanes; if ((executionContext & (RenderContext | CommitContext)) !== NoContext) { throw new Error('Cannot flush passive effects while already rendering.'); } { isFlushingPassiveEffects = true; didScheduleUpdateDuringPassiveEffects = false; } { markPassiveEffectsStarted(lanes); } var prevExecutionContext = executionContext; executionContext |= CommitContext; commitPassiveUnmountEffects(root.current); commitPassiveMountEffects(root, root.current, lanes, transitions); // TODO: Move to commitPassiveMountEffects { var profilerEffects = pendingPassiveProfilerEffects; pendingPassiveProfilerEffects = []; for (var i = 0; i < profilerEffects.length; i++) { var _fiber = profilerEffects[i]; commitPassiveEffectDurations(root, _fiber); } } { markPassiveEffectsStopped(); } { commitDoubleInvokeEffectsInDEV(root.current, true); } executionContext = prevExecutionContext; flushSyncCallbacks(); { // If additional passive effects were scheduled, increment a counter. If this // exceeds the limit, we'll fire a warning. if (didScheduleUpdateDuringPassiveEffects) { if (root === rootWithPassiveNestedUpdates) { nestedPassiveUpdateCount++; } else { nestedPassiveUpdateCount = 0; rootWithPassiveNestedUpdates = root; } } else { nestedPassiveUpdateCount = 0; } isFlushingPassiveEffects = false; didScheduleUpdateDuringPassiveEffects = false; } // TODO: Move to commitPassiveMountEffects onPostCommitRoot(root); { var stateNode = root.current.stateNode; stateNode.effectDuration = 0; stateNode.passiveEffectDuration = 0; } return true; } function isAlreadyFailedLegacyErrorBoundary(instance) { return legacyErrorBoundariesThatAlreadyFailed !== null && legacyErrorBoundariesThatAlreadyFailed.has(instance); } function markLegacyErrorBoundaryAsFailed(instance) { if (legacyErrorBoundariesThatAlreadyFailed === null) { legacyErrorBoundariesThatAlreadyFailed = new Set([instance]); } else { legacyErrorBoundariesThatAlreadyFailed.add(instance); } } function prepareToThrowUncaughtError(error) { if (!hasUncaughtError) { hasUncaughtError = true; firstUncaughtError = error; } } var onUncaughtError = prepareToThrowUncaughtError; function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { var errorInfo = createCapturedValueAtFiber(error, sourceFiber); var update = createRootErrorUpdate(rootFiber, errorInfo, SyncLane); var root = enqueueUpdate(rootFiber, update, SyncLane); var eventTime = requestEventTime(); if (root !== null) { markRootUpdated(root, SyncLane, eventTime); ensureRootIsScheduled(root, eventTime); } } function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error$1) { { reportUncaughtErrorInDEV(error$1); setIsRunningInsertionEffect(false); } if (sourceFiber.tag === HostRoot) { // Error was thrown at the root. There is no parent, so the root // itself should capture it. captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error$1); return; } var fiber = null; { fiber = nearestMountedAncestor; } while (fiber !== null) { if (fiber.tag === HostRoot) { captureCommitPhaseErrorOnRoot(fiber, sourceFiber, error$1); return; } else if (fiber.tag === ClassComponent) { var ctor = fiber.type; var instance = fiber.stateNode; if (typeof ctor.getDerivedStateFromError === 'function' || typeof instance.componentDidCatch === 'function' && !isAlreadyFailedLegacyErrorBoundary(instance)) { var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber); var update = createClassErrorUpdate(fiber, errorInfo, SyncLane); var root = enqueueUpdate(fiber, update, SyncLane); var eventTime = requestEventTime(); if (root !== null) { markRootUpdated(root, SyncLane, eventTime); ensureRootIsScheduled(root, eventTime); } return; } } fiber = fiber.return; } { // TODO: Until we re-land skipUnmountedBoundaries (see #20147), this warning // will fire for errors that are thrown by destroy functions inside deleted // trees. What it should instead do is propagate the error to the parent of // the deleted tree. In the meantime, do not add this warning to the // allowlist; this is only for our internal use. error('Internal React error: Attempted to capture a commit phase error ' + 'inside a detached tree. This indicates a bug in React. Likely ' + 'causes include deleting the same fiber more than once, committing an ' + 'already-finished tree, or an inconsistent return pointer.\n\n' + 'Error message:\n\n%s', error$1); } } function pingSuspendedRoot(root, wakeable, pingedLanes) { var pingCache = root.pingCache; if (pingCache !== null) { // The wakeable resolved, so we no longer need to memoize, because it will // never be thrown again. pingCache.delete(wakeable); } var eventTime = requestEventTime(); markRootPinged(root, pingedLanes); warnIfSuspenseResolutionNotWrappedWithActDEV(root); if (workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) { // Received a ping at the same priority level at which we're currently // rendering. We might want to restart this render. This should mirror // the logic of whether or not a root suspends once it completes. // TODO: If we're rendering sync either due to Sync, Batched or expired, // we should probably never restart. // If we're suspended with delay, or if it's a retry, we'll always suspend // so we can always restart. if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) { // Restart from the root. prepareFreshStack(root, NoLanes); } else { // Even though we can't restart right now, we might get an // opportunity later. So we mark this render as having a ping. workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes); } } ensureRootIsScheduled(root, eventTime); } function retryTimedOutBoundary(boundaryFiber, retryLane) { // The boundary fiber (a Suspense component or SuspenseList component) // previously was rendered in its fallback state. One of the promises that // suspended it has resolved, which means at least part of the tree was // likely unblocked. Try rendering again, at a new lanes. if (retryLane === NoLane) { // TODO: Assign this to `suspenseState.retryLane`? to avoid // unnecessary entanglement? retryLane = requestRetryLane(boundaryFiber); } // TODO: Special case idle priority? var eventTime = requestEventTime(); var root = enqueueConcurrentRenderForLane(boundaryFiber, retryLane); if (root !== null) { markRootUpdated(root, retryLane, eventTime); ensureRootIsScheduled(root, eventTime); } } function retryDehydratedSuspenseBoundary(boundaryFiber) { var suspenseState = boundaryFiber.memoizedState; var retryLane = NoLane; if (suspenseState !== null) { retryLane = suspenseState.retryLane; } retryTimedOutBoundary(boundaryFiber, retryLane); } function resolveRetryWakeable(boundaryFiber, wakeable) { var retryLane = NoLane; // Default var retryCache; switch (boundaryFiber.tag) { case SuspenseComponent: retryCache = boundaryFiber.stateNode; var suspenseState = boundaryFiber.memoizedState; if (suspenseState !== null) { retryLane = suspenseState.retryLane; } break; case SuspenseListComponent: retryCache = boundaryFiber.stateNode; break; default: throw new Error('Pinged unknown suspense boundary type. ' + 'This is probably a bug in React.'); } if (retryCache !== null) { // The wakeable resolved, so we no longer need to memoize, because it will // never be thrown again. retryCache.delete(wakeable); } retryTimedOutBoundary(boundaryFiber, retryLane); } // Computes the next Just Noticeable Difference (JND) boundary. // The theory is that a person can't tell the difference between small differences in time. // Therefore, if we wait a bit longer than necessary that won't translate to a noticeable // difference in the experience. However, waiting for longer might mean that we can avoid // showing an intermediate loading state. The longer we have already waited, the harder it // is to tell small differences in time. Therefore, the longer we've already waited, // the longer we can wait additionally. At some point we have to give up though. // We pick a train model where the next boundary commits at a consistent schedule. // These particular numbers are vague estimates. We expect to adjust them based on research. function jnd(timeElapsed) { return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil(timeElapsed / 1960) * 1960; } function checkForNestedUpdates() { if (nestedUpdateCount > NESTED_UPDATE_LIMIT) { nestedUpdateCount = 0; rootWithNestedUpdates = null; throw new Error('Maximum update depth exceeded. This can happen when a component ' + 'repeatedly calls setState inside componentWillUpdate or ' + 'componentDidUpdate. React limits the number of nested updates to ' + 'prevent infinite loops.'); } { if (nestedPassiveUpdateCount > NESTED_PASSIVE_UPDATE_LIMIT) { nestedPassiveUpdateCount = 0; rootWithPassiveNestedUpdates = null; error('Maximum update depth exceeded. This can happen when a component ' + "calls setState inside useEffect, but useEffect either doesn't " + 'have a dependency array, or one of the dependencies changes on ' + 'every render.'); } } } function flushRenderPhaseStrictModeWarningsInDEV() { { ReactStrictModeWarnings.flushLegacyContextWarning(); { ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); } } } function commitDoubleInvokeEffectsInDEV(fiber, hasPassiveEffects) { { // TODO (StrictEffects) Should we set a marker on the root if it contains strict effects // so we don't traverse unnecessarily? similar to subtreeFlags but just at the root level. // Maybe not a big deal since this is DEV only behavior. setCurrentFiber(fiber); invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectUnmountInDEV); if (hasPassiveEffects) { invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectUnmountInDEV); } invokeEffectsInDev(fiber, MountLayoutDev, invokeLayoutEffectMountInDEV); if (hasPassiveEffects) { invokeEffectsInDev(fiber, MountPassiveDev, invokePassiveEffectMountInDEV); } resetCurrentFiber(); } } function invokeEffectsInDev(firstChild, fiberFlags, invokeEffectFn) { { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. var current = firstChild; var subtreeRoot = null; while (current !== null) { var primarySubtreeFlag = current.subtreeFlags & fiberFlags; if (current !== subtreeRoot && current.child !== null && primarySubtreeFlag !== NoFlags) { current = current.child; } else { if ((current.flags & fiberFlags) !== NoFlags) { invokeEffectFn(current); } if (current.sibling !== null) { current = current.sibling; } else { current = subtreeRoot = current.return; } } } } } var didWarnStateUpdateForNotYetMountedComponent = null; function warnAboutUpdateOnNotYetMountedFiberInDEV(fiber) { { if ((executionContext & RenderContext) !== NoContext) { // We let the other warning about render phase updates deal with this one. return; } if (!(fiber.mode & ConcurrentMode)) { return; } var tag = fiber.tag; if (tag !== IndeterminateComponent && tag !== HostRoot && tag !== ClassComponent && tag !== FunctionComponent && tag !== ForwardRef && tag !== MemoComponent && tag !== SimpleMemoComponent) { // Only warn for user-defined components, not internal ones like Suspense. return; } // We show the whole stack but dedupe on the top component's name because // the problematic code almost always lies inside that component. var componentName = getComponentNameFromFiber(fiber) || 'ReactComponent'; if (didWarnStateUpdateForNotYetMountedComponent !== null) { if (didWarnStateUpdateForNotYetMountedComponent.has(componentName)) { return; } didWarnStateUpdateForNotYetMountedComponent.add(componentName); } else { didWarnStateUpdateForNotYetMountedComponent = new Set([componentName]); } var previousFiber = current; try { setCurrentFiber(fiber); error("Can't perform a React state update on a component that hasn't mounted yet. " + 'This indicates that you have a side-effect in your render function that ' + 'asynchronously later calls tries to update the component. Move this work to ' + 'useEffect instead.'); } finally { if (previousFiber) { setCurrentFiber(fiber); } else { resetCurrentFiber(); } } } } var beginWork$1; { var dummyFiber = null; beginWork$1 = function (current, unitOfWork, lanes) { // If a component throws an error, we replay it again in a synchronously // dispatched event, so that the debugger will treat it as an uncaught // error See ReactErrorUtils for more information. // Before entering the begin phase, copy the work-in-progress onto a dummy // fiber. If beginWork throws, we'll use this to reset the state. var originalWorkInProgressCopy = assignFiberPropertiesInDEV(dummyFiber, unitOfWork); try { return beginWork(current, unitOfWork, lanes); } catch (originalError) { if (didSuspendOrErrorWhileHydratingDEV() || originalError !== null && typeof originalError === 'object' && typeof originalError.then === 'function') { // Don't replay promises. // Don't replay errors if we are hydrating and have already suspended or handled an error throw originalError; } // Keep this code in sync with handleError; any changes here must have // corresponding changes there. resetContextDependencies(); resetHooksAfterThrow(); // Don't reset current debug fiber, since we're about to work on the // same fiber again. // Unwind the failed stack frame unwindInterruptedWork(current, unitOfWork); // Restore the original properties of the fiber. assignFiberPropertiesInDEV(unitOfWork, originalWorkInProgressCopy); if ( unitOfWork.mode & ProfileMode) { // Reset the profiler timer. startProfilerTimer(unitOfWork); } // Run beginWork again. invokeGuardedCallback(null, beginWork, null, current, unitOfWork, lanes); if (hasCaughtError()) { var replayError = clearCaughtError(); if (typeof replayError === 'object' && replayError !== null && replayError._suppressLogging && typeof originalError === 'object' && originalError !== null && !originalError._suppressLogging) { // If suppressed, let the flag carry over to the original error which is the one we'll rethrow. originalError._suppressLogging = true; } } // We always throw the original error in case the second render pass is not idempotent. // This can happen if a memoized function or CommonJS module doesn't throw after first invocation. throw originalError; } }; } var didWarnAboutUpdateInRender = false; var didWarnAboutUpdateInRenderForAnotherComponent; { didWarnAboutUpdateInRenderForAnotherComponent = new Set(); } function warnAboutRenderPhaseUpdatesInDEV(fiber) { { if (isRendering && !getIsUpdatingOpaqueValueInRenderPhaseInDEV()) { switch (fiber.tag) { case FunctionComponent: case ForwardRef: case SimpleMemoComponent: { var renderingComponentName = workInProgress && getComponentNameFromFiber(workInProgress) || 'Unknown'; // Dedupe by the rendering component because it's the one that needs to be fixed. var dedupeKey = renderingComponentName; if (!didWarnAboutUpdateInRenderForAnotherComponent.has(dedupeKey)) { didWarnAboutUpdateInRenderForAnotherComponent.add(dedupeKey); var setStateComponentName = getComponentNameFromFiber(fiber) || 'Unknown'; error('Cannot update a component (`%s`) while rendering a ' + 'different component (`%s`). To locate the bad setState() call inside `%s`, ' + 'follow the stack trace as described in https://reactjs.org/link/setstate-in-render', setStateComponentName, renderingComponentName, renderingComponentName); } break; } case ClassComponent: { if (!didWarnAboutUpdateInRender) { error('Cannot update during an existing state transition (such as ' + 'within `render`). Render methods should be a pure ' + 'function of props and state.'); didWarnAboutUpdateInRender = true; } break; } } } } } function restorePendingUpdaters(root, lanes) { { if (isDevToolsPresent) { var memoizedUpdaters = root.memoizedUpdaters; memoizedUpdaters.forEach(function (schedulingFiber) { addFiberToLanesMap(root, schedulingFiber, lanes); }); // This function intentionally does not clear memoized updaters. // Those may still be relevant to the current commit // and a future one (e.g. Suspense). } } } var fakeActCallbackNode = {}; function scheduleCallback$1(priorityLevel, callback) { { // If we're currently inside an `act` scope, bypass Scheduler and push to // the `act` queue instead. var actQueue = ReactCurrentActQueue$1.current; if (actQueue !== null) { actQueue.push(callback); return fakeActCallbackNode; } else { return scheduleCallback(priorityLevel, callback); } } } function cancelCallback$1(callbackNode) { if ( callbackNode === fakeActCallbackNode) { return; } // In production, always call Scheduler. This function will be stripped out. return cancelCallback(callbackNode); } function shouldForceFlushFallbacksInDEV() { // Never force flush in production. This function should get stripped out. return ReactCurrentActQueue$1.current !== null; } function warnIfUpdatesNotWrappedWithActDEV(fiber) { { if (fiber.mode & ConcurrentMode) { if (!isConcurrentActEnvironment()) { // Not in an act environment. No need to warn. return; } } else { // Legacy mode has additional cases where we suppress a warning. if (!isLegacyActEnvironment()) { // Not in an act environment. No need to warn. return; } if (executionContext !== NoContext) { // Legacy mode doesn't warn if the update is batched, i.e. // batchedUpdates or flushSync. return; } if (fiber.tag !== FunctionComponent && fiber.tag !== ForwardRef && fiber.tag !== SimpleMemoComponent) { // For backwards compatibility with pre-hooks code, legacy mode only // warns for updates that originate from a hook. return; } } if (ReactCurrentActQueue$1.current === null) { var previousFiber = current; try { setCurrentFiber(fiber); error('An update to %s inside a test was not wrapped in act(...).\n\n' + 'When testing, code that causes React state updates should be ' + 'wrapped into act(...):\n\n' + 'act(() => {\n' + ' /* fire events that update state */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act', getComponentNameFromFiber(fiber)); } finally { if (previousFiber) { setCurrentFiber(fiber); } else { resetCurrentFiber(); } } } } } function warnIfSuspenseResolutionNotWrappedWithActDEV(root) { { if (root.tag !== LegacyRoot && isConcurrentActEnvironment() && ReactCurrentActQueue$1.current === null) { error('A suspended resource finished loading inside a test, but the event ' + 'was not wrapped in act(...).\n\n' + 'When testing, code that resolves suspended data should be wrapped ' + 'into act(...):\n\n' + 'act(() => {\n' + ' /* finish loading suspended data */\n' + '});\n' + '/* assert on the output */\n\n' + "This ensures that you're testing the behavior the user would see " + 'in the browser.' + ' Learn more at https://reactjs.org/link/wrap-tests-with-act'); } } } function setIsRunningInsertionEffect(isRunning) { { isRunningInsertionEffect = isRunning; } } /* eslint-disable react-internal/prod-error-codes */ var resolveFamily = null; // $FlowFixMe Flow gets confused by a WeakSet feature check below. var failedBoundaries = null; var setRefreshHandler = function (handler) { { resolveFamily = handler; } }; function resolveFunctionForHotReloading(type) { { if (resolveFamily === null) { // Hot reloading is disabled. return type; } var family = resolveFamily(type); if (family === undefined) { return type; } // Use the latest known implementation. return family.current; } } function resolveClassForHotReloading(type) { // No implementation differences. return resolveFunctionForHotReloading(type); } function resolveForwardRefForHotReloading(type) { { if (resolveFamily === null) { // Hot reloading is disabled. return type; } var family = resolveFamily(type); if (family === undefined) { // Check if we're dealing with a real forwardRef. Don't want to crash early. if (type !== null && type !== undefined && typeof type.render === 'function') { // ForwardRef is special because its resolved .type is an object, // but it's possible that we only have its inner render function in the map. // If that inner render function is different, we'll build a new forwardRef type. var currentRender = resolveFunctionForHotReloading(type.render); if (type.render !== currentRender) { var syntheticType = { $$typeof: REACT_FORWARD_REF_TYPE, render: currentRender }; if (type.displayName !== undefined) { syntheticType.displayName = type.displayName; } return syntheticType; } } return type; } // Use the latest known implementation. return family.current; } } function isCompatibleFamilyForHotReloading(fiber, element) { { if (resolveFamily === null) { // Hot reloading is disabled. return false; } var prevType = fiber.elementType; var nextType = element.type; // If we got here, we know types aren't === equal. var needsCompareFamilies = false; var $$typeofNextType = typeof nextType === 'object' && nextType !== null ? nextType.$$typeof : null; switch (fiber.tag) { case ClassComponent: { if (typeof nextType === 'function') { needsCompareFamilies = true; } break; } case FunctionComponent: { if (typeof nextType === 'function') { needsCompareFamilies = true; } else if ($$typeofNextType === REACT_LAZY_TYPE) { // We don't know the inner type yet. // We're going to assume that the lazy inner type is stable, // and so it is sufficient to avoid reconciling it away. // We're not going to unwrap or actually use the new lazy type. needsCompareFamilies = true; } break; } case ForwardRef: { if ($$typeofNextType === REACT_FORWARD_REF_TYPE) { needsCompareFamilies = true; } else if ($$typeofNextType === REACT_LAZY_TYPE) { needsCompareFamilies = true; } break; } case MemoComponent: case SimpleMemoComponent: { if ($$typeofNextType === REACT_MEMO_TYPE) { // TODO: if it was but can no longer be simple, // we shouldn't set this. needsCompareFamilies = true; } else if ($$typeofNextType === REACT_LAZY_TYPE) { needsCompareFamilies = true; } break; } default: return false; } // Check if both types have a family and it's the same one. if (needsCompareFamilies) { // Note: memo() and forwardRef() we'll compare outer rather than inner type. // This means both of them need to be registered to preserve state. // If we unwrapped and compared the inner types for wrappers instead, // then we would risk falsely saying two separate memo(Foo) // calls are equivalent because they wrap the same Foo function. var prevFamily = resolveFamily(prevType); if (prevFamily !== undefined && prevFamily === resolveFamily(nextType)) { return true; } } return false; } } function markFailedErrorBoundaryForHotReloading(fiber) { { if (resolveFamily === null) { // Hot reloading is disabled. return; } if (typeof WeakSet !== 'function') { return; } if (failedBoundaries === null) { failedBoundaries = new WeakSet(); } failedBoundaries.add(fiber); } } var scheduleRefresh = function (root, update) { { if (resolveFamily === null) { // Hot reloading is disabled. return; } var staleFamilies = update.staleFamilies, updatedFamilies = update.updatedFamilies; flushPassiveEffects(); flushSync(function () { scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies); }); } }; var scheduleRoot = function (root, element) { { if (root.context !== emptyContextObject) { // Super edge case: root has a legacy _renderSubtree context // but we don't know the parentComponent so we can't pass it. // Just ignore. We'll delete this with _renderSubtree code path later. return; } flushPassiveEffects(); flushSync(function () { updateContainer(element, root, null, null); }); } }; function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) { { var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type; var candidateType = null; switch (tag) { case FunctionComponent: case SimpleMemoComponent: case ClassComponent: candidateType = type; break; case ForwardRef: candidateType = type.render; break; } if (resolveFamily === null) { throw new Error('Expected resolveFamily to be set during hot reload.'); } var needsRender = false; var needsRemount = false; if (candidateType !== null) { var family = resolveFamily(candidateType); if (family !== undefined) { if (staleFamilies.has(family)) { needsRemount = true; } else if (updatedFamilies.has(family)) { if (tag === ClassComponent) { needsRemount = true; } else { needsRender = true; } } } } if (failedBoundaries !== null) { if (failedBoundaries.has(fiber) || alternate !== null && failedBoundaries.has(alternate)) { needsRemount = true; } } if (needsRemount) { fiber._debugNeedsRemount = true; } if (needsRemount || needsRender) { var _root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (_root !== null) { scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp); } } if (child !== null && !needsRemount) { scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies); } if (sibling !== null) { scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies); } } } var findHostInstancesForRefresh = function (root, families) { { var hostInstances = new Set(); var types = new Set(families.map(function (family) { return family.current; })); findHostInstancesForMatchingFibersRecursively(root.current, types, hostInstances); return hostInstances; } }; function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) { { var child = fiber.child, sibling = fiber.sibling, tag = fiber.tag, type = fiber.type; var candidateType = null; switch (tag) { case FunctionComponent: case SimpleMemoComponent: case ClassComponent: candidateType = type; break; case ForwardRef: candidateType = type.render; break; } var didMatch = false; if (candidateType !== null) { if (types.has(candidateType)) { didMatch = true; } } if (didMatch) { // We have a match. This only drills down to the closest host components. // There's no need to search deeper because for the purpose of giving // visual feedback, "flashing" outermost parent rectangles is sufficient. findHostInstancesForFiberShallowly(fiber, hostInstances); } else { // If there's no match, maybe there will be one further down in the child tree. if (child !== null) { findHostInstancesForMatchingFibersRecursively(child, types, hostInstances); } } if (sibling !== null) { findHostInstancesForMatchingFibersRecursively(sibling, types, hostInstances); } } } function findHostInstancesForFiberShallowly(fiber, hostInstances) { { var foundHostInstances = findChildHostInstancesForFiberShallowly(fiber, hostInstances); if (foundHostInstances) { return; } // If we didn't find any host children, fallback to closest host parent. var node = fiber; while (true) { switch (node.tag) { case HostComponent: hostInstances.add(node.stateNode); return; case HostPortal: hostInstances.add(node.stateNode.containerInfo); return; case HostRoot: hostInstances.add(node.stateNode.containerInfo); return; } if (node.return === null) { throw new Error('Expected to reach root first.'); } node = node.return; } } } function findChildHostInstancesForFiberShallowly(fiber, hostInstances) { { var node = fiber; var foundHostInstances = false; while (true) { if (node.tag === HostComponent) { // We got a match. foundHostInstances = true; hostInstances.add(node.stateNode); // There may still be more, so keep searching. } else if (node.child !== null) { node.child.return = node; node = node.child; continue; } if (node === fiber) { return foundHostInstances; } while (node.sibling === null) { if (node.return === null || node.return === fiber) { return foundHostInstances; } node = node.return; } node.sibling.return = node.return; node = node.sibling; } } return false; } var hasBadMapPolyfill; { hasBadMapPolyfill = false; try { var nonExtensibleObject = Object.preventExtensions({}); /* eslint-disable no-new */ new Map([[nonExtensibleObject, null]]); new Set([nonExtensibleObject]); /* eslint-enable no-new */ } catch (e) { // TODO: Consider warning about bad polyfills hasBadMapPolyfill = true; } } function FiberNode(tag, pendingProps, key, mode) { // Instance this.tag = tag; this.key = key; this.elementType = null; this.type = null; this.stateNode = null; // Fiber this.return = null; this.child = null; this.sibling = null; this.index = 0; this.ref = null; this.pendingProps = pendingProps; this.memoizedProps = null; this.updateQueue = null; this.memoizedState = null; this.dependencies = null; this.mode = mode; // Effects this.flags = NoFlags; this.subtreeFlags = NoFlags; this.deletions = null; this.lanes = NoLanes; this.childLanes = NoLanes; this.alternate = null; { // Note: The following is done to avoid a v8 performance cliff. // // Initializing the fields below to smis and later updating them with // double values will cause Fibers to end up having separate shapes. // This behavior/bug has something to do with Object.preventExtension(). // Fortunately this only impacts DEV builds. // Unfortunately it makes React unusably slow for some applications. // To work around this, initialize the fields below with doubles. // // Learn more about this here: // https://github.com/facebook/react/issues/14365 // https://bugs.chromium.org/p/v8/issues/detail?id=8538 this.actualDuration = Number.NaN; this.actualStartTime = Number.NaN; this.selfBaseDuration = Number.NaN; this.treeBaseDuration = Number.NaN; // It's okay to replace the initial doubles with smis after initialization. // This won't trigger the performance cliff mentioned above, // and it simplifies other profiler code (including DevTools). this.actualDuration = 0; this.actualStartTime = -1; this.selfBaseDuration = 0; this.treeBaseDuration = 0; } { // This isn't directly used but is handy for debugging internals: this._debugSource = null; this._debugOwner = null; this._debugNeedsRemount = false; this._debugHookTypes = null; if (!hasBadMapPolyfill && typeof Object.preventExtensions === 'function') { Object.preventExtensions(this); } } } // This is a constructor function, rather than a POJO constructor, still // please ensure we do the following: // 1) Nobody should add any instance methods on this. Instance methods can be // more difficult to predict when they get optimized and they are almost // never inlined properly in static compilers. // 2) Nobody should rely on `instanceof Fiber` for type testing. We should // always know when it is a fiber. // 3) We might want to experiment with using numeric keys since they are easier // to optimize in a non-JIT environment. // 4) We can easily go from a constructor to a createFiber object literal if that // is faster. // 5) It should be easy to port this to a C struct and keep a C implementation // compatible. var createFiber = function (tag, pendingProps, key, mode) { // $FlowFixMe: the shapes are exact here but Flow doesn't like constructors return new FiberNode(tag, pendingProps, key, mode); }; function shouldConstruct$1(Component) { var prototype = Component.prototype; return !!(prototype && prototype.isReactComponent); } function isSimpleFunctionComponent(type) { return typeof type === 'function' && !shouldConstruct$1(type) && type.defaultProps === undefined; } function resolveLazyComponentTag(Component) { if (typeof Component === 'function') { return shouldConstruct$1(Component) ? ClassComponent : FunctionComponent; } else if (Component !== undefined && Component !== null) { var $$typeof = Component.$$typeof; if ($$typeof === REACT_FORWARD_REF_TYPE) { return ForwardRef; } if ($$typeof === REACT_MEMO_TYPE) { return MemoComponent; } } return IndeterminateComponent; } // This is used to create an alternate fiber to do work on. function createWorkInProgress(current, pendingProps) { var workInProgress = current.alternate; if (workInProgress === null) { // We use a double buffering pooling technique because we know that we'll // only ever need at most two versions of a tree. We pool the "other" unused // node that we're free to reuse. This is lazily created to avoid allocating // extra objects for things that are never updated. It also allow us to // reclaim the extra memory if needed. workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode); workInProgress.elementType = current.elementType; workInProgress.type = current.type; workInProgress.stateNode = current.stateNode; { // DEV-only fields workInProgress._debugSource = current._debugSource; workInProgress._debugOwner = current._debugOwner; workInProgress._debugHookTypes = current._debugHookTypes; } workInProgress.alternate = current; current.alternate = workInProgress; } else { workInProgress.pendingProps = pendingProps; // Needed because Blocks store data on type. workInProgress.type = current.type; // We already have an alternate. // Reset the effect tag. workInProgress.flags = NoFlags; // The effects are no longer valid. workInProgress.subtreeFlags = NoFlags; workInProgress.deletions = null; { // We intentionally reset, rather than copy, actualDuration & actualStartTime. // This prevents time from endlessly accumulating in new commits. // This has the downside of resetting values for different priority renders, // But works for yielding (the common case) and should support resuming. workInProgress.actualDuration = 0; workInProgress.actualStartTime = -1; } } // Reset all effects except static ones. // Static effects are not specific to a render. workInProgress.flags = current.flags & StaticMask; workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; workInProgress.memoizedProps = current.memoizedProps; workInProgress.memoizedState = current.memoizedState; workInProgress.updateQueue = current.updateQueue; // Clone the dependencies object. This is mutated during the render phase, so // it cannot be shared with the current fiber. var currentDependencies = current.dependencies; workInProgress.dependencies = currentDependencies === null ? null : { lanes: currentDependencies.lanes, firstContext: currentDependencies.firstContext }; // These will be overridden during the parent's reconciliation workInProgress.sibling = current.sibling; workInProgress.index = current.index; workInProgress.ref = current.ref; { workInProgress.selfBaseDuration = current.selfBaseDuration; workInProgress.treeBaseDuration = current.treeBaseDuration; } { workInProgress._debugNeedsRemount = current._debugNeedsRemount; switch (workInProgress.tag) { case IndeterminateComponent: case FunctionComponent: case SimpleMemoComponent: workInProgress.type = resolveFunctionForHotReloading(current.type); break; case ClassComponent: workInProgress.type = resolveClassForHotReloading(current.type); break; case ForwardRef: workInProgress.type = resolveForwardRefForHotReloading(current.type); break; } } return workInProgress; } // Used to reuse a Fiber for a second pass. function resetWorkInProgress(workInProgress, renderLanes) { // This resets the Fiber to what createFiber or createWorkInProgress would // have set the values to before during the first pass. Ideally this wouldn't // be necessary but unfortunately many code paths reads from the workInProgress // when they should be reading from current and writing to workInProgress. // We assume pendingProps, index, key, ref, return are still untouched to // avoid doing another reconciliation. // Reset the effect flags but keep any Placement tags, since that's something // that child fiber is setting, not the reconciliation. workInProgress.flags &= StaticMask | Placement; // The effects are no longer valid. var current = workInProgress.alternate; if (current === null) { // Reset to createFiber's initial values. workInProgress.childLanes = NoLanes; workInProgress.lanes = renderLanes; workInProgress.child = null; workInProgress.subtreeFlags = NoFlags; workInProgress.memoizedProps = null; workInProgress.memoizedState = null; workInProgress.updateQueue = null; workInProgress.dependencies = null; workInProgress.stateNode = null; { // Note: We don't reset the actualTime counts. It's useful to accumulate // actual time across multiple render passes. workInProgress.selfBaseDuration = 0; workInProgress.treeBaseDuration = 0; } } else { // Reset to the cloned values that createWorkInProgress would've. workInProgress.childLanes = current.childLanes; workInProgress.lanes = current.lanes; workInProgress.child = current.child; workInProgress.subtreeFlags = NoFlags; workInProgress.deletions = null; workInProgress.memoizedProps = current.memoizedProps; workInProgress.memoizedState = current.memoizedState; workInProgress.updateQueue = current.updateQueue; // Needed because Blocks store data on type. workInProgress.type = current.type; // Clone the dependencies object. This is mutated during the render phase, so // it cannot be shared with the current fiber. var currentDependencies = current.dependencies; workInProgress.dependencies = currentDependencies === null ? null : { lanes: currentDependencies.lanes, firstContext: currentDependencies.firstContext }; { // Note: We don't reset the actualTime counts. It's useful to accumulate // actual time across multiple render passes. workInProgress.selfBaseDuration = current.selfBaseDuration; workInProgress.treeBaseDuration = current.treeBaseDuration; } } return workInProgress; } function createHostRootFiber(tag, isStrictMode, concurrentUpdatesByDefaultOverride) { var mode; if (tag === ConcurrentRoot) { mode = ConcurrentMode; if (isStrictMode === true) { mode |= StrictLegacyMode; { mode |= StrictEffectsMode; } } } else { mode = NoMode; } if ( isDevToolsPresent) { // Always collect profile timings when DevTools are present. // This enables DevTools to start capturing timing at any point– // Without some nodes in the tree having empty base times. mode |= ProfileMode; } return createFiber(HostRoot, null, null, mode); } function createFiberFromTypeAndProps(type, // React$ElementType key, pendingProps, owner, mode, lanes) { var fiberTag = IndeterminateComponent; // The resolved type is set if we know what the final type will be. I.e. it's not lazy. var resolvedType = type; if (typeof type === 'function') { if (shouldConstruct$1(type)) { fiberTag = ClassComponent; { resolvedType = resolveClassForHotReloading(resolvedType); } } else { { resolvedType = resolveFunctionForHotReloading(resolvedType); } } } else if (typeof type === 'string') { fiberTag = HostComponent; } else { getTag: switch (type) { case REACT_FRAGMENT_TYPE: return createFiberFromFragment(pendingProps.children, mode, lanes, key); case REACT_STRICT_MODE_TYPE: fiberTag = Mode; mode |= StrictLegacyMode; if ( (mode & ConcurrentMode) !== NoMode) { // Strict effects should never run on legacy roots mode |= StrictEffectsMode; } break; case REACT_PROFILER_TYPE: return createFiberFromProfiler(pendingProps, mode, lanes, key); case REACT_SUSPENSE_TYPE: return createFiberFromSuspense(pendingProps, mode, lanes, key); case REACT_SUSPENSE_LIST_TYPE: return createFiberFromSuspenseList(pendingProps, mode, lanes, key); case REACT_OFFSCREEN_TYPE: return createFiberFromOffscreen(pendingProps, mode, lanes, key); case REACT_LEGACY_HIDDEN_TYPE: // eslint-disable-next-line no-fallthrough case REACT_SCOPE_TYPE: // eslint-disable-next-line no-fallthrough case REACT_CACHE_TYPE: // eslint-disable-next-line no-fallthrough case REACT_TRACING_MARKER_TYPE: // eslint-disable-next-line no-fallthrough case REACT_DEBUG_TRACING_MODE_TYPE: // eslint-disable-next-line no-fallthrough default: { if (typeof type === 'object' && type !== null) { switch (type.$$typeof) { case REACT_PROVIDER_TYPE: fiberTag = ContextProvider; break getTag; case REACT_CONTEXT_TYPE: // This is a consumer fiberTag = ContextConsumer; break getTag; case REACT_FORWARD_REF_TYPE: fiberTag = ForwardRef; { resolvedType = resolveForwardRefForHotReloading(resolvedType); } break getTag; case REACT_MEMO_TYPE: fiberTag = MemoComponent; break getTag; case REACT_LAZY_TYPE: fiberTag = LazyComponent; resolvedType = null; break getTag; } } var info = ''; { if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and " + 'named imports.'; } var ownerName = owner ? getComponentNameFromFiber(owner) : null; if (ownerName) { info += '\n\nCheck the render method of `' + ownerName + '`.'; } } throw new Error('Element type is invalid: expected a string (for built-in ' + 'components) or a class/function (for composite components) ' + ("but got: " + (type == null ? type : typeof type) + "." + info)); } } } var fiber = createFiber(fiberTag, pendingProps, key, mode); fiber.elementType = type; fiber.type = resolvedType; fiber.lanes = lanes; { fiber._debugOwner = owner; } return fiber; } function createFiberFromElement(element, mode, lanes) { var owner = null; { owner = element._owner; } var type = element.type; var key = element.key; var pendingProps = element.props; var fiber = createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes); { fiber._debugSource = element._source; fiber._debugOwner = element._owner; } return fiber; } function createFiberFromFragment(elements, mode, lanes, key) { var fiber = createFiber(Fragment, elements, key, mode); fiber.lanes = lanes; return fiber; } function createFiberFromProfiler(pendingProps, mode, lanes, key) { { if (typeof pendingProps.id !== 'string') { error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.', typeof pendingProps.id); } } var fiber = createFiber(Profiler, pendingProps, key, mode | ProfileMode); fiber.elementType = REACT_PROFILER_TYPE; fiber.lanes = lanes; { fiber.stateNode = { effectDuration: 0, passiveEffectDuration: 0 }; } return fiber; } function createFiberFromSuspense(pendingProps, mode, lanes, key) { var fiber = createFiber(SuspenseComponent, pendingProps, key, mode); fiber.elementType = REACT_SUSPENSE_TYPE; fiber.lanes = lanes; return fiber; } function createFiberFromSuspenseList(pendingProps, mode, lanes, key) { var fiber = createFiber(SuspenseListComponent, pendingProps, key, mode); fiber.elementType = REACT_SUSPENSE_LIST_TYPE; fiber.lanes = lanes; return fiber; } function createFiberFromOffscreen(pendingProps, mode, lanes, key) { var fiber = createFiber(OffscreenComponent, pendingProps, key, mode); fiber.elementType = REACT_OFFSCREEN_TYPE; fiber.lanes = lanes; var primaryChildInstance = { isHidden: false }; fiber.stateNode = primaryChildInstance; return fiber; } function createFiberFromText(content, mode, lanes) { var fiber = createFiber(HostText, content, null, mode); fiber.lanes = lanes; return fiber; } function createFiberFromHostInstanceForDeletion() { var fiber = createFiber(HostComponent, null, null, NoMode); fiber.elementType = 'DELETED'; return fiber; } function createFiberFromDehydratedFragment(dehydratedNode) { var fiber = createFiber(DehydratedFragment, null, null, NoMode); fiber.stateNode = dehydratedNode; return fiber; } function createFiberFromPortal(portal, mode, lanes) { var pendingProps = portal.children !== null ? portal.children : []; var fiber = createFiber(HostPortal, pendingProps, portal.key, mode); fiber.lanes = lanes; fiber.stateNode = { containerInfo: portal.containerInfo, pendingChildren: null, // Used by persistent updates implementation: portal.implementation }; return fiber; } // Used for stashing WIP properties to replay failed work in DEV. function assignFiberPropertiesInDEV(target, source) { if (target === null) { // This Fiber's initial properties will always be overwritten. // We only use a Fiber to ensure the same hidden class so DEV isn't slow. target = createFiber(IndeterminateComponent, null, null, NoMode); } // This is intentionally written as a list of all properties. // We tried to use Object.assign() instead but this is called in // the hottest path, and Object.assign() was too slow: // https://github.com/facebook/react/issues/12502 // This code is DEV-only so size is not a concern. target.tag = source.tag; target.key = source.key; target.elementType = source.elementType; target.type = source.type; target.stateNode = source.stateNode; target.return = source.return; target.child = source.child; target.sibling = source.sibling; target.index = source.index; target.ref = source.ref; target.pendingProps = source.pendingProps; target.memoizedProps = source.memoizedProps; target.updateQueue = source.updateQueue; target.memoizedState = source.memoizedState; target.dependencies = source.dependencies; target.mode = source.mode; target.flags = source.flags; target.subtreeFlags = source.subtreeFlags; target.deletions = source.deletions; target.lanes = source.lanes; target.childLanes = source.childLanes; target.alternate = source.alternate; { target.actualDuration = source.actualDuration; target.actualStartTime = source.actualStartTime; target.selfBaseDuration = source.selfBaseDuration; target.treeBaseDuration = source.treeBaseDuration; } target._debugSource = source._debugSource; target._debugOwner = source._debugOwner; target._debugNeedsRemount = source._debugNeedsRemount; target._debugHookTypes = source._debugHookTypes; return target; } function FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError) { this.tag = tag; this.containerInfo = containerInfo; this.pendingChildren = null; this.current = null; this.pingCache = null; this.finishedWork = null; this.timeoutHandle = noTimeout; this.context = null; this.pendingContext = null; this.callbackNode = null; this.callbackPriority = NoLane; this.eventTimes = createLaneMap(NoLanes); this.expirationTimes = createLaneMap(NoTimestamp); this.pendingLanes = NoLanes; this.suspendedLanes = NoLanes; this.pingedLanes = NoLanes; this.expiredLanes = NoLanes; this.mutableReadLanes = NoLanes; this.finishedLanes = NoLanes; this.entangledLanes = NoLanes; this.entanglements = createLaneMap(NoLanes); this.identifierPrefix = identifierPrefix; this.onRecoverableError = onRecoverableError; { this.mutableSourceEagerHydrationData = null; } { this.effectDuration = 0; this.passiveEffectDuration = 0; } { this.memoizedUpdaters = new Set(); var pendingUpdatersLaneMap = this.pendingUpdatersLaneMap = []; for (var _i = 0; _i < TotalLanes; _i++) { pendingUpdatersLaneMap.push(new Set()); } } { switch (tag) { case ConcurrentRoot: this._debugRootType = hydrate ? 'hydrateRoot()' : 'createRoot()'; break; case LegacyRoot: this._debugRootType = hydrate ? 'hydrate()' : 'render()'; break; } } } function createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, // TODO: We have several of these arguments that are conceptually part of the // host config, but because they are passed in at runtime, we have to thread // them through the root constructor. Perhaps we should put them all into a // single type, like a DynamicHostConfig that is defined by the renderer. identifierPrefix, onRecoverableError, transitionCallbacks) { var root = new FiberRootNode(containerInfo, tag, hydrate, identifierPrefix, onRecoverableError); // stateNode is any. var uninitializedFiber = createHostRootFiber(tag, isStrictMode); root.current = uninitializedFiber; uninitializedFiber.stateNode = root; { var _initialState = { element: initialChildren, isDehydrated: hydrate, cache: null, // not enabled yet transitions: null, pendingSuspenseBoundaries: null }; uninitializedFiber.memoizedState = _initialState; } initializeUpdateQueue(uninitializedFiber); return root; } var ReactVersion = '18.3.1'; function createPortal(children, containerInfo, // TODO: figure out the API for cross-renderer implementation. implementation) { var key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; { checkKeyStringCoercion(key); } return { // This tag allow us to uniquely identify this as a React Portal $$typeof: REACT_PORTAL_TYPE, key: key == null ? null : '' + key, children: children, containerInfo: containerInfo, implementation: implementation }; } var didWarnAboutNestedUpdates; var didWarnAboutFindNodeInStrictMode; { didWarnAboutNestedUpdates = false; didWarnAboutFindNodeInStrictMode = {}; } function getContextForSubtree(parentComponent) { if (!parentComponent) { return emptyContextObject; } var fiber = get(parentComponent); var parentContext = findCurrentUnmaskedContext(fiber); if (fiber.tag === ClassComponent) { var Component = fiber.type; if (isContextProvider(Component)) { return processChildContext(fiber, Component, parentContext); } } return parentContext; } function findHostInstanceWithWarning(component, methodName) { { var fiber = get(component); if (fiber === undefined) { if (typeof component.render === 'function') { throw new Error('Unable to find node on an unmounted component.'); } else { var keys = Object.keys(component).join(','); throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys); } } var hostFiber = findCurrentHostFiber(fiber); if (hostFiber === null) { return null; } if (hostFiber.mode & StrictLegacyMode) { var componentName = getComponentNameFromFiber(fiber) || 'Component'; if (!didWarnAboutFindNodeInStrictMode[componentName]) { didWarnAboutFindNodeInStrictMode[componentName] = true; var previousFiber = current; try { setCurrentFiber(hostFiber); if (fiber.mode & StrictLegacyMode) { error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which is inside StrictMode. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName); } else { error('%s is deprecated in StrictMode. ' + '%s was passed an instance of %s which renders StrictMode children. ' + 'Instead, add a ref directly to the element you want to reference. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node', methodName, methodName, componentName); } } finally { // Ideally this should reset to previous but this shouldn't be called in // render and there's another warning for that anyway. if (previousFiber) { setCurrentFiber(previousFiber); } else { resetCurrentFiber(); } } } } return hostFiber.stateNode; } } function createContainer(containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) { var hydrate = false; var initialChildren = null; return createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); } function createHydrationContainer(initialChildren, // TODO: Remove `callback` when we delete legacy mode. callback, containerInfo, tag, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError, transitionCallbacks) { var hydrate = true; var root = createFiberRoot(containerInfo, tag, hydrate, initialChildren, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); // TODO: Move this to FiberRoot constructor root.context = getContextForSubtree(null); // Schedule the initial render. In a hydration root, this is different from // a regular update because the initial render must match was was rendered // on the server. // NOTE: This update intentionally doesn't have a payload. We're only using // the update to schedule work on the root fiber (and, for legacy roots, to // enqueue the callback if one is provided). var current = root.current; var eventTime = requestEventTime(); var lane = requestUpdateLane(current); var update = createUpdate(eventTime, lane); update.callback = callback !== undefined && callback !== null ? callback : null; enqueueUpdate(current, update, lane); scheduleInitialHydrationOnRoot(root, lane, eventTime); return root; } function updateContainer(element, container, parentComponent, callback) { { onScheduleRoot(container, element); } var current$1 = container.current; var eventTime = requestEventTime(); var lane = requestUpdateLane(current$1); { markRenderScheduled(lane); } var context = getContextForSubtree(parentComponent); if (container.context === null) { container.context = context; } else { container.pendingContext = context; } { if (isRendering && current !== null && !didWarnAboutNestedUpdates) { didWarnAboutNestedUpdates = true; error('Render methods should be a pure function of props and state; ' + 'triggering nested component updates from render is not allowed. ' + 'If necessary, trigger nested updates in componentDidUpdate.\n\n' + 'Check the render method of %s.', getComponentNameFromFiber(current) || 'Unknown'); } } var update = createUpdate(eventTime, lane); // Caution: React DevTools currently depends on this property // being called "element". update.payload = { element: element }; callback = callback === undefined ? null : callback; if (callback !== null) { { if (typeof callback !== 'function') { error('render(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callback); } } update.callback = callback; } var root = enqueueUpdate(current$1, update, lane); if (root !== null) { scheduleUpdateOnFiber(root, current$1, lane, eventTime); entangleTransitions(root, current$1, lane); } return lane; } function getPublicRootInstance(container) { var containerFiber = container.current; if (!containerFiber.child) { return null; } switch (containerFiber.child.tag) { case HostComponent: return getPublicInstance(containerFiber.child.stateNode); default: return containerFiber.child.stateNode; } } function attemptSynchronousHydration$1(fiber) { switch (fiber.tag) { case HostRoot: { var root = fiber.stateNode; if (isRootDehydrated(root)) { // Flush the first scheduled "update". var lanes = getHighestPriorityPendingLanes(root); flushRoot(root, lanes); } break; } case SuspenseComponent: { flushSync(function () { var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { var eventTime = requestEventTime(); scheduleUpdateOnFiber(root, fiber, SyncLane, eventTime); } }); // If we're still blocked after this, we need to increase // the priority of any promises resolving within this // boundary so that they next attempt also has higher pri. var retryLane = SyncLane; markRetryLaneIfNotHydrated(fiber, retryLane); break; } } } function markRetryLaneImpl(fiber, retryLane) { var suspenseState = fiber.memoizedState; if (suspenseState !== null && suspenseState.dehydrated !== null) { suspenseState.retryLane = higherPriorityLane(suspenseState.retryLane, retryLane); } } // Increases the priority of thenables when they resolve within this boundary. function markRetryLaneIfNotHydrated(fiber, retryLane) { markRetryLaneImpl(fiber, retryLane); var alternate = fiber.alternate; if (alternate) { markRetryLaneImpl(alternate, retryLane); } } function attemptContinuousHydration$1(fiber) { if (fiber.tag !== SuspenseComponent) { // We ignore HostRoots here because we can't increase // their priority and they should not suspend on I/O, // since you have to wrap anything that might suspend in // Suspense. return; } var lane = SelectiveHydrationLane; var root = enqueueConcurrentRenderForLane(fiber, lane); if (root !== null) { var eventTime = requestEventTime(); scheduleUpdateOnFiber(root, fiber, lane, eventTime); } markRetryLaneIfNotHydrated(fiber, lane); } function attemptHydrationAtCurrentPriority$1(fiber) { if (fiber.tag !== SuspenseComponent) { // We ignore HostRoots here because we can't increase // their priority other than synchronously flush it. return; } var lane = requestUpdateLane(fiber); var root = enqueueConcurrentRenderForLane(fiber, lane); if (root !== null) { var eventTime = requestEventTime(); scheduleUpdateOnFiber(root, fiber, lane, eventTime); } markRetryLaneIfNotHydrated(fiber, lane); } function findHostInstanceWithNoPortals(fiber) { var hostFiber = findCurrentHostFiberWithNoPortals(fiber); if (hostFiber === null) { return null; } return hostFiber.stateNode; } var shouldErrorImpl = function (fiber) { return null; }; function shouldError(fiber) { return shouldErrorImpl(fiber); } var shouldSuspendImpl = function (fiber) { return false; }; function shouldSuspend(fiber) { return shouldSuspendImpl(fiber); } var overrideHookState = null; var overrideHookStateDeletePath = null; var overrideHookStateRenamePath = null; var overrideProps = null; var overridePropsDeletePath = null; var overridePropsRenamePath = null; var scheduleUpdate = null; var setErrorHandler = null; var setSuspenseHandler = null; { var copyWithDeleteImpl = function (obj, path, index) { var key = path[index]; var updated = isArray(obj) ? obj.slice() : assign({}, obj); if (index + 1 === path.length) { if (isArray(updated)) { updated.splice(key, 1); } else { delete updated[key]; } return updated; } // $FlowFixMe number or string is fine here updated[key] = copyWithDeleteImpl(obj[key], path, index + 1); return updated; }; var copyWithDelete = function (obj, path) { return copyWithDeleteImpl(obj, path, 0); }; var copyWithRenameImpl = function (obj, oldPath, newPath, index) { var oldKey = oldPath[index]; var updated = isArray(obj) ? obj.slice() : assign({}, obj); if (index + 1 === oldPath.length) { var newKey = newPath[index]; // $FlowFixMe number or string is fine here updated[newKey] = updated[oldKey]; if (isArray(updated)) { updated.splice(oldKey, 1); } else { delete updated[oldKey]; } } else { // $FlowFixMe number or string is fine here updated[oldKey] = copyWithRenameImpl( // $FlowFixMe number or string is fine here obj[oldKey], oldPath, newPath, index + 1); } return updated; }; var copyWithRename = function (obj, oldPath, newPath) { if (oldPath.length !== newPath.length) { warn('copyWithRename() expects paths of the same length'); return; } else { for (var i = 0; i < newPath.length - 1; i++) { if (oldPath[i] !== newPath[i]) { warn('copyWithRename() expects paths to be the same except for the deepest key'); return; } } } return copyWithRenameImpl(obj, oldPath, newPath, 0); }; var copyWithSetImpl = function (obj, path, index, value) { if (index >= path.length) { return value; } var key = path[index]; var updated = isArray(obj) ? obj.slice() : assign({}, obj); // $FlowFixMe number or string is fine here updated[key] = copyWithSetImpl(obj[key], path, index + 1, value); return updated; }; var copyWithSet = function (obj, path, value) { return copyWithSetImpl(obj, path, 0, value); }; var findHook = function (fiber, id) { // For now, the "id" of stateful hooks is just the stateful hook index. // This may change in the future with e.g. nested hooks. var currentHook = fiber.memoizedState; while (currentHook !== null && id > 0) { currentHook = currentHook.next; id--; } return currentHook; }; // Support DevTools editable values for useState and useReducer. overrideHookState = function (fiber, id, path, value) { var hook = findHook(fiber, id); if (hook !== null) { var newState = copyWithSet(hook.memoizedState, path, value); hook.memoizedState = newState; hook.baseState = newState; // We aren't actually adding an update to the queue, // because there is no update we can add for useReducer hooks that won't trigger an error. // (There's no appropriate action type for DevTools overrides.) // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. fiber.memoizedProps = assign({}, fiber.memoizedProps); var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } } }; overrideHookStateDeletePath = function (fiber, id, path) { var hook = findHook(fiber, id); if (hook !== null) { var newState = copyWithDelete(hook.memoizedState, path); hook.memoizedState = newState; hook.baseState = newState; // We aren't actually adding an update to the queue, // because there is no update we can add for useReducer hooks that won't trigger an error. // (There's no appropriate action type for DevTools overrides.) // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. fiber.memoizedProps = assign({}, fiber.memoizedProps); var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } } }; overrideHookStateRenamePath = function (fiber, id, oldPath, newPath) { var hook = findHook(fiber, id); if (hook !== null) { var newState = copyWithRename(hook.memoizedState, oldPath, newPath); hook.memoizedState = newState; hook.baseState = newState; // We aren't actually adding an update to the queue, // because there is no update we can add for useReducer hooks that won't trigger an error. // (There's no appropriate action type for DevTools overrides.) // As a result though, React will see the scheduled update as a noop and bailout. // Shallow cloning props works as a workaround for now to bypass the bailout check. fiber.memoizedProps = assign({}, fiber.memoizedProps); var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } } }; // Support DevTools props for function components, forwardRef, memo, host components, etc. overrideProps = function (fiber, path, value) { fiber.pendingProps = copyWithSet(fiber.memoizedProps, path, value); if (fiber.alternate) { fiber.alternate.pendingProps = fiber.pendingProps; } var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } }; overridePropsDeletePath = function (fiber, path) { fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path); if (fiber.alternate) { fiber.alternate.pendingProps = fiber.pendingProps; } var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } }; overridePropsRenamePath = function (fiber, oldPath, newPath) { fiber.pendingProps = copyWithRename(fiber.memoizedProps, oldPath, newPath); if (fiber.alternate) { fiber.alternate.pendingProps = fiber.pendingProps; } var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } }; scheduleUpdate = function (fiber) { var root = enqueueConcurrentRenderForLane(fiber, SyncLane); if (root !== null) { scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp); } }; setErrorHandler = function (newShouldErrorImpl) { shouldErrorImpl = newShouldErrorImpl; }; setSuspenseHandler = function (newShouldSuspendImpl) { shouldSuspendImpl = newShouldSuspendImpl; }; } function findHostInstanceByFiber(fiber) { var hostFiber = findCurrentHostFiber(fiber); if (hostFiber === null) { return null; } return hostFiber.stateNode; } function emptyFindFiberByHostInstance(instance) { return null; } function getCurrentFiberForDevTools() { return current; } function injectIntoDevTools(devToolsConfig) { var findFiberByHostInstance = devToolsConfig.findFiberByHostInstance; var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher; return injectInternals({ bundleType: devToolsConfig.bundleType, version: devToolsConfig.version, rendererPackageName: devToolsConfig.rendererPackageName, rendererConfig: devToolsConfig.rendererConfig, overrideHookState: overrideHookState, overrideHookStateDeletePath: overrideHookStateDeletePath, overrideHookStateRenamePath: overrideHookStateRenamePath, overrideProps: overrideProps, overridePropsDeletePath: overridePropsDeletePath, overridePropsRenamePath: overridePropsRenamePath, setErrorHandler: setErrorHandler, setSuspenseHandler: setSuspenseHandler, scheduleUpdate: scheduleUpdate, currentDispatcherRef: ReactCurrentDispatcher, findHostInstanceByFiber: findHostInstanceByFiber, findFiberByHostInstance: findFiberByHostInstance || emptyFindFiberByHostInstance, // React Refresh findHostInstancesForRefresh: findHostInstancesForRefresh , scheduleRefresh: scheduleRefresh , scheduleRoot: scheduleRoot , setRefreshHandler: setRefreshHandler , // Enables DevTools to append owner stacks to error messages in DEV mode. getCurrentFiber: getCurrentFiberForDevTools , // Enables DevTools to detect reconciler version rather than renderer version // which may not match for third party renderers. reconcilerVersion: ReactVersion }); } /* global reportError */ var defaultOnRecoverableError = typeof reportError === 'function' ? // In modern browsers, reportError will dispatch an error event, // emulating an uncaught JavaScript error. reportError : function (error) { // In older browsers and test environments, fallback to console.error. // eslint-disable-next-line react-internal/no-production-logging console['error'](error); }; function ReactDOMRoot(internalRoot) { this._internalRoot = internalRoot; } ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function (children) { var root = this._internalRoot; if (root === null) { throw new Error('Cannot update an unmounted root.'); } { if (typeof arguments[1] === 'function') { error('render(...): does not support the second callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().'); } else if (isValidContainer(arguments[1])) { error('You passed a container to the second argument of root.render(...). ' + "You don't need to pass it again since you already passed it to create the root."); } else if (typeof arguments[1] !== 'undefined') { error('You passed a second argument to root.render(...) but it only accepts ' + 'one argument.'); } var container = root.containerInfo; if (container.nodeType !== COMMENT_NODE) { var hostInstance = findHostInstanceWithNoPortals(root.current); if (hostInstance) { if (hostInstance.parentNode !== container) { error('render(...): It looks like the React-rendered content of the ' + 'root container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + "root.unmount() to empty a root's container."); } } } } updateContainer(children, root, null, null); }; ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function () { { if (typeof arguments[0] === 'function') { error('unmount(...): does not support a callback argument. ' + 'To execute a side effect after rendering, declare it in a component body with useEffect().'); } } var root = this._internalRoot; if (root !== null) { this._internalRoot = null; var container = root.containerInfo; { if (isAlreadyRendering()) { error('Attempted to synchronously unmount a root while React was already ' + 'rendering. React cannot finish unmounting the root until the ' + 'current render has completed, which may lead to a race condition.'); } } flushSync(function () { updateContainer(null, root, null, null); }); unmarkContainerAsRoot(container); } }; function createRoot(container, options) { if (!isValidContainer(container)) { throw new Error('createRoot(...): Target container is not a DOM element.'); } warnIfReactDOMContainerInDEV(container); var isStrictMode = false; var concurrentUpdatesByDefaultOverride = false; var identifierPrefix = ''; var onRecoverableError = defaultOnRecoverableError; var transitionCallbacks = null; if (options !== null && options !== undefined) { { if (options.hydrate) { warn('hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead.'); } else { if (typeof options === 'object' && options !== null && options.$$typeof === REACT_ELEMENT_TYPE) { error('You passed a JSX element to createRoot. You probably meant to ' + 'call root.render instead. ' + 'Example usage:\n\n' + ' let root = createRoot(domContainer);\n' + ' root.render(<App />);'); } } } if (options.unstable_strictMode === true) { isStrictMode = true; } if (options.identifierPrefix !== undefined) { identifierPrefix = options.identifierPrefix; } if (options.onRecoverableError !== undefined) { onRecoverableError = options.onRecoverableError; } if (options.transitionCallbacks !== undefined) { transitionCallbacks = options.transitionCallbacks; } } var root = createContainer(container, ConcurrentRoot, null, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); markContainerAsRoot(root.current, container); var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container; listenToAllSupportedEvents(rootContainerElement); return new ReactDOMRoot(root); } function ReactDOMHydrationRoot(internalRoot) { this._internalRoot = internalRoot; } function scheduleHydration(target) { if (target) { queueExplicitHydrationTarget(target); } } ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = scheduleHydration; function hydrateRoot(container, initialChildren, options) { if (!isValidContainer(container)) { throw new Error('hydrateRoot(...): Target container is not a DOM element.'); } warnIfReactDOMContainerInDEV(container); { if (initialChildren === undefined) { error('Must provide initial children as second argument to hydrateRoot. ' + 'Example usage: hydrateRoot(domContainer, <App />)'); } } // For now we reuse the whole bag of options since they contain // the hydration callbacks. var hydrationCallbacks = options != null ? options : null; // TODO: Delete this option var mutableSources = options != null && options.hydratedSources || null; var isStrictMode = false; var concurrentUpdatesByDefaultOverride = false; var identifierPrefix = ''; var onRecoverableError = defaultOnRecoverableError; if (options !== null && options !== undefined) { if (options.unstable_strictMode === true) { isStrictMode = true; } if (options.identifierPrefix !== undefined) { identifierPrefix = options.identifierPrefix; } if (options.onRecoverableError !== undefined) { onRecoverableError = options.onRecoverableError; } } var root = createHydrationContainer(initialChildren, null, container, ConcurrentRoot, hydrationCallbacks, isStrictMode, concurrentUpdatesByDefaultOverride, identifierPrefix, onRecoverableError); markContainerAsRoot(root.current, container); // This can't be a comment node since hydration doesn't work on comment nodes anyway. listenToAllSupportedEvents(container); if (mutableSources) { for (var i = 0; i < mutableSources.length; i++) { var mutableSource = mutableSources[i]; registerMutableSourceForHydration(root, mutableSource); } } return new ReactDOMHydrationRoot(root); } function isValidContainer(node) { return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || !disableCommentsAsDOMContainers )); } // TODO: Remove this function which also includes comment nodes. // We only use it in places that are currently more relaxed. function isValidContainerLegacy(node) { return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable ')); } function warnIfReactDOMContainerInDEV(container) { { if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') { error('createRoot(): Creating roots directly with document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try using a container element created ' + 'for your app.'); } if (isContainerMarkedAsRoot(container)) { if (container._reactRootContainer) { error('You are calling ReactDOMClient.createRoot() on a container that was previously ' + 'passed to ReactDOM.render(). This is not supported.'); } else { error('You are calling ReactDOMClient.createRoot() on a container that ' + 'has already been passed to createRoot() before. Instead, call ' + 'root.render() on the existing root instead if you want to update it.'); } } } } var ReactCurrentOwner$3 = ReactSharedInternals.ReactCurrentOwner; var topLevelUpdateWarnings; { topLevelUpdateWarnings = function (container) { if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) { var hostInstance = findHostInstanceWithNoPortals(container._reactRootContainer.current); if (hostInstance) { if (hostInstance.parentNode !== container) { error('render(...): It looks like the React-rendered content of this ' + 'container was removed without using React. This is not ' + 'supported and will cause errors. Instead, call ' + 'ReactDOM.unmountComponentAtNode to empty a container.'); } } } var isRootRenderedBySomeReact = !!container._reactRootContainer; var rootEl = getReactRootElementInContainer(container); var hasNonRootReactChild = !!(rootEl && getInstanceFromNode(rootEl)); if (hasNonRootReactChild && !isRootRenderedBySomeReact) { error('render(...): Replacing React-rendered children with a new root ' + 'component. If you intended to update the children of this node, ' + 'you should instead have the existing children update their state ' + 'and render the new components instead of calling ReactDOM.render.'); } if (container.nodeType === ELEMENT_NODE && container.tagName && container.tagName.toUpperCase() === 'BODY') { error('render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.'); } }; } function getReactRootElementInContainer(container) { if (!container) { return null; } if (container.nodeType === DOCUMENT_NODE) { return container.documentElement; } else { return container.firstChild; } } function noopOnRecoverableError() {// This isn't reachable because onRecoverableError isn't called in the // legacy API. } function legacyCreateRootFromDOMContainer(container, initialChildren, parentComponent, callback, isHydrationContainer) { if (isHydrationContainer) { if (typeof callback === 'function') { var originalCallback = callback; callback = function () { var instance = getPublicRootInstance(root); originalCallback.call(instance); }; } var root = createHydrationContainer(initialChildren, callback, container, LegacyRoot, null, // hydrationCallbacks false, // isStrictMode false, // concurrentUpdatesByDefaultOverride, '', // identifierPrefix noopOnRecoverableError); container._reactRootContainer = root; markContainerAsRoot(root.current, container); var rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container; listenToAllSupportedEvents(rootContainerElement); flushSync(); return root; } else { // First clear any existing content. var rootSibling; while (rootSibling = container.lastChild) { container.removeChild(rootSibling); } if (typeof callback === 'function') { var _originalCallback = callback; callback = function () { var instance = getPublicRootInstance(_root); _originalCallback.call(instance); }; } var _root = createContainer(container, LegacyRoot, null, // hydrationCallbacks false, // isStrictMode false, // concurrentUpdatesByDefaultOverride, '', // identifierPrefix noopOnRecoverableError); container._reactRootContainer = _root; markContainerAsRoot(_root.current, container); var _rootContainerElement = container.nodeType === COMMENT_NODE ? container.parentNode : container; listenToAllSupportedEvents(_rootContainerElement); // Initial mount should not be batched. flushSync(function () { updateContainer(initialChildren, _root, parentComponent, callback); }); return _root; } } function warnOnInvalidCallback$1(callback, callerName) { { if (callback !== null && typeof callback !== 'function') { error('%s(...): Expected the last optional `callback` argument to be a ' + 'function. Instead received: %s.', callerName, callback); } } } function legacyRenderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) { { topLevelUpdateWarnings(container); warnOnInvalidCallback$1(callback === undefined ? null : callback, 'render'); } var maybeRoot = container._reactRootContainer; var root; if (!maybeRoot) { // Initial mount root = legacyCreateRootFromDOMContainer(container, children, parentComponent, callback, forceHydrate); } else { root = maybeRoot; if (typeof callback === 'function') { var originalCallback = callback; callback = function () { var instance = getPublicRootInstance(root); originalCallback.call(instance); }; } // Update updateContainer(children, root, parentComponent, callback); } return getPublicRootInstance(root); } var didWarnAboutFindDOMNode = false; function findDOMNode(componentOrElement) { { if (!didWarnAboutFindDOMNode) { didWarnAboutFindDOMNode = true; error('findDOMNode is deprecated and will be removed in the next major ' + 'release. Instead, add a ref directly to the element you want ' + 'to reference. Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-find-node'); } var owner = ReactCurrentOwner$3.current; if (owner !== null && owner.stateNode !== null) { var warnedAboutRefsInRender = owner.stateNode._warnedAboutRefsInRender; if (!warnedAboutRefsInRender) { error('%s is accessing findDOMNode inside its render(). ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentNameFromType(owner.type) || 'A component'); } owner.stateNode._warnedAboutRefsInRender = true; } } if (componentOrElement == null) { return null; } if (componentOrElement.nodeType === ELEMENT_NODE) { return componentOrElement; } { return findHostInstanceWithWarning(componentOrElement, 'findDOMNode'); } } function hydrate(element, container, callback) { { error('ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot ' + 'instead. Until you switch to the new API, your app will behave as ' + "if it's running React 17. Learn " + 'more: https://reactjs.org/link/switch-to-createroot'); } if (!isValidContainerLegacy(container)) { throw new Error('Target container is not a DOM element.'); } { var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined; if (isModernRoot) { error('You are calling ReactDOM.hydrate() on a container that was previously ' + 'passed to ReactDOMClient.createRoot(). This is not supported. ' + 'Did you mean to call hydrateRoot(container, element)?'); } } // TODO: throw or warn if we couldn't hydrate? return legacyRenderSubtreeIntoContainer(null, element, container, true, callback); } function render(element, container, callback) { { error('ReactDOM.render is no longer supported in React 18. Use createRoot ' + 'instead. Until you switch to the new API, your app will behave as ' + "if it's running React 17. Learn " + 'more: https://reactjs.org/link/switch-to-createroot'); } if (!isValidContainerLegacy(container)) { throw new Error('Target container is not a DOM element.'); } { var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined; if (isModernRoot) { error('You are calling ReactDOM.render() on a container that was previously ' + 'passed to ReactDOMClient.createRoot(). This is not supported. ' + 'Did you mean to call root.render(element)?'); } } return legacyRenderSubtreeIntoContainer(null, element, container, false, callback); } function unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) { { error('ReactDOM.unstable_renderSubtreeIntoContainer() is no longer supported ' + 'in React 18. Consider using a portal instead. Until you switch to ' + "the createRoot API, your app will behave as if it's running React " + '17. Learn more: https://reactjs.org/link/switch-to-createroot'); } if (!isValidContainerLegacy(containerNode)) { throw new Error('Target container is not a DOM element.'); } if (parentComponent == null || !has(parentComponent)) { throw new Error('parentComponent must be a valid React Component'); } return legacyRenderSubtreeIntoContainer(parentComponent, element, containerNode, false, callback); } var didWarnAboutUnmountComponentAtNode = false; function unmountComponentAtNode(container) { { if (!didWarnAboutUnmountComponentAtNode) { didWarnAboutUnmountComponentAtNode = true; error('unmountComponentAtNode is deprecated and will be removed in the ' + 'next major release. Switch to the createRoot API. Learn ' + 'more: https://reactjs.org/link/switch-to-createroot'); } } if (!isValidContainerLegacy(container)) { throw new Error('unmountComponentAtNode(...): Target container is not a DOM element.'); } { var isModernRoot = isContainerMarkedAsRoot(container) && container._reactRootContainer === undefined; if (isModernRoot) { error('You are calling ReactDOM.unmountComponentAtNode() on a container that was previously ' + 'passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()?'); } } if (container._reactRootContainer) { { var rootEl = getReactRootElementInContainer(container); var renderedByDifferentReact = rootEl && !getInstanceFromNode(rootEl); if (renderedByDifferentReact) { error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by another copy of React.'); } } // Unmount should not be batched. flushSync(function () { legacyRenderSubtreeIntoContainer(null, null, container, false, function () { // $FlowFixMe This should probably use `delete container._reactRootContainer` container._reactRootContainer = null; unmarkContainerAsRoot(container); }); }); // If you call unmountComponentAtNode twice in quick succession, you'll // get `true` twice. That's probably fine? return true; } else { { var _rootEl = getReactRootElementInContainer(container); var hasNonRootReactChild = !!(_rootEl && getInstanceFromNode(_rootEl)); // Check if the container itself is a React root node. var isContainerReactRoot = container.nodeType === ELEMENT_NODE && isValidContainerLegacy(container.parentNode) && !!container.parentNode._reactRootContainer; if (hasNonRootReactChild) { error("unmountComponentAtNode(): The node you're attempting to unmount " + 'was rendered by React and is not a top-level container. %s', isContainerReactRoot ? 'You may have accidentally passed in a React root node instead ' + 'of its container.' : 'Instead, have the parent component update its state and ' + 'rerender in order to remove this component.'); } } return false; } } setAttemptSynchronousHydration(attemptSynchronousHydration$1); setAttemptContinuousHydration(attemptContinuousHydration$1); setAttemptHydrationAtCurrentPriority(attemptHydrationAtCurrentPriority$1); setGetCurrentUpdatePriority(getCurrentUpdatePriority); setAttemptHydrationAtPriority(runWithPriority); { if (typeof Map !== 'function' || // $FlowIssue Flow incorrectly thinks Map has no prototype Map.prototype == null || typeof Map.prototype.forEach !== 'function' || typeof Set !== 'function' || // $FlowIssue Flow incorrectly thinks Set has no prototype Set.prototype == null || typeof Set.prototype.clear !== 'function' || typeof Set.prototype.forEach !== 'function') { error('React depends on Map and Set built-in types. Make sure that you load a ' + 'polyfill in older browsers. https://reactjs.org/link/react-polyfills'); } } setRestoreImplementation(restoreControlledState$3); setBatchingImplementation(batchedUpdates$1, discreteUpdates, flushSync); function createPortal$1(children, container) { var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; if (!isValidContainer(container)) { throw new Error('Target container is not a DOM element.'); } // TODO: pass ReactDOM portal implementation as third argument // $FlowFixMe The Flow type is opaque but there's no way to actually create it. return createPortal(children, container, null, key); } function renderSubtreeIntoContainer(parentComponent, element, containerNode, callback) { return unstable_renderSubtreeIntoContainer(parentComponent, element, containerNode, callback); } var Internals = { usingClientEntryPoint: false, // Keep in sync with ReactTestUtils.js. // This is an array for better minification. Events: [getInstanceFromNode, getNodeFromInstance, getFiberCurrentPropsFromNode, enqueueStateRestore, restoreStateIfNeeded, batchedUpdates$1] }; function createRoot$1(container, options) { { if (!Internals.usingClientEntryPoint && !true) { error('You are importing createRoot from "react-dom" which is not supported. ' + 'You should instead import it from "react-dom/client".'); } } return createRoot(container, options); } function hydrateRoot$1(container, initialChildren, options) { { if (!Internals.usingClientEntryPoint && !true) { error('You are importing hydrateRoot from "react-dom" which is not supported. ' + 'You should instead import it from "react-dom/client".'); } } return hydrateRoot(container, initialChildren, options); } // Overload the definition to the two valid signatures. // Warning, this opts-out of checking the function body. // eslint-disable-next-line no-redeclare function flushSync$1(fn) { { if (isAlreadyRendering()) { error('flushSync was called from inside a lifecycle method. React cannot ' + 'flush when React is already rendering. Consider moving this call to ' + 'a scheduler task or micro task.'); } } return flushSync(fn); } var foundDevTools = injectIntoDevTools({ findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 1 , version: ReactVersion, rendererPackageName: 'react-dom' }); { if (!foundDevTools && canUseDOM && window.top === window.self) { // If we're in Chrome or Firefox, provide a download link if not installed. if (navigator.userAgent.indexOf('Chrome') > -1 && navigator.userAgent.indexOf('Edge') === -1 || navigator.userAgent.indexOf('Firefox') > -1) { var protocol = window.location.protocol; // Don't warn in exotic cases like chrome-extension://. if (/^(https?|file):$/.test(protocol)) { // eslint-disable-next-line react-internal/no-production-logging console.info('%cDownload the React DevTools ' + 'for a better development experience: ' + 'https://reactjs.org/link/react-devtools' + (protocol === 'file:' ? '\nYou might need to use a local HTTP server (instead of file://): ' + 'https://reactjs.org/link/react-devtools-faq' : ''), 'font-weight:bold'); } } } } exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = Internals; exports.createPortal = createPortal$1; exports.createRoot = createRoot$1; exports.findDOMNode = findDOMNode; exports.flushSync = flushSync$1; exports.hydrate = hydrate; exports.hydrateRoot = hydrateRoot$1; exports.render = render; exports.unmountComponentAtNode = unmountComponentAtNode; exports.unstable_batchedUpdates = batchedUpdates$1; exports.unstable_renderSubtreeIntoContainer = renderSubtreeIntoContainer; exports.version = ReactVersion; }))); vendor/wp-polyfill-node-contains.js 0000644 00000001203 15013651111 0013402 0 ustar 00 // Node.prototype.contains (function() { function contains(node) { if (!(0 in arguments)) { throw new TypeError('1 argument is required'); } do { if (this === node) { return true; } // eslint-disable-next-line no-cond-assign } while (node = node && node.parentNode); return false; } // IE if ('HTMLElement' in self && 'contains' in HTMLElement.prototype) { try { delete HTMLElement.prototype.contains; // eslint-disable-next-line no-empty } catch (e) {} } if ('Node' in self) { Node.prototype.contains = contains; } else { document.contains = Element.prototype.contains = contains; } }()); vendor/wp-polyfill-url.js 0000644 00000327374 15013651111 0011467 0 ustar 00 (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ module.exports = function (it) { if (typeof it != 'function') { throw TypeError(String(it) + ' is not a function'); } return it; }; },{}],2:[function(require,module,exports){ var isObject = require('../internals/is-object'); module.exports = function (it) { if (!isObject(it) && it !== null) { throw TypeError("Can't set " + String(it) + ' as a prototype'); } return it; }; },{"../internals/is-object":37}],3:[function(require,module,exports){ var wellKnownSymbol = require('../internals/well-known-symbol'); var create = require('../internals/object-create'); var definePropertyModule = require('../internals/object-define-property'); var UNSCOPABLES = wellKnownSymbol('unscopables'); var ArrayPrototype = Array.prototype; // Array.prototype[@@unscopables] // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables if (ArrayPrototype[UNSCOPABLES] == undefined) { definePropertyModule.f(ArrayPrototype, UNSCOPABLES, { configurable: true, value: create(null) }); } // add a key to Array.prototype[@@unscopables] module.exports = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; },{"../internals/object-create":45,"../internals/object-define-property":47,"../internals/well-known-symbol":77}],4:[function(require,module,exports){ module.exports = function (it, Constructor, name) { if (!(it instanceof Constructor)) { throw TypeError('Incorrect ' + (name ? name + ' ' : '') + 'invocation'); } return it; }; },{}],5:[function(require,module,exports){ var isObject = require('../internals/is-object'); module.exports = function (it) { if (!isObject(it)) { throw TypeError(String(it) + ' is not an object'); } return it; }; },{"../internals/is-object":37}],6:[function(require,module,exports){ 'use strict'; var bind = require('../internals/function-bind-context'); var toObject = require('../internals/to-object'); var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing'); var isArrayIteratorMethod = require('../internals/is-array-iterator-method'); var toLength = require('../internals/to-length'); var createProperty = require('../internals/create-property'); var getIteratorMethod = require('../internals/get-iterator-method'); // `Array.from` method implementation // https://tc39.github.io/ecma262/#sec-array.from module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { var O = toObject(arrayLike); var C = typeof this == 'function' ? this : Array; var argumentsLength = arguments.length; var mapfn = argumentsLength > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var iteratorMethod = getIteratorMethod(O); var index = 0; var length, result, step, iterator, next, value; if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined, 2); // if the target is not iterable or it's an array with the default iterator - use a simple case if (iteratorMethod != undefined && !(C == Array && isArrayIteratorMethod(iteratorMethod))) { iterator = iteratorMethod.call(O); next = iterator.next; result = new C(); for (;!(step = next.call(iterator)).done; index++) { value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value; createProperty(result, index, value); } } else { length = toLength(O.length); result = new C(length); for (;length > index; index++) { value = mapping ? mapfn(O[index], index) : O[index]; createProperty(result, index, value); } } result.length = index; return result; }; },{"../internals/call-with-safe-iteration-closing":8,"../internals/create-property":16,"../internals/function-bind-context":23,"../internals/get-iterator-method":25,"../internals/is-array-iterator-method":35,"../internals/to-length":71,"../internals/to-object":72}],7:[function(require,module,exports){ var toIndexedObject = require('../internals/to-indexed-object'); var toLength = require('../internals/to-length'); var toAbsoluteIndex = require('../internals/to-absolute-index'); // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; module.exports = { // `Array.prototype.includes` method // https://tc39.github.io/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.github.io/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; },{"../internals/to-absolute-index":68,"../internals/to-indexed-object":69,"../internals/to-length":71}],8:[function(require,module,exports){ var anObject = require('../internals/an-object'); // call something on iterator step with safe closing on error module.exports = function (iterator, fn, value, ENTRIES) { try { return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion) } catch (error) { var returnMethod = iterator['return']; if (returnMethod !== undefined) anObject(returnMethod.call(iterator)); throw error; } }; },{"../internals/an-object":5}],9:[function(require,module,exports){ var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; },{}],10:[function(require,module,exports){ var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support'); var classofRaw = require('../internals/classof-raw'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; }; },{"../internals/classof-raw":9,"../internals/to-string-tag-support":74,"../internals/well-known-symbol":77}],11:[function(require,module,exports){ var has = require('../internals/has'); var ownKeys = require('../internals/own-keys'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); var definePropertyModule = require('../internals/object-define-property'); module.exports = function (target, source) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } }; },{"../internals/has":28,"../internals/object-define-property":47,"../internals/object-get-own-property-descriptor":48,"../internals/own-keys":56}],12:[function(require,module,exports){ var fails = require('../internals/fails'); module.exports = !fails(function () { function F() { /* empty */ } F.prototype.constructor = null; return Object.getPrototypeOf(new F()) !== F.prototype; }); },{"../internals/fails":22}],13:[function(require,module,exports){ 'use strict'; var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype; var create = require('../internals/object-create'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var setToStringTag = require('../internals/set-to-string-tag'); var Iterators = require('../internals/iterators'); var returnThis = function () { return this; }; module.exports = function (IteratorConstructor, NAME, next) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }); setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); Iterators[TO_STRING_TAG] = returnThis; return IteratorConstructor; }; },{"../internals/create-property-descriptor":15,"../internals/iterators":40,"../internals/iterators-core":39,"../internals/object-create":45,"../internals/set-to-string-tag":62}],14:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var definePropertyModule = require('../internals/object-define-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; },{"../internals/create-property-descriptor":15,"../internals/descriptors":18,"../internals/object-define-property":47}],15:[function(require,module,exports){ module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; },{}],16:[function(require,module,exports){ 'use strict'; var toPrimitive = require('../internals/to-primitive'); var definePropertyModule = require('../internals/object-define-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = function (object, key, value) { var propertyKey = toPrimitive(key); if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); else object[propertyKey] = value; }; },{"../internals/create-property-descriptor":15,"../internals/object-define-property":47,"../internals/to-primitive":73}],17:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var createIteratorConstructor = require('../internals/create-iterator-constructor'); var getPrototypeOf = require('../internals/object-get-prototype-of'); var setPrototypeOf = require('../internals/object-set-prototype-of'); var setToStringTag = require('../internals/set-to-string-tag'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var redefine = require('../internals/redefine'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var Iterators = require('../internals/iterators'); var IteratorsCore = require('../internals/iterators-core'); var IteratorPrototype = IteratorsCore.IteratorPrototype; var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; var ITERATOR = wellKnownSymbol('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; var returnThis = function () { return this; }; module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { createIteratorConstructor(IteratorConstructor, NAME, next); var getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) return defaultIterator; if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; switch (KIND) { case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; } return function () { return new IteratorConstructor(this); }; }; var TO_STRING_TAG = NAME + ' Iterator'; var INCORRECT_VALUES_NAME = false; var IterablePrototype = Iterable.prototype; var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; var CurrentIteratorPrototype, methods, KEY; // fix native if (anyNativeIterator) { CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { if (setPrototypeOf) { setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis); } } // Set @@toStringTag to native iterators setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { INCORRECT_VALUES_NAME = true; defaultIterator = function values() { return nativeIterator.call(this); }; } // define iterator if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator); } Iterators[NAME] = defaultIterator; // export additional methods if (DEFAULT) { methods = { values: getIterationMethod(VALUES), keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), entries: getIterationMethod(ENTRIES) }; if (FORCED) for (KEY in methods) { if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { redefine(IterablePrototype, KEY, methods[KEY]); } } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } return methods; }; },{"../internals/create-iterator-constructor":13,"../internals/create-non-enumerable-property":14,"../internals/export":21,"../internals/is-pure":38,"../internals/iterators":40,"../internals/iterators-core":39,"../internals/object-get-prototype-of":51,"../internals/object-set-prototype-of":55,"../internals/redefine":59,"../internals/set-to-string-tag":62,"../internals/well-known-symbol":77}],18:[function(require,module,exports){ var fails = require('../internals/fails'); // Thank's IE8 for his funny defineProperty module.exports = !fails(function () { return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7; }); },{"../internals/fails":22}],19:[function(require,module,exports){ var global = require('../internals/global'); var isObject = require('../internals/is-object'); var document = global.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; },{"../internals/global":27,"../internals/is-object":37}],20:[function(require,module,exports){ // IE8- don't enum bug keys module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; },{}],21:[function(require,module,exports){ var global = require('../internals/global'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var redefine = require('../internals/redefine'); var setGlobal = require('../internals/set-global'); var copyConstructorProperties = require('../internals/copy-constructor-properties'); var isForced = require('../internals/is-forced'); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global; } else if (STATIC) { target = global[TARGET] || setGlobal(TARGET, {}); } else { target = (global[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty === typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { createNonEnumerableProperty(sourceProperty, 'sham', true); } // extend global redefine(target, key, sourceProperty, options); } }; },{"../internals/copy-constructor-properties":11,"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/is-forced":36,"../internals/object-get-own-property-descriptor":48,"../internals/redefine":59,"../internals/set-global":61}],22:[function(require,module,exports){ module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; },{}],23:[function(require,module,exports){ var aFunction = require('../internals/a-function'); // optional / simple context binding module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 0: return function () { return fn.call(that); }; case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; },{"../internals/a-function":1}],24:[function(require,module,exports){ var path = require('../internals/path'); var global = require('../internals/global'); var aFunction = function (variable) { return typeof variable == 'function' ? variable : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; }; },{"../internals/global":27,"../internals/path":57}],25:[function(require,module,exports){ var classof = require('../internals/classof'); var Iterators = require('../internals/iterators'); var wellKnownSymbol = require('../internals/well-known-symbol'); var ITERATOR = wellKnownSymbol('iterator'); module.exports = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; }; },{"../internals/classof":10,"../internals/iterators":40,"../internals/well-known-symbol":77}],26:[function(require,module,exports){ var anObject = require('../internals/an-object'); var getIteratorMethod = require('../internals/get-iterator-method'); module.exports = function (it) { var iteratorMethod = getIteratorMethod(it); if (typeof iteratorMethod != 'function') { throw TypeError(String(it) + ' is not iterable'); } return anObject(iteratorMethod.call(it)); }; },{"../internals/an-object":5,"../internals/get-iterator-method":25}],27:[function(require,module,exports){ (function (global){ var check = function (it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line no-undef check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || check(typeof self == 'object' && self) || check(typeof global == 'object' && global) || // eslint-disable-next-line no-new-func Function('return this')(); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],28:[function(require,module,exports){ var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; },{}],29:[function(require,module,exports){ module.exports = {}; },{}],30:[function(require,module,exports){ var getBuiltIn = require('../internals/get-built-in'); module.exports = getBuiltIn('document', 'documentElement'); },{"../internals/get-built-in":24}],31:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); var createElement = require('../internals/document-create-element'); // Thank's IE8 for his funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a != 7; }); },{"../internals/descriptors":18,"../internals/document-create-element":19,"../internals/fails":22}],32:[function(require,module,exports){ var fails = require('../internals/fails'); var classof = require('../internals/classof-raw'); var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) == 'String' ? split.call(it, '') : Object(it); } : Object; },{"../internals/classof-raw":9,"../internals/fails":22}],33:[function(require,module,exports){ var store = require('../internals/shared-store'); var functionToString = Function.toString; // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper if (typeof store.inspectSource != 'function') { store.inspectSource = function (it) { return functionToString.call(it); }; } module.exports = store.inspectSource; },{"../internals/shared-store":64}],34:[function(require,module,exports){ var NATIVE_WEAK_MAP = require('../internals/native-weak-map'); var global = require('../internals/global'); var isObject = require('../internals/is-object'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var objectHas = require('../internals/has'); var sharedKey = require('../internals/shared-key'); var hiddenKeys = require('../internals/hidden-keys'); var WeakMap = global.WeakMap; var set, get, has; var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP) { var store = new WeakMap(); var wmget = store.get; var wmhas = store.has; var wmset = store.set; set = function (it, metadata) { wmset.call(store, it, metadata); return metadata; }; get = function (it) { return wmget.call(store, it) || {}; }; has = function (it) { return wmhas.call(store, it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { createNonEnumerableProperty(it, STATE, metadata); return metadata; }; get = function (it) { return objectHas(it, STATE) ? it[STATE] : {}; }; has = function (it) { return objectHas(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; },{"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/has":28,"../internals/hidden-keys":29,"../internals/is-object":37,"../internals/native-weak-map":43,"../internals/shared-key":63}],35:[function(require,module,exports){ var wellKnownSymbol = require('../internals/well-known-symbol'); var Iterators = require('../internals/iterators'); var ITERATOR = wellKnownSymbol('iterator'); var ArrayPrototype = Array.prototype; // check on default Array iterator module.exports = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); }; },{"../internals/iterators":40,"../internals/well-known-symbol":77}],36:[function(require,module,exports){ var fails = require('../internals/fails'); var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; },{"../internals/fails":22}],37:[function(require,module,exports){ module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; },{}],38:[function(require,module,exports){ module.exports = false; },{}],39:[function(require,module,exports){ 'use strict'; var getPrototypeOf = require('../internals/object-get-prototype-of'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var has = require('../internals/has'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var ITERATOR = wellKnownSymbol('iterator'); var BUGGY_SAFARI_ITERATORS = false; var returnThis = function () { return this; }; // `%IteratorPrototype%` object // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; if ([].keys) { arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; else { PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; } } if (IteratorPrototype == undefined) IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) { createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis); } module.exports = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; },{"../internals/create-non-enumerable-property":14,"../internals/has":28,"../internals/is-pure":38,"../internals/object-get-prototype-of":51,"../internals/well-known-symbol":77}],40:[function(require,module,exports){ arguments[4][29][0].apply(exports,arguments) },{"dup":29}],41:[function(require,module,exports){ var fails = require('../internals/fails'); module.exports = !!Object.getOwnPropertySymbols && !fails(function () { // Chrome 38 Symbol has incorrect toString conversion // eslint-disable-next-line no-undef return !String(Symbol()); }); },{"../internals/fails":22}],42:[function(require,module,exports){ var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var ITERATOR = wellKnownSymbol('iterator'); module.exports = !fails(function () { var url = new URL('b?a=1&b=2&c=3', 'http://a'); var searchParams = url.searchParams; var result = ''; url.pathname = 'c%20d'; searchParams.forEach(function (value, key) { searchParams['delete']('b'); result += key + value; }); return (IS_PURE && !url.toJSON) || !searchParams.sort || url.href !== 'http://a/c%20d?a=1&c=3' || searchParams.get('c') !== '3' || String(new URLSearchParams('?a=1')) !== 'a=1' || !searchParams[ITERATOR] // throws in Edge || new URL('https://a@b').username !== 'a' || new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b' // not punycoded in Edge || new URL('http://тест').host !== 'xn--e1aybc' // not escaped in Chrome 62- || new URL('http://a#б').hash !== '#%D0%B1' // fails in Chrome 66- || result !== 'a1c3' // throws in Safari || new URL('http://x', undefined).host !== 'x'; }); },{"../internals/fails":22,"../internals/is-pure":38,"../internals/well-known-symbol":77}],43:[function(require,module,exports){ var global = require('../internals/global'); var inspectSource = require('../internals/inspect-source'); var WeakMap = global.WeakMap; module.exports = typeof WeakMap === 'function' && /native code/.test(inspectSource(WeakMap)); },{"../internals/global":27,"../internals/inspect-source":33}],44:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); var objectKeys = require('../internals/object-keys'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var toObject = require('../internals/to-object'); var IndexedObject = require('../internals/indexed-object'); var nativeAssign = Object.assign; var defineProperty = Object.defineProperty; // `Object.assign` method // https://tc39.github.io/ecma262/#sec-object.assign module.exports = !nativeAssign || fails(function () { // should have correct order of operations (Edge bug) if (DESCRIPTORS && nativeAssign({ b: 1 }, nativeAssign(defineProperty({}, 'a', { enumerable: true, get: function () { defineProperty(this, 'b', { value: 3, enumerable: false }); } }), { b: 2 })).b !== 1) return true; // should work with symbols and should have deterministic property order (V8 bug) var A = {}; var B = {}; // eslint-disable-next-line no-undef var symbol = Symbol(); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars var T = toObject(target); var argumentsLength = arguments.length; var index = 1; var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; var propertyIsEnumerable = propertyIsEnumerableModule.f; while (argumentsLength > index) { var S = IndexedObject(arguments[index++]); var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key]; } } return T; } : nativeAssign; },{"../internals/descriptors":18,"../internals/fails":22,"../internals/indexed-object":32,"../internals/object-get-own-property-symbols":50,"../internals/object-keys":53,"../internals/object-property-is-enumerable":54,"../internals/to-object":72}],45:[function(require,module,exports){ var anObject = require('../internals/an-object'); var defineProperties = require('../internals/object-define-properties'); var enumBugKeys = require('../internals/enum-bug-keys'); var hiddenKeys = require('../internals/hidden-keys'); var html = require('../internals/html'); var documentCreateElement = require('../internals/document-create-element'); var sharedKey = require('../internals/shared-key'); var GT = '>'; var LT = '<'; var PROTOTYPE = 'prototype'; var SCRIPT = 'script'; var IE_PROTO = sharedKey('IE_PROTO'); var EmptyConstructor = function () { /* empty */ }; var scriptTag = function (content) { return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT; }; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype var NullProtoObjectViaActiveX = function (activeXDocument) { activeXDocument.write(scriptTag('')); activeXDocument.close(); var temp = activeXDocument.parentWindow.Object; activeXDocument = null; // avoid memory leak return temp; }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var NullProtoObjectViaIFrame = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var JS = 'java' + SCRIPT + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475 iframe.src = String(JS); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(scriptTag('document.F=Object')); iframeDocument.close(); return iframeDocument.F; }; // Check for document.domain and active x support // No need to use active x approach when document.domain is not set // see https://github.com/es-shims/es5-shim/issues/150 // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346 // avoid IE GC bug var activeXDocument; var NullProtoObject = function () { try { /* global ActiveXObject */ activeXDocument = document.domain && new ActiveXObject('htmlfile'); } catch (error) { /* ignore */ } NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame(); var length = enumBugKeys.length; while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]]; return NullProtoObject(); }; hiddenKeys[IE_PROTO] = true; // `Object.create` method // https://tc39.github.io/ecma262/#sec-object.create module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { EmptyConstructor[PROTOTYPE] = anObject(O); result = new EmptyConstructor(); EmptyConstructor[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = NullProtoObject(); return Properties === undefined ? result : defineProperties(result, Properties); }; },{"../internals/an-object":5,"../internals/document-create-element":19,"../internals/enum-bug-keys":20,"../internals/hidden-keys":29,"../internals/html":30,"../internals/object-define-properties":46,"../internals/shared-key":63}],46:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var definePropertyModule = require('../internals/object-define-property'); var anObject = require('../internals/an-object'); var objectKeys = require('../internals/object-keys'); // `Object.defineProperties` method // https://tc39.github.io/ecma262/#sec-object.defineproperties module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); return O; }; },{"../internals/an-object":5,"../internals/descriptors":18,"../internals/object-define-property":47,"../internals/object-keys":53}],47:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); var anObject = require('../internals/an-object'); var toPrimitive = require('../internals/to-primitive'); var nativeDefineProperty = Object.defineProperty; // `Object.defineProperty` method // https://tc39.github.io/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return nativeDefineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; },{"../internals/an-object":5,"../internals/descriptors":18,"../internals/ie8-dom-define":31,"../internals/to-primitive":73}],48:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var toIndexedObject = require('../internals/to-indexed-object'); var toPrimitive = require('../internals/to-primitive'); var has = require('../internals/has'); var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return nativeGetOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); }; },{"../internals/create-property-descriptor":15,"../internals/descriptors":18,"../internals/has":28,"../internals/ie8-dom-define":31,"../internals/object-property-is-enumerable":54,"../internals/to-indexed-object":69,"../internals/to-primitive":73}],49:[function(require,module,exports){ var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.github.io/ecma262/#sec-object.getownpropertynames exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; },{"../internals/enum-bug-keys":20,"../internals/object-keys-internal":52}],50:[function(require,module,exports){ exports.f = Object.getOwnPropertySymbols; },{}],51:[function(require,module,exports){ var has = require('../internals/has'); var toObject = require('../internals/to-object'); var sharedKey = require('../internals/shared-key'); var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); var IE_PROTO = sharedKey('IE_PROTO'); var ObjectPrototype = Object.prototype; // `Object.getPrototypeOf` method // https://tc39.github.io/ecma262/#sec-object.getprototypeof module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectPrototype : null; }; },{"../internals/correct-prototype-getter":12,"../internals/has":28,"../internals/shared-key":63,"../internals/to-object":72}],52:[function(require,module,exports){ var has = require('../internals/has'); var toIndexedObject = require('../internals/to-indexed-object'); var indexOf = require('../internals/array-includes').indexOf; var hiddenKeys = require('../internals/hidden-keys'); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~indexOf(result, key) || result.push(key); } return result; }; },{"../internals/array-includes":7,"../internals/has":28,"../internals/hidden-keys":29,"../internals/to-indexed-object":69}],53:[function(require,module,exports){ var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); // `Object.keys` method // https://tc39.github.io/ecma262/#sec-object.keys module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; },{"../internals/enum-bug-keys":20,"../internals/object-keys-internal":52}],54:[function(require,module,exports){ 'use strict'; var nativePropertyIsEnumerable = {}.propertyIsEnumerable; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : nativePropertyIsEnumerable; },{}],55:[function(require,module,exports){ var anObject = require('../internals/an-object'); var aPossiblePrototype = require('../internals/a-possible-prototype'); // `Object.setPrototypeOf` method // https://tc39.github.io/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; setter.call(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { anObject(O); aPossiblePrototype(proto); if (CORRECT_SETTER) setter.call(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); },{"../internals/a-possible-prototype":2,"../internals/an-object":5}],56:[function(require,module,exports){ var getBuiltIn = require('../internals/get-built-in'); var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var anObject = require('../internals/an-object'); // all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; }; },{"../internals/an-object":5,"../internals/get-built-in":24,"../internals/object-get-own-property-names":49,"../internals/object-get-own-property-symbols":50}],57:[function(require,module,exports){ var global = require('../internals/global'); module.exports = global; },{"../internals/global":27}],58:[function(require,module,exports){ var redefine = require('../internals/redefine'); module.exports = function (target, src, options) { for (var key in src) redefine(target, key, src[key], options); return target; }; },{"../internals/redefine":59}],59:[function(require,module,exports){ var global = require('../internals/global'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); var has = require('../internals/has'); var setGlobal = require('../internals/set-global'); var inspectSource = require('../internals/inspect-source'); var InternalStateModule = require('../internals/internal-state'); var getInternalState = InternalStateModule.get; var enforceInternalState = InternalStateModule.enforce; var TEMPLATE = String(String).split('String'); (module.exports = function (O, key, value, options) { var unsafe = options ? !!options.unsafe : false; var simple = options ? !!options.enumerable : false; var noTargetGet = options ? !!options.noTargetGet : false; if (typeof value == 'function') { if (typeof key == 'string' && !has(value, 'name')) createNonEnumerableProperty(value, 'name', key); enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); } if (O === global) { if (simple) O[key] = value; else setGlobal(key, value); return; } else if (!unsafe) { delete O[key]; } else if (!noTargetGet && O[key]) { simple = true; } if (simple) O[key] = value; else createNonEnumerableProperty(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, 'toString', function toString() { return typeof this == 'function' && getInternalState(this).source || inspectSource(this); }); },{"../internals/create-non-enumerable-property":14,"../internals/global":27,"../internals/has":28,"../internals/inspect-source":33,"../internals/internal-state":34,"../internals/set-global":61}],60:[function(require,module,exports){ // `RequireObjectCoercible` abstract operation // https://tc39.github.io/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; },{}],61:[function(require,module,exports){ var global = require('../internals/global'); var createNonEnumerableProperty = require('../internals/create-non-enumerable-property'); module.exports = function (key, value) { try { createNonEnumerableProperty(global, key, value); } catch (error) { global[key] = value; } return value; }; },{"../internals/create-non-enumerable-property":14,"../internals/global":27}],62:[function(require,module,exports){ var defineProperty = require('../internals/object-define-property').f; var has = require('../internals/has'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); module.exports = function (it, TAG, STATIC) { if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); } }; },{"../internals/has":28,"../internals/object-define-property":47,"../internals/well-known-symbol":77}],63:[function(require,module,exports){ var shared = require('../internals/shared'); var uid = require('../internals/uid'); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; },{"../internals/shared":65,"../internals/uid":75}],64:[function(require,module,exports){ var global = require('../internals/global'); var setGlobal = require('../internals/set-global'); var SHARED = '__core-js_shared__'; var store = global[SHARED] || setGlobal(SHARED, {}); module.exports = store; },{"../internals/global":27,"../internals/set-global":61}],65:[function(require,module,exports){ var IS_PURE = require('../internals/is-pure'); var store = require('../internals/shared-store'); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.6.4', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2020 Denis Pushkarev (zloirock.ru)' }); },{"../internals/is-pure":38,"../internals/shared-store":64}],66:[function(require,module,exports){ var toInteger = require('../internals/to-integer'); var requireObjectCoercible = require('../internals/require-object-coercible'); // `String.prototype.{ codePointAt, at }` methods implementation var createMethod = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = String(requireObjectCoercible($this)); var position = toInteger(pos); var size = S.length; var first, second; if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; first = S.charCodeAt(position); return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; }; }; module.exports = { // `String.prototype.codePointAt` method // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat codeAt: createMethod(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at charAt: createMethod(true) }; },{"../internals/require-object-coercible":60,"../internals/to-integer":70}],67:[function(require,module,exports){ 'use strict'; // based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 var base = 36; var tMin = 1; var tMax = 26; var skew = 38; var damp = 700; var initialBias = 72; var initialN = 128; // 0x80 var delimiter = '-'; // '\x2D' var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process'; var baseMinusTMin = base - tMin; var floor = Math.floor; var stringFromCharCode = String.fromCharCode; /** * Creates an array containing the numeric code points of each Unicode * character in the string. While JavaScript uses UCS-2 internally, * this function will convert a pair of surrogate halves (each of which * UCS-2 exposes as separate characters) into a single code point, * matching UTF-16. */ var ucs2decode = function (string) { var output = []; var counter = 0; var length = string.length; while (counter < length) { var value = string.charCodeAt(counter++); if (value >= 0xD800 && value <= 0xDBFF && counter < length) { // It's a high surrogate, and there is a next character. var extra = string.charCodeAt(counter++); if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); } else { // It's an unmatched surrogate; only append this code unit, in case the // next code unit is the high surrogate of a surrogate pair. output.push(value); counter--; } } else { output.push(value); } } return output; }; /** * Converts a digit/integer into a basic code point. */ var digitToBasic = function (digit) { // 0..25 map to ASCII a..z or A..Z // 26..35 map to ASCII 0..9 return digit + 22 + 75 * (digit < 26); }; /** * Bias adaptation function as per section 3.4 of RFC 3492. * https://tools.ietf.org/html/rfc3492#section-3.4 */ var adapt = function (delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (; delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); }; /** * Converts a string of Unicode symbols (e.g. a domain name label) to a * Punycode string of ASCII-only symbols. */ // eslint-disable-next-line max-statements var encode = function (input) { var output = []; // Convert the input in UCS-2 to an array of Unicode code points. input = ucs2decode(input); // Cache the length. var inputLength = input.length; // Initialize the state. var n = initialN; var delta = 0; var bias = initialBias; var i, currentValue; // Handle the basic code points. for (i = 0; i < input.length; i++) { currentValue = input[i]; if (currentValue < 0x80) { output.push(stringFromCharCode(currentValue)); } } var basicLength = output.length; // number of basic code points. var handledCPCount = basicLength; // number of code points that have been handled; // Finish the basic string with a delimiter unless it's empty. if (basicLength) { output.push(delimiter); } // Main encoding loop: while (handledCPCount < inputLength) { // All non-basic code points < n have been handled already. Find the next larger one: var m = maxInt; for (i = 0; i < input.length; i++) { currentValue = input[i]; if (currentValue >= n && currentValue < m) { m = currentValue; } } // Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow. var handledCPCountPlusOne = handledCPCount + 1; if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { throw RangeError(OVERFLOW_ERROR); } delta += (m - n) * handledCPCountPlusOne; n = m; for (i = 0; i < input.length; i++) { currentValue = input[i]; if (currentValue < n && ++delta > maxInt) { throw RangeError(OVERFLOW_ERROR); } if (currentValue == n) { // Represent delta as a generalized variable-length integer. var q = delta; for (var k = base; /* no condition */; k += base) { var t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); if (q < t) break; var qMinusT = q - t; var baseMinusT = base - t; output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT))); q = floor(qMinusT / baseMinusT); } output.push(stringFromCharCode(digitToBasic(q))); bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); delta = 0; ++handledCPCount; } } ++delta; ++n; } return output.join(''); }; module.exports = function (input) { var encoded = []; var labels = input.toLowerCase().replace(regexSeparators, '\u002E').split('.'); var i, label; for (i = 0; i < labels.length; i++) { label = labels[i]; encoded.push(regexNonASCII.test(label) ? 'xn--' + encode(label) : label); } return encoded.join('.'); }; },{}],68:[function(require,module,exports){ var toInteger = require('../internals/to-integer'); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length). module.exports = function (index, length) { var integer = toInteger(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; },{"../internals/to-integer":70}],69:[function(require,module,exports){ // toObject with fallback for non-array-like ES3 strings var IndexedObject = require('../internals/indexed-object'); var requireObjectCoercible = require('../internals/require-object-coercible'); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; },{"../internals/indexed-object":32,"../internals/require-object-coercible":60}],70:[function(require,module,exports){ var ceil = Math.ceil; var floor = Math.floor; // `ToInteger` abstract operation // https://tc39.github.io/ecma262/#sec-tointeger module.exports = function (argument) { return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); }; },{}],71:[function(require,module,exports){ var toInteger = require('../internals/to-integer'); var min = Math.min; // `ToLength` abstract operation // https://tc39.github.io/ecma262/#sec-tolength module.exports = function (argument) { return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; },{"../internals/to-integer":70}],72:[function(require,module,exports){ var requireObjectCoercible = require('../internals/require-object-coercible'); // `ToObject` abstract operation // https://tc39.github.io/ecma262/#sec-toobject module.exports = function (argument) { return Object(requireObjectCoercible(argument)); }; },{"../internals/require-object-coercible":60}],73:[function(require,module,exports){ var isObject = require('../internals/is-object'); // `ToPrimitive` abstract operation // https://tc39.github.io/ecma262/#sec-toprimitive // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (input, PREFERRED_STRING) { if (!isObject(input)) return input; var fn, val; if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; throw TypeError("Can't convert object to primitive value"); }; },{"../internals/is-object":37}],74:[function(require,module,exports){ var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; module.exports = String(test) === '[object z]'; },{"../internals/well-known-symbol":77}],75:[function(require,module,exports){ var id = 0; var postfix = Math.random(); module.exports = function (key) { return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); }; },{}],76:[function(require,module,exports){ var NATIVE_SYMBOL = require('../internals/native-symbol'); module.exports = NATIVE_SYMBOL // eslint-disable-next-line no-undef && !Symbol.sham // eslint-disable-next-line no-undef && typeof Symbol.iterator == 'symbol'; },{"../internals/native-symbol":41}],77:[function(require,module,exports){ var global = require('../internals/global'); var shared = require('../internals/shared'); var has = require('../internals/has'); var uid = require('../internals/uid'); var NATIVE_SYMBOL = require('../internals/native-symbol'); var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid'); var WellKnownSymbolsStore = shared('wks'); var Symbol = global.Symbol; var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid; module.exports = function (name) { if (!has(WellKnownSymbolsStore, name)) { if (NATIVE_SYMBOL && has(Symbol, name)) WellKnownSymbolsStore[name] = Symbol[name]; else WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; },{"../internals/global":27,"../internals/has":28,"../internals/native-symbol":41,"../internals/shared":65,"../internals/uid":75,"../internals/use-symbol-as-uid":76}],78:[function(require,module,exports){ 'use strict'; var toIndexedObject = require('../internals/to-indexed-object'); var addToUnscopables = require('../internals/add-to-unscopables'); var Iterators = require('../internals/iterators'); var InternalStateModule = require('../internals/internal-state'); var defineIterator = require('../internals/define-iterator'); var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method // https://tc39.github.io/ecma262/#sec-array.prototype.entries // `Array.prototype.keys` method // https://tc39.github.io/ecma262/#sec-array.prototype.keys // `Array.prototype.values` method // https://tc39.github.io/ecma262/#sec-array.prototype.values // `Array.prototype[@@iterator]` method // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.github.io/ecma262/#sec-createarrayiterator module.exports = defineIterator(Array, 'Array', function (iterated, kind) { setInternalState(this, { type: ARRAY_ITERATOR, target: toIndexedObject(iterated), // target index: 0, // next index kind: kind // kind }); // `%ArrayIteratorPrototype%.next` method // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next }, function () { var state = getInternalState(this); var target = state.target; var kind = state.kind; var index = state.index++; if (!target || index >= target.length) { state.target = undefined; return { value: undefined, done: true }; } if (kind == 'keys') return { value: index, done: false }; if (kind == 'values') return { value: target[index], done: false }; return { value: [index, target[index]], done: false }; }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject Iterators.Arguments = Iterators.Array; // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); },{"../internals/add-to-unscopables":3,"../internals/define-iterator":17,"../internals/internal-state":34,"../internals/iterators":40,"../internals/to-indexed-object":69}],79:[function(require,module,exports){ 'use strict'; var charAt = require('../internals/string-multibyte').charAt; var InternalStateModule = require('../internals/internal-state'); var defineIterator = require('../internals/define-iterator'); var STRING_ITERATOR = 'String Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method // https://tc39.github.io/ecma262/#sec-string.prototype-@@iterator defineIterator(String, 'String', function (iterated) { setInternalState(this, { type: STRING_ITERATOR, string: String(iterated), index: 0 }); // `%StringIteratorPrototype%.next` method // https://tc39.github.io/ecma262/#sec-%stringiteratorprototype%.next }, function next() { var state = getInternalState(this); var string = state.string; var index = state.index; var point; if (index >= string.length) return { value: undefined, done: true }; point = charAt(string, index); state.index += point.length; return { value: point, done: false }; }); },{"../internals/define-iterator":17,"../internals/internal-state":34,"../internals/string-multibyte":66}],80:[function(require,module,exports){ 'use strict'; // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` require('../modules/es.array.iterator'); var $ = require('../internals/export'); var getBuiltIn = require('../internals/get-built-in'); var USE_NATIVE_URL = require('../internals/native-url'); var redefine = require('../internals/redefine'); var redefineAll = require('../internals/redefine-all'); var setToStringTag = require('../internals/set-to-string-tag'); var createIteratorConstructor = require('../internals/create-iterator-constructor'); var InternalStateModule = require('../internals/internal-state'); var anInstance = require('../internals/an-instance'); var hasOwn = require('../internals/has'); var bind = require('../internals/function-bind-context'); var classof = require('../internals/classof'); var anObject = require('../internals/an-object'); var isObject = require('../internals/is-object'); var create = require('../internals/object-create'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var getIterator = require('../internals/get-iterator'); var getIteratorMethod = require('../internals/get-iterator-method'); var wellKnownSymbol = require('../internals/well-known-symbol'); var $fetch = getBuiltIn('fetch'); var Headers = getBuiltIn('Headers'); var ITERATOR = wellKnownSymbol('iterator'); var URL_SEARCH_PARAMS = 'URLSearchParams'; var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator'; var setInternalState = InternalStateModule.set; var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS); var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR); var plus = /\+/g; var sequences = Array(4); var percentSequence = function (bytes) { return sequences[bytes - 1] || (sequences[bytes - 1] = RegExp('((?:%[\\da-f]{2}){' + bytes + '})', 'gi')); }; var percentDecode = function (sequence) { try { return decodeURIComponent(sequence); } catch (error) { return sequence; } }; var deserialize = function (it) { var result = it.replace(plus, ' '); var bytes = 4; try { return decodeURIComponent(result); } catch (error) { while (bytes) { result = result.replace(percentSequence(bytes--), percentDecode); } return result; } }; var find = /[!'()~]|%20/g; var replace = { '!': '%21', "'": '%27', '(': '%28', ')': '%29', '~': '%7E', '%20': '+' }; var replacer = function (match) { return replace[match]; }; var serialize = function (it) { return encodeURIComponent(it).replace(find, replacer); }; var parseSearchParams = function (result, query) { if (query) { var attributes = query.split('&'); var index = 0; var attribute, entry; while (index < attributes.length) { attribute = attributes[index++]; if (attribute.length) { entry = attribute.split('='); result.push({ key: deserialize(entry.shift()), value: deserialize(entry.join('=')) }); } } } }; var updateSearchParams = function (query) { this.entries.length = 0; parseSearchParams(this.entries, query); }; var validateArgumentsLength = function (passed, required) { if (passed < required) throw TypeError('Not enough arguments'); }; var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) { setInternalState(this, { type: URL_SEARCH_PARAMS_ITERATOR, iterator: getIterator(getInternalParamsState(params).entries), kind: kind }); }, 'Iterator', function next() { var state = getInternalIteratorState(this); var kind = state.kind; var step = state.iterator.next(); var entry = step.value; if (!step.done) { step.value = kind === 'keys' ? entry.key : kind === 'values' ? entry.value : [entry.key, entry.value]; } return step; }); // `URLSearchParams` constructor // https://url.spec.whatwg.org/#interface-urlsearchparams var URLSearchParamsConstructor = function URLSearchParams(/* init */) { anInstance(this, URLSearchParamsConstructor, URL_SEARCH_PARAMS); var init = arguments.length > 0 ? arguments[0] : undefined; var that = this; var entries = []; var iteratorMethod, iterator, next, step, entryIterator, entryNext, first, second, key; setInternalState(that, { type: URL_SEARCH_PARAMS, entries: entries, updateURL: function () { /* empty */ }, updateSearchParams: updateSearchParams }); if (init !== undefined) { if (isObject(init)) { iteratorMethod = getIteratorMethod(init); if (typeof iteratorMethod === 'function') { iterator = iteratorMethod.call(init); next = iterator.next; while (!(step = next.call(iterator)).done) { entryIterator = getIterator(anObject(step.value)); entryNext = entryIterator.next; if ( (first = entryNext.call(entryIterator)).done || (second = entryNext.call(entryIterator)).done || !entryNext.call(entryIterator).done ) throw TypeError('Expected sequence with length 2'); entries.push({ key: first.value + '', value: second.value + '' }); } } else for (key in init) if (hasOwn(init, key)) entries.push({ key: key, value: init[key] + '' }); } else { parseSearchParams(entries, typeof init === 'string' ? init.charAt(0) === '?' ? init.slice(1) : init : init + ''); } } }; var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype; redefineAll(URLSearchParamsPrototype, { // `URLSearchParams.prototype.appent` method // https://url.spec.whatwg.org/#dom-urlsearchparams-append append: function append(name, value) { validateArgumentsLength(arguments.length, 2); var state = getInternalParamsState(this); state.entries.push({ key: name + '', value: value + '' }); state.updateURL(); }, // `URLSearchParams.prototype.delete` method // https://url.spec.whatwg.org/#dom-urlsearchparams-delete 'delete': function (name) { validateArgumentsLength(arguments.length, 1); var state = getInternalParamsState(this); var entries = state.entries; var key = name + ''; var index = 0; while (index < entries.length) { if (entries[index].key === key) entries.splice(index, 1); else index++; } state.updateURL(); }, // `URLSearchParams.prototype.get` method // https://url.spec.whatwg.org/#dom-urlsearchparams-get get: function get(name) { validateArgumentsLength(arguments.length, 1); var entries = getInternalParamsState(this).entries; var key = name + ''; var index = 0; for (; index < entries.length; index++) { if (entries[index].key === key) return entries[index].value; } return null; }, // `URLSearchParams.prototype.getAll` method // https://url.spec.whatwg.org/#dom-urlsearchparams-getall getAll: function getAll(name) { validateArgumentsLength(arguments.length, 1); var entries = getInternalParamsState(this).entries; var key = name + ''; var result = []; var index = 0; for (; index < entries.length; index++) { if (entries[index].key === key) result.push(entries[index].value); } return result; }, // `URLSearchParams.prototype.has` method // https://url.spec.whatwg.org/#dom-urlsearchparams-has has: function has(name) { validateArgumentsLength(arguments.length, 1); var entries = getInternalParamsState(this).entries; var key = name + ''; var index = 0; while (index < entries.length) { if (entries[index++].key === key) return true; } return false; }, // `URLSearchParams.prototype.set` method // https://url.spec.whatwg.org/#dom-urlsearchparams-set set: function set(name, value) { validateArgumentsLength(arguments.length, 1); var state = getInternalParamsState(this); var entries = state.entries; var found = false; var key = name + ''; var val = value + ''; var index = 0; var entry; for (; index < entries.length; index++) { entry = entries[index]; if (entry.key === key) { if (found) entries.splice(index--, 1); else { found = true; entry.value = val; } } } if (!found) entries.push({ key: key, value: val }); state.updateURL(); }, // `URLSearchParams.prototype.sort` method // https://url.spec.whatwg.org/#dom-urlsearchparams-sort sort: function sort() { var state = getInternalParamsState(this); var entries = state.entries; // Array#sort is not stable in some engines var slice = entries.slice(); var entry, entriesIndex, sliceIndex; entries.length = 0; for (sliceIndex = 0; sliceIndex < slice.length; sliceIndex++) { entry = slice[sliceIndex]; for (entriesIndex = 0; entriesIndex < sliceIndex; entriesIndex++) { if (entries[entriesIndex].key > entry.key) { entries.splice(entriesIndex, 0, entry); break; } } if (entriesIndex === sliceIndex) entries.push(entry); } state.updateURL(); }, // `URLSearchParams.prototype.forEach` method forEach: function forEach(callback /* , thisArg */) { var entries = getInternalParamsState(this).entries; var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3); var index = 0; var entry; while (index < entries.length) { entry = entries[index++]; boundFunction(entry.value, entry.key, this); } }, // `URLSearchParams.prototype.keys` method keys: function keys() { return new URLSearchParamsIterator(this, 'keys'); }, // `URLSearchParams.prototype.values` method values: function values() { return new URLSearchParamsIterator(this, 'values'); }, // `URLSearchParams.prototype.entries` method entries: function entries() { return new URLSearchParamsIterator(this, 'entries'); } }, { enumerable: true }); // `URLSearchParams.prototype[@@iterator]` method redefine(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries); // `URLSearchParams.prototype.toString` method // https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior redefine(URLSearchParamsPrototype, 'toString', function toString() { var entries = getInternalParamsState(this).entries; var result = []; var index = 0; var entry; while (index < entries.length) { entry = entries[index++]; result.push(serialize(entry.key) + '=' + serialize(entry.value)); } return result.join('&'); }, { enumerable: true }); setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS); $({ global: true, forced: !USE_NATIVE_URL }, { URLSearchParams: URLSearchParamsConstructor }); // Wrap `fetch` for correct work with polyfilled `URLSearchParams` // https://github.com/zloirock/core-js/issues/674 if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'function') { $({ global: true, enumerable: true, forced: true }, { fetch: function fetch(input /* , init */) { var args = [input]; var init, body, headers; if (arguments.length > 1) { init = arguments[1]; if (isObject(init)) { body = init.body; if (classof(body) === URL_SEARCH_PARAMS) { headers = init.headers ? new Headers(init.headers) : new Headers(); if (!headers.has('content-type')) { headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); } init = create(init, { body: createPropertyDescriptor(0, String(body)), headers: createPropertyDescriptor(0, headers) }); } } args.push(init); } return $fetch.apply(this, args); } }); } module.exports = { URLSearchParams: URLSearchParamsConstructor, getState: getInternalParamsState }; },{"../internals/an-instance":4,"../internals/an-object":5,"../internals/classof":10,"../internals/create-iterator-constructor":13,"../internals/create-property-descriptor":15,"../internals/export":21,"../internals/function-bind-context":23,"../internals/get-built-in":24,"../internals/get-iterator":26,"../internals/get-iterator-method":25,"../internals/has":28,"../internals/internal-state":34,"../internals/is-object":37,"../internals/native-url":42,"../internals/object-create":45,"../internals/redefine":59,"../internals/redefine-all":58,"../internals/set-to-string-tag":62,"../internals/well-known-symbol":77,"../modules/es.array.iterator":78}],81:[function(require,module,exports){ 'use strict'; // TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env` require('../modules/es.string.iterator'); var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); var USE_NATIVE_URL = require('../internals/native-url'); var global = require('../internals/global'); var defineProperties = require('../internals/object-define-properties'); var redefine = require('../internals/redefine'); var anInstance = require('../internals/an-instance'); var has = require('../internals/has'); var assign = require('../internals/object-assign'); var arrayFrom = require('../internals/array-from'); var codeAt = require('../internals/string-multibyte').codeAt; var toASCII = require('../internals/string-punycode-to-ascii'); var setToStringTag = require('../internals/set-to-string-tag'); var URLSearchParamsModule = require('../modules/web.url-search-params'); var InternalStateModule = require('../internals/internal-state'); var NativeURL = global.URL; var URLSearchParams = URLSearchParamsModule.URLSearchParams; var getInternalSearchParamsState = URLSearchParamsModule.getState; var setInternalState = InternalStateModule.set; var getInternalURLState = InternalStateModule.getterFor('URL'); var floor = Math.floor; var pow = Math.pow; var INVALID_AUTHORITY = 'Invalid authority'; var INVALID_SCHEME = 'Invalid scheme'; var INVALID_HOST = 'Invalid host'; var INVALID_PORT = 'Invalid port'; var ALPHA = /[A-Za-z]/; var ALPHANUMERIC = /[\d+\-.A-Za-z]/; var DIGIT = /\d/; var HEX_START = /^(0x|0X)/; var OCT = /^[0-7]+$/; var DEC = /^\d+$/; var HEX = /^[\dA-Fa-f]+$/; // eslint-disable-next-line no-control-regex var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/; // eslint-disable-next-line no-control-regex var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/; // eslint-disable-next-line no-control-regex var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g; // eslint-disable-next-line no-control-regex var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g; var EOF; var parseHost = function (url, input) { var result, codePoints, index; if (input.charAt(0) == '[') { if (input.charAt(input.length - 1) != ']') return INVALID_HOST; result = parseIPv6(input.slice(1, -1)); if (!result) return INVALID_HOST; url.host = result; // opaque host } else if (!isSpecial(url)) { if (FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT.test(input)) return INVALID_HOST; result = ''; codePoints = arrayFrom(input); for (index = 0; index < codePoints.length; index++) { result += percentEncode(codePoints[index], C0ControlPercentEncodeSet); } url.host = result; } else { input = toASCII(input); if (FORBIDDEN_HOST_CODE_POINT.test(input)) return INVALID_HOST; result = parseIPv4(input); if (result === null) return INVALID_HOST; url.host = result; } }; var parseIPv4 = function (input) { var parts = input.split('.'); var partsLength, numbers, index, part, radix, number, ipv4; if (parts.length && parts[parts.length - 1] == '') { parts.pop(); } partsLength = parts.length; if (partsLength > 4) return input; numbers = []; for (index = 0; index < partsLength; index++) { part = parts[index]; if (part == '') return input; radix = 10; if (part.length > 1 && part.charAt(0) == '0') { radix = HEX_START.test(part) ? 16 : 8; part = part.slice(radix == 8 ? 1 : 2); } if (part === '') { number = 0; } else { if (!(radix == 10 ? DEC : radix == 8 ? OCT : HEX).test(part)) return input; number = parseInt(part, radix); } numbers.push(number); } for (index = 0; index < partsLength; index++) { number = numbers[index]; if (index == partsLength - 1) { if (number >= pow(256, 5 - partsLength)) return null; } else if (number > 255) return null; } ipv4 = numbers.pop(); for (index = 0; index < numbers.length; index++) { ipv4 += numbers[index] * pow(256, 3 - index); } return ipv4; }; // eslint-disable-next-line max-statements var parseIPv6 = function (input) { var address = [0, 0, 0, 0, 0, 0, 0, 0]; var pieceIndex = 0; var compress = null; var pointer = 0; var value, length, numbersSeen, ipv4Piece, number, swaps, swap; var char = function () { return input.charAt(pointer); }; if (char() == ':') { if (input.charAt(1) != ':') return; pointer += 2; pieceIndex++; compress = pieceIndex; } while (char()) { if (pieceIndex == 8) return; if (char() == ':') { if (compress !== null) return; pointer++; pieceIndex++; compress = pieceIndex; continue; } value = length = 0; while (length < 4 && HEX.test(char())) { value = value * 16 + parseInt(char(), 16); pointer++; length++; } if (char() == '.') { if (length == 0) return; pointer -= length; if (pieceIndex > 6) return; numbersSeen = 0; while (char()) { ipv4Piece = null; if (numbersSeen > 0) { if (char() == '.' && numbersSeen < 4) pointer++; else return; } if (!DIGIT.test(char())) return; while (DIGIT.test(char())) { number = parseInt(char(), 10); if (ipv4Piece === null) ipv4Piece = number; else if (ipv4Piece == 0) return; else ipv4Piece = ipv4Piece * 10 + number; if (ipv4Piece > 255) return; pointer++; } address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece; numbersSeen++; if (numbersSeen == 2 || numbersSeen == 4) pieceIndex++; } if (numbersSeen != 4) return; break; } else if (char() == ':') { pointer++; if (!char()) return; } else if (char()) return; address[pieceIndex++] = value; } if (compress !== null) { swaps = pieceIndex - compress; pieceIndex = 7; while (pieceIndex != 0 && swaps > 0) { swap = address[pieceIndex]; address[pieceIndex--] = address[compress + swaps - 1]; address[compress + --swaps] = swap; } } else if (pieceIndex != 8) return; return address; }; var findLongestZeroSequence = function (ipv6) { var maxIndex = null; var maxLength = 1; var currStart = null; var currLength = 0; var index = 0; for (; index < 8; index++) { if (ipv6[index] !== 0) { if (currLength > maxLength) { maxIndex = currStart; maxLength = currLength; } currStart = null; currLength = 0; } else { if (currStart === null) currStart = index; ++currLength; } } if (currLength > maxLength) { maxIndex = currStart; maxLength = currLength; } return maxIndex; }; var serializeHost = function (host) { var result, index, compress, ignore0; // ipv4 if (typeof host == 'number') { result = []; for (index = 0; index < 4; index++) { result.unshift(host % 256); host = floor(host / 256); } return result.join('.'); // ipv6 } else if (typeof host == 'object') { result = ''; compress = findLongestZeroSequence(host); for (index = 0; index < 8; index++) { if (ignore0 && host[index] === 0) continue; if (ignore0) ignore0 = false; if (compress === index) { result += index ? ':' : '::'; ignore0 = true; } else { result += host[index].toString(16); if (index < 7) result += ':'; } } return '[' + result + ']'; } return host; }; var C0ControlPercentEncodeSet = {}; var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, { ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1 }); var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, { '#': 1, '?': 1, '{': 1, '}': 1 }); var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, { '/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1 }); var percentEncode = function (char, set) { var code = codeAt(char, 0); return code > 0x20 && code < 0x7F && !has(set, char) ? char : encodeURIComponent(char); }; var specialSchemes = { ftp: 21, file: null, http: 80, https: 443, ws: 80, wss: 443 }; var isSpecial = function (url) { return has(specialSchemes, url.scheme); }; var includesCredentials = function (url) { return url.username != '' || url.password != ''; }; var cannotHaveUsernamePasswordPort = function (url) { return !url.host || url.cannotBeABaseURL || url.scheme == 'file'; }; var isWindowsDriveLetter = function (string, normalized) { var second; return string.length == 2 && ALPHA.test(string.charAt(0)) && ((second = string.charAt(1)) == ':' || (!normalized && second == '|')); }; var startsWithWindowsDriveLetter = function (string) { var third; return string.length > 1 && isWindowsDriveLetter(string.slice(0, 2)) && ( string.length == 2 || ((third = string.charAt(2)) === '/' || third === '\\' || third === '?' || third === '#') ); }; var shortenURLsPath = function (url) { var path = url.path; var pathSize = path.length; if (pathSize && (url.scheme != 'file' || pathSize != 1 || !isWindowsDriveLetter(path[0], true))) { path.pop(); } }; var isSingleDot = function (segment) { return segment === '.' || segment.toLowerCase() === '%2e'; }; var isDoubleDot = function (segment) { segment = segment.toLowerCase(); return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e'; }; // States: var SCHEME_START = {}; var SCHEME = {}; var NO_SCHEME = {}; var SPECIAL_RELATIVE_OR_AUTHORITY = {}; var PATH_OR_AUTHORITY = {}; var RELATIVE = {}; var RELATIVE_SLASH = {}; var SPECIAL_AUTHORITY_SLASHES = {}; var SPECIAL_AUTHORITY_IGNORE_SLASHES = {}; var AUTHORITY = {}; var HOST = {}; var HOSTNAME = {}; var PORT = {}; var FILE = {}; var FILE_SLASH = {}; var FILE_HOST = {}; var PATH_START = {}; var PATH = {}; var CANNOT_BE_A_BASE_URL_PATH = {}; var QUERY = {}; var FRAGMENT = {}; // eslint-disable-next-line max-statements var parseURL = function (url, input, stateOverride, base) { var state = stateOverride || SCHEME_START; var pointer = 0; var buffer = ''; var seenAt = false; var seenBracket = false; var seenPasswordToken = false; var codePoints, char, bufferCodePoints, failure; if (!stateOverride) { url.scheme = ''; url.username = ''; url.password = ''; url.host = null; url.port = null; url.path = []; url.query = null; url.fragment = null; url.cannotBeABaseURL = false; input = input.replace(LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE, ''); } input = input.replace(TAB_AND_NEW_LINE, ''); codePoints = arrayFrom(input); while (pointer <= codePoints.length) { char = codePoints[pointer]; switch (state) { case SCHEME_START: if (char && ALPHA.test(char)) { buffer += char.toLowerCase(); state = SCHEME; } else if (!stateOverride) { state = NO_SCHEME; continue; } else return INVALID_SCHEME; break; case SCHEME: if (char && (ALPHANUMERIC.test(char) || char == '+' || char == '-' || char == '.')) { buffer += char.toLowerCase(); } else if (char == ':') { if (stateOverride && ( (isSpecial(url) != has(specialSchemes, buffer)) || (buffer == 'file' && (includesCredentials(url) || url.port !== null)) || (url.scheme == 'file' && !url.host) )) return; url.scheme = buffer; if (stateOverride) { if (isSpecial(url) && specialSchemes[url.scheme] == url.port) url.port = null; return; } buffer = ''; if (url.scheme == 'file') { state = FILE; } else if (isSpecial(url) && base && base.scheme == url.scheme) { state = SPECIAL_RELATIVE_OR_AUTHORITY; } else if (isSpecial(url)) { state = SPECIAL_AUTHORITY_SLASHES; } else if (codePoints[pointer + 1] == '/') { state = PATH_OR_AUTHORITY; pointer++; } else { url.cannotBeABaseURL = true; url.path.push(''); state = CANNOT_BE_A_BASE_URL_PATH; } } else if (!stateOverride) { buffer = ''; state = NO_SCHEME; pointer = 0; continue; } else return INVALID_SCHEME; break; case NO_SCHEME: if (!base || (base.cannotBeABaseURL && char != '#')) return INVALID_SCHEME; if (base.cannotBeABaseURL && char == '#') { url.scheme = base.scheme; url.path = base.path.slice(); url.query = base.query; url.fragment = ''; url.cannotBeABaseURL = true; state = FRAGMENT; break; } state = base.scheme == 'file' ? FILE : RELATIVE; continue; case SPECIAL_RELATIVE_OR_AUTHORITY: if (char == '/' && codePoints[pointer + 1] == '/') { state = SPECIAL_AUTHORITY_IGNORE_SLASHES; pointer++; } else { state = RELATIVE; continue; } break; case PATH_OR_AUTHORITY: if (char == '/') { state = AUTHORITY; break; } else { state = PATH; continue; } case RELATIVE: url.scheme = base.scheme; if (char == EOF) { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.query = base.query; } else if (char == '/' || (char == '\\' && isSpecial(url))) { state = RELATIVE_SLASH; } else if (char == '?') { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.query = ''; state = QUERY; } else if (char == '#') { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.query = base.query; url.fragment = ''; state = FRAGMENT; } else { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; url.path = base.path.slice(); url.path.pop(); state = PATH; continue; } break; case RELATIVE_SLASH: if (isSpecial(url) && (char == '/' || char == '\\')) { state = SPECIAL_AUTHORITY_IGNORE_SLASHES; } else if (char == '/') { state = AUTHORITY; } else { url.username = base.username; url.password = base.password; url.host = base.host; url.port = base.port; state = PATH; continue; } break; case SPECIAL_AUTHORITY_SLASHES: state = SPECIAL_AUTHORITY_IGNORE_SLASHES; if (char != '/' || buffer.charAt(pointer + 1) != '/') continue; pointer++; break; case SPECIAL_AUTHORITY_IGNORE_SLASHES: if (char != '/' && char != '\\') { state = AUTHORITY; continue; } break; case AUTHORITY: if (char == '@') { if (seenAt) buffer = '%40' + buffer; seenAt = true; bufferCodePoints = arrayFrom(buffer); for (var i = 0; i < bufferCodePoints.length; i++) { var codePoint = bufferCodePoints[i]; if (codePoint == ':' && !seenPasswordToken) { seenPasswordToken = true; continue; } var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet); if (seenPasswordToken) url.password += encodedCodePoints; else url.username += encodedCodePoints; } buffer = ''; } else if ( char == EOF || char == '/' || char == '?' || char == '#' || (char == '\\' && isSpecial(url)) ) { if (seenAt && buffer == '') return INVALID_AUTHORITY; pointer -= arrayFrom(buffer).length + 1; buffer = ''; state = HOST; } else buffer += char; break; case HOST: case HOSTNAME: if (stateOverride && url.scheme == 'file') { state = FILE_HOST; continue; } else if (char == ':' && !seenBracket) { if (buffer == '') return INVALID_HOST; failure = parseHost(url, buffer); if (failure) return failure; buffer = ''; state = PORT; if (stateOverride == HOSTNAME) return; } else if ( char == EOF || char == '/' || char == '?' || char == '#' || (char == '\\' && isSpecial(url)) ) { if (isSpecial(url) && buffer == '') return INVALID_HOST; if (stateOverride && buffer == '' && (includesCredentials(url) || url.port !== null)) return; failure = parseHost(url, buffer); if (failure) return failure; buffer = ''; state = PATH_START; if (stateOverride) return; continue; } else { if (char == '[') seenBracket = true; else if (char == ']') seenBracket = false; buffer += char; } break; case PORT: if (DIGIT.test(char)) { buffer += char; } else if ( char == EOF || char == '/' || char == '?' || char == '#' || (char == '\\' && isSpecial(url)) || stateOverride ) { if (buffer != '') { var port = parseInt(buffer, 10); if (port > 0xFFFF) return INVALID_PORT; url.port = (isSpecial(url) && port === specialSchemes[url.scheme]) ? null : port; buffer = ''; } if (stateOverride) return; state = PATH_START; continue; } else return INVALID_PORT; break; case FILE: url.scheme = 'file'; if (char == '/' || char == '\\') state = FILE_SLASH; else if (base && base.scheme == 'file') { if (char == EOF) { url.host = base.host; url.path = base.path.slice(); url.query = base.query; } else if (char == '?') { url.host = base.host; url.path = base.path.slice(); url.query = ''; state = QUERY; } else if (char == '#') { url.host = base.host; url.path = base.path.slice(); url.query = base.query; url.fragment = ''; state = FRAGMENT; } else { if (!startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { url.host = base.host; url.path = base.path.slice(); shortenURLsPath(url); } state = PATH; continue; } } else { state = PATH; continue; } break; case FILE_SLASH: if (char == '/' || char == '\\') { state = FILE_HOST; break; } if (base && base.scheme == 'file' && !startsWithWindowsDriveLetter(codePoints.slice(pointer).join(''))) { if (isWindowsDriveLetter(base.path[0], true)) url.path.push(base.path[0]); else url.host = base.host; } state = PATH; continue; case FILE_HOST: if (char == EOF || char == '/' || char == '\\' || char == '?' || char == '#') { if (!stateOverride && isWindowsDriveLetter(buffer)) { state = PATH; } else if (buffer == '') { url.host = ''; if (stateOverride) return; state = PATH_START; } else { failure = parseHost(url, buffer); if (failure) return failure; if (url.host == 'localhost') url.host = ''; if (stateOverride) return; buffer = ''; state = PATH_START; } continue; } else buffer += char; break; case PATH_START: if (isSpecial(url)) { state = PATH; if (char != '/' && char != '\\') continue; } else if (!stateOverride && char == '?') { url.query = ''; state = QUERY; } else if (!stateOverride && char == '#') { url.fragment = ''; state = FRAGMENT; } else if (char != EOF) { state = PATH; if (char != '/') continue; } break; case PATH: if ( char == EOF || char == '/' || (char == '\\' && isSpecial(url)) || (!stateOverride && (char == '?' || char == '#')) ) { if (isDoubleDot(buffer)) { shortenURLsPath(url); if (char != '/' && !(char == '\\' && isSpecial(url))) { url.path.push(''); } } else if (isSingleDot(buffer)) { if (char != '/' && !(char == '\\' && isSpecial(url))) { url.path.push(''); } } else { if (url.scheme == 'file' && !url.path.length && isWindowsDriveLetter(buffer)) { if (url.host) url.host = ''; buffer = buffer.charAt(0) + ':'; // normalize windows drive letter } url.path.push(buffer); } buffer = ''; if (url.scheme == 'file' && (char == EOF || char == '?' || char == '#')) { while (url.path.length > 1 && url.path[0] === '') { url.path.shift(); } } if (char == '?') { url.query = ''; state = QUERY; } else if (char == '#') { url.fragment = ''; state = FRAGMENT; } } else { buffer += percentEncode(char, pathPercentEncodeSet); } break; case CANNOT_BE_A_BASE_URL_PATH: if (char == '?') { url.query = ''; state = QUERY; } else if (char == '#') { url.fragment = ''; state = FRAGMENT; } else if (char != EOF) { url.path[0] += percentEncode(char, C0ControlPercentEncodeSet); } break; case QUERY: if (!stateOverride && char == '#') { url.fragment = ''; state = FRAGMENT; } else if (char != EOF) { if (char == "'" && isSpecial(url)) url.query += '%27'; else if (char == '#') url.query += '%23'; else url.query += percentEncode(char, C0ControlPercentEncodeSet); } break; case FRAGMENT: if (char != EOF) url.fragment += percentEncode(char, fragmentPercentEncodeSet); break; } pointer++; } }; // `URL` constructor // https://url.spec.whatwg.org/#url-class var URLConstructor = function URL(url /* , base */) { var that = anInstance(this, URLConstructor, 'URL'); var base = arguments.length > 1 ? arguments[1] : undefined; var urlString = String(url); var state = setInternalState(that, { type: 'URL' }); var baseState, failure; if (base !== undefined) { if (base instanceof URLConstructor) baseState = getInternalURLState(base); else { failure = parseURL(baseState = {}, String(base)); if (failure) throw TypeError(failure); } } failure = parseURL(state, urlString, null, baseState); if (failure) throw TypeError(failure); var searchParams = state.searchParams = new URLSearchParams(); var searchParamsState = getInternalSearchParamsState(searchParams); searchParamsState.updateSearchParams(state.query); searchParamsState.updateURL = function () { state.query = String(searchParams) || null; }; if (!DESCRIPTORS) { that.href = serializeURL.call(that); that.origin = getOrigin.call(that); that.protocol = getProtocol.call(that); that.username = getUsername.call(that); that.password = getPassword.call(that); that.host = getHost.call(that); that.hostname = getHostname.call(that); that.port = getPort.call(that); that.pathname = getPathname.call(that); that.search = getSearch.call(that); that.searchParams = getSearchParams.call(that); that.hash = getHash.call(that); } }; var URLPrototype = URLConstructor.prototype; var serializeURL = function () { var url = getInternalURLState(this); var scheme = url.scheme; var username = url.username; var password = url.password; var host = url.host; var port = url.port; var path = url.path; var query = url.query; var fragment = url.fragment; var output = scheme + ':'; if (host !== null) { output += '//'; if (includesCredentials(url)) { output += username + (password ? ':' + password : '') + '@'; } output += serializeHost(host); if (port !== null) output += ':' + port; } else if (scheme == 'file') output += '//'; output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; if (query !== null) output += '?' + query; if (fragment !== null) output += '#' + fragment; return output; }; var getOrigin = function () { var url = getInternalURLState(this); var scheme = url.scheme; var port = url.port; if (scheme == 'blob') try { return new URL(scheme.path[0]).origin; } catch (error) { return 'null'; } if (scheme == 'file' || !isSpecial(url)) return 'null'; return scheme + '://' + serializeHost(url.host) + (port !== null ? ':' + port : ''); }; var getProtocol = function () { return getInternalURLState(this).scheme + ':'; }; var getUsername = function () { return getInternalURLState(this).username; }; var getPassword = function () { return getInternalURLState(this).password; }; var getHost = function () { var url = getInternalURLState(this); var host = url.host; var port = url.port; return host === null ? '' : port === null ? serializeHost(host) : serializeHost(host) + ':' + port; }; var getHostname = function () { var host = getInternalURLState(this).host; return host === null ? '' : serializeHost(host); }; var getPort = function () { var port = getInternalURLState(this).port; return port === null ? '' : String(port); }; var getPathname = function () { var url = getInternalURLState(this); var path = url.path; return url.cannotBeABaseURL ? path[0] : path.length ? '/' + path.join('/') : ''; }; var getSearch = function () { var query = getInternalURLState(this).query; return query ? '?' + query : ''; }; var getSearchParams = function () { return getInternalURLState(this).searchParams; }; var getHash = function () { var fragment = getInternalURLState(this).fragment; return fragment ? '#' + fragment : ''; }; var accessorDescriptor = function (getter, setter) { return { get: getter, set: setter, configurable: true, enumerable: true }; }; if (DESCRIPTORS) { defineProperties(URLPrototype, { // `URL.prototype.href` accessors pair // https://url.spec.whatwg.org/#dom-url-href href: accessorDescriptor(serializeURL, function (href) { var url = getInternalURLState(this); var urlString = String(href); var failure = parseURL(url, urlString); if (failure) throw TypeError(failure); getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); }), // `URL.prototype.origin` getter // https://url.spec.whatwg.org/#dom-url-origin origin: accessorDescriptor(getOrigin), // `URL.prototype.protocol` accessors pair // https://url.spec.whatwg.org/#dom-url-protocol protocol: accessorDescriptor(getProtocol, function (protocol) { var url = getInternalURLState(this); parseURL(url, String(protocol) + ':', SCHEME_START); }), // `URL.prototype.username` accessors pair // https://url.spec.whatwg.org/#dom-url-username username: accessorDescriptor(getUsername, function (username) { var url = getInternalURLState(this); var codePoints = arrayFrom(String(username)); if (cannotHaveUsernamePasswordPort(url)) return; url.username = ''; for (var i = 0; i < codePoints.length; i++) { url.username += percentEncode(codePoints[i], userinfoPercentEncodeSet); } }), // `URL.prototype.password` accessors pair // https://url.spec.whatwg.org/#dom-url-password password: accessorDescriptor(getPassword, function (password) { var url = getInternalURLState(this); var codePoints = arrayFrom(String(password)); if (cannotHaveUsernamePasswordPort(url)) return; url.password = ''; for (var i = 0; i < codePoints.length; i++) { url.password += percentEncode(codePoints[i], userinfoPercentEncodeSet); } }), // `URL.prototype.host` accessors pair // https://url.spec.whatwg.org/#dom-url-host host: accessorDescriptor(getHost, function (host) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; parseURL(url, String(host), HOST); }), // `URL.prototype.hostname` accessors pair // https://url.spec.whatwg.org/#dom-url-hostname hostname: accessorDescriptor(getHostname, function (hostname) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; parseURL(url, String(hostname), HOSTNAME); }), // `URL.prototype.port` accessors pair // https://url.spec.whatwg.org/#dom-url-port port: accessorDescriptor(getPort, function (port) { var url = getInternalURLState(this); if (cannotHaveUsernamePasswordPort(url)) return; port = String(port); if (port == '') url.port = null; else parseURL(url, port, PORT); }), // `URL.prototype.pathname` accessors pair // https://url.spec.whatwg.org/#dom-url-pathname pathname: accessorDescriptor(getPathname, function (pathname) { var url = getInternalURLState(this); if (url.cannotBeABaseURL) return; url.path = []; parseURL(url, pathname + '', PATH_START); }), // `URL.prototype.search` accessors pair // https://url.spec.whatwg.org/#dom-url-search search: accessorDescriptor(getSearch, function (search) { var url = getInternalURLState(this); search = String(search); if (search == '') { url.query = null; } else { if ('?' == search.charAt(0)) search = search.slice(1); url.query = ''; parseURL(url, search, QUERY); } getInternalSearchParamsState(url.searchParams).updateSearchParams(url.query); }), // `URL.prototype.searchParams` getter // https://url.spec.whatwg.org/#dom-url-searchparams searchParams: accessorDescriptor(getSearchParams), // `URL.prototype.hash` accessors pair // https://url.spec.whatwg.org/#dom-url-hash hash: accessorDescriptor(getHash, function (hash) { var url = getInternalURLState(this); hash = String(hash); if (hash == '') { url.fragment = null; return; } if ('#' == hash.charAt(0)) hash = hash.slice(1); url.fragment = ''; parseURL(url, hash, FRAGMENT); }) }); } // `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson redefine(URLPrototype, 'toJSON', function toJSON() { return serializeURL.call(this); }, { enumerable: true }); // `URL.prototype.toString` method // https://url.spec.whatwg.org/#URL-stringification-behavior redefine(URLPrototype, 'toString', function toString() { return serializeURL.call(this); }, { enumerable: true }); if (NativeURL) { var nativeCreateObjectURL = NativeURL.createObjectURL; var nativeRevokeObjectURL = NativeURL.revokeObjectURL; // `URL.createObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL // eslint-disable-next-line no-unused-vars if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) { return nativeCreateObjectURL.apply(NativeURL, arguments); }); // `URL.revokeObjectURL` method // https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL // eslint-disable-next-line no-unused-vars if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) { return nativeRevokeObjectURL.apply(NativeURL, arguments); }); } setToStringTag(URLConstructor, 'URL'); $({ global: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, { URL: URLConstructor }); },{"../internals/an-instance":4,"../internals/array-from":6,"../internals/descriptors":18,"../internals/export":21,"../internals/global":27,"../internals/has":28,"../internals/internal-state":34,"../internals/native-url":42,"../internals/object-assign":44,"../internals/object-define-properties":46,"../internals/redefine":59,"../internals/set-to-string-tag":62,"../internals/string-multibyte":66,"../internals/string-punycode-to-ascii":67,"../modules/es.string.iterator":79,"../modules/web.url-search-params":80}],82:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); // `URL.prototype.toJSON` method // https://url.spec.whatwg.org/#dom-url-tojson $({ target: 'URL', proto: true, enumerable: true }, { toJSON: function toJSON() { return URL.prototype.toString.call(this); } }); },{"../internals/export":21}],83:[function(require,module,exports){ require('../modules/web.url'); require('../modules/web.url.to-json'); require('../modules/web.url-search-params'); var path = require('../internals/path'); module.exports = path.URL; },{"../internals/path":57,"../modules/web.url":81,"../modules/web.url-search-params":80,"../modules/web.url.to-json":82}]},{},[83]); vendor/wp-polyfill-formdata.min.js 0000644 00000021106 15013651111 0013224 0 ustar 00 /*! formdata-polyfill. MIT License. Jimmy W?rting <https://jimmy.warting.se/opensource> */ !function(){var t;function e(t){var e=0;return function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}var n="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){return t==Array.prototype||t==Object.prototype||(t[e]=n.value),t};var r,o=function(t){t=["object"==typeof globalThis&&globalThis,t,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var e=0;e<t.length;++e){var n=t[e];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);function i(t,e){if(e)t:{var r=o;t=t.split(".");for(var i=0;i<t.length-1;i++){var a=t[i];if(!(a in r))break t;r=r[a]}(e=e(i=r[t=t[t.length-1]]))!=i&&null!=e&&n(r,t,{configurable:!0,writable:!0,value:e})}}function a(t){return(t={next:t})[Symbol.iterator]=function(){return this},t}function u(t){var n="undefined"!=typeof Symbol&&Symbol.iterator&&t[Symbol.iterator];return n?n.call(t):{next:e(t)}}if(i("Symbol",(function(t){function e(t,e){this.A=t,n(this,"description",{configurable:!0,writable:!0,value:e})}if(t)return t;e.prototype.toString=function(){return this.A};var r="jscomp_symbol_"+(1e9*Math.random()>>>0)+"_",o=0;return function t(n){if(this instanceof t)throw new TypeError("Symbol is not a constructor");return new e(r+(n||"")+"_"+o++,n)}})),i("Symbol.iterator",(function(t){if(t)return t;t=Symbol("Symbol.iterator");for(var r="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),i=0;i<r.length;i++){var u=o[r[i]];"function"==typeof u&&"function"!=typeof u.prototype[t]&&n(u.prototype,t,{configurable:!0,writable:!0,value:function(){return a(e(this))}})}return t})),"function"==typeof Object.setPrototypeOf)r=Object.setPrototypeOf;else{var l;t:{var s={};try{s.__proto__={a:!0},l=s.a;break t}catch(t){}l=!1}r=l?function(t,e){if(t.__proto__=e,t.__proto__!==e)throw new TypeError(t+" is not extensible");return t}:null}var f=r;function c(){this.m=!1,this.j=null,this.v=void 0,this.h=1,this.u=this.C=0,this.l=null}function h(t){if(t.m)throw new TypeError("Generator is already running");t.m=!0}function p(t,e){return t.h=3,{value:e}}function y(t){this.g=new c,this.G=t}function v(t,e,n,r){try{var o=e.call(t.g.j,n);if(!(o instanceof Object))throw new TypeError("Iterator result "+o+" is not an object");if(!o.done)return t.g.m=!1,o;var i=o.value}catch(e){return t.g.j=null,t.g.s(e),g(t)}return t.g.j=null,r.call(t.g,i),g(t)}function g(t){for(;t.g.h;)try{var e=t.G(t.g);if(e)return t.g.m=!1,{value:e.value,done:!1}}catch(e){t.g.v=void 0,t.g.s(e)}if(t.g.m=!1,t.g.l){if(e=t.g.l,t.g.l=null,e.F)throw e.D;return{value:e.return,done:!0}}return{value:void 0,done:!0}}function d(t){this.next=function(e){return t.o(e)},this.throw=function(e){return t.s(e)},this.return=function(e){return function(t,e){h(t.g);var n=t.g.j;return n?v(t,"return"in n?n.return:function(t){return{value:t,done:!0}},e,t.g.return):(t.g.return(e),g(t))}(t,e)},this[Symbol.iterator]=function(){return this}}function b(t,e){return e=new d(new y(e)),f&&t.prototype&&f(e,t.prototype),e}if(c.prototype.o=function(t){this.v=t},c.prototype.s=function(t){this.l={D:t,F:!0},this.h=this.C||this.u},c.prototype.return=function(t){this.l={return:t},this.h=this.u},y.prototype.o=function(t){return h(this.g),this.g.j?v(this,this.g.j.next,t,this.g.o):(this.g.o(t),g(this))},y.prototype.s=function(t){return h(this.g),this.g.j?v(this,this.g.j.throw,t,this.g.o):(this.g.s(t),g(this))},i("Array.prototype.entries",(function(t){return t||function(){return function(t,e){t instanceof String&&(t+="");var n=0,r=!1,o={next:function(){if(!r&&n<t.length){var o=n++;return{value:e(o,t[o]),done:!1}}return r=!0,{done:!0,value:void 0}}};return o[Symbol.iterator]=function(){return o},o}(this,(function(t,e){return[t,e]}))}})),"undefined"!=typeof Blob&&("undefined"==typeof FormData||!FormData.prototype.keys)){var m=function(t,e){for(var n=0;n<t.length;n++)e(t[n])},w=function(t){return t.replace(/\r?\n|\r/g,"\r\n")},S=function(t,e,n){return e instanceof Blob?(n=void 0!==n?String(n+""):"string"==typeof e.name?e.name:"blob",e.name===n&&"[object Blob]"!==Object.prototype.toString.call(e)||(e=new File([e],n)),[String(t),e]):[String(t),String(e)]},j=function(t,e){if(t.length<e)throw new TypeError(e+" argument required, but only "+t.length+" present.")},x="object"==typeof globalThis?globalThis:"object"==typeof window?window:"object"==typeof self?self:this,_=x.FormData,F=x.XMLHttpRequest&&x.XMLHttpRequest.prototype.send,A=x.Request&&x.fetch,M=x.navigator&&x.navigator.sendBeacon,D=x.Element&&x.Element.prototype,B=x.Symbol&&Symbol.toStringTag;B&&(Blob.prototype[B]||(Blob.prototype[B]="Blob"),"File"in x&&!File.prototype[B]&&(File.prototype[B]="File"));try{new File([],"")}catch(t){x.File=function(t,e,n){return t=new Blob(t,n||{}),Object.defineProperties(t,{name:{value:e},lastModified:{value:+(n&&void 0!==n.lastModified?new Date(n.lastModified):new Date)},toString:{value:function(){return"[object File]"}}}),B&&Object.defineProperty(t,B,{value:"File"}),t}}var T=function(t){return t.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},q=function(t){this.i=[];var e=this;t&&m(t.elements,(function(t){if(t.name&&!t.disabled&&"submit"!==t.type&&"button"!==t.type&&!t.matches("form fieldset[disabled] *"))if("file"===t.type){var n=t.files&&t.files.length?t.files:[new File([],"",{type:"application/octet-stream"})];m(n,(function(n){e.append(t.name,n)}))}else"select-multiple"===t.type||"select-one"===t.type?m(t.options,(function(n){!n.disabled&&n.selected&&e.append(t.name,n.value)})):"checkbox"===t.type||"radio"===t.type?t.checked&&e.append(t.name,t.value):(n="textarea"===t.type?w(t.value):t.value,e.append(t.name,n))}))};if((t=q.prototype).append=function(t,e,n){j(arguments,2),this.i.push(S(t,e,n))},t.delete=function(t){j(arguments,1);var e=[];t=String(t),m(this.i,(function(n){n[0]!==t&&e.push(n)})),this.i=e},t.entries=function t(){var e,n=this;return b(t,(function(t){if(1==t.h&&(e=0),3!=t.h)return e<n.i.length?t=p(t,n.i[e]):(t.h=0,t=void 0),t;e++,t.h=2}))},t.forEach=function(t,e){j(arguments,1);for(var n=u(this),r=n.next();!r.done;r=n.next()){var o=u(r.value);r=o.next().value,o=o.next().value,t.call(e,o,r,this)}},t.get=function(t){j(arguments,1);var e=this.i;t=String(t);for(var n=0;n<e.length;n++)if(e[n][0]===t)return e[n][1];return null},t.getAll=function(t){j(arguments,1);var e=[];return t=String(t),m(this.i,(function(n){n[0]===t&&e.push(n[1])})),e},t.has=function(t){j(arguments,1),t=String(t);for(var e=0;e<this.i.length;e++)if(this.i[e][0]===t)return!0;return!1},t.keys=function t(){var e,n,r,o,i=this;return b(t,(function(t){if(1==t.h&&(e=u(i),n=e.next()),3!=t.h)return n.done?void(t.h=0):(r=n.value,o=u(r),p(t,o.next().value));n=e.next(),t.h=2}))},t.set=function(t,e,n){j(arguments,2),t=String(t);var r=[],o=S(t,e,n),i=!0;m(this.i,(function(e){e[0]===t?i&&(i=!r.push(o)):r.push(e)})),i&&r.push(o),this.i=r},t.values=function t(){var e,n,r,o,i=this;return b(t,(function(t){if(1==t.h&&(e=u(i),n=e.next()),3!=t.h)return n.done?void(t.h=0):(r=n.value,(o=u(r)).next(),p(t,o.next().value));n=e.next(),t.h=2}))},q.prototype._asNative=function(){for(var t=new _,e=u(this),n=e.next();!n.done;n=e.next()){var r=u(n.value);n=r.next().value,r=r.next().value,t.append(n,r)}return t},q.prototype._blob=function(){var t="----formdata-polyfill-"+Math.random(),e=[],n="--"+t+'\r\nContent-Disposition: form-data; name="';return this.forEach((function(t,r){return"string"==typeof t?e.push(n+T(w(r))+'"\r\n\r\n'+w(t)+"\r\n"):e.push(n+T(w(r))+'"; filename="'+T(t.name)+'"\r\nContent-Type: '+(t.type||"application/octet-stream")+"\r\n\r\n",t,"\r\n")})),e.push("--"+t+"--"),new Blob(e,{type:"multipart/form-data; boundary="+t})},q.prototype[Symbol.iterator]=function(){return this.entries()},q.prototype.toString=function(){return"[object FormData]"},D&&!D.matches&&(D.matches=D.matchesSelector||D.mozMatchesSelector||D.msMatchesSelector||D.oMatchesSelector||D.webkitMatchesSelector||function(t){for(var e=(t=(this.document||this.ownerDocument).querySelectorAll(t)).length;0<=--e&&t.item(e)!==this;);return-1<e}),B&&(q.prototype[B]="FormData"),F){var O=x.XMLHttpRequest.prototype.setRequestHeader;x.XMLHttpRequest.prototype.setRequestHeader=function(t,e){O.call(this,t,e),"content-type"===t.toLowerCase()&&(this.B=!0)},x.XMLHttpRequest.prototype.send=function(t){t instanceof q?(t=t._blob(),this.B||this.setRequestHeader("Content-Type",t.type),F.call(this,t)):F.call(this,t)}}A&&(x.fetch=function(t,e){return e&&e.body&&e.body instanceof q&&(e.body=e.body._blob()),A.call(this,t,e)}),M&&(x.navigator.sendBeacon=function(t,e){return e instanceof q&&(e=e._asNative()),M.call(this,t,e)}),x.FormData=q}}(); vendor/react-jsx-runtime.min.js 0000644 00000001604 15013651111 0012535 0 ustar 00 /*! For license information please see react-jsx-runtime.min.js.LICENSE.txt */ (()=>{"use strict";var r={20:(r,e,t)=>{var o=t(594),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,f=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function _(r,e,t){var o,s={},_=null,i=null;for(o in void 0!==t&&(_=""+t),void 0!==e.key&&(_=""+e.key),void 0!==e.ref&&(i=e.ref),e)a.call(e,o)&&!p.hasOwnProperty(o)&&(s[o]=e[o]);if(r&&r.defaultProps)for(o in e=r.defaultProps)void 0===s[o]&&(s[o]=e[o]);return{$$typeof:n,type:r,key:_,ref:i,props:s,_owner:f.current}}e.Fragment=s,e.jsx=_,e.jsxs=_},594:r=>{r.exports=React},848:(r,e,t)=>{r.exports=t(20)}},e={},t=function t(o){var n=e[o];if(void 0!==n)return n.exports;var s=e[o]={exports:{}};return r[o](s,s.exports,t),s.exports}(848);window.ReactJSXRuntime=t})(); vendor/lodash.min.js 0000644 00000212063 15013651111 0010431 0 ustar 00 /** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ (function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function r(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&!1!==t(n[r],r,n););return n}function e(n,t){for(var r=null==n?0:n.length;r--&&!1!==t(n[r],r,n););return n}function u(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;return!0}function i(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function o(n,t){return!(null==n||!n.length)&&g(n,t,0)>-1}function f(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function c(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function a(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function l(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function s(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function h(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}function p(n){return n.match(Qn)||[]}function _(n,t,r){var e;return r(n,(function(n,r,u){if(t(n,r,u))return e=r,!1})),e}function v(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function g(n,t,r){return t==t?function(n,t,r){for(var e=r-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1}(n,t,r):v(n,d,r)}function y(n,t,r,e){for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function d(n){return n!=n}function b(n,t){var r=null==n?0:n.length;return r?j(n,t)/r:X}function w(n){return function(t){return null==t?N:t[n]}}function m(n){return function(t){return null==n?N:n[t]}}function x(n,t,r,e,u){return u(n,(function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)})),r}function j(n,t){for(var r,e=-1,u=n.length;++e<u;){var i=t(n[e]);i!==N&&(r=r===N?i:r+i)}return r}function A(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function k(n){return n?n.slice(0,M(n)+1).replace(Vn,""):n}function O(n){return function(t){return n(t)}}function I(n,t){return c(t,(function(t){return n[t]}))}function R(n,t){return n.has(t)}function z(n,t){for(var r=-1,e=n.length;++r<e&&g(t,n[r],0)>-1;);return r}function E(n,t){for(var r=n.length;r--&&g(t,n[r],0)>-1;);return r}function S(n){return"\\"+Yt[n]}function W(n){return Zt.test(n)}function L(n){return Kt.test(n)}function C(n){var t=-1,r=Array(n.size);return n.forEach((function(n,e){r[++t]=[e,n]})),r}function U(n,t){return function(r){return n(t(r))}}function B(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r];o!==t&&o!==Z||(n[r]=Z,i[u++]=r)}return i}function T(n){var t=-1,r=Array(n.size);return n.forEach((function(n){r[++t]=n})),r}function $(n){return W(n)?function(n){for(var t=Pt.lastIndex=0;Pt.test(n);)++t;return t}(n):_r(n)}function D(n){return W(n)?function(n){return n.match(Pt)||[]}(n):function(n){return n.split("")}(n)}function M(n){for(var t=n.length;t--&&Gn.test(n.charAt(t)););return t}function F(n){return n.match(qt)||[]}var N,P="Expected a function",q="__lodash_hash_undefined__",Z="__lodash_placeholder__",K=16,V=32,G=64,H=128,J=256,Y=1/0,Q=9007199254740991,X=NaN,nn=4294967295,tn=nn-1,rn=nn>>>1,en=[["ary",H],["bind",1],["bindKey",2],["curry",8],["curryRight",K],["flip",512],["partial",V],["partialRight",G],["rearg",J]],un="[object Arguments]",on="[object Array]",fn="[object Boolean]",cn="[object Date]",an="[object Error]",ln="[object Function]",sn="[object GeneratorFunction]",hn="[object Map]",pn="[object Number]",_n="[object Object]",vn="[object Promise]",gn="[object RegExp]",yn="[object Set]",dn="[object String]",bn="[object Symbol]",wn="[object WeakMap]",mn="[object ArrayBuffer]",xn="[object DataView]",jn="[object Float32Array]",An="[object Float64Array]",kn="[object Int8Array]",On="[object Int16Array]",In="[object Int32Array]",Rn="[object Uint8Array]",zn="[object Uint8ClampedArray]",En="[object Uint16Array]",Sn="[object Uint32Array]",Wn=/\b__p \+= '';/g,Ln=/\b(__p \+=) '' \+/g,Cn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Un=/&(?:amp|lt|gt|quot|#39);/g,Bn=/[&<>"']/g,Tn=RegExp(Un.source),$n=RegExp(Bn.source),Dn=/<%-([\s\S]+?)%>/g,Mn=/<%([\s\S]+?)%>/g,Fn=/<%=([\s\S]+?)%>/g,Nn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pn=/^\w*$/,qn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zn=/[\\^$.*+?()[\]{}|]/g,Kn=RegExp(Zn.source),Vn=/^\s+/,Gn=/\s/,Hn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Jn=/\{\n\/\* \[wrapped with (.+)\] \*/,Yn=/,? & /,Qn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Xn=/[()=,{}\[\]\/\s]/,nt=/\\(\\)?/g,tt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,et=/^[-+]0x[0-9a-f]+$/i,ut=/^0b[01]+$/i,it=/^\[object .+?Constructor\]$/,ot=/^0o[0-7]+$/i,ft=/^(?:0|[1-9]\d*)$/,ct=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,at=/($^)/,lt=/['\n\r\u2028\u2029\\]/g,st="\\ud800-\\udfff",ht="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",pt="\\u2700-\\u27bf",_t="a-z\\xdf-\\xf6\\xf8-\\xff",vt="A-Z\\xc0-\\xd6\\xd8-\\xde",gt="\\ufe0e\\ufe0f",yt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dt="['’]",bt="["+st+"]",wt="["+yt+"]",mt="["+ht+"]",xt="\\d+",jt="["+pt+"]",At="["+_t+"]",kt="[^"+st+yt+xt+pt+_t+vt+"]",Ot="\\ud83c[\\udffb-\\udfff]",It="[^"+st+"]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",zt="[\\ud800-\\udbff][\\udc00-\\udfff]",Et="["+vt+"]",St="\\u200d",Wt="(?:"+At+"|"+kt+")",Lt="(?:"+Et+"|"+kt+")",Ct="(?:['’](?:d|ll|m|re|s|t|ve))?",Ut="(?:['’](?:D|LL|M|RE|S|T|VE))?",Bt="(?:"+mt+"|"+Ot+")"+"?",Tt="["+gt+"]?",$t=Tt+Bt+("(?:"+St+"(?:"+[It,Rt,zt].join("|")+")"+Tt+Bt+")*"),Dt="(?:"+[jt,Rt,zt].join("|")+")"+$t,Mt="(?:"+[It+mt+"?",mt,Rt,zt,bt].join("|")+")",Ft=RegExp(dt,"g"),Nt=RegExp(mt,"g"),Pt=RegExp(Ot+"(?="+Ot+")|"+Mt+$t,"g"),qt=RegExp([Et+"?"+At+"+"+Ct+"(?="+[wt,Et,"$"].join("|")+")",Lt+"+"+Ut+"(?="+[wt,Et+Wt,"$"].join("|")+")",Et+"?"+Wt+"+"+Ct,Et+"+"+Ut,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",xt,Dt].join("|"),"g"),Zt=RegExp("["+St+st+ht+gt+"]"),Kt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Vt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Gt=-1,Ht={};Ht[jn]=Ht[An]=Ht[kn]=Ht[On]=Ht[In]=Ht[Rn]=Ht[zn]=Ht[En]=Ht[Sn]=!0,Ht[un]=Ht[on]=Ht[mn]=Ht[fn]=Ht[xn]=Ht[cn]=Ht[an]=Ht[ln]=Ht[hn]=Ht[pn]=Ht[_n]=Ht[gn]=Ht[yn]=Ht[dn]=Ht[wn]=!1;var Jt={};Jt[un]=Jt[on]=Jt[mn]=Jt[xn]=Jt[fn]=Jt[cn]=Jt[jn]=Jt[An]=Jt[kn]=Jt[On]=Jt[In]=Jt[hn]=Jt[pn]=Jt[_n]=Jt[gn]=Jt[yn]=Jt[dn]=Jt[bn]=Jt[Rn]=Jt[zn]=Jt[En]=Jt[Sn]=!0,Jt[an]=Jt[ln]=Jt[wn]=!1;var Yt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Qt=parseFloat,Xt=parseInt,nr="object"==typeof global&&global&&global.Object===Object&&global,tr="object"==typeof self&&self&&self.Object===Object&&self,rr=nr||tr||Function("return this")(),er="object"==typeof exports&&exports&&!exports.nodeType&&exports,ur=er&&"object"==typeof module&&module&&!module.nodeType&&module,ir=ur&&ur.exports===er,or=ir&&nr.process,fr=function(){try{var n=ur&&ur.require&&ur.require("util").types;return n||or&&or.binding&&or.binding("util")}catch(n){}}(),cr=fr&&fr.isArrayBuffer,ar=fr&&fr.isDate,lr=fr&&fr.isMap,sr=fr&&fr.isRegExp,hr=fr&&fr.isSet,pr=fr&&fr.isTypedArray,_r=w("length"),vr=m({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),gr=m({"&":"&","<":"<",">":">",'"':""","'":"'"}),yr=m({"&":"&","<":"<",">":">",""":'"',"'":"'"}),dr=function m(Gn){function Qn(n){if(Mu(n)&&!Sf(n)&&!(n instanceof pt)){if(n instanceof ht)return n;if(zi.call(n,"__wrapped__"))return hu(n)}return new ht(n)}function st(){}function ht(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=N}function pt(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=nn,this.__views__=[]}function _t(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function vt(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function gt(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function yt(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new gt;++t<r;)this.add(n[t])}function dt(n){this.size=(this.__data__=new vt(n)).size}function bt(n,t){var r=Sf(n),e=!r&&Ef(n),u=!r&&!e&&Lf(n),i=!r&&!e&&!u&&$f(n),o=r||e||u||i,f=o?A(n.length,xi):[],c=f.length;for(var a in n)!t&&!zi.call(n,a)||o&&("length"==a||u&&("offset"==a||"parent"==a)||i&&("buffer"==a||"byteLength"==a||"byteOffset"==a)||Je(a,c))||f.push(a);return f}function wt(n){var t=n.length;return t?n[Lr(0,t-1)]:N}function mt(n,t){return cu(le(n),Et(t,0,n.length))}function xt(n){return cu(le(n))}function jt(n,t,r){(r===N||Wu(n[t],r))&&(r!==N||t in n)||Rt(n,t,r)}function At(n,t,r){var e=n[t];zi.call(n,t)&&Wu(e,r)&&(r!==N||t in n)||Rt(n,t,r)}function kt(n,t){for(var r=n.length;r--;)if(Wu(n[r][0],t))return r;return-1}function Ot(n,t,r,e){return Ro(n,(function(n,u,i){t(e,n,r(n),i)})),e}function It(n,t){return n&&se(t,ni(t),n)}function Rt(n,t,r){"__proto__"==t&&Vi?Vi(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}function zt(n,t){for(var r=-1,e=t.length,u=vi(e),i=null==n;++r<e;)u[r]=i?N:Qu(n,t[r]);return u}function Et(n,t,r){return n==n&&(r!==N&&(n=n<=r?n:r),t!==N&&(n=n>=t?n:t)),n}function St(n,t,e,u,i,o){var f,c=1&t,a=2&t,l=4&t;if(e&&(f=i?e(n,u,i,o):e(n)),f!==N)return f;if(!Du(n))return n;var s=Sf(n);if(s){if(f=function(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&zi.call(n,"index")&&(r.index=n.index,r.input=n.input),r}(n),!c)return le(n,f)}else{var h=Mo(n),p=h==ln||h==sn;if(Lf(n))return ue(n,c);if(h==_n||h==un||p&&!i){if(f=a||p?{}:Ge(n),!c)return a?function(n,t){return se(n,Do(n),t)}(n,function(n,t){return n&&se(t,ti(t),n)}(f,n)):function(n,t){return se(n,$o(n),t)}(n,It(f,n))}else{if(!Jt[h])return i?n:{};f=function(n,t,r){var e=n.constructor;switch(t){case mn:return ie(n);case fn:case cn:return new e(+n);case xn:return function(n,t){return new n.constructor(t?ie(n.buffer):n.buffer,n.byteOffset,n.byteLength)}(n,r);case jn:case An:case kn:case On:case In:case Rn:case zn:case En:case Sn:return oe(n,r);case hn:return new e;case pn:case dn:return new e(n);case gn:return function(n){var t=new n.constructor(n.source,rt.exec(n));return t.lastIndex=n.lastIndex,t}(n);case yn:return new e;case bn:return function(n){return ko?wi(ko.call(n)):{}}(n)}}(n,h,c)}}o||(o=new dt);var _=o.get(n);if(_)return _;o.set(n,f),Tf(n)?n.forEach((function(r){f.add(St(r,t,e,r,n,o))})):Uf(n)&&n.forEach((function(r,u){f.set(u,St(r,t,e,u,n,o))}));var v=s?N:(l?a?Me:De:a?ti:ni)(n);return r(v||n,(function(r,u){v&&(r=n[u=r]),At(f,u,St(r,t,e,u,n,o))})),f}function Wt(n,t,r){var e=r.length;if(null==n)return!e;for(n=wi(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===N&&!(u in n)||!i(o))return!1}return!0}function Lt(n,t,r){if("function"!=typeof n)throw new ji(P);return Po((function(){n.apply(N,r)}),t)}function Ct(n,t,r,e){var u=-1,i=o,a=!0,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,O(r))),e?(i=f,a=!1):t.length>=200&&(i=R,a=!1,t=new yt(t));n:for(;++u<l;){var p=n[u],_=null==r?p:r(p);if(p=e||0!==p?p:0,a&&_==_){for(var v=h;v--;)if(t[v]===_)continue n;s.push(p)}else i(t,_,e)||s.push(p)}return s}function Ut(n,t){var r=!0;return Ro(n,(function(n,e,u){return r=!!t(n,e,u)})),r}function Bt(n,t,r){for(var e=-1,u=n.length;++e<u;){var i=n[e],o=t(i);if(null!=o&&(f===N?o==o&&!qu(o):r(o,f)))var f=o,c=i}return c}function Tt(n,t){var r=[];return Ro(n,(function(n,e,u){t(n,e,u)&&r.push(n)})),r}function $t(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=He),u||(u=[]);++i<o;){var f=n[i];t>0&&r(f)?t>1?$t(f,t-1,r,e,u):a(u,f):e||(u[u.length]=f)}return u}function Dt(n,t){return n&&Eo(n,t,ni)}function Mt(n,t){return n&&So(n,t,ni)}function Pt(n,t){return i(t,(function(t){return Bu(n[t])}))}function qt(n,t){for(var r=0,e=(t=re(t,n)).length;null!=n&&r<e;)n=n[au(t[r++])];return r&&r==e?n:N}function Zt(n,t,r){var e=t(n);return Sf(n)?e:a(e,r(n))}function Kt(n){return null==n?n===N?"[object Undefined]":"[object Null]":Ki&&Ki in wi(n)?function(n){var t=zi.call(n,Ki),r=n[Ki];try{n[Ki]=N;var e=!0}catch(n){}var u=Wi.call(n);return e&&(t?n[Ki]=r:delete n[Ki]),u}(n):function(n){return Wi.call(n)}(n)}function Yt(n,t){return n>t}function nr(n,t){return null!=n&&zi.call(n,t)}function tr(n,t){return null!=n&&t in wi(n)}function er(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=vi(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,O(t))),s=io(p.length,s),l[a]=!r&&(t||u>=120&&p.length>=120)?new yt(a&&p):N}p=n[0];var _=-1,v=l[0];n:for(;++_<u&&h.length<s;){var g=p[_],y=t?t(g):g;if(g=r||0!==g?g:0,!(v?R(v,y):e(h,y,r))){for(a=i;--a;){var d=l[a];if(!(d?R(d,y):e(n[a],y,r)))continue n}v&&v.push(y),h.push(g)}}return h}function ur(t,r,e){var u=null==(t=uu(t,r=re(r,t)))?t:t[au(yu(r))];return null==u?N:n(u,t,e)}function or(n){return Mu(n)&&Kt(n)==un}function fr(n,t,r,e,u){return n===t||(null==n||null==t||!Mu(n)&&!Mu(t)?n!=n&&t!=t:function(n,t,r,e,u,i){var o=Sf(n),f=Sf(t),c=o?on:Mo(n),a=f?on:Mo(t);c=c==un?_n:c,a=a==un?_n:a;var l=c==_n,s=a==_n,h=c==a;if(h&&Lf(n)){if(!Lf(t))return!1;o=!0,l=!1}if(h&&!l)return i||(i=new dt),o||$f(n)?Te(n,t,r,e,u,i):function(n,t,r,e,u,i,o){switch(r){case xn:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case mn:return!(n.byteLength!=t.byteLength||!i(new $i(n),new $i(t)));case fn:case cn:case pn:return Wu(+n,+t);case an:return n.name==t.name&&n.message==t.message;case gn:case dn:return n==t+"";case hn:var f=C;case yn:var c=1&e;if(f||(f=T),n.size!=t.size&&!c)return!1;var a=o.get(n);if(a)return a==t;e|=2,o.set(n,t);var l=Te(f(n),f(t),e,u,i,o);return o.delete(n),l;case bn:if(ko)return ko.call(n)==ko.call(t)}return!1}(n,t,c,r,e,u,i);if(!(1&r)){var p=l&&zi.call(n,"__wrapped__"),_=s&&zi.call(t,"__wrapped__");if(p||_){var v=p?n.value():n,g=_?t.value():t;return i||(i=new dt),u(v,g,r,e,i)}}return!!h&&(i||(i=new dt),function(n,t,r,e,u,i){var o=1&r,f=De(n),c=f.length;if(c!=De(t).length&&!o)return!1;for(var a=c;a--;){var l=f[a];if(!(o?l in t:zi.call(t,l)))return!1}var s=i.get(n),h=i.get(t);if(s&&h)return s==t&&h==n;var p=!0;i.set(n,t),i.set(t,n);for(var _=o;++a<c;){var v=n[l=f[a]],g=t[l];if(e)var y=o?e(g,v,l,t,n,i):e(v,g,l,n,t,i);if(!(y===N?v===g||u(v,g,r,e,i):y)){p=!1;break}_||(_="constructor"==l)}if(p&&!_){var d=n.constructor,b=t.constructor;d!=b&&"constructor"in n&&"constructor"in t&&!("function"==typeof d&&d instanceof d&&"function"==typeof b&&b instanceof b)&&(p=!1)}return i.delete(n),i.delete(t),p}(n,t,r,e,u,i))}(n,t,r,e,fr,u))}function _r(n,t,r,e){var u=r.length,i=u,o=!e;if(null==n)return!i;for(n=wi(n);u--;){var f=r[u];if(o&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return!1}for(;++u<i;){var c=(f=r[u])[0],a=n[c],l=f[1];if(o&&f[2]){if(a===N&&!(c in n))return!1}else{var s=new dt;if(e)var h=e(a,l,c,n,t,s);if(!(h===N?fr(l,a,3,e,s):h))return!1}}return!0}function br(n){return!(!Du(n)||function(n){return!!Si&&Si in n}(n))&&(Bu(n)?Ui:it).test(lu(n))}function wr(n){return"function"==typeof n?n:null==n?ci:"object"==typeof n?Sf(n)?Or(n[0],n[1]):kr(n):hi(n)}function mr(n){if(!nu(n))return eo(n);var t=[];for(var r in wi(n))zi.call(n,r)&&"constructor"!=r&&t.push(r);return t}function xr(n){if(!Du(n))return function(n){var t=[];if(null!=n)for(var r in wi(n))t.push(r);return t}(n);var t=nu(n),r=[];for(var e in n)("constructor"!=e||!t&&zi.call(n,e))&&r.push(e);return r}function jr(n,t){return n<t}function Ar(n,t){var r=-1,e=Lu(n)?vi(n.length):[];return Ro(n,(function(n,u,i){e[++r]=t(n,u,i)})),e}function kr(n){var t=Ze(n);return 1==t.length&&t[0][2]?ru(t[0][0],t[0][1]):function(r){return r===n||_r(r,n,t)}}function Or(n,t){return Qe(n)&&tu(t)?ru(au(n),t):function(r){var e=Qu(r,n);return e===N&&e===t?Xu(r,n):fr(t,e,3)}}function Ir(n,t,r,e,u){n!==t&&Eo(t,(function(i,o){if(u||(u=new dt),Du(i))!function(n,t,r,e,u,i,o){var f=iu(n,r),c=iu(t,r),a=o.get(c);if(a)return jt(n,r,a),N;var l=i?i(f,c,r+"",n,t,o):N,s=l===N;if(s){var h=Sf(c),p=!h&&Lf(c),_=!h&&!p&&$f(c);l=c,h||p||_?Sf(f)?l=f:Cu(f)?l=le(f):p?(s=!1,l=ue(c,!0)):_?(s=!1,l=oe(c,!0)):l=[]:Nu(c)||Ef(c)?(l=f,Ef(f)?l=Ju(f):Du(f)&&!Bu(f)||(l=Ge(c))):s=!1}s&&(o.set(c,l),u(l,c,e,i,o),o.delete(c)),jt(n,r,l)}(n,t,o,r,Ir,e,u);else{var f=e?e(iu(n,o),i,o+"",n,t,u):N;f===N&&(f=i),jt(n,o,f)}}),ti)}function Rr(n,t){var r=n.length;if(r)return Je(t+=t<0?r:0,r)?n[t]:N}function zr(n,t,r){t=t.length?c(t,(function(n){return Sf(n)?function(t){return qt(t,1===n.length?n[0]:n)}:n})):[ci];var e=-1;return t=c(t,O(Pe())),function(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].value;return n}(Ar(n,(function(n,r,u){return{criteria:c(t,(function(t){return t(n)})),index:++e,value:n}})),(function(n,t){return function(n,t,r){for(var e=-1,u=n.criteria,i=t.criteria,o=u.length,f=r.length;++e<o;){var c=fe(u[e],i[e]);if(c)return e>=f?c:c*("desc"==r[e]?-1:1)}return n.index-t.index}(n,t,r)}))}function Er(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=qt(n,o);r(f,o)&&$r(i,re(o,n),f)}return i}function Sr(n,t,r,e){var u=e?y:g,i=-1,o=t.length,f=n;for(n===t&&(t=le(t)),r&&(f=c(n,O(r)));++i<o;)for(var a=0,l=t[i],s=r?r(l):l;(a=u(f,s,a,e))>-1;)f!==n&&Pi.call(f,a,1),Pi.call(n,a,1);return n}function Wr(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;Je(u)?Pi.call(n,u,1):Gr(n,u)}}return n}function Lr(n,t){return n+Qi(co()*(t-n+1))}function Cr(n,t){var r="";if(!n||t<1||t>Q)return r;do{t%2&&(r+=n),(t=Qi(t/2))&&(n+=n)}while(t);return r}function Ur(n,t){return qo(eu(n,t,ci),n+"")}function Br(n){return wt(ei(n))}function Tr(n,t){var r=ei(n);return cu(r,Et(t,0,r.length))}function $r(n,t,r,e){if(!Du(n))return n;for(var u=-1,i=(t=re(t,n)).length,o=i-1,f=n;null!=f&&++u<i;){var c=au(t[u]),a=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return n;if(u!=o){var l=f[c];(a=e?e(l,c,f):N)===N&&(a=Du(l)?l:Je(t[u+1])?[]:{})}At(f,c,a),f=f[c]}return n}function Dr(n){return cu(ei(n))}function Mr(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),(r=r>u?u:r)<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=vi(u);++e<u;)i[e]=n[e+t];return i}function Fr(n,t){var r;return Ro(n,(function(n,e,u){return!(r=t(n,e,u))})),!!r}function Nr(n,t,r){var e=0,u=null==n?e:n.length;if("number"==typeof t&&t==t&&u<=rn){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!qu(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return Pr(n,t,ci,r)}function Pr(n,t,r,e){var u=0,i=null==n?0:n.length;if(0===i)return 0;for(var o=(t=r(t))!=t,f=null===t,c=qu(t),a=t===N;u<i;){var l=Qi((u+i)/2),s=r(n[l]),h=s!==N,p=null===s,_=s==s,v=qu(s);if(o)var g=e||_;else g=a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):!p&&!v&&(e?s<=t:s<t);g?u=l+1:i=l}return io(i,tn)}function qr(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],f=t?t(o):o;if(!r||!Wu(f,c)){var c=f;i[u++]=0===o?0:o}}return i}function Zr(n){return"number"==typeof n?n:qu(n)?X:+n}function Kr(n){if("string"==typeof n)return n;if(Sf(n))return c(n,Kr)+"";if(qu(n))return Oo?Oo.call(n):"";var t=n+"";return"0"==t&&1/n==-Y?"-0":t}function Vr(n,t,r){var e=-1,u=o,i=n.length,c=!0,a=[],l=a;if(r)c=!1,u=f;else if(i>=200){var s=t?null:Bo(n);if(s)return T(s);c=!1,u=R,l=new yt}else l=t?[]:a;n:for(;++e<i;){var h=n[e],p=t?t(h):h;if(h=r||0!==h?h:0,c&&p==p){for(var _=l.length;_--;)if(l[_]===p)continue n;t&&l.push(p),a.push(h)}else u(l,p,r)||(l!==a&&l.push(p),a.push(h))}return a}function Gr(n,t){return null==(n=uu(n,t=re(t,n)))||delete n[au(yu(t))]}function Hr(n,t,r,e){return $r(n,t,r(qt(n,t)),e)}function Jr(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?Mr(n,e?0:i,e?i+1:u):Mr(n,e?i+1:0,e?u:i)}function Yr(n,t){var r=n;return r instanceof pt&&(r=r.value()),l(t,(function(n,t){return t.func.apply(t.thisArg,a([n],t.args))}),r)}function Qr(n,t,r){var e=n.length;if(e<2)return e?Vr(n[0]):[];for(var u=-1,i=vi(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=Ct(i[u]||o,n[f],t,r));return Vr($t(i,1),t,r)}function Xr(n,t,r){for(var e=-1,u=n.length,i=t.length,o={};++e<u;)r(o,n[e],e<i?t[e]:N);return o}function ne(n){return Cu(n)?n:[]}function te(n){return"function"==typeof n?n:ci}function re(n,t){return Sf(n)?n:Qe(n,t)?[n]:Zo(Yu(n))}function ee(n,t,r){var e=n.length;return r=r===N?e:r,!t&&r>=e?n:Mr(n,t,r)}function ue(n,t){if(t)return n.slice();var r=n.length,e=Di?Di(r):new n.constructor(r);return n.copy(e),e}function ie(n){var t=new n.constructor(n.byteLength);return new $i(t).set(new $i(n)),t}function oe(n,t){return new n.constructor(t?ie(n.buffer):n.buffer,n.byteOffset,n.length)}function fe(n,t){if(n!==t){var r=n!==N,e=null===n,u=n==n,i=qu(n),o=t!==N,f=null===t,c=t==t,a=qu(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&n<t||a&&r&&u&&!e&&!i||f&&r&&u||!o&&u||!c)return-1}return 0}function ce(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,c=t.length,a=uo(i-o,0),l=vi(c+a),s=!e;++f<c;)l[f]=t[f];for(;++u<o;)(s||u<i)&&(l[r[u]]=n[u]);for(;a--;)l[f++]=n[u++];return l}function ae(n,t,r,e){for(var u=-1,i=n.length,o=-1,f=r.length,c=-1,a=t.length,l=uo(i-f,0),s=vi(l+a),h=!e;++u<l;)s[u]=n[u];for(var p=u;++c<a;)s[p+c]=t[c];for(;++o<f;)(h||u<i)&&(s[p+r[o]]=n[u++]);return s}function le(n,t){var r=-1,e=n.length;for(t||(t=vi(e));++r<e;)t[r]=n[r];return t}function se(n,t,r,e){var u=!r;r||(r={});for(var i=-1,o=t.length;++i<o;){var f=t[i],c=e?e(r[f],n[f],f,r,n):N;c===N&&(c=n[f]),u?Rt(r,f,c):At(r,f,c)}return r}function he(n,r){return function(e,u){var i=Sf(e)?t:Ot,o=r?r():{};return i(e,n,Pe(u,2),o)}}function pe(n){return Ur((function(t,r){var e=-1,u=r.length,i=u>1?r[u-1]:N,o=u>2?r[2]:N;for(i=n.length>3&&"function"==typeof i?(u--,i):N,o&&Ye(r[0],r[1],o)&&(i=u<3?N:i,u=1),t=wi(t);++e<u;){var f=r[e];f&&n(t,f,e,i)}return t}))}function _e(n,t){return function(r,e){if(null==r)return r;if(!Lu(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=wi(r);(t?i--:++i<u)&&!1!==e(o[i],i,o););return r}}function ve(n){return function(t,r,e){for(var u=-1,i=wi(t),o=e(t),f=o.length;f--;){var c=o[n?f:++u];if(!1===r(i[c],c,i))break}return t}}function ge(n){return function(t){var r=W(t=Yu(t))?D(t):N,e=r?r[0]:t.charAt(0),u=r?ee(r,1).join(""):t.slice(1);return e[n]()+u}}function ye(n){return function(t){return l(oi(ii(t).replace(Ft,"")),n,"")}}function de(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Io(n.prototype),e=n.apply(r,t);return Du(e)?e:r}}function be(t,r,e){var u=de(t);return function i(){for(var o=arguments.length,f=vi(o),c=o,a=Ne(i);c--;)f[c]=arguments[c];var l=o<3&&f[0]!==a&&f[o-1]!==a?[]:B(f,a);return(o-=l.length)<e?Ee(t,r,xe,i.placeholder,N,f,l,N,N,e-o):n(this&&this!==rr&&this instanceof i?u:t,this,f)}}function we(n){return function(t,r,e){var u=wi(t);if(!Lu(t)){var i=Pe(r,3);t=ni(t),r=function(n){return i(u[n],n,u)}}var o=n(t,r,e);return o>-1?u[i?t[o]:o]:N}}function me(n){return $e((function(t){var r=t.length,e=r,u=ht.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if("function"!=typeof i)throw new ji(P);if(u&&!o&&"wrapper"==Fe(i))var o=new ht([],!0)}for(e=o?e:r;++e<r;){var f=Fe(i=t[e]),c="wrapper"==f?To(i):N;o=c&&Xe(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?o[Fe(c[0])].apply(o,c[3]):1==i.length&&Xe(i)?o[f]():o.thru(i)}return function(){var n=arguments,e=n[0];if(o&&1==n.length&&Sf(e))return o.plant(e).value();for(var u=0,i=r?t[u].apply(this,n):e;++u<r;)i=t[u].call(this,i);return i}}))}function xe(n,t,r,e,u,i,o,f,c,a){var l=t&H,s=1&t,h=2&t,p=24&t,_=512&t,v=h?N:de(n);return function g(){for(var y=arguments.length,d=vi(y),b=y;b--;)d[b]=arguments[b];if(p)var w=Ne(g),m=function(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;return e}(d,w);if(e&&(d=ce(d,e,u,p)),i&&(d=ae(d,i,o,p)),y-=m,p&&y<a)return Ee(n,t,xe,g.placeholder,r,d,B(d,w),f,c,a-y);var x=s?r:this,j=h?x[n]:n;return y=d.length,f?d=function(n,t){for(var r=n.length,e=io(t.length,r),u=le(n);e--;){var i=t[e];n[e]=Je(i,r)?u[i]:N}return n}(d,f):_&&y>1&&d.reverse(),l&&c<y&&(d.length=c),this&&this!==rr&&this instanceof g&&(j=v||de(j)),j.apply(x,d)}}function je(n,t){return function(r,e){return function(n,t,r,e){return Dt(n,(function(n,u,i){t(e,r(n),u,i)})),e}(r,n,t(e),{})}}function Ae(n,t){return function(r,e){var u;if(r===N&&e===N)return t;if(r!==N&&(u=r),e!==N){if(u===N)return e;"string"==typeof r||"string"==typeof e?(r=Kr(r),e=Kr(e)):(r=Zr(r),e=Zr(e)),u=n(r,e)}return u}}function ke(t){return $e((function(r){return r=c(r,O(Pe())),Ur((function(e){var u=this;return t(r,(function(t){return n(t,u,e)}))}))}))}function Oe(n,t){var r=(t=t===N?" ":Kr(t)).length;if(r<2)return r?Cr(t,n):t;var e=Cr(t,Yi(n/$(t)));return W(t)?ee(D(e),0,n).join(""):e.slice(0,n)}function Ie(t,r,e,u){var i=1&r,o=de(t);return function r(){for(var f=-1,c=arguments.length,a=-1,l=u.length,s=vi(l+c),h=this&&this!==rr&&this instanceof r?o:t;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++f];return n(h,i?e:this,s)}}function Re(n){return function(t,r,e){return e&&"number"!=typeof e&&Ye(t,r,e)&&(r=e=N),t=Ku(t),r===N?(r=t,t=0):r=Ku(r),function(n,t,r,e){for(var u=-1,i=uo(Yi((t-n)/(r||1)),0),o=vi(i);i--;)o[e?i:++u]=n,n+=r;return o}(t,r,e=e===N?t<r?1:-1:Ku(e),n)}}function ze(n){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=Hu(t),r=Hu(r)),n(t,r)}}function Ee(n,t,r,e,u,i,o,f,c,a){var l=8&t;t|=l?V:G,4&(t&=~(l?G:V))||(t&=-4);var s=[n,t,u,l?i:N,l?o:N,l?N:i,l?N:o,f,c,a],h=r.apply(N,s);return Xe(n)&&No(h,s),h.placeholder=e,ou(h,n,t)}function Se(n){var t=bi[n];return function(n,r){if(n=Hu(n),(r=null==r?0:io(Vu(r),292))&&to(n)){var e=(Yu(n)+"e").split("e");return+((e=(Yu(t(e[0]+"e"+(+e[1]+r)))+"e").split("e"))[0]+"e"+(+e[1]-r))}return t(n)}}function We(n){return function(t){var r=Mo(t);return r==hn?C(t):r==yn?function(n){var t=-1,r=Array(n.size);return n.forEach((function(n){r[++t]=[n,n]})),r}(t):function(n,t){return c(t,(function(t){return[t,n[t]]}))}(t,n(t))}}function Le(n,t,r,e,u,i,o,f){var c=2&t;if(!c&&"function"!=typeof n)throw new ji(P);var a=e?e.length:0;if(a||(t&=-97,e=u=N),o=o===N?o:uo(Vu(o),0),f=f===N?f:Vu(f),a-=u?u.length:0,t&G){var l=e,s=u;e=u=N}var h=c?N:To(n),p=[n,t,r,e,u,l,s,i,o,f];if(h&&function(n,t){var r=n[1],e=t[1],u=r|e,i=u<131,o=e==H&&8==r||e==H&&r==J&&n[7].length<=t[8]||384==e&&t[7].length<=t[8]&&8==r;if(!i&&!o)return n;1&e&&(n[2]=t[2],u|=1&r?0:4);var f=t[3];if(f){var c=n[3];n[3]=c?ce(c,f,t[4]):f,n[4]=c?B(n[3],Z):t[4]}f=t[5],f&&(c=n[5],n[5]=c?ae(c,f,t[6]):f,n[6]=c?B(n[5],Z):t[6]),f=t[7],f&&(n[7]=f),e&H&&(n[8]=null==n[8]?t[8]:io(n[8],t[8])),null==n[9]&&(n[9]=t[9]),n[0]=t[0],n[1]=u}(p,h),n=p[0],t=p[1],r=p[2],e=p[3],u=p[4],!(f=p[9]=p[9]===N?c?0:n.length:uo(p[9]-a,0))&&24&t&&(t&=-25),t&&1!=t)_=8==t||t==K?be(n,t,f):t!=V&&33!=t||u.length?xe.apply(N,p):Ie(n,t,r,e);else var _=function(n,t,r){var e=1&t,u=de(n);return function t(){return(this&&this!==rr&&this instanceof t?u:n).apply(e?r:this,arguments)}}(n,t,r);return ou((h?Wo:No)(_,p),n,t)}function Ce(n,t,r,e){return n===N||Wu(n,Oi[r])&&!zi.call(e,r)?t:n}function Ue(n,t,r,e,u,i){return Du(n)&&Du(t)&&(i.set(t,n),Ir(n,t,N,Ue,i),i.delete(t)),n}function Be(n){return Nu(n)?N:n}function Te(n,t,r,e,u,i){var o=1&r,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return!1;var a=i.get(n),l=i.get(t);if(a&&l)return a==t&&l==n;var s=-1,p=!0,_=2&r?new yt:N;for(i.set(n,t),i.set(t,n);++s<f;){var v=n[s],g=t[s];if(e)var y=o?e(g,v,s,t,n,i):e(v,g,s,n,t,i);if(y!==N){if(y)continue;p=!1;break}if(_){if(!h(t,(function(n,t){if(!R(_,t)&&(v===n||u(v,n,r,e,i)))return _.push(t)}))){p=!1;break}}else if(v!==g&&!u(v,g,r,e,i)){p=!1;break}}return i.delete(n),i.delete(t),p}function $e(n){return qo(eu(n,N,vu),n+"")}function De(n){return Zt(n,ni,$o)}function Me(n){return Zt(n,ti,Do)}function Fe(n){for(var t=n.name+"",r=yo[t],e=zi.call(yo,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function Ne(n){return(zi.call(Qn,"placeholder")?Qn:n).placeholder}function Pe(){var n=Qn.iteratee||ai;return n=n===ai?wr:n,arguments.length?n(arguments[0],arguments[1]):n}function qe(n,t){var r=n.__data__;return function(n){var t=typeof n;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==n:null===n}(t)?r["string"==typeof t?"string":"hash"]:r.map}function Ze(n){for(var t=ni(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,tu(u)]}return t}function Ke(n,t){var r=function(n,t){return null==n?N:n[t]}(n,t);return br(r)?r:N}function Ve(n,t,r){for(var e=-1,u=(t=re(t,n)).length,i=!1;++e<u;){var o=au(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:!!(u=null==n?0:n.length)&&$u(u)&&Je(o,u)&&(Sf(n)||Ef(n))}function Ge(n){return"function"!=typeof n.constructor||nu(n)?{}:Io(Mi(n))}function He(n){return Sf(n)||Ef(n)||!!(qi&&n&&n[qi])}function Je(n,t){var r=typeof n;return!!(t=null==t?Q:t)&&("number"==r||"symbol"!=r&&ft.test(n))&&n>-1&&n%1==0&&n<t}function Ye(n,t,r){if(!Du(r))return!1;var e=typeof t;return!!("number"==e?Lu(r)&&Je(t,r.length):"string"==e&&t in r)&&Wu(r[t],n)}function Qe(n,t){if(Sf(n))return!1;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!qu(n))||Pn.test(n)||!Nn.test(n)||null!=t&&n in wi(t)}function Xe(n){var t=Fe(n),r=Qn[t];if("function"!=typeof r||!(t in pt.prototype))return!1;if(n===r)return!0;var e=To(r);return!!e&&n===e[0]}function nu(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||Oi)}function tu(n){return n==n&&!Du(n)}function ru(n,t){return function(r){return null!=r&&r[n]===t&&(t!==N||n in wi(r))}}function eu(t,r,e){return r=uo(r===N?t.length-1:r,0),function(){for(var u=arguments,i=-1,o=uo(u.length-r,0),f=vi(o);++i<o;)f[i]=u[r+i];i=-1;for(var c=vi(r+1);++i<r;)c[i]=u[i];return c[r]=e(f),n(t,this,c)}}function uu(n,t){return t.length<2?n:qt(n,Mr(t,0,-1))}function iu(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}function ou(n,t,r){var e=t+"";return qo(n,function(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(Hn,"{\n/* [wrapped with "+t+"] */\n")}(e,su(function(n){var t=n.match(Jn);return t?t[1].split(Yn):[]}(e),r)))}function fu(n){var t=0,r=0;return function(){var e=oo(),u=16-(e-r);if(r=e,u>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(N,arguments)}}function cu(n,t){var r=-1,e=n.length,u=e-1;for(t=t===N?e:t;++r<t;){var i=Lr(r,u),o=n[i];n[i]=n[r],n[r]=o}return n.length=t,n}function au(n){if("string"==typeof n||qu(n))return n;var t=n+"";return"0"==t&&1/n==-Y?"-0":t}function lu(n){if(null!=n){try{return Ri.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function su(n,t){return r(en,(function(r){var e="_."+r[0];t&r[1]&&!o(n,e)&&n.push(e)})),n.sort()}function hu(n){if(n instanceof pt)return n.clone();var t=new ht(n.__wrapped__,n.__chain__);return t.__actions__=le(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function pu(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:Vu(r);return u<0&&(u=uo(e+u,0)),v(n,Pe(t,3),u)}function _u(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e-1;return r!==N&&(u=Vu(r),u=r<0?uo(e+u,0):io(u,e-1)),v(n,Pe(t,3),u,!0)}function vu(n){return null!=n&&n.length?$t(n,1):[]}function gu(n){return n&&n.length?n[0]:N}function yu(n){var t=null==n?0:n.length;return t?n[t-1]:N}function du(n,t){return n&&n.length&&t&&t.length?Sr(n,t):n}function bu(n){return null==n?n:ao.call(n)}function wu(n){if(!n||!n.length)return[];var t=0;return n=i(n,(function(n){if(Cu(n))return t=uo(n.length,t),!0})),A(t,(function(t){return c(n,w(t))}))}function mu(t,r){if(!t||!t.length)return[];var e=wu(t);return null==r?e:c(e,(function(t){return n(r,N,t)}))}function xu(n){var t=Qn(n);return t.__chain__=!0,t}function ju(n,t){return t(n)}function Au(n,t){return(Sf(n)?r:Ro)(n,Pe(t,3))}function ku(n,t){return(Sf(n)?e:zo)(n,Pe(t,3))}function Ou(n,t){return(Sf(n)?c:Ar)(n,Pe(t,3))}function Iu(n,t,r){return t=r?N:t,t=n&&null==t?n.length:t,Le(n,H,N,N,N,N,t)}function Ru(n,t){var r;if("function"!=typeof t)throw new ji(P);return n=Vu(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=N),r}}function zu(n,t,r){function e(t){var r=c,e=a;return c=a=N,_=t,s=n.apply(e,r)}function u(n){var r=n-p;return p===N||r>=t||r<0||g&&n-_>=l}function i(){var n=bf();return u(n)?o(n):(h=Po(i,function(n){var r=t-(n-p);return g?io(r,l-(n-_)):r}(n)),N)}function o(n){return h=N,y&&c?e(n):(c=a=N,s)}function f(){var n=bf(),r=u(n);if(c=arguments,a=this,p=n,r){if(h===N)return function(n){return _=n,h=Po(i,t),v?e(n):s}(p);if(g)return Uo(h),h=Po(i,t),e(p)}return h===N&&(h=Po(i,t)),s}var c,a,l,s,h,p,_=0,v=!1,g=!1,y=!0;if("function"!=typeof n)throw new ji(P);return t=Hu(t)||0,Du(r)&&(v=!!r.leading,l=(g="maxWait"in r)?uo(Hu(r.maxWait)||0,t):l,y="trailing"in r?!!r.trailing:y),f.cancel=function(){h!==N&&Uo(h),_=0,c=p=a=h=N},f.flush=function(){return h===N?s:o(bf())},f}function Eu(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new ji(P);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Eu.Cache||gt),r}function Su(n){if("function"!=typeof n)throw new ji(P);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function Wu(n,t){return n===t||n!=n&&t!=t}function Lu(n){return null!=n&&$u(n.length)&&!Bu(n)}function Cu(n){return Mu(n)&&Lu(n)}function Uu(n){if(!Mu(n))return!1;var t=Kt(n);return t==an||"[object DOMException]"==t||"string"==typeof n.message&&"string"==typeof n.name&&!Nu(n)}function Bu(n){if(!Du(n))return!1;var t=Kt(n);return t==ln||t==sn||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Tu(n){return"number"==typeof n&&n==Vu(n)}function $u(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=Q}function Du(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function Mu(n){return null!=n&&"object"==typeof n}function Fu(n){return"number"==typeof n||Mu(n)&&Kt(n)==pn}function Nu(n){if(!Mu(n)||Kt(n)!=_n)return!1;var t=Mi(n);if(null===t)return!0;var r=zi.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ri.call(r)==Li}function Pu(n){return"string"==typeof n||!Sf(n)&&Mu(n)&&Kt(n)==dn}function qu(n){return"symbol"==typeof n||Mu(n)&&Kt(n)==bn}function Zu(n){if(!n)return[];if(Lu(n))return Pu(n)?D(n):le(n);if(Zi&&n[Zi])return function(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}(n[Zi]());var t=Mo(n);return(t==hn?C:t==yn?T:ei)(n)}function Ku(n){return n?(n=Hu(n))===Y||n===-Y?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function Vu(n){var t=Ku(n),r=t%1;return t==t?r?t-r:t:0}function Gu(n){return n?Et(Vu(n),0,nn):0}function Hu(n){if("number"==typeof n)return n;if(qu(n))return X;if(Du(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=Du(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=k(n);var r=ut.test(n);return r||ot.test(n)?Xt(n.slice(2),r?2:8):et.test(n)?X:+n}function Ju(n){return se(n,ti(n))}function Yu(n){return null==n?"":Kr(n)}function Qu(n,t,r){var e=null==n?N:qt(n,t);return e===N?r:e}function Xu(n,t){return null!=n&&Ve(n,t,tr)}function ni(n){return Lu(n)?bt(n):mr(n)}function ti(n){return Lu(n)?bt(n,!0):xr(n)}function ri(n,t){if(null==n)return{};var r=c(Me(n),(function(n){return[n]}));return t=Pe(t),Er(n,r,(function(n,r){return t(n,r[0])}))}function ei(n){return null==n?[]:I(n,ni(n))}function ui(n){return lc(Yu(n).toLowerCase())}function ii(n){return(n=Yu(n))&&n.replace(ct,vr).replace(Nt,"")}function oi(n,t,r){return n=Yu(n),(t=r?N:t)===N?L(n)?F(n):p(n):n.match(t)||[]}function fi(n){return function(){return n}}function ci(n){return n}function ai(n){return wr("function"==typeof n?n:St(n,1))}function li(n,t,e){var u=ni(t),i=Pt(t,u);null!=e||Du(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=Pt(t,ni(t)));var o=!(Du(e)&&"chain"in e&&!e.chain),f=Bu(n);return r(i,(function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=le(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})})),n}function si(){}function hi(n){return Qe(n)?w(au(n)):function(n){return function(t){return qt(t,n)}}(n)}function pi(){return[]}function _i(){return!1}var vi=(Gn=null==Gn?rr:dr.defaults(rr.Object(),Gn,dr.pick(rr,Vt))).Array,gi=Gn.Date,yi=Gn.Error,di=Gn.Function,bi=Gn.Math,wi=Gn.Object,mi=Gn.RegExp,xi=Gn.String,ji=Gn.TypeError,Ai=vi.prototype,ki=di.prototype,Oi=wi.prototype,Ii=Gn["__core-js_shared__"],Ri=ki.toString,zi=Oi.hasOwnProperty,Ei=0,Si=function(){var n=/[^.]+$/.exec(Ii&&Ii.keys&&Ii.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),Wi=Oi.toString,Li=Ri.call(wi),Ci=rr._,Ui=mi("^"+Ri.call(zi).replace(Zn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Bi=ir?Gn.Buffer:N,Ti=Gn.Symbol,$i=Gn.Uint8Array,Di=Bi?Bi.allocUnsafe:N,Mi=U(wi.getPrototypeOf,wi),Fi=wi.create,Ni=Oi.propertyIsEnumerable,Pi=Ai.splice,qi=Ti?Ti.isConcatSpreadable:N,Zi=Ti?Ti.iterator:N,Ki=Ti?Ti.toStringTag:N,Vi=function(){try{var n=Ke(wi,"defineProperty");return n({},"",{}),n}catch(n){}}(),Gi=Gn.clearTimeout!==rr.clearTimeout&&Gn.clearTimeout,Hi=gi&&gi.now!==rr.Date.now&&gi.now,Ji=Gn.setTimeout!==rr.setTimeout&&Gn.setTimeout,Yi=bi.ceil,Qi=bi.floor,Xi=wi.getOwnPropertySymbols,no=Bi?Bi.isBuffer:N,to=Gn.isFinite,ro=Ai.join,eo=U(wi.keys,wi),uo=bi.max,io=bi.min,oo=gi.now,fo=Gn.parseInt,co=bi.random,ao=Ai.reverse,lo=Ke(Gn,"DataView"),so=Ke(Gn,"Map"),ho=Ke(Gn,"Promise"),po=Ke(Gn,"Set"),_o=Ke(Gn,"WeakMap"),vo=Ke(wi,"create"),go=_o&&new _o,yo={},bo=lu(lo),wo=lu(so),mo=lu(ho),xo=lu(po),jo=lu(_o),Ao=Ti?Ti.prototype:N,ko=Ao?Ao.valueOf:N,Oo=Ao?Ao.toString:N,Io=function(){function n(){}return function(t){if(!Du(t))return{};if(Fi)return Fi(t);n.prototype=t;var r=new n;return n.prototype=N,r}}();Qn.templateSettings={escape:Dn,evaluate:Mn,interpolate:Fn,variable:"",imports:{_:Qn}},Qn.prototype=st.prototype,Qn.prototype.constructor=Qn,ht.prototype=Io(st.prototype),ht.prototype.constructor=ht,pt.prototype=Io(st.prototype),pt.prototype.constructor=pt,_t.prototype.clear=function(){this.__data__=vo?vo(null):{},this.size=0},_t.prototype.delete=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t},_t.prototype.get=function(n){var t=this.__data__;if(vo){var r=t[n];return r===q?N:r}return zi.call(t,n)?t[n]:N},_t.prototype.has=function(n){var t=this.__data__;return vo?t[n]!==N:zi.call(t,n)},_t.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=vo&&t===N?q:t,this},vt.prototype.clear=function(){this.__data__=[],this.size=0},vt.prototype.delete=function(n){var t=this.__data__,r=kt(t,n);return!(r<0||(r==t.length-1?t.pop():Pi.call(t,r,1),--this.size,0))},vt.prototype.get=function(n){var t=this.__data__,r=kt(t,n);return r<0?N:t[r][1]},vt.prototype.has=function(n){return kt(this.__data__,n)>-1},vt.prototype.set=function(n,t){var r=this.__data__,e=kt(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this},gt.prototype.clear=function(){this.size=0,this.__data__={hash:new _t,map:new(so||vt),string:new _t}},gt.prototype.delete=function(n){var t=qe(this,n).delete(n);return this.size-=t?1:0,t},gt.prototype.get=function(n){return qe(this,n).get(n)},gt.prototype.has=function(n){return qe(this,n).has(n)},gt.prototype.set=function(n,t){var r=qe(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},yt.prototype.add=yt.prototype.push=function(n){return this.__data__.set(n,q),this},yt.prototype.has=function(n){return this.__data__.has(n)},dt.prototype.clear=function(){this.__data__=new vt,this.size=0},dt.prototype.delete=function(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r},dt.prototype.get=function(n){return this.__data__.get(n)},dt.prototype.has=function(n){return this.__data__.has(n)},dt.prototype.set=function(n,t){var r=this.__data__;if(r instanceof vt){var e=r.__data__;if(!so||e.length<199)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new gt(e)}return r.set(n,t),this.size=r.size,this};var Ro=_e(Dt),zo=_e(Mt,!0),Eo=ve(),So=ve(!0),Wo=go?function(n,t){return go.set(n,t),n}:ci,Lo=Vi?function(n,t){return Vi(n,"toString",{configurable:!0,enumerable:!1,value:fi(t),writable:!0})}:ci,Co=Ur,Uo=Gi||function(n){return rr.clearTimeout(n)},Bo=po&&1/T(new po([,-0]))[1]==Y?function(n){return new po(n)}:si,To=go?function(n){return go.get(n)}:si,$o=Xi?function(n){return null==n?[]:(n=wi(n),i(Xi(n),(function(t){return Ni.call(n,t)})))}:pi,Do=Xi?function(n){for(var t=[];n;)a(t,$o(n)),n=Mi(n);return t}:pi,Mo=Kt;(lo&&Mo(new lo(new ArrayBuffer(1)))!=xn||so&&Mo(new so)!=hn||ho&&Mo(ho.resolve())!=vn||po&&Mo(new po)!=yn||_o&&Mo(new _o)!=wn)&&(Mo=function(n){var t=Kt(n),r=t==_n?n.constructor:N,e=r?lu(r):"";if(e)switch(e){case bo:return xn;case wo:return hn;case mo:return vn;case xo:return yn;case jo:return wn}return t});var Fo=Ii?Bu:_i,No=fu(Wo),Po=Ji||function(n,t){return rr.setTimeout(n,t)},qo=fu(Lo),Zo=function(n){var t=Eu(n,(function(n){return 500===r.size&&r.clear(),n})),r=t.cache;return t}((function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(qn,(function(n,r,e,u){t.push(e?u.replace(nt,"$1"):r||n)})),t})),Ko=Ur((function(n,t){return Cu(n)?Ct(n,$t(t,1,Cu,!0)):[]})),Vo=Ur((function(n,t){var r=yu(t);return Cu(r)&&(r=N),Cu(n)?Ct(n,$t(t,1,Cu,!0),Pe(r,2)):[]})),Go=Ur((function(n,t){var r=yu(t);return Cu(r)&&(r=N),Cu(n)?Ct(n,$t(t,1,Cu,!0),N,r):[]})),Ho=Ur((function(n){var t=c(n,ne);return t.length&&t[0]===n[0]?er(t):[]})),Jo=Ur((function(n){var t=yu(n),r=c(n,ne);return t===yu(r)?t=N:r.pop(),r.length&&r[0]===n[0]?er(r,Pe(t,2)):[]})),Yo=Ur((function(n){var t=yu(n),r=c(n,ne);return(t="function"==typeof t?t:N)&&r.pop(),r.length&&r[0]===n[0]?er(r,N,t):[]})),Qo=Ur(du),Xo=$e((function(n,t){var r=null==n?0:n.length,e=zt(n,t);return Wr(n,c(t,(function(n){return Je(n,r)?+n:n})).sort(fe)),e})),nf=Ur((function(n){return Vr($t(n,1,Cu,!0))})),tf=Ur((function(n){var t=yu(n);return Cu(t)&&(t=N),Vr($t(n,1,Cu,!0),Pe(t,2))})),rf=Ur((function(n){var t=yu(n);return t="function"==typeof t?t:N,Vr($t(n,1,Cu,!0),N,t)})),ef=Ur((function(n,t){return Cu(n)?Ct(n,t):[]})),uf=Ur((function(n){return Qr(i(n,Cu))})),of=Ur((function(n){var t=yu(n);return Cu(t)&&(t=N),Qr(i(n,Cu),Pe(t,2))})),ff=Ur((function(n){var t=yu(n);return t="function"==typeof t?t:N,Qr(i(n,Cu),N,t)})),cf=Ur(wu),af=Ur((function(n){var t=n.length,r=t>1?n[t-1]:N;return r="function"==typeof r?(n.pop(),r):N,mu(n,r)})),lf=$e((function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return zt(t,n)};return!(t>1||this.__actions__.length)&&e instanceof pt&&Je(r)?((e=e.slice(r,+r+(t?1:0))).__actions__.push({func:ju,args:[u],thisArg:N}),new ht(e,this.__chain__).thru((function(n){return t&&!n.length&&n.push(N),n}))):this.thru(u)})),sf=he((function(n,t,r){zi.call(n,r)?++n[r]:Rt(n,r,1)})),hf=we(pu),pf=we(_u),_f=he((function(n,t,r){zi.call(n,r)?n[r].push(t):Rt(n,r,[t])})),vf=Ur((function(t,r,e){var u=-1,i="function"==typeof r,o=Lu(t)?vi(t.length):[];return Ro(t,(function(t){o[++u]=i?n(r,t,e):ur(t,r,e)})),o})),gf=he((function(n,t,r){Rt(n,r,t)})),yf=he((function(n,t,r){n[r?0:1].push(t)}),(function(){return[[],[]]})),df=Ur((function(n,t){if(null==n)return[];var r=t.length;return r>1&&Ye(n,t[0],t[1])?t=[]:r>2&&Ye(t[0],t[1],t[2])&&(t=[t[0]]),zr(n,$t(t,1),[])})),bf=Hi||function(){return rr.Date.now()},wf=Ur((function(n,t,r){var e=1;if(r.length){var u=B(r,Ne(wf));e|=V}return Le(n,e,t,r,u)})),mf=Ur((function(n,t,r){var e=3;if(r.length){var u=B(r,Ne(mf));e|=V}return Le(t,e,n,r,u)})),xf=Ur((function(n,t){return Lt(n,1,t)})),jf=Ur((function(n,t,r){return Lt(n,Hu(t)||0,r)}));Eu.Cache=gt;var Af=Co((function(t,r){var e=(r=1==r.length&&Sf(r[0])?c(r[0],O(Pe())):c($t(r,1),O(Pe()))).length;return Ur((function(u){for(var i=-1,o=io(u.length,e);++i<o;)u[i]=r[i].call(this,u[i]);return n(t,this,u)}))})),kf=Ur((function(n,t){return Le(n,V,N,t,B(t,Ne(kf)))})),Of=Ur((function(n,t){return Le(n,G,N,t,B(t,Ne(Of)))})),If=$e((function(n,t){return Le(n,J,N,N,N,t)})),Rf=ze(Yt),zf=ze((function(n,t){return n>=t})),Ef=or(function(){return arguments}())?or:function(n){return Mu(n)&&zi.call(n,"callee")&&!Ni.call(n,"callee")},Sf=vi.isArray,Wf=cr?O(cr):function(n){return Mu(n)&&Kt(n)==mn},Lf=no||_i,Cf=ar?O(ar):function(n){return Mu(n)&&Kt(n)==cn},Uf=lr?O(lr):function(n){return Mu(n)&&Mo(n)==hn},Bf=sr?O(sr):function(n){return Mu(n)&&Kt(n)==gn},Tf=hr?O(hr):function(n){return Mu(n)&&Mo(n)==yn},$f=pr?O(pr):function(n){return Mu(n)&&$u(n.length)&&!!Ht[Kt(n)]},Df=ze(jr),Mf=ze((function(n,t){return n<=t})),Ff=pe((function(n,t){if(nu(t)||Lu(t))return se(t,ni(t),n),N;for(var r in t)zi.call(t,r)&&At(n,r,t[r])})),Nf=pe((function(n,t){se(t,ti(t),n)})),Pf=pe((function(n,t,r,e){se(t,ti(t),n,e)})),qf=pe((function(n,t,r,e){se(t,ni(t),n,e)})),Zf=$e(zt),Kf=Ur((function(n,t){n=wi(n);var r=-1,e=t.length,u=e>2?t[2]:N;for(u&&Ye(t[0],t[1],u)&&(e=1);++r<e;)for(var i=t[r],o=ti(i),f=-1,c=o.length;++f<c;){var a=o[f],l=n[a];(l===N||Wu(l,Oi[a])&&!zi.call(n,a))&&(n[a]=i[a])}return n})),Vf=Ur((function(t){return t.push(N,Ue),n(Qf,N,t)})),Gf=je((function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=Wi.call(t)),n[t]=r}),fi(ci)),Hf=je((function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=Wi.call(t)),zi.call(n,t)?n[t].push(r):n[t]=[r]}),Pe),Jf=Ur(ur),Yf=pe((function(n,t,r){Ir(n,t,r)})),Qf=pe((function(n,t,r,e){Ir(n,t,r,e)})),Xf=$e((function(n,t){var r={};if(null==n)return r;var e=!1;t=c(t,(function(t){return t=re(t,n),e||(e=t.length>1),t})),se(n,Me(n),r),e&&(r=St(r,7,Be));for(var u=t.length;u--;)Gr(r,t[u]);return r})),nc=$e((function(n,t){return null==n?{}:function(n,t){return Er(n,t,(function(t,r){return Xu(n,r)}))}(n,t)})),tc=We(ni),rc=We(ti),ec=ye((function(n,t,r){return t=t.toLowerCase(),n+(r?ui(t):t)})),uc=ye((function(n,t,r){return n+(r?"-":"")+t.toLowerCase()})),ic=ye((function(n,t,r){return n+(r?" ":"")+t.toLowerCase()})),oc=ge("toLowerCase"),fc=ye((function(n,t,r){return n+(r?"_":"")+t.toLowerCase()})),cc=ye((function(n,t,r){return n+(r?" ":"")+lc(t)})),ac=ye((function(n,t,r){return n+(r?" ":"")+t.toUpperCase()})),lc=ge("toUpperCase"),sc=Ur((function(t,r){try{return n(t,N,r)}catch(n){return Uu(n)?n:new yi(n)}})),hc=$e((function(n,t){return r(t,(function(t){t=au(t),Rt(n,t,wf(n[t],n))})),n})),pc=me(),_c=me(!0),vc=Ur((function(n,t){return function(r){return ur(r,n,t)}})),gc=Ur((function(n,t){return function(r){return ur(n,r,t)}})),yc=ke(c),dc=ke(u),bc=ke(h),wc=Re(),mc=Re(!0),xc=Ae((function(n,t){return n+t}),0),jc=Se("ceil"),Ac=Ae((function(n,t){return n/t}),1),kc=Se("floor"),Oc=Ae((function(n,t){return n*t}),1),Ic=Se("round"),Rc=Ae((function(n,t){return n-t}),0);return Qn.after=function(n,t){if("function"!=typeof t)throw new ji(P);return n=Vu(n),function(){if(--n<1)return t.apply(this,arguments)}},Qn.ary=Iu,Qn.assign=Ff,Qn.assignIn=Nf,Qn.assignInWith=Pf,Qn.assignWith=qf,Qn.at=Zf,Qn.before=Ru,Qn.bind=wf,Qn.bindAll=hc,Qn.bindKey=mf,Qn.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Sf(n)?n:[n]},Qn.chain=xu,Qn.chunk=function(n,t,r){t=(r?Ye(n,t,r):t===N)?1:uo(Vu(t),0);var e=null==n?0:n.length;if(!e||t<1)return[];for(var u=0,i=0,o=vi(Yi(e/t));u<e;)o[i++]=Mr(n,u,u+=t);return o},Qn.compact=function(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u},Qn.concat=function(){var n=arguments.length;if(!n)return[];for(var t=vi(n-1),r=arguments[0],e=n;e--;)t[e-1]=arguments[e];return a(Sf(r)?le(r):[r],$t(t,1))},Qn.cond=function(t){var r=null==t?0:t.length,e=Pe();return t=r?c(t,(function(n){if("function"!=typeof n[1])throw new ji(P);return[e(n[0]),n[1]]})):[],Ur((function(e){for(var u=-1;++u<r;){var i=t[u];if(n(i[0],this,e))return n(i[1],this,e)}}))},Qn.conforms=function(n){return function(n){var t=ni(n);return function(r){return Wt(r,n,t)}}(St(n,1))},Qn.constant=fi,Qn.countBy=sf,Qn.create=function(n,t){var r=Io(n);return null==t?r:It(r,t)},Qn.curry=function n(t,r,e){var u=Le(t,8,N,N,N,N,N,r=e?N:r);return u.placeholder=n.placeholder,u},Qn.curryRight=function n(t,r,e){var u=Le(t,K,N,N,N,N,N,r=e?N:r);return u.placeholder=n.placeholder,u},Qn.debounce=zu,Qn.defaults=Kf,Qn.defaultsDeep=Vf,Qn.defer=xf,Qn.delay=jf,Qn.difference=Ko,Qn.differenceBy=Vo,Qn.differenceWith=Go,Qn.drop=function(n,t,r){var e=null==n?0:n.length;return e?Mr(n,(t=r||t===N?1:Vu(t))<0?0:t,e):[]},Qn.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?Mr(n,0,(t=e-(t=r||t===N?1:Vu(t)))<0?0:t):[]},Qn.dropRightWhile=function(n,t){return n&&n.length?Jr(n,Pe(t,3),!0,!0):[]},Qn.dropWhile=function(n,t){return n&&n.length?Jr(n,Pe(t,3),!0):[]},Qn.fill=function(n,t,r,e){var u=null==n?0:n.length;return u?(r&&"number"!=typeof r&&Ye(n,t,r)&&(r=0,e=u),function(n,t,r,e){var u=n.length;for((r=Vu(r))<0&&(r=-r>u?0:u+r),(e=e===N||e>u?u:Vu(e))<0&&(e+=u),e=r>e?0:Gu(e);r<e;)n[r++]=t;return n}(n,t,r,e)):[]},Qn.filter=function(n,t){return(Sf(n)?i:Tt)(n,Pe(t,3))},Qn.flatMap=function(n,t){return $t(Ou(n,t),1)},Qn.flatMapDeep=function(n,t){return $t(Ou(n,t),Y)},Qn.flatMapDepth=function(n,t,r){return r=r===N?1:Vu(r),$t(Ou(n,t),r)},Qn.flatten=vu,Qn.flattenDeep=function(n){return null!=n&&n.length?$t(n,Y):[]},Qn.flattenDepth=function(n,t){return null!=n&&n.length?$t(n,t=t===N?1:Vu(t)):[]},Qn.flip=function(n){return Le(n,512)},Qn.flow=pc,Qn.flowRight=_c,Qn.fromPairs=function(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e},Qn.functions=function(n){return null==n?[]:Pt(n,ni(n))},Qn.functionsIn=function(n){return null==n?[]:Pt(n,ti(n))},Qn.groupBy=_f,Qn.initial=function(n){return null!=n&&n.length?Mr(n,0,-1):[]},Qn.intersection=Ho,Qn.intersectionBy=Jo,Qn.intersectionWith=Yo,Qn.invert=Gf,Qn.invertBy=Hf,Qn.invokeMap=vf,Qn.iteratee=ai,Qn.keyBy=gf,Qn.keys=ni,Qn.keysIn=ti,Qn.map=Ou,Qn.mapKeys=function(n,t){var r={};return t=Pe(t,3),Dt(n,(function(n,e,u){Rt(r,t(n,e,u),n)})),r},Qn.mapValues=function(n,t){var r={};return t=Pe(t,3),Dt(n,(function(n,e,u){Rt(r,e,t(n,e,u))})),r},Qn.matches=function(n){return kr(St(n,1))},Qn.matchesProperty=function(n,t){return Or(n,St(t,1))},Qn.memoize=Eu,Qn.merge=Yf,Qn.mergeWith=Qf,Qn.method=vc,Qn.methodOf=gc,Qn.mixin=li,Qn.negate=Su,Qn.nthArg=function(n){return n=Vu(n),Ur((function(t){return Rr(t,n)}))},Qn.omit=Xf,Qn.omitBy=function(n,t){return ri(n,Su(Pe(t)))},Qn.once=function(n){return Ru(2,n)},Qn.orderBy=function(n,t,r,e){return null==n?[]:(Sf(t)||(t=null==t?[]:[t]),Sf(r=e?N:r)||(r=null==r?[]:[r]),zr(n,t,r))},Qn.over=yc,Qn.overArgs=Af,Qn.overEvery=dc,Qn.overSome=bc,Qn.partial=kf,Qn.partialRight=Of,Qn.partition=yf,Qn.pick=nc,Qn.pickBy=ri,Qn.property=hi,Qn.propertyOf=function(n){return function(t){return null==n?N:qt(n,t)}},Qn.pull=Qo,Qn.pullAll=du,Qn.pullAllBy=function(n,t,r){return n&&n.length&&t&&t.length?Sr(n,t,Pe(r,2)):n},Qn.pullAllWith=function(n,t,r){return n&&n.length&&t&&t.length?Sr(n,t,N,r):n},Qn.pullAt=Xo,Qn.range=wc,Qn.rangeRight=mc,Qn.rearg=If,Qn.reject=function(n,t){return(Sf(n)?i:Tt)(n,Su(Pe(t,3)))},Qn.remove=function(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=Pe(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return Wr(n,u),r},Qn.rest=function(n,t){if("function"!=typeof n)throw new ji(P);return Ur(n,t=t===N?t:Vu(t))},Qn.reverse=bu,Qn.sampleSize=function(n,t,r){return t=(r?Ye(n,t,r):t===N)?1:Vu(t),(Sf(n)?mt:Tr)(n,t)},Qn.set=function(n,t,r){return null==n?n:$r(n,t,r)},Qn.setWith=function(n,t,r,e){return e="function"==typeof e?e:N,null==n?n:$r(n,t,r,e)},Qn.shuffle=function(n){return(Sf(n)?xt:Dr)(n)},Qn.slice=function(n,t,r){var e=null==n?0:n.length;return e?(r&&"number"!=typeof r&&Ye(n,t,r)?(t=0,r=e):(t=null==t?0:Vu(t),r=r===N?e:Vu(r)),Mr(n,t,r)):[]},Qn.sortBy=df,Qn.sortedUniq=function(n){return n&&n.length?qr(n):[]},Qn.sortedUniqBy=function(n,t){return n&&n.length?qr(n,Pe(t,2)):[]},Qn.split=function(n,t,r){return r&&"number"!=typeof r&&Ye(n,t,r)&&(t=r=N),(r=r===N?nn:r>>>0)?(n=Yu(n))&&("string"==typeof t||null!=t&&!Bf(t))&&(!(t=Kr(t))&&W(n))?ee(D(n),0,r):n.split(t,r):[]},Qn.spread=function(t,r){if("function"!=typeof t)throw new ji(P);return r=null==r?0:uo(Vu(r),0),Ur((function(e){var u=e[r],i=ee(e,0,r);return u&&a(i,u),n(t,this,i)}))},Qn.tail=function(n){var t=null==n?0:n.length;return t?Mr(n,1,t):[]},Qn.take=function(n,t,r){return n&&n.length?Mr(n,0,(t=r||t===N?1:Vu(t))<0?0:t):[]},Qn.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?Mr(n,(t=e-(t=r||t===N?1:Vu(t)))<0?0:t,e):[]},Qn.takeRightWhile=function(n,t){return n&&n.length?Jr(n,Pe(t,3),!1,!0):[]},Qn.takeWhile=function(n,t){return n&&n.length?Jr(n,Pe(t,3)):[]},Qn.tap=function(n,t){return t(n),n},Qn.throttle=function(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new ji(P);return Du(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),zu(n,t,{leading:e,maxWait:t,trailing:u})},Qn.thru=ju,Qn.toArray=Zu,Qn.toPairs=tc,Qn.toPairsIn=rc,Qn.toPath=function(n){return Sf(n)?c(n,au):qu(n)?[n]:le(Zo(Yu(n)))},Qn.toPlainObject=Ju,Qn.transform=function(n,t,e){var u=Sf(n),i=u||Lf(n)||$f(n);if(t=Pe(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:Du(n)&&Bu(o)?Io(Mi(n)):{}}return(i?r:Dt)(n,(function(n,r,u){return t(e,n,r,u)})),e},Qn.unary=function(n){return Iu(n,1)},Qn.union=nf,Qn.unionBy=tf,Qn.unionWith=rf,Qn.uniq=function(n){return n&&n.length?Vr(n):[]},Qn.uniqBy=function(n,t){return n&&n.length?Vr(n,Pe(t,2)):[]},Qn.uniqWith=function(n,t){return t="function"==typeof t?t:N,n&&n.length?Vr(n,N,t):[]},Qn.unset=function(n,t){return null==n||Gr(n,t)},Qn.unzip=wu,Qn.unzipWith=mu,Qn.update=function(n,t,r){return null==n?n:Hr(n,t,te(r))},Qn.updateWith=function(n,t,r,e){return e="function"==typeof e?e:N,null==n?n:Hr(n,t,te(r),e)},Qn.values=ei,Qn.valuesIn=function(n){return null==n?[]:I(n,ti(n))},Qn.without=ef,Qn.words=oi,Qn.wrap=function(n,t){return kf(te(t),n)},Qn.xor=uf,Qn.xorBy=of,Qn.xorWith=ff,Qn.zip=cf,Qn.zipObject=function(n,t){return Xr(n||[],t||[],At)},Qn.zipObjectDeep=function(n,t){return Xr(n||[],t||[],$r)},Qn.zipWith=af,Qn.entries=tc,Qn.entriesIn=rc,Qn.extend=Nf,Qn.extendWith=Pf,li(Qn,Qn),Qn.add=xc,Qn.attempt=sc,Qn.camelCase=ec,Qn.capitalize=ui,Qn.ceil=jc,Qn.clamp=function(n,t,r){return r===N&&(r=t,t=N),r!==N&&(r=(r=Hu(r))==r?r:0),t!==N&&(t=(t=Hu(t))==t?t:0),Et(Hu(n),t,r)},Qn.clone=function(n){return St(n,4)},Qn.cloneDeep=function(n){return St(n,5)},Qn.cloneDeepWith=function(n,t){return St(n,5,t="function"==typeof t?t:N)},Qn.cloneWith=function(n,t){return St(n,4,t="function"==typeof t?t:N)},Qn.conformsTo=function(n,t){return null==t||Wt(n,t,ni(t))},Qn.deburr=ii,Qn.defaultTo=function(n,t){return null==n||n!=n?t:n},Qn.divide=Ac,Qn.endsWith=function(n,t,r){n=Yu(n),t=Kr(t);var e=n.length,u=r=r===N?e:Et(Vu(r),0,e);return(r-=t.length)>=0&&n.slice(r,u)==t},Qn.eq=Wu,Qn.escape=function(n){return(n=Yu(n))&&$n.test(n)?n.replace(Bn,gr):n},Qn.escapeRegExp=function(n){return(n=Yu(n))&&Kn.test(n)?n.replace(Zn,"\\$&"):n},Qn.every=function(n,t,r){var e=Sf(n)?u:Ut;return r&&Ye(n,t,r)&&(t=N),e(n,Pe(t,3))},Qn.find=hf,Qn.findIndex=pu,Qn.findKey=function(n,t){return _(n,Pe(t,3),Dt)},Qn.findLast=pf,Qn.findLastIndex=_u,Qn.findLastKey=function(n,t){return _(n,Pe(t,3),Mt)},Qn.floor=kc,Qn.forEach=Au,Qn.forEachRight=ku,Qn.forIn=function(n,t){return null==n?n:Eo(n,Pe(t,3),ti)},Qn.forInRight=function(n,t){return null==n?n:So(n,Pe(t,3),ti)},Qn.forOwn=function(n,t){return n&&Dt(n,Pe(t,3))},Qn.forOwnRight=function(n,t){return n&&Mt(n,Pe(t,3))},Qn.get=Qu,Qn.gt=Rf,Qn.gte=zf,Qn.has=function(n,t){return null!=n&&Ve(n,t,nr)},Qn.hasIn=Xu,Qn.head=gu,Qn.identity=ci,Qn.includes=function(n,t,r,e){n=Lu(n)?n:ei(n),r=r&&!e?Vu(r):0;var u=n.length;return r<0&&(r=uo(u+r,0)),Pu(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&g(n,t,r)>-1},Qn.indexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:Vu(r);return u<0&&(u=uo(e+u,0)),g(n,t,u)},Qn.inRange=function(n,t,r){return t=Ku(t),r===N?(r=t,t=0):r=Ku(r),function(n,t,r){return n>=io(t,r)&&n<uo(t,r)}(n=Hu(n),t,r)},Qn.invoke=Jf,Qn.isArguments=Ef,Qn.isArray=Sf,Qn.isArrayBuffer=Wf,Qn.isArrayLike=Lu,Qn.isArrayLikeObject=Cu,Qn.isBoolean=function(n){return!0===n||!1===n||Mu(n)&&Kt(n)==fn},Qn.isBuffer=Lf,Qn.isDate=Cf,Qn.isElement=function(n){return Mu(n)&&1===n.nodeType&&!Nu(n)},Qn.isEmpty=function(n){if(null==n)return!0;if(Lu(n)&&(Sf(n)||"string"==typeof n||"function"==typeof n.splice||Lf(n)||$f(n)||Ef(n)))return!n.length;var t=Mo(n);if(t==hn||t==yn)return!n.size;if(nu(n))return!mr(n).length;for(var r in n)if(zi.call(n,r))return!1;return!0},Qn.isEqual=function(n,t){return fr(n,t)},Qn.isEqualWith=function(n,t,r){var e=(r="function"==typeof r?r:N)?r(n,t):N;return e===N?fr(n,t,N,r):!!e},Qn.isError=Uu,Qn.isFinite=function(n){return"number"==typeof n&&to(n)},Qn.isFunction=Bu,Qn.isInteger=Tu,Qn.isLength=$u,Qn.isMap=Uf,Qn.isMatch=function(n,t){return n===t||_r(n,t,Ze(t))},Qn.isMatchWith=function(n,t,r){return r="function"==typeof r?r:N,_r(n,t,Ze(t),r)},Qn.isNaN=function(n){return Fu(n)&&n!=+n},Qn.isNative=function(n){if(Fo(n))throw new yi("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return br(n)},Qn.isNil=function(n){return null==n},Qn.isNull=function(n){return null===n},Qn.isNumber=Fu,Qn.isObject=Du,Qn.isObjectLike=Mu,Qn.isPlainObject=Nu,Qn.isRegExp=Bf,Qn.isSafeInteger=function(n){return Tu(n)&&n>=-Q&&n<=Q},Qn.isSet=Tf,Qn.isString=Pu,Qn.isSymbol=qu,Qn.isTypedArray=$f,Qn.isUndefined=function(n){return n===N},Qn.isWeakMap=function(n){return Mu(n)&&Mo(n)==wn},Qn.isWeakSet=function(n){return Mu(n)&&"[object WeakSet]"==Kt(n)},Qn.join=function(n,t){return null==n?"":ro.call(n,t)},Qn.kebabCase=uc,Qn.last=yu,Qn.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=e;return r!==N&&(u=(u=Vu(r))<0?uo(e+u,0):io(u,e-1)),t==t?function(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}(n,t,u):v(n,d,u,!0)},Qn.lowerCase=ic,Qn.lowerFirst=oc,Qn.lt=Df,Qn.lte=Mf,Qn.max=function(n){return n&&n.length?Bt(n,ci,Yt):N},Qn.maxBy=function(n,t){return n&&n.length?Bt(n,Pe(t,2),Yt):N},Qn.mean=function(n){return b(n,ci)},Qn.meanBy=function(n,t){return b(n,Pe(t,2))},Qn.min=function(n){return n&&n.length?Bt(n,ci,jr):N},Qn.minBy=function(n,t){return n&&n.length?Bt(n,Pe(t,2),jr):N},Qn.stubArray=pi,Qn.stubFalse=_i,Qn.stubObject=function(){return{}},Qn.stubString=function(){return""},Qn.stubTrue=function(){return!0},Qn.multiply=Oc,Qn.nth=function(n,t){return n&&n.length?Rr(n,Vu(t)):N},Qn.noConflict=function(){return rr._===this&&(rr._=Ci),this},Qn.noop=si,Qn.now=bf,Qn.pad=function(n,t,r){n=Yu(n);var e=(t=Vu(t))?$(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return Oe(Qi(u),r)+n+Oe(Yi(u),r)},Qn.padEnd=function(n,t,r){n=Yu(n);var e=(t=Vu(t))?$(n):0;return t&&e<t?n+Oe(t-e,r):n},Qn.padStart=function(n,t,r){n=Yu(n);var e=(t=Vu(t))?$(n):0;return t&&e<t?Oe(t-e,r)+n:n},Qn.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),fo(Yu(n).replace(Vn,""),t||0)},Qn.random=function(n,t,r){if(r&&"boolean"!=typeof r&&Ye(n,t,r)&&(t=r=N),r===N&&("boolean"==typeof t?(r=t,t=N):"boolean"==typeof n&&(r=n,n=N)),n===N&&t===N?(n=0,t=1):(n=Ku(n),t===N?(t=n,n=0):t=Ku(t)),n>t){var e=n;n=t,t=e}if(r||n%1||t%1){var u=co();return io(n+u*(t-n+Qt("1e-"+((u+"").length-1))),t)}return Lr(n,t)},Qn.reduce=function(n,t,r){var e=Sf(n)?l:x,u=arguments.length<3;return e(n,Pe(t,4),r,u,Ro)},Qn.reduceRight=function(n,t,r){var e=Sf(n)?s:x,u=arguments.length<3;return e(n,Pe(t,4),r,u,zo)},Qn.repeat=function(n,t,r){return t=(r?Ye(n,t,r):t===N)?1:Vu(t),Cr(Yu(n),t)},Qn.replace=function(){var n=arguments,t=Yu(n[0]);return n.length<3?t:t.replace(n[1],n[2])},Qn.result=function(n,t,r){var e=-1,u=(t=re(t,n)).length;for(u||(u=1,n=N);++e<u;){var i=null==n?N:n[au(t[e])];i===N&&(e=u,i=r),n=Bu(i)?i.call(n):i}return n},Qn.round=Ic,Qn.runInContext=m,Qn.sample=function(n){return(Sf(n)?wt:Br)(n)},Qn.size=function(n){if(null==n)return 0;if(Lu(n))return Pu(n)?$(n):n.length;var t=Mo(n);return t==hn||t==yn?n.size:mr(n).length},Qn.snakeCase=fc,Qn.some=function(n,t,r){var e=Sf(n)?h:Fr;return r&&Ye(n,t,r)&&(t=N),e(n,Pe(t,3))},Qn.sortedIndex=function(n,t){return Nr(n,t)},Qn.sortedIndexBy=function(n,t,r){return Pr(n,t,Pe(r,2))},Qn.sortedIndexOf=function(n,t){var r=null==n?0:n.length;if(r){var e=Nr(n,t);if(e<r&&Wu(n[e],t))return e}return-1},Qn.sortedLastIndex=function(n,t){return Nr(n,t,!0)},Qn.sortedLastIndexBy=function(n,t,r){return Pr(n,t,Pe(r,2),!0)},Qn.sortedLastIndexOf=function(n,t){if(null!=n&&n.length){var r=Nr(n,t,!0)-1;if(Wu(n[r],t))return r}return-1},Qn.startCase=cc,Qn.startsWith=function(n,t,r){return n=Yu(n),r=null==r?0:Et(Vu(r),0,n.length),t=Kr(t),n.slice(r,r+t.length)==t},Qn.subtract=Rc,Qn.sum=function(n){return n&&n.length?j(n,ci):0},Qn.sumBy=function(n,t){return n&&n.length?j(n,Pe(t,2)):0},Qn.template=function(n,t,r){var e=Qn.templateSettings;r&&Ye(n,t,r)&&(t=N),n=Yu(n),t=Pf({},t,e,Ce);var u,i,o=Pf({},t.imports,e.imports,Ce),f=ni(o),c=I(o,f),a=0,l=t.interpolate||at,s="__p += '",h=mi((t.escape||at).source+"|"+l.source+"|"+(l===Fn?tt:at).source+"|"+(t.evaluate||at).source+"|$","g"),p="//# sourceURL="+(zi.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Gt+"]")+"\n";n.replace(h,(function(t,r,e,o,f,c){return e||(e=o),s+=n.slice(a,c).replace(lt,S),r&&(u=!0,s+="' +\n__e("+r+") +\n'"),f&&(i=!0,s+="';\n"+f+";\n__p += '"),e&&(s+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),a=c+t.length,t})),s+="';\n";var _=zi.call(t,"variable")&&t.variable;if(_){if(Xn.test(_))throw new yi("Invalid `variable` option passed into `_.template`")}else s="with (obj) {\n"+s+"\n}\n";s=(i?s.replace(Wn,""):s).replace(Ln,"$1").replace(Cn,"$1;"),s="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(i?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}";var v=sc((function(){return di(f,p+"return "+s).apply(N,c)}));if(v.source=s,Uu(v))throw v;return v},Qn.times=function(n,t){if((n=Vu(n))<1||n>Q)return[];var r=nn,e=io(n,nn);t=Pe(t),n-=nn;for(var u=A(e,t);++r<n;)t(r);return u},Qn.toFinite=Ku,Qn.toInteger=Vu,Qn.toLength=Gu,Qn.toLower=function(n){return Yu(n).toLowerCase()},Qn.toNumber=Hu,Qn.toSafeInteger=function(n){return n?Et(Vu(n),-Q,Q):0===n?n:0},Qn.toString=Yu,Qn.toUpper=function(n){return Yu(n).toUpperCase()},Qn.trim=function(n,t,r){if((n=Yu(n))&&(r||t===N))return k(n);if(!n||!(t=Kr(t)))return n;var e=D(n),u=D(t);return ee(e,z(e,u),E(e,u)+1).join("")},Qn.trimEnd=function(n,t,r){if((n=Yu(n))&&(r||t===N))return n.slice(0,M(n)+1);if(!n||!(t=Kr(t)))return n;var e=D(n);return ee(e,0,E(e,D(t))+1).join("")},Qn.trimStart=function(n,t,r){if((n=Yu(n))&&(r||t===N))return n.replace(Vn,"");if(!n||!(t=Kr(t)))return n;var e=D(n);return ee(e,z(e,D(t))).join("")},Qn.truncate=function(n,t){var r=30,e="...";if(Du(t)){var u="separator"in t?t.separator:u;r="length"in t?Vu(t.length):r,e="omission"in t?Kr(t.omission):e}var i=(n=Yu(n)).length;if(W(n)){var o=D(n);i=o.length}if(r>=i)return n;var f=r-$(e);if(f<1)return e;var c=o?ee(o,0,f).join(""):n.slice(0,f);if(u===N)return c+e;if(o&&(f+=c.length-f),Bf(u)){if(n.slice(f).search(u)){var a,l=c;for(u.global||(u=mi(u.source,Yu(rt.exec(u))+"g")),u.lastIndex=0;a=u.exec(l);)var s=a.index;c=c.slice(0,s===N?f:s)}}else if(n.indexOf(Kr(u),f)!=f){var h=c.lastIndexOf(u);h>-1&&(c=c.slice(0,h))}return c+e},Qn.unescape=function(n){return(n=Yu(n))&&Tn.test(n)?n.replace(Un,yr):n},Qn.uniqueId=function(n){var t=++Ei;return Yu(n)+t},Qn.upperCase=ac,Qn.upperFirst=lc,Qn.each=Au,Qn.eachRight=ku,Qn.first=gu,li(Qn,function(){var n={};return Dt(Qn,(function(t,r){zi.call(Qn.prototype,r)||(n[r]=t)})),n}(),{chain:!1}),Qn.VERSION="4.17.21",r(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(n){Qn[n].placeholder=Qn})),r(["drop","take"],(function(n,t){pt.prototype[n]=function(r){r=r===N?1:uo(Vu(r),0);var e=this.__filtered__&&!t?new pt(this):this.clone();return e.__filtered__?e.__takeCount__=io(r,e.__takeCount__):e.__views__.push({size:io(r,nn),type:n+(e.__dir__<0?"Right":"")}),e},pt.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}})),r(["filter","map","takeWhile"],(function(n,t){var r=t+1,e=1==r||3==r;pt.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:Pe(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}})),r(["head","last"],(function(n,t){var r="take"+(t?"Right":"");pt.prototype[n]=function(){return this[r](1).value()[0]}})),r(["initial","tail"],(function(n,t){var r="drop"+(t?"":"Right");pt.prototype[n]=function(){return this.__filtered__?new pt(this):this[r](1)}})),pt.prototype.compact=function(){return this.filter(ci)},pt.prototype.find=function(n){return this.filter(n).head()},pt.prototype.findLast=function(n){return this.reverse().find(n)},pt.prototype.invokeMap=Ur((function(n,t){return"function"==typeof n?new pt(this):this.map((function(r){return ur(r,n,t)}))})),pt.prototype.reject=function(n){return this.filter(Su(Pe(n)))},pt.prototype.slice=function(n,t){n=Vu(n);var r=this;return r.__filtered__&&(n>0||t<0)?new pt(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==N&&(r=(t=Vu(t))<0?r.dropRight(-t):r.take(t-n)),r)},pt.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},pt.prototype.toArray=function(){return this.take(nn)},Dt(pt.prototype,(function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=Qn[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(Qn.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof pt,c=o[0],l=f||Sf(t),s=function(n){var t=u.apply(Qn,a([n],o));return e&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(f=l=!1);var h=this.__chain__,p=!!this.__actions__.length,_=i&&!h,v=f&&!p;if(!i&&l){t=v?t:new pt(this);var g=n.apply(t,o);return g.__actions__.push({func:ju,args:[s],thisArg:N}),new ht(g,h)}return _&&v?n.apply(this,o):(g=this.thru(s),_?e?g.value()[0]:g.value():g)})})),r(["pop","push","shift","sort","splice","unshift"],(function(n){var t=Ai[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);Qn.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Sf(u)?u:[],n)}return this[r]((function(r){return t.apply(Sf(r)?r:[],n)}))}})),Dt(pt.prototype,(function(n,t){var r=Qn[t];if(r){var e=r.name+"";zi.call(yo,e)||(yo[e]=[]),yo[e].push({name:t,func:r})}})),yo[xe(N,2).name]=[{name:"wrapper",func:N}],pt.prototype.clone=function(){var n=new pt(this.__wrapped__);return n.__actions__=le(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=le(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=le(this.__views__),n},pt.prototype.reverse=function(){if(this.__filtered__){var n=new pt(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},pt.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,r=Sf(n),e=t<0,u=r?n.length:0,i=function(n,t,r){for(var e=-1,u=r.length;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=io(t,n+o);break;case"takeRight":n=uo(n,t-o)}}return{start:n,end:t}}(0,u,this.__views__),o=i.start,f=i.end,c=f-o,a=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=io(c,this.__takeCount__);if(!r||!e&&u==c&&p==c)return Yr(n,this.__actions__);var _=[];n:for(;c--&&h<p;){for(var v=-1,g=n[a+=t];++v<s;){var y=l[v],d=y.iteratee,b=y.type,w=d(g);if(2==b)g=w;else if(!w){if(1==b)continue n;break n}}_[h++]=g}return _},Qn.prototype.at=lf,Qn.prototype.chain=function(){return xu(this)},Qn.prototype.commit=function(){return new ht(this.value(),this.__chain__)},Qn.prototype.next=function(){this.__values__===N&&(this.__values__=Zu(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?N:this.__values__[this.__index__++]}},Qn.prototype.plant=function(n){for(var t,r=this;r instanceof st;){var e=hu(r);e.__index__=0,e.__values__=N,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t},Qn.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof pt){var t=n;return this.__actions__.length&&(t=new pt(this)),(t=t.reverse()).__actions__.push({func:ju,args:[bu],thisArg:N}),new ht(t,this.__chain__)}return this.thru(bu)},Qn.prototype.toJSON=Qn.prototype.valueOf=Qn.prototype.value=function(){return Yr(this.__wrapped__,this.__actions__)},Qn.prototype.first=Qn.prototype.head,Zi&&(Qn.prototype[Zi]=function(){return this}),Qn}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(rr._=dr,define((function(){return dr}))):ur?((ur.exports=dr)._=dr,er._=dr):rr._=dr}).call(this); vendor/react-dom.min.js 0000644 00000373662 15013651111 0011047 0 ustar 00 /** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ !function(){"use strict";var e,n;e=this,n=function(e,n){function t(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t<arguments.length;t++)n+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e,n){l(e,n),l(e+"Capture",n)}function l(e,n){for(ra[e]=n,e=0;e<n.length;e++)ta.add(n[e])}function a(e,n,t,r,l,a,u){this.acceptsBooleans=2===n||3===n||4===n,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=a,this.removeEmptyString=u}function u(e,n,t,r){var l=sa.hasOwnProperty(n)?sa[n]:null;(null!==l?0!==l.type:r||!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&(function(e,n,t,r){if(null==n||function(e,n,t,r){if(null!==t&&0===t.type)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==t?!t.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,n,t,r))return!0;if(r)return!1;if(null!==t)switch(t.type){case 3:return!n;case 4:return!1===n;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}(n,t,l,r)&&(t=null),r||null===l?function(e){return!!aa.call(ia,e)||!aa.call(oa,e)&&(ua.test(e)?ia[e]=!0:(oa[e]=!0,!1))}(n)&&(null===t?e.removeAttribute(n):e.setAttribute(n,""+t)):l.mustUseProperty?e[l.propertyName]=null===t?3!==l.type&&"":t:(n=l.attributeName,r=l.attributeNamespace,null===t?e.removeAttribute(n):(t=3===(l=l.type)||4===l&&!0===t?"":""+t,r?e.setAttributeNS(r,n,t):e.setAttribute(n,t))))}function o(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=_a&&e[_a]||e["@@iterator"])?e:null}function i(e,n,t){if(void 0===za)try{throw Error()}catch(e){za=(n=e.stack.trim().match(/\n( *(at )?)/))&&n[1]||""}return"\n"+za+e}function s(e,n){if(!e||Ta)return"";Ta=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(n){if(n&&r&&"string"==typeof n.stack){for(var l=n.stack.split("\n"),a=r.stack.split("\n"),u=l.length-1,o=a.length-1;1<=u&&0<=o&&l[u]!==a[o];)o--;for(;1<=u&&0<=o;u--,o--)if(l[u]!==a[o]){if(1!==u||1!==o)do{if(u--,0>--o||l[u]!==a[o]){var s="\n"+l[u].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}}while(1<=u&&0<=o);break}}}finally{Ta=!1,Error.prepareStackTrace=t}return(e=e?e.displayName||e.name:"")?i(e):""}function c(e){switch(e.tag){case 5:return i(e.type);case 16:return i("Lazy");case 13:return i("Suspense");case 19:return i("SuspenseList");case 0:case 2:case 15:return e=s(e.type,!1);case 11:return e=s(e.type.render,!1);case 1:return e=s(e.type,!0);default:return""}}function f(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case ha:return"Fragment";case ma:return"Portal";case va:return"Profiler";case ga:return"StrictMode";case wa:return"Suspense";case Sa:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ba:return(e.displayName||"Context")+".Consumer";case ya:return(e._context.displayName||"Context")+".Provider";case ka:var n=e.render;return(e=e.displayName)||(e=""!==(e=n.displayName||n.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case xa:return null!==(n=e.displayName||null)?n:f(e.type)||"Memo";case Ea:n=e._payload,e=e._init;try{return f(e(n))}catch(e){}}return null}function d(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=n.render).displayName||e.name||"",n.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return f(n);case 8:return n===ga?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof n)return n.displayName||n.name||null;if("string"==typeof n)return n}return null}function p(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function m(e){var n=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===n||"radio"===n)}function h(e){e._valueTracker||(e._valueTracker=function(e){var n=m(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),r=""+e[n];if(!e.hasOwnProperty(n)&&void 0!==t&&"function"==typeof t.get&&"function"==typeof t.set){var l=t.get,a=t.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,n,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}(e))}function g(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue(),r="";return e&&(r=m(e)?e.checked?"true":"false":e.value),(e=r)!==t&&(n.setValue(e),!0)}function v(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(n){return e.body}}function y(e,n){var t=n.checked;return La({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=t?t:e._wrapperState.initialChecked})}function b(e,n){var t=null==n.defaultValue?"":n.defaultValue,r=null!=n.checked?n.checked:n.defaultChecked;t=p(null!=n.value?n.value:t),e._wrapperState={initialChecked:r,initialValue:t,controlled:"checkbox"===n.type||"radio"===n.type?null!=n.checked:null!=n.value}}function k(e,n){null!=(n=n.checked)&&u(e,"checked",n,!1)}function w(e,n){k(e,n);var t=p(n.value),r=n.type;if(null!=t)"number"===r?(0===t&&""===e.value||e.value!=t)&&(e.value=""+t):e.value!==""+t&&(e.value=""+t);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");n.hasOwnProperty("value")?x(e,n.type,t):n.hasOwnProperty("defaultValue")&&x(e,n.type,p(n.defaultValue)),null==n.checked&&null!=n.defaultChecked&&(e.defaultChecked=!!n.defaultChecked)}function S(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var r=n.type;if(!("submit"!==r&&"reset"!==r||void 0!==n.value&&null!==n.value))return;n=""+e._wrapperState.initialValue,t||n===e.value||(e.value=n),e.defaultValue=n}""!==(t=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==t&&(e.name=t)}function x(e,n,t){"number"===n&&v(e.ownerDocument)===e||(null==t?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t))}function E(e,n,t,r){if(e=e.options,n){n={};for(var l=0;l<t.length;l++)n["$"+t[l]]=!0;for(t=0;t<e.length;t++)l=n.hasOwnProperty("$"+e[t].value),e[t].selected!==l&&(e[t].selected=l),l&&r&&(e[t].defaultSelected=!0)}else{for(t=""+p(t),n=null,l=0;l<e.length;l++){if(e[l].value===t)return e[l].selected=!0,void(r&&(e[l].defaultSelected=!0));null!==n||e[l].disabled||(n=e[l])}null!==n&&(n.selected=!0)}}function C(e,n){if(null!=n.dangerouslySetInnerHTML)throw Error(t(91));return La({},n,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function z(e,n){var r=n.value;if(null==r){if(r=n.children,n=n.defaultValue,null!=r){if(null!=n)throw Error(t(92));if(Ma(r)){if(1<r.length)throw Error(t(93));r=r[0]}n=r}null==n&&(n=""),r=n}e._wrapperState={initialValue:p(r)}}function N(e,n){var t=p(n.value),r=p(n.defaultValue);null!=t&&((t=""+t)!==e.value&&(e.value=t),null==n.defaultValue&&e.defaultValue!==t&&(e.defaultValue=t)),null!=r&&(e.defaultValue=""+r)}function P(e,n){(n=e.textContent)===e._wrapperState.initialValue&&""!==n&&null!==n&&(e.value=n)}function _(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function L(e,n){return null==e||"http://www.w3.org/1999/xhtml"===e?_(n):"http://www.w3.org/2000/svg"===e&&"foreignObject"===n?"http://www.w3.org/1999/xhtml":e}function T(e,n,t){return null==n||"boolean"==typeof n||""===n?"":t||"number"!=typeof n||0===n||Da.hasOwnProperty(e)&&Da[e]?(""+n).trim():n+"px"}function M(e,n){for(var t in e=e.style,n)if(n.hasOwnProperty(t)){var r=0===t.indexOf("--"),l=T(t,n[t],r);"float"===t&&(t="cssFloat"),r?e.setProperty(t,l):e[t]=l}}function F(e,n){if(n){if(Ia[e]&&(null!=n.children||null!=n.dangerouslySetInnerHTML))throw Error(t(137,e));if(null!=n.dangerouslySetInnerHTML){if(null!=n.children)throw Error(t(60));if("object"!=typeof n.dangerouslySetInnerHTML||!("__html"in n.dangerouslySetInnerHTML))throw Error(t(61))}if(null!=n.style&&"object"!=typeof n.style)throw Error(t(62))}}function R(e,n){if(-1===e.indexOf("-"))return"string"==typeof n.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function D(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function O(e){if(e=mn(e)){if("function"!=typeof Va)throw Error(t(280));var n=e.stateNode;n&&(n=gn(n),Va(e.stateNode,e.type,n))}}function I(e){Aa?Ba?Ba.push(e):Ba=[e]:Aa=e}function U(){if(Aa){var e=Aa,n=Ba;if(Ba=Aa=null,O(e),n)for(e=0;e<n.length;e++)O(n[e])}}function V(e,n,t){if(Qa)return e(n,t);Qa=!0;try{return Wa(e,n,t)}finally{Qa=!1,(null!==Aa||null!==Ba)&&(Ha(),U())}}function A(e,n){var r=e.stateNode;if(null===r)return null;var l=gn(r);if(null===l)return null;r=l[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(l=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!l;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(t(231,n,typeof r));return r}function B(e,n,t,r,l,a,u,o,i){Ga=!1,Za=null,Xa.apply(nu,arguments)}function W(e,n,r,l,a,u,o,i,s){if(B.apply(this,arguments),Ga){if(!Ga)throw Error(t(198));var c=Za;Ga=!1,Za=null,Ja||(Ja=!0,eu=c)}}function H(e){var n=e,t=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do{!!(4098&(n=e).flags)&&(t=n.return),e=n.return}while(e)}return 3===n.tag?t:null}function Q(e){if(13===e.tag){var n=e.memoizedState;if(null===n&&null!==(e=e.alternate)&&(n=e.memoizedState),null!==n)return n.dehydrated}return null}function j(e){if(H(e)!==e)throw Error(t(188))}function $(e){return null!==(e=function(e){var n=e.alternate;if(!n){if(null===(n=H(e)))throw Error(t(188));return n!==e?null:e}for(var r=e,l=n;;){var a=r.return;if(null===a)break;var u=a.alternate;if(null===u){if(null!==(l=a.return)){r=l;continue}break}if(a.child===u.child){for(u=a.child;u;){if(u===r)return j(a),e;if(u===l)return j(a),n;u=u.sibling}throw Error(t(188))}if(r.return!==l.return)r=a,l=u;else{for(var o=!1,i=a.child;i;){if(i===r){o=!0,r=a,l=u;break}if(i===l){o=!0,l=a,r=u;break}i=i.sibling}if(!o){for(i=u.child;i;){if(i===r){o=!0,r=u,l=a;break}if(i===l){o=!0,l=u,r=a;break}i=i.sibling}if(!o)throw Error(t(189))}}if(r.alternate!==l)throw Error(t(190))}if(3!==r.tag)throw Error(t(188));return r.stateNode.current===r?e:n}(e))?q(e):null}function q(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var n=q(e);if(null!==n)return n;e=e.sibling}return null}function K(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Y(e,n){var t=e.pendingLanes;if(0===t)return 0;var r=0,l=e.suspendedLanes,a=e.pingedLanes,u=268435455&t;if(0!==u){var o=u&~l;0!==o?r=K(o):0!=(a&=u)&&(r=K(a))}else 0!=(u=t&~l)?r=K(u):0!==a&&(r=K(a));if(0===r)return 0;if(0!==n&&n!==r&&!(n&l)&&((l=r&-r)>=(a=n&-n)||16===l&&4194240&a))return n;if(4&r&&(r|=16&t),0!==(n=e.entangledLanes))for(e=e.entanglements,n&=r;0<n;)l=1<<(t=31-yu(n)),r|=e[t],n&=~l;return r}function X(e,n){switch(e){case 1:case 2:case 4:return n+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;default:return-1}}function G(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function Z(){var e=wu;return!(4194240&(wu<<=1))&&(wu=64),e}function J(e){for(var n=[],t=0;31>t;t++)n.push(e);return n}function ee(e,n,t){e.pendingLanes|=n,536870912!==n&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[n=31-yu(n)]=t}function ne(e,n){var t=e.entangledLanes|=n;for(e=e.entanglements;t;){var r=31-yu(t),l=1<<r;l&n|e[r]&n&&(e[r]|=n),t&=~l}}function te(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}function re(e,n){switch(e){case"focusin":case"focusout":zu=null;break;case"dragenter":case"dragleave":Nu=null;break;case"mouseover":case"mouseout":Pu=null;break;case"pointerover":case"pointerout":_u.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Lu.delete(n.pointerId)}}function le(e,n,t,r,l,a){return null===e||e.nativeEvent!==a?(e={blockedOn:n,domEventName:t,eventSystemFlags:r,nativeEvent:a,targetContainers:[l]},null!==n&&null!==(n=mn(n))&&Ks(n),e):(e.eventSystemFlags|=r,n=e.targetContainers,null!==l&&-1===n.indexOf(l)&&n.push(l),e)}function ae(e){var n=pn(e.target);if(null!==n){var t=H(n);if(null!==t)if(13===(n=t.tag)){if(null!==(n=Q(t)))return e.blockedOn=n,void Gs(e.priority,(function(){Ys(t)}))}else if(3===n&&t.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===t.tag?t.stateNode.containerInfo:null)}e.blockedOn=null}function ue(e){if(null!==e.blockedOn)return!1;for(var n=e.targetContainers;0<n.length;){var t=me(e.domEventName,e.eventSystemFlags,n[0],e.nativeEvent);if(null!==t)return null!==(n=mn(t))&&Ks(n),e.blockedOn=t,!1;var r=new(t=e.nativeEvent).constructor(t.type,t);Ua=r,t.target.dispatchEvent(r),Ua=null,n.shift()}return!0}function oe(e,n,t){ue(e)&&t.delete(n)}function ie(){Eu=!1,null!==zu&&ue(zu)&&(zu=null),null!==Nu&&ue(Nu)&&(Nu=null),null!==Pu&&ue(Pu)&&(Pu=null),_u.forEach(oe),Lu.forEach(oe)}function se(e,n){e.blockedOn===n&&(e.blockedOn=null,Eu||(Eu=!0,ru(lu,ie)))}function ce(e){if(0<Cu.length){se(Cu[0],e);for(var n=1;n<Cu.length;n++){var t=Cu[n];t.blockedOn===e&&(t.blockedOn=null)}}for(null!==zu&&se(zu,e),null!==Nu&&se(Nu,e),null!==Pu&&se(Pu,e),n=function(n){return se(n,e)},_u.forEach(n),Lu.forEach(n),n=0;n<Tu.length;n++)(t=Tu[n]).blockedOn===e&&(t.blockedOn=null);for(;0<Tu.length&&null===(n=Tu[0]).blockedOn;)ae(n),null===n.blockedOn&&Tu.shift()}function fe(e,n,t,r){var l=xu,a=Fu.transition;Fu.transition=null;try{xu=1,pe(e,n,t,r)}finally{xu=l,Fu.transition=a}}function de(e,n,t,r){var l=xu,a=Fu.transition;Fu.transition=null;try{xu=4,pe(e,n,t,r)}finally{xu=l,Fu.transition=a}}function pe(e,n,t,r){if(Ru){var l=me(e,n,t,r);if(null===l)Je(e,n,r,Du,t),re(e,r);else if(function(e,n,t,r,l){switch(n){case"focusin":return zu=le(zu,e,n,t,r,l),!0;case"dragenter":return Nu=le(Nu,e,n,t,r,l),!0;case"mouseover":return Pu=le(Pu,e,n,t,r,l),!0;case"pointerover":var a=l.pointerId;return _u.set(a,le(_u.get(a)||null,e,n,t,r,l)),!0;case"gotpointercapture":return a=l.pointerId,Lu.set(a,le(Lu.get(a)||null,e,n,t,r,l)),!0}return!1}(l,e,n,t,r))r.stopPropagation();else if(re(e,r),4&n&&-1<Mu.indexOf(e)){for(;null!==l;){var a=mn(l);if(null!==a&&qs(a),null===(a=me(e,n,t,r))&&Je(e,n,r,Du,t),a===l)break;l=a}null!==l&&r.stopPropagation()}else Je(e,n,r,null,t)}}function me(e,n,t,r){if(Du=null,null!==(e=pn(e=D(r))))if(null===(n=H(e)))e=null;else if(13===(t=n.tag)){if(null!==(e=Q(n)))return e;e=null}else if(3===t){if(n.stateNode.current.memoizedState.isDehydrated)return 3===n.tag?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null);return Du=e,null}function he(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(cu()){case fu:return 1;case du:return 4;case pu:case mu:return 16;case hu:return 536870912;default:return 16}default:return 16}}function ge(){if(Uu)return Uu;var e,n,t=Iu,r=t.length,l="value"in Ou?Ou.value:Ou.textContent,a=l.length;for(e=0;e<r&&t[e]===l[e];e++);var u=r-e;for(n=1;n<=u&&t[r-n]===l[a-n];n++);return Uu=l.slice(e,1<n?1-n:void 0)}function ve(e){var n=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===n&&(e=13):e=n,10===e&&(e=13),32<=e||13===e?e:0}function ye(){return!0}function be(){return!1}function ke(e){function n(n,t,r,l,a){for(var u in this._reactName=n,this._targetInst=r,this.type=t,this.nativeEvent=l,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(u)&&(n=e[u],this[u]=n?n(l):l[u]);return this.isDefaultPrevented=(null!=l.defaultPrevented?l.defaultPrevented:!1===l.returnValue)?ye:be,this.isPropagationStopped=be,this}return La(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ye)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ye)},persist:function(){},isPersistent:ye}),n}function we(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):!!(e=eo[e])&&!!n[e]}function Se(e){return we}function xe(e,n){switch(e){case"keyup":return-1!==io.indexOf(n.keyCode);case"keydown":return 229!==n.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ee(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}function Ce(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===n?!!vo[e.type]:"textarea"===n}function ze(e,n,t,r){I(r),0<(n=nn(n,"onChange")).length&&(t=new Au("onChange","change",null,t,r),e.push({event:t,listeners:n}))}function Ne(e){Ke(e,0)}function Pe(e){if(g(hn(e)))return e}function _e(e,n){if("change"===e)return n}function Le(){yo&&(yo.detachEvent("onpropertychange",Te),bo=yo=null)}function Te(e){if("value"===e.propertyName&&Pe(bo)){var n=[];ze(n,bo,e,D(e)),V(Ne,n)}}function Me(e,n,t){"focusin"===e?(Le(),bo=t,(yo=n).attachEvent("onpropertychange",Te)):"focusout"===e&&Le()}function Fe(e,n){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Pe(bo)}function Re(e,n){if("click"===e)return Pe(n)}function De(e,n){if("input"===e||"change"===e)return Pe(n)}function Oe(e,n){if(wo(e,n))return!0;if("object"!=typeof e||null===e||"object"!=typeof n||null===n)return!1;var t=Object.keys(e),r=Object.keys(n);if(t.length!==r.length)return!1;for(r=0;r<t.length;r++){var l=t[r];if(!aa.call(n,l)||!wo(e[l],n[l]))return!1}return!0}function Ie(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ue(e,n){var t,r=Ie(e);for(e=0;r;){if(3===r.nodeType){if(t=e+r.textContent.length,e<=n&&t>=n)return{node:r,offset:n-e};e=t}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Ie(r)}}function Ve(e,n){return!(!e||!n)&&(e===n||(!e||3!==e.nodeType)&&(n&&3===n.nodeType?Ve(e,n.parentNode):"contains"in e?e.contains(n):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(n))))}function Ae(){for(var e=window,n=v();n instanceof e.HTMLIFrameElement;){try{var t="string"==typeof n.contentWindow.location.href}catch(e){t=!1}if(!t)break;n=v((e=n.contentWindow).document)}return n}function Be(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&("input"===n&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===n||"true"===e.contentEditable)}function We(e){var n=Ae(),t=e.focusedElem,r=e.selectionRange;if(n!==t&&t&&t.ownerDocument&&Ve(t.ownerDocument.documentElement,t)){if(null!==r&&Be(t))if(n=r.start,void 0===(e=r.end)&&(e=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(e,t.value.length);else if((e=(n=t.ownerDocument||document)&&n.defaultView||window).getSelection){e=e.getSelection();var l=t.textContent.length,a=Math.min(r.start,l);r=void 0===r.end?a:Math.min(r.end,l),!e.extend&&a>r&&(l=r,r=a,a=l),l=Ue(t,a);var u=Ue(t,r);l&&u&&(1!==e.rangeCount||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&((n=n.createRange()).setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(n),e.extend(u.node,u.offset)):(n.setEnd(u.node,u.offset),e.addRange(n)))}for(n=[],e=t;e=e.parentNode;)1===e.nodeType&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof t.focus&&t.focus(),t=0;t<n.length;t++)(e=n[t]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}function He(e,n,t){var r=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;zo||null==xo||xo!==v(r)||(r="selectionStart"in(r=xo)&&Be(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},Co&&Oe(Co,r)||(Co=r,0<(r=nn(Eo,"onSelect")).length&&(n=new Au("onSelect","select",null,n,t),e.push({event:n,listeners:r}),n.target=xo)))}function Qe(e,n){var t={};return t[e.toLowerCase()]=n.toLowerCase(),t["Webkit"+e]="webkit"+n,t["Moz"+e]="moz"+n,t}function je(e){if(Po[e])return Po[e];if(!No[e])return e;var n,t=No[e];for(n in t)if(t.hasOwnProperty(n)&&n in _o)return Po[e]=t[n];return e}function $e(e,n){Ro.set(e,n),r(n,[e])}function qe(e,n,t){var r=e.type||"unknown-event";e.currentTarget=t,W(r,n,void 0,e),e.currentTarget=null}function Ke(e,n){n=!!(4&n);for(var t=0;t<e.length;t++){var r=e[t],l=r.event;r=r.listeners;e:{var a=void 0;if(n)for(var u=r.length-1;0<=u;u--){var o=r[u],i=o.instance,s=o.currentTarget;if(o=o.listener,i!==a&&l.isPropagationStopped())break e;qe(l,o,s),a=i}else for(u=0;u<r.length;u++){if(i=(o=r[u]).instance,s=o.currentTarget,o=o.listener,i!==a&&l.isPropagationStopped())break e;qe(l,o,s),a=i}}}if(Ja)throw e=eu,Ja=!1,eu=null,e}function Ye(e,n){var t=n[Go];void 0===t&&(t=n[Go]=new Set);var r=e+"__bubble";t.has(r)||(Ze(n,e,2,!1),t.add(r))}function Xe(e,n,t){var r=0;n&&(r|=4),Ze(t,e,r,n)}function Ge(e){if(!e[Uo]){e[Uo]=!0,ta.forEach((function(n){"selectionchange"!==n&&(Io.has(n)||Xe(n,!1,e),Xe(n,!0,e))}));var n=9===e.nodeType?e:e.ownerDocument;null===n||n[Uo]||(n[Uo]=!0,Xe("selectionchange",!1,n))}}function Ze(e,n,t,r,l){switch(he(n)){case 1:l=fe;break;case 4:l=de;break;default:l=pe}t=l.bind(null,n,t,e),l=void 0,!ja||"touchstart"!==n&&"touchmove"!==n&&"wheel"!==n||(l=!0),r?void 0!==l?e.addEventListener(n,t,{capture:!0,passive:l}):e.addEventListener(n,t,!0):void 0!==l?e.addEventListener(n,t,{passive:l}):e.addEventListener(n,t,!1)}function Je(e,n,t,r,l){var a=r;if(!(1&n||2&n||null===r))e:for(;;){if(null===r)return;var u=r.tag;if(3===u||4===u){var o=r.stateNode.containerInfo;if(o===l||8===o.nodeType&&o.parentNode===l)break;if(4===u)for(u=r.return;null!==u;){var i=u.tag;if((3===i||4===i)&&((i=u.stateNode.containerInfo)===l||8===i.nodeType&&i.parentNode===l))return;u=u.return}for(;null!==o;){if(null===(u=pn(o)))return;if(5===(i=u.tag)||6===i){r=a=u;continue e}o=o.parentNode}}r=r.return}V((function(){var r=a,l=D(t),u=[];e:{var o=Ro.get(e);if(void 0!==o){var i=Au,s=e;switch(e){case"keypress":if(0===ve(t))break e;case"keydown":case"keyup":i=to;break;case"focusin":s="focus",i=$u;break;case"focusout":s="blur",i=$u;break;case"beforeblur":case"afterblur":i=$u;break;case"click":if(2===t.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":i=Qu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":i=ju;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":i=lo;break;case Lo:case To:case Mo:i=qu;break;case Fo:i=ao;break;case"scroll":i=Wu;break;case"wheel":i=oo;break;case"copy":case"cut":case"paste":i=Yu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":i=ro}var c=!!(4&n),f=!c&&"scroll"===e,d=c?null!==o?o+"Capture":null:o;c=[];for(var p,m=r;null!==m;){var h=(p=m).stateNode;if(5===p.tag&&null!==h&&(p=h,null!==d&&null!=(h=A(m,d))&&c.push(en(m,h,p))),f)break;m=m.return}0<c.length&&(o=new i(o,s,null,t,l),u.push({event:o,listeners:c}))}}if(!(7&n)){if(i="mouseout"===e||"pointerout"===e,(!(o="mouseover"===e||"pointerover"===e)||t===Ua||!(s=t.relatedTarget||t.fromElement)||!pn(s)&&!s[Xo])&&(i||o)&&(o=l.window===l?l:(o=l.ownerDocument)?o.defaultView||o.parentWindow:window,i?(i=r,null!==(s=(s=t.relatedTarget||t.toElement)?pn(s):null)&&(s!==(f=H(s))||5!==s.tag&&6!==s.tag)&&(s=null)):(i=null,s=r),i!==s)){if(c=Qu,h="onMouseLeave",d="onMouseEnter",m="mouse","pointerout"!==e&&"pointerover"!==e||(c=ro,h="onPointerLeave",d="onPointerEnter",m="pointer"),f=null==i?o:hn(i),p=null==s?o:hn(s),(o=new c(h,m+"leave",i,t,l)).target=f,o.relatedTarget=p,h=null,pn(l)===r&&((c=new c(d,m+"enter",s,t,l)).target=p,c.relatedTarget=f,h=c),f=h,i&&s)e:{for(d=s,m=0,p=c=i;p;p=tn(p))m++;for(p=0,h=d;h;h=tn(h))p++;for(;0<m-p;)c=tn(c),m--;for(;0<p-m;)d=tn(d),p--;for(;m--;){if(c===d||null!==d&&c===d.alternate)break e;c=tn(c),d=tn(d)}c=null}else c=null;null!==i&&rn(u,o,i,c,!1),null!==s&&null!==f&&rn(u,f,s,c,!0)}if("select"===(i=(o=r?hn(r):window).nodeName&&o.nodeName.toLowerCase())||"input"===i&&"file"===o.type)var g=_e;else if(Ce(o))if(ko)g=De;else{g=Fe;var v=Me}else(i=o.nodeName)&&"input"===i.toLowerCase()&&("checkbox"===o.type||"radio"===o.type)&&(g=Re);switch(g&&(g=g(e,r))?ze(u,g,t,l):(v&&v(e,o,r),"focusout"===e&&(v=o._wrapperState)&&v.controlled&&"number"===o.type&&x(o,"number",o.value)),v=r?hn(r):window,e){case"focusin":(Ce(v)||"true"===v.contentEditable)&&(xo=v,Eo=r,Co=null);break;case"focusout":Co=Eo=xo=null;break;case"mousedown":zo=!0;break;case"contextmenu":case"mouseup":case"dragend":zo=!1,He(u,t,l);break;case"selectionchange":if(So)break;case"keydown":case"keyup":He(u,t,l)}var y;if(so)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else go?xe(e,t)&&(b="onCompositionEnd"):"keydown"===e&&229===t.keyCode&&(b="onCompositionStart");b&&(po&&"ko"!==t.locale&&(go||"onCompositionStart"!==b?"onCompositionEnd"===b&&go&&(y=ge()):(Iu="value"in(Ou=l)?Ou.value:Ou.textContent,go=!0)),0<(v=nn(r,b)).length&&(b=new Xu(b,e,null,t,l),u.push({event:b,listeners:v}),(y||null!==(y=Ee(t)))&&(b.data=y))),(y=fo?function(e,n){switch(e){case"compositionend":return Ee(n);case"keypress":return 32!==n.which?null:(ho=!0,mo);case"textInput":return(e=n.data)===mo&&ho?null:e;default:return null}}(e,t):function(e,n){if(go)return"compositionend"===e||!so&&xe(e,n)?(e=ge(),Uu=Iu=Ou=null,go=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return po&&"ko"!==n.locale?null:n.data}}(e,t))&&0<(r=nn(r,"onBeforeInput")).length&&(l=new Gu("onBeforeInput","beforeinput",null,t,l),u.push({event:l,listeners:r}),l.data=y)}Ke(u,n)}))}function en(e,n,t){return{instance:e,listener:n,currentTarget:t}}function nn(e,n){for(var t=n+"Capture",r=[];null!==e;){var l=e,a=l.stateNode;5===l.tag&&null!==a&&(l=a,null!=(a=A(e,t))&&r.unshift(en(e,a,l)),null!=(a=A(e,n))&&r.push(en(e,a,l))),e=e.return}return r}function tn(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function rn(e,n,t,r,l){for(var a=n._reactName,u=[];null!==t&&t!==r;){var o=t,i=o.alternate,s=o.stateNode;if(null!==i&&i===r)break;5===o.tag&&null!==s&&(o=s,l?null!=(i=A(t,a))&&u.unshift(en(t,i,o)):l||null!=(i=A(t,a))&&u.push(en(t,i,o))),t=t.return}0!==u.length&&e.push({event:n,listeners:u})}function ln(e){return("string"==typeof e?e:""+e).replace(Vo,"\n").replace(Ao,"")}function an(e,n,r,l){if(n=ln(n),ln(e)!==n&&r)throw Error(t(425))}function un(){}function on(e,n){return"textarea"===e||"noscript"===e||"string"==typeof n.children||"number"==typeof n.children||"object"==typeof n.dangerouslySetInnerHTML&&null!==n.dangerouslySetInnerHTML&&null!=n.dangerouslySetInnerHTML.__html}function sn(e){setTimeout((function(){throw e}))}function cn(e,n){var t=n,r=0;do{var l=t.nextSibling;if(e.removeChild(t),l&&8===l.nodeType)if("/$"===(t=l.data)){if(0===r)return e.removeChild(l),void ce(n);r--}else"$"!==t&&"$?"!==t&&"$!"!==t||r++;t=l}while(t);ce(n)}function fn(e){for(;null!=e;e=e.nextSibling){var n=e.nodeType;if(1===n||3===n)break;if(8===n){if("$"===(n=e.data)||"$!"===n||"$?"===n)break;if("/$"===n)return null}}return e}function dn(e){e=e.previousSibling;for(var n=0;e;){if(8===e.nodeType){var t=e.data;if("$"===t||"$!"===t||"$?"===t){if(0===n)return e;n--}else"/$"===t&&n++}e=e.previousSibling}return null}function pn(e){var n=e[Ko];if(n)return n;for(var t=e.parentNode;t;){if(n=t[Xo]||t[Ko]){if(t=n.alternate,null!==n.child||null!==t&&null!==t.child)for(e=dn(e);null!==e;){if(t=e[Ko])return t;e=dn(e)}return n}t=(e=t).parentNode}return null}function mn(e){return!(e=e[Ko]||e[Xo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function hn(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(t(33))}function gn(e){return e[Yo]||null}function vn(e){return{current:e}}function yn(e,n){0>ni||(e.current=ei[ni],ei[ni]=null,ni--)}function bn(e,n,t){ni++,ei[ni]=e.current,e.current=n}function kn(e,n){var t=e.type.contextTypes;if(!t)return ti;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===n)return r.__reactInternalMemoizedMaskedChildContext;var l,a={};for(l in t)a[l]=n[l];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=a),a}function wn(e){return null!=(e=e.childContextTypes)}function Sn(e,n,r){if(ri.current!==ti)throw Error(t(168));bn(ri,n),bn(li,r)}function xn(e,n,r){var l=e.stateNode;if(n=n.childContextTypes,"function"!=typeof l.getChildContext)return r;for(var a in l=l.getChildContext())if(!(a in n))throw Error(t(108,d(e)||"Unknown",a));return La({},r,l)}function En(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ti,ai=ri.current,bn(ri,e),bn(li,li.current),!0}function Cn(e,n,r){var l=e.stateNode;if(!l)throw Error(t(169));r?(e=xn(e,n,ai),l.__reactInternalMemoizedMergedChildContext=e,yn(li),yn(ri),bn(ri,e)):yn(li),bn(li,r)}function zn(e){null===ui?ui=[e]:ui.push(e)}function Nn(){if(!ii&&null!==ui){ii=!0;var e=0,n=xu;try{var t=ui;for(xu=1;e<t.length;e++){var r=t[e];do{r=r(!0)}while(null!==r)}ui=null,oi=!1}catch(n){throw null!==ui&&(ui=ui.slice(e+1)),au(fu,Nn),n}finally{xu=n,ii=!1}}return null}function Pn(e,n){si[ci++]=di,si[ci++]=fi,fi=e,di=n}function _n(e,n,t){pi[mi++]=gi,pi[mi++]=vi,pi[mi++]=hi,hi=e;var r=gi;e=vi;var l=32-yu(r)-1;r&=~(1<<l),t+=1;var a=32-yu(n)+l;if(30<a){var u=l-l%5;a=(r&(1<<u)-1).toString(32),r>>=u,l-=u,gi=1<<32-yu(n)+l|t<<l|r,vi=a+e}else gi=1<<a|t<<l|r,vi=e}function Ln(e){null!==e.return&&(Pn(e,1),_n(e,1,0))}function Tn(e){for(;e===fi;)fi=si[--ci],si[ci]=null,di=si[--ci],si[ci]=null;for(;e===hi;)hi=pi[--mi],pi[mi]=null,vi=pi[--mi],pi[mi]=null,gi=pi[--mi],pi[mi]=null}function Mn(e,n){var t=js(5,null,null,0);t.elementType="DELETED",t.stateNode=n,t.return=e,null===(n=e.deletions)?(e.deletions=[t],e.flags|=16):n.push(t)}function Fn(e,n){switch(e.tag){case 5:var t=e.type;return null!==(n=1!==n.nodeType||t.toLowerCase()!==n.nodeName.toLowerCase()?null:n)&&(e.stateNode=n,yi=e,bi=fn(n.firstChild),!0);case 6:return null!==(n=""===e.pendingProps||3!==n.nodeType?null:n)&&(e.stateNode=n,yi=e,bi=null,!0);case 13:return null!==(n=8!==n.nodeType?null:n)&&(t=null!==hi?{id:gi,overflow:vi}:null,e.memoizedState={dehydrated:n,treeContext:t,retryLane:1073741824},(t=js(18,null,null,0)).stateNode=n,t.return=e,e.child=t,yi=e,bi=null,!0);default:return!1}}function Rn(e){return!(!(1&e.mode)||128&e.flags)}function Dn(e){if(ki){var n=bi;if(n){var r=n;if(!Fn(e,n)){if(Rn(e))throw Error(t(418));n=fn(r.nextSibling);var l=yi;n&&Fn(e,n)?Mn(l,r):(e.flags=-4097&e.flags|2,ki=!1,yi=e)}}else{if(Rn(e))throw Error(t(418));e.flags=-4097&e.flags|2,ki=!1,yi=e}}}function On(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;yi=e}function In(e){if(e!==yi)return!1;if(!ki)return On(e),ki=!0,!1;var n;if((n=3!==e.tag)&&!(n=5!==e.tag)&&(n="head"!==(n=e.type)&&"body"!==n&&!on(e.type,e.memoizedProps)),n&&(n=bi)){if(Rn(e)){for(e=bi;e;)e=fn(e.nextSibling);throw Error(t(418))}for(;n;)Mn(e,n),n=fn(n.nextSibling)}if(On(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(t(317));e:{for(e=e.nextSibling,n=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===n){bi=fn(e.nextSibling);break e}n--}else"$"!==r&&"$!"!==r&&"$?"!==r||n++}e=e.nextSibling}bi=null}}else bi=yi?fn(e.stateNode.nextSibling):null;return!0}function Un(){bi=yi=null,ki=!1}function Vn(e){null===wi?wi=[e]:wi.push(e)}function An(e,n,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(t(309));var l=r.stateNode}if(!l)throw Error(t(147,e));var a=l,u=""+e;return null!==n&&null!==n.ref&&"function"==typeof n.ref&&n.ref._stringRef===u?n.ref:(n=function(e){var n=a.refs;null===e?delete n[u]:n[u]=e},n._stringRef=u,n)}if("string"!=typeof e)throw Error(t(284));if(!r._owner)throw Error(t(290,e))}return e}function Bn(e,n){throw e=Object.prototype.toString.call(n),Error(t(31,"[object Object]"===e?"object with keys {"+Object.keys(n).join(", ")+"}":e))}function Wn(e){return(0,e._init)(e._payload)}function Hn(e){function n(n,t){if(e){var r=n.deletions;null===r?(n.deletions=[t],n.flags|=16):r.push(t)}}function r(t,r){if(!e)return null;for(;null!==r;)n(t,r),r=r.sibling;return null}function l(e,n){for(e=new Map;null!==n;)null!==n.key?e.set(n.key,n):e.set(n.index,n),n=n.sibling;return e}function a(e,n){return(e=Rl(e,n)).index=0,e.sibling=null,e}function u(n,t,r){return n.index=r,e?null!==(r=n.alternate)?(r=r.index)<t?(n.flags|=2,t):r:(n.flags|=2,t):(n.flags|=1048576,t)}function i(n){return e&&null===n.alternate&&(n.flags|=2),n}function s(e,n,t,r){return null===n||6!==n.tag?((n=Ul(t,e.mode,r)).return=e,n):((n=a(n,t)).return=e,n)}function c(e,n,t,r){var l=t.type;return l===ha?d(e,n,t.props.children,r,t.key):null!==n&&(n.elementType===l||"object"==typeof l&&null!==l&&l.$$typeof===Ea&&Wn(l)===n.type)?((r=a(n,t.props)).ref=An(e,n,t),r.return=e,r):((r=Dl(t.type,t.key,t.props,null,e.mode,r)).ref=An(e,n,t),r.return=e,r)}function f(e,n,t,r){return null===n||4!==n.tag||n.stateNode.containerInfo!==t.containerInfo||n.stateNode.implementation!==t.implementation?((n=Vl(t,e.mode,r)).return=e,n):((n=a(n,t.children||[])).return=e,n)}function d(e,n,t,r,l){return null===n||7!==n.tag?((n=Ol(t,e.mode,r,l)).return=e,n):((n=a(n,t)).return=e,n)}function p(e,n,t){if("string"==typeof n&&""!==n||"number"==typeof n)return(n=Ul(""+n,e.mode,t)).return=e,n;if("object"==typeof n&&null!==n){switch(n.$$typeof){case pa:return(t=Dl(n.type,n.key,n.props,null,e.mode,t)).ref=An(e,null,n),t.return=e,t;case ma:return(n=Vl(n,e.mode,t)).return=e,n;case Ea:return p(e,(0,n._init)(n._payload),t)}if(Ma(n)||o(n))return(n=Ol(n,e.mode,t,null)).return=e,n;Bn(e,n)}return null}function m(e,n,t,r){var l=null!==n?n.key:null;if("string"==typeof t&&""!==t||"number"==typeof t)return null!==l?null:s(e,n,""+t,r);if("object"==typeof t&&null!==t){switch(t.$$typeof){case pa:return t.key===l?c(e,n,t,r):null;case ma:return t.key===l?f(e,n,t,r):null;case Ea:return m(e,n,(l=t._init)(t._payload),r)}if(Ma(t)||o(t))return null!==l?null:d(e,n,t,r,null);Bn(e,t)}return null}function h(e,n,t,r,l){if("string"==typeof r&&""!==r||"number"==typeof r)return s(n,e=e.get(t)||null,""+r,l);if("object"==typeof r&&null!==r){switch(r.$$typeof){case pa:return c(n,e=e.get(null===r.key?t:r.key)||null,r,l);case ma:return f(n,e=e.get(null===r.key?t:r.key)||null,r,l);case Ea:return h(e,n,t,(0,r._init)(r._payload),l)}if(Ma(r)||o(r))return d(n,e=e.get(t)||null,r,l,null);Bn(n,r)}return null}function g(t,a,o,i){for(var s=null,c=null,f=a,d=a=0,g=null;null!==f&&d<o.length;d++){f.index>d?(g=f,f=null):g=f.sibling;var v=m(t,f,o[d],i);if(null===v){null===f&&(f=g);break}e&&f&&null===v.alternate&&n(t,f),a=u(v,a,d),null===c?s=v:c.sibling=v,c=v,f=g}if(d===o.length)return r(t,f),ki&&Pn(t,d),s;if(null===f){for(;d<o.length;d++)null!==(f=p(t,o[d],i))&&(a=u(f,a,d),null===c?s=f:c.sibling=f,c=f);return ki&&Pn(t,d),s}for(f=l(t,f);d<o.length;d++)null!==(g=h(f,t,d,o[d],i))&&(e&&null!==g.alternate&&f.delete(null===g.key?d:g.key),a=u(g,a,d),null===c?s=g:c.sibling=g,c=g);return e&&f.forEach((function(e){return n(t,e)})),ki&&Pn(t,d),s}function v(a,i,s,c){var f=o(s);if("function"!=typeof f)throw Error(t(150));if(null==(s=f.call(s)))throw Error(t(151));for(var d=f=null,g=i,v=i=0,y=null,b=s.next();null!==g&&!b.done;v++,b=s.next()){g.index>v?(y=g,g=null):y=g.sibling;var k=m(a,g,b.value,c);if(null===k){null===g&&(g=y);break}e&&g&&null===k.alternate&&n(a,g),i=u(k,i,v),null===d?f=k:d.sibling=k,d=k,g=y}if(b.done)return r(a,g),ki&&Pn(a,v),f;if(null===g){for(;!b.done;v++,b=s.next())null!==(b=p(a,b.value,c))&&(i=u(b,i,v),null===d?f=b:d.sibling=b,d=b);return ki&&Pn(a,v),f}for(g=l(a,g);!b.done;v++,b=s.next())null!==(b=h(g,a,v,b.value,c))&&(e&&null!==b.alternate&&g.delete(null===b.key?v:b.key),i=u(b,i,v),null===d?f=b:d.sibling=b,d=b);return e&&g.forEach((function(e){return n(a,e)})),ki&&Pn(a,v),f}return function e(t,l,u,s){if("object"==typeof u&&null!==u&&u.type===ha&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case pa:e:{for(var c=u.key,f=l;null!==f;){if(f.key===c){if((c=u.type)===ha){if(7===f.tag){r(t,f.sibling),(l=a(f,u.props.children)).return=t,t=l;break e}}else if(f.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===Ea&&Wn(c)===f.type){r(t,f.sibling),(l=a(f,u.props)).ref=An(t,f,u),l.return=t,t=l;break e}r(t,f);break}n(t,f),f=f.sibling}u.type===ha?((l=Ol(u.props.children,t.mode,s,u.key)).return=t,t=l):((s=Dl(u.type,u.key,u.props,null,t.mode,s)).ref=An(t,l,u),s.return=t,t=s)}return i(t);case ma:e:{for(f=u.key;null!==l;){if(l.key===f){if(4===l.tag&&l.stateNode.containerInfo===u.containerInfo&&l.stateNode.implementation===u.implementation){r(t,l.sibling),(l=a(l,u.children||[])).return=t,t=l;break e}r(t,l);break}n(t,l),l=l.sibling}(l=Vl(u,t.mode,s)).return=t,t=l}return i(t);case Ea:return e(t,l,(f=u._init)(u._payload),s)}if(Ma(u))return g(t,l,u,s);if(o(u))return v(t,l,u,s);Bn(t,u)}return"string"==typeof u&&""!==u||"number"==typeof u?(u=""+u,null!==l&&6===l.tag?(r(t,l.sibling),(l=a(l,u)).return=t,t=l):(r(t,l),(l=Ul(u,t.mode,s)).return=t,t=l),i(t)):r(t,l)}}function Qn(){Pi=Ni=zi=null}function jn(e,n){n=Ci.current,yn(Ci),e._currentValue=n}function $n(e,n,t){for(;null!==e;){var r=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,null!==r&&(r.childLanes|=n)):null!==r&&(r.childLanes&n)!==n&&(r.childLanes|=n),e===t)break;e=e.return}}function qn(e,n){zi=e,Pi=Ni=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(!!(e.lanes&n)&&(ns=!0),e.firstContext=null)}function Kn(e){var n=e._currentValue;if(Pi!==e)if(e={context:e,memoizedValue:n,next:null},null===Ni){if(null===zi)throw Error(t(308));Ni=e,zi.dependencies={lanes:0,firstContext:e}}else Ni=Ni.next=e;return n}function Yn(e){null===_i?_i=[e]:_i.push(e)}function Xn(e,n,t,r){var l=n.interleaved;return null===l?(t.next=t,Yn(n)):(t.next=l.next,l.next=t),n.interleaved=t,Gn(e,r)}function Gn(e,n){e.lanes|=n;var t=e.alternate;for(null!==t&&(t.lanes|=n),t=e,e=e.return;null!==e;)e.childLanes|=n,null!==(t=e.alternate)&&(t.childLanes|=n),t=e,e=e.return;return 3===t.tag?t.stateNode:null}function Zn(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jn(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function et(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function nt(e,n,t){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&ys){var l=r.pending;return null===l?n.next=n:(n.next=l.next,l.next=n),r.pending=n,Li(e,t)}return null===(l=r.interleaved)?(n.next=n,Yn(r)):(n.next=l.next,l.next=n),r.interleaved=n,Gn(e,t)}function tt(e,n,t){if(null!==(n=n.updateQueue)&&(n=n.shared,4194240&t)){var r=n.lanes;t|=r&=e.pendingLanes,n.lanes=t,ne(e,t)}}function rt(e,n){var t=e.updateQueue,r=e.alternate;if(null!==r&&t===(r=r.updateQueue)){var l=null,a=null;if(null!==(t=t.firstBaseUpdate)){do{var u={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null};null===a?l=a=u:a=a.next=u,t=t.next}while(null!==t);null===a?l=a=n:a=a.next=n}else l=a=n;return t={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:a,shared:r.shared,effects:r.effects},void(e.updateQueue=t)}null===(e=t.lastBaseUpdate)?t.firstBaseUpdate=n:e.next=n,t.lastBaseUpdate=n}function lt(e,n,t,r){var l=e.updateQueue;Ti=!1;var a=l.firstBaseUpdate,u=l.lastBaseUpdate,o=l.shared.pending;if(null!==o){l.shared.pending=null;var i=o,s=i.next;i.next=null,null===u?a=s:u.next=s,u=i;var c=e.alternate;null!==c&&(o=(c=c.updateQueue).lastBaseUpdate)!==u&&(null===o?c.firstBaseUpdate=s:o.next=s,c.lastBaseUpdate=i)}if(null!==a){var f=l.baseState;for(u=0,c=s=i=null,o=a;;){var d=o.lane,p=o.eventTime;if((r&d)===d){null!==c&&(c=c.next={eventTime:p,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=e,h=o;switch(d=n,p=t,h.tag){case 1:if("function"==typeof(m=h.payload)){f=m.call(p,f,d);break e}f=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(d="function"==typeof(m=h.payload)?m.call(p,f,d):m))break e;f=La({},f,d);break e;case 2:Ti=!0}}null!==o.callback&&0!==o.lane&&(e.flags|=64,null===(d=l.effects)?l.effects=[o]:d.push(o))}else p={eventTime:p,lane:d,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===c?(s=c=p,i=f):c=c.next=p,u|=d;if(null===(o=o.next)){if(null===(o=l.shared.pending))break;o=(d=o).next,d.next=null,l.lastBaseUpdate=d,l.shared.pending=null}}if(null===c&&(i=f),l.baseState=i,l.firstBaseUpdate=s,l.lastBaseUpdate=c,null!==(n=l.shared.interleaved)){l=n;do{u|=l.lane,l=l.next}while(l!==n)}else null===a&&(l.shared.lanes=0);zs|=u,e.lanes=u,e.memoizedState=f}}function at(e,n,r){if(e=n.effects,n.effects=null,null!==e)for(n=0;n<e.length;n++){var l=e[n],a=l.callback;if(null!==a){if(l.callback=null,l=r,"function"!=typeof a)throw Error(t(191,a));a.call(l)}}}function ut(e){if(e===Mi)throw Error(t(174));return e}function ot(e,n){switch(bn(Di,n),bn(Ri,e),bn(Fi,Mi),e=n.nodeType){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:L(null,"");break;default:n=L(n=(e=8===e?n.parentNode:n).namespaceURI||null,e=e.tagName)}yn(Fi),bn(Fi,n)}function it(e){yn(Fi),yn(Ri),yn(Di)}function st(e){ut(Di.current);var n=ut(Fi.current),t=L(n,e.type);n!==t&&(bn(Ri,e),bn(Fi,t))}function ct(e){Ri.current===e&&(yn(Fi),yn(Ri))}function ft(e){for(var n=e;null!==n;){if(13===n.tag){var t=n.memoizedState;if(null!==t&&(null===(t=t.dehydrated)||"$?"===t.data||"$!"===t.data))return n}else if(19===n.tag&&void 0!==n.memoizedProps.revealOrder){if(128&n.flags)return n}else if(null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function dt(){for(var e=0;e<Ii.length;e++)Ii[e]._workInProgressVersionPrimary=null;Ii.length=0}function pt(){throw Error(t(321))}function mt(e,n){if(null===n)return!1;for(var t=0;t<n.length&&t<e.length;t++)if(!wo(e[t],n[t]))return!1;return!0}function ht(e,n,r,l,a,u){if(Ai=u,Bi=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,Ui.current=null===e||null===e.memoizedState?Yi:Xi,e=r(l,a),ji){u=0;do{if(ji=!1,$i=0,25<=u)throw Error(t(301));u+=1,Hi=Wi=null,n.updateQueue=null,Ui.current=Gi,e=r(l,a)}while(ji)}if(Ui.current=Ki,n=null!==Wi&&null!==Wi.next,Ai=0,Hi=Wi=Bi=null,Qi=!1,n)throw Error(t(300));return e}function gt(){var e=0!==$i;return $i=0,e}function vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Hi?Bi.memoizedState=Hi=e:Hi=Hi.next=e,Hi}function yt(){if(null===Wi){var e=Bi.alternate;e=null!==e?e.memoizedState:null}else e=Wi.next;var n=null===Hi?Bi.memoizedState:Hi.next;if(null!==n)Hi=n,Wi=e;else{if(null===e)throw Error(t(310));e={memoizedState:(Wi=e).memoizedState,baseState:Wi.baseState,baseQueue:Wi.baseQueue,queue:Wi.queue,next:null},null===Hi?Bi.memoizedState=Hi=e:Hi=Hi.next=e}return Hi}function bt(e,n){return"function"==typeof n?n(e):n}function kt(e,n,r){if(null===(r=(n=yt()).queue))throw Error(t(311));r.lastRenderedReducer=e;var l=Wi,a=l.baseQueue,u=r.pending;if(null!==u){if(null!==a){var o=a.next;a.next=u.next,u.next=o}l.baseQueue=a=u,r.pending=null}if(null!==a){u=a.next,l=l.baseState;var i=o=null,s=null,c=u;do{var f=c.lane;if((Ai&f)===f)null!==s&&(s=s.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),l=c.hasEagerState?c.eagerState:e(l,c.action);else{var d={lane:f,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===s?(i=s=d,o=l):s=s.next=d,Bi.lanes|=f,zs|=f}c=c.next}while(null!==c&&c!==u);null===s?o=l:s.next=i,wo(l,n.memoizedState)||(ns=!0),n.memoizedState=l,n.baseState=o,n.baseQueue=s,r.lastRenderedState=l}if(null!==(e=r.interleaved)){a=e;do{u=a.lane,Bi.lanes|=u,zs|=u,a=a.next}while(a!==e)}else null===a&&(r.lanes=0);return[n.memoizedState,r.dispatch]}function wt(e,n,r){if(null===(r=(n=yt()).queue))throw Error(t(311));r.lastRenderedReducer=e;var l=r.dispatch,a=r.pending,u=n.memoizedState;if(null!==a){r.pending=null;var o=a=a.next;do{u=e(u,o.action),o=o.next}while(o!==a);wo(u,n.memoizedState)||(ns=!0),n.memoizedState=u,null===n.baseQueue&&(n.baseState=u),r.lastRenderedState=u}return[u,l]}function St(e,n,t){}function xt(e,n,r){r=Bi;var l=yt(),a=n(),u=!wo(l.memoizedState,a);if(u&&(l.memoizedState=a,ns=!0),l=l.queue,Dt(zt.bind(null,r,l,e),[e]),l.getSnapshot!==n||u||null!==Hi&&1&Hi.memoizedState.tag){if(r.flags|=2048,Lt(9,Ct.bind(null,r,l,a,n),void 0,null),null===bs)throw Error(t(349));30&Ai||Et(r,n,a)}return a}function Et(e,n,t){e.flags|=16384,e={getSnapshot:n,value:t},null===(n=Bi.updateQueue)?(n={lastEffect:null,stores:null},Bi.updateQueue=n,n.stores=[e]):null===(t=n.stores)?n.stores=[e]:t.push(e)}function Ct(e,n,t,r){n.value=t,n.getSnapshot=r,Nt(n)&&Pt(e)}function zt(e,n,t){return t((function(){Nt(n)&&Pt(e)}))}function Nt(e){var n=e.getSnapshot;e=e.value;try{var t=n();return!wo(e,t)}catch(e){return!0}}function Pt(e){var n=Gn(e,1);null!==n&&al(n,e,1,-1)}function _t(e){var n=vt();return"function"==typeof e&&(e=e()),n.memoizedState=n.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bt,lastRenderedState:e},n.queue=e,e=e.dispatch=qt.bind(null,Bi,e),[n.memoizedState,e]}function Lt(e,n,t,r){return e={tag:e,create:n,destroy:t,deps:r,next:null},null===(n=Bi.updateQueue)?(n={lastEffect:null,stores:null},Bi.updateQueue=n,n.lastEffect=e.next=e):null===(t=n.lastEffect)?n.lastEffect=e.next=e:(r=t.next,t.next=e,e.next=r,n.lastEffect=e),e}function Tt(e){return yt().memoizedState}function Mt(e,n,t,r){var l=vt();Bi.flags|=e,l.memoizedState=Lt(1|n,t,void 0,void 0===r?null:r)}function Ft(e,n,t,r){var l=yt();r=void 0===r?null:r;var a=void 0;if(null!==Wi){var u=Wi.memoizedState;if(a=u.destroy,null!==r&&mt(r,u.deps))return void(l.memoizedState=Lt(n,t,a,r))}Bi.flags|=e,l.memoizedState=Lt(1|n,t,a,r)}function Rt(e,n){return Mt(8390656,8,e,n)}function Dt(e,n){return Ft(2048,8,e,n)}function Ot(e,n){return Ft(4,2,e,n)}function It(e,n){return Ft(4,4,e,n)}function Ut(e,n){return"function"==typeof n?(e=e(),n(e),function(){n(null)}):null!=n?(e=e(),n.current=e,function(){n.current=null}):void 0}function Vt(e,n,t){return t=null!=t?t.concat([e]):null,Ft(4,4,Ut.bind(null,n,e),t)}function At(e,n){}function Bt(e,n){var t=yt();n=void 0===n?null:n;var r=t.memoizedState;return null!==r&&null!==n&&mt(n,r[1])?r[0]:(t.memoizedState=[e,n],e)}function Wt(e,n){var t=yt();n=void 0===n?null:n;var r=t.memoizedState;return null!==r&&null!==n&&mt(n,r[1])?r[0]:(e=e(),t.memoizedState=[e,n],e)}function Ht(e,n,t){return 21&Ai?(wo(t,n)||(t=Z(),Bi.lanes|=t,zs|=t,e.baseState=!0),n):(e.baseState&&(e.baseState=!1,ns=!0),e.memoizedState=t)}function Qt(e,n,t){xu=0!==(t=xu)&&4>t?t:4,e(!0);var r=Vi.transition;Vi.transition={};try{e(!1),n()}finally{xu=t,Vi.transition=r}}function jt(){return yt().memoizedState}function $t(e,n,t){var r=ll(e);t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},Kt(e)?Yt(n,t):null!==(t=Xn(e,n,t,r))&&(al(t,e,r,rl()),Xt(t,n,r))}function qt(e,n,t){var r=ll(e),l={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(Kt(e))Yt(n,l);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=n.lastRenderedReducer))try{var u=n.lastRenderedState,o=a(u,t);if(l.hasEagerState=!0,l.eagerState=o,wo(o,u)){var i=n.interleaved;return null===i?(l.next=l,Yn(n)):(l.next=i.next,i.next=l),void(n.interleaved=l)}}catch(e){}null!==(t=Xn(e,n,l,r))&&(al(t,e,r,l=rl()),Xt(t,n,r))}}function Kt(e){var n=e.alternate;return e===Bi||null!==n&&n===Bi}function Yt(e,n){ji=Qi=!0;var t=e.pending;null===t?n.next=n:(n.next=t.next,t.next=n),e.pending=n}function Xt(e,n,t){if(4194240&t){var r=n.lanes;t|=r&=e.pendingLanes,n.lanes=t,ne(e,t)}}function Gt(e,n){if(e&&e.defaultProps){for(var t in n=La({},n),e=e.defaultProps)void 0===n[t]&&(n[t]=e[t]);return n}return n}function Zt(e,n,t,r){t=null==(t=t(r,n=e.memoizedState))?n:La({},n,t),e.memoizedState=t,0===e.lanes&&(e.updateQueue.baseState=t)}function Jt(e,n,t,r,l,a,u){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,u):!(n.prototype&&n.prototype.isPureReactComponent&&Oe(t,r)&&Oe(l,a))}function er(e,n,t){var r=!1,l=ti,a=n.contextType;return"object"==typeof a&&null!==a?a=Kn(a):(l=wn(n)?ai:ri.current,a=(r=null!=(r=n.contextTypes))?kn(e,l):ti),n=new n(t,a),e.memoizedState=null!==n.state&&void 0!==n.state?n.state:null,n.updater=Zi,e.stateNode=n,n._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=l,e.__reactInternalMemoizedMaskedChildContext=a),n}function nr(e,n,t,r){e=n.state,"function"==typeof n.componentWillReceiveProps&&n.componentWillReceiveProps(t,r),"function"==typeof n.UNSAFE_componentWillReceiveProps&&n.UNSAFE_componentWillReceiveProps(t,r),n.state!==e&&Zi.enqueueReplaceState(n,n.state,null)}function tr(e,n,t,r){var l=e.stateNode;l.props=t,l.state=e.memoizedState,l.refs={},Zn(e);var a=n.contextType;"object"==typeof a&&null!==a?l.context=Kn(a):(a=wn(n)?ai:ri.current,l.context=kn(e,a)),l.state=e.memoizedState,"function"==typeof(a=n.getDerivedStateFromProps)&&(Zt(e,n,a,t),l.state=e.memoizedState),"function"==typeof n.getDerivedStateFromProps||"function"==typeof l.getSnapshotBeforeUpdate||"function"!=typeof l.UNSAFE_componentWillMount&&"function"!=typeof l.componentWillMount||(n=l.state,"function"==typeof l.componentWillMount&&l.componentWillMount(),"function"==typeof l.UNSAFE_componentWillMount&&l.UNSAFE_componentWillMount(),n!==l.state&&Zi.enqueueReplaceState(l,l.state,null),lt(e,t,l,r),l.state=e.memoizedState),"function"==typeof l.componentDidMount&&(e.flags|=4194308)}function rr(e,n){try{var t="",r=n;do{t+=c(r),r=r.return}while(r);var l=t}catch(e){l="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:n,stack:l,digest:null}}function lr(e,n,t){return{value:e,source:null,stack:null!=t?t:null,digest:null!=n?n:null}}function ar(e,n){try{console.error(n.value)}catch(e){setTimeout((function(){throw e}))}}function ur(e,n,t){(t=et(-1,t)).tag=3,t.payload={element:null};var r=n.value;return t.callback=function(){Rs||(Rs=!0,Ds=r),ar(0,n)},t}function or(e,n,t){(t=et(-1,t)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var l=n.value;t.payload=function(){return r(l)},t.callback=function(){ar(0,n)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(t.callback=function(){ar(0,n),"function"!=typeof r&&(null===Os?Os=new Set([this]):Os.add(this));var e=n.stack;this.componentDidCatch(n.value,{componentStack:null!==e?e:""})}),t}function ir(e,n,t){var r=e.pingCache;if(null===r){r=e.pingCache=new Ji;var l=new Set;r.set(n,l)}else void 0===(l=r.get(n))&&(l=new Set,r.set(n,l));l.has(t)||(l.add(t),e=Nl.bind(null,e,n,t),n.then(e,e))}function sr(e){do{var n;if((n=13===e.tag)&&(n=null===(n=e.memoizedState)||null!==n.dehydrated),n)return e;e=e.return}while(null!==e);return null}function cr(e,n,t,r,l){return 1&e.mode?(e.flags|=65536,e.lanes=l,e):(e===n?e.flags|=65536:(e.flags|=128,t.flags|=131072,t.flags&=-52805,1===t.tag&&(null===t.alternate?t.tag=17:((n=et(-1,1)).tag=2,nt(t,n,1))),t.lanes|=1),e)}function fr(e,n,t,r){n.child=null===e?Ei(n,null,t,r):xi(n,e.child,t,r)}function dr(e,n,t,r,l){t=t.render;var a=n.ref;return qn(n,l),r=ht(e,n,t,r,a,l),t=gt(),null===e||ns?(ki&&t&&Ln(n),n.flags|=1,fr(e,n,r,l),n.child):(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l,Lr(e,n,l))}function pr(e,n,t,r,l){if(null===e){var a=t.type;return"function"!=typeof a||Fl(a)||void 0!==a.defaultProps||null!==t.compare||void 0!==t.defaultProps?((e=Dl(t.type,null,r,n,n.mode,l)).ref=n.ref,e.return=n,n.child=e):(n.tag=15,n.type=a,mr(e,n,a,r,l))}if(a=e.child,!(e.lanes&l)){var u=a.memoizedProps;if((t=null!==(t=t.compare)?t:Oe)(u,r)&&e.ref===n.ref)return Lr(e,n,l)}return n.flags|=1,(e=Rl(a,r)).ref=n.ref,e.return=n,n.child=e}function mr(e,n,t,r,l){if(null!==e){var a=e.memoizedProps;if(Oe(a,r)&&e.ref===n.ref){if(ns=!1,n.pendingProps=r=a,!(e.lanes&l))return n.lanes=e.lanes,Lr(e,n,l);131072&e.flags&&(ns=!0)}}return vr(e,n,t,r,l)}function hr(e,n,t){var r=n.pendingProps,l=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&n.mode){if(!(1073741824&t))return e=null!==a?a.baseLanes|t:t,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,bn(xs,Ss),Ss|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:t,bn(xs,Ss),Ss|=r}else n.memoizedState={baseLanes:0,cachePool:null,transitions:null},bn(xs,Ss),Ss|=t;else null!==a?(r=a.baseLanes|t,n.memoizedState=null):r=t,bn(xs,Ss),Ss|=r;return fr(e,n,l,t),n.child}function gr(e,n){var t=n.ref;(null===e&&null!==t||null!==e&&e.ref!==t)&&(n.flags|=512,n.flags|=2097152)}function vr(e,n,t,r,l){var a=wn(t)?ai:ri.current;return a=kn(n,a),qn(n,l),t=ht(e,n,t,r,a,l),r=gt(),null===e||ns?(ki&&r&&Ln(n),n.flags|=1,fr(e,n,t,l),n.child):(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l,Lr(e,n,l))}function yr(e,n,t,r,l){if(wn(t)){var a=!0;En(n)}else a=!1;if(qn(n,l),null===n.stateNode)_r(e,n),er(n,t,r),tr(n,t,r,l),r=!0;else if(null===e){var u=n.stateNode,o=n.memoizedProps;u.props=o;var i=u.context,s=t.contextType;s="object"==typeof s&&null!==s?Kn(s):kn(n,s=wn(t)?ai:ri.current);var c=t.getDerivedStateFromProps,f="function"==typeof c||"function"==typeof u.getSnapshotBeforeUpdate;f||"function"!=typeof u.UNSAFE_componentWillReceiveProps&&"function"!=typeof u.componentWillReceiveProps||(o!==r||i!==s)&&nr(n,u,r,s),Ti=!1;var d=n.memoizedState;u.state=d,lt(n,r,u,l),i=n.memoizedState,o!==r||d!==i||li.current||Ti?("function"==typeof c&&(Zt(n,t,c,r),i=n.memoizedState),(o=Ti||Jt(n,t,o,r,d,i,s))?(f||"function"!=typeof u.UNSAFE_componentWillMount&&"function"!=typeof u.componentWillMount||("function"==typeof u.componentWillMount&&u.componentWillMount(),"function"==typeof u.UNSAFE_componentWillMount&&u.UNSAFE_componentWillMount()),"function"==typeof u.componentDidMount&&(n.flags|=4194308)):("function"==typeof u.componentDidMount&&(n.flags|=4194308),n.memoizedProps=r,n.memoizedState=i),u.props=r,u.state=i,u.context=s,r=o):("function"==typeof u.componentDidMount&&(n.flags|=4194308),r=!1)}else{u=n.stateNode,Jn(e,n),o=n.memoizedProps,s=n.type===n.elementType?o:Gt(n.type,o),u.props=s,f=n.pendingProps,d=u.context,i="object"==typeof(i=t.contextType)&&null!==i?Kn(i):kn(n,i=wn(t)?ai:ri.current);var p=t.getDerivedStateFromProps;(c="function"==typeof p||"function"==typeof u.getSnapshotBeforeUpdate)||"function"!=typeof u.UNSAFE_componentWillReceiveProps&&"function"!=typeof u.componentWillReceiveProps||(o!==f||d!==i)&&nr(n,u,r,i),Ti=!1,d=n.memoizedState,u.state=d,lt(n,r,u,l);var m=n.memoizedState;o!==f||d!==m||li.current||Ti?("function"==typeof p&&(Zt(n,t,p,r),m=n.memoizedState),(s=Ti||Jt(n,t,s,r,d,m,i)||!1)?(c||"function"!=typeof u.UNSAFE_componentWillUpdate&&"function"!=typeof u.componentWillUpdate||("function"==typeof u.componentWillUpdate&&u.componentWillUpdate(r,m,i),"function"==typeof u.UNSAFE_componentWillUpdate&&u.UNSAFE_componentWillUpdate(r,m,i)),"function"==typeof u.componentDidUpdate&&(n.flags|=4),"function"==typeof u.getSnapshotBeforeUpdate&&(n.flags|=1024)):("function"!=typeof u.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(n.flags|=4),"function"!=typeof u.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(n.flags|=1024),n.memoizedProps=r,n.memoizedState=m),u.props=r,u.state=m,u.context=i,r=s):("function"!=typeof u.componentDidUpdate||o===e.memoizedProps&&d===e.memoizedState||(n.flags|=4),"function"!=typeof u.getSnapshotBeforeUpdate||o===e.memoizedProps&&d===e.memoizedState||(n.flags|=1024),r=!1)}return br(e,n,t,r,a,l)}function br(e,n,t,r,l,a){gr(e,n);var u=!!(128&n.flags);if(!r&&!u)return l&&Cn(n,t,!1),Lr(e,n,a);r=n.stateNode,es.current=n;var o=u&&"function"!=typeof t.getDerivedStateFromError?null:r.render();return n.flags|=1,null!==e&&u?(n.child=xi(n,e.child,null,a),n.child=xi(n,null,o,a)):fr(e,n,o,a),n.memoizedState=r.state,l&&Cn(n,t,!0),n.child}function kr(e){var n=e.stateNode;n.pendingContext?Sn(0,n.pendingContext,n.pendingContext!==n.context):n.context&&Sn(0,n.context,!1),ot(e,n.containerInfo)}function wr(e,n,t,r,l){return Un(),Vn(l),n.flags|=256,fr(e,n,t,r),n.child}function Sr(e){return{baseLanes:e,cachePool:null,transitions:null}}function xr(e,n,r){var l,a=n.pendingProps,u=Oi.current,o=!1,i=!!(128&n.flags);if((l=i)||(l=(null===e||null!==e.memoizedState)&&!!(2&u)),l?(o=!0,n.flags&=-129):null!==e&&null===e.memoizedState||(u|=1),bn(Oi,1&u),null===e)return Dn(n),null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)?(1&n.mode?"$!"===e.data?n.lanes=8:n.lanes=1073741824:n.lanes=1,null):(i=a.children,e=a.fallback,o?(a=n.mode,o=n.child,i={mode:"hidden",children:i},1&a||null===o?o=Il(i,a,0,null):(o.childLanes=0,o.pendingProps=i),e=Ol(e,a,r,null),o.return=n,e.return=n,o.sibling=e,n.child=o,n.child.memoizedState=Sr(r),n.memoizedState=ts,e):Er(n,i));if(null!==(u=e.memoizedState)&&null!==(l=u.dehydrated))return function(e,n,r,l,a,u,o){if(r)return 256&n.flags?(n.flags&=-257,Cr(e,n,o,l=lr(Error(t(422))))):null!==n.memoizedState?(n.child=e.child,n.flags|=128,null):(u=l.fallback,a=n.mode,l=Il({mode:"visible",children:l.children},a,0,null),(u=Ol(u,a,o,null)).flags|=2,l.return=n,u.return=n,l.sibling=u,n.child=l,1&n.mode&&xi(n,e.child,null,o),n.child.memoizedState=Sr(o),n.memoizedState=ts,u);if(!(1&n.mode))return Cr(e,n,o,null);if("$!"===a.data){if(l=a.nextSibling&&a.nextSibling.dataset)var i=l.dgst;return l=i,Cr(e,n,o,l=lr(u=Error(t(419)),l,void 0))}if(i=!!(o&e.childLanes),ns||i){if(null!==(l=bs)){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}0!==(a=a&(l.suspendedLanes|o)?0:a)&&a!==u.retryLane&&(u.retryLane=a,Gn(e,a),al(l,e,a,-1))}return vl(),Cr(e,n,o,l=lr(Error(t(421))))}return"$?"===a.data?(n.flags|=128,n.child=e.child,n=_l.bind(null,e),a._reactRetry=n,null):(e=u.treeContext,bi=fn(a.nextSibling),yi=n,ki=!0,wi=null,null!==e&&(pi[mi++]=gi,pi[mi++]=vi,pi[mi++]=hi,gi=e.id,vi=e.overflow,hi=n),(n=Er(n,l.children)).flags|=4096,n)}(e,n,i,a,l,u,r);if(o){o=a.fallback,i=n.mode,l=(u=e.child).sibling;var s={mode:"hidden",children:a.children};return 1&i||n.child===u?(a=Rl(u,s)).subtreeFlags=14680064&u.subtreeFlags:((a=n.child).childLanes=0,a.pendingProps=s,n.deletions=null),null!==l?o=Rl(l,o):(o=Ol(o,i,r,null)).flags|=2,o.return=n,a.return=n,a.sibling=o,n.child=a,a=o,o=n.child,i=null===(i=e.child.memoizedState)?Sr(r):{baseLanes:i.baseLanes|r,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~r,n.memoizedState=ts,a}return e=(o=e.child).sibling,a=Rl(o,{mode:"visible",children:a.children}),!(1&n.mode)&&(a.lanes=r),a.return=n,a.sibling=null,null!==e&&(null===(r=n.deletions)?(n.deletions=[e],n.flags|=16):r.push(e)),n.child=a,n.memoizedState=null,a}function Er(e,n,t){return(n=Il({mode:"visible",children:n},e.mode,0,null)).return=e,e.child=n}function Cr(e,n,t,r){return null!==r&&Vn(r),xi(n,e.child,null,t),(e=Er(n,n.pendingProps.children)).flags|=2,n.memoizedState=null,e}function zr(e,n,t){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n),$n(e.return,n,t)}function Nr(e,n,t,r,l){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:l}:(a.isBackwards=n,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=t,a.tailMode=l)}function Pr(e,n,t){var r=n.pendingProps,l=r.revealOrder,a=r.tail;if(fr(e,n,r.children,t),2&(r=Oi.current))r=1&r|2,n.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=n.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&zr(e,t,n);else if(19===e.tag)zr(e,t,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(bn(Oi,r),1&n.mode)switch(l){case"forwards":for(t=n.child,l=null;null!==t;)null!==(e=t.alternate)&&null===ft(e)&&(l=t),t=t.sibling;null===(t=l)?(l=n.child,n.child=null):(l=t.sibling,t.sibling=null),Nr(n,!1,l,t,a);break;case"backwards":for(t=null,l=n.child,n.child=null;null!==l;){if(null!==(e=l.alternate)&&null===ft(e)){n.child=l;break}e=l.sibling,l.sibling=t,t=l,l=e}Nr(n,!0,t,null,a);break;case"together":Nr(n,!1,null,null,void 0);break;default:n.memoizedState=null}else n.memoizedState=null;return n.child}function _r(e,n){!(1&n.mode)&&null!==e&&(e.alternate=null,n.alternate=null,n.flags|=2)}function Lr(e,n,r){if(null!==e&&(n.dependencies=e.dependencies),zs|=n.lanes,!(r&n.childLanes))return null;if(null!==e&&n.child!==e.child)throw Error(t(153));if(null!==n.child){for(r=Rl(e=n.child,e.pendingProps),n.child=r,r.return=n;null!==e.sibling;)e=e.sibling,(r=r.sibling=Rl(e,e.pendingProps)).return=n;r.sibling=null}return n.child}function Tr(e,n){if(!ki)switch(e.tailMode){case"hidden":n=e.tail;for(var t=null;null!==n;)null!==n.alternate&&(t=n),n=n.sibling;null===t?e.tail=null:t.sibling=null;break;case"collapsed":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?n||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mr(e){var n=null!==e.alternate&&e.alternate.child===e.child,t=0,r=0;if(n)for(var l=e.child;null!==l;)t|=l.lanes|l.childLanes,r|=14680064&l.subtreeFlags,r|=14680064&l.flags,l.return=e,l=l.sibling;else for(l=e.child;null!==l;)t|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=t,n}function Fr(e,n,r){var l=n.pendingProps;switch(Tn(n),n.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mr(n),null;case 1:case 17:return wn(n.type)&&(yn(li),yn(ri)),Mr(n),null;case 3:return l=n.stateNode,it(),yn(li),yn(ri),dt(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),null!==e&&null!==e.child||(In(n)?n.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&n.flags)||(n.flags|=1024,null!==wi&&(sl(wi),wi=null))),ls(e,n),Mr(n),null;case 5:ct(n);var a=ut(Di.current);if(r=n.type,null!==e&&null!=n.stateNode)as(e,n,r,l,a),e.ref!==n.ref&&(n.flags|=512,n.flags|=2097152);else{if(!l){if(null===n.stateNode)throw Error(t(166));return Mr(n),null}if(e=ut(Fi.current),In(n)){l=n.stateNode,r=n.type;var o=n.memoizedProps;switch(l[Ko]=n,l[Yo]=o,e=!!(1&n.mode),r){case"dialog":Ye("cancel",l),Ye("close",l);break;case"iframe":case"object":case"embed":Ye("load",l);break;case"video":case"audio":for(a=0;a<Oo.length;a++)Ye(Oo[a],l);break;case"source":Ye("error",l);break;case"img":case"image":case"link":Ye("error",l),Ye("load",l);break;case"details":Ye("toggle",l);break;case"input":b(l,o),Ye("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!o.multiple},Ye("invalid",l);break;case"textarea":z(l,o),Ye("invalid",l)}for(var i in F(r,o),a=null,o)if(o.hasOwnProperty(i)){var s=o[i];"children"===i?"string"==typeof s?l.textContent!==s&&(!0!==o.suppressHydrationWarning&&an(l.textContent,s,e),a=["children",s]):"number"==typeof s&&l.textContent!==""+s&&(!0!==o.suppressHydrationWarning&&an(l.textContent,s,e),a=["children",""+s]):ra.hasOwnProperty(i)&&null!=s&&"onScroll"===i&&Ye("scroll",l)}switch(r){case"input":h(l),S(l,o,!0);break;case"textarea":h(l),P(l);break;case"select":case"option":break;default:"function"==typeof o.onClick&&(l.onclick=un)}l=a,n.updateQueue=l,null!==l&&(n.flags|=4)}else{i=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=_(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=i.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof l.is?e=i.createElement(r,{is:l.is}):(e=i.createElement(r),"select"===r&&(i=e,l.multiple?i.multiple=!0:l.size&&(i.size=l.size))):e=i.createElementNS(e,r),e[Ko]=n,e[Yo]=l,rs(e,n,!1,!1),n.stateNode=e;e:{switch(i=R(r,l),r){case"dialog":Ye("cancel",e),Ye("close",e),a=l;break;case"iframe":case"object":case"embed":Ye("load",e),a=l;break;case"video":case"audio":for(a=0;a<Oo.length;a++)Ye(Oo[a],e);a=l;break;case"source":Ye("error",e),a=l;break;case"img":case"image":case"link":Ye("error",e),Ye("load",e),a=l;break;case"details":Ye("toggle",e),a=l;break;case"input":b(e,l),a=y(e,l),Ye("invalid",e);break;case"option":default:a=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},a=La({},l,{value:void 0}),Ye("invalid",e);break;case"textarea":z(e,l),a=C(e,l),Ye("invalid",e)}for(o in F(r,a),s=a)if(s.hasOwnProperty(o)){var c=s[o];"style"===o?M(e,c):"dangerouslySetInnerHTML"===o?null!=(c=c?c.__html:void 0)&&Fa(e,c):"children"===o?"string"==typeof c?("textarea"!==r||""!==c)&&Ra(e,c):"number"==typeof c&&Ra(e,""+c):"suppressContentEditableWarning"!==o&&"suppressHydrationWarning"!==o&&"autoFocus"!==o&&(ra.hasOwnProperty(o)?null!=c&&"onScroll"===o&&Ye("scroll",e):null!=c&&u(e,o,c,i))}switch(r){case"input":h(e),S(e,l,!1);break;case"textarea":h(e),P(e);break;case"option":null!=l.value&&e.setAttribute("value",""+p(l.value));break;case"select":e.multiple=!!l.multiple,null!=(o=l.value)?E(e,!!l.multiple,o,!1):null!=l.defaultValue&&E(e,!!l.multiple,l.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=un)}switch(r){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(n.flags|=4)}null!==n.ref&&(n.flags|=512,n.flags|=2097152)}return Mr(n),null;case 6:if(e&&null!=n.stateNode)us(e,n,e.memoizedProps,l);else{if("string"!=typeof l&&null===n.stateNode)throw Error(t(166));if(r=ut(Di.current),ut(Fi.current),In(n)){if(l=n.stateNode,r=n.memoizedProps,l[Ko]=n,(o=l.nodeValue!==r)&&null!==(e=yi))switch(e.tag){case 3:an(l.nodeValue,r,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&an(l.nodeValue,r,!!(1&e.mode))}o&&(n.flags|=4)}else(l=(9===r.nodeType?r:r.ownerDocument).createTextNode(l))[Ko]=n,n.stateNode=l}return Mr(n),null;case 13:if(yn(Oi),l=n.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(ki&&null!==bi&&1&n.mode&&!(128&n.flags)){for(o=bi;o;)o=fn(o.nextSibling);Un(),n.flags|=98560,o=!1}else if(o=In(n),null!==l&&null!==l.dehydrated){if(null===e){if(!o)throw Error(t(318));if(!(o=null!==(o=n.memoizedState)?o.dehydrated:null))throw Error(t(317));o[Ko]=n}else Un(),!(128&n.flags)&&(n.memoizedState=null),n.flags|=4;Mr(n),o=!1}else null!==wi&&(sl(wi),wi=null),o=!0;if(!o)return 65536&n.flags?n:null}return 128&n.flags?(n.lanes=r,n):((l=null!==l)!=(null!==e&&null!==e.memoizedState)&&l&&(n.child.flags|=8192,1&n.mode&&(null===e||1&Oi.current?0===Es&&(Es=3):vl())),null!==n.updateQueue&&(n.flags|=4),Mr(n),null);case 4:return it(),ls(e,n),null===e&&Ge(n.stateNode.containerInfo),Mr(n),null;case 10:return jn(n.type._context),Mr(n),null;case 19:if(yn(Oi),null===(o=n.memoizedState))return Mr(n),null;if(l=!!(128&n.flags),null===(i=o.rendering))if(l)Tr(o,!1);else{if(0!==Es||null!==e&&128&e.flags)for(e=n.child;null!==e;){if(null!==(i=ft(e))){for(n.flags|=128,Tr(o,!1),null!==(l=i.updateQueue)&&(n.updateQueue=l,n.flags|=4),n.subtreeFlags=0,l=r,r=n.child;null!==r;)e=l,(o=r).flags&=14680066,null===(i=o.alternate)?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return bn(Oi,1&Oi.current|2),n.child}e=e.sibling}null!==o.tail&&su()>Ms&&(n.flags|=128,l=!0,Tr(o,!1),n.lanes=4194304)}else{if(!l)if(null!==(e=ft(i))){if(n.flags|=128,l=!0,null!==(r=e.updateQueue)&&(n.updateQueue=r,n.flags|=4),Tr(o,!0),null===o.tail&&"hidden"===o.tailMode&&!i.alternate&&!ki)return Mr(n),null}else 2*su()-o.renderingStartTime>Ms&&1073741824!==r&&(n.flags|=128,l=!0,Tr(o,!1),n.lanes=4194304);o.isBackwards?(i.sibling=n.child,n.child=i):(null!==(r=o.last)?r.sibling=i:n.child=i,o.last=i)}return null!==o.tail?(n=o.tail,o.rendering=n,o.tail=n.sibling,o.renderingStartTime=su(),n.sibling=null,r=Oi.current,bn(Oi,l?1&r|2:1&r),n):(Mr(n),null);case 22:case 23:return Ss=xs.current,yn(xs),l=null!==n.memoizedState,null!==e&&null!==e.memoizedState!==l&&(n.flags|=8192),l&&1&n.mode?!!(1073741824&Ss)&&(Mr(n),6&n.subtreeFlags&&(n.flags|=8192)):Mr(n),null;case 24:case 25:return null}throw Error(t(156,n.tag))}function Rr(e,n,r){switch(Tn(n),n.tag){case 1:return wn(n.type)&&(yn(li),yn(ri)),65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 3:return it(),yn(li),yn(ri),dt(),65536&(e=n.flags)&&!(128&e)?(n.flags=-65537&e|128,n):null;case 5:return ct(n),null;case 13:if(yn(Oi),null!==(e=n.memoizedState)&&null!==e.dehydrated){if(null===n.alternate)throw Error(t(340));Un()}return 65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 19:return yn(Oi),null;case 4:return it(),null;case 10:return jn(n.type._context),null;case 22:case 23:return Ss=xs.current,yn(xs),null;default:return null}}function Dr(e,n){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){zl(e,n,t)}else t.current=null}function Or(e,n,t){try{t()}catch(t){zl(e,n,t)}}function Ir(e,n,t){var r=n.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var l=r=r.next;do{if((l.tag&e)===e){var a=l.destroy;l.destroy=void 0,void 0!==a&&Or(n,t,a)}l=l.next}while(l!==r)}}function Ur(e,n){if(null!==(n=null!==(n=n.updateQueue)?n.lastEffect:null)){var t=n=n.next;do{if((t.tag&e)===e){var r=t.create;t.destroy=r()}t=t.next}while(t!==n)}}function Vr(e){var n=e.ref;if(null!==n){var t=e.stateNode;e.tag,e=t,"function"==typeof n?n(e):n.current=e}}function Ar(e){var n=e.alternate;null!==n&&(e.alternate=null,Ar(n)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(n=e.stateNode)&&(delete n[Ko],delete n[Yo],delete n[Go],delete n[Zo],delete n[Jo]),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Br(e){return 5===e.tag||3===e.tag||4===e.tag}function Wr(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Br(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function Hr(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?8===t.nodeType?t.parentNode.insertBefore(e,n):t.insertBefore(e,n):(8===t.nodeType?(n=t.parentNode).insertBefore(e,t):(n=t).appendChild(e),null!=(t=t._reactRootContainer)||null!==n.onclick||(n.onclick=un));else if(4!==r&&null!==(e=e.child))for(Hr(e,n,t),e=e.sibling;null!==e;)Hr(e,n,t),e=e.sibling}function Qr(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?t.insertBefore(e,n):t.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Qr(e,n,t),e=e.sibling;null!==e;)Qr(e,n,t),e=e.sibling}function jr(e,n,t){for(t=t.child;null!==t;)$r(e,n,t),t=t.sibling}function $r(e,n,t){if(vu&&"function"==typeof vu.onCommitFiberUnmount)try{vu.onCommitFiberUnmount(gu,t)}catch(e){}switch(t.tag){case 5:is||Dr(t,n);case 6:var r=ds,l=ps;ds=null,jr(e,n,t),ps=l,null!==(ds=r)&&(ps?(e=ds,t=t.stateNode,8===e.nodeType?e.parentNode.removeChild(t):e.removeChild(t)):ds.removeChild(t.stateNode));break;case 18:null!==ds&&(ps?(e=ds,t=t.stateNode,8===e.nodeType?cn(e.parentNode,t):1===e.nodeType&&cn(e,t),ce(e)):cn(ds,t.stateNode));break;case 4:r=ds,l=ps,ds=t.stateNode.containerInfo,ps=!0,jr(e,n,t),ds=r,ps=l;break;case 0:case 11:case 14:case 15:if(!is&&null!==(r=t.updateQueue)&&null!==(r=r.lastEffect)){l=r=r.next;do{var a=l,u=a.destroy;a=a.tag,void 0!==u&&(2&a||4&a)&&Or(t,n,u),l=l.next}while(l!==r)}jr(e,n,t);break;case 1:if(!is&&(Dr(t,n),"function"==typeof(r=t.stateNode).componentWillUnmount))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(e){zl(t,n,e)}jr(e,n,t);break;case 21:jr(e,n,t);break;case 22:1&t.mode?(is=(r=is)||null!==t.memoizedState,jr(e,n,t),is=r):jr(e,n,t);break;default:jr(e,n,t)}}function qr(e){var n=e.updateQueue;if(null!==n){e.updateQueue=null;var t=e.stateNode;null===t&&(t=e.stateNode=new ss),n.forEach((function(n){var r=Ll.bind(null,e,n);t.has(n)||(t.add(n),n.then(r,r))}))}}function Kr(e,n,r){if(null!==(r=n.deletions))for(var l=0;l<r.length;l++){var a=r[l];try{var u=e,o=n,i=o;e:for(;null!==i;){switch(i.tag){case 5:ds=i.stateNode,ps=!1;break e;case 3:case 4:ds=i.stateNode.containerInfo,ps=!0;break e}i=i.return}if(null===ds)throw Error(t(160));$r(u,o,a),ds=null,ps=!1;var s=a.alternate;null!==s&&(s.return=null),a.return=null}catch(e){zl(a,n,e)}}if(12854&n.subtreeFlags)for(n=n.child;null!==n;)Yr(n,e),n=n.sibling}function Yr(e,n,r){var l=e.alternate;switch(r=e.flags,e.tag){case 0:case 11:case 14:case 15:if(Kr(n,e),Xr(e),4&r){try{Ir(3,e,e.return),Ur(3,e)}catch(n){zl(e,e.return,n)}try{Ir(5,e,e.return)}catch(n){zl(e,e.return,n)}}break;case 1:Kr(n,e),Xr(e),512&r&&null!==l&&Dr(l,l.return);break;case 5:if(Kr(n,e),Xr(e),512&r&&null!==l&&Dr(l,l.return),32&e.flags){var a=e.stateNode;try{Ra(a,"")}catch(n){zl(e,e.return,n)}}if(4&r&&null!=(a=e.stateNode)){var o=e.memoizedProps,i=null!==l?l.memoizedProps:o,s=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===s&&"radio"===o.type&&null!=o.name&&k(a,o),R(s,i);var f=R(s,o);for(i=0;i<c.length;i+=2){var d=c[i],p=c[i+1];"style"===d?M(a,p):"dangerouslySetInnerHTML"===d?Fa(a,p):"children"===d?Ra(a,p):u(a,d,p,f)}switch(s){case"input":w(a,o);break;case"textarea":N(a,o);break;case"select":var m=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var h=o.value;null!=h?E(a,!!o.multiple,h,!1):m!==!!o.multiple&&(null!=o.defaultValue?E(a,!!o.multiple,o.defaultValue,!0):E(a,!!o.multiple,o.multiple?[]:"",!1))}a[Yo]=o}catch(n){zl(e,e.return,n)}}break;case 6:if(Kr(n,e),Xr(e),4&r){if(null===e.stateNode)throw Error(t(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(n){zl(e,e.return,n)}}break;case 3:if(Kr(n,e),Xr(e),4&r&&null!==l&&l.memoizedState.isDehydrated)try{ce(n.containerInfo)}catch(n){zl(e,e.return,n)}break;case 4:default:Kr(n,e),Xr(e);break;case 13:Kr(n,e),Xr(e),8192&(a=e.child).flags&&(o=null!==a.memoizedState,a.stateNode.isHidden=o,!o||null!==a.alternate&&null!==a.alternate.memoizedState||(Ts=su())),4&r&&qr(e);break;case 22:if(d=null!==l&&null!==l.memoizedState,1&e.mode?(is=(f=is)||d,Kr(n,e),is=f):Kr(n,e),Xr(e),8192&r){if(f=null!==e.memoizedState,(e.stateNode.isHidden=f)&&!d&&1&e.mode)for(cs=e,d=e.child;null!==d;){for(p=cs=d;null!==cs;){switch(h=(m=cs).child,m.tag){case 0:case 11:case 14:case 15:Ir(4,m,m.return);break;case 1:Dr(m,m.return);var g=m.stateNode;if("function"==typeof g.componentWillUnmount){r=m,n=m.return;try{l=r,g.props=l.memoizedProps,g.state=l.memoizedState,g.componentWillUnmount()}catch(e){zl(r,n,e)}}break;case 5:Dr(m,m.return);break;case 22:if(null!==m.memoizedState){el(p);continue}}null!==h?(h.return=m,cs=h):el(p)}d=d.sibling}e:for(d=null,p=e;;){if(5===p.tag){if(null===d){d=p;try{a=p.stateNode,f?"function"==typeof(o=a.style).setProperty?o.setProperty("display","none","important"):o.display="none":(s=p.stateNode,i=null!=(c=p.memoizedProps.style)&&c.hasOwnProperty("display")?c.display:null,s.style.display=T("display",i))}catch(n){zl(e,e.return,n)}}}else if(6===p.tag){if(null===d)try{p.stateNode.nodeValue=f?"":p.memoizedProps}catch(n){zl(e,e.return,n)}}else if((22!==p.tag&&23!==p.tag||null===p.memoizedState||p===e)&&null!==p.child){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;null===p.sibling;){if(null===p.return||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:Kr(n,e),Xr(e),4&r&&qr(e);case 21:}}function Xr(e){var n=e.flags;if(2&n){try{e:{for(var r=e.return;null!==r;){if(Br(r)){var l=r;break e}r=r.return}throw Error(t(160))}switch(l.tag){case 5:var a=l.stateNode;32&l.flags&&(Ra(a,""),l.flags&=-33),Qr(e,Wr(e),a);break;case 3:case 4:var u=l.stateNode.containerInfo;Hr(e,Wr(e),u);break;default:throw Error(t(161))}}catch(n){zl(e,e.return,n)}e.flags&=-3}4096&n&&(e.flags&=-4097)}function Gr(e,n,t){cs=e,Zr(e,n,t)}function Zr(e,n,t){for(var r=!!(1&e.mode);null!==cs;){var l=cs,a=l.child;if(22===l.tag&&r){var u=null!==l.memoizedState||os;if(!u){var o=l.alternate,i=null!==o&&null!==o.memoizedState||is;o=os;var s=is;if(os=u,(is=i)&&!s)for(cs=l;null!==cs;)i=(u=cs).child,22===u.tag&&null!==u.memoizedState?nl(l):null!==i?(i.return=u,cs=i):nl(l);for(;null!==a;)cs=a,Zr(a,n,t),a=a.sibling;cs=l,os=o,is=s}Jr(e,n,t)}else 8772&l.subtreeFlags&&null!==a?(a.return=l,cs=a):Jr(e,n,t)}}function Jr(e,n,r){for(;null!==cs;){if(8772&(n=cs).flags){r=n.alternate;try{if(8772&n.flags)switch(n.tag){case 0:case 11:case 15:is||Ur(5,n);break;case 1:var l=n.stateNode;if(4&n.flags&&!is)if(null===r)l.componentDidMount();else{var a=n.elementType===n.type?r.memoizedProps:Gt(n.type,r.memoizedProps);l.componentDidUpdate(a,r.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var u=n.updateQueue;null!==u&&at(n,u,l);break;case 3:var o=n.updateQueue;if(null!==o){if(r=null,null!==n.child)switch(n.child.tag){case 5:case 1:r=n.child.stateNode}at(n,o,r)}break;case 5:var i=n.stateNode;if(null===r&&4&n.flags){r=i;var s=n.memoizedProps;switch(n.type){case"button":case"input":case"select":case"textarea":s.autoFocus&&r.focus();break;case"img":s.src&&(r.src=s.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===n.memoizedState){var c=n.alternate;if(null!==c){var f=c.memoizedState;if(null!==f){var d=f.dehydrated;null!==d&&ce(d)}}}break;default:throw Error(t(163))}is||512&n.flags&&Vr(n)}catch(e){zl(n,n.return,e)}}if(n===e){cs=null;break}if(null!==(r=n.sibling)){r.return=n.return,cs=r;break}cs=n.return}}function el(e){for(;null!==cs;){var n=cs;if(n===e){cs=null;break}var t=n.sibling;if(null!==t){t.return=n.return,cs=t;break}cs=n.return}}function nl(e){for(;null!==cs;){var n=cs;try{switch(n.tag){case 0:case 11:case 15:var t=n.return;try{Ur(4,n)}catch(e){zl(n,t,e)}break;case 1:var r=n.stateNode;if("function"==typeof r.componentDidMount){var l=n.return;try{r.componentDidMount()}catch(e){zl(n,l,e)}}var a=n.return;try{Vr(n)}catch(e){zl(n,a,e)}break;case 5:var u=n.return;try{Vr(n)}catch(e){zl(n,u,e)}}}catch(e){zl(n,n.return,e)}if(n===e){cs=null;break}var o=n.sibling;if(null!==o){o.return=n.return,cs=o;break}cs=n.return}}function tl(){Ms=su()+500}function rl(){return 6&ys?su():-1!==Ws?Ws:Ws=su()}function ll(e){return 1&e.mode?2&ys&&0!==ws?ws&-ws:null!==Si.transition?(0===Hs&&(Hs=Z()),Hs):0!==(e=xu)?e:e=void 0===(e=window.event)?16:he(e.type):1}function al(e,n,r,l){if(50<As)throw As=0,Bs=null,Error(t(185));ee(e,r,l),2&ys&&e===bs||(e===bs&&(!(2&ys)&&(Ns|=r),4===Es&&cl(e,ws)),ul(e,l),1===r&&0===ys&&!(1&n.mode)&&(tl(),oi&&Nn()))}function ul(e,n){var t=e.callbackNode;!function(e,n){for(var t=e.suspendedLanes,r=e.pingedLanes,l=e.expirationTimes,a=e.pendingLanes;0<a;){var u=31-yu(a),o=1<<u,i=l[u];-1===i?o&t&&!(o&r)||(l[u]=X(o,n)):i<=n&&(e.expiredLanes|=o),a&=~o}}(e,n);var r=Y(e,e===bs?ws:0);if(0===r)null!==t&&uu(t),e.callbackNode=null,e.callbackPriority=0;else if(n=r&-r,e.callbackPriority!==n){if(null!=t&&uu(t),1===n)0===e.tag?function(e){oi=!0,zn(e)}(fl.bind(null,e)):zn(fl.bind(null,e)),$o((function(){!(6&ys)&&Nn()})),t=null;else{switch(te(r)){case 1:t=fu;break;case 4:t=du;break;case 16:default:t=pu;break;case 536870912:t=hu}t=Tl(t,ol.bind(null,e))}e.callbackPriority=n,e.callbackNode=t}}function ol(e,n){if(Ws=-1,Hs=0,6&ys)throw Error(t(327));var r=e.callbackNode;if(El()&&e.callbackNode!==r)return null;var l=Y(e,e===bs?ws:0);if(0===l)return null;if(30&l||l&e.expiredLanes||n)n=yl(e,l);else{n=l;var a=ys;ys|=2;var u=gl();for(bs===e&&ws===n||(Fs=null,tl(),ml(e,n));;)try{kl();break}catch(n){hl(e,n)}Qn(),hs.current=u,ys=a,null!==ks?n=0:(bs=null,ws=0,n=Es)}if(0!==n){if(2===n&&0!==(a=G(e))&&(l=a,n=il(e,a)),1===n)throw r=Cs,ml(e,0),cl(e,l),ul(e,su()),r;if(6===n)cl(e,l);else{if(a=e.current.alternate,!(30&l||function(e){for(var n=e;;){if(16384&n.flags){var t=n.updateQueue;if(null!==t&&null!==(t=t.stores))for(var r=0;r<t.length;r++){var l=t[r],a=l.getSnapshot;l=l.value;try{if(!wo(a(),l))return!1}catch(e){return!1}}}if(t=n.child,16384&n.subtreeFlags&&null!==t)t.return=n,n=t;else{if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}(a)||(n=yl(e,l),2===n&&(u=G(e),0!==u&&(l=u,n=il(e,u))),1!==n)))throw r=Cs,ml(e,0),cl(e,l),ul(e,su()),r;switch(e.finishedWork=a,e.finishedLanes=l,n){case 0:case 1:throw Error(t(345));case 2:case 5:xl(e,Ls,Fs);break;case 3:if(cl(e,l),(130023424&l)===l&&10<(n=Ts+500-su())){if(0!==Y(e,0))break;if(((a=e.suspendedLanes)&l)!==l){rl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Ho(xl.bind(null,e,Ls,Fs),n);break}xl(e,Ls,Fs);break;case 4:if(cl(e,l),(4194240&l)===l)break;for(n=e.eventTimes,a=-1;0<l;){var o=31-yu(l);u=1<<o,(o=n[o])>a&&(a=o),l&=~u}if(l=a,10<(l=(120>(l=su()-l)?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*ms(l/1960))-l)){e.timeoutHandle=Ho(xl.bind(null,e,Ls,Fs),l);break}xl(e,Ls,Fs);break;default:throw Error(t(329))}}}return ul(e,su()),e.callbackNode===r?ol.bind(null,e):null}function il(e,n){var t=_s;return e.current.memoizedState.isDehydrated&&(ml(e,n).flags|=256),2!==(e=yl(e,n))&&(n=Ls,Ls=t,null!==n&&sl(n)),e}function sl(e){null===Ls?Ls=e:Ls.push.apply(Ls,e)}function cl(e,n){for(n&=~Ps,n&=~Ns,e.suspendedLanes|=n,e.pingedLanes&=~n,e=e.expirationTimes;0<n;){var t=31-yu(n),r=1<<t;e[t]=-1,n&=~r}}function fl(e){if(6&ys)throw Error(t(327));El();var n=Y(e,0);if(!(1&n))return ul(e,su()),null;var r=yl(e,n);if(0!==e.tag&&2===r){var l=G(e);0!==l&&(n=l,r=il(e,l))}if(1===r)throw r=Cs,ml(e,0),cl(e,n),ul(e,su()),r;if(6===r)throw Error(t(345));return e.finishedWork=e.current.alternate,e.finishedLanes=n,xl(e,Ls,Fs),ul(e,su()),null}function dl(e,n){var t=ys;ys|=1;try{return e(n)}finally{0===(ys=t)&&(tl(),oi&&Nn())}}function pl(e){null!==Us&&0===Us.tag&&!(6&ys)&&El();var n=ys;ys|=1;var t=vs.transition,r=xu;try{if(vs.transition=null,xu=1,e)return e()}finally{xu=r,vs.transition=t,!(6&(ys=n))&&Nn()}}function ml(e,n){e.finishedWork=null,e.finishedLanes=0;var t=e.timeoutHandle;if(-1!==t&&(e.timeoutHandle=-1,Qo(t)),null!==ks)for(t=ks.return;null!==t;){var r=t;switch(Tn(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&(yn(li),yn(ri));break;case 3:it(),yn(li),yn(ri),dt();break;case 5:ct(r);break;case 4:it();break;case 13:case 19:yn(Oi);break;case 10:jn(r.type._context);break;case 22:case 23:Ss=xs.current,yn(xs)}t=t.return}if(bs=e,ks=e=Rl(e.current,null),ws=Ss=n,Es=0,Cs=null,Ps=Ns=zs=0,Ls=_s=null,null!==_i){for(n=0;n<_i.length;n++)if(null!==(r=(t=_i[n]).interleaved)){t.interleaved=null;var l=r.next,a=t.pending;if(null!==a){var u=a.next;a.next=l,r.next=u}t.pending=r}_i=null}return e}function hl(e,n){for(;;){var r=ks;try{if(Qn(),Ui.current=Ki,Qi){for(var l=Bi.memoizedState;null!==l;){var a=l.queue;null!==a&&(a.pending=null),l=l.next}Qi=!1}if(Ai=0,Hi=Wi=Bi=null,ji=!1,$i=0,gs.current=null,null===r||null===r.return){Es=1,Cs=n,ks=null;break}e:{var u=e,o=r.return,i=r,s=n;if(n=ws,i.flags|=32768,null!==s&&"object"==typeof s&&"function"==typeof s.then){var c=s,f=i,d=f.tag;if(!(1&f.mode||0!==d&&11!==d&&15!==d)){var p=f.alternate;p?(f.updateQueue=p.updateQueue,f.memoizedState=p.memoizedState,f.lanes=p.lanes):(f.updateQueue=null,f.memoizedState=null)}var m=sr(o);if(null!==m){m.flags&=-257,cr(m,o,i,0,n),1&m.mode&&ir(u,c,n),s=c;var h=(n=m).updateQueue;if(null===h){var g=new Set;g.add(s),n.updateQueue=g}else h.add(s);break e}if(!(1&n)){ir(u,c,n),vl();break e}s=Error(t(426))}else if(ki&&1&i.mode){var v=sr(o);if(null!==v){!(65536&v.flags)&&(v.flags|=256),cr(v,o,i,0,n),Vn(rr(s,i));break e}}u=s=rr(s,i),4!==Es&&(Es=2),null===_s?_s=[u]:_s.push(u),u=o;do{switch(u.tag){case 3:u.flags|=65536,n&=-n,u.lanes|=n,rt(u,ur(0,s,n));break e;case 1:i=s;var y=u.type,b=u.stateNode;if(!(128&u.flags||"function"!=typeof y.getDerivedStateFromError&&(null===b||"function"!=typeof b.componentDidCatch||null!==Os&&Os.has(b)))){u.flags|=65536,n&=-n,u.lanes|=n,rt(u,or(u,i,n));break e}}u=u.return}while(null!==u)}Sl(r)}catch(e){n=e,ks===r&&null!==r&&(ks=r=r.return);continue}break}}function gl(){var e=hs.current;return hs.current=Ki,null===e?Ki:e}function vl(){0!==Es&&3!==Es&&2!==Es||(Es=4),null===bs||!(268435455&zs)&&!(268435455&Ns)||cl(bs,ws)}function yl(e,n){var r=ys;ys|=2;var l=gl();for(bs===e&&ws===n||(Fs=null,ml(e,n));;)try{bl();break}catch(n){hl(e,n)}if(Qn(),ys=r,hs.current=l,null!==ks)throw Error(t(261));return bs=null,ws=0,Es}function bl(){for(;null!==ks;)wl(ks)}function kl(){for(;null!==ks&&!ou();)wl(ks)}function wl(e){var n=Qs(e.alternate,e,Ss);e.memoizedProps=e.pendingProps,null===n?Sl(e):ks=n,gs.current=null}function Sl(e){var n=e;do{var t=n.alternate;if(e=n.return,32768&n.flags){if(null!==(t=Rr(t,n)))return t.flags&=32767,void(ks=t);if(null===e)return Es=6,void(ks=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(t=Fr(t,n,Ss)))return void(ks=t);if(null!==(n=n.sibling))return void(ks=n);ks=n=e}while(null!==n);0===Es&&(Es=5)}function xl(e,n,r){var l=xu,a=vs.transition;try{vs.transition=null,xu=1,function(e,n,r,l){do{El()}while(null!==Us);if(6&ys)throw Error(t(327));r=e.finishedWork;var a=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(t(177));e.callbackNode=null,e.callbackPriority=0;var u=r.lanes|r.childLanes;if(function(e,n){var t=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<t;){var l=31-yu(t),a=1<<l;n[l]=0,r[l]=-1,e[l]=-1,t&=~a}}(e,u),e===bs&&(ks=bs=null,ws=0),!(2064&r.subtreeFlags)&&!(2064&r.flags)||Is||(Is=!0,Tl(pu,(function(){return El(),null}))),u=!!(15990&r.flags),15990&r.subtreeFlags||u){u=vs.transition,vs.transition=null;var o=xu;xu=1;var i=ys;ys|=4,gs.current=null,function(e,n){if(Bo=Ru,Be(e=Ae())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var l=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(l&&0!==l.rangeCount){r=l.anchorNode;var a=l.anchorOffset,u=l.focusNode;l=l.focusOffset;try{r.nodeType,u.nodeType}catch(e){r=null;break e}var o=0,i=-1,s=-1,c=0,f=0,d=e,p=null;n:for(;;){for(var m;d!==r||0!==a&&3!==d.nodeType||(i=o+a),d!==u||0!==l&&3!==d.nodeType||(s=o+l),3===d.nodeType&&(o+=d.nodeValue.length),null!==(m=d.firstChild);)p=d,d=m;for(;;){if(d===e)break n;if(p===r&&++c===a&&(i=o),p===u&&++f===l&&(s=o),null!==(m=d.nextSibling))break;p=(d=p).parentNode}d=m}r=-1===i||-1===s?null:{start:i,end:s}}else r=null}r=r||{start:0,end:0}}else r=null;for(Wo={focusedElem:e,selectionRange:r},Ru=!1,cs=n;null!==cs;)if(e=(n=cs).child,1028&n.subtreeFlags&&null!==e)e.return=n,cs=e;else for(;null!==cs;){n=cs;try{var h=n.alternate;if(1024&n.flags)switch(n.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==h){var g=h.memoizedProps,v=h.memoizedState,y=n.stateNode,b=y.getSnapshotBeforeUpdate(n.elementType===n.type?g:Gt(n.type,g),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var k=n.stateNode.containerInfo;1===k.nodeType?k.textContent="":9===k.nodeType&&k.documentElement&&k.removeChild(k.documentElement);break;default:throw Error(t(163))}}catch(e){zl(n,n.return,e)}if(null!==(e=n.sibling)){e.return=n.return,cs=e;break}cs=n.return}h=fs,fs=!1}(e,r),Yr(r,e),We(Wo),Ru=!!Bo,Wo=Bo=null,e.current=r,Gr(r,e,a),iu(),ys=i,xu=o,vs.transition=u}else e.current=r;if(Is&&(Is=!1,Us=e,Vs=a),0===(u=e.pendingLanes)&&(Os=null),function(e){if(vu&&"function"==typeof vu.onCommitFiberRoot)try{vu.onCommitFiberRoot(gu,e,void 0,!(128&~e.current.flags))}catch(e){}}(r.stateNode),ul(e,su()),null!==n)for(l=e.onRecoverableError,r=0;r<n.length;r++)a=n[r],l(a.value,{componentStack:a.stack,digest:a.digest});if(Rs)throw Rs=!1,e=Ds,Ds=null,e;!!(1&Vs)&&0!==e.tag&&El(),1&(u=e.pendingLanes)?e===Bs?As++:(As=0,Bs=e):As=0,Nn()}(e,n,r,l)}finally{vs.transition=a,xu=l}return null}function El(){if(null!==Us){var e=te(Vs),n=vs.transition,r=xu;try{if(vs.transition=null,xu=16>e?16:e,null===Us)var l=!1;else{if(e=Us,Us=null,Vs=0,6&ys)throw Error(t(331));var a=ys;for(ys|=4,cs=e.current;null!==cs;){var u=cs,o=u.child;if(16&cs.flags){var i=u.deletions;if(null!==i){for(var s=0;s<i.length;s++){var c=i[s];for(cs=c;null!==cs;){var f=cs;switch(f.tag){case 0:case 11:case 15:Ir(8,f,u)}var d=f.child;if(null!==d)d.return=f,cs=d;else for(;null!==cs;){var p=(f=cs).sibling,m=f.return;if(Ar(f),f===c){cs=null;break}if(null!==p){p.return=m,cs=p;break}cs=m}}}var h=u.alternate;if(null!==h){var g=h.child;if(null!==g){h.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(null!==g)}}cs=u}}if(2064&u.subtreeFlags&&null!==o)o.return=u,cs=o;else e:for(;null!==cs;){if(2048&(u=cs).flags)switch(u.tag){case 0:case 11:case 15:Ir(9,u,u.return)}var y=u.sibling;if(null!==y){y.return=u.return,cs=y;break e}cs=u.return}}var b=e.current;for(cs=b;null!==cs;){var k=(o=cs).child;if(2064&o.subtreeFlags&&null!==k)k.return=o,cs=k;else e:for(o=b;null!==cs;){if(2048&(i=cs).flags)try{switch(i.tag){case 0:case 11:case 15:Ur(9,i)}}catch(e){zl(i,i.return,e)}if(i===o){cs=null;break e}var w=i.sibling;if(null!==w){w.return=i.return,cs=w;break e}cs=i.return}}if(ys=a,Nn(),vu&&"function"==typeof vu.onPostCommitFiberRoot)try{vu.onPostCommitFiberRoot(gu,e)}catch(e){}l=!0}return l}finally{xu=r,vs.transition=n}}return!1}function Cl(e,n,t){e=nt(e,n=ur(0,n=rr(t,n),1),1),n=rl(),null!==e&&(ee(e,1,n),ul(e,n))}function zl(e,n,t){if(3===e.tag)Cl(e,e,t);else for(;null!==n;){if(3===n.tag){Cl(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Os||!Os.has(r))){n=nt(n,e=or(n,e=rr(t,e),1),1),e=rl(),null!==n&&(ee(n,1,e),ul(n,e));break}}n=n.return}}function Nl(e,n,t){var r=e.pingCache;null!==r&&r.delete(n),n=rl(),e.pingedLanes|=e.suspendedLanes&t,bs===e&&(ws&t)===t&&(4===Es||3===Es&&(130023424&ws)===ws&&500>su()-Ts?ml(e,0):Ps|=t),ul(e,n)}function Pl(e,n){0===n&&(1&e.mode?(n=Su,!(130023424&(Su<<=1))&&(Su=4194304)):n=1);var t=rl();null!==(e=Gn(e,n))&&(ee(e,n,t),ul(e,t))}function _l(e){var n=e.memoizedState,t=0;null!==n&&(t=n.retryLane),Pl(e,t)}function Ll(e,n){var r=0;switch(e.tag){case 13:var l=e.stateNode,a=e.memoizedState;null!==a&&(r=a.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(t(314))}null!==l&&l.delete(n),Pl(e,r)}function Tl(e,n){return au(e,n)}function Ml(e,n,t,r){this.tag=e,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fl(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Rl(e,n){var t=e.alternate;return null===t?((t=js(e.tag,n,e.key,e.mode)).elementType=e.elementType,t.type=e.type,t.stateNode=e.stateNode,t.alternate=e,e.alternate=t):(t.pendingProps=n,t.type=e.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=14680064&e.flags,t.childLanes=e.childLanes,t.lanes=e.lanes,t.child=e.child,t.memoizedProps=e.memoizedProps,t.memoizedState=e.memoizedState,t.updateQueue=e.updateQueue,n=e.dependencies,t.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext},t.sibling=e.sibling,t.index=e.index,t.ref=e.ref,t}function Dl(e,n,r,l,a,u){var o=2;if(l=e,"function"==typeof e)Fl(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case ha:return Ol(r.children,a,u,n);case ga:o=8,a|=8;break;case va:return(e=js(12,r,n,2|a)).elementType=va,e.lanes=u,e;case wa:return(e=js(13,r,n,a)).elementType=wa,e.lanes=u,e;case Sa:return(e=js(19,r,n,a)).elementType=Sa,e.lanes=u,e;case Ca:return Il(r,a,u,n);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case ya:o=10;break e;case ba:o=9;break e;case ka:o=11;break e;case xa:o=14;break e;case Ea:o=16,l=null;break e}throw Error(t(130,null==e?e:typeof e,""))}return(n=js(o,r,n,a)).elementType=e,n.type=l,n.lanes=u,n}function Ol(e,n,t,r){return(e=js(7,e,r,n)).lanes=t,e}function Il(e,n,t,r){return(e=js(22,e,r,n)).elementType=Ca,e.lanes=t,e.stateNode={isHidden:!1},e}function Ul(e,n,t){return(e=js(6,e,null,n)).lanes=t,e}function Vl(e,n,t){return(n=js(4,null!==e.children?e.children:[],e.key,n)).lanes=t,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function Al(e,n,t,r,l){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=J(0),this.expirationTimes=J(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=J(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Bl(e,n,t,r,l,a,u,o,i,s){return e=new Al(e,n,t,o,i),1===n?(n=1,!0===a&&(n|=8)):n=0,a=js(3,null,null,n),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Zn(a),e}function Wl(e){if(!e)return ti;e:{if(H(e=e._reactInternals)!==e||1!==e.tag)throw Error(t(170));var n=e;do{switch(n.tag){case 3:n=n.stateNode.context;break e;case 1:if(wn(n.type)){n=n.stateNode.__reactInternalMemoizedMergedChildContext;break e}}n=n.return}while(null!==n);throw Error(t(171))}if(1===e.tag){var r=e.type;if(wn(r))return xn(e,r,n)}return n}function Hl(e,n,t,r,l,a,u,o,i,s){return(e=Bl(t,r,!0,e,0,a,0,o,i)).context=Wl(null),t=e.current,(a=et(r=rl(),l=ll(t))).callback=null!=n?n:null,nt(t,a,l),e.current.lanes=l,ee(e,l,r),ul(e,r),e}function Ql(e,n,t,r){var l=n.current,a=rl(),u=ll(l);return t=Wl(t),null===n.context?n.context=t:n.pendingContext=t,(n=et(a,u)).payload={element:e},null!==(r=void 0===r?null:r)&&(n.callback=r),null!==(e=nt(l,n,u))&&(al(e,l,u,a),tt(e,l,u)),u}function jl(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function $l(e,n){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var t=e.retryLane;e.retryLane=0!==t&&t<n?t:n}}function ql(e,n){$l(e,n),(e=e.alternate)&&$l(e,n)}function Kl(e){return null===(e=$(e))?null:e.stateNode}function Yl(e){return null}function Xl(e){this._internalRoot=e}function Gl(e){this._internalRoot=e}function Zl(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Jl(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function ea(){}function na(e,n,t,r,l){var a=t._reactRootContainer;if(a){var u=a;if("function"==typeof l){var o=l;l=function(){var e=jl(u);o.call(e)}}Ql(n,u,e,l)}else u=function(e,n,t,r,l){if(l){if("function"==typeof r){var a=r;r=function(){var e=jl(u);a.call(e)}}var u=Hl(n,r,e,0,null,!1,0,"",ea);return e._reactRootContainer=u,e[Xo]=u.current,Ge(8===e.nodeType?e.parentNode:e),pl(),u}for(;l=e.lastChild;)e.removeChild(l);if("function"==typeof r){var o=r;r=function(){var e=jl(i);o.call(e)}}var i=Bl(e,0,!1,null,0,!1,0,"",ea);return e._reactRootContainer=i,e[Xo]=i.current,Ge(8===e.nodeType?e.parentNode:e),pl((function(){Ql(n,i,t,r)})),i}(t,n,e,l,r);return jl(u)}var ta=new Set,ra={},la=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),aa=Object.prototype.hasOwnProperty,ua=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,oa={},ia={},sa={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){sa[e]=new a(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var n=e[0];sa[n]=new a(n,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){sa[e]=new a(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){sa[e]=new a(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){sa[e]=new a(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){sa[e]=new a(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){sa[e]=new a(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){sa[e]=new a(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){sa[e]=new a(e,5,!1,e.toLowerCase(),null,!1,!1)}));var ca=/[\-:]([a-z])/g,fa=function(e){return e[1].toUpperCase()};"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var n=e.replace(ca,fa);sa[n]=new a(n,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var n=e.replace(ca,fa);sa[n]=new a(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var n=e.replace(ca,fa);sa[n]=new a(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){sa[e]=new a(e,1,!1,e.toLowerCase(),null,!1,!1)})),sa.xlinkHref=new a("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){sa[e]=new a(e,1,!1,e.toLowerCase(),null,!0,!0)}));var da=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,pa=Symbol.for("react.element"),ma=Symbol.for("react.portal"),ha=Symbol.for("react.fragment"),ga=Symbol.for("react.strict_mode"),va=Symbol.for("react.profiler"),ya=Symbol.for("react.provider"),ba=Symbol.for("react.context"),ka=Symbol.for("react.forward_ref"),wa=Symbol.for("react.suspense"),Sa=Symbol.for("react.suspense_list"),xa=Symbol.for("react.memo"),Ea=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var Ca=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var za,Na,Pa,_a=Symbol.iterator,La=Object.assign,Ta=!1,Ma=Array.isArray,Fa=(Pa=function(e,n){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=n;else{for((Na=Na||document.createElement("div")).innerHTML="<svg>"+n.valueOf().toString()+"</svg>",n=Na.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,n,t,r){MSApp.execUnsafeLocalFunction((function(){return Pa(e,n)}))}:Pa),Ra=function(e,n){if(n){var t=e.firstChild;if(t&&t===e.lastChild&&3===t.nodeType)return void(t.nodeValue=n)}e.textContent=n},Da={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Oa=["Webkit","ms","Moz","O"];Object.keys(Da).forEach((function(e){Oa.forEach((function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),Da[n]=Da[e]}))}));var Ia=La({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),Ua=null,Va=null,Aa=null,Ba=null,Wa=function(e,n){return e(n)},Ha=function(){},Qa=!1,ja=!1;if(la)try{var $a={};Object.defineProperty($a,"passive",{get:function(){ja=!0}}),window.addEventListener("test",$a,$a),window.removeEventListener("test",$a,$a)}catch(Pa){ja=!1}var qa,Ka,Ya,Xa=function(e,n,t,r,l,a,u,o,i){var s=Array.prototype.slice.call(arguments,3);try{n.apply(t,s)}catch(e){this.onError(e)}},Ga=!1,Za=null,Ja=!1,eu=null,nu={onError:function(e){Ga=!0,Za=e}},tu=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler,ru=tu.unstable_scheduleCallback,lu=tu.unstable_NormalPriority,au=ru,uu=tu.unstable_cancelCallback,ou=tu.unstable_shouldYield,iu=tu.unstable_requestPaint,su=tu.unstable_now,cu=tu.unstable_getCurrentPriorityLevel,fu=tu.unstable_ImmediatePriority,du=tu.unstable_UserBlockingPriority,pu=lu,mu=tu.unstable_LowPriority,hu=tu.unstable_IdlePriority,gu=null,vu=null,yu=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(bu(e)/ku|0)|0},bu=Math.log,ku=Math.LN2,wu=64,Su=4194304,xu=0,Eu=!1,Cu=[],zu=null,Nu=null,Pu=null,_u=new Map,Lu=new Map,Tu=[],Mu="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "),Fu=da.ReactCurrentBatchConfig,Ru=!0,Du=null,Ou=null,Iu=null,Uu=null,Vu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Au=ke(Vu),Bu=La({},Vu,{view:0,detail:0}),Wu=ke(Bu),Hu=La({},Bu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Se,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ya&&(Ya&&"mousemove"===e.type?(qa=e.screenX-Ya.screenX,Ka=e.screenY-Ya.screenY):Ka=qa=0,Ya=e),qa)},movementY:function(e){return"movementY"in e?e.movementY:Ka}}),Qu=ke(Hu),ju=ke(La({},Hu,{dataTransfer:0})),$u=ke(La({},Bu,{relatedTarget:0})),qu=ke(La({},Vu,{animationName:0,elapsedTime:0,pseudoElement:0})),Ku=La({},Vu,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yu=ke(Ku),Xu=ke(La({},Vu,{data:0})),Gu=Xu,Zu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ju={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},eo={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},no=La({},Bu,{key:function(e){if(e.key){var n=Zu[e.key]||e.key;if("Unidentified"!==n)return n}return"keypress"===e.type?13===(e=ve(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Ju[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Se,charCode:function(e){return"keypress"===e.type?ve(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?ve(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),to=ke(no),ro=ke(La({},Hu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),lo=ke(La({},Bu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Se})),ao=ke(La({},Vu,{propertyName:0,elapsedTime:0,pseudoElement:0})),uo=La({},Hu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),oo=ke(uo),io=[9,13,27,32],so=la&&"CompositionEvent"in window,co=null;la&&"documentMode"in document&&(co=document.documentMode);var fo=la&&"TextEvent"in window&&!co,po=la&&(!so||co&&8<co&&11>=co),mo=String.fromCharCode(32),ho=!1,go=!1,vo={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},yo=null,bo=null,ko=!1;la&&(ko=function(e){if(!la)return!1;var n=(e="on"+e)in document;return n||((n=document.createElement("div")).setAttribute(e,"return;"),n="function"==typeof n[e]),n}("input")&&(!document.documentMode||9<document.documentMode));var wo="function"==typeof Object.is?Object.is:function(e,n){return e===n&&(0!==e||1/e==1/n)||e!=e&&n!=n},So=la&&"documentMode"in document&&11>=document.documentMode,xo=null,Eo=null,Co=null,zo=!1,No={animationend:Qe("Animation","AnimationEnd"),animationiteration:Qe("Animation","AnimationIteration"),animationstart:Qe("Animation","AnimationStart"),transitionend:Qe("Transition","TransitionEnd")},Po={},_o={};la&&(_o=document.createElement("div").style,"AnimationEvent"in window||(delete No.animationend.animation,delete No.animationiteration.animation,delete No.animationstart.animation),"TransitionEvent"in window||delete No.transitionend.transition);var Lo=je("animationend"),To=je("animationiteration"),Mo=je("animationstart"),Fo=je("transitionend"),Ro=new Map,Do="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");!function(){for(var e=0;e<Do.length;e++){var n=Do[e];$e(n.toLowerCase(),"on"+(n=n[0].toUpperCase()+n.slice(1)))}$e(Lo,"onAnimationEnd"),$e(To,"onAnimationIteration"),$e(Mo,"onAnimationStart"),$e("dblclick","onDoubleClick"),$e("focusin","onFocus"),$e("focusout","onBlur"),$e(Fo,"onTransitionEnd")}(),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),r("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),r("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),r("onBeforeInput",["compositionend","keypress","textInput","paste"]),r("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),r("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),r("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Io=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oo)),Uo="_reactListening"+Math.random().toString(36).slice(2),Vo=/\r\n?/g,Ao=/\u0000|\uFFFD/g,Bo=null,Wo=null,Ho="function"==typeof setTimeout?setTimeout:void 0,Qo="function"==typeof clearTimeout?clearTimeout:void 0,jo="function"==typeof Promise?Promise:void 0,$o="function"==typeof queueMicrotask?queueMicrotask:void 0!==jo?function(e){return jo.resolve(null).then(e).catch(sn)}:Ho,qo=Math.random().toString(36).slice(2),Ko="__reactFiber$"+qo,Yo="__reactProps$"+qo,Xo="__reactContainer$"+qo,Go="__reactEvents$"+qo,Zo="__reactListeners$"+qo,Jo="__reactHandles$"+qo,ei=[],ni=-1,ti={},ri=vn(ti),li=vn(!1),ai=ti,ui=null,oi=!1,ii=!1,si=[],ci=0,fi=null,di=0,pi=[],mi=0,hi=null,gi=1,vi="",yi=null,bi=null,ki=!1,wi=null,Si=da.ReactCurrentBatchConfig,xi=Hn(!0),Ei=Hn(!1),Ci=vn(null),zi=null,Ni=null,Pi=null,_i=null,Li=Gn,Ti=!1,Mi={},Fi=vn(Mi),Ri=vn(Mi),Di=vn(Mi),Oi=vn(0),Ii=[],Ui=da.ReactCurrentDispatcher,Vi=da.ReactCurrentBatchConfig,Ai=0,Bi=null,Wi=null,Hi=null,Qi=!1,ji=!1,$i=0,qi=0,Ki={readContext:Kn,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},Yi={readContext:Kn,useCallback:function(e,n){return vt().memoizedState=[e,void 0===n?null:n],e},useContext:Kn,useEffect:Rt,useImperativeHandle:function(e,n,t){return t=null!=t?t.concat([e]):null,Mt(4194308,4,Ut.bind(null,n,e),t)},useLayoutEffect:function(e,n){return Mt(4194308,4,e,n)},useInsertionEffect:function(e,n){return Mt(4,2,e,n)},useMemo:function(e,n){var t=vt();return n=void 0===n?null:n,e=e(),t.memoizedState=[e,n],e},useReducer:function(e,n,t){var r=vt();return n=void 0!==t?t(n):n,r.memoizedState=r.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=$t.bind(null,Bi,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},vt().memoizedState=e},useState:_t,useDebugValue:At,useDeferredValue:function(e){return vt().memoizedState=e},useTransition:function(){var e=_t(!1),n=e[0];return e=Qt.bind(null,e[1]),vt().memoizedState=e,[n,e]},useMutableSource:function(e,n,t){},useSyncExternalStore:function(e,n,r){var l=Bi,a=vt();if(ki){if(void 0===r)throw Error(t(407));r=r()}else{if(r=n(),null===bs)throw Error(t(349));30&Ai||Et(l,n,r)}a.memoizedState=r;var u={value:r,getSnapshot:n};return a.queue=u,Rt(zt.bind(null,l,u,e),[e]),l.flags|=2048,Lt(9,Ct.bind(null,l,u,r,n),void 0,null),r},useId:function(){var e=vt(),n=bs.identifierPrefix;if(ki){var t=vi;n=":"+n+"R"+(t=(gi&~(1<<32-yu(gi)-1)).toString(32)+t),0<(t=$i++)&&(n+="H"+t.toString(32)),n+=":"}else n=":"+n+"r"+(t=qi++).toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},Xi={readContext:Kn,useCallback:Bt,useContext:Kn,useEffect:Dt,useImperativeHandle:Vt,useInsertionEffect:Ot,useLayoutEffect:It,useMemo:Wt,useReducer:kt,useRef:Tt,useState:function(e){return kt(bt)},useDebugValue:At,useDeferredValue:function(e){return Ht(yt(),Wi.memoizedState,e)},useTransition:function(){return[kt(bt)[0],yt().memoizedState]},useMutableSource:St,useSyncExternalStore:xt,useId:jt,unstable_isNewReconciler:!1},Gi={readContext:Kn,useCallback:Bt,useContext:Kn,useEffect:Dt,useImperativeHandle:Vt,useInsertionEffect:Ot,useLayoutEffect:It,useMemo:Wt,useReducer:wt,useRef:Tt,useState:function(e){return wt(bt)},useDebugValue:At,useDeferredValue:function(e){var n=yt();return null===Wi?n.memoizedState=e:Ht(n,Wi.memoizedState,e)},useTransition:function(){return[wt(bt)[0],yt().memoizedState]},useMutableSource:St,useSyncExternalStore:xt,useId:jt,unstable_isNewReconciler:!1},Zi={isMounted:function(e){return!!(e=e._reactInternals)&&H(e)===e},enqueueSetState:function(e,n,t){e=e._reactInternals;var r=rl(),l=ll(e),a=et(r,l);a.payload=n,null!=t&&(a.callback=t),null!==(n=nt(e,a,l))&&(al(n,e,l,r),tt(n,e,l))},enqueueReplaceState:function(e,n,t){e=e._reactInternals;var r=rl(),l=ll(e),a=et(r,l);a.tag=1,a.payload=n,null!=t&&(a.callback=t),null!==(n=nt(e,a,l))&&(al(n,e,l,r),tt(n,e,l))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var t=rl(),r=ll(e),l=et(t,r);l.tag=2,null!=n&&(l.callback=n),null!==(n=nt(e,l,r))&&(al(n,e,r,t),tt(n,e,r))}},Ji="function"==typeof WeakMap?WeakMap:Map,es=da.ReactCurrentOwner,ns=!1,ts={dehydrated:null,treeContext:null,retryLane:0},rs=function(e,n,t,r){for(t=n.child;null!==t;){if(5===t.tag||6===t.tag)e.appendChild(t.stateNode);else if(4!==t.tag&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===n)break;for(;null===t.sibling;){if(null===t.return||t.return===n)return;t=t.return}t.sibling.return=t.return,t=t.sibling}},ls=function(e,n){},as=function(e,n,t,r,l){var a=e.memoizedProps;if(a!==r){switch(e=n.stateNode,ut(Fi.current),l=null,t){case"input":a=y(e,a),r=y(e,r),l=[];break;case"select":a=La({},a,{value:void 0}),r=La({},r,{value:void 0}),l=[];break;case"textarea":a=C(e,a),r=C(e,r),l=[];break;default:"function"!=typeof a.onClick&&"function"==typeof r.onClick&&(e.onclick=un)}var u;for(s in F(t,r),t=null,a)if(!r.hasOwnProperty(s)&&a.hasOwnProperty(s)&&null!=a[s])if("style"===s){var o=a[s];for(u in o)o.hasOwnProperty(u)&&(t||(t={}),t[u]="")}else"dangerouslySetInnerHTML"!==s&&"children"!==s&&"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(ra.hasOwnProperty(s)?l||(l=[]):(l=l||[]).push(s,null));for(s in r){var i=r[s];if(o=null!=a?a[s]:void 0,r.hasOwnProperty(s)&&i!==o&&(null!=i||null!=o))if("style"===s)if(o){for(u in o)!o.hasOwnProperty(u)||i&&i.hasOwnProperty(u)||(t||(t={}),t[u]="");for(u in i)i.hasOwnProperty(u)&&o[u]!==i[u]&&(t||(t={}),t[u]=i[u])}else t||(l||(l=[]),l.push(s,t)),t=i;else"dangerouslySetInnerHTML"===s?(i=i?i.__html:void 0,o=o?o.__html:void 0,null!=i&&o!==i&&(l=l||[]).push(s,i)):"children"===s?"string"!=typeof i&&"number"!=typeof i||(l=l||[]).push(s,""+i):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&(ra.hasOwnProperty(s)?(null!=i&&"onScroll"===s&&Ye("scroll",e),l||o===i||(l=[])):(l=l||[]).push(s,i))}t&&(l=l||[]).push("style",t);var s=l;(n.updateQueue=s)&&(n.flags|=4)}},us=function(e,n,t,r){t!==r&&(n.flags|=4)},os=!1,is=!1,ss="function"==typeof WeakSet?WeakSet:Set,cs=null,fs=!1,ds=null,ps=!1,ms=Math.ceil,hs=da.ReactCurrentDispatcher,gs=da.ReactCurrentOwner,vs=da.ReactCurrentBatchConfig,ys=0,bs=null,ks=null,ws=0,Ss=0,xs=vn(0),Es=0,Cs=null,zs=0,Ns=0,Ps=0,_s=null,Ls=null,Ts=0,Ms=1/0,Fs=null,Rs=!1,Ds=null,Os=null,Is=!1,Us=null,Vs=0,As=0,Bs=null,Ws=-1,Hs=0,Qs=function(e,n,r){if(null!==e)if(e.memoizedProps!==n.pendingProps||li.current)ns=!0;else{if(!(e.lanes&r||128&n.flags))return ns=!1,function(e,n,t){switch(n.tag){case 3:kr(n),Un();break;case 5:st(n);break;case 1:wn(n.type)&&En(n);break;case 4:ot(n,n.stateNode.containerInfo);break;case 10:var r=n.type._context,l=n.memoizedProps.value;bn(Ci,r._currentValue),r._currentValue=l;break;case 13:if(null!==(r=n.memoizedState))return null!==r.dehydrated?(bn(Oi,1&Oi.current),n.flags|=128,null):t&n.child.childLanes?xr(e,n,t):(bn(Oi,1&Oi.current),null!==(e=Lr(e,n,t))?e.sibling:null);bn(Oi,1&Oi.current);break;case 19:if(r=!!(t&n.childLanes),128&e.flags){if(r)return Pr(e,n,t);n.flags|=128}if(null!==(l=n.memoizedState)&&(l.rendering=null,l.tail=null,l.lastEffect=null),bn(Oi,Oi.current),r)break;return null;case 22:case 23:return n.lanes=0,hr(e,n,t)}return Lr(e,n,t)}(e,n,r);ns=!!(131072&e.flags)}else ns=!1,ki&&1048576&n.flags&&_n(n,di,n.index);switch(n.lanes=0,n.tag){case 2:var l=n.type;_r(e,n),e=n.pendingProps;var a=kn(n,ri.current);qn(n,r),a=ht(null,n,l,e,a,r);var u=gt();return n.flags|=1,"object"==typeof a&&null!==a&&"function"==typeof a.render&&void 0===a.$$typeof?(n.tag=1,n.memoizedState=null,n.updateQueue=null,wn(l)?(u=!0,En(n)):u=!1,n.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,Zn(n),a.updater=Zi,n.stateNode=a,a._reactInternals=n,tr(n,l,e,r),n=br(null,n,l,!0,u,r)):(n.tag=0,ki&&u&&Ln(n),fr(null,n,a,r),n=n.child),n;case 16:l=n.elementType;e:{switch(_r(e,n),e=n.pendingProps,l=(a=l._init)(l._payload),n.type=l,a=n.tag=function(e){if("function"==typeof e)return Fl(e)?1:0;if(null!=e){if((e=e.$$typeof)===ka)return 11;if(e===xa)return 14}return 2}(l),e=Gt(l,e),a){case 0:n=vr(null,n,l,e,r);break e;case 1:n=yr(null,n,l,e,r);break e;case 11:n=dr(null,n,l,e,r);break e;case 14:n=pr(null,n,l,Gt(l.type,e),r);break e}throw Error(t(306,l,""))}return n;case 0:return l=n.type,a=n.pendingProps,vr(e,n,l,a=n.elementType===l?a:Gt(l,a),r);case 1:return l=n.type,a=n.pendingProps,yr(e,n,l,a=n.elementType===l?a:Gt(l,a),r);case 3:e:{if(kr(n),null===e)throw Error(t(387));l=n.pendingProps,a=(u=n.memoizedState).element,Jn(e,n),lt(n,l,null,r);var o=n.memoizedState;if(l=o.element,u.isDehydrated){if(u={element:l,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},n.updateQueue.baseState=u,n.memoizedState=u,256&n.flags){n=wr(e,n,l,r,a=rr(Error(t(423)),n));break e}if(l!==a){n=wr(e,n,l,r,a=rr(Error(t(424)),n));break e}for(bi=fn(n.stateNode.containerInfo.firstChild),yi=n,ki=!0,wi=null,r=Ei(n,null,l,r),n.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(Un(),l===a){n=Lr(e,n,r);break e}fr(e,n,l,r)}n=n.child}return n;case 5:return st(n),null===e&&Dn(n),l=n.type,a=n.pendingProps,u=null!==e?e.memoizedProps:null,o=a.children,on(l,a)?o=null:null!==u&&on(l,u)&&(n.flags|=32),gr(e,n),fr(e,n,o,r),n.child;case 6:return null===e&&Dn(n),null;case 13:return xr(e,n,r);case 4:return ot(n,n.stateNode.containerInfo),l=n.pendingProps,null===e?n.child=xi(n,null,l,r):fr(e,n,l,r),n.child;case 11:return l=n.type,a=n.pendingProps,dr(e,n,l,a=n.elementType===l?a:Gt(l,a),r);case 7:return fr(e,n,n.pendingProps,r),n.child;case 8:case 12:return fr(e,n,n.pendingProps.children,r),n.child;case 10:e:{if(l=n.type._context,a=n.pendingProps,u=n.memoizedProps,o=a.value,bn(Ci,l._currentValue),l._currentValue=o,null!==u)if(wo(u.value,o)){if(u.children===a.children&&!li.current){n=Lr(e,n,r);break e}}else for(null!==(u=n.child)&&(u.return=n);null!==u;){var i=u.dependencies;if(null!==i){o=u.child;for(var s=i.firstContext;null!==s;){if(s.context===l){if(1===u.tag){(s=et(-1,r&-r)).tag=2;var c=u.updateQueue;if(null!==c){var f=(c=c.shared).pending;null===f?s.next=s:(s.next=f.next,f.next=s),c.pending=s}}u.lanes|=r,null!==(s=u.alternate)&&(s.lanes|=r),$n(u.return,r,n),i.lanes|=r;break}s=s.next}}else if(10===u.tag)o=u.type===n.type?null:u.child;else if(18===u.tag){if(null===(o=u.return))throw Error(t(341));o.lanes|=r,null!==(i=o.alternate)&&(i.lanes|=r),$n(o,r,n),o=u.sibling}else o=u.child;if(null!==o)o.return=u;else for(o=u;null!==o;){if(o===n){o=null;break}if(null!==(u=o.sibling)){u.return=o.return,o=u;break}o=o.return}u=o}fr(e,n,a.children,r),n=n.child}return n;case 9:return a=n.type,l=n.pendingProps.children,qn(n,r),l=l(a=Kn(a)),n.flags|=1,fr(e,n,l,r),n.child;case 14:return a=Gt(l=n.type,n.pendingProps),pr(e,n,l,a=Gt(l.type,a),r);case 15:return mr(e,n,n.type,n.pendingProps,r);case 17:return l=n.type,a=n.pendingProps,a=n.elementType===l?a:Gt(l,a),_r(e,n),n.tag=1,wn(l)?(e=!0,En(n)):e=!1,qn(n,r),er(n,l,a),tr(n,l,a,r),br(null,n,l,!0,e,r);case 19:return Pr(e,n,r);case 22:return hr(e,n,r)}throw Error(t(156,n.tag))},js=function(e,n,t,r){return new Ml(e,n,t,r)},$s="function"==typeof reportError?reportError:function(e){console.error(e)};Gl.prototype.render=Xl.prototype.render=function(e){var n=this._internalRoot;if(null===n)throw Error(t(409));Ql(e,n,null,null)},Gl.prototype.unmount=Xl.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var n=e.containerInfo;pl((function(){Ql(null,e,null,null)})),n[Xo]=null}},Gl.prototype.unstable_scheduleHydration=function(e){if(e){var n=Xs();e={blockedOn:null,target:e,priority:n};for(var t=0;t<Tu.length&&0!==n&&n<Tu[t].priority;t++);Tu.splice(t,0,e),0===t&&ae(e)}};var qs=function(e){switch(e.tag){case 3:var n=e.stateNode;if(n.current.memoizedState.isDehydrated){var t=K(n.pendingLanes);0!==t&&(ne(n,1|t),ul(n,su()),!(6&ys)&&(tl(),Nn()))}break;case 13:pl((function(){var n=Gn(e,1);if(null!==n){var t=rl();al(n,e,1,t)}})),ql(e,1)}},Ks=function(e){if(13===e.tag){var n=Gn(e,134217728);null!==n&&al(n,e,134217728,rl()),ql(e,134217728)}},Ys=function(e){if(13===e.tag){var n=ll(e),t=Gn(e,n);null!==t&&al(t,e,n,rl()),ql(e,n)}},Xs=function(){return xu},Gs=function(e,n){var t=xu;try{return xu=e,n()}finally{xu=t}};Va=function(e,n,r){switch(n){case"input":if(w(e,r),n=r.name,"radio"===r.type&&null!=n){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+n)+'][type="radio"]'),n=0;n<r.length;n++){var l=r[n];if(l!==e&&l.form===e.form){var a=gn(l);if(!a)throw Error(t(90));g(l),w(l,a)}}}break;case"textarea":N(e,r);break;case"select":null!=(n=r.value)&&E(e,!!r.multiple,n,!1)}},function(e,n,t){Wa=e,Ha=t}(dl,0,pl);var Zs={usingClientEntryPoint:!1,Events:[mn,hn,gn,I,U,dl]};!function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:da.ReactCurrentDispatcher,findHostInstanceByFiber:Kl,findFiberByHostInstance:e.findFiberByHostInstance||Yl,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1"},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n.isDisabled||!n.supportsFiber)e=!0;else{try{gu=n.inject(e),vu=n}catch(e){}e=!!n.checkDCE}}}({findFiberByHostInstance:pn,bundleType:0,version:"18.3.1-next-f1338f8080-20240426",rendererPackageName:"react-dom"}),e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Zs,e.createPortal=function(e,n){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Zl(n))throw Error(t(200));return function(e,n,t){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:ma,key:null==r?null:""+r,children:e,containerInfo:n,implementation:t}}(e,n,null,r)},e.createRoot=function(e,n){if(!Zl(e))throw Error(t(299));var r=!1,l="",a=$s;return null!=n&&(!0===n.unstable_strictMode&&(r=!0),void 0!==n.identifierPrefix&&(l=n.identifierPrefix),void 0!==n.onRecoverableError&&(a=n.onRecoverableError)),n=Bl(e,1,!1,null,0,r,0,l,a),e[Xo]=n.current,Ge(8===e.nodeType?e.parentNode:e),new Xl(n)},e.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var n=e._reactInternals;if(void 0===n){if("function"==typeof e.render)throw Error(t(188));throw e=Object.keys(e).join(","),Error(t(268,e))}return e=null===(e=$(n))?null:e.stateNode},e.flushSync=function(e){return pl(e)},e.hydrate=function(e,n,r){if(!Jl(n))throw Error(t(200));return na(null,e,n,!0,r)},e.hydrateRoot=function(e,n,r){if(!Zl(e))throw Error(t(405));var l=null!=r&&r.hydratedSources||null,a=!1,u="",o=$s;if(null!=r&&(!0===r.unstable_strictMode&&(a=!0),void 0!==r.identifierPrefix&&(u=r.identifierPrefix),void 0!==r.onRecoverableError&&(o=r.onRecoverableError)),n=Hl(n,null,e,1,null!=r?r:null,a,0,u,o),e[Xo]=n.current,Ge(e),l)for(e=0;e<l.length;e++)a=(a=(r=l[e])._getVersion)(r._source),null==n.mutableSourceEagerHydrationData?n.mutableSourceEagerHydrationData=[r,a]:n.mutableSourceEagerHydrationData.push(r,a);return new Gl(n)},e.render=function(e,n,r){if(!Jl(n))throw Error(t(200));return na(null,e,n,!1,r)},e.unmountComponentAtNode=function(e){if(!Jl(e))throw Error(t(40));return!!e._reactRootContainer&&(pl((function(){na(null,null,e,!1,(function(){e._reactRootContainer=null,e[Xo]=null}))})),!0)},e.unstable_batchedUpdates=dl,e.unstable_renderSubtreeIntoContainer=function(e,n,r,l){if(!Jl(r))throw Error(t(200));if(null==e||void 0===e._reactInternals)throw Error(t(38));return na(e,n,r,!1,l)},e.version="18.3.1-next-f1338f8080-20240426"},"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],n):n((e=e||self).ReactDOM={},e.React)}(); vendor/react.js 0000644 00000326553 15013651111 0007505 0 ustar 00 /** * @license React * react.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : (global = global || self, factory(global.React = {})); }(this, (function (exports) { 'use strict'; var ReactVersion = '18.3.1'; // ATTENTION // When adding new symbols to this file, // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols' // The Symbol used to tag the ReactElement-like types. var REACT_ELEMENT_TYPE = Symbol.for('react.element'); var REACT_PORTAL_TYPE = Symbol.for('react.portal'); var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment'); var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode'); var REACT_PROFILER_TYPE = Symbol.for('react.profiler'); var REACT_PROVIDER_TYPE = Symbol.for('react.provider'); var REACT_CONTEXT_TYPE = Symbol.for('react.context'); var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref'); var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense'); var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list'); var REACT_MEMO_TYPE = Symbol.for('react.memo'); var REACT_LAZY_TYPE = Symbol.for('react.lazy'); var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen'); var MAYBE_ITERATOR_SYMBOL = Symbol.iterator; var FAUX_ITERATOR_SYMBOL = '@@iterator'; function getIteratorFn(maybeIterable) { if (maybeIterable === null || typeof maybeIterable !== 'object') { return null; } var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]; if (typeof maybeIterator === 'function') { return maybeIterator; } return null; } /** * Keeps track of the current dispatcher. */ var ReactCurrentDispatcher = { /** * @internal * @type {ReactComponent} */ current: null }; /** * Keeps track of the current batch's configuration such as how long an update * should suspend for if it needs to. */ var ReactCurrentBatchConfig = { transition: null }; var ReactCurrentActQueue = { current: null, // Used to reproduce behavior of `batchedUpdates` in legacy mode. isBatchingLegacy: false, didScheduleLegacyUpdate: false }; /** * Keeps track of the current owner. * * The current owner is the component who should own any components that are * currently being constructed. */ var ReactCurrentOwner = { /** * @internal * @type {ReactComponent} */ current: null }; var ReactDebugCurrentFrame = {}; var currentExtraStackFrame = null; function setExtraStackFrame(stack) { { currentExtraStackFrame = stack; } } { ReactDebugCurrentFrame.setExtraStackFrame = function (stack) { { currentExtraStackFrame = stack; } }; // Stack implementation injected by the current renderer. ReactDebugCurrentFrame.getCurrentStack = null; ReactDebugCurrentFrame.getStackAddendum = function () { var stack = ''; // Add an extra top frame while an element is being validated if (currentExtraStackFrame) { stack += currentExtraStackFrame; } // Delegate to the injected renderer-specific implementation var impl = ReactDebugCurrentFrame.getCurrentStack; if (impl) { stack += impl() || ''; } return stack; }; } // ----------------------------------------------------------------------------- var enableScopeAPI = false; // Experimental Create Event Handle API. var enableCacheElement = false; var enableTransitionTracing = false; // No known bugs, but needs performance testing var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber // stuff. Intended to enable React core members to more easily debug scheduling // issues in DEV builds. var enableDebugTracing = false; // Track which Fiber(s) schedule render work. var ReactSharedInternals = { ReactCurrentDispatcher: ReactCurrentDispatcher, ReactCurrentBatchConfig: ReactCurrentBatchConfig, ReactCurrentOwner: ReactCurrentOwner }; { ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame; ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue; } // by calls to these methods by a Babel plugin. // // In PROD (or in packages without access to React internals), // they are left as they are instead. function warn(format) { { { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } printWarning('warn', format, args); } } } function error(format) { { { for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { args[_key2 - 1] = arguments[_key2]; } printWarning('error', format, args); } } } function printWarning(level, format, args) { // When changing this logic, you might want to also // update consoleWithStackDev.www.js as well. { var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; var stack = ReactDebugCurrentFrame.getStackAddendum(); if (stack !== '') { format += '%s'; args = args.concat([stack]); } // eslint-disable-next-line react-internal/safe-string-coercion var argsWithFormat = args.map(function (item) { return String(item); }); // Careful: RN currently depends on this prefix argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it // breaks IE9: https://github.com/facebook/react/issues/13610 // eslint-disable-next-line react-internal/no-production-logging Function.prototype.apply.call(console[level], console, argsWithFormat); } } var didWarnStateUpdateForUnmountedComponent = {}; function warnNoop(publicInstance, callerName) { { var _constructor = publicInstance.constructor; var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass'; var warningKey = componentName + "." + callerName; if (didWarnStateUpdateForUnmountedComponent[warningKey]) { return; } error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName); didWarnStateUpdateForUnmountedComponent[warningKey] = true; } } /** * This is the abstract API for an update queue. */ var ReactNoopUpdateQueue = { /** * Checks whether or not this composite component is mounted. * @param {ReactClass} publicInstance The instance we want to test. * @return {boolean} True if mounted, false otherwise. * @protected * @final */ isMounted: function (publicInstance) { return false; }, /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {?function} callback Called after component is updated. * @param {?string} callerName name of the calling function in the public API. * @internal */ enqueueForceUpdate: function (publicInstance, callback, callerName) { warnNoop(publicInstance, 'forceUpdate'); }, /** * Replaces all of the state. Always use this or `setState` to mutate state. * You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} completeState Next state. * @param {?function} callback Called after component is updated. * @param {?string} callerName name of the calling function in the public API. * @internal */ enqueueReplaceState: function (publicInstance, completeState, callback, callerName) { warnNoop(publicInstance, 'replaceState'); }, /** * Sets a subset of the state. This only exists because _pendingState is * internal. This provides a merging strategy that is not available to deep * properties which is confusing. TODO: Expose pendingState or don't use it * during the merge. * * @param {ReactClass} publicInstance The instance that should rerender. * @param {object} partialState Next partial state to be merged with state. * @param {?function} callback Called after component is updated. * @param {?string} Name of the calling function in the public API. * @internal */ enqueueSetState: function (publicInstance, partialState, callback, callerName) { warnNoop(publicInstance, 'setState'); } }; var assign = Object.assign; var emptyObject = {}; { Object.freeze(emptyObject); } /** * Base class helpers for the updating state of a component. */ function Component(props, context, updater) { this.props = props; this.context = context; // If a component has string refs, we will assign a different object later. this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the // renderer. this.updater = updater || ReactNoopUpdateQueue; } Component.prototype.isReactComponent = {}; /** * Sets a subset of the state. Always use this to mutate * state. You should treat `this.state` as immutable. * * There is no guarantee that `this.state` will be immediately updated, so * accessing `this.state` after calling this method may return the old value. * * There is no guarantee that calls to `setState` will run synchronously, * as they may eventually be batched together. You can provide an optional * callback that will be executed when the call to setState is actually * completed. * * When a function is provided to setState, it will be called at some point in * the future (not synchronously). It will be called with the up to date * component arguments (state, props, context). These values can be different * from this.* because your function may be called after receiveProps but before * shouldComponentUpdate, and this new state, props, and context will not yet be * assigned to this. * * @param {object|function} partialState Next partial state or function to * produce next partial state to be merged with current state. * @param {?function} callback Called after state is updated. * @final * @protected */ Component.prototype.setState = function (partialState, callback) { if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) { throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.'); } this.updater.enqueueSetState(this, partialState, callback, 'setState'); }; /** * Forces an update. This should only be invoked when it is known with * certainty that we are **not** in a DOM transaction. * * You may want to call this when you know that some deeper aspect of the * component's state has changed but `setState` was not called. * * This will not invoke `shouldComponentUpdate`, but it will invoke * `componentWillUpdate` and `componentDidUpdate`. * * @param {?function} callback Called after update is complete. * @final * @protected */ Component.prototype.forceUpdate = function (callback) { this.updater.enqueueForceUpdate(this, callback, 'forceUpdate'); }; /** * Deprecated APIs. These APIs used to exist on classic React classes but since * we would like to deprecate them, we're not going to move them over to this * modern base class. Instead, we define a getter that warns if it's accessed. */ { var deprecatedAPIs = { isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'], replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'] }; var defineDeprecationWarning = function (methodName, info) { Object.defineProperty(Component.prototype, methodName, { get: function () { warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]); return undefined; } }); }; for (var fnName in deprecatedAPIs) { if (deprecatedAPIs.hasOwnProperty(fnName)) { defineDeprecationWarning(fnName, deprecatedAPIs[fnName]); } } } function ComponentDummy() {} ComponentDummy.prototype = Component.prototype; /** * Convenience component with default shallow equality check for sCU. */ function PureComponent(props, context, updater) { this.props = props; this.context = context; // If a component has string refs, we will assign a different object later. this.refs = emptyObject; this.updater = updater || ReactNoopUpdateQueue; } var pureComponentPrototype = PureComponent.prototype = new ComponentDummy(); pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods. assign(pureComponentPrototype, Component.prototype); pureComponentPrototype.isPureReactComponent = true; // an immutable object with a single mutable value function createRef() { var refObject = { current: null }; { Object.seal(refObject); } return refObject; } var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare function isArray(a) { return isArrayImpl(a); } /* * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol * and Temporal.* types. See https://github.com/facebook/react/pull/22064. * * The functions in this module will throw an easier-to-understand, * easier-to-debug exception with a clear errors message message explaining the * problem. (Instead of a confusing exception thrown inside the implementation * of the `value` object). */ // $FlowFixMe only called in DEV, so void return is not possible. function typeName(value) { { // toStringTag is needed for namespaced types like Temporal.Instant var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag; var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object'; return type; } } // $FlowFixMe only called in DEV, so void return is not possible. function willCoercionThrow(value) { { try { testStringCoercion(value); return false; } catch (e) { return true; } } } function testStringCoercion(value) { // If you ended up here by following an exception call stack, here's what's // happened: you supplied an object or symbol value to React (as a prop, key, // DOM attribute, CSS property, string ref, etc.) and when React tried to // coerce it to a string using `'' + value`, an exception was thrown. // // The most common types that will cause this exception are `Symbol` instances // and Temporal objects like `Temporal.Instant`. But any object that has a // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this // exception. (Library authors do this to prevent users from using built-in // numeric operators like `+` or comparison operators like `>=` because custom // methods are needed to perform accurate arithmetic or comparison.) // // To fix the problem, coerce this object or symbol value to a string before // passing it to React. The most reliable way is usually `String(value)`. // // To find which value is throwing, check the browser or debugger console. // Before this exception was thrown, there should be `console.error` output // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the // problem and how that type was used: key, atrribute, input value prop, etc. // In most cases, this console output also shows the component and its // ancestor components where the exception happened. // // eslint-disable-next-line react-internal/safe-string-coercion return '' + value; } function checkKeyStringCoercion(value) { { if (willCoercionThrow(value)) { error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value)); return testStringCoercion(value); // throw (to help callers find troubleshooting comments) } } } function getWrappedName(outerType, innerType, wrapperName) { var displayName = outerType.displayName; if (displayName) { return displayName; } var functionName = innerType.displayName || innerType.name || ''; return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName; } // Keep in sync with react-reconciler/getComponentNameFromFiber function getContextName(type) { return type.displayName || 'Context'; } // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead. function getComponentNameFromType(type) { if (type == null) { // Host root, text node or just invalid type. return null; } { if (typeof type.tag === 'number') { error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.'); } } if (typeof type === 'function') { return type.displayName || type.name || null; } if (typeof type === 'string') { return type; } switch (type) { case REACT_FRAGMENT_TYPE: return 'Fragment'; case REACT_PORTAL_TYPE: return 'Portal'; case REACT_PROFILER_TYPE: return 'Profiler'; case REACT_STRICT_MODE_TYPE: return 'StrictMode'; case REACT_SUSPENSE_TYPE: return 'Suspense'; case REACT_SUSPENSE_LIST_TYPE: return 'SuspenseList'; } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_CONTEXT_TYPE: var context = type; return getContextName(context) + '.Consumer'; case REACT_PROVIDER_TYPE: var provider = type; return getContextName(provider._context) + '.Provider'; case REACT_FORWARD_REF_TYPE: return getWrappedName(type, type.render, 'ForwardRef'); case REACT_MEMO_TYPE: var outerName = type.displayName || null; if (outerName !== null) { return outerName; } return getComponentNameFromType(type.type) || 'Memo'; case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { return getComponentNameFromType(init(payload)); } catch (x) { return null; } } // eslint-disable-next-line no-fallthrough } } return null; } var hasOwnProperty = Object.prototype.hasOwnProperty; var RESERVED_PROPS = { key: true, ref: true, __self: true, __source: true }; var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs; { didWarnAboutStringRefs = {}; } function hasValidRef(config) { { if (hasOwnProperty.call(config, 'ref')) { var getter = Object.getOwnPropertyDescriptor(config, 'ref').get; if (getter && getter.isReactWarning) { return false; } } } return config.ref !== undefined; } function hasValidKey(config) { { if (hasOwnProperty.call(config, 'key')) { var getter = Object.getOwnPropertyDescriptor(config, 'key').get; if (getter && getter.isReactWarning) { return false; } } } return config.key !== undefined; } function defineKeyPropWarningGetter(props, displayName) { var warnAboutAccessingKey = function () { { if (!specialPropKeyWarningShown) { specialPropKeyWarningShown = true; error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); } } }; warnAboutAccessingKey.isReactWarning = true; Object.defineProperty(props, 'key', { get: warnAboutAccessingKey, configurable: true }); } function defineRefPropWarningGetter(props, displayName) { var warnAboutAccessingRef = function () { { if (!specialPropRefWarningShown) { specialPropRefWarningShown = true; error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName); } } }; warnAboutAccessingRef.isReactWarning = true; Object.defineProperty(props, 'ref', { get: warnAboutAccessingRef, configurable: true }); } function warnIfStringRefCannotBeAutoConverted(config) { { if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) { var componentName = getComponentNameFromType(ReactCurrentOwner.current.type); if (!didWarnAboutStringRefs[componentName]) { error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref); didWarnAboutStringRefs[componentName] = true; } } } } /** * Factory method to create a new React element. This no longer adheres to * the class pattern, so do not use new to call it. Also, instanceof check * will not work. Instead test $$typeof field against Symbol.for('react.element') to check * if something is a React Element. * * @param {*} type * @param {*} props * @param {*} key * @param {string|object} ref * @param {*} owner * @param {*} self A *temporary* helper to detect places where `this` is * different from the `owner` when React.createElement is called, so that we * can warn. We want to get rid of owner and replace string `ref`s with arrow * functions, and as long as `this` and owner are the same, there will be no * change in behavior. * @param {*} source An annotation object (added by a transpiler or otherwise) * indicating filename, line number, and/or other information. * @internal */ var ReactElement = function (type, key, ref, self, source, owner, props) { var element = { // This tag allows us to uniquely identify this as a React Element $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type: type, key: key, ref: ref, props: props, // Record the component responsible for creating this element. _owner: owner }; { // The validation flag is currently mutative. We put it on // an external backing store so that we can freeze the whole object. // This can be replaced with a WeakMap once they are implemented in // commonly used development environments. element._store = {}; // To make comparing ReactElements easier for testing purposes, we make // the validation flag non-enumerable (where possible, which should // include every environment we run tests in), so the test framework // ignores it. Object.defineProperty(element._store, 'validated', { configurable: false, enumerable: false, writable: true, value: false }); // self and source are DEV only properties. Object.defineProperty(element, '_self', { configurable: false, enumerable: false, writable: false, value: self }); // Two elements created in two different places should be considered // equal for testing purposes and therefore we hide it from enumeration. Object.defineProperty(element, '_source', { configurable: false, enumerable: false, writable: false, value: source }); if (Object.freeze) { Object.freeze(element.props); Object.freeze(element); } } return element; }; /** * Create and return a new ReactElement of the given type. * See https://reactjs.org/docs/react-api.html#createelement */ function createElement(type, config, children) { var propName; // Reserved names are extracted var props = {}; var key = null; var ref = null; var self = null; var source = null; if (config != null) { if (hasValidRef(config)) { ref = config.ref; { warnIfStringRefCannotBeAutoConverted(config); } } if (hasValidKey(config)) { { checkKeyStringCoercion(config.key); } key = '' + config.key; } self = config.__self === undefined ? null : config.__self; source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { props[propName] = config[propName]; } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } { if (Object.freeze) { Object.freeze(childArray); } } props.children = childArray; } // Resolve default props if (type && type.defaultProps) { var defaultProps = type.defaultProps; for (propName in defaultProps) { if (props[propName] === undefined) { props[propName] = defaultProps[propName]; } } } { if (key || ref) { var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type; if (key) { defineKeyPropWarningGetter(props, displayName); } if (ref) { defineRefPropWarningGetter(props, displayName); } } } return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props); } function cloneAndReplaceKey(oldElement, newKey) { var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props); return newElement; } /** * Clone and return a new ReactElement using element as the starting point. * See https://reactjs.org/docs/react-api.html#cloneelement */ function cloneElement(element, config, children) { if (element === null || element === undefined) { throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + element + "."); } var propName; // Original props are copied var props = assign({}, element.props); // Reserved names are extracted var key = element.key; var ref = element.ref; // Self is preserved since the owner is preserved. var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a // transpiler, and the original source is probably a better indicator of the // true owner. var source = element._source; // Owner will be preserved, unless ref is overridden var owner = element._owner; if (config != null) { if (hasValidRef(config)) { // Silently steal the ref from the parent. ref = config.ref; owner = ReactCurrentOwner.current; } if (hasValidKey(config)) { { checkKeyStringCoercion(config.key); } key = '' + config.key; } // Remaining properties override existing props var defaultProps; if (element.type && element.type.defaultProps) { defaultProps = element.type.defaultProps; } for (propName in config) { if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) { if (config[propName] === undefined && defaultProps !== undefined) { // Resolve default props props[propName] = defaultProps[propName]; } else { props[propName] = config[propName]; } } } } // Children can be more than one argument, and those are transferred onto // the newly allocated props object. var childrenLength = arguments.length - 2; if (childrenLength === 1) { props.children = children; } else if (childrenLength > 1) { var childArray = Array(childrenLength); for (var i = 0; i < childrenLength; i++) { childArray[i] = arguments[i + 2]; } props.children = childArray; } return ReactElement(element.type, key, ref, self, source, owner, props); } /** * Verifies the object is a ReactElement. * See https://reactjs.org/docs/react-api.html#isvalidelement * @param {?object} object * @return {boolean} True if `object` is a ReactElement. * @final */ function isValidElement(object) { return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; } var SEPARATOR = '.'; var SUBSEPARATOR = ':'; /** * Escape and wrap key so it is safe to use as a reactid * * @param {string} key to be escaped. * @return {string} the escaped key. */ function escape(key) { var escapeRegex = /[=:]/g; var escaperLookup = { '=': '=0', ':': '=2' }; var escapedString = key.replace(escapeRegex, function (match) { return escaperLookup[match]; }); return '$' + escapedString; } /** * TODO: Test that a single child and an array with one item have the same key * pattern. */ var didWarnAboutMaps = false; var userProvidedKeyEscapeRegex = /\/+/g; function escapeUserProvidedKey(text) { return text.replace(userProvidedKeyEscapeRegex, '$&/'); } /** * Generate a key string that identifies a element within a set. * * @param {*} element A element that could contain a manual key. * @param {number} index Index that is used if a manual key is not provided. * @return {string} */ function getElementKey(element, index) { // Do some typechecking here since we call this blindly. We want to ensure // that we don't block potential future ES APIs. if (typeof element === 'object' && element !== null && element.key != null) { // Explicit key { checkKeyStringCoercion(element.key); } return escape('' + element.key); } // Implicit key determined by the index in the set return index.toString(36); } function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) { var type = typeof children; if (type === 'undefined' || type === 'boolean') { // All of the above are perceived as null. children = null; } var invokeCallback = false; if (children === null) { invokeCallback = true; } else { switch (type) { case 'string': case 'number': invokeCallback = true; break; case 'object': switch (children.$$typeof) { case REACT_ELEMENT_TYPE: case REACT_PORTAL_TYPE: invokeCallback = true; } } } if (invokeCallback) { var _child = children; var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array // so that it's consistent if the number of children grows: var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar; if (isArray(mappedChild)) { var escapedChildKey = ''; if (childKey != null) { escapedChildKey = escapeUserProvidedKey(childKey) + '/'; } mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) { return c; }); } else if (mappedChild != null) { if (isValidElement(mappedChild)) { { // The `if` statement here prevents auto-disabling of the safe // coercion ESLint rule, so we must manually disable it below. // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) { checkKeyStringCoercion(mappedChild.key); } } mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as // traverseAllChildren used to do for objects as children escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number // eslint-disable-next-line react-internal/safe-string-coercion escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey); } array.push(mappedChild); } return 1; } var child; var nextName; var subtreeCount = 0; // Count of children found in the current subtree. var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR; if (isArray(children)) { for (var i = 0; i < children.length; i++) { child = children[i]; nextName = nextNamePrefix + getElementKey(child, i); subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); } } else { var iteratorFn = getIteratorFn(children); if (typeof iteratorFn === 'function') { var iterableChildren = children; { // Warn about using Maps as children if (iteratorFn === iterableChildren.entries) { if (!didWarnAboutMaps) { warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.'); } didWarnAboutMaps = true; } } var iterator = iteratorFn.call(iterableChildren); var step; var ii = 0; while (!(step = iterator.next()).done) { child = step.value; nextName = nextNamePrefix + getElementKey(child, ii++); subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback); } } else if (type === 'object') { // eslint-disable-next-line react-internal/safe-string-coercion var childrenString = String(children); throw new Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). " + 'If you meant to render a collection of children, use an array ' + 'instead.'); } } return subtreeCount; } /** * Maps children that are typically specified as `props.children`. * * See https://reactjs.org/docs/react-api.html#reactchildrenmap * * The provided mapFunction(child, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} func The map function. * @param {*} context Context for mapFunction. * @return {object} Object containing the ordered map of results. */ function mapChildren(children, func, context) { if (children == null) { return children; } var result = []; var count = 0; mapIntoArray(children, result, '', '', function (child) { return func.call(context, child, count++); }); return result; } /** * Count the number of children that are typically specified as * `props.children`. * * See https://reactjs.org/docs/react-api.html#reactchildrencount * * @param {?*} children Children tree container. * @return {number} The number of children. */ function countChildren(children) { var n = 0; mapChildren(children, function () { n++; // Don't return anything }); return n; } /** * Iterates through children that are typically specified as `props.children`. * * See https://reactjs.org/docs/react-api.html#reactchildrenforeach * * The provided forEachFunc(child, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} forEachFunc * @param {*} forEachContext Context for forEachContext. */ function forEachChildren(children, forEachFunc, forEachContext) { mapChildren(children, function () { forEachFunc.apply(this, arguments); // Don't return anything. }, forEachContext); } /** * Flatten a children object (typically specified as `props.children`) and * return an array with appropriately re-keyed children. * * See https://reactjs.org/docs/react-api.html#reactchildrentoarray */ function toArray(children) { return mapChildren(children, function (child) { return child; }) || []; } /** * Returns the first child in a collection of children and verifies that there * is only one child in the collection. * * See https://reactjs.org/docs/react-api.html#reactchildrenonly * * The current implementation of this function assumes that a single child gets * passed without a wrapper, but the purpose of this helper function is to * abstract away the particular structure of children. * * @param {?object} children Child collection structure. * @return {ReactElement} The first and only `ReactElement` contained in the * structure. */ function onlyChild(children) { if (!isValidElement(children)) { throw new Error('React.Children.only expected to receive a single React element child.'); } return children; } function createContext(defaultValue) { // TODO: Second argument used to be an optional `calculateChangedBits` // function. Warn to reserve for future use? var context = { $$typeof: REACT_CONTEXT_TYPE, // As a workaround to support multiple concurrent renderers, we categorize // some renderers as primary and others as secondary. We only expect // there to be two concurrent renderers at most: React Native (primary) and // Fabric (secondary); React DOM (primary) and React ART (secondary). // Secondary renderers store their context values on separate fields. _currentValue: defaultValue, _currentValue2: defaultValue, // Used to track how many concurrent renderers this context currently // supports within in a single renderer. Such as parallel server rendering. _threadCount: 0, // These are circular Provider: null, Consumer: null, // Add these to use same hidden class in VM as ServerContext _defaultValue: null, _globalName: null }; context.Provider = { $$typeof: REACT_PROVIDER_TYPE, _context: context }; var hasWarnedAboutUsingNestedContextConsumers = false; var hasWarnedAboutUsingConsumerProvider = false; var hasWarnedAboutDisplayNameOnConsumer = false; { // A separate object, but proxies back to the original context object for // backwards compatibility. It has a different $$typeof, so we can properly // warn for the incorrect usage of Context as a Consumer. var Consumer = { $$typeof: REACT_CONTEXT_TYPE, _context: context }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here Object.defineProperties(Consumer, { Provider: { get: function () { if (!hasWarnedAboutUsingConsumerProvider) { hasWarnedAboutUsingConsumerProvider = true; error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?'); } return context.Provider; }, set: function (_Provider) { context.Provider = _Provider; } }, _currentValue: { get: function () { return context._currentValue; }, set: function (_currentValue) { context._currentValue = _currentValue; } }, _currentValue2: { get: function () { return context._currentValue2; }, set: function (_currentValue2) { context._currentValue2 = _currentValue2; } }, _threadCount: { get: function () { return context._threadCount; }, set: function (_threadCount) { context._threadCount = _threadCount; } }, Consumer: { get: function () { if (!hasWarnedAboutUsingNestedContextConsumers) { hasWarnedAboutUsingNestedContextConsumers = true; error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?'); } return context.Consumer; } }, displayName: { get: function () { return context.displayName; }, set: function (displayName) { if (!hasWarnedAboutDisplayNameOnConsumer) { warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName); hasWarnedAboutDisplayNameOnConsumer = true; } } } }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty context.Consumer = Consumer; } { context._currentRenderer = null; context._currentRenderer2 = null; } return context; } var Uninitialized = -1; var Pending = 0; var Resolved = 1; var Rejected = 2; function lazyInitializer(payload) { if (payload._status === Uninitialized) { var ctor = payload._result; var thenable = ctor(); // Transition to the next state. // This might throw either because it's missing or throws. If so, we treat it // as still uninitialized and try again next time. Which is the same as what // happens if the ctor or any wrappers processing the ctor throws. This might // end up fixing it if the resolution was a concurrency bug. thenable.then(function (moduleObject) { if (payload._status === Pending || payload._status === Uninitialized) { // Transition to the next state. var resolved = payload; resolved._status = Resolved; resolved._result = moduleObject; } }, function (error) { if (payload._status === Pending || payload._status === Uninitialized) { // Transition to the next state. var rejected = payload; rejected._status = Rejected; rejected._result = error; } }); if (payload._status === Uninitialized) { // In case, we're still uninitialized, then we're waiting for the thenable // to resolve. Set it as pending in the meantime. var pending = payload; pending._status = Pending; pending._result = thenable; } } if (payload._status === Resolved) { var moduleObject = payload._result; { if (moduleObject === undefined) { error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies. 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject); } } { if (!('default' in moduleObject)) { error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies. 'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject); } } return moduleObject.default; } else { throw payload._result; } } function lazy(ctor) { var payload = { // We use these fields to store the result. _status: Uninitialized, _result: ctor }; var lazyType = { $$typeof: REACT_LAZY_TYPE, _payload: payload, _init: lazyInitializer }; { // In production, this would just set it on the object. var defaultProps; var propTypes; // $FlowFixMe Object.defineProperties(lazyType, { defaultProps: { configurable: true, get: function () { return defaultProps; }, set: function (newDefaultProps) { error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); defaultProps = newDefaultProps; // Match production behavior more closely: // $FlowFixMe Object.defineProperty(lazyType, 'defaultProps', { enumerable: true }); } }, propTypes: { configurable: true, get: function () { return propTypes; }, set: function (newPropTypes) { error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.'); propTypes = newPropTypes; // Match production behavior more closely: // $FlowFixMe Object.defineProperty(lazyType, 'propTypes', { enumerable: true }); } } }); } return lazyType; } function forwardRef(render) { { if (render != null && render.$$typeof === REACT_MEMO_TYPE) { error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).'); } else if (typeof render !== 'function') { error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render); } else { if (render.length !== 0 && render.length !== 2) { error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.'); } } if (render != null) { if (render.defaultProps != null || render.propTypes != null) { error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?'); } } } var elementType = { $$typeof: REACT_FORWARD_REF_TYPE, render: render }; { var ownName; Object.defineProperty(elementType, 'displayName', { enumerable: false, configurable: true, get: function () { return ownName; }, set: function (name) { ownName = name; // The inner component shouldn't inherit this display name in most cases, // because the component may be used elsewhere. // But it's nice for anonymous functions to inherit the name, // so that our component-stack generation logic will display their frames. // An anonymous function generally suggests a pattern like: // React.forwardRef((props, ref) => {...}); // This kind of inner function is not used elsewhere so the side effect is okay. if (!render.name && !render.displayName) { render.displayName = name; } } }); } return elementType; } var REACT_MODULE_REFERENCE; { REACT_MODULE_REFERENCE = Symbol.for('react.module.reference'); } function isValidElementType(type) { if (typeof type === 'string' || typeof type === 'function') { return true; } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) { return true; } if (typeof type === 'object' && type !== null) { if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) { return true; } } return false; } function memo(type, compare) { { if (!isValidElementType(type)) { error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type); } } var elementType = { $$typeof: REACT_MEMO_TYPE, type: type, compare: compare === undefined ? null : compare }; { var ownName; Object.defineProperty(elementType, 'displayName', { enumerable: false, configurable: true, get: function () { return ownName; }, set: function (name) { ownName = name; // The inner component shouldn't inherit this display name in most cases, // because the component may be used elsewhere. // But it's nice for anonymous functions to inherit the name, // so that our component-stack generation logic will display their frames. // An anonymous function generally suggests a pattern like: // React.memo((props) => {...}); // This kind of inner function is not used elsewhere so the side effect is okay. if (!type.name && !type.displayName) { type.displayName = name; } } }); } return elementType; } function resolveDispatcher() { var dispatcher = ReactCurrentDispatcher.current; { if (dispatcher === null) { error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.'); } } // Will result in a null access error if accessed outside render phase. We // intentionally don't throw our own error because this is in a hot path. // Also helps ensure this is inlined. return dispatcher; } function useContext(Context) { var dispatcher = resolveDispatcher(); { // TODO: add a more generic warning for invalid values. if (Context._context !== undefined) { var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs // and nobody should be using this in existing code. if (realContext.Consumer === Context) { error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?'); } else if (realContext.Provider === Context) { error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?'); } } } return dispatcher.useContext(Context); } function useState(initialState) { var dispatcher = resolveDispatcher(); return dispatcher.useState(initialState); } function useReducer(reducer, initialArg, init) { var dispatcher = resolveDispatcher(); return dispatcher.useReducer(reducer, initialArg, init); } function useRef(initialValue) { var dispatcher = resolveDispatcher(); return dispatcher.useRef(initialValue); } function useEffect(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useEffect(create, deps); } function useInsertionEffect(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useInsertionEffect(create, deps); } function useLayoutEffect(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useLayoutEffect(create, deps); } function useCallback(callback, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useCallback(callback, deps); } function useMemo(create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useMemo(create, deps); } function useImperativeHandle(ref, create, deps) { var dispatcher = resolveDispatcher(); return dispatcher.useImperativeHandle(ref, create, deps); } function useDebugValue(value, formatterFn) { { var dispatcher = resolveDispatcher(); return dispatcher.useDebugValue(value, formatterFn); } } function useTransition() { var dispatcher = resolveDispatcher(); return dispatcher.useTransition(); } function useDeferredValue(value) { var dispatcher = resolveDispatcher(); return dispatcher.useDeferredValue(value); } function useId() { var dispatcher = resolveDispatcher(); return dispatcher.useId(); } function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { var dispatcher = resolveDispatcher(); return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot); } // Helpers to patch console.logs to avoid logging during side-effect free // replaying on render function. This currently only patches the object // lazily which won't cover if the log function was extracted eagerly. // We could also eagerly patch the method. var disabledDepth = 0; var prevLog; var prevInfo; var prevWarn; var prevError; var prevGroup; var prevGroupCollapsed; var prevGroupEnd; function disabledLog() {} disabledLog.__reactDisabledLog = true; function disableLogs() { { if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ prevLog = console.log; prevInfo = console.info; prevWarn = console.warn; prevError = console.error; prevGroup = console.group; prevGroupCollapsed = console.groupCollapsed; prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099 var props = { configurable: true, enumerable: true, value: disabledLog, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { info: props, log: props, warn: props, error: props, group: props, groupCollapsed: props, groupEnd: props }); /* eslint-enable react-internal/no-production-logging */ } disabledDepth++; } } function reenableLogs() { { disabledDepth--; if (disabledDepth === 0) { /* eslint-disable react-internal/no-production-logging */ var props = { configurable: true, enumerable: true, writable: true }; // $FlowFixMe Flow thinks console is immutable. Object.defineProperties(console, { log: assign({}, props, { value: prevLog }), info: assign({}, props, { value: prevInfo }), warn: assign({}, props, { value: prevWarn }), error: assign({}, props, { value: prevError }), group: assign({}, props, { value: prevGroup }), groupCollapsed: assign({}, props, { value: prevGroupCollapsed }), groupEnd: assign({}, props, { value: prevGroupEnd }) }); /* eslint-enable react-internal/no-production-logging */ } if (disabledDepth < 0) { error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.'); } } } var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher; var prefix; function describeBuiltInComponentFrame(name, source, ownerFn) { { if (prefix === undefined) { // Extract the VM specific prefix used by each line. try { throw Error(); } catch (x) { var match = x.stack.trim().match(/\n( *(at )?)/); prefix = match && match[1] || ''; } } // We use the prefix to ensure our stacks line up with native stack frames. return '\n' + prefix + name; } } var reentry = false; var componentFrameCache; { var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; componentFrameCache = new PossiblyWeakMap(); } function describeNativeComponentFrame(fn, construct) { // If something asked for a stack inside a fake render, it should get ignored. if ( !fn || reentry) { return ''; } { var frame = componentFrameCache.get(fn); if (frame !== undefined) { return frame; } } var control; reentry = true; var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined. Error.prepareStackTrace = undefined; var previousDispatcher; { previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function // for warnings. ReactCurrentDispatcher$1.current = null; disableLogs(); } try { // This should throw. if (construct) { // Something should be setting the props in the constructor. var Fake = function () { throw Error(); }; // $FlowFixMe Object.defineProperty(Fake.prototype, 'props', { set: function () { // We use a throwing setter instead of frozen or non-writable props // because that won't throw in a non-strict mode function. throw Error(); } }); if (typeof Reflect === 'object' && Reflect.construct) { // We construct a different control for this case to include any extra // frames added by the construct call. try { Reflect.construct(Fake, []); } catch (x) { control = x; } Reflect.construct(fn, [], Fake); } else { try { Fake.call(); } catch (x) { control = x; } fn.call(Fake.prototype); } } else { try { throw Error(); } catch (x) { control = x; } fn(); } } catch (sample) { // This is inlined manually because closure doesn't do it for us. if (sample && control && typeof sample.stack === 'string') { // This extracts the first frame from the sample that isn't also in the control. // Skipping one frame that we assume is the frame that calls the two. var sampleLines = sample.stack.split('\n'); var controlLines = control.stack.split('\n'); var s = sampleLines.length - 1; var c = controlLines.length - 1; while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) { // We expect at least one stack frame to be shared. // Typically this will be the root most one. However, stack frames may be // cut off due to maximum stack limits. In this case, one maybe cut off // earlier than the other. We assume that the sample is longer or the same // and there for cut off earlier. So we should find the root most frame in // the sample somewhere in the control. c--; } for (; s >= 1 && c >= 0; s--, c--) { // Next we find the first one that isn't the same which should be the // frame that called our sample function and the control. if (sampleLines[s] !== controlLines[c]) { // In V8, the first line is describing the message but other VMs don't. // If we're about to return the first line, and the control is also on the same // line, that's a pretty good indicator that our sample threw at same line as // the control. I.e. before we entered the sample frame. So we ignore this result. // This can happen if you passed a class to function component, or non-function. if (s !== 1 || c !== 1) { do { s--; c--; // We may still have similar intermediate frames from the construct call. // The next one that isn't the same should be our match though. if (c < 0 || sampleLines[s] !== controlLines[c]) { // V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>" // but we have a user-provided "displayName" // splice it in to make the stack more readable. if (fn.displayName && _frame.includes('<anonymous>')) { _frame = _frame.replace('<anonymous>', fn.displayName); } { if (typeof fn === 'function') { componentFrameCache.set(fn, _frame); } } // Return the line we found. return _frame; } } while (s >= 1 && c >= 0); } break; } } } } finally { reentry = false; { ReactCurrentDispatcher$1.current = previousDispatcher; reenableLogs(); } Error.prepareStackTrace = previousPrepareStackTrace; } // Fallback to just using the name if we couldn't make it throw. var name = fn ? fn.displayName || fn.name : ''; var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''; { if (typeof fn === 'function') { componentFrameCache.set(fn, syntheticFrame); } } return syntheticFrame; } function describeFunctionComponentFrame(fn, source, ownerFn) { { return describeNativeComponentFrame(fn, false); } } function shouldConstruct(Component) { var prototype = Component.prototype; return !!(prototype && prototype.isReactComponent); } function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) { if (type == null) { return ''; } if (typeof type === 'function') { { return describeNativeComponentFrame(type, shouldConstruct(type)); } } if (typeof type === 'string') { return describeBuiltInComponentFrame(type); } switch (type) { case REACT_SUSPENSE_TYPE: return describeBuiltInComponentFrame('Suspense'); case REACT_SUSPENSE_LIST_TYPE: return describeBuiltInComponentFrame('SuspenseList'); } if (typeof type === 'object') { switch (type.$$typeof) { case REACT_FORWARD_REF_TYPE: return describeFunctionComponentFrame(type.render); case REACT_MEMO_TYPE: // Memo may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn); case REACT_LAZY_TYPE: { var lazyComponent = type; var payload = lazyComponent._payload; var init = lazyComponent._init; try { // Lazy may contain any component type so we recursively resolve it. return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn); } catch (x) {} } } } return ''; } var loggedTypeFailures = {}; var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; function setCurrentlyValidatingElement(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); ReactDebugCurrentFrame$1.setExtraStackFrame(stack); } else { ReactDebugCurrentFrame$1.setExtraStackFrame(null); } } } function checkPropTypes(typeSpecs, values, location, componentName, element) { { // $FlowFixMe This is okay but Flow doesn't know it. var has = Function.call.bind(hasOwnProperty); for (var typeSpecName in typeSpecs) { if (has(typeSpecs, typeSpecName)) { var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to // fail the render phase where it didn't fail before. So we log it. // After these have been cleaned up, we'll let them throw. try { // This is intentionally an invariant that gets caught. It's the same // behavior as without this statement except with a better message. if (typeof typeSpecs[typeSpecName] !== 'function') { // eslint-disable-next-line react-internal/prod-error-codes var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'); err.name = 'Invariant Violation'; throw err; } error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'); } catch (ex) { error$1 = ex; } if (error$1 && !(error$1 instanceof Error)) { setCurrentlyValidatingElement(element); error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1); setCurrentlyValidatingElement(null); } if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) { // Only monitor this failure once because there tends to be a lot of the // same error. loggedTypeFailures[error$1.message] = true; setCurrentlyValidatingElement(element); error('Failed %s type: %s', location, error$1.message); setCurrentlyValidatingElement(null); } } } } } function setCurrentlyValidatingElement$1(element) { { if (element) { var owner = element._owner; var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null); setExtraStackFrame(stack); } else { setExtraStackFrame(null); } } } var propTypesMisspellWarningShown; { propTypesMisspellWarningShown = false; } function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { var name = getComponentNameFromType(ReactCurrentOwner.current.type); if (name) { return '\n\nCheck the render method of `' + name + '`.'; } } return ''; } function getSourceInfoErrorAddendum(source) { if (source !== undefined) { var fileName = source.fileName.replace(/^.*[\\\/]/, ''); var lineNumber = source.lineNumber; return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'; } return ''; } function getSourceInfoErrorAddendumForProps(elementProps) { if (elementProps !== null && elementProps !== undefined) { return getSourceInfoErrorAddendum(elementProps.__source); } return ''; } /** * Warn if there's no key explicitly set on dynamic arrays of children or * object keys are not valid. This allows us to keep track of children between * updates. */ var ownerHasKeyUseWarning = {}; function getCurrentComponentErrorInfo(parentType) { var info = getDeclarationErrorAddendum(); if (!info) { var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name; if (parentName) { info = "\n\nCheck the top-level render call using <" + parentName + ">."; } } return info; } /** * Warn if the element doesn't have an explicit key assigned to it. * This element is in an array. The array could grow and shrink or be * reordered. All children that haven't already been validated are required to * have a "key" property assigned to it. Error statuses are cached so a warning * will only be shown once. * * @internal * @param {ReactElement} element Element that requires a key. * @param {*} parentType element's parent's type. */ function validateExplicitKey(element, parentType) { if (!element._store || element._store.validated || element.key != null) { return; } element._store.validated = true; var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType); if (ownerHasKeyUseWarning[currentComponentErrorInfo]) { return; } ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a // property, it may be the creator of the child that's responsible for // assigning it a key. var childOwner = ''; if (element && element._owner && element._owner !== ReactCurrentOwner.current) { // Give the component that originally created this child. childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + "."; } { setCurrentlyValidatingElement$1(element); error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner); setCurrentlyValidatingElement$1(null); } } /** * Ensure that every element either is passed in a static location, in an * array with an explicit keys property defined, or in an object literal * with valid key property. * * @internal * @param {ReactNode} node Statically passed child of any type. * @param {*} parentType node's parent's type. */ function validateChildKeys(node, parentType) { if (typeof node !== 'object') { return; } if (isArray(node)) { for (var i = 0; i < node.length; i++) { var child = node[i]; if (isValidElement(child)) { validateExplicitKey(child, parentType); } } } else if (isValidElement(node)) { // This element was passed in a valid location. if (node._store) { node._store.validated = true; } } else if (node) { var iteratorFn = getIteratorFn(node); if (typeof iteratorFn === 'function') { // Entry iterators used to provide implicit keys, // but now we print a separate warning for them later. if (iteratorFn !== node.entries) { var iterator = iteratorFn.call(node); var step; while (!(step = iterator.next()).done) { if (isValidElement(step.value)) { validateExplicitKey(step.value, parentType); } } } } } } /** * Given an element, validate that its props follow the propTypes definition, * provided by the type. * * @param {ReactElement} element */ function validatePropTypes(element) { { var type = element.type; if (type === null || type === undefined || typeof type === 'string') { return; } var propTypes; if (typeof type === 'function') { propTypes = type.propTypes; } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. type.$$typeof === REACT_MEMO_TYPE)) { propTypes = type.propTypes; } else { return; } if (propTypes) { // Intentionally inside to avoid triggering lazy initializers: var name = getComponentNameFromType(type); checkPropTypes(propTypes, element.props, 'prop', name, element); } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) { propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: var _name = getComponentNameFromType(type); error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown'); } if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) { error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.'); } } } /** * Given a fragment, validate that it can only be provided with fragment props * @param {ReactElement} fragment */ function validateFragmentProps(fragment) { { var keys = Object.keys(fragment.props); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (key !== 'children' && key !== 'key') { setCurrentlyValidatingElement$1(fragment); error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key); setCurrentlyValidatingElement$1(null); break; } } if (fragment.ref !== null) { setCurrentlyValidatingElement$1(fragment); error('Invalid attribute `ref` supplied to `React.Fragment`.'); setCurrentlyValidatingElement$1(null); } } } function createElementWithValidation(type, props, children) { var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to // succeed and there will likely be errors in render. if (!validType) { var info = ''; if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports."; } var sourceInfo = getSourceInfoErrorAddendumForProps(props); if (sourceInfo) { info += sourceInfo; } else { info += getDeclarationErrorAddendum(); } var typeString; if (type === null) { typeString = 'null'; } else if (isArray(type)) { typeString = 'array'; } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) { typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />"; info = ' Did you accidentally export a JSX literal instead of a component?'; } else { typeString = typeof type; } { error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info); } } var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used. // TODO: Drop this when these are no longer allowed as the type argument. if (element == null) { return element; } // Skip key warning if the type isn't valid since our key validation logic // doesn't expect a non-string/function type and can throw confusing errors. // We don't want exception behavior to differ between dev and prod. // (Rendering will throw with a helpful message and as soon as the type is // fixed, the key warnings will appear.) if (validType) { for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], type); } } if (type === REACT_FRAGMENT_TYPE) { validateFragmentProps(element); } else { validatePropTypes(element); } return element; } var didWarnAboutDeprecatedCreateFactory = false; function createFactoryWithValidation(type) { var validatedFactory = createElementWithValidation.bind(null, type); validatedFactory.type = type; { if (!didWarnAboutDeprecatedCreateFactory) { didWarnAboutDeprecatedCreateFactory = true; warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.'); } // Legacy hook: remove it Object.defineProperty(validatedFactory, 'type', { enumerable: false, get: function () { warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); Object.defineProperty(this, 'type', { value: type }); return type; } }); } return validatedFactory; } function cloneElementWithValidation(element, props, children) { var newElement = cloneElement.apply(this, arguments); for (var i = 2; i < arguments.length; i++) { validateChildKeys(arguments[i], newElement.type); } validatePropTypes(newElement); return newElement; } var enableSchedulerDebugging = false; var enableProfiling = false; var frameYieldMs = 5; function push(heap, node) { var index = heap.length; heap.push(node); siftUp(heap, node, index); } function peek(heap) { return heap.length === 0 ? null : heap[0]; } function pop(heap) { if (heap.length === 0) { return null; } var first = heap[0]; var last = heap.pop(); if (last !== first) { heap[0] = last; siftDown(heap, last, 0); } return first; } function siftUp(heap, node, i) { var index = i; while (index > 0) { var parentIndex = index - 1 >>> 1; var parent = heap[parentIndex]; if (compare(parent, node) > 0) { // The parent is larger. Swap positions. heap[parentIndex] = node; heap[index] = parent; index = parentIndex; } else { // The parent is smaller. Exit. return; } } } function siftDown(heap, node, i) { var index = i; var length = heap.length; var halfLength = length >>> 1; while (index < halfLength) { var leftIndex = (index + 1) * 2 - 1; var left = heap[leftIndex]; var rightIndex = leftIndex + 1; var right = heap[rightIndex]; // If the left or right node is smaller, swap with the smaller of those. if (compare(left, node) < 0) { if (rightIndex < length && compare(right, left) < 0) { heap[index] = right; heap[rightIndex] = node; index = rightIndex; } else { heap[index] = left; heap[leftIndex] = node; index = leftIndex; } } else if (rightIndex < length && compare(right, node) < 0) { heap[index] = right; heap[rightIndex] = node; index = rightIndex; } else { // Neither child is smaller. Exit. return; } } } function compare(a, b) { // Compare sort index first, then task id. var diff = a.sortIndex - b.sortIndex; return diff !== 0 ? diff : a.id - b.id; } // TODO: Use symbols? var ImmediatePriority = 1; var UserBlockingPriority = 2; var NormalPriority = 3; var LowPriority = 4; var IdlePriority = 5; function markTaskErrored(task, ms) { } /* eslint-disable no-var */ var getCurrentTime; var hasPerformanceNow = typeof performance === 'object' && typeof performance.now === 'function'; if (hasPerformanceNow) { var localPerformance = performance; getCurrentTime = function () { return localPerformance.now(); }; } else { var localDate = Date; var initialTime = localDate.now(); getCurrentTime = function () { return localDate.now() - initialTime; }; } // Max 31 bit integer. The max integer size in V8 for 32-bit systems. // Math.pow(2, 30) - 1 // 0b111111111111111111111111111111 var maxSigned31BitInt = 1073741823; // Times out immediately var IMMEDIATE_PRIORITY_TIMEOUT = -1; // Eventually times out var USER_BLOCKING_PRIORITY_TIMEOUT = 250; var NORMAL_PRIORITY_TIMEOUT = 5000; var LOW_PRIORITY_TIMEOUT = 10000; // Never times out var IDLE_PRIORITY_TIMEOUT = maxSigned31BitInt; // Tasks are stored on a min heap var taskQueue = []; var timerQueue = []; // Incrementing id counter. Used to maintain insertion order. var taskIdCounter = 1; // Pausing the scheduler is useful for debugging. var currentTask = null; var currentPriorityLevel = NormalPriority; // This is set while performing work, to prevent re-entrance. var isPerformingWork = false; var isHostCallbackScheduled = false; var isHostTimeoutScheduled = false; // Capture local references to native APIs, in case a polyfill overrides them. var localSetTimeout = typeof setTimeout === 'function' ? setTimeout : null; var localClearTimeout = typeof clearTimeout === 'function' ? clearTimeout : null; var localSetImmediate = typeof setImmediate !== 'undefined' ? setImmediate : null; // IE and Node.js + jsdom var isInputPending = typeof navigator !== 'undefined' && navigator.scheduling !== undefined && navigator.scheduling.isInputPending !== undefined ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null; function advanceTimers(currentTime) { // Check for tasks that are no longer delayed and add them to the queue. var timer = peek(timerQueue); while (timer !== null) { if (timer.callback === null) { // Timer was cancelled. pop(timerQueue); } else if (timer.startTime <= currentTime) { // Timer fired. Transfer to the task queue. pop(timerQueue); timer.sortIndex = timer.expirationTime; push(taskQueue, timer); } else { // Remaining timers are pending. return; } timer = peek(timerQueue); } } function handleTimeout(currentTime) { isHostTimeoutScheduled = false; advanceTimers(currentTime); if (!isHostCallbackScheduled) { if (peek(taskQueue) !== null) { isHostCallbackScheduled = true; requestHostCallback(flushWork); } else { var firstTimer = peek(timerQueue); if (firstTimer !== null) { requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); } } } } function flushWork(hasTimeRemaining, initialTime) { isHostCallbackScheduled = false; if (isHostTimeoutScheduled) { // We scheduled a timeout but it's no longer needed. Cancel it. isHostTimeoutScheduled = false; cancelHostTimeout(); } isPerformingWork = true; var previousPriorityLevel = currentPriorityLevel; try { if (enableProfiling) { try { return workLoop(hasTimeRemaining, initialTime); } catch (error) { if (currentTask !== null) { var currentTime = getCurrentTime(); markTaskErrored(currentTask, currentTime); currentTask.isQueued = false; } throw error; } } else { // No catch in prod code path. return workLoop(hasTimeRemaining, initialTime); } } finally { currentTask = null; currentPriorityLevel = previousPriorityLevel; isPerformingWork = false; } } function workLoop(hasTimeRemaining, initialTime) { var currentTime = initialTime; advanceTimers(currentTime); currentTask = peek(taskQueue); while (currentTask !== null && !(enableSchedulerDebugging )) { if (currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost())) { // This currentTask hasn't expired, and we've reached the deadline. break; } var callback = currentTask.callback; if (typeof callback === 'function') { currentTask.callback = null; currentPriorityLevel = currentTask.priorityLevel; var didUserCallbackTimeout = currentTask.expirationTime <= currentTime; var continuationCallback = callback(didUserCallbackTimeout); currentTime = getCurrentTime(); if (typeof continuationCallback === 'function') { currentTask.callback = continuationCallback; } else { if (currentTask === peek(taskQueue)) { pop(taskQueue); } } advanceTimers(currentTime); } else { pop(taskQueue); } currentTask = peek(taskQueue); } // Return whether there's additional work if (currentTask !== null) { return true; } else { var firstTimer = peek(timerQueue); if (firstTimer !== null) { requestHostTimeout(handleTimeout, firstTimer.startTime - currentTime); } return false; } } function unstable_runWithPriority(priorityLevel, eventHandler) { switch (priorityLevel) { case ImmediatePriority: case UserBlockingPriority: case NormalPriority: case LowPriority: case IdlePriority: break; default: priorityLevel = NormalPriority; } var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = priorityLevel; try { return eventHandler(); } finally { currentPriorityLevel = previousPriorityLevel; } } function unstable_next(eventHandler) { var priorityLevel; switch (currentPriorityLevel) { case ImmediatePriority: case UserBlockingPriority: case NormalPriority: // Shift down to normal priority priorityLevel = NormalPriority; break; default: // Anything lower than normal priority should remain at the current level. priorityLevel = currentPriorityLevel; break; } var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = priorityLevel; try { return eventHandler(); } finally { currentPriorityLevel = previousPriorityLevel; } } function unstable_wrapCallback(callback) { var parentPriorityLevel = currentPriorityLevel; return function () { // This is a fork of runWithPriority, inlined for performance. var previousPriorityLevel = currentPriorityLevel; currentPriorityLevel = parentPriorityLevel; try { return callback.apply(this, arguments); } finally { currentPriorityLevel = previousPriorityLevel; } }; } function unstable_scheduleCallback(priorityLevel, callback, options) { var currentTime = getCurrentTime(); var startTime; if (typeof options === 'object' && options !== null) { var delay = options.delay; if (typeof delay === 'number' && delay > 0) { startTime = currentTime + delay; } else { startTime = currentTime; } } else { startTime = currentTime; } var timeout; switch (priorityLevel) { case ImmediatePriority: timeout = IMMEDIATE_PRIORITY_TIMEOUT; break; case UserBlockingPriority: timeout = USER_BLOCKING_PRIORITY_TIMEOUT; break; case IdlePriority: timeout = IDLE_PRIORITY_TIMEOUT; break; case LowPriority: timeout = LOW_PRIORITY_TIMEOUT; break; case NormalPriority: default: timeout = NORMAL_PRIORITY_TIMEOUT; break; } var expirationTime = startTime + timeout; var newTask = { id: taskIdCounter++, callback: callback, priorityLevel: priorityLevel, startTime: startTime, expirationTime: expirationTime, sortIndex: -1 }; if (startTime > currentTime) { // This is a delayed task. newTask.sortIndex = startTime; push(timerQueue, newTask); if (peek(taskQueue) === null && newTask === peek(timerQueue)) { // All tasks are delayed, and this is the task with the earliest delay. if (isHostTimeoutScheduled) { // Cancel an existing timeout. cancelHostTimeout(); } else { isHostTimeoutScheduled = true; } // Schedule a timeout. requestHostTimeout(handleTimeout, startTime - currentTime); } } else { newTask.sortIndex = expirationTime; push(taskQueue, newTask); // wait until the next time we yield. if (!isHostCallbackScheduled && !isPerformingWork) { isHostCallbackScheduled = true; requestHostCallback(flushWork); } } return newTask; } function unstable_pauseExecution() { } function unstable_continueExecution() { if (!isHostCallbackScheduled && !isPerformingWork) { isHostCallbackScheduled = true; requestHostCallback(flushWork); } } function unstable_getFirstCallbackNode() { return peek(taskQueue); } function unstable_cancelCallback(task) { // remove from the queue because you can't remove arbitrary nodes from an // array based heap, only the first one.) task.callback = null; } function unstable_getCurrentPriorityLevel() { return currentPriorityLevel; } var isMessageLoopRunning = false; var scheduledHostCallback = null; var taskTimeoutID = -1; // Scheduler periodically yields in case there is other work on the main // thread, like user events. By default, it yields multiple times per frame. // It does not attempt to align with frame boundaries, since most tasks don't // need to be frame aligned; for those that do, use requestAnimationFrame. var frameInterval = frameYieldMs; var startTime = -1; function shouldYieldToHost() { var timeElapsed = getCurrentTime() - startTime; if (timeElapsed < frameInterval) { // The main thread has only been blocked for a really short amount of time; // smaller than a single frame. Don't yield yet. return false; } // The main thread has been blocked for a non-negligible amount of time. We return true; } function requestPaint() { } function forceFrameRate(fps) { if (fps < 0 || fps > 125) { // Using console['error'] to evade Babel and ESLint console['error']('forceFrameRate takes a positive int between 0 and 125, ' + 'forcing frame rates higher than 125 fps is not supported'); return; } if (fps > 0) { frameInterval = Math.floor(1000 / fps); } else { // reset the framerate frameInterval = frameYieldMs; } } var performWorkUntilDeadline = function () { if (scheduledHostCallback !== null) { var currentTime = getCurrentTime(); // Keep track of the start time so we can measure how long the main thread // has been blocked. startTime = currentTime; var hasTimeRemaining = true; // If a scheduler task throws, exit the current browser task so the // error can be observed. // // Intentionally not using a try-catch, since that makes some debugging // techniques harder. Instead, if `scheduledHostCallback` errors, then // `hasMoreWork` will remain true, and we'll continue the work loop. var hasMoreWork = true; try { hasMoreWork = scheduledHostCallback(hasTimeRemaining, currentTime); } finally { if (hasMoreWork) { // If there's more work, schedule the next message event at the end // of the preceding one. schedulePerformWorkUntilDeadline(); } else { isMessageLoopRunning = false; scheduledHostCallback = null; } } } else { isMessageLoopRunning = false; } // Yielding to the browser will give it a chance to paint, so we can }; var schedulePerformWorkUntilDeadline; if (typeof localSetImmediate === 'function') { // Node.js and old IE. // There's a few reasons for why we prefer setImmediate. // // Unlike MessageChannel, it doesn't prevent a Node.js process from exiting. // (Even though this is a DOM fork of the Scheduler, you could get here // with a mix of Node.js 15+, which has a MessageChannel, and jsdom.) // https://github.com/facebook/react/issues/20756 // // But also, it runs earlier which is the semantic we want. // If other browsers ever implement it, it's better to use it. // Although both of these would be inferior to native scheduling. schedulePerformWorkUntilDeadline = function () { localSetImmediate(performWorkUntilDeadline); }; } else if (typeof MessageChannel !== 'undefined') { // DOM and Worker environments. // We prefer MessageChannel because of the 4ms setTimeout clamping. var channel = new MessageChannel(); var port = channel.port2; channel.port1.onmessage = performWorkUntilDeadline; schedulePerformWorkUntilDeadline = function () { port.postMessage(null); }; } else { // We should only fallback here in non-browser environments. schedulePerformWorkUntilDeadline = function () { localSetTimeout(performWorkUntilDeadline, 0); }; } function requestHostCallback(callback) { scheduledHostCallback = callback; if (!isMessageLoopRunning) { isMessageLoopRunning = true; schedulePerformWorkUntilDeadline(); } } function requestHostTimeout(callback, ms) { taskTimeoutID = localSetTimeout(function () { callback(getCurrentTime()); }, ms); } function cancelHostTimeout() { localClearTimeout(taskTimeoutID); taskTimeoutID = -1; } var unstable_requestPaint = requestPaint; var unstable_Profiling = null; var Scheduler = /*#__PURE__*/Object.freeze({ __proto__: null, unstable_ImmediatePriority: ImmediatePriority, unstable_UserBlockingPriority: UserBlockingPriority, unstable_NormalPriority: NormalPriority, unstable_IdlePriority: IdlePriority, unstable_LowPriority: LowPriority, unstable_runWithPriority: unstable_runWithPriority, unstable_next: unstable_next, unstable_scheduleCallback: unstable_scheduleCallback, unstable_cancelCallback: unstable_cancelCallback, unstable_wrapCallback: unstable_wrapCallback, unstable_getCurrentPriorityLevel: unstable_getCurrentPriorityLevel, unstable_shouldYield: shouldYieldToHost, unstable_requestPaint: unstable_requestPaint, unstable_continueExecution: unstable_continueExecution, unstable_pauseExecution: unstable_pauseExecution, unstable_getFirstCallbackNode: unstable_getFirstCallbackNode, get unstable_now () { return getCurrentTime; }, unstable_forceFrameRate: forceFrameRate, unstable_Profiling: unstable_Profiling }); var ReactSharedInternals$1 = { ReactCurrentDispatcher: ReactCurrentDispatcher, ReactCurrentOwner: ReactCurrentOwner, ReactCurrentBatchConfig: ReactCurrentBatchConfig, // Re-export the schedule API(s) for UMD bundles. // This avoids introducing a dependency on a new UMD global in a minor update, // Since that would be a breaking change (e.g. for all existing CodeSandboxes). // This re-export is only required for UMD bundles; // CJS bundles use the shared NPM package. Scheduler: Scheduler }; { ReactSharedInternals$1.ReactCurrentActQueue = ReactCurrentActQueue; ReactSharedInternals$1.ReactDebugCurrentFrame = ReactDebugCurrentFrame; } function startTransition(scope, options) { var prevTransition = ReactCurrentBatchConfig.transition; ReactCurrentBatchConfig.transition = {}; var currentTransition = ReactCurrentBatchConfig.transition; { ReactCurrentBatchConfig.transition._updatedFibers = new Set(); } try { scope(); } finally { ReactCurrentBatchConfig.transition = prevTransition; { if (prevTransition === null && currentTransition._updatedFibers) { var updatedFibersCount = currentTransition._updatedFibers.size; if (updatedFibersCount > 10) { warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.'); } currentTransition._updatedFibers.clear(); } } } } var didWarnAboutMessageChannel = false; var enqueueTaskImpl = null; function enqueueTask(task) { if (enqueueTaskImpl === null) { try { // read require off the module object to get around the bundlers. // we don't want them to detect a require and bundle a Node polyfill. var requireString = ('require' + Math.random()).slice(0, 7); var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's // version of setImmediate, bypassing fake timers if any. enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate; } catch (_err) { // we're in a browser // we can't use regular timers because they may still be faked // so we try MessageChannel+postMessage instead enqueueTaskImpl = function (callback) { { if (didWarnAboutMessageChannel === false) { didWarnAboutMessageChannel = true; if (typeof MessageChannel === 'undefined') { error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.'); } } } var channel = new MessageChannel(); channel.port1.onmessage = callback; channel.port2.postMessage(undefined); }; } } return enqueueTaskImpl(task); } var actScopeDepth = 0; var didWarnNoAwaitAct = false; function act(callback) { { // `act` calls can be nested, so we track the depth. This represents the // number of `act` scopes on the stack. var prevActScopeDepth = actScopeDepth; actScopeDepth++; if (ReactCurrentActQueue.current === null) { // This is the outermost `act` scope. Initialize the queue. The reconciler // will detect the queue and use it instead of Scheduler. ReactCurrentActQueue.current = []; } var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy; var result; try { // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only // set to `true` while the given callback is executed, not for updates // triggered during an async event, because this is how the legacy // implementation of `act` behaved. ReactCurrentActQueue.isBatchingLegacy = true; result = callback(); // Replicate behavior of original `act` implementation in legacy mode, // which flushed updates immediately after the scope function exits, even // if it's an async function. if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) { var queue = ReactCurrentActQueue.current; if (queue !== null) { ReactCurrentActQueue.didScheduleLegacyUpdate = false; flushActQueue(queue); } } } catch (error) { popActScope(prevActScopeDepth); throw error; } finally { ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy; } if (result !== null && typeof result === 'object' && typeof result.then === 'function') { var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait // for it to resolve before exiting the current scope. var wasAwaited = false; var thenable = { then: function (resolve, reject) { wasAwaited = true; thenableResult.then(function (returnValue) { popActScope(prevActScopeDepth); if (actScopeDepth === 0) { // We've exited the outermost act scope. Recursively flush the // queue until there's no remaining work. recursivelyFlushAsyncActWork(returnValue, resolve, reject); } else { resolve(returnValue); } }, function (error) { // The callback threw an error. popActScope(prevActScopeDepth); reject(error); }); } }; { if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') { // eslint-disable-next-line no-undef Promise.resolve().then(function () {}).then(function () { if (!wasAwaited) { didWarnNoAwaitAct = true; error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);'); } }); } } return thenable; } else { var returnValue = result; // The callback is not an async function. Exit the current scope // immediately, without awaiting. popActScope(prevActScopeDepth); if (actScopeDepth === 0) { // Exiting the outermost act scope. Flush the queue. var _queue = ReactCurrentActQueue.current; if (_queue !== null) { flushActQueue(_queue); ReactCurrentActQueue.current = null; } // Return a thenable. If the user awaits it, we'll flush again in // case additional work was scheduled by a microtask. var _thenable = { then: function (resolve, reject) { // Confirm we haven't re-entered another `act` scope, in case // the user does something weird like await the thenable // multiple times. if (ReactCurrentActQueue.current === null) { // Recursively flush the queue until there's no remaining work. ReactCurrentActQueue.current = []; recursivelyFlushAsyncActWork(returnValue, resolve, reject); } else { resolve(returnValue); } } }; return _thenable; } else { // Since we're inside a nested `act` scope, the returned thenable // immediately resolves. The outer scope will flush the queue. var _thenable2 = { then: function (resolve, reject) { resolve(returnValue); } }; return _thenable2; } } } } function popActScope(prevActScopeDepth) { { if (prevActScopeDepth !== actScopeDepth - 1) { error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. '); } actScopeDepth = prevActScopeDepth; } } function recursivelyFlushAsyncActWork(returnValue, resolve, reject) { { var queue = ReactCurrentActQueue.current; if (queue !== null) { try { flushActQueue(queue); enqueueTask(function () { if (queue.length === 0) { // No additional work was scheduled. Finish. ReactCurrentActQueue.current = null; resolve(returnValue); } else { // Keep flushing work until there's none left. recursivelyFlushAsyncActWork(returnValue, resolve, reject); } }); } catch (error) { reject(error); } } else { resolve(returnValue); } } } var isFlushing = false; function flushActQueue(queue) { { if (!isFlushing) { // Prevent re-entrance. isFlushing = true; var i = 0; try { for (; i < queue.length; i++) { var callback = queue[i]; do { callback = callback(true); } while (callback !== null); } queue.length = 0; } catch (error) { // If something throws, leave the remaining callbacks on the queue. queue = queue.slice(i + 1); throw error; } finally { isFlushing = false; } } } } var createElement$1 = createElementWithValidation ; var cloneElement$1 = cloneElementWithValidation ; var createFactory = createFactoryWithValidation ; var Children = { map: mapChildren, forEach: forEachChildren, count: countChildren, toArray: toArray, only: onlyChild }; exports.Children = Children; exports.Component = Component; exports.Fragment = REACT_FRAGMENT_TYPE; exports.Profiler = REACT_PROFILER_TYPE; exports.PureComponent = PureComponent; exports.StrictMode = REACT_STRICT_MODE_TYPE; exports.Suspense = REACT_SUSPENSE_TYPE; exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals$1; exports.act = act; exports.cloneElement = cloneElement$1; exports.createContext = createContext; exports.createElement = createElement$1; exports.createFactory = createFactory; exports.createRef = createRef; exports.forwardRef = forwardRef; exports.isValidElement = isValidElement; exports.lazy = lazy; exports.memo = memo; exports.startTransition = startTransition; exports.unstable_act = act; exports.useCallback = useCallback; exports.useContext = useContext; exports.useDebugValue = useDebugValue; exports.useDeferredValue = useDeferredValue; exports.useEffect = useEffect; exports.useId = useId; exports.useImperativeHandle = useImperativeHandle; exports.useInsertionEffect = useInsertionEffect; exports.useLayoutEffect = useLayoutEffect; exports.useMemo = useMemo; exports.useReducer = useReducer; exports.useRef = useRef; exports.useState = useState; exports.useSyncExternalStore = useSyncExternalStore; exports.useTransition = useTransition; exports.version = ReactVersion; }))); vendor/react.min.js 0000644 00000024604 15013651111 0010257 0 ustar 00 /** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ !function(){"use strict";var e,t;e=this,t=function(e){function t(e,t,n){this.props=e,this.context=t,this.refs=F,this.updater=n||O}function n(){}function r(e,t,n){this.props=e,this.context=t,this.refs=F,this.updater=n||O}function o(e,t,n){var r,o={},u=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(u=""+t.key),t)U.call(t,r)&&!q.hasOwnProperty(r)&&(o[r]=t[r]);var i=arguments.length-2;if(1===i)o.children=n;else if(1<i){for(var l=Array(i),c=0;c<i;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in i=e.defaultProps)void 0===o[r]&&(o[r]=i[r]);return{$$typeof:k,type:e,key:u,ref:a,props:o,_owner:V.current}}function u(e){return"object"==typeof e&&null!==e&&e.$$typeof===k}function a(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function i(e,t,n,r,o){var l=typeof e;"undefined"!==l&&"boolean"!==l||(e=null);var c=!1;if(null===e)c=!0;else switch(l){case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case k:case w:c=!0}}if(c)return o=o(c=e),e=""===r?"."+a(c,0):r,D(o)?(n="",null!=e&&(n=e.replace(A,"$&/")+"/"),i(o,t,n,"",(function(e){return e}))):null!=o&&(u(o)&&(o=function(e,t){return{$$typeof:k,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,n+(!o.key||c&&c.key===o.key?"":(""+o.key).replace(A,"$&/")+"/")+e)),t.push(o)),1;if(c=0,r=""===r?".":r+":",D(e))for(var f=0;f<e.length;f++){var s=r+a(l=e[f],f);c+=i(l,t,n,s,o)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=T&&e[T]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),f=0;!(l=e.next()).done;)c+=i(l=l.value,t,n,s=r+a(l,f++),o);else if("object"===l)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return c}function l(e,t,n){if(null==e)return e;var r=[],o=0;return i(e,r,"","",(function(e){return t.call(n,e,o++)})),r}function c(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}function f(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(!(0<y(o,t)))break e;e[r]=t,e[n]=o,n=r}}function s(e){return 0===e.length?null:e[0]}function p(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,u=o>>>1;r<u;){var a=2*(r+1)-1,i=e[a],l=a+1,c=e[l];if(0>y(i,n))l<o&&0>y(c,i)?(e[r]=c,e[l]=n,r=l):(e[r]=i,e[a]=n,r=a);else{if(!(l<o&&0>y(c,n)))break e;e[r]=c,e[l]=n,r=l}}}return t}function y(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}function d(e){for(var t=s(J);null!==t;){if(null===t.callback)p(J);else{if(!(t.startTime<=e))break;p(J),t.sortIndex=t.expirationTime,f(G,t)}t=s(J)}}function b(e){if(te=!1,d(e),!ee)if(null!==s(G))ee=!0,_(v);else{var t=s(J);null!==t&&h(b,t.startTime-e)}}function v(e,t){ee=!1,te&&(te=!1,re(ie),ie=-1),Z=!0;var n=X;try{for(d(t),Q=s(G);null!==Q&&(!(Q.expirationTime>t)||e&&!m());){var r=Q.callback;if("function"==typeof r){Q.callback=null,X=Q.priorityLevel;var o=r(Q.expirationTime<=t);t=H(),"function"==typeof o?Q.callback=o:Q===s(G)&&p(G),d(t)}else p(G);Q=s(G)}if(null!==Q)var u=!0;else{var a=s(J);null!==a&&h(b,a.startTime-t),u=!1}return u}finally{Q=null,X=n,Z=!1}}function m(){return!(H()-ce<le)}function _(e){ae=e,ue||(ue=!0,se())}function h(e,t){ie=ne((function(){e(H())}),t)}function g(e){throw Error("act(...) is not supported in production builds of React.")}var k=Symbol.for("react.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),R=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),$=Symbol.for("react.suspense"),I=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),T=Symbol.iterator,O={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){},enqueueReplaceState:function(e,t,n,r){},enqueueSetState:function(e,t,n,r){}},L=Object.assign,F={};t.prototype.isReactComponent={},t.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},t.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},n.prototype=t.prototype;var M=r.prototype=new n;M.constructor=r,L(M,t.prototype),M.isPureReactComponent=!0;var D=Array.isArray,U=Object.prototype.hasOwnProperty,V={current:null},q={key:!0,ref:!0,__self:!0,__source:!0},A=/\/+/g,N={current:null},B={transition:null};if("object"==typeof performance&&"function"==typeof performance.now)var z=performance,H=function(){return z.now()};else{var W=Date,Y=W.now();H=function(){return W.now()-Y}}var G=[],J=[],K=1,Q=null,X=3,Z=!1,ee=!1,te=!1,ne="function"==typeof setTimeout?setTimeout:null,re="function"==typeof clearTimeout?clearTimeout:null,oe="undefined"!=typeof setImmediate?setImmediate:null;"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var ue=!1,ae=null,ie=-1,le=5,ce=-1,fe=function(){if(null!==ae){var e=H();ce=e;var t=!0;try{t=ae(!0,e)}finally{t?se():(ue=!1,ae=null)}}else ue=!1};if("function"==typeof oe)var se=function(){oe(fe)};else if("undefined"!=typeof MessageChannel){var pe=(M=new MessageChannel).port2;M.port1.onmessage=fe,se=function(){pe.postMessage(null)}}else se=function(){ne(fe,0)};M={ReactCurrentDispatcher:N,ReactCurrentOwner:V,ReactCurrentBatchConfig:B,Scheduler:{__proto__:null,unstable_ImmediatePriority:1,unstable_UserBlockingPriority:2,unstable_NormalPriority:3,unstable_IdlePriority:5,unstable_LowPriority:4,unstable_runWithPriority:function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=X;X=e;try{return t()}finally{X=n}},unstable_next:function(e){switch(X){case 1:case 2:case 3:var t=3;break;default:t=X}var n=X;X=t;try{return e()}finally{X=n}},unstable_scheduleCallback:function(e,t,n){var r=H();switch(n="object"==typeof n&&null!==n&&"number"==typeof(n=n.delay)&&0<n?r+n:r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return e={id:K++,callback:t,priorityLevel:e,startTime:n,expirationTime:o=n+o,sortIndex:-1},n>r?(e.sortIndex=n,f(J,e),null===s(G)&&e===s(J)&&(te?(re(ie),ie=-1):te=!0,h(b,n-r))):(e.sortIndex=o,f(G,e),ee||Z||(ee=!0,_(v))),e},unstable_cancelCallback:function(e){e.callback=null},unstable_wrapCallback:function(e){var t=X;return function(){var n=X;X=t;try{return e.apply(this,arguments)}finally{X=n}}},unstable_getCurrentPriorityLevel:function(){return X},unstable_shouldYield:m,unstable_requestPaint:function(){},unstable_continueExecution:function(){ee||Z||(ee=!0,_(v))},unstable_pauseExecution:function(){},unstable_getFirstCallbackNode:function(){return s(G)},get unstable_now(){return H},unstable_forceFrameRate:function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<e?Math.floor(1e3/e):5},unstable_Profiling:null}},e.Children={map:l,forEach:function(e,t,n){l(e,(function(){t.apply(this,arguments)}),n)},count:function(e){var t=0;return l(e,(function(){t++})),t},toArray:function(e){return l(e,(function(e){return e}))||[]},only:function(e){if(!u(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},e.Component=t,e.Fragment=S,e.Profiler=C,e.PureComponent=r,e.StrictMode=x,e.Suspense=$,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M,e.act=g,e.cloneElement=function(e,t,n){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=L({},e.props),o=e.key,u=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(u=t.ref,a=V.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var i=e.type.defaultProps;for(l in t)U.call(t,l)&&!q.hasOwnProperty(l)&&(r[l]=void 0===t[l]&&void 0!==i?i[l]:t[l])}var l=arguments.length-2;if(1===l)r.children=n;else if(1<l){i=Array(l);for(var c=0;c<l;c++)i[c]=arguments[c+2];r.children=i}return{$$typeof:k,type:e.type,key:o,ref:u,props:r,_owner:a}},e.createContext=function(e){return(e={$$typeof:R,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:E,_context:e},e.Consumer=e},e.createElement=o,e.createFactory=function(e){var t=o.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:P,render:e}},e.isValidElement=u,e.lazy=function(e){return{$$typeof:j,_payload:{_status:-1,_result:e},_init:c}},e.memo=function(e,t){return{$$typeof:I,type:e,compare:void 0===t?null:t}},e.startTransition=function(e,t){t=B.transition,B.transition={};try{e()}finally{B.transition=t}},e.unstable_act=g,e.useCallback=function(e,t){return N.current.useCallback(e,t)},e.useContext=function(e){return N.current.useContext(e)},e.useDebugValue=function(e,t){},e.useDeferredValue=function(e){return N.current.useDeferredValue(e)},e.useEffect=function(e,t){return N.current.useEffect(e,t)},e.useId=function(){return N.current.useId()},e.useImperativeHandle=function(e,t,n){return N.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return N.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return N.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return N.current.useMemo(e,t)},e.useReducer=function(e,t,n){return N.current.useReducer(e,t,n)},e.useRef=function(e){return N.current.useRef(e)},e.useState=function(e){return N.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return N.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return N.current.useTransition()},e.version="18.3.1"},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).React={})}(); vendor/wp-polyfill-dom-rect.min.js 0000644 00000001534 15013651111 0013144 0 ustar 00 (()=>{function e(e){return void 0===e?0:Number(e)}function t(e,t){return!(e===t||isNaN(e)&&isNaN(t))}self.DOMRect=function(n,i,u,r){var o,f,a,c,m=e(n),b=e(i),d=e(u),g=e(r);Object.defineProperties(this,{x:{get:function(){return m},set:function(e){t(m,e)&&(m=e,o=f=void 0)},enumerable:!0},y:{get:function(){return b},set:function(e){t(b,e)&&(b=e,a=c=void 0)},enumerable:!0},width:{get:function(){return d},set:function(e){t(d,e)&&(d=e,o=f=void 0)},enumerable:!0},height:{get:function(){return g},set:function(e){t(g,e)&&(g=e,a=c=void 0)},enumerable:!0},left:{get:function(){return o=void 0===o?m+Math.min(0,d):o},enumerable:!0},right:{get:function(){return f=void 0===f?m+Math.max(0,d):f},enumerable:!0},top:{get:function(){return a=void 0===a?b+Math.min(0,g):a},enumerable:!0},bottom:{get:function(){return c=void 0===c?b+Math.max(0,g):c},enumerable:!0}})}})(); vendor/wp-polyfill-inert.min.js 0000644 00000020020 15013651111 0012542 0 ustar 00 !function(e){"object"==typeof exports&&"undefined"!=typeof module||"function"!=typeof define||!define.amd?e():define("inert",e)}((function(){"use strict";var e,t,n,i,o,r,s=function(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),e};function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function d(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){d(this,u),this._inertManager=t,this._rootElement=e,this._managedNodes=new Set,this._rootElement.hasAttribute("aria-hidden")?this._savedAriaHidden=this._rootElement.getAttribute("aria-hidden"):this._savedAriaHidden=null,this._rootElement.setAttribute("aria-hidden","true"),this._makeSubtreeUnfocusable(this._rootElement),this._observer=new MutationObserver(this._onMutation.bind(this)),this._observer.observe(this._rootElement,{attributes:!0,childList:!0,subtree:!0})}function h(e,t){d(this,h),this._node=e,this._overrodeFocusMethod=!1,this._inertRoots=new Set([t]),this._savedTabIndex=null,this._destroyed=!1,this.ensureUntabbable()}function l(e){if(d(this,l),!e)throw new Error("Missing required argument; InertManager needs to wrap a document.");this._document=e,this._managedNodes=new Map,this._inertRoots=new Map,this._observer=new MutationObserver(this._watchForInert.bind(this)),_(e.head||e.body||e.documentElement),"loading"===e.readyState?e.addEventListener("DOMContentLoaded",this._onDocumentLoaded.bind(this)):this._onDocumentLoaded()}function c(e,t,n){if(e.nodeType==Node.ELEMENT_NODE){var i=e;if(s=(t&&t(i),i.shadowRoot))return void c(s,t,s);if("content"==i.localName){for(var o=(s=i).getDistributedNodes?s.getDistributedNodes():[],r=0;r<o.length;r++)c(o[r],t,n);return}if("slot"==i.localName){for(var s,a=(s=i).assignedNodes?s.assignedNodes({flatten:!0}):[],d=0;d<a.length;d++)c(a[d],t,n);return}}for(var u=e.firstChild;null!=u;)c(u,t,n),u=u.nextSibling}function _(e){var t;e.querySelector("style#inert-style, link#inert-style")||((t=document.createElement("style")).setAttribute("id","inert-style"),t.textContent="\n[inert] {\n pointer-events: none;\n cursor: default;\n}\n\n[inert], [inert] * {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n",e.appendChild(t))}"undefined"!=typeof window&&"undefined"!=typeof Element&&(e=Array.prototype.slice,t=Element.prototype.matches||Element.prototype.msMatchesSelector,n=["a[href]","area[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","details","summary","iframe","object","embed","video","[contenteditable]"].join(","),s(u,[{key:"destructor",value:function(){this._observer.disconnect(),this._rootElement&&(null!==this._savedAriaHidden?this._rootElement.setAttribute("aria-hidden",this._savedAriaHidden):this._rootElement.removeAttribute("aria-hidden")),this._managedNodes.forEach((function(e){this._unmanageNode(e.node)}),this),this._observer=null,this._rootElement=null,this._managedNodes=null,this._inertManager=null}},{key:"_makeSubtreeUnfocusable",value:function(e){var t=this,n=(c(e,(function(e){return t._visitNode(e)})),document.activeElement);if(!document.body.contains(e)){for(var i=e,o=void 0;i;){if(i.nodeType===Node.DOCUMENT_FRAGMENT_NODE){o=i;break}i=i.parentNode}o&&(n=o.activeElement)}e.contains(n)&&(n.blur(),n===document.activeElement&&document.body.focus())}},{key:"_visitNode",value:function(e){e.nodeType===Node.ELEMENT_NODE&&(e!==this._rootElement&&e.hasAttribute("inert")&&this._adoptInertRoot(e),(t.call(e,n)||e.hasAttribute("tabindex"))&&this._manageNode(e))}},{key:"_manageNode",value:function(e){e=this._inertManager.register(e,this),this._managedNodes.add(e)}},{key:"_unmanageNode",value:function(e){(e=this._inertManager.deregister(e,this))&&this._managedNodes.delete(e)}},{key:"_unmanageSubtree",value:function(e){var t=this;c(e,(function(e){return t._unmanageNode(e)}))}},{key:"_adoptInertRoot",value:function(e){var t=this._inertManager.getInertRoot(e);t||(this._inertManager.setInert(e,!0),t=this._inertManager.getInertRoot(e)),t.managedNodes.forEach((function(e){this._manageNode(e.node)}),this)}},{key:"_onMutation",value:function(t,n){t.forEach((function(t){var n,i=t.target;"childList"===t.type?(e.call(t.addedNodes).forEach((function(e){this._makeSubtreeUnfocusable(e)}),this),e.call(t.removedNodes).forEach((function(e){this._unmanageSubtree(e)}),this)):"attributes"===t.type&&("tabindex"===t.attributeName?this._manageNode(i):i!==this._rootElement&&"inert"===t.attributeName&&i.hasAttribute("inert")&&(this._adoptInertRoot(i),n=this._inertManager.getInertRoot(i),this._managedNodes.forEach((function(e){i.contains(e.node)&&n._manageNode(e.node)}))))}),this)}},{key:"managedNodes",get:function(){return new Set(this._managedNodes)}},{key:"hasSavedAriaHidden",get:function(){return null!==this._savedAriaHidden}},{key:"savedAriaHidden",set:function(e){this._savedAriaHidden=e},get:function(){return this._savedAriaHidden}}]),i=u,s(h,[{key:"destructor",value:function(){var e;this._throwIfDestroyed(),this._node&&this._node.nodeType===Node.ELEMENT_NODE&&(e=this._node,null!==this._savedTabIndex?e.setAttribute("tabindex",this._savedTabIndex):e.removeAttribute("tabindex"),this._overrodeFocusMethod&&delete e.focus),this._node=null,this._inertRoots=null,this._destroyed=!0}},{key:"_throwIfDestroyed",value:function(){if(this.destroyed)throw new Error("Trying to access destroyed InertNode")}},{key:"ensureUntabbable",value:function(){var e;this.node.nodeType===Node.ELEMENT_NODE&&(e=this.node,t.call(e,n)?-1===e.tabIndex&&this.hasSavedTabIndex||(e.hasAttribute("tabindex")&&(this._savedTabIndex=e.tabIndex),e.setAttribute("tabindex","-1"),e.nodeType===Node.ELEMENT_NODE&&(e.focus=function(){},this._overrodeFocusMethod=!0)):e.hasAttribute("tabindex")&&(this._savedTabIndex=e.tabIndex,e.removeAttribute("tabindex")))}},{key:"addInertRoot",value:function(e){this._throwIfDestroyed(),this._inertRoots.add(e)}},{key:"removeInertRoot",value:function(e){this._throwIfDestroyed(),this._inertRoots.delete(e),0===this._inertRoots.size&&this.destructor()}},{key:"destroyed",get:function(){return this._destroyed}},{key:"hasSavedTabIndex",get:function(){return null!==this._savedTabIndex}},{key:"node",get:function(){return this._throwIfDestroyed(),this._node}},{key:"savedTabIndex",set:function(e){this._throwIfDestroyed(),this._savedTabIndex=e},get:function(){return this._throwIfDestroyed(),this._savedTabIndex}}]),o=h,s(l,[{key:"setInert",value:function(e,t){if(t){if(!this._inertRoots.has(e)&&(t=new i(e,this),e.setAttribute("inert",""),this._inertRoots.set(e,t),!this._document.body.contains(e)))for(var n=e.parentNode;n;)11===n.nodeType&&_(n),n=n.parentNode}else this._inertRoots.has(e)&&(this._inertRoots.get(e).destructor(),this._inertRoots.delete(e),e.removeAttribute("inert"))}},{key:"getInertRoot",value:function(e){return this._inertRoots.get(e)}},{key:"register",value:function(e,t){var n=this._managedNodes.get(e);return void 0!==n?n.addInertRoot(t):n=new o(e,t),this._managedNodes.set(e,n),n}},{key:"deregister",value:function(e,t){var n=this._managedNodes.get(e);return n?(n.removeInertRoot(t),n.destroyed&&this._managedNodes.delete(e),n):null}},{key:"_onDocumentLoaded",value:function(){e.call(this._document.querySelectorAll("[inert]")).forEach((function(e){this.setInert(e,!0)}),this),this._observer.observe(this._document.body||this._document.documentElement,{attributes:!0,subtree:!0,childList:!0})}},{key:"_watchForInert",value:function(n,i){var o=this;n.forEach((function(n){switch(n.type){case"childList":e.call(n.addedNodes).forEach((function(n){var i;n.nodeType===Node.ELEMENT_NODE&&(i=e.call(n.querySelectorAll("[inert]")),t.call(n,"[inert]")&&i.unshift(n),i.forEach((function(e){this.setInert(e,!0)}),o))}),o);break;case"attributes":if("inert"!==n.attributeName)return;var i=n.target,r=i.hasAttribute("inert");o.setInert(i,r)}}),this)}}]),s=l,HTMLElement.prototype.hasOwnProperty("inert")||(r=new s(document),Object.defineProperty(HTMLElement.prototype,"inert",{enumerable:!0,get:function(){return this.hasAttribute("inert")},set:function(e){r.setInert(this,e)}})))})); vendor/wp-polyfill-object-fit.min.js 0000644 00000005637 15013651111 0013470 0 ustar 00 !function(){"use strict";if("undefined"!=typeof window){var t=window.navigator.userAgent.match(/Edge\/(\d{2})\./),e=t?parseInt(t[1],10):null,i=!!e&&16<=e&&e<=18;if("objectFit"in document.documentElement.style==0||i){var n=function(t,e,i){var n,o,l,a,d;if((i=i.split(" ")).length<2&&(i[1]=i[0]),"x"===t)n=i[0],o=i[1],l="left",a="right",d=e.clientWidth;else{if("y"!==t)return;n=i[1],o=i[0],l="top",a="bottom",d=e.clientHeight}if(n!==l&&o!==l){if(n!==a&&o!==a)return"center"===n||"50%"===n?(e.style[l]="50%",void(e.style["margin-"+l]=d/-2+"px")):void(0<=n.indexOf("%")?(n=parseInt(n,10))<50?(e.style[l]=n+"%",e.style["margin-"+l]=d*(n/-100)+"px"):(n=100-n,e.style[a]=n+"%",e.style["margin-"+a]=d*(n/-100)+"px"):e.style[l]=n);e.style[a]="0"}else e.style[l]="0"},o=function(t){var e=t.dataset?t.dataset.objectFit:t.getAttribute("data-object-fit"),i=t.dataset?t.dataset.objectPosition:t.getAttribute("data-object-position");e=e||"cover",i=i||"50% 50%";var o=t.parentNode;return function(t){var e=window.getComputedStyle(t,null),i=e.getPropertyValue("position"),n=e.getPropertyValue("overflow"),o=e.getPropertyValue("display");i&&"static"!==i||(t.style.position="relative"),"hidden"!==n&&(t.style.overflow="hidden"),o&&"inline"!==o||(t.style.display="block"),0===t.clientHeight&&(t.style.height="100%"),-1===t.className.indexOf("object-fit-polyfill")&&(t.className=t.className+" object-fit-polyfill")}(o),function(t){var e=window.getComputedStyle(t,null),i={"max-width":"none","max-height":"none","min-width":"0px","min-height":"0px",top:"auto",right:"auto",bottom:"auto",left:"auto","margin-top":"0px","margin-right":"0px","margin-bottom":"0px","margin-left":"0px"};for(var n in i)e.getPropertyValue(n)!==i[n]&&(t.style[n]=i[n])}(t),t.style.position="absolute",t.style.width="auto",t.style.height="auto","scale-down"===e&&(e=t.clientWidth<o.clientWidth&&t.clientHeight<o.clientHeight?"none":"contain"),"none"===e?(n("x",t,i),void n("y",t,i)):"fill"===e?(t.style.width="100%",t.style.height="100%",n("x",t,i),void n("y",t,i)):(t.style.height="100%",void("cover"===e&&t.clientWidth>o.clientWidth||"contain"===e&&t.clientWidth<o.clientWidth?(t.style.top="0",t.style.marginTop="0",n("x",t,i)):(t.style.width="100%",t.style.height="auto",t.style.left="0",t.style.marginLeft="0",n("y",t,i))))},l=function(t){if(void 0===t||t instanceof Event)t=document.querySelectorAll("[data-object-fit]");else if(t&&t.nodeName)t=[t];else if("object"!=typeof t||!t.length||!t[0].nodeName)return!1;for(var e=0;e<t.length;e++)if(t[e].nodeName){var n=t[e].nodeName.toLowerCase();if("img"===n){if(i)continue;t[e].complete?o(t[e]):t[e].addEventListener("load",(function(){o(this)}))}else"video"===n?0<t[e].readyState?o(t[e]):t[e].addEventListener("loadedmetadata",(function(){o(this)})):o(t[e])}return!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",l):l(),window.addEventListener("resize",l),window.objectFitPolyfill=l}else window.objectFitPolyfill=function(){return!1}}}(); development/react-refresh-runtime.min.js 0000644 00000057135 15013651111 0014426 0 ustar 00 /* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ "./node_modules/react-refresh/cjs/react-refresh-runtime.development.js": /*!*****************************************************************************!*\ !*** ./node_modules/react-refresh/cjs/react-refresh-runtime.development.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, exports) => { eval("/**\n * @license React\n * react-refresh-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n'use strict';\n\n// ATTENTION\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\n\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // We never remove these associations.\n// It's OK to reference families, but use WeakMap/Set for types.\n\nvar allFamiliesByID = new Map();\nvar allFamiliesByType = new PossiblyWeakMap();\nvar allSignaturesByType = new PossiblyWeakMap(); // This WeakMap is read by React, so we only put families\n// that have actually been edited here. This keeps checks fast.\n// $FlowIssue\n\nvar updatedFamiliesByType = new PossiblyWeakMap(); // This is cleared on every performReactRefresh() call.\n// It is an array of [Family, NextType] tuples.\n\nvar pendingUpdates = []; // This is injected by the renderer via DevTools global hook.\n\nvar helpersByRendererID = new Map();\nvar helpersByRoot = new Map(); // We keep track of mounted roots so we can schedule updates.\n\nvar mountedRoots = new Set(); // If a root captures an error, we remember it so we can retry on edit.\n\nvar failedRoots = new Set(); // In environments that support WeakMap, we also remember the last element for every root.\n// It needs to be weak because we do this even for roots that failed to mount.\n// If there is no WeakMap, we won't attempt to do retrying.\n// $FlowIssue\n\nvar rootElements = // $FlowIssue\ntypeof WeakMap === 'function' ? new WeakMap() : null;\nvar isPerformingRefresh = false;\n\nfunction computeFullKey(signature) {\n if (signature.fullKey !== null) {\n return signature.fullKey;\n }\n\n var fullKey = signature.ownKey;\n var hooks;\n\n try {\n hooks = signature.getCustomHooks();\n } catch (err) {\n // This can happen in an edge case, e.g. if expression like Foo.useSomething\n // depends on Foo which is lazily initialized during rendering.\n // In that case just assume we'll have to remount.\n signature.forceReset = true;\n signature.fullKey = fullKey;\n return fullKey;\n }\n\n for (var i = 0; i < hooks.length; i++) {\n var hook = hooks[i];\n\n if (typeof hook !== 'function') {\n // Something's wrong. Assume we need to remount.\n signature.forceReset = true;\n signature.fullKey = fullKey;\n return fullKey;\n }\n\n var nestedHookSignature = allSignaturesByType.get(hook);\n\n if (nestedHookSignature === undefined) {\n // No signature means Hook wasn't in the source code, e.g. in a library.\n // We'll skip it because we can assume it won't change during this session.\n continue;\n }\n\n var nestedHookKey = computeFullKey(nestedHookSignature);\n\n if (nestedHookSignature.forceReset) {\n signature.forceReset = true;\n }\n\n fullKey += '\\n---\\n' + nestedHookKey;\n }\n\n signature.fullKey = fullKey;\n return fullKey;\n}\n\nfunction haveEqualSignatures(prevType, nextType) {\n var prevSignature = allSignaturesByType.get(prevType);\n var nextSignature = allSignaturesByType.get(nextType);\n\n if (prevSignature === undefined && nextSignature === undefined) {\n return true;\n }\n\n if (prevSignature === undefined || nextSignature === undefined) {\n return false;\n }\n\n if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) {\n return false;\n }\n\n if (nextSignature.forceReset) {\n return false;\n }\n\n return true;\n}\n\nfunction isReactClass(type) {\n return type.prototype && type.prototype.isReactComponent;\n}\n\nfunction canPreserveStateBetween(prevType, nextType) {\n if (isReactClass(prevType) || isReactClass(nextType)) {\n return false;\n }\n\n if (haveEqualSignatures(prevType, nextType)) {\n return true;\n }\n\n return false;\n}\n\nfunction resolveFamily(type) {\n // Only check updated types to keep lookups fast.\n return updatedFamiliesByType.get(type);\n} // If we didn't care about IE11, we could use new Map/Set(iterable).\n\n\nfunction cloneMap(map) {\n var clone = new Map();\n map.forEach(function (value, key) {\n clone.set(key, value);\n });\n return clone;\n}\n\nfunction cloneSet(set) {\n var clone = new Set();\n set.forEach(function (value) {\n clone.add(value);\n });\n return clone;\n} // This is a safety mechanism to protect against rogue getters and Proxies.\n\n\nfunction getProperty(object, property) {\n try {\n return object[property];\n } catch (err) {\n // Intentionally ignore.\n return undefined;\n }\n}\n\nfunction performReactRefresh() {\n\n if (pendingUpdates.length === 0) {\n return null;\n }\n\n if (isPerformingRefresh) {\n return null;\n }\n\n isPerformingRefresh = true;\n\n try {\n var staleFamilies = new Set();\n var updatedFamilies = new Set();\n var updates = pendingUpdates;\n pendingUpdates = [];\n updates.forEach(function (_ref) {\n var family = _ref[0],\n nextType = _ref[1];\n // Now that we got a real edit, we can create associations\n // that will be read by the React reconciler.\n var prevType = family.current;\n updatedFamiliesByType.set(prevType, family);\n updatedFamiliesByType.set(nextType, family);\n family.current = nextType; // Determine whether this should be a re-render or a re-mount.\n\n if (canPreserveStateBetween(prevType, nextType)) {\n updatedFamilies.add(family);\n } else {\n staleFamilies.add(family);\n }\n }); // TODO: rename these fields to something more meaningful.\n\n var update = {\n updatedFamilies: updatedFamilies,\n // Families that will re-render preserving state\n staleFamilies: staleFamilies // Families that will be remounted\n\n };\n helpersByRendererID.forEach(function (helpers) {\n // Even if there are no roots, set the handler on first update.\n // This ensures that if *new* roots are mounted, they'll use the resolve handler.\n helpers.setRefreshHandler(resolveFamily);\n });\n var didError = false;\n var firstError = null; // We snapshot maps and sets that are mutated during commits.\n // If we don't do this, there is a risk they will be mutated while\n // we iterate over them. For example, trying to recover a failed root\n // may cause another root to be added to the failed list -- an infinite loop.\n\n var failedRootsSnapshot = cloneSet(failedRoots);\n var mountedRootsSnapshot = cloneSet(mountedRoots);\n var helpersByRootSnapshot = cloneMap(helpersByRoot);\n failedRootsSnapshot.forEach(function (root) {\n var helpers = helpersByRootSnapshot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n if (!failedRoots.has(root)) {// No longer failed.\n }\n\n if (rootElements === null) {\n return;\n }\n\n if (!rootElements.has(root)) {\n return;\n }\n\n var element = rootElements.get(root);\n\n try {\n helpers.scheduleRoot(root, element);\n } catch (err) {\n if (!didError) {\n didError = true;\n firstError = err;\n } // Keep trying other roots.\n\n }\n });\n mountedRootsSnapshot.forEach(function (root) {\n var helpers = helpersByRootSnapshot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n if (!mountedRoots.has(root)) {// No longer mounted.\n }\n\n try {\n helpers.scheduleRefresh(root, update);\n } catch (err) {\n if (!didError) {\n didError = true;\n firstError = err;\n } // Keep trying other roots.\n\n }\n });\n\n if (didError) {\n throw firstError;\n }\n\n return update;\n } finally {\n isPerformingRefresh = false;\n }\n}\nfunction register(type, id) {\n {\n if (type === null) {\n return;\n }\n\n if (typeof type !== 'function' && typeof type !== 'object') {\n return;\n } // This can happen in an edge case, e.g. if we register\n // return value of a HOC but it returns a cached component.\n // Ignore anything but the first registration for each type.\n\n\n if (allFamiliesByType.has(type)) {\n return;\n } // Create family or remember to update it.\n // None of this bookkeeping affects reconciliation\n // until the first performReactRefresh() call above.\n\n\n var family = allFamiliesByID.get(id);\n\n if (family === undefined) {\n family = {\n current: type\n };\n allFamiliesByID.set(id, family);\n } else {\n pendingUpdates.push([family, type]);\n }\n\n allFamiliesByType.set(type, family); // Visit inner types because we might not have registered them.\n\n if (typeof type === 'object' && type !== null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n register(type.render, id + '$render');\n break;\n\n case REACT_MEMO_TYPE:\n register(type.type, id + '$type');\n break;\n }\n }\n }\n}\nfunction setSignature(type, key) {\n var forceReset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var getCustomHooks = arguments.length > 3 ? arguments[3] : undefined;\n\n {\n if (!allSignaturesByType.has(type)) {\n allSignaturesByType.set(type, {\n forceReset: forceReset,\n ownKey: key,\n fullKey: null,\n getCustomHooks: getCustomHooks || function () {\n return [];\n }\n });\n } // Visit inner types because we might not have signed them.\n\n\n if (typeof type === 'object' && type !== null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n setSignature(type.render, key, forceReset, getCustomHooks);\n break;\n\n case REACT_MEMO_TYPE:\n setSignature(type.type, key, forceReset, getCustomHooks);\n break;\n }\n }\n }\n} // This is lazily called during first render for a type.\n// It captures Hook list at that time so inline requires don't break comparisons.\n\nfunction collectCustomHooksForSignature(type) {\n {\n var signature = allSignaturesByType.get(type);\n\n if (signature !== undefined) {\n computeFullKey(signature);\n }\n }\n}\nfunction getFamilyByID(id) {\n {\n return allFamiliesByID.get(id);\n }\n}\nfunction getFamilyByType(type) {\n {\n return allFamiliesByType.get(type);\n }\n}\nfunction findAffectedHostInstances(families) {\n {\n var affectedInstances = new Set();\n mountedRoots.forEach(function (root) {\n var helpers = helpersByRoot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n var instancesForRoot = helpers.findHostInstancesForRefresh(root, families);\n instancesForRoot.forEach(function (inst) {\n affectedInstances.add(inst);\n });\n });\n return affectedInstances;\n }\n}\nfunction injectIntoGlobalHook(globalObject) {\n {\n // For React Native, the global hook will be set up by require('react-devtools-core').\n // That code will run before us. So we need to monkeypatch functions on existing hook.\n // For React Web, the global hook will be set up by the extension.\n // This will also run before us.\n var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n if (hook === undefined) {\n // However, if there is no DevTools extension, we'll need to set up the global hook ourselves.\n // Note that in this case it's important that renderer code runs *after* this method call.\n // Otherwise, the renderer will think that there is no global hook, and won't do the injection.\n var nextID = 0;\n globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {\n renderers: new Map(),\n supportsFiber: true,\n inject: function (injected) {\n return nextID++;\n },\n onScheduleFiberRoot: function (id, root, children) {},\n onCommitFiberRoot: function (id, root, maybePriorityLevel, didError) {},\n onCommitFiberUnmount: function () {}\n };\n }\n\n if (hook.isDisabled) {\n // This isn't a real property on the hook, but it can be set to opt out\n // of DevTools integration and associated warnings and logs.\n // Using console['warn'] to evade Babel and ESLint\n console['warn']('Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). ' + 'Fast Refresh is not compatible with this shim and will be disabled.');\n return;\n } // Here, we just want to get a reference to scheduleRefresh.\n\n\n var oldInject = hook.inject;\n\n hook.inject = function (injected) {\n var id = oldInject.apply(this, arguments);\n\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n\n return id;\n }; // Do the same for any already injected roots.\n // This is useful if ReactDOM has already been initialized.\n // https://github.com/facebook/react/issues/17626\n\n\n hook.renderers.forEach(function (injected, id) {\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n }); // We also want to track currently mounted roots.\n\n var oldOnCommitFiberRoot = hook.onCommitFiberRoot;\n\n var oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function () {};\n\n hook.onScheduleFiberRoot = function (id, root, children) {\n if (!isPerformingRefresh) {\n // If it was intentionally scheduled, don't attempt to restore.\n // This includes intentionally scheduled unmounts.\n failedRoots.delete(root);\n\n if (rootElements !== null) {\n rootElements.set(root, children);\n }\n }\n\n return oldOnScheduleFiberRoot.apply(this, arguments);\n };\n\n hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {\n var helpers = helpersByRendererID.get(id);\n\n if (helpers !== undefined) {\n helpersByRoot.set(root, helpers);\n var current = root.current;\n var alternate = current.alternate; // We need to determine whether this root has just (un)mounted.\n // This logic is copy-pasted from similar logic in the DevTools backend.\n // If this breaks with some refactoring, you'll want to update DevTools too.\n\n if (alternate !== null) {\n var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && mountedRoots.has(root);\n var isMounted = current.memoizedState != null && current.memoizedState.element != null;\n\n if (!wasMounted && isMounted) {\n // Mount a new root.\n mountedRoots.add(root);\n failedRoots.delete(root);\n } else if (wasMounted && isMounted) ; else if (wasMounted && !isMounted) {\n // Unmount an existing root.\n mountedRoots.delete(root);\n\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n } else {\n helpersByRoot.delete(root);\n }\n } else if (!wasMounted && !isMounted) {\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n }\n }\n } else {\n // Mount a new root.\n mountedRoots.add(root);\n }\n } // Always call the decorated DevTools hook.\n\n\n return oldOnCommitFiberRoot.apply(this, arguments);\n };\n }\n}\nfunction hasUnrecoverableErrors() {\n // TODO: delete this after removing dependency in RN.\n return false;\n} // Exposed for testing.\n\nfunction _getMountedRootCount() {\n {\n return mountedRoots.size;\n }\n} // This is a wrapper over more primitive functions for setting signature.\n// Signatures let us decide whether the Hook order has changed on refresh.\n//\n// This function is intended to be used as a transform target, e.g.:\n// var _s = createSignatureFunctionForTransform()\n//\n// function Hello() {\n// const [foo, setFoo] = useState(0);\n// const value = useCustomHook();\n// _s(); /* Call without arguments triggers collecting the custom Hook list.\n// * This doesn't happen during the module evaluation because we\n// * don't want to change the module order with inline requires.\n// * Next calls are noops. */\n// return <h1>Hi</h1>;\n// }\n//\n// /* Call with arguments attaches the signature to the type: */\n// _s(\n// Hello,\n// 'useState{[foo, setFoo]}(0)',\n// () => [useCustomHook], /* Lazy to avoid triggering inline requires */\n// );\n\nfunction createSignatureFunctionForTransform() {\n {\n var savedType;\n var hasCustomHooks;\n var didCollectHooks = false;\n return function (type, key, forceReset, getCustomHooks) {\n if (typeof key === 'string') {\n // We're in the initial phase that associates signatures\n // with the functions. Note this may be called multiple times\n // in HOC chains like _s(hoc1(_s(hoc2(_s(actualFunction))))).\n if (!savedType) {\n // We're in the innermost call, so this is the actual type.\n savedType = type;\n hasCustomHooks = typeof getCustomHooks === 'function';\n } // Set the signature for all types (even wrappers!) in case\n // they have no signatures of their own. This is to prevent\n // problems like https://github.com/facebook/react/issues/20417.\n\n\n if (type != null && (typeof type === 'function' || typeof type === 'object')) {\n setSignature(type, key, forceReset, getCustomHooks);\n }\n\n return type;\n } else {\n // We're in the _s() call without arguments, which means\n // this is the time to collect custom Hook signatures.\n // Only do this once. This path is hot and runs *inside* every render!\n if (!didCollectHooks && hasCustomHooks) {\n didCollectHooks = true;\n collectCustomHooksForSignature(savedType);\n }\n }\n };\n }\n}\nfunction isLikelyComponentType(type) {\n {\n switch (typeof type) {\n case 'function':\n {\n // First, deal with classes.\n if (type.prototype != null) {\n if (type.prototype.isReactComponent) {\n // React class.\n return true;\n }\n\n var ownNames = Object.getOwnPropertyNames(type.prototype);\n\n if (ownNames.length > 1 || ownNames[0] !== 'constructor') {\n // This looks like a class.\n return false;\n } // eslint-disable-next-line no-proto\n\n\n if (type.prototype.__proto__ !== Object.prototype) {\n // It has a superclass.\n return false;\n } // Pass through.\n // This looks like a regular function with empty prototype.\n\n } // For plain functions and arrows, use name as a heuristic.\n\n\n var name = type.name || type.displayName;\n return typeof name === 'string' && /^[A-Z]/.test(name);\n }\n\n case 'object':\n {\n if (type != null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n case REACT_MEMO_TYPE:\n // Definitely React components.\n return true;\n\n default:\n return false;\n }\n }\n\n return false;\n }\n\n default:\n {\n return false;\n }\n }\n }\n}\n\nexports._getMountedRootCount = _getMountedRootCount;\nexports.collectCustomHooksForSignature = collectCustomHooksForSignature;\nexports.createSignatureFunctionForTransform = createSignatureFunctionForTransform;\nexports.findAffectedHostInstances = findAffectedHostInstances;\nexports.getFamilyByID = getFamilyByID;\nexports.getFamilyByType = getFamilyByType;\nexports.hasUnrecoverableErrors = hasUnrecoverableErrors;\nexports.injectIntoGlobalHook = injectIntoGlobalHook;\nexports.isLikelyComponentType = isLikelyComponentType;\nexports.performReactRefresh = performReactRefresh;\nexports.register = register;\nexports.setSignature = setSignature;\n })();\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/react-refresh/cjs/react-refresh-runtime.development.js?"); /***/ }), /***/ "./node_modules/react-refresh/runtime.js": /*!***********************************************!*\ !*** ./node_modules/react-refresh/runtime.js ***! \***********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react-refresh-runtime.development.js */ \"./node_modules/react-refresh/cjs/react-refresh-runtime.development.js\");\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/react-refresh/runtime.js?"); /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module can't be inlined because the eval devtool is used. /******/ var __webpack_exports__ = __webpack_require__("./node_modules/react-refresh/runtime.js"); /******/ window.ReactRefreshRuntime = __webpack_exports__; /******/ /******/ })() ; development/react-refresh-entry.min.js 0000644 00000200347 15013651111 0014077 0 ustar 00 /* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js": /*!***************************************************************************************!*\ !*** ./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js ***! \***************************************************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { eval("/* global __react_refresh_library__ */\n\nconst safeThis = __webpack_require__(/*! core-js-pure/features/global-this */ \"./node_modules/core-js-pure/features/global-this.js\");\nconst RefreshRuntime = __webpack_require__(/*! react-refresh/runtime */ \"react-refresh/runtime\");\n\nif (true) {\n if (typeof safeThis !== 'undefined') {\n var $RefreshInjected$ = '__reactRefreshInjected';\n // Namespace the injected flag (if necessary) for monorepo compatibility\n if (typeof __react_refresh_library__ !== 'undefined' && __react_refresh_library__) {\n $RefreshInjected$ += '_' + __react_refresh_library__;\n }\n\n // Only inject the runtime if it hasn't been injected\n if (!safeThis[$RefreshInjected$]) {\n // Inject refresh runtime into global scope\n RefreshRuntime.injectIntoGlobalHook(safeThis);\n\n // Mark the runtime as injected to prevent double-injection\n safeThis[$RefreshInjected$] = true;\n }\n }\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js?"); /***/ }), /***/ "./node_modules/core-js-pure/actual/global-this.js": /*!*********************************************************!*\ !*** ./node_modules/core-js-pure/actual/global-this.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar parent = __webpack_require__(/*! ../stable/global-this */ \"./node_modules/core-js-pure/stable/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/actual/global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/es/global-this.js": /*!*****************************************************!*\ !*** ./node_modules/core-js-pure/es/global-this.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n__webpack_require__(/*! ../modules/es.global-this */ \"./node_modules/core-js-pure/modules/es.global-this.js\");\n\nmodule.exports = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/es/global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/features/global-this.js": /*!***********************************************************!*\ !*** ./node_modules/core-js-pure/features/global-this.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nmodule.exports = __webpack_require__(/*! ../full/global-this */ \"./node_modules/core-js-pure/full/global-this.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/features/global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/full/global-this.js": /*!*******************************************************!*\ !*** ./node_modules/core-js-pure/full/global-this.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n// TODO: remove from `core-js@4`\n__webpack_require__(/*! ../modules/esnext.global-this */ \"./node_modules/core-js-pure/modules/esnext.global-this.js\");\n\nvar parent = __webpack_require__(/*! ../actual/global-this */ \"./node_modules/core-js-pure/actual/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/full/global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/a-callable.js": /*!***********************************************************!*\ !*** ./node_modules/core-js-pure/internals/a-callable.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar tryToString = __webpack_require__(/*! ../internals/try-to-string */ \"./node_modules/core-js-pure/internals/try-to-string.js\");\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw new $TypeError(tryToString(argument) + ' is not a function');\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/a-callable.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/an-object.js": /*!**********************************************************!*\ !*** ./node_modules/core-js-pure/internals/an-object.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw new $TypeError($String(argument) + ' is not an object');\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/an-object.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/classof-raw.js": /*!************************************************************!*\ !*** ./node_modules/core-js-pure/internals/classof-raw.js ***! \************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/classof-raw.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/create-non-enumerable-property.js": /*!*******************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/create-non-enumerable-property.js ***! \*******************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ \"./node_modules/core-js-pure/internals/object-define-property.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/create-non-enumerable-property.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/create-property-descriptor.js": /*!***************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/create-property-descriptor.js ***! \***************************************************************************/ /***/ ((module) => { "use strict"; eval("\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/create-property-descriptor.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/define-global-property.js": /*!***********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/define-global-property.js ***! \***********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/define-global-property.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/descriptors.js": /*!************************************************************!*\ !*** ./node_modules/core-js-pure/internals/descriptors.js ***! \************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/descriptors.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/document-create-element.js": /*!************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/document-create-element.js ***! \************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/document-create-element.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/engine-user-agent.js": /*!******************************************************************!*\ !*** ./node_modules/core-js-pure/internals/engine-user-agent.js ***! \******************************************************************/ /***/ ((module) => { "use strict"; eval("\nmodule.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/engine-user-agent.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/engine-v8-version.js": /*!******************************************************************!*\ !*** ./node_modules/core-js-pure/internals/engine-v8-version.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ \"./node_modules/core-js-pure/internals/engine-user-agent.js\");\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/engine-v8-version.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/export.js": /*!*******************************************************!*\ !*** ./node_modules/core-js-pure/internals/export.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar apply = __webpack_require__(/*! ../internals/function-apply */ \"./node_modules/core-js-pure/internals/function-apply.js\");\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ \"./node_modules/core-js-pure/internals/function-uncurry-this-clause.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar getOwnPropertyDescriptor = (__webpack_require__(/*! ../internals/object-get-own-property-descriptor */ \"./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js\").f);\nvar isForced = __webpack_require__(/*! ../internals/is-forced */ \"./node_modules/core-js-pure/internals/is-forced.js\");\nvar path = __webpack_require__(/*! ../internals/path */ \"./node_modules/core-js-pure/internals/path.js\");\nvar bind = __webpack_require__(/*! ../internals/function-bind-context */ \"./node_modules/core-js-pure/internals/function-bind-context.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof Wrapper) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return apply(NativeConstructor, this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : global[TARGET] && global[TARGET].prototype;\n\n var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (!FORCED && !PROTO && typeof targetProperty == typeof sourceProperty) continue;\n\n // bind methods to global for calling from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changes in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n createNonEnumerableProperty(target, key, resultProperty);\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);\n // export real prototype methods\n if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/export.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/fails.js": /*!******************************************************!*\ !*** ./node_modules/core-js-pure/internals/fails.js ***! \******************************************************/ /***/ ((module) => { "use strict"; eval("\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/fails.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-apply.js": /*!***************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-apply.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-apply.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-bind-context.js": /*!**********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-bind-context.js ***! \**********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ \"./node_modules/core-js-pure/internals/function-uncurry-this-clause.js\");\nvar aCallable = __webpack_require__(/*! ../internals/a-callable */ \"./node_modules/core-js-pure/internals/a-callable.js\");\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-bind-context.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-bind-native.js": /*!*********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-bind-native.js ***! \*********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-bind-native.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-call.js": /*!**************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-call.js ***! \**************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-call.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-uncurry-this-clause.js": /*!*****************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-uncurry-this-clause.js ***! \*****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar classofRaw = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-uncurry-this-clause.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-uncurry-this.js": /*!**********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-uncurry-this.js ***! \**********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-uncurry-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/get-built-in.js": /*!*************************************************************!*\ !*** ./node_modules/core-js-pure/internals/get-built-in.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar path = __webpack_require__(/*! ../internals/path */ \"./node_modules/core-js-pure/internals/path.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nvar aFunction = function (variable) {\n return isCallable(variable) ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/get-built-in.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/get-method.js": /*!***********************************************************!*\ !*** ./node_modules/core-js-pure/internals/get-method.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar aCallable = __webpack_require__(/*! ../internals/a-callable */ \"./node_modules/core-js-pure/internals/a-callable.js\");\nvar isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ \"./node_modules/core-js-pure/internals/is-null-or-undefined.js\");\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/get-method.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/global.js": /*!*******************************************************!*\ !*** ./node_modules/core-js-pure/internals/global.js ***! \*******************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; eval("\nvar check = function (it) {\n return it && it.Math === Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) ||\n check(typeof this == 'object' && this) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/global.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/has-own-property.js": /*!*****************************************************************!*\ !*** ./node_modules/core-js-pure/internals/has-own-property.js ***! \*****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\nvar toObject = __webpack_require__(/*! ../internals/to-object */ \"./node_modules/core-js-pure/internals/to-object.js\");\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/has-own-property.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/ie8-dom-define.js": /*!***************************************************************!*\ !*** ./node_modules/core-js-pure/internals/ie8-dom-define.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar createElement = __webpack_require__(/*! ../internals/document-create-element */ \"./node_modules/core-js-pure/internals/document-create-element.js\");\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a !== 7;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/ie8-dom-define.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/indexed-object.js": /*!***************************************************************!*\ !*** ./node_modules/core-js-pure/internals/indexed-object.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar classof = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) === 'String' ? split(it, '') : $Object(it);\n} : $Object;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/indexed-object.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-callable.js": /*!************************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-callable.js ***! \************************************************************/ /***/ ((module) => { "use strict"; eval("\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\nvar documentAll = typeof document == 'object' && document.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nmodule.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-callable.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-forced.js": /*!**********************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-forced.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value === POLYFILL ? true\n : value === NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-forced.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-null-or-undefined.js": /*!*********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-null-or-undefined.js ***! \*********************************************************************/ /***/ ((module) => { "use strict"; eval("\n// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-null-or-undefined.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-object.js": /*!**********************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-object.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-object.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-pure.js": /*!********************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-pure.js ***! \********************************************************/ /***/ ((module) => { "use strict"; eval("\nmodule.exports = true;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-pure.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-symbol.js": /*!**********************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-symbol.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js-pure/internals/get-built-in.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ \"./node_modules/core-js-pure/internals/object-is-prototype-of.js\");\nvar USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ \"./node_modules/core-js-pure/internals/use-symbol-as-uid.js\");\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-symbol.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/object-define-property.js": /*!***********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/object-define-property.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ \"./node_modules/core-js-pure/internals/ie8-dom-define.js\");\nvar V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(/*! ../internals/v8-prototype-define-bug */ \"./node_modules/core-js-pure/internals/v8-prototype-define-bug.js\");\nvar anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\nvar toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ \"./node_modules/core-js-pure/internals/to-property-key.js\");\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-define-property.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js": /*!***********************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js ***! \***********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ \"./node_modules/core-js-pure/internals/object-property-is-enumerable.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\nvar toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ \"./node_modules/core-js-pure/internals/to-indexed-object.js\");\nvar toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ \"./node_modules/core-js-pure/internals/to-property-key.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\nvar IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ \"./node_modules/core-js-pure/internals/ie8-dom-define.js\");\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/object-is-prototype-of.js": /*!***********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/object-is-prototype-of.js ***! \***********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-is-prototype-of.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/object-property-is-enumerable.js": /*!******************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/object-property-is-enumerable.js ***! \******************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; eval("\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-property-is-enumerable.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/ordinary-to-primitive.js": /*!**********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/ordinary-to-primitive.js ***! \**********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw new $TypeError(\"Can't convert object to primitive value\");\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/ordinary-to-primitive.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/path.js": /*!*****************************************************!*\ !*** ./node_modules/core-js-pure/internals/path.js ***! \*****************************************************/ /***/ ((module) => { "use strict"; eval("\nmodule.exports = {};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/path.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/require-object-coercible.js": /*!*************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/require-object-coercible.js ***! \*************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ \"./node_modules/core-js-pure/internals/is-null-or-undefined.js\");\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw new $TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/require-object-coercible.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/shared-store.js": /*!*************************************************************!*\ !*** ./node_modules/core-js-pure/internals/shared-store.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar defineGlobalProperty = __webpack_require__(/*! ../internals/define-global-property */ \"./node_modules/core-js-pure/internals/define-global-property.js\");\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/shared-store.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/shared.js": /*!*******************************************************!*\ !*** ./node_modules/core-js-pure/internals/shared.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar IS_PURE = __webpack_require__(/*! ../internals/is-pure */ \"./node_modules/core-js-pure/internals/is-pure.js\");\nvar store = __webpack_require__(/*! ../internals/shared-store */ \"./node_modules/core-js-pure/internals/shared-store.js\");\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.35.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/shared.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/symbol-constructor-detection.js": /*!*****************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/symbol-constructor-detection.js ***! \*****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ \"./node_modules/core-js-pure/internals/engine-v8-version.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\nvar $String = global.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol('symbol detection');\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/symbol-constructor-detection.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/to-indexed-object.js": /*!******************************************************************!*\ !*** ./node_modules/core-js-pure/internals/to-indexed-object.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ \"./node_modules/core-js-pure/internals/indexed-object.js\");\nvar requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ \"./node_modules/core-js-pure/internals/require-object-coercible.js\");\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-indexed-object.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/to-object.js": /*!**********************************************************!*\ !*** ./node_modules/core-js-pure/internals/to-object.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ \"./node_modules/core-js-pure/internals/require-object-coercible.js\");\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-object.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/to-primitive.js": /*!*************************************************************!*\ !*** ./node_modules/core-js-pure/internals/to-primitive.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\nvar isSymbol = __webpack_require__(/*! ../internals/is-symbol */ \"./node_modules/core-js-pure/internals/is-symbol.js\");\nvar getMethod = __webpack_require__(/*! ../internals/get-method */ \"./node_modules/core-js-pure/internals/get-method.js\");\nvar ordinaryToPrimitive = __webpack_require__(/*! ../internals/ordinary-to-primitive */ \"./node_modules/core-js-pure/internals/ordinary-to-primitive.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw new $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-primitive.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/to-property-key.js": /*!****************************************************************!*\ !*** ./node_modules/core-js-pure/internals/to-property-key.js ***! \****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ \"./node_modules/core-js-pure/internals/to-primitive.js\");\nvar isSymbol = __webpack_require__(/*! ../internals/is-symbol */ \"./node_modules/core-js-pure/internals/is-symbol.js\");\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-property-key.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/try-to-string.js": /*!**************************************************************!*\ !*** ./node_modules/core-js-pure/internals/try-to-string.js ***! \**************************************************************/ /***/ ((module) => { "use strict"; eval("\nvar $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/try-to-string.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/uid.js": /*!****************************************************!*\ !*** ./node_modules/core-js-pure/internals/uid.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/uid.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/use-symbol-as-uid.js": /*!******************************************************************!*\ !*** ./node_modules/core-js-pure/internals/use-symbol-as-uid.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ \"./node_modules/core-js-pure/internals/symbol-constructor-detection.js\");\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/use-symbol-as-uid.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/v8-prototype-define-bug.js": /*!************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/v8-prototype-define-bug.js ***! \************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype !== 42;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/v8-prototype-define-bug.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/well-known-symbol.js": /*!******************************************************************!*\ !*** ./node_modules/core-js-pure/internals/well-known-symbol.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar shared = __webpack_require__(/*! ../internals/shared */ \"./node_modules/core-js-pure/internals/shared.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\nvar uid = __webpack_require__(/*! ../internals/uid */ \"./node_modules/core-js-pure/internals/uid.js\");\nvar NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ \"./node_modules/core-js-pure/internals/symbol-constructor-detection.js\");\nvar USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ \"./node_modules/core-js-pure/internals/use-symbol-as-uid.js\");\n\nvar Symbol = global.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/well-known-symbol.js?"); /***/ }), /***/ "./node_modules/core-js-pure/modules/es.global-this.js": /*!*************************************************************!*\ !*** ./node_modules/core-js-pure/modules/es.global-this.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js-pure/internals/export.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n// `globalThis` object\n// https://tc39.es/ecma262/#sec-globalthis\n$({ global: true, forced: global.globalThis !== global }, {\n globalThis: global\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/modules/es.global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/modules/esnext.global-this.js": /*!*****************************************************************!*\ !*** ./node_modules/core-js-pure/modules/esnext.global-this.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n// TODO: Remove from `core-js@4`\n__webpack_require__(/*! ../modules/es.global-this */ \"./node_modules/core-js-pure/modules/es.global-this.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/modules/esnext.global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/stable/global-this.js": /*!*********************************************************!*\ !*** ./node_modules/core-js-pure/stable/global-this.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar parent = __webpack_require__(/*! ../es/global-this */ \"./node_modules/core-js-pure/es/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/stable/global-this.js?"); /***/ }), /***/ "react-refresh/runtime": /*!**************************************!*\ !*** external "ReactRefreshRuntime" ***! \**************************************/ /***/ ((module) => { "use strict"; module.exports = window["ReactRefreshRuntime"]; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { /******/ if (typeof globalThis === 'object') return globalThis; /******/ try { /******/ return this || new Function('return this')(); /******/ } catch (e) { /******/ if (typeof window === 'object') return window; /******/ } /******/ })(); /******/ })(); /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module can't be inlined because the eval devtool is used. /******/ var __webpack_exports__ = __webpack_require__("./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js"); /******/ /******/ })() ; development/react-refresh-runtime.js 0000644 00000057135 15013651111 0013644 0 ustar 00 /* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ "./node_modules/react-refresh/cjs/react-refresh-runtime.development.js": /*!*****************************************************************************!*\ !*** ./node_modules/react-refresh/cjs/react-refresh-runtime.development.js ***! \*****************************************************************************/ /***/ ((__unused_webpack_module, exports) => { eval("/**\n * @license React\n * react-refresh-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nif (true) {\n (function() {\n'use strict';\n\n// ATTENTION\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\n\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map; // We never remove these associations.\n// It's OK to reference families, but use WeakMap/Set for types.\n\nvar allFamiliesByID = new Map();\nvar allFamiliesByType = new PossiblyWeakMap();\nvar allSignaturesByType = new PossiblyWeakMap(); // This WeakMap is read by React, so we only put families\n// that have actually been edited here. This keeps checks fast.\n// $FlowIssue\n\nvar updatedFamiliesByType = new PossiblyWeakMap(); // This is cleared on every performReactRefresh() call.\n// It is an array of [Family, NextType] tuples.\n\nvar pendingUpdates = []; // This is injected by the renderer via DevTools global hook.\n\nvar helpersByRendererID = new Map();\nvar helpersByRoot = new Map(); // We keep track of mounted roots so we can schedule updates.\n\nvar mountedRoots = new Set(); // If a root captures an error, we remember it so we can retry on edit.\n\nvar failedRoots = new Set(); // In environments that support WeakMap, we also remember the last element for every root.\n// It needs to be weak because we do this even for roots that failed to mount.\n// If there is no WeakMap, we won't attempt to do retrying.\n// $FlowIssue\n\nvar rootElements = // $FlowIssue\ntypeof WeakMap === 'function' ? new WeakMap() : null;\nvar isPerformingRefresh = false;\n\nfunction computeFullKey(signature) {\n if (signature.fullKey !== null) {\n return signature.fullKey;\n }\n\n var fullKey = signature.ownKey;\n var hooks;\n\n try {\n hooks = signature.getCustomHooks();\n } catch (err) {\n // This can happen in an edge case, e.g. if expression like Foo.useSomething\n // depends on Foo which is lazily initialized during rendering.\n // In that case just assume we'll have to remount.\n signature.forceReset = true;\n signature.fullKey = fullKey;\n return fullKey;\n }\n\n for (var i = 0; i < hooks.length; i++) {\n var hook = hooks[i];\n\n if (typeof hook !== 'function') {\n // Something's wrong. Assume we need to remount.\n signature.forceReset = true;\n signature.fullKey = fullKey;\n return fullKey;\n }\n\n var nestedHookSignature = allSignaturesByType.get(hook);\n\n if (nestedHookSignature === undefined) {\n // No signature means Hook wasn't in the source code, e.g. in a library.\n // We'll skip it because we can assume it won't change during this session.\n continue;\n }\n\n var nestedHookKey = computeFullKey(nestedHookSignature);\n\n if (nestedHookSignature.forceReset) {\n signature.forceReset = true;\n }\n\n fullKey += '\\n---\\n' + nestedHookKey;\n }\n\n signature.fullKey = fullKey;\n return fullKey;\n}\n\nfunction haveEqualSignatures(prevType, nextType) {\n var prevSignature = allSignaturesByType.get(prevType);\n var nextSignature = allSignaturesByType.get(nextType);\n\n if (prevSignature === undefined && nextSignature === undefined) {\n return true;\n }\n\n if (prevSignature === undefined || nextSignature === undefined) {\n return false;\n }\n\n if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) {\n return false;\n }\n\n if (nextSignature.forceReset) {\n return false;\n }\n\n return true;\n}\n\nfunction isReactClass(type) {\n return type.prototype && type.prototype.isReactComponent;\n}\n\nfunction canPreserveStateBetween(prevType, nextType) {\n if (isReactClass(prevType) || isReactClass(nextType)) {\n return false;\n }\n\n if (haveEqualSignatures(prevType, nextType)) {\n return true;\n }\n\n return false;\n}\n\nfunction resolveFamily(type) {\n // Only check updated types to keep lookups fast.\n return updatedFamiliesByType.get(type);\n} // If we didn't care about IE11, we could use new Map/Set(iterable).\n\n\nfunction cloneMap(map) {\n var clone = new Map();\n map.forEach(function (value, key) {\n clone.set(key, value);\n });\n return clone;\n}\n\nfunction cloneSet(set) {\n var clone = new Set();\n set.forEach(function (value) {\n clone.add(value);\n });\n return clone;\n} // This is a safety mechanism to protect against rogue getters and Proxies.\n\n\nfunction getProperty(object, property) {\n try {\n return object[property];\n } catch (err) {\n // Intentionally ignore.\n return undefined;\n }\n}\n\nfunction performReactRefresh() {\n\n if (pendingUpdates.length === 0) {\n return null;\n }\n\n if (isPerformingRefresh) {\n return null;\n }\n\n isPerformingRefresh = true;\n\n try {\n var staleFamilies = new Set();\n var updatedFamilies = new Set();\n var updates = pendingUpdates;\n pendingUpdates = [];\n updates.forEach(function (_ref) {\n var family = _ref[0],\n nextType = _ref[1];\n // Now that we got a real edit, we can create associations\n // that will be read by the React reconciler.\n var prevType = family.current;\n updatedFamiliesByType.set(prevType, family);\n updatedFamiliesByType.set(nextType, family);\n family.current = nextType; // Determine whether this should be a re-render or a re-mount.\n\n if (canPreserveStateBetween(prevType, nextType)) {\n updatedFamilies.add(family);\n } else {\n staleFamilies.add(family);\n }\n }); // TODO: rename these fields to something more meaningful.\n\n var update = {\n updatedFamilies: updatedFamilies,\n // Families that will re-render preserving state\n staleFamilies: staleFamilies // Families that will be remounted\n\n };\n helpersByRendererID.forEach(function (helpers) {\n // Even if there are no roots, set the handler on first update.\n // This ensures that if *new* roots are mounted, they'll use the resolve handler.\n helpers.setRefreshHandler(resolveFamily);\n });\n var didError = false;\n var firstError = null; // We snapshot maps and sets that are mutated during commits.\n // If we don't do this, there is a risk they will be mutated while\n // we iterate over them. For example, trying to recover a failed root\n // may cause another root to be added to the failed list -- an infinite loop.\n\n var failedRootsSnapshot = cloneSet(failedRoots);\n var mountedRootsSnapshot = cloneSet(mountedRoots);\n var helpersByRootSnapshot = cloneMap(helpersByRoot);\n failedRootsSnapshot.forEach(function (root) {\n var helpers = helpersByRootSnapshot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n if (!failedRoots.has(root)) {// No longer failed.\n }\n\n if (rootElements === null) {\n return;\n }\n\n if (!rootElements.has(root)) {\n return;\n }\n\n var element = rootElements.get(root);\n\n try {\n helpers.scheduleRoot(root, element);\n } catch (err) {\n if (!didError) {\n didError = true;\n firstError = err;\n } // Keep trying other roots.\n\n }\n });\n mountedRootsSnapshot.forEach(function (root) {\n var helpers = helpersByRootSnapshot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n if (!mountedRoots.has(root)) {// No longer mounted.\n }\n\n try {\n helpers.scheduleRefresh(root, update);\n } catch (err) {\n if (!didError) {\n didError = true;\n firstError = err;\n } // Keep trying other roots.\n\n }\n });\n\n if (didError) {\n throw firstError;\n }\n\n return update;\n } finally {\n isPerformingRefresh = false;\n }\n}\nfunction register(type, id) {\n {\n if (type === null) {\n return;\n }\n\n if (typeof type !== 'function' && typeof type !== 'object') {\n return;\n } // This can happen in an edge case, e.g. if we register\n // return value of a HOC but it returns a cached component.\n // Ignore anything but the first registration for each type.\n\n\n if (allFamiliesByType.has(type)) {\n return;\n } // Create family or remember to update it.\n // None of this bookkeeping affects reconciliation\n // until the first performReactRefresh() call above.\n\n\n var family = allFamiliesByID.get(id);\n\n if (family === undefined) {\n family = {\n current: type\n };\n allFamiliesByID.set(id, family);\n } else {\n pendingUpdates.push([family, type]);\n }\n\n allFamiliesByType.set(type, family); // Visit inner types because we might not have registered them.\n\n if (typeof type === 'object' && type !== null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n register(type.render, id + '$render');\n break;\n\n case REACT_MEMO_TYPE:\n register(type.type, id + '$type');\n break;\n }\n }\n }\n}\nfunction setSignature(type, key) {\n var forceReset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var getCustomHooks = arguments.length > 3 ? arguments[3] : undefined;\n\n {\n if (!allSignaturesByType.has(type)) {\n allSignaturesByType.set(type, {\n forceReset: forceReset,\n ownKey: key,\n fullKey: null,\n getCustomHooks: getCustomHooks || function () {\n return [];\n }\n });\n } // Visit inner types because we might not have signed them.\n\n\n if (typeof type === 'object' && type !== null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n setSignature(type.render, key, forceReset, getCustomHooks);\n break;\n\n case REACT_MEMO_TYPE:\n setSignature(type.type, key, forceReset, getCustomHooks);\n break;\n }\n }\n }\n} // This is lazily called during first render for a type.\n// It captures Hook list at that time so inline requires don't break comparisons.\n\nfunction collectCustomHooksForSignature(type) {\n {\n var signature = allSignaturesByType.get(type);\n\n if (signature !== undefined) {\n computeFullKey(signature);\n }\n }\n}\nfunction getFamilyByID(id) {\n {\n return allFamiliesByID.get(id);\n }\n}\nfunction getFamilyByType(type) {\n {\n return allFamiliesByType.get(type);\n }\n}\nfunction findAffectedHostInstances(families) {\n {\n var affectedInstances = new Set();\n mountedRoots.forEach(function (root) {\n var helpers = helpersByRoot.get(root);\n\n if (helpers === undefined) {\n throw new Error('Could not find helpers for a root. This is a bug in React Refresh.');\n }\n\n var instancesForRoot = helpers.findHostInstancesForRefresh(root, families);\n instancesForRoot.forEach(function (inst) {\n affectedInstances.add(inst);\n });\n });\n return affectedInstances;\n }\n}\nfunction injectIntoGlobalHook(globalObject) {\n {\n // For React Native, the global hook will be set up by require('react-devtools-core').\n // That code will run before us. So we need to monkeypatch functions on existing hook.\n // For React Web, the global hook will be set up by the extension.\n // This will also run before us.\n var hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n\n if (hook === undefined) {\n // However, if there is no DevTools extension, we'll need to set up the global hook ourselves.\n // Note that in this case it's important that renderer code runs *after* this method call.\n // Otherwise, the renderer will think that there is no global hook, and won't do the injection.\n var nextID = 0;\n globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {\n renderers: new Map(),\n supportsFiber: true,\n inject: function (injected) {\n return nextID++;\n },\n onScheduleFiberRoot: function (id, root, children) {},\n onCommitFiberRoot: function (id, root, maybePriorityLevel, didError) {},\n onCommitFiberUnmount: function () {}\n };\n }\n\n if (hook.isDisabled) {\n // This isn't a real property on the hook, but it can be set to opt out\n // of DevTools integration and associated warnings and logs.\n // Using console['warn'] to evade Babel and ESLint\n console['warn']('Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). ' + 'Fast Refresh is not compatible with this shim and will be disabled.');\n return;\n } // Here, we just want to get a reference to scheduleRefresh.\n\n\n var oldInject = hook.inject;\n\n hook.inject = function (injected) {\n var id = oldInject.apply(this, arguments);\n\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n\n return id;\n }; // Do the same for any already injected roots.\n // This is useful if ReactDOM has already been initialized.\n // https://github.com/facebook/react/issues/17626\n\n\n hook.renderers.forEach(function (injected, id) {\n if (typeof injected.scheduleRefresh === 'function' && typeof injected.setRefreshHandler === 'function') {\n // This version supports React Refresh.\n helpersByRendererID.set(id, injected);\n }\n }); // We also want to track currently mounted roots.\n\n var oldOnCommitFiberRoot = hook.onCommitFiberRoot;\n\n var oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || function () {};\n\n hook.onScheduleFiberRoot = function (id, root, children) {\n if (!isPerformingRefresh) {\n // If it was intentionally scheduled, don't attempt to restore.\n // This includes intentionally scheduled unmounts.\n failedRoots.delete(root);\n\n if (rootElements !== null) {\n rootElements.set(root, children);\n }\n }\n\n return oldOnScheduleFiberRoot.apply(this, arguments);\n };\n\n hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {\n var helpers = helpersByRendererID.get(id);\n\n if (helpers !== undefined) {\n helpersByRoot.set(root, helpers);\n var current = root.current;\n var alternate = current.alternate; // We need to determine whether this root has just (un)mounted.\n // This logic is copy-pasted from similar logic in the DevTools backend.\n // If this breaks with some refactoring, you'll want to update DevTools too.\n\n if (alternate !== null) {\n var wasMounted = alternate.memoizedState != null && alternate.memoizedState.element != null && mountedRoots.has(root);\n var isMounted = current.memoizedState != null && current.memoizedState.element != null;\n\n if (!wasMounted && isMounted) {\n // Mount a new root.\n mountedRoots.add(root);\n failedRoots.delete(root);\n } else if (wasMounted && isMounted) ; else if (wasMounted && !isMounted) {\n // Unmount an existing root.\n mountedRoots.delete(root);\n\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n } else {\n helpersByRoot.delete(root);\n }\n } else if (!wasMounted && !isMounted) {\n if (didError) {\n // We'll remount it on future edits.\n failedRoots.add(root);\n }\n }\n } else {\n // Mount a new root.\n mountedRoots.add(root);\n }\n } // Always call the decorated DevTools hook.\n\n\n return oldOnCommitFiberRoot.apply(this, arguments);\n };\n }\n}\nfunction hasUnrecoverableErrors() {\n // TODO: delete this after removing dependency in RN.\n return false;\n} // Exposed for testing.\n\nfunction _getMountedRootCount() {\n {\n return mountedRoots.size;\n }\n} // This is a wrapper over more primitive functions for setting signature.\n// Signatures let us decide whether the Hook order has changed on refresh.\n//\n// This function is intended to be used as a transform target, e.g.:\n// var _s = createSignatureFunctionForTransform()\n//\n// function Hello() {\n// const [foo, setFoo] = useState(0);\n// const value = useCustomHook();\n// _s(); /* Call without arguments triggers collecting the custom Hook list.\n// * This doesn't happen during the module evaluation because we\n// * don't want to change the module order with inline requires.\n// * Next calls are noops. */\n// return <h1>Hi</h1>;\n// }\n//\n// /* Call with arguments attaches the signature to the type: */\n// _s(\n// Hello,\n// 'useState{[foo, setFoo]}(0)',\n// () => [useCustomHook], /* Lazy to avoid triggering inline requires */\n// );\n\nfunction createSignatureFunctionForTransform() {\n {\n var savedType;\n var hasCustomHooks;\n var didCollectHooks = false;\n return function (type, key, forceReset, getCustomHooks) {\n if (typeof key === 'string') {\n // We're in the initial phase that associates signatures\n // with the functions. Note this may be called multiple times\n // in HOC chains like _s(hoc1(_s(hoc2(_s(actualFunction))))).\n if (!savedType) {\n // We're in the innermost call, so this is the actual type.\n savedType = type;\n hasCustomHooks = typeof getCustomHooks === 'function';\n } // Set the signature for all types (even wrappers!) in case\n // they have no signatures of their own. This is to prevent\n // problems like https://github.com/facebook/react/issues/20417.\n\n\n if (type != null && (typeof type === 'function' || typeof type === 'object')) {\n setSignature(type, key, forceReset, getCustomHooks);\n }\n\n return type;\n } else {\n // We're in the _s() call without arguments, which means\n // this is the time to collect custom Hook signatures.\n // Only do this once. This path is hot and runs *inside* every render!\n if (!didCollectHooks && hasCustomHooks) {\n didCollectHooks = true;\n collectCustomHooksForSignature(savedType);\n }\n }\n };\n }\n}\nfunction isLikelyComponentType(type) {\n {\n switch (typeof type) {\n case 'function':\n {\n // First, deal with classes.\n if (type.prototype != null) {\n if (type.prototype.isReactComponent) {\n // React class.\n return true;\n }\n\n var ownNames = Object.getOwnPropertyNames(type.prototype);\n\n if (ownNames.length > 1 || ownNames[0] !== 'constructor') {\n // This looks like a class.\n return false;\n } // eslint-disable-next-line no-proto\n\n\n if (type.prototype.__proto__ !== Object.prototype) {\n // It has a superclass.\n return false;\n } // Pass through.\n // This looks like a regular function with empty prototype.\n\n } // For plain functions and arrows, use name as a heuristic.\n\n\n var name = type.name || type.displayName;\n return typeof name === 'string' && /^[A-Z]/.test(name);\n }\n\n case 'object':\n {\n if (type != null) {\n switch (getProperty(type, '$$typeof')) {\n case REACT_FORWARD_REF_TYPE:\n case REACT_MEMO_TYPE:\n // Definitely React components.\n return true;\n\n default:\n return false;\n }\n }\n\n return false;\n }\n\n default:\n {\n return false;\n }\n }\n }\n}\n\nexports._getMountedRootCount = _getMountedRootCount;\nexports.collectCustomHooksForSignature = collectCustomHooksForSignature;\nexports.createSignatureFunctionForTransform = createSignatureFunctionForTransform;\nexports.findAffectedHostInstances = findAffectedHostInstances;\nexports.getFamilyByID = getFamilyByID;\nexports.getFamilyByType = getFamilyByType;\nexports.hasUnrecoverableErrors = hasUnrecoverableErrors;\nexports.injectIntoGlobalHook = injectIntoGlobalHook;\nexports.isLikelyComponentType = isLikelyComponentType;\nexports.performReactRefresh = performReactRefresh;\nexports.register = register;\nexports.setSignature = setSignature;\n })();\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/react-refresh/cjs/react-refresh-runtime.development.js?"); /***/ }), /***/ "./node_modules/react-refresh/runtime.js": /*!***********************************************!*\ !*** ./node_modules/react-refresh/runtime.js ***! \***********************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { eval("\n\nif (false) {} else {\n module.exports = __webpack_require__(/*! ./cjs/react-refresh-runtime.development.js */ \"./node_modules/react-refresh/cjs/react-refresh-runtime.development.js\");\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/react-refresh/runtime.js?"); /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module can't be inlined because the eval devtool is used. /******/ var __webpack_exports__ = __webpack_require__("./node_modules/react-refresh/runtime.js"); /******/ window.ReactRefreshRuntime = __webpack_exports__; /******/ /******/ })() ; development/react-refresh-entry.js 0000644 00000200347 15013651111 0013315 0 ustar 00 /* * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js": /*!***************************************************************************************!*\ !*** ./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js ***! \***************************************************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { eval("/* global __react_refresh_library__ */\n\nconst safeThis = __webpack_require__(/*! core-js-pure/features/global-this */ \"./node_modules/core-js-pure/features/global-this.js\");\nconst RefreshRuntime = __webpack_require__(/*! react-refresh/runtime */ \"react-refresh/runtime\");\n\nif (true) {\n if (typeof safeThis !== 'undefined') {\n var $RefreshInjected$ = '__reactRefreshInjected';\n // Namespace the injected flag (if necessary) for monorepo compatibility\n if (typeof __react_refresh_library__ !== 'undefined' && __react_refresh_library__) {\n $RefreshInjected$ += '_' + __react_refresh_library__;\n }\n\n // Only inject the runtime if it hasn't been injected\n if (!safeThis[$RefreshInjected$]) {\n // Inject refresh runtime into global scope\n RefreshRuntime.injectIntoGlobalHook(safeThis);\n\n // Mark the runtime as injected to prevent double-injection\n safeThis[$RefreshInjected$] = true;\n }\n }\n}\n\n\n//# sourceURL=webpack://WordPress/./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js?"); /***/ }), /***/ "./node_modules/core-js-pure/actual/global-this.js": /*!*********************************************************!*\ !*** ./node_modules/core-js-pure/actual/global-this.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar parent = __webpack_require__(/*! ../stable/global-this */ \"./node_modules/core-js-pure/stable/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/actual/global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/es/global-this.js": /*!*****************************************************!*\ !*** ./node_modules/core-js-pure/es/global-this.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n__webpack_require__(/*! ../modules/es.global-this */ \"./node_modules/core-js-pure/modules/es.global-this.js\");\n\nmodule.exports = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/es/global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/features/global-this.js": /*!***********************************************************!*\ !*** ./node_modules/core-js-pure/features/global-this.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nmodule.exports = __webpack_require__(/*! ../full/global-this */ \"./node_modules/core-js-pure/full/global-this.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/features/global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/full/global-this.js": /*!*******************************************************!*\ !*** ./node_modules/core-js-pure/full/global-this.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n// TODO: remove from `core-js@4`\n__webpack_require__(/*! ../modules/esnext.global-this */ \"./node_modules/core-js-pure/modules/esnext.global-this.js\");\n\nvar parent = __webpack_require__(/*! ../actual/global-this */ \"./node_modules/core-js-pure/actual/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/full/global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/a-callable.js": /*!***********************************************************!*\ !*** ./node_modules/core-js-pure/internals/a-callable.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar tryToString = __webpack_require__(/*! ../internals/try-to-string */ \"./node_modules/core-js-pure/internals/try-to-string.js\");\n\nvar $TypeError = TypeError;\n\n// `Assert: IsCallable(argument) is true`\nmodule.exports = function (argument) {\n if (isCallable(argument)) return argument;\n throw new $TypeError(tryToString(argument) + ' is not a function');\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/a-callable.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/an-object.js": /*!**********************************************************!*\ !*** ./node_modules/core-js-pure/internals/an-object.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar $String = String;\nvar $TypeError = TypeError;\n\n// `Assert: Type(argument) is Object`\nmodule.exports = function (argument) {\n if (isObject(argument)) return argument;\n throw new $TypeError($String(argument) + ' is not an object');\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/an-object.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/classof-raw.js": /*!************************************************************!*\ !*** ./node_modules/core-js-pure/internals/classof-raw.js ***! \************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nvar toString = uncurryThis({}.toString);\nvar stringSlice = uncurryThis(''.slice);\n\nmodule.exports = function (it) {\n return stringSlice(toString(it), 8, -1);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/classof-raw.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/create-non-enumerable-property.js": /*!*******************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/create-non-enumerable-property.js ***! \*******************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar definePropertyModule = __webpack_require__(/*! ../internals/object-define-property */ \"./node_modules/core-js-pure/internals/object-define-property.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\n\nmodule.exports = DESCRIPTORS ? function (object, key, value) {\n return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/create-non-enumerable-property.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/create-property-descriptor.js": /*!***************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/create-property-descriptor.js ***! \***************************************************************************/ /***/ ((module) => { "use strict"; eval("\nmodule.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/create-property-descriptor.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/define-global-property.js": /*!***********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/define-global-property.js ***! \***********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar defineProperty = Object.defineProperty;\n\nmodule.exports = function (key, value) {\n try {\n defineProperty(global, key, { value: value, configurable: true, writable: true });\n } catch (error) {\n global[key] = value;\n } return value;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/define-global-property.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/descriptors.js": /*!************************************************************!*\ !*** ./node_modules/core-js-pure/internals/descriptors.js ***! \************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\n// Detect IE8's incomplete defineProperty implementation\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/descriptors.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/document-create-element.js": /*!************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/document-create-element.js ***! \************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar document = global.document;\n// typeof document.createElement is 'object' in old IE\nvar EXISTS = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return EXISTS ? document.createElement(it) : {};\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/document-create-element.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/engine-user-agent.js": /*!******************************************************************!*\ !*** ./node_modules/core-js-pure/internals/engine-user-agent.js ***! \******************************************************************/ /***/ ((module) => { "use strict"; eval("\nmodule.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/engine-user-agent.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/engine-v8-version.js": /*!******************************************************************!*\ !*** ./node_modules/core-js-pure/internals/engine-v8-version.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar userAgent = __webpack_require__(/*! ../internals/engine-user-agent */ \"./node_modules/core-js-pure/internals/engine-user-agent.js\");\n\nvar process = global.process;\nvar Deno = global.Deno;\nvar versions = process && process.versions || Deno && Deno.version;\nvar v8 = versions && versions.v8;\nvar match, version;\n\nif (v8) {\n match = v8.split('.');\n // in old Chrome, versions of V8 isn't V8 = Chrome / 10\n // but their correct versions are not interesting for us\n version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);\n}\n\n// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`\n// so check `userAgent` even if `.v8` exists, but 0\nif (!version && userAgent) {\n match = userAgent.match(/Edge\\/(\\d+)/);\n if (!match || match[1] >= 74) {\n match = userAgent.match(/Chrome\\/(\\d+)/);\n if (match) version = +match[1];\n }\n}\n\nmodule.exports = version;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/engine-v8-version.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/export.js": /*!*******************************************************!*\ !*** ./node_modules/core-js-pure/internals/export.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar apply = __webpack_require__(/*! ../internals/function-apply */ \"./node_modules/core-js-pure/internals/function-apply.js\");\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ \"./node_modules/core-js-pure/internals/function-uncurry-this-clause.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar getOwnPropertyDescriptor = (__webpack_require__(/*! ../internals/object-get-own-property-descriptor */ \"./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js\").f);\nvar isForced = __webpack_require__(/*! ../internals/is-forced */ \"./node_modules/core-js-pure/internals/is-forced.js\");\nvar path = __webpack_require__(/*! ../internals/path */ \"./node_modules/core-js-pure/internals/path.js\");\nvar bind = __webpack_require__(/*! ../internals/function-bind-context */ \"./node_modules/core-js-pure/internals/function-bind-context.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js-pure/internals/create-non-enumerable-property.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\n\nvar wrapConstructor = function (NativeConstructor) {\n var Wrapper = function (a, b, c) {\n if (this instanceof Wrapper) {\n switch (arguments.length) {\n case 0: return new NativeConstructor();\n case 1: return new NativeConstructor(a);\n case 2: return new NativeConstructor(a, b);\n } return new NativeConstructor(a, b, c);\n } return apply(NativeConstructor, this, arguments);\n };\n Wrapper.prototype = NativeConstructor.prototype;\n return Wrapper;\n};\n\n/*\n options.target - name of the target object\n options.global - target is the global object\n options.stat - export as static methods of target\n options.proto - export as prototype methods of target\n options.real - real prototype method for the `pure` version\n options.forced - export even if the native feature is available\n options.bind - bind methods to the target, required for the `pure` version\n options.wrap - wrap constructors to preventing global pollution, required for the `pure` version\n options.unsafe - use the simple assignment of property instead of delete + defineProperty\n options.sham - add a flag to not completely full polyfills\n options.enumerable - export as enumerable property\n options.dontCallGetSet - prevent calling a getter on target\n options.name - the .name of the function if it does not match the key\n*/\nmodule.exports = function (options, source) {\n var TARGET = options.target;\n var GLOBAL = options.global;\n var STATIC = options.stat;\n var PROTO = options.proto;\n\n var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : global[TARGET] && global[TARGET].prototype;\n\n var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];\n var targetPrototype = target.prototype;\n\n var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;\n var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;\n\n for (key in source) {\n FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);\n // contains in native\n USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);\n\n targetProperty = target[key];\n\n if (USE_NATIVE) if (options.dontCallGetSet) {\n descriptor = getOwnPropertyDescriptor(nativeSource, key);\n nativeProperty = descriptor && descriptor.value;\n } else nativeProperty = nativeSource[key];\n\n // export native or implementation\n sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];\n\n if (!FORCED && !PROTO && typeof targetProperty == typeof sourceProperty) continue;\n\n // bind methods to global for calling from export context\n if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);\n // wrap global constructors for prevent changes in this version\n else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);\n // make static versions for prototype methods\n else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);\n // default case\n else resultProperty = sourceProperty;\n\n // add a flag to not completely full polyfills\n if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {\n createNonEnumerableProperty(resultProperty, 'sham', true);\n }\n\n createNonEnumerableProperty(target, key, resultProperty);\n\n if (PROTO) {\n VIRTUAL_PROTOTYPE = TARGET + 'Prototype';\n if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {\n createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});\n }\n // export virtual prototype methods\n createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);\n // export real prototype methods\n if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) {\n createNonEnumerableProperty(targetPrototype, key, sourceProperty);\n }\n }\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/export.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/fails.js": /*!******************************************************!*\ !*** ./node_modules/core-js-pure/internals/fails.js ***! \******************************************************/ /***/ ((module) => { "use strict"; eval("\nmodule.exports = function (exec) {\n try {\n return !!exec();\n } catch (error) {\n return true;\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/fails.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-apply.js": /*!***************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-apply.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-apply.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-bind-context.js": /*!**********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-bind-context.js ***! \**********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this-clause */ \"./node_modules/core-js-pure/internals/function-uncurry-this-clause.js\");\nvar aCallable = __webpack_require__(/*! ../internals/a-callable */ \"./node_modules/core-js-pure/internals/a-callable.js\");\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar bind = uncurryThis(uncurryThis.bind);\n\n// optional / simple context binding\nmodule.exports = function (fn, that) {\n aCallable(fn);\n return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-bind-context.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-bind-native.js": /*!*********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-bind-native.js ***! \*********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\nmodule.exports = !fails(function () {\n // eslint-disable-next-line es/no-function-prototype-bind -- safe\n var test = (function () { /* empty */ }).bind();\n // eslint-disable-next-line no-prototype-builtins -- safe\n return typeof test != 'function' || test.hasOwnProperty('prototype');\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-bind-native.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-call.js": /*!**************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-call.js ***! \**************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar call = Function.prototype.call;\n\nmodule.exports = NATIVE_BIND ? call.bind(call) : function () {\n return call.apply(call, arguments);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-call.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-uncurry-this-clause.js": /*!*****************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-uncurry-this-clause.js ***! \*****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar classofRaw = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nmodule.exports = function (fn) {\n // Nashorn bug:\n // https://github.com/zloirock/core-js/issues/1128\n // https://github.com/zloirock/core-js/issues/1130\n if (classofRaw(fn) === 'Function') return uncurryThis(fn);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-uncurry-this-clause.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/function-uncurry-this.js": /*!**********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/function-uncurry-this.js ***! \**********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js-pure/internals/function-bind-native.js\");\n\nvar FunctionPrototype = Function.prototype;\nvar call = FunctionPrototype.call;\nvar uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);\n\nmodule.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {\n return function () {\n return call.apply(fn, arguments);\n };\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/function-uncurry-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/get-built-in.js": /*!*************************************************************!*\ !*** ./node_modules/core-js-pure/internals/get-built-in.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar path = __webpack_require__(/*! ../internals/path */ \"./node_modules/core-js-pure/internals/path.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nvar aFunction = function (variable) {\n return isCallable(variable) ? variable : undefined;\n};\n\nmodule.exports = function (namespace, method) {\n return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])\n : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/get-built-in.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/get-method.js": /*!***********************************************************!*\ !*** ./node_modules/core-js-pure/internals/get-method.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar aCallable = __webpack_require__(/*! ../internals/a-callable */ \"./node_modules/core-js-pure/internals/a-callable.js\");\nvar isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ \"./node_modules/core-js-pure/internals/is-null-or-undefined.js\");\n\n// `GetMethod` abstract operation\n// https://tc39.es/ecma262/#sec-getmethod\nmodule.exports = function (V, P) {\n var func = V[P];\n return isNullOrUndefined(func) ? undefined : aCallable(func);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/get-method.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/global.js": /*!*******************************************************!*\ !*** ./node_modules/core-js-pure/internals/global.js ***! \*******************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; eval("\nvar check = function (it) {\n return it && it.Math === Math && it;\n};\n\n// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nmodule.exports =\n // eslint-disable-next-line es/no-global-this -- safe\n check(typeof globalThis == 'object' && globalThis) ||\n check(typeof window == 'object' && window) ||\n // eslint-disable-next-line no-restricted-globals -- safe\n check(typeof self == 'object' && self) ||\n check(typeof __webpack_require__.g == 'object' && __webpack_require__.g) ||\n check(typeof this == 'object' && this) ||\n // eslint-disable-next-line no-new-func -- fallback\n (function () { return this; })() || Function('return this')();\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/global.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/has-own-property.js": /*!*****************************************************************!*\ !*** ./node_modules/core-js-pure/internals/has-own-property.js ***! \*****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\nvar toObject = __webpack_require__(/*! ../internals/to-object */ \"./node_modules/core-js-pure/internals/to-object.js\");\n\nvar hasOwnProperty = uncurryThis({}.hasOwnProperty);\n\n// `HasOwnProperty` abstract operation\n// https://tc39.es/ecma262/#sec-hasownproperty\n// eslint-disable-next-line es/no-object-hasown -- safe\nmodule.exports = Object.hasOwn || function hasOwn(it, key) {\n return hasOwnProperty(toObject(it), key);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/has-own-property.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/ie8-dom-define.js": /*!***************************************************************!*\ !*** ./node_modules/core-js-pure/internals/ie8-dom-define.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar createElement = __webpack_require__(/*! ../internals/document-create-element */ \"./node_modules/core-js-pure/internals/document-create-element.js\");\n\n// Thanks to IE8 for its funny defineProperty\nmodule.exports = !DESCRIPTORS && !fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(createElement('div'), 'a', {\n get: function () { return 7; }\n }).a !== 7;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/ie8-dom-define.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/indexed-object.js": /*!***************************************************************!*\ !*** ./node_modules/core-js-pure/internals/indexed-object.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar classof = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js-pure/internals/classof-raw.js\");\n\nvar $Object = Object;\nvar split = uncurryThis(''.split);\n\n// fallback for non-array-like ES3 and non-enumerable old V8 strings\nmodule.exports = fails(function () {\n // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346\n // eslint-disable-next-line no-prototype-builtins -- safe\n return !$Object('z').propertyIsEnumerable(0);\n}) ? function (it) {\n return classof(it) === 'String' ? split(it, '') : $Object(it);\n} : $Object;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/indexed-object.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-callable.js": /*!************************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-callable.js ***! \************************************************************/ /***/ ((module) => { "use strict"; eval("\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot\nvar documentAll = typeof document == 'object' && document.all;\n\n// `IsCallable` abstract operation\n// https://tc39.es/ecma262/#sec-iscallable\n// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing\nmodule.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {\n return typeof argument == 'function' || argument === documentAll;\n} : function (argument) {\n return typeof argument == 'function';\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-callable.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-forced.js": /*!**********************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-forced.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nvar replacement = /#|\\.prototype\\./;\n\nvar isForced = function (feature, detection) {\n var value = data[normalize(feature)];\n return value === POLYFILL ? true\n : value === NATIVE ? false\n : isCallable(detection) ? fails(detection)\n : !!detection;\n};\n\nvar normalize = isForced.normalize = function (string) {\n return String(string).replace(replacement, '.').toLowerCase();\n};\n\nvar data = isForced.data = {};\nvar NATIVE = isForced.NATIVE = 'N';\nvar POLYFILL = isForced.POLYFILL = 'P';\n\nmodule.exports = isForced;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-forced.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-null-or-undefined.js": /*!*********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-null-or-undefined.js ***! \*********************************************************************/ /***/ ((module) => { "use strict"; eval("\n// we can't use just `it == null` since of `document.all` special case\n// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec\nmodule.exports = function (it) {\n return it === null || it === undefined;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-null-or-undefined.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-object.js": /*!**********************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-object.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\n\nmodule.exports = function (it) {\n return typeof it == 'object' ? it !== null : isCallable(it);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-object.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-pure.js": /*!********************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-pure.js ***! \********************************************************/ /***/ ((module) => { "use strict"; eval("\nmodule.exports = true;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-pure.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/is-symbol.js": /*!**********************************************************!*\ !*** ./node_modules/core-js-pure/internals/is-symbol.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js-pure/internals/get-built-in.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ \"./node_modules/core-js-pure/internals/object-is-prototype-of.js\");\nvar USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ \"./node_modules/core-js-pure/internals/use-symbol-as-uid.js\");\n\nvar $Object = Object;\n\nmodule.exports = USE_SYMBOL_AS_UID ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n var $Symbol = getBuiltIn('Symbol');\n return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/is-symbol.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/object-define-property.js": /*!***********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/object-define-property.js ***! \***********************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ \"./node_modules/core-js-pure/internals/ie8-dom-define.js\");\nvar V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(/*! ../internals/v8-prototype-define-bug */ \"./node_modules/core-js-pure/internals/v8-prototype-define-bug.js\");\nvar anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js-pure/internals/an-object.js\");\nvar toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ \"./node_modules/core-js-pure/internals/to-property-key.js\");\n\nvar $TypeError = TypeError;\n// eslint-disable-next-line es/no-object-defineproperty -- safe\nvar $defineProperty = Object.defineProperty;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ENUMERABLE = 'enumerable';\nvar CONFIGURABLE = 'configurable';\nvar WRITABLE = 'writable';\n\n// `Object.defineProperty` method\n// https://tc39.es/ecma262/#sec-object.defineproperty\nexports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {\n var current = $getOwnPropertyDescriptor(O, P);\n if (current && current[WRITABLE]) {\n O[P] = Attributes.value;\n Attributes = {\n configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],\n enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],\n writable: false\n };\n }\n } return $defineProperty(O, P, Attributes);\n} : $defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPropertyKey(P);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return $defineProperty(O, P, Attributes);\n } catch (error) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-define-property.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js": /*!***********************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js ***! \***********************************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar propertyIsEnumerableModule = __webpack_require__(/*! ../internals/object-property-is-enumerable */ \"./node_modules/core-js-pure/internals/object-property-is-enumerable.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js-pure/internals/create-property-descriptor.js\");\nvar toIndexedObject = __webpack_require__(/*! ../internals/to-indexed-object */ \"./node_modules/core-js-pure/internals/to-indexed-object.js\");\nvar toPropertyKey = __webpack_require__(/*! ../internals/to-property-key */ \"./node_modules/core-js-pure/internals/to-property-key.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\nvar IE8_DOM_DEFINE = __webpack_require__(/*! ../internals/ie8-dom-define */ \"./node_modules/core-js-pure/internals/ie8-dom-define.js\");\n\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// `Object.getOwnPropertyDescriptor` method\n// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor\nexports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {\n O = toIndexedObject(O);\n P = toPropertyKey(P);\n if (IE8_DOM_DEFINE) try {\n return $getOwnPropertyDescriptor(O, P);\n } catch (error) { /* empty */ }\n if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-get-own-property-descriptor.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/object-is-prototype-of.js": /*!***********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/object-is-prototype-of.js ***! \***********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nmodule.exports = uncurryThis({}.isPrototypeOf);\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-is-prototype-of.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/object-property-is-enumerable.js": /*!******************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/object-property-is-enumerable.js ***! \******************************************************************************/ /***/ ((__unused_webpack_module, exports) => { "use strict"; eval("\nvar $propertyIsEnumerable = {}.propertyIsEnumerable;\n// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\n\n// Nashorn ~ JDK8 bug\nvar NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);\n\n// `Object.prototype.propertyIsEnumerable` method implementation\n// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable\nexports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {\n var descriptor = getOwnPropertyDescriptor(this, V);\n return !!descriptor && descriptor.enumerable;\n} : $propertyIsEnumerable;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/object-property-is-enumerable.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/ordinary-to-primitive.js": /*!**********************************************************************!*\ !*** ./node_modules/core-js-pure/internals/ordinary-to-primitive.js ***! \**********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js-pure/internals/is-callable.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\n\nvar $TypeError = TypeError;\n\n// `OrdinaryToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-ordinarytoprimitive\nmodule.exports = function (input, pref) {\n var fn, val;\n if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;\n if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;\n throw new $TypeError(\"Can't convert object to primitive value\");\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/ordinary-to-primitive.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/path.js": /*!*****************************************************!*\ !*** ./node_modules/core-js-pure/internals/path.js ***! \*****************************************************/ /***/ ((module) => { "use strict"; eval("\nmodule.exports = {};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/path.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/require-object-coercible.js": /*!*************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/require-object-coercible.js ***! \*************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar isNullOrUndefined = __webpack_require__(/*! ../internals/is-null-or-undefined */ \"./node_modules/core-js-pure/internals/is-null-or-undefined.js\");\n\nvar $TypeError = TypeError;\n\n// `RequireObjectCoercible` abstract operation\n// https://tc39.es/ecma262/#sec-requireobjectcoercible\nmodule.exports = function (it) {\n if (isNullOrUndefined(it)) throw new $TypeError(\"Can't call method on \" + it);\n return it;\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/require-object-coercible.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/shared-store.js": /*!*************************************************************!*\ !*** ./node_modules/core-js-pure/internals/shared-store.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar defineGlobalProperty = __webpack_require__(/*! ../internals/define-global-property */ \"./node_modules/core-js-pure/internals/define-global-property.js\");\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || defineGlobalProperty(SHARED, {});\n\nmodule.exports = store;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/shared-store.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/shared.js": /*!*******************************************************!*\ !*** ./node_modules/core-js-pure/internals/shared.js ***! \*******************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar IS_PURE = __webpack_require__(/*! ../internals/is-pure */ \"./node_modules/core-js-pure/internals/is-pure.js\");\nvar store = __webpack_require__(/*! ../internals/shared-store */ \"./node_modules/core-js-pure/internals/shared-store.js\");\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: '3.35.1',\n mode: IS_PURE ? 'pure' : 'global',\n copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',\n license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',\n source: 'https://github.com/zloirock/core-js'\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/shared.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/symbol-constructor-detection.js": /*!*****************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/symbol-constructor-detection.js ***! \*****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n/* eslint-disable es/no-symbol -- required for testing */\nvar V8_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ \"./node_modules/core-js-pure/internals/engine-v8-version.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\nvar $String = global.String;\n\n// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing\nmodule.exports = !!Object.getOwnPropertySymbols && !fails(function () {\n var symbol = Symbol('symbol detection');\n // Chrome 38 Symbol has incorrect toString conversion\n // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances\n // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,\n // of course, fail.\n return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||\n // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances\n !Symbol.sham && V8_VERSION && V8_VERSION < 41;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/symbol-constructor-detection.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/to-indexed-object.js": /*!******************************************************************!*\ !*** ./node_modules/core-js-pure/internals/to-indexed-object.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n// toObject with fallback for non-array-like ES3 strings\nvar IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ \"./node_modules/core-js-pure/internals/indexed-object.js\");\nvar requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ \"./node_modules/core-js-pure/internals/require-object-coercible.js\");\n\nmodule.exports = function (it) {\n return IndexedObject(requireObjectCoercible(it));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-indexed-object.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/to-object.js": /*!**********************************************************!*\ !*** ./node_modules/core-js-pure/internals/to-object.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar requireObjectCoercible = __webpack_require__(/*! ../internals/require-object-coercible */ \"./node_modules/core-js-pure/internals/require-object-coercible.js\");\n\nvar $Object = Object;\n\n// `ToObject` abstract operation\n// https://tc39.es/ecma262/#sec-toobject\nmodule.exports = function (argument) {\n return $Object(requireObjectCoercible(argument));\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-object.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/to-primitive.js": /*!*************************************************************!*\ !*** ./node_modules/core-js-pure/internals/to-primitive.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar call = __webpack_require__(/*! ../internals/function-call */ \"./node_modules/core-js-pure/internals/function-call.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js-pure/internals/is-object.js\");\nvar isSymbol = __webpack_require__(/*! ../internals/is-symbol */ \"./node_modules/core-js-pure/internals/is-symbol.js\");\nvar getMethod = __webpack_require__(/*! ../internals/get-method */ \"./node_modules/core-js-pure/internals/get-method.js\");\nvar ordinaryToPrimitive = __webpack_require__(/*! ../internals/ordinary-to-primitive */ \"./node_modules/core-js-pure/internals/ordinary-to-primitive.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js-pure/internals/well-known-symbol.js\");\n\nvar $TypeError = TypeError;\nvar TO_PRIMITIVE = wellKnownSymbol('toPrimitive');\n\n// `ToPrimitive` abstract operation\n// https://tc39.es/ecma262/#sec-toprimitive\nmodule.exports = function (input, pref) {\n if (!isObject(input) || isSymbol(input)) return input;\n var exoticToPrim = getMethod(input, TO_PRIMITIVE);\n var result;\n if (exoticToPrim) {\n if (pref === undefined) pref = 'default';\n result = call(exoticToPrim, input, pref);\n if (!isObject(result) || isSymbol(result)) return result;\n throw new $TypeError(\"Can't convert object to primitive value\");\n }\n if (pref === undefined) pref = 'number';\n return ordinaryToPrimitive(input, pref);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-primitive.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/to-property-key.js": /*!****************************************************************!*\ !*** ./node_modules/core-js-pure/internals/to-property-key.js ***! \****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar toPrimitive = __webpack_require__(/*! ../internals/to-primitive */ \"./node_modules/core-js-pure/internals/to-primitive.js\");\nvar isSymbol = __webpack_require__(/*! ../internals/is-symbol */ \"./node_modules/core-js-pure/internals/is-symbol.js\");\n\n// `ToPropertyKey` abstract operation\n// https://tc39.es/ecma262/#sec-topropertykey\nmodule.exports = function (argument) {\n var key = toPrimitive(argument, 'string');\n return isSymbol(key) ? key : key + '';\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/to-property-key.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/try-to-string.js": /*!**************************************************************!*\ !*** ./node_modules/core-js-pure/internals/try-to-string.js ***! \**************************************************************/ /***/ ((module) => { "use strict"; eval("\nvar $String = String;\n\nmodule.exports = function (argument) {\n try {\n return $String(argument);\n } catch (error) {\n return 'Object';\n }\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/try-to-string.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/uid.js": /*!****************************************************!*\ !*** ./node_modules/core-js-pure/internals/uid.js ***! \****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js-pure/internals/function-uncurry-this.js\");\n\nvar id = 0;\nvar postfix = Math.random();\nvar toString = uncurryThis(1.0.toString);\n\nmodule.exports = function (key) {\n return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/uid.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/use-symbol-as-uid.js": /*!******************************************************************!*\ !*** ./node_modules/core-js-pure/internals/use-symbol-as-uid.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n/* eslint-disable es/no-symbol -- required for testing */\nvar NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ \"./node_modules/core-js-pure/internals/symbol-constructor-detection.js\");\n\nmodule.exports = NATIVE_SYMBOL\n && !Symbol.sham\n && typeof Symbol.iterator == 'symbol';\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/use-symbol-as-uid.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/v8-prototype-define-bug.js": /*!************************************************************************!*\ !*** ./node_modules/core-js-pure/internals/v8-prototype-define-bug.js ***! \************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js-pure/internals/descriptors.js\");\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js-pure/internals/fails.js\");\n\n// V8 ~ Chrome 36-\n// https://bugs.chromium.org/p/v8/issues/detail?id=3334\nmodule.exports = DESCRIPTORS && fails(function () {\n // eslint-disable-next-line es/no-object-defineproperty -- required for testing\n return Object.defineProperty(function () { /* empty */ }, 'prototype', {\n value: 42,\n writable: false\n }).prototype !== 42;\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/v8-prototype-define-bug.js?"); /***/ }), /***/ "./node_modules/core-js-pure/internals/well-known-symbol.js": /*!******************************************************************!*\ !*** ./node_modules/core-js-pure/internals/well-known-symbol.js ***! \******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\nvar shared = __webpack_require__(/*! ../internals/shared */ \"./node_modules/core-js-pure/internals/shared.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js-pure/internals/has-own-property.js\");\nvar uid = __webpack_require__(/*! ../internals/uid */ \"./node_modules/core-js-pure/internals/uid.js\");\nvar NATIVE_SYMBOL = __webpack_require__(/*! ../internals/symbol-constructor-detection */ \"./node_modules/core-js-pure/internals/symbol-constructor-detection.js\");\nvar USE_SYMBOL_AS_UID = __webpack_require__(/*! ../internals/use-symbol-as-uid */ \"./node_modules/core-js-pure/internals/use-symbol-as-uid.js\");\n\nvar Symbol = global.Symbol;\nvar WellKnownSymbolsStore = shared('wks');\nvar createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;\n\nmodule.exports = function (name) {\n if (!hasOwn(WellKnownSymbolsStore, name)) {\n WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)\n ? Symbol[name]\n : createWellKnownSymbol('Symbol.' + name);\n } return WellKnownSymbolsStore[name];\n};\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/internals/well-known-symbol.js?"); /***/ }), /***/ "./node_modules/core-js-pure/modules/es.global-this.js": /*!*************************************************************!*\ !*** ./node_modules/core-js-pure/modules/es.global-this.js ***! \*************************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js-pure/internals/export.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js-pure/internals/global.js\");\n\n// `globalThis` object\n// https://tc39.es/ecma262/#sec-globalthis\n$({ global: true, forced: global.globalThis !== global }, {\n globalThis: global\n});\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/modules/es.global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/modules/esnext.global-this.js": /*!*****************************************************************!*\ !*** ./node_modules/core-js-pure/modules/esnext.global-this.js ***! \*****************************************************************/ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\n// TODO: Remove from `core-js@4`\n__webpack_require__(/*! ../modules/es.global-this */ \"./node_modules/core-js-pure/modules/es.global-this.js\");\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/modules/esnext.global-this.js?"); /***/ }), /***/ "./node_modules/core-js-pure/stable/global-this.js": /*!*********************************************************!*\ !*** ./node_modules/core-js-pure/stable/global-this.js ***! \*********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; eval("\nvar parent = __webpack_require__(/*! ../es/global-this */ \"./node_modules/core-js-pure/es/global-this.js\");\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://WordPress/./node_modules/core-js-pure/stable/global-this.js?"); /***/ }), /***/ "react-refresh/runtime": /*!**************************************!*\ !*** external "ReactRefreshRuntime" ***! \**************************************/ /***/ ((module) => { "use strict"; module.exports = window["ReactRefreshRuntime"]; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { /******/ if (typeof globalThis === 'object') return globalThis; /******/ try { /******/ return this || new Function('return this')(); /******/ } catch (e) { /******/ if (typeof window === 'object') return window; /******/ } /******/ })(); /******/ })(); /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module can't be inlined because the eval devtool is used. /******/ var __webpack_exports__ = __webpack_require__("./node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js"); /******/ /******/ })() ; block-editor.js 0000644 00012311223 15013651111 0007457 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 197: /***/ (() => { /* (ignored) */ /***/ }), /***/ 271: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Container = __webpack_require__(683) let LazyResult, Processor class Document extends Container { constructor(defaults) { // type needs to be passed to super, otherwise child roots won't be normalized correctly super({ type: 'document', ...defaults }) if (!this.nodes) { this.nodes = [] } } toResult(opts = {}) { let lazy = new LazyResult(new Processor(), this, opts) return lazy.stringify() } } Document.registerLazyResult = dependant => { LazyResult = dependant } Document.registerProcessor = dependant => { Processor = dependant } module.exports = Document Document.default = Document /***/ }), /***/ 346: /***/ ((module) => { "use strict"; const DEFAULT_RAW = { after: '\n', beforeClose: '\n', beforeComment: '\n', beforeDecl: '\n', beforeOpen: ' ', beforeRule: '\n', colon: ': ', commentLeft: ' ', commentRight: ' ', emptyBody: '', indent: ' ', semicolon: false } function capitalize(str) { return str[0].toUpperCase() + str.slice(1) } class Stringifier { constructor(builder) { this.builder = builder } atrule(node, semicolon) { let name = '@' + node.name let params = node.params ? this.rawValue(node, 'params') : '' if (typeof node.raws.afterName !== 'undefined') { name += node.raws.afterName } else if (params) { name += ' ' } if (node.nodes) { this.block(node, name + params) } else { let end = (node.raws.between || '') + (semicolon ? ';' : '') this.builder(name + params + end, node) } } beforeAfter(node, detect) { let value if (node.type === 'decl') { value = this.raw(node, null, 'beforeDecl') } else if (node.type === 'comment') { value = this.raw(node, null, 'beforeComment') } else if (detect === 'before') { value = this.raw(node, null, 'beforeRule') } else { value = this.raw(node, null, 'beforeClose') } let buf = node.parent let depth = 0 while (buf && buf.type !== 'root') { depth += 1 buf = buf.parent } if (value.includes('\n')) { let indent = this.raw(node, null, 'indent') if (indent.length) { for (let step = 0; step < depth; step++) value += indent } } return value } block(node, start) { let between = this.raw(node, 'between', 'beforeOpen') this.builder(start + between + '{', node, 'start') let after if (node.nodes && node.nodes.length) { this.body(node) after = this.raw(node, 'after') } else { after = this.raw(node, 'after', 'emptyBody') } if (after) this.builder(after) this.builder('}', node, 'end') } body(node) { let last = node.nodes.length - 1 while (last > 0) { if (node.nodes[last].type !== 'comment') break last -= 1 } let semicolon = this.raw(node, 'semicolon') for (let i = 0; i < node.nodes.length; i++) { let child = node.nodes[i] let before = this.raw(child, 'before') if (before) this.builder(before) this.stringify(child, last !== i || semicolon) } } comment(node) { let left = this.raw(node, 'left', 'commentLeft') let right = this.raw(node, 'right', 'commentRight') this.builder('/*' + left + node.text + right + '*/', node) } decl(node, semicolon) { let between = this.raw(node, 'between', 'colon') let string = node.prop + between + this.rawValue(node, 'value') if (node.important) { string += node.raws.important || ' !important' } if (semicolon) string += ';' this.builder(string, node) } document(node) { this.body(node) } raw(node, own, detect) { let value if (!detect) detect = own // Already had if (own) { value = node.raws[own] if (typeof value !== 'undefined') return value } let parent = node.parent if (detect === 'before') { // Hack for first rule in CSS if (!parent || (parent.type === 'root' && parent.first === node)) { return '' } // `root` nodes in `document` should use only their own raws if (parent && parent.type === 'document') { return '' } } // Floating child without parent if (!parent) return DEFAULT_RAW[detect] // Detect style by other nodes let root = node.root() if (!root.rawCache) root.rawCache = {} if (typeof root.rawCache[detect] !== 'undefined') { return root.rawCache[detect] } if (detect === 'before' || detect === 'after') { return this.beforeAfter(node, detect) } else { let method = 'raw' + capitalize(detect) if (this[method]) { value = this[method](root, node) } else { root.walk(i => { value = i.raws[own] if (typeof value !== 'undefined') return false }) } } if (typeof value === 'undefined') value = DEFAULT_RAW[detect] root.rawCache[detect] = value return value } rawBeforeClose(root) { let value root.walk(i => { if (i.nodes && i.nodes.length > 0) { if (typeof i.raws.after !== 'undefined') { value = i.raws.after if (value.includes('\n')) { value = value.replace(/[^\n]+$/, '') } return false } } }) if (value) value = value.replace(/\S/g, '') return value } rawBeforeComment(root, node) { let value root.walkComments(i => { if (typeof i.raws.before !== 'undefined') { value = i.raws.before if (value.includes('\n')) { value = value.replace(/[^\n]+$/, '') } return false } }) if (typeof value === 'undefined') { value = this.raw(node, null, 'beforeDecl') } else if (value) { value = value.replace(/\S/g, '') } return value } rawBeforeDecl(root, node) { let value root.walkDecls(i => { if (typeof i.raws.before !== 'undefined') { value = i.raws.before if (value.includes('\n')) { value = value.replace(/[^\n]+$/, '') } return false } }) if (typeof value === 'undefined') { value = this.raw(node, null, 'beforeRule') } else if (value) { value = value.replace(/\S/g, '') } return value } rawBeforeOpen(root) { let value root.walk(i => { if (i.type !== 'decl') { value = i.raws.between if (typeof value !== 'undefined') return false } }) return value } rawBeforeRule(root) { let value root.walk(i => { if (i.nodes && (i.parent !== root || root.first !== i)) { if (typeof i.raws.before !== 'undefined') { value = i.raws.before if (value.includes('\n')) { value = value.replace(/[^\n]+$/, '') } return false } } }) if (value) value = value.replace(/\S/g, '') return value } rawColon(root) { let value root.walkDecls(i => { if (typeof i.raws.between !== 'undefined') { value = i.raws.between.replace(/[^\s:]/g, '') return false } }) return value } rawEmptyBody(root) { let value root.walk(i => { if (i.nodes && i.nodes.length === 0) { value = i.raws.after if (typeof value !== 'undefined') return false } }) return value } rawIndent(root) { if (root.raws.indent) return root.raws.indent let value root.walk(i => { let p = i.parent if (p && p !== root && p.parent && p.parent === root) { if (typeof i.raws.before !== 'undefined') { let parts = i.raws.before.split('\n') value = parts[parts.length - 1] value = value.replace(/\S/g, '') return false } } }) return value } rawSemicolon(root) { let value root.walk(i => { if (i.nodes && i.nodes.length && i.last.type === 'decl') { value = i.raws.semicolon if (typeof value !== 'undefined') return false } }) return value } rawValue(node, prop) { let value = node[prop] let raw = node.raws[prop] if (raw && raw.value === value) { return raw.raw } return value } root(node) { this.body(node) if (node.raws.after) this.builder(node.raws.after) } rule(node) { this.block(node, this.rawValue(node, 'selector')) if (node.raws.ownSemicolon) { this.builder(node.raws.ownSemicolon, node, 'end') } } stringify(node, semicolon) { /* c8 ignore start */ if (!this[node.type]) { throw new Error( 'Unknown AST node type ' + node.type + '. ' + 'Maybe you need to change PostCSS stringifier.' ) } /* c8 ignore stop */ this[node.type](node, semicolon) } } module.exports = Stringifier Stringifier.default = Stringifier /***/ }), /***/ 356: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let pico = __webpack_require__(2775) let terminalHighlight = __webpack_require__(9746) class CssSyntaxError extends Error { constructor(message, line, column, source, file, plugin) { super(message) this.name = 'CssSyntaxError' this.reason = message if (file) { this.file = file } if (source) { this.source = source } if (plugin) { this.plugin = plugin } if (typeof line !== 'undefined' && typeof column !== 'undefined') { if (typeof line === 'number') { this.line = line this.column = column } else { this.line = line.line this.column = line.column this.endLine = column.line this.endColumn = column.column } } this.setMessage() if (Error.captureStackTrace) { Error.captureStackTrace(this, CssSyntaxError) } } setMessage() { this.message = this.plugin ? this.plugin + ': ' : '' this.message += this.file ? this.file : '<css input>' if (typeof this.line !== 'undefined') { this.message += ':' + this.line + ':' + this.column } this.message += ': ' + this.reason } showSourceCode(color) { if (!this.source) return '' let css = this.source if (color == null) color = pico.isColorSupported let aside = text => text let mark = text => text let highlight = text => text if (color) { let { bold, gray, red } = pico.createColors(true) mark = text => bold(red(text)) aside = text => gray(text) if (terminalHighlight) { highlight = text => terminalHighlight(text) } } let lines = css.split(/\r?\n/) let start = Math.max(this.line - 3, 0) let end = Math.min(this.line + 2, lines.length) let maxWidth = String(end).length return lines .slice(start, end) .map((line, index) => { let number = start + 1 + index let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | ' if (number === this.line) { if (line.length > 160) { let padding = 20 let subLineStart = Math.max(0, this.column - padding) let subLineEnd = Math.max( this.column + padding, this.endColumn + padding ) let subLine = line.slice(subLineStart, subLineEnd) let spacing = aside(gutter.replace(/\d/g, ' ')) + line .slice(0, Math.min(this.column - 1, padding - 1)) .replace(/[^\t]/g, ' ') return ( mark('>') + aside(gutter) + highlight(subLine) + '\n ' + spacing + mark('^') ) } let spacing = aside(gutter.replace(/\d/g, ' ')) + line.slice(0, this.column - 1).replace(/[^\t]/g, ' ') return ( mark('>') + aside(gutter) + highlight(line) + '\n ' + spacing + mark('^') ) } return ' ' + aside(gutter) + highlight(line) }) .join('\n') } toString() { let code = this.showSourceCode() if (code) { code = '\n\n' + code + '\n' } return this.name + ': ' + this.message + code } } module.exports = CssSyntaxError CssSyntaxError.default = CssSyntaxError /***/ }), /***/ 448: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Container = __webpack_require__(683) let Document = __webpack_require__(271) let MapGenerator = __webpack_require__(1670) let parse = __webpack_require__(4295) let Result = __webpack_require__(9055) let Root = __webpack_require__(9434) let stringify = __webpack_require__(633) let { isClean, my } = __webpack_require__(1381) let warnOnce = __webpack_require__(3122) const TYPE_TO_CLASS_NAME = { atrule: 'AtRule', comment: 'Comment', decl: 'Declaration', document: 'Document', root: 'Root', rule: 'Rule' } const PLUGIN_PROPS = { AtRule: true, AtRuleExit: true, Comment: true, CommentExit: true, Declaration: true, DeclarationExit: true, Document: true, DocumentExit: true, Once: true, OnceExit: true, postcssPlugin: true, prepare: true, Root: true, RootExit: true, Rule: true, RuleExit: true } const NOT_VISITORS = { Once: true, postcssPlugin: true, prepare: true } const CHILDREN = 0 function isPromise(obj) { return typeof obj === 'object' && typeof obj.then === 'function' } function getEvents(node) { let key = false let type = TYPE_TO_CLASS_NAME[node.type] if (node.type === 'decl') { key = node.prop.toLowerCase() } else if (node.type === 'atrule') { key = node.name.toLowerCase() } if (key && node.append) { return [ type, type + '-' + key, CHILDREN, type + 'Exit', type + 'Exit-' + key ] } else if (key) { return [type, type + '-' + key, type + 'Exit', type + 'Exit-' + key] } else if (node.append) { return [type, CHILDREN, type + 'Exit'] } else { return [type, type + 'Exit'] } } function toStack(node) { let events if (node.type === 'document') { events = ['Document', CHILDREN, 'DocumentExit'] } else if (node.type === 'root') { events = ['Root', CHILDREN, 'RootExit'] } else { events = getEvents(node) } return { eventIndex: 0, events, iterator: 0, node, visitorIndex: 0, visitors: [] } } function cleanMarks(node) { node[isClean] = false if (node.nodes) node.nodes.forEach(i => cleanMarks(i)) return node } let postcss = {} class LazyResult { get content() { return this.stringify().content } get css() { return this.stringify().css } get map() { return this.stringify().map } get messages() { return this.sync().messages } get opts() { return this.result.opts } get processor() { return this.result.processor } get root() { return this.sync().root } get [Symbol.toStringTag]() { return 'LazyResult' } constructor(processor, css, opts) { this.stringified = false this.processed = false let root if ( typeof css === 'object' && css !== null && (css.type === 'root' || css.type === 'document') ) { root = cleanMarks(css) } else if (css instanceof LazyResult || css instanceof Result) { root = cleanMarks(css.root) if (css.map) { if (typeof opts.map === 'undefined') opts.map = {} if (!opts.map.inline) opts.map.inline = false opts.map.prev = css.map } } else { let parser = parse if (opts.syntax) parser = opts.syntax.parse if (opts.parser) parser = opts.parser if (parser.parse) parser = parser.parse try { root = parser(css, opts) } catch (error) { this.processed = true this.error = error } if (root && !root[my]) { /* c8 ignore next 2 */ Container.rebuild(root) } } this.result = new Result(processor, root, opts) this.helpers = { ...postcss, postcss, result: this.result } this.plugins = this.processor.plugins.map(plugin => { if (typeof plugin === 'object' && plugin.prepare) { return { ...plugin, ...plugin.prepare(this.result) } } else { return plugin } }) } async() { if (this.error) return Promise.reject(this.error) if (this.processed) return Promise.resolve(this.result) if (!this.processing) { this.processing = this.runAsync() } return this.processing } catch(onRejected) { return this.async().catch(onRejected) } finally(onFinally) { return this.async().then(onFinally, onFinally) } getAsyncError() { throw new Error('Use process(css).then(cb) to work with async plugins') } handleError(error, node) { let plugin = this.result.lastPlugin try { if (node) node.addToError(error) this.error = error if (error.name === 'CssSyntaxError' && !error.plugin) { error.plugin = plugin.postcssPlugin error.setMessage() } else if (plugin.postcssVersion) { if (false) {} } } catch (err) { /* c8 ignore next 3 */ // eslint-disable-next-line no-console if (console && console.error) console.error(err) } return error } prepareVisitors() { this.listeners = {} let add = (plugin, type, cb) => { if (!this.listeners[type]) this.listeners[type] = [] this.listeners[type].push([plugin, cb]) } for (let plugin of this.plugins) { if (typeof plugin === 'object') { for (let event in plugin) { if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) { throw new Error( `Unknown event ${event} in ${plugin.postcssPlugin}. ` + `Try to update PostCSS (${this.processor.version} now).` ) } if (!NOT_VISITORS[event]) { if (typeof plugin[event] === 'object') { for (let filter in plugin[event]) { if (filter === '*') { add(plugin, event, plugin[event][filter]) } else { add( plugin, event + '-' + filter.toLowerCase(), plugin[event][filter] ) } } } else if (typeof plugin[event] === 'function') { add(plugin, event, plugin[event]) } } } } } this.hasListener = Object.keys(this.listeners).length > 0 } async runAsync() { this.plugin = 0 for (let i = 0; i < this.plugins.length; i++) { let plugin = this.plugins[i] let promise = this.runOnRoot(plugin) if (isPromise(promise)) { try { await promise } catch (error) { throw this.handleError(error) } } } this.prepareVisitors() if (this.hasListener) { let root = this.result.root while (!root[isClean]) { root[isClean] = true let stack = [toStack(root)] while (stack.length > 0) { let promise = this.visitTick(stack) if (isPromise(promise)) { try { await promise } catch (e) { let node = stack[stack.length - 1].node throw this.handleError(e, node) } } } } if (this.listeners.OnceExit) { for (let [plugin, visitor] of this.listeners.OnceExit) { this.result.lastPlugin = plugin try { if (root.type === 'document') { let roots = root.nodes.map(subRoot => visitor(subRoot, this.helpers) ) await Promise.all(roots) } else { await visitor(root, this.helpers) } } catch (e) { throw this.handleError(e) } } } } this.processed = true return this.stringify() } runOnRoot(plugin) { this.result.lastPlugin = plugin try { if (typeof plugin === 'object' && plugin.Once) { if (this.result.root.type === 'document') { let roots = this.result.root.nodes.map(root => plugin.Once(root, this.helpers) ) if (isPromise(roots[0])) { return Promise.all(roots) } return roots } return plugin.Once(this.result.root, this.helpers) } else if (typeof plugin === 'function') { return plugin(this.result.root, this.result) } } catch (error) { throw this.handleError(error) } } stringify() { if (this.error) throw this.error if (this.stringified) return this.result this.stringified = true this.sync() let opts = this.result.opts let str = stringify if (opts.syntax) str = opts.syntax.stringify if (opts.stringifier) str = opts.stringifier if (str.stringify) str = str.stringify let map = new MapGenerator(str, this.result.root, this.result.opts) let data = map.generate() this.result.css = data[0] this.result.map = data[1] return this.result } sync() { if (this.error) throw this.error if (this.processed) return this.result this.processed = true if (this.processing) { throw this.getAsyncError() } for (let plugin of this.plugins) { let promise = this.runOnRoot(plugin) if (isPromise(promise)) { throw this.getAsyncError() } } this.prepareVisitors() if (this.hasListener) { let root = this.result.root while (!root[isClean]) { root[isClean] = true this.walkSync(root) } if (this.listeners.OnceExit) { if (root.type === 'document') { for (let subRoot of root.nodes) { this.visitSync(this.listeners.OnceExit, subRoot) } } else { this.visitSync(this.listeners.OnceExit, root) } } } return this.result } then(onFulfilled, onRejected) { if (false) {} return this.async().then(onFulfilled, onRejected) } toString() { return this.css } visitSync(visitors, node) { for (let [plugin, visitor] of visitors) { this.result.lastPlugin = plugin let promise try { promise = visitor(node, this.helpers) } catch (e) { throw this.handleError(e, node.proxyOf) } if (node.type !== 'root' && node.type !== 'document' && !node.parent) { return true } if (isPromise(promise)) { throw this.getAsyncError() } } } visitTick(stack) { let visit = stack[stack.length - 1] let { node, visitors } = visit if (node.type !== 'root' && node.type !== 'document' && !node.parent) { stack.pop() return } if (visitors.length > 0 && visit.visitorIndex < visitors.length) { let [plugin, visitor] = visitors[visit.visitorIndex] visit.visitorIndex += 1 if (visit.visitorIndex === visitors.length) { visit.visitors = [] visit.visitorIndex = 0 } this.result.lastPlugin = plugin try { return visitor(node.toProxy(), this.helpers) } catch (e) { throw this.handleError(e, node) } } if (visit.iterator !== 0) { let iterator = visit.iterator let child while ((child = node.nodes[node.indexes[iterator]])) { node.indexes[iterator] += 1 if (!child[isClean]) { child[isClean] = true stack.push(toStack(child)) return } } visit.iterator = 0 delete node.indexes[iterator] } let events = visit.events while (visit.eventIndex < events.length) { let event = events[visit.eventIndex] visit.eventIndex += 1 if (event === CHILDREN) { if (node.nodes && node.nodes.length) { node[isClean] = true visit.iterator = node.getIterator() } return } else if (this.listeners[event]) { visit.visitors = this.listeners[event] return } } stack.pop() } walkSync(node) { node[isClean] = true let events = getEvents(node) for (let event of events) { if (event === CHILDREN) { if (node.nodes) { node.each(child => { if (!child[isClean]) this.walkSync(child) }) } } else { let visitors = this.listeners[event] if (visitors) { if (this.visitSync(visitors, node.toProxy())) return } } } } warnings() { return this.sync().warnings() } } LazyResult.registerPostcss = dependant => { postcss = dependant } module.exports = LazyResult LazyResult.default = LazyResult Root.registerLazyResult(LazyResult) Document.registerLazyResult(LazyResult) /***/ }), /***/ 461: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // Load in dependencies var computedStyle = __webpack_require__(6109); /** * Calculate the `line-height` of a given node * @param {HTMLElement} node Element to calculate line height of. Must be in the DOM. * @returns {Number} `line-height` of the element in pixels */ function lineHeight(node) { // Grab the line-height via style var lnHeightStr = computedStyle(node, 'line-height'); var lnHeight = parseFloat(lnHeightStr, 10); // If the lineHeight did not contain a unit (i.e. it was numeric), convert it to ems (e.g. '2.3' === '2.3em') if (lnHeightStr === lnHeight + '') { // Save the old lineHeight style and update the em unit to the element var _lnHeightStyle = node.style.lineHeight; node.style.lineHeight = lnHeightStr + 'em'; // Calculate the em based height lnHeightStr = computedStyle(node, 'line-height'); lnHeight = parseFloat(lnHeightStr, 10); // Revert the lineHeight style if (_lnHeightStyle) { node.style.lineHeight = _lnHeightStyle; } else { delete node.style.lineHeight; } } // If the lineHeight is in `pt`, convert it to pixels (4px for 3pt) // DEV: `em` units are converted to `pt` in IE6 // Conversion ratio from https://developer.mozilla.org/en-US/docs/Web/CSS/length if (lnHeightStr.indexOf('pt') !== -1) { lnHeight *= 4; lnHeight /= 3; // Otherwise, if the lineHeight is in `mm`, convert it to pixels (96px for 25.4mm) } else if (lnHeightStr.indexOf('mm') !== -1) { lnHeight *= 96; lnHeight /= 25.4; // Otherwise, if the lineHeight is in `cm`, convert it to pixels (96px for 2.54cm) } else if (lnHeightStr.indexOf('cm') !== -1) { lnHeight *= 96; lnHeight /= 2.54; // Otherwise, if the lineHeight is in `in`, convert it to pixels (96px for 1in) } else if (lnHeightStr.indexOf('in') !== -1) { lnHeight *= 96; // Otherwise, if the lineHeight is in `pc`, convert it to pixels (12pt for 1pc) } else if (lnHeightStr.indexOf('pc') !== -1) { lnHeight *= 16; } // Continue our computation lnHeight = Math.round(lnHeight); // If the line-height is "normal", calculate by font-size if (lnHeightStr === 'normal') { // Create a temporary node var nodeName = node.nodeName; var _node = document.createElement(nodeName); _node.innerHTML = ' '; // If we have a text area, reset it to only 1 row // https://github.com/twolfson/line-height/issues/4 if (nodeName.toUpperCase() === 'TEXTAREA') { _node.setAttribute('rows', '1'); } // Set the font-size of the element var fontSizeStr = computedStyle(node, 'font-size'); _node.style.fontSize = fontSizeStr; // Remove default padding/border which can affect offset height // https://github.com/twolfson/line-height/issues/4 // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetHeight _node.style.padding = '0px'; _node.style.border = '0px'; // Append it to the body var body = document.body; body.appendChild(_node); // Assume the line height of the element is the height var height = _node.offsetHeight; lnHeight = height; // Remove our child from the DOM body.removeChild(_node); } // Return the calculated height return lnHeight; } // Export lineHeight module.exports = lineHeight; /***/ }), /***/ 628: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = __webpack_require__(4067); function emptyFunction() {} function emptyFunctionWithReset() {} emptyFunctionWithReset.resetWarningCache = emptyFunction; module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret) { // It is still safe when called from React. return; } var err = 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' ); err.name = 'Invariant Violation'; throw err; }; shim.isRequired = shim; function getShim() { return shim; }; // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bigint: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, elementType: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim, checkPropTypes: emptyFunctionWithReset, resetWarningCache: emptyFunction }; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /***/ }), /***/ 633: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Stringifier = __webpack_require__(346) function stringify(node, builder) { let str = new Stringifier(builder) str.stringify(node) } module.exports = stringify stringify.default = stringify /***/ }), /***/ 683: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Comment = __webpack_require__(6589) let Declaration = __webpack_require__(1516) let Node = __webpack_require__(7490) let { isClean, my } = __webpack_require__(1381) let AtRule, parse, Root, Rule function cleanSource(nodes) { return nodes.map(i => { if (i.nodes) i.nodes = cleanSource(i.nodes) delete i.source return i }) } function markTreeDirty(node) { node[isClean] = false if (node.proxyOf.nodes) { for (let i of node.proxyOf.nodes) { markTreeDirty(i) } } } class Container extends Node { get first() { if (!this.proxyOf.nodes) return undefined return this.proxyOf.nodes[0] } get last() { if (!this.proxyOf.nodes) return undefined return this.proxyOf.nodes[this.proxyOf.nodes.length - 1] } append(...children) { for (let child of children) { let nodes = this.normalize(child, this.last) for (let node of nodes) this.proxyOf.nodes.push(node) } this.markDirty() return this } cleanRaws(keepBetween) { super.cleanRaws(keepBetween) if (this.nodes) { for (let node of this.nodes) node.cleanRaws(keepBetween) } } each(callback) { if (!this.proxyOf.nodes) return undefined let iterator = this.getIterator() let index, result while (this.indexes[iterator] < this.proxyOf.nodes.length) { index = this.indexes[iterator] result = callback(this.proxyOf.nodes[index], index) if (result === false) break this.indexes[iterator] += 1 } delete this.indexes[iterator] return result } every(condition) { return this.nodes.every(condition) } getIterator() { if (!this.lastEach) this.lastEach = 0 if (!this.indexes) this.indexes = {} this.lastEach += 1 let iterator = this.lastEach this.indexes[iterator] = 0 return iterator } getProxyProcessor() { return { get(node, prop) { if (prop === 'proxyOf') { return node } else if (!node[prop]) { return node[prop] } else if ( prop === 'each' || (typeof prop === 'string' && prop.startsWith('walk')) ) { return (...args) => { return node[prop]( ...args.map(i => { if (typeof i === 'function') { return (child, index) => i(child.toProxy(), index) } else { return i } }) ) } } else if (prop === 'every' || prop === 'some') { return cb => { return node[prop]((child, ...other) => cb(child.toProxy(), ...other) ) } } else if (prop === 'root') { return () => node.root().toProxy() } else if (prop === 'nodes') { return node.nodes.map(i => i.toProxy()) } else if (prop === 'first' || prop === 'last') { return node[prop].toProxy() } else { return node[prop] } }, set(node, prop, value) { if (node[prop] === value) return true node[prop] = value if (prop === 'name' || prop === 'params' || prop === 'selector') { node.markDirty() } return true } } } index(child) { if (typeof child === 'number') return child if (child.proxyOf) child = child.proxyOf return this.proxyOf.nodes.indexOf(child) } insertAfter(exist, add) { let existIndex = this.index(exist) let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse() existIndex = this.index(exist) for (let node of nodes) this.proxyOf.nodes.splice(existIndex + 1, 0, node) let index for (let id in this.indexes) { index = this.indexes[id] if (existIndex < index) { this.indexes[id] = index + nodes.length } } this.markDirty() return this } insertBefore(exist, add) { let existIndex = this.index(exist) let type = existIndex === 0 ? 'prepend' : false let nodes = this.normalize( add, this.proxyOf.nodes[existIndex], type ).reverse() existIndex = this.index(exist) for (let node of nodes) this.proxyOf.nodes.splice(existIndex, 0, node) let index for (let id in this.indexes) { index = this.indexes[id] if (existIndex <= index) { this.indexes[id] = index + nodes.length } } this.markDirty() return this } normalize(nodes, sample) { if (typeof nodes === 'string') { nodes = cleanSource(parse(nodes).nodes) } else if (typeof nodes === 'undefined') { nodes = [] } else if (Array.isArray(nodes)) { nodes = nodes.slice(0) for (let i of nodes) { if (i.parent) i.parent.removeChild(i, 'ignore') } } else if (nodes.type === 'root' && this.type !== 'document') { nodes = nodes.nodes.slice(0) for (let i of nodes) { if (i.parent) i.parent.removeChild(i, 'ignore') } } else if (nodes.type) { nodes = [nodes] } else if (nodes.prop) { if (typeof nodes.value === 'undefined') { throw new Error('Value field is missed in node creation') } else if (typeof nodes.value !== 'string') { nodes.value = String(nodes.value) } nodes = [new Declaration(nodes)] } else if (nodes.selector || nodes.selectors) { nodes = [new Rule(nodes)] } else if (nodes.name) { nodes = [new AtRule(nodes)] } else if (nodes.text) { nodes = [new Comment(nodes)] } else { throw new Error('Unknown node type in node creation') } let processed = nodes.map(i => { /* c8 ignore next */ if (!i[my]) Container.rebuild(i) i = i.proxyOf if (i.parent) i.parent.removeChild(i) if (i[isClean]) markTreeDirty(i) if (!i.raws) i.raws = {} if (typeof i.raws.before === 'undefined') { if (sample && typeof sample.raws.before !== 'undefined') { i.raws.before = sample.raws.before.replace(/\S/g, '') } } i.parent = this.proxyOf return i }) return processed } prepend(...children) { children = children.reverse() for (let child of children) { let nodes = this.normalize(child, this.first, 'prepend').reverse() for (let node of nodes) this.proxyOf.nodes.unshift(node) for (let id in this.indexes) { this.indexes[id] = this.indexes[id] + nodes.length } } this.markDirty() return this } push(child) { child.parent = this this.proxyOf.nodes.push(child) return this } removeAll() { for (let node of this.proxyOf.nodes) node.parent = undefined this.proxyOf.nodes = [] this.markDirty() return this } removeChild(child) { child = this.index(child) this.proxyOf.nodes[child].parent = undefined this.proxyOf.nodes.splice(child, 1) let index for (let id in this.indexes) { index = this.indexes[id] if (index >= child) { this.indexes[id] = index - 1 } } this.markDirty() return this } replaceValues(pattern, opts, callback) { if (!callback) { callback = opts opts = {} } this.walkDecls(decl => { if (opts.props && !opts.props.includes(decl.prop)) return if (opts.fast && !decl.value.includes(opts.fast)) return decl.value = decl.value.replace(pattern, callback) }) this.markDirty() return this } some(condition) { return this.nodes.some(condition) } walk(callback) { return this.each((child, i) => { let result try { result = callback(child, i) } catch (e) { throw child.addToError(e) } if (result !== false && child.walk) { result = child.walk(callback) } return result }) } walkAtRules(name, callback) { if (!callback) { callback = name return this.walk((child, i) => { if (child.type === 'atrule') { return callback(child, i) } }) } if (name instanceof RegExp) { return this.walk((child, i) => { if (child.type === 'atrule' && name.test(child.name)) { return callback(child, i) } }) } return this.walk((child, i) => { if (child.type === 'atrule' && child.name === name) { return callback(child, i) } }) } walkComments(callback) { return this.walk((child, i) => { if (child.type === 'comment') { return callback(child, i) } }) } walkDecls(prop, callback) { if (!callback) { callback = prop return this.walk((child, i) => { if (child.type === 'decl') { return callback(child, i) } }) } if (prop instanceof RegExp) { return this.walk((child, i) => { if (child.type === 'decl' && prop.test(child.prop)) { return callback(child, i) } }) } return this.walk((child, i) => { if (child.type === 'decl' && child.prop === prop) { return callback(child, i) } }) } walkRules(selector, callback) { if (!callback) { callback = selector return this.walk((child, i) => { if (child.type === 'rule') { return callback(child, i) } }) } if (selector instanceof RegExp) { return this.walk((child, i) => { if (child.type === 'rule' && selector.test(child.selector)) { return callback(child, i) } }) } return this.walk((child, i) => { if (child.type === 'rule' && child.selector === selector) { return callback(child, i) } }) } } Container.registerParse = dependant => { parse = dependant } Container.registerRule = dependant => { Rule = dependant } Container.registerAtRule = dependant => { AtRule = dependant } Container.registerRoot = dependant => { Root = dependant } module.exports = Container Container.default = Container /* c8 ignore start */ Container.rebuild = node => { if (node.type === 'atrule') { Object.setPrototypeOf(node, AtRule.prototype) } else if (node.type === 'rule') { Object.setPrototypeOf(node, Rule.prototype) } else if (node.type === 'decl') { Object.setPrototypeOf(node, Declaration.prototype) } else if (node.type === 'comment') { Object.setPrototypeOf(node, Comment.prototype) } else if (node.type === 'root') { Object.setPrototypeOf(node, Root.prototype) } node[my] = true if (node.nodes) { node.nodes.forEach(child => { Container.rebuild(child) }) } } /* c8 ignore stop */ /***/ }), /***/ 1087: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Copyright 2013-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule isEventSupported */ var ExecutionEnvironment = __webpack_require__(8202); var useHasFeature; if (ExecutionEnvironment.canUseDOM) { useHasFeature = document.implementation && document.implementation.hasFeature && // always returns true in newer browsers as per the standard. // @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature document.implementation.hasFeature('', '') !== true; } /** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, * `reset`, `load`, `error`, and `select`. * * Borrows from Modernizr. * * @param {string} eventNameSuffix Event name, e.g. "click". * @param {?boolean} capture Check if the capture phase is supported. * @return {boolean} True if the event is supported. * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT */ function isEventSupported(eventNameSuffix, capture) { if (!ExecutionEnvironment.canUseDOM || capture && !('addEventListener' in document)) { return false; } var eventName = 'on' + eventNameSuffix; var isSupported = eventName in document; if (!isSupported) { var element = document.createElement('div'); element.setAttribute(eventName, 'return;'); isSupported = typeof element[eventName] === 'function'; } if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') { // This is the only way to test support for the `wheel` event in IE9+. isSupported = document.implementation.hasFeature('Events.wheel', '3.0'); } return isSupported; } module.exports = isEventSupported; /***/ }), /***/ 1326: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Container = __webpack_require__(683) class AtRule extends Container { constructor(defaults) { super(defaults) this.type = 'atrule' } append(...children) { if (!this.proxyOf.nodes) this.nodes = [] return super.append(...children) } prepend(...children) { if (!this.proxyOf.nodes) this.nodes = [] return super.prepend(...children) } } module.exports = AtRule AtRule.default = AtRule Container.registerAtRule(AtRule) /***/ }), /***/ 1381: /***/ ((module) => { "use strict"; module.exports.isClean = Symbol('isClean') module.exports.my = Symbol('my') /***/ }), /***/ 1443: /***/ ((module) => { module.exports = function postcssPrefixSelector(options) { const prefix = options.prefix; const prefixWithSpace = /\s+$/.test(prefix) ? prefix : `${prefix} `; const ignoreFiles = options.ignoreFiles ? [].concat(options.ignoreFiles) : []; const includeFiles = options.includeFiles ? [].concat(options.includeFiles) : []; return function (root) { if ( ignoreFiles.length && root.source.input.file && isFileInArray(root.source.input.file, ignoreFiles) ) { return; } if ( includeFiles.length && root.source.input.file && !isFileInArray(root.source.input.file, includeFiles) ) { return; } root.walkRules((rule) => { const keyframeRules = [ 'keyframes', '-webkit-keyframes', '-moz-keyframes', '-o-keyframes', '-ms-keyframes', ]; if (rule.parent && keyframeRules.includes(rule.parent.name)) { return; } rule.selectors = rule.selectors.map((selector) => { if (options.exclude && excludeSelector(selector, options.exclude)) { return selector; } if (options.transform) { return options.transform( prefix, selector, prefixWithSpace + selector, root.source.input.file, rule ); } return prefixWithSpace + selector; }); }); }; }; function isFileInArray(file, arr) { return arr.some((ruleOrString) => { if (ruleOrString instanceof RegExp) { return ruleOrString.test(file); } return file.includes(ruleOrString); }); } function excludeSelector(selector, excludeArr) { return excludeArr.some((excludeRule) => { if (excludeRule instanceof RegExp) { return excludeRule.test(selector); } return selector === excludeRule; }); } /***/ }), /***/ 1516: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Node = __webpack_require__(7490) class Declaration extends Node { get variable() { return this.prop.startsWith('--') || this.prop[0] === '$' } constructor(defaults) { if ( defaults && typeof defaults.value !== 'undefined' && typeof defaults.value !== 'string' ) { defaults = { ...defaults, value: String(defaults.value) } } super(defaults) this.type = 'decl' } } module.exports = Declaration Declaration.default = Declaration /***/ }), /***/ 1524: /***/ ((module) => { var minus = "-".charCodeAt(0); var plus = "+".charCodeAt(0); var dot = ".".charCodeAt(0); var exp = "e".charCodeAt(0); var EXP = "E".charCodeAt(0); // Check if three code points would start a number // https://www.w3.org/TR/css-syntax-3/#starts-with-a-number function likeNumber(value) { var code = value.charCodeAt(0); var nextCode; if (code === plus || code === minus) { nextCode = value.charCodeAt(1); if (nextCode >= 48 && nextCode <= 57) { return true; } var nextNextCode = value.charCodeAt(2); if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) { return true; } return false; } if (code === dot) { nextCode = value.charCodeAt(1); if (nextCode >= 48 && nextCode <= 57) { return true; } return false; } if (code >= 48 && code <= 57) { return true; } return false; } // Consume a number // https://www.w3.org/TR/css-syntax-3/#consume-number module.exports = function(value) { var pos = 0; var length = value.length; var code; var nextCode; var nextNextCode; if (length === 0 || !likeNumber(value)) { return false; } code = value.charCodeAt(pos); if (code === plus || code === minus) { pos++; } while (pos < length) { code = value.charCodeAt(pos); if (code < 48 || code > 57) { break; } pos += 1; } code = value.charCodeAt(pos); nextCode = value.charCodeAt(pos + 1); if (code === dot && nextCode >= 48 && nextCode <= 57) { pos += 2; while (pos < length) { code = value.charCodeAt(pos); if (code < 48 || code > 57) { break; } pos += 1; } } code = value.charCodeAt(pos); nextCode = value.charCodeAt(pos + 1); nextNextCode = value.charCodeAt(pos + 2); if ( (code === exp || code === EXP) && ((nextCode >= 48 && nextCode <= 57) || ((nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) ) { pos += nextCode === plus || nextCode === minus ? 3 : 2; while (pos < length) { code = value.charCodeAt(pos); if (code < 48 || code > 57) { break; } pos += 1; } } return { number: value.slice(0, pos), unit: value.slice(pos) }; }; /***/ }), /***/ 1544: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var parse = __webpack_require__(8491); var walk = __webpack_require__(3815); var stringify = __webpack_require__(4725); function ValueParser(value) { if (this instanceof ValueParser) { this.nodes = parse(value); return this; } return new ValueParser(value); } ValueParser.prototype.toString = function() { return Array.isArray(this.nodes) ? stringify(this.nodes) : ""; }; ValueParser.prototype.walk = function(cb, bubble) { walk(this.nodes, cb, bubble); return this; }; ValueParser.unit = __webpack_require__(1524); ValueParser.walk = walk; ValueParser.stringify = stringify; module.exports = ValueParser; /***/ }), /***/ 1609: /***/ ((module) => { "use strict"; module.exports = window["React"]; /***/ }), /***/ 1670: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let { dirname, relative, resolve, sep } = __webpack_require__(197) let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(1866) let { pathToFileURL } = __webpack_require__(2739) let Input = __webpack_require__(5380) let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) let pathAvailable = Boolean(dirname && resolve && relative && sep) class MapGenerator { constructor(stringify, root, opts, cssString) { this.stringify = stringify this.mapOpts = opts.map || {} this.root = root this.opts = opts this.css = cssString this.originalCSS = cssString this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute this.memoizedFileURLs = new Map() this.memoizedPaths = new Map() this.memoizedURLs = new Map() } addAnnotation() { let content if (this.isInline()) { content = 'data:application/json;base64,' + this.toBase64(this.map.toString()) } else if (typeof this.mapOpts.annotation === 'string') { content = this.mapOpts.annotation } else if (typeof this.mapOpts.annotation === 'function') { content = this.mapOpts.annotation(this.opts.to, this.root) } else { content = this.outputFile() + '.map' } let eol = '\n' if (this.css.includes('\r\n')) eol = '\r\n' this.css += eol + '/*# sourceMappingURL=' + content + ' */' } applyPrevMaps() { for (let prev of this.previous()) { let from = this.toUrl(this.path(prev.file)) let root = prev.root || dirname(prev.file) let map if (this.mapOpts.sourcesContent === false) { map = new SourceMapConsumer(prev.text) if (map.sourcesContent) { map.sourcesContent = null } } else { map = prev.consumer() } this.map.applySourceMap(map, from, this.toUrl(this.path(root))) } } clearAnnotation() { if (this.mapOpts.annotation === false) return if (this.root) { let node for (let i = this.root.nodes.length - 1; i >= 0; i--) { node = this.root.nodes[i] if (node.type !== 'comment') continue if (node.text.startsWith('# sourceMappingURL=')) { this.root.removeChild(i) } } } else if (this.css) { this.css = this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm, '') } } generate() { this.clearAnnotation() if (pathAvailable && sourceMapAvailable && this.isMap()) { return this.generateMap() } else { let result = '' this.stringify(this.root, i => { result += i }) return [result] } } generateMap() { if (this.root) { this.generateString() } else if (this.previous().length === 1) { let prev = this.previous()[0].consumer() prev.file = this.outputFile() this.map = SourceMapGenerator.fromSourceMap(prev, { ignoreInvalidMapping: true }) } else { this.map = new SourceMapGenerator({ file: this.outputFile(), ignoreInvalidMapping: true }) this.map.addMapping({ generated: { column: 0, line: 1 }, original: { column: 0, line: 1 }, source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : '<no source>' }) } if (this.isSourcesContent()) this.setSourcesContent() if (this.root && this.previous().length > 0) this.applyPrevMaps() if (this.isAnnotation()) this.addAnnotation() if (this.isInline()) { return [this.css] } else { return [this.css, this.map] } } generateString() { this.css = '' this.map = new SourceMapGenerator({ file: this.outputFile(), ignoreInvalidMapping: true }) let line = 1 let column = 1 let noSource = '<no source>' let mapping = { generated: { column: 0, line: 0 }, original: { column: 0, line: 0 }, source: '' } let last, lines this.stringify(this.root, (str, node, type) => { this.css += str if (node && type !== 'end') { mapping.generated.line = line mapping.generated.column = column - 1 if (node.source && node.source.start) { mapping.source = this.sourcePath(node) mapping.original.line = node.source.start.line mapping.original.column = node.source.start.column - 1 this.map.addMapping(mapping) } else { mapping.source = noSource mapping.original.line = 1 mapping.original.column = 0 this.map.addMapping(mapping) } } lines = str.match(/\n/g) if (lines) { line += lines.length last = str.lastIndexOf('\n') column = str.length - last } else { column += str.length } if (node && type !== 'start') { let p = node.parent || { raws: {} } let childless = node.type === 'decl' || (node.type === 'atrule' && !node.nodes) if (!childless || node !== p.last || p.raws.semicolon) { if (node.source && node.source.end) { mapping.source = this.sourcePath(node) mapping.original.line = node.source.end.line mapping.original.column = node.source.end.column - 1 mapping.generated.line = line mapping.generated.column = column - 2 this.map.addMapping(mapping) } else { mapping.source = noSource mapping.original.line = 1 mapping.original.column = 0 mapping.generated.line = line mapping.generated.column = column - 1 this.map.addMapping(mapping) } } } }) } isAnnotation() { if (this.isInline()) { return true } if (typeof this.mapOpts.annotation !== 'undefined') { return this.mapOpts.annotation } if (this.previous().length) { return this.previous().some(i => i.annotation) } return true } isInline() { if (typeof this.mapOpts.inline !== 'undefined') { return this.mapOpts.inline } let annotation = this.mapOpts.annotation if (typeof annotation !== 'undefined' && annotation !== true) { return false } if (this.previous().length) { return this.previous().some(i => i.inline) } return true } isMap() { if (typeof this.opts.map !== 'undefined') { return !!this.opts.map } return this.previous().length > 0 } isSourcesContent() { if (typeof this.mapOpts.sourcesContent !== 'undefined') { return this.mapOpts.sourcesContent } if (this.previous().length) { return this.previous().some(i => i.withContent()) } return true } outputFile() { if (this.opts.to) { return this.path(this.opts.to) } else if (this.opts.from) { return this.path(this.opts.from) } else { return 'to.css' } } path(file) { if (this.mapOpts.absolute) return file if (file.charCodeAt(0) === 60 /* `<` */) return file if (/^\w+:\/\//.test(file)) return file let cached = this.memoizedPaths.get(file) if (cached) return cached let from = this.opts.to ? dirname(this.opts.to) : '.' if (typeof this.mapOpts.annotation === 'string') { from = dirname(resolve(from, this.mapOpts.annotation)) } let path = relative(from, file) this.memoizedPaths.set(file, path) return path } previous() { if (!this.previousMaps) { this.previousMaps = [] if (this.root) { this.root.walk(node => { if (node.source && node.source.input.map) { let map = node.source.input.map if (!this.previousMaps.includes(map)) { this.previousMaps.push(map) } } }) } else { let input = new Input(this.originalCSS, this.opts) if (input.map) this.previousMaps.push(input.map) } } return this.previousMaps } setSourcesContent() { let already = {} if (this.root) { this.root.walk(node => { if (node.source) { let from = node.source.input.from if (from && !already[from]) { already[from] = true let fromUrl = this.usesFileUrls ? this.toFileUrl(from) : this.toUrl(this.path(from)) this.map.setSourceContent(fromUrl, node.source.input.css) } } }) } else if (this.css) { let from = this.opts.from ? this.toUrl(this.path(this.opts.from)) : '<no source>' this.map.setSourceContent(from, this.css) } } sourcePath(node) { if (this.mapOpts.from) { return this.toUrl(this.mapOpts.from) } else if (this.usesFileUrls) { return this.toFileUrl(node.source.input.from) } else { return this.toUrl(this.path(node.source.input.from)) } } toBase64(str) { if (Buffer) { return Buffer.from(str).toString('base64') } else { return window.btoa(unescape(encodeURIComponent(str))) } } toFileUrl(path) { let cached = this.memoizedFileURLs.get(path) if (cached) return cached if (pathToFileURL) { let fileURL = pathToFileURL(path).toString() this.memoizedFileURLs.set(path, fileURL) return fileURL } else { throw new Error( '`map.absolute` option is not available in this PostCSS build' ) } } toUrl(path) { let cached = this.memoizedURLs.get(path) if (cached) return cached if (sep === '\\') { path = path.replace(/\\/g, '/') } let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent) this.memoizedURLs.set(path, url) return url } } module.exports = MapGenerator /***/ }), /***/ 1866: /***/ (() => { /* (ignored) */ /***/ }), /***/ 2213: /***/ ((module) => { /** * Copyright 2004-present Facebook. All Rights Reserved. * * @providesModule UserAgent_DEPRECATED */ /** * Provides entirely client-side User Agent and OS detection. You should prefer * the non-deprecated UserAgent module when possible, which exposes our * authoritative server-side PHP-based detection to the client. * * Usage is straightforward: * * if (UserAgent_DEPRECATED.ie()) { * // IE * } * * You can also do version checks: * * if (UserAgent_DEPRECATED.ie() >= 7) { * // IE7 or better * } * * The browser functions will return NaN if the browser does not match, so * you can also do version compares the other way: * * if (UserAgent_DEPRECATED.ie() < 7) { * // IE6 or worse * } * * Note that the version is a float and may include a minor version number, * so you should always use range operators to perform comparisons, not * strict equality. * * **Note:** You should **strongly** prefer capability detection to browser * version detection where it's reasonable: * * http://www.quirksmode.org/js/support.html * * Further, we have a large number of mature wrapper functions and classes * which abstract away many browser irregularities. Check the documentation, * grep for things, or ask on javascript@lists.facebook.com before writing yet * another copy of "event || window.event". * */ var _populated = false; // Browsers var _ie, _firefox, _opera, _webkit, _chrome; // Actual IE browser for compatibility mode var _ie_real_version; // Platforms var _osx, _windows, _linux, _android; // Architectures var _win64; // Devices var _iphone, _ipad, _native; var _mobile; function _populate() { if (_populated) { return; } _populated = true; // To work around buggy JS libraries that can't handle multi-digit // version numbers, Opera 10's user agent string claims it's Opera // 9, then later includes a Version/X.Y field: // // Opera/9.80 (foo) Presto/2.2.15 Version/10.10 var uas = navigator.userAgent; var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas); var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas); _iphone = /\b(iPhone|iP[ao]d)/.exec(uas); _ipad = /\b(iP[ao]d)/.exec(uas); _android = /Android/i.exec(uas); _native = /FBAN\/\w+;/i.exec(uas); _mobile = /Mobile/i.exec(uas); // Note that the IE team blog would have you believe you should be checking // for 'Win64; x64'. But MSDN then reveals that you can actually be coming // from either x64 or ia64; so ultimately, you should just check for Win64 // as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit // Windows will send 'WOW64' instead. _win64 = !!(/Win64/.exec(uas)); if (agent) { _ie = agent[1] ? parseFloat(agent[1]) : ( agent[5] ? parseFloat(agent[5]) : NaN); // IE compatibility mode if (_ie && document && document.documentMode) { _ie = document.documentMode; } // grab the "true" ie version from the trident token if available var trident = /(?:Trident\/(\d+.\d+))/.exec(uas); _ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie; _firefox = agent[2] ? parseFloat(agent[2]) : NaN; _opera = agent[3] ? parseFloat(agent[3]) : NaN; _webkit = agent[4] ? parseFloat(agent[4]) : NaN; if (_webkit) { // We do not add the regexp to the above test, because it will always // match 'safari' only since 'AppleWebKit' appears before 'Chrome' in // the userAgent string. agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas); _chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN; } else { _chrome = NaN; } } else { _ie = _firefox = _opera = _chrome = _webkit = NaN; } if (os) { if (os[1]) { // Detect OS X version. If no version number matches, set _osx to true. // Version examples: 10, 10_6_1, 10.7 // Parses version number as a float, taking only first two sets of // digits. If only one set of digits is found, returns just the major // version number. var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas); _osx = ver ? parseFloat(ver[1].replace('_', '.')) : true; } else { _osx = false; } _windows = !!os[2]; _linux = !!os[3]; } else { _osx = _windows = _linux = false; } } var UserAgent_DEPRECATED = { /** * Check if the UA is Internet Explorer. * * * @return float|NaN Version number (if match) or NaN. */ ie: function() { return _populate() || _ie; }, /** * Check if we're in Internet Explorer compatibility mode. * * @return bool true if in compatibility mode, false if * not compatibility mode or not ie */ ieCompatibilityMode: function() { return _populate() || (_ie_real_version > _ie); }, /** * Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we * only need this because Skype can't handle 64-bit IE yet. We need to remove * this when we don't need it -- tracked by #601957. */ ie64: function() { return UserAgent_DEPRECATED.ie() && _win64; }, /** * Check if the UA is Firefox. * * * @return float|NaN Version number (if match) or NaN. */ firefox: function() { return _populate() || _firefox; }, /** * Check if the UA is Opera. * * * @return float|NaN Version number (if match) or NaN. */ opera: function() { return _populate() || _opera; }, /** * Check if the UA is WebKit. * * * @return float|NaN Version number (if match) or NaN. */ webkit: function() { return _populate() || _webkit; }, /** * For Push * WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit */ safari: function() { return UserAgent_DEPRECATED.webkit(); }, /** * Check if the UA is a Chrome browser. * * * @return float|NaN Version number (if match) or NaN. */ chrome : function() { return _populate() || _chrome; }, /** * Check if the user is running Windows. * * @return bool `true' if the user's OS is Windows. */ windows: function() { return _populate() || _windows; }, /** * Check if the user is running Mac OS X. * * @return float|bool Returns a float if a version number is detected, * otherwise true/false. */ osx: function() { return _populate() || _osx; }, /** * Check if the user is running Linux. * * @return bool `true' if the user's OS is some flavor of Linux. */ linux: function() { return _populate() || _linux; }, /** * Check if the user is running on an iPhone or iPod platform. * * @return bool `true' if the user is running some flavor of the * iPhone OS. */ iphone: function() { return _populate() || _iphone; }, mobile: function() { return _populate() || (_iphone || _ipad || _android || _mobile); }, nativeApp: function() { // webviews inside of the native apps return _populate() || _native; }, android: function() { return _populate() || _android; }, ipad: function() { return _populate() || _ipad; } }; module.exports = UserAgent_DEPRECATED; /***/ }), /***/ 2327: /***/ ((module) => { "use strict"; const SINGLE_QUOTE = "'".charCodeAt(0) const DOUBLE_QUOTE = '"'.charCodeAt(0) const BACKSLASH = '\\'.charCodeAt(0) const SLASH = '/'.charCodeAt(0) const NEWLINE = '\n'.charCodeAt(0) const SPACE = ' '.charCodeAt(0) const FEED = '\f'.charCodeAt(0) const TAB = '\t'.charCodeAt(0) const CR = '\r'.charCodeAt(0) const OPEN_SQUARE = '['.charCodeAt(0) const CLOSE_SQUARE = ']'.charCodeAt(0) const OPEN_PARENTHESES = '('.charCodeAt(0) const CLOSE_PARENTHESES = ')'.charCodeAt(0) const OPEN_CURLY = '{'.charCodeAt(0) const CLOSE_CURLY = '}'.charCodeAt(0) const SEMICOLON = ';'.charCodeAt(0) const ASTERISK = '*'.charCodeAt(0) const COLON = ':'.charCodeAt(0) const AT = '@'.charCodeAt(0) const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g const RE_BAD_BRACKET = /.[\r\n"'(/\\]/ const RE_HEX_ESCAPE = /[\da-f]/i module.exports = function tokenizer(input, options = {}) { let css = input.css.valueOf() let ignore = options.ignoreErrors let code, content, escape, next, quote let currentToken, escaped, escapePos, n, prev let length = css.length let pos = 0 let buffer = [] let returned = [] function position() { return pos } function unclosed(what) { throw input.error('Unclosed ' + what, pos) } function endOfFile() { return returned.length === 0 && pos >= length } function nextToken(opts) { if (returned.length) return returned.pop() if (pos >= length) return let ignoreUnclosed = opts ? opts.ignoreUnclosed : false code = css.charCodeAt(pos) switch (code) { case NEWLINE: case SPACE: case TAB: case CR: case FEED: { next = pos do { next += 1 code = css.charCodeAt(next) } while ( code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED ) currentToken = ['space', css.slice(pos, next)] pos = next - 1 break } case OPEN_SQUARE: case CLOSE_SQUARE: case OPEN_CURLY: case CLOSE_CURLY: case COLON: case SEMICOLON: case CLOSE_PARENTHESES: { let controlChar = String.fromCharCode(code) currentToken = [controlChar, controlChar, pos] break } case OPEN_PARENTHESES: { prev = buffer.length ? buffer.pop()[1] : '' n = css.charCodeAt(pos + 1) if ( prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR ) { next = pos do { escaped = false next = css.indexOf(')', next + 1) if (next === -1) { if (ignore || ignoreUnclosed) { next = pos break } else { unclosed('bracket') } } escapePos = next while (css.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1 escaped = !escaped } } while (escaped) currentToken = ['brackets', css.slice(pos, next + 1), pos, next] pos = next } else { next = css.indexOf(')', pos + 1) content = css.slice(pos, next + 1) if (next === -1 || RE_BAD_BRACKET.test(content)) { currentToken = ['(', '(', pos] } else { currentToken = ['brackets', content, pos, next] pos = next } } break } case SINGLE_QUOTE: case DOUBLE_QUOTE: { quote = code === SINGLE_QUOTE ? "'" : '"' next = pos do { escaped = false next = css.indexOf(quote, next + 1) if (next === -1) { if (ignore || ignoreUnclosed) { next = pos + 1 break } else { unclosed('string') } } escapePos = next while (css.charCodeAt(escapePos - 1) === BACKSLASH) { escapePos -= 1 escaped = !escaped } } while (escaped) currentToken = ['string', css.slice(pos, next + 1), pos, next] pos = next break } case AT: { RE_AT_END.lastIndex = pos + 1 RE_AT_END.test(css) if (RE_AT_END.lastIndex === 0) { next = css.length - 1 } else { next = RE_AT_END.lastIndex - 2 } currentToken = ['at-word', css.slice(pos, next + 1), pos, next] pos = next break } case BACKSLASH: { next = pos escape = true while (css.charCodeAt(next + 1) === BACKSLASH) { next += 1 escape = !escape } code = css.charCodeAt(next + 1) if ( escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED ) { next += 1 if (RE_HEX_ESCAPE.test(css.charAt(next))) { while (RE_HEX_ESCAPE.test(css.charAt(next + 1))) { next += 1 } if (css.charCodeAt(next + 1) === SPACE) { next += 1 } } } currentToken = ['word', css.slice(pos, next + 1), pos, next] pos = next break } default: { if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) { next = css.indexOf('*/', pos + 2) + 1 if (next === 0) { if (ignore || ignoreUnclosed) { next = css.length } else { unclosed('comment') } } currentToken = ['comment', css.slice(pos, next + 1), pos, next] pos = next } else { RE_WORD_END.lastIndex = pos + 1 RE_WORD_END.test(css) if (RE_WORD_END.lastIndex === 0) { next = css.length - 1 } else { next = RE_WORD_END.lastIndex - 2 } currentToken = ['word', css.slice(pos, next + 1), pos, next] buffer.push(currentToken) pos = next } break } } pos++ return currentToken } function back(token) { returned.push(token) } return { back, endOfFile, nextToken, position } } /***/ }), /***/ 2739: /***/ (() => { /* (ignored) */ /***/ }), /***/ 2775: /***/ ((module) => { var x=String; var create=function() {return {isColorSupported:false,reset:x,bold:x,dim:x,italic:x,underline:x,inverse:x,hidden:x,strikethrough:x,black:x,red:x,green:x,yellow:x,blue:x,magenta:x,cyan:x,white:x,gray:x,bgBlack:x,bgRed:x,bgGreen:x,bgYellow:x,bgBlue:x,bgMagenta:x,bgCyan:x,bgWhite:x,blackBright:x,redBright:x,greenBright:x,yellowBright:x,blueBright:x,magentaBright:x,cyanBright:x,whiteBright:x,bgBlackBright:x,bgRedBright:x,bgGreenBright:x,bgYellowBright:x,bgBlueBright:x,bgMagentaBright:x,bgCyanBright:x,bgWhiteBright:x}}; module.exports=create(); module.exports.createColors = create; /***/ }), /***/ 3122: /***/ ((module) => { "use strict"; /* eslint-disable no-console */ let printed = {} module.exports = function warnOnce(message) { if (printed[message]) return printed[message] = true if (typeof console !== 'undefined' && console.warn) { console.warn(message) } } /***/ }), /***/ 3815: /***/ ((module) => { module.exports = function walk(nodes, cb, bubble) { var i, max, node, result; for (i = 0, max = nodes.length; i < max; i += 1) { node = nodes[i]; if (!bubble) { result = cb(node, i, nodes); } if ( result !== false && node.type === "function" && Array.isArray(node.nodes) ) { walk(node.nodes, cb, bubble); } if (bubble) { cb(node, i, nodes); } } }; /***/ }), /***/ 3937: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let AtRule = __webpack_require__(1326) let Comment = __webpack_require__(6589) let Declaration = __webpack_require__(1516) let Root = __webpack_require__(9434) let Rule = __webpack_require__(4092) let tokenizer = __webpack_require__(2327) const SAFE_COMMENT_NEIGHBOR = { empty: true, space: true } function findLastWithPosition(tokens) { for (let i = tokens.length - 1; i >= 0; i--) { let token = tokens[i] let pos = token[3] || token[2] if (pos) return pos } } class Parser { constructor(input) { this.input = input this.root = new Root() this.current = this.root this.spaces = '' this.semicolon = false this.createTokenizer() this.root.source = { input, start: { column: 1, line: 1, offset: 0 } } } atrule(token) { let node = new AtRule() node.name = token[1].slice(1) if (node.name === '') { this.unnamedAtrule(node, token) } this.init(node, token[2]) let type let prev let shift let last = false let open = false let params = [] let brackets = [] while (!this.tokenizer.endOfFile()) { token = this.tokenizer.nextToken() type = token[0] if (type === '(' || type === '[') { brackets.push(type === '(' ? ')' : ']') } else if (type === '{' && brackets.length > 0) { brackets.push('}') } else if (type === brackets[brackets.length - 1]) { brackets.pop() } if (brackets.length === 0) { if (type === ';') { node.source.end = this.getPosition(token[2]) node.source.end.offset++ this.semicolon = true break } else if (type === '{') { open = true break } else if (type === '}') { if (params.length > 0) { shift = params.length - 1 prev = params[shift] while (prev && prev[0] === 'space') { prev = params[--shift] } if (prev) { node.source.end = this.getPosition(prev[3] || prev[2]) node.source.end.offset++ } } this.end(token) break } else { params.push(token) } } else { params.push(token) } if (this.tokenizer.endOfFile()) { last = true break } } node.raws.between = this.spacesAndCommentsFromEnd(params) if (params.length) { node.raws.afterName = this.spacesAndCommentsFromStart(params) this.raw(node, 'params', params) if (last) { token = params[params.length - 1] node.source.end = this.getPosition(token[3] || token[2]) node.source.end.offset++ this.spaces = node.raws.between node.raws.between = '' } } else { node.raws.afterName = '' node.params = '' } if (open) { node.nodes = [] this.current = node } } checkMissedSemicolon(tokens) { let colon = this.colon(tokens) if (colon === false) return let founded = 0 let token for (let j = colon - 1; j >= 0; j--) { token = tokens[j] if (token[0] !== 'space') { founded += 1 if (founded === 2) break } } // If the token is a word, e.g. `!important`, `red` or any other valid property's value. // Then we need to return the colon after that word token. [3] is the "end" colon of that word. // And because we need it after that one we do +1 to get the next one. throw this.input.error( 'Missed semicolon', token[0] === 'word' ? token[3] + 1 : token[2] ) } colon(tokens) { let brackets = 0 let prev, token, type for (let [i, element] of tokens.entries()) { token = element type = token[0] if (type === '(') { brackets += 1 } if (type === ')') { brackets -= 1 } if (brackets === 0 && type === ':') { if (!prev) { this.doubleColon(token) } else if (prev[0] === 'word' && prev[1] === 'progid') { continue } else { return i } } prev = token } return false } comment(token) { let node = new Comment() this.init(node, token[2]) node.source.end = this.getPosition(token[3] || token[2]) node.source.end.offset++ let text = token[1].slice(2, -2) if (/^\s*$/.test(text)) { node.text = '' node.raws.left = text node.raws.right = '' } else { let match = text.match(/^(\s*)([^]*\S)(\s*)$/) node.text = match[2] node.raws.left = match[1] node.raws.right = match[3] } } createTokenizer() { this.tokenizer = tokenizer(this.input) } decl(tokens, customProperty) { let node = new Declaration() this.init(node, tokens[0][2]) let last = tokens[tokens.length - 1] if (last[0] === ';') { this.semicolon = true tokens.pop() } node.source.end = this.getPosition( last[3] || last[2] || findLastWithPosition(tokens) ) node.source.end.offset++ while (tokens[0][0] !== 'word') { if (tokens.length === 1) this.unknownWord(tokens) node.raws.before += tokens.shift()[1] } node.source.start = this.getPosition(tokens[0][2]) node.prop = '' while (tokens.length) { let type = tokens[0][0] if (type === ':' || type === 'space' || type === 'comment') { break } node.prop += tokens.shift()[1] } node.raws.between = '' let token while (tokens.length) { token = tokens.shift() if (token[0] === ':') { node.raws.between += token[1] break } else { if (token[0] === 'word' && /\w/.test(token[1])) { this.unknownWord([token]) } node.raws.between += token[1] } } if (node.prop[0] === '_' || node.prop[0] === '*') { node.raws.before += node.prop[0] node.prop = node.prop.slice(1) } let firstSpaces = [] let next while (tokens.length) { next = tokens[0][0] if (next !== 'space' && next !== 'comment') break firstSpaces.push(tokens.shift()) } this.precheckMissedSemicolon(tokens) for (let i = tokens.length - 1; i >= 0; i--) { token = tokens[i] if (token[1].toLowerCase() === '!important') { node.important = true let string = this.stringFrom(tokens, i) string = this.spacesFromEnd(tokens) + string if (string !== ' !important') node.raws.important = string break } else if (token[1].toLowerCase() === 'important') { let cache = tokens.slice(0) let str = '' for (let j = i; j > 0; j--) { let type = cache[j][0] if (str.trim().startsWith('!') && type !== 'space') { break } str = cache.pop()[1] + str } if (str.trim().startsWith('!')) { node.important = true node.raws.important = str tokens = cache } } if (token[0] !== 'space' && token[0] !== 'comment') { break } } let hasWord = tokens.some(i => i[0] !== 'space' && i[0] !== 'comment') if (hasWord) { node.raws.between += firstSpaces.map(i => i[1]).join('') firstSpaces = [] } this.raw(node, 'value', firstSpaces.concat(tokens), customProperty) if (node.value.includes(':') && !customProperty) { this.checkMissedSemicolon(tokens) } } doubleColon(token) { throw this.input.error( 'Double colon', { offset: token[2] }, { offset: token[2] + token[1].length } ) } emptyRule(token) { let node = new Rule() this.init(node, token[2]) node.selector = '' node.raws.between = '' this.current = node } end(token) { if (this.current.nodes && this.current.nodes.length) { this.current.raws.semicolon = this.semicolon } this.semicolon = false this.current.raws.after = (this.current.raws.after || '') + this.spaces this.spaces = '' if (this.current.parent) { this.current.source.end = this.getPosition(token[2]) this.current.source.end.offset++ this.current = this.current.parent } else { this.unexpectedClose(token) } } endFile() { if (this.current.parent) this.unclosedBlock() if (this.current.nodes && this.current.nodes.length) { this.current.raws.semicolon = this.semicolon } this.current.raws.after = (this.current.raws.after || '') + this.spaces this.root.source.end = this.getPosition(this.tokenizer.position()) } freeSemicolon(token) { this.spaces += token[1] if (this.current.nodes) { let prev = this.current.nodes[this.current.nodes.length - 1] if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) { prev.raws.ownSemicolon = this.spaces this.spaces = '' prev.source.end = this.getPosition(token[2]) prev.source.end.offset += prev.raws.ownSemicolon.length } } } // Helpers getPosition(offset) { let pos = this.input.fromOffset(offset) return { column: pos.col, line: pos.line, offset } } init(node, offset) { this.current.push(node) node.source = { input: this.input, start: this.getPosition(offset) } node.raws.before = this.spaces this.spaces = '' if (node.type !== 'comment') this.semicolon = false } other(start) { let end = false let type = null let colon = false let bracket = null let brackets = [] let customProperty = start[1].startsWith('--') let tokens = [] let token = start while (token) { type = token[0] tokens.push(token) if (type === '(' || type === '[') { if (!bracket) bracket = token brackets.push(type === '(' ? ')' : ']') } else if (customProperty && colon && type === '{') { if (!bracket) bracket = token brackets.push('}') } else if (brackets.length === 0) { if (type === ';') { if (colon) { this.decl(tokens, customProperty) return } else { break } } else if (type === '{') { this.rule(tokens) return } else if (type === '}') { this.tokenizer.back(tokens.pop()) end = true break } else if (type === ':') { colon = true } } else if (type === brackets[brackets.length - 1]) { brackets.pop() if (brackets.length === 0) bracket = null } token = this.tokenizer.nextToken() } if (this.tokenizer.endOfFile()) end = true if (brackets.length > 0) this.unclosedBracket(bracket) if (end && colon) { if (!customProperty) { while (tokens.length) { token = tokens[tokens.length - 1][0] if (token !== 'space' && token !== 'comment') break this.tokenizer.back(tokens.pop()) } } this.decl(tokens, customProperty) } else { this.unknownWord(tokens) } } parse() { let token while (!this.tokenizer.endOfFile()) { token = this.tokenizer.nextToken() switch (token[0]) { case 'space': this.spaces += token[1] break case ';': this.freeSemicolon(token) break case '}': this.end(token) break case 'comment': this.comment(token) break case 'at-word': this.atrule(token) break case '{': this.emptyRule(token) break default: this.other(token) break } } this.endFile() } precheckMissedSemicolon(/* tokens */) { // Hook for Safe Parser } raw(node, prop, tokens, customProperty) { let token, type let length = tokens.length let value = '' let clean = true let next, prev for (let i = 0; i < length; i += 1) { token = tokens[i] type = token[0] if (type === 'space' && i === length - 1 && !customProperty) { clean = false } else if (type === 'comment') { prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty' next = tokens[i + 1] ? tokens[i + 1][0] : 'empty' if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) { if (value.slice(-1) === ',') { clean = false } else { value += token[1] } } else { clean = false } } else { value += token[1] } } if (!clean) { let raw = tokens.reduce((all, i) => all + i[1], '') node.raws[prop] = { raw, value } } node[prop] = value } rule(tokens) { tokens.pop() let node = new Rule() this.init(node, tokens[0][2]) node.raws.between = this.spacesAndCommentsFromEnd(tokens) this.raw(node, 'selector', tokens) this.current = node } spacesAndCommentsFromEnd(tokens) { let lastTokenType let spaces = '' while (tokens.length) { lastTokenType = tokens[tokens.length - 1][0] if (lastTokenType !== 'space' && lastTokenType !== 'comment') break spaces = tokens.pop()[1] + spaces } return spaces } // Errors spacesAndCommentsFromStart(tokens) { let next let spaces = '' while (tokens.length) { next = tokens[0][0] if (next !== 'space' && next !== 'comment') break spaces += tokens.shift()[1] } return spaces } spacesFromEnd(tokens) { let lastTokenType let spaces = '' while (tokens.length) { lastTokenType = tokens[tokens.length - 1][0] if (lastTokenType !== 'space') break spaces = tokens.pop()[1] + spaces } return spaces } stringFrom(tokens, from) { let result = '' for (let i = from; i < tokens.length; i++) { result += tokens[i][1] } tokens.splice(from, tokens.length - from) return result } unclosedBlock() { let pos = this.current.source.start throw this.input.error('Unclosed block', pos.line, pos.column) } unclosedBracket(bracket) { throw this.input.error( 'Unclosed bracket', { offset: bracket[2] }, { offset: bracket[2] + 1 } ) } unexpectedClose(token) { throw this.input.error( 'Unexpected }', { offset: token[2] }, { offset: token[2] + 1 } ) } unknownWord(tokens) { throw this.input.error( 'Unknown word ' + tokens[0][1], { offset: tokens[0][2] }, { offset: tokens[0][2] + tokens[0][1].length } ) } unnamedAtrule(node, token) { throw this.input.error( 'At-rule without name', { offset: token[2] }, { offset: token[2] + token[1].length } ) } } module.exports = Parser /***/ }), /***/ 4067: /***/ ((module) => { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }), /***/ 4092: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Container = __webpack_require__(683) let list = __webpack_require__(7374) class Rule extends Container { get selectors() { return list.comma(this.selector) } set selectors(values) { let match = this.selector ? this.selector.match(/,\s*/) : null let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen') this.selector = values.join(sep) } constructor(defaults) { super(defaults) this.type = 'rule' if (!this.nodes) this.nodes = [] } } module.exports = Rule Rule.default = Rule Container.registerRule(Rule) /***/ }), /***/ 4132: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; __webpack_unused_export__ = true; var TextareaAutosize_1 = __webpack_require__(4462); exports.A = TextareaAutosize_1.TextareaAutosize; /***/ }), /***/ 4295: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Container = __webpack_require__(683) let Input = __webpack_require__(5380) let Parser = __webpack_require__(3937) function parse(css, opts) { let input = new Input(css, opts) let parser = new Parser(input) try { parser.parse() } catch (e) { if (false) {} throw e } return parser.root } module.exports = parse parse.default = parse Container.registerParse(parse) /***/ }), /***/ 4306: /***/ (function(module, exports) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! autosize 4.0.4 license: MIT http://www.jacklmoore.com/autosize */ (function (global, factory) { if (true) { !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { var mod; } })(this, function (module, exports) { 'use strict'; var map = typeof Map === "function" ? new Map() : function () { var keys = []; var values = []; return { has: function has(key) { return keys.indexOf(key) > -1; }, get: function get(key) { return values[keys.indexOf(key)]; }, set: function set(key, value) { if (keys.indexOf(key) === -1) { keys.push(key); values.push(value); } }, delete: function _delete(key) { var index = keys.indexOf(key); if (index > -1) { keys.splice(index, 1); values.splice(index, 1); } } }; }(); var createEvent = function createEvent(name) { return new Event(name, { bubbles: true }); }; try { new Event('test'); } catch (e) { // IE does not support `new Event()` createEvent = function createEvent(name) { var evt = document.createEvent('Event'); evt.initEvent(name, true, false); return evt; }; } function assign(ta) { if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return; var heightOffset = null; var clientWidth = null; var cachedHeight = null; function init() { var style = window.getComputedStyle(ta, null); if (style.resize === 'vertical') { ta.style.resize = 'none'; } else if (style.resize === 'both') { ta.style.resize = 'horizontal'; } if (style.boxSizing === 'content-box') { heightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom)); } else { heightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth); } // Fix when a textarea is not on document body and heightOffset is Not a Number if (isNaN(heightOffset)) { heightOffset = 0; } update(); } function changeOverflow(value) { { // Chrome/Safari-specific fix: // When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space // made available by removing the scrollbar. The following forces the necessary text reflow. var width = ta.style.width; ta.style.width = '0px'; // Force reflow: /* jshint ignore:start */ ta.offsetWidth; /* jshint ignore:end */ ta.style.width = width; } ta.style.overflowY = value; } function getParentOverflows(el) { var arr = []; while (el && el.parentNode && el.parentNode instanceof Element) { if (el.parentNode.scrollTop) { arr.push({ node: el.parentNode, scrollTop: el.parentNode.scrollTop }); } el = el.parentNode; } return arr; } function resize() { if (ta.scrollHeight === 0) { // If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM. return; } var overflows = getParentOverflows(ta); var docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240) ta.style.height = ''; ta.style.height = ta.scrollHeight + heightOffset + 'px'; // used to check if an update is actually necessary on window.resize clientWidth = ta.clientWidth; // prevents scroll-position jumping overflows.forEach(function (el) { el.node.scrollTop = el.scrollTop; }); if (docTop) { document.documentElement.scrollTop = docTop; } } function update() { resize(); var styleHeight = Math.round(parseFloat(ta.style.height)); var computed = window.getComputedStyle(ta, null); // Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight; // The actual height not matching the style height (set via the resize method) indicates that // the max-height has been exceeded, in which case the overflow should be allowed. if (actualHeight < styleHeight) { if (computed.overflowY === 'hidden') { changeOverflow('scroll'); resize(); actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; } } else { // Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands. if (computed.overflowY !== 'hidden') { changeOverflow('hidden'); resize(); actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight; } } if (cachedHeight !== actualHeight) { cachedHeight = actualHeight; var evt = createEvent('autosize:resized'); try { ta.dispatchEvent(evt); } catch (err) { // Firefox will throw an error on dispatchEvent for a detached element // https://bugzilla.mozilla.org/show_bug.cgi?id=889376 } } } var pageResize = function pageResize() { if (ta.clientWidth !== clientWidth) { update(); } }; var destroy = function (style) { window.removeEventListener('resize', pageResize, false); ta.removeEventListener('input', update, false); ta.removeEventListener('keyup', update, false); ta.removeEventListener('autosize:destroy', destroy, false); ta.removeEventListener('autosize:update', update, false); Object.keys(style).forEach(function (key) { ta.style[key] = style[key]; }); map.delete(ta); }.bind(ta, { height: ta.style.height, resize: ta.style.resize, overflowY: ta.style.overflowY, overflowX: ta.style.overflowX, wordWrap: ta.style.wordWrap }); ta.addEventListener('autosize:destroy', destroy, false); // IE9 does not fire onpropertychange or oninput for deletions, // so binding to onkeyup to catch most of those events. // There is no way that I know of to detect something like 'cut' in IE9. if ('onpropertychange' in ta && 'oninput' in ta) { ta.addEventListener('keyup', update, false); } window.addEventListener('resize', pageResize, false); ta.addEventListener('input', update, false); ta.addEventListener('autosize:update', update, false); ta.style.overflowX = 'hidden'; ta.style.wordWrap = 'break-word'; map.set(ta, { destroy: destroy, update: update }); init(); } function destroy(ta) { var methods = map.get(ta); if (methods) { methods.destroy(); } } function update(ta) { var methods = map.get(ta); if (methods) { methods.update(); } } var autosize = null; // Do nothing in Node.js environment and IE8 (or lower) if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') { autosize = function autosize(el) { return el; }; autosize.destroy = function (el) { return el; }; autosize.update = function (el) { return el; }; } else { autosize = function autosize(el, options) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], function (x) { return assign(x, options); }); } return el; }; autosize.destroy = function (el) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], destroy); } return el; }; autosize.update = function (el) { if (el) { Array.prototype.forEach.call(el.length ? el : [el], update); } return el; }; } exports.default = autosize; module.exports = exports['default']; }); /***/ }), /***/ 4462: /***/ (function(__unused_webpack_module, exports, __webpack_require__) { "use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __assign = (this && this.__assign) || Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) t[p[i]] = s[p[i]]; return t; }; exports.__esModule = true; var React = __webpack_require__(1609); var PropTypes = __webpack_require__(5826); var autosize = __webpack_require__(4306); var _getLineHeight = __webpack_require__(461); var getLineHeight = _getLineHeight; var RESIZED = "autosize:resized"; /** * A light replacement for built-in textarea component * which automaticaly adjusts its height to match the content */ var TextareaAutosizeClass = /** @class */ (function (_super) { __extends(TextareaAutosizeClass, _super); function TextareaAutosizeClass() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.state = { lineHeight: null }; _this.textarea = null; _this.onResize = function (e) { if (_this.props.onResize) { _this.props.onResize(e); } }; _this.updateLineHeight = function () { if (_this.textarea) { _this.setState({ lineHeight: getLineHeight(_this.textarea) }); } }; _this.onChange = function (e) { var onChange = _this.props.onChange; _this.currentValue = e.currentTarget.value; onChange && onChange(e); }; return _this; } TextareaAutosizeClass.prototype.componentDidMount = function () { var _this = this; var _a = this.props, maxRows = _a.maxRows, async = _a.async; if (typeof maxRows === "number") { this.updateLineHeight(); } if (typeof maxRows === "number" || async) { /* the defer is needed to: - force "autosize" to activate the scrollbar when this.props.maxRows is passed - support StyledComponents (see #71) */ setTimeout(function () { return _this.textarea && autosize(_this.textarea); }); } else { this.textarea && autosize(this.textarea); } if (this.textarea) { this.textarea.addEventListener(RESIZED, this.onResize); } }; TextareaAutosizeClass.prototype.componentWillUnmount = function () { if (this.textarea) { this.textarea.removeEventListener(RESIZED, this.onResize); autosize.destroy(this.textarea); } }; TextareaAutosizeClass.prototype.render = function () { var _this = this; var _a = this, _b = _a.props, onResize = _b.onResize, maxRows = _b.maxRows, onChange = _b.onChange, style = _b.style, innerRef = _b.innerRef, children = _b.children, props = __rest(_b, ["onResize", "maxRows", "onChange", "style", "innerRef", "children"]), lineHeight = _a.state.lineHeight; var maxHeight = maxRows && lineHeight ? lineHeight * maxRows : null; return (React.createElement("textarea", __assign({}, props, { onChange: this.onChange, style: maxHeight ? __assign({}, style, { maxHeight: maxHeight }) : style, ref: function (element) { _this.textarea = element; if (typeof _this.props.innerRef === 'function') { _this.props.innerRef(element); } else if (_this.props.innerRef) { _this.props.innerRef.current = element; } } }), children)); }; TextareaAutosizeClass.prototype.componentDidUpdate = function () { this.textarea && autosize.update(this.textarea); }; TextareaAutosizeClass.defaultProps = { rows: 1, async: false }; TextareaAutosizeClass.propTypes = { rows: PropTypes.number, maxRows: PropTypes.number, onResize: PropTypes.func, innerRef: PropTypes.any, async: PropTypes.bool }; return TextareaAutosizeClass; }(React.Component)); exports.TextareaAutosize = React.forwardRef(function (props, ref) { return React.createElement(TextareaAutosizeClass, __assign({}, props, { innerRef: ref })); }); /***/ }), /***/ 4725: /***/ ((module) => { function stringifyNode(node, custom) { var type = node.type; var value = node.value; var buf; var customResult; if (custom && (customResult = custom(node)) !== undefined) { return customResult; } else if (type === "word" || type === "space") { return value; } else if (type === "string") { buf = node.quote || ""; return buf + value + (node.unclosed ? "" : buf); } else if (type === "comment") { return "/*" + value + (node.unclosed ? "" : "*/"); } else if (type === "div") { return (node.before || "") + value + (node.after || ""); } else if (Array.isArray(node.nodes)) { buf = stringify(node.nodes, custom); if (type !== "function") { return buf; } return ( value + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")") ); } return value; } function stringify(nodes, custom) { var result, i; if (Array.isArray(nodes)) { result = ""; for (i = nodes.length - 1; ~i; i -= 1) { result = stringifyNode(nodes[i], custom) + result; } return result; } return stringifyNode(nodes, custom); } module.exports = stringify; /***/ }), /***/ 5042: /***/ ((module) => { // This alphabet uses `A-Za-z0-9_-` symbols. // The order of characters is optimized for better gzip and brotli compression. // References to the same file (works both for gzip and brotli): // `'use`, `andom`, and `rict'` // References to the brotli default dictionary: // `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf` let urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict' let customAlphabet = (alphabet, defaultSize = 21) => { return (size = defaultSize) => { let id = '' // A compact alternative for `for (var i = 0; i < step; i++)`. let i = size | 0 while (i--) { // `| 0` is more compact and faster than `Math.floor()`. id += alphabet[(Math.random() * alphabet.length) | 0] } return id } } let nanoid = (size = 21) => { let id = '' // A compact alternative for `for (var i = 0; i < step; i++)`. let i = size | 0 while (i--) { // `| 0` is more compact and faster than `Math.floor()`. id += urlAlphabet[(Math.random() * 64) | 0] } return id } module.exports = { nanoid, customAlphabet } /***/ }), /***/ 5215: /***/ ((module) => { "use strict"; // do not edit .js files directly - edit src/index.jst module.exports = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } // true if both NaN, false otherwise return a!==a && b!==b; }; /***/ }), /***/ 5380: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let { nanoid } = __webpack_require__(5042) let { isAbsolute, resolve } = __webpack_require__(197) let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(1866) let { fileURLToPath, pathToFileURL } = __webpack_require__(2739) let CssSyntaxError = __webpack_require__(356) let PreviousMap = __webpack_require__(5696) let terminalHighlight = __webpack_require__(9746) let fromOffsetCache = Symbol('fromOffsetCache') let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator) let pathAvailable = Boolean(resolve && isAbsolute) class Input { get from() { return this.file || this.id } constructor(css, opts = {}) { if ( css === null || typeof css === 'undefined' || (typeof css === 'object' && !css.toString) ) { throw new Error(`PostCSS received ${css} instead of CSS string`) } this.css = css.toString() if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') { this.hasBOM = true this.css = this.css.slice(1) } else { this.hasBOM = false } this.document = this.css if (opts.document) this.document = opts.document.toString() if (opts.from) { if ( !pathAvailable || /^\w+:\/\//.test(opts.from) || isAbsolute(opts.from) ) { this.file = opts.from } else { this.file = resolve(opts.from) } } if (pathAvailable && sourceMapAvailable) { let map = new PreviousMap(this.css, opts) if (map.text) { this.map = map let file = map.consumer().file if (!this.file && file) this.file = this.mapResolve(file) } } if (!this.file) { this.id = '<input css ' + nanoid(6) + '>' } if (this.map) this.map.file = this.from } error(message, line, column, opts = {}) { let endColumn, endLine, result if (line && typeof line === 'object') { let start = line let end = column if (typeof start.offset === 'number') { let pos = this.fromOffset(start.offset) line = pos.line column = pos.col } else { line = start.line column = start.column } if (typeof end.offset === 'number') { let pos = this.fromOffset(end.offset) endLine = pos.line endColumn = pos.col } else { endLine = end.line endColumn = end.column } } else if (!column) { let pos = this.fromOffset(line) line = pos.line column = pos.col } let origin = this.origin(line, column, endLine, endColumn) if (origin) { result = new CssSyntaxError( message, origin.endLine === undefined ? origin.line : { column: origin.column, line: origin.line }, origin.endLine === undefined ? origin.column : { column: origin.endColumn, line: origin.endLine }, origin.source, origin.file, opts.plugin ) } else { result = new CssSyntaxError( message, endLine === undefined ? line : { column, line }, endLine === undefined ? column : { column: endColumn, line: endLine }, this.css, this.file, opts.plugin ) } result.input = { column, endColumn, endLine, line, source: this.css } if (this.file) { if (pathToFileURL) { result.input.url = pathToFileURL(this.file).toString() } result.input.file = this.file } return result } fromOffset(offset) { let lastLine, lineToIndex if (!this[fromOffsetCache]) { let lines = this.css.split('\n') lineToIndex = new Array(lines.length) let prevIndex = 0 for (let i = 0, l = lines.length; i < l; i++) { lineToIndex[i] = prevIndex prevIndex += lines[i].length + 1 } this[fromOffsetCache] = lineToIndex } else { lineToIndex = this[fromOffsetCache] } lastLine = lineToIndex[lineToIndex.length - 1] let min = 0 if (offset >= lastLine) { min = lineToIndex.length - 1 } else { let max = lineToIndex.length - 2 let mid while (min < max) { mid = min + ((max - min) >> 1) if (offset < lineToIndex[mid]) { max = mid - 1 } else if (offset >= lineToIndex[mid + 1]) { min = mid + 1 } else { min = mid break } } } return { col: offset - lineToIndex[min] + 1, line: min + 1 } } mapResolve(file) { if (/^\w+:\/\//.test(file)) { return file } return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file) } origin(line, column, endLine, endColumn) { if (!this.map) return false let consumer = this.map.consumer() let from = consumer.originalPositionFor({ column, line }) if (!from.source) return false let to if (typeof endLine === 'number') { to = consumer.originalPositionFor({ column: endColumn, line: endLine }) } let fromUrl if (isAbsolute(from.source)) { fromUrl = pathToFileURL(from.source) } else { fromUrl = new URL( from.source, this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile) ) } let result = { column: from.column, endColumn: to && to.column, endLine: to && to.line, line: from.line, url: fromUrl.toString() } if (fromUrl.protocol === 'file:') { if (fileURLToPath) { result.file = fileURLToPath(fromUrl) } else { /* c8 ignore next 2 */ throw new Error(`file: protocol is not available in this PostCSS build`) } } let source = consumer.sourceContentFor(from.source) if (source) result.source = source return result } toJSON() { let json = {} for (let name of ['hasBOM', 'css', 'file', 'id']) { if (this[name] != null) { json[name] = this[name] } } if (this.map) { json.map = { ...this.map } if (json.map.consumerCache) { json.map.consumerCache = undefined } } return json } } module.exports = Input Input.default = Input if (terminalHighlight && terminalHighlight.registerInput) { terminalHighlight.registerInput(Input) } /***/ }), /***/ 5404: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { const CSSValueParser = __webpack_require__(1544) /** * @type {import('postcss').PluginCreator} */ module.exports = (opts) => { const DEFAULTS = { skipHostRelativeUrls: true, } const config = Object.assign(DEFAULTS, opts) return { postcssPlugin: 'rebaseUrl', Declaration(decl) { // The faster way to find Declaration node const parsedValue = CSSValueParser(decl.value) let valueChanged = false parsedValue.walk(node => { if (node.type !== 'function' || node.value !== 'url') { return } const urlVal = node.nodes[0].value // bases relative URLs with rootUrl const basedUrl = new URL(urlVal, opts.rootUrl) // skip host-relative, already normalized URLs (e.g. `/images/image.jpg`, without `..`s) if ((basedUrl.pathname === urlVal) && config.skipHostRelativeUrls) { return false // skip this value } node.nodes[0].value = basedUrl.toString() valueChanged = true return false // do not walk deeper }) if (valueChanged) { decl.value = CSSValueParser.stringify(parsedValue) } } } } module.exports.postcss = true /***/ }), /***/ 5417: /***/ ((__unused_webpack_module, exports) => { "use strict"; /*istanbul ignore start*/ Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = Diff; /*istanbul ignore end*/ function Diff() {} Diff.prototype = { /*istanbul ignore start*/ /*istanbul ignore end*/ diff: function diff(oldString, newString) { /*istanbul ignore start*/ var /*istanbul ignore end*/ options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var callback = options.callback; if (typeof options === 'function') { callback = options; options = {}; } this.options = options; var self = this; function done(value) { if (callback) { setTimeout(function () { callback(undefined, value); }, 0); return true; } else { return value; } } // Allow subclasses to massage the input prior to running oldString = this.castInput(oldString); newString = this.castInput(newString); oldString = this.removeEmpty(this.tokenize(oldString)); newString = this.removeEmpty(this.tokenize(newString)); var newLen = newString.length, oldLen = oldString.length; var editLength = 1; var maxEditLength = newLen + oldLen; var bestPath = [{ newPos: -1, components: [] }]; // Seed editLength = 0, i.e. the content starts with the same values var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { // Identity per the equality and tokenizer return done([{ value: this.join(newString), count: newString.length }]); } // Main worker method. checks all permutations of a given edit length for acceptance. function execEditLength() { for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { var basePath = /*istanbul ignore start*/ void 0 /*istanbul ignore end*/ ; var addPath = bestPath[diagonalPath - 1], removePath = bestPath[diagonalPath + 1], _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; if (addPath) { // No one else is going to attempt to use this value, clear it bestPath[diagonalPath - 1] = undefined; } var canAdd = addPath && addPath.newPos + 1 < newLen, canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; if (!canAdd && !canRemove) { // If this path is a terminal then prune bestPath[diagonalPath] = undefined; continue; } // Select the diagonal that we want to branch from. We select the prior // path whose position in the new string is the farthest from the origin // and does not pass the bounds of the diff graph if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { basePath = clonePath(removePath); self.pushComponent(basePath.components, undefined, true); } else { basePath = addPath; // No need to clone, we've pulled it from the list basePath.newPos++; self.pushComponent(basePath.components, true, undefined); } _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); } else { // Otherwise track this path as a potential candidate and continue. bestPath[diagonalPath] = basePath; } } editLength++; } // Performs the length of edit iteration. Is a bit fugly as this has to support the // sync and async mode which is never fun. Loops over execEditLength until a value // is produced. if (callback) { (function exec() { setTimeout(function () { // This should not happen, but we want to be safe. /* istanbul ignore next */ if (editLength > maxEditLength) { return callback(); } if (!execEditLength()) { exec(); } }, 0); })(); } else { while (editLength <= maxEditLength) { var ret = execEditLength(); if (ret) { return ret; } } } }, /*istanbul ignore start*/ /*istanbul ignore end*/ pushComponent: function pushComponent(components, added, removed) { var last = components[components.length - 1]; if (last && last.added === added && last.removed === removed) { // We need to clone here as the component clone operation is just // as shallow array clone components[components.length - 1] = { count: last.count + 1, added: added, removed: removed }; } else { components.push({ count: 1, added: added, removed: removed }); } }, /*istanbul ignore start*/ /*istanbul ignore end*/ extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { var newLen = newString.length, oldLen = oldString.length, newPos = basePath.newPos, oldPos = newPos - diagonalPath, commonCount = 0; while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { newPos++; oldPos++; commonCount++; } if (commonCount) { basePath.components.push({ count: commonCount }); } basePath.newPos = newPos; return oldPos; }, /*istanbul ignore start*/ /*istanbul ignore end*/ equals: function equals(left, right) { if (this.options.comparator) { return this.options.comparator(left, right); } else { return left === right || this.options.ignoreCase && left.toLowerCase() === right.toLowerCase(); } }, /*istanbul ignore start*/ /*istanbul ignore end*/ removeEmpty: function removeEmpty(array) { var ret = []; for (var i = 0; i < array.length; i++) { if (array[i]) { ret.push(array[i]); } } return ret; }, /*istanbul ignore start*/ /*istanbul ignore end*/ castInput: function castInput(value) { return value; }, /*istanbul ignore start*/ /*istanbul ignore end*/ tokenize: function tokenize(value) { return value.split(''); }, /*istanbul ignore start*/ /*istanbul ignore end*/ join: function join(chars) { return chars.join(''); } }; function buildValues(diff, components, newString, oldString, useLongestToken) { var componentPos = 0, componentLen = components.length, newPos = 0, oldPos = 0; for (; componentPos < componentLen; componentPos++) { var component = components[componentPos]; if (!component.removed) { if (!component.added && useLongestToken) { var value = newString.slice(newPos, newPos + component.count); value = value.map(function (value, i) { var oldValue = oldString[oldPos + i]; return oldValue.length > value.length ? oldValue : value; }); component.value = diff.join(value); } else { component.value = diff.join(newString.slice(newPos, newPos + component.count)); } newPos += component.count; // Common case if (!component.added) { oldPos += component.count; } } else { component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); oldPos += component.count; // Reverse add and remove so removes are output first to match common convention // The diffing algorithm is tied to add then remove output and this is the simplest // route to get the desired output with minimal overhead. if (componentPos && components[componentPos - 1].added) { var tmp = components[componentPos - 1]; components[componentPos - 1] = components[componentPos]; components[componentPos] = tmp; } } } // Special case handle for when one terminal is ignored (i.e. whitespace). // For this case we merge the terminal into the prior string and drop the change. // This is only available for string mode. var lastComponent = components[componentLen - 1]; if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { components[componentLen - 2].value += lastComponent.value; components.pop(); } return components; } function clonePath(path) { return { newPos: path.newPos, components: path.components.slice(0) }; } /***/ }), /***/ 5696: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let { existsSync, readFileSync } = __webpack_require__(9977) let { dirname, join } = __webpack_require__(197) let { SourceMapConsumer, SourceMapGenerator } = __webpack_require__(1866) function fromBase64(str) { if (Buffer) { return Buffer.from(str, 'base64').toString() } else { /* c8 ignore next 2 */ return window.atob(str) } } class PreviousMap { constructor(css, opts) { if (opts.map === false) return this.loadAnnotation(css) this.inline = this.startWith(this.annotation, 'data:') let prev = opts.map ? opts.map.prev : undefined let text = this.loadMap(opts.from, prev) if (!this.mapFile && opts.from) { this.mapFile = opts.from } if (this.mapFile) this.root = dirname(this.mapFile) if (text) this.text = text } consumer() { if (!this.consumerCache) { this.consumerCache = new SourceMapConsumer(this.text) } return this.consumerCache } decodeInline(text) { let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/ let baseUri = /^data:application\/json;base64,/ let charsetUri = /^data:application\/json;charset=utf-?8,/ let uri = /^data:application\/json,/ let uriMatch = text.match(charsetUri) || text.match(uri) if (uriMatch) { return decodeURIComponent(text.substr(uriMatch[0].length)) } let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri) if (baseUriMatch) { return fromBase64(text.substr(baseUriMatch[0].length)) } let encoding = text.match(/data:application\/json;([^,]+),/)[1] throw new Error('Unsupported source map encoding ' + encoding) } getAnnotationURL(sourceMapString) { return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim() } isMap(map) { if (typeof map !== 'object') return false return ( typeof map.mappings === 'string' || typeof map._mappings === 'string' || Array.isArray(map.sections) ) } loadAnnotation(css) { let comments = css.match(/\/\*\s*# sourceMappingURL=/g) if (!comments) return // sourceMappingURLs from comments, strings, etc. let start = css.lastIndexOf(comments.pop()) let end = css.indexOf('*/', start) if (start > -1 && end > -1) { // Locate the last sourceMappingURL to avoid pickin this.annotation = this.getAnnotationURL(css.substring(start, end)) } } loadFile(path) { this.root = dirname(path) if (existsSync(path)) { this.mapFile = path return readFileSync(path, 'utf-8').toString().trim() } } loadMap(file, prev) { if (prev === false) return false if (prev) { if (typeof prev === 'string') { return prev } else if (typeof prev === 'function') { let prevPath = prev(file) if (prevPath) { let map = this.loadFile(prevPath) if (!map) { throw new Error( 'Unable to load previous source map: ' + prevPath.toString() ) } return map } } else if (prev instanceof SourceMapConsumer) { return SourceMapGenerator.fromSourceMap(prev).toString() } else if (prev instanceof SourceMapGenerator) { return prev.toString() } else if (this.isMap(prev)) { return JSON.stringify(prev) } else { throw new Error( 'Unsupported previous source map format: ' + prev.toString() ) } } else if (this.inline) { return this.decodeInline(this.annotation) } else if (this.annotation) { let map = this.annotation if (file) map = join(dirname(file), map) return this.loadFile(map) } } startWith(string, start) { if (!string) return false return string.substr(0, start.length) === start } withContent() { return !!( this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0 ) } } module.exports = PreviousMap PreviousMap.default = PreviousMap /***/ }), /***/ 5776: /***/ ((module) => { "use strict"; class Warning { constructor(text, opts = {}) { this.type = 'warning' this.text = text if (opts.node && opts.node.source) { let range = opts.node.rangeBy(opts) this.line = range.start.line this.column = range.start.column this.endLine = range.end.line this.endColumn = range.end.column } for (let opt in opts) this[opt] = opts[opt] } toString() { if (this.node) { return this.node.error(this.text, { index: this.index, plugin: this.plugin, word: this.word }).message } if (this.plugin) { return this.plugin + ': ' + this.text } return this.text } } module.exports = Warning Warning.default = Warning /***/ }), /***/ 5826: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (false) { var throwOnDirectAccess, ReactIs; } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = __webpack_require__(628)(); } /***/ }), /***/ 6109: /***/ ((module) => { // This code has been refactored for 140 bytes // You can see the original here: https://github.com/twolfson/computedStyle/blob/04cd1da2e30fa45844f95f5cb1ac898e9b9ef050/lib/computedStyle.js var computedStyle = function (el, prop, getComputedStyle) { getComputedStyle = window.getComputedStyle; // In one fell swoop return ( // If we have getComputedStyle getComputedStyle ? // Query it // TODO: From CSS-Query notes, we might need (node, null) for FF getComputedStyle(el) : // Otherwise, we are in IE and use currentStyle el.currentStyle )[ // Switch to camelCase for CSSOM // DEV: Grabbed from jQuery // https://github.com/jquery/jquery/blob/1.9-stable/src/css.js#L191-L194 // https://github.com/jquery/jquery/blob/1.9-stable/src/core.js#L593-L597 prop.replace(/-(\w)/gi, function (word, letter) { return letter.toUpperCase(); }) ]; }; module.exports = computedStyle; /***/ }), /***/ 6589: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Node = __webpack_require__(7490) class Comment extends Node { constructor(defaults) { super(defaults) this.type = 'comment' } } module.exports = Comment Comment.default = Comment /***/ }), /***/ 7191: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule normalizeWheel * @typechecks */ var UserAgent_DEPRECATED = __webpack_require__(2213); var isEventSupported = __webpack_require__(1087); // Reasonable defaults var PIXEL_STEP = 10; var LINE_HEIGHT = 40; var PAGE_HEIGHT = 800; /** * Mouse wheel (and 2-finger trackpad) support on the web sucks. It is * complicated, thus this doc is long and (hopefully) detailed enough to answer * your questions. * * If you need to react to the mouse wheel in a predictable way, this code is * like your bestest friend. * hugs * * * As of today, there are 4 DOM event types you can listen to: * * 'wheel' -- Chrome(31+), FF(17+), IE(9+) * 'mousewheel' -- Chrome, IE(6+), Opera, Safari * 'MozMousePixelScroll' -- FF(3.5 only!) (2010-2013) -- don't bother! * 'DOMMouseScroll' -- FF(0.9.7+) since 2003 * * So what to do? The is the best: * * normalizeWheel.getEventType(); * * In your event callback, use this code to get sane interpretation of the * deltas. This code will return an object with properties: * * spinX -- normalized spin speed (use for zoom) - x plane * spinY -- " - y plane * pixelX -- normalized distance (to pixels) - x plane * pixelY -- " - y plane * * Wheel values are provided by the browser assuming you are using the wheel to * scroll a web page by a number of lines or pixels (or pages). Values can vary * significantly on different platforms and browsers, forgetting that you can * scroll at different speeds. Some devices (like trackpads) emit more events * at smaller increments with fine granularity, and some emit massive jumps with * linear speed or acceleration. * * This code does its best to normalize the deltas for you: * * - spin is trying to normalize how far the wheel was spun (or trackpad * dragged). This is super useful for zoom support where you want to * throw away the chunky scroll steps on the PC and make those equal to * the slow and smooth tiny steps on the Mac. Key data: This code tries to * resolve a single slow step on a wheel to 1. * * - pixel is normalizing the desired scroll delta in pixel units. You'll * get the crazy differences between browsers, but at least it'll be in * pixels! * * - positive value indicates scrolling DOWN/RIGHT, negative UP/LEFT. This * should translate to positive value zooming IN, negative zooming OUT. * This matches the newer 'wheel' event. * * Why are there spinX, spinY (or pixels)? * * - spinX is a 2-finger side drag on the trackpad, and a shift + wheel turn * with a mouse. It results in side-scrolling in the browser by default. * * - spinY is what you expect -- it's the classic axis of a mouse wheel. * * - I dropped spinZ/pixelZ. It is supported by the DOM 3 'wheel' event and * probably is by browsers in conjunction with fancy 3D controllers .. but * you know. * * Implementation info: * * Examples of 'wheel' event if you scroll slowly (down) by one step with an * average mouse: * * OS X + Chrome (mouse) - 4 pixel delta (wheelDelta -120) * OS X + Safari (mouse) - N/A pixel delta (wheelDelta -12) * OS X + Firefox (mouse) - 0.1 line delta (wheelDelta N/A) * Win8 + Chrome (mouse) - 100 pixel delta (wheelDelta -120) * Win8 + Firefox (mouse) - 3 line delta (wheelDelta -120) * * On the trackpad: * * OS X + Chrome (trackpad) - 2 pixel delta (wheelDelta -6) * OS X + Firefox (trackpad) - 1 pixel delta (wheelDelta N/A) * * On other/older browsers.. it's more complicated as there can be multiple and * also missing delta values. * * The 'wheel' event is more standard: * * http://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents * * The basics is that it includes a unit, deltaMode (pixels, lines, pages), and * deltaX, deltaY and deltaZ. Some browsers provide other values to maintain * backward compatibility with older events. Those other values help us * better normalize spin speed. Example of what the browsers provide: * * | event.wheelDelta | event.detail * ------------------+------------------+-------------- * Safari v5/OS X | -120 | 0 * Safari v5/Win7 | -120 | 0 * Chrome v17/OS X | -120 | 0 * Chrome v17/Win7 | -120 | 0 * IE9/Win7 | -120 | undefined * Firefox v4/OS X | undefined | 1 * Firefox v4/Win7 | undefined | 3 * */ function normalizeWheel(/*object*/ event) /*object*/ { var sX = 0, sY = 0, // spinX, spinY pX = 0, pY = 0; // pixelX, pixelY // Legacy if ('detail' in event) { sY = event.detail; } if ('wheelDelta' in event) { sY = -event.wheelDelta / 120; } if ('wheelDeltaY' in event) { sY = -event.wheelDeltaY / 120; } if ('wheelDeltaX' in event) { sX = -event.wheelDeltaX / 120; } // side scrolling on FF with DOMMouseScroll if ( 'axis' in event && event.axis === event.HORIZONTAL_AXIS ) { sX = sY; sY = 0; } pX = sX * PIXEL_STEP; pY = sY * PIXEL_STEP; if ('deltaY' in event) { pY = event.deltaY; } if ('deltaX' in event) { pX = event.deltaX; } if ((pX || pY) && event.deltaMode) { if (event.deltaMode == 1) { // delta in LINE units pX *= LINE_HEIGHT; pY *= LINE_HEIGHT; } else { // delta in PAGE units pX *= PAGE_HEIGHT; pY *= PAGE_HEIGHT; } } // Fall-back if spin cannot be determined if (pX && !sX) { sX = (pX < 1) ? -1 : 1; } if (pY && !sY) { sY = (pY < 1) ? -1 : 1; } return { spinX : sX, spinY : sY, pixelX : pX, pixelY : pY }; } /** * The best combination if you prefer spinX + spinY normalization. It favors * the older DOMMouseScroll for Firefox, as FF does not include wheelDelta with * 'wheel' event, making spin speed determination impossible. */ normalizeWheel.getEventType = function() /*string*/ { return (UserAgent_DEPRECATED.firefox()) ? 'DOMMouseScroll' : (isEventSupported('wheel')) ? 'wheel' : 'mousewheel'; }; module.exports = normalizeWheel; /***/ }), /***/ 7374: /***/ ((module) => { "use strict"; let list = { comma(string) { return list.split(string, [','], true) }, space(string) { let spaces = [' ', '\n', '\t'] return list.split(string, spaces) }, split(string, separators, last) { let array = [] let current = '' let split = false let func = 0 let inQuote = false let prevQuote = '' let escape = false for (let letter of string) { if (escape) { escape = false } else if (letter === '\\') { escape = true } else if (inQuote) { if (letter === prevQuote) { inQuote = false } } else if (letter === '"' || letter === "'") { inQuote = true prevQuote = letter } else if (letter === '(') { func += 1 } else if (letter === ')') { if (func > 0) func -= 1 } else if (func === 0) { if (separators.includes(letter)) split = true } if (split) { if (current !== '') array.push(current.trim()) current = '' split = false } else { current += letter } } if (last || current !== '') array.push(current.trim()) return array } } module.exports = list list.default = list /***/ }), /***/ 7490: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let CssSyntaxError = __webpack_require__(356) let Stringifier = __webpack_require__(346) let stringify = __webpack_require__(633) let { isClean, my } = __webpack_require__(1381) function cloneNode(obj, parent) { let cloned = new obj.constructor() for (let i in obj) { if (!Object.prototype.hasOwnProperty.call(obj, i)) { /* c8 ignore next 2 */ continue } if (i === 'proxyCache') continue let value = obj[i] let type = typeof value if (i === 'parent' && type === 'object') { if (parent) cloned[i] = parent } else if (i === 'source') { cloned[i] = value } else if (Array.isArray(value)) { cloned[i] = value.map(j => cloneNode(j, cloned)) } else { if (type === 'object' && value !== null) value = cloneNode(value) cloned[i] = value } } return cloned } function sourceOffset(inputCSS, position) { // Not all custom syntaxes support `offset` in `source.start` and `source.end` if ( position && typeof position.offset !== 'undefined' ) { return position.offset; } let column = 1 let line = 1 let offset = 0 for (let i = 0; i < inputCSS.length; i++) { if (line === position.line && column === position.column) { offset = i break } if (inputCSS[i] === '\n') { column = 1 line += 1 } else { column += 1 } } return offset } class Node { get proxyOf() { return this } constructor(defaults = {}) { this.raws = {} this[isClean] = false this[my] = true for (let name in defaults) { if (name === 'nodes') { this.nodes = [] for (let node of defaults[name]) { if (typeof node.clone === 'function') { this.append(node.clone()) } else { this.append(node) } } } else { this[name] = defaults[name] } } } addToError(error) { error.postcssNode = this if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) { let s = this.source error.stack = error.stack.replace( /\n\s{4}at /, `$&${s.input.from}:${s.start.line}:${s.start.column}$&` ) } return error } after(add) { this.parent.insertAfter(this, add) return this } assign(overrides = {}) { for (let name in overrides) { this[name] = overrides[name] } return this } before(add) { this.parent.insertBefore(this, add) return this } cleanRaws(keepBetween) { delete this.raws.before delete this.raws.after if (!keepBetween) delete this.raws.between } clone(overrides = {}) { let cloned = cloneNode(this) for (let name in overrides) { cloned[name] = overrides[name] } return cloned } cloneAfter(overrides = {}) { let cloned = this.clone(overrides) this.parent.insertAfter(this, cloned) return cloned } cloneBefore(overrides = {}) { let cloned = this.clone(overrides) this.parent.insertBefore(this, cloned) return cloned } error(message, opts = {}) { if (this.source) { let { end, start } = this.rangeBy(opts) return this.source.input.error( message, { column: start.column, line: start.line }, { column: end.column, line: end.line }, opts ) } return new CssSyntaxError(message) } getProxyProcessor() { return { get(node, prop) { if (prop === 'proxyOf') { return node } else if (prop === 'root') { return () => node.root().toProxy() } else { return node[prop] } }, set(node, prop, value) { if (node[prop] === value) return true node[prop] = value if ( prop === 'prop' || prop === 'value' || prop === 'name' || prop === 'params' || prop === 'important' || /* c8 ignore next */ prop === 'text' ) { node.markDirty() } return true } } } /* c8 ignore next 3 */ markClean() { this[isClean] = true } markDirty() { if (this[isClean]) { this[isClean] = false let next = this while ((next = next.parent)) { next[isClean] = false } } } next() { if (!this.parent) return undefined let index = this.parent.index(this) return this.parent.nodes[index + 1] } positionBy(opts) { let pos = this.source.start if (opts.index) { pos = this.positionInside(opts.index) } else if (opts.word) { let inputString = ('document' in this.source.input) ? this.source.input.document : this.source.input.css let stringRepresentation = inputString.slice( sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end) ) let index = stringRepresentation.indexOf(opts.word) if (index !== -1) pos = this.positionInside(index) } return pos } positionInside(index) { let column = this.source.start.column let line = this.source.start.line let inputString = ('document' in this.source.input) ? this.source.input.document : this.source.input.css let offset = sourceOffset(inputString, this.source.start) let end = offset + index for (let i = offset; i < end; i++) { if (inputString[i] === '\n') { column = 1 line += 1 } else { column += 1 } } return { column, line } } prev() { if (!this.parent) return undefined let index = this.parent.index(this) return this.parent.nodes[index - 1] } rangeBy(opts) { let start = { column: this.source.start.column, line: this.source.start.line } let end = this.source.end ? { column: this.source.end.column + 1, line: this.source.end.line } : { column: start.column + 1, line: start.line } if (opts.word) { let inputString = ('document' in this.source.input) ? this.source.input.document : this.source.input.css let stringRepresentation = inputString.slice( sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end) ) let index = stringRepresentation.indexOf(opts.word) if (index !== -1) { start = this.positionInside(index) end = this.positionInside( index + opts.word.length, ) } } else { if (opts.start) { start = { column: opts.start.column, line: opts.start.line } } else if (opts.index) { start = this.positionInside(opts.index) } if (opts.end) { end = { column: opts.end.column, line: opts.end.line } } else if (typeof opts.endIndex === 'number') { end = this.positionInside(opts.endIndex) } else if (opts.index) { end = this.positionInside(opts.index + 1) } } if ( end.line < start.line || (end.line === start.line && end.column <= start.column) ) { end = { column: start.column + 1, line: start.line } } return { end, start } } raw(prop, defaultType) { let str = new Stringifier() return str.raw(this, prop, defaultType) } remove() { if (this.parent) { this.parent.removeChild(this) } this.parent = undefined return this } replaceWith(...nodes) { if (this.parent) { let bookmark = this let foundSelf = false for (let node of nodes) { if (node === this) { foundSelf = true } else if (foundSelf) { this.parent.insertAfter(bookmark, node) bookmark = node } else { this.parent.insertBefore(bookmark, node) } } if (!foundSelf) { this.remove() } } return this } root() { let result = this while (result.parent && result.parent.type !== 'document') { result = result.parent } return result } toJSON(_, inputs) { let fixed = {} let emitInputs = inputs == null inputs = inputs || new Map() let inputsNextIndex = 0 for (let name in this) { if (!Object.prototype.hasOwnProperty.call(this, name)) { /* c8 ignore next 2 */ continue } if (name === 'parent' || name === 'proxyCache') continue let value = this[name] if (Array.isArray(value)) { fixed[name] = value.map(i => { if (typeof i === 'object' && i.toJSON) { return i.toJSON(null, inputs) } else { return i } }) } else if (typeof value === 'object' && value.toJSON) { fixed[name] = value.toJSON(null, inputs) } else if (name === 'source') { let inputId = inputs.get(value.input) if (inputId == null) { inputId = inputsNextIndex inputs.set(value.input, inputsNextIndex) inputsNextIndex++ } fixed[name] = { end: value.end, inputId, start: value.start } } else { fixed[name] = value } } if (emitInputs) { fixed.inputs = [...inputs.keys()].map(input => input.toJSON()) } return fixed } toProxy() { if (!this.proxyCache) { this.proxyCache = new Proxy(this, this.getProxyProcessor()) } return this.proxyCache } toString(stringifier = stringify) { if (stringifier.stringify) stringifier = stringifier.stringify let result = '' stringifier(this, i => { result += i }) return result } warn(result, text, opts) { let data = { node: this } for (let i in opts) data[i] = opts[i] return result.warn(text, data) } } module.exports = Node Node.default = Node /***/ }), /***/ 7520: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(7191); /***/ }), /***/ 7661: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let MapGenerator = __webpack_require__(1670) let parse = __webpack_require__(4295) const Result = __webpack_require__(9055) let stringify = __webpack_require__(633) let warnOnce = __webpack_require__(3122) class NoWorkResult { get content() { return this.result.css } get css() { return this.result.css } get map() { return this.result.map } get messages() { return [] } get opts() { return this.result.opts } get processor() { return this.result.processor } get root() { if (this._root) { return this._root } let root let parser = parse try { root = parser(this._css, this._opts) } catch (error) { this.error = error } if (this.error) { throw this.error } else { this._root = root return root } } get [Symbol.toStringTag]() { return 'NoWorkResult' } constructor(processor, css, opts) { css = css.toString() this.stringified = false this._processor = processor this._css = css this._opts = opts this._map = undefined let root let str = stringify this.result = new Result(this._processor, root, this._opts) this.result.css = css let self = this Object.defineProperty(this.result, 'root', { get() { return self.root } }) let map = new MapGenerator(str, root, this._opts, css) if (map.isMap()) { let [generatedCSS, generatedMap] = map.generate() if (generatedCSS) { this.result.css = generatedCSS } if (generatedMap) { this.result.map = generatedMap } } else { map.clearAnnotation() this.result.css = map.css } } async() { if (this.error) return Promise.reject(this.error) return Promise.resolve(this.result) } catch(onRejected) { return this.async().catch(onRejected) } finally(onFinally) { return this.async().then(onFinally, onFinally) } sync() { if (this.error) throw this.error return this.result } then(onFulfilled, onRejected) { if (false) {} return this.async().then(onFulfilled, onRejected) } toString() { return this._css } warnings() { return [] } } module.exports = NoWorkResult NoWorkResult.default = NoWorkResult /***/ }), /***/ 7734: /***/ ((module) => { "use strict"; // do not edit .js files directly - edit src/index.jst var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; module.exports = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if ((a instanceof Map) && (b instanceof Map)) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false; return true; } if ((a instanceof Set) && (b instanceof Set)) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; return true; } if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } // true if both NaN, false otherwise return a!==a && b!==b; }; /***/ }), /***/ 8021: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; var __webpack_unused_export__; /*istanbul ignore start*/ __webpack_unused_export__ = ({ value: true }); exports.JJ = diffChars; __webpack_unused_export__ = void 0; /*istanbul ignore end*/ var /*istanbul ignore start*/ _base = _interopRequireDefault(__webpack_require__(5417)) /*istanbul ignore end*/ ; /*istanbul ignore start*/ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /*istanbul ignore end*/ var characterDiff = new /*istanbul ignore start*/ _base /*istanbul ignore end*/ . /*istanbul ignore start*/ default /*istanbul ignore end*/ (); /*istanbul ignore start*/ __webpack_unused_export__ = characterDiff; /*istanbul ignore end*/ function diffChars(oldStr, newStr, options) { return characterDiff.diff(oldStr, newStr, options); } /***/ }), /***/ 8202: /***/ ((module) => { "use strict"; /** * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ExecutionEnvironment */ /*jslint evil: true */ var canUseDOM = !!( typeof window !== 'undefined' && window.document && window.document.createElement ); /** * Simple, lightweight module assisting with the detection and context of * Worker. Helps avoid circular dependencies and allows code to reason about * whether or not they are in a Worker, even if they never include the main * `ReactWorker` dependency. */ var ExecutionEnvironment = { canUseDOM: canUseDOM, canUseWorkers: typeof Worker !== 'undefined', canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent), canUseViewport: canUseDOM && !!window.screen, isInWorker: !canUseDOM // For now, this is true - might change in the future. }; module.exports = ExecutionEnvironment; /***/ }), /***/ 8491: /***/ ((module) => { var openParentheses = "(".charCodeAt(0); var closeParentheses = ")".charCodeAt(0); var singleQuote = "'".charCodeAt(0); var doubleQuote = '"'.charCodeAt(0); var backslash = "\\".charCodeAt(0); var slash = "/".charCodeAt(0); var comma = ",".charCodeAt(0); var colon = ":".charCodeAt(0); var star = "*".charCodeAt(0); var uLower = "u".charCodeAt(0); var uUpper = "U".charCodeAt(0); var plus = "+".charCodeAt(0); var isUnicodeRange = /^[a-f0-9?-]+$/i; module.exports = function(input) { var tokens = []; var value = input; var next, quote, prev, token, escape, escapePos, whitespacePos, parenthesesOpenPos; var pos = 0; var code = value.charCodeAt(pos); var max = value.length; var stack = [{ nodes: tokens }]; var balanced = 0; var parent; var name = ""; var before = ""; var after = ""; while (pos < max) { // Whitespaces if (code <= 32) { next = pos; do { next += 1; code = value.charCodeAt(next); } while (code <= 32); token = value.slice(pos, next); prev = tokens[tokens.length - 1]; if (code === closeParentheses && balanced) { after = token; } else if (prev && prev.type === "div") { prev.after = token; prev.sourceEndIndex += token.length; } else if ( code === comma || code === colon || (code === slash && value.charCodeAt(next + 1) !== star && (!parent || (parent && parent.type === "function" && parent.value !== "calc"))) ) { before = token; } else { tokens.push({ type: "space", sourceIndex: pos, sourceEndIndex: next, value: token }); } pos = next; // Quotes } else if (code === singleQuote || code === doubleQuote) { next = pos; quote = code === singleQuote ? "'" : '"'; token = { type: "string", sourceIndex: pos, quote: quote }; do { escape = false; next = value.indexOf(quote, next + 1); if (~next) { escapePos = next; while (value.charCodeAt(escapePos - 1) === backslash) { escapePos -= 1; escape = !escape; } } else { value += quote; next = value.length - 1; token.unclosed = true; } } while (escape); token.value = value.slice(pos + 1, next); token.sourceEndIndex = token.unclosed ? next : next + 1; tokens.push(token); pos = next + 1; code = value.charCodeAt(pos); // Comments } else if (code === slash && value.charCodeAt(pos + 1) === star) { next = value.indexOf("*/", pos); token = { type: "comment", sourceIndex: pos, sourceEndIndex: next + 2 }; if (next === -1) { token.unclosed = true; next = value.length; token.sourceEndIndex = next; } token.value = value.slice(pos + 2, next); tokens.push(token); pos = next + 2; code = value.charCodeAt(pos); // Operation within calc } else if ( (code === slash || code === star) && parent && parent.type === "function" && parent.value === "calc" ) { token = value[pos]; tokens.push({ type: "word", sourceIndex: pos - before.length, sourceEndIndex: pos + token.length, value: token }); pos += 1; code = value.charCodeAt(pos); // Dividers } else if (code === slash || code === comma || code === colon) { token = value[pos]; tokens.push({ type: "div", sourceIndex: pos - before.length, sourceEndIndex: pos + token.length, value: token, before: before, after: "" }); before = ""; pos += 1; code = value.charCodeAt(pos); // Open parentheses } else if (openParentheses === code) { // Whitespaces after open parentheses next = pos; do { next += 1; code = value.charCodeAt(next); } while (code <= 32); parenthesesOpenPos = pos; token = { type: "function", sourceIndex: pos - name.length, value: name, before: value.slice(parenthesesOpenPos + 1, next) }; pos = next; if (name === "url" && code !== singleQuote && code !== doubleQuote) { next -= 1; do { escape = false; next = value.indexOf(")", next + 1); if (~next) { escapePos = next; while (value.charCodeAt(escapePos - 1) === backslash) { escapePos -= 1; escape = !escape; } } else { value += ")"; next = value.length - 1; token.unclosed = true; } } while (escape); // Whitespaces before closed whitespacePos = next; do { whitespacePos -= 1; code = value.charCodeAt(whitespacePos); } while (code <= 32); if (parenthesesOpenPos < whitespacePos) { if (pos !== whitespacePos + 1) { token.nodes = [ { type: "word", sourceIndex: pos, sourceEndIndex: whitespacePos + 1, value: value.slice(pos, whitespacePos + 1) } ]; } else { token.nodes = []; } if (token.unclosed && whitespacePos + 1 !== next) { token.after = ""; token.nodes.push({ type: "space", sourceIndex: whitespacePos + 1, sourceEndIndex: next, value: value.slice(whitespacePos + 1, next) }); } else { token.after = value.slice(whitespacePos + 1, next); token.sourceEndIndex = next; } } else { token.after = ""; token.nodes = []; } pos = next + 1; token.sourceEndIndex = token.unclosed ? next : pos; code = value.charCodeAt(pos); tokens.push(token); } else { balanced += 1; token.after = ""; token.sourceEndIndex = pos + 1; tokens.push(token); stack.push(token); tokens = token.nodes = []; parent = token; } name = ""; // Close parentheses } else if (closeParentheses === code && balanced) { pos += 1; code = value.charCodeAt(pos); parent.after = after; parent.sourceEndIndex += after.length; after = ""; balanced -= 1; stack[stack.length - 1].sourceEndIndex = pos; stack.pop(); parent = stack[balanced]; tokens = parent.nodes; // Words } else { next = pos; do { if (code === backslash) { next += 1; } next += 1; code = value.charCodeAt(next); } while ( next < max && !( code <= 32 || code === singleQuote || code === doubleQuote || code === comma || code === colon || code === slash || code === openParentheses || (code === star && parent && parent.type === "function" && parent.value === "calc") || (code === slash && parent.type === "function" && parent.value === "calc") || (code === closeParentheses && balanced) ) ); token = value.slice(pos, next); if (openParentheses === code) { name = token; } else if ( (uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2)) ) { tokens.push({ type: "unicode-range", sourceIndex: pos, sourceEndIndex: next, value: token }); } else { tokens.push({ type: "word", sourceIndex: pos, sourceEndIndex: next, value: token }); } pos = next; } } for (pos = stack.length - 1; pos; pos -= 1) { stack[pos].unclosed = true; stack[pos].sourceEndIndex = value.length; } return stack[0].nodes; }; /***/ }), /***/ 9055: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Warning = __webpack_require__(5776) class Result { get content() { return this.css } constructor(processor, root, opts) { this.processor = processor this.messages = [] this.root = root this.opts = opts this.css = undefined this.map = undefined } toString() { return this.css } warn(text, opts = {}) { if (!opts.plugin) { if (this.lastPlugin && this.lastPlugin.postcssPlugin) { opts.plugin = this.lastPlugin.postcssPlugin } } let warning = new Warning(text, opts) this.messages.push(warning) return warning } warnings() { return this.messages.filter(i => i.type === 'warning') } } module.exports = Result Result.default = Result /***/ }), /***/ 9434: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Container = __webpack_require__(683) let LazyResult, Processor class Root extends Container { constructor(defaults) { super(defaults) this.type = 'root' if (!this.nodes) this.nodes = [] } normalize(child, sample, type) { let nodes = super.normalize(child) if (sample) { if (type === 'prepend') { if (this.nodes.length > 1) { sample.raws.before = this.nodes[1].raws.before } else { delete sample.raws.before } } else if (this.first !== sample) { for (let node of nodes) { node.raws.before = sample.raws.before } } } return nodes } removeChild(child, ignore) { let index = this.index(child) if (!ignore && index === 0 && this.nodes.length > 1) { this.nodes[1].raws.before = this.nodes[index].raws.before } return super.removeChild(child) } toResult(opts = {}) { let lazy = new LazyResult(new Processor(), this, opts) return lazy.stringify() } } Root.registerLazyResult = dependant => { LazyResult = dependant } Root.registerProcessor = dependant => { Processor = dependant } module.exports = Root Root.default = Root Container.registerRoot(Root) /***/ }), /***/ 9656: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { "use strict"; let Document = __webpack_require__(271) let LazyResult = __webpack_require__(448) let NoWorkResult = __webpack_require__(7661) let Root = __webpack_require__(9434) class Processor { constructor(plugins = []) { this.version = '8.5.3' this.plugins = this.normalize(plugins) } normalize(plugins) { let normalized = [] for (let i of plugins) { if (i.postcss === true) { i = i() } else if (i.postcss) { i = i.postcss } if (typeof i === 'object' && Array.isArray(i.plugins)) { normalized = normalized.concat(i.plugins) } else if (typeof i === 'object' && i.postcssPlugin) { normalized.push(i) } else if (typeof i === 'function') { normalized.push(i) } else if (typeof i === 'object' && (i.parse || i.stringify)) { if (false) {} } else { throw new Error(i + ' is not a PostCSS plugin') } } return normalized } process(css, opts = {}) { if ( !this.plugins.length && !opts.parser && !opts.stringifier && !opts.syntax ) { return new NoWorkResult(this, css, opts) } else { return new LazyResult(this, css, opts) } } use(plugin) { this.plugins = this.plugins.concat(this.normalize([plugin])) return this } } module.exports = Processor Processor.default = Processor Root.registerProcessor(Processor) Document.registerProcessor(Processor) /***/ }), /***/ 9681: /***/ ((module) => { var characterMap = { "À": "A", "Á": "A", "Â": "A", "Ã": "A", "Ä": "A", "Å": "A", "Ấ": "A", "Ắ": "A", "Ẳ": "A", "Ẵ": "A", "Ặ": "A", "Æ": "AE", "Ầ": "A", "Ằ": "A", "Ȃ": "A", "Ả": "A", "Ạ": "A", "Ẩ": "A", "Ẫ": "A", "Ậ": "A", "Ç": "C", "Ḉ": "C", "È": "E", "É": "E", "Ê": "E", "Ë": "E", "Ế": "E", "Ḗ": "E", "Ề": "E", "Ḕ": "E", "Ḝ": "E", "Ȇ": "E", "Ẻ": "E", "Ẽ": "E", "Ẹ": "E", "Ể": "E", "Ễ": "E", "Ệ": "E", "Ì": "I", "Í": "I", "Î": "I", "Ï": "I", "Ḯ": "I", "Ȋ": "I", "Ỉ": "I", "Ị": "I", "Ð": "D", "Ñ": "N", "Ò": "O", "Ó": "O", "Ô": "O", "Õ": "O", "Ö": "O", "Ø": "O", "Ố": "O", "Ṍ": "O", "Ṓ": "O", "Ȏ": "O", "Ỏ": "O", "Ọ": "O", "Ổ": "O", "Ỗ": "O", "Ộ": "O", "Ờ": "O", "Ở": "O", "Ỡ": "O", "Ớ": "O", "Ợ": "O", "Ù": "U", "Ú": "U", "Û": "U", "Ü": "U", "Ủ": "U", "Ụ": "U", "Ử": "U", "Ữ": "U", "Ự": "U", "Ý": "Y", "à": "a", "á": "a", "â": "a", "ã": "a", "ä": "a", "å": "a", "ấ": "a", "ắ": "a", "ẳ": "a", "ẵ": "a", "ặ": "a", "æ": "ae", "ầ": "a", "ằ": "a", "ȃ": "a", "ả": "a", "ạ": "a", "ẩ": "a", "ẫ": "a", "ậ": "a", "ç": "c", "ḉ": "c", "è": "e", "é": "e", "ê": "e", "ë": "e", "ế": "e", "ḗ": "e", "ề": "e", "ḕ": "e", "ḝ": "e", "ȇ": "e", "ẻ": "e", "ẽ": "e", "ẹ": "e", "ể": "e", "ễ": "e", "ệ": "e", "ì": "i", "í": "i", "î": "i", "ï": "i", "ḯ": "i", "ȋ": "i", "ỉ": "i", "ị": "i", "ð": "d", "ñ": "n", "ò": "o", "ó": "o", "ô": "o", "õ": "o", "ö": "o", "ø": "o", "ố": "o", "ṍ": "o", "ṓ": "o", "ȏ": "o", "ỏ": "o", "ọ": "o", "ổ": "o", "ỗ": "o", "ộ": "o", "ờ": "o", "ở": "o", "ỡ": "o", "ớ": "o", "ợ": "o", "ù": "u", "ú": "u", "û": "u", "ü": "u", "ủ": "u", "ụ": "u", "ử": "u", "ữ": "u", "ự": "u", "ý": "y", "ÿ": "y", "Ā": "A", "ā": "a", "Ă": "A", "ă": "a", "Ą": "A", "ą": "a", "Ć": "C", "ć": "c", "Ĉ": "C", "ĉ": "c", "Ċ": "C", "ċ": "c", "Č": "C", "č": "c", "C̆": "C", "c̆": "c", "Ď": "D", "ď": "d", "Đ": "D", "đ": "d", "Ē": "E", "ē": "e", "Ĕ": "E", "ĕ": "e", "Ė": "E", "ė": "e", "Ę": "E", "ę": "e", "Ě": "E", "ě": "e", "Ĝ": "G", "Ǵ": "G", "ĝ": "g", "ǵ": "g", "Ğ": "G", "ğ": "g", "Ġ": "G", "ġ": "g", "Ģ": "G", "ģ": "g", "Ĥ": "H", "ĥ": "h", "Ħ": "H", "ħ": "h", "Ḫ": "H", "ḫ": "h", "Ĩ": "I", "ĩ": "i", "Ī": "I", "ī": "i", "Ĭ": "I", "ĭ": "i", "Į": "I", "į": "i", "İ": "I", "ı": "i", "IJ": "IJ", "ij": "ij", "Ĵ": "J", "ĵ": "j", "Ķ": "K", "ķ": "k", "Ḱ": "K", "ḱ": "k", "K̆": "K", "k̆": "k", "Ĺ": "L", "ĺ": "l", "Ļ": "L", "ļ": "l", "Ľ": "L", "ľ": "l", "Ŀ": "L", "ŀ": "l", "Ł": "l", "ł": "l", "Ḿ": "M", "ḿ": "m", "M̆": "M", "m̆": "m", "Ń": "N", "ń": "n", "Ņ": "N", "ņ": "n", "Ň": "N", "ň": "n", "ʼn": "n", "N̆": "N", "n̆": "n", "Ō": "O", "ō": "o", "Ŏ": "O", "ŏ": "o", "Ő": "O", "ő": "o", "Œ": "OE", "œ": "oe", "P̆": "P", "p̆": "p", "Ŕ": "R", "ŕ": "r", "Ŗ": "R", "ŗ": "r", "Ř": "R", "ř": "r", "R̆": "R", "r̆": "r", "Ȓ": "R", "ȓ": "r", "Ś": "S", "ś": "s", "Ŝ": "S", "ŝ": "s", "Ş": "S", "Ș": "S", "ș": "s", "ş": "s", "Š": "S", "š": "s", "Ţ": "T", "ţ": "t", "ț": "t", "Ț": "T", "Ť": "T", "ť": "t", "Ŧ": "T", "ŧ": "t", "T̆": "T", "t̆": "t", "Ũ": "U", "ũ": "u", "Ū": "U", "ū": "u", "Ŭ": "U", "ŭ": "u", "Ů": "U", "ů": "u", "Ű": "U", "ű": "u", "Ų": "U", "ų": "u", "Ȗ": "U", "ȗ": "u", "V̆": "V", "v̆": "v", "Ŵ": "W", "ŵ": "w", "Ẃ": "W", "ẃ": "w", "X̆": "X", "x̆": "x", "Ŷ": "Y", "ŷ": "y", "Ÿ": "Y", "Y̆": "Y", "y̆": "y", "Ź": "Z", "ź": "z", "Ż": "Z", "ż": "z", "Ž": "Z", "ž": "z", "ſ": "s", "ƒ": "f", "Ơ": "O", "ơ": "o", "Ư": "U", "ư": "u", "Ǎ": "A", "ǎ": "a", "Ǐ": "I", "ǐ": "i", "Ǒ": "O", "ǒ": "o", "Ǔ": "U", "ǔ": "u", "Ǖ": "U", "ǖ": "u", "Ǘ": "U", "ǘ": "u", "Ǚ": "U", "ǚ": "u", "Ǜ": "U", "ǜ": "u", "Ứ": "U", "ứ": "u", "Ṹ": "U", "ṹ": "u", "Ǻ": "A", "ǻ": "a", "Ǽ": "AE", "ǽ": "ae", "Ǿ": "O", "ǿ": "o", "Þ": "TH", "þ": "th", "Ṕ": "P", "ṕ": "p", "Ṥ": "S", "ṥ": "s", "X́": "X", "x́": "x", "Ѓ": "Г", "ѓ": "г", "Ќ": "К", "ќ": "к", "A̋": "A", "a̋": "a", "E̋": "E", "e̋": "e", "I̋": "I", "i̋": "i", "Ǹ": "N", "ǹ": "n", "Ồ": "O", "ồ": "o", "Ṑ": "O", "ṑ": "o", "Ừ": "U", "ừ": "u", "Ẁ": "W", "ẁ": "w", "Ỳ": "Y", "ỳ": "y", "Ȁ": "A", "ȁ": "a", "Ȅ": "E", "ȅ": "e", "Ȉ": "I", "ȉ": "i", "Ȍ": "O", "ȍ": "o", "Ȑ": "R", "ȑ": "r", "Ȕ": "U", "ȕ": "u", "B̌": "B", "b̌": "b", "Č̣": "C", "č̣": "c", "Ê̌": "E", "ê̌": "e", "F̌": "F", "f̌": "f", "Ǧ": "G", "ǧ": "g", "Ȟ": "H", "ȟ": "h", "J̌": "J", "ǰ": "j", "Ǩ": "K", "ǩ": "k", "M̌": "M", "m̌": "m", "P̌": "P", "p̌": "p", "Q̌": "Q", "q̌": "q", "Ř̩": "R", "ř̩": "r", "Ṧ": "S", "ṧ": "s", "V̌": "V", "v̌": "v", "W̌": "W", "w̌": "w", "X̌": "X", "x̌": "x", "Y̌": "Y", "y̌": "y", "A̧": "A", "a̧": "a", "B̧": "B", "b̧": "b", "Ḑ": "D", "ḑ": "d", "Ȩ": "E", "ȩ": "e", "Ɛ̧": "E", "ɛ̧": "e", "Ḩ": "H", "ḩ": "h", "I̧": "I", "i̧": "i", "Ɨ̧": "I", "ɨ̧": "i", "M̧": "M", "m̧": "m", "O̧": "O", "o̧": "o", "Q̧": "Q", "q̧": "q", "U̧": "U", "u̧": "u", "X̧": "X", "x̧": "x", "Z̧": "Z", "z̧": "z", "й":"и", "Й":"И", "ё":"е", "Ё":"Е", }; var chars = Object.keys(characterMap).join('|'); var allAccents = new RegExp(chars, 'g'); var firstAccent = new RegExp(chars, ''); function matcher(match) { return characterMap[match]; } var removeAccents = function(string) { return string.replace(allAccents, matcher); }; var hasAccents = function(string) { return !!string.match(firstAccent); }; module.exports = removeAccents; module.exports.has = hasAccents; module.exports.remove = removeAccents; /***/ }), /***/ 9746: /***/ (() => { /* (ignored) */ /***/ }), /***/ 9977: /***/ (() => { /* (ignored) */ /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. (() => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { AlignmentControl: () => (/* reexport */ AlignmentControl), AlignmentToolbar: () => (/* reexport */ AlignmentToolbar), Autocomplete: () => (/* reexport */ autocomplete), BlockAlignmentControl: () => (/* reexport */ BlockAlignmentControl), BlockAlignmentToolbar: () => (/* reexport */ BlockAlignmentToolbar), BlockBreadcrumb: () => (/* reexport */ block_breadcrumb), BlockCanvas: () => (/* reexport */ block_canvas), BlockColorsStyleSelector: () => (/* reexport */ color_style_selector), BlockContextProvider: () => (/* reexport */ BlockContextProvider), BlockControls: () => (/* reexport */ block_controls), BlockEdit: () => (/* reexport */ BlockEdit), BlockEditorKeyboardShortcuts: () => (/* reexport */ keyboard_shortcuts), BlockEditorProvider: () => (/* reexport */ components_provider), BlockFormatControls: () => (/* reexport */ BlockFormatControls), BlockIcon: () => (/* reexport */ block_icon), BlockInspector: () => (/* reexport */ block_inspector), BlockList: () => (/* reexport */ BlockList), BlockMover: () => (/* reexport */ block_mover), BlockNavigationDropdown: () => (/* reexport */ dropdown), BlockPopover: () => (/* reexport */ block_popover), BlockPreview: () => (/* reexport */ block_preview), BlockSelectionClearer: () => (/* reexport */ BlockSelectionClearer), BlockSettingsMenu: () => (/* reexport */ block_settings_menu), BlockSettingsMenuControls: () => (/* reexport */ block_settings_menu_controls), BlockStyles: () => (/* reexport */ block_styles), BlockTitle: () => (/* reexport */ BlockTitle), BlockToolbar: () => (/* reexport */ BlockToolbar), BlockTools: () => (/* reexport */ BlockTools), BlockVerticalAlignmentControl: () => (/* reexport */ BlockVerticalAlignmentControl), BlockVerticalAlignmentToolbar: () => (/* reexport */ BlockVerticalAlignmentToolbar), ButtonBlockAppender: () => (/* reexport */ button_block_appender), ButtonBlockerAppender: () => (/* reexport */ ButtonBlockerAppender), ColorPalette: () => (/* reexport */ color_palette), ColorPaletteControl: () => (/* reexport */ ColorPaletteControl), ContrastChecker: () => (/* reexport */ contrast_checker), CopyHandler: () => (/* reexport */ CopyHandler), DefaultBlockAppender: () => (/* reexport */ DefaultBlockAppender), FontSizePicker: () => (/* reexport */ font_size_picker), HeadingLevelDropdown: () => (/* reexport */ HeadingLevelDropdown), HeightControl: () => (/* reexport */ HeightControl), InnerBlocks: () => (/* reexport */ inner_blocks), Inserter: () => (/* reexport */ inserter), InspectorAdvancedControls: () => (/* reexport */ InspectorAdvancedControls), InspectorControls: () => (/* reexport */ inspector_controls), JustifyContentControl: () => (/* reexport */ JustifyContentControl), JustifyToolbar: () => (/* reexport */ JustifyToolbar), LineHeightControl: () => (/* reexport */ line_height_control), LinkControl: () => (/* reexport */ link_control), MediaPlaceholder: () => (/* reexport */ media_placeholder), MediaReplaceFlow: () => (/* reexport */ media_replace_flow), MediaUpload: () => (/* reexport */ media_upload), MediaUploadCheck: () => (/* reexport */ check), MultiSelectScrollIntoView: () => (/* reexport */ MultiSelectScrollIntoView), NavigableToolbar: () => (/* reexport */ NavigableToolbar), ObserveTyping: () => (/* reexport */ observe_typing), PanelColorSettings: () => (/* reexport */ panel_color_settings), PlainText: () => (/* reexport */ plain_text), RecursionProvider: () => (/* reexport */ RecursionProvider), RichText: () => (/* reexport */ rich_text), RichTextShortcut: () => (/* reexport */ RichTextShortcut), RichTextToolbarButton: () => (/* reexport */ RichTextToolbarButton), SETTINGS_DEFAULTS: () => (/* reexport */ SETTINGS_DEFAULTS), SkipToSelectedBlock: () => (/* reexport */ SkipToSelectedBlock), ToolSelector: () => (/* reexport */ tool_selector), Typewriter: () => (/* reexport */ typewriter), URLInput: () => (/* reexport */ url_input), URLInputButton: () => (/* reexport */ url_input_button), URLPopover: () => (/* reexport */ url_popover), Warning: () => (/* reexport */ warning), WritingFlow: () => (/* reexport */ writing_flow), __experimentalBlockAlignmentMatrixControl: () => (/* reexport */ block_alignment_matrix_control), __experimentalBlockFullHeightAligmentControl: () => (/* reexport */ block_full_height_alignment_control), __experimentalBlockPatternSetup: () => (/* reexport */ block_pattern_setup), __experimentalBlockPatternsList: () => (/* reexport */ block_patterns_list), __experimentalBlockVariationPicker: () => (/* reexport */ block_variation_picker), __experimentalBlockVariationTransforms: () => (/* reexport */ block_variation_transforms), __experimentalBorderRadiusControl: () => (/* reexport */ BorderRadiusControl), __experimentalColorGradientControl: () => (/* reexport */ control), __experimentalColorGradientSettingsDropdown: () => (/* reexport */ ColorGradientSettingsDropdown), __experimentalDateFormatPicker: () => (/* reexport */ DateFormatPicker), __experimentalDuotoneControl: () => (/* reexport */ duotone_control), __experimentalFontAppearanceControl: () => (/* reexport */ FontAppearanceControl), __experimentalFontFamilyControl: () => (/* reexport */ FontFamilyControl), __experimentalGetBorderClassesAndStyles: () => (/* reexport */ getBorderClassesAndStyles), __experimentalGetColorClassesAndStyles: () => (/* reexport */ getColorClassesAndStyles), __experimentalGetElementClassName: () => (/* reexport */ __experimentalGetElementClassName), __experimentalGetGapCSSValue: () => (/* reexport */ getGapCSSValue), __experimentalGetGradientClass: () => (/* reexport */ __experimentalGetGradientClass), __experimentalGetGradientObjectByGradientValue: () => (/* reexport */ __experimentalGetGradientObjectByGradientValue), __experimentalGetShadowClassesAndStyles: () => (/* reexport */ getShadowClassesAndStyles), __experimentalGetSpacingClassesAndStyles: () => (/* reexport */ getSpacingClassesAndStyles), __experimentalImageEditor: () => (/* reexport */ ImageEditor), __experimentalImageSizeControl: () => (/* reexport */ ImageSizeControl), __experimentalImageURLInputUI: () => (/* reexport */ ImageURLInputUI), __experimentalInspectorPopoverHeader: () => (/* reexport */ InspectorPopoverHeader), __experimentalLetterSpacingControl: () => (/* reexport */ LetterSpacingControl), __experimentalLibrary: () => (/* reexport */ library), __experimentalLinkControl: () => (/* reexport */ DeprecatedExperimentalLinkControl), __experimentalLinkControlSearchInput: () => (/* reexport */ __experimentalLinkControlSearchInput), __experimentalLinkControlSearchItem: () => (/* reexport */ __experimentalLinkControlSearchItem), __experimentalLinkControlSearchResults: () => (/* reexport */ __experimentalLinkControlSearchResults), __experimentalListView: () => (/* reexport */ components_list_view), __experimentalPanelColorGradientSettings: () => (/* reexport */ panel_color_gradient_settings), __experimentalPreviewOptions: () => (/* reexport */ PreviewOptions), __experimentalPublishDateTimePicker: () => (/* reexport */ publish_date_time_picker), __experimentalRecursionProvider: () => (/* reexport */ DeprecatedExperimentalRecursionProvider), __experimentalResponsiveBlockControl: () => (/* reexport */ responsive_block_control), __experimentalSpacingSizesControl: () => (/* reexport */ SpacingSizesControl), __experimentalTextDecorationControl: () => (/* reexport */ TextDecorationControl), __experimentalTextTransformControl: () => (/* reexport */ TextTransformControl), __experimentalUnitControl: () => (/* reexport */ UnitControl), __experimentalUseBlockOverlayActive: () => (/* reexport */ useBlockOverlayActive), __experimentalUseBlockPreview: () => (/* reexport */ useBlockPreview), __experimentalUseBorderProps: () => (/* reexport */ useBorderProps), __experimentalUseColorProps: () => (/* reexport */ useColorProps), __experimentalUseCustomSides: () => (/* reexport */ useCustomSides), __experimentalUseGradient: () => (/* reexport */ __experimentalUseGradient), __experimentalUseHasRecursion: () => (/* reexport */ DeprecatedExperimentalUseHasRecursion), __experimentalUseMultipleOriginColorsAndGradients: () => (/* reexport */ useMultipleOriginColorsAndGradients), __experimentalUseResizeCanvas: () => (/* reexport */ useResizeCanvas), __experimentalWritingModeControl: () => (/* reexport */ WritingModeControl), __unstableBlockNameContext: () => (/* reexport */ block_name_context), __unstableBlockSettingsMenuFirstItem: () => (/* reexport */ block_settings_menu_first_item), __unstableBlockToolbarLastItem: () => (/* reexport */ block_toolbar_last_item), __unstableEditorStyles: () => (/* reexport */ editor_styles), __unstableIframe: () => (/* reexport */ iframe), __unstableInserterMenuExtension: () => (/* reexport */ inserter_menu_extension), __unstableRichTextInputEvent: () => (/* reexport */ __unstableRichTextInputEvent), __unstableUseBlockSelectionClearer: () => (/* reexport */ useBlockSelectionClearer), __unstableUseClipboardHandler: () => (/* reexport */ __unstableUseClipboardHandler), __unstableUseMouseMoveTypingReset: () => (/* reexport */ useMouseMoveTypingReset), __unstableUseTypewriter: () => (/* reexport */ useTypewriter), __unstableUseTypingObserver: () => (/* reexport */ useTypingObserver), createCustomColorsHOC: () => (/* reexport */ createCustomColorsHOC), getColorClassName: () => (/* reexport */ getColorClassName), getColorObjectByAttributeValues: () => (/* reexport */ getColorObjectByAttributeValues), getColorObjectByColorValue: () => (/* reexport */ getColorObjectByColorValue), getComputedFluidTypographyValue: () => (/* reexport */ getComputedFluidTypographyValue), getCustomValueFromPreset: () => (/* reexport */ getCustomValueFromPreset), getFontSize: () => (/* reexport */ utils_getFontSize), getFontSizeClass: () => (/* reexport */ getFontSizeClass), getFontSizeObjectByValue: () => (/* reexport */ utils_getFontSizeObjectByValue), getGradientSlugByValue: () => (/* reexport */ getGradientSlugByValue), getGradientValueBySlug: () => (/* reexport */ getGradientValueBySlug), getPxFromCssUnit: () => (/* reexport */ get_px_from_css_unit), getSpacingPresetCssVar: () => (/* reexport */ getSpacingPresetCssVar), getTypographyClassesAndStyles: () => (/* reexport */ getTypographyClassesAndStyles), isValueSpacingPreset: () => (/* reexport */ isValueSpacingPreset), privateApis: () => (/* reexport */ privateApis), store: () => (/* reexport */ store), storeConfig: () => (/* reexport */ storeConfig), transformStyles: () => (/* reexport */ transform_styles), useBlockBindingsUtils: () => (/* reexport */ useBlockBindingsUtils), useBlockCommands: () => (/* reexport */ useBlockCommands), useBlockDisplayInformation: () => (/* reexport */ useBlockDisplayInformation), useBlockEditContext: () => (/* reexport */ useBlockEditContext), useBlockEditingMode: () => (/* reexport */ useBlockEditingMode), useBlockProps: () => (/* reexport */ use_block_props_useBlockProps), useCachedTruthy: () => (/* reexport */ useCachedTruthy), useHasRecursion: () => (/* reexport */ useHasRecursion), useInnerBlocksProps: () => (/* reexport */ useInnerBlocksProps), useSetting: () => (/* reexport */ useSetting), useSettings: () => (/* reexport */ use_settings_useSettings), useStyleOverride: () => (/* reexport */ useStyleOverride), withColorContext: () => (/* reexport */ with_color_context), withColors: () => (/* reexport */ withColors), withFontSizes: () => (/* reexport */ with_font_sizes) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/private-selectors.js var private_selectors_namespaceObject = {}; __webpack_require__.r(private_selectors_namespaceObject); __webpack_require__.d(private_selectors_namespaceObject, { getAllPatterns: () => (getAllPatterns), getBlockRemovalRules: () => (getBlockRemovalRules), getBlockSettings: () => (getBlockSettings), getBlockStyles: () => (getBlockStyles), getBlockWithoutAttributes: () => (getBlockWithoutAttributes), getClosestAllowedInsertionPoint: () => (getClosestAllowedInsertionPoint), getClosestAllowedInsertionPointForPattern: () => (getClosestAllowedInsertionPointForPattern), getContentLockingParent: () => (getContentLockingParent), getEnabledBlockParents: () => (getEnabledBlockParents), getEnabledClientIdsTree: () => (getEnabledClientIdsTree), getExpandedBlock: () => (getExpandedBlock), getInserterMediaCategories: () => (getInserterMediaCategories), getInsertionPoint: () => (getInsertionPoint), getLastFocus: () => (getLastFocus), getLastInsertedBlocksClientIds: () => (getLastInsertedBlocksClientIds), getOpenedBlockSettingsMenu: () => (getOpenedBlockSettingsMenu), getParentSectionBlock: () => (getParentSectionBlock), getPatternBySlug: () => (getPatternBySlug), getRegisteredInserterMediaCategories: () => (getRegisteredInserterMediaCategories), getRemovalPromptData: () => (getRemovalPromptData), getReusableBlocks: () => (getReusableBlocks), getSectionRootClientId: () => (getSectionRootClientId), getStyleOverrides: () => (getStyleOverrides), getTemporarilyEditingAsBlocks: () => (getTemporarilyEditingAsBlocks), getTemporarilyEditingFocusModeToRevert: () => (getTemporarilyEditingFocusModeToRevert), getZoomLevel: () => (getZoomLevel), hasAllowedPatterns: () => (hasAllowedPatterns), isBlockInterfaceHidden: () => (private_selectors_isBlockInterfaceHidden), isBlockSubtreeDisabled: () => (isBlockSubtreeDisabled), isDragging: () => (private_selectors_isDragging), isSectionBlock: () => (isSectionBlock), isZoomOut: () => (isZoomOut) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); __webpack_require__.d(selectors_namespaceObject, { __experimentalGetActiveBlockIdByBlockNames: () => (__experimentalGetActiveBlockIdByBlockNames), __experimentalGetAllowedBlocks: () => (__experimentalGetAllowedBlocks), __experimentalGetAllowedPatterns: () => (__experimentalGetAllowedPatterns), __experimentalGetBlockListSettingsForBlocks: () => (__experimentalGetBlockListSettingsForBlocks), __experimentalGetDirectInsertBlock: () => (__experimentalGetDirectInsertBlock), __experimentalGetGlobalBlocksByName: () => (__experimentalGetGlobalBlocksByName), __experimentalGetLastBlockAttributeChanges: () => (__experimentalGetLastBlockAttributeChanges), __experimentalGetParsedPattern: () => (__experimentalGetParsedPattern), __experimentalGetPatternTransformItems: () => (__experimentalGetPatternTransformItems), __experimentalGetPatternsByBlockTypes: () => (__experimentalGetPatternsByBlockTypes), __experimentalGetReusableBlockTitle: () => (__experimentalGetReusableBlockTitle), __unstableGetBlockWithoutInnerBlocks: () => (__unstableGetBlockWithoutInnerBlocks), __unstableGetClientIdWithClientIdsTree: () => (__unstableGetClientIdWithClientIdsTree), __unstableGetClientIdsTree: () => (__unstableGetClientIdsTree), __unstableGetContentLockingParent: () => (__unstableGetContentLockingParent), __unstableGetEditorMode: () => (__unstableGetEditorMode), __unstableGetSelectedBlocksWithPartialSelection: () => (__unstableGetSelectedBlocksWithPartialSelection), __unstableGetTemporarilyEditingAsBlocks: () => (__unstableGetTemporarilyEditingAsBlocks), __unstableGetTemporarilyEditingFocusModeToRevert: () => (__unstableGetTemporarilyEditingFocusModeToRevert), __unstableGetVisibleBlocks: () => (__unstableGetVisibleBlocks), __unstableHasActiveBlockOverlayActive: () => (__unstableHasActiveBlockOverlayActive), __unstableIsFullySelected: () => (__unstableIsFullySelected), __unstableIsLastBlockChangeIgnored: () => (__unstableIsLastBlockChangeIgnored), __unstableIsSelectionCollapsed: () => (__unstableIsSelectionCollapsed), __unstableIsSelectionMergeable: () => (__unstableIsSelectionMergeable), __unstableIsWithinBlockOverlay: () => (__unstableIsWithinBlockOverlay), __unstableSelectionHasUnmergeableBlock: () => (__unstableSelectionHasUnmergeableBlock), areInnerBlocksControlled: () => (areInnerBlocksControlled), canEditBlock: () => (canEditBlock), canInsertBlockType: () => (canInsertBlockType), canInsertBlocks: () => (canInsertBlocks), canLockBlockType: () => (canLockBlockType), canMoveBlock: () => (canMoveBlock), canMoveBlocks: () => (canMoveBlocks), canRemoveBlock: () => (canRemoveBlock), canRemoveBlocks: () => (canRemoveBlocks), didAutomaticChange: () => (didAutomaticChange), getAdjacentBlockClientId: () => (getAdjacentBlockClientId), getAllowedBlocks: () => (getAllowedBlocks), getBlock: () => (getBlock), getBlockAttributes: () => (getBlockAttributes), getBlockCount: () => (getBlockCount), getBlockEditingMode: () => (getBlockEditingMode), getBlockHierarchyRootClientId: () => (getBlockHierarchyRootClientId), getBlockIndex: () => (getBlockIndex), getBlockInsertionPoint: () => (getBlockInsertionPoint), getBlockListSettings: () => (getBlockListSettings), getBlockMode: () => (getBlockMode), getBlockName: () => (getBlockName), getBlockNamesByClientId: () => (getBlockNamesByClientId), getBlockOrder: () => (getBlockOrder), getBlockParents: () => (getBlockParents), getBlockParentsByBlockName: () => (getBlockParentsByBlockName), getBlockRootClientId: () => (getBlockRootClientId), getBlockSelectionEnd: () => (getBlockSelectionEnd), getBlockSelectionStart: () => (getBlockSelectionStart), getBlockTransformItems: () => (getBlockTransformItems), getBlocks: () => (getBlocks), getBlocksByClientId: () => (getBlocksByClientId), getBlocksByName: () => (getBlocksByName), getClientIdsOfDescendants: () => (getClientIdsOfDescendants), getClientIdsWithDescendants: () => (getClientIdsWithDescendants), getDirectInsertBlock: () => (getDirectInsertBlock), getDraggedBlockClientIds: () => (getDraggedBlockClientIds), getFirstMultiSelectedBlockClientId: () => (getFirstMultiSelectedBlockClientId), getGlobalBlockCount: () => (getGlobalBlockCount), getHoveredBlockClientId: () => (getHoveredBlockClientId), getInserterItems: () => (getInserterItems), getLastMultiSelectedBlockClientId: () => (getLastMultiSelectedBlockClientId), getLowestCommonAncestorWithSelectedBlock: () => (getLowestCommonAncestorWithSelectedBlock), getMultiSelectedBlockClientIds: () => (getMultiSelectedBlockClientIds), getMultiSelectedBlocks: () => (getMultiSelectedBlocks), getMultiSelectedBlocksEndClientId: () => (getMultiSelectedBlocksEndClientId), getMultiSelectedBlocksStartClientId: () => (getMultiSelectedBlocksStartClientId), getNextBlockClientId: () => (getNextBlockClientId), getPatternsByBlockTypes: () => (getPatternsByBlockTypes), getPreviousBlockClientId: () => (getPreviousBlockClientId), getSelectedBlock: () => (getSelectedBlock), getSelectedBlockClientId: () => (getSelectedBlockClientId), getSelectedBlockClientIds: () => (getSelectedBlockClientIds), getSelectedBlockCount: () => (getSelectedBlockCount), getSelectedBlocksInitialCaretPosition: () => (getSelectedBlocksInitialCaretPosition), getSelectionEnd: () => (getSelectionEnd), getSelectionStart: () => (getSelectionStart), getSettings: () => (getSettings), getTemplate: () => (getTemplate), getTemplateLock: () => (getTemplateLock), hasBlockMovingClientId: () => (hasBlockMovingClientId), hasDraggedInnerBlock: () => (hasDraggedInnerBlock), hasInserterItems: () => (hasInserterItems), hasMultiSelection: () => (hasMultiSelection), hasSelectedBlock: () => (hasSelectedBlock), hasSelectedInnerBlock: () => (hasSelectedInnerBlock), isAncestorBeingDragged: () => (isAncestorBeingDragged), isAncestorMultiSelected: () => (isAncestorMultiSelected), isBlockBeingDragged: () => (isBlockBeingDragged), isBlockHighlighted: () => (isBlockHighlighted), isBlockInsertionPointVisible: () => (isBlockInsertionPointVisible), isBlockMultiSelected: () => (isBlockMultiSelected), isBlockSelected: () => (isBlockSelected), isBlockValid: () => (isBlockValid), isBlockVisible: () => (isBlockVisible), isBlockWithinSelection: () => (isBlockWithinSelection), isCaretWithinFormattedText: () => (isCaretWithinFormattedText), isDraggingBlocks: () => (isDraggingBlocks), isFirstMultiSelectedBlock: () => (isFirstMultiSelectedBlock), isGroupable: () => (isGroupable), isLastBlockChangePersistent: () => (isLastBlockChangePersistent), isMultiSelecting: () => (selectors_isMultiSelecting), isNavigationMode: () => (isNavigationMode), isSelectionEnabled: () => (selectors_isSelectionEnabled), isTyping: () => (selectors_isTyping), isUngroupable: () => (isUngroupable), isValidTemplate: () => (isValidTemplate), wasBlockJustInserted: () => (wasBlockJustInserted) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/private-actions.js var private_actions_namespaceObject = {}; __webpack_require__.r(private_actions_namespaceObject); __webpack_require__.d(private_actions_namespaceObject, { __experimentalUpdateSettings: () => (__experimentalUpdateSettings), clearBlockRemovalPrompt: () => (clearBlockRemovalPrompt), deleteStyleOverride: () => (deleteStyleOverride), ensureDefaultBlock: () => (ensureDefaultBlock), expandBlock: () => (expandBlock), hideBlockInterface: () => (hideBlockInterface), modifyContentLockBlock: () => (modifyContentLockBlock), privateRemoveBlocks: () => (privateRemoveBlocks), resetZoomLevel: () => (resetZoomLevel), setBlockRemovalRules: () => (setBlockRemovalRules), setInsertionPoint: () => (setInsertionPoint), setLastFocus: () => (setLastFocus), setOpenedBlockSettingsMenu: () => (setOpenedBlockSettingsMenu), setStyleOverride: () => (setStyleOverride), setZoomLevel: () => (setZoomLevel), showBlockInterface: () => (showBlockInterface), startDragging: () => (startDragging), stopDragging: () => (stopDragging), stopEditingAsBlocks: () => (stopEditingAsBlocks) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); __webpack_require__.d(actions_namespaceObject, { __unstableDeleteSelection: () => (__unstableDeleteSelection), __unstableExpandSelection: () => (__unstableExpandSelection), __unstableMarkAutomaticChange: () => (__unstableMarkAutomaticChange), __unstableMarkLastChangeAsPersistent: () => (__unstableMarkLastChangeAsPersistent), __unstableMarkNextChangeAsNotPersistent: () => (__unstableMarkNextChangeAsNotPersistent), __unstableSaveReusableBlock: () => (__unstableSaveReusableBlock), __unstableSetEditorMode: () => (__unstableSetEditorMode), __unstableSetTemporarilyEditingAsBlocks: () => (__unstableSetTemporarilyEditingAsBlocks), __unstableSplitSelection: () => (__unstableSplitSelection), clearSelectedBlock: () => (clearSelectedBlock), duplicateBlocks: () => (duplicateBlocks), enterFormattedText: () => (enterFormattedText), exitFormattedText: () => (exitFormattedText), flashBlock: () => (flashBlock), hideInsertionPoint: () => (hideInsertionPoint), hoverBlock: () => (hoverBlock), insertAfterBlock: () => (insertAfterBlock), insertBeforeBlock: () => (insertBeforeBlock), insertBlock: () => (insertBlock), insertBlocks: () => (insertBlocks), insertDefaultBlock: () => (insertDefaultBlock), mergeBlocks: () => (mergeBlocks), moveBlockToPosition: () => (moveBlockToPosition), moveBlocksDown: () => (moveBlocksDown), moveBlocksToPosition: () => (moveBlocksToPosition), moveBlocksUp: () => (moveBlocksUp), multiSelect: () => (multiSelect), receiveBlocks: () => (receiveBlocks), registerInserterMediaCategory: () => (registerInserterMediaCategory), removeBlock: () => (removeBlock), removeBlocks: () => (removeBlocks), replaceBlock: () => (replaceBlock), replaceBlocks: () => (replaceBlocks), replaceInnerBlocks: () => (replaceInnerBlocks), resetBlocks: () => (resetBlocks), resetSelection: () => (resetSelection), selectBlock: () => (selectBlock), selectNextBlock: () => (selectNextBlock), selectPreviousBlock: () => (selectPreviousBlock), selectionChange: () => (selectionChange), setBlockEditingMode: () => (setBlockEditingMode), setBlockMovingClientId: () => (setBlockMovingClientId), setBlockVisibility: () => (setBlockVisibility), setHasControlledInnerBlocks: () => (setHasControlledInnerBlocks), setNavigationMode: () => (setNavigationMode), setTemplateValidity: () => (setTemplateValidity), showInsertionPoint: () => (showInsertionPoint), startDraggingBlocks: () => (startDraggingBlocks), startMultiSelect: () => (startMultiSelect), startTyping: () => (startTyping), stopDraggingBlocks: () => (stopDraggingBlocks), stopMultiSelect: () => (stopMultiSelect), stopTyping: () => (stopTyping), synchronizeTemplate: () => (synchronizeTemplate), toggleBlockHighlight: () => (toggleBlockHighlight), toggleBlockMode: () => (toggleBlockMode), toggleSelection: () => (toggleSelection), unsetBlockEditingMode: () => (unsetBlockEditingMode), updateBlock: () => (updateBlock), updateBlockAttributes: () => (updateBlockAttributes), updateBlockListSettings: () => (updateBlockListSettings), updateSettings: () => (updateSettings), validateBlocksToTemplate: () => (validateBlocksToTemplate) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/upload-media/build-module/store/selectors.js var store_selectors_namespaceObject = {}; __webpack_require__.r(store_selectors_namespaceObject); __webpack_require__.d(store_selectors_namespaceObject, { getItems: () => (getItems), getSettings: () => (selectors_getSettings), isUploading: () => (isUploading), isUploadingById: () => (isUploadingById), isUploadingByUrl: () => (isUploadingByUrl) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/upload-media/build-module/store/private-selectors.js var store_private_selectors_namespaceObject = {}; __webpack_require__.r(store_private_selectors_namespaceObject); __webpack_require__.d(store_private_selectors_namespaceObject, { getAllItems: () => (getAllItems), getBlobUrls: () => (getBlobUrls), getItem: () => (getItem), getPausedUploadForPost: () => (getPausedUploadForPost), isBatchUploaded: () => (isBatchUploaded), isPaused: () => (isPaused), isUploadingToPost: () => (isUploadingToPost) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/upload-media/build-module/store/actions.js var store_actions_namespaceObject = {}; __webpack_require__.r(store_actions_namespaceObject); __webpack_require__.d(store_actions_namespaceObject, { addItems: () => (addItems), cancelItem: () => (cancelItem) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/upload-media/build-module/store/private-actions.js var store_private_actions_namespaceObject = {}; __webpack_require__.r(store_private_actions_namespaceObject); __webpack_require__.d(store_private_actions_namespaceObject, { addItem: () => (addItem), finishOperation: () => (finishOperation), pauseQueue: () => (pauseQueue), prepareItem: () => (prepareItem), processItem: () => (processItem), removeItem: () => (removeItem), resumeQueue: () => (resumeQueue), revokeBlobUrls: () => (revokeBlobUrls), updateSettings: () => (private_actions_updateSettings), uploadItem: () => (uploadItem) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/components/global-styles/index.js var global_styles_namespaceObject = {}; __webpack_require__.r(global_styles_namespaceObject); __webpack_require__.d(global_styles_namespaceObject, { AdvancedPanel: () => (AdvancedPanel), BackgroundPanel: () => (background_panel_BackgroundImagePanel), BorderPanel: () => (BorderPanel), ColorPanel: () => (ColorPanel), DimensionsPanel: () => (DimensionsPanel), FiltersPanel: () => (FiltersPanel), GlobalStylesContext: () => (GlobalStylesContext), ImageSettingsPanel: () => (ImageSettingsPanel), TypographyPanel: () => (TypographyPanel), areGlobalStyleConfigsEqual: () => (areGlobalStyleConfigsEqual), getBlockCSSSelector: () => (getBlockCSSSelector), getBlockSelectors: () => (getBlockSelectors), getGlobalStylesChanges: () => (getGlobalStylesChanges), getLayoutStyles: () => (getLayoutStyles), toStyles: () => (toStyles), useGlobalSetting: () => (useGlobalSetting), useGlobalStyle: () => (useGlobalStyle), useGlobalStylesOutput: () => (useGlobalStylesOutput), useGlobalStylesOutputWithConfig: () => (useGlobalStylesOutputWithConfig), useGlobalStylesReset: () => (useGlobalStylesReset), useHasBackgroundPanel: () => (useHasBackgroundPanel), useHasBorderPanel: () => (useHasBorderPanel), useHasBorderPanelControls: () => (useHasBorderPanelControls), useHasColorPanel: () => (useHasColorPanel), useHasDimensionsPanel: () => (useHasDimensionsPanel), useHasFiltersPanel: () => (useHasFiltersPanel), useHasImageSettingsPanel: () => (useHasImageSettingsPanel), useHasTypographyPanel: () => (useHasTypographyPanel), useSettingsForBlockElement: () => (useSettingsForBlockElement) }); ;// external ["wp","blocks"] const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; ;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; ;// external ["wp","hooks"] const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; ;// ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js /** * WordPress dependencies */ const mayDisplayControlsKey = Symbol('mayDisplayControls'); const mayDisplayParentControlsKey = Symbol('mayDisplayParentControls'); const blockEditingModeKey = Symbol('blockEditingMode'); const blockBindingsKey = Symbol('blockBindings'); const isPreviewModeKey = Symbol('isPreviewMode'); const DEFAULT_BLOCK_EDIT_CONTEXT = { name: '', isSelected: false }; const Context = (0,external_wp_element_namespaceObject.createContext)(DEFAULT_BLOCK_EDIT_CONTEXT); const { Provider } = Context; /** * A hook that returns the block edit context. * * @return {Object} Block edit context */ function useBlockEditContext() { return (0,external_wp_element_namespaceObject.useContext)(Context); } ;// external ["wp","deprecated"] const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); // EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js var es6 = __webpack_require__(7734); var es6_default = /*#__PURE__*/__webpack_require__.n(es6); ;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// ./node_modules/@wordpress/block-editor/build-module/store/defaults.js /** * WordPress dependencies */ const PREFERENCES_DEFAULTS = { insertUsage: {} }; /** * The default editor settings * * @typedef {Object} SETTINGS_DEFAULT * @property {boolean} alignWide Enable/Disable Wide/Full Alignments * @property {boolean} supportsLayout Enable/disable layouts support in container blocks. * @property {boolean} imageEditing Image Editing settings set to false to disable. * @property {Array} imageSizes Available image sizes * @property {number} maxWidth Max width to constraint resizing * @property {boolean|Array} allowedBlockTypes Allowed block types * @property {boolean} hasFixedToolbar Whether or not the editor toolbar is fixed * @property {boolean} distractionFree Whether or not the editor UI is distraction free * @property {boolean} focusMode Whether the focus mode is enabled or not * @property {Array} styles Editor Styles * @property {boolean} keepCaretInsideBlock Whether caret should move between blocks in edit mode * @property {string} bodyPlaceholder Empty post placeholder * @property {string} titlePlaceholder Empty title placeholder * @property {boolean} canLockBlocks Whether the user can manage Block Lock state * @property {boolean} codeEditingEnabled Whether or not the user can switch to the code editor * @property {boolean} generateAnchors Enable/Disable auto anchor generation for Heading blocks * @property {boolean} enableOpenverseMediaCategory Enable/Disable the Openverse media category in the inserter. * @property {boolean} clearBlockSelection Whether the block editor should clear selection on mousedown when a block is not clicked. * @property {boolean} __experimentalCanUserUseUnfilteredHTML Whether the user should be able to use unfiltered HTML or the HTML should be filtered e.g., to remove elements considered insecure like iframes. * @property {boolean} __experimentalBlockDirectory Whether the user has enabled the Block Directory * @property {Array} __experimentalBlockPatterns Array of objects representing the block patterns * @property {Array} __experimentalBlockPatternCategories Array of objects representing the block pattern categories */ const SETTINGS_DEFAULTS = { alignWide: false, supportsLayout: true, // colors setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. colors: [{ name: (0,external_wp_i18n_namespaceObject.__)('Black'), slug: 'black', color: '#000000' }, { name: (0,external_wp_i18n_namespaceObject.__)('Cyan bluish gray'), slug: 'cyan-bluish-gray', color: '#abb8c3' }, { name: (0,external_wp_i18n_namespaceObject.__)('White'), slug: 'white', color: '#ffffff' }, { name: (0,external_wp_i18n_namespaceObject.__)('Pale pink'), slug: 'pale-pink', color: '#f78da7' }, { name: (0,external_wp_i18n_namespaceObject.__)('Vivid red'), slug: 'vivid-red', color: '#cf2e2e' }, { name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid orange'), slug: 'luminous-vivid-orange', color: '#ff6900' }, { name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid amber'), slug: 'luminous-vivid-amber', color: '#fcb900' }, { name: (0,external_wp_i18n_namespaceObject.__)('Light green cyan'), slug: 'light-green-cyan', color: '#7bdcb5' }, { name: (0,external_wp_i18n_namespaceObject.__)('Vivid green cyan'), slug: 'vivid-green-cyan', color: '#00d084' }, { name: (0,external_wp_i18n_namespaceObject.__)('Pale cyan blue'), slug: 'pale-cyan-blue', color: '#8ed1fc' }, { name: (0,external_wp_i18n_namespaceObject.__)('Vivid cyan blue'), slug: 'vivid-cyan-blue', color: '#0693e3' }, { name: (0,external_wp_i18n_namespaceObject.__)('Vivid purple'), slug: 'vivid-purple', color: '#9b51e0' }], // fontSizes setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. fontSizes: [{ name: (0,external_wp_i18n_namespaceObject._x)('Small', 'font size name'), size: 13, slug: 'small' }, { name: (0,external_wp_i18n_namespaceObject._x)('Normal', 'font size name'), size: 16, slug: 'normal' }, { name: (0,external_wp_i18n_namespaceObject._x)('Medium', 'font size name'), size: 20, slug: 'medium' }, { name: (0,external_wp_i18n_namespaceObject._x)('Large', 'font size name'), size: 36, slug: 'large' }, { name: (0,external_wp_i18n_namespaceObject._x)('Huge', 'font size name'), size: 42, slug: 'huge' }], // Image default size slug. imageDefaultSize: 'large', imageSizes: [{ slug: 'thumbnail', name: (0,external_wp_i18n_namespaceObject.__)('Thumbnail') }, { slug: 'medium', name: (0,external_wp_i18n_namespaceObject.__)('Medium') }, { slug: 'large', name: (0,external_wp_i18n_namespaceObject.__)('Large') }, { slug: 'full', name: (0,external_wp_i18n_namespaceObject.__)('Full Size') }], // Allow plugin to disable Image Editor if need be. imageEditing: true, // This is current max width of the block inner area // It's used to constraint image resizing and this value could be overridden later by themes maxWidth: 580, // Allowed block types for the editor, defaulting to true (all supported). allowedBlockTypes: true, // Maximum upload size in bytes allowed for the site. maxUploadFileSize: 0, // List of allowed mime types and file extensions. allowedMimeTypes: null, // Allows to disable block locking interface. canLockBlocks: true, // Allows to disable Openverse media category in the inserter. enableOpenverseMediaCategory: true, clearBlockSelection: true, __experimentalCanUserUseUnfilteredHTML: false, __experimentalBlockDirectory: false, __mobileEnablePageTemplates: false, __experimentalBlockPatterns: [], __experimentalBlockPatternCategories: [], isPreviewMode: false, // These settings will be completely revamped in the future. // The goal is to evolve this into an API which will instruct // the block inspector to animate transitions between what it // displays based on the relationship between the selected block // and its parent, and only enable it if the parent is controlling // its children blocks. blockInspectorAnimation: { animationParent: 'core/navigation', 'core/navigation': { enterDirection: 'leftToRight' }, 'core/navigation-submenu': { enterDirection: 'rightToLeft' }, 'core/navigation-link': { enterDirection: 'rightToLeft' }, 'core/search': { enterDirection: 'rightToLeft' }, 'core/social-links': { enterDirection: 'rightToLeft' }, 'core/page-list': { enterDirection: 'rightToLeft' }, 'core/spacer': { enterDirection: 'rightToLeft' }, 'core/home-link': { enterDirection: 'rightToLeft' }, 'core/site-title': { enterDirection: 'rightToLeft' }, 'core/site-logo': { enterDirection: 'rightToLeft' } }, generateAnchors: false, // gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults. // The setting is only kept for backward compatibility purposes. gradients: [{ name: (0,external_wp_i18n_namespaceObject.__)('Vivid cyan blue to vivid purple'), gradient: 'linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)', slug: 'vivid-cyan-blue-to-vivid-purple' }, { name: (0,external_wp_i18n_namespaceObject.__)('Light green cyan to vivid green cyan'), gradient: 'linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)', slug: 'light-green-cyan-to-vivid-green-cyan' }, { name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid amber to luminous vivid orange'), gradient: 'linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)', slug: 'luminous-vivid-amber-to-luminous-vivid-orange' }, { name: (0,external_wp_i18n_namespaceObject.__)('Luminous vivid orange to vivid red'), gradient: 'linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)', slug: 'luminous-vivid-orange-to-vivid-red' }, { name: (0,external_wp_i18n_namespaceObject.__)('Very light gray to cyan bluish gray'), gradient: 'linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)', slug: 'very-light-gray-to-cyan-bluish-gray' }, { name: (0,external_wp_i18n_namespaceObject.__)('Cool to warm spectrum'), gradient: 'linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)', slug: 'cool-to-warm-spectrum' }, { name: (0,external_wp_i18n_namespaceObject.__)('Blush light purple'), gradient: 'linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)', slug: 'blush-light-purple' }, { name: (0,external_wp_i18n_namespaceObject.__)('Blush bordeaux'), gradient: 'linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)', slug: 'blush-bordeaux' }, { name: (0,external_wp_i18n_namespaceObject.__)('Luminous dusk'), gradient: 'linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)', slug: 'luminous-dusk' }, { name: (0,external_wp_i18n_namespaceObject.__)('Pale ocean'), gradient: 'linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)', slug: 'pale-ocean' }, { name: (0,external_wp_i18n_namespaceObject.__)('Electric grass'), gradient: 'linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)', slug: 'electric-grass' }, { name: (0,external_wp_i18n_namespaceObject.__)('Midnight'), gradient: 'linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)', slug: 'midnight' }], __unstableResolvedAssets: { styles: [], scripts: [] } }; ;// ./node_modules/@wordpress/block-editor/build-module/store/array.js /** * Insert one or multiple elements into a given position of an array. * * @param {Array} array Source array. * @param {*} elements Elements to insert. * @param {number} index Insert Position. * * @return {Array} Result. */ function insertAt(array, elements, index) { return [...array.slice(0, index), ...(Array.isArray(elements) ? elements : [elements]), ...array.slice(index)]; } /** * Moves an element in an array. * * @param {Array} array Source array. * @param {number} from Source index. * @param {number} to Destination index. * @param {number} count Number of elements to move. * * @return {Array} Result. */ function moveTo(array, from, to, count = 1) { const withoutMovedElements = [...array]; withoutMovedElements.splice(from, count); return insertAt(withoutMovedElements, array.slice(from, from + count), to); } ;// ./node_modules/@wordpress/block-editor/build-module/store/private-keys.js const globalStylesDataKey = Symbol('globalStylesDataKey'); const globalStylesLinksDataKey = Symbol('globalStylesLinks'); const selectBlockPatternsKey = Symbol('selectBlockPatternsKey'); const reusableBlocksSelectKey = Symbol('reusableBlocksSelect'); const sectionRootClientIdKey = Symbol('sectionRootClientIdKey'); ;// external ["wp","privateApis"] const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; ;// ./node_modules/@wordpress/block-editor/build-module/lock-unlock.js /** * WordPress dependencies */ const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-editor'); ;// ./node_modules/@wordpress/block-editor/build-module/store/reducer.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { isContentBlock } = unlock(external_wp_blocks_namespaceObject.privateApis); const identity = x => x; /** * Given an array of blocks, returns an object where each key is a nesting * context, the value of which is an array of block client IDs existing within * that nesting context. * * @param {Array} blocks Blocks to map. * @param {?string} rootClientId Assumed root client ID. * * @return {Object} Block order map object. */ function mapBlockOrder(blocks, rootClientId = '') { const result = new Map(); const current = []; result.set(rootClientId, current); blocks.forEach(block => { const { clientId, innerBlocks } = block; current.push(clientId); mapBlockOrder(innerBlocks, clientId).forEach((order, subClientId) => { result.set(subClientId, order); }); }); return result; } /** * Given an array of blocks, returns an object where each key contains * the clientId of the block and the value is the parent of the block. * * @param {Array} blocks Blocks to map. * @param {?string} rootClientId Assumed root client ID. * * @return {Object} Block order map object. */ function mapBlockParents(blocks, rootClientId = '') { const result = []; const stack = [[rootClientId, blocks]]; while (stack.length) { const [parent, currentBlocks] = stack.shift(); currentBlocks.forEach(({ innerBlocks, ...block }) => { result.push([block.clientId, parent]); if (innerBlocks?.length) { stack.push([block.clientId, innerBlocks]); } }); } return result; } /** * Helper method to iterate through all blocks, recursing into inner blocks, * applying a transformation function to each one. * Returns a flattened object with the transformed blocks. * * @param {Array} blocks Blocks to flatten. * @param {Function} transform Transforming function to be applied to each block. * * @return {Array} Flattened object. */ function flattenBlocks(blocks, transform = identity) { const result = []; const stack = [...blocks]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); result.push([block.clientId, transform(block)]); } return result; } function getFlattenedClientIds(blocks) { const result = {}; const stack = [...blocks]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); result[block.clientId] = true; } return result; } /** * Given an array of blocks, returns an object containing all blocks, without * attributes, recursing into inner blocks. Keys correspond to the block client * ID, the value of which is the attributes object. * * @param {Array} blocks Blocks to flatten. * * @return {Array} Flattened block attributes object. */ function getFlattenedBlocksWithoutAttributes(blocks) { return flattenBlocks(blocks, block => { const { attributes, ...restBlock } = block; return restBlock; }); } /** * Given an array of blocks, returns an object containing all block attributes, * recursing into inner blocks. Keys correspond to the block client ID, the * value of which is the attributes object. * * @param {Array} blocks Blocks to flatten. * * @return {Array} Flattened block attributes object. */ function getFlattenedBlockAttributes(blocks) { return flattenBlocks(blocks, block => block.attributes); } /** * Returns true if the two object arguments have the same keys, or false * otherwise. * * @param {Object} a First object. * @param {Object} b Second object. * * @return {boolean} Whether the two objects have the same keys. */ function hasSameKeys(a, b) { return es6_default()(Object.keys(a), Object.keys(b)); } /** * Returns true if, given the currently dispatching action and the previously * dispatched action, the two actions are updating the same block attribute, or * false otherwise. * * @param {Object} action Currently dispatching action. * @param {Object} lastAction Previously dispatched action. * * @return {boolean} Whether actions are updating the same block attribute. */ function isUpdatingSameBlockAttribute(action, lastAction) { return action.type === 'UPDATE_BLOCK_ATTRIBUTES' && lastAction !== undefined && lastAction.type === 'UPDATE_BLOCK_ATTRIBUTES' && es6_default()(action.clientIds, lastAction.clientIds) && hasSameKeys(action.attributes, lastAction.attributes); } function updateBlockTreeForBlocks(state, blocks) { const treeToUpdate = state.tree; const stack = [...blocks]; const flattenedBlocks = [...blocks]; while (stack.length) { const block = stack.shift(); stack.push(...block.innerBlocks); flattenedBlocks.push(...block.innerBlocks); } // Create objects before mutating them, that way it's always defined. for (const block of flattenedBlocks) { treeToUpdate.set(block.clientId, {}); } for (const block of flattenedBlocks) { treeToUpdate.set(block.clientId, Object.assign(treeToUpdate.get(block.clientId), { ...state.byClientId.get(block.clientId), attributes: state.attributes.get(block.clientId), innerBlocks: block.innerBlocks.map(subBlock => treeToUpdate.get(subBlock.clientId)) })); } } function updateParentInnerBlocksInTree(state, updatedClientIds, updateChildrenOfUpdatedClientIds = false) { const treeToUpdate = state.tree; const uncontrolledParents = new Set([]); const controlledParents = new Set(); for (const clientId of updatedClientIds) { let current = updateChildrenOfUpdatedClientIds ? clientId : state.parents.get(clientId); do { if (state.controlledInnerBlocks[current]) { // Should stop on controlled blocks. // If we reach a controlled parent, break out of the loop. controlledParents.add(current); break; } else { // Else continue traversing up through parents. uncontrolledParents.add(current); current = state.parents.get(current); } } while (current !== undefined); } // To make sure the order of assignments doesn't matter, // we first create empty objects and mutates the inner blocks later. for (const clientId of uncontrolledParents) { treeToUpdate.set(clientId, { ...treeToUpdate.get(clientId) }); } for (const clientId of uncontrolledParents) { treeToUpdate.get(clientId).innerBlocks = (state.order.get(clientId) || []).map(subClientId => treeToUpdate.get(subClientId)); } // Controlled parent blocks, need a dedicated key for their inner blocks // to be used when doing getBlocks( controlledBlockClientId ). for (const clientId of controlledParents) { treeToUpdate.set('controlled||' + clientId, { innerBlocks: (state.order.get(clientId) || []).map(subClientId => treeToUpdate.get(subClientId)) }); } } /** * Higher-order reducer intended to compute full block objects key for each block in the post. * This is a denormalization to optimize the performance of the getBlock selectors and avoid * recomputing the block objects and avoid heavy memoization. * * @param {Function} reducer Original reducer function. * * @return {Function} Enhanced reducer function. */ const withBlockTree = reducer => (state = {}, action) => { const newState = reducer(state, action); if (newState === state) { return state; } newState.tree = state.tree ? state.tree : new Map(); switch (action.type) { case 'RECEIVE_BLOCKS': case 'INSERT_BLOCKS': { newState.tree = new Map(newState.tree); updateBlockTreeForBlocks(newState, action.blocks); updateParentInnerBlocksInTree(newState, action.rootClientId ? [action.rootClientId] : [''], true); break; } case 'UPDATE_BLOCK': newState.tree = new Map(newState.tree); newState.tree.set(action.clientId, { ...newState.tree.get(action.clientId), ...newState.byClientId.get(action.clientId), attributes: newState.attributes.get(action.clientId) }); updateParentInnerBlocksInTree(newState, [action.clientId], false); break; case 'SYNC_DERIVED_BLOCK_ATTRIBUTES': case 'UPDATE_BLOCK_ATTRIBUTES': { newState.tree = new Map(newState.tree); action.clientIds.forEach(clientId => { newState.tree.set(clientId, { ...newState.tree.get(clientId), attributes: newState.attributes.get(clientId) }); }); updateParentInnerBlocksInTree(newState, action.clientIds, false); break; } case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': { const inserterClientIds = getFlattenedClientIds(action.blocks); newState.tree = new Map(newState.tree); action.replacedClientIds.forEach(clientId => { newState.tree.delete(clientId); // Controlled inner blocks are only removed // if the block doesn't move to another position // otherwise their content will be lost. if (!inserterClientIds[clientId]) { newState.tree.delete('controlled||' + clientId); } }); updateBlockTreeForBlocks(newState, action.blocks); updateParentInnerBlocksInTree(newState, action.blocks.map(b => b.clientId), false); // If there are no replaced blocks, it means we're removing blocks so we need to update their parent. const parentsOfRemovedBlocks = []; for (const clientId of action.clientIds) { const parentId = state.parents.get(clientId); if (parentId !== undefined && (parentId === '' || newState.byClientId.get(parentId))) { parentsOfRemovedBlocks.push(parentId); } } updateParentInnerBlocksInTree(newState, parentsOfRemovedBlocks, true); break; } case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': const parentsOfRemovedBlocks = []; for (const clientId of action.clientIds) { const parentId = state.parents.get(clientId); if (parentId !== undefined && (parentId === '' || newState.byClientId.get(parentId))) { parentsOfRemovedBlocks.push(parentId); } } newState.tree = new Map(newState.tree); action.removedClientIds.forEach(clientId => { newState.tree.delete(clientId); newState.tree.delete('controlled||' + clientId); }); updateParentInnerBlocksInTree(newState, parentsOfRemovedBlocks, true); break; case 'MOVE_BLOCKS_TO_POSITION': { const updatedBlockUids = []; if (action.fromRootClientId) { updatedBlockUids.push(action.fromRootClientId); } else { updatedBlockUids.push(''); } if (action.toRootClientId) { updatedBlockUids.push(action.toRootClientId); } newState.tree = new Map(newState.tree); updateParentInnerBlocksInTree(newState, updatedBlockUids, true); break; } case 'MOVE_BLOCKS_UP': case 'MOVE_BLOCKS_DOWN': { const updatedBlockUids = [action.rootClientId ? action.rootClientId : '']; newState.tree = new Map(newState.tree); updateParentInnerBlocksInTree(newState, updatedBlockUids, true); break; } case 'SAVE_REUSABLE_BLOCK_SUCCESS': { const updatedBlockUids = []; newState.attributes.forEach((attributes, clientId) => { if (newState.byClientId.get(clientId).name === 'core/block' && attributes.ref === action.updatedId) { updatedBlockUids.push(clientId); } }); newState.tree = new Map(newState.tree); updatedBlockUids.forEach(clientId => { newState.tree.set(clientId, { ...newState.byClientId.get(clientId), attributes: newState.attributes.get(clientId), innerBlocks: newState.tree.get(clientId).innerBlocks }); }); updateParentInnerBlocksInTree(newState, updatedBlockUids, false); } } return newState; }; /** * Higher-order reducer intended to augment the blocks reducer, assigning an * `isPersistentChange` property value corresponding to whether a change in * state can be considered as persistent. All changes are considered persistent * except when updating the same block attribute as in the previous action. * * @param {Function} reducer Original reducer function. * * @return {Function} Enhanced reducer function. */ function withPersistentBlockChange(reducer) { let lastAction; let markNextChangeAsNotPersistent = false; let explicitPersistent; return (state, action) => { let nextState = reducer(state, action); let nextIsPersistentChange; if (action.type === 'SET_EXPLICIT_PERSISTENT') { var _state$isPersistentCh; explicitPersistent = action.isPersistentChange; nextIsPersistentChange = (_state$isPersistentCh = state.isPersistentChange) !== null && _state$isPersistentCh !== void 0 ? _state$isPersistentCh : true; } if (explicitPersistent !== undefined) { nextIsPersistentChange = explicitPersistent; return nextIsPersistentChange === nextState.isPersistentChange ? nextState : { ...nextState, isPersistentChange: nextIsPersistentChange }; } const isExplicitPersistentChange = action.type === 'MARK_LAST_CHANGE_AS_PERSISTENT' || markNextChangeAsNotPersistent; // Defer to previous state value (or default) unless changing or // explicitly marking as persistent. if (state === nextState && !isExplicitPersistentChange) { var _state$isPersistentCh2; markNextChangeAsNotPersistent = action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'; nextIsPersistentChange = (_state$isPersistentCh2 = state?.isPersistentChange) !== null && _state$isPersistentCh2 !== void 0 ? _state$isPersistentCh2 : true; if (state.isPersistentChange === nextIsPersistentChange) { return state; } return { ...nextState, isPersistentChange: nextIsPersistentChange }; } nextState = { ...nextState, isPersistentChange: isExplicitPersistentChange ? !markNextChangeAsNotPersistent : !isUpdatingSameBlockAttribute(action, lastAction) }; // In comparing against the previous action, consider only those which // would have qualified as one which would have been ignored or not // have resulted in a changed state. lastAction = action; markNextChangeAsNotPersistent = action.type === 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT'; return nextState; }; } /** * Higher-order reducer intended to augment the blocks reducer, assigning an * `isIgnoredChange` property value corresponding to whether a change in state * can be considered as ignored. A change is considered ignored when the result * of an action not incurred by direct user interaction. * * @param {Function} reducer Original reducer function. * * @return {Function} Enhanced reducer function. */ function withIgnoredBlockChange(reducer) { /** * Set of action types for which a blocks state change should be ignored. * * @type {Set} */ const IGNORED_ACTION_TYPES = new Set(['RECEIVE_BLOCKS']); return (state, action) => { const nextState = reducer(state, action); if (nextState !== state) { nextState.isIgnoredChange = IGNORED_ACTION_TYPES.has(action.type); } return nextState; }; } /** * Higher-order reducer targeting the combined blocks reducer, augmenting * block client IDs in remove action to include cascade of inner blocks. * * @param {Function} reducer Original reducer function. * * @return {Function} Enhanced reducer function. */ const withInnerBlocksRemoveCascade = reducer => (state, action) => { // Gets all children which need to be removed. const getAllChildren = clientIds => { let result = clientIds; for (let i = 0; i < result.length; i++) { if (!state.order.get(result[i]) || action.keepControlledInnerBlocks && action.keepControlledInnerBlocks[result[i]]) { continue; } if (result === clientIds) { result = [...result]; } result.push(...state.order.get(result[i])); } return result; }; if (state) { switch (action.type) { case 'REMOVE_BLOCKS': action = { ...action, type: 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN', removedClientIds: getAllChildren(action.clientIds) }; break; case 'REPLACE_BLOCKS': action = { ...action, type: 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN', replacedClientIds: getAllChildren(action.clientIds) }; break; } } return reducer(state, action); }; /** * Higher-order reducer which targets the combined blocks reducer and handles * the `RESET_BLOCKS` action. When dispatched, this action will replace all * blocks that exist in the post, leaving blocks that exist only in state (e.g. * reusable blocks and blocks controlled by inner blocks controllers) alone. * * @param {Function} reducer Original reducer function. * * @return {Function} Enhanced reducer function. */ const withBlockReset = reducer => (state, action) => { if (action.type === 'RESET_BLOCKS') { const newState = { ...state, byClientId: new Map(getFlattenedBlocksWithoutAttributes(action.blocks)), attributes: new Map(getFlattenedBlockAttributes(action.blocks)), order: mapBlockOrder(action.blocks), parents: new Map(mapBlockParents(action.blocks)), controlledInnerBlocks: {} }; newState.tree = new Map(state?.tree); updateBlockTreeForBlocks(newState, action.blocks); newState.tree.set('', { innerBlocks: action.blocks.map(subBlock => newState.tree.get(subBlock.clientId)) }); return newState; } return reducer(state, action); }; /** * Higher-order reducer which targets the combined blocks reducer and handles * the `REPLACE_INNER_BLOCKS` action. When dispatched, this action the state * should become equivalent to the execution of a `REMOVE_BLOCKS` action * containing all the child's of the root block followed by the execution of * `INSERT_BLOCKS` with the new blocks. * * @param {Function} reducer Original reducer function. * * @return {Function} Enhanced reducer function. */ const withReplaceInnerBlocks = reducer => (state, action) => { if (action.type !== 'REPLACE_INNER_BLOCKS') { return reducer(state, action); } // Finds every nested inner block controller. We must check the action blocks // and not just the block parent state because some inner block controllers // should be deleted if specified, whereas others should not be deleted. If // a controlled should not be deleted, then we need to avoid deleting its // inner blocks from the block state because its inner blocks will not be // attached to the block in the action. const nestedControllers = {}; if (Object.keys(state.controlledInnerBlocks).length) { const stack = [...action.blocks]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); if (!!state.controlledInnerBlocks[block.clientId]) { nestedControllers[block.clientId] = true; } } } // The `keepControlledInnerBlocks` prop will keep the inner blocks of the // marked block in the block state so that they can be reattached to the // marked block when we re-insert everything a few lines below. let stateAfterBlocksRemoval = state; if (state.order.get(action.rootClientId)) { stateAfterBlocksRemoval = reducer(stateAfterBlocksRemoval, { type: 'REMOVE_BLOCKS', keepControlledInnerBlocks: nestedControllers, clientIds: state.order.get(action.rootClientId) }); } let stateAfterInsert = stateAfterBlocksRemoval; if (action.blocks.length) { stateAfterInsert = reducer(stateAfterInsert, { ...action, type: 'INSERT_BLOCKS', index: 0 }); // We need to re-attach the controlled inner blocks to the blocks tree and // preserve their block order. Otherwise, an inner block controller's blocks // will be deleted entirely from its entity. const stateAfterInsertOrder = new Map(stateAfterInsert.order); Object.keys(nestedControllers).forEach(key => { if (state.order.get(key)) { stateAfterInsertOrder.set(key, state.order.get(key)); } }); stateAfterInsert.order = stateAfterInsertOrder; stateAfterInsert.tree = new Map(stateAfterInsert.tree); Object.keys(nestedControllers).forEach(_key => { const key = `controlled||${_key}`; if (state.tree.has(key)) { stateAfterInsert.tree.set(key, state.tree.get(key)); } }); } return stateAfterInsert; }; /** * Higher-order reducer which targets the combined blocks reducer and handles * the `SAVE_REUSABLE_BLOCK_SUCCESS` action. This action can't be handled by * regular reducers and needs a higher-order reducer since it needs access to * both `byClientId` and `attributes` simultaneously. * * @param {Function} reducer Original reducer function. * * @return {Function} Enhanced reducer function. */ const withSaveReusableBlock = reducer => (state, action) => { if (state && action.type === 'SAVE_REUSABLE_BLOCK_SUCCESS') { const { id, updatedId } = action; // If a temporary reusable block is saved, we swap the temporary id with the final one. if (id === updatedId) { return state; } state = { ...state }; state.attributes = new Map(state.attributes); state.attributes.forEach((attributes, clientId) => { const { name } = state.byClientId.get(clientId); if (name === 'core/block' && attributes.ref === id) { state.attributes.set(clientId, { ...attributes, ref: updatedId }); } }); } return reducer(state, action); }; /** * Higher-order reducer which removes blocks from state when switching parent block controlled state. * * @param {Function} reducer Original reducer function. * * @return {Function} Enhanced reducer function. */ const withResetControlledBlocks = reducer => (state, action) => { if (action.type === 'SET_HAS_CONTROLLED_INNER_BLOCKS') { // when switching a block from controlled to uncontrolled or inverse, // we need to remove its content first. const tempState = reducer(state, { type: 'REPLACE_INNER_BLOCKS', rootClientId: action.clientId, blocks: [] }); return reducer(tempState, action); } return reducer(state, action); }; /** * Reducer returning the blocks state. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ const blocks = (0,external_wp_compose_namespaceObject.pipe)(external_wp_data_namespaceObject.combineReducers, withSaveReusableBlock, // Needs to be before withBlockCache. withBlockTree, // Needs to be before withInnerBlocksRemoveCascade. withInnerBlocksRemoveCascade, withReplaceInnerBlocks, // Needs to be after withInnerBlocksRemoveCascade. withBlockReset, withPersistentBlockChange, withIgnoredBlockChange, withResetControlledBlocks)({ // The state is using a Map instead of a plain object for performance reasons. // You can run the "./test/performance.js" unit test to check the impact // code changes can have on this reducer. byClientId(state = new Map(), action) { switch (action.type) { case 'RECEIVE_BLOCKS': case 'INSERT_BLOCKS': { const newState = new Map(state); getFlattenedBlocksWithoutAttributes(action.blocks).forEach(([key, value]) => { newState.set(key, value); }); return newState; } case 'UPDATE_BLOCK': { // Ignore updates if block isn't known. if (!state.has(action.clientId)) { return state; } // Do nothing if only attributes change. const { attributes, ...changes } = action.updates; if (Object.values(changes).length === 0) { return state; } const newState = new Map(state); newState.set(action.clientId, { ...state.get(action.clientId), ...changes }); return newState; } case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': { if (!action.blocks) { return state; } const newState = new Map(state); action.replacedClientIds.forEach(clientId => { newState.delete(clientId); }); getFlattenedBlocksWithoutAttributes(action.blocks).forEach(([key, value]) => { newState.set(key, value); }); return newState; } case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': { const newState = new Map(state); action.removedClientIds.forEach(clientId => { newState.delete(clientId); }); return newState; } } return state; }, // The state is using a Map instead of a plain object for performance reasons. // You can run the "./test/performance.js" unit test to check the impact // code changes can have on this reducer. attributes(state = new Map(), action) { switch (action.type) { case 'RECEIVE_BLOCKS': case 'INSERT_BLOCKS': { const newState = new Map(state); getFlattenedBlockAttributes(action.blocks).forEach(([key, value]) => { newState.set(key, value); }); return newState; } case 'UPDATE_BLOCK': { // Ignore updates if block isn't known or there are no attribute changes. if (!state.get(action.clientId) || !action.updates.attributes) { return state; } const newState = new Map(state); newState.set(action.clientId, { ...state.get(action.clientId), ...action.updates.attributes }); return newState; } case 'SYNC_DERIVED_BLOCK_ATTRIBUTES': case 'UPDATE_BLOCK_ATTRIBUTES': { // Avoid a state change if none of the block IDs are known. if (action.clientIds.every(id => !state.get(id))) { return state; } let hasChange = false; const newState = new Map(state); for (const clientId of action.clientIds) { var _action$attributes; const updatedAttributeEntries = Object.entries(action.uniqueByBlock ? action.attributes[clientId] : (_action$attributes = action.attributes) !== null && _action$attributes !== void 0 ? _action$attributes : {}); if (updatedAttributeEntries.length === 0) { continue; } let hasUpdatedAttributes = false; const existingAttributes = state.get(clientId); const newAttributes = {}; updatedAttributeEntries.forEach(([key, value]) => { if (existingAttributes[key] !== value) { hasUpdatedAttributes = true; newAttributes[key] = value; } }); hasChange = hasChange || hasUpdatedAttributes; if (hasUpdatedAttributes) { newState.set(clientId, { ...existingAttributes, ...newAttributes }); } } return hasChange ? newState : state; } case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': { if (!action.blocks) { return state; } const newState = new Map(state); action.replacedClientIds.forEach(clientId => { newState.delete(clientId); }); getFlattenedBlockAttributes(action.blocks).forEach(([key, value]) => { newState.set(key, value); }); return newState; } case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': { const newState = new Map(state); action.removedClientIds.forEach(clientId => { newState.delete(clientId); }); return newState; } } return state; }, // The state is using a Map instead of a plain object for performance reasons. // You can run the "./test/performance.js" unit test to check the impact // code changes can have on this reducer. order(state = new Map(), action) { switch (action.type) { case 'RECEIVE_BLOCKS': { var _state$get; const blockOrder = mapBlockOrder(action.blocks); const newState = new Map(state); blockOrder.forEach((order, clientId) => { if (clientId !== '') { newState.set(clientId, order); } }); newState.set('', ((_state$get = state.get('')) !== null && _state$get !== void 0 ? _state$get : []).concat(blockOrder[''])); return newState; } case 'INSERT_BLOCKS': { const { rootClientId = '' } = action; const subState = state.get(rootClientId) || []; const mappedBlocks = mapBlockOrder(action.blocks, rootClientId); const { index = subState.length } = action; const newState = new Map(state); mappedBlocks.forEach((order, clientId) => { newState.set(clientId, order); }); newState.set(rootClientId, insertAt(subState, mappedBlocks.get(rootClientId), index)); return newState; } case 'MOVE_BLOCKS_TO_POSITION': { var _state$get$filter; const { fromRootClientId = '', toRootClientId = '', clientIds } = action; const { index = state.get(toRootClientId).length } = action; // Moving inside the same parent block. if (fromRootClientId === toRootClientId) { const subState = state.get(toRootClientId); const fromIndex = subState.indexOf(clientIds[0]); const newState = new Map(state); newState.set(toRootClientId, moveTo(state.get(toRootClientId), fromIndex, index, clientIds.length)); return newState; } // Moving from a parent block to another. const newState = new Map(state); newState.set(fromRootClientId, (_state$get$filter = state.get(fromRootClientId)?.filter(id => !clientIds.includes(id))) !== null && _state$get$filter !== void 0 ? _state$get$filter : []); newState.set(toRootClientId, insertAt(state.get(toRootClientId), clientIds, index)); return newState; } case 'MOVE_BLOCKS_UP': { const { clientIds, rootClientId = '' } = action; const firstClientId = clientIds[0]; const subState = state.get(rootClientId); if (!subState.length || firstClientId === subState[0]) { return state; } const firstIndex = subState.indexOf(firstClientId); const newState = new Map(state); newState.set(rootClientId, moveTo(subState, firstIndex, firstIndex - 1, clientIds.length)); return newState; } case 'MOVE_BLOCKS_DOWN': { const { clientIds, rootClientId = '' } = action; const firstClientId = clientIds[0]; const lastClientId = clientIds[clientIds.length - 1]; const subState = state.get(rootClientId); if (!subState.length || lastClientId === subState[subState.length - 1]) { return state; } const firstIndex = subState.indexOf(firstClientId); const newState = new Map(state); newState.set(rootClientId, moveTo(subState, firstIndex, firstIndex + 1, clientIds.length)); return newState; } case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': { const { clientIds } = action; if (!action.blocks) { return state; } const mappedBlocks = mapBlockOrder(action.blocks); const newState = new Map(state); action.replacedClientIds.forEach(clientId => { newState.delete(clientId); }); mappedBlocks.forEach((order, clientId) => { if (clientId !== '') { newState.set(clientId, order); } }); newState.forEach((order, clientId) => { const newSubOrder = Object.values(order).reduce((result, subClientId) => { if (subClientId === clientIds[0]) { return [...result, ...mappedBlocks.get('')]; } if (clientIds.indexOf(subClientId) === -1) { result.push(subClientId); } return result; }, []); newState.set(clientId, newSubOrder); }); return newState; } case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': { const newState = new Map(state); // Remove inner block ordering for removed blocks. action.removedClientIds.forEach(clientId => { newState.delete(clientId); }); newState.forEach((order, clientId) => { var _order$filter; const newSubOrder = (_order$filter = order?.filter(id => !action.removedClientIds.includes(id))) !== null && _order$filter !== void 0 ? _order$filter : []; if (newSubOrder.length !== order.length) { newState.set(clientId, newSubOrder); } }); return newState; } } return state; }, // While technically redundant data as the inverse of `order`, it serves as // an optimization for the selectors which derive the ancestry of a block. parents(state = new Map(), action) { switch (action.type) { case 'RECEIVE_BLOCKS': { const newState = new Map(state); mapBlockParents(action.blocks).forEach(([key, value]) => { newState.set(key, value); }); return newState; } case 'INSERT_BLOCKS': { const newState = new Map(state); mapBlockParents(action.blocks, action.rootClientId || '').forEach(([key, value]) => { newState.set(key, value); }); return newState; } case 'MOVE_BLOCKS_TO_POSITION': { const newState = new Map(state); action.clientIds.forEach(id => { newState.set(id, action.toRootClientId || ''); }); return newState; } case 'REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN': { const newState = new Map(state); action.replacedClientIds.forEach(clientId => { newState.delete(clientId); }); mapBlockParents(action.blocks, state.get(action.clientIds[0])).forEach(([key, value]) => { newState.set(key, value); }); return newState; } case 'REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN': { const newState = new Map(state); action.removedClientIds.forEach(clientId => { newState.delete(clientId); }); return newState; } } return state; }, controlledInnerBlocks(state = {}, { type, clientId, hasControlledInnerBlocks }) { if (type === 'SET_HAS_CONTROLLED_INNER_BLOCKS') { return { ...state, [clientId]: hasControlledInnerBlocks }; } return state; } }); /** * Reducer returning visibility status of block interface. * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {boolean} Updated state. */ function isBlockInterfaceHidden(state = false, action) { switch (action.type) { case 'HIDE_BLOCK_INTERFACE': return true; case 'SHOW_BLOCK_INTERFACE': return false; } return state; } /** * Reducer returning typing state. * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {boolean} Updated state. */ function isTyping(state = false, action) { switch (action.type) { case 'START_TYPING': return true; case 'STOP_TYPING': return false; } return state; } /** * Reducer returning dragging state. It is possible for a user to be dragging * data from outside of the editor, so this state is separate from `draggedBlocks`. * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {boolean} Updated state. */ function isDragging(state = false, action) { switch (action.type) { case 'START_DRAGGING': return true; case 'STOP_DRAGGING': return false; } return state; } /** * Reducer returning dragged block client id. * * @param {string[]} state Current state. * @param {Object} action Dispatched action. * * @return {string[]} Updated state. */ function draggedBlocks(state = [], action) { switch (action.type) { case 'START_DRAGGING_BLOCKS': return action.clientIds; case 'STOP_DRAGGING_BLOCKS': return []; } return state; } /** * Reducer tracking the visible blocks. * * @param {Record<string,boolean>} state Current state. * @param {Object} action Dispatched action. * * @return {Record<string,boolean>} Block visibility. */ function blockVisibility(state = {}, action) { if (action.type === 'SET_BLOCK_VISIBILITY') { return { ...state, ...action.updates }; } return state; } /** * Internal helper reducer for selectionStart and selectionEnd. Can hold a block * selection, represented by an object with property clientId. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ function selectionHelper(state = {}, action) { switch (action.type) { case 'CLEAR_SELECTED_BLOCK': { if (state.clientId) { return {}; } return state; } case 'SELECT_BLOCK': if (action.clientId === state.clientId) { return state; } return { clientId: action.clientId }; case 'REPLACE_INNER_BLOCKS': case 'INSERT_BLOCKS': { if (!action.updateSelection || !action.blocks.length) { return state; } return { clientId: action.blocks[0].clientId }; } case 'REMOVE_BLOCKS': if (!action.clientIds || !action.clientIds.length || action.clientIds.indexOf(state.clientId) === -1) { return state; } return {}; case 'REPLACE_BLOCKS': { if (action.clientIds.indexOf(state.clientId) === -1) { return state; } const blockToSelect = action.blocks[action.indexToSelect] || action.blocks[action.blocks.length - 1]; if (!blockToSelect) { return {}; } if (blockToSelect.clientId === state.clientId) { return state; } return { clientId: blockToSelect.clientId }; } } return state; } /** * Reducer returning the selection state. * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {boolean} Updated state. */ function selection(state = {}, action) { switch (action.type) { case 'SELECTION_CHANGE': if (action.clientId) { return { selectionStart: { clientId: action.clientId, attributeKey: action.attributeKey, offset: action.startOffset }, selectionEnd: { clientId: action.clientId, attributeKey: action.attributeKey, offset: action.endOffset } }; } return { selectionStart: action.start || state.selectionStart, selectionEnd: action.end || state.selectionEnd }; case 'RESET_SELECTION': const { selectionStart, selectionEnd } = action; return { selectionStart, selectionEnd }; case 'MULTI_SELECT': const { start, end } = action; if (start === state.selectionStart?.clientId && end === state.selectionEnd?.clientId) { return state; } return { selectionStart: { clientId: start }, selectionEnd: { clientId: end } }; case 'RESET_BLOCKS': const startClientId = state?.selectionStart?.clientId; const endClientId = state?.selectionEnd?.clientId; // Do nothing if there's no selected block. if (!startClientId && !endClientId) { return state; } // If the start of the selection won't exist after reset, remove selection. if (!action.blocks.some(block => block.clientId === startClientId)) { return { selectionStart: {}, selectionEnd: {} }; } // If the end of the selection won't exist after reset, collapse selection. if (!action.blocks.some(block => block.clientId === endClientId)) { return { ...state, selectionEnd: state.selectionStart }; } } const selectionStart = selectionHelper(state.selectionStart, action); const selectionEnd = selectionHelper(state.selectionEnd, action); if (selectionStart === state.selectionStart && selectionEnd === state.selectionEnd) { return state; } return { selectionStart, selectionEnd }; } /** * Reducer returning whether the user is multi-selecting. * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {boolean} Updated state. */ function isMultiSelecting(state = false, action) { switch (action.type) { case 'START_MULTI_SELECT': return true; case 'STOP_MULTI_SELECT': return false; } return state; } /** * Reducer returning whether selection is enabled. * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {boolean} Updated state. */ function isSelectionEnabled(state = true, action) { switch (action.type) { case 'TOGGLE_SELECTION': return action.isSelectionEnabled; } return state; } /** * Reducer returning the data needed to display a prompt when certain blocks * are removed, or `false` if no such prompt is requested. * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {Object|false} Data for removal prompt display, if any. */ function removalPromptData(state = false, action) { switch (action.type) { case 'DISPLAY_BLOCK_REMOVAL_PROMPT': const { clientIds, selectPrevious, message } = action; return { clientIds, selectPrevious, message }; case 'CLEAR_BLOCK_REMOVAL_PROMPT': return false; } return state; } /** * Reducer returning any rules that a block editor may provide in order to * prevent a user from accidentally removing certain blocks. These rules are * then used to display a confirmation prompt to the user. For instance, in the * Site Editor, the Query Loop block is important enough to warrant such * confirmation. * * The data is a record whose keys are block types (e.g. 'core/query') and * whose values are the explanation to be shown to users (e.g. 'Query Loop * displays a list of posts or pages.'). * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {Record<string,string>} Updated state. */ function blockRemovalRules(state = false, action) { switch (action.type) { case 'SET_BLOCK_REMOVAL_RULES': return action.rules; } return state; } /** * Reducer returning the initial block selection. * * Currently this in only used to restore the selection after block deletion and * pasting new content.This reducer should eventually be removed in favour of setting * selection directly. * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {number|null} Initial position: 0, -1 or null. */ function initialPosition(state = null, action) { if (action.type === 'REPLACE_BLOCKS' && action.initialPosition !== undefined) { return action.initialPosition; } else if (['MULTI_SELECT', 'SELECT_BLOCK', 'RESET_SELECTION', 'INSERT_BLOCKS', 'REPLACE_INNER_BLOCKS'].includes(action.type)) { return action.initialPosition; } return state; } function blocksMode(state = {}, action) { if (action.type === 'TOGGLE_BLOCK_MODE') { const { clientId } = action; return { ...state, [clientId]: state[clientId] && state[clientId] === 'html' ? 'visual' : 'html' }; } return state; } /** * Reducer returning the block insertion point visibility, either null if there * is not an explicit insertion point assigned, or an object of its `index` and * `rootClientId`. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ function insertionCue(state = null, action) { switch (action.type) { case 'SHOW_INSERTION_POINT': { const { rootClientId, index, __unstableWithInserter, operation, nearestSide } = action; const nextState = { rootClientId, index, __unstableWithInserter, operation, nearestSide }; // Bail out updates if the states are the same. return es6_default()(state, nextState) ? state : nextState; } case 'HIDE_INSERTION_POINT': return null; } return state; } /** * Reducer returning whether the post blocks match the defined template or not. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {boolean} Updated state. */ function template(state = { isValid: true }, action) { switch (action.type) { case 'SET_TEMPLATE_VALIDITY': return { ...state, isValid: action.isValid }; } return state; } /** * Reducer returning the editor setting. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ function settings(state = SETTINGS_DEFAULTS, action) { switch (action.type) { case 'UPDATE_SETTINGS': { const updatedSettings = action.reset ? { ...SETTINGS_DEFAULTS, ...action.settings } : { ...state, ...action.settings }; Object.defineProperty(updatedSettings, '__unstableIsPreviewMode', { get() { external_wp_deprecated_default()('__unstableIsPreviewMode', { since: '6.8', alternative: 'isPreviewMode' }); return this.isPreviewMode; } }); return updatedSettings; } } return state; } /** * Reducer returning the user preferences. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {string} Updated state. */ function preferences(state = PREFERENCES_DEFAULTS, action) { switch (action.type) { case 'INSERT_BLOCKS': case 'REPLACE_BLOCKS': { const nextInsertUsage = action.blocks.reduce((prevUsage, block) => { const { attributes, name: blockName } = block; let id = blockName; // If a block variation match is found change the name to be the same with the // one that is used for block variations in the Inserter (`getItemFromVariation`). const match = (0,external_wp_data_namespaceObject.select)(external_wp_blocks_namespaceObject.store).getActiveBlockVariation(blockName, attributes); if (match?.name) { id += '/' + match.name; } if (blockName === 'core/block') { id += '/' + attributes.ref; } return { ...prevUsage, [id]: { time: action.time, count: prevUsage[id] ? prevUsage[id].count + 1 : 1 } }; }, state.insertUsage); return { ...state, insertUsage: nextInsertUsage }; } } return state; } /** * Reducer returning an object where each key is a block client ID, its value * representing the settings for its nested blocks. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ const blockListSettings = (state = {}, action) => { switch (action.type) { // Even if the replaced blocks have the same client ID, our logic // should correct the state. case 'REPLACE_BLOCKS': case 'REMOVE_BLOCKS': { return Object.fromEntries(Object.entries(state).filter(([id]) => !action.clientIds.includes(id))); } case 'UPDATE_BLOCK_LIST_SETTINGS': { const updates = typeof action.clientId === 'string' ? { [action.clientId]: action.settings } : action.clientId; // Remove settings that are the same as the current state. for (const clientId in updates) { if (!updates[clientId]) { if (!state[clientId]) { delete updates[clientId]; } } else if (es6_default()(state[clientId], updates[clientId])) { delete updates[clientId]; } } if (Object.keys(updates).length === 0) { return state; } const merged = { ...state, ...updates }; for (const clientId in updates) { if (!updates[clientId]) { delete merged[clientId]; } } return merged; } } return state; }; /** * Reducer return an updated state representing the most recent block attribute * update. The state is structured as an object where the keys represent the * client IDs of blocks, the values a subset of attributes from the most recent * block update. The state is always reset to null if the last action is * anything other than an attributes update. * * @param {Object<string,Object>} state Current state. * @param {Object} action Action object. * * @return {[string,Object]} Updated state. */ function lastBlockAttributesChange(state = null, action) { switch (action.type) { case 'UPDATE_BLOCK': if (!action.updates.attributes) { break; } return { [action.clientId]: action.updates.attributes }; case 'UPDATE_BLOCK_ATTRIBUTES': return action.clientIds.reduce((accumulator, id) => ({ ...accumulator, [id]: action.uniqueByBlock ? action.attributes[id] : action.attributes }), {}); } return state; } /** * Reducer returning current highlighted block. * * @param {boolean} state Current highlighted block. * @param {Object} action Dispatched action. * * @return {string} Updated state. */ function highlightedBlock(state, action) { switch (action.type) { case 'TOGGLE_BLOCK_HIGHLIGHT': const { clientId, isHighlighted } = action; if (isHighlighted) { return clientId; } else if (state === clientId) { return null; } return state; case 'SELECT_BLOCK': if (action.clientId !== state) { return null; } } return state; } /** * Reducer returning current expanded block in the list view. * * @param {string|null} state Current expanded block. * @param {Object} action Dispatched action. * * @return {string|null} Updated state. */ function expandedBlock(state = null, action) { switch (action.type) { case 'SET_BLOCK_EXPANDED_IN_LIST_VIEW': return action.clientId; case 'SELECT_BLOCK': if (action.clientId !== state) { return null; } } return state; } /** * Reducer returning the block insertion event list state. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ function lastBlockInserted(state = {}, action) { switch (action.type) { case 'INSERT_BLOCKS': case 'REPLACE_BLOCKS': if (!action.blocks.length) { return state; } const clientIds = action.blocks.map(block => { return block.clientId; }); const source = action.meta?.source; return { clientIds, source }; case 'RESET_BLOCKS': return {}; } return state; } /** * Reducer returning the block that is eding temporarily edited as blocks. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ function temporarilyEditingAsBlocks(state = '', action) { if (action.type === 'SET_TEMPORARILY_EDITING_AS_BLOCKS') { return action.temporarilyEditingAsBlocks; } return state; } /** * Reducer returning the focus mode that should be used when temporarily edit as blocks finishes. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ function temporarilyEditingFocusModeRevert(state = '', action) { if (action.type === 'SET_TEMPORARILY_EDITING_AS_BLOCKS') { return action.focusModeToRevert; } return state; } /** * Reducer returning a map of block client IDs to block editing modes. * * @param {Map} state Current state. * @param {Object} action Dispatched action. * * @return {Map} Updated state. */ function blockEditingModes(state = new Map(), action) { switch (action.type) { case 'SET_BLOCK_EDITING_MODE': if (state.get(action.clientId) === action.mode) { return state; } return new Map(state).set(action.clientId, action.mode); case 'UNSET_BLOCK_EDITING_MODE': { if (!state.has(action.clientId)) { return state; } const newState = new Map(state); newState.delete(action.clientId); return newState; } case 'RESET_BLOCKS': { return state.has('') ? new Map().set('', state.get('')) : state; } } return state; } /** * Reducer returning the clientId of the block settings menu that is currently open. * * @param {string|null} state Current state. * @param {Object} action Dispatched action. * * @return {string|null} Updated state. */ function openedBlockSettingsMenu(state = null, action) { if ('SET_OPENED_BLOCK_SETTINGS_MENU' === action.type) { var _action$clientId; return (_action$clientId = action?.clientId) !== null && _action$clientId !== void 0 ? _action$clientId : null; } return state; } /** * Reducer returning a map of style IDs to style overrides. * * @param {Map} state Current state. * @param {Object} action Dispatched action. * * @return {Map} Updated state. */ function styleOverrides(state = new Map(), action) { switch (action.type) { case 'SET_STYLE_OVERRIDE': return new Map(state).set(action.id, action.style); case 'DELETE_STYLE_OVERRIDE': { const newState = new Map(state); newState.delete(action.id); return newState; } } return state; } /** * Reducer returning a map of the registered inserter media categories. * * @param {Array} state Current state. * @param {Object} action Dispatched action. * * @return {Array} Updated state. */ function registeredInserterMediaCategories(state = [], action) { switch (action.type) { case 'REGISTER_INSERTER_MEDIA_CATEGORY': return [...state, action.category]; } return state; } /** * Reducer setting last focused element * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {boolean} Updated state. */ function lastFocus(state = false, action) { switch (action.type) { case 'LAST_FOCUS': return action.lastFocus; } return state; } /** * Reducer setting currently hovered block. * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {boolean} Updated state. */ function hoveredBlockClientId(state = false, action) { switch (action.type) { case 'HOVER_BLOCK': return action.clientId; } return state; } /** * Reducer setting zoom out state. * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {number} Updated state. */ function zoomLevel(state = 100, action) { switch (action.type) { case 'SET_ZOOM_LEVEL': return action.zoom; case 'RESET_ZOOM_LEVEL': return 100; } return state; } /** * Reducer setting the insertion point * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ function insertionPoint(state = null, action) { switch (action.type) { case 'SET_INSERTION_POINT': return action.value; case 'SELECT_BLOCK': return null; } return state; } const combinedReducers = (0,external_wp_data_namespaceObject.combineReducers)({ blocks, isDragging, isTyping, isBlockInterfaceHidden, draggedBlocks, selection, isMultiSelecting, isSelectionEnabled, initialPosition, blocksMode, blockListSettings, insertionPoint, insertionCue, template, settings, preferences, lastBlockAttributesChange, lastFocus, expandedBlock, highlightedBlock, lastBlockInserted, temporarilyEditingAsBlocks, temporarilyEditingFocusModeRevert, blockVisibility, blockEditingModes, styleOverrides, removalPromptData, blockRemovalRules, openedBlockSettingsMenu, registeredInserterMediaCategories, hoveredBlockClientId, zoomLevel }); /** * Retrieves a block's tree structure, handling both controlled and uncontrolled inner blocks. * * @param {Object} state The current state object. * @param {string} clientId The client ID of the block to retrieve. * * @return {Object|undefined} The block tree object, or undefined if not found. For controlled blocks, * returns a merged tree with controlled inner blocks. */ function getBlockTreeBlock(state, clientId) { if (clientId === '') { const rootBlock = state.blocks.tree.get(clientId); if (!rootBlock) { return; } // Patch the root block to have a clientId property. // TODO - consider updating the blocks reducer so that the root block has this property. return { clientId: '', ...rootBlock }; } if (!state.blocks.controlledInnerBlocks[clientId]) { return state.blocks.tree.get(clientId); } const controlledTree = state.blocks.tree.get(`controlled||${clientId}`); const regularTree = state.blocks.tree.get(clientId); return { ...regularTree, innerBlocks: controlledTree?.innerBlocks }; } /** * Recursively traverses through a block tree of a given block and executes a callback for each block. * * @param {Object} state The store state. * @param {string} clientId The clientId of the block to start traversing from. * @param {Function} callback Function to execute for each block encountered during traversal. * The callback receives the current block as its argument. */ function traverseBlockTree(state, clientId, callback) { const tree = getBlockTreeBlock(state, clientId); if (!tree) { return; } callback(tree); if (!tree?.innerBlocks?.length) { return; } for (const innerBlock of tree?.innerBlocks) { traverseBlockTree(state, innerBlock.clientId, callback); } } /** * Checks if a block has a parent in a list of client IDs, and if so returns the client ID of the parent. * * @param {Object} state The current state object. * @param {string} clientId The client ID of the block to search the parents of. * @param {Array} clientIds The client IDs of the blocks to check. * * @return {string|undefined} The client ID of the parent block if found, undefined otherwise. */ function findParentInClientIdsList(state, clientId, clientIds) { if (!clientIds.length) { return; } let parent = state.blocks.parents.get(clientId); while (parent !== undefined) { if (clientIds.includes(parent)) { return parent; } parent = state.blocks.parents.get(parent); } } /** * Checks if a block has any bindings in its metadata attributes. * * @param {Object} block The block object to check for bindings. * @return {boolean} True if the block has bindings, false otherwise. */ function hasBindings(block) { return block?.attributes?.metadata?.bindings && Object.keys(block?.attributes?.metadata?.bindings).length; } /** * Computes and returns derived block editing modes for a given block tree. * * This function calculates the editing modes for each block in the tree, taking into account * various factors such as zoom level, navigation mode, sections, and synced patterns. * * @param {Object} state The current state object. * @param {boolean} isNavMode Whether the navigation mode is active. * @param {string} treeClientId The client ID of the root block for the tree. Defaults to an empty string. * @return {Map} A Map containing the derived block editing modes, keyed by block client ID. */ function getDerivedBlockEditingModesForTree(state, isNavMode = false, treeClientId = '') { const isZoomedOut = state?.zoomLevel < 100 || state?.zoomLevel === 'auto-scaled'; const derivedBlockEditingModes = new Map(); // When there are sections, the majority of blocks are disabled, // so the default block editing mode is set to disabled. const sectionRootClientId = state.settings?.[sectionRootClientIdKey]; const sectionClientIds = state.blocks.order.get(sectionRootClientId); const hasDisabledBlocks = Array.from(state.blockEditingModes).some(([, mode]) => mode === 'disabled'); const templatePartClientIds = []; const syncedPatternClientIds = []; Object.keys(state.blocks.controlledInnerBlocks).forEach(clientId => { const block = state.blocks.byClientId?.get(clientId); if (block?.name === 'core/template-part') { templatePartClientIds.push(clientId); } if (block?.name === 'core/block') { syncedPatternClientIds.push(clientId); } }); traverseBlockTree(state, treeClientId, block => { const { clientId, name: blockName } = block; // If the block already has an explicit block editing mode set, // don't override it. if (state.blockEditingModes.has(clientId)) { return; } // Disabled explicit block editing modes are inherited by children. // It's an expensive calculation, so only do it if there are disabled blocks. if (hasDisabledBlocks) { // Look through parents to find one with an explicit block editing mode. let ancestorBlockEditingMode; let parent = state.blocks.parents.get(clientId); while (parent !== undefined) { // There's a chance we only just calculated this for the parent, // if so we can return that value for a faster lookup. if (derivedBlockEditingModes.has(parent)) { ancestorBlockEditingMode = derivedBlockEditingModes.get(parent); } else if (state.blockEditingModes.has(parent)) { // Checking the explicit block editing mode will be slower, // as the block editing mode is more likely to be set on a // distant ancestor. ancestorBlockEditingMode = state.blockEditingModes.get(parent); } if (ancestorBlockEditingMode) { break; } parent = state.blocks.parents.get(parent); } // If the ancestor block editing mode is disabled, it's inherited by the child. if (ancestorBlockEditingMode === 'disabled') { derivedBlockEditingModes.set(clientId, 'disabled'); return; } } if (isZoomedOut || isNavMode) { // If the root block is the section root set its editing mode to contentOnly. if (clientId === sectionRootClientId) { derivedBlockEditingModes.set(clientId, 'contentOnly'); return; } // There are no sections, so everything else is disabled. if (!sectionClientIds?.length) { derivedBlockEditingModes.set(clientId, 'disabled'); return; } if (sectionClientIds.includes(clientId)) { derivedBlockEditingModes.set(clientId, 'contentOnly'); return; } // If zoomed out, all blocks that aren't sections or the section root are // disabled. if (isZoomedOut) { derivedBlockEditingModes.set(clientId, 'disabled'); return; } const isInSection = !!findParentInClientIdsList(state, clientId, sectionClientIds); if (!isInSection) { if (clientId === '') { derivedBlockEditingModes.set(clientId, 'disabled'); return; } // Allow selection of template parts outside of sections. if (blockName === 'core/template-part') { derivedBlockEditingModes.set(clientId, 'contentOnly'); return; } const isInTemplatePart = !!findParentInClientIdsList(state, clientId, templatePartClientIds); // Allow contentOnly blocks in template parts outside of sections // to be editable. Only disable blocks that don't fit this criteria. if (!isInTemplatePart && !isContentBlock(blockName)) { derivedBlockEditingModes.set(clientId, 'disabled'); return; } } // Handle synced pattern content so the inner blocks of a synced pattern are // properly disabled. if (syncedPatternClientIds.length) { const parentPatternClientId = findParentInClientIdsList(state, clientId, syncedPatternClientIds); if (parentPatternClientId) { // This is a pattern nested in another pattern, it should be disabled. if (findParentInClientIdsList(state, parentPatternClientId, syncedPatternClientIds)) { derivedBlockEditingModes.set(clientId, 'disabled'); return; } if (hasBindings(block)) { derivedBlockEditingModes.set(clientId, 'contentOnly'); return; } // Synced pattern content without a binding isn't editable // from the instance, the user has to edit the pattern source, // so return 'disabled'. derivedBlockEditingModes.set(clientId, 'disabled'); return; } } if (blockName && isContentBlock(blockName)) { derivedBlockEditingModes.set(clientId, 'contentOnly'); return; } derivedBlockEditingModes.set(clientId, 'disabled'); return; } if (syncedPatternClientIds.length) { // Synced pattern blocks (core/block). if (syncedPatternClientIds.includes(clientId)) { // This is a pattern nested in another pattern, it should be disabled. if (findParentInClientIdsList(state, clientId, syncedPatternClientIds)) { derivedBlockEditingModes.set(clientId, 'disabled'); return; } // Else do nothing, use the default block editing mode. return; } // Inner blocks of synced patterns. const parentPatternClientId = findParentInClientIdsList(state, clientId, syncedPatternClientIds); if (parentPatternClientId) { // This is a pattern nested in another pattern, it should be disabled. if (findParentInClientIdsList(state, parentPatternClientId, syncedPatternClientIds)) { derivedBlockEditingModes.set(clientId, 'disabled'); return; } if (hasBindings(block)) { derivedBlockEditingModes.set(clientId, 'contentOnly'); return; } // Synced pattern content without a binding isn't editable // from the instance, the user has to edit the pattern source, // so return 'disabled'. derivedBlockEditingModes.set(clientId, 'disabled'); } } }); return derivedBlockEditingModes; } /** * Updates the derived block editing modes based on added and removed blocks. * * This function handles the updating of block editing modes when blocks are added, * removed, or moved within the editor. * * It only returns a value when modifications are made to the block editing modes. * * @param {Object} options The options for updating derived block editing modes. * @param {Object} options.prevState The previous state object. * @param {Object} options.nextState The next state object. * @param {Array} [options.addedBlocks] An array of blocks that were added. * @param {Array} [options.removedClientIds] An array of client IDs of blocks that were removed. * @param {boolean} [options.isNavMode] Whether the navigation mode is active. * @return {Map|undefined} The updated derived block editing modes, or undefined if no changes were made. */ function getDerivedBlockEditingModesUpdates({ prevState, nextState, addedBlocks, removedClientIds, isNavMode = false }) { const prevDerivedBlockEditingModes = isNavMode ? prevState.derivedNavModeBlockEditingModes : prevState.derivedBlockEditingModes; let nextDerivedBlockEditingModes; // Perform removals before additions to handle cases like the `MOVE_BLOCKS_TO_POSITION` action. // That action removes a set of clientIds, but adds the same blocks back in a different location. // If removals were performed after additions, those moved clientIds would be removed incorrectly. removedClientIds?.forEach(clientId => { // The actions only receive parent block IDs for removal. // Recurse through the block tree to ensure all blocks are removed. // Specifically use the previous state, before the blocks were removed. traverseBlockTree(prevState, clientId, block => { if (prevDerivedBlockEditingModes.has(block.clientId)) { if (!nextDerivedBlockEditingModes) { nextDerivedBlockEditingModes = new Map(prevDerivedBlockEditingModes); } nextDerivedBlockEditingModes.delete(block.clientId); } }); }); addedBlocks?.forEach(addedBlock => { traverseBlockTree(nextState, addedBlock.clientId, block => { const updates = getDerivedBlockEditingModesForTree(nextState, isNavMode, block.clientId); if (updates.size) { if (!nextDerivedBlockEditingModes) { nextDerivedBlockEditingModes = new Map([...(prevDerivedBlockEditingModes?.size ? prevDerivedBlockEditingModes : []), ...updates]); } else { nextDerivedBlockEditingModes = new Map([...(nextDerivedBlockEditingModes?.size ? nextDerivedBlockEditingModes : []), ...updates]); } } }); }); return nextDerivedBlockEditingModes; } /** * Higher-order reducer that adds derived block editing modes to the state. * * This function wraps a reducer and enhances it to handle actions that affect * block editing modes. It updates the derivedBlockEditingModes in the state * based on various actions such as adding, removing, or moving blocks, or changing * the editor mode. * * @param {Function} reducer The original reducer function to be wrapped. * @return {Function} A new reducer function that includes derived block editing modes handling. */ function withDerivedBlockEditingModes(reducer) { return (state, action) => { var _state$derivedBlockEd, _state$derivedNavMode; const nextState = reducer(state, action); // An exception is needed here to still recompute the block editing modes when // the editor mode changes since the editor mode isn't stored within the // block editor state and changing it won't trigger an altered new state. if (action.type !== 'SET_EDITOR_MODE' && nextState === state) { return state; } switch (action.type) { case 'REMOVE_BLOCKS': { const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, removedClientIds: action.clientIds, isNavMode: false }); const nextDerivedNavModeBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, removedClientIds: action.clientIds, isNavMode: true }); if (nextDerivedBlockEditingModes || nextDerivedNavModeBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes !== null && nextDerivedBlockEditingModes !== void 0 ? nextDerivedBlockEditingModes : state.derivedBlockEditingModes, derivedNavModeBlockEditingModes: nextDerivedNavModeBlockEditingModes !== null && nextDerivedNavModeBlockEditingModes !== void 0 ? nextDerivedNavModeBlockEditingModes : state.derivedNavModeBlockEditingModes }; } break; } case 'RECEIVE_BLOCKS': case 'INSERT_BLOCKS': { const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks, isNavMode: false }); const nextDerivedNavModeBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks, isNavMode: true }); if (nextDerivedBlockEditingModes || nextDerivedNavModeBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes !== null && nextDerivedBlockEditingModes !== void 0 ? nextDerivedBlockEditingModes : state.derivedBlockEditingModes, derivedNavModeBlockEditingModes: nextDerivedNavModeBlockEditingModes !== null && nextDerivedNavModeBlockEditingModes !== void 0 ? nextDerivedNavModeBlockEditingModes : state.derivedNavModeBlockEditingModes }; } break; } case 'SET_BLOCK_EDITING_MODE': case 'UNSET_BLOCK_EDITING_MODE': case 'SET_HAS_CONTROLLED_INNER_BLOCKS': { const updatedBlock = getBlockTreeBlock(nextState, action.clientId); // The block might have been removed in which case it'll be // handled by the `REMOVE_BLOCKS` action. if (!updatedBlock) { break; } const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, removedClientIds: [action.clientId], addedBlocks: [updatedBlock], isNavMode: false }); const nextDerivedNavModeBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, removedClientIds: [action.clientId], addedBlocks: [updatedBlock], isNavMode: true }); if (nextDerivedBlockEditingModes || nextDerivedNavModeBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes !== null && nextDerivedBlockEditingModes !== void 0 ? nextDerivedBlockEditingModes : state.derivedBlockEditingModes, derivedNavModeBlockEditingModes: nextDerivedNavModeBlockEditingModes !== null && nextDerivedNavModeBlockEditingModes !== void 0 ? nextDerivedNavModeBlockEditingModes : state.derivedNavModeBlockEditingModes }; } break; } case 'REPLACE_BLOCKS': { const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks, removedClientIds: action.clientIds, isNavMode: false }); const nextDerivedNavModeBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks, removedClientIds: action.clientIds, isNavMode: true }); if (nextDerivedBlockEditingModes || nextDerivedNavModeBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes !== null && nextDerivedBlockEditingModes !== void 0 ? nextDerivedBlockEditingModes : state.derivedBlockEditingModes, derivedNavModeBlockEditingModes: nextDerivedNavModeBlockEditingModes !== null && nextDerivedNavModeBlockEditingModes !== void 0 ? nextDerivedNavModeBlockEditingModes : state.derivedNavModeBlockEditingModes }; } break; } case 'REPLACE_INNER_BLOCKS': { // Get the clientIds of the blocks that are being replaced // from the old state, before they were removed. const removedClientIds = state.blocks.order.get(action.rootClientId); const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks, removedClientIds, isNavMode: false }); const nextDerivedNavModeBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks: action.blocks, removedClientIds, isNavMode: true }); if (nextDerivedBlockEditingModes || nextDerivedNavModeBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes !== null && nextDerivedBlockEditingModes !== void 0 ? nextDerivedBlockEditingModes : state.derivedBlockEditingModes, derivedNavModeBlockEditingModes: nextDerivedNavModeBlockEditingModes !== null && nextDerivedNavModeBlockEditingModes !== void 0 ? nextDerivedNavModeBlockEditingModes : state.derivedNavModeBlockEditingModes }; } break; } case 'MOVE_BLOCKS_TO_POSITION': { const addedBlocks = action.clientIds.map(clientId => { return nextState.blocks.byClientId.get(clientId); }); const nextDerivedBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks, removedClientIds: action.clientIds, isNavMode: false }); const nextDerivedNavModeBlockEditingModes = getDerivedBlockEditingModesUpdates({ prevState: state, nextState, addedBlocks, removedClientIds: action.clientIds, isNavMode: true }); if (nextDerivedBlockEditingModes || nextDerivedNavModeBlockEditingModes) { return { ...nextState, derivedBlockEditingModes: nextDerivedBlockEditingModes !== null && nextDerivedBlockEditingModes !== void 0 ? nextDerivedBlockEditingModes : state.derivedBlockEditingModes, derivedNavModeBlockEditingModes: nextDerivedNavModeBlockEditingModes !== null && nextDerivedNavModeBlockEditingModes !== void 0 ? nextDerivedNavModeBlockEditingModes : state.derivedNavModeBlockEditingModes }; } break; } case 'UPDATE_SETTINGS': { // Recompute the entire tree if the section root changes. if (state?.settings?.[sectionRootClientIdKey] !== nextState?.settings?.[sectionRootClientIdKey]) { return { ...nextState, derivedBlockEditingModes: getDerivedBlockEditingModesForTree(nextState, false /* Nav mode off */), derivedNavModeBlockEditingModes: getDerivedBlockEditingModesForTree(nextState, true /* Nav mode on */) }; } break; } case 'RESET_BLOCKS': case 'SET_EDITOR_MODE': case 'RESET_ZOOM_LEVEL': case 'SET_ZOOM_LEVEL': { // Recompute the entire tree if the editor mode or zoom level changes, // or if all the blocks are reset. return { ...nextState, derivedBlockEditingModes: getDerivedBlockEditingModesForTree(nextState, false /* Nav mode off */), derivedNavModeBlockEditingModes: getDerivedBlockEditingModesForTree(nextState, true /* Nav mode on */) }; } } // If there's no change, the derivedBlockEditingModes from the previous // state need to be preserved. nextState.derivedBlockEditingModes = (_state$derivedBlockEd = state?.derivedBlockEditingModes) !== null && _state$derivedBlockEd !== void 0 ? _state$derivedBlockEd : new Map(); nextState.derivedNavModeBlockEditingModes = (_state$derivedNavMode = state?.derivedNavModeBlockEditingModes) !== null && _state$derivedNavMode !== void 0 ? _state$derivedNavMode : new Map(); return nextState; }; } function withAutomaticChangeReset(reducer) { return (state, action) => { const nextState = reducer(state, action); if (!state) { return nextState; } // Take over the last value without creating a new reference. nextState.automaticChangeStatus = state.automaticChangeStatus; if (action.type === 'MARK_AUTOMATIC_CHANGE') { return { ...nextState, automaticChangeStatus: 'pending' }; } if (action.type === 'MARK_AUTOMATIC_CHANGE_FINAL' && state.automaticChangeStatus === 'pending') { return { ...nextState, automaticChangeStatus: 'final' }; } // If there's a change that doesn't affect blocks or selection, maintain // the current status. if (nextState.blocks === state.blocks && nextState.selection === state.selection) { return nextState; } // As long as the state is not final, ignore any selection changes. if (nextState.automaticChangeStatus !== 'final' && nextState.selection !== state.selection) { return nextState; } // Reset the status if blocks change or selection changes (when status is final). return { ...nextState, automaticChangeStatus: undefined }; }; } /* harmony default export */ const reducer = ((0,external_wp_compose_namespaceObject.pipe)(withDerivedBlockEditingModes, withAutomaticChangeReset)(combinedReducers)); ;// external ["wp","primitives"] const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; ;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// ./node_modules/@wordpress/icons/build-module/library/symbol.js /** * WordPress dependencies */ const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) }); /* harmony default export */ const library_symbol = (symbol); ;// external ["wp","richText"] const external_wp_richText_namespaceObject = window["wp"]["richText"]; ;// external ["wp","preferences"] const external_wp_preferences_namespaceObject = window["wp"]["preferences"]; ;// external ["wp","blockSerializationDefaultParser"] const external_wp_blockSerializationDefaultParser_namespaceObject = window["wp"]["blockSerializationDefaultParser"]; ;// ./node_modules/@wordpress/block-editor/build-module/store/constants.js const STORE_NAME = 'core/block-editor'; ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/utils.js /** * WordPress dependencies */ const INSERTER_PATTERN_TYPES = { user: 'user', theme: 'theme', directory: 'directory' }; const INSERTER_SYNC_TYPES = { full: 'fully', unsynced: 'unsynced' }; const allPatternsCategory = { name: 'allPatterns', label: (0,external_wp_i18n_namespaceObject._x)('All', 'patterns') }; const myPatternsCategory = { name: 'myPatterns', label: (0,external_wp_i18n_namespaceObject.__)('My patterns') }; const starterPatternsCategory = { name: 'core/starter-content', label: (0,external_wp_i18n_namespaceObject.__)('Starter content') }; function isPatternFiltered(pattern, sourceFilter, syncFilter) { const isUserPattern = pattern.name.startsWith('core/block'); const isDirectoryPattern = pattern.source === 'core' || pattern.source?.startsWith('pattern-directory'); // If theme source selected, filter out user created patterns and those from // the core patterns directory. if (sourceFilter === INSERTER_PATTERN_TYPES.theme && (isUserPattern || isDirectoryPattern)) { return true; } // If the directory source is selected, filter out user created patterns // and those bundled with the theme. if (sourceFilter === INSERTER_PATTERN_TYPES.directory && (isUserPattern || !isDirectoryPattern)) { return true; } // If user source selected, filter out theme patterns. if (sourceFilter === INSERTER_PATTERN_TYPES.user && pattern.type !== INSERTER_PATTERN_TYPES.user) { return true; } // Filter by sync status. if (syncFilter === INSERTER_SYNC_TYPES.full && pattern.syncStatus !== '') { return true; } if (syncFilter === INSERTER_SYNC_TYPES.unsynced && pattern.syncStatus !== 'unsynced' && isUserPattern) { return true; } return false; } ;// ./node_modules/@wordpress/block-editor/build-module/utils/object.js /** * Immutably sets a value inside an object. Like `lodash#set`, but returning a * new object. Treats nullish initial values as empty objects. Clones any * nested objects. Supports arrays, too. * * @param {Object} object Object to set a value in. * @param {number|string|Array} path Path in the object to modify. * @param {*} value New value to set. * @return {Object} Cloned object with the new value set. */ function setImmutably(object, path, value) { // Normalize path path = Array.isArray(path) ? [...path] : [path]; // Shallowly clone the base of the object object = Array.isArray(object) ? [...object] : { ...object }; const leaf = path.pop(); // Traverse object from root to leaf, shallowly cloning at each level let prev = object; for (const key of path) { const lvl = prev[key]; prev = prev[key] = Array.isArray(lvl) ? [...lvl] : { ...lvl }; } prev[leaf] = value; return object; } /** * Helper util to return a value from a certain path of the object. * Path is specified as either: * - a string of properties, separated by dots, for example: "x.y". * - an array of properties, for example `[ 'x', 'y' ]`. * You can also specify a default value in case the result is nullish. * * @param {Object} object Input object. * @param {string|Array} path Path to the object property. * @param {*} defaultValue Default value if the value at the specified path is nullish. * @return {*} Value of the object property at the specified path. */ const getValueFromObjectPath = (object, path, defaultValue) => { var _value; const arrayPath = Array.isArray(path) ? path : path.split('.'); let value = object; arrayPath.forEach(fieldName => { value = value?.[fieldName]; }); return (_value = value) !== null && _value !== void 0 ? _value : defaultValue; }; /** * Helper util to filter out objects with duplicate values for a given property. * * @param {Object[]} array Array of objects to filter. * @param {string} property Property to filter unique values by. * * @return {Object[]} Array of objects with unique values for the specified property. */ function uniqByProperty(array, property) { const seen = new Set(); return array.filter(item => { const value = item[property]; return seen.has(value) ? false : seen.add(value); }); } ;// ./node_modules/@wordpress/block-editor/build-module/store/get-block-settings.js /** * WordPress dependencies */ /** * Internal dependencies */ const blockedPaths = ['color', 'border', 'dimensions', 'typography', 'spacing']; const deprecatedFlags = { 'color.palette': settings => settings.colors, 'color.gradients': settings => settings.gradients, 'color.custom': settings => settings.disableCustomColors === undefined ? undefined : !settings.disableCustomColors, 'color.customGradient': settings => settings.disableCustomGradients === undefined ? undefined : !settings.disableCustomGradients, 'typography.fontSizes': settings => settings.fontSizes, 'typography.customFontSize': settings => settings.disableCustomFontSizes === undefined ? undefined : !settings.disableCustomFontSizes, 'typography.lineHeight': settings => settings.enableCustomLineHeight, 'spacing.units': settings => { if (settings.enableCustomUnits === undefined) { return; } if (settings.enableCustomUnits === true) { return ['px', 'em', 'rem', 'vh', 'vw', '%']; } return settings.enableCustomUnits; }, 'spacing.padding': settings => settings.enableCustomSpacing }; const prefixedFlags = { /* * These were only available in the plugin * and can be removed when the minimum WordPress version * for the plugin is 5.9. */ 'border.customColor': 'border.color', 'border.customStyle': 'border.style', 'border.customWidth': 'border.width', 'typography.customFontStyle': 'typography.fontStyle', 'typography.customFontWeight': 'typography.fontWeight', 'typography.customLetterSpacing': 'typography.letterSpacing', 'typography.customTextDecorations': 'typography.textDecoration', 'typography.customTextTransforms': 'typography.textTransform', /* * These were part of WordPress 5.8 and we need to keep them. */ 'border.customRadius': 'border.radius', 'spacing.customMargin': 'spacing.margin', 'spacing.customPadding': 'spacing.padding', 'typography.customLineHeight': 'typography.lineHeight' }; /** * Remove `custom` prefixes for flags that did not land in 5.8. * * This provides continued support for `custom` prefixed properties. It will * be removed once third party devs have had sufficient time to update themes, * plugins, etc. * * @see https://github.com/WordPress/gutenberg/pull/34485 * * @param {string} path Path to desired value in settings. * @return {string} The value for defined setting. */ const removeCustomPrefixes = path => { return prefixedFlags[path] || path; }; function getBlockSettings(state, clientId, ...paths) { const blockName = getBlockName(state, clientId); const candidates = []; if (clientId) { let id = clientId; do { const name = getBlockName(state, id); if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, '__experimentalSettings', false)) { candidates.push(id); } } while (id = state.blocks.parents.get(id)); } return paths.map(path => { if (blockedPaths.includes(path)) { // eslint-disable-next-line no-console console.warn('Top level useSetting paths are disabled. Please use a subpath to query the information needed.'); return undefined; } // 0. Allow third parties to filter the block's settings at runtime. let result = (0,external_wp_hooks_namespaceObject.applyFilters)('blockEditor.useSetting.before', undefined, path, clientId, blockName); if (undefined !== result) { return result; } const normalizedPath = removeCustomPrefixes(path); // 1. Take settings from the block instance or its ancestors. // Start from the current block and work our way up the ancestors. for (const candidateClientId of candidates) { var _getValueFromObjectPa; const candidateAtts = getBlockAttributes(state, candidateClientId); result = (_getValueFromObjectPa = getValueFromObjectPath(candidateAtts.settings?.blocks?.[blockName], normalizedPath)) !== null && _getValueFromObjectPa !== void 0 ? _getValueFromObjectPa : getValueFromObjectPath(candidateAtts.settings, normalizedPath); if (result !== undefined) { // Stop the search for more distant ancestors and move on. break; } } // 2. Fall back to the settings from the block editor store (__experimentalFeatures). const settings = getSettings(state); if (result === undefined && blockName) { result = getValueFromObjectPath(settings.__experimentalFeatures?.blocks?.[blockName], normalizedPath); } if (result === undefined) { result = getValueFromObjectPath(settings.__experimentalFeatures, normalizedPath); } // Return if the setting was found in either the block instance or the store. if (result !== undefined) { if (external_wp_blocks_namespaceObject.__EXPERIMENTAL_PATHS_WITH_OVERRIDE[normalizedPath]) { var _ref, _result$custom; return (_ref = (_result$custom = result.custom) !== null && _result$custom !== void 0 ? _result$custom : result.theme) !== null && _ref !== void 0 ? _ref : result.default; } return result; } // 3. Otherwise, use deprecated settings. const deprecatedSettingsValue = deprecatedFlags[normalizedPath]?.(settings); if (deprecatedSettingsValue !== undefined) { return deprecatedSettingsValue; } // 4. Fallback for typography.dropCap: // This is only necessary to support typography.dropCap. // when __experimentalFeatures are not present (core without plugin). // To remove when __experimentalFeatures are ported to core. return normalizedPath === 'typography.dropCap' ? true : undefined; }); } ;// ./node_modules/@wordpress/block-editor/build-module/store/private-selectors.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns true if the block interface is hidden, or false otherwise. * * @param {Object} state Global application state. * * @return {boolean} Whether the block toolbar is hidden. */ function private_selectors_isBlockInterfaceHidden(state) { return state.isBlockInterfaceHidden; } /** * Gets the client ids of the last inserted blocks. * * @param {Object} state Global application state. * @return {Array|undefined} Client Ids of the last inserted block(s). */ function getLastInsertedBlocksClientIds(state) { return state?.lastBlockInserted?.clientIds; } function getBlockWithoutAttributes(state, clientId) { return state.blocks.byClientId.get(clientId); } /** * Returns true if all of the descendants of a block with the given client ID * have an editing mode of 'disabled', or false otherwise. * * @param {Object} state Global application state. * @param {string} clientId The block client ID. * * @return {boolean} Whether the block descendants are disabled. */ const isBlockSubtreeDisabled = (state, clientId) => { const isChildSubtreeDisabled = childClientId => { return getBlockEditingMode(state, childClientId) === 'disabled' && getBlockOrder(state, childClientId).every(isChildSubtreeDisabled); }; return getBlockOrder(state, clientId).every(isChildSubtreeDisabled); }; function getEnabledClientIdsTreeUnmemoized(state, rootClientId) { const blockOrder = getBlockOrder(state, rootClientId); const result = []; for (const clientId of blockOrder) { const innerBlocks = getEnabledClientIdsTreeUnmemoized(state, clientId); if (getBlockEditingMode(state, clientId) !== 'disabled') { result.push({ clientId, innerBlocks }); } else { result.push(...innerBlocks); } } return result; } /** * Returns a tree of block objects with only clientID and innerBlocks set. * Blocks with a 'disabled' editing mode are not included. * * @param {Object} state Global application state. * @param {?string} rootClientId Optional root client ID of block list. * * @return {Object[]} Tree of block objects with only clientID and innerBlocks set. */ const getEnabledClientIdsTree = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(getEnabledClientIdsTreeUnmemoized, state => [state.blocks.order, state.derivedBlockEditingModes, state.derivedNavModeBlockEditingModes, state.blockEditingModes, state.settings.templateLock, state.blockListSettings, select(STORE_NAME).__unstableGetEditorMode(state)])); /** * Returns a list of a given block's ancestors, from top to bottom. Blocks with * a 'disabled' editing mode are excluded. * * @see getBlockParents * * @param {Object} state Global application state. * @param {string} clientId The block client ID. * @param {boolean} ascending Order results from bottom to top (true) or top * to bottom (false). */ const getEnabledBlockParents = (0,external_wp_data_namespaceObject.createSelector)((state, clientId, ascending = false) => { return getBlockParents(state, clientId, ascending).filter(parent => getBlockEditingMode(state, parent) !== 'disabled'); }, state => [state.blocks.parents, state.blockEditingModes, state.settings.templateLock, state.blockListSettings]); /** * Selector that returns the data needed to display a prompt when certain * blocks are removed, or `false` if no such prompt is requested. * * @param {Object} state Global application state. * * @return {Object|false} Data for removal prompt display, if any. */ function getRemovalPromptData(state) { return state.removalPromptData; } /** * Returns true if removal prompt exists, or false otherwise. * * @param {Object} state Global application state. * * @return {boolean} Whether removal prompt exists. */ function getBlockRemovalRules(state) { return state.blockRemovalRules; } /** * Returns the client ID of the block settings menu that is currently open. * * @param {Object} state Global application state. * @return {string|null} The client ID of the block menu that is currently open. */ function getOpenedBlockSettingsMenu(state) { return state.openedBlockSettingsMenu; } /** * Returns all style overrides, intended to be merged with global editor styles. * * Overrides are sorted to match the order of the blocks they relate to. This * is useful to maintain correct CSS cascade order. * * @param {Object} state Global application state. * * @return {Array} An array of style ID to style override pairs. */ const getStyleOverrides = (0,external_wp_data_namespaceObject.createSelector)(state => { const clientIds = getClientIdsWithDescendants(state); const clientIdMap = clientIds.reduce((acc, clientId, index) => { acc[clientId] = index; return acc; }, {}); return [...state.styleOverrides].sort((overrideA, overrideB) => { var _clientIdMap$clientId, _clientIdMap$clientId2; // Once the overrides Map is spread to an array, the first element // is the key, while the second is the override itself including // the clientId to sort by. const [, { clientId: clientIdA }] = overrideA; const [, { clientId: clientIdB }] = overrideB; const aIndex = (_clientIdMap$clientId = clientIdMap[clientIdA]) !== null && _clientIdMap$clientId !== void 0 ? _clientIdMap$clientId : -1; const bIndex = (_clientIdMap$clientId2 = clientIdMap[clientIdB]) !== null && _clientIdMap$clientId2 !== void 0 ? _clientIdMap$clientId2 : -1; return aIndex - bIndex; }); }, state => [state.blocks.order, state.styleOverrides]); /** @typedef {import('./actions').InserterMediaCategory} InserterMediaCategory */ /** * Returns the registered inserter media categories through the public API. * * @param {Object} state Editor state. * * @return {InserterMediaCategory[]} Inserter media categories. */ function getRegisteredInserterMediaCategories(state) { return state.registeredInserterMediaCategories; } /** * Returns an array containing the allowed inserter media categories. * It merges the registered media categories from extenders with the * core ones. It also takes into account the allowed `mime_types`, which * can be altered by `upload_mimes` filter and restrict some of them. * * @param {Object} state Global application state. * * @return {InserterMediaCategory[]} Client IDs of descendants. */ const getInserterMediaCategories = (0,external_wp_data_namespaceObject.createSelector)(state => { const { settings: { inserterMediaCategories, allowedMimeTypes, enableOpenverseMediaCategory }, registeredInserterMediaCategories } = state; // The allowed `mime_types` can be altered by `upload_mimes` filter and restrict // some of them. In this case we shouldn't add the category to the available media // categories list in the inserter. if (!inserterMediaCategories && !registeredInserterMediaCategories.length || !allowedMimeTypes) { return; } const coreInserterMediaCategoriesNames = inserterMediaCategories?.map(({ name }) => name) || []; const mergedCategories = [...(inserterMediaCategories || []), ...(registeredInserterMediaCategories || []).filter(({ name }) => !coreInserterMediaCategoriesNames.includes(name))]; return mergedCategories.filter(category => { // Check if Openverse category is enabled. if (!enableOpenverseMediaCategory && category.name === 'openverse') { return false; } return Object.values(allowedMimeTypes).some(mimeType => mimeType.startsWith(`${category.mediaType}/`)); }); }, state => [state.settings.inserterMediaCategories, state.settings.allowedMimeTypes, state.settings.enableOpenverseMediaCategory, state.registeredInserterMediaCategories]); /** * Returns whether there is at least one allowed pattern for inner blocks children. * This is useful for deferring the parsing of all patterns until needed. * * @param {Object} state Editor state. * @param {string} [rootClientId=null] Target root client ID. * * @return {boolean} If there is at least one allowed pattern. */ const hasAllowedPatterns = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, rootClientId = null) => { const { getAllPatterns } = unlock(select(STORE_NAME)); const patterns = getAllPatterns(); const { allowedBlockTypes } = getSettings(state); return patterns.some(pattern => { const { inserter = true } = pattern; if (!inserter) { return false; } const grammar = getGrammar(pattern); return checkAllowListRecursive(grammar, allowedBlockTypes) && grammar.every(({ name: blockName }) => canInsertBlockType(state, blockName, rootClientId)); }); }, (state, rootClientId) => [...getAllPatternsDependants(select)(state), ...getInsertBlockTypeDependants(select)(state, rootClientId)])); function mapUserPattern(userPattern, __experimentalUserPatternCategories = []) { return { name: `core/block/${userPattern.id}`, id: userPattern.id, type: INSERTER_PATTERN_TYPES.user, title: userPattern.title.raw, categories: userPattern.wp_pattern_category?.map(catId => { const category = __experimentalUserPatternCategories.find(({ id }) => id === catId); return category ? category.slug : catId; }), content: userPattern.content.raw, syncStatus: userPattern.wp_pattern_sync_status }; } const getPatternBySlug = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, patternName) => { var _state$settings$__exp, _state$settings$selec; // Only fetch reusable blocks if we know we need them. To do: maybe // use the entity record API to retrieve the block by slug. if (patternName?.startsWith('core/block/')) { const _id = parseInt(patternName.slice('core/block/'.length), 10); const block = unlock(select(STORE_NAME)).getReusableBlocks().find(({ id }) => id === _id); if (!block) { return null; } return mapUserPattern(block, state.settings.__experimentalUserPatternCategories); } return [ // This setting is left for back compat. ...((_state$settings$__exp = state.settings.__experimentalBlockPatterns) !== null && _state$settings$__exp !== void 0 ? _state$settings$__exp : []), ...((_state$settings$selec = state.settings[selectBlockPatternsKey]?.(select)) !== null && _state$settings$selec !== void 0 ? _state$settings$selec : [])].find(({ name }) => name === patternName); }, (state, patternName) => patternName?.startsWith('core/block/') ? [unlock(select(STORE_NAME)).getReusableBlocks(), state.settings.__experimentalReusableBlocks] : [state.settings.__experimentalBlockPatterns, state.settings[selectBlockPatternsKey]?.(select)])); const getAllPatterns = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(state => { var _state$settings$__exp2, _state$settings$selec2; return [...unlock(select(STORE_NAME)).getReusableBlocks().map(userPattern => mapUserPattern(userPattern, state.settings.__experimentalUserPatternCategories)), // This setting is left for back compat. ...((_state$settings$__exp2 = state.settings.__experimentalBlockPatterns) !== null && _state$settings$__exp2 !== void 0 ? _state$settings$__exp2 : []), ...((_state$settings$selec2 = state.settings[selectBlockPatternsKey]?.(select)) !== null && _state$settings$selec2 !== void 0 ? _state$settings$selec2 : [])].filter((x, index, arr) => index === arr.findIndex(y => x.name === y.name)); }, getAllPatternsDependants(select))); const EMPTY_ARRAY = []; const getReusableBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { var _ref; const reusableBlocksSelect = state.settings[reusableBlocksSelectKey]; return (_ref = reusableBlocksSelect ? reusableBlocksSelect(select) : state.settings.__experimentalReusableBlocks) !== null && _ref !== void 0 ? _ref : EMPTY_ARRAY; }); /** * Returns the element of the last element that had focus when focus left the editor canvas. * * @param {Object} state Block editor state. * * @return {Object} Element. */ function getLastFocus(state) { return state.lastFocus; } /** * Returns true if the user is dragging anything, or false otherwise. It is possible for a * user to be dragging data from outside of the editor, so this selector is separate from * the `isDraggingBlocks` selector which only returns true if the user is dragging blocks. * * @param {Object} state Global application state. * * @return {boolean} Whether user is dragging. */ function private_selectors_isDragging(state) { return state.isDragging; } /** * Retrieves the expanded block from the state. * * @param {Object} state Block editor state. * * @return {string|null} The client ID of the expanded block, if set. */ function getExpandedBlock(state) { return state.expandedBlock; } /** * Retrieves the client ID of the ancestor block that is content locking the block * with the provided client ID. * * @param {Object} state Global application state. * @param {string} clientId Client Id of the block. * * @return {?string} Client ID of the ancestor block that is content locking the block. */ const getContentLockingParent = (state, clientId) => { let current = clientId; let result; while (!result && (current = state.blocks.parents.get(current))) { if (getTemplateLock(state, current) === 'contentOnly') { result = current; } } return result; }; /** * Retrieves the client ID of the parent section block. * * @param {Object} state Global application state. * @param {string} clientId Client Id of the block. * * @return {?string} Client ID of the ancestor block that is content locking the block. */ const getParentSectionBlock = (state, clientId) => { let current = clientId; let result; while (!result && (current = state.blocks.parents.get(current))) { if (isSectionBlock(state, current)) { result = current; } } return result; }; /** * Retrieves the client ID is a content locking parent * * @param {Object} state Global application state. * @param {string} clientId Client Id of the block. * * @return {boolean} Whether the block is a content locking parent. */ function isSectionBlock(state, clientId) { const blockName = getBlockName(state, clientId); if (blockName === 'core/block' || getTemplateLock(state, clientId) === 'contentOnly') { return true; } // Template parts become sections in navigation mode. const _isNavigationMode = isNavigationMode(state); if (_isNavigationMode && blockName === 'core/template-part') { return true; } const sectionRootClientId = getSectionRootClientId(state); const sectionClientIds = getBlockOrder(state, sectionRootClientId); return _isNavigationMode && sectionClientIds.includes(clientId); } /** * Retrieves the client ID of the block that is content locked but is * currently being temporarily edited as a non-locked block. * * @param {Object} state Global application state. * * @return {?string} The client ID of the block being temporarily edited as a non-locked block. */ function getTemporarilyEditingAsBlocks(state) { return state.temporarilyEditingAsBlocks; } /** * Returns the focus mode that should be reapplied when the user stops editing * a content locked blocks as a block without locking. * * @param {Object} state Global application state. * * @return {?string} The focus mode that should be re-set when temporarily editing as blocks stops. */ function getTemporarilyEditingFocusModeToRevert(state) { return state.temporarilyEditingFocusModeRevert; } /** * Returns the style attributes of multiple blocks. * * @param {Object} state Global application state. * @param {string[]} clientIds An array of block client IDs. * * @return {Object} An object where keys are client IDs and values are the corresponding block styles or undefined. */ const getBlockStyles = (0,external_wp_data_namespaceObject.createSelector)((state, clientIds) => clientIds.reduce((styles, clientId) => { styles[clientId] = state.blocks.attributes.get(clientId)?.style; return styles; }, {}), (state, clientIds) => [...clientIds.map(clientId => state.blocks.attributes.get(clientId)?.style)]); /** * Retrieves the client ID of the block which contains the blocks * acting as "sections" in the editor. This is typically the "main content" * of the template/post. * * @param {Object} state Editor state. * * @return {string|undefined} The section root client ID or undefined if not set. */ function getSectionRootClientId(state) { return state.settings?.[sectionRootClientIdKey]; } /** * Returns whether the editor is considered zoomed out. * * @param {Object} state Global application state. * @return {boolean} Whether the editor is zoomed. */ function isZoomOut(state) { return state.zoomLevel === 'auto-scaled' || state.zoomLevel < 100; } /** * Returns whether the zoom level. * * @param {Object} state Global application state. * @return {number|"auto-scaled"} Zoom level. */ function getZoomLevel(state) { return state.zoomLevel; } /** * Finds the closest block where the block is allowed to be inserted. * * @param {Object} state Editor state. * @param {string[] | string} name Block name or names. * @param {string} clientId Default insertion point. * * @return {string} clientID of the closest container when the block name can be inserted. */ function getClosestAllowedInsertionPoint(state, name, clientId = '') { const blockNames = Array.isArray(name) ? name : [name]; const areBlockNamesAllowedInClientId = id => blockNames.every(currentName => canInsertBlockType(state, currentName, id)); // If we're trying to insert at the root level and it's not allowed // Try the section root instead. if (!clientId) { if (areBlockNamesAllowedInClientId(clientId)) { return clientId; } const sectionRootClientId = getSectionRootClientId(state); if (sectionRootClientId && areBlockNamesAllowedInClientId(sectionRootClientId)) { return sectionRootClientId; } return null; } // Traverse the block tree up until we find a place where we can insert. let current = clientId; while (current !== null && !areBlockNamesAllowedInClientId(current)) { const parentClientId = getBlockRootClientId(state, current); current = parentClientId; } return current; } function getClosestAllowedInsertionPointForPattern(state, pattern, clientId) { const { allowedBlockTypes } = getSettings(state); const isAllowed = checkAllowListRecursive(getGrammar(pattern), allowedBlockTypes); if (!isAllowed) { return null; } const names = getGrammar(pattern).map(({ blockName: name }) => name); return getClosestAllowedInsertionPoint(state, names, clientId); } /** * Where the point where the next block will be inserted into. * * @param {Object} state * @return {Object} where the insertion point in the block editor is or null if none is set. */ function getInsertionPoint(state) { return state.insertionPoint; } ;// ./node_modules/@wordpress/block-editor/build-module/store/utils.js /** * WordPress dependencies */ /** * Internal dependencies */ const isFiltered = Symbol('isFiltered'); const parsedPatternCache = new WeakMap(); const grammarMapCache = new WeakMap(); function parsePattern(pattern) { const blocks = (0,external_wp_blocks_namespaceObject.parse)(pattern.content, { __unstableSkipMigrationLogs: true }); if (blocks.length === 1) { blocks[0].attributes = { ...blocks[0].attributes, metadata: { ...(blocks[0].attributes.metadata || {}), categories: pattern.categories, patternName: pattern.name, name: blocks[0].attributes.metadata?.name || pattern.title } }; } return { ...pattern, blocks }; } function getParsedPattern(pattern) { let parsedPattern = parsedPatternCache.get(pattern); if (!parsedPattern) { parsedPattern = parsePattern(pattern); parsedPatternCache.set(pattern, parsedPattern); } return parsedPattern; } function getGrammar(pattern) { let grammarMap = grammarMapCache.get(pattern); if (!grammarMap) { grammarMap = (0,external_wp_blockSerializationDefaultParser_namespaceObject.parse)(pattern.content); // Block names are null only at the top level for whitespace. grammarMap = grammarMap.filter(block => block.blockName !== null); grammarMapCache.set(pattern, grammarMap); } return grammarMap; } const checkAllowList = (list, item, defaultResult = null) => { if (typeof list === 'boolean') { return list; } if (Array.isArray(list)) { // TODO: when there is a canonical way to detect that we are editing a post // the following check should be changed to something like: // if ( list.includes( 'core/post-content' ) && getEditorMode() === 'post-content' && item === null ) if (list.includes('core/post-content') && item === null) { return true; } return list.includes(item); } return defaultResult; }; const checkAllowListRecursive = (blocks, allowedBlockTypes) => { if (typeof allowedBlockTypes === 'boolean') { return allowedBlockTypes; } const blocksQueue = [...blocks]; while (blocksQueue.length > 0) { const block = blocksQueue.shift(); const isAllowed = checkAllowList(allowedBlockTypes, block.name || block.blockName, true); if (!isAllowed) { return false; } block.innerBlocks?.forEach(innerBlock => { blocksQueue.push(innerBlock); }); } return true; }; const getAllPatternsDependants = select => state => { return [state.settings.__experimentalBlockPatterns, state.settings.__experimentalUserPatternCategories, state.settings.__experimentalReusableBlocks, state.settings[selectBlockPatternsKey]?.(select), state.blockPatterns, unlock(select(STORE_NAME)).getReusableBlocks()]; }; const getInsertBlockTypeDependants = select => (state, rootClientId) => { return [state.blockListSettings[rootClientId], state.blocks.byClientId.get(rootClientId), state.settings.allowedBlockTypes, state.settings.templateLock, state.blockEditingModes, select(STORE_NAME).__unstableGetEditorMode(state), getSectionRootClientId(state)]; }; ;// ./node_modules/@wordpress/block-editor/build-module/utils/sorting.js /** * Recursive stable sorting comparator function. * * @param {string|Function} field Field to sort by. * @param {Array} items Items to sort. * @param {string} order Order, 'asc' or 'desc'. * @return {Function} Comparison function to be used in a `.sort()`. */ const comparator = (field, items, order) => { return (a, b) => { let cmpA, cmpB; if (typeof field === 'function') { cmpA = field(a); cmpB = field(b); } else { cmpA = a[field]; cmpB = b[field]; } if (cmpA > cmpB) { return order === 'asc' ? 1 : -1; } else if (cmpB > cmpA) { return order === 'asc' ? -1 : 1; } const orderA = items.findIndex(item => item === a); const orderB = items.findIndex(item => item === b); // Stable sort: maintaining original array order if (orderA > orderB) { return 1; } else if (orderB > orderA) { return -1; } return 0; }; }; /** * Order items by a certain key. * Supports decorator functions that allow complex picking of a comparison field. * Sorts in ascending order by default, but supports descending as well. * Stable sort - maintains original order of equal items. * * @param {Array} items Items to order. * @param {string|Function} field Field to order by. * @param {string} order Sorting order, `asc` or `desc`. * @return {Array} Sorted items. */ function orderBy(items, field, order = 'asc') { return items.concat().sort(comparator(field, items, order)); } ;// ./node_modules/@wordpress/block-editor/build-module/store/selectors.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * A block selection object. * * @typedef {Object} WPBlockSelection * * @property {string} clientId A block client ID. * @property {string} attributeKey A block attribute key. * @property {number} offset An attribute value offset, based on the rich * text value. See `wp.richText.create`. */ // Module constants. const MILLISECONDS_PER_HOUR = 3600 * 1000; const MILLISECONDS_PER_DAY = 24 * 3600 * 1000; const MILLISECONDS_PER_WEEK = 7 * 24 * 3600 * 1000; /** * Shared reference to an empty array for cases where it is important to avoid * returning a new array reference on every invocation, as in a connected or * other pure component which performs `shouldComponentUpdate` check on props. * This should be used as a last resort, since the normalized data should be * maintained by the reducer result in state. * * @type {Array} */ const selectors_EMPTY_ARRAY = []; /** * Shared reference to an empty Set for cases where it is important to avoid * returning a new Set reference on every invocation, as in a connected or * other pure component which performs `shouldComponentUpdate` check on props. * This should be used as a last resort, since the normalized data should be * maintained by the reducer result in state. * * @type {Set} */ const EMPTY_SET = new Set(); const DEFAULT_INSERTER_OPTIONS = { [isFiltered]: true }; /** * Returns a block's name given its client ID, or null if no block exists with * the client ID. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * * @return {string} Block name. */ function getBlockName(state, clientId) { const block = state.blocks.byClientId.get(clientId); const socialLinkName = 'core/social-link'; if (external_wp_element_namespaceObject.Platform.OS !== 'web' && block?.name === socialLinkName) { const attributes = state.blocks.attributes.get(clientId); const { service } = attributes !== null && attributes !== void 0 ? attributes : {}; return service ? `${socialLinkName}-${service}` : socialLinkName; } return block ? block.name : null; } /** * Returns whether a block is valid or not. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * * @return {boolean} Is Valid. */ function isBlockValid(state, clientId) { const block = state.blocks.byClientId.get(clientId); return !!block && block.isValid; } /** * Returns a block's attributes given its client ID, or null if no block exists with * the client ID. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * * @return {?Object} Block attributes. */ function getBlockAttributes(state, clientId) { const block = state.blocks.byClientId.get(clientId); if (!block) { return null; } return state.blocks.attributes.get(clientId); } /** * Returns a block given its client ID. This is a parsed copy of the block, * containing its `blockName`, `clientId`, and current `attributes` state. This * is not the block's registration settings, which must be retrieved from the * blocks module registration store. * * getBlock recurses through its inner blocks until all its children blocks have * been retrieved. Note that getBlock will not return the child inner blocks of * an inner block controller. This is because an inner block controller syncs * itself with its own entity, and should therefore not be included with the * blocks of a different entity. For example, say you call `getBlocks( TP )` to * get the blocks of a template part. If another template part is a child of TP, * then the nested template part's child blocks will not be returned. This way, * the template block itself is considered part of the parent, but the children * are not. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * * @return {Object} Parsed block object. */ function getBlock(state, clientId) { if (!state.blocks.byClientId.has(clientId)) { return null; } return state.blocks.tree.get(clientId); } const __unstableGetBlockWithoutInnerBlocks = (0,external_wp_data_namespaceObject.createSelector)((state, clientId) => { const block = state.blocks.byClientId.get(clientId); if (!block) { return null; } return { ...block, attributes: getBlockAttributes(state, clientId) }; }, (state, clientId) => [state.blocks.byClientId.get(clientId), state.blocks.attributes.get(clientId)]); /** * Returns all block objects for the current post being edited as an array in * the order they appear in the post. Note that this will exclude child blocks * of nested inner block controllers. * * @param {Object} state Editor state. * @param {?string} rootClientId Optional root client ID of block list. * * @return {Object[]} Post blocks. */ function getBlocks(state, rootClientId) { const treeKey = !rootClientId || !areInnerBlocksControlled(state, rootClientId) ? rootClientId || '' : 'controlled||' + rootClientId; return state.blocks.tree.get(treeKey)?.innerBlocks || selectors_EMPTY_ARRAY; } /** * Returns a stripped down block object containing only its client ID, * and its inner blocks' client IDs. * * @deprecated * * @param {Object} state Editor state. * @param {string} clientId Client ID of the block to get. * * @return {Object} Client IDs of the post blocks. */ const __unstableGetClientIdWithClientIdsTree = (0,external_wp_data_namespaceObject.createSelector)((state, clientId) => { external_wp_deprecated_default()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdWithClientIdsTree", { since: '6.3', version: '6.5' }); return { clientId, innerBlocks: __unstableGetClientIdsTree(state, clientId) }; }, state => [state.blocks.order]); /** * Returns the block tree represented in the block-editor store from the * given root, consisting of stripped down block objects containing only * their client IDs, and their inner blocks' client IDs. * * @deprecated * * @param {Object} state Editor state. * @param {?string} rootClientId Optional root client ID of block list. * * @return {Object[]} Client IDs of the post blocks. */ const __unstableGetClientIdsTree = (0,external_wp_data_namespaceObject.createSelector)((state, rootClientId = '') => { external_wp_deprecated_default()("wp.data.select( 'core/block-editor' ).__unstableGetClientIdsTree", { since: '6.3', version: '6.5' }); return getBlockOrder(state, rootClientId).map(clientId => __unstableGetClientIdWithClientIdsTree(state, clientId)); }, state => [state.blocks.order]); /** * Returns an array containing the clientIds of all descendants of the blocks * given. Returned ids are ordered first by the order of the ids given, then * by the order that they appear in the editor. * * @param {Object} state Global application state. * @param {string|string[]} rootIds Client ID(s) for which descendant blocks are to be returned. * * @return {Array} Client IDs of descendants. */ const getClientIdsOfDescendants = (0,external_wp_data_namespaceObject.createSelector)((state, rootIds) => { rootIds = Array.isArray(rootIds) ? [...rootIds] : [rootIds]; const ids = []; // Add the descendants of the root blocks first. for (const rootId of rootIds) { const order = state.blocks.order.get(rootId); if (order) { ids.push(...order); } } let index = 0; // Add the descendants of the descendants, recursively. while (index < ids.length) { const id = ids[index]; const order = state.blocks.order.get(id); if (order) { ids.splice(index + 1, 0, ...order); } index++; } return ids; }, state => [state.blocks.order]); /** * Returns an array containing the clientIds of the top-level blocks and * their descendants of any depth (for nested blocks). Ids are returned * in the same order that they appear in the editor. * * @param {Object} state Global application state. * * @return {Array} ids of top-level and descendant blocks. */ const getClientIdsWithDescendants = state => getClientIdsOfDescendants(state, ''); /** * Returns the total number of blocks, or the total number of blocks with a specific name in a post. * The number returned includes nested blocks. * * @param {Object} state Global application state. * @param {?string} blockName Optional block name, if specified only blocks of that type will be counted. * * @return {number} Number of blocks in the post, or number of blocks with name equal to blockName. */ const getGlobalBlockCount = (0,external_wp_data_namespaceObject.createSelector)((state, blockName) => { const clientIds = getClientIdsWithDescendants(state); if (!blockName) { return clientIds.length; } let count = 0; for (const clientId of clientIds) { const block = state.blocks.byClientId.get(clientId); if (block.name === blockName) { count++; } } return count; }, state => [state.blocks.order, state.blocks.byClientId]); /** * Returns all blocks that match a blockName. Results include nested blocks. * * @param {Object} state Global application state. * @param {string[]} blockName Block name(s) for which clientIds are to be returned. * * @return {Array} Array of clientIds of blocks with name equal to blockName. */ const getBlocksByName = (0,external_wp_data_namespaceObject.createSelector)((state, blockName) => { if (!blockName) { return selectors_EMPTY_ARRAY; } const blockNames = Array.isArray(blockName) ? blockName : [blockName]; const clientIds = getClientIdsWithDescendants(state); const foundBlocks = clientIds.filter(clientId => { const block = state.blocks.byClientId.get(clientId); return blockNames.includes(block.name); }); return foundBlocks.length > 0 ? foundBlocks : selectors_EMPTY_ARRAY; }, state => [state.blocks.order, state.blocks.byClientId]); /** * Returns all global blocks that match a blockName. Results include nested blocks. * * @deprecated * * @param {Object} state Global application state. * @param {string[]} blockName Block name(s) for which clientIds are to be returned. * * @return {Array} Array of clientIds of blocks with name equal to blockName. */ function __experimentalGetGlobalBlocksByName(state, blockName) { external_wp_deprecated_default()("wp.data.select( 'core/block-editor' ).__experimentalGetGlobalBlocksByName", { since: '6.5', alternative: `wp.data.select( 'core/block-editor' ).getBlocksByName` }); return getBlocksByName(state, blockName); } /** * Given an array of block client IDs, returns the corresponding array of block * objects. * * @param {Object} state Editor state. * @param {string[]} clientIds Client IDs for which blocks are to be returned. * * @return {WPBlock[]} Block objects. */ const getBlocksByClientId = (0,external_wp_data_namespaceObject.createSelector)((state, clientIds) => (Array.isArray(clientIds) ? clientIds : [clientIds]).map(clientId => getBlock(state, clientId)), (state, clientIds) => (Array.isArray(clientIds) ? clientIds : [clientIds]).map(clientId => state.blocks.tree.get(clientId))); /** * Given an array of block client IDs, returns the corresponding array of block * names. * * @param {Object} state Editor state. * @param {string[]} clientIds Client IDs for which block names are to be returned. * * @return {string[]} Block names. */ const getBlockNamesByClientId = (0,external_wp_data_namespaceObject.createSelector)((state, clientIds) => getBlocksByClientId(state, clientIds).filter(Boolean).map(block => block.name), (state, clientIds) => getBlocksByClientId(state, clientIds)); /** * Returns the number of blocks currently present in the post. * * @param {Object} state Editor state. * @param {?string} rootClientId Optional root client ID of block list. * * @return {number} Number of blocks in the post. */ function getBlockCount(state, rootClientId) { return getBlockOrder(state, rootClientId).length; } /** * Returns the current selection start block client ID, attribute key and text * offset. * * @param {Object} state Block editor state. * * @return {WPBlockSelection} Selection start information. */ function getSelectionStart(state) { return state.selection.selectionStart; } /** * Returns the current selection end block client ID, attribute key and text * offset. * * @param {Object} state Block editor state. * * @return {WPBlockSelection} Selection end information. */ function getSelectionEnd(state) { return state.selection.selectionEnd; } /** * Returns the current block selection start. This value may be null, and it * may represent either a singular block selection or multi-selection start. * A selection is singular if its start and end match. * * @param {Object} state Global application state. * * @return {?string} Client ID of block selection start. */ function getBlockSelectionStart(state) { return state.selection.selectionStart.clientId; } /** * Returns the current block selection end. This value may be null, and it * may represent either a singular block selection or multi-selection end. * A selection is singular if its start and end match. * * @param {Object} state Global application state. * * @return {?string} Client ID of block selection end. */ function getBlockSelectionEnd(state) { return state.selection.selectionEnd.clientId; } /** * Returns the number of blocks currently selected in the post. * * @param {Object} state Global application state. * * @return {number} Number of blocks selected in the post. */ function getSelectedBlockCount(state) { const multiSelectedBlockCount = getMultiSelectedBlockClientIds(state).length; if (multiSelectedBlockCount) { return multiSelectedBlockCount; } return state.selection.selectionStart.clientId ? 1 : 0; } /** * Returns true if there is a single selected block, or false otherwise. * * @param {Object} state Editor state. * * @return {boolean} Whether a single block is selected. */ function hasSelectedBlock(state) { const { selectionStart, selectionEnd } = state.selection; return !!selectionStart.clientId && selectionStart.clientId === selectionEnd.clientId; } /** * Returns the currently selected block client ID, or null if there is no * selected block. * * @param {Object} state Editor state. * * @return {?string} Selected block client ID. */ function getSelectedBlockClientId(state) { const { selectionStart, selectionEnd } = state.selection; const { clientId } = selectionStart; if (!clientId || clientId !== selectionEnd.clientId) { return null; } return clientId; } /** * Returns the currently selected block, or null if there is no selected block. * * @param {Object} state Global application state. * * @example * *```js * import { select } from '@wordpress/data' * import { store as blockEditorStore } from '@wordpress/block-editor' * * // Set initial active block client ID * let activeBlockClientId = null * * const getActiveBlockData = () => { * const activeBlock = select(blockEditorStore).getSelectedBlock() * * if (activeBlock && activeBlock.clientId !== activeBlockClientId) { * activeBlockClientId = activeBlock.clientId * * // Get active block name and attributes * const activeBlockName = activeBlock.name * const activeBlockAttributes = activeBlock.attributes * * // Log active block name and attributes * console.log(activeBlockName, activeBlockAttributes) * } * } * * // Subscribe to changes in the editor * // wp.data.subscribe(() => { * // getActiveBlockData() * // }) * * // Update active block data on click * // onclick="getActiveBlockData()" *``` * * @return {?Object} Selected block. */ function getSelectedBlock(state) { const clientId = getSelectedBlockClientId(state); return clientId ? getBlock(state, clientId) : null; } /** * Given a block client ID, returns the root block from which the block is * nested, an empty string for top-level blocks, or null if the block does not * exist. * * @param {Object} state Editor state. * @param {string} clientId Block from which to find root client ID. * * @return {?string} Root client ID, if exists */ function getBlockRootClientId(state, clientId) { var _state$blocks$parents; return (_state$blocks$parents = state.blocks.parents.get(clientId)) !== null && _state$blocks$parents !== void 0 ? _state$blocks$parents : null; } /** * Given a block client ID, returns the list of all its parents from top to bottom. * * @param {Object} state Editor state. * @param {string} clientId Block from which to find root client ID. * @param {boolean} ascending Order results from bottom to top (true) or top to bottom (false). * * @return {Array} ClientIDs of the parent blocks. */ const getBlockParents = (0,external_wp_data_namespaceObject.createSelector)((state, clientId, ascending = false) => { const parents = []; let current = clientId; while (current = state.blocks.parents.get(current)) { parents.push(current); } if (!parents.length) { return selectors_EMPTY_ARRAY; } return ascending ? parents : parents.reverse(); }, state => [state.blocks.parents]); /** * Given a block client ID and a block name, returns the list of all its parents * from top to bottom, filtered by the given name(s). For example, if passed * 'core/group' as the blockName, it will only return parents which are group * blocks. If passed `[ 'core/group', 'core/cover']`, as the blockName, it will * return parents which are group blocks and parents which are cover blocks. * * @param {Object} state Editor state. * @param {string} clientId Block from which to find root client ID. * @param {string|string[]} blockName Block name(s) to filter. * @param {boolean} ascending Order results from bottom to top (true) or top to bottom (false). * * @return {Array} ClientIDs of the parent blocks. */ const getBlockParentsByBlockName = (0,external_wp_data_namespaceObject.createSelector)((state, clientId, blockName, ascending = false) => { const parents = getBlockParents(state, clientId, ascending); const hasName = Array.isArray(blockName) ? name => blockName.includes(name) : name => blockName === name; return parents.filter(id => hasName(getBlockName(state, id))); }, state => [state.blocks.parents]); /** * Given a block client ID, returns the root of the hierarchy from which the block is nested, return the block itself for root level blocks. * * @param {Object} state Editor state. * @param {string} clientId Block from which to find root client ID. * * @return {string} Root client ID */ function getBlockHierarchyRootClientId(state, clientId) { let current = clientId; let parent; do { parent = current; current = state.blocks.parents.get(current); } while (current); return parent; } /** * Given a block client ID, returns the lowest common ancestor with selected client ID. * * @param {Object} state Editor state. * @param {string} clientId Block from which to find common ancestor client ID. * * @return {string} Common ancestor client ID or undefined */ function getLowestCommonAncestorWithSelectedBlock(state, clientId) { const selectedId = getSelectedBlockClientId(state); const clientParents = [...getBlockParents(state, clientId), clientId]; const selectedParents = [...getBlockParents(state, selectedId), selectedId]; let lowestCommonAncestor; const maxDepth = Math.min(clientParents.length, selectedParents.length); for (let index = 0; index < maxDepth; index++) { if (clientParents[index] === selectedParents[index]) { lowestCommonAncestor = clientParents[index]; } else { break; } } return lowestCommonAncestor; } /** * Returns the client ID of the block adjacent one at the given reference * startClientId and modifier directionality. Defaults start startClientId to * the selected block, and direction as next block. Returns null if there is no * adjacent block. * * @param {Object} state Editor state. * @param {?string} startClientId Optional client ID of block from which to * search. * @param {?number} modifier Directionality multiplier (1 next, -1 * previous). * * @return {?string} Return the client ID of the block, or null if none exists. */ function getAdjacentBlockClientId(state, startClientId, modifier = 1) { // Default to selected block. if (startClientId === undefined) { startClientId = getSelectedBlockClientId(state); } // Try multi-selection starting at extent based on modifier. if (startClientId === undefined) { if (modifier < 0) { startClientId = getFirstMultiSelectedBlockClientId(state); } else { startClientId = getLastMultiSelectedBlockClientId(state); } } // Validate working start client ID. if (!startClientId) { return null; } // Retrieve start block root client ID, being careful to allow the falsey // empty string top-level root by explicitly testing against null. const rootClientId = getBlockRootClientId(state, startClientId); if (rootClientId === null) { return null; } const { order } = state.blocks; const orderSet = order.get(rootClientId); const index = orderSet.indexOf(startClientId); const nextIndex = index + 1 * modifier; // Block was first in set and we're attempting to get previous. if (nextIndex < 0) { return null; } // Block was last in set and we're attempting to get next. if (nextIndex === orderSet.length) { return null; } // Assume incremented index is within the set. return orderSet[nextIndex]; } /** * Returns the previous block's client ID from the given reference start ID. * Defaults start to the selected block. Returns null if there is no previous * block. * * @param {Object} state Editor state. * @param {?string} startClientId Optional client ID of block from which to * search. * * @return {?string} Adjacent block's client ID, or null if none exists. */ function getPreviousBlockClientId(state, startClientId) { return getAdjacentBlockClientId(state, startClientId, -1); } /** * Returns the next block's client ID from the given reference start ID. * Defaults start to the selected block. Returns null if there is no next * block. * * @param {Object} state Editor state. * @param {?string} startClientId Optional client ID of block from which to * search. * * @return {?string} Adjacent block's client ID, or null if none exists. */ function getNextBlockClientId(state, startClientId) { return getAdjacentBlockClientId(state, startClientId, 1); } /* eslint-disable jsdoc/valid-types */ /** * Returns the initial caret position for the selected block. * This position is to used to position the caret properly when the selected block changes. * If the current block is not a RichText, having initial position set to 0 means "focus block" * * @param {Object} state Global application state. * * @return {0|-1|null} Initial position. */ function getSelectedBlocksInitialCaretPosition(state) { /* eslint-enable jsdoc/valid-types */ return state.initialPosition; } /** * Returns the current selection set of block client IDs (multiselection or single selection). * * @param {Object} state Editor state. * * @return {Array} Multi-selected block client IDs. */ const getSelectedBlockClientIds = (0,external_wp_data_namespaceObject.createSelector)(state => { const { selectionStart, selectionEnd } = state.selection; if (!selectionStart.clientId || !selectionEnd.clientId) { return selectors_EMPTY_ARRAY; } if (selectionStart.clientId === selectionEnd.clientId) { return [selectionStart.clientId]; } // Retrieve root client ID to aid in retrieving relevant nested block // order, being careful to allow the falsey empty string top-level root // by explicitly testing against null. const rootClientId = getBlockRootClientId(state, selectionStart.clientId); if (rootClientId === null) { return selectors_EMPTY_ARRAY; } const blockOrder = getBlockOrder(state, rootClientId); const startIndex = blockOrder.indexOf(selectionStart.clientId); const endIndex = blockOrder.indexOf(selectionEnd.clientId); if (startIndex > endIndex) { return blockOrder.slice(endIndex, startIndex + 1); } return blockOrder.slice(startIndex, endIndex + 1); }, state => [state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId]); /** * Returns the current multi-selection set of block client IDs, or an empty * array if there is no multi-selection. * * @param {Object} state Editor state. * * @return {Array} Multi-selected block client IDs. */ function getMultiSelectedBlockClientIds(state) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId === selectionEnd.clientId) { return selectors_EMPTY_ARRAY; } return getSelectedBlockClientIds(state); } /** * Returns the current multi-selection set of blocks, or an empty array if * there is no multi-selection. * * @param {Object} state Editor state. * * @return {Array} Multi-selected block objects. */ const getMultiSelectedBlocks = (0,external_wp_data_namespaceObject.createSelector)(state => { const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state); if (!multiSelectedBlockClientIds.length) { return selectors_EMPTY_ARRAY; } return multiSelectedBlockClientIds.map(clientId => getBlock(state, clientId)); }, state => [...getSelectedBlockClientIds.getDependants(state), state.blocks.byClientId, state.blocks.order, state.blocks.attributes]); /** * Returns the client ID of the first block in the multi-selection set, or null * if there is no multi-selection. * * @param {Object} state Editor state. * * @return {?string} First block client ID in the multi-selection set. */ function getFirstMultiSelectedBlockClientId(state) { return getMultiSelectedBlockClientIds(state)[0] || null; } /** * Returns the client ID of the last block in the multi-selection set, or null * if there is no multi-selection. * * @param {Object} state Editor state. * * @return {?string} Last block client ID in the multi-selection set. */ function getLastMultiSelectedBlockClientId(state) { const selectedClientIds = getMultiSelectedBlockClientIds(state); return selectedClientIds[selectedClientIds.length - 1] || null; } /** * Returns true if a multi-selection exists, and the block corresponding to the * specified client ID is the first block of the multi-selection set, or false * otherwise. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * * @return {boolean} Whether block is first in multi-selection. */ function isFirstMultiSelectedBlock(state, clientId) { return getFirstMultiSelectedBlockClientId(state) === clientId; } /** * Returns true if the client ID occurs within the block multi-selection, or * false otherwise. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * * @return {boolean} Whether block is in multi-selection set. */ function isBlockMultiSelected(state, clientId) { return getMultiSelectedBlockClientIds(state).indexOf(clientId) !== -1; } /** * Returns true if an ancestor of the block is multi-selected, or false * otherwise. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * * @return {boolean} Whether an ancestor of the block is in multi-selection * set. */ const isAncestorMultiSelected = (0,external_wp_data_namespaceObject.createSelector)((state, clientId) => { let ancestorClientId = clientId; let isMultiSelected = false; while (ancestorClientId && !isMultiSelected) { ancestorClientId = getBlockRootClientId(state, ancestorClientId); isMultiSelected = isBlockMultiSelected(state, ancestorClientId); } return isMultiSelected; }, state => [state.blocks.order, state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId]); /** * Returns the client ID of the block which begins the multi-selection set, or * null if there is no multi-selection. * * This is not necessarily the first client ID in the selection. * * @see getFirstMultiSelectedBlockClientId * * @param {Object} state Editor state. * * @return {?string} Client ID of block beginning multi-selection. */ function getMultiSelectedBlocksStartClientId(state) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId === selectionEnd.clientId) { return null; } return selectionStart.clientId || null; } /** * Returns the client ID of the block which ends the multi-selection set, or * null if there is no multi-selection. * * This is not necessarily the last client ID in the selection. * * @see getLastMultiSelectedBlockClientId * * @param {Object} state Editor state. * * @return {?string} Client ID of block ending multi-selection. */ function getMultiSelectedBlocksEndClientId(state) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId === selectionEnd.clientId) { return null; } return selectionEnd.clientId || null; } /** * Returns true if the selection is not partial. * * @param {Object} state Editor state. * * @return {boolean} Whether the selection is mergeable. */ function __unstableIsFullySelected(state) { const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); return !selectionAnchor.attributeKey && !selectionFocus.attributeKey && typeof selectionAnchor.offset === 'undefined' && typeof selectionFocus.offset === 'undefined'; } /** * Returns true if the selection is collapsed. * * @param {Object} state Editor state. * * @return {boolean} Whether the selection is collapsed. */ function __unstableIsSelectionCollapsed(state) { const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); return !!selectionAnchor && !!selectionFocus && selectionAnchor.clientId === selectionFocus.clientId && selectionAnchor.attributeKey === selectionFocus.attributeKey && selectionAnchor.offset === selectionFocus.offset; } function __unstableSelectionHasUnmergeableBlock(state) { return getSelectedBlockClientIds(state).some(clientId => { const blockName = getBlockName(state, clientId); const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName); return !blockType.merge; }); } /** * Check whether the selection is mergeable. * * @param {Object} state Editor state. * @param {boolean} isForward Whether to merge forwards. * * @return {boolean} Whether the selection is mergeable. */ function __unstableIsSelectionMergeable(state, isForward) { const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); // It's not mergeable if the start and end are within the same block. if (selectionAnchor.clientId === selectionFocus.clientId) { return false; } // It's not mergeable if there's no rich text selection. if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') { return false; } const anchorRootClientId = getBlockRootClientId(state, selectionAnchor.clientId); const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId); // It's not mergeable if the selection doesn't start and end in the same // block list. Maybe in the future it should be allowed. if (anchorRootClientId !== focusRootClientId) { return false; } const blockOrder = getBlockOrder(state, anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); // Reassign selection start and end based on order. let selectionStart, selectionEnd; if (anchorIndex > focusIndex) { selectionStart = selectionFocus; selectionEnd = selectionAnchor; } else { selectionStart = selectionAnchor; selectionEnd = selectionFocus; } const targetBlockClientId = isForward ? selectionEnd.clientId : selectionStart.clientId; const blockToMergeClientId = isForward ? selectionStart.clientId : selectionEnd.clientId; const targetBlockName = getBlockName(state, targetBlockClientId); const targetBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(targetBlockName); if (!targetBlockType.merge) { return false; } const blockToMerge = getBlock(state, blockToMergeClientId); // It's mergeable if the blocks are of the same type. if (blockToMerge.name === targetBlockName) { return true; } // If the blocks are of a different type, try to transform the block being // merged into the same type of block. const blocksToMerge = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blockToMerge, targetBlockName); return blocksToMerge && blocksToMerge.length; } /** * Get partial selected blocks with their content updated * based on the selection. * * @param {Object} state Editor state. * * @return {Object[]} Updated partial selected blocks. */ const __unstableGetSelectedBlocksWithPartialSelection = state => { const selectionAnchor = getSelectionStart(state); const selectionFocus = getSelectionEnd(state); if (selectionAnchor.clientId === selectionFocus.clientId) { return selectors_EMPTY_ARRAY; } // Can't split if the selection is not set. if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') { return selectors_EMPTY_ARRAY; } const anchorRootClientId = getBlockRootClientId(state, selectionAnchor.clientId); const focusRootClientId = getBlockRootClientId(state, selectionFocus.clientId); // It's not splittable if the selection doesn't start and end in the same // block list. Maybe in the future it should be allowed. if (anchorRootClientId !== focusRootClientId) { return selectors_EMPTY_ARRAY; } const blockOrder = getBlockOrder(state, anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); // Reassign selection start and end based on order. const [selectionStart, selectionEnd] = anchorIndex > focusIndex ? [selectionFocus, selectionAnchor] : [selectionAnchor, selectionFocus]; const blockA = getBlock(state, selectionStart.clientId); const blockB = getBlock(state, selectionEnd.clientId); const htmlA = blockA.attributes[selectionStart.attributeKey]; const htmlB = blockB.attributes[selectionEnd.attributeKey]; let valueA = (0,external_wp_richText_namespaceObject.create)({ html: htmlA }); let valueB = (0,external_wp_richText_namespaceObject.create)({ html: htmlB }); valueA = (0,external_wp_richText_namespaceObject.remove)(valueA, 0, selectionStart.offset); valueB = (0,external_wp_richText_namespaceObject.remove)(valueB, selectionEnd.offset, valueB.text.length); return [{ ...blockA, attributes: { ...blockA.attributes, [selectionStart.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: valueA }) } }, { ...blockB, attributes: { ...blockB.attributes, [selectionEnd.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: valueB }) } }]; }; /** * Returns an array containing all block client IDs in the editor in the order * they appear. Optionally accepts a root client ID of the block list for which * the order should be returned, defaulting to the top-level block order. * * @param {Object} state Editor state. * @param {?string} rootClientId Optional root client ID of block list. * * @return {Array} Ordered client IDs of editor blocks. */ function getBlockOrder(state, rootClientId) { return state.blocks.order.get(rootClientId || '') || selectors_EMPTY_ARRAY; } /** * Returns the index at which the block corresponding to the specified client * ID occurs within the block order, or `-1` if the block does not exist. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * * @return {number} Index at which block exists in order. */ function getBlockIndex(state, clientId) { const rootClientId = getBlockRootClientId(state, clientId); return getBlockOrder(state, rootClientId).indexOf(clientId); } /** * Returns true if the block corresponding to the specified client ID is * currently selected and no multi-selection exists, or false otherwise. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * * @return {boolean} Whether block is selected and multi-selection exists. */ function isBlockSelected(state, clientId) { const { selectionStart, selectionEnd } = state.selection; if (selectionStart.clientId !== selectionEnd.clientId) { return false; } return selectionStart.clientId === clientId; } /** * Returns true if one of the block's inner blocks is selected. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * @param {boolean} deep Perform a deep check. * * @return {boolean} Whether the block has an inner block selected */ function hasSelectedInnerBlock(state, clientId, deep = false) { const selectedBlockClientIds = getSelectedBlockClientIds(state); if (!selectedBlockClientIds.length) { return false; } if (deep) { return selectedBlockClientIds.some(id => // Pass true because we don't care about order and it's more // performant. getBlockParents(state, id, true).includes(clientId)); } return selectedBlockClientIds.some(id => getBlockRootClientId(state, id) === clientId); } /** * Returns true if one of the block's inner blocks is dragged. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * @param {boolean} deep Perform a deep check. * * @return {boolean} Whether the block has an inner block dragged */ function hasDraggedInnerBlock(state, clientId, deep = false) { return getBlockOrder(state, clientId).some(innerClientId => isBlockBeingDragged(state, innerClientId) || deep && hasDraggedInnerBlock(state, innerClientId, deep)); } /** * Returns true if the block corresponding to the specified client ID is * currently selected but isn't the last of the selected blocks. Here "last" * refers to the block sequence in the document, _not_ the sequence of * multi-selection, which is why `state.selectionEnd` isn't used. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * * @return {boolean} Whether block is selected and not the last in the * selection. */ function isBlockWithinSelection(state, clientId) { if (!clientId) { return false; } const clientIds = getMultiSelectedBlockClientIds(state); const index = clientIds.indexOf(clientId); return index > -1 && index < clientIds.length - 1; } /** * Returns true if a multi-selection has been made, or false otherwise. * * @param {Object} state Editor state. * * @return {boolean} Whether multi-selection has been made. */ function hasMultiSelection(state) { const { selectionStart, selectionEnd } = state.selection; return selectionStart.clientId !== selectionEnd.clientId; } /** * Whether in the process of multi-selecting or not. This flag is only true * while the multi-selection is being selected (by mouse move), and is false * once the multi-selection has been settled. * * @see hasMultiSelection * * @param {Object} state Global application state. * * @return {boolean} True if multi-selecting, false if not. */ function selectors_isMultiSelecting(state) { return state.isMultiSelecting; } /** * Selector that returns if multi-selection is enabled or not. * * @param {Object} state Global application state. * * @return {boolean} True if it should be possible to multi-select blocks, false if multi-selection is disabled. */ function selectors_isSelectionEnabled(state) { return state.isSelectionEnabled; } /** * Returns the block's editing mode, defaulting to "visual" if not explicitly * assigned. * * @param {Object} state Editor state. * @param {string} clientId Block client ID. * * @return {Object} Block editing mode. */ function getBlockMode(state, clientId) { return state.blocksMode[clientId] || 'visual'; } /** * Returns true if the user is typing, or false otherwise. * * @param {Object} state Global application state. * * @return {boolean} Whether user is typing. */ function selectors_isTyping(state) { return state.isTyping; } /** * Returns true if the user is dragging blocks, or false otherwise. * * @param {Object} state Global application state. * * @return {boolean} Whether user is dragging blocks. */ function isDraggingBlocks(state) { return !!state.draggedBlocks.length; } /** * Returns the client ids of any blocks being directly dragged. * * This does not include children of a parent being dragged. * * @param {Object} state Global application state. * * @return {string[]} Array of dragged block client ids. */ function getDraggedBlockClientIds(state) { return state.draggedBlocks; } /** * Returns whether the block is being dragged. * * Only returns true if the block is being directly dragged, * not if the block is a child of a parent being dragged. * See `isAncestorBeingDragged` for child blocks. * * @param {Object} state Global application state. * @param {string} clientId Client id for block to check. * * @return {boolean} Whether the block is being dragged. */ function isBlockBeingDragged(state, clientId) { return state.draggedBlocks.includes(clientId); } /** * Returns whether a parent/ancestor of the block is being dragged. * * @param {Object} state Global application state. * @param {string} clientId Client id for block to check. * * @return {boolean} Whether the block's ancestor is being dragged. */ function isAncestorBeingDragged(state, clientId) { // Return early if no blocks are being dragged rather than // the more expensive check for parents. if (!isDraggingBlocks(state)) { return false; } const parents = getBlockParents(state, clientId); return parents.some(parentClientId => isBlockBeingDragged(state, parentClientId)); } /** * Returns true if the caret is within formatted text, or false otherwise. * * @deprecated * * @return {boolean} Whether the caret is within formatted text. */ function isCaretWithinFormattedText() { external_wp_deprecated_default()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText', { since: '6.1', version: '6.3' }); return false; } /** * Returns the location of the insertion cue. Defaults to the last index. * * @param {Object} state Editor state. * * @return {Object} Insertion point object with `rootClientId`, `index`. */ const getBlockInsertionPoint = (0,external_wp_data_namespaceObject.createSelector)(state => { let rootClientId, index; const { insertionCue, selection: { selectionEnd } } = state; if (insertionCue !== null) { return insertionCue; } const { clientId } = selectionEnd; if (clientId) { rootClientId = getBlockRootClientId(state, clientId) || undefined; index = getBlockIndex(state, selectionEnd.clientId) + 1; } else { index = getBlockOrder(state).length; } return { rootClientId, index }; }, state => [state.insertionCue, state.selection.selectionEnd.clientId, state.blocks.parents, state.blocks.order]); /** * Returns true if the block insertion point is visible. * * @param {Object} state Global application state. * * @return {?boolean} Whether the insertion point is visible or not. */ function isBlockInsertionPointVisible(state) { return state.insertionCue !== null; } /** * Returns whether the blocks matches the template or not. * * @param {boolean} state * @return {?boolean} Whether the template is valid or not. */ function isValidTemplate(state) { return state.template.isValid; } /** * Returns the defined block template * * @param {boolean} state * * @return {?Array} Block Template. */ function getTemplate(state) { return state.settings.template; } /** * Returns the defined block template lock. Optionally accepts a root block * client ID as context, otherwise defaulting to the global context. * * @param {Object} state Editor state. * @param {?string} rootClientId Optional block root client ID. * * @return {string|false} Block Template Lock */ function getTemplateLock(state, rootClientId) { var _getBlockListSettings; if (!rootClientId) { var _state$settings$templ; return (_state$settings$templ = state.settings.templateLock) !== null && _state$settings$templ !== void 0 ? _state$settings$templ : false; } return (_getBlockListSettings = getBlockListSettings(state, rootClientId)?.templateLock) !== null && _getBlockListSettings !== void 0 ? _getBlockListSettings : false; } /** * Determines if the given block type is visible in the inserter. * Note that this is different than whether a block is allowed to be inserted. * In some cases, the block is not allowed in a given position but * it should still be visible in the inserter to be able to add it * to a different position. * * @param {Object} state Editor state. * @param {string|Object} blockNameOrType The block type object, e.g., the response * from the block directory; or a string name of * an installed block type, e.g.' core/paragraph'. * @param {?string} rootClientId Optional root client ID of block list. * * @return {boolean} Whether the given block type is allowed to be inserted. */ const isBlockVisibleInTheInserter = (state, blockNameOrType, rootClientId = null) => { let blockType; let blockName; if (blockNameOrType && 'object' === typeof blockNameOrType) { blockType = blockNameOrType; blockName = blockNameOrType.name; } else { blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockNameOrType); blockName = blockNameOrType; } if (!blockType) { return false; } const { allowedBlockTypes } = getSettings(state); const isBlockAllowedInEditor = checkAllowList(allowedBlockTypes, blockName, true); if (!isBlockAllowedInEditor) { return false; } // If parent blocks are not visible, child blocks should be hidden too. const parents = (Array.isArray(blockType.parent) ? blockType.parent : []).concat(Array.isArray(blockType.ancestor) ? blockType.ancestor : []); if (parents.length > 0) { // This is an exception to the rule that says that all blocks are visible in the inserter. // Blocks that require a given parent or ancestor are only visible if we're within that parent. if (parents.includes('core/post-content')) { return true; } let current = rootClientId; let hasParent = false; do { if (parents.includes(getBlockName(state, current))) { hasParent = true; break; } current = state.blocks.parents.get(current); } while (current); return hasParent; } return true; }; /** * Determines if the given block type is allowed to be inserted into the block list. * This function is not exported and not memoized because using a memoized selector * inside another memoized selector is just a waste of time. * * @param {Object} state Editor state. * @param {string|Object} blockName The block type object, e.g., the response * from the block directory; or a string name of * an installed block type, e.g.' core/paragraph'. * @param {?string} rootClientId Optional root client ID of block list. * * @return {boolean} Whether the given block type is allowed to be inserted. */ const canInsertBlockTypeUnmemoized = (state, blockName, rootClientId = null) => { if (!isBlockVisibleInTheInserter(state, blockName, rootClientId)) { return false; } let blockType; if (blockName && 'object' === typeof blockName) { blockType = blockName; blockName = blockType.name; } else { blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName); } const isLocked = !!getTemplateLock(state, rootClientId); if (isLocked) { return false; } const _isSectionBlock = !!isSectionBlock(state, rootClientId); if (_isSectionBlock) { return false; } if (getBlockEditingMode(state, rootClientId !== null && rootClientId !== void 0 ? rootClientId : '') === 'disabled') { return false; } const parentBlockListSettings = getBlockListSettings(state, rootClientId); // The parent block doesn't have settings indicating it doesn't support // inner blocks, return false. if (rootClientId && parentBlockListSettings === undefined) { return false; } const parentName = getBlockName(state, rootClientId); const parentBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(parentName); // Look at the `blockType.allowedBlocks` field to determine whether this is an allowed child block. const parentAllowedChildBlocks = parentBlockType?.allowedBlocks; let hasParentAllowedBlock = checkAllowList(parentAllowedChildBlocks, blockName); // The `allowedBlocks` block list setting can further limit which blocks are allowed children. if (hasParentAllowedBlock !== false) { const parentAllowedBlocks = parentBlockListSettings?.allowedBlocks; const hasParentListAllowedBlock = checkAllowList(parentAllowedBlocks, blockName); // Never downgrade the result from `true` to `null` if (hasParentListAllowedBlock !== null) { hasParentAllowedBlock = hasParentListAllowedBlock; } } const blockAllowedParentBlocks = blockType.parent; const hasBlockAllowedParent = checkAllowList(blockAllowedParentBlocks, parentName); let hasBlockAllowedAncestor = true; const blockAllowedAncestorBlocks = blockType.ancestor; if (blockAllowedAncestorBlocks) { const ancestors = [rootClientId, ...getBlockParents(state, rootClientId)]; hasBlockAllowedAncestor = ancestors.some(ancestorClientId => checkAllowList(blockAllowedAncestorBlocks, getBlockName(state, ancestorClientId))); } const canInsert = hasBlockAllowedAncestor && (hasParentAllowedBlock === null && hasBlockAllowedParent === null || hasParentAllowedBlock === true || hasBlockAllowedParent === true); if (!canInsert) { return canInsert; } /** * This filter is an ad-hoc solution to prevent adding template parts inside post content. * Conceptually, having a filter inside a selector is bad pattern so this code will be * replaced by a declarative API that doesn't the following drawbacks: * * Filters are not reactive: Upon switching between "template mode" and non "template mode", * the filter and selector won't necessarily be executed again. For now, it doesn't matter much * because you can't switch between the two modes while the inserter stays open. * * Filters are global: Once they're defined, they will affect all editor instances and all registries. * An ideal API would only affect specific editor instances. */ return (0,external_wp_hooks_namespaceObject.applyFilters)('blockEditor.__unstableCanInsertBlockType', canInsert, blockType, rootClientId, { // Pass bound selectors of the current registry. If we're in a nested // context, the data will differ from the one selected from the root // registry. getBlock: getBlock.bind(null, state), getBlockParentsByBlockName: getBlockParentsByBlockName.bind(null, state) }); }; /** * Determines if the given block type is allowed to be inserted into the block list. * * @param {Object} state Editor state. * @param {string} blockName The name of the block type, e.g.' core/paragraph'. * @param {?string} rootClientId Optional root client ID of block list. * * @return {boolean} Whether the given block type is allowed to be inserted. */ const canInsertBlockType = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)(canInsertBlockTypeUnmemoized, (state, blockName, rootClientId) => getInsertBlockTypeDependants(select)(state, rootClientId))); /** * Determines if the given blocks are allowed to be inserted into the block * list. * * @param {Object} state Editor state. * @param {string} clientIds The block client IDs to be inserted. * @param {?string} rootClientId Optional root client ID of block list. * * @return {boolean} Whether the given blocks are allowed to be inserted. */ function canInsertBlocks(state, clientIds, rootClientId = null) { return clientIds.every(id => canInsertBlockType(state, getBlockName(state, id), rootClientId)); } /** * Determines if the given block is allowed to be deleted. * * @param {Object} state Editor state. * @param {string} clientId The block client Id. * * @return {boolean} Whether the given block is allowed to be removed. */ function canRemoveBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); if (attributes === null) { return true; } if (attributes.lock?.remove !== undefined) { return !attributes.lock.remove; } const rootClientId = getBlockRootClientId(state, clientId); if (getTemplateLock(state, rootClientId)) { return false; } const isBlockWithinSection = !!getParentSectionBlock(state, clientId); if (isBlockWithinSection) { return false; } return getBlockEditingMode(state, rootClientId) !== 'disabled'; } /** * Determines if the given blocks are allowed to be removed. * * @param {Object} state Editor state. * @param {string} clientIds The block client IDs to be removed. * * @return {boolean} Whether the given blocks are allowed to be removed. */ function canRemoveBlocks(state, clientIds) { return clientIds.every(clientId => canRemoveBlock(state, clientId)); } /** * Determines if the given block is allowed to be moved. * * @param {Object} state Editor state. * @param {string} clientId The block client Id. * * @return {boolean} Whether the given block is allowed to be moved. */ function canMoveBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); if (attributes === null) { return true; } if (attributes.lock?.move !== undefined) { return !attributes.lock.move; } const rootClientId = getBlockRootClientId(state, clientId); if (getTemplateLock(state, rootClientId) === 'all') { return false; } return getBlockEditingMode(state, rootClientId) !== 'disabled'; } /** * Determines if the given blocks are allowed to be moved. * * @param {Object} state Editor state. * @param {string} clientIds The block client IDs to be moved. * * @return {boolean} Whether the given blocks are allowed to be moved. */ function canMoveBlocks(state, clientIds) { return clientIds.every(clientId => canMoveBlock(state, clientId)); } /** * Determines if the given block is allowed to be edited. * * @param {Object} state Editor state. * @param {string} clientId The block client Id. * * @return {boolean} Whether the given block is allowed to be edited. */ function canEditBlock(state, clientId) { const attributes = getBlockAttributes(state, clientId); if (attributes === null) { return true; } const { lock } = attributes; // When the edit is true, we cannot edit the block. return !lock?.edit; } /** * Determines if the given block type can be locked/unlocked by a user. * * @param {Object} state Editor state. * @param {(string|Object)} nameOrType Block name or type object. * * @return {boolean} Whether a given block type can be locked/unlocked. */ function canLockBlockType(state, nameOrType) { if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, 'lock', true)) { return false; } // Use block editor settings as the default value. return !!state.settings?.canLockBlocks; } /** * Returns information about how recently and frequently a block has been inserted. * * @param {Object} state Global application state. * @param {string} id A string which identifies the insert, e.g. 'core/block/12' * * @return {?{ time: number, count: number }} An object containing `time` which is when the last * insert occurred as a UNIX epoch, and `count` which is * the number of inserts that have occurred. */ function getInsertUsage(state, id) { var _state$preferences$in; return (_state$preferences$in = state.preferences.insertUsage?.[id]) !== null && _state$preferences$in !== void 0 ? _state$preferences$in : null; } /** * Returns whether we can show a block type in the inserter * * @param {Object} state Global State * @param {Object} blockType BlockType * @param {?string} rootClientId Optional root client ID of block list. * * @return {boolean} Whether the given block type is allowed to be shown in the inserter. */ const canIncludeBlockTypeInInserter = (state, blockType, rootClientId) => { if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'inserter', true)) { return false; } return canInsertBlockTypeUnmemoized(state, blockType.name, rootClientId); }; /** * Return a function to be used to transform a block variation to an inserter item * * @param {Object} state Global State * @param {Object} item Denormalized inserter item * @return {Function} Function to transform a block variation to inserter item */ const getItemFromVariation = (state, item) => variation => { const variationId = `${item.id}/${variation.name}`; const { time, count = 0 } = getInsertUsage(state, variationId) || {}; return { ...item, id: variationId, icon: variation.icon || item.icon, title: variation.title || item.title, description: variation.description || item.description, category: variation.category || item.category, // If `example` is explicitly undefined for the variation, the preview will not be shown. example: variation.hasOwnProperty('example') ? variation.example : item.example, initialAttributes: { ...item.initialAttributes, ...variation.attributes }, innerBlocks: variation.innerBlocks, keywords: variation.keywords || item.keywords, frecency: calculateFrecency(time, count) }; }; /** * Returns the calculated frecency. * * 'frecency' is a heuristic (https://en.wikipedia.org/wiki/Frecency) * that combines block usage frequency and recency. * * @param {number} time When the last insert occurred as a UNIX epoch * @param {number} count The number of inserts that have occurred. * * @return {number} The calculated frecency. */ const calculateFrecency = (time, count) => { if (!time) { return count; } // The selector is cached, which means Date.now() is the last time that the // relevant state changed. This suits our needs. const duration = Date.now() - time; switch (true) { case duration < MILLISECONDS_PER_HOUR: return count * 4; case duration < MILLISECONDS_PER_DAY: return count * 2; case duration < MILLISECONDS_PER_WEEK: return count / 2; default: return count / 4; } }; /** * Returns a function that accepts a block type and builds an item to be shown * in a specific context. It's used for building items for Inserter and available * block Transforms list. * * @param {Object} state Editor state. * @param {Object} options Options object for handling the building of a block type. * @param {string} options.buildScope The scope for which the item is going to be used. * @return {Function} Function returns an item to be shown in a specific context (Inserter|Transforms list). */ const buildBlockTypeItem = (state, { buildScope = 'inserter' }) => blockType => { const id = blockType.name; let isDisabled = false; if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType.name, 'multiple', true)) { isDisabled = getBlocksByClientId(state, getClientIdsWithDescendants(state)).some(({ name }) => name === blockType.name); } const { time, count = 0 } = getInsertUsage(state, id) || {}; const blockItemBase = { id, name: blockType.name, title: blockType.title, icon: blockType.icon, isDisabled, frecency: calculateFrecency(time, count) }; if (buildScope === 'transform') { return blockItemBase; } const inserterVariations = (0,external_wp_blocks_namespaceObject.getBlockVariations)(blockType.name, 'inserter'); return { ...blockItemBase, initialAttributes: {}, description: blockType.description, category: blockType.category, keywords: blockType.keywords, parent: blockType.parent, ancestor: blockType.ancestor, variations: inserterVariations, example: blockType.example, utility: 1 // Deprecated. }; }; /** * Determines the items that appear in the inserter. Includes both static * items (e.g. a regular block type) and dynamic items (e.g. a reusable block). * * Each item object contains what's necessary to display a button in the * inserter and handle its selection. * * The 'frecency' property is a heuristic (https://en.wikipedia.org/wiki/Frecency) * that combines block usage frequency and recency. * * Items are returned ordered descendingly by their 'utility' and 'frecency'. * * @param {Object} state Editor state. * @param {?string} rootClientId Optional root client ID of block list. * * @return {WPEditorInserterItem[]} Items that appear in inserter. * * @typedef {Object} WPEditorInserterItem * @property {string} id Unique identifier for the item. * @property {string} name The type of block to create. * @property {Object} initialAttributes Attributes to pass to the newly created block. * @property {string} title Title of the item, as it appears in the inserter. * @property {string} icon Dashicon for the item, as it appears in the inserter. * @property {string} category Block category that the item is associated with. * @property {string[]} keywords Keywords that can be searched to find this item. * @property {boolean} isDisabled Whether or not the user should be prevented from inserting * this item. * @property {number} frecency Heuristic that combines frequency and recency. */ const getInserterItems = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, rootClientId = null, options = DEFAULT_INSERTER_OPTIONS) => { const buildReusableBlockInserterItem = reusableBlock => { const icon = !reusableBlock.wp_pattern_sync_status ? { src: library_symbol, foreground: 'var(--wp-block-synced-color)' } : library_symbol; const id = `core/block/${reusableBlock.id}`; const { time, count = 0 } = getInsertUsage(state, id) || {}; const frecency = calculateFrecency(time, count); return { id, name: 'core/block', initialAttributes: { ref: reusableBlock.id }, title: reusableBlock.title?.raw, icon, category: 'reusable', keywords: ['reusable'], isDisabled: false, utility: 1, // Deprecated. frecency, content: reusableBlock.content?.raw, syncStatus: reusableBlock.wp_pattern_sync_status }; }; const syncedPatternInserterItems = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) ? unlock(select(STORE_NAME)).getReusableBlocks().map(buildReusableBlockInserterItem) : []; const buildBlockTypeInserterItem = buildBlockTypeItem(state, { buildScope: 'inserter' }); let blockTypeInserterItems = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(blockType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'inserter', true)).map(buildBlockTypeInserterItem); if (options[isFiltered] !== false) { blockTypeInserterItems = blockTypeInserterItems.filter(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)); } else { blockTypeInserterItems = blockTypeInserterItems.filter(blockType => isBlockVisibleInTheInserter(state, blockType, rootClientId)).map(blockType => ({ ...blockType, isAllowedInCurrentRoot: canIncludeBlockTypeInInserter(state, blockType, rootClientId) })); } const items = blockTypeInserterItems.reduce((accumulator, item) => { const { variations = [] } = item; // Exclude any block type item that is to be replaced by a default variation. if (!variations.some(({ isDefault }) => isDefault)) { accumulator.push(item); } if (variations.length) { const variationMapper = getItemFromVariation(state, item); accumulator.push(...variations.map(variationMapper)); } return accumulator; }, []); // Ensure core blocks are prioritized in the returned results, // because third party blocks can be registered earlier than // the core blocks (usually by using the `init` action), // thus affecting the display order. // We don't sort reusable blocks as they are handled differently. const groupByType = (blocks, block) => { const { core, noncore } = blocks; const type = block.name.startsWith('core/') ? core : noncore; type.push(block); return blocks; }; const { core: coreItems, noncore: nonCoreItems } = items.reduce(groupByType, { core: [], noncore: [] }); const sortedBlockTypes = [...coreItems, ...nonCoreItems]; return [...sortedBlockTypes, ...syncedPatternInserterItems]; }, (state, rootClientId) => [(0,external_wp_blocks_namespaceObject.getBlockTypes)(), unlock(select(STORE_NAME)).getReusableBlocks(), state.blocks.order, state.preferences.insertUsage, ...getInsertBlockTypeDependants(select)(state, rootClientId)])); /** * Determines the items that appear in the available block transforms list. * * Each item object contains what's necessary to display a menu item in the * transform list and handle its selection. * * The 'frecency' property is a heuristic (https://en.wikipedia.org/wiki/Frecency) * that combines block usage frequency and recency. * * Items are returned ordered descendingly by their 'frecency'. * * @param {Object} state Editor state. * @param {Object|Object[]} blocks Block object or array objects. * @param {?string} rootClientId Optional root client ID of block list. * * @return {WPEditorTransformItem[]} Items that appear in inserter. * * @typedef {Object} WPEditorTransformItem * @property {string} id Unique identifier for the item. * @property {string} name The type of block to create. * @property {string} title Title of the item, as it appears in the inserter. * @property {string} icon Dashicon for the item, as it appears in the inserter. * @property {boolean} isDisabled Whether or not the user should be prevented from inserting * this item. * @property {number} frecency Heuristic that combines frequency and recency. */ const getBlockTransformItems = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, blocks, rootClientId = null) => { const normalizedBlocks = Array.isArray(blocks) ? blocks : [blocks]; const buildBlockTypeTransformItem = buildBlockTypeItem(state, { buildScope: 'transform' }); const blockTypeTransformItems = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)).map(buildBlockTypeTransformItem); const itemsByName = Object.fromEntries(Object.entries(blockTypeTransformItems).map(([, value]) => [value.name, value])); const possibleTransforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)(normalizedBlocks).reduce((accumulator, block) => { if (itemsByName[block?.name]) { accumulator.push(itemsByName[block.name]); } return accumulator; }, []); return orderBy(possibleTransforms, block => itemsByName[block.name].frecency, 'desc'); }, (state, blocks, rootClientId) => [(0,external_wp_blocks_namespaceObject.getBlockTypes)(), state.preferences.insertUsage, ...getInsertBlockTypeDependants(select)(state, rootClientId)])); /** * Determines whether there are items to show in the inserter. * * @param {Object} state Editor state. * @param {?string} rootClientId Optional root client ID of block list. * * @return {boolean} Items that appear in inserter. */ const hasInserterItems = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, rootClientId = null) => { const hasBlockType = (0,external_wp_blocks_namespaceObject.getBlockTypes)().some(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)); if (hasBlockType) { return true; } const hasReusableBlock = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) && unlock(select(STORE_NAME)).getReusableBlocks().length > 0; return hasReusableBlock; }); /** * Returns the list of allowed inserter blocks for inner blocks children. * * @param {Object} state Editor state. * @param {?string} rootClientId Optional root client ID of block list. * * @return {Array?} The list of allowed block types. */ const getAllowedBlocks = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, rootClientId = null) => { if (!rootClientId) { return; } const blockTypes = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)); const hasReusableBlock = canInsertBlockTypeUnmemoized(state, 'core/block', rootClientId) && unlock(select(STORE_NAME)).getReusableBlocks().length > 0; if (hasReusableBlock) { blockTypes.push('core/block'); } return blockTypes; }, (state, rootClientId) => [(0,external_wp_blocks_namespaceObject.getBlockTypes)(), unlock(select(STORE_NAME)).getReusableBlocks(), ...getInsertBlockTypeDependants(select)(state, rootClientId)])); const __experimentalGetAllowedBlocks = (0,external_wp_data_namespaceObject.createSelector)((state, rootClientId = null) => { external_wp_deprecated_default()('wp.data.select( "core/block-editor" ).__experimentalGetAllowedBlocks', { alternative: 'wp.data.select( "core/block-editor" ).getAllowedBlocks', since: '6.2', version: '6.4' }); return getAllowedBlocks(state, rootClientId); }, (state, rootClientId) => getAllowedBlocks.getDependants(state, rootClientId)); /** * Returns the block to be directly inserted by the block appender. * * @param {Object} state Editor state. * @param {?string} rootClientId Optional root client ID of block list. * * @return {WPDirectInsertBlock|undefined} The block type to be directly inserted. * * @typedef {Object} WPDirectInsertBlock * @property {string} name The type of block. * @property {?Object} attributes Attributes to pass to the newly created block. * @property {?Array<string>} attributesToCopy Attributes to be copied from adjacent blocks when inserted. */ function getDirectInsertBlock(state, rootClientId = null) { var _state$blockListSetti; if (!rootClientId) { return; } const { defaultBlock, directInsert } = (_state$blockListSetti = state.blockListSettings[rootClientId]) !== null && _state$blockListSetti !== void 0 ? _state$blockListSetti : {}; if (!defaultBlock || !directInsert) { return; } return defaultBlock; } function __experimentalGetDirectInsertBlock(state, rootClientId = null) { external_wp_deprecated_default()('wp.data.select( "core/block-editor" ).__experimentalGetDirectInsertBlock', { alternative: 'wp.data.select( "core/block-editor" ).getDirectInsertBlock', since: '6.3', version: '6.4' }); return getDirectInsertBlock(state, rootClientId); } const __experimentalGetParsedPattern = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, patternName) => { const pattern = unlock(select(STORE_NAME)).getPatternBySlug(patternName); return pattern ? getParsedPattern(pattern) : null; }); const getAllowedPatternsDependants = select => (state, rootClientId) => [...getAllPatternsDependants(select)(state), ...getInsertBlockTypeDependants(select)(state, rootClientId)]; const patternsWithParsedBlocks = new WeakMap(); function enhancePatternWithParsedBlocks(pattern) { let enhancedPattern = patternsWithParsedBlocks.get(pattern); if (!enhancedPattern) { enhancedPattern = { ...pattern, get blocks() { return getParsedPattern(pattern).blocks; } }; patternsWithParsedBlocks.set(pattern, enhancedPattern); } return enhancedPattern; } /** * Returns the list of allowed patterns for inner blocks children. * * @param {Object} state Editor state. * @param {?string} rootClientId Optional target root client ID. * * @return {Array?} The list of allowed patterns. */ const __experimentalGetAllowedPatterns = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => { return (0,external_wp_data_namespaceObject.createSelector)((state, rootClientId = null, options = DEFAULT_INSERTER_OPTIONS) => { const { getAllPatterns } = unlock(select(STORE_NAME)); const patterns = getAllPatterns(); const { allowedBlockTypes } = getSettings(state); const parsedPatterns = patterns.filter(({ inserter = true }) => !!inserter).map(enhancePatternWithParsedBlocks); const availableParsedPatterns = parsedPatterns.filter(pattern => checkAllowListRecursive(getGrammar(pattern), allowedBlockTypes)); const patternsAllowed = availableParsedPatterns.filter(pattern => getGrammar(pattern).every(({ blockName: name }) => options[isFiltered] !== false ? canInsertBlockType(state, name, rootClientId) : isBlockVisibleInTheInserter(state, name, rootClientId))); return patternsAllowed; }, getAllowedPatternsDependants(select)); }); /** * Returns the list of patterns based on their declared `blockTypes` * and a block's name. * Patterns can use `blockTypes` to integrate in work flows like * suggesting appropriate patterns in a Placeholder state(during insertion) * or blocks transformations. * * @param {Object} state Editor state. * @param {string|string[]} blockNames Block's name or array of block names to find matching patterns. * @param {?string} rootClientId Optional target root client ID. * * @return {Array} The list of matched block patterns based on declared `blockTypes` and block name. */ const getPatternsByBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, blockNames, rootClientId = null) => { if (!blockNames) { return selectors_EMPTY_ARRAY; } const patterns = select(STORE_NAME).__experimentalGetAllowedPatterns(rootClientId); const normalizedBlockNames = Array.isArray(blockNames) ? blockNames : [blockNames]; const filteredPatterns = patterns.filter(pattern => pattern?.blockTypes?.some?.(blockName => normalizedBlockNames.includes(blockName))); if (filteredPatterns.length === 0) { return selectors_EMPTY_ARRAY; } return filteredPatterns; }, (state, blockNames, rootClientId) => getAllowedPatternsDependants(select)(state, rootClientId))); const __experimentalGetPatternsByBlockTypes = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => { external_wp_deprecated_default()('wp.data.select( "core/block-editor" ).__experimentalGetPatternsByBlockTypes', { alternative: 'wp.data.select( "core/block-editor" ).getPatternsByBlockTypes', since: '6.2', version: '6.4' }); return select(STORE_NAME).getPatternsByBlockTypes; }); /** * Determines the items that appear in the available pattern transforms list. * * For now we only handle blocks without InnerBlocks and take into account * the `role` property of blocks' attributes for the transformation. * * We return the first set of possible eligible block patterns, * by checking the `blockTypes` property. We still have to recurse through * block pattern's blocks and try to find matches from the selected blocks. * Now this happens in the consumer to avoid heavy operations in the selector. * * @param {Object} state Editor state. * @param {Object[]} blocks The selected blocks. * @param {?string} rootClientId Optional root client ID of block list. * * @return {WPBlockPattern[]} Items that are eligible for a pattern transformation. */ const __experimentalGetPatternTransformItems = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, blocks, rootClientId = null) => { if (!blocks) { return selectors_EMPTY_ARRAY; } /** * For now we only handle blocks without InnerBlocks and take into account * the `role` property of blocks' attributes for the transformation. * Note that the blocks have been retrieved through `getBlock`, which doesn't * return the inner blocks of an inner block controller, so we still need * to check for this case too. */ if (blocks.some(({ clientId, innerBlocks }) => innerBlocks.length || areInnerBlocksControlled(state, clientId))) { return selectors_EMPTY_ARRAY; } // Create a Set of the selected block names that is used in patterns filtering. const selectedBlockNames = Array.from(new Set(blocks.map(({ name }) => name))); /** * Here we will return first set of possible eligible block patterns, * by checking the `blockTypes` property. We still have to recurse through * block pattern's blocks and try to find matches from the selected blocks. * Now this happens in the consumer to avoid heavy operations in the selector. */ return select(STORE_NAME).getPatternsByBlockTypes(selectedBlockNames, rootClientId); }, (state, blocks, rootClientId) => getAllowedPatternsDependants(select)(state, rootClientId))); /** * Returns the Block List settings of a block, if any exist. * * @param {Object} state Editor state. * @param {?string} clientId Block client ID. * * @return {?Object} Block settings of the block if set. */ function getBlockListSettings(state, clientId) { return state.blockListSettings[clientId]; } /** * Returns the editor settings. * * @param {Object} state Editor state. * * @return {Object} The editor settings object. */ function getSettings(state) { return state.settings; } /** * Returns true if the most recent block change is be considered persistent, or * false otherwise. A persistent change is one committed by BlockEditorProvider * via its `onChange` callback, in addition to `onInput`. * * @param {Object} state Block editor state. * * @return {boolean} Whether the most recent block change was persistent. */ function isLastBlockChangePersistent(state) { return state.blocks.isPersistentChange; } /** * Returns the block list settings for an array of blocks, if any exist. * * @param {Object} state Editor state. * @param {Array} clientIds Block client IDs. * * @return {Object} An object where the keys are client ids and the values are * a block list setting object. */ const __experimentalGetBlockListSettingsForBlocks = (0,external_wp_data_namespaceObject.createSelector)((state, clientIds = []) => { return clientIds.reduce((blockListSettingsForBlocks, clientId) => { if (!state.blockListSettings[clientId]) { return blockListSettingsForBlocks; } return { ...blockListSettingsForBlocks, [clientId]: state.blockListSettings[clientId] }; }, {}); }, state => [state.blockListSettings]); /** * Returns the title of a given reusable block * * @param {Object} state Global application state. * @param {number|string} ref The shared block's ID. * * @return {string} The reusable block saved title. */ const __experimentalGetReusableBlockTitle = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (0,external_wp_data_namespaceObject.createSelector)((state, ref) => { external_wp_deprecated_default()("wp.data.select( 'core/block-editor' ).__experimentalGetReusableBlockTitle", { since: '6.6', version: '6.8' }); const reusableBlock = unlock(select(STORE_NAME)).getReusableBlocks().find(block => block.id === ref); if (!reusableBlock) { return null; } return reusableBlock.title?.raw; }, () => [unlock(select(STORE_NAME)).getReusableBlocks()])); /** * Returns true if the most recent block change is be considered ignored, or * false otherwise. An ignored change is one not to be committed by * BlockEditorProvider, neither via `onChange` nor `onInput`. * * @param {Object} state Block editor state. * * @return {boolean} Whether the most recent block change was ignored. */ function __unstableIsLastBlockChangeIgnored(state) { // TODO: Removal Plan: Changes incurred by RECEIVE_BLOCKS should not be // ignored if in-fact they result in a change in blocks state. The current // need to ignore changes not a result of user interaction should be // accounted for in the refactoring of reusable blocks as occurring within // their own separate block editor / state (#7119). return state.blocks.isIgnoredChange; } /** * Returns the block attributes changed as a result of the last dispatched * action. * * @param {Object} state Block editor state. * * @return {Object<string,Object>} Subsets of block attributes changed, keyed * by block client ID. */ function __experimentalGetLastBlockAttributeChanges(state) { return state.lastBlockAttributesChange; } /** * Returns whether the navigation mode is enabled. * * @param {Object} state Editor state. * * @return {boolean} Is navigation mode enabled. */ function isNavigationMode(state) { return __unstableGetEditorMode(state) === 'navigation'; } /** * Returns the current editor mode. * * @param {Object} state Editor state. * * @return {string} the editor mode. */ const __unstableGetEditorMode = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => state => { var _state$settings$edito; if (!window?.__experimentalEditorWriteMode) { return 'edit'; } return (_state$settings$edito = state.settings.editorTool) !== null && _state$settings$edito !== void 0 ? _state$settings$edito : select(external_wp_preferences_namespaceObject.store).get('core', 'editorTool'); }); /** * Returns whether block moving mode is enabled. * * @deprecated */ function hasBlockMovingClientId() { external_wp_deprecated_default()('wp.data.select( "core/block-editor" ).hasBlockMovingClientId', { since: '6.7', hint: 'Block moving mode feature has been removed' }); return false; } /** * Returns true if the last change was an automatic change, false otherwise. * * @param {Object} state Global application state. * * @return {boolean} Whether the last change was automatic. */ function didAutomaticChange(state) { return !!state.automaticChangeStatus; } /** * Returns true if the current highlighted block matches the block clientId. * * @param {Object} state Global application state. * @param {string} clientId The block to check. * * @return {boolean} Whether the block is currently highlighted. */ function isBlockHighlighted(state, clientId) { return state.highlightedBlock === clientId; } /** * Checks if a given block has controlled inner blocks. * * @param {Object} state Global application state. * @param {string} clientId The block to check. * * @return {boolean} True if the block has controlled inner blocks. */ function areInnerBlocksControlled(state, clientId) { return !!state.blocks.controlledInnerBlocks[clientId]; } /** * Returns the clientId for the first 'active' block of a given array of block names. * A block is 'active' if it (or a child) is the selected block. * Returns the first match moving up the DOM from the selected block. * * @param {Object} state Global application state. * @param {string[]} validBlocksNames The names of block types to check for. * * @return {string} The matching block's clientId. */ const __experimentalGetActiveBlockIdByBlockNames = (0,external_wp_data_namespaceObject.createSelector)((state, validBlockNames) => { if (!validBlockNames.length) { return null; } // Check if selected block is a valid entity area. const selectedBlockClientId = getSelectedBlockClientId(state); if (validBlockNames.includes(getBlockName(state, selectedBlockClientId))) { return selectedBlockClientId; } // Check if first selected block is a child of a valid entity area. const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(state); const entityAreaParents = getBlockParentsByBlockName(state, selectedBlockClientId || multiSelectedBlockClientIds[0], validBlockNames); if (entityAreaParents) { // Last parent closest/most interior. return entityAreaParents[entityAreaParents.length - 1]; } return null; }, (state, validBlockNames) => [state.selection.selectionStart.clientId, state.selection.selectionEnd.clientId, validBlockNames]); /** * Tells if the block with the passed clientId was just inserted. * * @param {Object} state Global application state. * @param {Object} clientId Client Id of the block. * @param {?string} source Optional insertion source of the block. * @return {boolean} True if the block matches the last block inserted from the specified source. */ function wasBlockJustInserted(state, clientId, source) { const { lastBlockInserted } = state; return lastBlockInserted.clientIds?.includes(clientId) && lastBlockInserted.source === source; } /** * Tells if the block is visible on the canvas or not. * * @param {Object} state Global application state. * @param {Object} clientId Client Id of the block. * @return {boolean} True if the block is visible. */ function isBlockVisible(state, clientId) { var _state$blockVisibilit; return (_state$blockVisibilit = state.blockVisibility?.[clientId]) !== null && _state$blockVisibilit !== void 0 ? _state$blockVisibilit : true; } /** * Returns the currently hovered block. * * @param {Object} state Global application state. * @return {Object} Client Id of the hovered block. */ function getHoveredBlockClientId(state) { return state.hoveredBlockClientId; } /** * Returns the list of all hidden blocks. * * @param {Object} state Global application state. * @return {[string]} List of hidden blocks. */ const __unstableGetVisibleBlocks = (0,external_wp_data_namespaceObject.createSelector)(state => { const visibleBlocks = new Set(Object.keys(state.blockVisibility).filter(key => state.blockVisibility[key])); if (visibleBlocks.size === 0) { return EMPTY_SET; } return visibleBlocks; }, state => [state.blockVisibility]); function __unstableHasActiveBlockOverlayActive(state, clientId) { // Prevent overlay on blocks with a non-default editing mode. If the mode is // 'disabled' then the overlay is redundant since the block can't be // selected. If the mode is 'contentOnly' then the overlay is redundant // since there will be no controls to interact with once selected. if (getBlockEditingMode(state, clientId) !== 'default') { return false; } // If the block editing is locked, the block overlay is always active. if (!canEditBlock(state, clientId)) { return true; } // In zoom-out mode, the block overlay is always active for section level blocks. if (isZoomOut(state)) { const sectionRootClientId = getSectionRootClientId(state); if (sectionRootClientId) { const sectionClientIds = getBlockOrder(state, sectionRootClientId); if (sectionClientIds?.includes(clientId)) { return true; } } else if (clientId && !getBlockRootClientId(state, clientId)) { return true; } } // In navigation mode, the block overlay is active when the block is not // selected (and doesn't contain a selected child). The same behavior is // also enabled in all modes for blocks that have controlled children // (reusable block, template part, navigation), unless explicitly disabled // with `supports.__experimentalDisableBlockOverlay`. const blockSupportDisable = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(getBlockName(state, clientId), '__experimentalDisableBlockOverlay', false); const shouldEnableIfUnselected = blockSupportDisable ? false : areInnerBlocksControlled(state, clientId); return shouldEnableIfUnselected && !isBlockSelected(state, clientId) && !hasSelectedInnerBlock(state, clientId, true); } function __unstableIsWithinBlockOverlay(state, clientId) { let parent = state.blocks.parents.get(clientId); while (!!parent) { if (__unstableHasActiveBlockOverlayActive(state, parent)) { return true; } parent = state.blocks.parents.get(parent); } return false; } /** * @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode */ /** * Returns the block editing mode for a given block. * * The mode can be one of three options: * * - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be * selected. * - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the * toolbar, the block movers, block settings. * - `'default'`: Allows editing the block as normal. * * Blocks can set a mode using the `useBlockEditingMode` hook. * * The mode is inherited by all of the block's inner blocks, unless they have * their own mode. * * A template lock can also set a mode. If the template lock is `'contentOnly'`, * the block's mode is overridden to `'contentOnly'` if the block has a content * role attribute, or `'disabled'` otherwise. * * @see useBlockEditingMode * * @param {Object} state Global application state. * @param {string} clientId The block client ID, or `''` for the root container. * * @return {BlockEditingMode} The block editing mode. One of `'disabled'`, * `'contentOnly'`, or `'default'`. */ const getBlockEditingMode = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, clientId = '') => { // Some selectors that call this provide `null` as the default // rootClientId, but the default rootClientId is actually `''`. if (clientId === null) { clientId = ''; } const isNavMode = isNavigationMode(state); // If the editor is currently not in navigation mode, check if the clientId // has an editing mode set in the regular derived map. // There may be an editing mode set here for synced patterns or in zoomed out // mode. if (!isNavMode && state.derivedBlockEditingModes?.has(clientId)) { return state.derivedBlockEditingModes.get(clientId); } // If the editor *is* in navigation mode, the block editing mode states // are stored in the derivedNavModeBlockEditingModes map. if (isNavMode && state.derivedNavModeBlockEditingModes?.has(clientId)) { return state.derivedNavModeBlockEditingModes.get(clientId); } // In normal mode, consider that an explicitly set editing mode takes over. const blockEditingMode = state.blockEditingModes.get(clientId); if (blockEditingMode) { return blockEditingMode; } // In normal mode, top level is default mode. if (clientId === '') { return 'default'; } const rootClientId = getBlockRootClientId(state, clientId); const templateLock = getTemplateLock(state, rootClientId); // If the parent of the block is contentOnly locked, check whether it's a content block. if (templateLock === 'contentOnly') { const name = getBlockName(state, clientId); const { hasContentRoleAttribute } = unlock(select(external_wp_blocks_namespaceObject.store)); const isContent = hasContentRoleAttribute(name); return isContent ? 'contentOnly' : 'disabled'; } return 'default'; }); /** * Indicates if a block is ungroupable. * A block is ungroupable if it is a single grouping block with inner blocks. * If a block has an `ungroup` transform, it is also ungroupable, without the * requirement of being the default grouping block. * Additionally a block can only be ungrouped if it has inner blocks and can * be removed. * * @param {Object} state Global application state. * @param {string} clientId Client Id of the block. If not passed the selected block's client id will be used. * @return {boolean} True if the block is ungroupable. */ const isUngroupable = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, clientId = '') => { const _clientId = clientId || getSelectedBlockClientId(state); if (!_clientId) { return false; } const { getGroupingBlockName } = select(external_wp_blocks_namespaceObject.store); const block = getBlock(state, _clientId); const groupingBlockName = getGroupingBlockName(); const _isUngroupable = block && (block.name === groupingBlockName || (0,external_wp_blocks_namespaceObject.getBlockType)(block.name)?.transforms?.ungroup) && !!block.innerBlocks.length; return _isUngroupable && canRemoveBlock(state, _clientId); }); /** * Indicates if the provided blocks(by client ids) are groupable. * We need to have at least one block, have a grouping block name set and * be able to remove these blocks. * * @param {Object} state Global application state. * @param {string[]} clientIds Block client ids. If not passed the selected blocks client ids will be used. * @return {boolean} True if the blocks are groupable. */ const isGroupable = (0,external_wp_data_namespaceObject.createRegistrySelector)(select => (state, clientIds = selectors_EMPTY_ARRAY) => { const { getGroupingBlockName } = select(external_wp_blocks_namespaceObject.store); const groupingBlockName = getGroupingBlockName(); const _clientIds = clientIds?.length ? clientIds : getSelectedBlockClientIds(state); const rootClientId = _clientIds?.length ? getBlockRootClientId(state, _clientIds[0]) : undefined; const groupingBlockAvailable = canInsertBlockType(state, groupingBlockName, rootClientId); const _isGroupable = groupingBlockAvailable && _clientIds.length; return _isGroupable && canRemoveBlocks(state, _clientIds); }); /** * DO-NOT-USE in production. * This selector is created for internal/experimental only usage and may be * removed anytime without any warning, causing breakage on any plugin or theme invoking it. * * @deprecated * * @param {Object} state Global application state. * @param {Object} clientId Client Id of the block. * * @return {?string} Client ID of the ancestor block that is content locking the block. */ const __unstableGetContentLockingParent = (state, clientId) => { external_wp_deprecated_default()("wp.data.select( 'core/block-editor' ).__unstableGetContentLockingParent", { since: '6.1', version: '6.7' }); return getContentLockingParent(state, clientId); }; /** * DO-NOT-USE in production. * This selector is created for internal/experimental only usage and may be * removed anytime without any warning, causing breakage on any plugin or theme invoking it. * * @deprecated * * @param {Object} state Global application state. */ function __unstableGetTemporarilyEditingAsBlocks(state) { external_wp_deprecated_default()("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingAsBlocks", { since: '6.1', version: '6.7' }); return getTemporarilyEditingAsBlocks(state); } /** * DO-NOT-USE in production. * This selector is created for internal/experimental only usage and may be * removed anytime without any warning, causing breakage on any plugin or theme invoking it. * * @deprecated * * @param {Object} state Global application state. */ function __unstableGetTemporarilyEditingFocusModeToRevert(state) { external_wp_deprecated_default()("wp.data.select( 'core/block-editor' ).__unstableGetTemporarilyEditingFocusModeToRevert", { since: '6.5', version: '6.7' }); return getTemporarilyEditingFocusModeToRevert(state); } ;// external ["wp","a11y"] const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; ;// ./node_modules/@wordpress/block-editor/build-module/store/private-actions.js /** * WordPress dependencies */ /** * Internal dependencies */ const castArray = maybeArray => Array.isArray(maybeArray) ? maybeArray : [maybeArray]; /** * A list of private/experimental block editor settings that * should not become a part of the WordPress public API. * BlockEditorProvider will remove these settings from the * settings object it receives. * * @see https://github.com/WordPress/gutenberg/pull/46131 */ const privateSettings = ['inserterMediaCategories', 'blockInspectorAnimation', 'mediaSideload']; /** * Action that updates the block editor settings and * conditionally preserves the experimental ones. * * @param {Object} settings Updated settings * @param {Object} options Options object. * @param {boolean} options.stripExperimentalSettings Whether to strip experimental settings. * @param {boolean} options.reset Whether to reset the settings. * @return {Object} Action object */ function __experimentalUpdateSettings(settings, { stripExperimentalSettings = false, reset = false } = {}) { let incomingSettings = settings; if (Object.hasOwn(incomingSettings, '__unstableIsPreviewMode')) { external_wp_deprecated_default()("__unstableIsPreviewMode argument in wp.data.dispatch('core/block-editor').updateSettings", { since: '6.8', alternative: 'isPreviewMode' }); incomingSettings = { ...incomingSettings }; incomingSettings.isPreviewMode = incomingSettings.__unstableIsPreviewMode; delete incomingSettings.__unstableIsPreviewMode; } let cleanSettings = incomingSettings; // There are no plugins in the mobile apps, so there is no // need to strip the experimental settings: if (stripExperimentalSettings && external_wp_element_namespaceObject.Platform.OS === 'web') { cleanSettings = {}; for (const key in incomingSettings) { if (!privateSettings.includes(key)) { cleanSettings[key] = incomingSettings[key]; } } } return { type: 'UPDATE_SETTINGS', settings: cleanSettings, reset }; } /** * Hides the block interface (eg. toolbar, outline, etc.) * * @return {Object} Action object. */ function hideBlockInterface() { return { type: 'HIDE_BLOCK_INTERFACE' }; } /** * Shows the block interface (eg. toolbar, outline, etc.) * * @return {Object} Action object. */ function showBlockInterface() { return { type: 'SHOW_BLOCK_INTERFACE' }; } /** * Yields action objects used in signalling that the blocks corresponding to * the set of specified client IDs are to be removed. * * Compared to `removeBlocks`, this private interface exposes an additional * parameter; see `forceRemove`. * * @param {string|string[]} clientIds Client IDs of blocks to remove. * @param {boolean} selectPrevious True if the previous block * or the immediate parent * (if no previous block exists) * should be selected * when a block is removed. * @param {boolean} forceRemove Whether to force the operation, * bypassing any checks for certain * block types. */ const privateRemoveBlocks = (clientIds, selectPrevious = true, forceRemove = false) => ({ select, dispatch, registry }) => { if (!clientIds || !clientIds.length) { return; } clientIds = castArray(clientIds); const canRemoveBlocks = select.canRemoveBlocks(clientIds); if (!canRemoveBlocks) { return; } // In certain editing contexts, we'd like to prevent accidental removal // of important blocks. For example, in the site editor, the Query Loop // block is deemed important. In such cases, we'll ask the user for // confirmation that they intended to remove such block(s). However, // the editor instance is responsible for presenting those confirmation // prompts to the user. Any instance opting into removal prompts must // register using `setBlockRemovalRules()`. // // @see https://github.com/WordPress/gutenberg/pull/51145 const rules = !forceRemove && select.getBlockRemovalRules(); if (rules) { function flattenBlocks(blocks) { const result = []; const stack = [...blocks]; while (stack.length) { const { innerBlocks, ...block } = stack.shift(); stack.push(...innerBlocks); result.push(block); } return result; } const blockList = clientIds.map(select.getBlock); const flattenedBlocks = flattenBlocks(blockList); // Find the first message and use it. let message; for (const rule of rules) { message = rule.callback(flattenedBlocks); if (message) { dispatch(displayBlockRemovalPrompt(clientIds, selectPrevious, message)); return; } } } if (selectPrevious) { dispatch.selectPreviousBlock(clientIds[0], selectPrevious); } // We're batching these two actions because an extra `undo/redo` step can // be created, based on whether we insert a default block or not. registry.batch(() => { dispatch({ type: 'REMOVE_BLOCKS', clientIds }); // To avoid a focus loss when removing the last block, assure there is // always a default block if the last of the blocks have been removed. dispatch(ensureDefaultBlock()); }); }; /** * Action which will insert a default block insert action if there * are no other blocks at the root of the editor. This action should be used * in actions which may result in no blocks remaining in the editor (removal, * replacement, etc). */ const ensureDefaultBlock = () => ({ select, dispatch }) => { // To avoid a focus loss when removing the last block, assure there is // always a default block if the last of the blocks have been removed. const count = select.getBlockCount(); if (count > 0) { return; } // If there's an custom appender, don't insert default block. // We have to remember to manually move the focus elsewhere to // prevent it from being lost though. const { __unstableHasCustomAppender } = select.getSettings(); if (__unstableHasCustomAppender) { return; } dispatch.insertDefaultBlock(); }; /** * Returns an action object used in signalling that a block removal prompt must * be displayed. * * Contrast with `setBlockRemovalRules`. * * @param {string|string[]} clientIds Client IDs of blocks to remove. * @param {boolean} selectPrevious True if the previous block or the * immediate parent (if no previous * block exists) should be selected * when a block is removed. * @param {string} message Message to display in the prompt. * * @return {Object} Action object. */ function displayBlockRemovalPrompt(clientIds, selectPrevious, message) { return { type: 'DISPLAY_BLOCK_REMOVAL_PROMPT', clientIds, selectPrevious, message }; } /** * Returns an action object used in signalling that a block removal prompt must * be cleared, either be cause the user has confirmed or canceled the request * for removal. * * @return {Object} Action object. */ function clearBlockRemovalPrompt() { return { type: 'CLEAR_BLOCK_REMOVAL_PROMPT' }; } /** * Returns an action object used to set up any rules that a block editor may * provide in order to prevent a user from accidentally removing certain * blocks. These rules are then used to display a confirmation prompt to the * user. For instance, in the Site Editor, the Query Loop block is important * enough to warrant such confirmation. * * IMPORTANT: Registering rules implicitly signals to the `privateRemoveBlocks` * action that the editor will be responsible for displaying block removal * prompts and confirming deletions. This action is meant to be used by * component `BlockRemovalWarningModal` only. * * The data is a record whose keys are block types (e.g. 'core/query') and * whose values are the explanation to be shown to users (e.g. 'Query Loop * displays a list of posts or pages.'). * * Contrast with `displayBlockRemovalPrompt`. * * @param {Record<string,string>|false} rules Block removal rules. * @return {Object} Action object. */ function setBlockRemovalRules(rules = false) { return { type: 'SET_BLOCK_REMOVAL_RULES', rules }; } /** * Sets the client ID of the block settings menu that is currently open. * * @param {?string} clientId The block client ID. * @return {Object} Action object. */ function setOpenedBlockSettingsMenu(clientId) { return { type: 'SET_OPENED_BLOCK_SETTINGS_MENU', clientId }; } function setStyleOverride(id, style) { return { type: 'SET_STYLE_OVERRIDE', id, style }; } function deleteStyleOverride(id) { return { type: 'DELETE_STYLE_OVERRIDE', id }; } /** * Action that sets the element that had focus when focus leaves the editor canvas. * * @param {Object} lastFocus The last focused element. * * * @return {Object} Action object. */ function setLastFocus(lastFocus = null) { return { type: 'LAST_FOCUS', lastFocus }; } /** * Action that stops temporarily editing as blocks. * * @param {string} clientId The block's clientId. */ function stopEditingAsBlocks(clientId) { return ({ select, dispatch, registry }) => { const focusModeToRevert = unlock(registry.select(store)).getTemporarilyEditingFocusModeToRevert(); dispatch.__unstableMarkNextChangeAsNotPersistent(); dispatch.updateBlockAttributes(clientId, { templateLock: 'contentOnly' }); dispatch.updateBlockListSettings(clientId, { ...select.getBlockListSettings(clientId), templateLock: 'contentOnly' }); dispatch.updateSettings({ focusMode: focusModeToRevert }); dispatch.__unstableSetTemporarilyEditingAsBlocks(); }; } /** * Returns an action object used in signalling that the user has begun to drag. * * @return {Object} Action object. */ function startDragging() { return { type: 'START_DRAGGING' }; } /** * Returns an action object used in signalling that the user has stopped dragging. * * @return {Object} Action object. */ function stopDragging() { return { type: 'STOP_DRAGGING' }; } /** * @param {string|null} clientId The block's clientId, or `null` to clear. * * @return {Object} Action object. */ function expandBlock(clientId) { return { type: 'SET_BLOCK_EXPANDED_IN_LIST_VIEW', clientId }; } /** * @param {Object} value * @param {string} value.rootClientId The root client ID to insert at. * @param {number} value.index The index to insert at. * * @return {Object} Action object. */ function setInsertionPoint(value) { return { type: 'SET_INSERTION_POINT', value }; } /** * Temporarily modify/unlock the content-only block for editions. * * @param {string} clientId The client id of the block. */ const modifyContentLockBlock = clientId => ({ select, dispatch }) => { dispatch.selectBlock(clientId); dispatch.__unstableMarkNextChangeAsNotPersistent(); dispatch.updateBlockAttributes(clientId, { templateLock: undefined }); dispatch.updateBlockListSettings(clientId, { ...select.getBlockListSettings(clientId), templateLock: false }); const focusModeToRevert = select.getSettings().focusMode; dispatch.updateSettings({ focusMode: true }); dispatch.__unstableSetTemporarilyEditingAsBlocks(clientId, focusModeToRevert); }; /** * Sets the zoom level. * * @param {number} zoom the new zoom level * @return {Object} Action object. */ const setZoomLevel = (zoom = 100) => ({ select, dispatch }) => { // When switching to zoom-out mode, we need to select the parent section if (zoom !== 100) { const firstSelectedClientId = select.getBlockSelectionStart(); const sectionRootClientId = select.getSectionRootClientId(); if (firstSelectedClientId) { let sectionClientId; if (sectionRootClientId) { const sectionClientIds = select.getBlockOrder(sectionRootClientId); // If the selected block is a section block, use it. if (sectionClientIds?.includes(firstSelectedClientId)) { sectionClientId = firstSelectedClientId; } else { // If the selected block is not a section block, find // the parent section that contains the selected block. sectionClientId = select.getBlockParents(firstSelectedClientId).find(parent => sectionClientIds.includes(parent)); } } else { sectionClientId = select.getBlockHierarchyRootClientId(firstSelectedClientId); } if (sectionClientId) { dispatch.selectBlock(sectionClientId); } else { dispatch.clearSelectedBlock(); } (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('You are currently in zoom-out mode.')); } } dispatch({ type: 'SET_ZOOM_LEVEL', zoom }); }; /** * Resets the Zoom state. * @return {Object} Action object. */ function resetZoomLevel() { return { type: 'RESET_ZOOM_LEVEL' }; } ;// external ["wp","notices"] const external_wp_notices_namespaceObject = window["wp"]["notices"]; ;// ./node_modules/@wordpress/block-editor/build-module/utils/selection.js /** * WordPress dependencies */ /** * A robust way to retain selection position through various * transforms is to insert a special character at the position and * then recover it. */ const START_OF_SELECTED_AREA = '\u0086'; /** * Retrieve the block attribute that contains the selection position. * * @param {Object} blockAttributes Block attributes. * @return {string|void} The name of the block attribute that was previously selected. */ function retrieveSelectedAttribute(blockAttributes) { if (!blockAttributes) { return; } return Object.keys(blockAttributes).find(name => { const value = blockAttributes[name]; return (typeof value === 'string' || value instanceof external_wp_richText_namespaceObject.RichTextData) && // To do: refactor this to use rich text's selection instead, so we // no longer have to use on this hack inserting a special character. value.toString().indexOf(START_OF_SELECTED_AREA) !== -1; }); } function findRichTextAttributeKey(blockType) { for (const [key, value] of Object.entries(blockType.attributes)) { if (value.source === 'rich-text' || value.source === 'html') { return key; } } } ;// ./node_modules/@wordpress/block-editor/build-module/store/actions.js /* eslint no-console: [ 'error', { allow: [ 'error', 'warn' ] } ] */ /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('../components/use-on-block-drop/types').WPDropOperation} WPDropOperation */ const actions_castArray = maybeArray => Array.isArray(maybeArray) ? maybeArray : [maybeArray]; /** * Action that resets blocks state to the specified array of blocks, taking precedence * over any other content reflected as an edit in state. * * @param {Array} blocks Array of blocks. */ const resetBlocks = blocks => ({ dispatch }) => { dispatch({ type: 'RESET_BLOCKS', blocks }); dispatch(validateBlocksToTemplate(blocks)); }; /** * Block validity is a function of blocks state (at the point of a * reset) and the template setting. As a compromise to its placement * across distinct parts of state, it is implemented here as a side * effect of the block reset action. * * @param {Array} blocks Array of blocks. */ const validateBlocksToTemplate = blocks => ({ select, dispatch }) => { const template = select.getTemplate(); const templateLock = select.getTemplateLock(); // Unlocked templates are considered always valid because they act // as default values only. const isBlocksValidToTemplate = !template || templateLock !== 'all' || (0,external_wp_blocks_namespaceObject.doBlocksMatchTemplate)(blocks, template); // Update if validity has changed. const isValidTemplate = select.isValidTemplate(); if (isBlocksValidToTemplate !== isValidTemplate) { dispatch.setTemplateValidity(isBlocksValidToTemplate); return isBlocksValidToTemplate; } }; /** * A block selection object. * * @typedef {Object} WPBlockSelection * * @property {string} clientId A block client ID. * @property {string} attributeKey A block attribute key. * @property {number} offset An attribute value offset, based on the rich * text value. See `wp.richText.create`. */ /** * A selection object. * * @typedef {Object} WPSelection * * @property {WPBlockSelection} start The selection start. * @property {WPBlockSelection} end The selection end. */ /* eslint-disable jsdoc/valid-types */ /** * Returns an action object used in signalling that selection state should be * reset to the specified selection. * * @param {WPBlockSelection} selectionStart The selection start. * @param {WPBlockSelection} selectionEnd The selection end. * @param {0|-1|null} initialPosition Initial block position. * * @return {Object} Action object. */ function resetSelection(selectionStart, selectionEnd, initialPosition) { /* eslint-enable jsdoc/valid-types */ return { type: 'RESET_SELECTION', selectionStart, selectionEnd, initialPosition }; } /** * Returns an action object used in signalling that blocks have been received. * Unlike resetBlocks, these should be appended to the existing known set, not * replacing. * * @deprecated * * @param {Object[]} blocks Array of block objects. * * @return {Object} Action object. */ function receiveBlocks(blocks) { external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).receiveBlocks', { since: '5.9', alternative: 'resetBlocks or insertBlocks' }); return { type: 'RECEIVE_BLOCKS', blocks }; } /** * Action that updates attributes of multiple blocks with the specified client IDs. * * @param {string|string[]} clientIds Block client IDs. * @param {Object} attributes Block attributes to be merged. Should be keyed by clientIds if * uniqueByBlock is true. * @param {boolean} uniqueByBlock true if each block in clientIds array has a unique set of attributes * @return {Object} Action object. */ function updateBlockAttributes(clientIds, attributes, uniqueByBlock = false) { return { type: 'UPDATE_BLOCK_ATTRIBUTES', clientIds: actions_castArray(clientIds), attributes, uniqueByBlock }; } /** * Action that updates the block with the specified client ID. * * @param {string} clientId Block client ID. * @param {Object} updates Block attributes to be merged. * * @return {Object} Action object. */ function updateBlock(clientId, updates) { return { type: 'UPDATE_BLOCK', clientId, updates }; } /* eslint-disable jsdoc/valid-types */ /** * Returns an action object used in signalling that the block with the * specified client ID has been selected, optionally accepting a position * value reflecting its selection directionality. An initialPosition of -1 * reflects a reverse selection. * * @param {string} clientId Block client ID. * @param {0|-1|null} initialPosition Optional initial position. Pass as -1 to * reflect reverse selection. * * @return {Object} Action object. */ function selectBlock(clientId, initialPosition = 0) { /* eslint-enable jsdoc/valid-types */ return { type: 'SELECT_BLOCK', initialPosition, clientId }; } /** * Returns an action object used in signalling that the block with the * specified client ID has been hovered. * * @param {string} clientId Block client ID. * * @return {Object} Action object. */ function hoverBlock(clientId) { return { type: 'HOVER_BLOCK', clientId }; } /** * Yields action objects used in signalling that the block preceding the given * clientId (or optionally, its first parent from bottom to top) * should be selected. * * @param {string} clientId Block client ID. * @param {boolean} fallbackToParent If true, select the first parent if there is no previous block. */ const selectPreviousBlock = (clientId, fallbackToParent = false) => ({ select, dispatch }) => { const previousBlockClientId = select.getPreviousBlockClientId(clientId); if (previousBlockClientId) { dispatch.selectBlock(previousBlockClientId, -1); } else if (fallbackToParent) { const firstParentClientId = select.getBlockRootClientId(clientId); if (firstParentClientId) { dispatch.selectBlock(firstParentClientId, -1); } } }; /** * Yields action objects used in signalling that the block following the given * clientId should be selected. * * @param {string} clientId Block client ID. */ const selectNextBlock = clientId => ({ select, dispatch }) => { const nextBlockClientId = select.getNextBlockClientId(clientId); if (nextBlockClientId) { dispatch.selectBlock(nextBlockClientId); } }; /** * Action that starts block multi-selection. * * @return {Object} Action object. */ function startMultiSelect() { return { type: 'START_MULTI_SELECT' }; } /** * Action that stops block multi-selection. * * @return {Object} Action object. */ function stopMultiSelect() { return { type: 'STOP_MULTI_SELECT' }; } /** * Action that changes block multi-selection. * * @param {string} start First block of the multi selection. * @param {string} end Last block of the multiselection. * @param {number|null} __experimentalInitialPosition Optional initial position. Pass as null to skip focus within editor canvas. */ const multiSelect = (start, end, __experimentalInitialPosition = 0) => ({ select, dispatch }) => { const startBlockRootClientId = select.getBlockRootClientId(start); const endBlockRootClientId = select.getBlockRootClientId(end); // Only allow block multi-selections at the same level. if (startBlockRootClientId !== endBlockRootClientId) { return; } dispatch({ type: 'MULTI_SELECT', start, end, initialPosition: __experimentalInitialPosition }); const blockCount = select.getSelectedBlockCount(); (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: number of selected blocks */ (0,external_wp_i18n_namespaceObject._n)('%s block selected.', '%s blocks selected.', blockCount), blockCount), 'assertive'); }; /** * Action that clears the block selection. * * @return {Object} Action object. */ function clearSelectedBlock() { return { type: 'CLEAR_SELECTED_BLOCK' }; } /** * Action that enables or disables block selection. * * @param {boolean} [isSelectionEnabled=true] Whether block selection should * be enabled. * * @return {Object} Action object. */ function toggleSelection(isSelectionEnabled = true) { return { type: 'TOGGLE_SELECTION', isSelectionEnabled }; } /* eslint-disable jsdoc/valid-types */ /** * Action that replaces given blocks with one or more replacement blocks. * * @param {(string|string[])} clientIds Block client ID(s) to replace. * @param {(Object|Object[])} blocks Replacement block(s). * @param {number} indexToSelect Index of replacement block to select. * @param {0|-1|null} initialPosition Index of caret after in the selected block after the operation. * @param {?Object} meta Optional Meta values to be passed to the action object. * * @return {Object} Action object. */ const replaceBlocks = (clientIds, blocks, indexToSelect, initialPosition = 0, meta) => ({ select, dispatch, registry }) => { /* eslint-enable jsdoc/valid-types */ clientIds = actions_castArray(clientIds); blocks = actions_castArray(blocks); const rootClientId = select.getBlockRootClientId(clientIds[0]); // Replace is valid if the new blocks can be inserted in the root block. for (let index = 0; index < blocks.length; index++) { const block = blocks[index]; const canInsertBlock = select.canInsertBlockType(block.name, rootClientId); if (!canInsertBlock) { return; } } // We're batching these two actions because an extra `undo/redo` step can // be created, based on whether we insert a default block or not. registry.batch(() => { dispatch({ type: 'REPLACE_BLOCKS', clientIds, blocks, time: Date.now(), indexToSelect, initialPosition, meta }); // To avoid a focus loss when removing the last block, assure there is // always a default block if the last of the blocks have been removed. dispatch.ensureDefaultBlock(); }); }; /** * Action that replaces a single block with one or more replacement blocks. * * @param {(string|string[])} clientId Block client ID to replace. * @param {(Object|Object[])} block Replacement block(s). * * @return {Object} Action object. */ function replaceBlock(clientId, block) { return replaceBlocks(clientId, block); } /** * Higher-order action creator which, given the action type to dispatch creates * an action creator for managing block movement. * * @param {string} type Action type to dispatch. * * @return {Function} Action creator. */ const createOnMove = type => (clientIds, rootClientId) => ({ select, dispatch }) => { // If one of the blocks is locked or the parent is locked, we cannot move any block. const canMoveBlocks = select.canMoveBlocks(clientIds); if (!canMoveBlocks) { return; } dispatch({ type, clientIds: actions_castArray(clientIds), rootClientId }); }; const moveBlocksDown = createOnMove('MOVE_BLOCKS_DOWN'); const moveBlocksUp = createOnMove('MOVE_BLOCKS_UP'); /** * Action that moves given blocks to a new position. * * @param {?string} clientIds The client IDs of the blocks. * @param {?string} fromRootClientId Root client ID source. * @param {?string} toRootClientId Root client ID destination. * @param {number} index The index to move the blocks to. */ const moveBlocksToPosition = (clientIds, fromRootClientId = '', toRootClientId = '', index) => ({ select, dispatch }) => { const canMoveBlocks = select.canMoveBlocks(clientIds); // If one of the blocks is locked or the parent is locked, we cannot move any block. if (!canMoveBlocks) { return; } // If moving inside the same root block the move is always possible. if (fromRootClientId !== toRootClientId) { const canRemoveBlocks = select.canRemoveBlocks(clientIds); // If we're moving to another block, it means we're deleting blocks from // the original block, so we need to check if removing is possible. if (!canRemoveBlocks) { return; } const canInsertBlocks = select.canInsertBlocks(clientIds, toRootClientId); // If moving to other parent block, the move is possible if we can insert a block of the same type inside the new parent block. if (!canInsertBlocks) { return; } } dispatch({ type: 'MOVE_BLOCKS_TO_POSITION', fromRootClientId, toRootClientId, clientIds, index }); }; /** * Action that moves given block to a new position. * * @param {?string} clientId The client ID of the block. * @param {?string} fromRootClientId Root client ID source. * @param {?string} toRootClientId Root client ID destination. * @param {number} index The index to move the block to. */ function moveBlockToPosition(clientId, fromRootClientId = '', toRootClientId = '', index) { return moveBlocksToPosition([clientId], fromRootClientId, toRootClientId, index); } /** * Action that inserts a single block, optionally at a specific index respective a root block list. * * Only allowed blocks are inserted. The action may fail silently for blocks that are not allowed or if * a templateLock is active on the block list. * * @param {Object} block Block object to insert. * @param {?number} index Index at which block should be inserted. * @param {?string} rootClientId Optional root client ID of block list on which to insert. * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to true. * @param {?Object} meta Optional Meta values to be passed to the action object. * * @return {Object} Action object. */ function insertBlock(block, index, rootClientId, updateSelection, meta) { return insertBlocks([block], index, rootClientId, updateSelection, 0, meta); } /* eslint-disable jsdoc/valid-types */ /** * Action that inserts an array of blocks, optionally at a specific index respective a root block list. * * Only allowed blocks are inserted. The action may fail silently for blocks that are not allowed or if * a templateLock is active on the block list. * * @param {Object[]} blocks Block objects to insert. * @param {?number} index Index at which block should be inserted. * @param {?string} rootClientId Optional root client ID of block list on which to insert. * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to true. * @param {0|-1|null} initialPosition Initial focus position. Setting it to null prevent focusing the inserted block. * @param {?Object} meta Optional Meta values to be passed to the action object. * * @return {Object} Action object. */ const insertBlocks = (blocks, index, rootClientId, updateSelection = true, initialPosition = 0, meta) => ({ select, dispatch }) => { /* eslint-enable jsdoc/valid-types */ if (initialPosition !== null && typeof initialPosition === 'object') { meta = initialPosition; initialPosition = 0; external_wp_deprecated_default()("meta argument in wp.data.dispatch('core/block-editor')", { since: '5.8', hint: 'The meta argument is now the 6th argument of the function' }); } blocks = actions_castArray(blocks); const allowedBlocks = []; for (const block of blocks) { const isValid = select.canInsertBlockType(block.name, rootClientId); if (isValid) { allowedBlocks.push(block); } } if (allowedBlocks.length) { dispatch({ type: 'INSERT_BLOCKS', blocks: allowedBlocks, index, rootClientId, time: Date.now(), updateSelection, initialPosition: updateSelection ? initialPosition : null, meta }); } }; /** * Action that shows the insertion point. * * @param {?string} rootClientId Optional root client ID of block list on * which to insert. * @param {?number} index Index at which block should be inserted. * @param {?Object} __unstableOptions Additional options. * @property {boolean} __unstableWithInserter Whether or not to show an inserter button. * @property {WPDropOperation} operation The operation to perform when applied, * either 'insert' or 'replace' for now. * * @return {Object} Action object. */ function showInsertionPoint(rootClientId, index, __unstableOptions = {}) { const { __unstableWithInserter, operation, nearestSide } = __unstableOptions; return { type: 'SHOW_INSERTION_POINT', rootClientId, index, __unstableWithInserter, operation, nearestSide }; } /** * Action that hides the insertion point. */ const hideInsertionPoint = () => ({ select, dispatch }) => { if (!select.isBlockInsertionPointVisible()) { return; } dispatch({ type: 'HIDE_INSERTION_POINT' }); }; /** * Action that resets the template validity. * * @param {boolean} isValid template validity flag. * * @return {Object} Action object. */ function setTemplateValidity(isValid) { return { type: 'SET_TEMPLATE_VALIDITY', isValid }; } /** * Action that synchronizes the template with the list of blocks. * * @return {Object} Action object. */ const synchronizeTemplate = () => ({ select, dispatch }) => { dispatch({ type: 'SYNCHRONIZE_TEMPLATE' }); const blocks = select.getBlocks(); const template = select.getTemplate(); const updatedBlockList = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(blocks, template); dispatch.resetBlocks(updatedBlockList); }; /** * Delete the current selection. * * @param {boolean} isForward */ const __unstableDeleteSelection = isForward => ({ registry, select, dispatch }) => { const selectionAnchor = select.getSelectionStart(); const selectionFocus = select.getSelectionEnd(); if (selectionAnchor.clientId === selectionFocus.clientId) { return; } // It's not mergeable if there's no rich text selection. if (!selectionAnchor.attributeKey || !selectionFocus.attributeKey || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') { return false; } const anchorRootClientId = select.getBlockRootClientId(selectionAnchor.clientId); const focusRootClientId = select.getBlockRootClientId(selectionFocus.clientId); // It's not mergeable if the selection doesn't start and end in the same // block list. Maybe in the future it should be allowed. if (anchorRootClientId !== focusRootClientId) { return; } const blockOrder = select.getBlockOrder(anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); // Reassign selection start and end based on order. let selectionStart, selectionEnd; if (anchorIndex > focusIndex) { selectionStart = selectionFocus; selectionEnd = selectionAnchor; } else { selectionStart = selectionAnchor; selectionEnd = selectionFocus; } const targetSelection = isForward ? selectionEnd : selectionStart; const targetBlock = select.getBlock(targetSelection.clientId); const targetBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(targetBlock.name); if (!targetBlockType.merge) { return; } const selectionA = selectionStart; const selectionB = selectionEnd; const blockA = select.getBlock(selectionA.clientId); const blockB = select.getBlock(selectionB.clientId); const htmlA = blockA.attributes[selectionA.attributeKey]; const htmlB = blockB.attributes[selectionB.attributeKey]; let valueA = (0,external_wp_richText_namespaceObject.create)({ html: htmlA }); let valueB = (0,external_wp_richText_namespaceObject.create)({ html: htmlB }); valueA = (0,external_wp_richText_namespaceObject.remove)(valueA, selectionA.offset, valueA.text.length); valueB = (0,external_wp_richText_namespaceObject.insert)(valueB, START_OF_SELECTED_AREA, 0, selectionB.offset); // Clone the blocks so we don't manipulate the original. const cloneA = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockA, { [selectionA.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: valueA }) }); const cloneB = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockB, { [selectionB.attributeKey]: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: valueB }) }); const followingBlock = isForward ? cloneA : cloneB; // We can only merge blocks with similar types // thus, we transform the block to merge first const blocksWithTheSameType = blockA.name === blockB.name ? [followingBlock] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(followingBlock, targetBlockType.name); // If the block types can not match, do nothing if (!blocksWithTheSameType || !blocksWithTheSameType.length) { return; } let updatedAttributes; if (isForward) { const blockToMerge = blocksWithTheSameType.pop(); updatedAttributes = targetBlockType.merge(blockToMerge.attributes, cloneB.attributes); } else { const blockToMerge = blocksWithTheSameType.shift(); updatedAttributes = targetBlockType.merge(cloneA.attributes, blockToMerge.attributes); } const newAttributeKey = retrieveSelectedAttribute(updatedAttributes); const convertedHtml = updatedAttributes[newAttributeKey]; const convertedValue = (0,external_wp_richText_namespaceObject.create)({ html: convertedHtml }); const newOffset = convertedValue.text.indexOf(START_OF_SELECTED_AREA); const newValue = (0,external_wp_richText_namespaceObject.remove)(convertedValue, newOffset, newOffset + 1); const newHtml = (0,external_wp_richText_namespaceObject.toHTMLString)({ value: newValue }); updatedAttributes[newAttributeKey] = newHtml; const selectedBlockClientIds = select.getSelectedBlockClientIds(); const replacement = [...(isForward ? blocksWithTheSameType : []), { // Preserve the original client ID. ...targetBlock, attributes: { ...targetBlock.attributes, ...updatedAttributes } }, ...(isForward ? [] : blocksWithTheSameType)]; registry.batch(() => { dispatch.selectionChange(targetBlock.clientId, newAttributeKey, newOffset, newOffset); dispatch.replaceBlocks(selectedBlockClientIds, replacement, 0, // If we don't pass the `indexToSelect` it will default to the last block. select.getSelectedBlocksInitialCaretPosition()); }); }; /** * Split the current selection. * @param {?Array} blocks */ const __unstableSplitSelection = (blocks = []) => ({ registry, select, dispatch }) => { const selectionAnchor = select.getSelectionStart(); const selectionFocus = select.getSelectionEnd(); const anchorRootClientId = select.getBlockRootClientId(selectionAnchor.clientId); const focusRootClientId = select.getBlockRootClientId(selectionFocus.clientId); // It's not splittable if the selection doesn't start and end in the same // block list. Maybe in the future it should be allowed. if (anchorRootClientId !== focusRootClientId) { return; } const blockOrder = select.getBlockOrder(anchorRootClientId); const anchorIndex = blockOrder.indexOf(selectionAnchor.clientId); const focusIndex = blockOrder.indexOf(selectionFocus.clientId); // Reassign selection start and end based on order. let selectionStart, selectionEnd; if (anchorIndex > focusIndex) { selectionStart = selectionFocus; selectionEnd = selectionAnchor; } else { selectionStart = selectionAnchor; selectionEnd = selectionFocus; } const selectionA = selectionStart; const selectionB = selectionEnd; const blockA = select.getBlock(selectionA.clientId); const blockB = select.getBlock(selectionB.clientId); const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name); const blockBType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockB.name); const attributeKeyA = typeof selectionA.attributeKey === 'string' ? selectionA.attributeKey : findRichTextAttributeKey(blockAType); const attributeKeyB = typeof selectionB.attributeKey === 'string' ? selectionB.attributeKey : findRichTextAttributeKey(blockBType); const blockAttributes = select.getBlockAttributes(selectionA.clientId); const bindings = blockAttributes?.metadata?.bindings; // If the attribute is bound, don't split the selection and insert a new block instead. if (bindings?.[attributeKeyA]) { // Show warning if user tries to insert a block into another block with bindings. if (blocks.length) { const { createWarningNotice } = registry.dispatch(external_wp_notices_namespaceObject.store); createWarningNotice((0,external_wp_i18n_namespaceObject.__)("Blocks can't be inserted into other blocks with bindings"), { type: 'snackbar' }); return; } dispatch.insertAfterBlock(selectionA.clientId); return; } // Can't split if the selection is not set. if (!attributeKeyA || !attributeKeyB || typeof selectionAnchor.offset === 'undefined' || typeof selectionFocus.offset === 'undefined') { return; } // We can do some short-circuiting if the selection is collapsed. if (selectionA.clientId === selectionB.clientId && attributeKeyA === attributeKeyB && selectionA.offset === selectionB.offset) { // If an unmodified default block is selected, replace it. We don't // want to be converting into a default block. if (blocks.length) { if ((0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(blockA)) { dispatch.replaceBlocks([selectionA.clientId], blocks, blocks.length - 1, -1); return; } } // If selection is at the start or end, we can simply insert an // empty block, provided this block has no inner blocks. else if (!select.getBlockOrder(selectionA.clientId).length) { function createEmpty() { const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)(); return select.canInsertBlockType(defaultBlockName, anchorRootClientId) ? (0,external_wp_blocks_namespaceObject.createBlock)(defaultBlockName) : (0,external_wp_blocks_namespaceObject.createBlock)(select.getBlockName(selectionA.clientId)); } const length = blockAttributes[attributeKeyA].length; if (selectionA.offset === 0 && length) { dispatch.insertBlocks([createEmpty()], select.getBlockIndex(selectionA.clientId), anchorRootClientId, false); return; } if (selectionA.offset === length) { dispatch.insertBlocks([createEmpty()], select.getBlockIndex(selectionA.clientId) + 1, anchorRootClientId); return; } } } const htmlA = blockA.attributes[attributeKeyA]; const htmlB = blockB.attributes[attributeKeyB]; let valueA = (0,external_wp_richText_namespaceObject.create)({ html: htmlA }); let valueB = (0,external_wp_richText_namespaceObject.create)({ html: htmlB }); valueA = (0,external_wp_richText_namespaceObject.remove)(valueA, selectionA.offset, valueA.text.length); valueB = (0,external_wp_richText_namespaceObject.remove)(valueB, 0, selectionB.offset); let head = { // Preserve the original client ID. ...blockA, // If both start and end are the same, should only copy innerBlocks // once. innerBlocks: blockA.clientId === blockB.clientId ? [] : blockA.innerBlocks, attributes: { ...blockA.attributes, [attributeKeyA]: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: valueA }) } }; let tail = { ...blockB, // Only preserve the original client ID if the end is different. clientId: blockA.clientId === blockB.clientId ? (0,external_wp_blocks_namespaceObject.createBlock)(blockB.name).clientId : blockB.clientId, attributes: { ...blockB.attributes, [attributeKeyB]: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: valueB }) } }; // When splitting a block, attempt to convert the tail block to the // default block type. For example, when splitting a heading block, the // tail block will be converted to a paragraph block. Note that for // blocks such as a list item and button, this will be skipped because // the default block type cannot be inserted. const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)(); if ( // A block is only split when the selection is within the same // block. blockA.clientId === blockB.clientId && defaultBlockName && tail.name !== defaultBlockName && select.canInsertBlockType(defaultBlockName, anchorRootClientId)) { const switched = (0,external_wp_blocks_namespaceObject.switchToBlockType)(tail, defaultBlockName); if (switched?.length === 1) { tail = switched[0]; } } if (!blocks.length) { dispatch.replaceBlocks(select.getSelectedBlockClientIds(), [head, tail]); return; } let selection; const output = []; const clonedBlocks = [...blocks]; const firstBlock = clonedBlocks.shift(); const headType = (0,external_wp_blocks_namespaceObject.getBlockType)(head.name); const firstBlocks = headType.merge && firstBlock.name === headType.name ? [firstBlock] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(firstBlock, headType.name); if (firstBlocks?.length) { const first = firstBlocks.shift(); head = { ...head, attributes: { ...head.attributes, ...headType.merge(head.attributes, first.attributes) } }; output.push(head); selection = { clientId: head.clientId, attributeKey: attributeKeyA, offset: (0,external_wp_richText_namespaceObject.create)({ html: head.attributes[attributeKeyA] }).text.length }; clonedBlocks.unshift(...firstBlocks); } else { if (!(0,external_wp_blocks_namespaceObject.isUnmodifiedBlock)(head)) { output.push(head); } output.push(firstBlock); } const lastBlock = clonedBlocks.pop(); const tailType = (0,external_wp_blocks_namespaceObject.getBlockType)(tail.name); if (clonedBlocks.length) { output.push(...clonedBlocks); } if (lastBlock) { const lastBlocks = tailType.merge && tailType.name === lastBlock.name ? [lastBlock] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(lastBlock, tailType.name); if (lastBlocks?.length) { const last = lastBlocks.pop(); output.push({ ...tail, attributes: { ...tail.attributes, ...tailType.merge(last.attributes, tail.attributes) } }); output.push(...lastBlocks); selection = { clientId: tail.clientId, attributeKey: attributeKeyB, offset: (0,external_wp_richText_namespaceObject.create)({ html: last.attributes[attributeKeyB] }).text.length }; } else { output.push(lastBlock); if (!(0,external_wp_blocks_namespaceObject.isUnmodifiedBlock)(tail)) { output.push(tail); } } } else if (!(0,external_wp_blocks_namespaceObject.isUnmodifiedBlock)(tail)) { output.push(tail); } registry.batch(() => { dispatch.replaceBlocks(select.getSelectedBlockClientIds(), output, output.length - 1, 0); if (selection) { dispatch.selectionChange(selection.clientId, selection.attributeKey, selection.offset, selection.offset); } }); }; /** * Expand the selection to cover the entire blocks, removing partial selection. */ const __unstableExpandSelection = () => ({ select, dispatch }) => { const selectionAnchor = select.getSelectionStart(); const selectionFocus = select.getSelectionEnd(); dispatch.selectionChange({ start: { clientId: selectionAnchor.clientId }, end: { clientId: selectionFocus.clientId } }); }; /** * Action that merges two blocks. * * @param {string} firstBlockClientId Client ID of the first block to merge. * @param {string} secondBlockClientId Client ID of the second block to merge. */ const mergeBlocks = (firstBlockClientId, secondBlockClientId) => ({ registry, select, dispatch }) => { const clientIdA = firstBlockClientId; const clientIdB = secondBlockClientId; const blockA = select.getBlock(clientIdA); const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name); if (!blockAType) { return; } const blockB = select.getBlock(clientIdB); if (!blockAType.merge && (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockA.name, '__experimentalOnMerge')) { // If there's no merge function defined, attempt merging inner // blocks. const blocksWithTheSameType = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blockB, blockAType.name); // Only focus the previous block if it's not mergeable. if (blocksWithTheSameType?.length !== 1) { dispatch.selectBlock(blockA.clientId); return; } const [blockWithSameType] = blocksWithTheSameType; if (blockWithSameType.innerBlocks.length < 1) { dispatch.selectBlock(blockA.clientId); return; } registry.batch(() => { dispatch.insertBlocks(blockWithSameType.innerBlocks, undefined, clientIdA); dispatch.removeBlock(clientIdB); dispatch.selectBlock(blockWithSameType.innerBlocks[0].clientId); // Attempt to merge the next block if it's the same type and // same attributes. This is useful when merging a paragraph into // a list, and the next block is also a list. If we don't merge, // it looks like one list, but it's actually two lists. The same // applies to other blocks such as a group with the same // attributes. const nextBlockClientId = select.getNextBlockClientId(clientIdA); if (nextBlockClientId && select.getBlockName(clientIdA) === select.getBlockName(nextBlockClientId)) { const rootAttributes = select.getBlockAttributes(clientIdA); const previousRootAttributes = select.getBlockAttributes(nextBlockClientId); if (Object.keys(rootAttributes).every(key => rootAttributes[key] === previousRootAttributes[key])) { dispatch.moveBlocksToPosition(select.getBlockOrder(nextBlockClientId), nextBlockClientId, clientIdA); dispatch.removeBlock(nextBlockClientId, false); } } }); return; } if ((0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(blockA)) { dispatch.removeBlock(clientIdA, select.isBlockSelected(clientIdA)); return; } if ((0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(blockB)) { dispatch.removeBlock(clientIdB, select.isBlockSelected(clientIdB)); return; } if (!blockAType.merge) { dispatch.selectBlock(blockA.clientId); return; } const blockBType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockB.name); const { clientId, attributeKey, offset } = select.getSelectionStart(); const selectedBlockType = clientId === clientIdA ? blockAType : blockBType; const attributeDefinition = selectedBlockType.attributes[attributeKey]; const canRestoreTextSelection = (clientId === clientIdA || clientId === clientIdB) && attributeKey !== undefined && offset !== undefined && // We cannot restore text selection if the RichText identifier // is not a defined block attribute key. This can be the case if the // fallback instance ID is used to store selection (and no RichText // identifier is set), or when the identifier is wrong. !!attributeDefinition; if (!attributeDefinition) { if (typeof attributeKey === 'number') { window.console.error(`RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was ${typeof attributeKey}`); } else { window.console.error('The RichText identifier prop does not match any attributes defined by the block.'); } } // Clone the blocks so we don't insert the character in a "live" block. const cloneA = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockA); const cloneB = (0,external_wp_blocks_namespaceObject.cloneBlock)(blockB); if (canRestoreTextSelection) { const selectedBlock = clientId === clientIdA ? cloneA : cloneB; const html = selectedBlock.attributes[attributeKey]; const value = (0,external_wp_richText_namespaceObject.insert)((0,external_wp_richText_namespaceObject.create)({ html }), START_OF_SELECTED_AREA, offset, offset); selectedBlock.attributes[attributeKey] = (0,external_wp_richText_namespaceObject.toHTMLString)({ value }); } // We can only merge blocks with similar types // thus, we transform the block to merge first. const blocksWithTheSameType = blockA.name === blockB.name ? [cloneB] : (0,external_wp_blocks_namespaceObject.switchToBlockType)(cloneB, blockA.name); // If the block types can not match, do nothing. if (!blocksWithTheSameType || !blocksWithTheSameType.length) { return; } // Calling the merge to update the attributes and remove the block to be merged. const updatedAttributes = blockAType.merge(cloneA.attributes, blocksWithTheSameType[0].attributes); if (canRestoreTextSelection) { const newAttributeKey = retrieveSelectedAttribute(updatedAttributes); const convertedHtml = updatedAttributes[newAttributeKey]; const convertedValue = (0,external_wp_richText_namespaceObject.create)({ html: convertedHtml }); const newOffset = convertedValue.text.indexOf(START_OF_SELECTED_AREA); const newValue = (0,external_wp_richText_namespaceObject.remove)(convertedValue, newOffset, newOffset + 1); const newHtml = (0,external_wp_richText_namespaceObject.toHTMLString)({ value: newValue }); updatedAttributes[newAttributeKey] = newHtml; dispatch.selectionChange(blockA.clientId, newAttributeKey, newOffset, newOffset); } dispatch.replaceBlocks([blockA.clientId, blockB.clientId], [{ ...blockA, attributes: { ...blockA.attributes, ...updatedAttributes } }, ...blocksWithTheSameType.slice(1)], 0 // If we don't pass the `indexToSelect` it will default to the last block. ); }; /** * Yields action objects used in signalling that the blocks corresponding to * the set of specified client IDs are to be removed. * * @param {string|string[]} clientIds Client IDs of blocks to remove. * @param {boolean} selectPrevious True if the previous block * or the immediate parent * (if no previous block exists) * should be selected * when a block is removed. */ const removeBlocks = (clientIds, selectPrevious = true) => privateRemoveBlocks(clientIds, selectPrevious); /** * Returns an action object used in signalling that the block with the * specified client ID is to be removed. * * @param {string} clientId Client ID of block to remove. * @param {boolean} selectPrevious True if the previous block should be * selected when a block is removed. * * @return {Object} Action object. */ function removeBlock(clientId, selectPrevious) { return removeBlocks([clientId], selectPrevious); } /* eslint-disable jsdoc/valid-types */ /** * Returns an action object used in signalling that the inner blocks with the * specified client ID should be replaced. * * @param {string} rootClientId Client ID of the block whose InnerBlocks will re replaced. * @param {Object[]} blocks Block objects to insert as new InnerBlocks * @param {?boolean} updateSelection If true block selection will be updated. If false, block selection will not change. Defaults to false. * @param {0|-1|null} initialPosition Initial block position. * @return {Object} Action object. */ function replaceInnerBlocks(rootClientId, blocks, updateSelection = false, initialPosition = 0) { /* eslint-enable jsdoc/valid-types */ return { type: 'REPLACE_INNER_BLOCKS', rootClientId, blocks, updateSelection, initialPosition: updateSelection ? initialPosition : null, time: Date.now() }; } /** * Returns an action object used to toggle the block editing mode between * visual and HTML modes. * * @param {string} clientId Block client ID. * * @return {Object} Action object. */ function toggleBlockMode(clientId) { return { type: 'TOGGLE_BLOCK_MODE', clientId }; } /** * Returns an action object used in signalling that the user has begun to type. * * @return {Object} Action object. */ function startTyping() { return { type: 'START_TYPING' }; } /** * Returns an action object used in signalling that the user has stopped typing. * * @return {Object} Action object. */ function stopTyping() { return { type: 'STOP_TYPING' }; } /** * Returns an action object used in signalling that the user has begun to drag blocks. * * @param {string[]} clientIds An array of client ids being dragged * * @return {Object} Action object. */ function startDraggingBlocks(clientIds = []) { return { type: 'START_DRAGGING_BLOCKS', clientIds }; } /** * Returns an action object used in signalling that the user has stopped dragging blocks. * * @return {Object} Action object. */ function stopDraggingBlocks() { return { type: 'STOP_DRAGGING_BLOCKS' }; } /** * Returns an action object used in signalling that the caret has entered formatted text. * * @deprecated * * @return {Object} Action object. */ function enterFormattedText() { external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).enterFormattedText', { since: '6.1', version: '6.3' }); return { type: 'DO_NOTHING' }; } /** * Returns an action object used in signalling that the user caret has exited formatted text. * * @deprecated * * @return {Object} Action object. */ function exitFormattedText() { external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).exitFormattedText', { since: '6.1', version: '6.3' }); return { type: 'DO_NOTHING' }; } /** * Action that changes the position of the user caret. * * @param {string|WPSelection} clientId The selected block client ID. * @param {string} attributeKey The selected block attribute key. * @param {number} startOffset The start offset. * @param {number} endOffset The end offset. * * @return {Object} Action object. */ function selectionChange(clientId, attributeKey, startOffset, endOffset) { if (typeof clientId === 'string') { return { type: 'SELECTION_CHANGE', clientId, attributeKey, startOffset, endOffset }; } return { type: 'SELECTION_CHANGE', ...clientId }; } /** * Action that adds a new block of the default type to the block list. * * @param {?Object} attributes Optional attributes of the block to assign. * @param {?string} rootClientId Optional root client ID of block list on which * to append. * @param {?number} index Optional index where to insert the default block. */ const insertDefaultBlock = (attributes, rootClientId, index) => ({ dispatch }) => { // Abort if there is no default block type (if it has been unregistered). const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)(); if (!defaultBlockName) { return; } const block = (0,external_wp_blocks_namespaceObject.createBlock)(defaultBlockName, attributes); return dispatch.insertBlock(block, index, rootClientId); }; /** * @typedef {Object< string, Object >} SettingsByClientId */ /** * Action that changes the nested settings of the given block(s). * * @param {string | SettingsByClientId} clientId Client ID of the block whose * nested setting are being * received, or object of settings * by client ID. * @param {Object} settings Object with the new settings * for the nested block. * * @return {Object} Action object */ function updateBlockListSettings(clientId, settings) { return { type: 'UPDATE_BLOCK_LIST_SETTINGS', clientId, settings }; } /** * Action that updates the block editor settings. * * @param {Object} settings Updated settings * * @return {Object} Action object */ function updateSettings(settings) { return __experimentalUpdateSettings(settings, { stripExperimentalSettings: true }); } /** * Action that signals that a temporary reusable block has been saved * in order to switch its temporary id with the real id. * * @param {string} id Reusable block's id. * @param {string} updatedId Updated block's id. * * @return {Object} Action object. */ function __unstableSaveReusableBlock(id, updatedId) { return { type: 'SAVE_REUSABLE_BLOCK_SUCCESS', id, updatedId }; } /** * Action that marks the last block change explicitly as persistent. * * @return {Object} Action object. */ function __unstableMarkLastChangeAsPersistent() { return { type: 'MARK_LAST_CHANGE_AS_PERSISTENT' }; } /** * Action that signals that the next block change should be marked explicitly as not persistent. * * @return {Object} Action object. */ function __unstableMarkNextChangeAsNotPersistent() { return { type: 'MARK_NEXT_CHANGE_AS_NOT_PERSISTENT' }; } /** * Action that marks the last block change as an automatic change, meaning it was not * performed by the user, and can be undone using the `Escape` and `Backspace` keys. * This action must be called after the change was made, and any actions that are a * consequence of it, so it is recommended to be called at the next idle period to ensure all * selection changes have been recorded. */ const __unstableMarkAutomaticChange = () => ({ dispatch }) => { dispatch({ type: 'MARK_AUTOMATIC_CHANGE' }); const { requestIdleCallback = cb => setTimeout(cb, 100) } = window; requestIdleCallback(() => { dispatch({ type: 'MARK_AUTOMATIC_CHANGE_FINAL' }); }); }; /** * Action that enables or disables the navigation mode. * * @param {boolean} isNavigationMode Enable/Disable navigation mode. */ const setNavigationMode = (isNavigationMode = true) => ({ dispatch }) => { dispatch.__unstableSetEditorMode(isNavigationMode ? 'navigation' : 'edit'); }; /** * Action that sets the editor mode * * @param {string} mode Editor mode */ const __unstableSetEditorMode = mode => ({ registry }) => { registry.dispatch(external_wp_preferences_namespaceObject.store).set('core', 'editorTool', mode); if (mode === 'navigation') { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('You are currently in Write mode.')); } else if (mode === 'edit') { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('You are currently in Design mode.')); } }; /** * Set the block moving client ID. * * @deprecated * * @return {Object} Action object. */ function setBlockMovingClientId() { external_wp_deprecated_default()('wp.data.dispatch( "core/block-editor" ).setBlockMovingClientId', { since: '6.7', hint: 'Block moving mode feature has been removed' }); return { type: 'DO_NOTHING' }; } /** * Action that duplicates a list of blocks. * * @param {string[]} clientIds * @param {boolean} updateSelection */ const duplicateBlocks = (clientIds, updateSelection = true) => ({ select, dispatch }) => { if (!clientIds || !clientIds.length) { return; } // Return early if blocks don't exist. const blocks = select.getBlocksByClientId(clientIds); if (blocks.some(block => !block)) { return; } // Return early if blocks don't support multiple usage. const blockNames = blocks.map(block => block.name); if (blockNames.some(blockName => !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'multiple', true))) { return; } const rootClientId = select.getBlockRootClientId(clientIds[0]); const clientIdsArray = actions_castArray(clientIds); const lastSelectedIndex = select.getBlockIndex(clientIdsArray[clientIdsArray.length - 1]); const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.__experimentalCloneSanitizedBlock)(block)); dispatch.insertBlocks(clonedBlocks, lastSelectedIndex + 1, rootClientId, updateSelection); if (clonedBlocks.length > 1 && updateSelection) { dispatch.multiSelect(clonedBlocks[0].clientId, clonedBlocks[clonedBlocks.length - 1].clientId); } return clonedBlocks.map(block => block.clientId); }; /** * Action that inserts a default block before a given block. * * @param {string} clientId */ const insertBeforeBlock = clientId => ({ select, dispatch }) => { if (!clientId) { return; } const rootClientId = select.getBlockRootClientId(clientId); const isLocked = select.getTemplateLock(rootClientId); if (isLocked) { return; } const blockIndex = select.getBlockIndex(clientId); const directInsertBlock = rootClientId ? select.getDirectInsertBlock(rootClientId) : null; if (!directInsertBlock) { return dispatch.insertDefaultBlock({}, rootClientId, blockIndex); } const copiedAttributes = {}; if (directInsertBlock.attributesToCopy) { const attributes = select.getBlockAttributes(clientId); directInsertBlock.attributesToCopy.forEach(key => { if (attributes[key]) { copiedAttributes[key] = attributes[key]; } }); } const block = (0,external_wp_blocks_namespaceObject.createBlock)(directInsertBlock.name, { ...directInsertBlock.attributes, ...copiedAttributes }); return dispatch.insertBlock(block, blockIndex, rootClientId); }; /** * Action that inserts a default block after a given block. * * @param {string} clientId */ const insertAfterBlock = clientId => ({ select, dispatch }) => { if (!clientId) { return; } const rootClientId = select.getBlockRootClientId(clientId); const isLocked = select.getTemplateLock(rootClientId); if (isLocked) { return; } const blockIndex = select.getBlockIndex(clientId); const directInsertBlock = rootClientId ? select.getDirectInsertBlock(rootClientId) : null; if (!directInsertBlock) { return dispatch.insertDefaultBlock({}, rootClientId, blockIndex + 1); } const copiedAttributes = {}; if (directInsertBlock.attributesToCopy) { const attributes = select.getBlockAttributes(clientId); directInsertBlock.attributesToCopy.forEach(key => { if (attributes[key]) { copiedAttributes[key] = attributes[key]; } }); } const block = (0,external_wp_blocks_namespaceObject.createBlock)(directInsertBlock.name, { ...directInsertBlock.attributes, ...copiedAttributes }); return dispatch.insertBlock(block, blockIndex + 1, rootClientId); }; /** * Action that toggles the highlighted block state. * * @param {string} clientId The block's clientId. * @param {boolean} isHighlighted The highlight state. */ function toggleBlockHighlight(clientId, isHighlighted) { return { type: 'TOGGLE_BLOCK_HIGHLIGHT', clientId, isHighlighted }; } /** * Action that "flashes" the block with a given `clientId` by rhythmically highlighting it. * * @param {string} clientId Target block client ID. */ const flashBlock = clientId => async ({ dispatch }) => { dispatch(toggleBlockHighlight(clientId, true)); await new Promise(resolve => setTimeout(resolve, 150)); dispatch(toggleBlockHighlight(clientId, false)); }; /** * Action that sets whether a block has controlled inner blocks. * * @param {string} clientId The block's clientId. * @param {boolean} hasControlledInnerBlocks True if the block's inner blocks are controlled. */ function setHasControlledInnerBlocks(clientId, hasControlledInnerBlocks) { return { type: 'SET_HAS_CONTROLLED_INNER_BLOCKS', hasControlledInnerBlocks, clientId }; } /** * Action that sets whether given blocks are visible on the canvas. * * @param {Record<string,boolean>} updates For each block's clientId, its new visibility setting. */ function setBlockVisibility(updates) { return { type: 'SET_BLOCK_VISIBILITY', updates }; } /** * Action that sets whether a block is being temporarily edited as blocks. * * DO-NOT-USE in production. * This action is created for internal/experimental only usage and may be * removed anytime without any warning, causing breakage on any plugin or theme invoking it. * * @param {?string} temporarilyEditingAsBlocks The block's clientId being temporarily edited as blocks. * @param {?string} focusModeToRevert The focus mode to revert after temporarily edit as blocks finishes. */ function __unstableSetTemporarilyEditingAsBlocks(temporarilyEditingAsBlocks, focusModeToRevert) { return { type: 'SET_TEMPORARILY_EDITING_AS_BLOCKS', temporarilyEditingAsBlocks, focusModeToRevert }; } /** * Interface for inserter media requests. * * @typedef {Object} InserterMediaRequest * @property {number} per_page How many items to fetch per page. * @property {string} search The search term to use for filtering the results. */ /** * Interface for inserter media responses. Any media resource should * map their response to this interface, in order to create the core * WordPress media blocks (image, video, audio). * * @typedef {Object} InserterMediaItem * @property {string} title The title of the media item. * @property {string} url The source url of the media item. * @property {string} [previewUrl] The preview source url of the media item to display in the media list. * @property {number} [id] The WordPress id of the media item. * @property {number|string} [sourceId] The id of the media item from external source. * @property {string} [alt] The alt text of the media item. * @property {string} [caption] The caption of the media item. */ /** * Registers a new inserter media category. Once registered, the media category is * available in the inserter's media tab. * * The following interfaces are used: * * _Type Definition_ * * - _InserterMediaRequest_ `Object`: Interface for inserter media requests. * * _Properties_ * * - _per_page_ `number`: How many items to fetch per page. * - _search_ `string`: The search term to use for filtering the results. * * _Type Definition_ * * - _InserterMediaItem_ `Object`: Interface for inserter media responses. Any media resource should * map their response to this interface, in order to create the core * WordPress media blocks (image, video, audio). * * _Properties_ * * - _title_ `string`: The title of the media item. * - _url_ `string: The source url of the media item. * - _previewUrl_ `[string]`: The preview source url of the media item to display in the media list. * - _id_ `[number]`: The WordPress id of the media item. * - _sourceId_ `[number|string]`: The id of the media item from external source. * - _alt_ `[string]`: The alt text of the media item. * - _caption_ `[string]`: The caption of the media item. * * @param {InserterMediaCategory} category The inserter media category to register. * * @example * ```js * * wp.data.dispatch('core/block-editor').registerInserterMediaCategory( { * name: 'openverse', * labels: { * name: 'Openverse', * search_items: 'Search Openverse', * }, * mediaType: 'image', * async fetch( query = {} ) { * const defaultArgs = { * mature: false, * excluded_source: 'flickr,inaturalist,wikimedia', * license: 'pdm,cc0', * }; * const finalQuery = { ...query, ...defaultArgs }; * // Sometimes you might need to map the supported request params according to `InserterMediaRequest`. * // interface. In this example the `search` query param is named `q`. * const mapFromInserterMediaRequest = { * per_page: 'page_size', * search: 'q', * }; * const url = new URL( 'https://api.openverse.org/v1/images/' ); * Object.entries( finalQuery ).forEach( ( [ key, value ] ) => { * const queryKey = mapFromInserterMediaRequest[ key ] || key; * url.searchParams.set( queryKey, value ); * } ); * const response = await window.fetch( url, { * headers: { * 'User-Agent': 'WordPress/inserter-media-fetch', * }, * } ); * const jsonResponse = await response.json(); * const results = jsonResponse.results; * return results.map( ( result ) => ( { * ...result, * // If your response result includes an `id` prop that you want to access later, it should * // be mapped to `InserterMediaItem`'s `sourceId` prop. This can be useful if you provide * // a report URL getter. * // Additionally you should always clear the `id` value of your response results because * // it is used to identify WordPress media items. * sourceId: result.id, * id: undefined, * caption: result.caption, * previewUrl: result.thumbnail, * } ) ); * }, * getReportUrl: ( { sourceId } ) => * `https://wordpress.org/openverse/image/${ sourceId }/report/`, * isExternalResource: true, * } ); * ``` * * @typedef {Object} InserterMediaCategory Interface for inserter media category. * @property {string} name The name of the media category, that should be unique among all media categories. * @property {Object} labels Labels for the media category. * @property {string} labels.name General name of the media category. It's used in the inserter media items list. * @property {string} [labels.search_items='Search'] Label for searching items. Default is ‘Search Posts’ / ‘Search Pages’. * @property {('image'|'audio'|'video')} mediaType The media type of the media category. * @property {(InserterMediaRequest) => Promise<InserterMediaItem[]>} fetch The function to fetch media items for the category. * @property {(InserterMediaItem) => string} [getReportUrl] If the media category supports reporting media items, this function should return * the report url for the media item. It accepts the `InserterMediaItem` as an argument. * @property {boolean} [isExternalResource] If the media category is an external resource, this should be set to true. * This is used to avoid making a request to the external resource when the user */ const registerInserterMediaCategory = category => ({ select, dispatch }) => { if (!category || typeof category !== 'object') { console.error('Category should be an `InserterMediaCategory` object.'); return; } if (!category.name) { console.error('Category should have a `name` that should be unique among all media categories.'); return; } if (!category.labels?.name) { console.error('Category should have a `labels.name`.'); return; } if (!['image', 'audio', 'video'].includes(category.mediaType)) { console.error('Category should have `mediaType` property that is one of `image|audio|video`.'); return; } if (!category.fetch || typeof category.fetch !== 'function') { console.error('Category should have a `fetch` function defined with the following signature `(InserterMediaRequest) => Promise<InserterMediaItem[]>`.'); return; } const registeredInserterMediaCategories = select.getRegisteredInserterMediaCategories(); if (registeredInserterMediaCategories.some(({ name }) => name === category.name)) { console.error(`A category is already registered with the same name: "${category.name}".`); return; } if (registeredInserterMediaCategories.some(({ labels: { name } = {} }) => name === category.labels?.name)) { console.error(`A category is already registered with the same labels.name: "${category.labels.name}".`); return; } // `inserterMediaCategories` is a private block editor setting, which means it cannot // be updated through the public `updateSettings` action. We preserve this setting as // private, so extenders can only add new inserter media categories and don't have any // control over the core media categories. dispatch({ type: 'REGISTER_INSERTER_MEDIA_CATEGORY', category: { ...category, isExternalResource: true } }); }; /** * @typedef {import('../components/block-editing-mode').BlockEditingMode} BlockEditingMode */ /** * Sets the block editing mode for a given block. * * @see useBlockEditingMode * * @param {string} clientId The block client ID, or `''` for the root container. * @param {BlockEditingMode} mode The block editing mode. One of `'disabled'`, * `'contentOnly'`, or `'default'`. * * @return {Object} Action object. */ function setBlockEditingMode(clientId = '', mode) { return { type: 'SET_BLOCK_EDITING_MODE', clientId, mode }; } /** * Clears the block editing mode for a given block. * * @see useBlockEditingMode * * @param {string} clientId The block client ID, or `''` for the root container. * * @return {Object} Action object. */ function unsetBlockEditingMode(clientId = '') { return { type: 'UNSET_BLOCK_EDITING_MODE', clientId }; } ;// ./node_modules/@wordpress/block-editor/build-module/store/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Block editor data store configuration. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore */ const storeConfig = { reducer: reducer, selectors: selectors_namespaceObject, actions: actions_namespaceObject }; /** * Store definition for the block editor namespace. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore */ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { ...storeConfig, persist: ['preferences'] }); // We will be able to use the `register` function once we switch // the "preferences" persistence to use the new preferences package. const registeredStore = (0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, { ...storeConfig, persist: ['preferences'] }); unlock(registeredStore).registerPrivateActions(private_actions_namespaceObject); unlock(registeredStore).registerPrivateSelectors(private_selectors_namespaceObject); // TODO: Remove once we switch to the `register` function (see above). // // Until then, private functions also need to be attached to the original // `store` descriptor in order to avoid unit tests failing, which could happen // when tests create new registries in which they register stores. // // @see https://github.com/WordPress/gutenberg/pull/51145#discussion_r1239999590 unlock(store).registerPrivateActions(private_actions_namespaceObject); unlock(store).registerPrivateSelectors(private_selectors_namespaceObject); ;// ./node_modules/@wordpress/block-editor/build-module/components/use-settings/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Hook that retrieves the given settings for the block instance in use. * * It looks up the settings first in the block instance hierarchy. * If none are found, it'll look them up in the block editor settings. * * @param {string[]} paths The paths to the settings. * @return {any[]} Returns the values defined for the settings. * @example * ```js * const [ fixed, sticky ] = useSettings( 'position.fixed', 'position.sticky' ); * ``` */ function use_settings_useSettings(...paths) { const { clientId = null } = useBlockEditContext(); return (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getBlockSettings(clientId, ...paths), [clientId, ...paths]); } /** * Hook that retrieves the given setting for the block instance in use. * * It looks up the setting first in the block instance hierarchy. * If none is found, it'll look it up in the block editor settings. * * @deprecated 6.5.0 Use useSettings instead. * * @param {string} path The path to the setting. * @return {any} Returns the value defined for the setting. * @example * ```js * const isEnabled = useSetting( 'typography.dropCap' ); * ``` */ function useSetting(path) { external_wp_deprecated_default()('wp.blockEditor.useSetting', { since: '6.5', alternative: 'wp.blockEditor.useSettings', note: 'The new useSettings function can retrieve multiple settings at once, with better performance.' }); const [value] = use_settings_useSettings(path); return value; } ;// external ["wp","styleEngine"] const external_wp_styleEngine_namespaceObject = window["wp"]["styleEngine"]; ;// ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/fluid-utils.js /** * The fluid utilities must match the backend equivalent. * See: gutenberg_get_typography_font_size_value() in lib/block-supports/typography.php * --------------------------------------------------------------- */ // Defaults. const DEFAULT_MAXIMUM_VIEWPORT_WIDTH = '1600px'; const DEFAULT_MINIMUM_VIEWPORT_WIDTH = '320px'; const DEFAULT_SCALE_FACTOR = 1; const DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN = 0.25; const DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX = 0.75; const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px'; /** * Computes a fluid font-size value that uses clamp(). A minimum and maximum * font size OR a single font size can be specified. * * If a single font size is specified, it is scaled up and down using a logarithmic scale. * * @example * ```js * // Calculate fluid font-size value from a minimum and maximum value. * const fontSize = getComputedFluidTypographyValue( { * minimumFontSize: '20px', * maximumFontSize: '45px' * } ); * // Calculate fluid font-size value from a single font size. * const fontSize = getComputedFluidTypographyValue( { * fontSize: '30px', * } ); * ``` * * @param {Object} args * @param {?string} args.minimumViewportWidth Minimum viewport size from which type will have fluidity. Optional if fontSize is specified. * @param {?string} args.maximumViewportWidth Maximum size up to which type will have fluidity. Optional if fontSize is specified. * @param {string|number} [args.fontSize] Size to derive maximumFontSize and minimumFontSize from, if necessary. Optional if minimumFontSize and maximumFontSize are specified. * @param {?string} args.maximumFontSize Maximum font size for any clamp() calculation. Optional. * @param {?string} args.minimumFontSize Minimum font size for any clamp() calculation. Optional. * @param {?number} args.scaleFactor A scale factor to determine how fast a font scales within boundaries. Optional. * @param {?string} args.minimumFontSizeLimit The smallest a calculated font size may be. Optional. * * @return {string|null} A font-size value using clamp(). */ function getComputedFluidTypographyValue({ minimumFontSize, maximumFontSize, fontSize, minimumViewportWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH, maximumViewportWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH, scaleFactor = DEFAULT_SCALE_FACTOR, minimumFontSizeLimit }) { // Validate incoming settings and set defaults. minimumFontSizeLimit = !!getTypographyValueAndUnit(minimumFontSizeLimit) ? minimumFontSizeLimit : DEFAULT_MINIMUM_FONT_SIZE_LIMIT; /* * Calculates missing minimumFontSize and maximumFontSize from * defaultFontSize if provided. */ if (fontSize) { // Parses default font size. const fontSizeParsed = getTypographyValueAndUnit(fontSize); // Protect against invalid units. if (!fontSizeParsed?.unit) { return null; } // Parses the minimum font size limit, so we can perform checks using it. const minimumFontSizeLimitParsed = getTypographyValueAndUnit(minimumFontSizeLimit, { coerceTo: fontSizeParsed.unit }); // Don't enforce minimum font size if a font size has explicitly set a min and max value. if (!!minimumFontSizeLimitParsed?.value && !minimumFontSize && !maximumFontSize) { /* * If a minimum size was not passed to this function * and the user-defined font size is lower than $minimum_font_size_limit, * do not calculate a fluid value. */ if (fontSizeParsed?.value <= minimumFontSizeLimitParsed?.value) { return null; } } // If no fluid max font size is available use the incoming value. if (!maximumFontSize) { maximumFontSize = `${fontSizeParsed.value}${fontSizeParsed.unit}`; } /* * If no minimumFontSize is provided, create one using * the given font size multiplied by the min font size scale factor. */ if (!minimumFontSize) { const fontSizeValueInPx = fontSizeParsed.unit === 'px' ? fontSizeParsed.value : fontSizeParsed.value * 16; /* * The scale factor is a multiplier that affects how quickly the curve will move towards the minimum, * that is, how quickly the size factor reaches 0 given increasing font size values. * For a - b * log2(), lower values of b will make the curve move towards the minimum faster. * The scale factor is constrained between min and max values. */ const minimumFontSizeFactor = Math.min(Math.max(1 - 0.075 * Math.log2(fontSizeValueInPx), DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN), DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX); // Calculates the minimum font size. const calculatedMinimumFontSize = roundToPrecision(fontSizeParsed.value * minimumFontSizeFactor, 3); // Only use calculated min font size if it's > $minimum_font_size_limit value. if (!!minimumFontSizeLimitParsed?.value && calculatedMinimumFontSize < minimumFontSizeLimitParsed?.value) { minimumFontSize = `${minimumFontSizeLimitParsed.value}${minimumFontSizeLimitParsed.unit}`; } else { minimumFontSize = `${calculatedMinimumFontSize}${fontSizeParsed.unit}`; } } } // Grab the minimum font size and normalize it in order to use the value for calculations. const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSize); // We get a 'preferred' unit to keep units consistent when calculating, // otherwise the result will not be accurate. const fontSizeUnit = minimumFontSizeParsed?.unit || 'rem'; // Grabs the maximum font size and normalize it in order to use the value for calculations. const maximumFontSizeParsed = getTypographyValueAndUnit(maximumFontSize, { coerceTo: fontSizeUnit }); // Checks for mandatory min and max sizes, and protects against unsupported units. if (!minimumFontSizeParsed || !maximumFontSizeParsed) { return null; } // Uses rem for accessible fluid target font scaling. const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSize, { coerceTo: 'rem' }); // Viewport widths defined for fluid typography. Normalize units const maximumViewportWidthParsed = getTypographyValueAndUnit(maximumViewportWidth, { coerceTo: fontSizeUnit }); const minimumViewportWidthParsed = getTypographyValueAndUnit(minimumViewportWidth, { coerceTo: fontSizeUnit }); // Protect against unsupported units. if (!maximumViewportWidthParsed || !minimumViewportWidthParsed || !minimumFontSizeRem) { return null; } // Calculates the linear factor denominator. If it's 0, we cannot calculate a fluid value. const linearDenominator = maximumViewportWidthParsed.value - minimumViewportWidthParsed.value; if (!linearDenominator) { return null; } // Build CSS rule. // Borrowed from https://websemantics.uk/tools/responsive-font-calculator/. const minViewportWidthOffsetValue = roundToPrecision(minimumViewportWidthParsed.value / 100, 3); const viewportWidthOffset = roundToPrecision(minViewportWidthOffsetValue, 3) + fontSizeUnit; const linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / linearDenominator); const linearFactorScaled = roundToPrecision((linearFactor || 1) * scaleFactor, 3); const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewportWidthOffset}) * ${linearFactorScaled})`; return `clamp(${minimumFontSize}, ${fluidTargetFontSize}, ${maximumFontSize})`; } /** * Internal method that checks a string for a unit and value and returns an array consisting of `'value'` and `'unit'`, e.g., [ '42', 'rem' ]. * A raw font size of `value + unit` is expected. If the value is an integer, it will convert to `value + 'px'`. * * @param {string|number} rawValue Raw size value from theme.json. * @param {Object|undefined} options Calculation options. * * @return {{ unit: string, value: number }|null} An object consisting of `'value'` and `'unit'` properties. */ function getTypographyValueAndUnit(rawValue, options = {}) { if (typeof rawValue !== 'string' && typeof rawValue !== 'number') { return null; } // Converts numeric values to pixel values by default. if (isFinite(rawValue)) { rawValue = `${rawValue}px`; } const { coerceTo, rootSizeValue, acceptableUnits } = { coerceTo: '', // Default browser font size. Later we could inject some JS to compute this `getComputedStyle( document.querySelector( "html" ) ).fontSize`. rootSizeValue: 16, acceptableUnits: ['rem', 'px', 'em'], ...options }; const acceptableUnitsGroup = acceptableUnits?.join('|'); const regexUnits = new RegExp(`^(\\d*\\.?\\d+)(${acceptableUnitsGroup}){1,1}$`); const matches = rawValue.match(regexUnits); // We need a number value and a unit. if (!matches || matches.length < 3) { return null; } let [, value, unit] = matches; let returnValue = parseFloat(value); if ('px' === coerceTo && ('em' === unit || 'rem' === unit)) { returnValue = returnValue * rootSizeValue; unit = coerceTo; } if ('px' === unit && ('em' === coerceTo || 'rem' === coerceTo)) { returnValue = returnValue / rootSizeValue; unit = coerceTo; } /* * No calculation is required if swapping between em and rem yet, * since we assume a root size value. Later we might like to differentiate between * :root font size (rem) and parent element font size (em) relativity. */ if (('em' === coerceTo || 'rem' === coerceTo) && ('em' === unit || 'rem' === unit)) { unit = coerceTo; } return { value: roundToPrecision(returnValue, 3), unit }; } /** * Returns a value rounded to defined precision. * Returns `undefined` if the value is not a valid finite number. * * @param {number} value Raw value. * @param {number} digits The number of digits to appear after the decimal point * * @return {number|undefined} Value rounded to standard precision. */ function roundToPrecision(value, digits = 3) { const base = Math.pow(10, digits); return Number.isFinite(value) ? parseFloat(Math.round(value * base) / base) : undefined; } ;// ./node_modules/@wordpress/block-editor/build-module/utils/format-font-style.js /** * WordPress dependencies */ /** * Formats font styles to human readable names. * * @param {string} fontStyle font style string * @return {Object} new object with formatted font style */ function formatFontStyle(fontStyle) { if (!fontStyle) { return {}; } if (typeof fontStyle === 'object') { return fontStyle; } let name; switch (fontStyle) { case 'normal': name = (0,external_wp_i18n_namespaceObject._x)('Regular', 'font style'); break; case 'italic': name = (0,external_wp_i18n_namespaceObject._x)('Italic', 'font style'); break; case 'oblique': name = (0,external_wp_i18n_namespaceObject._x)('Oblique', 'font style'); break; default: name = fontStyle; break; } return { name, value: fontStyle }; } ;// ./node_modules/@wordpress/block-editor/build-module/utils/format-font-weight.js /** * WordPress dependencies */ /** * Formats font weights to human readable names. * * @param {string} fontWeight font weight string * @return {Object} new object with formatted font weight */ function formatFontWeight(fontWeight) { if (!fontWeight) { return {}; } if (typeof fontWeight === 'object') { return fontWeight; } let name; switch (fontWeight) { case 'normal': case '400': name = (0,external_wp_i18n_namespaceObject._x)('Regular', 'font weight'); break; case 'bold': case '700': name = (0,external_wp_i18n_namespaceObject._x)('Bold', 'font weight'); break; case '100': name = (0,external_wp_i18n_namespaceObject._x)('Thin', 'font weight'); break; case '200': name = (0,external_wp_i18n_namespaceObject._x)('Extra Light', 'font weight'); break; case '300': name = (0,external_wp_i18n_namespaceObject._x)('Light', 'font weight'); break; case '500': name = (0,external_wp_i18n_namespaceObject._x)('Medium', 'font weight'); break; case '600': name = (0,external_wp_i18n_namespaceObject._x)('Semi Bold', 'font weight'); break; case '800': name = (0,external_wp_i18n_namespaceObject._x)('Extra Bold', 'font weight'); break; case '900': name = (0,external_wp_i18n_namespaceObject._x)('Black', 'font weight'); break; case '1000': name = (0,external_wp_i18n_namespaceObject._x)('Extra Black', 'font weight'); break; default: name = fontWeight; break; } return { name, value: fontWeight }; } ;// ./node_modules/@wordpress/block-editor/build-module/utils/get-font-styles-and-weights.js /** * WordPress dependencies */ /** * Internal dependencies */ const FONT_STYLES = [{ name: (0,external_wp_i18n_namespaceObject._x)('Regular', 'font style'), value: 'normal' }, { name: (0,external_wp_i18n_namespaceObject._x)('Italic', 'font style'), value: 'italic' }]; const FONT_WEIGHTS = [{ name: (0,external_wp_i18n_namespaceObject._x)('Thin', 'font weight'), value: '100' }, { name: (0,external_wp_i18n_namespaceObject._x)('Extra Light', 'font weight'), value: '200' }, { name: (0,external_wp_i18n_namespaceObject._x)('Light', 'font weight'), value: '300' }, { name: (0,external_wp_i18n_namespaceObject._x)('Regular', 'font weight'), value: '400' }, { name: (0,external_wp_i18n_namespaceObject._x)('Medium', 'font weight'), value: '500' }, { name: (0,external_wp_i18n_namespaceObject._x)('Semi Bold', 'font weight'), value: '600' }, { name: (0,external_wp_i18n_namespaceObject._x)('Bold', 'font weight'), value: '700' }, { name: (0,external_wp_i18n_namespaceObject._x)('Extra Bold', 'font weight'), value: '800' }, { name: (0,external_wp_i18n_namespaceObject._x)('Black', 'font weight'), value: '900' }, { name: (0,external_wp_i18n_namespaceObject._x)('Extra Black', 'font weight'), value: '1000' }]; /** * Builds a list of font style and weight options based on font family faces. * Defaults to the standard font styles and weights if no font family faces are provided. * * @param {Array} fontFamilyFaces font family faces array * @return {Object} new object with combined and separated font style and weight properties */ function getFontStylesAndWeights(fontFamilyFaces) { let fontStyles = []; let fontWeights = []; const combinedStyleAndWeightOptions = []; const isSystemFont = !fontFamilyFaces || fontFamilyFaces?.length === 0; let isVariableFont = false; fontFamilyFaces?.forEach(face => { // Check for variable font by looking for a space in the font weight value. e.g. "100 900" if ('string' === typeof face.fontWeight && /\s/.test(face.fontWeight.trim())) { isVariableFont = true; // Find font weight start and end values. let [startValue, endValue] = face.fontWeight.split(' '); startValue = parseInt(startValue.slice(0, 1)); if (endValue === '1000') { endValue = 10; } else { endValue = parseInt(endValue.slice(0, 1)); } // Create font weight options for available variable weights. for (let i = startValue; i <= endValue; i++) { const fontWeightValue = `${i.toString()}00`; if (!fontWeights.some(weight => weight.value === fontWeightValue)) { fontWeights.push(formatFontWeight(fontWeightValue)); } } } // Format font style and weight values. const fontWeight = formatFontWeight('number' === typeof face.fontWeight ? face.fontWeight.toString() : face.fontWeight); const fontStyle = formatFontStyle(face.fontStyle); // Create font style and font weight lists without duplicates. if (fontStyle && Object.keys(fontStyle).length) { if (!fontStyles.some(style => style.value === fontStyle.value)) { fontStyles.push(fontStyle); } } if (fontWeight && Object.keys(fontWeight).length) { if (!fontWeights.some(weight => weight.value === fontWeight.value)) { if (!isVariableFont) { fontWeights.push(fontWeight); } } } }); // If there is no font weight of 600 or above, then include faux bold as an option. if (!fontWeights.some(weight => weight.value >= '600')) { fontWeights.push({ name: (0,external_wp_i18n_namespaceObject._x)('Bold', 'font weight'), value: '700' }); } // If there is no italic font style, then include faux italic as an option. if (!fontStyles.some(style => style.value === 'italic')) { fontStyles.push({ name: (0,external_wp_i18n_namespaceObject._x)('Italic', 'font style'), value: 'italic' }); } // Use default font styles and weights for system fonts. if (isSystemFont) { fontStyles = FONT_STYLES; fontWeights = FONT_WEIGHTS; } // Use default styles and weights if there are no available styles or weights from the provided font faces. fontStyles = fontStyles.length === 0 ? FONT_STYLES : fontStyles; fontWeights = fontWeights.length === 0 ? FONT_WEIGHTS : fontWeights; // Generate combined font style and weight options for available fonts. fontStyles.forEach(({ name: styleName, value: styleValue }) => { fontWeights.forEach(({ name: weightName, value: weightValue }) => { const optionName = styleValue === 'normal' ? weightName : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Font weight name. 2: Font style name. */ (0,external_wp_i18n_namespaceObject._x)('%1$s %2$s', 'font'), weightName, styleName); combinedStyleAndWeightOptions.push({ key: `${styleValue}-${weightValue}`, name: optionName, style: { fontStyle: styleValue, fontWeight: weightValue } }); }); }); return { fontStyles, fontWeights, combinedStyleAndWeightOptions, isSystemFont, isVariableFont }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/typography-utils.js /** * The fluid utilities must match the backend equivalent. * See: gutenberg_get_typography_font_size_value() in lib/block-supports/typography.php * --------------------------------------------------------------- */ /** * Internal dependencies */ /** * @typedef {Object} FluidPreset * @property {string|undefined} max A maximum font size value. * @property {?string|undefined} min A minimum font size value. */ /** * @typedef {Object} Preset * @property {?string|?number} size A default font size. * @property {string} name A font size name, displayed in the UI. * @property {string} slug A font size slug * @property {boolean|FluidPreset|undefined} fluid Specifies the minimum and maximum font size value of a fluid font size. */ /** * @typedef {Object} TypographySettings * @property {?string} minViewportWidth Minimum viewport size from which type will have fluidity. Optional if size is specified. * @property {?string} maxViewportWidth Maximum size up to which type will have fluidity. Optional if size is specified. * @property {?number} scaleFactor A scale factor to determine how fast a font scales within boundaries. Optional. * @property {?number} minFontSizeFactor How much to scale defaultFontSize by to derive minimumFontSize. Optional. * @property {?string} minFontSize The smallest a calculated font size may be. Optional. */ /** * Returns a font-size value based on a given font-size preset. * Takes into account fluid typography parameters and attempts to return a css formula depending on available, valid values. * * The Core PHP equivalent is wp_get_typography_font_size_value(). * * @param {Preset} preset * @param {Object} settings * @param {boolean|TypographySettings} settings.typography.fluid Whether fluid typography is enabled, and, optionally, fluid font size options. * @param {?Object} settings.typography.layout Layout options. * * @return {string|*} A font-size value or the value of preset.size. */ function getTypographyFontSizeValue(preset, settings) { const { size: defaultSize } = preset; /* * Catch falsy values and 0/'0'. Fluid calculations cannot be performed on `0`. * Also return early when a preset font size explicitly disables fluid typography with `false`. */ if (!defaultSize || '0' === defaultSize || false === preset?.fluid) { return defaultSize; } /* * Return early when fluid typography is disabled in the settings, and there * are no local settings to enable it for the individual preset. * * If this condition isn't met, either the settings or individual preset settings * have enabled fluid typography. */ if (!isFluidTypographyEnabled(settings?.typography) && !isFluidTypographyEnabled(preset)) { return defaultSize; } let fluidTypographySettings = getFluidTypographyOptionsFromSettings(settings); fluidTypographySettings = typeof fluidTypographySettings?.fluid === 'object' ? fluidTypographySettings?.fluid : {}; const fluidFontSizeValue = getComputedFluidTypographyValue({ minimumFontSize: preset?.fluid?.min, maximumFontSize: preset?.fluid?.max, fontSize: defaultSize, minimumFontSizeLimit: fluidTypographySettings?.minFontSize, maximumViewportWidth: fluidTypographySettings?.maxViewportWidth, minimumViewportWidth: fluidTypographySettings?.minViewportWidth }); if (!!fluidFontSizeValue) { return fluidFontSizeValue; } return defaultSize; } function isFluidTypographyEnabled(typographySettings) { const fluidSettings = typographySettings?.fluid; return true === fluidSettings || fluidSettings && typeof fluidSettings === 'object' && Object.keys(fluidSettings).length > 0; } /** * Returns fluid typography settings from theme.json setting object. * * @param {Object} settings Theme.json settings * @param {Object} settings.typography Theme.json typography settings * @param {Object} settings.layout Theme.json layout settings * @return {TypographySettings} Fluid typography settings */ function getFluidTypographyOptionsFromSettings(settings) { const typographySettings = settings?.typography; const layoutSettings = settings?.layout; const defaultMaxViewportWidth = getTypographyValueAndUnit(layoutSettings?.wideSize) ? layoutSettings?.wideSize : null; return isFluidTypographyEnabled(typographySettings) && defaultMaxViewportWidth ? { fluid: { maxViewportWidth: defaultMaxViewportWidth, ...typographySettings.fluid } } : { fluid: typographySettings?.fluid }; } /** * Returns an object of merged font families and the font faces from the selected font family * based on the theme.json settings object and the currently selected font family. * * @param {Object} settings Theme.json settings. * @param {string} selectedFontFamily Decoded font family string. * @return {Object} Merged font families and font faces from the selected font family. */ function getMergedFontFamiliesAndFontFamilyFaces(settings, selectedFontFamily) { var _fontFamilies$find$fo; const fontFamiliesFromSettings = settings?.typography?.fontFamilies; const fontFamilies = ['default', 'theme', 'custom'].flatMap(key => { var _fontFamiliesFromSett; return (_fontFamiliesFromSett = fontFamiliesFromSettings?.[key]) !== null && _fontFamiliesFromSett !== void 0 ? _fontFamiliesFromSett : []; }); const fontFamilyFaces = (_fontFamilies$find$fo = fontFamilies.find(family => family.fontFamily === selectedFontFamily)?.fontFace) !== null && _fontFamilies$find$fo !== void 0 ? _fontFamilies$find$fo : []; return { fontFamilies, fontFamilyFaces }; } /** * Returns the nearest font weight value from the available font weight list based on the new font weight. * The nearest font weight is the one with the smallest difference from the new font weight. * * @param {Array} availableFontWeights Array of available font weights. * @param {string} newFontWeightValue New font weight value. * @return {string} Nearest font weight. */ function findNearestFontWeight(availableFontWeights, newFontWeightValue) { newFontWeightValue = 'number' === typeof newFontWeightValue ? newFontWeightValue.toString() : newFontWeightValue; if (!newFontWeightValue || typeof newFontWeightValue !== 'string') { return ''; } if (!availableFontWeights || availableFontWeights.length === 0) { return newFontWeightValue; } const nearestFontWeight = availableFontWeights?.reduce((nearest, { value: fw }) => { const currentDiff = Math.abs(parseInt(fw) - parseInt(newFontWeightValue)); const nearestDiff = Math.abs(parseInt(nearest) - parseInt(newFontWeightValue)); return currentDiff < nearestDiff ? fw : nearest; }, availableFontWeights[0]?.value); return nearestFontWeight; } /** * Returns the nearest font style based on the new font style. * Defaults to an empty string if the new font style is not valid or available. * * @param {Array} availableFontStyles Array of available font weights. * @param {string} newFontStyleValue New font style value. * @return {string} Nearest font style or an empty string. */ function findNearestFontStyle(availableFontStyles, newFontStyleValue) { if (typeof newFontStyleValue !== 'string' || !newFontStyleValue) { return ''; } const validStyles = ['normal', 'italic', 'oblique']; if (!validStyles.includes(newFontStyleValue)) { return ''; } if (!availableFontStyles || availableFontStyles.length === 0 || availableFontStyles.find(style => style.value === newFontStyleValue)) { return newFontStyleValue; } if (newFontStyleValue === 'oblique' && !availableFontStyles.find(style => style.value === 'oblique')) { return 'italic'; } return ''; } /** * Returns the nearest font style and weight based on the available font family faces and the new font style and weight. * * @param {Array} fontFamilyFaces Array of available font family faces. * @param {string} fontStyle New font style. Defaults to previous value. * @param {string} fontWeight New font weight. Defaults to previous value. * @return {Object} Nearest font style and font weight. */ function findNearestStyleAndWeight(fontFamilyFaces, fontStyle, fontWeight) { let nearestFontStyle = fontStyle; let nearestFontWeight = fontWeight; const { fontStyles, fontWeights, combinedStyleAndWeightOptions } = getFontStylesAndWeights(fontFamilyFaces); // Check if the new font style and weight are available in the font family faces. const hasFontStyle = fontStyles?.some(({ value: fs }) => fs === fontStyle); const hasFontWeight = fontWeights?.some(({ value: fw }) => fw?.toString() === fontWeight?.toString()); if (!hasFontStyle) { /* * Default to italic if oblique is not available. * Or find the nearest font style based on the nearest font weight. */ nearestFontStyle = fontStyle ? findNearestFontStyle(fontStyles, fontStyle) : combinedStyleAndWeightOptions?.find(option => option.style.fontWeight === findNearestFontWeight(fontWeights, fontWeight))?.style?.fontStyle; } if (!hasFontWeight) { /* * Find the nearest font weight based on available weights. * Or find the nearest font weight based on the nearest font style. */ nearestFontWeight = fontWeight ? findNearestFontWeight(fontWeights, fontWeight) : combinedStyleAndWeightOptions?.find(option => option.style.fontStyle === (nearestFontStyle || fontStyle))?.style?.fontWeight; } return { nearestFontStyle, nearestFontWeight }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/utils.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /* Supporting data. */ const ROOT_BLOCK_SELECTOR = 'body'; const ROOT_CSS_PROPERTIES_SELECTOR = ':root'; const PRESET_METADATA = [{ path: ['color', 'palette'], valueKey: 'color', cssVarInfix: 'color', classes: [{ classSuffix: 'color', propertyName: 'color' }, { classSuffix: 'background-color', propertyName: 'background-color' }, { classSuffix: 'border-color', propertyName: 'border-color' }] }, { path: ['color', 'gradients'], valueKey: 'gradient', cssVarInfix: 'gradient', classes: [{ classSuffix: 'gradient-background', propertyName: 'background' }] }, { path: ['color', 'duotone'], valueKey: 'colors', cssVarInfix: 'duotone', valueFunc: ({ slug }) => `url( '#wp-duotone-${slug}' )`, classes: [] }, { path: ['shadow', 'presets'], valueKey: 'shadow', cssVarInfix: 'shadow', classes: [] }, { path: ['typography', 'fontSizes'], valueFunc: (preset, settings) => getTypographyFontSizeValue(preset, settings), valueKey: 'size', cssVarInfix: 'font-size', classes: [{ classSuffix: 'font-size', propertyName: 'font-size' }] }, { path: ['typography', 'fontFamilies'], valueKey: 'fontFamily', cssVarInfix: 'font-family', classes: [{ classSuffix: 'font-family', propertyName: 'font-family' }] }, { path: ['spacing', 'spacingSizes'], valueKey: 'size', cssVarInfix: 'spacing', valueFunc: ({ size }) => size, classes: [] }]; const STYLE_PATH_TO_CSS_VAR_INFIX = { 'color.background': 'color', 'color.text': 'color', 'filter.duotone': 'duotone', 'elements.link.color.text': 'color', 'elements.link.:hover.color.text': 'color', 'elements.link.typography.fontFamily': 'font-family', 'elements.link.typography.fontSize': 'font-size', 'elements.button.color.text': 'color', 'elements.button.color.background': 'color', 'elements.caption.color.text': 'color', 'elements.button.typography.fontFamily': 'font-family', 'elements.button.typography.fontSize': 'font-size', 'elements.heading.color': 'color', 'elements.heading.color.background': 'color', 'elements.heading.typography.fontFamily': 'font-family', 'elements.heading.gradient': 'gradient', 'elements.heading.color.gradient': 'gradient', 'elements.h1.color': 'color', 'elements.h1.color.background': 'color', 'elements.h1.typography.fontFamily': 'font-family', 'elements.h1.color.gradient': 'gradient', 'elements.h2.color': 'color', 'elements.h2.color.background': 'color', 'elements.h2.typography.fontFamily': 'font-family', 'elements.h2.color.gradient': 'gradient', 'elements.h3.color': 'color', 'elements.h3.color.background': 'color', 'elements.h3.typography.fontFamily': 'font-family', 'elements.h3.color.gradient': 'gradient', 'elements.h4.color': 'color', 'elements.h4.color.background': 'color', 'elements.h4.typography.fontFamily': 'font-family', 'elements.h4.color.gradient': 'gradient', 'elements.h5.color': 'color', 'elements.h5.color.background': 'color', 'elements.h5.typography.fontFamily': 'font-family', 'elements.h5.color.gradient': 'gradient', 'elements.h6.color': 'color', 'elements.h6.color.background': 'color', 'elements.h6.typography.fontFamily': 'font-family', 'elements.h6.color.gradient': 'gradient', 'color.gradient': 'gradient', shadow: 'shadow', 'typography.fontSize': 'font-size', 'typography.fontFamily': 'font-family' }; // A static list of block attributes that store global style preset slugs. const STYLE_PATH_TO_PRESET_BLOCK_ATTRIBUTE = { 'color.background': 'backgroundColor', 'color.text': 'textColor', 'color.gradient': 'gradient', 'typography.fontSize': 'fontSize', 'typography.fontFamily': 'fontFamily' }; function useToolsPanelDropdownMenuProps() { const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); return !isMobile ? { popoverProps: { placement: 'left-start', // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) offset: 259 } } : {}; } function findInPresetsBy(features, blockName, presetPath, presetProperty, presetValueValue) { // Block presets take priority above root level presets. const orderedPresetsByOrigin = [getValueFromObjectPath(features, ['blocks', blockName, ...presetPath]), getValueFromObjectPath(features, presetPath)]; for (const presetByOrigin of orderedPresetsByOrigin) { if (presetByOrigin) { // Preset origins ordered by priority. const origins = ['custom', 'theme', 'default']; for (const origin of origins) { const presets = presetByOrigin[origin]; if (presets) { const presetObject = presets.find(preset => preset[presetProperty] === presetValueValue); if (presetObject) { if (presetProperty === 'slug') { return presetObject; } // If there is a highest priority preset with the same slug but different value the preset we found was overwritten and should be ignored. const highestPresetObjectWithSameSlug = findInPresetsBy(features, blockName, presetPath, 'slug', presetObject.slug); if (highestPresetObjectWithSameSlug[presetProperty] === presetObject[presetProperty]) { return presetObject; } return undefined; } } } } } } function getPresetVariableFromValue(features, blockName, variableStylePath, presetPropertyValue) { if (!presetPropertyValue) { return presetPropertyValue; } const cssVarInfix = STYLE_PATH_TO_CSS_VAR_INFIX[variableStylePath]; const metadata = PRESET_METADATA.find(data => data.cssVarInfix === cssVarInfix); if (!metadata) { // The property doesn't have preset data // so the value should be returned as it is. return presetPropertyValue; } const { valueKey, path } = metadata; const presetObject = findInPresetsBy(features, blockName, path, valueKey, presetPropertyValue); if (!presetObject) { // Value wasn't found in the presets, // so it must be a custom value. return presetPropertyValue; } return `var:preset|${cssVarInfix}|${presetObject.slug}`; } function getValueFromPresetVariable(features, blockName, variable, [presetType, slug]) { const metadata = PRESET_METADATA.find(data => data.cssVarInfix === presetType); if (!metadata) { return variable; } const presetObject = findInPresetsBy(features.settings, blockName, metadata.path, 'slug', slug); if (presetObject) { const { valueKey } = metadata; const result = presetObject[valueKey]; return getValueFromVariable(features, blockName, result); } return variable; } function getValueFromCustomVariable(features, blockName, variable, path) { var _getValueFromObjectPa; const result = (_getValueFromObjectPa = getValueFromObjectPath(features.settings, ['blocks', blockName, 'custom', ...path])) !== null && _getValueFromObjectPa !== void 0 ? _getValueFromObjectPa : getValueFromObjectPath(features.settings, ['custom', ...path]); if (!result) { return variable; } // A variable may reference another variable so we need recursion until we find the value. return getValueFromVariable(features, blockName, result); } /** * Attempts to fetch the value of a theme.json CSS variable. * * @param {Object} features GlobalStylesContext config, e.g., user, base or merged. Represents the theme.json tree. * @param {string} blockName The name of a block as represented in the styles property. E.g., 'root' for root-level, and 'core/${blockName}' for blocks. * @param {string|*} variable An incoming style value. A CSS var value is expected, but it could be any value. * @return {string|*|{ref}} The value of the CSS var, if found. If not found, the passed variable argument. */ function getValueFromVariable(features, blockName, variable) { if (!variable || typeof variable !== 'string') { if (typeof variable?.ref === 'string') { variable = getValueFromObjectPath(features, variable.ref); // Presence of another ref indicates a reference to another dynamic value. // Pointing to another dynamic value is not supported. if (!variable || !!variable?.ref) { return variable; } } else { return variable; } } const USER_VALUE_PREFIX = 'var:'; const THEME_VALUE_PREFIX = 'var(--wp--'; const THEME_VALUE_SUFFIX = ')'; let parsedVar; if (variable.startsWith(USER_VALUE_PREFIX)) { parsedVar = variable.slice(USER_VALUE_PREFIX.length).split('|'); } else if (variable.startsWith(THEME_VALUE_PREFIX) && variable.endsWith(THEME_VALUE_SUFFIX)) { parsedVar = variable.slice(THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length).split('--'); } else { // We don't know how to parse the value: either is raw of uses complex CSS such as `calc(1px * var(--wp--variable) )` return variable; } const [type, ...path] = parsedVar; if (type === 'preset') { return getValueFromPresetVariable(features, blockName, variable, path); } if (type === 'custom') { return getValueFromCustomVariable(features, blockName, variable, path); } return variable; } /** * Function that scopes a selector with another one. This works a bit like * SCSS nesting except the `&` operator isn't supported. * * @example * ```js * const scope = '.a, .b .c'; * const selector = '> .x, .y'; * const merged = scopeSelector( scope, selector ); * // merged is '.a > .x, .a .y, .b .c > .x, .b .c .y' * ``` * * @param {string} scope Selector to scope to. * @param {string} selector Original selector. * * @return {string} Scoped selector. */ function scopeSelector(scope, selector) { if (!scope || !selector) { return selector; } const scopes = scope.split(','); const selectors = selector.split(','); const selectorsScoped = []; scopes.forEach(outer => { selectors.forEach(inner => { selectorsScoped.push(`${outer.trim()} ${inner.trim()}`); }); }); return selectorsScoped.join(', '); } /** * Scopes a collection of selectors for features and subfeatures. * * @example * ```js * const scope = '.custom-scope'; * const selectors = { * color: '.wp-my-block p', * typography: { fontSize: '.wp-my-block caption' }, * }; * const result = scopeFeatureSelector( scope, selectors ); * // result is { * // color: '.custom-scope .wp-my-block p', * // typography: { fonSize: '.custom-scope .wp-my-block caption' }, * // } * ``` * * @param {string} scope Selector to scope collection of selectors with. * @param {Object} selectors Collection of feature selectors e.g. * * @return {Object|undefined} Scoped collection of feature selectors. */ function scopeFeatureSelectors(scope, selectors) { if (!scope || !selectors) { return; } const featureSelectors = {}; Object.entries(selectors).forEach(([feature, selector]) => { if (typeof selector === 'string') { featureSelectors[feature] = scopeSelector(scope, selector); } if (typeof selector === 'object') { featureSelectors[feature] = {}; Object.entries(selector).forEach(([subfeature, subfeatureSelector]) => { featureSelectors[feature][subfeature] = scopeSelector(scope, subfeatureSelector); }); } }); return featureSelectors; } /** * Appends a sub-selector to an existing one. * * Given the compounded `selector` "h1, h2, h3" * and the `toAppend` selector ".some-class" the result will be * "h1.some-class, h2.some-class, h3.some-class". * * @param {string} selector Original selector. * @param {string} toAppend Selector to append. * * @return {string} The new selector. */ function appendToSelector(selector, toAppend) { if (!selector.includes(',')) { return selector + toAppend; } const selectors = selector.split(','); const newSelectors = selectors.map(sel => sel + toAppend); return newSelectors.join(','); } /** * Compares global style variations according to their styles and settings properties. * * @example * ```js * const globalStyles = { styles: { typography: { fontSize: '10px' } }, settings: {} }; * const variation = { styles: { typography: { fontSize: '10000px' } }, settings: {} }; * const isEqual = areGlobalStyleConfigsEqual( globalStyles, variation ); * // false * ``` * * @param {Object} original A global styles object. * @param {Object} variation A global styles object. * * @return {boolean} Whether `original` and `variation` match. */ function areGlobalStyleConfigsEqual(original, variation) { if (typeof original !== 'object' || typeof variation !== 'object') { return original === variation; } return es6_default()(original?.styles, variation?.styles) && es6_default()(original?.settings, variation?.settings); } /** * Generates the selector for a block style variation by creating the * appropriate CSS class and adding it to the ancestor portion of the block's * selector. * * For example, take the Button block which has a compound selector: * `.wp-block-button .wp-block-button__link`. With a variation named 'custom', * the class `.is-style-custom` should be added to the `.wp-block-button` * ancestor only. * * This function will take into account comma separated and complex selectors. * * @param {string} variation Name for the variation. * @param {string} blockSelector CSS selector for the block. * * @return {string} CSS selector for the block style variation. */ function getBlockStyleVariationSelector(variation, blockSelector) { const variationClass = `.is-style-${variation}`; if (!blockSelector) { return variationClass; } const ancestorRegex = /((?::\([^)]+\))?\s*)([^\s:]+)/; const addVariationClass = (_match, group1, group2) => { return group1 + group2 + variationClass; }; const result = blockSelector.split(',').map(part => part.replace(ancestorRegex, addVariationClass)); return result.join(','); } /** * Looks up a theme file URI based on a relative path. * * @param {string} file A relative path. * @param {Array<Object>} themeFileURIs A collection of absolute theme file URIs and their corresponding file paths. * @return {string} A resolved theme file URI, if one is found in the themeFileURIs collection. */ function getResolvedThemeFilePath(file, themeFileURIs) { if (!file || !themeFileURIs || !Array.isArray(themeFileURIs)) { return file; } const uri = themeFileURIs.find(themeFileUri => themeFileUri?.name === file); if (!uri?.href) { return file; } return uri?.href; } /** * Resolves ref values in theme JSON. * * @param {Object|string} ruleValue A block style value that may contain a reference to a theme.json value. * @param {Object} tree A theme.json object. * @return {*} The resolved value or incoming ruleValue. */ function getResolvedRefValue(ruleValue, tree) { if (!ruleValue || !tree) { return ruleValue; } /* * Where the rule value is an object with a 'ref' property pointing * to a path, this converts that path into the value at that path. * For example: { "ref": "style.color.background" } => "#fff". */ if (typeof ruleValue !== 'string' && ruleValue?.ref) { const resolvedRuleValue = (0,external_wp_styleEngine_namespaceObject.getCSSValueFromRawStyle)(getValueFromObjectPath(tree, ruleValue.ref)); /* * Presence of another ref indicates a reference to another dynamic value. * Pointing to another dynamic value is not supported. */ if (resolvedRuleValue?.ref) { return undefined; } if (resolvedRuleValue === undefined) { return ruleValue; } return resolvedRuleValue; } return ruleValue; } /** * Resolves ref and relative path values in theme JSON. * * @param {Object|string} ruleValue A block style value that may contain a reference to a theme.json value. * @param {Object} tree A theme.json object. * @return {*} The resolved value or incoming ruleValue. */ function getResolvedValue(ruleValue, tree) { if (!ruleValue || !tree) { return ruleValue; } // Resolve ref values. const resolvedValue = getResolvedRefValue(ruleValue, tree); // Resolve relative paths. if (resolvedValue?.url) { resolvedValue.url = getResolvedThemeFilePath(resolvedValue.url, tree?._links?.['wp:theme-file']); } return resolvedValue; } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/context.js /** * WordPress dependencies */ const DEFAULT_GLOBAL_STYLES_CONTEXT = { user: {}, base: {}, merged: {}, setUserConfig: () => {} }; const GlobalStylesContext = (0,external_wp_element_namespaceObject.createContext)(DEFAULT_GLOBAL_STYLES_CONTEXT); ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/hooks.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const EMPTY_CONFIG = { settings: {}, styles: {} }; const VALID_SETTINGS = ['appearanceTools', 'useRootPaddingAwareAlignments', 'background.backgroundImage', 'background.backgroundRepeat', 'background.backgroundSize', 'background.backgroundPosition', 'border.color', 'border.radius', 'border.style', 'border.width', 'shadow.presets', 'shadow.defaultPresets', 'color.background', 'color.button', 'color.caption', 'color.custom', 'color.customDuotone', 'color.customGradient', 'color.defaultDuotone', 'color.defaultGradients', 'color.defaultPalette', 'color.duotone', 'color.gradients', 'color.heading', 'color.link', 'color.palette', 'color.text', 'custom', 'dimensions.aspectRatio', 'dimensions.minHeight', 'layout.contentSize', 'layout.definitions', 'layout.wideSize', 'lightbox.enabled', 'lightbox.allowEditing', 'position.fixed', 'position.sticky', 'spacing.customSpacingSize', 'spacing.defaultSpacingSizes', 'spacing.spacingSizes', 'spacing.spacingScale', 'spacing.blockGap', 'spacing.margin', 'spacing.padding', 'spacing.units', 'typography.fluid', 'typography.customFontSize', 'typography.defaultFontSizes', 'typography.dropCap', 'typography.fontFamilies', 'typography.fontSizes', 'typography.fontStyle', 'typography.fontWeight', 'typography.letterSpacing', 'typography.lineHeight', 'typography.textAlign', 'typography.textColumns', 'typography.textDecoration', 'typography.textTransform', 'typography.writingMode']; const useGlobalStylesReset = () => { const { user, setUserConfig } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext); const config = { settings: user.settings, styles: user.styles }; const canReset = !!config && !es6_default()(config, EMPTY_CONFIG); return [canReset, (0,external_wp_element_namespaceObject.useCallback)(() => setUserConfig(EMPTY_CONFIG), [setUserConfig])]; }; function useGlobalSetting(propertyPath, blockName, source = 'all') { const { setUserConfig, ...configs } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext); const appendedBlockPath = blockName ? '.blocks.' + blockName : ''; const appendedPropertyPath = propertyPath ? '.' + propertyPath : ''; const contextualPath = `settings${appendedBlockPath}${appendedPropertyPath}`; const globalPath = `settings${appendedPropertyPath}`; const sourceKey = source === 'all' ? 'merged' : source; const settingValue = (0,external_wp_element_namespaceObject.useMemo)(() => { const configToUse = configs[sourceKey]; if (!configToUse) { throw 'Unsupported source'; } if (propertyPath) { var _getValueFromObjectPa; return (_getValueFromObjectPa = getValueFromObjectPath(configToUse, contextualPath)) !== null && _getValueFromObjectPa !== void 0 ? _getValueFromObjectPa : getValueFromObjectPath(configToUse, globalPath); } let result = {}; VALID_SETTINGS.forEach(setting => { var _getValueFromObjectPa2; const value = (_getValueFromObjectPa2 = getValueFromObjectPath(configToUse, `settings${appendedBlockPath}.${setting}`)) !== null && _getValueFromObjectPa2 !== void 0 ? _getValueFromObjectPa2 : getValueFromObjectPath(configToUse, `settings.${setting}`); if (value !== undefined) { result = setImmutably(result, setting.split('.'), value); } }); return result; }, [configs, sourceKey, propertyPath, contextualPath, globalPath, appendedBlockPath]); const setSetting = newValue => { setUserConfig(currentConfig => setImmutably(currentConfig, contextualPath.split('.'), newValue)); }; return [settingValue, setSetting]; } function useGlobalStyle(path, blockName, source = 'all', { shouldDecodeEncode = true } = {}) { const { merged: mergedConfig, base: baseConfig, user: userConfig, setUserConfig } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext); const appendedPath = path ? '.' + path : ''; const finalPath = !blockName ? `styles${appendedPath}` : `styles.blocks.${blockName}${appendedPath}`; const setStyle = newValue => { setUserConfig(currentConfig => setImmutably(currentConfig, finalPath.split('.'), shouldDecodeEncode ? getPresetVariableFromValue(mergedConfig.settings, blockName, path, newValue) : newValue)); }; let rawResult, result; switch (source) { case 'all': rawResult = getValueFromObjectPath(mergedConfig, finalPath); result = shouldDecodeEncode ? getValueFromVariable(mergedConfig, blockName, rawResult) : rawResult; break; case 'user': rawResult = getValueFromObjectPath(userConfig, finalPath); result = shouldDecodeEncode ? getValueFromVariable(mergedConfig, blockName, rawResult) : rawResult; break; case 'base': rawResult = getValueFromObjectPath(baseConfig, finalPath); result = shouldDecodeEncode ? getValueFromVariable(baseConfig, blockName, rawResult) : rawResult; break; default: throw 'Unsupported source'; } return [result, setStyle]; } /** * React hook that overrides a global settings object with block and element specific settings. * * @param {Object} parentSettings Settings object. * @param {blockName?} blockName Block name. * @param {element?} element Element name. * * @return {Object} Merge of settings and supports. */ function useSettingsForBlockElement(parentSettings, blockName, element) { const { supportedStyles, supports } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { supportedStyles: unlock(select(external_wp_blocks_namespaceObject.store)).getSupportedStyles(blockName, element), supports: select(external_wp_blocks_namespaceObject.store).getBlockType(blockName)?.supports }; }, [blockName, element]); return (0,external_wp_element_namespaceObject.useMemo)(() => { const updatedSettings = { ...parentSettings }; if (!supportedStyles.includes('fontSize')) { updatedSettings.typography = { ...updatedSettings.typography, fontSizes: {}, customFontSize: false, defaultFontSizes: false }; } if (!supportedStyles.includes('fontFamily')) { updatedSettings.typography = { ...updatedSettings.typography, fontFamilies: {} }; } updatedSettings.color = { ...updatedSettings.color, text: updatedSettings.color?.text && supportedStyles.includes('color'), background: updatedSettings.color?.background && (supportedStyles.includes('background') || supportedStyles.includes('backgroundColor')), button: updatedSettings.color?.button && supportedStyles.includes('buttonColor'), heading: updatedSettings.color?.heading && supportedStyles.includes('headingColor'), link: updatedSettings.color?.link && supportedStyles.includes('linkColor'), caption: updatedSettings.color?.caption && supportedStyles.includes('captionColor') }; // Some blocks can enable background colors but disable gradients. if (!supportedStyles.includes('background')) { updatedSettings.color.gradients = []; updatedSettings.color.customGradient = false; } // If filters are not supported by the block/element, disable duotone. if (!supportedStyles.includes('filter')) { updatedSettings.color.defaultDuotone = false; updatedSettings.color.customDuotone = false; } ['lineHeight', 'fontStyle', 'fontWeight', 'letterSpacing', 'textAlign', 'textTransform', 'textDecoration', 'writingMode'].forEach(key => { if (!supportedStyles.includes(key)) { updatedSettings.typography = { ...updatedSettings.typography, [key]: false }; } }); // The column-count style is named text column to reduce confusion with // the columns block and manage expectations from the support. // See: https://github.com/WordPress/gutenberg/pull/33587 if (!supportedStyles.includes('columnCount')) { updatedSettings.typography = { ...updatedSettings.typography, textColumns: false }; } ['contentSize', 'wideSize'].forEach(key => { if (!supportedStyles.includes(key)) { updatedSettings.layout = { ...updatedSettings.layout, [key]: false }; } }); ['padding', 'margin', 'blockGap'].forEach(key => { if (!supportedStyles.includes(key)) { updatedSettings.spacing = { ...updatedSettings.spacing, [key]: false }; } const sides = Array.isArray(supports?.spacing?.[key]) ? supports?.spacing?.[key] : supports?.spacing?.[key]?.sides; // Check if spacing type is supported before adding sides. if (sides?.length && updatedSettings.spacing?.[key]) { updatedSettings.spacing = { ...updatedSettings.spacing, [key]: { ...updatedSettings.spacing?.[key], sides } }; } }); ['aspectRatio', 'minHeight'].forEach(key => { if (!supportedStyles.includes(key)) { updatedSettings.dimensions = { ...updatedSettings.dimensions, [key]: false }; } }); ['radius', 'color', 'style', 'width'].forEach(key => { if (!supportedStyles.includes('border' + key.charAt(0).toUpperCase() + key.slice(1))) { updatedSettings.border = { ...updatedSettings.border, [key]: false }; } }); ['backgroundImage', 'backgroundSize'].forEach(key => { if (!supportedStyles.includes(key)) { updatedSettings.background = { ...updatedSettings.background, [key]: false }; } }); updatedSettings.shadow = supportedStyles.includes('shadow') ? updatedSettings.shadow : false; // Text alignment is only available for blocks. if (element) { updatedSettings.typography.textAlign = false; } return updatedSettings; }, [parentSettings, supportedStyles, supports, element]); } function useColorsPerOrigin(settings) { const customColors = settings?.color?.palette?.custom; const themeColors = settings?.color?.palette?.theme; const defaultColors = settings?.color?.palette?.default; const shouldDisplayDefaultColors = settings?.color?.defaultPalette; return (0,external_wp_element_namespaceObject.useMemo)(() => { const result = []; if (themeColors && themeColors.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'), colors: themeColors }); } if (shouldDisplayDefaultColors && defaultColors && defaultColors.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'), colors: defaultColors }); } if (customColors && customColors.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette is created by the user.'), colors: customColors }); } return result; }, [customColors, themeColors, defaultColors, shouldDisplayDefaultColors]); } function useGradientsPerOrigin(settings) { const customGradients = settings?.color?.gradients?.custom; const themeGradients = settings?.color?.gradients?.theme; const defaultGradients = settings?.color?.gradients?.default; const shouldDisplayDefaultGradients = settings?.color?.defaultGradients; return (0,external_wp_element_namespaceObject.useMemo)(() => { const result = []; if (themeGradients && themeGradients.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'), gradients: themeGradients }); } if (shouldDisplayDefaultGradients && defaultGradients && defaultGradients.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'), gradients: defaultGradients }); } if (customGradients && customGradients.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette is created by the user.'), gradients: customGradients }); } return result; }, [customGradients, themeGradients, defaultGradients, shouldDisplayDefaultGradients]); } ;// ./node_modules/clsx/dist/clsx.mjs function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/utils.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * External dependencies */ /** * Removed falsy values from nested object. * * @param {*} object * @return {*} Object cleaned from falsy values */ const utils_cleanEmptyObject = object => { if (object === null || typeof object !== 'object' || Array.isArray(object)) { return object; } const cleanedNestedObjects = Object.entries(object).map(([key, value]) => [key, utils_cleanEmptyObject(value)]).filter(([, value]) => value !== undefined); return !cleanedNestedObjects.length ? undefined : Object.fromEntries(cleanedNestedObjects); }; function transformStyles(activeSupports, migrationPaths, result, source, index, results) { // If there are no active supports return early. if (Object.values(activeSupports !== null && activeSupports !== void 0 ? activeSupports : {}).every(isActive => !isActive)) { return result; } // If the condition verifies we are probably in the presence of a wrapping transform // e.g: nesting paragraphs in a group or columns and in that case the styles should not be transformed. if (results.length === 1 && result.innerBlocks.length === source.length) { return result; } // For cases where we have a transform from one block to multiple blocks // or multiple blocks to one block we apply the styles of the first source block // to the result(s). let referenceBlockAttributes = source[0]?.attributes; // If we are in presence of transform between more than one block in the source // that has more than one block in the result // we apply the styles on source N to the result N, // if source N does not exists we do nothing. if (results.length > 1 && source.length > 1) { if (source[index]) { referenceBlockAttributes = source[index]?.attributes; } else { return result; } } let returnBlock = result; Object.entries(activeSupports).forEach(([support, isActive]) => { if (isActive) { migrationPaths[support].forEach(path => { const styleValue = getValueFromObjectPath(referenceBlockAttributes, path); if (styleValue) { returnBlock = { ...returnBlock, attributes: setImmutably(returnBlock.attributes, path, styleValue) }; } }); } }); return returnBlock; } /** * Check whether serialization of specific block support feature or set should * be skipped. * * @param {string|Object} blockNameOrType Block name or block type object. * @param {string} featureSet Name of block support feature set. * @param {string} feature Name of the individual feature to check. * * @return {boolean} Whether serialization should occur. */ function shouldSkipSerialization(blockNameOrType, featureSet, feature) { const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockNameOrType, featureSet); const skipSerialization = support?.__experimentalSkipSerialization; if (Array.isArray(skipSerialization)) { return skipSerialization.includes(feature); } return skipSerialization; } const pendingStyleOverrides = new WeakMap(); /** * Override a block editor settings style. Leave the ID blank to create a new * style. * * @param {Object} override Override object. * @param {?string} override.id Id of the style override, leave blank to create * a new style. * @param {string} override.css CSS to apply. */ function useStyleOverride({ id, css }) { return usePrivateStyleOverride({ id, css }); } function usePrivateStyleOverride({ id, css, assets, __unstableType, variation, clientId } = {}) { const { setStyleOverride, deleteStyleOverride } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const fallbackId = (0,external_wp_element_namespaceObject.useId)(); (0,external_wp_element_namespaceObject.useEffect)(() => { // Unmount if there is CSS and assets are empty. if (!css && !assets) { return; } const _id = id || fallbackId; const override = { id, css, assets, __unstableType, variation, clientId }; // Batch updates to style overrides to avoid triggering cascading renders // for each style override block included in a tree and optimize initial render. if (!pendingStyleOverrides.get(registry)) { pendingStyleOverrides.set(registry, []); } pendingStyleOverrides.get(registry).push([_id, override]); window.queueMicrotask(() => { if (pendingStyleOverrides.get(registry)?.length) { registry.batch(() => { pendingStyleOverrides.get(registry).forEach(args => { setStyleOverride(...args); }); pendingStyleOverrides.set(registry, []); }); } }); return () => { const isPending = pendingStyleOverrides.get(registry)?.find(([currentId]) => currentId === _id); if (isPending) { pendingStyleOverrides.set(registry, pendingStyleOverrides.get(registry).filter(([currentId]) => currentId !== _id)); } else { deleteStyleOverride(_id); } }; }, [id, css, clientId, assets, __unstableType, fallbackId, setStyleOverride, deleteStyleOverride, registry]); } /** * Based on the block and its context, returns an object of all the block settings. * This object can be passed as a prop to all the Styles UI components * (TypographyPanel, DimensionsPanel...). * * @param {string} name Block name. * @param {*} parentLayout Parent layout. * * @return {Object} Settings object. */ function useBlockSettings(name, parentLayout) { const [backgroundImage, backgroundSize, customFontFamilies, defaultFontFamilies, themeFontFamilies, defaultFontSizesEnabled, customFontSizes, defaultFontSizes, themeFontSizes, customFontSize, fontStyle, fontWeight, lineHeight, textAlign, textColumns, textDecoration, writingMode, textTransform, letterSpacing, padding, margin, blockGap, defaultSpacingSizesEnabled, customSpacingSize, userSpacingSizes, defaultSpacingSizes, themeSpacingSizes, units, aspectRatio, minHeight, layout, borderColor, borderRadius, borderStyle, borderWidth, customColorsEnabled, customColors, customDuotone, themeColors, defaultColors, defaultPalette, defaultDuotone, userDuotonePalette, themeDuotonePalette, defaultDuotonePalette, userGradientPalette, themeGradientPalette, defaultGradientPalette, defaultGradients, areCustomGradientsEnabled, isBackgroundEnabled, isLinkEnabled, isTextEnabled, isHeadingEnabled, isButtonEnabled, shadow] = use_settings_useSettings('background.backgroundImage', 'background.backgroundSize', 'typography.fontFamilies.custom', 'typography.fontFamilies.default', 'typography.fontFamilies.theme', 'typography.defaultFontSizes', 'typography.fontSizes.custom', 'typography.fontSizes.default', 'typography.fontSizes.theme', 'typography.customFontSize', 'typography.fontStyle', 'typography.fontWeight', 'typography.lineHeight', 'typography.textAlign', 'typography.textColumns', 'typography.textDecoration', 'typography.writingMode', 'typography.textTransform', 'typography.letterSpacing', 'spacing.padding', 'spacing.margin', 'spacing.blockGap', 'spacing.defaultSpacingSizes', 'spacing.customSpacingSize', 'spacing.spacingSizes.custom', 'spacing.spacingSizes.default', 'spacing.spacingSizes.theme', 'spacing.units', 'dimensions.aspectRatio', 'dimensions.minHeight', 'layout', 'border.color', 'border.radius', 'border.style', 'border.width', 'color.custom', 'color.palette.custom', 'color.customDuotone', 'color.palette.theme', 'color.palette.default', 'color.defaultPalette', 'color.defaultDuotone', 'color.duotone.custom', 'color.duotone.theme', 'color.duotone.default', 'color.gradients.custom', 'color.gradients.theme', 'color.gradients.default', 'color.defaultGradients', 'color.customGradient', 'color.background', 'color.link', 'color.text', 'color.heading', 'color.button', 'shadow'); const rawSettings = (0,external_wp_element_namespaceObject.useMemo)(() => { return { background: { backgroundImage, backgroundSize }, color: { palette: { custom: customColors, theme: themeColors, default: defaultColors }, gradients: { custom: userGradientPalette, theme: themeGradientPalette, default: defaultGradientPalette }, duotone: { custom: userDuotonePalette, theme: themeDuotonePalette, default: defaultDuotonePalette }, defaultGradients, defaultPalette, defaultDuotone, custom: customColorsEnabled, customGradient: areCustomGradientsEnabled, customDuotone, background: isBackgroundEnabled, link: isLinkEnabled, heading: isHeadingEnabled, button: isButtonEnabled, text: isTextEnabled }, typography: { fontFamilies: { custom: customFontFamilies, default: defaultFontFamilies, theme: themeFontFamilies }, fontSizes: { custom: customFontSizes, default: defaultFontSizes, theme: themeFontSizes }, customFontSize, defaultFontSizes: defaultFontSizesEnabled, fontStyle, fontWeight, lineHeight, textAlign, textColumns, textDecoration, textTransform, letterSpacing, writingMode }, spacing: { spacingSizes: { custom: userSpacingSizes, default: defaultSpacingSizes, theme: themeSpacingSizes }, customSpacingSize, defaultSpacingSizes: defaultSpacingSizesEnabled, padding, margin, blockGap, units }, border: { color: borderColor, radius: borderRadius, style: borderStyle, width: borderWidth }, dimensions: { aspectRatio, minHeight }, layout, parentLayout, shadow }; }, [backgroundImage, backgroundSize, customFontFamilies, defaultFontFamilies, themeFontFamilies, defaultFontSizesEnabled, customFontSizes, defaultFontSizes, themeFontSizes, customFontSize, fontStyle, fontWeight, lineHeight, textAlign, textColumns, textDecoration, textTransform, letterSpacing, writingMode, padding, margin, blockGap, defaultSpacingSizesEnabled, customSpacingSize, userSpacingSizes, defaultSpacingSizes, themeSpacingSizes, units, aspectRatio, minHeight, layout, parentLayout, borderColor, borderRadius, borderStyle, borderWidth, customColorsEnabled, customColors, customDuotone, themeColors, defaultColors, defaultPalette, defaultDuotone, userDuotonePalette, themeDuotonePalette, defaultDuotonePalette, userGradientPalette, themeGradientPalette, defaultGradientPalette, defaultGradients, areCustomGradientsEnabled, isBackgroundEnabled, isLinkEnabled, isTextEnabled, isHeadingEnabled, isButtonEnabled, shadow]); return useSettingsForBlockElement(rawSettings, name); } function createBlockEditFilter(features) { // We don't want block controls to re-render when typing inside a block. // `memo` will prevent re-renders unless props change, so only pass the // needed props and not the whole attributes object. features = features.map(settings => { return { ...settings, Edit: (0,external_wp_element_namespaceObject.memo)(settings.edit) }; }); const withBlockEditHooks = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(OriginalBlockEdit => props => { const context = useBlockEditContext(); // CAUTION: code added before this line will be executed for all // blocks, not just those that support the feature! Code added // above this line should be carefully evaluated for its impact on // performance. return [...features.map((feature, i) => { const { Edit, hasSupport, attributeKeys = [], shareWithChildBlocks } = feature; const shouldDisplayControls = context[mayDisplayControlsKey] || context[mayDisplayParentControlsKey] && shareWithChildBlocks; if (!shouldDisplayControls || !hasSupport(props.name)) { return null; } const neededProps = {}; for (const key of attributeKeys) { if (props.attributes[key]) { neededProps[key] = props.attributes[key]; } } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Edit // We can use the index because the array length // is fixed per page load right now. , { name: props.name, isSelected: props.isSelected, clientId: props.clientId, setAttributes: props.setAttributes, __unstableParentLayout: props.__unstableParentLayout // This component is pure, so only pass needed // props!!! , ...neededProps }, i); }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OriginalBlockEdit, { ...props }, "edit")]; }, 'withBlockEditHooks'); (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/hooks', withBlockEditHooks); } function BlockProps({ index, useBlockProps: hook, setAllWrapperProps, ...props }) { const wrapperProps = hook(props); const setWrapperProps = next => setAllWrapperProps(prev => { const nextAll = [...prev]; nextAll[index] = next; return nextAll; }); // Setting state after every render is fine because this component is // pure and will only re-render when needed props change. (0,external_wp_element_namespaceObject.useEffect)(() => { // We could shallow compare the props, but since this component only // changes when needed attributes change, the benefit is probably small. setWrapperProps(wrapperProps); return () => { setWrapperProps(undefined); }; }); return null; } const BlockPropsPure = (0,external_wp_element_namespaceObject.memo)(BlockProps); function createBlockListBlockFilter(features) { const withBlockListBlockHooks = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => { const [allWrapperProps, setAllWrapperProps] = (0,external_wp_element_namespaceObject.useState)(Array(features.length).fill(undefined)); return [...features.map((feature, i) => { const { hasSupport, attributeKeys = [], useBlockProps, isMatch } = feature; const neededProps = {}; for (const key of attributeKeys) { if (props.attributes[key]) { neededProps[key] = props.attributes[key]; } } if ( // Skip rendering if none of the needed attributes are // set. !Object.keys(neededProps).length || !hasSupport(props.name) || isMatch && !isMatch(neededProps)) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockPropsPure // We can use the index because the array length // is fixed per page load right now. , { index: i, useBlockProps: useBlockProps // This component is pure, so we must pass a stable // function reference. , setAllWrapperProps: setAllWrapperProps, name: props.name, clientId: props.clientId // This component is pure, so only pass needed // props!!! , ...neededProps }, i); }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListBlock, { ...props, wrapperProps: allWrapperProps.filter(Boolean).reduce((acc, wrapperProps) => { return { ...acc, ...wrapperProps, className: dist_clsx(acc.className, wrapperProps.className), style: { ...acc.style, ...wrapperProps.style } }; }, props.wrapperProps || {}) }, "edit")]; }, 'withBlockListBlockHooks'); (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/hooks', withBlockListBlockHooks); } function createBlockSaveFilter(features) { function extraPropsFromHooks(props, name, attributes) { return features.reduce((accu, feature) => { const { hasSupport, attributeKeys = [], addSaveProps } = feature; const neededAttributes = {}; for (const key of attributeKeys) { if (attributes[key]) { neededAttributes[key] = attributes[key]; } } if ( // Skip rendering if none of the needed attributes are // set. !Object.keys(neededAttributes).length || !hasSupport(name)) { return accu; } return addSaveProps(accu, name, neededAttributes); }, props); } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/editor/hooks', extraPropsFromHooks, 0); (0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/editor/hooks', props => { // Previously we had a filter deleting the className if it was an empty // string. That filter is no longer running, so now we need to delete it // here. if (props.hasOwnProperty('className') && !props.className) { delete props.className; } return props; }); } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/compat.js /** * WordPress dependencies */ function migrateLightBlockWrapper(settings) { const { apiVersion = 1 } = settings; if (apiVersion < 2 && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'lightBlockWrapper', false)) { settings.apiVersion = 2; } return settings; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/compat/migrateLightBlockWrapper', migrateLightBlockWrapper); ;// external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; ;// ./node_modules/@wordpress/block-editor/build-module/components/block-controls/groups.js /** * WordPress dependencies */ const BlockControlsDefault = (0,external_wp_components_namespaceObject.createSlotFill)('BlockControls'); const BlockControlsBlock = (0,external_wp_components_namespaceObject.createSlotFill)('BlockControlsBlock'); const BlockControlsInline = (0,external_wp_components_namespaceObject.createSlotFill)('BlockFormatControls'); const BlockControlsOther = (0,external_wp_components_namespaceObject.createSlotFill)('BlockControlsOther'); const BlockControlsParent = (0,external_wp_components_namespaceObject.createSlotFill)('BlockControlsParent'); const groups = { default: BlockControlsDefault, block: BlockControlsBlock, inline: BlockControlsInline, other: BlockControlsOther, parent: BlockControlsParent }; /* harmony default export */ const block_controls_groups = (groups); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-controls/hook.js /** * WordPress dependencies */ /** * Internal dependencies */ function useBlockControlsFill(group, shareWithChildBlocks) { const context = useBlockEditContext(); if (context[mayDisplayControlsKey]) { return block_controls_groups[group]?.Fill; } if (context[mayDisplayParentControlsKey] && shareWithChildBlocks) { return block_controls_groups.parent.Fill; } return null; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-controls/fill.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockControlsFill({ group = 'default', controls, children, __experimentalShareWithChildBlocks = false }) { const Fill = useBlockControlsFill(group, __experimentalShareWithChildBlocks); if (!Fill) { return null; } const innerMarkup = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [group === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { controls: controls }), children] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalStyleProvider, { document: document, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, { children: fillProps => { // `fillProps.forwardedContext` is an array of context provider entries, provided by slot, // that should wrap the fill markup. const { forwardedContext = [] } = fillProps; return forwardedContext.reduce((inner, [Provider, props]) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, { ...props, children: inner }), innerMarkup); } }) }); } ;// external ["wp","warning"] const external_wp_warning_namespaceObject = window["wp"]["warning"]; var external_wp_warning_default = /*#__PURE__*/__webpack_require__.n(external_wp_warning_namespaceObject); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-controls/slot.js /** * WordPress dependencies */ /** * Internal dependencies */ const { ComponentsContext } = unlock(external_wp_components_namespaceObject.privateApis); function BlockControlsSlot({ group = 'default', ...props }) { const toolbarState = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolbarContext); const contextState = (0,external_wp_element_namespaceObject.useContext)(ComponentsContext); const fillProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ forwardedContext: [[external_wp_components_namespaceObject.__experimentalToolbarContext.Provider, { value: toolbarState }], [ComponentsContext.Provider, { value: contextState }]] }), [toolbarState, contextState]); const slotFill = block_controls_groups[group]; const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(slotFill.name); if (!slotFill) { true ? external_wp_warning_default()(`Unknown BlockControls group "${group}" provided.`) : 0; return null; } if (!fills?.length) { return null; } const { Slot } = slotFill; const slot = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Slot, { ...props, bubblesVirtually: true, fillProps: fillProps }); if (group === 'default') { return slot; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: slot }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-controls/index.js /** * Internal dependencies */ const BlockControls = BlockControlsFill; BlockControls.Slot = BlockControlsSlot; // This is just here for backward compatibility. const BlockFormatControls = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockControlsFill, { group: "inline", ...props }); }; BlockFormatControls.Slot = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockControlsSlot, { group: "inline", ...props }); }; /* harmony default export */ const block_controls = (BlockControls); ;// ./node_modules/@wordpress/icons/build-module/library/justify-left.js /** * WordPress dependencies */ const justifyLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 9v6h11V9H9zM4 20h1.5V4H4v16z" }) }); /* harmony default export */ const justify_left = (justifyLeft); ;// ./node_modules/@wordpress/icons/build-module/library/justify-center.js /** * WordPress dependencies */ const justifyCenter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.5 15v5H11v-5H4V9h7V4h1.5v5h7v6h-7Z" }) }); /* harmony default export */ const justify_center = (justifyCenter); ;// ./node_modules/@wordpress/icons/build-module/library/justify-right.js /** * WordPress dependencies */ const justifyRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z" }) }); /* harmony default export */ const justify_right = (justifyRight); ;// ./node_modules/@wordpress/icons/build-module/library/justify-space-between.js /** * WordPress dependencies */ const justifySpaceBetween = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z" }) }); /* harmony default export */ const justify_space_between = (justifySpaceBetween); ;// ./node_modules/@wordpress/icons/build-module/library/justify-stretch.js /** * WordPress dependencies */ const justifyStretch = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 4H5.5V20H4V4ZM7 10L17 10V14L7 14V10ZM20 4H18.5V20H20V4Z" }) }); /* harmony default export */ const justify_stretch = (justifyStretch); ;// ./node_modules/@wordpress/icons/build-module/library/arrow-right.js /** * WordPress dependencies */ const arrowRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) }); /* harmony default export */ const arrow_right = (arrowRight); ;// ./node_modules/@wordpress/icons/build-module/library/arrow-down.js /** * WordPress dependencies */ const arrowDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z" }) }); /* harmony default export */ const arrow_down = (arrowDown); ;// ./node_modules/@wordpress/block-editor/build-module/layouts/definitions.js // Layout definitions keyed by layout type. // Provides a common definition of slugs, classnames, base styles, and spacing styles for each layout type. // If making changes or additions to layout definitions, be sure to update the corresponding PHP definitions in // `block-supports/layout.php` so that the server-side and client-side definitions match. const LAYOUT_DEFINITIONS = { default: { name: 'default', slug: 'flow', className: 'is-layout-flow', baseStyles: [{ selector: ' > .alignleft', rules: { float: 'left', 'margin-inline-start': '0', 'margin-inline-end': '2em' } }, { selector: ' > .alignright', rules: { float: 'right', 'margin-inline-start': '2em', 'margin-inline-end': '0' } }, { selector: ' > .aligncenter', rules: { 'margin-left': 'auto !important', 'margin-right': 'auto !important' } }], spacingStyles: [{ selector: ' > :first-child', rules: { 'margin-block-start': '0' } }, { selector: ' > :last-child', rules: { 'margin-block-end': '0' } }, { selector: ' > *', rules: { 'margin-block-start': null, 'margin-block-end': '0' } }] }, constrained: { name: 'constrained', slug: 'constrained', className: 'is-layout-constrained', baseStyles: [{ selector: ' > .alignleft', rules: { float: 'left', 'margin-inline-start': '0', 'margin-inline-end': '2em' } }, { selector: ' > .alignright', rules: { float: 'right', 'margin-inline-start': '2em', 'margin-inline-end': '0' } }, { selector: ' > .aligncenter', rules: { 'margin-left': 'auto !important', 'margin-right': 'auto !important' } }, { selector: ' > :where(:not(.alignleft):not(.alignright):not(.alignfull))', rules: { 'max-width': 'var(--wp--style--global--content-size)', 'margin-left': 'auto !important', 'margin-right': 'auto !important' } }, { selector: ' > .alignwide', rules: { 'max-width': 'var(--wp--style--global--wide-size)' } }], spacingStyles: [{ selector: ' > :first-child', rules: { 'margin-block-start': '0' } }, { selector: ' > :last-child', rules: { 'margin-block-end': '0' } }, { selector: ' > *', rules: { 'margin-block-start': null, 'margin-block-end': '0' } }] }, flex: { name: 'flex', slug: 'flex', className: 'is-layout-flex', displayMode: 'flex', baseStyles: [{ selector: '', rules: { 'flex-wrap': 'wrap', 'align-items': 'center' } }, { selector: ' > :is(*, div)', // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: '0' } }], spacingStyles: [{ selector: '', rules: { gap: null } }] }, grid: { name: 'grid', slug: 'grid', className: 'is-layout-grid', displayMode: 'grid', baseStyles: [{ selector: ' > :is(*, div)', // :is(*, div) instead of just * increases the specificity by 001. rules: { margin: '0' } }], spacingStyles: [{ selector: '', rules: { gap: null } }] } }; ;// ./node_modules/@wordpress/block-editor/build-module/layouts/utils.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Utility to generate the proper CSS selector for layout styles. * * @param {string} selectors CSS selector, also supports multiple comma-separated selectors. * @param {string} append The string to append. * * @return {string} - CSS selector. */ function appendSelectors(selectors, append = '') { return selectors.split(',').map(subselector => `${subselector}${append ? ` ${append}` : ''}`).join(','); } /** * Get generated blockGap CSS rules based on layout definitions provided in theme.json * Falsy values in the layout definition's spacingStyles rules will be swapped out * with the provided `blockGapValue`. * * @param {string} selector The CSS selector to target for the generated rules. * @param {Object} layoutDefinitions Layout definitions object. * @param {string} layoutType The layout type (e.g. `default` or `flex`). * @param {string} blockGapValue The current blockGap value to be applied. * @return {string} The generated CSS rules. */ function getBlockGapCSS(selector, layoutDefinitions = LAYOUT_DEFINITIONS, layoutType, blockGapValue) { let output = ''; if (layoutDefinitions?.[layoutType]?.spacingStyles?.length && blockGapValue) { layoutDefinitions[layoutType].spacingStyles.forEach(gapStyle => { output += `${appendSelectors(selector, gapStyle.selector.trim())} { `; output += Object.entries(gapStyle.rules).map(([cssProperty, value]) => `${cssProperty}: ${value ? value : blockGapValue}`).join('; '); output += '; }'; }); } return output; } /** * Helper method to assign contextual info to clarify * alignment settings. * * Besides checking if `contentSize` and `wideSize` have a * value, we now show this information only if their values * are not a `css var`. This needs to change when parsing * css variables land. * * @see https://github.com/WordPress/gutenberg/pull/34710#issuecomment-918000752 * * @param {Object} layout The layout object. * @return {Object} An object with contextual info per alignment. */ function getAlignmentsInfo(layout) { const { contentSize, wideSize, type = 'default' } = layout; const alignmentInfo = {}; const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%|svw|lvw|dvw|svh|lvh|dvh|vi|svi|lvi|dvi|vb|svb|lvb|dvb|vmin|svmin|lvmin|dvmin|vmax|svmax|lvmax|dvmax)?$/i; if (sizeRegex.test(contentSize) && type === 'constrained') { // translators: %s: container size (i.e. 600px etc) alignmentInfo.none = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Max %s wide'), contentSize); } if (sizeRegex.test(wideSize)) { // translators: %s: container size (i.e. 600px etc) alignmentInfo.wide = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Max %s wide'), wideSize); } return alignmentInfo; } ;// ./node_modules/@wordpress/icons/build-module/library/sides-all.js /** * WordPress dependencies */ const sidesAll = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z" }) }); /* harmony default export */ const sides_all = (sidesAll); ;// ./node_modules/@wordpress/icons/build-module/library/sides-horizontal.js /** * WordPress dependencies */ const sidesHorizontal = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m4.5 7.5v9h1.5v-9z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m18 7.5v9h1.5v-9z" })] }); /* harmony default export */ const sides_horizontal = (sidesHorizontal); ;// ./node_modules/@wordpress/icons/build-module/library/sides-vertical.js /** * WordPress dependencies */ const sidesVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 6h9v-1.5h-9z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 19.5h9v-1.5h-9z" })] }); /* harmony default export */ const sides_vertical = (sidesVertical); ;// ./node_modules/@wordpress/icons/build-module/library/sides-top.js /** * WordPress dependencies */ const sidesTop = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m16.5 6h-9v-1.5h9z" })] }); /* harmony default export */ const sides_top = (sidesTop); ;// ./node_modules/@wordpress/icons/build-module/library/sides-right.js /** * WordPress dependencies */ const sidesRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m18 16.5v-9h1.5v9z" })] }); /* harmony default export */ const sides_right = (sidesRight); ;// ./node_modules/@wordpress/icons/build-module/library/sides-bottom.js /** * WordPress dependencies */ const sidesBottom = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m16.5 19.5h-9v-1.5h9z" })] }); /* harmony default export */ const sides_bottom = (sidesBottom); ;// ./node_modules/@wordpress/icons/build-module/library/sides-left.js /** * WordPress dependencies */ const sidesLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z", style: { opacity: 0.25 } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m4.5 16.5v-9h1.5v9z" })] }); /* harmony default export */ const sides_left = (sidesLeft); ;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/utils.js /** * WordPress dependencies */ const RANGE_CONTROL_MAX_SIZE = 8; const ALL_SIDES = ['top', 'right', 'bottom', 'left']; const DEFAULT_VALUES = { top: undefined, right: undefined, bottom: undefined, left: undefined }; const ICONS = { custom: sides_all, axial: sides_all, horizontal: sides_horizontal, vertical: sides_vertical, top: sides_top, right: sides_right, bottom: sides_bottom, left: sides_left }; const LABELS = { default: (0,external_wp_i18n_namespaceObject.__)('Spacing control'), top: (0,external_wp_i18n_namespaceObject.__)('Top'), bottom: (0,external_wp_i18n_namespaceObject.__)('Bottom'), left: (0,external_wp_i18n_namespaceObject.__)('Left'), right: (0,external_wp_i18n_namespaceObject.__)('Right'), mixed: (0,external_wp_i18n_namespaceObject.__)('Mixed'), vertical: (0,external_wp_i18n_namespaceObject.__)('Vertical'), horizontal: (0,external_wp_i18n_namespaceObject.__)('Horizontal'), axial: (0,external_wp_i18n_namespaceObject.__)('Horizontal & vertical'), custom: (0,external_wp_i18n_namespaceObject.__)('Custom') }; const VIEWS = { axial: 'axial', top: 'top', right: 'right', bottom: 'bottom', left: 'left', custom: 'custom' }; /** * Checks is given value is a spacing preset. * * @param {string} value Value to check * * @return {boolean} Return true if value is string in format var:preset|spacing|. */ function isValueSpacingPreset(value) { if (!value?.includes) { return false; } return value === '0' || value.includes('var:preset|spacing|'); } /** * Converts a spacing preset into a custom value. * * @param {string} value Value to convert * @param {Array} spacingSizes Array of the current spacing preset objects * * @return {string} Mapping of the spacing preset to its equivalent custom value. */ function getCustomValueFromPreset(value, spacingSizes) { if (!isValueSpacingPreset(value)) { return value; } const slug = getSpacingPresetSlug(value); const spacingSize = spacingSizes.find(size => String(size.slug) === slug); return spacingSize?.size; } /** * Converts a custom value to preset value if one can be found. * * Returns value as-is if no match is found. * * @param {string} value Value to convert * @param {Array} spacingSizes Array of the current spacing preset objects * * @return {string} The preset value if it can be found. */ function getPresetValueFromCustomValue(value, spacingSizes) { // Return value as-is if it is undefined or is already a preset, or '0'; if (!value || isValueSpacingPreset(value) || value === '0') { return value; } const spacingMatch = spacingSizes.find(size => String(size.size) === String(value)); if (spacingMatch?.slug) { return `var:preset|spacing|${spacingMatch.slug}`; } return value; } /** * Converts a spacing preset into a custom value. * * @param {string} value Value to convert. * * @return {string | undefined} CSS var string for given spacing preset value. */ function getSpacingPresetCssVar(value) { if (!value) { return; } const slug = value.match(/var:preset\|spacing\|(.+)/); if (!slug) { return value; } return `var(--wp--preset--spacing--${slug[1]})`; } /** * Returns the slug section of the given spacing preset string. * * @param {string} value Value to extract slug from. * * @return {string|undefined} The int value of the slug from given spacing preset. */ function getSpacingPresetSlug(value) { if (!value) { return; } if (value === '0' || value === 'default') { return value; } const slug = value.match(/var:preset\|spacing\|(.+)/); return slug ? slug[1] : undefined; } /** * Converts spacing preset value into a Range component value . * * @param {string} presetValue Value to convert to Range value. * @param {Array} spacingSizes Array of current spacing preset value objects. * * @return {number} The int value for use in Range control. */ function getSliderValueFromPreset(presetValue, spacingSizes) { if (presetValue === undefined) { return 0; } const slug = parseFloat(presetValue, 10) === 0 ? '0' : getSpacingPresetSlug(presetValue); const sliderValue = spacingSizes.findIndex(spacingSize => { return String(spacingSize.slug) === slug; }); // Returning NaN rather than undefined as undefined makes range control thumb sit in center return sliderValue !== -1 ? sliderValue : NaN; } /** * Determines whether a particular axis has support. If no axis is * specified, this function checks if either axis is supported. * * @param {Array} sides Supported sides. * @param {string} axis Which axis to check. * * @return {boolean} Whether there is support for the specified axis or both axes. */ function hasAxisSupport(sides, axis) { if (!sides || !sides.length) { return false; } const hasHorizontalSupport = sides.includes('horizontal') || sides.includes('left') && sides.includes('right'); const hasVerticalSupport = sides.includes('vertical') || sides.includes('top') && sides.includes('bottom'); if (axis === 'horizontal') { return hasHorizontalSupport; } if (axis === 'vertical') { return hasVerticalSupport; } return hasHorizontalSupport || hasVerticalSupport; } /** * Checks if the supported sides are balanced for each axis. * - Horizontal - both left and right sides are supported. * - Vertical - both top and bottom are supported. * * @param {Array} sides The supported sides which may be axes as well. * * @return {boolean} Whether or not the supported sides are balanced. */ function hasBalancedSidesSupport(sides = []) { const counts = { top: 0, right: 0, bottom: 0, left: 0 }; sides.forEach(side => counts[side] += 1); return (counts.top + counts.bottom) % 2 === 0 && (counts.left + counts.right) % 2 === 0; } /** * Determines which view the SpacingSizesControl should default to on its * first render; Axial, Custom, or Single side. * * @param {Object} values Current side values. * @param {Array} sides Supported sides. * * @return {string} View to display. */ function getInitialView(values = {}, sides) { const { top, right, bottom, left } = values; const sideValues = [top, right, bottom, left].filter(Boolean); // Axial ( Horizontal & vertical ). // - Has axial side support // - Has axial side values which match // - Has no values and the supported sides are balanced const hasMatchingAxialValues = top === bottom && left === right && (!!top || !!left); const hasNoValuesAndBalancedSides = !sideValues.length && hasBalancedSidesSupport(sides); const hasOnlyAxialSides = sides?.includes('horizontal') && sides?.includes('vertical') && sides?.length === 2; if (hasAxisSupport(sides) && (hasMatchingAxialValues || hasNoValuesAndBalancedSides)) { return VIEWS.axial; } // Only axial sides are supported and single value defined. // - Ensure the side returned is the first side that has a value. if (hasOnlyAxialSides && sideValues.length === 1) { let side; Object.entries(values).some(([key, value]) => { side = key; return value !== undefined; }); return side; } // Only single side supported and no value defined. if (sides?.length === 1 && !sideValues.length) { return sides[0]; } // Default to the Custom (separated sides) view. return VIEWS.custom; } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/gap.js /** * Internal dependencies */ /** * Returns a BoxControl object value from a given blockGap style value. * The string check is for backwards compatibility before Gutenberg supported * split gap values (row and column) and the value was a string n + unit. * * @param {?string | ?Object} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}. * @return {Object|null} A value to pass to the BoxControl component. */ function getGapBoxControlValueFromStyle(blockGapValue) { if (!blockGapValue) { return null; } const isValueString = typeof blockGapValue === 'string'; return { top: isValueString ? blockGapValue : blockGapValue?.top, left: isValueString ? blockGapValue : blockGapValue?.left }; } /** * Returns a CSS value for the `gap` property from a given blockGap style. * * @param {?string | ?Object} blockGapValue A block gap string or axial object value, e.g., '10px' or { top: '10px', left: '10px'}. * @param {?string} defaultValue A default gap value. * @return {string|null} The concatenated gap value (row and column). */ function getGapCSSValue(blockGapValue, defaultValue = '0') { const blockGapBoxControlValue = getGapBoxControlValueFromStyle(blockGapValue); if (!blockGapBoxControlValue) { return null; } const row = getSpacingPresetCssVar(blockGapBoxControlValue?.top) || defaultValue; const column = getSpacingPresetCssVar(blockGapBoxControlValue?.left) || defaultValue; return row === column ? row : `${row} ${column}`; } ;// ./node_modules/@wordpress/icons/build-module/library/justify-top.js /** * WordPress dependencies */ const justifyTop = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 20h6V9H9v11zM4 4v1.5h16V4H4z" }) }); /* harmony default export */ const justify_top = (justifyTop); ;// ./node_modules/@wordpress/icons/build-module/library/justify-center-vertical.js /** * WordPress dependencies */ const justifyCenterVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z" }) }); /* harmony default export */ const justify_center_vertical = (justifyCenterVertical); ;// ./node_modules/@wordpress/icons/build-module/library/justify-bottom.js /** * WordPress dependencies */ const justifyBottom = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z" }) }); /* harmony default export */ const justify_bottom = (justifyBottom); ;// ./node_modules/@wordpress/icons/build-module/library/justify-stretch-vertical.js /** * WordPress dependencies */ const justifyStretchVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z" }) }); /* harmony default export */ const justify_stretch_vertical = (justifyStretchVertical); ;// ./node_modules/@wordpress/icons/build-module/library/justify-space-between-vertical.js /** * WordPress dependencies */ const justifySpaceBetweenVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z" }) }); /* harmony default export */ const justify_space_between_vertical = (justifySpaceBetweenVertical); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/ui.js /** * WordPress dependencies */ const BLOCK_ALIGNMENTS_CONTROLS = { top: { icon: justify_top, title: (0,external_wp_i18n_namespaceObject._x)('Align top', 'Block vertical alignment setting') }, center: { icon: justify_center_vertical, title: (0,external_wp_i18n_namespaceObject._x)('Align middle', 'Block vertical alignment setting') }, bottom: { icon: justify_bottom, title: (0,external_wp_i18n_namespaceObject._x)('Align bottom', 'Block vertical alignment setting') }, stretch: { icon: justify_stretch_vertical, title: (0,external_wp_i18n_namespaceObject._x)('Stretch to fill', 'Block vertical alignment setting') }, 'space-between': { icon: justify_space_between_vertical, title: (0,external_wp_i18n_namespaceObject._x)('Space between', 'Block vertical alignment setting') } }; const DEFAULT_CONTROLS = ['top', 'center', 'bottom']; const DEFAULT_CONTROL = 'top'; function BlockVerticalAlignmentUI({ value, onChange, controls = DEFAULT_CONTROLS, isCollapsed = true, isToolbar }) { function applyOrUnset(align) { return () => onChange(value === align ? undefined : align); } const activeAlignment = BLOCK_ALIGNMENTS_CONTROLS[value]; const defaultAlignmentControl = BLOCK_ALIGNMENTS_CONTROLS[DEFAULT_CONTROL]; const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu; const extraProps = isToolbar ? { isCollapsed } : {}; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UIComponent, { icon: activeAlignment ? activeAlignment.icon : defaultAlignmentControl.icon, label: (0,external_wp_i18n_namespaceObject._x)('Change vertical alignment', 'Block vertical alignment setting label'), controls: controls.map(control => { return { ...BLOCK_ALIGNMENTS_CONTROLS[control], isActive: value === control, role: isCollapsed ? 'menuitemradio' : undefined, onClick: applyOrUnset(control) }; }), ...extraProps }); } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-vertical-alignment-toolbar/README.md */ /* harmony default export */ const ui = (BlockVerticalAlignmentUI); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-vertical-alignment-control/index.js /** * Internal dependencies */ const BlockVerticalAlignmentControl = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ui, { ...props, isToolbar: false }); }; const BlockVerticalAlignmentToolbar = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ui, { ...props, isToolbar: true }); }; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-vertical-alignment-control/README.md */ ;// ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/ui.js /** * WordPress dependencies */ const icons = { left: justify_left, center: justify_center, right: justify_right, 'space-between': justify_space_between, stretch: justify_stretch }; function JustifyContentUI({ allowedControls = ['left', 'center', 'right', 'space-between'], isCollapsed = true, onChange, value, popoverProps, isToolbar }) { // If the control is already selected we want a click // again on the control to deselect the item, so we // call onChange( undefined ) const handleClick = next => { if (next === value) { onChange(undefined); } else { onChange(next); } }; const icon = value ? icons[value] : icons.left; const allControls = [{ name: 'left', icon: justify_left, title: (0,external_wp_i18n_namespaceObject.__)('Justify items left'), isActive: 'left' === value, onClick: () => handleClick('left') }, { name: 'center', icon: justify_center, title: (0,external_wp_i18n_namespaceObject.__)('Justify items center'), isActive: 'center' === value, onClick: () => handleClick('center') }, { name: 'right', icon: justify_right, title: (0,external_wp_i18n_namespaceObject.__)('Justify items right'), isActive: 'right' === value, onClick: () => handleClick('right') }, { name: 'space-between', icon: justify_space_between, title: (0,external_wp_i18n_namespaceObject.__)('Space between items'), isActive: 'space-between' === value, onClick: () => handleClick('space-between') }, { name: 'stretch', icon: justify_stretch, title: (0,external_wp_i18n_namespaceObject.__)('Stretch items'), isActive: 'stretch' === value, onClick: () => handleClick('stretch') }]; const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu; const extraProps = isToolbar ? { isCollapsed } : {}; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UIComponent, { icon: icon, popoverProps: popoverProps, label: (0,external_wp_i18n_namespaceObject.__)('Change items justification'), controls: allControls.filter(elem => allowedControls.includes(elem.name)), ...extraProps }); } /* harmony default export */ const justify_content_control_ui = (JustifyContentUI); ;// ./node_modules/@wordpress/block-editor/build-module/components/justify-content-control/index.js /** * Internal dependencies */ const JustifyContentControl = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(justify_content_control_ui, { ...props, isToolbar: false }); }; const JustifyToolbar = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(justify_content_control_ui, { ...props, isToolbar: true }); }; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/justify-content-control/README.md */ ;// ./node_modules/@wordpress/block-editor/build-module/layouts/flex.js /** * WordPress dependencies */ /** * Internal dependencies */ // Used with the default, horizontal flex orientation. const justifyContentMap = { left: 'flex-start', right: 'flex-end', center: 'center', 'space-between': 'space-between' }; // Used with the vertical (column) flex orientation. const alignItemsMap = { left: 'flex-start', right: 'flex-end', center: 'center', stretch: 'stretch' }; const verticalAlignmentMap = { top: 'flex-start', center: 'center', bottom: 'flex-end', stretch: 'stretch', 'space-between': 'space-between' }; const flexWrapOptions = ['wrap', 'nowrap']; /* harmony default export */ const flex = ({ name: 'flex', label: (0,external_wp_i18n_namespaceObject.__)('Flex'), inspectorControls: function FlexLayoutInspectorControls({ layout = {}, onChange, layoutBlockSupport = {} }) { const { allowOrientation = true, allowJustification = true } = layoutBlockSupport; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { children: [allowJustification && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexLayoutJustifyContentControl, { layout: layout, onChange: onChange }) }), allowOrientation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OrientationControl, { layout: layout, onChange: onChange }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexWrapControl, { layout: layout, onChange: onChange })] }); }, toolBarControls: function FlexLayoutToolbarControls({ layout = {}, onChange, layoutBlockSupport }) { const { allowVerticalAlignment = true, allowJustification = true } = layoutBlockSupport; if (!allowJustification && !allowVerticalAlignment) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(block_controls, { group: "block", __experimentalShareWithChildBlocks: true, children: [allowJustification && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexLayoutJustifyContentControl, { layout: layout, onChange: onChange, isToolbar: true }), allowVerticalAlignment && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexLayoutVerticalAlignmentControl, { layout: layout, onChange: onChange })] }); }, getLayoutStyle: function getLayoutStyle({ selector, layout, style, blockName, hasBlockGapSupport, layoutDefinitions = LAYOUT_DEFINITIONS }) { const { orientation = 'horizontal' } = layout; // If a block's block.json skips serialization for spacing or spacing.blockGap, // don't apply the user-defined value to the styles. const blockGapValue = style?.spacing?.blockGap && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? getGapCSSValue(style?.spacing?.blockGap, '0.5em') : undefined; const justifyContent = justifyContentMap[layout.justifyContent]; const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap'; const verticalAlignment = verticalAlignmentMap[layout.verticalAlignment]; const alignItems = alignItemsMap[layout.justifyContent] || alignItemsMap.left; let output = ''; const rules = []; if (flexWrap && flexWrap !== 'wrap') { rules.push(`flex-wrap: ${flexWrap}`); } if (orientation === 'horizontal') { if (verticalAlignment) { rules.push(`align-items: ${verticalAlignment}`); } if (justifyContent) { rules.push(`justify-content: ${justifyContent}`); } } else { if (verticalAlignment) { rules.push(`justify-content: ${verticalAlignment}`); } rules.push('flex-direction: column'); rules.push(`align-items: ${alignItems}`); } if (rules.length) { output = `${appendSelectors(selector)} { ${rules.join('; ')}; }`; } // Output blockGap styles based on rules contained in layout definitions in theme.json. if (hasBlockGapSupport && blockGapValue) { output += getBlockGapCSS(selector, layoutDefinitions, 'flex', blockGapValue); } return output; }, getOrientation(layout) { const { orientation = 'horizontal' } = layout; return orientation; }, getAlignments() { return []; } }); function FlexLayoutVerticalAlignmentControl({ layout, onChange }) { const { orientation = 'horizontal' } = layout; const defaultVerticalAlignment = orientation === 'horizontal' ? verticalAlignmentMap.center : verticalAlignmentMap.top; const { verticalAlignment = defaultVerticalAlignment } = layout; const onVerticalAlignmentChange = value => { onChange({ ...layout, verticalAlignment: value }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockVerticalAlignmentControl, { onChange: onVerticalAlignmentChange, value: verticalAlignment, controls: orientation === 'horizontal' ? ['top', 'center', 'bottom', 'stretch'] : ['top', 'center', 'bottom', 'space-between'] }); } const POPOVER_PROPS = { placement: 'bottom-start' }; function FlexLayoutJustifyContentControl({ layout, onChange, isToolbar = false }) { const { justifyContent = 'left', orientation = 'horizontal' } = layout; const onJustificationChange = value => { onChange({ ...layout, justifyContent: value }); }; const allowedControls = ['left', 'center', 'right']; if (orientation === 'horizontal') { allowedControls.push('space-between'); } else { allowedControls.push('stretch'); } if (isToolbar) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(JustifyContentControl, { allowedControls: allowedControls, value: justifyContent, onChange: onJustificationChange, popoverProps: POPOVER_PROPS }); } const justificationOptions = [{ value: 'left', icon: justify_left, label: (0,external_wp_i18n_namespaceObject.__)('Justify items left') }, { value: 'center', icon: justify_center, label: (0,external_wp_i18n_namespaceObject.__)('Justify items center') }, { value: 'right', icon: justify_right, label: (0,external_wp_i18n_namespaceObject.__)('Justify items right') }]; if (orientation === 'horizontal') { justificationOptions.push({ value: 'space-between', icon: justify_space_between, label: (0,external_wp_i18n_namespaceObject.__)('Space between items') }); } else { justificationOptions.push({ value: 'stretch', icon: justify_stretch, label: (0,external_wp_i18n_namespaceObject.__)('Stretch items') }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Justification'), value: justifyContent, onChange: onJustificationChange, className: "block-editor-hooks__flex-layout-justification-controls", children: justificationOptions.map(({ value, icon, label }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { value: value, icon: icon, label: label }, value); }) }); } function FlexWrapControl({ layout, onChange }) { const { flexWrap = 'wrap' } = layout; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Allow to wrap to multiple lines'), onChange: value => { onChange({ ...layout, flexWrap: value ? 'wrap' : 'nowrap' }); }, checked: flexWrap === 'wrap' }); } function OrientationControl({ layout, onChange }) { const { orientation = 'horizontal', verticalAlignment, justifyContent } = layout; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, className: "block-editor-hooks__flex-layout-orientation-controls", label: (0,external_wp_i18n_namespaceObject.__)('Orientation'), value: orientation, onChange: value => { // Make sure the vertical alignment and justification are compatible with the new orientation. let newVerticalAlignment = verticalAlignment; let newJustification = justifyContent; if (value === 'horizontal') { if (verticalAlignment === 'space-between') { newVerticalAlignment = 'center'; } if (justifyContent === 'stretch') { newJustification = 'left'; } } else { if (verticalAlignment === 'stretch') { newVerticalAlignment = 'top'; } if (justifyContent === 'space-between') { newJustification = 'left'; } } return onChange({ ...layout, orientation: value, verticalAlignment: newVerticalAlignment, justifyContent: newJustification }); }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { icon: arrow_right, value: "horizontal", label: (0,external_wp_i18n_namespaceObject.__)('Horizontal') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { icon: arrow_down, value: "vertical", label: (0,external_wp_i18n_namespaceObject.__)('Vertical') })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/layouts/flow.js /** * WordPress dependencies */ /** * Internal dependencies */ /* harmony default export */ const flow = ({ name: 'default', label: (0,external_wp_i18n_namespaceObject.__)('Flow'), inspectorControls: function DefaultLayoutInspectorControls() { return null; }, toolBarControls: function DefaultLayoutToolbarControls() { return null; }, getLayoutStyle: function getLayoutStyle({ selector, style, blockName, hasBlockGapSupport, layoutDefinitions = LAYOUT_DEFINITIONS }) { const blockGapStyleValue = getGapCSSValue(style?.spacing?.blockGap); // If a block's block.json skips serialization for spacing or // spacing.blockGap, don't apply the user-defined value to the styles. let blockGapValue = ''; if (!shouldSkipSerialization(blockName, 'spacing', 'blockGap')) { // If an object is provided only use the 'top' value for this kind of gap. if (blockGapStyleValue?.top) { blockGapValue = getGapCSSValue(blockGapStyleValue?.top); } else if (typeof blockGapStyleValue === 'string') { blockGapValue = getGapCSSValue(blockGapStyleValue); } } let output = ''; // Output blockGap styles based on rules contained in layout definitions in theme.json. if (hasBlockGapSupport && blockGapValue) { output += getBlockGapCSS(selector, layoutDefinitions, 'default', blockGapValue); } return output; }, getOrientation() { return 'vertical'; }, getAlignments(layout, isBlockBasedTheme) { const alignmentInfo = getAlignmentsInfo(layout); if (layout.alignments !== undefined) { if (!layout.alignments.includes('none')) { layout.alignments.unshift('none'); } return layout.alignments.map(alignment => ({ name: alignment, info: alignmentInfo[alignment] })); } const alignments = [{ name: 'left' }, { name: 'center' }, { name: 'right' }]; // This is for backwards compatibility with hybrid themes. if (!isBlockBasedTheme) { const { contentSize, wideSize } = layout; if (contentSize) { alignments.unshift({ name: 'full' }); } if (wideSize) { alignments.unshift({ name: 'wide', info: alignmentInfo.wide }); } } alignments.unshift({ name: 'none', info: alignmentInfo.none }); return alignments; } }); ;// ./node_modules/@wordpress/icons/build-module/icon/index.js /** * WordPress dependencies */ /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ /** * Return an SVG icon. * * @param {IconProps} props icon is the SVG component to render * size is a number specifying the icon size in pixels * Other props will be passed to wrapped SVG component * @param {import('react').ForwardedRef<HTMLElement>} ref The forwarded ref to the SVG element. * * @return {JSX.Element} Icon component */ function Icon({ icon, size = 24, ...props }, ref) { return (0,external_wp_element_namespaceObject.cloneElement)(icon, { width: size, height: size, ...props, ref }); } /* harmony default export */ const build_module_icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon)); ;// ./node_modules/@wordpress/icons/build-module/library/align-none.js /** * WordPress dependencies */ const alignNone = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z" }) }); /* harmony default export */ const align_none = (alignNone); ;// ./node_modules/@wordpress/icons/build-module/library/stretch-wide.js /** * WordPress dependencies */ const stretchWide = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16 5.5H8V4h8v1.5ZM16 20H8v-1.5h8V20ZM5 9h14v6H5V9Z" }) }); /* harmony default export */ const stretch_wide = (stretchWide); ;// ./node_modules/@wordpress/block-editor/build-module/layouts/constrained.js /** * WordPress dependencies */ /** * Internal dependencies */ /* harmony default export */ const constrained = ({ name: 'constrained', label: (0,external_wp_i18n_namespaceObject.__)('Constrained'), inspectorControls: function DefaultLayoutInspectorControls({ layout, onChange, layoutBlockSupport = {} }) { const { wideSize, contentSize, justifyContent = 'center' } = layout; const { allowJustification = true, allowCustomContentAndWideSize = true } = layoutBlockSupport; const onJustificationChange = value => { onChange({ ...layout, justifyContent: value }); }; const justificationOptions = [{ value: 'left', icon: justify_left, label: (0,external_wp_i18n_namespaceObject.__)('Justify items left') }, { value: 'center', icon: justify_center, label: (0,external_wp_i18n_namespaceObject.__)('Justify items center') }, { value: 'right', icon: justify_right, label: (0,external_wp_i18n_namespaceObject.__)('Justify items right') }]; const [availableUnits] = use_settings_useSettings('spacing.units'); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vw'] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, className: "block-editor-hooks__layout-constrained", children: [allowCustomContentAndWideSize && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Content width'), labelPosition: "top", value: contentSize || wideSize || '', onChange: nextWidth => { nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; onChange({ ...layout, contentSize: nextWidth }); }, units: units, prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: align_none }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Wide width'), labelPosition: "top", value: wideSize || contentSize || '', onChange: nextWidth => { nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; onChange({ ...layout, wideSize: nextWidth }); }, units: units, prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: stretch_wide }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-hooks__layout-constrained-helptext", children: (0,external_wp_i18n_namespaceObject.__)('Customize the width for all elements that are assigned to the center or wide columns.') })] }), allowJustification && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Justification'), value: justifyContent, onChange: onJustificationChange, children: justificationOptions.map(({ value, icon, label }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { value: value, icon: icon, label: label }, value); }) })] }); }, toolBarControls: function DefaultLayoutToolbarControls({ layout = {}, onChange, layoutBlockSupport }) { const { allowJustification = true } = layoutBlockSupport; if (!allowJustification) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls, { group: "block", __experimentalShareWithChildBlocks: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DefaultLayoutJustifyContentControl, { layout: layout, onChange: onChange }) }); }, getLayoutStyle: function getLayoutStyle({ selector, layout = {}, style, blockName, hasBlockGapSupport, layoutDefinitions = LAYOUT_DEFINITIONS }) { const { contentSize, wideSize, justifyContent } = layout; const blockGapStyleValue = getGapCSSValue(style?.spacing?.blockGap); // If a block's block.json skips serialization for spacing or // spacing.blockGap, don't apply the user-defined value to the styles. let blockGapValue = ''; if (!shouldSkipSerialization(blockName, 'spacing', 'blockGap')) { // If an object is provided only use the 'top' value for this kind of gap. if (blockGapStyleValue?.top) { blockGapValue = getGapCSSValue(blockGapStyleValue?.top); } else if (typeof blockGapStyleValue === 'string') { blockGapValue = getGapCSSValue(blockGapStyleValue); } } const marginLeft = justifyContent === 'left' ? '0 !important' : 'auto !important'; const marginRight = justifyContent === 'right' ? '0 !important' : 'auto !important'; let output = !!contentSize || !!wideSize ? ` ${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright):not(.alignfull))')} { max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize}; margin-left: ${marginLeft}; margin-right: ${marginRight}; } ${appendSelectors(selector, '> .alignwide')} { max-width: ${wideSize !== null && wideSize !== void 0 ? wideSize : contentSize}; } ${appendSelectors(selector, '> .alignfull')} { max-width: none; } ` : ''; if (justifyContent === 'left') { output += `${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright):not(.alignfull))')} { margin-left: ${marginLeft}; }`; } else if (justifyContent === 'right') { output += `${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright):not(.alignfull))')} { margin-right: ${marginRight}; }`; } // If there is custom padding, add negative margins for alignfull blocks. if (style?.spacing?.padding) { // The style object might be storing a preset so we need to make sure we get a usable value. const paddingValues = (0,external_wp_styleEngine_namespaceObject.getCSSRules)(style); paddingValues.forEach(rule => { if (rule.key === 'paddingRight') { // Add unit if 0, to avoid calc(0 * -1) which is invalid. const paddingRightValue = rule.value === '0' ? '0px' : rule.value; output += ` ${appendSelectors(selector, '> .alignfull')} { margin-right: calc(${paddingRightValue} * -1); } `; } else if (rule.key === 'paddingLeft') { // Add unit if 0, to avoid calc(0 * -1) which is invalid. const paddingLeftValue = rule.value === '0' ? '0px' : rule.value; output += ` ${appendSelectors(selector, '> .alignfull')} { margin-left: calc(${paddingLeftValue} * -1); } `; } }); } // Output blockGap styles based on rules contained in layout definitions in theme.json. if (hasBlockGapSupport && blockGapValue) { output += getBlockGapCSS(selector, layoutDefinitions, 'constrained', blockGapValue); } return output; }, getOrientation() { return 'vertical'; }, getAlignments(layout) { const alignmentInfo = getAlignmentsInfo(layout); if (layout.alignments !== undefined) { if (!layout.alignments.includes('none')) { layout.alignments.unshift('none'); } return layout.alignments.map(alignment => ({ name: alignment, info: alignmentInfo[alignment] })); } const { contentSize, wideSize } = layout; const alignments = [{ name: 'left' }, { name: 'center' }, { name: 'right' }]; if (contentSize) { alignments.unshift({ name: 'full' }); } if (wideSize) { alignments.unshift({ name: 'wide', info: alignmentInfo.wide }); } alignments.unshift({ name: 'none', info: alignmentInfo.none }); return alignments; } }); const constrained_POPOVER_PROPS = { placement: 'bottom-start' }; function DefaultLayoutJustifyContentControl({ layout, onChange }) { const { justifyContent = 'center' } = layout; const onJustificationChange = value => { onChange({ ...layout, justifyContent: value }); }; const allowedControls = ['left', 'center', 'right']; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(JustifyContentControl, { allowedControls: allowedControls, value: justifyContent, onChange: onJustificationChange, popoverProps: constrained_POPOVER_PROPS }); } ;// ./node_modules/@wordpress/block-editor/build-module/layouts/grid.js /** * WordPress dependencies */ /** * Internal dependencies */ const RANGE_CONTROL_MAX_VALUES = { px: 600, '%': 100, vw: 100, vh: 100, em: 38, rem: 38, svw: 100, lvw: 100, dvw: 100, svh: 100, lvh: 100, dvh: 100, vi: 100, svi: 100, lvi: 100, dvi: 100, vb: 100, svb: 100, lvb: 100, dvb: 100, vmin: 100, svmin: 100, lvmin: 100, dvmin: 100, vmax: 100, svmax: 100, lvmax: 100, dvmax: 100 }; const units = [{ value: 'px', label: 'px', default: 0 }, { value: 'rem', label: 'rem', default: 0 }, { value: 'em', label: 'em', default: 0 }]; /* harmony default export */ const grid = ({ name: 'grid', label: (0,external_wp_i18n_namespaceObject.__)('Grid'), inspectorControls: function GridLayoutInspectorControls({ layout = {}, onChange, layoutBlockSupport = {} }) { const { allowSizingOnChildren = false } = layoutBlockSupport; // In the experiment we want to also show column control in Auto mode, and // the minimum width control in Manual mode. const showColumnsControl = window.__experimentalEnableGridInteractivity || !!layout?.columnCount; const showMinWidthControl = window.__experimentalEnableGridInteractivity || !layout?.columnCount; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLayoutTypeControl, { layout: layout, onChange: onChange }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [showColumnsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLayoutColumnsAndRowsControl, { layout: layout, onChange: onChange, allowSizingOnChildren: allowSizingOnChildren }), showMinWidthControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLayoutMinimumWidthControl, { layout: layout, onChange: onChange })] })] }); }, toolBarControls: function GridLayoutToolbarControls() { return null; }, getLayoutStyle: function getLayoutStyle({ selector, layout, style, blockName, hasBlockGapSupport, layoutDefinitions = LAYOUT_DEFINITIONS }) { const { minimumColumnWidth = null, columnCount = null, rowCount = null } = layout; // Check that the grid layout attributes are of the correct type, so that we don't accidentally // write code that stores a string attribute instead of a number. if (false) {} // If a block's block.json skips serialization for spacing or spacing.blockGap, // don't apply the user-defined value to the styles. const blockGapValue = style?.spacing?.blockGap && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? getGapCSSValue(style?.spacing?.blockGap, '0.5em') : undefined; let output = ''; const rules = []; if (minimumColumnWidth && columnCount > 0) { const maxValue = `max(${minimumColumnWidth}, ( 100% - (${blockGapValue || '1.2rem'}*${columnCount - 1}) ) / ${columnCount})`; rules.push(`grid-template-columns: repeat(auto-fill, minmax(${maxValue}, 1fr))`, `container-type: inline-size`); if (rowCount) { rules.push(`grid-template-rows: repeat(${rowCount}, minmax(1rem, auto))`); } } else if (columnCount) { rules.push(`grid-template-columns: repeat(${columnCount}, minmax(0, 1fr))`); if (rowCount) { rules.push(`grid-template-rows: repeat(${rowCount}, minmax(1rem, auto))`); } } else { rules.push(`grid-template-columns: repeat(auto-fill, minmax(min(${minimumColumnWidth || '12rem'}, 100%), 1fr))`, 'container-type: inline-size'); } if (rules.length) { // Reason to disable: the extra line breaks added by prettier mess with the unit tests. // eslint-disable-next-line prettier/prettier output = `${appendSelectors(selector)} { ${rules.join('; ')}; }`; } // Output blockGap styles based on rules contained in layout definitions in theme.json. if (hasBlockGapSupport && blockGapValue) { output += getBlockGapCSS(selector, layoutDefinitions, 'grid', blockGapValue); } return output; }, getOrientation() { return 'horizontal'; }, getAlignments() { return []; } }); // Enables setting minimum width of grid items. function GridLayoutMinimumWidthControl({ layout, onChange }) { const { minimumColumnWidth, columnCount, isManualPlacement } = layout; const defaultValue = isManualPlacement || columnCount ? null : '12rem'; const value = minimumColumnWidth || defaultValue; const [quantity, unit = 'rem'] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value); const handleSliderChange = next => { onChange({ ...layout, minimumColumnWidth: [next, unit].join('') }); }; // Mostly copied from HeightControl. const handleUnitChange = newUnit => { // Attempt to smooth over differences between currentUnit and newUnit. // This should slightly improve the experience of switching between unit types. let newValue; if (['em', 'rem'].includes(newUnit) && unit === 'px') { // Convert pixel value to an approximate of the new unit, assuming a root size of 16px. newValue = (quantity / 16).toFixed(2) + newUnit; } else if (['em', 'rem'].includes(unit) && newUnit === 'px') { // Convert to pixel value assuming a root size of 16px. newValue = Math.round(quantity * 16) + newUnit; } onChange({ ...layout, minimumColumnWidth: newValue }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)('Minimum column width') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { gap: 4, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { size: "__unstable-large", onChange: newValue => { onChange({ ...layout, minimumColumnWidth: newValue === '' ? undefined : newValue }); }, onUnitChange: handleUnitChange, value: value, units: units, min: 0, label: (0,external_wp_i18n_namespaceObject.__)('Minimum column width'), hideLabelFromVision: true }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, onChange: handleSliderChange, value: quantity || 0, min: 0, max: RANGE_CONTROL_MAX_VALUES[unit] || 600, withInputField: false, label: (0,external_wp_i18n_namespaceObject.__)('Minimum column width'), hideLabelFromVision: true }) })] })] }); } // Enables setting number of grid columns function GridLayoutColumnsAndRowsControl({ layout, onChange, allowSizingOnChildren }) { // If the grid interactivity experiment is enabled, allow unsetting the column count. const defaultColumnCount = window.__experimentalEnableGridInteractivity ? undefined : 3; const { columnCount = defaultColumnCount, rowCount, isManualPlacement } = layout; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { children: [(!window.__experimentalEnableGridInteractivity || !isManualPlacement) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)('Columns') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { gap: 4, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { size: "__unstable-large", onChange: value => { if (window.__experimentalEnableGridInteractivity) { // Allow unsetting the column count when in auto mode. const defaultNewColumnCount = isManualPlacement ? 1 : undefined; const newColumnCount = value === '' || value === '0' ? defaultNewColumnCount : parseInt(value, 10); onChange({ ...layout, columnCount: newColumnCount }); } else { // Don't allow unsetting the column count. const newColumnCount = value === '' || value === '0' ? 1 : parseInt(value, 10); onChange({ ...layout, columnCount: newColumnCount }); } }, value: columnCount, min: 1, label: (0,external_wp_i18n_namespaceObject.__)('Columns'), hideLabelFromVision: !window.__experimentalEnableGridInteractivity || !isManualPlacement }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: window.__experimentalEnableGridInteractivity && allowSizingOnChildren && isManualPlacement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { size: "__unstable-large", onChange: value => { // Don't allow unsetting the row count. const newRowCount = value === '' || value === '0' ? 1 : parseInt(value, 10); onChange({ ...layout, rowCount: newRowCount }); }, value: rowCount, min: 1, label: (0,external_wp_i18n_namespaceObject.__)('Rows') }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, value: columnCount !== null && columnCount !== void 0 ? columnCount : 1, onChange: value => onChange({ ...layout, columnCount: value === '' || value === '0' ? 1 : value }), min: 1, max: 16, withInputField: false, label: (0,external_wp_i18n_namespaceObject.__)('Columns'), hideLabelFromVision: true }) })] })] }) }); } // Enables switching between grid types function GridLayoutTypeControl({ layout, onChange }) { const { columnCount, rowCount, minimumColumnWidth, isManualPlacement } = layout; /** * When switching, temporarily save any custom values set on the * previous type so we can switch back without loss. */ const [tempColumnCount, setTempColumnCount] = (0,external_wp_element_namespaceObject.useState)(columnCount || 3); const [tempRowCount, setTempRowCount] = (0,external_wp_element_namespaceObject.useState)(rowCount); const [tempMinimumColumnWidth, setTempMinimumColumnWidth] = (0,external_wp_element_namespaceObject.useState)(minimumColumnWidth || '12rem'); const gridPlacement = isManualPlacement || !!columnCount && !window.__experimentalEnableGridInteractivity ? 'manual' : 'auto'; const onChangeType = value => { if (value === 'manual') { setTempMinimumColumnWidth(minimumColumnWidth || '12rem'); } else { setTempColumnCount(columnCount || 3); setTempRowCount(rowCount); } onChange({ ...layout, columnCount: value === 'manual' ? tempColumnCount : null, rowCount: value === 'manual' && window.__experimentalEnableGridInteractivity ? tempRowCount : undefined, isManualPlacement: value === 'manual' && window.__experimentalEnableGridInteractivity ? true : undefined, minimumColumnWidth: value === 'auto' ? tempMinimumColumnWidth : null }); }; const helpText = gridPlacement === 'manual' ? (0,external_wp_i18n_namespaceObject.__)('Grid items can be manually placed in any position on the grid.') : (0,external_wp_i18n_namespaceObject.__)('Grid items are placed automatically depending on their order.'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Grid item position'), value: gridPlacement, onChange: onChangeType, isBlock: true, help: window.__experimentalEnableGridInteractivity ? helpText : undefined, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "auto", label: (0,external_wp_i18n_namespaceObject.__)('Auto') }, "auto"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "manual", label: (0,external_wp_i18n_namespaceObject.__)('Manual') }, "manual")] }); } ;// ./node_modules/@wordpress/block-editor/build-module/layouts/index.js /** * Internal dependencies */ const layoutTypes = [flow, flex, constrained, grid]; /** * Retrieves a layout type by name. * * @param {string} name - The name of the layout type. * @return {Object} Layout type. */ function getLayoutType(name = 'default') { return layoutTypes.find(layoutType => layoutType.name === name); } /** * Retrieves the available layout types. * * @return {Array} Layout types. */ function getLayoutTypes() { return layoutTypes; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/layout.js /** * WordPress dependencies */ /** * Internal dependencies */ const defaultLayout = { type: 'default' }; const Layout = (0,external_wp_element_namespaceObject.createContext)(defaultLayout); /** * Allows to define the layout. */ const LayoutProvider = Layout.Provider; /** * React hook used to retrieve the layout config. */ function useLayout() { return (0,external_wp_element_namespaceObject.useContext)(Layout); } function LayoutStyle({ layout = {}, css, ...props }) { const layoutType = getLayoutType(layout.type); const [blockGapSupport] = use_settings_useSettings('spacing.blockGap'); const hasBlockGapSupport = blockGapSupport !== null; if (layoutType) { if (css) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("style", { children: css }); } const layoutStyle = layoutType.getLayoutStyle?.({ hasBlockGapSupport, layout, ...props }); if (layoutStyle) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("style", { children: layoutStyle }); } } return null; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/use-available-alignments.js /** * WordPress dependencies */ /** * Internal dependencies */ const use_available_alignments_EMPTY_ARRAY = []; const use_available_alignments_DEFAULT_CONTROLS = ['none', 'left', 'center', 'right', 'wide', 'full']; const WIDE_CONTROLS = ['wide', 'full']; function useAvailableAlignments(controls = use_available_alignments_DEFAULT_CONTROLS) { // Always add the `none` option if not exists. if (!controls.includes('none')) { controls = ['none', ...controls]; } const isNoneOnly = controls.length === 1 && controls[0] === 'none'; const [wideControlsEnabled, themeSupportsLayout, isBlockBasedTheme] = (0,external_wp_data_namespaceObject.useSelect)(select => { var _settings$alignWide; // If `isNoneOnly` is true, we'll be returning early because there is // nothing to filter on an empty array. We won't need the info from // the `useSelect` but we must call it anyway because Rules of Hooks. // So the callback returns early to avoid block editor subscription. if (isNoneOnly) { return [false, false, false]; } const settings = select(store).getSettings(); return [(_settings$alignWide = settings.alignWide) !== null && _settings$alignWide !== void 0 ? _settings$alignWide : false, settings.supportsLayout, settings.__unstableIsBlockBasedTheme]; }, [isNoneOnly]); const layout = useLayout(); if (isNoneOnly) { return use_available_alignments_EMPTY_ARRAY; } const layoutType = getLayoutType(layout?.type); if (themeSupportsLayout) { const layoutAlignments = layoutType.getAlignments(layout, isBlockBasedTheme); const alignments = layoutAlignments.filter(alignment => controls.includes(alignment.name)); // While we treat `none` as an alignment, we shouldn't return it if no // other alignments exist. if (alignments.length === 1 && alignments[0].name === 'none') { return use_available_alignments_EMPTY_ARRAY; } return alignments; } // Starting here, it's the fallback for themes not supporting the layout config. if (layoutType.name !== 'default' && layoutType.name !== 'constrained') { return use_available_alignments_EMPTY_ARRAY; } const alignments = controls.filter(control => { if (layout.alignments) { return layout.alignments.includes(control); } if (!wideControlsEnabled && WIDE_CONTROLS.includes(control)) { return false; } return use_available_alignments_DEFAULT_CONTROLS.includes(control); }).map(name => ({ name })); // While we treat `none` as an alignment, we shouldn't return it if no // other alignments exist. if (alignments.length === 1 && alignments[0].name === 'none') { return use_available_alignments_EMPTY_ARRAY; } return alignments; } ;// ./node_modules/@wordpress/icons/build-module/library/position-left.js /** * WordPress dependencies */ const positionLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z" }) }); /* harmony default export */ const position_left = (positionLeft); ;// ./node_modules/@wordpress/icons/build-module/library/position-center.js /** * WordPress dependencies */ const positionCenter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z" }) }); /* harmony default export */ const position_center = (positionCenter); ;// ./node_modules/@wordpress/icons/build-module/library/position-right.js /** * WordPress dependencies */ const positionRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z" }) }); /* harmony default export */ const position_right = (positionRight); ;// ./node_modules/@wordpress/icons/build-module/library/stretch-full-width.js /** * WordPress dependencies */ const stretchFullWidth = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 4h14v11H5V4Zm11 16H8v-1.5h8V20Z" }) }); /* harmony default export */ const stretch_full_width = (stretchFullWidth); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/constants.js /** * WordPress dependencies */ const constants_BLOCK_ALIGNMENTS_CONTROLS = { none: { icon: align_none, title: (0,external_wp_i18n_namespaceObject._x)('None', 'Alignment option') }, left: { icon: position_left, title: (0,external_wp_i18n_namespaceObject.__)('Align left') }, center: { icon: position_center, title: (0,external_wp_i18n_namespaceObject.__)('Align center') }, right: { icon: position_right, title: (0,external_wp_i18n_namespaceObject.__)('Align right') }, wide: { icon: stretch_wide, title: (0,external_wp_i18n_namespaceObject.__)('Wide width') }, full: { icon: stretch_full_width, title: (0,external_wp_i18n_namespaceObject.__)('Full width') } }; const constants_DEFAULT_CONTROL = 'none'; ;// ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/ui.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function BlockAlignmentUI({ value, onChange, controls, isToolbar, isCollapsed = true }) { const enabledControls = useAvailableAlignments(controls); const hasEnabledControls = !!enabledControls.length; if (!hasEnabledControls) { return null; } function onChangeAlignment(align) { onChange([value, 'none'].includes(align) ? undefined : align); } const activeAlignmentControl = constants_BLOCK_ALIGNMENTS_CONTROLS[value]; const defaultAlignmentControl = constants_BLOCK_ALIGNMENTS_CONTROLS[constants_DEFAULT_CONTROL]; const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu; const commonProps = { icon: activeAlignmentControl ? activeAlignmentControl.icon : defaultAlignmentControl.icon, label: (0,external_wp_i18n_namespaceObject.__)('Align') }; const extraProps = isToolbar ? { isCollapsed, controls: enabledControls.map(({ name: controlName }) => { return { ...constants_BLOCK_ALIGNMENTS_CONTROLS[controlName], isActive: value === controlName || !value && controlName === 'none', role: isCollapsed ? 'menuitemradio' : undefined, onClick: () => onChangeAlignment(controlName) }; }) } : { toggleProps: { description: (0,external_wp_i18n_namespaceObject.__)('Change alignment') }, children: ({ onClose }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { className: "block-editor-block-alignment-control__menu-group", children: enabledControls.map(({ name: controlName, info }) => { const { icon, title } = constants_BLOCK_ALIGNMENTS_CONTROLS[controlName]; // If no value is provided, mark as selected the `none` option. const isSelected = controlName === value || !value && controlName === 'none'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: icon, iconPosition: "left", className: dist_clsx('components-dropdown-menu__menu-item', { 'is-active': isSelected }), isSelected: isSelected, onClick: () => { onChangeAlignment(controlName); onClose(); }, role: "menuitemradio", info: info, children: title }, controlName); }) }) }); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UIComponent, { ...commonProps, ...extraProps }); } /* harmony default export */ const block_alignment_control_ui = (BlockAlignmentUI); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-control/index.js /** * Internal dependencies */ const BlockAlignmentControl = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_alignment_control_ui, { ...props, isToolbar: false }); }; const BlockAlignmentToolbar = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_alignment_control_ui, { ...props, isToolbar: true }); }; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-alignment-control/README.md */ ;// ./node_modules/@wordpress/block-editor/build-module/components/block-editing-mode/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * @typedef {'disabled'|'contentOnly'|'default'} BlockEditingMode */ /** * Allows a block to restrict the user interface that is displayed for editing * that block and its inner blocks. * * @example * ```js * function MyBlock( { attributes, setAttributes } ) { * useBlockEditingMode( 'disabled' ); * return <div { ...useBlockProps() }></div>; * } * ``` * * `mode` can be one of three options: * * - `'disabled'`: Prevents editing the block entirely, i.e. it cannot be * selected. * - `'contentOnly'`: Hides all non-content UI, e.g. auxiliary controls in the * toolbar, the block movers, block settings. * - `'default'`: Allows editing the block as normal. * * The mode is inherited by all of the block's inner blocks, unless they have * their own mode. * * If called outside of a block context, the mode is applied to all blocks. * * @param {?BlockEditingMode} mode The editing mode to apply. If undefined, the * current editing mode is not changed. * * @return {BlockEditingMode} The current editing mode. */ function useBlockEditingMode(mode) { const context = useBlockEditContext(); const { clientId = '' } = context; const { setBlockEditingMode, unsetBlockEditingMode } = (0,external_wp_data_namespaceObject.useDispatch)(store); const globalBlockEditingMode = (0,external_wp_data_namespaceObject.useSelect)(select => // Avoid adding the subscription if not needed! clientId ? null : select(store).getBlockEditingMode(), [clientId]); (0,external_wp_element_namespaceObject.useEffect)(() => { if (mode) { setBlockEditingMode(clientId, mode); } return () => { if (mode) { unsetBlockEditingMode(clientId); } }; }, [clientId, mode, setBlockEditingMode, unsetBlockEditingMode]); return clientId ? context[blockEditingModeKey] : globalBlockEditingMode; } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/align.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * An array which includes all possible valid alignments, * used to validate if an alignment is valid or not. * * @constant * @type {string[]} */ const ALL_ALIGNMENTS = ['left', 'center', 'right', 'wide', 'full']; /** * An array which includes all wide alignments. * In order for this alignments to be valid they need to be supported by the block, * and by the theme. * * @constant * @type {string[]} */ const WIDE_ALIGNMENTS = ['wide', 'full']; /** * Returns the valid alignments. * Takes into consideration the aligns supported by a block, if the block supports wide controls or not and if theme supports wide controls or not. * Exported just for testing purposes, not exported outside the module. * * @param {?boolean|string[]} blockAlign Aligns supported by the block. * @param {?boolean} hasWideBlockSupport True if block supports wide alignments. And False otherwise. * @param {?boolean} hasWideEnabled True if theme supports wide alignments. And False otherwise. * * @return {string[]} Valid alignments. */ function getValidAlignments(blockAlign, hasWideBlockSupport = true, hasWideEnabled = true) { let validAlignments; if (Array.isArray(blockAlign)) { validAlignments = ALL_ALIGNMENTS.filter(value => blockAlign.includes(value)); } else if (blockAlign === true) { // `true` includes all alignments... validAlignments = [...ALL_ALIGNMENTS]; } else { validAlignments = []; } if (!hasWideEnabled || blockAlign === true && !hasWideBlockSupport) { return validAlignments.filter(alignment => !WIDE_ALIGNMENTS.includes(alignment)); } return validAlignments; } /** * Filters registered block settings, extending attributes to include `align`. * * @param {Object} settings Original block settings. * * @return {Object} Filtered block settings. */ function addAttribute(settings) { var _settings$attributes$; // Allow blocks to specify their own attribute definition with default values if needed. if ('type' in ((_settings$attributes$ = settings.attributes?.align) !== null && _settings$attributes$ !== void 0 ? _settings$attributes$ : {})) { return settings; } if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'align')) { // Gracefully handle if settings.attributes is undefined. settings.attributes = { ...settings.attributes, align: { type: 'string', // Allow for '' since it is used by the `updateAlignment` function // in toolbar controls for special cases with defined default values. enum: [...ALL_ALIGNMENTS, ''] } }; } return settings; } function BlockEditAlignmentToolbarControlsPure({ name: blockName, align, setAttributes }) { // Compute the block valid alignments by taking into account, // if the theme supports wide alignments or not and the layout's // available alignments. We do that for conditionally rendering // Slot. const blockAllowedAlignments = getValidAlignments((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'align'), (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'alignWide', true)); const validAlignments = useAvailableAlignments(blockAllowedAlignments).map(({ name }) => name); const blockEditingMode = useBlockEditingMode(); if (!validAlignments.length || blockEditingMode !== 'default') { return null; } const updateAlignment = nextAlign => { if (!nextAlign) { const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName); const blockDefaultAlign = blockType?.attributes?.align?.default; if (blockDefaultAlign) { nextAlign = ''; } } setAttributes({ align: nextAlign }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls, { group: "block", __experimentalShareWithChildBlocks: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockAlignmentControl, { value: align, onChange: updateAlignment, controls: validAlignments }) }); } /* harmony default export */ const align = ({ shareWithChildBlocks: true, edit: BlockEditAlignmentToolbarControlsPure, useBlockProps, addSaveProps: addAssignedAlign, attributeKeys: ['align'], hasSupport(name) { return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, 'align', false); } }); function useBlockProps({ name, align }) { const blockAllowedAlignments = getValidAlignments((0,external_wp_blocks_namespaceObject.getBlockSupport)(name, 'align'), (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, 'alignWide', true)); const validAlignments = useAvailableAlignments(blockAllowedAlignments); if (validAlignments.some(alignment => alignment.name === align)) { return { 'data-align': align }; } return {}; } /** * Override props assigned to save component to inject alignment class name if * block supports it. * * @param {Object} props Additional props applied to save element. * @param {Object} blockType Block type. * @param {Object} attributes Block attributes. * * @return {Object} Filtered props applied to save element. */ function addAssignedAlign(props, blockType, attributes) { const { align } = attributes; const blockAlign = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, 'align'); const hasWideBlockSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'alignWide', true); // Compute valid alignments without taking into account if // the theme supports wide alignments or not. // This way changing themes does not impact the block save. const isAlignValid = getValidAlignments(blockAlign, hasWideBlockSupport).includes(align); if (isAlignValid) { props.className = dist_clsx(`align${align}`, props.className); } return props; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/align/addAttribute', addAttribute); ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/groups.js /** * WordPress dependencies */ const InspectorControlsDefault = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControls'); const InspectorControlsAdvanced = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorAdvancedControls'); const InspectorControlsBindings = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsBindings'); const InspectorControlsBackground = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsBackground'); const InspectorControlsBorder = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsBorder'); const InspectorControlsColor = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsColor'); const InspectorControlsFilter = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsFilter'); const InspectorControlsDimensions = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsDimensions'); const InspectorControlsPosition = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsPosition'); const InspectorControlsTypography = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsTypography'); const InspectorControlsListView = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsListView'); const InspectorControlsStyles = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsStyles'); const InspectorControlsEffects = (0,external_wp_components_namespaceObject.createSlotFill)('InspectorControlsEffects'); const groups_groups = { default: InspectorControlsDefault, advanced: InspectorControlsAdvanced, background: InspectorControlsBackground, bindings: InspectorControlsBindings, border: InspectorControlsBorder, color: InspectorControlsColor, dimensions: InspectorControlsDimensions, effects: InspectorControlsEffects, filter: InspectorControlsFilter, list: InspectorControlsListView, position: InspectorControlsPosition, settings: InspectorControlsDefault, // Alias for default. styles: InspectorControlsStyles, typography: InspectorControlsTypography }; /* harmony default export */ const inspector_controls_groups = (groups_groups); ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/fill.js /** * WordPress dependencies */ /** * Internal dependencies */ function InspectorControlsFill({ children, group = 'default', __experimentalGroup, resetAllFilter }) { if (__experimentalGroup) { external_wp_deprecated_default()('`__experimentalGroup` property in `InspectorControlsFill`', { since: '6.2', version: '6.4', alternative: '`group`' }); group = __experimentalGroup; } const context = useBlockEditContext(); const Fill = inspector_controls_groups[group]?.Fill; if (!Fill) { true ? external_wp_warning_default()(`Unknown InspectorControls group "${group}" provided.`) : 0; return null; } if (!context[mayDisplayControlsKey]) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalStyleProvider, { document: document, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, { children: fillProps => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ToolsPanelInspectorControl, { fillProps: fillProps, children: children, resetAllFilter: resetAllFilter }); } }) }); } function RegisterResetAll({ resetAllFilter, children }) { const { registerResetAllFilter, deregisterResetAllFilter } = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolsPanelContext); (0,external_wp_element_namespaceObject.useEffect)(() => { if (resetAllFilter && registerResetAllFilter && deregisterResetAllFilter) { registerResetAllFilter(resetAllFilter); return () => { deregisterResetAllFilter(resetAllFilter); }; } }, [resetAllFilter, registerResetAllFilter, deregisterResetAllFilter]); return children; } function ToolsPanelInspectorControl({ children, resetAllFilter, fillProps }) { // `fillProps.forwardedContext` is an array of context provider entries, provided by slot, // that should wrap the fill markup. const { forwardedContext = [] } = fillProps; // Children passed to InspectorControlsFill will not have // access to any React Context whose Provider is part of // the InspectorControlsSlot tree. So we re-create the // Provider in this subtree. const innerMarkup = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RegisterResetAll, { resetAllFilter: resetAllFilter, children: children }); return forwardedContext.reduce((inner, [Provider, props]) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, { ...props, children: inner }), innerMarkup); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/block-support-tools-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockSupportToolsPanel({ children, group, label }) { const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { getBlockAttributes, getMultiSelectedBlockClientIds, getSelectedBlockClientId, hasMultiSelection } = (0,external_wp_data_namespaceObject.useSelect)(store); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const panelId = getSelectedBlockClientId(); const resetAll = (0,external_wp_element_namespaceObject.useCallback)((resetFilters = []) => { const newAttributes = {}; const clientIds = hasMultiSelection() ? getMultiSelectedBlockClientIds() : [panelId]; clientIds.forEach(clientId => { const { style } = getBlockAttributes(clientId); let newBlockAttributes = { style }; resetFilters.forEach(resetFilter => { newBlockAttributes = { ...newBlockAttributes, ...resetFilter(newBlockAttributes) }; }); // Enforce a cleaned style object. newBlockAttributes = { ...newBlockAttributes, style: utils_cleanEmptyObject(newBlockAttributes.style) }; newAttributes[clientId] = newBlockAttributes; }); updateBlockAttributes(clientIds, newAttributes, true); }, [getBlockAttributes, getMultiSelectedBlockClientIds, hasMultiSelection, panelId, updateBlockAttributes]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { className: `${group}-block-support-panel`, label: label, resetAll: resetAll, panelId: panelId, hasInnerWrapper: true, shouldRenderPlaceholderItems: true // Required to maintain fills ordering. , __experimentalFirstVisibleItemClass: "first", __experimentalLastVisibleItemClass: "last", dropdownMenuProps: dropdownMenuProps, children: children }, panelId); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/block-support-slot-container.js /** * WordPress dependencies */ function BlockSupportSlotContainer({ Slot, fillProps, ...props }) { // Add the toolspanel context provider and value to existing fill props const toolsPanelContext = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.__experimentalToolsPanelContext); const computedFillProps = (0,external_wp_element_namespaceObject.useMemo)(() => { var _fillProps$forwardedC; return { ...(fillProps !== null && fillProps !== void 0 ? fillProps : {}), forwardedContext: [...((_fillProps$forwardedC = fillProps?.forwardedContext) !== null && _fillProps$forwardedC !== void 0 ? _fillProps$forwardedC : []), [external_wp_components_namespaceObject.__experimentalToolsPanelContext.Provider, { value: toolsPanelContext }]] }; }, [toolsPanelContext, fillProps]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Slot, { ...props, fillProps: computedFillProps, bubblesVirtually: true }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/slot.js /** * WordPress dependencies */ /** * Internal dependencies */ function InspectorControlsSlot({ __experimentalGroup, group = 'default', label, fillProps, ...props }) { if (__experimentalGroup) { external_wp_deprecated_default()('`__experimentalGroup` property in `InspectorControlsSlot`', { since: '6.2', version: '6.4', alternative: '`group`' }); group = __experimentalGroup; } const slotFill = inspector_controls_groups[group]; const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(slotFill?.name); if (!slotFill) { true ? external_wp_warning_default()(`Unknown InspectorControls group "${group}" provided.`) : 0; return null; } if (!fills?.length) { return null; } const { Slot } = slotFill; if (label) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockSupportToolsPanel, { group: group, label: label, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockSupportSlotContainer, { ...props, fillProps: fillProps, Slot: Slot }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Slot, { ...props, fillProps: fillProps, bubblesVirtually: true }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls/index.js /** * Internal dependencies */ const InspectorControls = InspectorControlsFill; InspectorControls.Slot = InspectorControlsSlot; // This is just here for backward compatibility. const InspectorAdvancedControls = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorControlsFill, { ...props, group: "advanced" }); }; InspectorAdvancedControls.Slot = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorControlsSlot, { ...props, group: "advanced" }); }; InspectorAdvancedControls.slotName = 'InspectorAdvancedControls'; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md */ /* harmony default export */ const inspector_controls = (InspectorControls); ;// external ["wp","url"] const external_wp_url_namespaceObject = window["wp"]["url"]; ;// external ["wp","dom"] const external_wp_dom_namespaceObject = window["wp"]["dom"]; ;// external ["wp","blob"] const external_wp_blob_namespaceObject = window["wp"]["blob"]; ;// external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// ./node_modules/@wordpress/icons/build-module/library/media.js /** * WordPress dependencies */ const media = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7 6.5 4 2.5-4 2.5z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z" })] }); /* harmony default export */ const library_media = (media); ;// ./node_modules/@wordpress/icons/build-module/library/upload.js /** * WordPress dependencies */ const upload = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" }) }); /* harmony default export */ const library_upload = (upload); ;// ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js /** * WordPress dependencies */ const postFeaturedImage = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z" }) }); /* harmony default export */ const post_featured_image = (postFeaturedImage); ;// ./node_modules/@wordpress/block-editor/build-module/components/media-upload/index.js /** * WordPress dependencies */ /** * This is a placeholder for the media upload component necessary to make it possible to provide * an integration with the core blocks that handle media files. By default it renders nothing but * it provides a way to have it overridden with the `editor.MediaUpload` filter. * * @return {Component} The component to be rendered. */ const MediaUpload = () => null; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md */ /* harmony default export */ const media_upload = ((0,external_wp_components_namespaceObject.withFilters)('editor.MediaUpload')(MediaUpload)); ;// ./node_modules/@wordpress/block-editor/build-module/components/media-upload/check.js /** * WordPress dependencies */ /** * Internal dependencies */ function MediaUploadCheck({ fallback = null, children }) { const hasUploadPermissions = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(store); return !!getSettings().mediaUpload; }, []); return hasUploadPermissions ? children : fallback; } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-upload/README.md */ /* harmony default export */ const check = (MediaUploadCheck); ;// external ["wp","isShallowEqual"] const external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"]; var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject); ;// ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js /** * WordPress dependencies */ const keyboardReturn = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-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" }) }); /* harmony default export */ const keyboard_return = (keyboardReturn); ;// ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js /** * WordPress dependencies */ const chevronLeftSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) }); /* harmony default export */ const chevron_left_small = (chevronLeftSmall); ;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js /** * WordPress dependencies */ const chevronRightSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) }); /* harmony default export */ const chevron_right_small = (chevronRightSmall); ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/settings-drawer.js /** * WordPress dependencies */ function LinkSettingsDrawer({ children, settingsOpen, setSettingsOpen }) { const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const MaybeAnimatePresence = prefersReducedMotion ? external_wp_element_namespaceObject.Fragment : external_wp_components_namespaceObject.__unstableAnimatePresence; const MaybeMotionDiv = prefersReducedMotion ? 'div' : external_wp_components_namespaceObject.__unstableMotion.div; const id = (0,external_wp_compose_namespaceObject.useInstanceId)(LinkSettingsDrawer); const settingsDrawerId = `link-control-settings-drawer-${id}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: "block-editor-link-control__drawer-toggle", "aria-expanded": settingsOpen, onClick: () => setSettingsOpen(!settingsOpen), icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_small : chevron_right_small, "aria-controls": settingsDrawerId, children: (0,external_wp_i18n_namespaceObject._x)('Advanced', 'Additional link settings') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MaybeAnimatePresence, { children: settingsOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MaybeMotionDiv, { className: "block-editor-link-control__drawer", hidden: !settingsOpen, id: settingsDrawerId, initial: "collapsed", animate: "open", exit: "collapsed", variants: { open: { opacity: 1, height: 'auto' }, collapsed: { opacity: 0, height: 0 } }, transition: { duration: 0.1 }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-link-control__drawer-inner", children: children }) }) })] }); } /* harmony default export */ const settings_drawer = (LinkSettingsDrawer); // EXTERNAL MODULE: external "React" var external_React_ = __webpack_require__(1609); ;// ./node_modules/@wordpress/block-editor/build-module/components/url-input/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Whether the argument is a function. * * @param {*} maybeFunc The argument to check. * @return {boolean} True if the argument is a function, false otherwise. */ function isFunction(maybeFunc) { return typeof maybeFunc === 'function'; } class URLInput extends external_wp_element_namespaceObject.Component { constructor(props) { super(props); this.onChange = this.onChange.bind(this); this.onFocus = this.onFocus.bind(this); this.onKeyDown = this.onKeyDown.bind(this); this.selectLink = this.selectLink.bind(this); this.handleOnClick = this.handleOnClick.bind(this); this.bindSuggestionNode = this.bindSuggestionNode.bind(this); this.autocompleteRef = props.autocompleteRef || (0,external_wp_element_namespaceObject.createRef)(); this.inputRef = (0,external_wp_element_namespaceObject.createRef)(); this.updateSuggestions = (0,external_wp_compose_namespaceObject.debounce)(this.updateSuggestions.bind(this), 200); this.suggestionNodes = []; this.suggestionsRequest = null; this.state = { suggestions: [], showSuggestions: false, suggestionsValue: null, selectedSuggestion: null, suggestionsListboxId: '', suggestionOptionIdPrefix: '' }; } componentDidUpdate(prevProps) { const { showSuggestions, selectedSuggestion } = this.state; const { value, __experimentalShowInitialSuggestions = false } = this.props; // Only have to worry about scrolling selected suggestion into view // when already expanded. if (showSuggestions && selectedSuggestion !== null && this.suggestionNodes[selectedSuggestion]) { this.suggestionNodes[selectedSuggestion].scrollIntoView({ behavior: 'instant', block: 'nearest', inline: 'nearest' }); } // Update suggestions when the value changes. if (prevProps.value !== value && !this.props.disableSuggestions) { if (value?.length) { // If the new value is not empty we need to update with suggestions for it. this.updateSuggestions(value); } else if (__experimentalShowInitialSuggestions) { // If the new value is empty and we can show initial suggestions, then show initial suggestions. this.updateSuggestions(); } } } componentDidMount() { if (this.shouldShowInitialSuggestions()) { this.updateSuggestions(); } } componentWillUnmount() { this.suggestionsRequest?.cancel?.(); this.suggestionsRequest = null; } bindSuggestionNode(index) { return ref => { this.suggestionNodes[index] = ref; }; } shouldShowInitialSuggestions() { const { __experimentalShowInitialSuggestions = false, value } = this.props; return __experimentalShowInitialSuggestions && !(value && value.length); } updateSuggestions(value = '') { const { __experimentalFetchLinkSuggestions: fetchLinkSuggestions, __experimentalHandleURLSuggestions: handleURLSuggestions } = this.props; if (!fetchLinkSuggestions) { return; } // Initial suggestions may only show if there is no value // (note: this includes whitespace). const isInitialSuggestions = !value?.length; // Trim only now we've determined whether or not it originally had a "length" // (even if that value was all whitespace). value = value.trim(); // Allow a suggestions request if: // - there are at least 2 characters in the search input (except manual searches where // search input length is not required to trigger a fetch) // - this is a direct entry (eg: a URL) if (!isInitialSuggestions && (value.length < 2 || !handleURLSuggestions && (0,external_wp_url_namespaceObject.isURL)(value))) { this.suggestionsRequest?.cancel?.(); this.suggestionsRequest = null; this.setState({ suggestions: [], showSuggestions: false, suggestionsValue: value, selectedSuggestion: null, loading: false }); return; } this.setState({ selectedSuggestion: null, loading: true }); const request = fetchLinkSuggestions(value, { isInitialSuggestions }); request.then(suggestions => { // A fetch Promise doesn't have an abort option. It's mimicked by // comparing the request reference in on the instance, which is // reset or deleted on subsequent requests or unmounting. if (this.suggestionsRequest !== request) { return; } this.setState({ suggestions, suggestionsValue: value, loading: false, showSuggestions: !!suggestions.length }); if (!!suggestions.length) { this.props.debouncedSpeak((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of results. */ (0,external_wp_i18n_namespaceObject._n)('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', suggestions.length), suggestions.length), 'assertive'); } else { this.props.debouncedSpeak((0,external_wp_i18n_namespaceObject.__)('No results.'), 'assertive'); } }).catch(() => { if (this.suggestionsRequest !== request) { return; } this.setState({ loading: false }); }).finally(() => { // If this is the current promise then reset the reference // to allow for checking if a new request is made. if (this.suggestionsRequest === request) { this.suggestionsRequest = null; } }); // Note that this assignment is handled *before* the async search request // as a Promise always resolves on the next tick of the event loop. this.suggestionsRequest = request; } onChange(newValue) { this.props.onChange(newValue); } onFocus() { const { suggestions } = this.state; const { disableSuggestions, value } = this.props; // When opening the link editor, if there's a value present, we want to load the suggestions pane with the results for this input search value // Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons) // or there is already a request in progress. if (value && !disableSuggestions && !(suggestions && suggestions.length) && this.suggestionsRequest === null) { // Ensure the suggestions are updated with the current input value. this.updateSuggestions(value); } } onKeyDown(event) { this.props.onKeyDown?.(event); const { showSuggestions, selectedSuggestion, suggestions, loading } = this.state; // If the suggestions are not shown or loading, we shouldn't handle the arrow keys // We shouldn't preventDefault to allow block arrow keys navigation. if (!showSuggestions || !suggestions.length || loading) { // In the Windows version of Firefox the up and down arrows don't move the caret // within an input field like they do for Mac Firefox/Chrome/Safari. This causes // a form of focus trapping that is disruptive to the user experience. This disruption // only happens if the caret is not in the first or last position in the text input. // See: https://github.com/WordPress/gutenberg/issues/5693#issuecomment-436684747 switch (event.keyCode) { // When UP is pressed, if the caret is at the start of the text, move it to the 0 // position. case external_wp_keycodes_namespaceObject.UP: { if (0 !== event.target.selectionStart) { event.preventDefault(); // Set the input caret to position 0. event.target.setSelectionRange(0, 0); } break; } // When DOWN is pressed, if the caret is not at the end of the text, move it to the // last position. case external_wp_keycodes_namespaceObject.DOWN: { if (this.props.value.length !== event.target.selectionStart) { event.preventDefault(); // Set the input caret to the last position. event.target.setSelectionRange(this.props.value.length, this.props.value.length); } break; } // Submitting while loading should trigger onSubmit. case external_wp_keycodes_namespaceObject.ENTER: { if (this.props.onSubmit) { event.preventDefault(); this.props.onSubmit(null, event); } break; } } return; } const suggestion = this.state.suggestions[this.state.selectedSuggestion]; switch (event.keyCode) { case external_wp_keycodes_namespaceObject.UP: { event.preventDefault(); const previousIndex = !selectedSuggestion ? suggestions.length - 1 : selectedSuggestion - 1; this.setState({ selectedSuggestion: previousIndex }); break; } case external_wp_keycodes_namespaceObject.DOWN: { event.preventDefault(); const nextIndex = selectedSuggestion === null || selectedSuggestion === suggestions.length - 1 ? 0 : selectedSuggestion + 1; this.setState({ selectedSuggestion: nextIndex }); break; } case external_wp_keycodes_namespaceObject.TAB: { if (this.state.selectedSuggestion !== null) { this.selectLink(suggestion); // Announce a link has been selected when tabbing away from the input field. this.props.speak((0,external_wp_i18n_namespaceObject.__)('Link selected.')); } break; } case external_wp_keycodes_namespaceObject.ENTER: { event.preventDefault(); if (this.state.selectedSuggestion !== null) { this.selectLink(suggestion); if (this.props.onSubmit) { this.props.onSubmit(suggestion, event); } } else if (this.props.onSubmit) { this.props.onSubmit(null, event); } break; } } } selectLink(suggestion) { this.props.onChange(suggestion.url, suggestion); this.setState({ selectedSuggestion: null, showSuggestions: false }); } handleOnClick(suggestion) { this.selectLink(suggestion); // Move focus to the input field when a link suggestion is clicked. this.inputRef.current.focus(); } static getDerivedStateFromProps({ value, instanceId, disableSuggestions, __experimentalShowInitialSuggestions = false }, { showSuggestions }) { let shouldShowSuggestions = showSuggestions; const hasValue = value && value.length; if (!__experimentalShowInitialSuggestions && !hasValue) { shouldShowSuggestions = false; } if (disableSuggestions === true) { shouldShowSuggestions = false; } return { showSuggestions: shouldShowSuggestions, suggestionsListboxId: `block-editor-url-input-suggestions-${instanceId}`, suggestionOptionIdPrefix: `block-editor-url-input-suggestion-${instanceId}` }; } render() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [this.renderControl(), this.renderSuggestions()] }); } renderControl() { const { label = null, className, isFullWidth, instanceId, placeholder = (0,external_wp_i18n_namespaceObject.__)('Paste URL or type to search'), __experimentalRenderControl: renderControl, value = '', hideLabelFromVision = false } = this.props; const { loading, showSuggestions, selectedSuggestion, suggestionsListboxId, suggestionOptionIdPrefix } = this.state; const inputId = `url-input-control-${instanceId}`; const controlProps = { id: inputId, // Passes attribute to label for the for attribute label, className: dist_clsx('block-editor-url-input', className, { 'is-full-width': isFullWidth }), hideLabelFromVision }; const inputProps = { id: inputId, value, required: true, type: 'text', onChange: this.onChange, onFocus: this.onFocus, placeholder, onKeyDown: this.onKeyDown, role: 'combobox', 'aria-label': label ? undefined : (0,external_wp_i18n_namespaceObject.__)('URL'), // Ensure input always has an accessible label 'aria-expanded': showSuggestions, 'aria-autocomplete': 'list', 'aria-owns': suggestionsListboxId, 'aria-activedescendant': selectedSuggestion !== null ? `${suggestionOptionIdPrefix}-${selectedSuggestion}` : undefined, ref: this.inputRef, suffix: this.props.suffix }; if (renderControl) { return renderControl(controlProps, inputProps, loading); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.BaseControl, { __nextHasNoMarginBottom: true, ...controlProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { ...inputProps, __next40pxDefaultSize: true }), loading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})] }); } renderSuggestions() { const { className, __experimentalRenderSuggestions: renderSuggestions } = this.props; const { showSuggestions, suggestions, suggestionsValue, selectedSuggestion, suggestionsListboxId, suggestionOptionIdPrefix, loading } = this.state; if (!showSuggestions || suggestions.length === 0) { return null; } const suggestionsListProps = { id: suggestionsListboxId, ref: this.autocompleteRef, role: 'listbox' }; const buildSuggestionItemProps = (suggestion, index) => { return { role: 'option', tabIndex: '-1', id: `${suggestionOptionIdPrefix}-${index}`, ref: this.bindSuggestionNode(index), 'aria-selected': index === selectedSuggestion ? true : undefined }; }; if (isFunction(renderSuggestions)) { return renderSuggestions({ suggestions, selectedSuggestion, suggestionsListProps, buildSuggestionItemProps, isLoading: loading, handleSuggestionClick: this.handleOnClick, isInitialSuggestions: !suggestionsValue?.length, currentInputValue: suggestionsValue }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { placement: "bottom", focusOnMount: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...suggestionsListProps, className: dist_clsx('block-editor-url-input__suggestions', { [`${className}__suggestions`]: className }), children: suggestions.map((suggestion, index) => /*#__PURE__*/(0,external_React_.createElement)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ...buildSuggestionItemProps(suggestion, index), key: suggestion.id, className: dist_clsx('block-editor-url-input__suggestion', { 'is-selected': index === selectedSuggestion }), onClick: () => this.handleOnClick(suggestion) }, suggestion.title)) }) }); } } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md */ /* harmony default export */ const url_input = ((0,external_wp_compose_namespaceObject.compose)(external_wp_compose_namespaceObject.withSafeTimeout, external_wp_components_namespaceObject.withSpokenMessages, external_wp_compose_namespaceObject.withInstanceId, (0,external_wp_data_namespaceObject.withSelect)((select, props) => { // If a link suggestions handler is already provided then // bail. if (isFunction(props.__experimentalFetchLinkSuggestions)) { return; } const { getSettings } = select(store); return { __experimentalFetchLinkSuggestions: getSettings().__experimentalFetchLinkSuggestions }; }))(URLInput)); ;// ./node_modules/@wordpress/icons/build-module/library/plus.js /** * WordPress dependencies */ const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) }); /* harmony default export */ const library_plus = (plus); ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-create-button.js /** * WordPress dependencies */ const LinkControlSearchCreate = ({ searchTerm, onClick, itemProps, buttonText }) => { if (!searchTerm) { return null; } let text; if (buttonText) { text = typeof buttonText === 'function' ? buttonText(searchTerm) : buttonText; } else { text = (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: search term. */ (0,external_wp_i18n_namespaceObject.__)('Create: <mark>%s</mark>'), searchTerm), { mark: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {}) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { ...itemProps, iconPosition: "left", icon: library_plus, className: "block-editor-link-control__search-item", onClick: onClick, children: text }); }; /* harmony default export */ const search_create_button = (LinkControlSearchCreate); ;// ./node_modules/@wordpress/icons/build-module/library/post-list.js /** * WordPress dependencies */ const postList = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z" }) }); /* harmony default export */ const post_list = (postList); ;// ./node_modules/@wordpress/icons/build-module/library/page.js /** * WordPress dependencies */ const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" })] }); /* harmony default export */ const library_page = (page); ;// ./node_modules/@wordpress/icons/build-module/library/tag.js /** * WordPress dependencies */ const tag = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" }) }); /* harmony default export */ const library_tag = (tag); ;// ./node_modules/@wordpress/icons/build-module/library/category.js /** * WordPress dependencies */ const category = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z", fillRule: "evenodd", clipRule: "evenodd" }) }); /* harmony default export */ const library_category = (category); ;// ./node_modules/@wordpress/icons/build-module/library/file.js /** * WordPress dependencies */ const file = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" }) }); /* harmony default export */ const library_file = (file); ;// ./node_modules/@wordpress/icons/build-module/library/globe.js /** * WordPress dependencies */ const globe = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z" }) }); /* harmony default export */ const library_globe = (globe); ;// ./node_modules/@wordpress/icons/build-module/library/home.js /** * WordPress dependencies */ const home = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" }) }); /* harmony default export */ const library_home = (home); ;// ./node_modules/@wordpress/icons/build-module/library/verse.js /** * WordPress dependencies */ const verse = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" }) }); /* harmony default export */ const library_verse = (verse); ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-item.js /** * WordPress dependencies */ const ICONS_MAP = { post: post_list, page: library_page, post_tag: library_tag, category: library_category, attachment: library_file }; function SearchItemIcon({ isURL, suggestion }) { let icon = null; if (isURL) { icon = library_globe; } else if (suggestion.type in ICONS_MAP) { icon = ICONS_MAP[suggestion.type]; if (suggestion.type === 'page') { if (suggestion.isFrontPage) { icon = library_home; } if (suggestion.isBlogHome) { icon = library_verse; } } } if (icon) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { className: "block-editor-link-control__search-item-icon", icon: icon }); } return null; } /** * Adds a leading slash to a url if it doesn't already have one. * @param {string} url the url to add a leading slash to. * @return {string} the url with a leading slash. */ function addLeadingSlash(url) { const trimmedURL = url?.trim(); if (!trimmedURL?.length) { return url; } return url?.replace(/^\/?/, '/'); } function removeTrailingSlash(url) { const trimmedURL = url?.trim(); if (!trimmedURL?.length) { return url; } return url?.replace(/\/$/, ''); } const partialRight = (fn, ...partialArgs) => (...args) => fn(...args, ...partialArgs); const defaultTo = d => v => { return v === null || v === undefined || v !== v ? d : v; }; /** * Prepares a URL for display in the UI. * - decodes the URL. * - filters it (removes protocol, www, etc.). * - truncates it if necessary. * - adds a leading slash. * @param {string} url the url. * @return {string} the processed url to display. */ function getURLForDisplay(url) { if (!url) { return url; } return (0,external_wp_compose_namespaceObject.pipe)(external_wp_url_namespaceObject.safeDecodeURI, external_wp_url_namespaceObject.getPath, defaultTo(''), partialRight(external_wp_url_namespaceObject.filterURLForDisplay, 24), removeTrailingSlash, addLeadingSlash)(url); } const LinkControlSearchItem = ({ itemProps, suggestion, searchTerm, onClick, isURL = false, shouldShowType = false }) => { const info = isURL ? (0,external_wp_i18n_namespaceObject.__)('Press ENTER to add this link') : getURLForDisplay(suggestion.url); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { ...itemProps, info: info, iconPosition: "left", icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SearchItemIcon, { suggestion: suggestion, isURL: isURL }), onClick: onClick, shortcut: shouldShowType && getVisualTypeName(suggestion), className: "block-editor-link-control__search-item", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextHighlight // The component expects a plain text string. , { text: (0,external_wp_dom_namespaceObject.__unstableStripHTML)(suggestion.title), highlight: searchTerm }) }); }; function getVisualTypeName(suggestion) { if (suggestion.isFrontPage) { return 'front page'; } if (suggestion.isBlogHome) { return 'blog home'; } // Rename 'post_tag' to 'tag'. Ideally, the API would return the localised CPT or taxonomy label. return suggestion.type === 'post_tag' ? 'tag' : suggestion.type; } /* harmony default export */ const search_item = (LinkControlSearchItem); const __experimentalLinkControlSearchItem = props => { external_wp_deprecated_default()('wp.blockEditor.__experimentalLinkControlSearchItem', { since: '6.8' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkControlSearchItem, { ...props }); }; ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/constants.js /** * WordPress dependencies */ // Used as a unique identifier for the "Create" option within search results. // Used to help distinguish the "Create" suggestion within the search results in // order to handle it as a unique case. const CREATE_TYPE = '__CREATE__'; const TEL_TYPE = 'tel'; const URL_TYPE = 'link'; const MAILTO_TYPE = 'mailto'; const INTERNAL_TYPE = 'internal'; const LINK_ENTRY_TYPES = [URL_TYPE, MAILTO_TYPE, TEL_TYPE, INTERNAL_TYPE]; const DEFAULT_LINK_SETTINGS = [{ id: 'opensInNewTab', title: (0,external_wp_i18n_namespaceObject.__)('Open in new tab') }]; ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-results.js /** * WordPress dependencies */ /** * External dependencies */ /** * Internal dependencies */ function LinkControlSearchResults({ withCreateSuggestion, currentInputValue, handleSuggestionClick, suggestionsListProps, buildSuggestionItemProps, suggestions, selectedSuggestion, isLoading, isInitialSuggestions, createSuggestionButtonText, suggestionsQuery }) { const resultsListClasses = dist_clsx('block-editor-link-control__search-results', { 'is-loading': isLoading }); const isSingleDirectEntryResult = suggestions.length === 1 && LINK_ENTRY_TYPES.includes(suggestions[0].type); const shouldShowCreateSuggestion = withCreateSuggestion && !isSingleDirectEntryResult && !isInitialSuggestions; // If the query has a specified type, then we can skip showing them in the result. See #24839. const shouldShowSuggestionsTypes = !suggestionsQuery?.type; const labelText = isInitialSuggestions ? (0,external_wp_i18n_namespaceObject.__)('Suggestions') : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: search term. */ (0,external_wp_i18n_namespaceObject.__)('Search results for "%s"'), currentInputValue); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-link-control__search-results-wrapper", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...suggestionsListProps, className: resultsListClasses, "aria-label": labelText, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: suggestions.map((suggestion, index) => { if (shouldShowCreateSuggestion && CREATE_TYPE === suggestion.type) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(search_create_button, { searchTerm: currentInputValue, buttonText: createSuggestionButtonText, onClick: () => handleSuggestionClick(suggestion) // Intentionally only using `type` here as // the constant is enough to uniquely // identify the single "CREATE" suggestion. , itemProps: buildSuggestionItemProps(suggestion, index), isSelected: index === selectedSuggestion }, suggestion.type); } // If we're not handling "Create" suggestions above then // we don't want them in the main results so exit early. if (CREATE_TYPE === suggestion.type) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(search_item, { itemProps: buildSuggestionItemProps(suggestion, index), suggestion: suggestion, index: index, onClick: () => { handleSuggestionClick(suggestion); }, isSelected: index === selectedSuggestion, isURL: LINK_ENTRY_TYPES.includes(suggestion.type), searchTerm: currentInputValue, shouldShowType: shouldShowSuggestionsTypes, isFrontPage: suggestion?.isFrontPage, isBlogHome: suggestion?.isBlogHome }, `${suggestion.id}-${suggestion.type}`); }) }) }) }); } /* harmony default export */ const search_results = (LinkControlSearchResults); const __experimentalLinkControlSearchResults = props => { external_wp_deprecated_default()('wp.blockEditor.__experimentalLinkControlSearchResults', { since: '6.8' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkControlSearchResults, { ...props }); }; ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/is-url-like.js /** * WordPress dependencies */ /** * Determines whether a given value could be a URL. Note this does not * guarantee the value is a URL only that it looks like it might be one. For * example, just because a string has `www.` in it doesn't make it a URL, * but it does make it highly likely that it will be so in the context of * creating a link it makes sense to treat it like one. * * @param {string} val the candidate for being URL-like (or not). * * @return {boolean} whether or not the value is potentially a URL. */ function isURLLike(val) { const hasSpaces = val.includes(' '); if (hasSpaces) { return false; } const protocol = (0,external_wp_url_namespaceObject.getProtocol)(val); const protocolIsValid = (0,external_wp_url_namespaceObject.isValidProtocol)(protocol); const mayBeTLD = hasPossibleTLD(val); const isWWW = val?.startsWith('www.'); const isInternal = val?.startsWith('#') && (0,external_wp_url_namespaceObject.isValidFragment)(val); return protocolIsValid || isWWW || isInternal || mayBeTLD; } /** * Checks if a given URL has a valid Top-Level Domain (TLD). * * @param {string} url - The URL to check. * @param {number} maxLength - The maximum length of the TLD. * @return {boolean} Returns true if the URL has a valid TLD, false otherwise. */ function hasPossibleTLD(url, maxLength = 6) { // Clean the URL by removing anything after the first occurrence of "?" or "#". const cleanedURL = url.split(/[?#]/)[0]; // Regular expression explanation: // - (?<=\S) : Positive lookbehind assertion to ensure there is at least one non-whitespace character before the TLD // - \. : Matches a literal dot (.) // - [a-zA-Z_]{2,maxLength} : Matches 2 to maxLength letters or underscores, representing the TLD // - (?:\/|$) : Non-capturing group that matches either a forward slash (/) or the end of the string const regex = new RegExp(`(?<=\\S)\\.(?:[a-zA-Z_]{2,${maxLength}})(?:\\/|$)`); return regex.test(cleanedURL); } ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-search-handler.js /** * WordPress dependencies */ /** * Internal dependencies */ const handleNoop = () => Promise.resolve([]); const handleDirectEntry = val => { let type = URL_TYPE; const protocol = (0,external_wp_url_namespaceObject.getProtocol)(val) || ''; if (protocol.includes('mailto')) { type = MAILTO_TYPE; } if (protocol.includes('tel')) { type = TEL_TYPE; } if (val?.startsWith('#')) { type = INTERNAL_TYPE; } return Promise.resolve([{ id: val, title: val, url: type === 'URL' ? (0,external_wp_url_namespaceObject.prependHTTP)(val) : val, type }]); }; const handleEntitySearch = async (val, suggestionsQuery, fetchSearchSuggestions, withCreateSuggestion, pageOnFront, pageForPosts) => { const { isInitialSuggestions } = suggestionsQuery; const results = await fetchSearchSuggestions(val, suggestionsQuery); // Identify front page and update type to match. results.map(result => { if (Number(result.id) === pageOnFront) { result.isFrontPage = true; return result; } else if (Number(result.id) === pageForPosts) { result.isBlogHome = true; return result; } return result; }); // If displaying initial suggestions just return plain results. if (isInitialSuggestions) { return results; } // Here we append a faux suggestion to represent a "CREATE" option. This // is detected in the rendering of the search results and handled as a // special case. This is currently necessary because the suggestions // dropdown will only appear if there are valid suggestions and // therefore unless the create option is a suggestion it will not // display in scenarios where there are no results returned from the // API. In addition promoting CREATE to a first class suggestion affords // the a11y benefits afforded by `URLInput` to all suggestions (eg: // keyboard handling, ARIA roles...etc). // // Note also that the value of the `title` and `url` properties must correspond // to the text value of the `<input>`. This is because `title` is used // when creating the suggestion. Similarly `url` is used when using keyboard to select // the suggestion (the <form> `onSubmit` handler falls-back to `url`). return isURLLike(val) || !withCreateSuggestion ? results : results.concat({ // the `id` prop is intentionally omitted here because it // is never exposed as part of the component's public API. // see: https://github.com/WordPress/gutenberg/pull/19775#discussion_r378931316. title: val, // Must match the existing `<input>`s text value. url: val, // Must match the existing `<input>`s text value. type: CREATE_TYPE }); }; function useSearchHandler(suggestionsQuery, allowDirectEntry, withCreateSuggestion) { const { fetchSearchSuggestions, pageOnFront, pageForPosts } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(store); return { pageOnFront: getSettings().pageOnFront, pageForPosts: getSettings().pageForPosts, fetchSearchSuggestions: getSettings().__experimentalFetchLinkSuggestions }; }, []); const directEntryHandler = allowDirectEntry ? handleDirectEntry : handleNoop; return (0,external_wp_element_namespaceObject.useCallback)((val, { isInitialSuggestions }) => { return isURLLike(val) ? directEntryHandler(val, { isInitialSuggestions }) : handleEntitySearch(val, { ...suggestionsQuery, isInitialSuggestions }, fetchSearchSuggestions, withCreateSuggestion, pageOnFront, pageForPosts); }, [directEntryHandler, fetchSearchSuggestions, pageOnFront, pageForPosts, suggestionsQuery, withCreateSuggestion]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/search-input.js /** * WordPress dependencies */ /** * Internal dependencies */ // Must be a function as otherwise URLInput will default // to the fetchLinkSuggestions passed in block editor settings // which will cause an unintended http request. const noopSearchHandler = () => Promise.resolve([]); const noop = () => {}; const LinkControlSearchInput = (0,external_wp_element_namespaceObject.forwardRef)(({ value, children, currentLink = {}, className = null, placeholder = null, withCreateSuggestion = false, onCreateSuggestion = noop, onChange = noop, onSelect = noop, showSuggestions = true, renderSuggestions = props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(search_results, { ...props }), fetchSuggestions = null, allowDirectEntry = true, showInitialSuggestions = false, suggestionsQuery = {}, withURLSuggestion = true, createSuggestionButtonText, hideLabelFromVision = false, suffix }, ref) => { const genericSearchHandler = useSearchHandler(suggestionsQuery, allowDirectEntry, withCreateSuggestion, withURLSuggestion); const searchHandler = showSuggestions ? fetchSuggestions || genericSearchHandler : noopSearchHandler; const [focusedSuggestion, setFocusedSuggestion] = (0,external_wp_element_namespaceObject.useState)(); /** * Handles the user moving between different suggestions. Does not handle * choosing an individual item. * * @param {string} selection the url of the selected suggestion. * @param {Object} suggestion the suggestion object. */ const onInputChange = (selection, suggestion) => { onChange(selection); setFocusedSuggestion(suggestion); }; const handleRenderSuggestions = props => renderSuggestions({ ...props, withCreateSuggestion, createSuggestionButtonText, suggestionsQuery, handleSuggestionClick: suggestion => { if (props.handleSuggestionClick) { props.handleSuggestionClick(suggestion); } onSuggestionSelected(suggestion); } }); const onSuggestionSelected = async selectedSuggestion => { let suggestion = selectedSuggestion; if (CREATE_TYPE === selectedSuggestion.type) { // Create a new page and call onSelect with the output from the onCreateSuggestion callback. try { suggestion = await onCreateSuggestion(selectedSuggestion.title); if (suggestion?.url) { onSelect(suggestion); } } catch (e) {} return; } if (allowDirectEntry || suggestion && Object.keys(suggestion).length >= 1) { const { id, url, ...restLinkProps } = currentLink !== null && currentLink !== void 0 ? currentLink : {}; onSelect( // Some direct entries don't have types or IDs, and we still need to clear the previous ones. { ...restLinkProps, ...suggestion }, suggestion); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-link-control__search-input-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(url_input, { disableSuggestions: currentLink?.url === value, label: (0,external_wp_i18n_namespaceObject.__)('Link'), hideLabelFromVision: hideLabelFromVision, className: className, value: value, onChange: onInputChange, placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : (0,external_wp_i18n_namespaceObject.__)('Search or type URL'), __experimentalRenderSuggestions: showSuggestions ? handleRenderSuggestions : null, __experimentalFetchLinkSuggestions: searchHandler, __experimentalHandleURLSuggestions: true, __experimentalShowInitialSuggestions: showInitialSuggestions, onSubmit: (suggestion, event) => { const hasSuggestion = suggestion || focusedSuggestion; // If there is no suggestion and the value (ie: any manually entered URL) is empty // then don't allow submission otherwise we get empty links. if (!hasSuggestion && !value?.trim()?.length) { event.preventDefault(); } else { onSuggestionSelected(hasSuggestion || { url: value }); } }, ref: ref, suffix: suffix }), children] }); }); /* harmony default export */ const search_input = (LinkControlSearchInput); const __experimentalLinkControlSearchInput = props => { external_wp_deprecated_default()('wp.blockEditor.__experimentalLinkControlSearchInput', { since: '6.8' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkControlSearchInput, { ...props }); }; ;// ./node_modules/@wordpress/icons/build-module/library/info.js /** * WordPress dependencies */ const info = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" }) }); /* harmony default export */ const library_info = (info); ;// ./node_modules/@wordpress/icons/build-module/library/pencil.js /** * WordPress dependencies */ const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) }); /* harmony default export */ const library_pencil = (pencil); ;// ./node_modules/@wordpress/icons/build-module/library/edit.js /** * Internal dependencies */ /* harmony default export */ const edit = (library_pencil); ;// ./node_modules/@wordpress/icons/build-module/library/link-off.js /** * WordPress dependencies */ const linkOff = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" }) }); /* harmony default export */ const link_off = (linkOff); ;// ./node_modules/@wordpress/icons/build-module/library/copy-small.js /** * WordPress dependencies */ const copySmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z" }) }); /* harmony default export */ const copy_small = (copySmall); ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/viewer-slot.js /** * WordPress dependencies */ const { Slot: ViewerSlot, Fill: ViewerFill } = (0,external_wp_components_namespaceObject.createSlotFill)('BlockEditorLinkControlViewer'); /* harmony default export */ const viewer_slot = ((/* unused pure expression or super */ null && (ViewerSlot))); ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-rich-url-data.js /** * Internal dependencies */ /** * WordPress dependencies */ function use_rich_url_data_reducer(state, action) { switch (action.type) { case 'RESOLVED': return { ...state, isFetching: false, richData: action.richData }; case 'ERROR': return { ...state, isFetching: false, richData: null }; case 'LOADING': return { ...state, isFetching: true }; default: throw new Error(`Unexpected action type ${action.type}`); } } function useRemoteUrlData(url) { const [state, dispatch] = (0,external_wp_element_namespaceObject.useReducer)(use_rich_url_data_reducer, { richData: null, isFetching: false }); const { fetchRichUrlData } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(store); return { fetchRichUrlData: getSettings().__experimentalFetchRichUrlData }; }, []); (0,external_wp_element_namespaceObject.useEffect)(() => { // Only make the request if we have an actual URL // and the fetching util is available. In some editors // there may not be such a util. if (url?.length && fetchRichUrlData && typeof AbortController !== 'undefined') { dispatch({ type: 'LOADING' }); const controller = new window.AbortController(); const signal = controller.signal; fetchRichUrlData(url, { signal }).then(urlData => { dispatch({ type: 'RESOLVED', richData: urlData }); }).catch(() => { // Avoid setting state on unmounted component if (!signal.aborted) { dispatch({ type: 'ERROR' }); } }); // Cleanup: when the URL changes the abort the current request. return () => { controller.abort(); }; } }, [url]); return state; } /* harmony default export */ const use_rich_url_data = (useRemoteUrlData); ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/link-preview.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Filters the title for display. Removes the protocol and www prefix. * * @param {string} title The title to be filtered. * * @return {string} The filtered title. */ function filterTitleForDisplay(title) { // Derived from `filterURLForDisplay` in `@wordpress/url`. return title.replace(/^[a-z\-.\+]+[0-9]*:(\/\/)?/i, '').replace(/^www\./i, ''); } function LinkPreview({ value, onEditClick, hasRichPreviews = false, hasUnlinkControl = false, onRemove }) { const showIconLabels = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_preferences_namespaceObject.store).get('core', 'showIconLabels'), []); // Avoid fetching if rich previews are not desired. const showRichPreviews = hasRichPreviews ? value?.url : null; const { richData, isFetching } = use_rich_url_data(showRichPreviews); // Rich data may be an empty object so test for that. const hasRichData = richData && Object.keys(richData).length; const displayURL = value && (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(value.url), 24) || ''; // url can be undefined if the href attribute is unset const isEmptyURL = !value?.url?.length; const displayTitle = !isEmptyURL && (0,external_wp_dom_namespaceObject.__unstableStripHTML)(richData?.title || value?.title || displayURL); const isUrlRedundant = !value?.url || filterTitleForDisplay(displayTitle) === displayURL; let icon; if (richData?.icon) { icon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: richData?.icon, alt: "" }); } else if (isEmptyURL) { icon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_info, size: 32 }); } else { icon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_globe }); } const { createNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(value.url, () => { createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Link copied to clipboard.'), { isDismissible: true, type: 'snackbar' }); }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "group", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Manage link'), className: dist_clsx('block-editor-link-control__search-item', { 'is-current': true, 'is-rich': hasRichData, 'is-fetching': !!isFetching, 'is-preview': true, 'is-error': isEmptyURL, 'is-url-title': displayTitle === displayURL }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-link-control__search-item-top", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: "block-editor-link-control__search-item-header", role: "figure", "aria-label": /* translators: Accessibility text for the link preview when editing a link. */ (0,external_wp_i18n_namespaceObject.__)('Link information'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: dist_clsx('block-editor-link-control__search-item-icon', { 'is-image': richData?.icon }), children: icon }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-link-control__search-item-details", children: !isEmptyURL ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { className: "block-editor-link-control__search-item-title", href: value.url, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 1, children: displayTitle }) }), !isUrlRedundant && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-link-control__search-item-info", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 1, children: displayURL }) })] }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-link-control__search-item-error-notice", children: (0,external_wp_i18n_namespaceObject.__)('Link is empty') }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { icon: edit, label: (0,external_wp_i18n_namespaceObject.__)('Edit link'), onClick: onEditClick, size: "compact", showTooltip: !showIconLabels }), hasUnlinkControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { icon: link_off, label: (0,external_wp_i18n_namespaceObject.__)('Remove link'), onClick: onRemove, size: "compact", showTooltip: !showIconLabels }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { icon: copy_small, label: (0,external_wp_i18n_namespaceObject.__)('Copy link'), ref: ref, accessibleWhenDisabled: true, disabled: isEmptyURL, size: "compact", showTooltip: !showIconLabels }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ViewerSlot, { fillProps: value })] }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/settings.js /** * WordPress dependencies */ const settings_noop = () => {}; const LinkControlSettings = ({ value, onChange = settings_noop, settings }) => { if (!settings || !settings.length) { return null; } const handleSettingChange = setting => newValue => { onChange({ ...value, [setting.id]: newValue }); }; const theSettings = settings.map(setting => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { __nextHasNoMarginBottom: true, className: "block-editor-link-control__setting", label: setting.title, onChange: handleSettingChange(setting), checked: value ? !!value[setting.id] : false, help: setting?.help }, setting.id)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "block-editor-link-control__settings", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)('Currently selected link settings') }), theSettings] }); }; /* harmony default export */ const link_control_settings = (LinkControlSettings); ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-create-page.js /** * WordPress dependencies */ function useCreatePage(handleCreatePage) { const cancelableCreateSuggestion = (0,external_wp_element_namespaceObject.useRef)(); const [isCreatingPage, setIsCreatingPage] = (0,external_wp_element_namespaceObject.useState)(false); const [errorMessage, setErrorMessage] = (0,external_wp_element_namespaceObject.useState)(null); const createPage = async function (suggestionTitle) { setIsCreatingPage(true); setErrorMessage(null); try { // Make cancellable in order that we can avoid setting State // if the component unmounts during the call to `createSuggestion` cancelableCreateSuggestion.current = makeCancelable( // Using Promise.resolve to allow createSuggestion to return a // non-Promise based value. Promise.resolve(handleCreatePage(suggestionTitle))); return await cancelableCreateSuggestion.current.promise; } catch (error) { if (error && error.isCanceled) { return; // bail if canceled to avoid setting state } setErrorMessage(error.message || (0,external_wp_i18n_namespaceObject.__)('An unknown error occurred during creation. Please try again.')); throw error; } finally { setIsCreatingPage(false); } }; /** * Handles cancelling any pending Promises that have been made cancelable. */ (0,external_wp_element_namespaceObject.useEffect)(() => { return () => { // componentDidUnmount if (cancelableCreateSuggestion.current) { cancelableCreateSuggestion.current.cancel(); } }; }, []); return { createPage, isCreatingPage, errorMessage }; } /** * Creates a wrapper around a promise which allows it to be programmatically * cancelled. * See: https://reactjs.org/blog/2015/12/16/ismounted-antipattern.html * * @param {Promise} promise the Promise to make cancelable */ const makeCancelable = promise => { let hasCanceled_ = false; const wrappedPromise = new Promise((resolve, reject) => { promise.then(val => hasCanceled_ ? reject({ isCanceled: true }) : resolve(val), error => hasCanceled_ ? reject({ isCanceled: true }) : reject(error)); }); return { promise: wrappedPromise, cancel() { hasCanceled_ = true; } }; }; // EXTERNAL MODULE: ./node_modules/fast-deep-equal/index.js var fast_deep_equal = __webpack_require__(5215); var fast_deep_equal_default = /*#__PURE__*/__webpack_require__.n(fast_deep_equal); ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/use-internal-value.js /** * WordPress dependencies */ /** * External dependencies */ function useInternalValue(value) { const [internalValue, setInternalValue] = (0,external_wp_element_namespaceObject.useState)(value || {}); const [previousValue, setPreviousValue] = (0,external_wp_element_namespaceObject.useState)(value); // If the value prop changes, update the internal state. // See: // - https://github.com/WordPress/gutenberg/pull/51387#issuecomment-1722927384. // - https://react.dev/reference/react/useState#storing-information-from-previous-renders. if (!fast_deep_equal_default()(value, previousValue)) { setPreviousValue(value); setInternalValue(value); } const setInternalURLInputValue = nextValue => { setInternalValue({ ...internalValue, url: nextValue }); }; const setInternalTextInputValue = nextValue => { setInternalValue({ ...internalValue, title: nextValue }); }; const createSetInternalSettingValueHandler = settingsKeys => nextValue => { // Only apply settings values which are defined in the settings prop. const settingsUpdates = Object.keys(nextValue).reduce((acc, key) => { if (settingsKeys.includes(key)) { acc[key] = nextValue[key]; } return acc; }, {}); setInternalValue({ ...internalValue, ...settingsUpdates }); }; return [internalValue, setInternalValue, setInternalURLInputValue, setInternalTextInputValue, createSetInternalSettingValueHandler]; } ;// ./node_modules/@wordpress/block-editor/build-module/components/link-control/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Default properties associated with a link control value. * * @typedef WPLinkControlDefaultValue * * @property {string} url Link URL. * @property {string=} title Link title. * @property {boolean=} opensInNewTab Whether link should open in a new browser * tab. This value is only assigned if not * providing a custom `settings` prop. */ /* eslint-disable jsdoc/valid-types */ /** * Custom settings values associated with a link. * * @typedef {{[setting:string]:any}} WPLinkControlSettingsValue */ /* eslint-enable */ /** * Custom settings values associated with a link. * * @typedef WPLinkControlSetting * * @property {string} id Identifier to use as property for setting value. * @property {string} title Human-readable label to show in user interface. */ /** * Properties associated with a link control value, composed as a union of the * default properties and any custom settings values. * * @typedef {WPLinkControlDefaultValue&WPLinkControlSettingsValue} WPLinkControlValue */ /** @typedef {(nextValue:WPLinkControlValue)=>void} WPLinkControlOnChangeProp */ /** * Properties associated with a search suggestion used within the LinkControl. * * @typedef WPLinkControlSuggestion * * @property {string} id Identifier to use to uniquely identify the suggestion. * @property {string} type Identifies the type of the suggestion (eg: `post`, * `page`, `url`...etc) * @property {string} title Human-readable label to show in user interface. * @property {string} url A URL for the suggestion. */ /** @typedef {(title:string)=>WPLinkControlSuggestion} WPLinkControlCreateSuggestionProp */ /** * @typedef WPLinkControlProps * * @property {(WPLinkControlSetting[])=} settings An array of settings objects. Each object will used to * render a `ToggleControl` for that setting. * @property {boolean=} forceIsEditingLink If passed as either `true` or `false`, controls the * internal editing state of the component to respective * show or not show the URL input field. * @property {WPLinkControlValue=} value Current link value. * @property {WPLinkControlOnChangeProp=} onChange Value change handler, called with the updated value if * the user selects a new link or updates settings. * @property {boolean=} noDirectEntry Whether to allow turning a URL-like search query directly into a link. * @property {boolean=} showSuggestions Whether to present suggestions when typing the URL. * @property {boolean=} showInitialSuggestions Whether to present initial suggestions immediately. * @property {boolean=} withCreateSuggestion Whether to allow creation of link value from suggestion. * @property {Object=} suggestionsQuery Query parameters to pass along to wp.blockEditor.__experimentalFetchLinkSuggestions. * @property {boolean=} noURLSuggestion Whether to add a fallback suggestion which treats the search query as a URL. * @property {boolean=} hasTextControl Whether to add a text field to the UI to update the value.title. * @property {string|Function|undefined} createSuggestionButtonText The text to use in the button that calls createSuggestion. * @property {Function} renderControlBottom Optional controls to be rendered at the bottom of the component. */ const link_control_noop = () => {}; const PREFERENCE_SCOPE = 'core/block-editor'; const PREFERENCE_KEY = 'linkControlSettingsDrawer'; /** * Renders a link control. A link control is a controlled input which maintains * a value associated with a link (HTML anchor element) and relevant settings * for how that link is expected to behave. * * @param {WPLinkControlProps} props Component props. */ function LinkControl({ searchInputPlaceholder, value, settings = DEFAULT_LINK_SETTINGS, onChange = link_control_noop, onRemove, onCancel, noDirectEntry = false, showSuggestions = true, showInitialSuggestions, forceIsEditingLink, createSuggestion, withCreateSuggestion, inputValue: propInputValue = '', suggestionsQuery = {}, noURLSuggestion = false, createSuggestionButtonText, hasRichPreviews = false, hasTextControl = false, renderControlBottom = null }) { if (withCreateSuggestion === undefined && createSuggestion) { withCreateSuggestion = true; } const [settingsOpen, setSettingsOpen] = (0,external_wp_element_namespaceObject.useState)(false); const { advancedSettingsPreference } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _prefsStore$get; const prefsStore = select(external_wp_preferences_namespaceObject.store); return { advancedSettingsPreference: (_prefsStore$get = prefsStore.get(PREFERENCE_SCOPE, PREFERENCE_KEY)) !== null && _prefsStore$get !== void 0 ? _prefsStore$get : false }; }, []); const { set: setPreference } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_preferences_namespaceObject.store); /** * Sets the open/closed state of the Advanced Settings Drawer, * optionlly persisting the state to the user's preferences. * * Note that Block Editor components can be consumed by non-WordPress * environments which may not have preferences setup. * Therefore a local state is also used as a fallback. * * @param {boolean} prefVal the open/closed state of the Advanced Settings Drawer. */ const setSettingsOpenWithPreference = prefVal => { if (setPreference) { setPreference(PREFERENCE_SCOPE, PREFERENCE_KEY, prefVal); } setSettingsOpen(prefVal); }; // Block Editor components can be consumed by non-WordPress environments // which may not have these preferences setup. // Therefore a local state is used as a fallback. const isSettingsOpen = advancedSettingsPreference || settingsOpen; const isMountingRef = (0,external_wp_element_namespaceObject.useRef)(true); const wrapperNode = (0,external_wp_element_namespaceObject.useRef)(); const textInputRef = (0,external_wp_element_namespaceObject.useRef)(); const isEndingEditWithFocusRef = (0,external_wp_element_namespaceObject.useRef)(false); const settingsKeys = settings.map(({ id }) => id); const [internalControlValue, setInternalControlValue, setInternalURLInputValue, setInternalTextInputValue, createSetInternalSettingValueHandler] = useInternalValue(value); const valueHasChanges = value && !(0,external_wp_isShallowEqual_namespaceObject.isShallowEqualObjects)(internalControlValue, value); const [isEditingLink, setIsEditingLink] = (0,external_wp_element_namespaceObject.useState)(forceIsEditingLink !== undefined ? forceIsEditingLink : !value || !value.url); const { createPage, isCreatingPage, errorMessage } = useCreatePage(createSuggestion); (0,external_wp_element_namespaceObject.useEffect)(() => { if (forceIsEditingLink === undefined) { return; } setIsEditingLink(forceIsEditingLink); }, [forceIsEditingLink]); (0,external_wp_element_namespaceObject.useEffect)(() => { // We don't auto focus into the Link UI on mount // because otherwise using the keyboard to select text // *within* the link format is not possible. if (isMountingRef.current) { return; } // Scenario - when: // - switching between editable and non editable LinkControl // - clicking on a link // ...then move focus to the *first* element to avoid focus loss // and to ensure focus is *within* the Link UI. const nextFocusTarget = external_wp_dom_namespaceObject.focus.focusable.find(wrapperNode.current)[0] || wrapperNode.current; nextFocusTarget.focus(); isEndingEditWithFocusRef.current = false; }, [isEditingLink, isCreatingPage]); // The component mounting reference is maintained separately // to correctly reset values in `StrictMode`. (0,external_wp_element_namespaceObject.useEffect)(() => { isMountingRef.current = false; return () => { isMountingRef.current = true; }; }, []); const hasLinkValue = value?.url?.trim()?.length > 0; /** * Cancels editing state and marks that focus may need to be restored after * the next render, if focus was within the wrapper when editing finished. */ const stopEditing = () => { isEndingEditWithFocusRef.current = !!wrapperNode.current?.contains(wrapperNode.current.ownerDocument.activeElement); setIsEditingLink(false); }; const handleSelectSuggestion = updatedValue => { // Suggestions may contains "settings" values (e.g. `opensInNewTab`) // which should not override any existing settings values set by the // user. This filters out any settings values from the suggestion. const nonSettingsChanges = Object.keys(updatedValue).reduce((acc, key) => { if (!settingsKeys.includes(key)) { acc[key] = updatedValue[key]; } return acc; }, {}); onChange({ ...internalControlValue, ...nonSettingsChanges, // As title is not a setting, it must be manually applied // in such a way as to preserve the users changes over // any "title" value provided by the "suggestion". title: internalControlValue?.title || updatedValue?.title }); stopEditing(); }; const handleSubmit = () => { if (valueHasChanges) { // Submit the original value with new stored values applied // on top. URL is a special case as it may also be a prop. onChange({ ...value, ...internalControlValue, url: currentUrlInputValue }); } stopEditing(); }; const handleSubmitWithEnter = event => { const { keyCode } = event; if (keyCode === external_wp_keycodes_namespaceObject.ENTER && !currentInputIsEmpty // Disallow submitting empty values. ) { event.preventDefault(); handleSubmit(); } }; const resetInternalValues = () => { setInternalControlValue(value); }; const handleCancel = event => { event.preventDefault(); event.stopPropagation(); // Ensure that any unsubmitted input changes are reset. resetInternalValues(); if (hasLinkValue) { // If there is a link then exist editing mode and show preview. stopEditing(); } else { // If there is no link value, then remove the link entirely. onRemove?.(); } onCancel?.(); }; const currentUrlInputValue = propInputValue || internalControlValue?.url || ''; const currentInputIsEmpty = !currentUrlInputValue?.trim()?.length; const shownUnlinkControl = onRemove && value && !isEditingLink && !isCreatingPage; const showActions = isEditingLink && hasLinkValue; // Only show text control once a URL value has been committed // and it isn't just empty whitespace. // See https://github.com/WordPress/gutenberg/pull/33849/#issuecomment-932194927. const showTextControl = hasLinkValue && hasTextControl; const isEditing = (isEditingLink || !value) && !isCreatingPage; const isDisabled = !valueHasChanges || currentInputIsEmpty; const showSettings = !!settings?.length && isEditingLink && hasLinkValue; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { tabIndex: -1, ref: wrapperNode, className: "block-editor-link-control", children: [isCreatingPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-link-control__loading", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), " ", (0,external_wp_i18n_namespaceObject.__)('Creating'), "\u2026"] }), isEditing && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx({ 'block-editor-link-control__search-input-wrapper': true, 'has-text-control': showTextControl, 'has-actions': showActions }), children: [showTextControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, ref: textInputRef, className: "block-editor-link-control__field block-editor-link-control__text-content", label: (0,external_wp_i18n_namespaceObject.__)('Text'), value: internalControlValue?.title, onChange: setInternalTextInputValue, onKeyDown: handleSubmitWithEnter, __next40pxDefaultSize: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(search_input, { currentLink: value, className: "block-editor-link-control__field block-editor-link-control__search-input", placeholder: searchInputPlaceholder, value: currentUrlInputValue, withCreateSuggestion: withCreateSuggestion, onCreateSuggestion: createPage, onChange: setInternalURLInputValue, onSelect: handleSelectSuggestion, showInitialSuggestions: showInitialSuggestions, allowDirectEntry: !noDirectEntry, showSuggestions: showSuggestions, suggestionsQuery: suggestionsQuery, withURLSuggestion: !noURLSuggestion, createSuggestionButtonText: createSuggestionButtonText, hideLabelFromVision: !showTextControl, suffix: showActions ? undefined : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, { variant: "control", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { onClick: isDisabled ? link_control_noop : handleSubmit, label: (0,external_wp_i18n_namespaceObject.__)('Submit'), icon: keyboard_return, className: "block-editor-link-control__search-submit", "aria-disabled": isDisabled, size: "small" }) }) })] }), errorMessage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { className: "block-editor-link-control__search-error", status: "error", isDismissible: false, children: errorMessage })] }), value && !isEditingLink && !isCreatingPage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkPreview, { // force remount when URL changes to avoid race conditions for rich previews value: value, onEditClick: () => setIsEditingLink(true), hasRichPreviews: hasRichPreviews, hasUnlinkControl: shownUnlinkControl, onRemove: () => { onRemove(); setIsEditingLink(true); } }, value?.url), showSettings && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-link-control__tools", children: !currentInputIsEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(settings_drawer, { settingsOpen: isSettingsOpen, setSettingsOpen: setSettingsOpenWithPreference, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(link_control_settings, { value: internalControlValue, settings: settings, onChange: createSetInternalSettingValueHandler(settingsKeys) }) }) }), showActions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", className: "block-editor-link-control__search-actions", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: handleCancel, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", onClick: isDisabled ? link_control_noop : handleSubmit, className: "block-editor-link-control__search-submit", "aria-disabled": isDisabled, children: (0,external_wp_i18n_namespaceObject.__)('Save') })] }), !isCreatingPage && renderControlBottom && renderControlBottom()] }); } LinkControl.ViewerFill = ViewerFill; LinkControl.DEFAULT_LINK_SETTINGS = DEFAULT_LINK_SETTINGS; const DeprecatedExperimentalLinkControl = props => { external_wp_deprecated_default()('wp.blockEditor.__experimentalLinkControl', { since: '6.8', alternative: 'wp.blockEditor.LinkControl' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkControl, { ...props }); }; DeprecatedExperimentalLinkControl.ViewerFill = LinkControl.ViewerFill; DeprecatedExperimentalLinkControl.DEFAULT_LINK_SETTINGS = LinkControl.DEFAULT_LINK_SETTINGS; /* harmony default export */ const link_control = (LinkControl); ;// ./node_modules/@wordpress/block-editor/build-module/components/media-replace-flow/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const media_replace_flow_noop = () => {}; let uniqueId = 0; const MediaReplaceFlow = ({ mediaURL, mediaId, mediaIds, allowedTypes, accept, onError, onSelect, onSelectURL, onReset, onToggleFeaturedImage, useFeaturedImage, onFilesUpload = media_replace_flow_noop, name = (0,external_wp_i18n_namespaceObject.__)('Replace'), createNotice, removeNotice, children, multiple = false, addToGallery, handleUpload = true, popoverProps, renderToggle }) => { const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(store); const errorNoticeID = `block-editor/media-replace-flow/error-notice/${++uniqueId}`; const onUploadError = message => { const safeMessage = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(message); if (onError) { onError(safeMessage); return; } // We need to set a timeout for showing the notice // so that VoiceOver and possibly other screen readers // can announce the error after the toolbar button // regains focus once the upload dialog closes. // Otherwise VO simply skips over the notice and announces // the focused element and the open menu. setTimeout(() => { createNotice('error', safeMessage, { speak: true, id: errorNoticeID, isDismissible: true }); }, 1000); }; const selectMedia = (media, closeMenu) => { if (useFeaturedImage && onToggleFeaturedImage) { onToggleFeaturedImage(); } closeMenu(); // Calling `onSelect` after the state update since it might unmount the component. onSelect(media); (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('The media file has been replaced')); removeNotice(errorNoticeID); }; const uploadFiles = (event, closeMenu) => { const files = event.target.files; if (!handleUpload) { closeMenu(); return onSelect(files); } onFilesUpload(files); getSettings().mediaUpload({ allowedTypes, filesList: files, onFileChange: ([media]) => { selectMedia(media, closeMenu); }, onError: onUploadError }); }; const openOnArrowDown = event => { if (event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { event.preventDefault(); event.target.click(); } }; const onlyAllowsImages = () => { if (!allowedTypes || allowedTypes.length === 0) { return false; } return allowedTypes.every(allowedType => allowedType === 'image' || allowedType.startsWith('image/')); }; const gallery = multiple && onlyAllowsImages(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: popoverProps, contentClassName: "block-editor-media-replace-flow__options", renderToggle: ({ isOpen, onToggle }) => { if (renderToggle) { return renderToggle({ 'aria-expanded': isOpen, 'aria-haspopup': 'true', onClick: onToggle, onKeyDown: openOnArrowDown, children: name }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { "aria-expanded": isOpen, "aria-haspopup": "true", onClick: onToggle, onKeyDown: openOnArrowDown, children: name }); }, renderContent: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.NavigableMenu, { className: "block-editor-media-replace-flow__media-upload-menu", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(check, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(media_upload, { gallery: gallery, addToGallery: addToGallery, multiple: multiple, value: multiple ? mediaIds : mediaId, onSelect: media => selectMedia(media, onClose), allowedTypes: allowedTypes, render: ({ open }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: library_media, onClick: open, children: (0,external_wp_i18n_namespaceObject.__)('Open Media Library') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormFileUpload, { onChange: event => { uploadFiles(event, onClose); }, accept: accept, multiple: !!multiple, render: ({ openFileDialog }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: library_upload, onClick: () => { openFileDialog(); }, children: (0,external_wp_i18n_namespaceObject._x)('Upload', 'verb') }); } })] }), onToggleFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: post_featured_image, onClick: onToggleFeaturedImage, isPressed: useFeaturedImage, children: (0,external_wp_i18n_namespaceObject.__)('Use featured image') }), mediaURL && onReset && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { onReset(); onClose(); }, children: (0,external_wp_i18n_namespaceObject.__)('Reset') }), typeof children === 'function' ? children({ onClose }) : children] }), onSelectURL && /*#__PURE__*/ // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions (0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { className: "block-editor-media-flow__url-input", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-media-replace-flow__image-url-label", children: (0,external_wp_i18n_namespaceObject.__)('Current media URL:') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(link_control, { value: { url: mediaURL }, settings: [], showSuggestions: false, onChange: ({ url }) => { onSelectURL(url); } })] })] }) }); }; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-replace-flow/README.md */ /* harmony default export */ const media_replace_flow = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withDispatch)(dispatch => { const { createNotice, removeNotice } = dispatch(external_wp_notices_namespaceObject.store); return { createNotice, removeNotice }; }), (0,external_wp_components_namespaceObject.withFilters)('editor.MediaReplaceFlow')])(MediaReplaceFlow)); ;// ./node_modules/@wordpress/block-editor/build-module/components/background-image-control/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const IMAGE_BACKGROUND_TYPE = 'image'; const BACKGROUND_POPOVER_PROPS = { placement: 'left-start', offset: 36, shift: true, className: 'block-editor-global-styles-background-panel__popover' }; const background_image_control_noop = () => {}; /** * Get the help text for the background size control. * * @param {string} value backgroundSize value. * @return {string} Translated help text. */ function backgroundSizeHelpText(value) { if (value === 'cover' || value === undefined) { return (0,external_wp_i18n_namespaceObject.__)('Image covers the space evenly.'); } if (value === 'contain') { return (0,external_wp_i18n_namespaceObject.__)('Image is contained without distortion.'); } return (0,external_wp_i18n_namespaceObject.__)('Image has a fixed width.'); } /** * Converts decimal x and y coords from FocalPointPicker to percentage-based values * to use as backgroundPosition value. * * @param {{x?:number, y?:number}} value FocalPointPicker coords. * @return {string} backgroundPosition value. */ const coordsToBackgroundPosition = value => { if (!value || isNaN(value.x) && isNaN(value.y)) { return undefined; } const x = isNaN(value.x) ? 0.5 : value.x; const y = isNaN(value.y) ? 0.5 : value.y; return `${x * 100}% ${y * 100}%`; }; /** * Converts backgroundPosition value to x and y coords for FocalPointPicker. * * @param {string} value backgroundPosition value. * @return {{x?:number, y?:number}} FocalPointPicker coords. */ const backgroundPositionToCoords = value => { if (!value) { return { x: undefined, y: undefined }; } let [x, y] = value.split(' ').map(v => parseFloat(v) / 100); x = isNaN(x) ? undefined : x; y = isNaN(y) ? x : y; return { x, y }; }; function InspectorImagePreviewItem({ as = 'span', imgUrl, toggleProps = {}, filename, label, className, onToggleCallback = background_image_control_noop }) { (0,external_wp_element_namespaceObject.useEffect)(() => { if (typeof toggleProps?.isOpen !== 'undefined') { onToggleCallback(toggleProps?.isOpen); } }, [toggleProps?.isOpen, onToggleCallback]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { as: as, className: className, ...toggleProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", as: "span", className: "block-editor-global-styles-background-panel__inspector-preview-inner", children: [imgUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-global-styles-background-panel__inspector-image-indicator-wrapper", "aria-hidden": true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-global-styles-background-panel__inspector-image-indicator", style: { backgroundImage: `url(${imgUrl})` } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.FlexItem, { as: "span", style: imgUrl ? {} : { flexGrow: 1 }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 1, className: "block-editor-global-styles-background-panel__inspector-media-replace-title", children: label }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "span", children: imgUrl ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: file name */ (0,external_wp_i18n_namespaceObject.__)('Background image: %s'), filename || label) : (0,external_wp_i18n_namespaceObject.__)('No background image selected') })] })] }) }); } function BackgroundControlsPanel({ label, filename, url: imgUrl, children, onToggle: onToggleCallback = background_image_control_noop, hasImageValue }) { if (!hasImageValue) { return; } const imgLabel = label || (0,external_wp_url_namespaceObject.getFilename)(imgUrl) || (0,external_wp_i18n_namespaceObject.__)('Add background image'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: BACKGROUND_POPOVER_PROPS, renderToggle: ({ onToggle, isOpen }) => { const toggleProps = { onClick: onToggle, className: 'block-editor-global-styles-background-panel__dropdown-toggle', 'aria-expanded': isOpen, 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Background size, position and repeat options.'), isOpen }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorImagePreviewItem, { imgUrl: imgUrl, filename: filename, label: imgLabel, toggleProps: toggleProps, as: "button", onToggleCallback: onToggleCallback }); }, renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { className: "block-editor-global-styles-background-panel__dropdown-content-wrapper", paddingSize: "medium", children: children }) }); } function LoadingSpinner() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className: "block-editor-global-styles-background-panel__loading", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }); } function BackgroundImageControls({ onChange, style, inheritedValue, onRemoveImage = background_image_control_noop, onResetImage = background_image_control_noop, displayInPanel, defaultValues }) { const [isUploading, setIsUploading] = (0,external_wp_element_namespaceObject.useState)(false); const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(store); const { id, title, url } = style?.background?.backgroundImage || { ...inheritedValue?.background?.backgroundImage }; const replaceContainerRef = (0,external_wp_element_namespaceObject.useRef)(); const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const onUploadError = message => { createErrorNotice(message, { type: 'snackbar' }); setIsUploading(false); }; const resetBackgroundImage = () => onChange(setImmutably(style, ['background', 'backgroundImage'], undefined)); const onSelectMedia = media => { if (!media || !media.url) { resetBackgroundImage(); setIsUploading(false); return; } if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { setIsUploading(true); return; } // For media selections originated from a file upload. if (media.media_type && media.media_type !== IMAGE_BACKGROUND_TYPE || !media.media_type && media.type && media.type !== IMAGE_BACKGROUND_TYPE) { onUploadError((0,external_wp_i18n_namespaceObject.__)('Only images can be used as a background image.')); return; } const sizeValue = style?.background?.backgroundSize || defaultValues?.backgroundSize; const positionValue = style?.background?.backgroundPosition; onChange(setImmutably(style, ['background'], { ...style?.background, backgroundImage: { url: media.url, id: media.id, source: 'file', title: media.title || undefined }, backgroundPosition: /* * A background image uploaded and set in the editor receives a default background position of '50% 0', * when the background image size is the equivalent of "Tile". * This is to increase the chance that the image's focus point is visible. * This is in-editor only to assist with the user experience. */ !positionValue && ('auto' === sizeValue || !sizeValue) ? '50% 0' : positionValue, backgroundSize: sizeValue })); setIsUploading(false); }; // Drag and drop callback, restricting image to one. const onFilesDrop = filesList => { getSettings().mediaUpload({ allowedTypes: [IMAGE_BACKGROUND_TYPE], filesList, onFileChange([image]) { onSelectMedia(image); }, onError: onUploadError, multiple: false }); }; const hasValue = hasBackgroundImageValue(style); const closeAndFocus = () => { const [toggleButton] = external_wp_dom_namespaceObject.focus.tabbable.find(replaceContainerRef.current); // Focus the toggle button and close the dropdown menu. // This ensures similar behaviour as to selecting an image, where the dropdown is // closed and focus is redirected to the dropdown toggle button. toggleButton?.focus(); toggleButton?.click(); }; const onRemove = () => onChange(setImmutably(style, ['background'], { backgroundImage: 'none' })); const canRemove = !hasValue && hasBackgroundImageValue(inheritedValue); const imgLabel = title || (0,external_wp_url_namespaceObject.getFilename)(url) || (0,external_wp_i18n_namespaceObject.__)('Add background image'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ref: replaceContainerRef, className: "block-editor-global-styles-background-panel__image-tools-panel-item", children: [isUploading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LoadingSpinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(media_replace_flow, { mediaId: id, mediaURL: url, allowedTypes: [IMAGE_BACKGROUND_TYPE], accept: "image/*", onSelect: onSelectMedia, popoverProps: { className: dist_clsx({ 'block-editor-global-styles-background-panel__media-replace-popover': displayInPanel }) }, name: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorImagePreviewItem, { className: "block-editor-global-styles-background-panel__image-preview", imgUrl: url, filename: title, label: imgLabel }), renderToggle: props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { ...props, __next40pxDefaultSize: true }), onError: onUploadError, onReset: () => { closeAndFocus(); onResetImage(); }, children: canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { closeAndFocus(); onRemove(); onRemoveImage(); }, children: (0,external_wp_i18n_namespaceObject.__)('Remove') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, { onFilesDrop: onFilesDrop, label: (0,external_wp_i18n_namespaceObject.__)('Drop to upload') })] }); } function BackgroundSizeControls({ onChange, style, inheritedValue, defaultValues }) { const sizeValue = style?.background?.backgroundSize || inheritedValue?.background?.backgroundSize; const repeatValue = style?.background?.backgroundRepeat || inheritedValue?.background?.backgroundRepeat; const imageValue = style?.background?.backgroundImage?.url || inheritedValue?.background?.backgroundImage?.url; const isUploadedImage = style?.background?.backgroundImage?.id; const positionValue = style?.background?.backgroundPosition || inheritedValue?.background?.backgroundPosition; const attachmentValue = style?.background?.backgroundAttachment || inheritedValue?.background?.backgroundAttachment; /* * Set default values for uploaded images. * The default values are passed by the consumer. * Block-level controls may have different defaults to root-level controls. * A falsy value is treated by default as `auto` (Tile). */ let currentValueForToggle = !sizeValue && isUploadedImage ? defaultValues?.backgroundSize : sizeValue || 'auto'; /* * The incoming value could be a value + unit, e.g. '20px'. * In this case set the value to 'tile'. */ currentValueForToggle = !['cover', 'contain', 'auto'].includes(currentValueForToggle) ? 'auto' : currentValueForToggle; /* * If the current value is `cover` and the repeat value is `undefined`, then * the toggle should be unchecked as the default state. Otherwise, the toggle * should reflect the current repeat value. */ const repeatCheckedValue = !(repeatValue === 'no-repeat' || currentValueForToggle === 'cover' && repeatValue === undefined); const updateBackgroundSize = next => { // When switching to 'contain' toggle the repeat off. let nextRepeat = repeatValue; let nextPosition = positionValue; if (next === 'contain') { nextRepeat = 'no-repeat'; nextPosition = undefined; } if (next === 'cover') { nextRepeat = undefined; nextPosition = undefined; } if ((currentValueForToggle === 'cover' || currentValueForToggle === 'contain') && next === 'auto') { nextRepeat = undefined; /* * A background image uploaded and set in the editor (an image with a record id), * receives a default background position of '50% 0', * when the toggle switches to "Tile". This is to increase the chance that * the image's focus point is visible. * This is in-editor only to assist with the user experience. */ if (!!style?.background?.backgroundImage?.id) { nextPosition = '50% 0'; } } /* * Next will be null when the input is cleared, * in which case the value should be 'auto'. */ if (!next && currentValueForToggle === 'auto') { next = 'auto'; } onChange(setImmutably(style, ['background'], { ...style?.background, backgroundPosition: nextPosition, backgroundRepeat: nextRepeat, backgroundSize: next })); }; const updateBackgroundPosition = next => { onChange(setImmutably(style, ['background', 'backgroundPosition'], coordsToBackgroundPosition(next))); }; const toggleIsRepeated = () => onChange(setImmutably(style, ['background', 'backgroundRepeat'], repeatCheckedValue === true ? 'no-repeat' : 'repeat')); const toggleScrollWithPage = () => onChange(setImmutably(style, ['background', 'backgroundAttachment'], attachmentValue === 'fixed' ? 'scroll' : 'fixed')); // Set a default background position for non-site-wide, uploaded images with a size of 'contain'. const backgroundPositionValue = !positionValue && isUploadedImage && 'contain' === sizeValue ? defaultValues?.backgroundPosition : positionValue; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, className: "single-column", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FocalPointPicker, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), url: imageValue, value: backgroundPositionToCoords(backgroundPositionValue), onChange: updateBackgroundPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'), checked: attachmentValue === 'fixed', onChange: toggleScrollWithPage }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __nextHasNoMarginBottom: true, size: "__unstable-large", label: (0,external_wp_i18n_namespaceObject.__)('Size'), value: currentValueForToggle, onChange: updateBackgroundSize, isBlock: true, help: backgroundSizeHelpText(sizeValue || defaultValues?.backgroundSize), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "cover", label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Size option for background image control') }, "cover"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "contain", label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Size option for background image control') }, "contain"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "auto", label: (0,external_wp_i18n_namespaceObject._x)('Tile', 'Size option for background image control') }, "tile")] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", spacing: 2, as: "span", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { "aria-label": (0,external_wp_i18n_namespaceObject.__)('Background image width'), onChange: updateBackgroundSize, value: sizeValue, size: "__unstable-large", __unstableInputWidth: "100px", min: 0, placeholder: (0,external_wp_i18n_namespaceObject.__)('Auto'), disabled: currentValueForToggle !== 'auto' || currentValueForToggle === undefined }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Repeat'), checked: repeatCheckedValue, onChange: toggleIsRepeated, disabled: currentValueForToggle === 'cover' })] })] }); } function BackgroundImagePanel({ value, onChange, inheritedValue = value, settings, defaultValues = {} }) { /* * Resolve any inherited "ref" pointers. * Should the block editor need resolved, inherited values * across all controls, this could be abstracted into a hook, * e.g., useResolveGlobalStyle */ const { globalStyles, _links } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(store); const _settings = getSettings(); return { globalStyles: _settings[globalStylesDataKey], _links: _settings[globalStylesLinksDataKey] }; }, []); const resolvedInheritedValue = (0,external_wp_element_namespaceObject.useMemo)(() => { const resolvedValues = { background: {} }; if (!inheritedValue?.background) { return inheritedValue; } Object.entries(inheritedValue?.background).forEach(([key, backgroundValue]) => { resolvedValues.background[key] = getResolvedValue(backgroundValue, { styles: globalStyles, _links }); }); return resolvedValues; }, [globalStyles, _links, inheritedValue]); const resetBackground = () => onChange(setImmutably(value, ['background'], {})); const { title, url } = value?.background?.backgroundImage || { ...resolvedInheritedValue?.background?.backgroundImage }; const hasImageValue = hasBackgroundImageValue(value) || hasBackgroundImageValue(resolvedInheritedValue); const imageValue = value?.background?.backgroundImage || inheritedValue?.background?.backgroundImage; const shouldShowBackgroundImageControls = hasImageValue && 'none' !== imageValue && (settings?.background?.backgroundSize || settings?.background?.backgroundPosition || settings?.background?.backgroundRepeat); const [isDropDownOpen, setIsDropDownOpen] = (0,external_wp_element_namespaceObject.useState)(false); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('block-editor-global-styles-background-panel__inspector-media-replace-container', { 'is-open': isDropDownOpen }), children: shouldShowBackgroundImageControls ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackgroundControlsPanel, { label: title, filename: title, url: url, onToggle: setIsDropDownOpen, hasImageValue: hasImageValue, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, className: "single-column", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackgroundImageControls, { onChange: onChange, style: value, inheritedValue: resolvedInheritedValue, displayInPanel: true, onResetImage: () => { setIsDropDownOpen(false); resetBackground(); }, onRemoveImage: () => setIsDropDownOpen(false), defaultValues: defaultValues }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackgroundSizeControls, { onChange: onChange, style: value, defaultValues: defaultValues, inheritedValue: resolvedInheritedValue })] }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackgroundImageControls, { onChange: onChange, style: value, inheritedValue: resolvedInheritedValue, defaultValues: defaultValues, onResetImage: () => { setIsDropDownOpen(false); resetBackground(); }, onRemoveImage: () => setIsDropDownOpen(false) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/background-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ const background_panel_DEFAULT_CONTROLS = { backgroundImage: true }; /** * Checks site settings to see if the background panel may be used. * `settings.background.backgroundSize` exists also, * but can only be used if settings?.background?.backgroundImage is `true`. * * @param {Object} settings Site settings * @return {boolean} Whether site settings has activated background panel. */ function useHasBackgroundPanel(settings) { return external_wp_element_namespaceObject.Platform.OS === 'web' && settings?.background?.backgroundImage; } /** * Checks if there is a current value in the background size block support * attributes. Background size values include background size as well * as background position. * * @param {Object} style Style attribute. * @return {boolean} Whether the block has a background size value set. */ function hasBackgroundSizeValue(style) { return style?.background?.backgroundPosition !== undefined || style?.background?.backgroundSize !== undefined; } /** * Checks if there is a current value in the background image block support * attributes. * * @param {Object} style Style attribute. * @return {boolean} Whether the block has a background image value set. */ function hasBackgroundImageValue(style) { return !!style?.background?.backgroundImage?.id || // Supports url() string values in theme.json. 'string' === typeof style?.background?.backgroundImage || !!style?.background?.backgroundImage?.url; } function BackgroundToolsPanel({ resetAllFilter, onChange, value, panelId, children, headerLabel }) { const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const resetAll = () => { const updatedValue = resetAllFilter(value); onChange(updatedValue); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: headerLabel, resetAll: resetAll, panelId: panelId, dropdownMenuProps: dropdownMenuProps, children: children }); } function background_panel_BackgroundImagePanel({ as: Wrapper = BackgroundToolsPanel, value, onChange, inheritedValue, settings, panelId, defaultControls = background_panel_DEFAULT_CONTROLS, defaultValues = {}, headerLabel = (0,external_wp_i18n_namespaceObject.__)('Background image') }) { const showBackgroundImageControl = useHasBackgroundPanel(settings); const resetBackground = () => onChange(setImmutably(value, ['background'], {})); const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(previousValue => { return { ...previousValue, background: {} }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, { resetAllFilter: resetAllFilter, value: value, onChange: onChange, panelId: panelId, headerLabel: headerLabel, children: showBackgroundImageControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!value?.background, label: (0,external_wp_i18n_namespaceObject.__)('Image'), onDeselect: resetBackground, isShownByDefault: defaultControls.backgroundImage, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackgroundImagePanel, { value: value, onChange: onChange, settings: settings, inheritedValue: inheritedValue, defaultControls: defaultControls, defaultValues: defaultValues }) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/background.js /** * WordPress dependencies */ /** * Internal dependencies */ const BACKGROUND_SUPPORT_KEY = 'background'; // Initial control values. const BACKGROUND_BLOCK_DEFAULT_VALUES = { backgroundSize: 'cover', backgroundPosition: '50% 50%' // used only when backgroundSize is 'contain'. }; /** * Determine whether there is block support for background. * * @param {string} blockName Block name. * @param {string} feature Background image feature to check for. * * @return {boolean} Whether there is support. */ function hasBackgroundSupport(blockName, feature = 'any') { const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, BACKGROUND_SUPPORT_KEY); if (support === true) { return true; } if (feature === 'any') { return !!support?.backgroundImage || !!support?.backgroundSize || !!support?.backgroundRepeat; } return !!support?.[feature]; } function setBackgroundStyleDefaults(backgroundStyle) { if (!backgroundStyle || !backgroundStyle?.backgroundImage?.url) { return; } let backgroundStylesWithDefaults; // Set block background defaults. if (!backgroundStyle?.backgroundSize) { backgroundStylesWithDefaults = { backgroundSize: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundSize }; } if ('contain' === backgroundStyle?.backgroundSize && !backgroundStyle?.backgroundPosition) { backgroundStylesWithDefaults = { backgroundPosition: BACKGROUND_BLOCK_DEFAULT_VALUES.backgroundPosition }; } return backgroundStylesWithDefaults; } function background_useBlockProps({ name, style }) { if (!hasBackgroundSupport(name) || !style?.background?.backgroundImage) { return; } const backgroundStyles = setBackgroundStyleDefaults(style?.background); if (!backgroundStyles) { return; } return { style: { ...backgroundStyles } }; } /** * Generates a CSS class name if an background image is set. * * @param {Object} style A block's style attribute. * * @return {string} CSS class name. */ function getBackgroundImageClasses(style) { return hasBackgroundImageValue(style) ? 'has-background' : ''; } function BackgroundInspectorControl({ children }) { const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(attributes => { return { ...attributes, style: { ...attributes.style, background: undefined } }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { group: "background", resetAllFilter: resetAllFilter, children: children }); } function background_BackgroundImagePanel({ clientId, name, setAttributes, settings }) { const { style, inheritedValue } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockAttributes, getSettings } = select(store); const _settings = getSettings(); return { style: getBlockAttributes(clientId)?.style, /* * To ensure we pass down the right inherited values: * @TODO 1. Pass inherited value down to all block style controls, * See: packages/block-editor/src/hooks/style.js * @TODO 2. Add support for block style variations, * See implementation: packages/block-editor/src/hooks/block-style-variation.js */ inheritedValue: _settings[globalStylesDataKey]?.blocks?.[name] }; }, [clientId, name]); if (!useHasBackgroundPanel(settings) || !hasBackgroundSupport(name, 'backgroundImage')) { return null; } const onChange = newStyle => { setAttributes({ style: utils_cleanEmptyObject(newStyle) }); }; const updatedSettings = { ...settings, background: { ...settings.background, backgroundSize: settings?.background?.backgroundSize && hasBackgroundSupport(name, 'backgroundSize') } }; const defaultControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [BACKGROUND_SUPPORT_KEY, 'defaultControls']); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(background_panel_BackgroundImagePanel, { inheritedValue: inheritedValue, as: BackgroundInspectorControl, panelId: clientId, defaultValues: BACKGROUND_BLOCK_DEFAULT_VALUES, settings: updatedSettings, onChange: onChange, defaultControls: defaultControls, value: style }); } /* harmony default export */ const background = ({ useBlockProps: background_useBlockProps, attributeKeys: ['style'], hasSupport: hasBackgroundSupport }); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/lock.js /** * WordPress dependencies */ /** * Filters registered block settings, extending attributes to include `lock`. * * @param {Object} settings Original block settings. * * @return {Object} Filtered block settings. */ function lock_addAttribute(settings) { var _settings$attributes$; // Allow blocks to specify their own attribute definition with default values if needed. if ('type' in ((_settings$attributes$ = settings.attributes?.lock) !== null && _settings$attributes$ !== void 0 ? _settings$attributes$ : {})) { return settings; } // Gracefully handle if settings.attributes is undefined. settings.attributes = { ...settings.attributes, lock: { type: 'object' } }; return settings; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/lock/addAttribute', lock_addAttribute); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/anchor.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Regular expression matching invalid anchor characters for replacement. * * @type {RegExp} */ const ANCHOR_REGEX = /[\s#]/g; const ANCHOR_SCHEMA = { type: 'string', source: 'attribute', attribute: 'id', selector: '*' }; /** * Filters registered block settings, extending attributes with anchor using ID * of the first node. * * @param {Object} settings Original block settings. * * @return {Object} Filtered block settings. */ function anchor_addAttribute(settings) { var _settings$attributes$; // Allow blocks to specify their own attribute definition with default values if needed. if ('type' in ((_settings$attributes$ = settings.attributes?.anchor) !== null && _settings$attributes$ !== void 0 ? _settings$attributes$ : {})) { return settings; } if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'anchor')) { // Gracefully handle if settings.attributes is undefined. settings.attributes = { ...settings.attributes, anchor: ANCHOR_SCHEMA }; } return settings; } function BlockEditAnchorControlPure({ anchor, setAttributes }) { const blockEditingMode = useBlockEditingMode(); if (blockEditingMode !== 'default') { return null; } const isWeb = external_wp_element_namespaceObject.Platform.OS === 'web'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, className: "html-anchor-control", label: (0,external_wp_i18n_namespaceObject.__)('HTML anchor'), help: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [(0,external_wp_i18n_namespaceObject.__)('Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor”. Then, you’ll be able to link directly to this section of your page.'), isWeb && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/page-jumps/'), children: (0,external_wp_i18n_namespaceObject.__)('Learn more about anchors') })] })] }), value: anchor || '', placeholder: !isWeb ? (0,external_wp_i18n_namespaceObject.__)('Add an anchor') : null, onChange: nextValue => { nextValue = nextValue.replace(ANCHOR_REGEX, '-'); setAttributes({ anchor: nextValue }); }, autoCapitalize: "none", autoComplete: "off" }) }); } /* harmony default export */ const hooks_anchor = ({ addSaveProps, edit: BlockEditAnchorControlPure, attributeKeys: ['anchor'], hasSupport(name) { return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, 'anchor'); } }); /** * Override props assigned to save component to inject anchor ID, if block * supports anchor. This is only applied if the block's save result is an * element and not a markup string. * * @param {Object} extraProps Additional props applied to save element. * @param {Object} blockType Block type. * @param {Object} attributes Current block attributes. * * @return {Object} Filtered props applied to save element. */ function addSaveProps(extraProps, blockType, attributes) { if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'anchor')) { extraProps.id = attributes.anchor === '' ? null : attributes.anchor; } return extraProps; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/anchor/attribute', anchor_addAttribute); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/aria-label.js /** * WordPress dependencies */ /** * Filters registered block settings, extending attributes with ariaLabel using aria-label * of the first node. * * @param {Object} settings Original block settings. * * @return {Object} Filtered block settings. */ function aria_label_addAttribute(settings) { // Allow blocks to specify their own attribute definition with default values if needed. if (settings?.attributes?.ariaLabel?.type) { return settings; } if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'ariaLabel')) { // Gracefully handle if settings.attributes is undefined. settings.attributes = { ...settings.attributes, ariaLabel: { type: 'string' } }; } return settings; } /** * Override props assigned to save component to inject aria-label, if block * supports ariaLabel. This is only applied if the block's save result is an * element and not a markup string. * * @param {Object} extraProps Additional props applied to save element. * @param {Object} blockType Block type. * @param {Object} attributes Current block attributes. * * @return {Object} Filtered props applied to save element. */ function aria_label_addSaveProps(extraProps, blockType, attributes) { if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'ariaLabel')) { extraProps['aria-label'] = attributes.ariaLabel === '' ? null : attributes.ariaLabel; } return extraProps; } /* harmony default export */ const aria_label = ({ addSaveProps: aria_label_addSaveProps, attributeKeys: ['ariaLabel'], hasSupport(name) { return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, 'ariaLabel'); } }); (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/ariaLabel/attribute', aria_label_addAttribute); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/custom-class-name.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Filters registered block settings, extending attributes to include `className`. * * @param {Object} settings Original block settings. * * @return {Object} Filtered block settings. */ function custom_class_name_addAttribute(settings) { if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'customClassName', true)) { // Gracefully handle if settings.attributes is undefined. settings.attributes = { ...settings.attributes, className: { type: 'string' } }; } return settings; } function CustomClassNameControlsPure({ className, setAttributes }) { const blockEditingMode = useBlockEditingMode(); if (blockEditingMode !== 'default') { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, autoComplete: "off", label: (0,external_wp_i18n_namespaceObject.__)('Additional CSS class(es)'), value: className || '', onChange: nextValue => { setAttributes({ className: nextValue !== '' ? nextValue : undefined }); }, help: (0,external_wp_i18n_namespaceObject.__)('Separate multiple classes with spaces.') }) }); } /* harmony default export */ const custom_class_name = ({ edit: CustomClassNameControlsPure, addSaveProps: custom_class_name_addSaveProps, attributeKeys: ['className'], hasSupport(name) { return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, 'customClassName', true); } }); /** * Override props assigned to save component to inject the className, if block * supports customClassName. This is only applied if the block's save result is an * element and not a markup string. * * @param {Object} extraProps Additional props applied to save element. * @param {Object} blockType Block type. * @param {Object} attributes Current block attributes. * * @return {Object} Filtered props applied to save element. */ function custom_class_name_addSaveProps(extraProps, blockType, attributes) { if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'customClassName', true) && attributes.className) { extraProps.className = dist_clsx(extraProps.className, attributes.className); } return extraProps; } function addTransforms(result, source, index, results) { if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(result.name, 'customClassName', true)) { return result; } // If the condition verifies we are probably in the presence of a wrapping transform // e.g: nesting paragraphs in a group or columns and in that case the class should not be kept. if (results.length === 1 && result.innerBlocks.length === source.length) { return result; } // If we are transforming one block to multiple blocks or multiple blocks to one block, // we ignore the class during the transform. if (results.length === 1 && source.length > 1 || results.length > 1 && source.length === 1) { return result; } // If we are in presence of transform between one or more block in the source // that have one or more blocks in the result // we apply the class on source N to the result N, // if source N does not exists we do nothing. if (source[index]) { const originClassName = source[index]?.attributes.className; // Avoid overriding classes if the transformed block already includes them. if (originClassName && result.attributes.className === undefined) { return { ...result, attributes: { ...result.attributes, className: originClassName } }; } } return result; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/custom-class-name/attribute', custom_class_name_addAttribute); (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/color/addTransforms', addTransforms); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/generated-class-name.js /** * WordPress dependencies */ /** * Override props assigned to save component to inject generated className if * block supports it. This is only applied if the block's save result is an * element and not a markup string. * * @param {Object} extraProps Additional props applied to save element. * @param {Object} blockType Block type. * * @return {Object} Filtered props applied to save element. */ function addGeneratedClassName(extraProps, blockType) { // Adding the generated className. if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'className', true)) { if (typeof extraProps.className === 'string') { // We have some extra classes and want to add the default classname // We use uniq to prevent duplicate classnames. extraProps.className = [...new Set([(0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockType.name), ...extraProps.className.split(' ')])].join(' ').trim(); } else { // There is no string in the className variable, // so we just dump the default name in there. extraProps.className = (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockType.name); } } return extraProps; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.getSaveContent.extraProps', 'core/generated-class-name/save-props', addGeneratedClassName); ;// ./node_modules/colord/index.mjs var colord_r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(colord_r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},colord_j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof colord_j?r:new colord_j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(colord_j,y),S.push(r))})},E=function(){return new colord_j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; ;// ./node_modules/colord/plugins/names.mjs /* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])} ;// ./node_modules/colord/plugins/a11y.mjs var a11y_o=function(o){var t=o/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},a11y_t=function(t){return.2126*a11y_o(t.r)+.7152*a11y_o(t.g)+.0722*a11y_o(t.b)};/* harmony default export */ function a11y(o){o.prototype.luminance=function(){return o=a11y_t(this.rgba),void 0===(r=2)&&(r=0),void 0===n&&(n=Math.pow(10,r)),Math.round(n*o)/n+0;var o,r,n},o.prototype.contrast=function(r){void 0===r&&(r="#FFF");var n,a,i,e,v,u,d,c=r instanceof o?r:new o(r);return e=this.rgba,v=c.toRgb(),u=a11y_t(e),d=a11y_t(v),n=u>d?(u+.05)/(d+.05):(d+.05)/(u+.05),void 0===(a=2)&&(a=0),void 0===i&&(i=Math.pow(10,a)),Math.floor(i*n)/i+0},o.prototype.isReadable=function(o,t){return void 0===o&&(o="#FFF"),void 0===t&&(t={}),this.contrast(o)>=(e=void 0===(i=(r=t).size)?"normal":i,"AAA"===(a=void 0===(n=r.level)?"AA":n)&&"normal"===e?7:"AA"===a&&"large"===e?3:4.5);var r,n,a,i,e}} ;// ./node_modules/@wordpress/block-editor/build-module/components/colors/utils.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ k([names, a11y]); const { kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); /** * Provided an array of color objects as set by the theme or by the editor defaults, * and the values of the defined color or custom color returns a color object describing the color. * * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. * @param {?string} definedColor A string containing the color slug. * @param {?string} customColor A string containing the customColor value. * * @return {?Object} If definedColor is passed and the name is found in colors, * the color object exactly as set by the theme or editor defaults is returned. * Otherwise, an object that just sets the color is defined. */ const getColorObjectByAttributeValues = (colors, definedColor, customColor) => { if (definedColor) { const colorObj = colors?.find(color => color.slug === definedColor); if (colorObj) { return colorObj; } } return { color: customColor }; }; /** * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined. * * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. * @param {?string} colorValue A string containing the color value. * * @return {?Object} Color object included in the colors array whose color property equals colorValue. * Returns undefined if no color object matches this requirement. */ const getColorObjectByColorValue = (colors, colorValue) => { return colors?.find(color => color.color === colorValue); }; /** * Returns a class based on the context a color is being used and its slug. * * @param {string} colorContextName Context/place where color is being used e.g: background, text etc... * @param {string} colorSlug Slug of the color. * * @return {?string} String with the class corresponding to the color in the provided context. * Returns undefined if either colorContextName or colorSlug are not provided. */ function getColorClassName(colorContextName, colorSlug) { if (!colorContextName || !colorSlug) { return undefined; } return `has-${kebabCase(colorSlug)}-${colorContextName}`; } /** * Given an array of color objects and a color value returns the color value of the most readable color in the array. * * @param {Array} colors Array of color objects as set by the theme or by the editor defaults. * @param {?string} colorValue A string containing the color value. * * @return {string} String with the color value of the most readable color. */ function getMostReadableColor(colors, colorValue) { const colordColor = w(colorValue); const getColorContrast = ({ color }) => colordColor.contrast(color); const maxContrast = Math.max(...colors.map(getColorContrast)); return colors.find(color => getColorContrast(color) === maxContrast).color; } ;// ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/use-multiple-origin-colors-and-gradients.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Retrieves color and gradient related settings. * * The arrays for colors and gradients are made up of color palettes from each * origin i.e. "Core", "Theme", and "User". * * @return {Object} Color and gradient related settings. */ function useMultipleOriginColorsAndGradients() { const [enableCustomColors, customColors, themeColors, defaultColors, shouldDisplayDefaultColors, enableCustomGradients, customGradients, themeGradients, defaultGradients, shouldDisplayDefaultGradients] = use_settings_useSettings('color.custom', 'color.palette.custom', 'color.palette.theme', 'color.palette.default', 'color.defaultPalette', 'color.customGradient', 'color.gradients.custom', 'color.gradients.theme', 'color.gradients.default', 'color.defaultGradients'); const colorGradientSettings = { disableCustomColors: !enableCustomColors, disableCustomGradients: !enableCustomGradients }; colorGradientSettings.colors = (0,external_wp_element_namespaceObject.useMemo)(() => { const result = []; if (themeColors && themeColors.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'), slug: 'theme', colors: themeColors }); } if (shouldDisplayDefaultColors && defaultColors && defaultColors.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'), slug: 'default', colors: defaultColors }); } if (customColors && customColors.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette is created by the user.'), slug: 'custom', colors: customColors }); } return result; }, [customColors, themeColors, defaultColors, shouldDisplayDefaultColors]); colorGradientSettings.gradients = (0,external_wp_element_namespaceObject.useMemo)(() => { const result = []; if (themeGradients && themeGradients.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Theme', 'Indicates this palette comes from the theme.'), slug: 'theme', gradients: themeGradients }); } if (shouldDisplayDefaultGradients && defaultGradients && defaultGradients.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Default', 'Indicates this palette comes from WordPress.'), slug: 'default', gradients: defaultGradients }); } if (customGradients && customGradients.length) { result.push({ name: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Indicates this palette is created by the user.'), slug: 'custom', gradients: customGradients }); } return result; }, [customGradients, themeGradients, defaultGradients, shouldDisplayDefaultGradients]); colorGradientSettings.hasColorsOrGradients = !!colorGradientSettings.colors.length || !!colorGradientSettings.gradients.length; return colorGradientSettings; } ;// ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/utils.js /** * WordPress dependencies */ /** * Gets the (non-undefined) item with the highest occurrence within an array * Based in part on: https://stackoverflow.com/a/20762713 * * Undefined values are always sorted to the end by `sort`, so this function * returns the first element, to always prioritize real values over undefined * values. * * See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#description * * @param {Array<any>} inputArray Array of items to check. * @return {any} The item with the most occurrences. */ function mode(inputArray) { const arr = [...inputArray]; return arr.sort((a, b) => inputArray.filter(v => v === b).length - inputArray.filter(v => v === a).length).shift(); } /** * Returns the most common CSS unit from the current CSS unit selections. * * - If a single flat border radius is set, its unit will be used * - If individual corner selections, the most common of those will be used * - Failing any unit selections a default of 'px' is returned. * * @param {Object} selectedUnits Unit selections for flat radius & each corner. * @return {string} Most common CSS unit from current selections. Default: `px`. */ function getAllUnit(selectedUnits = {}) { const { flat, ...cornerUnits } = selectedUnits; return flat || mode(Object.values(cornerUnits).filter(Boolean)) || 'px'; } /** * Gets the 'all' input value and unit from values data. * * @param {Object|string} values Radius values. * @return {string} A value + unit for the 'all' input. */ function getAllValue(values = {}) { /** * Border radius support was originally a single pixel value. * * To maintain backwards compatibility treat this case as the all value. */ if (typeof values === 'string') { return values; } const parsedQuantitiesAndUnits = Object.values(values).map(value => (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value)); const allValues = parsedQuantitiesAndUnits.map(value => { var _value$; return (_value$ = value[0]) !== null && _value$ !== void 0 ? _value$ : ''; }); const allUnits = parsedQuantitiesAndUnits.map(value => value[1]); const value = allValues.every(v => v === allValues[0]) ? allValues[0] : ''; const unit = mode(allUnits); const allValue = value === 0 || value ? `${value}${unit}` : undefined; return allValue; } /** * Checks to determine if values are mixed. * * @param {Object} values Radius values. * @return {boolean} Whether values are mixed. */ function hasMixedValues(values = {}) { const allValue = getAllValue(values); const isMixed = typeof values === 'string' ? false : isNaN(parseFloat(allValue)); return isMixed; } /** * Checks to determine if values are defined. * * @param {Object} values Radius values. * @return {boolean} Whether values are mixed. */ function hasDefinedValues(values) { if (!values) { return false; } // A string value represents a shorthand value. if (typeof values === 'string') { return true; } // An object represents longhand border radius values, if any are set // flag values as being defined. const filteredValues = Object.values(values).filter(value => { return !!value || value === 0; }); return !!filteredValues.length; } ;// ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/all-input-control.js /** * WordPress dependencies */ /** * Internal dependencies */ function AllInputControl({ onChange, selectedUnits, setSelectedUnits, values, ...props }) { let allValue = getAllValue(values); if (allValue === undefined) { // If we don't have any value set the unit to any current selection // or the most common unit from the individual radii values. allValue = getAllUnit(selectedUnits); } const hasValues = hasDefinedValues(values); const isMixed = hasValues && hasMixedValues(values); const allPlaceholder = isMixed ? (0,external_wp_i18n_namespaceObject.__)('Mixed') : null; // Filter out CSS-unit-only values to prevent invalid styles. const handleOnChange = next => { const isNumeric = !isNaN(parseFloat(next)); const nextValue = isNumeric ? next : undefined; onChange(nextValue); }; // Store current unit selection for use as fallback for individual // radii controls. const handleOnUnitChange = unit => { setSelectedUnits({ topLeft: unit, topRight: unit, bottomLeft: unit, bottomRight: unit }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { ...props, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Border radius'), disableUnits: isMixed, isOnly: true, value: allValue, onChange: handleOnChange, onUnitChange: handleOnUnitChange, placeholder: allPlaceholder, size: "__unstable-large" }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/input-controls.js /** * WordPress dependencies */ const CORNERS = { topLeft: (0,external_wp_i18n_namespaceObject.__)('Top left'), topRight: (0,external_wp_i18n_namespaceObject.__)('Top right'), bottomLeft: (0,external_wp_i18n_namespaceObject.__)('Bottom left'), bottomRight: (0,external_wp_i18n_namespaceObject.__)('Bottom right') }; function BoxInputControls({ onChange, selectedUnits, setSelectedUnits, values: valuesProp, ...props }) { const createHandleOnChange = corner => next => { if (!onChange) { return; } // Filter out CSS-unit-only values to prevent invalid styles. const isNumeric = !isNaN(parseFloat(next)); const nextValue = isNumeric ? next : undefined; onChange({ ...values, [corner]: nextValue }); }; const createHandleOnUnitChange = side => next => { const newUnits = { ...selectedUnits }; newUnits[side] = next; setSelectedUnits(newUnits); }; // For shorthand style & backwards compatibility, handle flat string value. const values = typeof valuesProp !== 'string' ? valuesProp : { topLeft: valuesProp, topRight: valuesProp, bottomLeft: valuesProp, bottomRight: valuesProp }; // Controls are wrapped in tooltips as visible labels aren't desired here. // Tooltip rendering also requires the UnitControl to be wrapped. See: // https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026 return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "components-border-radius-control__input-controls-wrapper", children: Object.entries(CORNERS).map(([corner, label]) => { const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values[corner]); const computedUnit = values[corner] ? parsedUnit : selectedUnits[corner] || selectedUnits.flat; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: label, placement: "top", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "components-border-radius-control__tooltip-wrapper", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { ...props, "aria-label": label, value: [parsedQuantity, computedUnit].join(''), onChange: createHandleOnChange(corner), onUnitChange: createHandleOnUnitChange(corner), size: "__unstable-large" }) }) }, corner); }) }); } ;// ./node_modules/@wordpress/icons/build-module/library/link.js /** * WordPress dependencies */ const link_link = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) }); /* harmony default export */ const library_link = (link_link); ;// ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/linked-button.js /** * WordPress dependencies */ function LinkedButton({ isLinked, ...props }) { const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink radii') : (0,external_wp_i18n_namespaceObject.__)('Link radii'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { ...props, className: "component-border-radius-control__linked-button", size: "small", icon: isLinked ? library_link : link_off, iconSize: 24, label: label }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/border-radius-control/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const border_radius_control_DEFAULT_VALUES = { topLeft: undefined, topRight: undefined, bottomLeft: undefined, bottomRight: undefined }; const MIN_BORDER_RADIUS_VALUE = 0; const MAX_BORDER_RADIUS_VALUES = { px: 100, em: 20, rem: 20 }; /** * Control to display border radius options. * * @param {Object} props Component props. * @param {Function} props.onChange Callback to handle onChange. * @param {Object} props.values Border radius values. * * @return {Element} Custom border radius control. */ function BorderRadiusControl({ onChange, values }) { const [isLinked, setIsLinked] = (0,external_wp_element_namespaceObject.useState)(!hasDefinedValues(values) || !hasMixedValues(values)); // Tracking selected units via internal state allows filtering of CSS unit // only values from being saved while maintaining preexisting unit selection // behaviour. Filtering CSS unit only values prevents invalid style values. const [selectedUnits, setSelectedUnits] = (0,external_wp_element_namespaceObject.useState)({ flat: typeof values === 'string' ? (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values)[1] : undefined, topLeft: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values?.topLeft)[1], topRight: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values?.topRight)[1], bottomLeft: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values?.bottomLeft)[1], bottomRight: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values?.bottomRight)[1] }); const [availableUnits] = use_settings_useSettings('spacing.units'); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['px', 'em', 'rem'] }); const unit = getAllUnit(selectedUnits); const unitConfig = units && units.find(item => item.value === unit); const step = unitConfig?.step || 1; const [allValue] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(getAllValue(values)); const toggleLinked = () => setIsLinked(!isLinked); const handleSliderChange = next => { onChange(next !== undefined ? `${next}${unit}` : undefined); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "components-border-radius-control", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)('Radius') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "components-border-radius-control__wrapper", children: [isLinked ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AllInputControl, { className: "components-border-radius-control__unit-control", values: values, min: MIN_BORDER_RADIUS_VALUE, onChange: onChange, selectedUnits: selectedUnits, setSelectedUnits: setSelectedUnits, units: units }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Border radius'), hideLabelFromVision: true, className: "components-border-radius-control__range-control", value: allValue !== null && allValue !== void 0 ? allValue : '', min: MIN_BORDER_RADIUS_VALUE, max: MAX_BORDER_RADIUS_VALUES[unit], initialPosition: 0, withInputField: false, onChange: handleSliderChange, step: step, __nextHasNoMarginBottom: true })] }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BoxInputControls, { min: MIN_BORDER_RADIUS_VALUE, onChange: onChange, selectedUnits: selectedUnits, setSelectedUnits: setSelectedUnits, values: values || border_radius_control_DEFAULT_VALUES, units: units }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkedButton, { onClick: toggleLinked, isLinked: isLinked })] })] }); } ;// ./node_modules/@wordpress/icons/build-module/library/check.js /** * WordPress dependencies */ const check_check = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" }) }); /* harmony default export */ const library_check = (check_check); ;// ./node_modules/@wordpress/icons/build-module/library/shadow.js /** * WordPress dependencies */ const shadow = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 8c-2.2 0-4 1.8-4 4s1.8 4 4 4 4-1.8 4-4-1.8-4-4-4zm0 6.5c-1.4 0-2.5-1.1-2.5-2.5s1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5-1.1 2.5-2.5 2.5zM12.8 3h-1.5v3h1.5V3zm-1.6 18h1.5v-3h-1.5v3zm6.8-9.8v1.5h3v-1.5h-3zm-12 0H3v1.5h3v-1.5zm9.7 5.6 2.1 2.1 1.1-1.1-2.1-2.1-1.1 1.1zM8.3 7.2 6.2 5.1 5.1 6.2l2.1 2.1 1.1-1.1zM5.1 17.8l1.1 1.1 2.1-2.1-1.1-1.1-2.1 2.1zM18.9 6.2l-1.1-1.1-2.1 2.1 1.1 1.1 2.1-2.1z" }) }); /* harmony default export */ const library_shadow = (shadow); ;// ./node_modules/@wordpress/icons/build-module/library/reset.js /** * WordPress dependencies */ const reset_reset = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 11.5h10V13H7z" }) }); /* harmony default export */ const library_reset = (reset_reset); ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/shadow-panel-components.js /** * WordPress dependencies */ /** * External dependencies */ /** * Shared reference to an empty array for cases where it is important to avoid * returning a new array reference on every invocation. * * @type {Array} */ const shadow_panel_components_EMPTY_ARRAY = []; function ShadowPopoverContainer({ shadow, onShadowChange, settings }) { const shadows = useShadowPresets(settings); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-global-styles__shadow-popover-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 5, children: (0,external_wp_i18n_namespaceObject.__)('Drop shadow') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowPresets, { presets: shadows, activeShadow: shadow, onSelect: onShadowChange }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-global-styles__clear-shadow", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: () => onShadowChange(undefined), disabled: !shadow, accessibleWhenDisabled: true, children: (0,external_wp_i18n_namespaceObject.__)('Clear') }) })] }) }); } function ShadowPresets({ presets, activeShadow, onSelect }) { return !presets ? null : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { role: "listbox", className: "block-editor-global-styles__shadow__list", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Drop shadows'), children: presets.map(({ name, slug, shadow }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowIndicator, { label: name, isActive: shadow === activeShadow, type: slug === 'unset' ? 'unset' : 'preset', onSelect: () => onSelect(shadow === activeShadow ? undefined : shadow), shadow: shadow }, slug)) }); } function ShadowIndicator({ type, label, isActive, onSelect, shadow }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: label, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Item, { role: "option", "aria-label": label, "aria-selected": isActive, className: dist_clsx('block-editor-global-styles__shadow__item', { 'is-active': isActive }), render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { className: dist_clsx('block-editor-global-styles__shadow-indicator', { unset: type === 'unset' }), onClick: onSelect, style: { boxShadow: shadow }, "aria-label": label, children: isActive && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_check }) }) }) }); } function ShadowPopover({ shadow, onShadowChange, settings }) { const popoverProps = { placement: 'left-start', offset: 36, shift: true }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: popoverProps, className: "block-editor-global-styles__shadow-dropdown", renderToggle: renderShadowToggle(shadow, onShadowChange), renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { paddingSize: "medium", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowPopoverContainer, { shadow: shadow, onShadowChange: onShadowChange, settings: settings }) }) }); } function renderShadowToggle(shadow, onShadowChange) { return ({ onToggle, isOpen }) => { const shadowButtonRef = (0,external_wp_element_namespaceObject.useRef)(undefined); const toggleProps = { onClick: onToggle, className: dist_clsx({ 'is-open': isOpen }), 'aria-expanded': isOpen, ref: shadowButtonRef }; const removeButtonProps = { onClick: () => { if (isOpen) { onToggle(); } onShadowChange(undefined); // Return focus to parent button. shadowButtonRef.current?.focus(); }, className: dist_clsx('block-editor-global-styles__shadow-editor__remove-button', { 'is-open': isOpen }), label: (0,external_wp_i18n_namespaceObject.__)('Remove') }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ...toggleProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { className: "block-editor-global-styles__toggle-icon", icon: library_shadow, size: 24 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: (0,external_wp_i18n_namespaceObject.__)('Drop shadow') })] }) }), !!shadow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, size: "small", icon: library_reset, ...removeButtonProps })] }); }; } function useShadowPresets(settings) { return (0,external_wp_element_namespaceObject.useMemo)(() => { var _settings$shadow$pres; if (!settings?.shadow) { return shadow_panel_components_EMPTY_ARRAY; } const defaultPresetsEnabled = settings?.shadow?.defaultPresets; const { default: defaultShadows, theme: themeShadows, custom: customShadows } = (_settings$shadow$pres = settings?.shadow?.presets) !== null && _settings$shadow$pres !== void 0 ? _settings$shadow$pres : {}; const unsetShadow = { name: (0,external_wp_i18n_namespaceObject.__)('Unset'), slug: 'unset', shadow: 'none' }; const shadowPresets = [...(defaultPresetsEnabled && defaultShadows || shadow_panel_components_EMPTY_ARRAY), ...(themeShadows || shadow_panel_components_EMPTY_ARRAY), ...(customShadows || shadow_panel_components_EMPTY_ARRAY)]; if (shadowPresets.length) { shadowPresets.unshift(unsetShadow); } return shadowPresets; }, [settings]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/border-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ function useHasBorderPanel(settings) { const controls = Object.values(useHasBorderPanelControls(settings)); return controls.some(Boolean); } function useHasBorderPanelControls(settings) { const controls = { hasBorderColor: useHasBorderColorControl(settings), hasBorderRadius: useHasBorderRadiusControl(settings), hasBorderStyle: useHasBorderStyleControl(settings), hasBorderWidth: useHasBorderWidthControl(settings), hasShadow: useHasShadowControl(settings) }; return controls; } function useHasBorderColorControl(settings) { return settings?.border?.color; } function useHasBorderRadiusControl(settings) { return settings?.border?.radius; } function useHasBorderStyleControl(settings) { return settings?.border?.style; } function useHasBorderWidthControl(settings) { return settings?.border?.width; } function useHasShadowControl(settings) { const shadows = useShadowPresets(settings); return !!settings?.shadow && shadows.length > 0; } function BorderToolsPanel({ resetAllFilter, onChange, value, panelId, children, label }) { const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const resetAll = () => { const updatedValue = resetAllFilter(value); onChange(updatedValue); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: label, resetAll: resetAll, panelId: panelId, dropdownMenuProps: dropdownMenuProps, children: children }); } const border_panel_DEFAULT_CONTROLS = { radius: true, color: true, width: true, shadow: true }; function BorderPanel({ as: Wrapper = BorderToolsPanel, value, onChange, inheritedValue = value, settings, panelId, name, defaultControls = border_panel_DEFAULT_CONTROLS }) { var _settings$shadow$pres, _ref, _ref2, _shadowPresets$custom; const colors = useColorsPerOrigin(settings); const decodeValue = (0,external_wp_element_namespaceObject.useCallback)(rawValue => getValueFromVariable({ settings }, '', rawValue), [settings]); const encodeColorValue = colorValue => { const allColors = colors.flatMap(({ colors: originColors }) => originColors); const colorObject = allColors.find(({ color }) => color === colorValue); return colorObject ? 'var:preset|color|' + colorObject.slug : colorValue; }; const border = (0,external_wp_element_namespaceObject.useMemo)(() => { if ((0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(inheritedValue?.border)) { const borderValue = { ...inheritedValue?.border }; ['top', 'right', 'bottom', 'left'].forEach(side => { borderValue[side] = { ...borderValue[side], color: decodeValue(borderValue[side]?.color) }; }); return borderValue; } return { ...inheritedValue?.border, color: inheritedValue?.border?.color ? decodeValue(inheritedValue?.border?.color) : undefined }; }, [inheritedValue?.border, decodeValue]); const setBorder = newBorder => onChange({ ...value, border: newBorder }); const showBorderColor = useHasBorderColorControl(settings); const showBorderStyle = useHasBorderStyleControl(settings); const showBorderWidth = useHasBorderWidthControl(settings); // Border radius. const showBorderRadius = useHasBorderRadiusControl(settings); const borderRadiusValues = decodeValue(border?.radius); const setBorderRadius = newBorderRadius => setBorder({ ...border, radius: newBorderRadius }); const hasBorderRadius = () => { const borderValues = value?.border?.radius; if (typeof borderValues === 'object') { return Object.entries(borderValues).some(Boolean); } return !!borderValues; }; const hasShadowControl = useHasShadowControl(settings); // Shadow const shadow = decodeValue(inheritedValue?.shadow); const shadowPresets = (_settings$shadow$pres = settings?.shadow?.presets) !== null && _settings$shadow$pres !== void 0 ? _settings$shadow$pres : {}; const mergedShadowPresets = (_ref = (_ref2 = (_shadowPresets$custom = shadowPresets.custom) !== null && _shadowPresets$custom !== void 0 ? _shadowPresets$custom : shadowPresets.theme) !== null && _ref2 !== void 0 ? _ref2 : shadowPresets.default) !== null && _ref !== void 0 ? _ref : []; const setShadow = newValue => { const slug = mergedShadowPresets?.find(({ shadow: shadowName }) => shadowName === newValue)?.slug; onChange(setImmutably(value, ['shadow'], slug ? `var:preset|shadow|${slug}` : newValue || undefined)); }; const hasShadow = () => !!value?.shadow; const resetShadow = () => setShadow(undefined); const resetBorder = () => { if (hasBorderRadius()) { return setBorder({ radius: value?.border?.radius }); } setBorder(undefined); }; const onBorderChange = newBorder => { // Ensure we have a visible border style when a border width or // color is being selected. const updatedBorder = { ...newBorder }; if ((0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(updatedBorder)) { ['top', 'right', 'bottom', 'left'].forEach(side => { if (updatedBorder[side]) { updatedBorder[side] = { ...updatedBorder[side], color: encodeColorValue(updatedBorder[side]?.color) }; } }); } else if (updatedBorder) { updatedBorder.color = encodeColorValue(updatedBorder.color); } // As radius is maintained separately to color, style, and width // maintain its value. Undefined values here will be cleaned when // global styles are saved. setBorder({ radius: border?.radius, ...updatedBorder }); }; const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(previousValue => { return { ...previousValue, border: undefined, shadow: undefined }; }, []); const showBorderByDefault = defaultControls?.color || defaultControls?.width; const hasBorderControl = showBorderColor || showBorderStyle || showBorderWidth || showBorderRadius; const label = useBorderPanelLabel({ blockName: name, hasShadowControl, hasBorderControl }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, { resetAllFilter: resetAllFilter, value: value, onChange: onChange, panelId: panelId, label: label, children: [(showBorderWidth || showBorderColor) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => (0,external_wp_components_namespaceObject.__experimentalIsDefinedBorder)(value?.border), label: (0,external_wp_i18n_namespaceObject.__)('Border'), onDeselect: () => resetBorder(), isShownByDefault: showBorderByDefault, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BorderBoxControl, { colors: colors, enableAlpha: true, enableStyle: showBorderStyle, onChange: onBorderChange, popoverOffset: 40, popoverPlacement: "left-start", value: border, __experimentalIsRenderedInSidebar: true, size: "__unstable-large", hideLabelFromVision: !hasShadowControl, label: (0,external_wp_i18n_namespaceObject.__)('Border') }) }), showBorderRadius && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: hasBorderRadius, label: (0,external_wp_i18n_namespaceObject.__)('Radius'), onDeselect: () => setBorderRadius(undefined), isShownByDefault: defaultControls.radius, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BorderRadiusControl, { values: borderRadiusValues, onChange: newValue => { setBorderRadius(newValue || undefined); } }) }), hasShadowControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Shadow'), hasValue: hasShadow, onDeselect: resetShadow, isShownByDefault: defaultControls.shadow, panelId: panelId, children: [hasBorderControl ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)('Shadow') }) : null, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ShadowPopover, { shadow: shadow, onShadowChange: setShadow, settings: settings }) })] })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/border.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const BORDER_SUPPORT_KEY = '__experimentalBorder'; const SHADOW_SUPPORT_KEY = 'shadow'; const getColorByProperty = (colors, property, value) => { let matchedColor; colors.some(origin => origin.colors.some(color => { if (color[property] === value) { matchedColor = color; return true; } return false; })); return matchedColor; }; const getMultiOriginColor = ({ colors, namedColor, customColor }) => { // Search each origin (default, theme, or user) for matching color by name. if (namedColor) { const colorObject = getColorByProperty(colors, 'slug', namedColor); if (colorObject) { return colorObject; } } // Skip if no custom color or matching named color. if (!customColor) { return { color: undefined }; } // Attempt to find color via custom color value or build new object. const colorObject = getColorByProperty(colors, 'color', customColor); return colorObject ? colorObject : { color: customColor }; }; function getColorSlugFromVariable(value) { const namedColor = /var:preset\|color\|(.+)/.exec(value); if (namedColor && namedColor[1]) { return namedColor[1]; } return null; } function styleToAttributes(style) { if ((0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(style?.border)) { return { style, borderColor: undefined }; } const borderColorValue = style?.border?.color; const borderColorSlug = borderColorValue?.startsWith('var:preset|color|') ? borderColorValue.substring('var:preset|color|'.length) : undefined; const updatedStyle = { ...style }; updatedStyle.border = { ...updatedStyle.border, color: borderColorSlug ? undefined : borderColorValue }; return { style: utils_cleanEmptyObject(updatedStyle), borderColor: borderColorSlug }; } function attributesToStyle(attributes) { if ((0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(attributes.style?.border)) { return attributes.style; } return { ...attributes.style, border: { ...attributes.style?.border, color: attributes.borderColor ? 'var:preset|color|' + attributes.borderColor : attributes.style?.border?.color } }; } function BordersInspectorControl({ label, children, resetAllFilter }) { const attributesResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(attributes => { const existingStyle = attributesToStyle(attributes); const updatedStyle = resetAllFilter(existingStyle); return { ...attributes, ...styleToAttributes(updatedStyle) }; }, [resetAllFilter]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { group: "border", resetAllFilter: attributesResetAllFilter, label: label, children: children }); } function border_BorderPanel({ clientId, name, setAttributes, settings }) { const isEnabled = useHasBorderPanel(settings); function selector(select) { const { style, borderColor } = select(store).getBlockAttributes(clientId) || {}; return { style, borderColor }; } const { style, borderColor } = (0,external_wp_data_namespaceObject.useSelect)(selector, [clientId]); const value = (0,external_wp_element_namespaceObject.useMemo)(() => { return attributesToStyle({ style, borderColor }); }, [style, borderColor]); const onChange = newStyle => { setAttributes(styleToAttributes(newStyle)); }; if (!isEnabled) { return null; } const defaultControls = { ...(0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [BORDER_SUPPORT_KEY, '__experimentalDefaultControls']), ...(0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [SHADOW_SUPPORT_KEY, '__experimentalDefaultControls']) }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BorderPanel, { as: BordersInspectorControl, panelId: clientId, settings: settings, value: value, onChange: onChange, defaultControls: defaultControls }); } /** * Determine whether there is block support for border properties. * * @param {string} blockName Block name. * @param {string} feature Border feature to check support for. * * @return {boolean} Whether there is support. */ function hasBorderSupport(blockName, feature = 'any') { if (external_wp_element_namespaceObject.Platform.OS !== 'web') { return false; } const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, BORDER_SUPPORT_KEY); if (support === true) { return true; } if (feature === 'any') { return !!(support?.color || support?.radius || support?.width || support?.style); } return !!support?.[feature]; } /** * Determine whether there is block support for shadow properties. * * @param {string} blockName Block name. * * @return {boolean} Whether there is support. */ function hasShadowSupport(blockName) { return hasBlockSupport(blockName, SHADOW_SUPPORT_KEY); } function useBorderPanelLabel({ blockName, hasBorderControl, hasShadowControl } = {}) { const settings = useBlockSettings(blockName); const controls = useHasBorderPanelControls(settings); if (!hasBorderControl && !hasShadowControl && blockName) { hasBorderControl = controls?.hasBorderColor || controls?.hasBorderStyle || controls?.hasBorderWidth || controls?.hasBorderRadius; hasShadowControl = controls?.hasShadow; } if (hasBorderControl && hasShadowControl) { return (0,external_wp_i18n_namespaceObject.__)('Border & Shadow'); } if (hasShadowControl) { return (0,external_wp_i18n_namespaceObject.__)('Shadow'); } return (0,external_wp_i18n_namespaceObject.__)('Border'); } /** * Returns a new style object where the specified border attribute has been * removed. * * @param {Object} style Styles from block attributes. * @param {string} attribute The border style attribute to clear. * * @return {Object} Style object with the specified attribute removed. */ function removeBorderAttribute(style, attribute) { return cleanEmptyObject({ ...style, border: { ...style?.border, [attribute]: undefined } }); } /** * Filters registered block settings, extending attributes to include * `borderColor` if needed. * * @param {Object} settings Original block settings. * * @return {Object} Updated block settings. */ function addAttributes(settings) { if (!hasBorderSupport(settings, 'color')) { return settings; } // Allow blocks to specify default value if needed. if (settings.attributes.borderColor) { return settings; } // Add new borderColor attribute to block settings. return { ...settings, attributes: { ...settings.attributes, borderColor: { type: 'string' } } }; } /** * Override props assigned to save component to inject border color. * * @param {Object} props Additional props applied to save element. * @param {Object|string} blockNameOrType Block type definition. * @param {Object} attributes Block's attributes. * * @return {Object} Filtered props to apply to save element. */ function border_addSaveProps(props, blockNameOrType, attributes) { if (!hasBorderSupport(blockNameOrType, 'color') || shouldSkipSerialization(blockNameOrType, BORDER_SUPPORT_KEY, 'color')) { return props; } const borderClasses = getBorderClasses(attributes); const newClassName = dist_clsx(props.className, borderClasses); // If we are clearing the last of the previous classes in `className` // set it to `undefined` to avoid rendering empty DOM attributes. props.className = newClassName ? newClassName : undefined; return props; } /** * Generates a CSS class name consisting of all the applicable border color * classes given the current block attributes. * * @param {Object} attributes Block's attributes. * * @return {string} CSS class name. */ function getBorderClasses(attributes) { const { borderColor, style } = attributes; const borderColorClass = getColorClassName('border-color', borderColor); return dist_clsx({ 'has-border-color': borderColor || style?.border?.color, [borderColorClass]: !!borderColorClass }); } function border_useBlockProps({ name, borderColor, style }) { const { colors } = useMultipleOriginColorsAndGradients(); if (!hasBorderSupport(name, 'color') || shouldSkipSerialization(name, BORDER_SUPPORT_KEY, 'color')) { return {}; } const { color: borderColorValue } = getMultiOriginColor({ colors, namedColor: borderColor }); const { color: borderTopColor } = getMultiOriginColor({ colors, namedColor: getColorSlugFromVariable(style?.border?.top?.color) }); const { color: borderRightColor } = getMultiOriginColor({ colors, namedColor: getColorSlugFromVariable(style?.border?.right?.color) }); const { color: borderBottomColor } = getMultiOriginColor({ colors, namedColor: getColorSlugFromVariable(style?.border?.bottom?.color) }); const { color: borderLeftColor } = getMultiOriginColor({ colors, namedColor: getColorSlugFromVariable(style?.border?.left?.color) }); const extraStyles = { borderTopColor: borderTopColor || borderColorValue, borderRightColor: borderRightColor || borderColorValue, borderBottomColor: borderBottomColor || borderColorValue, borderLeftColor: borderLeftColor || borderColorValue }; return border_addSaveProps({ style: utils_cleanEmptyObject(extraStyles) || {} }, name, { borderColor, style }); } /* harmony default export */ const border = ({ useBlockProps: border_useBlockProps, addSaveProps: border_addSaveProps, attributeKeys: ['borderColor', 'style'], hasSupport(name) { return hasBorderSupport(name, 'color'); } }); (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/border/addAttributes', addAttributes); ;// ./node_modules/@wordpress/block-editor/build-module/components/gradients/use-gradient.js /** * WordPress dependencies */ /** * Internal dependencies */ function __experimentalGetGradientClass(gradientSlug) { if (!gradientSlug) { return undefined; } return `has-${gradientSlug}-gradient-background`; } /** * Retrieves the gradient value per slug. * * @param {Array} gradients Gradient Palette * @param {string} slug Gradient slug * * @return {string} Gradient value. */ function getGradientValueBySlug(gradients, slug) { const gradient = gradients?.find(g => g.slug === slug); return gradient && gradient.gradient; } function __experimentalGetGradientObjectByGradientValue(gradients, value) { const gradient = gradients?.find(g => g.gradient === value); return gradient; } /** * Retrieves the gradient slug per slug. * * @param {Array} gradients Gradient Palette * @param {string} value Gradient value * @return {string} Gradient slug. */ function getGradientSlugByValue(gradients, value) { const gradient = __experimentalGetGradientObjectByGradientValue(gradients, value); return gradient && gradient.slug; } function __experimentalUseGradient({ gradientAttribute = 'gradient', customGradientAttribute = 'customGradient' } = {}) { const { clientId } = useBlockEditContext(); const [userGradientPalette, themeGradientPalette, defaultGradientPalette] = use_settings_useSettings('color.gradients.custom', 'color.gradients.theme', 'color.gradients.default'); const allGradients = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userGradientPalette || []), ...(themeGradientPalette || []), ...(defaultGradientPalette || [])], [userGradientPalette, themeGradientPalette, defaultGradientPalette]); const { gradient, customGradient } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockAttributes } = select(store); const attributes = getBlockAttributes(clientId) || {}; return { customGradient: attributes[customGradientAttribute], gradient: attributes[gradientAttribute] }; }, [clientId, gradientAttribute, customGradientAttribute]); const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); const setGradient = (0,external_wp_element_namespaceObject.useCallback)(newGradientValue => { const slug = getGradientSlugByValue(allGradients, newGradientValue); if (slug) { updateBlockAttributes(clientId, { [gradientAttribute]: slug, [customGradientAttribute]: undefined }); return; } updateBlockAttributes(clientId, { [gradientAttribute]: undefined, [customGradientAttribute]: newGradientValue }); }, [allGradients, clientId, updateBlockAttributes]); const gradientClass = __experimentalGetGradientClass(gradient); let gradientValue; if (gradient) { gradientValue = getGradientValueBySlug(allGradients, gradient); } else { gradientValue = customGradient; } return { gradientClass, gradientValue, setGradient }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/control.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { Tabs } = unlock(external_wp_components_namespaceObject.privateApis); const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients']; const TAB_IDS = { color: 'color', gradient: 'gradient' }; function ColorGradientControlInner({ colors, gradients, disableCustomColors, disableCustomGradients, __experimentalIsRenderedInSidebar, className, label, onColorChange, onGradientChange, colorValue, gradientValue, clearable, showTitle = true, enableAlpha, headingLevel }) { const canChooseAColor = onColorChange && (colors && colors.length > 0 || !disableCustomColors); const canChooseAGradient = onGradientChange && (gradients && gradients.length > 0 || !disableCustomGradients); if (!canChooseAColor && !canChooseAGradient) { return null; } const tabPanels = { [TAB_IDS.color]: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorPalette, { value: colorValue, onChange: canChooseAGradient ? newColor => { onColorChange(newColor); onGradientChange(); } : onColorChange, colors, disableCustomColors, __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, clearable: clearable, enableAlpha: enableAlpha, headingLevel: headingLevel }), [TAB_IDS.gradient]: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.GradientPicker, { value: gradientValue, onChange: canChooseAColor ? newGradient => { onGradientChange(newGradient); onColorChange(); } : onGradientChange, gradients, disableCustomGradients, __experimentalIsRenderedInSidebar: __experimentalIsRenderedInSidebar, clearable: clearable, headingLevel: headingLevel }) }; const renderPanelType = type => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-color-gradient-control__panel", children: tabPanels[type] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl, { __nextHasNoMarginBottom: true, className: dist_clsx('block-editor-color-gradient-control', className), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("fieldset", { className: "block-editor-color-gradient-control__fieldset", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: [showTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("legend", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-color-gradient-control__color-indicator", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { children: label }) }) }), canChooseAColor && canChooseAGradient && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs, { defaultTabId: gradientValue ? TAB_IDS.gradient : !!canChooseAColor && TAB_IDS.color, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tabs.TabList, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { tabId: TAB_IDS.color, children: (0,external_wp_i18n_namespaceObject.__)('Color') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.Tab, { tabId: TAB_IDS.gradient, children: (0,external_wp_i18n_namespaceObject.__)('Gradient') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, { tabId: TAB_IDS.color, className: "block-editor-color-gradient-control__panel", focusable: false, children: tabPanels.color }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tabs.TabPanel, { tabId: TAB_IDS.gradient, className: "block-editor-color-gradient-control__panel", focusable: false, children: tabPanels.gradient })] }) }), !canChooseAGradient && renderPanelType(TAB_IDS.color), !canChooseAColor && renderPanelType(TAB_IDS.gradient)] }) }) }); } function ColorGradientControlSelect(props) { const [colors, gradients, customColors, customGradients] = use_settings_useSettings('color.palette', 'color.gradients', 'color.custom', 'color.customGradient'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorGradientControlInner, { colors: colors, gradients: gradients, disableCustomColors: !customColors, disableCustomGradients: !customGradients, ...props }); } function ColorGradientControl(props) { if (colorsAndGradientKeys.every(key => props.hasOwnProperty(key))) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorGradientControlInner, { ...props }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorGradientControlSelect, { ...props }); } /* harmony default export */ const control = (ColorGradientControl); ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/color-panel.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function useHasColorPanel(settings) { const hasTextPanel = useHasTextPanel(settings); const hasBackgroundPanel = useHasBackgroundColorPanel(settings); const hasLinkPanel = useHasLinkPanel(settings); const hasHeadingPanel = useHasHeadingPanel(settings); const hasButtonPanel = useHasButtonPanel(settings); const hasCaptionPanel = useHasCaptionPanel(settings); return hasTextPanel || hasBackgroundPanel || hasLinkPanel || hasHeadingPanel || hasButtonPanel || hasCaptionPanel; } function useHasTextPanel(settings) { const colors = useColorsPerOrigin(settings); return settings?.color?.text && (colors?.length > 0 || settings?.color?.custom); } function useHasLinkPanel(settings) { const colors = useColorsPerOrigin(settings); return settings?.color?.link && (colors?.length > 0 || settings?.color?.custom); } function useHasCaptionPanel(settings) { const colors = useColorsPerOrigin(settings); return settings?.color?.caption && (colors?.length > 0 || settings?.color?.custom); } function useHasHeadingPanel(settings) { const colors = useColorsPerOrigin(settings); const gradients = useGradientsPerOrigin(settings); return settings?.color?.heading && (colors?.length > 0 || settings?.color?.custom || gradients?.length > 0 || settings?.color?.customGradient); } function useHasButtonPanel(settings) { const colors = useColorsPerOrigin(settings); const gradients = useGradientsPerOrigin(settings); return settings?.color?.button && (colors?.length > 0 || settings?.color?.custom || gradients?.length > 0 || settings?.color?.customGradient); } function useHasBackgroundColorPanel(settings) { const colors = useColorsPerOrigin(settings); const gradients = useGradientsPerOrigin(settings); return settings?.color?.background && (colors?.length > 0 || settings?.color?.custom || gradients?.length > 0 || settings?.color?.customGradient); } function ColorToolsPanel({ resetAllFilter, onChange, value, panelId, children }) { const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const resetAll = () => { const updatedValue = resetAllFilter(value); onChange(updatedValue); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Elements'), resetAll: resetAll, panelId: panelId, hasInnerWrapper: true, headingLevel: 3, className: "color-block-support-panel", __experimentalFirstVisibleItemClass: "first", __experimentalLastVisibleItemClass: "last", dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "color-block-support-panel__inner-wrapper", children: children }) }); } const color_panel_DEFAULT_CONTROLS = { text: true, background: true, link: true, heading: true, button: true, caption: true }; const popoverProps = { placement: 'left-start', offset: 36, shift: true }; const { Tabs: color_panel_Tabs } = unlock(external_wp_components_namespaceObject.privateApis); const LabeledColorIndicators = ({ indicators, label }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalZStack, { isLayered: false, offset: -8, children: indicators.map((indicator, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { expanded: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorIndicator, { colorValue: indicator }) }, index)) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "block-editor-panel-color-gradient-settings__color-name", children: label })] }); function ColorPanelTab({ isGradient, inheritedValue, userValue, setValue, colorGradientControlSettings }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(control, { ...colorGradientControlSettings, showTitle: false, enableAlpha: true, __experimentalIsRenderedInSidebar: true, colorValue: isGradient ? undefined : inheritedValue, gradientValue: isGradient ? inheritedValue : undefined, onColorChange: isGradient ? undefined : setValue, onGradientChange: isGradient ? setValue : undefined, clearable: inheritedValue === userValue, headingLevel: 3 }); } function ColorPanelDropdown({ label, hasValue, resetValue, isShownByDefault, indicators, tabs, colorGradientControlSettings, panelId }) { var _tabs$; const currentTab = tabs.find(tab => tab.userValue !== undefined); const { key: firstTabKey, ...firstTab } = (_tabs$ = tabs[0]) !== null && _tabs$ !== void 0 ? _tabs$ : {}; const colorGradientDropdownButtonRef = (0,external_wp_element_namespaceObject.useRef)(undefined); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { className: "block-editor-tools-panel-color-gradient-settings__item", hasValue: hasValue, label: label, onDeselect: resetValue, isShownByDefault: isShownByDefault, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: popoverProps, className: "block-editor-tools-panel-color-gradient-settings__dropdown", renderToggle: ({ onToggle, isOpen }) => { const toggleProps = { onClick: onToggle, className: dist_clsx('block-editor-panel-color-gradient-settings__dropdown', { 'is-open': isOpen }), 'aria-expanded': isOpen, ref: colorGradientDropdownButtonRef }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { ...toggleProps, __next40pxDefaultSize: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LabeledColorIndicators, { indicators: indicators, label: label }) }), hasValue() && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Reset'), className: "block-editor-panel-color-gradient-settings__reset", size: "small", icon: library_reset, onClick: () => { resetValue(); if (isOpen) { onToggle(); } // Return focus to parent button colorGradientDropdownButtonRef.current?.focus(); } })] }); }, renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { paddingSize: "none", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-panel-color-gradient-settings__dropdown-content", children: [tabs.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPanelTab, { ...firstTab, colorGradientControlSettings: colorGradientControlSettings }, firstTabKey), tabs.length > 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(color_panel_Tabs, { defaultTabId: currentTab?.key, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(color_panel_Tabs.TabList, { children: tabs.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(color_panel_Tabs.Tab, { tabId: tab.key, children: tab.label }, tab.key)) }), tabs.map(tab => { const { key: tabKey, ...restTabProps } = tab; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(color_panel_Tabs.TabPanel, { tabId: tabKey, focusable: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPanelTab, { ...restTabProps, colorGradientControlSettings: colorGradientControlSettings }, tabKey) }, tabKey); })] })] }) }) }) }); } function ColorPanel({ as: Wrapper = ColorToolsPanel, value, onChange, inheritedValue = value, settings, panelId, defaultControls = color_panel_DEFAULT_CONTROLS, children }) { const colors = useColorsPerOrigin(settings); const gradients = useGradientsPerOrigin(settings); const areCustomSolidsEnabled = settings?.color?.custom; const areCustomGradientsEnabled = settings?.color?.customGradient; const hasSolidColors = colors.length > 0 || areCustomSolidsEnabled; const hasGradientColors = gradients.length > 0 || areCustomGradientsEnabled; const decodeValue = rawValue => getValueFromVariable({ settings }, '', rawValue); const encodeColorValue = colorValue => { const allColors = colors.flatMap(({ colors: originColors }) => originColors); const colorObject = allColors.find(({ color }) => color === colorValue); return colorObject ? 'var:preset|color|' + colorObject.slug : colorValue; }; const encodeGradientValue = gradientValue => { const allGradients = gradients.flatMap(({ gradients: originGradients }) => originGradients); const gradientObject = allGradients.find(({ gradient }) => gradient === gradientValue); return gradientObject ? 'var:preset|gradient|' + gradientObject.slug : gradientValue; }; // BackgroundColor const showBackgroundPanel = useHasBackgroundColorPanel(settings); const backgroundColor = decodeValue(inheritedValue?.color?.background); const userBackgroundColor = decodeValue(value?.color?.background); const gradient = decodeValue(inheritedValue?.color?.gradient); const userGradient = decodeValue(value?.color?.gradient); const hasBackground = () => !!userBackgroundColor || !!userGradient; const setBackgroundColor = newColor => { const newValue = setImmutably(value, ['color', 'background'], encodeColorValue(newColor)); newValue.color.gradient = undefined; onChange(newValue); }; const setGradient = newGradient => { const newValue = setImmutably(value, ['color', 'gradient'], encodeGradientValue(newGradient)); newValue.color.background = undefined; onChange(newValue); }; const resetBackground = () => { const newValue = setImmutably(value, ['color', 'background'], undefined); newValue.color.gradient = undefined; onChange(newValue); }; // Links const showLinkPanel = useHasLinkPanel(settings); const linkColor = decodeValue(inheritedValue?.elements?.link?.color?.text); const userLinkColor = decodeValue(value?.elements?.link?.color?.text); const setLinkColor = newColor => { onChange(setImmutably(value, ['elements', 'link', 'color', 'text'], encodeColorValue(newColor))); }; const hoverLinkColor = decodeValue(inheritedValue?.elements?.link?.[':hover']?.color?.text); const userHoverLinkColor = decodeValue(value?.elements?.link?.[':hover']?.color?.text); const setHoverLinkColor = newColor => { onChange(setImmutably(value, ['elements', 'link', ':hover', 'color', 'text'], encodeColorValue(newColor))); }; const hasLink = () => !!userLinkColor || !!userHoverLinkColor; const resetLink = () => { let newValue = setImmutably(value, ['elements', 'link', ':hover', 'color', 'text'], undefined); newValue = setImmutably(newValue, ['elements', 'link', 'color', 'text'], undefined); onChange(newValue); }; // Text Color const showTextPanel = useHasTextPanel(settings); const textColor = decodeValue(inheritedValue?.color?.text); const userTextColor = decodeValue(value?.color?.text); const hasTextColor = () => !!userTextColor; const setTextColor = newColor => { let changedObject = setImmutably(value, ['color', 'text'], encodeColorValue(newColor)); if (textColor === linkColor) { changedObject = setImmutably(changedObject, ['elements', 'link', 'color', 'text'], encodeColorValue(newColor)); } onChange(changedObject); }; const resetTextColor = () => setTextColor(undefined); // Elements const elements = [{ name: 'caption', label: (0,external_wp_i18n_namespaceObject.__)('Captions'), showPanel: useHasCaptionPanel(settings) }, { name: 'button', label: (0,external_wp_i18n_namespaceObject.__)('Button'), showPanel: useHasButtonPanel(settings) }, { name: 'heading', label: (0,external_wp_i18n_namespaceObject.__)('Heading'), showPanel: useHasHeadingPanel(settings) }, { name: 'h1', label: (0,external_wp_i18n_namespaceObject.__)('H1'), showPanel: useHasHeadingPanel(settings) }, { name: 'h2', label: (0,external_wp_i18n_namespaceObject.__)('H2'), showPanel: useHasHeadingPanel(settings) }, { name: 'h3', label: (0,external_wp_i18n_namespaceObject.__)('H3'), showPanel: useHasHeadingPanel(settings) }, { name: 'h4', label: (0,external_wp_i18n_namespaceObject.__)('H4'), showPanel: useHasHeadingPanel(settings) }, { name: 'h5', label: (0,external_wp_i18n_namespaceObject.__)('H5'), showPanel: useHasHeadingPanel(settings) }, { name: 'h6', label: (0,external_wp_i18n_namespaceObject.__)('H6'), showPanel: useHasHeadingPanel(settings) }]; const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(previousValue => { return { ...previousValue, color: undefined, elements: { ...previousValue?.elements, link: { ...previousValue?.elements?.link, color: undefined, ':hover': { color: undefined } }, ...elements.reduce((acc, element) => { return { ...acc, [element.name]: { ...previousValue?.elements?.[element.name], color: undefined } }; }, {}) } }; }, []); const items = [showTextPanel && { key: 'text', label: (0,external_wp_i18n_namespaceObject.__)('Text'), hasValue: hasTextColor, resetValue: resetTextColor, isShownByDefault: defaultControls.text, indicators: [textColor], tabs: [{ key: 'text', label: (0,external_wp_i18n_namespaceObject.__)('Text'), inheritedValue: textColor, setValue: setTextColor, userValue: userTextColor }] }, showBackgroundPanel && { key: 'background', label: (0,external_wp_i18n_namespaceObject.__)('Background'), hasValue: hasBackground, resetValue: resetBackground, isShownByDefault: defaultControls.background, indicators: [gradient !== null && gradient !== void 0 ? gradient : backgroundColor], tabs: [hasSolidColors && { key: 'background', label: (0,external_wp_i18n_namespaceObject.__)('Color'), inheritedValue: backgroundColor, setValue: setBackgroundColor, userValue: userBackgroundColor }, hasGradientColors && { key: 'gradient', label: (0,external_wp_i18n_namespaceObject.__)('Gradient'), inheritedValue: gradient, setValue: setGradient, userValue: userGradient, isGradient: true }].filter(Boolean) }, showLinkPanel && { key: 'link', label: (0,external_wp_i18n_namespaceObject.__)('Link'), hasValue: hasLink, resetValue: resetLink, isShownByDefault: defaultControls.link, indicators: [linkColor, hoverLinkColor], tabs: [{ key: 'link', label: (0,external_wp_i18n_namespaceObject.__)('Default'), inheritedValue: linkColor, setValue: setLinkColor, userValue: userLinkColor }, { key: 'hover', label: (0,external_wp_i18n_namespaceObject.__)('Hover'), inheritedValue: hoverLinkColor, setValue: setHoverLinkColor, userValue: userHoverLinkColor }] }].filter(Boolean); elements.forEach(({ name, label, showPanel }) => { if (!showPanel) { return; } const elementBackgroundColor = decodeValue(inheritedValue?.elements?.[name]?.color?.background); const elementGradient = decodeValue(inheritedValue?.elements?.[name]?.color?.gradient); const elementTextColor = decodeValue(inheritedValue?.elements?.[name]?.color?.text); const elementBackgroundUserColor = decodeValue(value?.elements?.[name]?.color?.background); const elementGradientUserColor = decodeValue(value?.elements?.[name]?.color?.gradient); const elementTextUserColor = decodeValue(value?.elements?.[name]?.color?.text); const hasElement = () => !!(elementTextUserColor || elementBackgroundUserColor || elementGradientUserColor); const resetElement = () => { const newValue = setImmutably(value, ['elements', name, 'color', 'background'], undefined); newValue.elements[name].color.gradient = undefined; newValue.elements[name].color.text = undefined; onChange(newValue); }; const setElementTextColor = newTextColor => { onChange(setImmutably(value, ['elements', name, 'color', 'text'], encodeColorValue(newTextColor))); }; const setElementBackgroundColor = newBackgroundColor => { const newValue = setImmutably(value, ['elements', name, 'color', 'background'], encodeColorValue(newBackgroundColor)); newValue.elements[name].color.gradient = undefined; onChange(newValue); }; const setElementGradient = newGradient => { const newValue = setImmutably(value, ['elements', name, 'color', 'gradient'], encodeGradientValue(newGradient)); newValue.elements[name].color.background = undefined; onChange(newValue); }; const supportsTextColor = true; // Background color is not supported for `caption` // as there isn't yet a way to set padding for the element. const supportsBackground = name !== 'caption'; items.push({ key: name, label, hasValue: hasElement, resetValue: resetElement, isShownByDefault: defaultControls[name], indicators: supportsTextColor && supportsBackground ? [elementTextColor, elementGradient !== null && elementGradient !== void 0 ? elementGradient : elementBackgroundColor] : [supportsTextColor ? elementTextColor : elementGradient !== null && elementGradient !== void 0 ? elementGradient : elementBackgroundColor], tabs: [hasSolidColors && supportsTextColor && { key: 'text', label: (0,external_wp_i18n_namespaceObject.__)('Text'), inheritedValue: elementTextColor, setValue: setElementTextColor, userValue: elementTextUserColor }, hasSolidColors && supportsBackground && { key: 'background', label: (0,external_wp_i18n_namespaceObject.__)('Background'), inheritedValue: elementBackgroundColor, setValue: setElementBackgroundColor, userValue: elementBackgroundUserColor }, hasGradientColors && supportsBackground && { key: 'gradient', label: (0,external_wp_i18n_namespaceObject.__)('Gradient'), inheritedValue: elementGradient, setValue: setElementGradient, userValue: elementGradientUserColor, isGradient: true }].filter(Boolean) }); }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, { resetAllFilter: resetAllFilter, value: value, onChange: onChange, panelId: panelId, children: [items.map(item => { const { key, ...restItem } = item; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPanelDropdown, { ...restItem, colorGradientControlSettings: { colors, disableCustomColors: !areCustomSolidsEnabled, gradients, disableCustomGradients: !areCustomGradientsEnabled }, panelId: panelId }, key); }), children] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/contrast-checker/index.js /** * External dependencies */ /** * WordPress dependencies */ k([names, a11y]); function ContrastChecker({ backgroundColor, fallbackBackgroundColor, fallbackTextColor, fallbackLinkColor, fontSize, // Font size value in pixels. isLargeText, textColor, linkColor, enableAlphaChecker = false }) { const currentBackgroundColor = backgroundColor || fallbackBackgroundColor; // Must have a background color. if (!currentBackgroundColor) { return null; } const currentTextColor = textColor || fallbackTextColor; const currentLinkColor = linkColor || fallbackLinkColor; // Must have at least one text color. if (!currentTextColor && !currentLinkColor) { return null; } const textColors = [{ color: currentTextColor, description: (0,external_wp_i18n_namespaceObject.__)('text color') }, { color: currentLinkColor, description: (0,external_wp_i18n_namespaceObject.__)('link color') }]; const colordBackgroundColor = w(currentBackgroundColor); const backgroundColorHasTransparency = colordBackgroundColor.alpha() < 1; const backgroundColorBrightness = colordBackgroundColor.brightness(); const isReadableOptions = { level: 'AA', size: isLargeText || isLargeText !== false && fontSize >= 24 ? 'large' : 'small' }; let message = ''; let speakMessage = ''; for (const item of textColors) { // If there is no color, go no further. if (!item.color) { continue; } const colordTextColor = w(item.color); const isColordTextReadable = colordTextColor.isReadable(colordBackgroundColor, isReadableOptions); const textHasTransparency = colordTextColor.alpha() < 1; // If the contrast is not readable. if (!isColordTextReadable) { // Don't show the message if the background or text is transparent. if (backgroundColorHasTransparency || textHasTransparency) { continue; } message = backgroundColorBrightness < colordTextColor.brightness() ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s is a type of text color, e.g., "text color" or "link color". (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s.'), item.description) : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s is a type of text color, e.g., "text color" or "link color". (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s.'), item.description); speakMessage = (0,external_wp_i18n_namespaceObject.__)('This color combination may be hard for people to read.'); // Break from the loop when we have a contrast warning. // These messages take priority over the transparency warning. break; } // If there is no contrast warning and the text is transparent, // show the transparent warning if alpha check is enabled. if (textHasTransparency && enableAlphaChecker) { message = (0,external_wp_i18n_namespaceObject.__)('Transparent text may be hard for people to read.'); speakMessage = (0,external_wp_i18n_namespaceObject.__)('Transparent text may be hard for people to read.'); } } if (!message) { return null; } // Note: The `Notice` component can speak messages via its `spokenMessage` // prop, but the contrast checker requires granular control over when the // announcements are made. Notably, the message will be re-announced if a // new color combination is selected and the contrast is still insufficient. (0,external_wp_a11y_namespaceObject.speak)(speakMessage); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-contrast-checker", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { spokenMessage: null, status: "warning", isDismissible: false, children: message }) }); } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/contrast-checker/README.md */ /* harmony default export */ const contrast_checker = (ContrastChecker); ;// ./node_modules/@wordpress/block-editor/build-module/components/provider/block-refs-provider.js /** * WordPress dependencies */ const BlockRefs = (0,external_wp_element_namespaceObject.createContext)({ refsMap: (0,external_wp_compose_namespaceObject.observableMap)() }); function BlockRefsProvider({ children }) { const value = (0,external_wp_element_namespaceObject.useMemo)(() => ({ refsMap: (0,external_wp_compose_namespaceObject.observableMap)() }), []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRefs.Provider, { value: value, children: children }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-block-refs.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('@wordpress/element').RefCallback} RefCallback */ /** @typedef {import('@wordpress/element').Ref} Ref */ /** * Provides a ref to the BlockRefs context. * * @param {string} clientId The client ID of the element ref. * * @return {RefCallback} Ref callback. */ function useBlockRefProvider(clientId) { const { refsMap } = (0,external_wp_element_namespaceObject.useContext)(BlockRefs); return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { refsMap.set(clientId, element); return () => refsMap.delete(clientId); }, [clientId]); } function assignRef(ref, value) { if (typeof ref === 'function') { ref(value); } else if (ref) { ref.current = value; } } /** * Tracks the DOM element for the block identified by `clientId` and assigns it to the `ref` * whenever it changes. * * @param {string} clientId The client ID to track. * @param {Ref} ref The ref object/callback to assign to. */ function useBlockElementRef(clientId, ref) { const { refsMap } = (0,external_wp_element_namespaceObject.useContext)(BlockRefs); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { assignRef(ref, refsMap.get(clientId)); const unsubscribe = refsMap.subscribe(clientId, () => assignRef(ref, refsMap.get(clientId))); return () => { unsubscribe(); assignRef(ref, null); }; }, [refsMap, clientId, ref]); } /** * Return the element for a given client ID. Updates whenever the element * changes, becomes available, or disappears. * * @param {string} clientId The client ID to an element for. * * @return {Element|null} The block's wrapper element. */ function useBlockElement(clientId) { const [blockElement, setBlockElement] = (0,external_wp_element_namespaceObject.useState)(null); useBlockElementRef(clientId, setBlockElement); return blockElement; } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/contrast-checker.js /** * WordPress dependencies */ /** * Internal dependencies */ function getComputedValue(node, property) { return node.ownerDocument.defaultView.getComputedStyle(node).getPropertyValue(property); } function getBlockElementColors(blockEl) { if (!blockEl) { return {}; } const firstLinkElement = blockEl.querySelector('a'); const linkColor = !!firstLinkElement?.innerText ? getComputedValue(firstLinkElement, 'color') : undefined; const textColor = getComputedValue(blockEl, 'color'); let backgroundColorNode = blockEl; let backgroundColor = getComputedValue(backgroundColorNode, 'background-color'); while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) { backgroundColorNode = backgroundColorNode.parentNode; backgroundColor = getComputedValue(backgroundColorNode, 'background-color'); } return { textColor, backgroundColor, linkColor }; } function contrast_checker_reducer(prevColors, newColors) { const hasChanged = Object.keys(newColors).some(key => prevColors[key] !== newColors[key]); // Do not re-render if the colors have not changed. return hasChanged ? newColors : prevColors; } function BlockColorContrastChecker({ clientId }) { const blockEl = useBlockElement(clientId); const [colors, setColors] = (0,external_wp_element_namespaceObject.useReducer)(contrast_checker_reducer, {}); // There are so many things that can change the color of a block // So we perform this check on every render. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (!blockEl) { return; } function updateColors() { setColors(getBlockElementColors(blockEl)); } // Combine `useLayoutEffect` and two rAF calls to ensure that values are read // after the current paint but before the next paint. window.requestAnimationFrame(() => window.requestAnimationFrame(updateColors)); }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(contrast_checker, { backgroundColor: colors.backgroundColor, textColor: colors.textColor, linkColor: colors.linkColor, enableAlphaChecker: true }); } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/color.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const COLOR_SUPPORT_KEY = 'color'; const hasColorSupport = blockNameOrType => { const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockNameOrType, COLOR_SUPPORT_KEY); return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false); }; const hasLinkColorSupport = blockType => { if (external_wp_element_namespaceObject.Platform.OS !== 'web') { return false; } const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY); return colorSupport !== null && typeof colorSupport === 'object' && !!colorSupport.link; }; const hasGradientSupport = blockNameOrType => { const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockNameOrType, COLOR_SUPPORT_KEY); return colorSupport !== null && typeof colorSupport === 'object' && !!colorSupport.gradients; }; const hasBackgroundColorSupport = blockType => { const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY); return colorSupport && colorSupport.background !== false; }; const hasTextColorSupport = blockType => { const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, COLOR_SUPPORT_KEY); return colorSupport && colorSupport.text !== false; }; /** * Filters registered block settings, extending attributes to include * `backgroundColor` and `textColor` attribute. * * @param {Object} settings Original block settings. * * @return {Object} Filtered block settings. */ function color_addAttributes(settings) { if (!hasColorSupport(settings)) { return settings; } // Allow blocks to specify their own attribute definition with default values if needed. if (!settings.attributes.backgroundColor) { Object.assign(settings.attributes, { backgroundColor: { type: 'string' } }); } if (!settings.attributes.textColor) { Object.assign(settings.attributes, { textColor: { type: 'string' } }); } if (hasGradientSupport(settings) && !settings.attributes.gradient) { Object.assign(settings.attributes, { gradient: { type: 'string' } }); } return settings; } /** * Override props assigned to save component to inject colors classnames. * * @param {Object} props Additional props applied to save element. * @param {Object|string} blockNameOrType Block type. * @param {Object} attributes Block attributes. * * @return {Object} Filtered props applied to save element. */ function color_addSaveProps(props, blockNameOrType, attributes) { if (!hasColorSupport(blockNameOrType) || shouldSkipSerialization(blockNameOrType, COLOR_SUPPORT_KEY)) { return props; } const hasGradient = hasGradientSupport(blockNameOrType); // I'd have preferred to avoid the "style" attribute usage here const { backgroundColor, textColor, gradient, style } = attributes; const shouldSerialize = feature => !shouldSkipSerialization(blockNameOrType, COLOR_SUPPORT_KEY, feature); // Primary color classes must come before the `has-text-color`, // `has-background` and `has-link-color` classes to maintain backwards // compatibility and avoid block invalidations. const textClass = shouldSerialize('text') ? getColorClassName('color', textColor) : undefined; const gradientClass = shouldSerialize('gradients') ? __experimentalGetGradientClass(gradient) : undefined; const backgroundClass = shouldSerialize('background') ? getColorClassName('background-color', backgroundColor) : undefined; const serializeHasBackground = shouldSerialize('background') || shouldSerialize('gradients'); const hasBackground = backgroundColor || style?.color?.background || hasGradient && (gradient || style?.color?.gradient); const newClassName = dist_clsx(props.className, textClass, gradientClass, { // Don't apply the background class if there's a custom gradient. [backgroundClass]: (!hasGradient || !style?.color?.gradient) && !!backgroundClass, 'has-text-color': shouldSerialize('text') && (textColor || style?.color?.text), 'has-background': serializeHasBackground && hasBackground, 'has-link-color': shouldSerialize('link') && style?.elements?.link?.color }); props.className = newClassName ? newClassName : undefined; return props; } function color_styleToAttributes(style) { const textColorValue = style?.color?.text; const textColorSlug = textColorValue?.startsWith('var:preset|color|') ? textColorValue.substring('var:preset|color|'.length) : undefined; const backgroundColorValue = style?.color?.background; const backgroundColorSlug = backgroundColorValue?.startsWith('var:preset|color|') ? backgroundColorValue.substring('var:preset|color|'.length) : undefined; const gradientValue = style?.color?.gradient; const gradientSlug = gradientValue?.startsWith('var:preset|gradient|') ? gradientValue.substring('var:preset|gradient|'.length) : undefined; const updatedStyle = { ...style }; updatedStyle.color = { ...updatedStyle.color, text: textColorSlug ? undefined : textColorValue, background: backgroundColorSlug ? undefined : backgroundColorValue, gradient: gradientSlug ? undefined : gradientValue }; return { style: utils_cleanEmptyObject(updatedStyle), textColor: textColorSlug, backgroundColor: backgroundColorSlug, gradient: gradientSlug }; } function color_attributesToStyle(attributes) { return { ...attributes.style, color: { ...attributes.style?.color, text: attributes.textColor ? 'var:preset|color|' + attributes.textColor : attributes.style?.color?.text, background: attributes.backgroundColor ? 'var:preset|color|' + attributes.backgroundColor : attributes.style?.color?.background, gradient: attributes.gradient ? 'var:preset|gradient|' + attributes.gradient : attributes.style?.color?.gradient } }; } function ColorInspectorControl({ children, resetAllFilter }) { const attributesResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(attributes => { const existingStyle = color_attributesToStyle(attributes); const updatedStyle = resetAllFilter(existingStyle); return { ...attributes, ...color_styleToAttributes(updatedStyle) }; }, [resetAllFilter]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { group: "color", resetAllFilter: attributesResetAllFilter, children: children }); } function ColorEdit({ clientId, name, setAttributes, settings }) { const isEnabled = useHasColorPanel(settings); function selector(select) { const { style, textColor, backgroundColor, gradient } = select(store).getBlockAttributes(clientId) || {}; return { style, textColor, backgroundColor, gradient }; } const { style, textColor, backgroundColor, gradient } = (0,external_wp_data_namespaceObject.useSelect)(selector, [clientId]); const value = (0,external_wp_element_namespaceObject.useMemo)(() => { return color_attributesToStyle({ style, textColor, backgroundColor, gradient }); }, [style, textColor, backgroundColor, gradient]); const onChange = newStyle => { setAttributes(color_styleToAttributes(newStyle)); }; if (!isEnabled) { return null; } const defaultControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [COLOR_SUPPORT_KEY, '__experimentalDefaultControls']); const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web' && !value?.color?.gradient && (settings?.color?.text || settings?.color?.link) && // Contrast checking is enabled by default. // Deactivating it requires `enableContrastChecker` to have // an explicit value of `false`. false !== (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [COLOR_SUPPORT_KEY, 'enableContrastChecker']); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorPanel, { as: ColorInspectorControl, panelId: clientId, settings: settings, value: value, onChange: onChange, defaultControls: defaultControls, enableContrastChecker: false !== (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [COLOR_SUPPORT_KEY, 'enableContrastChecker']), children: enableContrastChecking && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockColorContrastChecker, { clientId: clientId }) }); } function color_useBlockProps({ name, backgroundColor, textColor, gradient, style }) { const [userPalette, themePalette, defaultPalette] = use_settings_useSettings('color.palette.custom', 'color.palette.theme', 'color.palette.default'); const colors = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]); if (!hasColorSupport(name) || shouldSkipSerialization(name, COLOR_SUPPORT_KEY)) { return {}; } const extraStyles = {}; if (textColor && !shouldSkipSerialization(name, COLOR_SUPPORT_KEY, 'text')) { extraStyles.color = getColorObjectByAttributeValues(colors, textColor)?.color; } if (backgroundColor && !shouldSkipSerialization(name, COLOR_SUPPORT_KEY, 'background')) { extraStyles.backgroundColor = getColorObjectByAttributeValues(colors, backgroundColor)?.color; } const saveProps = color_addSaveProps({ style: extraStyles }, name, { textColor, backgroundColor, gradient, style }); const hasBackgroundValue = backgroundColor || style?.color?.background || gradient || style?.color?.gradient; return { ...saveProps, className: dist_clsx(saveProps.className, // Add background image classes in the editor, if not already handled by background color values. !hasBackgroundValue && getBackgroundImageClasses(style)) }; } /* harmony default export */ const color = ({ useBlockProps: color_useBlockProps, addSaveProps: color_addSaveProps, attributeKeys: ['backgroundColor', 'textColor', 'gradient', 'style'], hasSupport: hasColorSupport }); const MIGRATION_PATHS = { linkColor: [['style', 'elements', 'link', 'color', 'text']], textColor: [['textColor'], ['style', 'color', 'text']], backgroundColor: [['backgroundColor'], ['style', 'color', 'background']], gradient: [['gradient'], ['style', 'color', 'gradient']] }; function color_addTransforms(result, source, index, results) { const destinationBlockType = result.name; const activeSupports = { linkColor: hasLinkColorSupport(destinationBlockType), textColor: hasTextColorSupport(destinationBlockType), backgroundColor: hasBackgroundColorSupport(destinationBlockType), gradient: hasGradientSupport(destinationBlockType) }; return transformStyles(activeSupports, MIGRATION_PATHS, result, source, index, results); } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/color/addAttribute', color_addAttributes); (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/color/addTransforms', color_addTransforms); ;// ./node_modules/@wordpress/block-editor/build-module/components/font-family/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function FontFamilyControl({ /** Start opting into the larger default height that will become the default size in a future version. */ __next40pxDefaultSize = false, /** Start opting into the new margin-free styles that will become the default in a future version. */ __nextHasNoMarginBottom = false, value = '', onChange, fontFamilies, className, ...props }) { var _options$find; const [blockLevelFontFamilies] = use_settings_useSettings('typography.fontFamilies'); if (!fontFamilies) { fontFamilies = blockLevelFontFamilies; } if (!fontFamilies || fontFamilies.length === 0) { return null; } const options = [{ key: '', name: (0,external_wp_i18n_namespaceObject.__)('Default') }, ...fontFamilies.map(({ fontFamily, name }) => ({ key: fontFamily, name: name || fontFamily, style: { fontFamily } }))]; if (!__nextHasNoMarginBottom) { external_wp_deprecated_default()('Bottom margin styles for wp.blockEditor.FontFamilyControl', { since: '6.7', version: '7.0', hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version' }); } if (!__next40pxDefaultSize && (props.size === undefined || props.size === 'default')) { external_wp_deprecated_default()(`36px default size for wp.blockEditor.__experimentalFontFamilyControl`, { since: '6.8', version: '7.1', hint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.' }); } const selectedValue = (_options$find = options.find(option => option.key === value)) !== null && _options$find !== void 0 ? _options$find : ''; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CustomSelectControl, { __next40pxDefaultSize: __next40pxDefaultSize, __shouldNotWarnDeprecated36pxSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Font'), value: selectedValue, onChange: ({ selectedItem }) => onChange(selectedItem.key), options: options, className: dist_clsx('block-editor-font-family-control', className, { 'is-next-has-no-margin-bottom': __nextHasNoMarginBottom }), ...props }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/font-appearance-control/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Adjusts font appearance field label in case either font styles or weights * are disabled. * * @param {boolean} hasFontStyles Whether font styles are enabled and present. * @param {boolean} hasFontWeights Whether font weights are enabled and present. * @return {string} A label representing what font appearance is being edited. */ const getFontAppearanceLabel = (hasFontStyles, hasFontWeights) => { if (!hasFontStyles) { return (0,external_wp_i18n_namespaceObject.__)('Font weight'); } if (!hasFontWeights) { return (0,external_wp_i18n_namespaceObject.__)('Font style'); } return (0,external_wp_i18n_namespaceObject.__)('Appearance'); }; /** * Control to display font style and weight options of the active font. * * @param {Object} props Component props. * * @return {Element} Font appearance control. */ function FontAppearanceControl(props) { const { /** Start opting into the larger default height that will become the default size in a future version. */ __next40pxDefaultSize = false, onChange, hasFontStyles = true, hasFontWeights = true, fontFamilyFaces, value: { fontStyle, fontWeight }, ...otherProps } = props; const hasStylesOrWeights = hasFontStyles || hasFontWeights; const label = getFontAppearanceLabel(hasFontStyles, hasFontWeights); const defaultOption = { key: 'default', name: (0,external_wp_i18n_namespaceObject.__)('Default'), style: { fontStyle: undefined, fontWeight: undefined } }; const { fontStyles, fontWeights, combinedStyleAndWeightOptions } = getFontStylesAndWeights(fontFamilyFaces); // Generates select options for combined font styles and weights. const combineOptions = () => { const combinedOptions = [defaultOption]; if (combinedStyleAndWeightOptions) { combinedOptions.push(...combinedStyleAndWeightOptions); } return combinedOptions; }; // Generates select options for font styles only. const styleOptions = () => { const combinedOptions = [defaultOption]; fontStyles.forEach(({ name, value }) => { combinedOptions.push({ key: value, name, style: { fontStyle: value, fontWeight: undefined } }); }); return combinedOptions; }; // Generates select options for font weights only. const weightOptions = () => { const combinedOptions = [defaultOption]; fontWeights.forEach(({ name, value }) => { combinedOptions.push({ key: value, name, style: { fontStyle: undefined, fontWeight: value } }); }); return combinedOptions; }; // Map font styles and weights to select options. const selectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => { // Display combined available font style and weight options. if (hasFontStyles && hasFontWeights) { return combineOptions(); } // Display only font style options or font weight options. return hasFontStyles ? styleOptions() : weightOptions(); }, [props.options, fontStyles, fontWeights, combinedStyleAndWeightOptions]); // Find current selection by comparing font style & weight against options, // and fall back to the Default option if there is no matching option. const currentSelection = selectOptions.find(option => option.style.fontStyle === fontStyle && option.style.fontWeight === fontWeight) || selectOptions[0]; // Adjusts screen reader description based on styles or weights. const getDescribedBy = () => { if (!currentSelection) { return (0,external_wp_i18n_namespaceObject.__)('No selected font appearance'); } if (!hasFontStyles) { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Currently selected font weight. (0,external_wp_i18n_namespaceObject.__)('Currently selected font weight: %s'), currentSelection.name); } if (!hasFontWeights) { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Currently selected font style. (0,external_wp_i18n_namespaceObject.__)('Currently selected font style: %s'), currentSelection.name); } return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Currently selected font appearance. (0,external_wp_i18n_namespaceObject.__)('Currently selected font appearance: %s'), currentSelection.name); }; if (!__next40pxDefaultSize && (otherProps.size === undefined || otherProps.size === 'default')) { external_wp_deprecated_default()(`36px default size for wp.blockEditor.__experimentalFontAppearanceControl`, { since: '6.8', version: '7.1', hint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.' }); } return hasStylesOrWeights && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CustomSelectControl, { ...otherProps, className: "components-font-appearance-control", __next40pxDefaultSize: __next40pxDefaultSize, __shouldNotWarnDeprecated36pxSize: true, label: label, describedBy: getDescribedBy(), options: selectOptions, value: currentSelection, onChange: ({ selectedItem }) => onChange(selectedItem.style) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/utils.js const BASE_DEFAULT_VALUE = 1.5; const STEP = 0.01; /** * A spin factor of 10 allows the spin controls to increment/decrement by 0.1. * e.g. A line-height value of 1.55 will increment to 1.65. */ const SPIN_FACTOR = 10; /** * There are varying value types within LineHeightControl: * * {undefined} Initial value. No changes from the user. * {string} Input value. Value consumed/outputted by the input. Empty would be ''. * {number} Block attribute type. Input value needs to be converted for attribute setting. * * Note: If the value is undefined, the input requires it to be an empty string ('') * in order to be considered "controlled" by props (rather than internal state). */ const RESET_VALUE = ''; /** * Determines if the lineHeight attribute has been properly defined. * * @param {any} lineHeight The value to check. * * @return {boolean} Whether the lineHeight attribute is valid. */ function isLineHeightDefined(lineHeight) { return lineHeight !== undefined && lineHeight !== RESET_VALUE; } ;// ./node_modules/@wordpress/block-editor/build-module/components/line-height-control/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const line_height_control_LineHeightControl = ({ /** Start opting into the larger default height that will become the default size in a future version. */ __next40pxDefaultSize = false, value: lineHeight, onChange, __unstableInputWidth = '60px', ...otherProps }) => { const isDefined = isLineHeightDefined(lineHeight); const adjustNextValue = (nextValue, wasTypedOrPasted) => { // Set the next value without modification if lineHeight has been defined. if (isDefined) { return nextValue; } /** * The following logic handles the initial spin up/down action * (from an undefined value state) so that the next values are better suited for * line-height rendering. For example, the first spin up should immediately * go to 1.6, rather than the normally expected 0.1. * * Spin up/down actions can be triggered by keydowns of the up/down arrow keys, * dragging the input or by clicking the spin buttons. */ const spin = STEP * SPIN_FACTOR; switch (`${nextValue}`) { case `${spin}`: // Increment by spin value. return BASE_DEFAULT_VALUE + spin; case '0': { // This means the user explicitly input '0', rather than using the // spin down action from an undefined value state. if (wasTypedOrPasted) { return nextValue; } // Decrement by spin value. return BASE_DEFAULT_VALUE - spin; } case '': return BASE_DEFAULT_VALUE; default: return nextValue; } }; const stateReducer = (state, action) => { // Be careful when changing this — cross-browser behavior of the // `inputType` field in `input` events are inconsistent. // For example, Firefox emits an input event with inputType="insertReplacementText" // on spin button clicks, while other browsers do not even emit an input event. const wasTypedOrPasted = ['insertText', 'insertFromPaste'].includes(action.payload.event.nativeEvent?.inputType); const value = adjustNextValue(state.value, wasTypedOrPasted); return { ...state, value }; }; const value = isDefined ? lineHeight : RESET_VALUE; const handleOnChange = (nextValue, { event }) => { if (nextValue === '') { onChange(); return; } if (event.type === 'click') { onChange(adjustNextValue(`${nextValue}`, false)); return; } onChange(`${nextValue}`); }; if (!__next40pxDefaultSize && (otherProps.size === undefined || otherProps.size === 'default')) { external_wp_deprecated_default()(`36px default size for wp.blockEditor.LineHeightControl`, { since: '6.8', version: '7.1', hint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.' }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-line-height-control", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { ...otherProps, __shouldNotWarnDeprecated36pxSize: true, __next40pxDefaultSize: __next40pxDefaultSize, __unstableInputWidth: __unstableInputWidth, __unstableStateReducer: stateReducer, onChange: handleOnChange, label: (0,external_wp_i18n_namespaceObject.__)('Line height'), placeholder: BASE_DEFAULT_VALUE, step: STEP, spinFactor: SPIN_FACTOR, value: value, min: 0, spinControls: "custom" }) }); }; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/line-height-control/README.md */ /* harmony default export */ const line_height_control = (line_height_control_LineHeightControl); ;// ./node_modules/@wordpress/block-editor/build-module/components/letter-spacing-control/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Control for letter-spacing. * * @param {Object} props Component props. * @param {boolean} props.__next40pxDefaultSize Start opting into the larger default height that will become the default size in a future version. * @param {string} props.value Currently selected letter-spacing. * @param {Function} props.onChange Handles change in letter-spacing selection. * @param {string|number|undefined} props.__unstableInputWidth Input width to pass through to inner UnitControl. Should be a valid CSS value. * * @return {Element} Letter-spacing control. */ function LetterSpacingControl({ __next40pxDefaultSize = false, value, onChange, __unstableInputWidth = '60px', ...otherProps }) { const [availableUnits] = use_settings_useSettings('spacing.units'); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['px', 'em', 'rem'], defaultValues: { px: 2, em: 0.2, rem: 0.2 } }); if (!__next40pxDefaultSize && (otherProps.size === undefined || otherProps.size === 'default')) { external_wp_deprecated_default()(`36px default size for wp.blockEditor.__experimentalLetterSpacingControl`, { since: '6.8', version: '7.1', hint: 'Set the `__next40pxDefaultSize` prop to true to start opting into the new default size, which will become the default in a future version.' }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { __next40pxDefaultSize: __next40pxDefaultSize, __shouldNotWarnDeprecated36pxSize: true, ...otherProps, label: (0,external_wp_i18n_namespaceObject.__)('Letter spacing'), value: value, __unstableInputWidth: __unstableInputWidth, units: units, onChange: onChange }); } ;// ./node_modules/@wordpress/icons/build-module/library/align-left.js /** * WordPress dependencies */ const alignLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z" }) }); /* harmony default export */ const align_left = (alignLeft); ;// ./node_modules/@wordpress/icons/build-module/library/align-center.js /** * WordPress dependencies */ const alignCenter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z" }) }); /* harmony default export */ const align_center = (alignCenter); ;// ./node_modules/@wordpress/icons/build-module/library/align-right.js /** * WordPress dependencies */ const alignRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z" }) }); /* harmony default export */ const align_right = (alignRight); ;// ./node_modules/@wordpress/icons/build-module/library/align-justify.js /** * WordPress dependencies */ const alignJustify = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z" }) }); /* harmony default export */ const align_justify = (alignJustify); ;// ./node_modules/@wordpress/block-editor/build-module/components/text-alignment-control/index.js /** * External dependencies */ /** * WordPress dependencies */ const TEXT_ALIGNMENT_OPTIONS = [{ label: (0,external_wp_i18n_namespaceObject.__)('Align text left'), value: 'left', icon: align_left }, { label: (0,external_wp_i18n_namespaceObject.__)('Align text center'), value: 'center', icon: align_center }, { label: (0,external_wp_i18n_namespaceObject.__)('Align text right'), value: 'right', icon: align_right }, { label: (0,external_wp_i18n_namespaceObject.__)('Justify text'), value: 'justify', icon: align_justify }]; const DEFAULT_OPTIONS = ['left', 'center', 'right']; /** * Control to facilitate text alignment selections. * * @param {Object} props Component props. * @param {string} props.className Class name to add to the control. * @param {string} props.value Currently selected text alignment. * @param {Function} props.onChange Handles change in text alignment selection. * @param {string[]} props.options Array of text alignment options to display. * * @return {Element} Text alignment control. */ function TextAlignmentControl({ className, value, onChange, options = DEFAULT_OPTIONS }) { const validOptions = (0,external_wp_element_namespaceObject.useMemo)(() => TEXT_ALIGNMENT_OPTIONS.filter(option => options.includes(option.value)), [options]); if (!validOptions.length) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { isDeselectable: true, __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Text alignment'), className: dist_clsx('block-editor-text-alignment-control', className), value: value, onChange: newValue => { onChange(newValue === value ? undefined : newValue); }, children: validOptions.map(option => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { value: option.value, icon: option.icon, label: option.label }, option.value); }) }); } ;// ./node_modules/@wordpress/icons/build-module/library/format-uppercase.js /** * WordPress dependencies */ const formatUppercase = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z" }) }); /* harmony default export */ const format_uppercase = (formatUppercase); ;// ./node_modules/@wordpress/icons/build-module/library/format-lowercase.js /** * WordPress dependencies */ const formatLowercase = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z" }) }); /* harmony default export */ const format_lowercase = (formatLowercase); ;// ./node_modules/@wordpress/icons/build-module/library/format-capitalize.js /** * WordPress dependencies */ const formatCapitalize = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z" }) }); /* harmony default export */ const format_capitalize = (formatCapitalize); ;// ./node_modules/@wordpress/block-editor/build-module/components/text-transform-control/index.js /** * External dependencies */ /** * WordPress dependencies */ const TEXT_TRANSFORMS = [{ label: (0,external_wp_i18n_namespaceObject.__)('None'), value: 'none', icon: library_reset }, { label: (0,external_wp_i18n_namespaceObject.__)('Uppercase'), value: 'uppercase', icon: format_uppercase }, { label: (0,external_wp_i18n_namespaceObject.__)('Lowercase'), value: 'lowercase', icon: format_lowercase }, { label: (0,external_wp_i18n_namespaceObject.__)('Capitalize'), value: 'capitalize', icon: format_capitalize }]; /** * Control to facilitate text transform selections. * * @param {Object} props Component props. * @param {string} props.className Class name to add to the control. * @param {string} props.value Currently selected text transform. * @param {Function} props.onChange Handles change in text transform selection. * * @return {Element} Text transform control. */ function TextTransformControl({ className, value, onChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { isDeselectable: true, __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Letter case'), className: dist_clsx('block-editor-text-transform-control', className), value: value, onChange: newValue => { onChange(newValue === value ? undefined : newValue); }, children: TEXT_TRANSFORMS.map(option => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { value: option.value, icon: option.icon, label: option.label }, option.value); }) }); } ;// ./node_modules/@wordpress/icons/build-module/library/format-underline.js /** * WordPress dependencies */ const formatUnderline = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z" }) }); /* harmony default export */ const format_underline = (formatUnderline); ;// ./node_modules/@wordpress/icons/build-module/library/format-strikethrough.js /** * WordPress dependencies */ const formatStrikethrough = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" }) }); /* harmony default export */ const format_strikethrough = (formatStrikethrough); ;// ./node_modules/@wordpress/block-editor/build-module/components/text-decoration-control/index.js /** * External dependencies */ /** * WordPress dependencies */ const TEXT_DECORATIONS = [{ label: (0,external_wp_i18n_namespaceObject.__)('None'), value: 'none', icon: library_reset }, { label: (0,external_wp_i18n_namespaceObject.__)('Underline'), value: 'underline', icon: format_underline }, { label: (0,external_wp_i18n_namespaceObject.__)('Strikethrough'), value: 'line-through', icon: format_strikethrough }]; /** * Control to facilitate text decoration selections. * * @param {Object} props Component props. * @param {string} props.value Currently selected text decoration. * @param {Function} props.onChange Handles change in text decoration selection. * @param {string} props.className Additional class name to apply. * * @return {Element} Text decoration control. */ function TextDecorationControl({ value, onChange, className }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { isDeselectable: true, __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Decoration'), className: dist_clsx('block-editor-text-decoration-control', className), value: value, onChange: newValue => { onChange(newValue === value ? undefined : newValue); }, children: TEXT_DECORATIONS.map(option => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { value: option.value, icon: option.icon, label: option.label }, option.value); }) }); } ;// ./node_modules/@wordpress/icons/build-module/library/text-horizontal.js /** * WordPress dependencies */ const textHorizontal = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M8.2 14.4h3.9L13 17h1.7L11 6.5H9.3L5.6 17h1.7l.9-2.6zm2-5.5 1.4 4H8.8l1.4-4zm7.4 7.5-1.3.8.8 1.4H5.5V20h14.3l-2.2-3.6z" }) }); /* harmony default export */ const text_horizontal = (textHorizontal); ;// ./node_modules/@wordpress/icons/build-module/library/text-vertical.js /** * WordPress dependencies */ const textVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 5.6v1.7l2.6.9v3.9L7 13v1.7L17.5 11V9.3L7 5.6zm4.2 6V8.8l4 1.4-4 1.4zm-5.7 5.6V5.5H4v14.3l3.6-2.2-.8-1.3-1.3.9z" }) }); /* harmony default export */ const text_vertical = (textVertical); ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-mode-control/index.js /** * External dependencies */ /** * WordPress dependencies */ const WRITING_MODES = [{ label: (0,external_wp_i18n_namespaceObject.__)('Horizontal'), value: 'horizontal-tb', icon: text_horizontal }, { label: (0,external_wp_i18n_namespaceObject.__)('Vertical'), value: (0,external_wp_i18n_namespaceObject.isRTL)() ? 'vertical-lr' : 'vertical-rl', icon: text_vertical }]; /** * Control to facilitate writing mode selections. * * @param {Object} props Component props. * @param {string} props.className Class name to add to the control. * @param {string} props.value Currently selected writing mode. * @param {Function} props.onChange Handles change in the writing mode selection. * * @return {Element} Writing Mode control. */ function WritingModeControl({ className, value, onChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { isDeselectable: true, __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Orientation'), className: dist_clsx('block-editor-writing-mode-control', className), value: value, onChange: newValue => { onChange(newValue === value ? undefined : newValue); }, children: WRITING_MODES.map(option => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { value: option.value, icon: option.icon, label: option.label }, option.value); }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/typography-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ const MIN_TEXT_COLUMNS = 1; const MAX_TEXT_COLUMNS = 6; function useHasTypographyPanel(settings) { const hasFontFamily = useHasFontFamilyControl(settings); const hasLineHeight = useHasLineHeightControl(settings); const hasFontAppearance = useHasAppearanceControl(settings); const hasLetterSpacing = useHasLetterSpacingControl(settings); const hasTextAlign = useHasTextAlignmentControl(settings); const hasTextTransform = useHasTextTransformControl(settings); const hasTextDecoration = useHasTextDecorationControl(settings); const hasWritingMode = useHasWritingModeControl(settings); const hasTextColumns = useHasTextColumnsControl(settings); const hasFontSize = useHasFontSizeControl(settings); return hasFontFamily || hasLineHeight || hasFontAppearance || hasLetterSpacing || hasTextAlign || hasTextTransform || hasFontSize || hasTextDecoration || hasWritingMode || hasTextColumns; } function useHasFontSizeControl(settings) { return settings?.typography?.defaultFontSizes !== false && settings?.typography?.fontSizes?.default?.length || settings?.typography?.fontSizes?.theme?.length || settings?.typography?.fontSizes?.custom?.length || settings?.typography?.customFontSize; } function useHasFontFamilyControl(settings) { return ['default', 'theme', 'custom'].some(key => settings?.typography?.fontFamilies?.[key]?.length); } function useHasLineHeightControl(settings) { return settings?.typography?.lineHeight; } function useHasAppearanceControl(settings) { return settings?.typography?.fontStyle || settings?.typography?.fontWeight; } function useAppearanceControlLabel(settings) { if (!settings?.typography?.fontStyle) { return (0,external_wp_i18n_namespaceObject.__)('Font weight'); } if (!settings?.typography?.fontWeight) { return (0,external_wp_i18n_namespaceObject.__)('Font style'); } return (0,external_wp_i18n_namespaceObject.__)('Appearance'); } function useHasLetterSpacingControl(settings) { return settings?.typography?.letterSpacing; } function useHasTextTransformControl(settings) { return settings?.typography?.textTransform; } function useHasTextAlignmentControl(settings) { return settings?.typography?.textAlign; } function useHasTextDecorationControl(settings) { return settings?.typography?.textDecoration; } function useHasWritingModeControl(settings) { return settings?.typography?.writingMode; } function useHasTextColumnsControl(settings) { return settings?.typography?.textColumns; } /** * Concatenate all the font sizes into a single list for the font size picker. * * @param {Object} settings The global styles settings. * * @return {Array} The merged font sizes. */ function getMergedFontSizes(settings) { var _fontSizes$custom, _fontSizes$theme, _fontSizes$default; const fontSizes = settings?.typography?.fontSizes; const defaultFontSizesEnabled = !!settings?.typography?.defaultFontSizes; return [...((_fontSizes$custom = fontSizes?.custom) !== null && _fontSizes$custom !== void 0 ? _fontSizes$custom : []), ...((_fontSizes$theme = fontSizes?.theme) !== null && _fontSizes$theme !== void 0 ? _fontSizes$theme : []), ...(defaultFontSizesEnabled ? (_fontSizes$default = fontSizes?.default) !== null && _fontSizes$default !== void 0 ? _fontSizes$default : [] : [])]; } function TypographyToolsPanel({ resetAllFilter, onChange, value, panelId, children }) { const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const resetAll = () => { const updatedValue = resetAllFilter(value); onChange(updatedValue); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Typography'), resetAll: resetAll, panelId: panelId, dropdownMenuProps: dropdownMenuProps, children: children }); } const typography_panel_DEFAULT_CONTROLS = { fontFamily: true, fontSize: true, fontAppearance: true, lineHeight: true, letterSpacing: true, textAlign: true, textTransform: true, textDecoration: true, writingMode: true, textColumns: true }; function TypographyPanel({ as: Wrapper = TypographyToolsPanel, value, onChange, inheritedValue = value, settings, panelId, defaultControls = typography_panel_DEFAULT_CONTROLS }) { const decodeValue = rawValue => getValueFromVariable({ settings }, '', rawValue); // Font Family const hasFontFamilyEnabled = useHasFontFamilyControl(settings); const fontFamily = decodeValue(inheritedValue?.typography?.fontFamily); const { fontFamilies, fontFamilyFaces } = (0,external_wp_element_namespaceObject.useMemo)(() => { return getMergedFontFamiliesAndFontFamilyFaces(settings, fontFamily); }, [settings, fontFamily]); const setFontFamily = newValue => { const slug = fontFamilies?.find(({ fontFamily: f }) => f === newValue)?.slug; onChange(setImmutably(value, ['typography', 'fontFamily'], slug ? `var:preset|font-family|${slug}` : newValue || undefined)); }; const hasFontFamily = () => !!value?.typography?.fontFamily; const resetFontFamily = () => setFontFamily(undefined); // Font Size const hasFontSizeEnabled = useHasFontSizeControl(settings); const disableCustomFontSizes = !settings?.typography?.customFontSize; const mergedFontSizes = getMergedFontSizes(settings); const fontSize = decodeValue(inheritedValue?.typography?.fontSize); const setFontSize = (newValue, metadata) => { const actualValue = !!metadata?.slug ? `var:preset|font-size|${metadata?.slug}` : newValue; onChange(setImmutably(value, ['typography', 'fontSize'], actualValue || undefined)); }; const hasFontSize = () => !!value?.typography?.fontSize; const resetFontSize = () => setFontSize(undefined); // Appearance const hasAppearanceControl = useHasAppearanceControl(settings); const appearanceControlLabel = useAppearanceControlLabel(settings); const hasFontStyles = settings?.typography?.fontStyle; const hasFontWeights = settings?.typography?.fontWeight; const fontStyle = decodeValue(inheritedValue?.typography?.fontStyle); const fontWeight = decodeValue(inheritedValue?.typography?.fontWeight); const { nearestFontStyle, nearestFontWeight } = findNearestStyleAndWeight(fontFamilyFaces, fontStyle, fontWeight); const setFontAppearance = (0,external_wp_element_namespaceObject.useCallback)(({ fontStyle: newFontStyle, fontWeight: newFontWeight }) => { // Only update the font style and weight if they have changed. if (newFontStyle !== fontStyle || newFontWeight !== fontWeight) { onChange({ ...value, typography: { ...value?.typography, fontStyle: newFontStyle || undefined, fontWeight: newFontWeight || undefined } }); } }, [fontStyle, fontWeight, onChange, value]); const hasFontAppearance = () => !!value?.typography?.fontStyle || !!value?.typography?.fontWeight; const resetFontAppearance = (0,external_wp_element_namespaceObject.useCallback)(() => { setFontAppearance({}); }, [setFontAppearance]); // Check if previous font style and weight values are available in the new font family. (0,external_wp_element_namespaceObject.useEffect)(() => { if (nearestFontStyle && nearestFontWeight) { setFontAppearance({ fontStyle: nearestFontStyle, fontWeight: nearestFontWeight }); } else { // Reset font appearance if there are no available styles or weights. resetFontAppearance(); } }, [nearestFontStyle, nearestFontWeight, resetFontAppearance, setFontAppearance]); // Line Height const hasLineHeightEnabled = useHasLineHeightControl(settings); const lineHeight = decodeValue(inheritedValue?.typography?.lineHeight); const setLineHeight = newValue => { onChange(setImmutably(value, ['typography', 'lineHeight'], newValue || undefined)); }; const hasLineHeight = () => value?.typography?.lineHeight !== undefined; const resetLineHeight = () => setLineHeight(undefined); // Letter Spacing const hasLetterSpacingControl = useHasLetterSpacingControl(settings); const letterSpacing = decodeValue(inheritedValue?.typography?.letterSpacing); const setLetterSpacing = newValue => { onChange(setImmutably(value, ['typography', 'letterSpacing'], newValue || undefined)); }; const hasLetterSpacing = () => !!value?.typography?.letterSpacing; const resetLetterSpacing = () => setLetterSpacing(undefined); // Text Columns const hasTextColumnsControl = useHasTextColumnsControl(settings); const textColumns = decodeValue(inheritedValue?.typography?.textColumns); const setTextColumns = newValue => { onChange(setImmutably(value, ['typography', 'textColumns'], newValue || undefined)); }; const hasTextColumns = () => !!value?.typography?.textColumns; const resetTextColumns = () => setTextColumns(undefined); // Text Transform const hasTextTransformControl = useHasTextTransformControl(settings); const textTransform = decodeValue(inheritedValue?.typography?.textTransform); const setTextTransform = newValue => { onChange(setImmutably(value, ['typography', 'textTransform'], newValue || undefined)); }; const hasTextTransform = () => !!value?.typography?.textTransform; const resetTextTransform = () => setTextTransform(undefined); // Text Decoration const hasTextDecorationControl = useHasTextDecorationControl(settings); const textDecoration = decodeValue(inheritedValue?.typography?.textDecoration); const setTextDecoration = newValue => { onChange(setImmutably(value, ['typography', 'textDecoration'], newValue || undefined)); }; const hasTextDecoration = () => !!value?.typography?.textDecoration; const resetTextDecoration = () => setTextDecoration(undefined); // Text Orientation const hasWritingModeControl = useHasWritingModeControl(settings); const writingMode = decodeValue(inheritedValue?.typography?.writingMode); const setWritingMode = newValue => { onChange(setImmutably(value, ['typography', 'writingMode'], newValue || undefined)); }; const hasWritingMode = () => !!value?.typography?.writingMode; const resetWritingMode = () => setWritingMode(undefined); // Text Alignment const hasTextAlignmentControl = useHasTextAlignmentControl(settings); const textAlign = decodeValue(inheritedValue?.typography?.textAlign); const setTextAlign = newValue => { onChange(setImmutably(value, ['typography', 'textAlign'], newValue || undefined)); }; const hasTextAlign = () => !!value?.typography?.textAlign; const resetTextAlign = () => setTextAlign(undefined); const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(previousValue => { return { ...previousValue, typography: {} }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, { resetAllFilter: resetAllFilter, value: value, onChange: onChange, panelId: panelId, children: [hasFontFamilyEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Font'), hasValue: hasFontFamily, onDeselect: resetFontFamily, isShownByDefault: defaultControls.fontFamily, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FontFamilyControl, { fontFamilies: fontFamilies, value: fontFamily, onChange: setFontFamily, size: "__unstable-large", __nextHasNoMarginBottom: true }) }), hasFontSizeEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Size'), hasValue: hasFontSize, onDeselect: resetFontSize, isShownByDefault: defaultControls.fontSize, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FontSizePicker, { value: fontSize, onChange: setFontSize, fontSizes: mergedFontSizes, disableCustomFontSizes: disableCustomFontSizes, withReset: false, withSlider: true, size: "__unstable-large" }) }), hasAppearanceControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { className: "single-column", label: appearanceControlLabel, hasValue: hasFontAppearance, onDeselect: resetFontAppearance, isShownByDefault: defaultControls.fontAppearance, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FontAppearanceControl, { value: { fontStyle, fontWeight }, onChange: setFontAppearance, hasFontStyles: hasFontStyles, hasFontWeights: hasFontWeights, fontFamilyFaces: fontFamilyFaces, size: "__unstable-large" }) }), hasLineHeightEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { className: "single-column", label: (0,external_wp_i18n_namespaceObject.__)('Line height'), hasValue: hasLineHeight, onDeselect: resetLineHeight, isShownByDefault: defaultControls.lineHeight, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(line_height_control, { __unstableInputWidth: "auto", value: lineHeight, onChange: setLineHeight, size: "__unstable-large" }) }), hasLetterSpacingControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { className: "single-column", label: (0,external_wp_i18n_namespaceObject.__)('Letter spacing'), hasValue: hasLetterSpacing, onDeselect: resetLetterSpacing, isShownByDefault: defaultControls.letterSpacing, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LetterSpacingControl, { value: letterSpacing, onChange: setLetterSpacing, size: "__unstable-large", __unstableInputWidth: "auto" }) }), hasTextColumnsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { className: "single-column", label: (0,external_wp_i18n_namespaceObject.__)('Columns'), hasValue: hasTextColumns, onDeselect: resetTextColumns, isShownByDefault: defaultControls.textColumns, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { label: (0,external_wp_i18n_namespaceObject.__)('Columns'), max: MAX_TEXT_COLUMNS, min: MIN_TEXT_COLUMNS, onChange: setTextColumns, size: "__unstable-large", spinControls: "custom", value: textColumns, initialPosition: 1 }) }), hasTextDecorationControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { className: "single-column", label: (0,external_wp_i18n_namespaceObject.__)('Decoration'), hasValue: hasTextDecoration, onDeselect: resetTextDecoration, isShownByDefault: defaultControls.textDecoration, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TextDecorationControl, { value: textDecoration, onChange: setTextDecoration, size: "__unstable-large", __unstableInputWidth: "auto" }) }), hasWritingModeControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { className: "single-column", label: (0,external_wp_i18n_namespaceObject.__)('Orientation'), hasValue: hasWritingMode, onDeselect: resetWritingMode, isShownByDefault: defaultControls.writingMode, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WritingModeControl, { value: writingMode, onChange: setWritingMode, size: "__unstable-large", __nextHasNoMarginBottom: true }) }), hasTextTransformControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Letter case'), hasValue: hasTextTransform, onDeselect: resetTextTransform, isShownByDefault: defaultControls.textTransform, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TextTransformControl, { value: textTransform, onChange: setTextTransform, showNone: true, isBlock: true, size: "__unstable-large", __nextHasNoMarginBottom: true }) }), hasTextAlignmentControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Text alignment'), hasValue: hasTextAlign, onDeselect: resetTextAlign, isShownByDefault: defaultControls.textAlign, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TextAlignmentControl, { value: textAlign, onChange: setTextAlign, size: "__unstable-large", __nextHasNoMarginBottom: true }) })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/line-height.js /** * WordPress dependencies */ /** * Internal dependencies */ const LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight'; /** * Inspector control panel containing the line height related configuration * * @param {Object} props * * @return {Element} Line height edit element. */ function LineHeightEdit(props) { const { attributes: { style }, setAttributes } = props; const onChange = newLineHeightValue => { const newStyle = { ...style, typography: { ...style?.typography, lineHeight: newLineHeightValue } }; setAttributes({ style: cleanEmptyObject(newStyle) }); }; return /*#__PURE__*/_jsx(LineHeightControl, { __unstableInputWidth: "100%", value: style?.typography?.lineHeight, onChange: onChange, size: "__unstable-large" }); } /** * Custom hook that checks if line-height settings have been disabled. * * @param {string} name The name of the block. * @return {boolean} Whether setting is disabled. */ function useIsLineHeightDisabled({ name: blockName } = {}) { const [isEnabled] = useSettings('typography.lineHeight'); return !isEnabled || !hasBlockSupport(blockName, LINE_HEIGHT_SUPPORT_KEY); } ;// external ["wp","tokenList"] const external_wp_tokenList_namespaceObject = window["wp"]["tokenList"]; var external_wp_tokenList_default = /*#__PURE__*/__webpack_require__.n(external_wp_tokenList_namespaceObject); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/font-family.js /** * WordPress dependencies */ /** * Internal dependencies */ const FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily'; const { kebabCase: font_family_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); /** * Filters registered block settings, extending attributes to include * the `fontFamily` attribute. * * @param {Object} settings Original block settings * @return {Object} Filtered block settings */ function font_family_addAttributes(settings) { if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, FONT_FAMILY_SUPPORT_KEY)) { return settings; } // Allow blocks to specify a default value if needed. if (!settings.attributes.fontFamily) { Object.assign(settings.attributes, { fontFamily: { type: 'string' } }); } return settings; } /** * Override props assigned to save component to inject font family. * * @param {Object} props Additional props applied to save element * @param {Object} blockType Block type * @param {Object} attributes Block attributes * @return {Object} Filtered props applied to save element */ function font_family_addSaveProps(props, blockType, attributes) { if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, FONT_FAMILY_SUPPORT_KEY)) { return props; } if (shouldSkipSerialization(blockType, TYPOGRAPHY_SUPPORT_KEY, 'fontFamily')) { return props; } if (!attributes?.fontFamily) { return props; } // Use TokenList to dedupe classes. const classes = new (external_wp_tokenList_default())(props.className); classes.add(`has-${font_family_kebabCase(attributes?.fontFamily)}-font-family`); const newClassName = classes.value; props.className = newClassName ? newClassName : undefined; return props; } function font_family_useBlockProps({ name, fontFamily }) { return font_family_addSaveProps({}, name, { fontFamily }); } /* harmony default export */ const font_family = ({ useBlockProps: font_family_useBlockProps, addSaveProps: font_family_addSaveProps, attributeKeys: ['fontFamily'], hasSupport(name) { return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, FONT_FAMILY_SUPPORT_KEY); } }); /** * Resets the font family block support attribute. This can be used when * disabling the font family support controls for a block via a progressive * discovery panel. * * @param {Object} props Block props. * @param {Object} props.setAttributes Function to set block's attributes. */ function resetFontFamily({ setAttributes }) { setAttributes({ fontFamily: undefined }); } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/fontFamily/addAttribute', font_family_addAttributes); ;// ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/utils.js /** * WordPress dependencies */ /** * Internal dependencies */ const { kebabCase: utils_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); /** * Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values. * If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned. * * @param {Array} fontSizes Array of font size objects containing at least the "name" and "size" values as properties. * @param {?string} fontSizeAttribute Content of the font size attribute (slug). * @param {?number} customFontSizeAttribute Contents of the custom font size attribute (value). * * @return {?Object} If fontSizeAttribute is set and an equal slug is found in fontSizes it returns the font size object for that slug. * Otherwise, an object with just the size value based on customFontSize is returned. */ const utils_getFontSize = (fontSizes, fontSizeAttribute, customFontSizeAttribute) => { if (fontSizeAttribute) { const fontSizeObject = fontSizes?.find(({ slug }) => slug === fontSizeAttribute); if (fontSizeObject) { return fontSizeObject; } } return { size: customFontSizeAttribute }; }; /** * Returns the corresponding font size object for a given value. * * @param {Array} fontSizes Array of font size objects. * @param {number} value Font size value. * * @return {Object} Font size object. */ function utils_getFontSizeObjectByValue(fontSizes, value) { const fontSizeObject = fontSizes?.find(({ size }) => size === value); if (fontSizeObject) { return fontSizeObject; } return { size: value }; } /** * Returns a class based on fontSizeName. * * @param {string} fontSizeSlug Slug of the fontSize. * * @return {string | undefined} String with the class corresponding to the fontSize passed. * The class is generated by appending 'has-' followed by fontSizeSlug in kebabCase and ending with '-font-size'. */ function getFontSizeClass(fontSizeSlug) { if (!fontSizeSlug) { return; } return `has-${utils_kebabCase(fontSizeSlug)}-font-size`; } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/font-size.js /** * WordPress dependencies */ /** * Internal dependencies */ const FONT_SIZE_SUPPORT_KEY = 'typography.fontSize'; /** * Filters registered block settings, extending attributes to include * `fontSize` and `fontWeight` attributes. * * @param {Object} settings Original block settings. * * @return {Object} Filtered block settings. */ function font_size_addAttributes(settings) { if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, FONT_SIZE_SUPPORT_KEY)) { return settings; } // Allow blocks to specify a default value if needed. if (!settings.attributes.fontSize) { Object.assign(settings.attributes, { fontSize: { type: 'string' } }); } return settings; } /** * Override props assigned to save component to inject font size. * * @param {Object} props Additional props applied to save element. * @param {Object} blockNameOrType Block type. * @param {Object} attributes Block attributes. * * @return {Object} Filtered props applied to save element. */ function font_size_addSaveProps(props, blockNameOrType, attributes) { if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockNameOrType, FONT_SIZE_SUPPORT_KEY)) { return props; } if (shouldSkipSerialization(blockNameOrType, TYPOGRAPHY_SUPPORT_KEY, 'fontSize')) { return props; } // Use TokenList to dedupe classes. const classes = new (external_wp_tokenList_default())(props.className); classes.add(getFontSizeClass(attributes.fontSize)); const newClassName = classes.value; props.className = newClassName ? newClassName : undefined; return props; } /** * Inspector control panel containing the font size related configuration * * @param {Object} props * * @return {Element} Font size edit element. */ function FontSizeEdit(props) { const { attributes: { fontSize, style }, setAttributes } = props; const [fontSizes] = useSettings('typography.fontSizes'); const onChange = value => { const fontSizeSlug = getFontSizeObjectByValue(fontSizes, value).slug; setAttributes({ style: cleanEmptyObject({ ...style, typography: { ...style?.typography, fontSize: fontSizeSlug ? undefined : value } }), fontSize: fontSizeSlug }); }; const fontSizeObject = getFontSize(fontSizes, fontSize, style?.typography?.fontSize); const fontSizeValue = fontSizeObject?.size || style?.typography?.fontSize || fontSize; return /*#__PURE__*/_jsx(FontSizePicker, { onChange: onChange, value: fontSizeValue, withReset: false, withSlider: true, size: "__unstable-large" }); } /** * Custom hook that checks if font-size settings have been disabled. * * @param {string} name The name of the block. * @return {boolean} Whether setting is disabled. */ function useIsFontSizeDisabled({ name: blockName } = {}) { const [fontSizes] = useSettings('typography.fontSizes'); const hasFontSizes = !!fontSizes?.length; return !hasBlockSupport(blockName, FONT_SIZE_SUPPORT_KEY) || !hasFontSizes; } function font_size_useBlockProps({ name, fontSize, style }) { const [fontSizes, fluidTypographySettings, layoutSettings] = use_settings_useSettings('typography.fontSizes', 'typography.fluid', 'layout'); /* * Only add inline styles if the block supports font sizes, * doesn't skip serialization of font sizes, * and has either a custom font size or a preset font size. */ if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, FONT_SIZE_SUPPORT_KEY) || shouldSkipSerialization(name, TYPOGRAPHY_SUPPORT_KEY, 'fontSize') || !fontSize && !style?.typography?.fontSize) { return; } let props; if (style?.typography?.fontSize) { props = { style: { fontSize: getTypographyFontSizeValue({ size: style.typography.fontSize }, { typography: { fluid: fluidTypographySettings }, layout: layoutSettings }) } }; } if (fontSize) { props = { style: { fontSize: utils_getFontSize(fontSizes, fontSize, style?.typography?.fontSize).size } }; } if (!props) { return; } return font_size_addSaveProps(props, name, { fontSize }); } /* harmony default export */ const font_size = ({ useBlockProps: font_size_useBlockProps, addSaveProps: font_size_addSaveProps, attributeKeys: ['fontSize', 'style'], hasSupport(name) { return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, FONT_SIZE_SUPPORT_KEY); } }); const font_size_MIGRATION_PATHS = { fontSize: [['fontSize'], ['style', 'typography', 'fontSize']] }; function font_size_addTransforms(result, source, index, results) { const destinationBlockType = result.name; const activeSupports = { fontSize: (0,external_wp_blocks_namespaceObject.hasBlockSupport)(destinationBlockType, FONT_SIZE_SUPPORT_KEY) }; return transformStyles(activeSupports, font_size_MIGRATION_PATHS, result, source, index, results); } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/font/addAttribute', font_size_addAttributes); (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/font-size/addTransforms', font_size_addTransforms); ;// ./node_modules/@wordpress/block-editor/build-module/components/alignment-control/ui.js /** * WordPress dependencies */ const DEFAULT_ALIGNMENT_CONTROLS = [{ icon: align_left, title: (0,external_wp_i18n_namespaceObject.__)('Align text left'), align: 'left' }, { icon: align_center, title: (0,external_wp_i18n_namespaceObject.__)('Align text center'), align: 'center' }, { icon: align_right, title: (0,external_wp_i18n_namespaceObject.__)('Align text right'), align: 'right' }]; const ui_POPOVER_PROPS = { placement: 'bottom-start' }; function AlignmentUI({ value, onChange, alignmentControls = DEFAULT_ALIGNMENT_CONTROLS, label = (0,external_wp_i18n_namespaceObject.__)('Align text'), description = (0,external_wp_i18n_namespaceObject.__)('Change text alignment'), isCollapsed = true, isToolbar }) { function applyOrUnset(align) { return () => onChange(value === align ? undefined : align); } const activeAlignment = alignmentControls.find(control => control.align === value); function setIcon() { if (activeAlignment) { return activeAlignment.icon; } return (0,external_wp_i18n_namespaceObject.isRTL)() ? align_right : align_left; } const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu; const extraProps = isToolbar ? { isCollapsed } : { toggleProps: { description }, popoverProps: ui_POPOVER_PROPS }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UIComponent, { icon: setIcon(), label: label, controls: alignmentControls.map(control => { const { align } = control; const isActive = value === align; return { ...control, isActive, role: isCollapsed ? 'menuitemradio' : undefined, onClick: applyOrUnset(align) }; }), ...extraProps }); } /* harmony default export */ const alignment_control_ui = (AlignmentUI); ;// ./node_modules/@wordpress/block-editor/build-module/components/alignment-control/index.js /** * Internal dependencies */ const AlignmentControl = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(alignment_control_ui, { ...props, isToolbar: false }); }; const AlignmentToolbar = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(alignment_control_ui, { ...props, isToolbar: true }); }; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/alignment-control/README.md */ ;// ./node_modules/@wordpress/block-editor/build-module/hooks/text-align.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign'; const text_align_TEXT_ALIGNMENT_OPTIONS = [{ icon: align_left, title: (0,external_wp_i18n_namespaceObject.__)('Align text left'), align: 'left' }, { icon: align_center, title: (0,external_wp_i18n_namespaceObject.__)('Align text center'), align: 'center' }, { icon: align_right, title: (0,external_wp_i18n_namespaceObject.__)('Align text right'), align: 'right' }]; const VALID_TEXT_ALIGNMENTS = ['left', 'center', 'right']; const NO_TEXT_ALIGNMENTS = []; /** * Returns the valid text alignments. * Takes into consideration the text aligns supported by a block. * Exported just for testing purposes, not exported outside the module. * * @param {?boolean|string[]} blockTextAlign Text aligns supported by the block. * * @return {string[]} Valid text alignments. */ function getValidTextAlignments(blockTextAlign) { if (Array.isArray(blockTextAlign)) { return VALID_TEXT_ALIGNMENTS.filter(textAlign => blockTextAlign.includes(textAlign)); } return blockTextAlign === true ? VALID_TEXT_ALIGNMENTS : NO_TEXT_ALIGNMENTS; } function BlockEditTextAlignmentToolbarControlsPure({ style, name: blockName, setAttributes }) { const settings = useBlockSettings(blockName); const hasTextAlignControl = settings?.typography?.textAlign; const blockEditingMode = useBlockEditingMode(); if (!hasTextAlignControl || blockEditingMode !== 'default') { return null; } const validTextAlignments = getValidTextAlignments((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, TEXT_ALIGN_SUPPORT_KEY)); if (!validTextAlignments.length) { return null; } const textAlignmentControls = text_align_TEXT_ALIGNMENT_OPTIONS.filter(control => validTextAlignments.includes(control.align)); const onChange = newTextAlignValue => { const newStyle = { ...style, typography: { ...style?.typography, textAlign: newTextAlignValue } }; setAttributes({ style: utils_cleanEmptyObject(newStyle) }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AlignmentControl, { value: style?.typography?.textAlign, onChange: onChange, alignmentControls: textAlignmentControls }) }); } /* harmony default export */ const text_align = ({ edit: BlockEditTextAlignmentToolbarControlsPure, useBlockProps: text_align_useBlockProps, addSaveProps: addAssignedTextAlign, attributeKeys: ['style'], hasSupport(name) { return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, TEXT_ALIGN_SUPPORT_KEY, false); } }); function text_align_useBlockProps({ name, style }) { if (!style?.typography?.textAlign) { return null; } const validTextAlignments = getValidTextAlignments((0,external_wp_blocks_namespaceObject.getBlockSupport)(name, TEXT_ALIGN_SUPPORT_KEY)); if (!validTextAlignments.length) { return null; } if (shouldSkipSerialization(name, TYPOGRAPHY_SUPPORT_KEY, 'textAlign')) { return null; } const textAlign = style.typography.textAlign; const className = dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }); return { className }; } /** * Override props assigned to save component to inject text alignment class * name if block supports it. * * @param {Object} props Additional props applied to save element. * @param {Object} blockType Block type. * @param {Object} attributes Block attributes. * * @return {Object} Filtered props applied to save element. */ function addAssignedTextAlign(props, blockType, attributes) { if (!attributes?.style?.typography?.textAlign) { return props; } const { textAlign } = attributes.style.typography; const blockTextAlign = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, TEXT_ALIGN_SUPPORT_KEY); const isTextAlignValid = getValidTextAlignments(blockTextAlign).includes(textAlign); if (isTextAlignValid && !shouldSkipSerialization(blockType, TYPOGRAPHY_SUPPORT_KEY, 'textAlign')) { props.className = dist_clsx(`has-text-align-${textAlign}`, props.className); } return props; } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/typography.js /** * WordPress dependencies */ /** * Internal dependencies */ function omit(object, keys) { return Object.fromEntries(Object.entries(object).filter(([key]) => !keys.includes(key))); } const LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing'; const TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform'; const TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration'; const TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns'; const FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle'; const FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight'; const WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode'; const TYPOGRAPHY_SUPPORT_KEY = 'typography'; const TYPOGRAPHY_SUPPORT_KEYS = [LINE_HEIGHT_SUPPORT_KEY, FONT_SIZE_SUPPORT_KEY, FONT_STYLE_SUPPORT_KEY, FONT_WEIGHT_SUPPORT_KEY, FONT_FAMILY_SUPPORT_KEY, TEXT_ALIGN_SUPPORT_KEY, TEXT_COLUMNS_SUPPORT_KEY, TEXT_DECORATION_SUPPORT_KEY, WRITING_MODE_SUPPORT_KEY, TEXT_TRANSFORM_SUPPORT_KEY, LETTER_SPACING_SUPPORT_KEY]; function typography_styleToAttributes(style) { const updatedStyle = { ...omit(style, ['fontFamily']) }; const fontSizeValue = style?.typography?.fontSize; const fontFamilyValue = style?.typography?.fontFamily; const fontSizeSlug = fontSizeValue?.startsWith('var:preset|font-size|') ? fontSizeValue.substring('var:preset|font-size|'.length) : undefined; const fontFamilySlug = fontFamilyValue?.startsWith('var:preset|font-family|') ? fontFamilyValue.substring('var:preset|font-family|'.length) : undefined; updatedStyle.typography = { ...omit(updatedStyle.typography, ['fontFamily']), fontSize: fontSizeSlug ? undefined : fontSizeValue }; return { style: utils_cleanEmptyObject(updatedStyle), fontFamily: fontFamilySlug, fontSize: fontSizeSlug }; } function typography_attributesToStyle(attributes) { return { ...attributes.style, typography: { ...attributes.style?.typography, fontFamily: attributes.fontFamily ? 'var:preset|font-family|' + attributes.fontFamily : undefined, fontSize: attributes.fontSize ? 'var:preset|font-size|' + attributes.fontSize : attributes.style?.typography?.fontSize } }; } function TypographyInspectorControl({ children, resetAllFilter }) { const attributesResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(attributes => { const existingStyle = typography_attributesToStyle(attributes); const updatedStyle = resetAllFilter(existingStyle); return { ...attributes, ...typography_styleToAttributes(updatedStyle) }; }, [resetAllFilter]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { group: "typography", resetAllFilter: attributesResetAllFilter, children: children }); } function typography_TypographyPanel({ clientId, name, setAttributes, settings }) { function selector(select) { const { style, fontFamily, fontSize } = select(store).getBlockAttributes(clientId) || {}; return { style, fontFamily, fontSize }; } const { style, fontFamily, fontSize } = (0,external_wp_data_namespaceObject.useSelect)(selector, [clientId]); const isEnabled = useHasTypographyPanel(settings); const value = (0,external_wp_element_namespaceObject.useMemo)(() => typography_attributesToStyle({ style, fontFamily, fontSize }), [style, fontSize, fontFamily]); const onChange = newStyle => { setAttributes(typography_styleToAttributes(newStyle)); }; if (!isEnabled) { return null; } const defaultControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [TYPOGRAPHY_SUPPORT_KEY, '__experimentalDefaultControls']); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TypographyPanel, { as: TypographyInspectorControl, panelId: clientId, settings: settings, value: value, onChange: onChange, defaultControls: defaultControls }); } const hasTypographySupport = blockName => { return TYPOGRAPHY_SUPPORT_KEYS.some(key => hasBlockSupport(blockName, key)); }; ;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js /** * WordPress dependencies */ /** * Internal dependencies */ const use_spacing_sizes_EMPTY_ARRAY = []; const compare = new Intl.Collator('und', { numeric: true }).compare; function useSpacingSizes() { const [customSpacingSizes, themeSpacingSizes, defaultSpacingSizes, defaultSpacingSizesEnabled] = use_settings_useSettings('spacing.spacingSizes.custom', 'spacing.spacingSizes.theme', 'spacing.spacingSizes.default', 'spacing.defaultSpacingSizes'); const customSizes = customSpacingSizes !== null && customSpacingSizes !== void 0 ? customSpacingSizes : use_spacing_sizes_EMPTY_ARRAY; const themeSizes = themeSpacingSizes !== null && themeSpacingSizes !== void 0 ? themeSpacingSizes : use_spacing_sizes_EMPTY_ARRAY; const defaultSizes = defaultSpacingSizes && defaultSpacingSizesEnabled !== false ? defaultSpacingSizes : use_spacing_sizes_EMPTY_ARRAY; return (0,external_wp_element_namespaceObject.useMemo)(() => { const sizes = [{ name: (0,external_wp_i18n_namespaceObject.__)('None'), slug: '0', size: 0 }, ...customSizes, ...themeSizes, ...defaultSizes]; // Using numeric slugs opts-in to sorting by slug. if (sizes.every(({ slug }) => /^[0-9]/.test(slug))) { sizes.sort((a, b) => compare(a.slug, b.slug)); } return sizes.length > RANGE_CONTROL_MAX_SIZE ? [{ name: (0,external_wp_i18n_namespaceObject.__)('Default'), slug: 'default', size: undefined }, ...sizes] : sizes; }, [customSizes, themeSizes, defaultSizes]); } ;// ./node_modules/@wordpress/icons/build-module/library/settings.js /** * WordPress dependencies */ const settings_settings = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" })] }); /* harmony default export */ const library_settings = (settings_settings); ;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js /** * WordPress dependencies */ /** * Internal dependencies */ const CUSTOM_VALUE_SETTINGS = { px: { max: 300, steps: 1 }, '%': { max: 100, steps: 1 }, vw: { max: 100, steps: 1 }, vh: { max: 100, steps: 1 }, em: { max: 10, steps: 0.1 }, rm: { max: 10, steps: 0.1 }, svw: { max: 100, steps: 1 }, lvw: { max: 100, steps: 1 }, dvw: { max: 100, steps: 1 }, svh: { max: 100, steps: 1 }, lvh: { max: 100, steps: 1 }, dvh: { max: 100, steps: 1 }, vi: { max: 100, steps: 1 }, svi: { max: 100, steps: 1 }, lvi: { max: 100, steps: 1 }, dvi: { max: 100, steps: 1 }, vb: { max: 100, steps: 1 }, svb: { max: 100, steps: 1 }, lvb: { max: 100, steps: 1 }, dvb: { max: 100, steps: 1 }, vmin: { max: 100, steps: 1 }, svmin: { max: 100, steps: 1 }, lvmin: { max: 100, steps: 1 }, dvmin: { max: 100, steps: 1 }, vmax: { max: 100, steps: 1 }, svmax: { max: 100, steps: 1 }, lvmax: { max: 100, steps: 1 }, dvmax: { max: 100, steps: 1 } }; function SpacingInputControl({ icon, isMixed = false, minimumCustomValue, onChange, onMouseOut, onMouseOver, showSideInLabel = true, side, spacingSizes, type, value }) { var _CUSTOM_VALUE_SETTING, _CUSTOM_VALUE_SETTING2; // Treat value as a preset value if the passed in value matches the value of one of the spacingSizes. value = getPresetValueFromCustomValue(value, spacingSizes); let selectListSizes = spacingSizes; const showRangeControl = spacingSizes.length <= RANGE_CONTROL_MAX_SIZE; const disableCustomSpacingSizes = (0,external_wp_data_namespaceObject.useSelect)(select => { const editorSettings = select(store).getSettings(); return editorSettings?.disableCustomSpacingSizes; }); const [showCustomValueControl, setShowCustomValueControl] = (0,external_wp_element_namespaceObject.useState)(!disableCustomSpacingSizes && value !== undefined && !isValueSpacingPreset(value)); const [minValue, setMinValue] = (0,external_wp_element_namespaceObject.useState)(minimumCustomValue); const previousValue = (0,external_wp_compose_namespaceObject.usePrevious)(value); if (!!value && previousValue !== value && !isValueSpacingPreset(value) && showCustomValueControl !== true) { setShowCustomValueControl(true); } const [availableUnits] = use_settings_useSettings('spacing.units'); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['px', 'em', 'rem'] }); let currentValue = null; const showCustomValueInSelectList = !showRangeControl && !showCustomValueControl && value !== undefined && (!isValueSpacingPreset(value) || isValueSpacingPreset(value) && isMixed); if (showCustomValueInSelectList) { selectListSizes = [...spacingSizes, { name: !isMixed ? // translators: %s: A custom measurement, e.g. a number followed by a unit like 12px. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Custom (%s)'), value) : (0,external_wp_i18n_namespaceObject.__)('Mixed'), slug: 'custom', size: value }]; currentValue = selectListSizes.length - 1; } else if (!isMixed) { currentValue = !showCustomValueControl ? getSliderValueFromPreset(value, spacingSizes) : getCustomValueFromPreset(value, spacingSizes); } const selectedUnit = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(currentValue), [currentValue])[1] || units[0]?.value; const setInitialValue = () => { if (value === undefined) { onChange('0'); } }; const customTooltipContent = newValue => value === undefined ? undefined : spacingSizes[newValue]?.name; const customRangeValue = parseFloat(currentValue, 10); const getNewCustomValue = newSize => { const isNumeric = !isNaN(parseFloat(newSize)); const nextValue = isNumeric ? newSize : undefined; return nextValue; }; const getNewPresetValue = (newSize, controlType) => { const size = parseInt(newSize, 10); if (controlType === 'selectList') { if (size === 0) { return undefined; } if (size === 1) { return '0'; } } else if (size === 0) { return '0'; } return `var:preset|spacing|${spacingSizes[newSize]?.slug}`; }; const handleCustomValueSliderChange = next => { onChange([next, selectedUnit].join('')); }; const allPlaceholder = isMixed ? (0,external_wp_i18n_namespaceObject.__)('Mixed') : null; const options = selectListSizes.map((size, index) => ({ key: index, name: size.name })); const marks = spacingSizes.slice(1, spacingSizes.length - 1).map((_newValue, index) => ({ value: index + 1, label: undefined })); const sideLabel = ALL_SIDES.includes(side) && showSideInLabel ? LABELS[side] : ''; const typeLabel = showSideInLabel ? type?.toLowerCase() : type; const ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: The side of the block being modified (top, bottom, left etc.). 2. Type of spacing being modified (padding, margin, etc). (0,external_wp_i18n_namespaceObject._x)('%1$s %2$s', 'spacing'), sideLabel, typeLabel).trim(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "spacing-sizes-control__wrapper", children: [icon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { className: "spacing-sizes-control__icon", icon: icon, size: 24 }), showCustomValueControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { onMouseOver: onMouseOver, onMouseOut: onMouseOut, onFocus: onMouseOver, onBlur: onMouseOut, onChange: newSize => onChange(getNewCustomValue(newSize)), value: currentValue, units: units, min: minValue, placeholder: allPlaceholder, disableUnits: isMixed, label: ariaLabel, hideLabelFromVision: true, className: "spacing-sizes-control__custom-value-input", size: "__unstable-large", onDragStart: () => { if (value?.charAt(0) === '-') { setMinValue(0); } }, onDrag: () => { if (value?.charAt(0) === '-') { setMinValue(0); } }, onDragEnd: () => { setMinValue(minimumCustomValue); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __next40pxDefaultSize: true, onMouseOver: onMouseOver, onMouseOut: onMouseOut, onFocus: onMouseOver, onBlur: onMouseOut, value: customRangeValue, min: 0, max: (_CUSTOM_VALUE_SETTING = CUSTOM_VALUE_SETTINGS[selectedUnit]?.max) !== null && _CUSTOM_VALUE_SETTING !== void 0 ? _CUSTOM_VALUE_SETTING : 10, step: (_CUSTOM_VALUE_SETTING2 = CUSTOM_VALUE_SETTINGS[selectedUnit]?.steps) !== null && _CUSTOM_VALUE_SETTING2 !== void 0 ? _CUSTOM_VALUE_SETTING2 : 0.1, withInputField: false, onChange: handleCustomValueSliderChange, className: "spacing-sizes-control__custom-value-range", __nextHasNoMarginBottom: true, label: ariaLabel, hideLabelFromVision: true })] }), showRangeControl && !showCustomValueControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __next40pxDefaultSize: true, onMouseOver: onMouseOver, onMouseOut: onMouseOut, className: "spacing-sizes-control__range-control", value: currentValue, onChange: newSize => onChange(getNewPresetValue(newSize)), onMouseDown: event => { // If mouse down is near start of range set initial value to 0, which // prevents the user have to drag right then left to get 0 setting. if (event?.nativeEvent?.offsetX < 35) { setInitialValue(); } }, withInputField: false, "aria-valuenow": currentValue, "aria-valuetext": spacingSizes[currentValue]?.name, renderTooltipContent: customTooltipContent, min: 0, max: spacingSizes.length - 1, marks: marks, label: ariaLabel, hideLabelFromVision: true, __nextHasNoMarginBottom: true, onFocus: onMouseOver, onBlur: onMouseOut }), !showRangeControl && !showCustomValueControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CustomSelectControl, { className: "spacing-sizes-control__custom-select-control", value: // passing empty string as a fallback to continue using the // component in controlled mode options.find(option => option.key === currentValue) || '', onChange: selection => { onChange(getNewPresetValue(selection.selectedItem.key, 'selectList')); }, options: options, label: ariaLabel, hideLabelFromVision: true, size: "__unstable-large", onMouseOver: onMouseOver, onMouseOut: onMouseOut, onFocus: onMouseOver, onBlur: onMouseOut }), !disableCustomSpacingSizes && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { label: showCustomValueControl ? (0,external_wp_i18n_namespaceObject.__)('Use size preset') : (0,external_wp_i18n_namespaceObject.__)('Set custom size'), icon: library_settings, onClick: () => { setShowCustomValueControl(!showCustomValueControl); }, isPressed: showCustomValueControl, size: "small", className: "spacing-sizes-control__custom-toggle", iconSize: 24 })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/input-controls/axial.js /** * Internal dependencies */ const groupedSides = ['vertical', 'horizontal']; function AxialInputControls({ minimumCustomValue, onChange, onMouseOut, onMouseOver, sides, spacingSizes, type, values }) { const createHandleOnChange = side => next => { if (!onChange) { return; } // Encode the existing value into the preset value if the passed in value matches the value of one of the spacingSizes. const nextValues = { ...Object.keys(values).reduce((acc, key) => { acc[key] = getPresetValueFromCustomValue(values[key], spacingSizes); return acc; }, {}) }; if (side === 'vertical') { nextValues.top = next; nextValues.bottom = next; } if (side === 'horizontal') { nextValues.left = next; nextValues.right = next; } onChange(nextValues); }; // Filter sides if custom configuration provided, maintaining default order. const filteredSides = sides?.length ? groupedSides.filter(side => hasAxisSupport(sides, side)) : groupedSides; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: filteredSides.map(side => { const axisValue = side === 'vertical' ? values.top : values.left; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingInputControl, { icon: ICONS[side], label: LABELS[side], minimumCustomValue: minimumCustomValue, onChange: createHandleOnChange(side), onMouseOut: onMouseOut, onMouseOver: onMouseOver, side: side, spacingSizes: spacingSizes, type: type, value: axisValue, withInputField: false }, `spacing-sizes-control-${side}`); }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/input-controls/separated.js /** * Internal dependencies */ function SeparatedInputControls({ minimumCustomValue, onChange, onMouseOut, onMouseOver, sides, spacingSizes, type, values }) { // Filter sides if custom configuration provided, maintaining default order. const filteredSides = sides?.length ? ALL_SIDES.filter(side => sides.includes(side)) : ALL_SIDES; const createHandleOnChange = side => next => { // Encode the existing value into the preset value if the passed in value matches the value of one of the spacingSizes. const nextValues = { ...Object.keys(values).reduce((acc, key) => { acc[key] = getPresetValueFromCustomValue(values[key], spacingSizes); return acc; }, {}) }; nextValues[side] = next; onChange(nextValues); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: filteredSides.map(side => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingInputControl, { icon: ICONS[side], label: LABELS[side], minimumCustomValue: minimumCustomValue, onChange: createHandleOnChange(side), onMouseOut: onMouseOut, onMouseOver: onMouseOver, side: side, spacingSizes: spacingSizes, type: type, value: values[side], withInputField: false }, `spacing-sizes-control-${side}`); }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/input-controls/single.js /** * Internal dependencies */ function SingleInputControl({ minimumCustomValue, onChange, onMouseOut, onMouseOver, showSideInLabel, side, spacingSizes, type, values }) { const createHandleOnChange = currentSide => next => { // Encode the existing value into the preset value if the passed in value matches the value of one of the spacingSizes. const nextValues = { ...Object.keys(values).reduce((acc, key) => { acc[key] = getPresetValueFromCustomValue(values[key], spacingSizes); return acc; }, {}) }; nextValues[currentSide] = next; onChange(nextValues); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingInputControl, { label: LABELS[side], minimumCustomValue: minimumCustomValue, onChange: createHandleOnChange(side), onMouseOut: onMouseOut, onMouseOver: onMouseOver, showSideInLabel: showSideInLabel, side: side, spacingSizes: spacingSizes, type: type, value: values[side], withInputField: false }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/linked-button.js /** * WordPress dependencies */ function linked_button_LinkedButton({ isLinked, ...props }) { const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink sides') : (0,external_wp_i18n_namespaceObject.__)('Link sides'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { ...props, size: "small", icon: isLinked ? library_link : link_off, iconSize: 24, label: label }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/spacing-sizes-control/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * A flexible control for managing spacing values in the block editor. Supports single, axial, * and separated input controls for different spacing configurations with automatic view selection * based on current values and available sides. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/spacing-sizes-control/README.md * * @example * ```jsx * import { __experimentalSpacingSizesControl as SpacingSizesControl } from '@wordpress/block-editor'; * import { useState } from '@wordpress/element'; * * function Example() { * const [ sides, setSides ] = useState( { * top: '0px', * right: '0px', * bottom: '0px', * left: '0px', * } ); * * return ( * <SpacingSizesControl * values={ sides } * onChange={ setSides } * label="Sides" * /> * ); * } * ``` * * @param {Object} props Component props. * @param {Object} props.inputProps Additional props for input controls. * @param {string} props.label Label for the control. * @param {number} props.minimumCustomValue Minimum value for custom input. * @param {Function} props.onChange Called when spacing values change. * @param {Function} props.onMouseOut Called when mouse leaves the control. * @param {Function} props.onMouseOver Called when mouse enters the control. * @param {boolean} props.showSideInLabel Show side in control label. * @param {Array} props.sides Available sides for control. * @param {boolean} props.useSelect Use select control for predefined values. * @param {Object} props.values Current spacing values. * @return {Element} Spacing sizes control component. */ function SpacingSizesControl({ inputProps, label: labelProp, minimumCustomValue = 0, onChange, onMouseOut, onMouseOver, showSideInLabel = true, sides = ALL_SIDES, useSelect, values }) { const spacingSizes = useSpacingSizes(); const inputValues = values || DEFAULT_VALUES; const hasOneSide = sides?.length === 1; const hasOnlyAxialSides = sides?.includes('horizontal') && sides?.includes('vertical') && sides?.length === 2; const [view, setView] = (0,external_wp_element_namespaceObject.useState)(getInitialView(inputValues, sides)); const toggleLinked = () => { setView(view === VIEWS.axial ? VIEWS.custom : VIEWS.axial); }; const handleOnChange = nextValue => { const newValues = { ...values, ...nextValue }; onChange(newValues); }; const inputControlProps = { ...inputProps, minimumCustomValue, onChange: handleOnChange, onMouseOut, onMouseOver, sides, spacingSizes, type: labelProp, useSelect, values: inputValues }; const renderControls = () => { if (view === VIEWS.axial) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AxialInputControls, { ...inputControlProps }); } if (view === VIEWS.custom) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SeparatedInputControls, { ...inputControlProps }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleInputControl, { side: view, ...inputControlProps, showSideInLabel: showSideInLabel }); }; const sideLabel = ALL_SIDES.includes(view) && showSideInLabel ? LABELS[view] : ''; const label = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: The side of the block being modified (top, bottom, left etc.). 2. Type of spacing being modified (padding, margin, etc). (0,external_wp_i18n_namespaceObject._x)('%1$s %2$s', 'spacing'), labelProp, sideLabel).trim(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "spacing-sizes-control", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "spacing-sizes-control__header", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", className: "spacing-sizes-control__label", children: label }), !hasOneSide && !hasOnlyAxialSides && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(linked_button_LinkedButton, { label: labelProp, onClick: toggleLinked, isLinked: view === VIEWS.axial })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0.5, children: renderControls() })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/height-control/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const RANGE_CONTROL_CUSTOM_SETTINGS = { px: { max: 1000, step: 1 }, '%': { max: 100, step: 1 }, vw: { max: 100, step: 1 }, vh: { max: 100, step: 1 }, em: { max: 50, step: 0.1 }, rem: { max: 50, step: 0.1 }, svw: { max: 100, step: 1 }, lvw: { max: 100, step: 1 }, dvw: { max: 100, step: 1 }, svh: { max: 100, step: 1 }, lvh: { max: 100, step: 1 }, dvh: { max: 100, step: 1 }, vi: { max: 100, step: 1 }, svi: { max: 100, step: 1 }, lvi: { max: 100, step: 1 }, dvi: { max: 100, step: 1 }, vb: { max: 100, step: 1 }, svb: { max: 100, step: 1 }, lvb: { max: 100, step: 1 }, dvb: { max: 100, step: 1 }, vmin: { max: 100, step: 1 }, svmin: { max: 100, step: 1 }, lvmin: { max: 100, step: 1 }, dvmin: { max: 100, step: 1 }, vmax: { max: 100, step: 1 }, svmax: { max: 100, step: 1 }, lvmax: { max: 100, step: 1 }, dvmax: { max: 100, step: 1 } }; /** * HeightControl renders a linked unit control and range control for adjusting the height of a block. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/height-control/README.md * * @param {Object} props * @param {?string} props.label A label for the control. * @param {( value: string ) => void } props.onChange Called when the height changes. * @param {string} props.value The current height value. * * @return {Component} The component to be rendered. */ function HeightControl({ label = (0,external_wp_i18n_namespaceObject.__)('Height'), onChange, value }) { var _RANGE_CONTROL_CUSTOM, _RANGE_CONTROL_CUSTOM2; const customRangeValue = parseFloat(value); const [availableUnits] = use_settings_useSettings('spacing.units'); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vh', 'vw'] }); const selectedUnit = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value), [value])[1] || units[0]?.value || 'px'; const handleSliderChange = next => { onChange([next, selectedUnit].join('')); }; const handleUnitChange = newUnit => { // Attempt to smooth over differences between currentUnit and newUnit. // This should slightly improve the experience of switching between unit types. const [currentValue, currentUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value); if (['em', 'rem'].includes(newUnit) && currentUnit === 'px') { // Convert pixel value to an approximate of the new unit, assuming a root size of 16px. onChange((currentValue / 16).toFixed(2) + newUnit); } else if (['em', 'rem'].includes(currentUnit) && newUnit === 'px') { // Convert to pixel value assuming a root size of 16px. onChange(Math.round(currentValue * 16) + newUnit); } else if (['%', 'vw', 'svw', 'lvw', 'dvw', 'vh', 'svh', 'lvh', 'dvh', 'vi', 'svi', 'lvi', 'dvi', 'vb', 'svb', 'lvb', 'dvb', 'vmin', 'svmin', 'lvmin', 'dvmin', 'vmax', 'svmax', 'lvmax', 'dvmax'].includes(newUnit) && currentValue > 100) { // When converting to `%` or viewport-relative units, cap the new value at 100. onChange(100 + newUnit); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "block-editor-height-control", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { as: "legend", children: label }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { value: value, units: units, onChange: onChange, onUnitChange: handleUnitChange, min: 0, size: "__unstable-large", label: label, hideLabelFromVision: true }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginX: 2, marginBottom: 0, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __next40pxDefaultSize: true, value: customRangeValue, min: 0, max: (_RANGE_CONTROL_CUSTOM = RANGE_CONTROL_CUSTOM_SETTINGS[selectedUnit]?.max) !== null && _RANGE_CONTROL_CUSTOM !== void 0 ? _RANGE_CONTROL_CUSTOM : 100, step: (_RANGE_CONTROL_CUSTOM2 = RANGE_CONTROL_CUSTOM_SETTINGS[selectedUnit]?.step) !== null && _RANGE_CONTROL_CUSTOM2 !== void 0 ? _RANGE_CONTROL_CUSTOM2 : 0.1, withInputField: false, onChange: handleSliderChange, __nextHasNoMarginBottom: true, label: label, hideLabelFromVision: true }) }) })] })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/grid/use-get-number-of-blocks-before-cell.js /** * WordPress dependencies */ /** * Internal dependencies */ function useGetNumberOfBlocksBeforeCell(gridClientId, numColumns) { const { getBlockOrder, getBlockAttributes } = (0,external_wp_data_namespaceObject.useSelect)(store); const getNumberOfBlocksBeforeCell = (column, row) => { const targetIndex = (row - 1) * numColumns + column - 1; let count = 0; for (const clientId of getBlockOrder(gridClientId)) { var _getBlockAttributes$s; const { columnStart, rowStart } = (_getBlockAttributes$s = getBlockAttributes(clientId).style?.layout) !== null && _getBlockAttributes$s !== void 0 ? _getBlockAttributes$s : {}; const cellIndex = (rowStart - 1) * numColumns + columnStart - 1; if (cellIndex < targetIndex) { count++; } } return count; }; return getNumberOfBlocksBeforeCell; } ;// ./node_modules/@wordpress/block-editor/build-module/components/child-layout-control/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function helpText(selfStretch, parentLayout) { const { orientation = 'horizontal' } = parentLayout; if (selfStretch === 'fill') { return (0,external_wp_i18n_namespaceObject.__)('Stretch to fill available space.'); } if (selfStretch === 'fixed' && orientation === 'horizontal') { return (0,external_wp_i18n_namespaceObject.__)('Specify a fixed width.'); } else if (selfStretch === 'fixed') { return (0,external_wp_i18n_namespaceObject.__)('Specify a fixed height.'); } return (0,external_wp_i18n_namespaceObject.__)('Fit contents.'); } /** * Form to edit the child layout value. * * @param {Object} props Props. * @param {Object} props.value The child layout value. * @param {Function} props.onChange Function to update the child layout value. * @param {Object} props.parentLayout The parent layout value. * * @param {boolean} props.isShownByDefault * @param {string} props.panelId * @return {Element} child layout edit element. */ function ChildLayoutControl({ value: childLayout = {}, onChange, parentLayout, isShownByDefault, panelId }) { const { type: parentType, default: { type: defaultParentType = 'default' } = {} } = parentLayout !== null && parentLayout !== void 0 ? parentLayout : {}; const parentLayoutType = parentType || defaultParentType; if (parentLayoutType === 'flex') { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FlexControls, { childLayout: childLayout, onChange: onChange, parentLayout: parentLayout, isShownByDefault: isShownByDefault, panelId: panelId }); } else if (parentLayoutType === 'grid') { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridControls, { childLayout: childLayout, onChange: onChange, parentLayout: parentLayout, isShownByDefault: isShownByDefault, panelId: panelId }); } return null; } function FlexControls({ childLayout, onChange, parentLayout, isShownByDefault, panelId }) { const { selfStretch, flexSize } = childLayout; const { orientation = 'horizontal' } = parentLayout !== null && parentLayout !== void 0 ? parentLayout : {}; const hasFlexValue = () => !!selfStretch; const flexResetLabel = orientation === 'horizontal' ? (0,external_wp_i18n_namespaceObject.__)('Width') : (0,external_wp_i18n_namespaceObject.__)('Height'); const [availableUnits] = use_settings_useSettings('spacing.units'); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vh', 'vw'] }); const resetFlex = () => { onChange({ selfStretch: undefined, flexSize: undefined }); }; (0,external_wp_element_namespaceObject.useEffect)(() => { if (selfStretch === 'fixed' && !flexSize) { onChange({ ...childLayout, selfStretch: 'fit' }); } }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { as: external_wp_components_namespaceObject.__experimentalToolsPanelItem, spacing: 2, hasValue: hasFlexValue, label: flexResetLabel, onDeselect: resetFlex, isShownByDefault: isShownByDefault, panelId: panelId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __nextHasNoMarginBottom: true, size: "__unstable-large", label: childLayoutOrientation(parentLayout), value: selfStretch || 'fit', help: helpText(selfStretch, parentLayout), onChange: value => { const newFlexSize = value !== 'fixed' ? null : flexSize; onChange({ selfStretch: value, flexSize: newFlexSize }); }, isBlock: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "fit", label: (0,external_wp_i18n_namespaceObject._x)('Fit', 'Intrinsic block width in flex layout') }, "fit"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "fill", label: (0,external_wp_i18n_namespaceObject._x)('Grow', 'Block with expanding width in flex layout') }, "fill"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "fixed", label: (0,external_wp_i18n_namespaceObject._x)('Fixed', 'Block with fixed width in flex layout') }, "fixed")] }), selfStretch === 'fixed' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { size: "__unstable-large", units: units, onChange: value => { onChange({ selfStretch, flexSize: value }); }, value: flexSize, label: flexResetLabel, hideLabelFromVision: true })] }); } function childLayoutOrientation(parentLayout) { const { orientation = 'horizontal' } = parentLayout; return orientation === 'horizontal' ? (0,external_wp_i18n_namespaceObject.__)('Width') : (0,external_wp_i18n_namespaceObject.__)('Height'); } function GridControls({ childLayout, onChange, parentLayout, isShownByDefault, panelId }) { const { columnStart, rowStart, columnSpan, rowSpan } = childLayout; const { columnCount = 3, rowCount } = parentLayout !== null && parentLayout !== void 0 ? parentLayout : {}; const rootClientId = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlockRootClientId(panelId)); const { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(store); const getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(rootClientId, columnCount); const hasStartValue = () => !!columnStart || !!rowStart; const hasSpanValue = () => !!columnSpan || !!rowSpan; const resetGridStarts = () => { onChange({ columnStart: undefined, rowStart: undefined }); }; const resetGridSpans = () => { onChange({ columnSpan: undefined, rowSpan: undefined }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { as: external_wp_components_namespaceObject.__experimentalToolsPanelItem, hasValue: hasSpanValue, label: (0,external_wp_i18n_namespaceObject.__)('Grid span'), onDeselect: resetGridSpans, isShownByDefault: isShownByDefault, panelId: panelId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { size: "__unstable-large", label: (0,external_wp_i18n_namespaceObject.__)('Column span'), type: "number", onChange: value => { // Don't allow unsetting. const newColumnSpan = value === '' ? 1 : parseInt(value, 10); onChange({ columnStart, rowStart, rowSpan, columnSpan: newColumnSpan }); }, value: columnSpan !== null && columnSpan !== void 0 ? columnSpan : 1, min: 1 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { size: "__unstable-large", label: (0,external_wp_i18n_namespaceObject.__)('Row span'), type: "number", onChange: value => { // Don't allow unsetting. const newRowSpan = value === '' ? 1 : parseInt(value, 10); onChange({ columnStart, rowStart, columnSpan, rowSpan: newRowSpan }); }, value: rowSpan !== null && rowSpan !== void 0 ? rowSpan : 1, min: 1 })] }), window.__experimentalEnableGridInteractivity && columnCount && /*#__PURE__*/ // Use Flex with an explicit width on the FlexItem instead of HStack to // work around an issue in webkit where inputs with a max attribute are // sized incorrectly. (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { as: external_wp_components_namespaceObject.__experimentalToolsPanelItem, hasValue: hasStartValue, label: (0,external_wp_i18n_namespaceObject.__)('Grid placement'), onDeselect: resetGridStarts, isShownByDefault: false, panelId: panelId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { style: { width: '50%' }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { size: "__unstable-large", label: (0,external_wp_i18n_namespaceObject.__)('Column'), type: "number", onChange: value => { // Don't allow unsetting. const newColumnStart = value === '' ? 1 : parseInt(value, 10); onChange({ columnStart: newColumnStart, rowStart, columnSpan, rowSpan }); __unstableMarkNextChangeAsNotPersistent(); moveBlocksToPosition([panelId], rootClientId, rootClientId, getNumberOfBlocksBeforeCell(newColumnStart, rowStart)); }, value: columnStart !== null && columnStart !== void 0 ? columnStart : 1, min: 1, max: columnCount ? columnCount - (columnSpan !== null && columnSpan !== void 0 ? columnSpan : 1) + 1 : undefined }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { style: { width: '50%' }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { size: "__unstable-large", label: (0,external_wp_i18n_namespaceObject.__)('Row'), type: "number", onChange: value => { // Don't allow unsetting. const newRowStart = value === '' ? 1 : parseInt(value, 10); onChange({ columnStart, rowStart: newRowStart, columnSpan, rowSpan }); __unstableMarkNextChangeAsNotPersistent(); moveBlocksToPosition([panelId], rootClientId, rootClientId, getNumberOfBlocksBeforeCell(columnStart, newRowStart)); }, value: rowStart !== null && rowStart !== void 0 ? rowStart : 1, min: 1, max: rowCount ? rowCount - (rowSpan !== null && rowSpan !== void 0 ? rowSpan : 1) + 1 : undefined }) })] })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/dimensions-tool/aspect-ratio-tool.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * @typedef {import('@wordpress/components/build-types/select-control/types').SelectControlProps} SelectControlProps */ /** * @callback AspectRatioToolPropsOnChange * @param {string} [value] New aspect ratio value. * @return {void} No return. */ /** * @typedef {Object} AspectRatioToolProps * @property {string} [panelId] ID of the panel this tool is associated with. * @property {string} [value] Current aspect ratio value. * @property {AspectRatioToolPropsOnChange} [onChange] Callback to update the aspect ratio value. * @property {SelectControlProps[]} [options] Aspect ratio options. * @property {string} [defaultValue] Default aspect ratio value. * @property {boolean} [isShownByDefault] Whether the tool is shown by default. */ function AspectRatioTool({ panelId, value, onChange = () => {}, options, defaultValue = 'auto', hasValue, isShownByDefault = true }) { // Match the CSS default so if the value is used directly in CSS it will look correct in the control. const displayValue = value !== null && value !== void 0 ? value : 'auto'; const [defaultRatios, themeRatios, showDefaultRatios] = use_settings_useSettings('dimensions.aspectRatios.default', 'dimensions.aspectRatios.theme', 'dimensions.defaultAspectRatios'); const themeOptions = themeRatios?.map(({ name, ratio }) => ({ label: name, value: ratio })); const defaultOptions = defaultRatios?.map(({ name, ratio }) => ({ label: name, value: ratio })); const aspectRatioOptions = [{ label: (0,external_wp_i18n_namespaceObject._x)('Original', 'Aspect ratio option for dimensions control'), value: 'auto' }, ...(showDefaultRatios ? defaultOptions : []), ...(themeOptions ? themeOptions : []), { label: (0,external_wp_i18n_namespaceObject._x)('Custom', 'Aspect ratio option for dimensions control'), value: 'custom', disabled: true, hidden: true }]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: hasValue ? hasValue : () => displayValue !== defaultValue, label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'), onDeselect: () => onChange(undefined), isShownByDefault: isShownByDefault, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'), value: displayValue, options: options !== null && options !== void 0 ? options : aspectRatioOptions, onChange: onChange, size: "__unstable-large", __nextHasNoMarginBottom: true }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/dimensions-panel.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const AXIAL_SIDES = ['horizontal', 'vertical']; function useHasDimensionsPanel(settings) { const hasContentSize = useHasContentSize(settings); const hasWideSize = useHasWideSize(settings); const hasPadding = useHasPadding(settings); const hasMargin = useHasMargin(settings); const hasGap = useHasGap(settings); const hasMinHeight = useHasMinHeight(settings); const hasAspectRatio = useHasAspectRatio(settings); const hasChildLayout = useHasChildLayout(settings); return external_wp_element_namespaceObject.Platform.OS === 'web' && (hasContentSize || hasWideSize || hasPadding || hasMargin || hasGap || hasMinHeight || hasAspectRatio || hasChildLayout); } function useHasContentSize(settings) { return settings?.layout?.contentSize; } function useHasWideSize(settings) { return settings?.layout?.wideSize; } function useHasPadding(settings) { return settings?.spacing?.padding; } function useHasMargin(settings) { return settings?.spacing?.margin; } function useHasGap(settings) { return settings?.spacing?.blockGap; } function useHasMinHeight(settings) { return settings?.dimensions?.minHeight; } function useHasAspectRatio(settings) { return settings?.dimensions?.aspectRatio; } function useHasChildLayout(settings) { var _settings$parentLayou; const { type: parentLayoutType = 'default', default: { type: defaultParentLayoutType = 'default' } = {}, allowSizingOnChildren = false } = (_settings$parentLayou = settings?.parentLayout) !== null && _settings$parentLayou !== void 0 ? _settings$parentLayou : {}; const support = (defaultParentLayoutType === 'flex' || parentLayoutType === 'flex' || defaultParentLayoutType === 'grid' || parentLayoutType === 'grid') && allowSizingOnChildren; return !!settings?.layout && support; } function useHasSpacingPresets(settings) { const { defaultSpacingSizes, spacingSizes } = settings?.spacing || {}; return defaultSpacingSizes !== false && spacingSizes?.default?.length > 0 || spacingSizes?.theme?.length > 0 || spacingSizes?.custom?.length > 0; } function filterValuesBySides(values, sides) { // If no custom side configuration, all sides are opted into by default. // Without any values, we have nothing to filter either. if (!sides || !values) { return values; } // Only include sides opted into within filtered values. const filteredValues = {}; sides.forEach(side => { if (side === 'vertical') { filteredValues.top = values.top; filteredValues.bottom = values.bottom; } if (side === 'horizontal') { filteredValues.left = values.left; filteredValues.right = values.right; } filteredValues[side] = values?.[side]; }); return filteredValues; } function splitStyleValue(value) { // Check for shorthand value (a string value). if (value && typeof value === 'string') { // Convert to value for individual sides for BoxControl. return { top: value, right: value, bottom: value, left: value }; } return value; } function splitGapValue(value, isAxialGap) { if (!value) { return value; } // Check for shorthand value (a string value). if (typeof value === 'string') { /* * Map the string value to appropriate sides for the spacing control depending * on whether the current block has axial gap support or not. * * Note: The axial value pairs must match for the spacing control to display * the appropriate horizontal/vertical sliders. */ return isAxialGap ? { top: value, right: value, bottom: value, left: value } : { top: value }; } return { ...value, right: value?.left, bottom: value?.top }; } function DimensionsToolsPanel({ resetAllFilter, onChange, value, panelId, children }) { const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const resetAll = () => { const updatedValue = resetAllFilter(value); onChange(updatedValue); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Dimensions'), resetAll: resetAll, panelId: panelId, dropdownMenuProps: dropdownMenuProps, children: children }); } const dimensions_panel_DEFAULT_CONTROLS = { contentSize: true, wideSize: true, padding: true, margin: true, blockGap: true, minHeight: true, aspectRatio: true, childLayout: true }; function DimensionsPanel({ as: Wrapper = DimensionsToolsPanel, value, onChange, inheritedValue = value, settings, panelId, defaultControls = dimensions_panel_DEFAULT_CONTROLS, onVisualize = () => {}, // Special case because the layout controls are not part of the dimensions panel // in global styles but not in block inspector. includeLayoutControls = false }) { var _defaultControls$cont, _defaultControls$wide, _defaultControls$padd, _defaultControls$marg, _defaultControls$bloc, _defaultControls$chil, _defaultControls$minH, _defaultControls$aspe; const { dimensions, spacing } = settings; const decodeValue = rawValue => { if (rawValue && typeof rawValue === 'object') { return Object.keys(rawValue).reduce((acc, key) => { acc[key] = getValueFromVariable({ settings: { dimensions, spacing } }, '', rawValue[key]); return acc; }, {}); } return getValueFromVariable({ settings: { dimensions, spacing } }, '', rawValue); }; const showSpacingPresetsControl = useHasSpacingPresets(settings); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: settings?.spacing?.units || ['%', 'px', 'em', 'rem', 'vw'] }); //Minimum Margin Value const minimumMargin = -Infinity; const [minMarginValue, setMinMarginValue] = (0,external_wp_element_namespaceObject.useState)(minimumMargin); // Content Width const showContentSizeControl = useHasContentSize(settings) && includeLayoutControls; const contentSizeValue = decodeValue(inheritedValue?.layout?.contentSize); const setContentSizeValue = newValue => { onChange(setImmutably(value, ['layout', 'contentSize'], newValue || undefined)); }; const hasUserSetContentSizeValue = () => !!value?.layout?.contentSize; const resetContentSizeValue = () => setContentSizeValue(undefined); // Wide Width const showWideSizeControl = useHasWideSize(settings) && includeLayoutControls; const wideSizeValue = decodeValue(inheritedValue?.layout?.wideSize); const setWideSizeValue = newValue => { onChange(setImmutably(value, ['layout', 'wideSize'], newValue || undefined)); }; const hasUserSetWideSizeValue = () => !!value?.layout?.wideSize; const resetWideSizeValue = () => setWideSizeValue(undefined); // Padding const showPaddingControl = useHasPadding(settings); const rawPadding = decodeValue(inheritedValue?.spacing?.padding); const paddingValues = splitStyleValue(rawPadding); const paddingSides = Array.isArray(settings?.spacing?.padding) ? settings?.spacing?.padding : settings?.spacing?.padding?.sides; const isAxialPadding = paddingSides && paddingSides.some(side => AXIAL_SIDES.includes(side)); const setPaddingValues = newPaddingValues => { const padding = filterValuesBySides(newPaddingValues, paddingSides); onChange(setImmutably(value, ['spacing', 'padding'], padding)); }; const hasPaddingValue = () => !!value?.spacing?.padding && Object.keys(value?.spacing?.padding).length; const resetPaddingValue = () => setPaddingValues(undefined); const onMouseOverPadding = () => onVisualize('padding'); // Margin const showMarginControl = useHasMargin(settings); const rawMargin = decodeValue(inheritedValue?.spacing?.margin); const marginValues = splitStyleValue(rawMargin); const marginSides = Array.isArray(settings?.spacing?.margin) ? settings?.spacing?.margin : settings?.spacing?.margin?.sides; const isAxialMargin = marginSides && marginSides.some(side => AXIAL_SIDES.includes(side)); const setMarginValues = newMarginValues => { const margin = filterValuesBySides(newMarginValues, marginSides); onChange(setImmutably(value, ['spacing', 'margin'], margin)); }; const hasMarginValue = () => !!value?.spacing?.margin && Object.keys(value?.spacing?.margin).length; const resetMarginValue = () => setMarginValues(undefined); const onMouseOverMargin = () => onVisualize('margin'); // Block Gap const showGapControl = useHasGap(settings); const gapSides = Array.isArray(settings?.spacing?.blockGap) ? settings?.spacing?.blockGap : settings?.spacing?.blockGap?.sides; const isAxialGap = gapSides && gapSides.some(side => AXIAL_SIDES.includes(side)); const gapValue = decodeValue(inheritedValue?.spacing?.blockGap); const gapValues = splitGapValue(gapValue, isAxialGap); const setGapValue = newGapValue => { onChange(setImmutably(value, ['spacing', 'blockGap'], newGapValue)); }; const setGapValues = nextBoxGapValue => { if (!nextBoxGapValue) { setGapValue(null); } // If axial gap is not enabled, treat the 'top' value as the shorthand gap value. if (!isAxialGap && nextBoxGapValue?.hasOwnProperty('top')) { setGapValue(nextBoxGapValue.top); } else { setGapValue({ top: nextBoxGapValue?.top, left: nextBoxGapValue?.left }); } }; const resetGapValue = () => setGapValue(undefined); const hasGapValue = () => !!value?.spacing?.blockGap; // Min Height const showMinHeightControl = useHasMinHeight(settings); const minHeightValue = decodeValue(inheritedValue?.dimensions?.minHeight); const setMinHeightValue = newValue => { const tempValue = setImmutably(value, ['dimensions', 'minHeight'], newValue); // Apply min-height, while removing any applied aspect ratio. onChange(setImmutably(tempValue, ['dimensions', 'aspectRatio'], undefined)); }; const resetMinHeightValue = () => { setMinHeightValue(undefined); }; const hasMinHeightValue = () => !!value?.dimensions?.minHeight; // Aspect Ratio const showAspectRatioControl = useHasAspectRatio(settings); const aspectRatioValue = decodeValue(inheritedValue?.dimensions?.aspectRatio); const setAspectRatioValue = newValue => { const tempValue = setImmutably(value, ['dimensions', 'aspectRatio'], newValue); // Apply aspect-ratio, while removing any applied min-height. onChange(setImmutably(tempValue, ['dimensions', 'minHeight'], undefined)); }; const hasAspectRatioValue = () => !!value?.dimensions?.aspectRatio; // Child Layout const showChildLayoutControl = useHasChildLayout(settings); const childLayout = inheritedValue?.layout; const setChildLayout = newChildLayout => { onChange({ ...value, layout: { ...newChildLayout } }); }; const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(previousValue => { return { ...previousValue, layout: utils_cleanEmptyObject({ ...previousValue?.layout, contentSize: undefined, wideSize: undefined, selfStretch: undefined, flexSize: undefined, columnStart: undefined, rowStart: undefined, columnSpan: undefined, rowSpan: undefined }), spacing: { ...previousValue?.spacing, padding: undefined, margin: undefined, blockGap: undefined }, dimensions: { ...previousValue?.dimensions, minHeight: undefined, aspectRatio: undefined } }; }, []); const onMouseLeaveControls = () => onVisualize(false); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Wrapper, { resetAllFilter: resetAllFilter, value: value, onChange: onChange, panelId: panelId, children: [(showContentSizeControl || showWideSizeControl) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "span-columns", children: (0,external_wp_i18n_namespaceObject.__)('Set the width of the main content area.') }), showContentSizeControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Content width'), hasValue: hasUserSetContentSizeValue, onDeselect: resetContentSizeValue, isShownByDefault: (_defaultControls$cont = defaultControls.contentSize) !== null && _defaultControls$cont !== void 0 ? _defaultControls$cont : dimensions_panel_DEFAULT_CONTROLS.contentSize, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Content width'), labelPosition: "top", value: contentSizeValue || '', onChange: nextContentSize => { setContentSizeValue(nextContentSize); }, units: units, prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: align_none }) }) }) }), showWideSizeControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Wide width'), hasValue: hasUserSetWideSizeValue, onDeselect: resetWideSizeValue, isShownByDefault: (_defaultControls$wide = defaultControls.wideSize) !== null && _defaultControls$wide !== void 0 ? _defaultControls$wide : dimensions_panel_DEFAULT_CONTROLS.wideSize, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Wide width'), labelPosition: "top", value: wideSizeValue || '', onChange: nextWideSize => { setWideSizeValue(nextWideSize); }, units: units, prefix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: stretch_wide }) }) }) }), showPaddingControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: hasPaddingValue, label: (0,external_wp_i18n_namespaceObject.__)('Padding'), onDeselect: resetPaddingValue, isShownByDefault: (_defaultControls$padd = defaultControls.padding) !== null && _defaultControls$padd !== void 0 ? _defaultControls$padd : dimensions_panel_DEFAULT_CONTROLS.padding, className: dist_clsx({ 'tools-panel-item-spacing': showSpacingPresetsControl }), panelId: panelId, children: [!showSpacingPresetsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BoxControl, { __next40pxDefaultSize: true, values: paddingValues, onChange: setPaddingValues, label: (0,external_wp_i18n_namespaceObject.__)('Padding'), sides: paddingSides, units: units, allowReset: false, splitOnAxis: isAxialPadding, inputProps: { onMouseOver: onMouseOverPadding, onMouseOut: onMouseLeaveControls } }), showSpacingPresetsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingSizesControl, { values: paddingValues, onChange: setPaddingValues, label: (0,external_wp_i18n_namespaceObject.__)('Padding'), sides: paddingSides, units: units, allowReset: false, onMouseOver: onMouseOverPadding, onMouseOut: onMouseLeaveControls })] }), showMarginControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: hasMarginValue, label: (0,external_wp_i18n_namespaceObject.__)('Margin'), onDeselect: resetMarginValue, isShownByDefault: (_defaultControls$marg = defaultControls.margin) !== null && _defaultControls$marg !== void 0 ? _defaultControls$marg : dimensions_panel_DEFAULT_CONTROLS.margin, className: dist_clsx({ 'tools-panel-item-spacing': showSpacingPresetsControl }), panelId: panelId, children: [!showSpacingPresetsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BoxControl, { __next40pxDefaultSize: true, values: marginValues, onChange: setMarginValues, inputProps: { min: minMarginValue, onDragStart: () => { // Reset to 0 in case the value was negative. setMinMarginValue(0); }, onDragEnd: () => { setMinMarginValue(minimumMargin); }, onMouseOver: onMouseOverMargin, onMouseOut: onMouseLeaveControls }, label: (0,external_wp_i18n_namespaceObject.__)('Margin'), sides: marginSides, units: units, allowReset: false, splitOnAxis: isAxialMargin }), showSpacingPresetsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingSizesControl, { values: marginValues, onChange: setMarginValues, minimumCustomValue: -Infinity, label: (0,external_wp_i18n_namespaceObject.__)('Margin'), sides: marginSides, units: units, allowReset: false, onMouseOver: onMouseOverMargin, onMouseOut: onMouseLeaveControls })] }), showGapControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: hasGapValue, label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'), onDeselect: resetGapValue, isShownByDefault: (_defaultControls$bloc = defaultControls.blockGap) !== null && _defaultControls$bloc !== void 0 ? _defaultControls$bloc : dimensions_panel_DEFAULT_CONTROLS.blockGap, className: dist_clsx({ 'tools-panel-item-spacing': showSpacingPresetsControl, 'single-column': // If UnitControl is used, should be single-column. !showSpacingPresetsControl && !isAxialGap }), panelId: panelId, children: [!showSpacingPresetsControl && (isAxialGap ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BoxControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'), min: 0, onChange: setGapValues, units: units, sides: gapSides, values: gapValues, allowReset: false, splitOnAxis: isAxialGap }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'), min: 0, onChange: setGapValue, units: units, value: gapValue })), showSpacingPresetsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingSizesControl, { label: (0,external_wp_i18n_namespaceObject.__)('Block spacing'), min: 0, onChange: setGapValues, showSideInLabel: false, sides: isAxialGap ? gapSides : ['top'] // Use 'top' as the shorthand property in non-axial configurations. , values: gapValues, allowReset: false })] }), showChildLayoutControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ChildLayoutControl, { value: childLayout, onChange: setChildLayout, parentLayout: settings?.parentLayout, panelId: panelId, isShownByDefault: (_defaultControls$chil = defaultControls.childLayout) !== null && _defaultControls$chil !== void 0 ? _defaultControls$chil : dimensions_panel_DEFAULT_CONTROLS.childLayout }), showMinHeightControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: hasMinHeightValue, label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'), onDeselect: resetMinHeightValue, isShownByDefault: (_defaultControls$minH = defaultControls.minHeight) !== null && _defaultControls$minH !== void 0 ? _defaultControls$minH : dimensions_panel_DEFAULT_CONTROLS.minHeight, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(HeightControl, { label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'), value: minHeightValue, onChange: setMinHeightValue }) }), showAspectRatioControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AspectRatioTool, { hasValue: hasAspectRatioValue, value: aspectRatioValue, onChange: setAspectRatioValue, panelId: panelId, isShownByDefault: (_defaultControls$aspe = defaultControls.aspectRatio) !== null && _defaultControls$aspe !== void 0 ? _defaultControls$aspe : dimensions_panel_DEFAULT_CONTROLS.aspectRatio })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-popover/use-popover-scroll.js /** * WordPress dependencies */ const scrollContainerCache = new WeakMap(); /** * Allow scrolling "through" popovers over the canvas. This is only called for * as long as the pointer is over a popover. Do not use React events because it * will bubble through portals. * * @param {Object} contentRef */ function usePopoverScroll(contentRef) { const effect = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { function onWheel(event) { const { deltaX, deltaY } = event; const contentEl = contentRef.current; let scrollContainer = scrollContainerCache.get(contentEl); if (!scrollContainer) { scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(contentEl); scrollContainerCache.set(contentEl, scrollContainer); } scrollContainer.scrollBy(deltaX, deltaY); } // Tell the browser that we do not call event.preventDefault // See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners const options = { passive: true }; node.addEventListener('wheel', onWheel, options); return () => { node.removeEventListener('wheel', onWheel, options); }; }, [contentRef]); return contentRef ? effect : null; } /* harmony default export */ const use_popover_scroll = (usePopoverScroll); ;// ./node_modules/@wordpress/block-editor/build-module/utils/dom.js const BLOCK_SELECTOR = '.block-editor-block-list__block'; const APPENDER_SELECTOR = '.block-list-appender'; const BLOCK_APPENDER_CLASS = '.block-editor-button-block-appender'; /** * Returns true if two elements are contained within the same block. * * @param {Element} a First element. * @param {Element} b Second element. * * @return {boolean} Whether elements are in the same block. */ function isInSameBlock(a, b) { return a.closest(BLOCK_SELECTOR) === b.closest(BLOCK_SELECTOR); } /** * Returns true if an element is considered part of the block and not its inner * blocks or appender. * * @param {Element} blockElement Block container element. * @param {Element} element Element. * * @return {boolean} Whether an element is considered part of the block and not * its inner blocks or appender. */ function isInsideRootBlock(blockElement, element) { const parentBlock = element.closest([BLOCK_SELECTOR, APPENDER_SELECTOR, BLOCK_APPENDER_CLASS].join(',')); return parentBlock === blockElement; } /** * Finds the block client ID given any DOM node inside the block. * * @param {Node?} node DOM node. * * @return {string|undefined} Client ID or undefined if the node is not part of * a block. */ function getBlockClientId(node) { while (node && node.nodeType !== node.ELEMENT_NODE) { node = node.parentNode; } if (!node) { return; } const elementNode = /** @type {Element} */node; const blockNode = elementNode.closest(BLOCK_SELECTOR); if (!blockNode) { return; } return blockNode.id.slice('block-'.length); } /** * Calculates the union of two rectangles. * * @param {DOMRect} rect1 First rectangle. * @param {DOMRect} rect2 Second rectangle. * @return {DOMRect} Union of the two rectangles. */ function rectUnion(rect1, rect2) { const left = Math.min(rect1.left, rect2.left); const right = Math.max(rect1.right, rect2.right); const bottom = Math.max(rect1.bottom, rect2.bottom); const top = Math.min(rect1.top, rect2.top); return new window.DOMRectReadOnly(left, top, right - left, bottom - top); } /** * Returns whether an element is visible. * * @param {Element} element Element. * @return {boolean} Whether the element is visible. */ function isElementVisible(element) { const viewport = element.ownerDocument.defaultView; if (!viewport) { return false; } // Check for <VisuallyHidden> component. if (element.classList.contains('components-visually-hidden')) { return false; } const bounds = element.getBoundingClientRect(); if (bounds.width === 0 || bounds.height === 0) { return false; } // Older browsers, e.g. Safari < 17.4 may not support the `checkVisibility` method. if (element.checkVisibility) { return element.checkVisibility?.({ opacityProperty: true, contentVisibilityAuto: true, visibilityProperty: true }); } const style = viewport.getComputedStyle(element); if (style.display === 'none' || style.visibility === 'hidden' || style.opacity === '0') { return false; } return true; } /** * Checks if the element is scrollable. * * @param {Element} element Element. * @return {boolean} True if the element is scrollable. */ function isScrollable(element) { const style = window.getComputedStyle(element); return style.overflowX === 'auto' || style.overflowX === 'scroll' || style.overflowY === 'auto' || style.overflowY === 'scroll'; } const WITH_OVERFLOW_ELEMENT_BLOCKS = ['core/navigation']; /** * Returns the bounding rectangle of an element, with special handling for blocks * that have visible overflowing children (defined in WITH_OVERFLOW_ELEMENT_BLOCKS). * * For blocks like Navigation that can have overflowing elements (e.g. submenus), * this function calculates the combined bounds of both the parent and its visible * children. The returned rect may extend beyond the viewport. * The returned rect represents the full extent of the element and its visible * children, which may extend beyond the viewport. * * @param {Element} element Element. * @return {DOMRect} Bounding client rect of the element and its visible children. */ function getElementBounds(element) { const viewport = element.ownerDocument.defaultView; if (!viewport) { return new window.DOMRectReadOnly(); } let bounds = element.getBoundingClientRect(); const dataType = element.getAttribute('data-type'); /* * For blocks with overflowing elements (like Navigation), include the bounds * of visible children that extend beyond the parent container. */ if (dataType && WITH_OVERFLOW_ELEMENT_BLOCKS.includes(dataType)) { const stack = [element]; let currentElement; while (currentElement = stack.pop()) { // Children won’t affect bounds unless the element is not scrollable. if (!isScrollable(currentElement)) { for (const child of currentElement.children) { if (isElementVisible(child)) { const childBounds = child.getBoundingClientRect(); bounds = rectUnion(bounds, childBounds); stack.push(child); } } } } } /* * Take into account the outer horizontal limits of the container in which * an element is supposed to be "visible". For example, if an element is * positioned -10px to the left of the window x value (0), this function * discounts the negative overhang because it's not visible and therefore * not to be counted in the visibility calculations. Top and bottom values * are not accounted for to accommodate vertical scroll. */ const left = Math.max(bounds.left, 0); const right = Math.min(bounds.right, viewport.innerWidth); bounds = new window.DOMRectReadOnly(left, bounds.top, right - left, bounds.height); return bounds; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-popover/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER; function BlockPopover({ clientId, bottomClientId, children, __unstablePopoverSlot, __unstableContentRef, shift = true, ...props }, ref) { const selectedElement = useBlockElement(clientId); const lastSelectedElement = useBlockElement(bottomClientId !== null && bottomClientId !== void 0 ? bottomClientId : clientId); const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, use_popover_scroll(__unstableContentRef)]); const [popoverDimensionsRecomputeCounter, forceRecomputePopoverDimensions] = (0,external_wp_element_namespaceObject.useReducer)( // Module is there to make sure that the counter doesn't overflow. s => (s + 1) % MAX_POPOVER_RECOMPUTE_COUNTER, 0); // When blocks are moved up/down, they are animated to their new position by // updating the `transform` property manually (i.e. without using CSS // transitions or animations). The animation, which can also scroll the block // editor, can sometimes cause the position of the Popover to get out of sync. // A MutationObserver is therefore used to make sure that changes to the // selectedElement's attribute (i.e. `transform`) can be tracked and used to // trigger the Popover to rerender. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (!selectedElement) { return; } const observer = new window.MutationObserver(forceRecomputePopoverDimensions); observer.observe(selectedElement, { attributes: true }); return () => { observer.disconnect(); }; }, [selectedElement]); const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => { if ( // popoverDimensionsRecomputeCounter is by definition always equal or greater // than 0. This check is only there to satisfy the correctness of the // exhaustive-deps rule for the `useMemo` hook. popoverDimensionsRecomputeCounter < 0 || !selectedElement || bottomClientId && !lastSelectedElement) { return undefined; } return { getBoundingClientRect() { return lastSelectedElement ? rectUnion(getElementBounds(selectedElement), getElementBounds(lastSelectedElement)) : getElementBounds(selectedElement); }, contextElement: selectedElement }; }, [popoverDimensionsRecomputeCounter, selectedElement, bottomClientId, lastSelectedElement]); if (!selectedElement || bottomClientId && !lastSelectedElement) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { ref: mergedRefs, animate: false, focusOnMount: false, anchor: popoverAnchor // Render in the old slot if needed for backward compatibility, // otherwise render in place (not in the default popover slot). , __unstableSlotName: __unstablePopoverSlot, inline: !__unstablePopoverSlot, placement: "top-start", resize: false, flip: false, shift: shift, ...props, className: dist_clsx('block-editor-block-popover', props.className), variant: "unstyled", children: children }); } const PrivateBlockPopover = (0,external_wp_element_namespaceObject.forwardRef)(BlockPopover); const PublicBlockPopover = ({ clientId, bottomClientId, children, ...props }, ref) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockPopover, { ...props, bottomClientId: bottomClientId, clientId: clientId, __unstableContentRef: undefined, __unstablePopoverSlot: undefined, ref: ref, children: children }); /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-popover/README.md */ /* harmony default export */ const block_popover = ((0,external_wp_element_namespaceObject.forwardRef)(PublicBlockPopover)); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-popover/cover.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockPopoverCover({ clientId, bottomClientId, children, shift = false, additionalStyles, ...props }, ref) { var _bottomClientId; (_bottomClientId = bottomClientId) !== null && _bottomClientId !== void 0 ? _bottomClientId : bottomClientId = clientId; const selectedElement = useBlockElement(clientId); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockPopover, { ref: ref, clientId: clientId, bottomClientId: bottomClientId, shift: shift, ...props, children: selectedElement && clientId === bottomClientId ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverContainer, { selectedElement: selectedElement, additionalStyles: additionalStyles, children: children }) : children }); } function CoverContainer({ selectedElement, additionalStyles = {}, children }) { const [width, setWidth] = (0,external_wp_element_namespaceObject.useState)(selectedElement.offsetWidth); const [height, setHeight] = (0,external_wp_element_namespaceObject.useState)(selectedElement.offsetHeight); (0,external_wp_element_namespaceObject.useEffect)(() => { const observer = new window.ResizeObserver(() => { setWidth(selectedElement.offsetWidth); setHeight(selectedElement.offsetHeight); }); observer.observe(selectedElement, { box: 'border-box' }); return () => observer.disconnect(); }, [selectedElement]); const style = (0,external_wp_element_namespaceObject.useMemo)(() => { return { position: 'absolute', width, height, ...additionalStyles }; }, [width, height, additionalStyles]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: style, children: children }); } /* harmony default export */ const cover = ((0,external_wp_element_namespaceObject.forwardRef)(BlockPopoverCover)); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/spacing-visualizer.js /** * WordPress dependencies */ /** * Internal dependencies */ function SpacingVisualizer({ clientId, value, computeStyle, forceShow }) { const blockElement = useBlockElement(clientId); const [style, updateStyle] = (0,external_wp_element_namespaceObject.useReducer)(() => computeStyle(blockElement)); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (!blockElement) { return; } // It's not sufficient to read the computed spacing value when value.spacing changes as // useEffect may run before the browser recomputes CSS. We therefore combine // useLayoutEffect and two rAF calls to ensure that we read the spacing after the current // paint but before the next paint. // See https://github.com/WordPress/gutenberg/pull/59227. window.requestAnimationFrame(() => window.requestAnimationFrame(updateStyle)); }, [blockElement, value]); const previousValueRef = (0,external_wp_element_namespaceObject.useRef)(value); const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { if (external_wp_isShallowEqual_default()(value, previousValueRef.current) || forceShow) { return; } setIsActive(true); previousValueRef.current = value; const timeout = setTimeout(() => { setIsActive(false); }, 400); return () => { setIsActive(false); clearTimeout(timeout); }; }, [value, forceShow]); if (!isActive && !forceShow) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(cover, { clientId: clientId, __unstablePopoverSlot: "block-toolbar", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor__spacing-visualizer", style: style }) }); } function getComputedCSS(element, property) { return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property); } function MarginVisualizer({ clientId, value, forceShow }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingVisualizer, { clientId: clientId, value: value?.spacing?.margin, computeStyle: blockElement => { const top = getComputedCSS(blockElement, 'margin-top'); const right = getComputedCSS(blockElement, 'margin-right'); const bottom = getComputedCSS(blockElement, 'margin-bottom'); const left = getComputedCSS(blockElement, 'margin-left'); return { borderTopWidth: top, borderRightWidth: right, borderBottomWidth: bottom, borderLeftWidth: left, top: top ? `-${top}` : 0, right: right ? `-${right}` : 0, bottom: bottom ? `-${bottom}` : 0, left: left ? `-${left}` : 0 }; }, forceShow: forceShow }); } function PaddingVisualizer({ clientId, value, forceShow }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacingVisualizer, { clientId: clientId, value: value?.spacing?.padding, computeStyle: blockElement => ({ borderTopWidth: getComputedCSS(blockElement, 'padding-top'), borderRightWidth: getComputedCSS(blockElement, 'padding-right'), borderBottomWidth: getComputedCSS(blockElement, 'padding-bottom'), borderLeftWidth: getComputedCSS(blockElement, 'padding-left') }), forceShow: forceShow }); } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/dimensions.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const DIMENSIONS_SUPPORT_KEY = 'dimensions'; const SPACING_SUPPORT_KEY = 'spacing'; const dimensions_ALL_SIDES = (/* unused pure expression or super */ null && (['top', 'right', 'bottom', 'left'])); const dimensions_AXIAL_SIDES = (/* unused pure expression or super */ null && (['vertical', 'horizontal'])); function useVisualizer() { const [property, setProperty] = (0,external_wp_element_namespaceObject.useState)(false); const { hideBlockInterface, showBlockInterface } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!property) { showBlockInterface(); } else { hideBlockInterface(); } }, [property, showBlockInterface, hideBlockInterface]); return [property, setProperty]; } function DimensionsInspectorControl({ children, resetAllFilter }) { const attributesResetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(attributes => { const existingStyle = attributes.style; const updatedStyle = resetAllFilter(existingStyle); return { ...attributes, style: updatedStyle }; }, [resetAllFilter]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { group: "dimensions", resetAllFilter: attributesResetAllFilter, children: children }); } function dimensions_DimensionsPanel({ clientId, name, setAttributes, settings }) { const isEnabled = useHasDimensionsPanel(settings); const value = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlockAttributes(clientId)?.style, [clientId]); const [visualizedProperty, setVisualizedProperty] = useVisualizer(); const onChange = newStyle => { setAttributes({ style: utils_cleanEmptyObject(newStyle) }); }; if (!isEnabled) { return null; } const defaultDimensionsControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [DIMENSIONS_SUPPORT_KEY, '__experimentalDefaultControls']); const defaultSpacingControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, [SPACING_SUPPORT_KEY, '__experimentalDefaultControls']); const defaultControls = { ...defaultDimensionsControls, ...defaultSpacingControls }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionsPanel, { as: DimensionsInspectorControl, panelId: clientId, settings: settings, value: value, onChange: onChange, defaultControls: defaultControls, onVisualize: setVisualizedProperty }), !!settings?.spacing?.padding && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaddingVisualizer, { forceShow: visualizedProperty === 'padding', clientId: clientId, value: value }), !!settings?.spacing?.margin && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MarginVisualizer, { forceShow: visualizedProperty === 'margin', clientId: clientId, value: value })] }); } /** * Determine whether there is block support for dimensions. * * @param {string} blockName Block name. * @param {string} feature Background image feature to check for. * * @return {boolean} Whether there is support. */ function hasDimensionsSupport(blockName, feature = 'any') { if (external_wp_element_namespaceObject.Platform.OS !== 'web') { return false; } const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, DIMENSIONS_SUPPORT_KEY); if (support === true) { return true; } if (feature === 'any') { return !!(support?.aspectRatio || !!support?.minHeight); } return !!support?.[feature]; } /* harmony default export */ const dimensions = ({ useBlockProps: dimensions_useBlockProps, attributeKeys: ['minHeight', 'style'], hasSupport(name) { return hasDimensionsSupport(name, 'aspectRatio'); } }); function dimensions_useBlockProps({ name, minHeight, style }) { if (!hasDimensionsSupport(name, 'aspectRatio') || shouldSkipSerialization(name, DIMENSIONS_SUPPORT_KEY, 'aspectRatio')) { return {}; } const className = dist_clsx({ 'has-aspect-ratio': !!style?.dimensions?.aspectRatio }); // Allow dimensions-based inline style overrides to override any global styles rules that // might be set for the block, and therefore affect the display of the aspect ratio. const inlineStyleOverrides = {}; // Apply rules to unset incompatible styles. // Note that a set `aspectRatio` will win out if both an aspect ratio and a minHeight are set. // This is because the aspect ratio is a newer block support, so (in theory) any aspect ratio // that is set should be intentional and should override any existing minHeight. The Cover block // and dimensions controls have logic that will manually clear the aspect ratio if a minHeight // is set. if (style?.dimensions?.aspectRatio) { // To ensure the aspect ratio does not get overridden by `minHeight` unset any existing rule. inlineStyleOverrides.minHeight = 'unset'; } else if (minHeight || style?.dimensions?.minHeight) { // To ensure the minHeight does not get overridden by `aspectRatio` unset any existing rule. inlineStyleOverrides.aspectRatio = 'unset'; } return { className, style: inlineStyleOverrides }; } /** * @deprecated */ function useCustomSides() { external_wp_deprecated_default()('wp.blockEditor.__experimentalUseCustomSides', { since: '6.3', version: '6.4' }); } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/style.js /** * WordPress dependencies */ /** * Internal dependencies */ const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, DIMENSIONS_SUPPORT_KEY, BACKGROUND_SUPPORT_KEY, SPACING_SUPPORT_KEY, SHADOW_SUPPORT_KEY]; const hasStyleSupport = nameOrType => styleSupportKeys.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, key)); /** * Returns the inline styles to add depending on the style object * * @param {Object} styles Styles configuration. * * @return {Object} Flattened CSS variables declaration. */ function getInlineStyles(styles = {}) { const output = {}; // The goal is to move everything to server side generated engine styles // This is temporary as we absorb more and more styles into the engine. (0,external_wp_styleEngine_namespaceObject.getCSSRules)(styles).forEach(rule => { output[rule.key] = rule.value; }); return output; } /** * Filters registered block settings, extending attributes to include `style` attribute. * * @param {Object} settings Original block settings. * * @return {Object} Filtered block settings. */ function style_addAttribute(settings) { if (!hasStyleSupport(settings)) { return settings; } // Allow blocks to specify their own attribute definition with default values if needed. if (!settings.attributes.style) { Object.assign(settings.attributes, { style: { type: 'object' } }); } return settings; } /** * A dictionary of paths to flag skipping block support serialization as the key, * with values providing the style paths to be omitted from serialization. * * @constant * @type {Record<string, string[]>} */ const skipSerializationPathsEdit = { [`${BORDER_SUPPORT_KEY}.__experimentalSkipSerialization`]: ['border'], [`${COLOR_SUPPORT_KEY}.__experimentalSkipSerialization`]: [COLOR_SUPPORT_KEY], [`${TYPOGRAPHY_SUPPORT_KEY}.__experimentalSkipSerialization`]: [TYPOGRAPHY_SUPPORT_KEY], [`${DIMENSIONS_SUPPORT_KEY}.__experimentalSkipSerialization`]: [DIMENSIONS_SUPPORT_KEY], [`${SPACING_SUPPORT_KEY}.__experimentalSkipSerialization`]: [SPACING_SUPPORT_KEY], [`${SHADOW_SUPPORT_KEY}.__experimentalSkipSerialization`]: [SHADOW_SUPPORT_KEY] }; /** * A dictionary of paths to flag skipping block support serialization as the key, * with values providing the style paths to be omitted from serialization. * * Extends the Edit skip paths to enable skipping additional paths in just * the Save component. This allows a block support to be serialized within the * editor, while using an alternate approach, such as server-side rendering, when * the support is saved. * * @constant * @type {Record<string, string[]>} */ const skipSerializationPathsSave = { ...skipSerializationPathsEdit, [`${DIMENSIONS_SUPPORT_KEY}.aspectRatio`]: [`${DIMENSIONS_SUPPORT_KEY}.aspectRatio`], // Skip serialization of aspect ratio in save mode. [`${BACKGROUND_SUPPORT_KEY}`]: [BACKGROUND_SUPPORT_KEY] // Skip serialization of background support in save mode. }; const skipSerializationPathsSaveChecks = { [`${DIMENSIONS_SUPPORT_KEY}.aspectRatio`]: true, [`${BACKGROUND_SUPPORT_KEY}`]: true }; /** * A dictionary used to normalize feature names between support flags, style * object properties and __experimentSkipSerialization configuration arrays. * * This allows not having to provide a migration for a support flag and possible * backwards compatibility bridges, while still achieving consistency between * the support flag and the skip serialization array. * * @constant * @type {Record<string, string>} */ const renamedFeatures = { gradients: 'gradient' }; /** * A utility function used to remove one or more paths from a style object. * Works in a way similar to Lodash's `omit()`. See unit tests and examples below. * * It supports a single string path: * * ``` * omitStyle( { color: 'red' }, 'color' ); // {} * ``` * * or an array of paths: * * ``` * omitStyle( { color: 'red', background: '#fff' }, [ 'color', 'background' ] ); // {} * ``` * * It also allows you to specify paths at multiple levels in a string. * * ``` * omitStyle( { typography: { textDecoration: 'underline' } }, 'typography.textDecoration' ); // {} * ``` * * You can remove multiple paths at the same time: * * ``` * omitStyle( * { * typography: { * textDecoration: 'underline', * textTransform: 'uppercase', * } * }, * [ * 'typography.textDecoration', * 'typography.textTransform', * ] * ); * // {} * ``` * * You can also specify nested paths as arrays: * * ``` * omitStyle( * { * typography: { * textDecoration: 'underline', * textTransform: 'uppercase', * } * }, * [ * [ 'typography', 'textDecoration' ], * [ 'typography', 'textTransform' ], * ] * ); * // {} * ``` * * With regards to nesting of styles, infinite depth is supported: * * ``` * omitStyle( * { * border: { * radius: { * topLeft: '10px', * topRight: '0.5rem', * } * } * }, * [ * [ 'border', 'radius', 'topRight' ], * ] * ); * // { border: { radius: { topLeft: '10px' } } } * ``` * * The third argument, `preserveReference`, defines how to treat the input style object. * It is mostly necessary to properly handle mutation when recursively handling the style object. * Defaulting to `false`, this will always create a new object, avoiding to mutate `style`. * However, when recursing, we change that value to `true` in order to work with a single copy * of the original style object. * * @see https://lodash.com/docs/4.17.15#omit * * @param {Object} style Styles object. * @param {Array|string} paths Paths to remove. * @param {boolean} preserveReference True to mutate the `style` object, false otherwise. * @return {Object} Styles object with the specified paths removed. */ function omitStyle(style, paths, preserveReference = false) { if (!style) { return style; } let newStyle = style; if (!preserveReference) { newStyle = JSON.parse(JSON.stringify(style)); } if (!Array.isArray(paths)) { paths = [paths]; } paths.forEach(path => { if (!Array.isArray(path)) { path = path.split('.'); } if (path.length > 1) { const [firstSubpath, ...restPath] = path; omitStyle(newStyle[firstSubpath], [restPath], true); } else if (path.length === 1) { delete newStyle[path[0]]; } }); return newStyle; } /** * Override props assigned to save component to inject the CSS variables definition. * * @param {Object} props Additional props applied to save element. * @param {Object|string} blockNameOrType Block type. * @param {Object} attributes Block attributes. * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization. * * @return {Object} Filtered props applied to save element. */ function style_addSaveProps(props, blockNameOrType, attributes, skipPaths = skipSerializationPathsSave) { if (!hasStyleSupport(blockNameOrType)) { return props; } let { style } = attributes; Object.entries(skipPaths).forEach(([indicator, path]) => { const skipSerialization = skipSerializationPathsSaveChecks[indicator] || (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockNameOrType, indicator); if (skipSerialization === true) { style = omitStyle(style, path); } if (Array.isArray(skipSerialization)) { skipSerialization.forEach(featureName => { const feature = renamedFeatures[featureName] || featureName; style = omitStyle(style, [[...path, feature]]); }); } }); props.style = { ...getInlineStyles(style), ...props.style }; return props; } function BlockStyleControls({ clientId, name, setAttributes, __unstableParentLayout }) { const settings = useBlockSettings(name, __unstableParentLayout); const blockEditingMode = useBlockEditingMode(); const passedProps = { clientId, name, setAttributes, settings: { ...settings, typography: { ...settings.typography, // The text alignment UI for individual blocks is rendered in // the block toolbar, so disable it here. textAlign: false } } }; if (blockEditingMode !== 'default') { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorEdit, { ...passedProps }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(background_BackgroundImagePanel, { ...passedProps }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(typography_TypographyPanel, { ...passedProps }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(border_BorderPanel, { ...passedProps }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dimensions_DimensionsPanel, { ...passedProps })] }); } /* harmony default export */ const style = ({ edit: BlockStyleControls, hasSupport: hasStyleSupport, addSaveProps: style_addSaveProps, attributeKeys: ['style'], useBlockProps: style_useBlockProps }); // Defines which element types are supported, including their hover styles or // any other elements that have been included under a single element type // e.g. heading and h1-h6. const elementTypes = [{ elementType: 'button' }, { elementType: 'link', pseudo: [':hover'] }, { elementType: 'heading', elements: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] }]; // Used for generating the instance ID const STYLE_BLOCK_PROPS_REFERENCE = {}; function style_useBlockProps({ name, style }) { const blockElementsContainerIdentifier = (0,external_wp_compose_namespaceObject.useInstanceId)(STYLE_BLOCK_PROPS_REFERENCE, 'wp-elements'); const baseElementSelector = `.${blockElementsContainerIdentifier}`; const blockElementStyles = style?.elements; const styles = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!blockElementStyles) { return; } const elementCSSRules = []; elementTypes.forEach(({ elementType, pseudo, elements }) => { const skipSerialization = shouldSkipSerialization(name, COLOR_SUPPORT_KEY, elementType); if (skipSerialization) { return; } const elementStyles = blockElementStyles?.[elementType]; // Process primary element type styles. if (elementStyles) { const selector = scopeSelector(baseElementSelector, external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[elementType]); elementCSSRules.push((0,external_wp_styleEngine_namespaceObject.compileCSS)(elementStyles, { selector })); // Process any interactive states for the element type. if (pseudo) { pseudo.forEach(pseudoSelector => { if (elementStyles[pseudoSelector]) { elementCSSRules.push((0,external_wp_styleEngine_namespaceObject.compileCSS)(elementStyles[pseudoSelector], { selector: scopeSelector(baseElementSelector, `${external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[elementType]}${pseudoSelector}`) })); } }); } } // Process related elements e.g. h1-h6 for headings if (elements) { elements.forEach(element => { if (blockElementStyles[element]) { elementCSSRules.push((0,external_wp_styleEngine_namespaceObject.compileCSS)(blockElementStyles[element], { selector: scopeSelector(baseElementSelector, external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[element]) })); } }); } }); return elementCSSRules.length > 0 ? elementCSSRules.join('') : undefined; }, [baseElementSelector, blockElementStyles, name]); useStyleOverride({ css: styles }); return style_addSaveProps({ className: blockElementsContainerIdentifier }, name, { style }, skipSerializationPathsEdit); } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/style/addAttribute', style_addAttribute); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/settings.js /** * WordPress dependencies */ const hasSettingsSupport = blockType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, '__experimentalSettings', false); function settings_addAttribute(settings) { if (!hasSettingsSupport(settings)) { return settings; } // Allow blocks to specify their own attribute definition with default values if needed. if (!settings?.attributes?.settings) { settings.attributes = { ...settings.attributes, settings: { type: 'object' } }; } return settings; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/settings/addAttribute', settings_addAttribute); ;// ./node_modules/@wordpress/icons/build-module/library/filter.js /** * WordPress dependencies */ const filter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z" }) }); /* harmony default export */ const library_filter = (filter); ;// ./node_modules/@wordpress/block-editor/build-module/components/duotone-control/index.js /** * WordPress dependencies */ function DuotoneControl({ id: idProp, colorPalette, duotonePalette, disableCustomColors, disableCustomDuotone, value, onChange }) { let toolbarIcon; if (value === 'unset') { toolbarIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorIndicator, { className: "block-editor-duotone-control__unset-indicator" }); } else if (value) { toolbarIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DuotoneSwatch, { values: value }); } else { toolbarIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_filter }); } const actionLabel = (0,external_wp_i18n_namespaceObject.__)('Apply duotone filter'); const id = (0,external_wp_compose_namespaceObject.useInstanceId)(DuotoneControl, 'duotone-control', idProp); const descriptionId = `${id}__description`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: { className: 'block-editor-duotone-control__popover', headerTitle: (0,external_wp_i18n_namespaceObject.__)('Duotone') }, renderToggle: ({ isOpen, onToggle }) => { const openOnArrowDown = event => { if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { event.preventDefault(); onToggle(); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { showTooltip: true, onClick: onToggle, "aria-haspopup": "true", "aria-expanded": isOpen, onKeyDown: openOnArrowDown, label: actionLabel, icon: toolbarIcon }); }, renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Duotone'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('Create a two-tone color effect without losing your original image.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DuotonePicker, { "aria-label": actionLabel, "aria-describedby": descriptionId, colorPalette: colorPalette, duotonePalette: duotonePalette, disableCustomColors: disableCustomColors, disableCustomDuotone: disableCustomDuotone, value: value, onChange: onChange })] }) }); } /* harmony default export */ const duotone_control = (DuotoneControl); ;// ./node_modules/@wordpress/block-editor/build-module/components/duotone/utils.js /** * External dependencies */ /** * Convert a list of colors to an object of R, G, and B values. * * @param {string[]} colors Array of RBG color strings. * * @return {Object} R, G, and B values. */ function getValuesFromColors(colors = []) { const values = { r: [], g: [], b: [], a: [] }; colors.forEach(color => { const rgbColor = w(color).toRgb(); values.r.push(rgbColor.r / 255); values.g.push(rgbColor.g / 255); values.b.push(rgbColor.b / 255); values.a.push(rgbColor.a); }); return values; } /** * Stylesheet for disabling a global styles duotone filter. * * @param {string} selector Selector to disable the filter for. * * @return {string} Filter none style. */ function getDuotoneUnsetStylesheet(selector) { return `${selector}{filter:none}`; } /** * SVG and stylesheet needed for rendering the duotone filter. * * @param {string} selector Selector to apply the filter to. * @param {string} id Unique id for this duotone filter. * * @return {string} Duotone filter style. */ function getDuotoneStylesheet(selector, id) { return `${selector}{filter:url(#${id})}`; } /** * The SVG part of the duotone filter. * * @param {string} id Unique id for this duotone filter. * @param {string[]} colors Color strings from dark to light. * * @return {string} Duotone SVG. */ function getDuotoneFilter(id, colors) { const values = getValuesFromColors(colors); return ` <svg xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 0 0" width="0" height="0" focusable="false" role="none" aria-hidden="true" style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;" > <defs> <filter id="${id}"> <!-- Use sRGB instead of linearRGB so transparency looks correct. Use perceptual brightness to convert to grayscale. --> <feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix> <!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --> <feComponentTransfer color-interpolation-filters="sRGB"> <feFuncR type="table" tableValues="${values.r.join(' ')}"></feFuncR> <feFuncG type="table" tableValues="${values.g.join(' ')}"></feFuncG> <feFuncB type="table" tableValues="${values.b.join(' ')}"></feFuncB> <feFuncA type="table" tableValues="${values.a.join(' ')}"></feFuncA> </feComponentTransfer> <!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. --> <feComposite in2="SourceGraphic" operator="in"></feComposite> </filter> </defs> </svg>`; } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/get-block-css-selector.js /** * Internal dependencies */ /** * Determine the CSS selector for the block type and target provided, returning * it if available. * * @param {import('@wordpress/blocks').Block} blockType The block's type. * @param {string|string[]} target The desired selector's target e.g. `root`, delimited string, or array path. * @param {Object} options Options object. * @param {boolean} options.fallback Whether or not to fallback to broader selector. * * @return {?string} The CSS selector or `null` if no selector available. */ function getBlockCSSSelector(blockType, target = 'root', options = {}) { if (!target) { return null; } const { fallback = false } = options; const { name, selectors, supports } = blockType; const hasSelectors = selectors && Object.keys(selectors).length > 0; const path = Array.isArray(target) ? target.join('.') : target; // Root selector. // Calculated before returning as it can be used as a fallback for feature // selectors later on. let rootSelector = null; if (hasSelectors && selectors.root) { // Use the selectors API if available. rootSelector = selectors?.root; } else if (supports?.__experimentalSelector) { // Use the old experimental selector supports property if set. rootSelector = supports.__experimentalSelector; } else { // If no root selector found, generate default block class selector. rootSelector = '.wp-block-' + name.replace('core/', '').replace('/', '-'); } // Return selector if it's the root target we are looking for. if (path === 'root') { return rootSelector; } // If target is not `root` or `duotone` we have a feature or subfeature // as the target. If the target is a string convert to an array. const pathArray = Array.isArray(target) ? target : target.split('.'); // Feature selectors ( may fallback to root selector ); if (pathArray.length === 1) { const fallbackSelector = fallback ? rootSelector : null; // Prefer the selectors API if available. if (hasSelectors) { // Get selector from either `feature.root` or shorthand path. const featureSelector = getValueFromObjectPath(selectors, `${path}.root`, null) || getValueFromObjectPath(selectors, path, null); // Return feature selector if found or any available fallback. return featureSelector || fallbackSelector; } // Try getting old experimental supports selector value. const featureSelector = getValueFromObjectPath(supports, `${path}.__experimentalSelector`, null); // If nothing to work with, provide fallback selector if available. if (!featureSelector) { return fallbackSelector; } // Scope the feature selector by the block's root selector. return scopeSelector(rootSelector, featureSelector); } // Subfeature selector. // This may fallback either to parent feature or root selector. let subfeatureSelector; // Use selectors API if available. if (hasSelectors) { subfeatureSelector = getValueFromObjectPath(selectors, path, null); } // Only return if we have a subfeature selector. if (subfeatureSelector) { return subfeatureSelector; } // To this point we don't have a subfeature selector. If a fallback has been // requested, remove subfeature from target path and return results of a // call for the parent feature's selector. if (fallback) { return getBlockCSSSelector(blockType, pathArray[0], options); } // We tried. return null; } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/filters-panel.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const filters_panel_EMPTY_ARRAY = []; function useMultiOriginColorPresets(settings, { presetSetting, defaultSetting }) { const disableDefault = !settings?.color?.[defaultSetting]; const userPresets = settings?.color?.[presetSetting]?.custom || filters_panel_EMPTY_ARRAY; const themePresets = settings?.color?.[presetSetting]?.theme || filters_panel_EMPTY_ARRAY; const defaultPresets = settings?.color?.[presetSetting]?.default || filters_panel_EMPTY_ARRAY; return (0,external_wp_element_namespaceObject.useMemo)(() => [...userPresets, ...themePresets, ...(disableDefault ? filters_panel_EMPTY_ARRAY : defaultPresets)], [disableDefault, userPresets, themePresets, defaultPresets]); } function useHasFiltersPanel(settings) { return useHasDuotoneControl(settings); } function useHasDuotoneControl(settings) { return settings.color.customDuotone || settings.color.defaultDuotone || settings.color.duotone.length > 0; } function FiltersToolsPanel({ resetAllFilter, onChange, value, panelId, children }) { const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const resetAll = () => { const updatedValue = resetAllFilter(value); onChange(updatedValue); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject._x)('Filters', 'Name for applying graphical effects'), resetAll: resetAll, panelId: panelId, dropdownMenuProps: dropdownMenuProps, children: children }); } const filters_panel_DEFAULT_CONTROLS = { duotone: true }; const filters_panel_popoverProps = { placement: 'left-start', offset: 36, shift: true, className: 'block-editor-duotone-control__popover', headerTitle: (0,external_wp_i18n_namespaceObject.__)('Duotone') }; const LabeledColorIndicator = ({ indicator, label }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalZStack, { isLayered: false, offset: -8, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Flex, { expanded: false, children: indicator === 'unset' || !indicator ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorIndicator, { className: "block-editor-duotone-control__unset-indicator" }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DuotoneSwatch, { values: indicator }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { title: label, children: label })] }); const renderToggle = (duotone, resetDuotone) => ({ onToggle, isOpen }) => { const duotoneButtonRef = (0,external_wp_element_namespaceObject.useRef)(undefined); const toggleProps = { onClick: onToggle, className: dist_clsx({ 'is-open': isOpen }), 'aria-expanded': isOpen, ref: duotoneButtonRef }; const removeButtonProps = { onClick: () => { if (isOpen) { onToggle(); } resetDuotone(); // Return focus to parent button. duotoneButtonRef.current?.focus(); }, className: 'block-editor-panel-duotone-settings__reset', label: (0,external_wp_i18n_namespaceObject.__)('Reset') }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ...toggleProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LabeledColorIndicator, { indicator: duotone, label: (0,external_wp_i18n_namespaceObject.__)('Duotone') }) }), duotone && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "small", icon: library_reset, ...removeButtonProps })] }); }; function FiltersPanel({ as: Wrapper = FiltersToolsPanel, value, onChange, inheritedValue = value, settings, panelId, defaultControls = filters_panel_DEFAULT_CONTROLS }) { const decodeValue = rawValue => getValueFromVariable({ settings }, '', rawValue); // Duotone const hasDuotoneEnabled = useHasDuotoneControl(settings); const duotonePalette = useMultiOriginColorPresets(settings, { presetSetting: 'duotone', defaultSetting: 'defaultDuotone' }); const colorPalette = useMultiOriginColorPresets(settings, { presetSetting: 'palette', defaultSetting: 'defaultPalette' }); const duotone = decodeValue(inheritedValue?.filter?.duotone); const setDuotone = newValue => { const duotonePreset = duotonePalette.find(({ colors }) => { return colors === newValue; }); const duotoneValue = duotonePreset ? `var:preset|duotone|${duotonePreset.slug}` : newValue; onChange(setImmutably(value, ['filter', 'duotone'], duotoneValue)); }; const hasDuotone = () => !!value?.filter?.duotone; const resetDuotone = () => setDuotone(undefined); const resetAllFilter = (0,external_wp_element_namespaceObject.useCallback)(previousValue => { return { ...previousValue, filter: { ...previousValue.filter, duotone: undefined } }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, { resetAllFilter: resetAllFilter, value: value, onChange: onChange, panelId: panelId, children: hasDuotoneEnabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Duotone'), hasValue: hasDuotone, onDeselect: resetDuotone, isShownByDefault: defaultControls.duotone, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: filters_panel_popoverProps, className: "block-editor-global-styles-filters-panel__dropdown", renderToggle: renderToggle(duotone, resetDuotone), renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { paddingSize: "small", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Duotone'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('Create a two-tone color effect without losing your original image.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DuotonePicker, { colorPalette: colorPalette, duotonePalette: duotonePalette // TODO: Re-enable both when custom colors are supported for block-level styles. , disableCustomColors: true, disableCustomDuotone: true, value: duotone, onChange: setDuotone })] }) }) }) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/duotone.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const duotone_EMPTY_ARRAY = []; // Safari does not always update the duotone filter when the duotone colors // are changed. This browser check is later used to force a re-render of the block // element to ensure the duotone filter is updated. The check is included at the // root of this file as it only needs to be run once per page load. const isSafari = window?.navigator.userAgent && window.navigator.userAgent.includes('Safari') && !window.navigator.userAgent.includes('Chrome') && !window.navigator.userAgent.includes('Chromium'); k([names]); function useMultiOriginPresets({ presetSetting, defaultSetting }) { const [enableDefault, userPresets, themePresets, defaultPresets] = use_settings_useSettings(defaultSetting, `${presetSetting}.custom`, `${presetSetting}.theme`, `${presetSetting}.default`); return (0,external_wp_element_namespaceObject.useMemo)(() => [...(userPresets || duotone_EMPTY_ARRAY), ...(themePresets || duotone_EMPTY_ARRAY), ...(enableDefault && defaultPresets || duotone_EMPTY_ARRAY)], [enableDefault, userPresets, themePresets, defaultPresets]); } function getColorsFromDuotonePreset(duotone, duotonePalette) { if (!duotone) { return; } const preset = duotonePalette?.find(({ slug }) => { return duotone === `var:preset|duotone|${slug}`; }); return preset ? preset.colors : undefined; } function getDuotonePresetFromColors(colors, duotonePalette) { if (!colors || !Array.isArray(colors)) { return; } const preset = duotonePalette?.find(duotonePreset => { return duotonePreset?.colors?.every((val, index) => val === colors[index]); }); return preset ? `var:preset|duotone|${preset.slug}` : undefined; } function DuotonePanelPure({ style, setAttributes, name }) { const duotoneStyle = style?.color?.duotone; const settings = useBlockSettings(name); const blockEditingMode = useBlockEditingMode(); const duotonePalette = useMultiOriginPresets({ presetSetting: 'color.duotone', defaultSetting: 'color.defaultDuotone' }); const colorPalette = useMultiOriginPresets({ presetSetting: 'color.palette', defaultSetting: 'color.defaultPalette' }); const [enableCustomColors, enableCustomDuotone] = use_settings_useSettings('color.custom', 'color.customDuotone'); const disableCustomColors = !enableCustomColors; const disableCustomDuotone = !enableCustomDuotone || colorPalette?.length === 0 && disableCustomColors; if (duotonePalette?.length === 0 && disableCustomDuotone) { return null; } if (blockEditingMode !== 'default') { return null; } const duotonePresetOrColors = !Array.isArray(duotoneStyle) ? getColorsFromDuotonePreset(duotoneStyle, duotonePalette) : duotoneStyle; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { group: "filter", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FiltersPanel, { value: { filter: { duotone: duotonePresetOrColors } }, onChange: newDuotone => { const newStyle = { ...style, color: { ...newDuotone?.filter } }; setAttributes({ style: newStyle }); }, settings: settings }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls, { group: "block", __experimentalShareWithChildBlocks: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(duotone_control, { duotonePalette: duotonePalette, colorPalette: colorPalette, disableCustomDuotone: disableCustomDuotone, disableCustomColors: disableCustomColors, value: duotonePresetOrColors, onChange: newDuotone => { const maybePreset = getDuotonePresetFromColors(newDuotone, duotonePalette); const newStyle = { ...style, color: { ...style?.color, duotone: maybePreset !== null && maybePreset !== void 0 ? maybePreset : newDuotone // use preset or fallback to custom colors. } }; setAttributes({ style: newStyle }); }, settings: settings }) })] }); } /* harmony default export */ const duotone = ({ shareWithChildBlocks: true, edit: DuotonePanelPure, useBlockProps: duotone_useBlockProps, attributeKeys: ['style'], hasSupport(name) { return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, 'filter.duotone'); } }); /** * Filters registered block settings, extending attributes to include * the `duotone` attribute. * * @param {Object} settings Original block settings. * * @return {Object} Filtered block settings. */ function addDuotoneAttributes(settings) { // Previous `color.__experimentalDuotone` support flag is migrated via // block_type_metadata_settings filter in `lib/block-supports/duotone.php`. if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'filter.duotone')) { return settings; } // Allow blocks to specify their own attribute definition with default // values if needed. if (!settings.attributes.style) { Object.assign(settings.attributes, { style: { type: 'object' } }); } return settings; } function useDuotoneStyles({ clientId, id: filterId, selector: duotoneSelector, attribute: duotoneAttr }) { const duotonePalette = useMultiOriginPresets({ presetSetting: 'color.duotone', defaultSetting: 'color.defaultDuotone' }); // Possible values for duotone attribute: // 1. Array of colors - e.g. ['#000000', '#ffffff']. // 2. Variable for an existing Duotone preset - e.g. 'var:preset|duotone|green-blue' or 'var(--wp--preset--duotone--green-blue)'' // 3. A CSS string - e.g. 'unset' to remove globally applied duotone. const isCustom = Array.isArray(duotoneAttr); const duotonePreset = isCustom ? undefined : getColorsFromDuotonePreset(duotoneAttr, duotonePalette); const isPreset = typeof duotoneAttr === 'string' && duotonePreset; const isCSS = typeof duotoneAttr === 'string' && !isPreset; // Match the structure of WP_Duotone_Gutenberg::render_duotone_support() in PHP. let colors = null; if (isPreset) { // Array of colors. colors = duotonePreset; } else if (isCSS) { // CSS filter property string (e.g. 'unset'). colors = duotoneAttr; } else if (isCustom) { // Array of colors. colors = duotoneAttr; } // Build the CSS selectors to which the filter will be applied. const selectors = duotoneSelector.split(','); const selectorsScoped = selectors.map(selectorPart => { // Assuming the selector part is a subclass selector (not a tag name) // so we can prepend the filter id class. If we want to support elements // such as `img` or namespaces, we'll need to add a case for that here. return `.${filterId}${selectorPart.trim()}`; }); const selector = selectorsScoped.join(', '); const isValidFilter = Array.isArray(colors) || colors === 'unset'; usePrivateStyleOverride(isValidFilter ? { css: colors !== 'unset' ? getDuotoneStylesheet(selector, filterId) : getDuotoneUnsetStylesheet(selector), __unstableType: 'presets' } : undefined); usePrivateStyleOverride(isValidFilter ? { assets: colors !== 'unset' ? getDuotoneFilter(filterId, colors) : '', __unstableType: 'svgs' } : undefined); const blockElement = useBlockElement(clientId); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isValidFilter) { return; } // Safari does not always update the duotone filter when the duotone // colors are changed. When using Safari, force the block element to be // repainted by the browser to ensure any changes are reflected // visually. This logic matches that used on the site frontend in // `block-supports/duotone.php`. if (blockElement && isSafari) { const display = blockElement.style.display; // Switch to `inline-block` to force a repaint. In the editor, // `inline-block` is used instead of `none` to ensure that scroll // position is not affected, as `none` results in the editor // scrolling to the top of the block. blockElement.style.setProperty('display', 'inline-block'); // Simply accessing el.offsetHeight flushes layout and style changes // in WebKit without having to wait for setTimeout. // eslint-disable-next-line no-unused-expressions blockElement.offsetHeight; blockElement.style.setProperty('display', display); } // `colors` must be a dependency so this effect runs when the colors // change in Safari. }, [isValidFilter, blockElement, colors]); } // Used for generating the instance ID const DUOTONE_BLOCK_PROPS_REFERENCE = {}; function duotone_useBlockProps({ clientId, name, style }) { const id = (0,external_wp_compose_namespaceObject.useInstanceId)(DUOTONE_BLOCK_PROPS_REFERENCE); const selector = (0,external_wp_element_namespaceObject.useMemo)(() => { const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); if (blockType) { // Backwards compatibility for `supports.color.__experimentalDuotone` // is provided via the `block_type_metadata_settings` filter. If // `supports.filter.duotone` has not been set and the // experimental property has been, the experimental property // value is copied into `supports.filter.duotone`. const duotoneSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, 'filter.duotone', false); if (!duotoneSupport) { return null; } // If the experimental duotone support was set, that value is // to be treated as a selector and requires scoping. const experimentalDuotone = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, 'color.__experimentalDuotone', false); if (experimentalDuotone) { const rootSelector = getBlockCSSSelector(blockType); return typeof experimentalDuotone === 'string' ? scopeSelector(rootSelector, experimentalDuotone) : rootSelector; } // Regular filter.duotone support uses filter.duotone selectors with fallbacks. return getBlockCSSSelector(blockType, 'filter.duotone', { fallback: true }); } }, [name]); const attribute = style?.color?.duotone; const filterClass = `wp-duotone-${id}`; const shouldRender = selector && attribute; useDuotoneStyles({ clientId, id: filterClass, selector, attribute }); return { className: shouldRender ? filterClass : '' }; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/editor/duotone/add-attributes', addDuotoneAttributes); ;// ./node_modules/@wordpress/block-editor/build-module/components/use-block-display-information/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('@wordpress/blocks').WPIcon} WPIcon */ /** * Contains basic block's information for display reasons. * * @typedef {Object} WPBlockDisplayInformation * * @property {boolean} isSynced True if is a reusable block or template part * @property {string} title Human-readable block type label. * @property {WPIcon} icon Block type icon. * @property {string} description A detailed block type description. * @property {string} anchor HTML anchor. * @property {name} name A custom, human readable name for the block. */ /** * Get the display label for a block's position type. * * @param {Object} attributes Block attributes. * @return {string} The position type label. */ function getPositionTypeLabel(attributes) { const positionType = attributes?.style?.position?.type; if (positionType === 'sticky') { return (0,external_wp_i18n_namespaceObject.__)('Sticky'); } if (positionType === 'fixed') { return (0,external_wp_i18n_namespaceObject.__)('Fixed'); } return null; } /** * Hook used to try to find a matching block variation and return * the appropriate information for display reasons. In order to * to try to find a match we need to things: * 1. Block's client id to extract it's current attributes. * 2. A block variation should have set `isActive` prop to a proper function. * * If for any reason a block variation match cannot be found, * the returned information come from the Block Type. * If no blockType is found with the provided clientId, returns null. * * @param {string} clientId Block's client id. * @return {?WPBlockDisplayInformation} Block's display information, or `null` when the block or its type not found. */ function useBlockDisplayInformation(clientId) { return (0,external_wp_data_namespaceObject.useSelect)(select => { if (!clientId) { return null; } const { getBlockName, getBlockAttributes } = select(store); const { getBlockType, getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store); const blockName = getBlockName(clientId); const blockType = getBlockType(blockName); if (!blockType) { return null; } const attributes = getBlockAttributes(clientId); const match = getActiveBlockVariation(blockName, attributes); const isSynced = (0,external_wp_blocks_namespaceObject.isReusableBlock)(blockType) || (0,external_wp_blocks_namespaceObject.isTemplatePart)(blockType); const syncedTitle = isSynced ? (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, attributes) : undefined; const title = syncedTitle || blockType.title; const positionLabel = getPositionTypeLabel(attributes); const blockTypeInfo = { isSynced, title, icon: blockType.icon, description: blockType.description, anchor: attributes?.anchor, positionLabel, positionType: attributes?.style?.position?.type, name: attributes?.metadata?.name }; if (!match) { return blockTypeInfo; } return { isSynced, title: match.title || blockType.title, icon: match.icon || blockType.icon, description: match.description || blockType.description, anchor: attributes?.anchor, positionLabel, positionType: attributes?.style?.position?.type, name: attributes?.metadata?.name }; }, [clientId]); } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/position.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const POSITION_SUPPORT_KEY = 'position'; const DEFAULT_OPTION = { key: 'default', value: '', name: (0,external_wp_i18n_namespaceObject.__)('Default') }; const STICKY_OPTION = { key: 'sticky', value: 'sticky', name: (0,external_wp_i18n_namespaceObject._x)('Sticky', 'Name for the value of the CSS position property'), hint: (0,external_wp_i18n_namespaceObject.__)('The block will stick to the top of the window instead of scrolling.') }; const FIXED_OPTION = { key: 'fixed', value: 'fixed', name: (0,external_wp_i18n_namespaceObject._x)('Fixed', 'Name for the value of the CSS position property'), hint: (0,external_wp_i18n_namespaceObject.__)('The block will not move when the page is scrolled.') }; const POSITION_SIDES = ['top', 'right', 'bottom', 'left']; const VALID_POSITION_TYPES = ['sticky', 'fixed']; /** * Get calculated position CSS. * * @param {Object} props Component props. * @param {string} props.selector Selector to use. * @param {Object} props.style Style object. * @return {string} The generated CSS rules. */ function getPositionCSS({ selector, style }) { let output = ''; const { type: positionType } = style?.position || {}; if (!VALID_POSITION_TYPES.includes(positionType)) { return output; } output += `${selector} {`; output += `position: ${positionType};`; POSITION_SIDES.forEach(side => { if (style?.position?.[side] !== undefined) { output += `${side}: ${style.position[side]};`; } }); if (positionType === 'sticky' || positionType === 'fixed') { // TODO: Replace hard-coded z-index value with a z-index preset approach in theme.json. output += `z-index: 10`; } output += `}`; return output; } /** * Determines if there is sticky position support. * * @param {string|Object} blockType Block name or Block Type object. * * @return {boolean} Whether there is support. */ function hasStickyPositionSupport(blockType) { const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, POSITION_SUPPORT_KEY); return !!(true === support || support?.sticky); } /** * Determines if there is fixed position support. * * @param {string|Object} blockType Block name or Block Type object. * * @return {boolean} Whether there is support. */ function hasFixedPositionSupport(blockType) { const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, POSITION_SUPPORT_KEY); return !!(true === support || support?.fixed); } /** * Determines if there is position support. * * @param {string|Object} blockType Block name or Block Type object. * * @return {boolean} Whether there is support. */ function hasPositionSupport(blockType) { const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, POSITION_SUPPORT_KEY); return !!support; } /** * Checks if there is a current value in the position block support attributes. * * @param {Object} props Block props. * @return {boolean} Whether or not the block has a position value set. */ function hasPositionValue(props) { return props.attributes.style?.position?.type !== undefined; } /** * Checks if the block is currently set to a sticky or fixed position. * This check is helpful for determining how to position block toolbars or other elements. * * @param {Object} attributes Block attributes. * @return {boolean} Whether or not the block is set to a sticky or fixed position. */ function hasStickyOrFixedPositionValue(attributes) { const positionType = attributes?.style?.position?.type; return positionType === 'sticky' || positionType === 'fixed'; } /** * Resets the position block support attributes. This can be used when disabling * the position support controls for a block via a `ToolsPanel`. * * @param {Object} props Block props. * @param {Object} props.attributes Block's attributes. * @param {Object} props.setAttributes Function to set block's attributes. */ function resetPosition({ attributes = {}, setAttributes }) { const { style = {} } = attributes; setAttributes({ style: cleanEmptyObject({ ...style, position: { ...style?.position, type: undefined, top: undefined, right: undefined, bottom: undefined, left: undefined } }) }); } /** * Custom hook that checks if position settings have been disabled. * * @param {string} name The name of the block. * * @return {boolean} Whether padding setting is disabled. */ function useIsPositionDisabled({ name: blockName } = {}) { const [allowFixed, allowSticky] = use_settings_useSettings('position.fixed', 'position.sticky'); const isDisabled = !allowFixed && !allowSticky; return !hasPositionSupport(blockName) || isDisabled; } /* * Position controls rendered in an inspector control panel. * * @param {Object} props * * @return {Element} Position panel. */ function PositionPanelPure({ style = {}, clientId, name: blockName, setAttributes }) { const allowFixed = hasFixedPositionSupport(blockName); const allowSticky = hasStickyPositionSupport(blockName); const value = style?.position?.type; const { firstParentClientId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockParents } = select(store); const parents = getBlockParents(clientId); return { firstParentClientId: parents[parents.length - 1] }; }, [clientId]); const blockInformation = useBlockDisplayInformation(firstParentClientId); const stickyHelpText = allowSticky && value === STICKY_OPTION.value && blockInformation ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: the name of the parent block. */ (0,external_wp_i18n_namespaceObject.__)('The block will stick to the scrollable area of the parent %s block.'), blockInformation.title) : null; const options = (0,external_wp_element_namespaceObject.useMemo)(() => { const availableOptions = [DEFAULT_OPTION]; // Display options if they are allowed, or if a block already has a valid value set. // This allows for a block to be switched off from a position type that is not allowed. if (allowSticky || value === STICKY_OPTION.value) { availableOptions.push(STICKY_OPTION); } if (allowFixed || value === FIXED_OPTION.value) { availableOptions.push(FIXED_OPTION); } return availableOptions; }, [allowFixed, allowSticky, value]); const onChangeType = next => { // For now, use a hard-coded `0px` value for the position. // `0px` is preferred over `0` as it can be used in `calc()` functions. // In the future, it could be useful to allow for an offset value. const placementValue = '0px'; const newStyle = { ...style, position: { ...style?.position, type: next, top: next === 'sticky' || next === 'fixed' ? placementValue : undefined } }; setAttributes({ style: utils_cleanEmptyObject(newStyle) }); }; const selectedOption = value ? options.find(option => option.value === value) || DEFAULT_OPTION : DEFAULT_OPTION; // Only display position controls if there is at least one option to choose from. return external_wp_element_namespaceObject.Platform.select({ web: options.length > 1 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { group: "position", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl, { __nextHasNoMarginBottom: true, help: stickyHelpText, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CustomSelectControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Position'), hideLabelFromVision: true, describedBy: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Currently selected position. (0,external_wp_i18n_namespaceObject.__)('Currently selected position: %s'), selectedOption.name), options: options, value: selectedOption, onChange: ({ selectedItem }) => { onChangeType(selectedItem.value); }, size: "__unstable-large" }) }) }) : null, native: null }); } /* harmony default export */ const position = ({ edit: function Edit(props) { const isPositionDisabled = useIsPositionDisabled(props); if (isPositionDisabled) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PositionPanelPure, { ...props }); }, useBlockProps: position_useBlockProps, attributeKeys: ['style'], hasSupport(name) { return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, POSITION_SUPPORT_KEY); } }); // Used for generating the instance ID const POSITION_BLOCK_PROPS_REFERENCE = {}; function position_useBlockProps({ name, style }) { const hasPositionBlockSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, POSITION_SUPPORT_KEY); const isPositionDisabled = useIsPositionDisabled({ name }); const allowPositionStyles = hasPositionBlockSupport && !isPositionDisabled; const id = (0,external_wp_compose_namespaceObject.useInstanceId)(POSITION_BLOCK_PROPS_REFERENCE); // Higher specificity to override defaults in editor UI. const positionSelector = `.wp-container-${id}.wp-container-${id}`; // Get CSS string for the current position values. let css; if (allowPositionStyles) { css = getPositionCSS({ selector: positionSelector, style }) || ''; } // Attach a `wp-container-` id-based class name. const className = dist_clsx({ [`wp-container-${id}`]: allowPositionStyles && !!css, // Only attach a container class if there is generated CSS to be attached. [`is-position-${style?.position?.type}`]: allowPositionStyles && !!css && !!style?.position?.type }); useStyleOverride({ css }); return { className }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/use-global-styles-output.js /** * WordPress dependencies */ /** * Internal dependencies */ // Elements that rely on class names in their selectors. const ELEMENT_CLASS_NAMES = { button: 'wp-element-button', caption: 'wp-element-caption' }; // List of block support features that can have their related styles // generated under their own feature level selector rather than the block's. const BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS = { __experimentalBorder: 'border', color: 'color', spacing: 'spacing', typography: 'typography' }; const { kebabCase: use_global_styles_output_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); /** * Transform given preset tree into a set of style declarations. * * @param {Object} blockPresets * @param {Object} mergedSettings Merged theme.json settings. * * @return {Array<Object>} An array of style declarations. */ function getPresetsDeclarations(blockPresets = {}, mergedSettings) { return PRESET_METADATA.reduce((declarations, { path, valueKey, valueFunc, cssVarInfix }) => { const presetByOrigin = getValueFromObjectPath(blockPresets, path, []); ['default', 'theme', 'custom'].forEach(origin => { if (presetByOrigin[origin]) { presetByOrigin[origin].forEach(value => { if (valueKey && !valueFunc) { declarations.push(`--wp--preset--${cssVarInfix}--${use_global_styles_output_kebabCase(value.slug)}: ${value[valueKey]}`); } else if (valueFunc && typeof valueFunc === 'function') { declarations.push(`--wp--preset--${cssVarInfix}--${use_global_styles_output_kebabCase(value.slug)}: ${valueFunc(value, mergedSettings)}`); } }); } }); return declarations; }, []); } /** * Transform given preset tree into a set of preset class declarations. * * @param {?string} blockSelector * @param {Object} blockPresets * @return {string} CSS declarations for the preset classes. */ function getPresetsClasses(blockSelector = '*', blockPresets = {}) { return PRESET_METADATA.reduce((declarations, { path, cssVarInfix, classes }) => { if (!classes) { return declarations; } const presetByOrigin = getValueFromObjectPath(blockPresets, path, []); ['default', 'theme', 'custom'].forEach(origin => { if (presetByOrigin[origin]) { presetByOrigin[origin].forEach(({ slug }) => { classes.forEach(({ classSuffix, propertyName }) => { const classSelectorToUse = `.has-${use_global_styles_output_kebabCase(slug)}-${classSuffix}`; const selectorToUse = blockSelector.split(',') // Selector can be "h1, h2, h3" .map(selector => `${selector}${classSelectorToUse}`).join(','); const value = `var(--wp--preset--${cssVarInfix}--${use_global_styles_output_kebabCase(slug)})`; declarations += `${selectorToUse}{${propertyName}: ${value} !important;}`; }); }); } }); return declarations; }, ''); } function getPresetsSvgFilters(blockPresets = {}) { return PRESET_METADATA.filter( // Duotone are the only type of filters for now. metadata => metadata.path.at(-1) === 'duotone').flatMap(metadata => { const presetByOrigin = getValueFromObjectPath(blockPresets, metadata.path, {}); return ['default', 'theme'].filter(origin => presetByOrigin[origin]).flatMap(origin => presetByOrigin[origin].map(preset => getDuotoneFilter(`wp-duotone-${preset.slug}`, preset.colors))).join(''); }); } function flattenTree(input = {}, prefix, token) { let result = []; Object.keys(input).forEach(key => { const newKey = prefix + use_global_styles_output_kebabCase(key.replace('/', '-')); const newLeaf = input[key]; if (newLeaf instanceof Object) { const newPrefix = newKey + token; result = [...result, ...flattenTree(newLeaf, newPrefix, token)]; } else { result.push(`${newKey}: ${newLeaf}`); } }); return result; } /** * Gets variation selector string from feature selector. * * @param {string} featureSelector The feature selector. * * @param {string} styleVariationSelector The style variation selector. * @return {string} Combined selector string. */ function concatFeatureVariationSelectorString(featureSelector, styleVariationSelector) { const featureSelectors = featureSelector.split(','); const combinedSelectors = []; featureSelectors.forEach(selector => { combinedSelectors.push(`${styleVariationSelector.trim()}${selector.trim()}`); }); return combinedSelectors.join(', '); } /** * Generate style declarations for a block's custom feature and subfeature * selectors. * * NOTE: The passed `styles` object will be mutated by this function. * * @param {Object} selectors Custom selectors object for a block. * @param {Object} styles A block's styles object. * * @return {Object} Style declarations. */ const getFeatureDeclarations = (selectors, styles) => { const declarations = {}; Object.entries(selectors).forEach(([feature, selector]) => { // We're only processing features/subfeatures that have styles. if (feature === 'root' || !styles?.[feature]) { return; } const isShorthand = typeof selector === 'string'; // If we have a selector object instead of shorthand process it. if (!isShorthand) { Object.entries(selector).forEach(([subfeature, subfeatureSelector]) => { // Don't process root feature selector yet or any // subfeature that doesn't have a style. if (subfeature === 'root' || !styles?.[feature][subfeature]) { return; } // Create a temporary styles object and build // declarations for subfeature. const subfeatureStyles = { [feature]: { [subfeature]: styles[feature][subfeature] } }; const newDeclarations = getStylesDeclarations(subfeatureStyles); // Merge new declarations in with any others that // share the same selector. declarations[subfeatureSelector] = [...(declarations[subfeatureSelector] || []), ...newDeclarations]; // Remove the subfeature's style now it will be // included under its own selector not the block's. delete styles[feature][subfeature]; }); } // Now subfeatures have been processed and removed, we can // process root, or shorthand, feature selectors. if (isShorthand || selector.root) { const featureSelector = isShorthand ? selector : selector.root; // Create temporary style object and build declarations for feature. const featureStyles = { [feature]: styles[feature] }; const newDeclarations = getStylesDeclarations(featureStyles); // Merge new declarations with any others that share the selector. declarations[featureSelector] = [...(declarations[featureSelector] || []), ...newDeclarations]; // Remove the feature from the block's styles now as it will be // included under its own selector not the block's. delete styles[feature]; } }); return declarations; }; /** * Transform given style tree into a set of style declarations. * * @param {Object} blockStyles Block styles. * * @param {string} selector The selector these declarations should attach to. * * @param {boolean} useRootPaddingAlign Whether to use CSS custom properties in root selector. * * @param {Object} tree A theme.json tree containing layout definitions. * * @param {boolean} disableRootPadding Whether to force disable the root padding styles. * @return {Array} An array of style declarations. */ function getStylesDeclarations(blockStyles = {}, selector = '', useRootPaddingAlign, tree = {}, disableRootPadding = false) { const isRoot = ROOT_BLOCK_SELECTOR === selector; const output = Object.entries(external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY).reduce((declarations, [key, { value, properties, useEngine, rootOnly }]) => { if (rootOnly && !isRoot) { return declarations; } const pathToValue = value; if (pathToValue[0] === 'elements' || useEngine) { return declarations; } const styleValue = getValueFromObjectPath(blockStyles, pathToValue); // Root-level padding styles don't currently support strings with CSS shorthand values. // This may change: https://github.com/WordPress/gutenberg/issues/40132. if (key === '--wp--style--root--padding' && (typeof styleValue === 'string' || !useRootPaddingAlign)) { return declarations; } if (properties && typeof styleValue !== 'string') { Object.entries(properties).forEach(entry => { const [name, prop] = entry; if (!getValueFromObjectPath(styleValue, [prop], false)) { // Do not create a declaration // for sub-properties that don't have any value. return; } const cssProperty = name.startsWith('--') ? name : use_global_styles_output_kebabCase(name); declarations.push(`${cssProperty}: ${(0,external_wp_styleEngine_namespaceObject.getCSSValueFromRawStyle)(getValueFromObjectPath(styleValue, [prop]))}`); }); } else if (getValueFromObjectPath(blockStyles, pathToValue, false)) { const cssProperty = key.startsWith('--') ? key : use_global_styles_output_kebabCase(key); declarations.push(`${cssProperty}: ${(0,external_wp_styleEngine_namespaceObject.getCSSValueFromRawStyle)(getValueFromObjectPath(blockStyles, pathToValue))}`); } return declarations; }, []); /* * Preprocess background image values. * * Note: As we absorb more and more styles into the engine, we could simplify this function. * A refactor is for the style engine to handle ref resolution (and possibly defaults) * via a public util used internally and externally. Theme.json tree and defaults could be passed * as options. */ if (!!blockStyles.background) { /* * Resolve dynamic values before they are compiled by the style engine, * which doesn't (yet) resolve dynamic values. */ if (blockStyles.background?.backgroundImage) { blockStyles.background.backgroundImage = getResolvedValue(blockStyles.background.backgroundImage, tree); } /* * Set default values for block background styles. * Top-level styles are an exception as they are applied to the body. */ if (!isRoot && !!blockStyles.background?.backgroundImage?.id) { blockStyles = { ...blockStyles, background: { ...blockStyles.background, ...setBackgroundStyleDefaults(blockStyles.background) } }; } } const extraRules = (0,external_wp_styleEngine_namespaceObject.getCSSRules)(blockStyles); extraRules.forEach(rule => { // Don't output padding properties if padding variables are set or if we're not editing a full template. if (isRoot && (useRootPaddingAlign || disableRootPadding) && rule.key.startsWith('padding')) { return; } const cssProperty = rule.key.startsWith('--') ? rule.key : use_global_styles_output_kebabCase(rule.key); let ruleValue = getResolvedValue(rule.value, tree, null); // Calculate fluid typography rules where available. if (cssProperty === 'font-size') { /* * getTypographyFontSizeValue() will check * if fluid typography has been activated and also * whether the incoming value can be converted to a fluid value. * Values that already have a "clamp()" function will not pass the test, * and therefore the original $value will be returned. */ ruleValue = getTypographyFontSizeValue({ size: ruleValue }, tree?.settings); } // For aspect ratio to work, other dimensions rules (and Cover block defaults) must be unset. // This ensures that a fixed height does not override the aspect ratio. if (cssProperty === 'aspect-ratio') { output.push('min-height: unset'); } output.push(`${cssProperty}: ${ruleValue}`); }); return output; } /** * Get generated CSS for layout styles by looking up layout definitions provided * in theme.json, and outputting common layout styles, and specific blockGap values. * * @param {Object} props * @param {Object} props.layoutDefinitions Layout definitions, keyed by layout type. * @param {Object} props.style A style object containing spacing values. * @param {string} props.selector Selector used to group together layout styling rules. * @param {boolean} props.hasBlockGapSupport Whether or not the theme opts-in to blockGap support. * @param {boolean} props.hasFallbackGapSupport Whether or not the theme allows fallback gap styles. * @param {?string} props.fallbackGapValue An optional fallback gap value if no real gap value is available. * @return {string} Generated CSS rules for the layout styles. */ function getLayoutStyles({ layoutDefinitions = LAYOUT_DEFINITIONS, style, selector, hasBlockGapSupport, hasFallbackGapSupport, fallbackGapValue }) { let ruleset = ''; let gapValue = hasBlockGapSupport ? getGapCSSValue(style?.spacing?.blockGap) : ''; // Ensure a fallback gap value for the root layout definitions, // and use a fallback value if one is provided for the current block. if (hasFallbackGapSupport) { if (selector === ROOT_BLOCK_SELECTOR) { gapValue = !gapValue ? '0.5em' : gapValue; } else if (!hasBlockGapSupport && fallbackGapValue) { gapValue = fallbackGapValue; } } if (gapValue && layoutDefinitions) { Object.values(layoutDefinitions).forEach(({ className, name, spacingStyles }) => { // Allow outputting fallback gap styles for flex layout type when block gap support isn't available. if (!hasBlockGapSupport && 'flex' !== name && 'grid' !== name) { return; } if (spacingStyles?.length) { spacingStyles.forEach(spacingStyle => { const declarations = []; if (spacingStyle.rules) { Object.entries(spacingStyle.rules).forEach(([cssProperty, cssValue]) => { declarations.push(`${cssProperty}: ${cssValue ? cssValue : gapValue}`); }); } if (declarations.length) { let combinedSelector = ''; if (!hasBlockGapSupport) { // For fallback gap styles, use lower specificity, to ensure styles do not unintentionally override theme styles. combinedSelector = selector === ROOT_BLOCK_SELECTOR ? `:where(.${className}${spacingStyle?.selector || ''})` : `:where(${selector}.${className}${spacingStyle?.selector || ''})`; } else { combinedSelector = selector === ROOT_BLOCK_SELECTOR ? `:root :where(.${className})${spacingStyle?.selector || ''}` : `:root :where(${selector}-${className})${spacingStyle?.selector || ''}`; } ruleset += `${combinedSelector} { ${declarations.join('; ')}; }`; } }); } }); // For backwards compatibility, ensure the legacy block gap CSS variable is still available. if (selector === ROOT_BLOCK_SELECTOR && hasBlockGapSupport) { ruleset += `${ROOT_CSS_PROPERTIES_SELECTOR} { --wp--style--block-gap: ${gapValue}; }`; } } // Output base styles if (selector === ROOT_BLOCK_SELECTOR && layoutDefinitions) { const validDisplayModes = ['block', 'flex', 'grid']; Object.values(layoutDefinitions).forEach(({ className, displayMode, baseStyles }) => { if (displayMode && validDisplayModes.includes(displayMode)) { ruleset += `${selector} .${className} { display:${displayMode}; }`; } if (baseStyles?.length) { baseStyles.forEach(baseStyle => { const declarations = []; if (baseStyle.rules) { Object.entries(baseStyle.rules).forEach(([cssProperty, cssValue]) => { declarations.push(`${cssProperty}: ${cssValue}`); }); } if (declarations.length) { const combinedSelector = `.${className}${baseStyle?.selector || ''}`; ruleset += `${combinedSelector} { ${declarations.join('; ')}; }`; } }); } }); } return ruleset; } const STYLE_KEYS = ['border', 'color', 'dimensions', 'spacing', 'typography', 'filter', 'outline', 'shadow', 'background']; function pickStyleKeys(treeToPickFrom) { if (!treeToPickFrom) { return {}; } const entries = Object.entries(treeToPickFrom); const pickedEntries = entries.filter(([key]) => STYLE_KEYS.includes(key)); // clone the style objects so that `getFeatureDeclarations` can remove consumed keys from it const clonedEntries = pickedEntries.map(([key, style]) => [key, JSON.parse(JSON.stringify(style))]); return Object.fromEntries(clonedEntries); } const getNodesWithStyles = (tree, blockSelectors) => { var _tree$styles$blocks; const nodes = []; if (!tree?.styles) { return nodes; } // Top-level. const styles = pickStyleKeys(tree.styles); if (styles) { nodes.push({ styles, selector: ROOT_BLOCK_SELECTOR, // Root selector (body) styles should not be wrapped in `:root where()` to keep // specificity at (0,0,1) and maintain backwards compatibility. skipSelectorWrapper: true }); } Object.entries(external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS).forEach(([name, selector]) => { if (tree.styles?.elements?.[name]) { nodes.push({ styles: tree.styles?.elements?.[name], selector, // Top level elements that don't use a class name should not receive the // `:root :where()` wrapper to maintain backwards compatibility. skipSelectorWrapper: !ELEMENT_CLASS_NAMES[name] }); } }); // Iterate over blocks: they can have styles & elements. Object.entries((_tree$styles$blocks = tree.styles?.blocks) !== null && _tree$styles$blocks !== void 0 ? _tree$styles$blocks : {}).forEach(([blockName, node]) => { var _node$elements; const blockStyles = pickStyleKeys(node); if (node?.variations) { const variations = {}; Object.entries(node.variations).forEach(([variationName, variation]) => { var _variation$elements, _variation$blocks; variations[variationName] = pickStyleKeys(variation); if (variation?.css) { variations[variationName].css = variation.css; } const variationSelector = blockSelectors[blockName]?.styleVariationSelectors?.[variationName]; // Process the variation's inner element styles. // This comes before the inner block styles so the // element styles within the block type styles take // precedence over these. Object.entries((_variation$elements = variation?.elements) !== null && _variation$elements !== void 0 ? _variation$elements : {}).forEach(([element, elementStyles]) => { if (elementStyles && external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[element]) { nodes.push({ styles: elementStyles, selector: scopeSelector(variationSelector, external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[element]) }); } }); // Process the variations inner block type styles. Object.entries((_variation$blocks = variation?.blocks) !== null && _variation$blocks !== void 0 ? _variation$blocks : {}).forEach(([variationBlockName, variationBlockStyles]) => { var _variationBlockStyles; const variationBlockSelector = scopeSelector(variationSelector, blockSelectors[variationBlockName]?.selector); const variationDuotoneSelector = scopeSelector(variationSelector, blockSelectors[variationBlockName]?.duotoneSelector); const variationFeatureSelectors = scopeFeatureSelectors(variationSelector, blockSelectors[variationBlockName]?.featureSelectors); const variationBlockStyleNodes = pickStyleKeys(variationBlockStyles); if (variationBlockStyles?.css) { variationBlockStyleNodes.css = variationBlockStyles.css; } nodes.push({ selector: variationBlockSelector, duotoneSelector: variationDuotoneSelector, featureSelectors: variationFeatureSelectors, fallbackGapValue: blockSelectors[variationBlockName]?.fallbackGapValue, hasLayoutSupport: blockSelectors[variationBlockName]?.hasLayoutSupport, styles: variationBlockStyleNodes }); // Process element styles for the inner blocks // of the variation. Object.entries((_variationBlockStyles = variationBlockStyles.elements) !== null && _variationBlockStyles !== void 0 ? _variationBlockStyles : {}).forEach(([variationBlockElement, variationBlockElementStyles]) => { if (variationBlockElementStyles && external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[variationBlockElement]) { nodes.push({ styles: variationBlockElementStyles, selector: scopeSelector(variationBlockSelector, external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[variationBlockElement]) }); } }); }); }); blockStyles.variations = variations; } if (blockSelectors?.[blockName]?.selector) { nodes.push({ duotoneSelector: blockSelectors[blockName].duotoneSelector, fallbackGapValue: blockSelectors[blockName].fallbackGapValue, hasLayoutSupport: blockSelectors[blockName].hasLayoutSupport, selector: blockSelectors[blockName].selector, styles: blockStyles, featureSelectors: blockSelectors[blockName].featureSelectors, styleVariationSelectors: blockSelectors[blockName].styleVariationSelectors }); } Object.entries((_node$elements = node?.elements) !== null && _node$elements !== void 0 ? _node$elements : {}).forEach(([elementName, value]) => { if (value && blockSelectors?.[blockName] && external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[elementName]) { nodes.push({ styles: value, selector: blockSelectors[blockName]?.selector.split(',').map(sel => { const elementSelectors = external_wp_blocks_namespaceObject.__EXPERIMENTAL_ELEMENTS[elementName].split(','); return elementSelectors.map(elementSelector => sel + ' ' + elementSelector); }).join(',') }); } }); }); return nodes; }; const getNodesWithSettings = (tree, blockSelectors) => { var _tree$settings$blocks; const nodes = []; if (!tree?.settings) { return nodes; } const pickPresets = treeToPickFrom => { let presets = {}; PRESET_METADATA.forEach(({ path }) => { const value = getValueFromObjectPath(treeToPickFrom, path, false); if (value !== false) { presets = setImmutably(presets, path, value); } }); return presets; }; // Top-level. const presets = pickPresets(tree.settings); const custom = tree.settings?.custom; if (Object.keys(presets).length > 0 || custom) { nodes.push({ presets, custom, selector: ROOT_CSS_PROPERTIES_SELECTOR }); } // Blocks. Object.entries((_tree$settings$blocks = tree.settings?.blocks) !== null && _tree$settings$blocks !== void 0 ? _tree$settings$blocks : {}).forEach(([blockName, node]) => { const blockPresets = pickPresets(node); const blockCustom = node.custom; if (Object.keys(blockPresets).length > 0 || blockCustom) { nodes.push({ presets: blockPresets, custom: blockCustom, selector: blockSelectors[blockName]?.selector }); } }); return nodes; }; const toCustomProperties = (tree, blockSelectors) => { const settings = getNodesWithSettings(tree, blockSelectors); let ruleset = ''; settings.forEach(({ presets, custom, selector }) => { const declarations = getPresetsDeclarations(presets, tree?.settings); const customProps = flattenTree(custom, '--wp--custom--', '--'); if (customProps.length > 0) { declarations.push(...customProps); } if (declarations.length > 0) { ruleset += `${selector}{${declarations.join(';')};}`; } }); return ruleset; }; const toStyles = (tree, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport, disableLayoutStyles = false, disableRootPadding = false, styleOptions = undefined) => { // These allow opting out of certain sets of styles. const options = { blockGap: true, blockStyles: true, layoutStyles: true, marginReset: true, presets: true, rootPadding: true, variationStyles: false, ...styleOptions }; const nodesWithStyles = getNodesWithStyles(tree, blockSelectors); const nodesWithSettings = getNodesWithSettings(tree, blockSelectors); const useRootPaddingAlign = tree?.settings?.useRootPaddingAwareAlignments; const { contentSize, wideSize } = tree?.settings?.layout || {}; const hasBodyStyles = options.marginReset || options.rootPadding || options.layoutStyles; let ruleset = ''; if (options.presets && (contentSize || wideSize)) { ruleset += `${ROOT_CSS_PROPERTIES_SELECTOR} {`; ruleset = contentSize ? ruleset + ` --wp--style--global--content-size: ${contentSize};` : ruleset; ruleset = wideSize ? ruleset + ` --wp--style--global--wide-size: ${wideSize};` : ruleset; ruleset += '}'; } if (hasBodyStyles) { /* * Reset default browser margin on the body element. * This is set on the body selector **before** generating the ruleset * from the `theme.json`. This is to ensure that if the `theme.json` declares * `margin` in its `spacing` declaration for the `body` element then these * user-generated values take precedence in the CSS cascade. * @link https://github.com/WordPress/gutenberg/issues/36147. */ ruleset += ':where(body) {margin: 0;'; // Root padding styles should be output for full templates, patterns and template parts. if (options.rootPadding && useRootPaddingAlign) { /* * These rules reproduce the ones from https://github.com/WordPress/gutenberg/blob/79103f124925d1f457f627e154f52a56228ed5ad/lib/class-wp-theme-json-gutenberg.php#L2508 * almost exactly, but for the selectors that target block wrappers in the front end. This code only runs in the editor, so it doesn't need those selectors. */ ruleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) } .has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); } .has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); } .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; } .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0; `; } ruleset += '}'; } if (options.blockStyles) { nodesWithStyles.forEach(({ selector, duotoneSelector, styles, fallbackGapValue, hasLayoutSupport, featureSelectors, styleVariationSelectors, skipSelectorWrapper }) => { // Process styles for block support features with custom feature level // CSS selectors set. if (featureSelectors) { const featureDeclarations = getFeatureDeclarations(featureSelectors, styles); Object.entries(featureDeclarations).forEach(([cssSelector, declarations]) => { if (declarations.length) { const rules = declarations.join(';'); ruleset += `:root :where(${cssSelector}){${rules};}`; } }); } // Process duotone styles. if (duotoneSelector) { const duotoneStyles = {}; if (styles?.filter) { duotoneStyles.filter = styles.filter; delete styles.filter; } const duotoneDeclarations = getStylesDeclarations(duotoneStyles); if (duotoneDeclarations.length) { ruleset += `${duotoneSelector}{${duotoneDeclarations.join(';')};}`; } } // Process blockGap and layout styles. if (!disableLayoutStyles && (ROOT_BLOCK_SELECTOR === selector || hasLayoutSupport)) { ruleset += getLayoutStyles({ style: styles, selector, hasBlockGapSupport, hasFallbackGapSupport, fallbackGapValue }); } // Process the remaining block styles (they use either normal block class or __experimentalSelector). const styleDeclarations = getStylesDeclarations(styles, selector, useRootPaddingAlign, tree, disableRootPadding); if (styleDeclarations?.length) { const generalSelector = skipSelectorWrapper ? selector : `:root :where(${selector})`; ruleset += `${generalSelector}{${styleDeclarations.join(';')};}`; } if (styles?.css) { ruleset += processCSSNesting(styles.css, `:root :where(${selector})`); } if (options.variationStyles && styleVariationSelectors) { Object.entries(styleVariationSelectors).forEach(([styleVariationName, styleVariationSelector]) => { const styleVariations = styles?.variations?.[styleVariationName]; if (styleVariations) { // If the block uses any custom selectors for block support, add those first. if (featureSelectors) { const featureDeclarations = getFeatureDeclarations(featureSelectors, styleVariations); Object.entries(featureDeclarations).forEach(([baseSelector, declarations]) => { if (declarations.length) { const cssSelector = concatFeatureVariationSelectorString(baseSelector, styleVariationSelector); const rules = declarations.join(';'); ruleset += `:root :where(${cssSelector}){${rules};}`; } }); } // Otherwise add regular selectors. const styleVariationDeclarations = getStylesDeclarations(styleVariations, styleVariationSelector, useRootPaddingAlign, tree); if (styleVariationDeclarations.length) { ruleset += `:root :where(${styleVariationSelector}){${styleVariationDeclarations.join(';')};}`; } if (styleVariations?.css) { ruleset += processCSSNesting(styleVariations.css, `:root :where(${styleVariationSelector})`); } } }); } // Check for pseudo selector in `styles` and handle separately. const pseudoSelectorStyles = Object.entries(styles).filter(([key]) => key.startsWith(':')); if (pseudoSelectorStyles?.length) { pseudoSelectorStyles.forEach(([pseudoKey, pseudoStyle]) => { const pseudoDeclarations = getStylesDeclarations(pseudoStyle); if (!pseudoDeclarations?.length) { return; } // `selector` may be provided in a form // where block level selectors have sub element // selectors appended to them as a comma separated // string. // e.g. `h1 a,h2 a,h3 a,h4 a,h5 a,h6 a`; // Split and append pseudo selector to create // the proper rules to target the elements. const _selector = selector.split(',').map(sel => sel + pseudoKey).join(','); // As pseudo classes such as :hover, :focus etc. have class-level // specificity, they must use the `:root :where()` wrapper. This. // caps the specificity at `0-1-0` to allow proper nesting of variations // and block type element styles. const pseudoRule = `:root :where(${_selector}){${pseudoDeclarations.join(';')};}`; ruleset += pseudoRule; }); } }); } if (options.layoutStyles) { /* Add alignment / layout styles */ ruleset = ruleset + '.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }'; ruleset = ruleset + '.wp-site-blocks > .alignright { float: right; margin-left: 2em; }'; ruleset = ruleset + '.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }'; } if (options.blockGap && hasBlockGapSupport) { // Use fallback of `0.5em` just in case, however if there is blockGap support, there should nearly always be a real value. const gapValue = getGapCSSValue(tree?.styles?.spacing?.blockGap) || '0.5em'; ruleset = ruleset + `:root :where(.wp-site-blocks) > * { margin-block-start: ${gapValue}; margin-block-end: 0; }`; ruleset = ruleset + ':root :where(.wp-site-blocks) > :first-child { margin-block-start: 0; }'; ruleset = ruleset + ':root :where(.wp-site-blocks) > :last-child { margin-block-end: 0; }'; } if (options.presets) { nodesWithSettings.forEach(({ selector, presets }) => { if (ROOT_BLOCK_SELECTOR === selector || ROOT_CSS_PROPERTIES_SELECTOR === selector) { // Do not add extra specificity for top-level classes. selector = ''; } const classes = getPresetsClasses(selector, presets); if (classes.length > 0) { ruleset += classes; } }); } return ruleset; }; function toSvgFilters(tree, blockSelectors) { const nodesWithSettings = getNodesWithSettings(tree, blockSelectors); return nodesWithSettings.flatMap(({ presets }) => { return getPresetsSvgFilters(presets); }); } const getSelectorsConfig = (blockType, rootSelector) => { if (blockType?.selectors && Object.keys(blockType.selectors).length > 0) { return blockType.selectors; } const config = { root: rootSelector }; Object.entries(BLOCK_SUPPORT_FEATURE_LEVEL_SELECTORS).forEach(([featureKey, featureName]) => { const featureSelector = getBlockCSSSelector(blockType, featureKey); if (featureSelector) { config[featureName] = featureSelector; } }); return config; }; const getBlockSelectors = (blockTypes, getBlockStyles, variationInstanceId) => { const result = {}; blockTypes.forEach(blockType => { const name = blockType.name; const selector = getBlockCSSSelector(blockType); let duotoneSelector = getBlockCSSSelector(blockType, 'filter.duotone'); // Keep backwards compatibility for support.color.__experimentalDuotone. if (!duotoneSelector) { const rootSelector = getBlockCSSSelector(blockType); const duotoneSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockType, 'color.__experimentalDuotone', false); duotoneSelector = duotoneSupport && scopeSelector(rootSelector, duotoneSupport); } const hasLayoutSupport = !!blockType?.supports?.layout || !!blockType?.supports?.__experimentalLayout; const fallbackGapValue = blockType?.supports?.spacing?.blockGap?.__experimentalDefault; const blockStyleVariations = getBlockStyles(name); const styleVariationSelectors = {}; blockStyleVariations?.forEach(variation => { const variationSuffix = variationInstanceId ? `-${variationInstanceId}` : ''; const variationName = `${variation.name}${variationSuffix}`; const styleVariationSelector = getBlockStyleVariationSelector(variationName, selector); styleVariationSelectors[variationName] = styleVariationSelector; }); // For each block support feature add any custom selectors. const featureSelectors = getSelectorsConfig(blockType, selector); result[name] = { duotoneSelector, fallbackGapValue, featureSelectors: Object.keys(featureSelectors).length ? featureSelectors : undefined, hasLayoutSupport, name, selector, styleVariationSelectors: blockStyleVariations?.length ? styleVariationSelectors : undefined }; }); return result; }; /** * If there is a separator block whose color is defined in theme.json via background, * update the separator color to the same value by using border color. * * @param {Object} config Theme.json configuration file object. * @return {Object} configTheme.json configuration file object updated. */ function updateConfigWithSeparator(config) { const needsSeparatorStyleUpdate = config.styles?.blocks?.['core/separator'] && config.styles?.blocks?.['core/separator'].color?.background && !config.styles?.blocks?.['core/separator'].color?.text && !config.styles?.blocks?.['core/separator'].border?.color; if (needsSeparatorStyleUpdate) { return { ...config, styles: { ...config.styles, blocks: { ...config.styles.blocks, 'core/separator': { ...config.styles.blocks['core/separator'], color: { ...config.styles.blocks['core/separator'].color, text: config.styles?.blocks['core/separator'].color.background } } } } }; } return config; } function processCSSNesting(css, blockSelector) { let processedCSS = ''; if (!css || css.trim() === '') { return processedCSS; } // Split CSS nested rules. const parts = css.split('&'); parts.forEach(part => { if (!part || part.trim() === '') { return; } const isRootCss = !part.includes('{'); if (isRootCss) { // If the part doesn't contain braces, it applies to the root level. processedCSS += `:root :where(${blockSelector}){${part.trim()}}`; } else { // If the part contains braces, it's a nested CSS rule. const splitPart = part.replace('}', '').split('{'); if (splitPart.length !== 2) { return; } const [nestedSelector, cssValue] = splitPart; // Handle pseudo elements such as ::before, ::after, etc. Regex will also // capture any leading combinator such as >, +, or ~, as well as spaces. // This allows pseudo elements as descendants e.g. `.parent ::before`. const matches = nestedSelector.match(/([>+~\s]*::[a-zA-Z-]+)/); const pseudoPart = matches ? matches[1] : ''; const withoutPseudoElement = matches ? nestedSelector.replace(pseudoPart, '').trim() : nestedSelector.trim(); let combinedSelector; if (withoutPseudoElement === '') { // Only contained a pseudo element to use the block selector to form // the final `:root :where()` selector. combinedSelector = blockSelector; } else { // If the nested selector is a descendant of the block scope it with the // block selector. Otherwise append it to the block selector. combinedSelector = nestedSelector.startsWith(' ') ? scopeSelector(blockSelector, withoutPseudoElement) : appendToSelector(blockSelector, withoutPseudoElement); } // Build final rule, re-adding any pseudo element outside the `:where()` // to maintain valid CSS selector. processedCSS += `:root :where(${combinedSelector})${pseudoPart}{${cssValue.trim()}}`; } }); return processedCSS; } /** * Returns the global styles output using a global styles configuration. * If wishing to generate global styles and settings based on the * global styles config loaded in the editor context, use `useGlobalStylesOutput()`. * The use case for a custom config is to generate bespoke styles * and settings for previews, or other out-of-editor experiences. * * @param {Object} mergedConfig Global styles configuration. * @param {boolean} disableRootPadding Disable root padding styles. * * @return {Array} Array of stylesheets and settings. */ function useGlobalStylesOutputWithConfig(mergedConfig = {}, disableRootPadding) { const [blockGap] = useGlobalSetting('spacing.blockGap'); const hasBlockGapSupport = blockGap !== null; const hasFallbackGapSupport = !hasBlockGapSupport; // This setting isn't useful yet: it exists as a placeholder for a future explicit fallback styles support. const disableLayoutStyles = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(store); return !!getSettings().disableLayoutStyles; }); const { getBlockStyles } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); return (0,external_wp_element_namespaceObject.useMemo)(() => { var _updatedConfig$styles; if (!mergedConfig?.styles || !mergedConfig?.settings) { return []; } const updatedConfig = updateConfigWithSeparator(mergedConfig); const blockSelectors = getBlockSelectors((0,external_wp_blocks_namespaceObject.getBlockTypes)(), getBlockStyles); const customProperties = toCustomProperties(updatedConfig, blockSelectors); const globalStyles = toStyles(updatedConfig, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport, disableLayoutStyles, disableRootPadding); const svgs = toSvgFilters(updatedConfig, blockSelectors); const styles = [{ css: customProperties, isGlobalStyles: true }, { css: globalStyles, isGlobalStyles: true }, // Load custom CSS in own stylesheet so that any invalid CSS entered in the input won't break all the global styles in the editor. { css: (_updatedConfig$styles = updatedConfig.styles.css) !== null && _updatedConfig$styles !== void 0 ? _updatedConfig$styles : '', isGlobalStyles: true }, { assets: svgs, __unstableType: 'svg', isGlobalStyles: true }]; // Loop through the blocks to check if there are custom CSS values. // If there are, get the block selector and push the selector together with // the CSS value to the 'stylesheets' array. (0,external_wp_blocks_namespaceObject.getBlockTypes)().forEach(blockType => { if (updatedConfig.styles.blocks[blockType.name]?.css) { const selector = blockSelectors[blockType.name].selector; styles.push({ css: processCSSNesting(updatedConfig.styles.blocks[blockType.name]?.css, selector), isGlobalStyles: true }); } }); return [styles, updatedConfig.settings]; }, [hasBlockGapSupport, hasFallbackGapSupport, mergedConfig, disableLayoutStyles, disableRootPadding, getBlockStyles]); } /** * Returns the global styles output based on the current state of global styles config loaded in the editor context. * * @param {boolean} disableRootPadding Disable root padding styles. * * @return {Array} Array of stylesheets and settings. */ function useGlobalStylesOutput(disableRootPadding = false) { const { merged: mergedConfig } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext); return useGlobalStylesOutputWithConfig(mergedConfig, disableRootPadding); } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/block-style-variation.js /** * WordPress dependencies */ /** * Internal dependencies */ const VARIATION_PREFIX = 'is-style-'; function getVariationMatches(className) { if (!className) { return []; } return className.split(/\s+/).reduce((matches, name) => { if (name.startsWith(VARIATION_PREFIX)) { const match = name.slice(VARIATION_PREFIX.length); if (match !== 'default') { matches.push(match); } } return matches; }, []); } /** * Get the first block style variation that has been registered from the class string. * * @param {string} className CSS class string for a block. * @param {Array} registeredStyles Currently registered block styles. * * @return {string|null} The name of the first registered variation. */ function getVariationNameFromClass(className, registeredStyles = []) { // The global flag affects how capturing groups work in JS. So the regex // below will only return full CSS classes not just the variation name. const matches = getVariationMatches(className); if (!matches) { return null; } for (const variation of matches) { if (registeredStyles.some(style => style.name === variation)) { return variation; } } return null; } // A helper component to apply a style override using the useStyleOverride hook. function OverrideStyles({ override }) { usePrivateStyleOverride(override); } /** * This component is used to generate new block style variation overrides * based on an incoming theme config. If a matching style is found in the config, * a new override is created and returned. The overrides can be used in conjunction with * useStyleOverride to apply the new styles to the editor. Its use is * subject to change. * * @param {Object} props Props. * @param {Object} props.config A global styles object, containing settings and styles. * @return {JSX.Element|undefined} An array of new block variation overrides. */ function __unstableBlockStyleVariationOverridesWithConfig({ config }) { const { getBlockStyles, overrides } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ getBlockStyles: select(external_wp_blocks_namespaceObject.store).getBlockStyles, overrides: unlock(select(store)).getStyleOverrides() }), []); const { getBlockName } = (0,external_wp_data_namespaceObject.useSelect)(store); const overridesWithConfig = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!overrides?.length) { return; } const newOverrides = []; const overriddenClientIds = []; for (const [, override] of overrides) { if (override?.variation && override?.clientId && /* * Because this component overwrites existing style overrides, * filter out any overrides that are already present in the store. */ !overriddenClientIds.includes(override.clientId)) { const blockName = getBlockName(override.clientId); const configStyles = config?.styles?.blocks?.[blockName]?.variations?.[override.variation]; if (configStyles) { const variationConfig = { settings: config?.settings, // The variation style data is all that is needed to generate // the styles for the current application to a block. The variation // name is updated to match the instance specific class name. styles: { blocks: { [blockName]: { variations: { [`${override.variation}-${override.clientId}`]: configStyles } } } } }; const blockSelectors = getBlockSelectors((0,external_wp_blocks_namespaceObject.getBlockTypes)(), getBlockStyles, override.clientId); const hasBlockGapSupport = false; const hasFallbackGapSupport = true; const disableLayoutStyles = true; const disableRootPadding = true; const variationStyles = toStyles(variationConfig, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport, disableLayoutStyles, disableRootPadding, { blockGap: false, blockStyles: true, layoutStyles: false, marginReset: false, presets: false, rootPadding: false, variationStyles: true }); newOverrides.push({ id: `${override.variation}-${override.clientId}`, css: variationStyles, __unstableType: 'variation', variation: override.variation, // The clientId will be stored with the override and used to ensure // the order of overrides matches the order of blocks so that the // correct CSS cascade is maintained. clientId: override.clientId }); overriddenClientIds.push(override.clientId); } } } return newOverrides; }, [config, overrides, getBlockStyles, getBlockName]); if (!overridesWithConfig || !overridesWithConfig.length) { return; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: overridesWithConfig.map(override => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverrideStyles, { override: override }, override.id)) }); } /** * Retrieves any variation styles data and resolves any referenced values. * * @param {Object} globalStyles A complete global styles object, containing settings and styles. * @param {string} name The name of the desired block type. * @param {variation} variation The of the block style variation to retrieve data for. * * @return {Object|undefined} The global styles data for the specified variation. */ function getVariationStylesWithRefValues(globalStyles, name, variation) { if (!globalStyles?.styles?.blocks?.[name]?.variations?.[variation]) { return; } // Helper to recursively look for `ref` values to resolve. const replaceRefs = variationStyles => { Object.keys(variationStyles).forEach(key => { const value = variationStyles[key]; // Only process objects. if (typeof value === 'object' && value !== null) { // Process `ref` value if present. if (value.ref !== undefined) { if (typeof value.ref !== 'string' || value.ref.trim() === '') { // Remove invalid ref. delete variationStyles[key]; } else { // Resolve `ref` value. const refValue = getValueFromObjectPath(globalStyles, value.ref); if (refValue) { variationStyles[key] = refValue; } else { delete variationStyles[key]; } } } else { // Recursively resolve `ref` values in nested objects. replaceRefs(value); // After recursion, if value is empty due to explicitly // `undefined` ref value, remove it. if (Object.keys(value).length === 0) { delete variationStyles[key]; } } } }); }; // Deep clone variation node to avoid mutating it within global styles and losing refs. const styles = JSON.parse(JSON.stringify(globalStyles.styles.blocks[name].variations[variation])); replaceRefs(styles); return styles; } function useBlockStyleVariation(name, variation, clientId) { // Prefer global styles data in GlobalStylesContext, which are available // if in the site editor. Otherwise fall back to whatever is in the // editor settings and available in the post editor. const { merged: mergedConfig } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext); const { globalSettings, globalStyles } = (0,external_wp_data_namespaceObject.useSelect)(select => { const settings = select(store).getSettings(); return { globalSettings: settings.__experimentalFeatures, globalStyles: settings[globalStylesDataKey] }; }, []); return (0,external_wp_element_namespaceObject.useMemo)(() => { var _mergedConfig$setting, _mergedConfig$styles, _mergedConfig$setting2; const variationStyles = getVariationStylesWithRefValues({ settings: (_mergedConfig$setting = mergedConfig?.settings) !== null && _mergedConfig$setting !== void 0 ? _mergedConfig$setting : globalSettings, styles: (_mergedConfig$styles = mergedConfig?.styles) !== null && _mergedConfig$styles !== void 0 ? _mergedConfig$styles : globalStyles }, name, variation); return { settings: (_mergedConfig$setting2 = mergedConfig?.settings) !== null && _mergedConfig$setting2 !== void 0 ? _mergedConfig$setting2 : globalSettings, // The variation style data is all that is needed to generate // the styles for the current application to a block. The variation // name is updated to match the instance specific class name. styles: { blocks: { [name]: { variations: { [`${variation}-${clientId}`]: variationStyles } } } } }; }, [mergedConfig, globalSettings, globalStyles, variation, clientId, name]); } // Rather than leveraging `useInstanceId` here, the `clientId` is used. // This is so that the variation style override's ID is predictable // when the order of applied style variations changes. function block_style_variation_useBlockProps({ name, className, clientId }) { const { getBlockStyles } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); const registeredStyles = getBlockStyles(name); const variation = getVariationNameFromClass(className, registeredStyles); const variationClass = `${VARIATION_PREFIX}${variation}-${clientId}`; const { settings, styles } = useBlockStyleVariation(name, variation, clientId); const variationStyles = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!variation) { return; } const variationConfig = { settings, styles }; const blockSelectors = getBlockSelectors((0,external_wp_blocks_namespaceObject.getBlockTypes)(), getBlockStyles, clientId); const hasBlockGapSupport = false; const hasFallbackGapSupport = true; const disableLayoutStyles = true; const disableRootPadding = true; return toStyles(variationConfig, blockSelectors, hasBlockGapSupport, hasFallbackGapSupport, disableLayoutStyles, disableRootPadding, { blockGap: false, blockStyles: true, layoutStyles: false, marginReset: false, presets: false, rootPadding: false, variationStyles: true }); }, [variation, settings, styles, getBlockStyles, clientId]); usePrivateStyleOverride({ id: `variation-${clientId}`, css: variationStyles, __unstableType: 'variation', variation, // The clientId will be stored with the override and used to ensure // the order of overrides matches the order of blocks so that the // correct CSS cascade is maintained. clientId }); return variation ? { className: variationClass } : {}; } /* harmony default export */ const block_style_variation = ({ hasSupport: () => true, attributeKeys: ['className'], isMatch: ({ className }) => getVariationMatches(className).length > 0, useBlockProps: block_style_variation_useBlockProps }); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/layout.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const layoutBlockSupportKey = 'layout'; const { kebabCase: layout_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); function hasLayoutBlockSupport(blockName) { return (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'layout') || (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, '__experimentalLayout'); } /** * Generates the utility classnames for the given block's layout attributes. * * @param { Object } blockAttributes Block attributes. * @param { string } blockName Block name. * * @return { Array } Array of CSS classname strings. */ function useLayoutClasses(blockAttributes = {}, blockName = '') { const { layout } = blockAttributes; const { default: defaultBlockLayout } = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, layoutBlockSupportKey) || {}; const usedLayout = layout?.inherit || layout?.contentSize || layout?.wideSize ? { ...layout, type: 'constrained' } : layout || defaultBlockLayout || {}; const layoutClassnames = []; if (LAYOUT_DEFINITIONS[usedLayout?.type || 'default']?.className) { const baseClassName = LAYOUT_DEFINITIONS[usedLayout?.type || 'default']?.className; const splitBlockName = blockName.split('/'); const fullBlockName = splitBlockName[0] === 'core' ? splitBlockName.pop() : splitBlockName.join('-'); const compoundClassName = `wp-block-${fullBlockName}-${baseClassName}`; layoutClassnames.push(baseClassName, compoundClassName); } const hasGlobalPadding = (0,external_wp_data_namespaceObject.useSelect)(select => { return (usedLayout?.inherit || usedLayout?.contentSize || usedLayout?.type === 'constrained') && select(store).getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments; }, [usedLayout?.contentSize, usedLayout?.inherit, usedLayout?.type]); if (hasGlobalPadding) { layoutClassnames.push('has-global-padding'); } if (usedLayout?.orientation) { layoutClassnames.push(`is-${layout_kebabCase(usedLayout.orientation)}`); } if (usedLayout?.justifyContent) { layoutClassnames.push(`is-content-justification-${layout_kebabCase(usedLayout.justifyContent)}`); } if (usedLayout?.flexWrap && usedLayout.flexWrap === 'nowrap') { layoutClassnames.push('is-nowrap'); } return layoutClassnames; } /** * Generates a CSS rule with the given block's layout styles. * * @param { Object } blockAttributes Block attributes. * @param { string } blockName Block name. * @param { string } selector A selector to use in generating the CSS rule. * * @return { string } CSS rule. */ function useLayoutStyles(blockAttributes = {}, blockName, selector) { const { layout = {}, style = {} } = blockAttributes; // Update type for blocks using legacy layouts. const usedLayout = layout?.inherit || layout?.contentSize || layout?.wideSize ? { ...layout, type: 'constrained' } : layout || {}; const fullLayoutType = getLayoutType(usedLayout?.type || 'default'); const [blockGapSupport] = use_settings_useSettings('spacing.blockGap'); const hasBlockGapSupport = blockGapSupport !== null; return fullLayoutType?.getLayoutStyle?.({ blockName, selector, layout, style, hasBlockGapSupport }); } function LayoutPanelPure({ layout, setAttributes, name: blockName, clientId }) { const settings = useBlockSettings(blockName); // Block settings come from theme.json under settings.[blockName]. const { layout: layoutSettings } = settings; const { themeSupportsLayout } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(store); return { themeSupportsLayout: getSettings().supportsLayout }; }, []); const blockEditingMode = useBlockEditingMode(); if (blockEditingMode !== 'default') { return null; } // Layout block support comes from the block's block.json. const layoutBlockSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, layoutBlockSupportKey, {}); const blockSupportAndThemeSettings = { ...layoutSettings, ...layoutBlockSupport }; const { allowSwitching, allowEditing = true, allowInheriting = true, default: defaultBlockLayout } = blockSupportAndThemeSettings; if (!allowEditing) { return null; } /* * Try to find the layout type from either the * block's layout settings or any saved layout config. */ const blockSupportAndLayout = { ...layoutBlockSupport, ...layout }; const { type, default: { type: defaultType = 'default' } = {} } = blockSupportAndLayout; const blockLayoutType = type || defaultType; // Only show the inherit toggle if it's supported, // and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other. const showInheritToggle = !!(allowInheriting && (!blockLayoutType || blockLayoutType === 'default' || blockLayoutType === 'constrained' || blockSupportAndLayout.inherit)); const usedLayout = layout || defaultBlockLayout || {}; const { inherit = false, contentSize = null } = usedLayout; /** * `themeSupportsLayout` is only relevant to the `default/flow` or * `constrained` layouts and it should not be taken into account when other * `layout` types are used. */ if ((blockLayoutType === 'default' || blockLayoutType === 'constrained') && !themeSupportsLayout) { return null; } const layoutType = getLayoutType(blockLayoutType); const constrainedType = getLayoutType('constrained'); const displayControlsForLegacyLayouts = !usedLayout.type && (contentSize || inherit); const hasContentSizeOrLegacySettings = !!inherit || !!contentSize; const onChangeType = newType => setAttributes({ layout: { type: newType } }); const onChangeLayout = newLayout => setAttributes({ layout: newLayout }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Layout'), children: [showInheritToggle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Inner blocks use content width'), checked: layoutType?.name === 'constrained' || hasContentSizeOrLegacySettings, onChange: () => setAttributes({ layout: { type: layoutType?.name === 'constrained' || hasContentSizeOrLegacySettings ? 'default' : 'constrained' } }), help: layoutType?.name === 'constrained' || hasContentSizeOrLegacySettings ? (0,external_wp_i18n_namespaceObject.__)('Nested blocks use content width with options for full and wide widths.') : (0,external_wp_i18n_namespaceObject.__)('Nested blocks will fill the width of this container.') }) }), !inherit && allowSwitching && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LayoutTypeSwitcher, { type: blockLayoutType, onChange: onChangeType }), layoutType && layoutType.name !== 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layoutType.inspectorControls, { layout: usedLayout, onChange: onChangeLayout, layoutBlockSupport: blockSupportAndThemeSettings, name: blockName, clientId: clientId }), constrainedType && displayControlsForLegacyLayouts && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(constrainedType.inspectorControls, { layout: usedLayout, onChange: onChangeLayout, layoutBlockSupport: blockSupportAndThemeSettings, name: blockName, clientId: clientId })] }) }), !inherit && layoutType && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(layoutType.toolBarControls, { layout: usedLayout, onChange: onChangeLayout, layoutBlockSupport: layoutBlockSupport, name: blockName, clientId: clientId })] }); } /* harmony default export */ const layout = ({ shareWithChildBlocks: true, edit: LayoutPanelPure, attributeKeys: ['layout'], hasSupport(name) { return hasLayoutBlockSupport(name); } }); function LayoutTypeSwitcher({ type, onChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, isBlock: true, label: (0,external_wp_i18n_namespaceObject.__)('Layout type'), __nextHasNoMarginBottom: true, hideLabelFromVision: true, isAdaptiveWidth: true, value: type, onChange: onChange, children: getLayoutTypes().map(({ name, label }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: name, label: label }, name); }) }); } /** * Filters registered block settings, extending attributes to include `layout`. * * @param {Object} settings Original block settings. * * @return {Object} Filtered block settings. */ function layout_addAttribute(settings) { var _settings$attributes$; if ('type' in ((_settings$attributes$ = settings.attributes?.layout) !== null && _settings$attributes$ !== void 0 ? _settings$attributes$ : {})) { return settings; } if (hasLayoutBlockSupport(settings)) { settings.attributes = { ...settings.attributes, layout: { type: 'object' } }; } return settings; } function BlockWithLayoutStyles({ block: BlockListBlock, props, blockGapSupport, layoutClasses }) { const { name, attributes } = props; const id = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockListBlock); const { layout } = attributes; const { default: defaultBlockLayout } = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, layoutBlockSupportKey) || {}; const usedLayout = layout?.inherit || layout?.contentSize || layout?.wideSize ? { ...layout, type: 'constrained' } : layout || defaultBlockLayout || {}; const selectorPrefix = `wp-container-${layout_kebabCase(name)}-is-layout-`; // Higher specificity to override defaults from theme.json. const selector = `.${selectorPrefix}${id}`; const hasBlockGapSupport = blockGapSupport !== null; // Get CSS string for the current layout type. // The CSS and `style` element is only output if it is not empty. const fullLayoutType = getLayoutType(usedLayout?.type || 'default'); const css = fullLayoutType?.getLayoutStyle?.({ blockName: name, selector, layout: usedLayout, style: attributes?.style, hasBlockGapSupport }); // Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`. const layoutClassNames = dist_clsx({ [`${selectorPrefix}${id}`]: !!css // Only attach a container class if there is generated CSS to be attached. }, layoutClasses); useStyleOverride({ css }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListBlock, { ...props, __unstableLayoutClassNames: layoutClassNames }); } /** * Override the default block element to add the layout styles. * * @param {Function} BlockListBlock Original component. * * @return {Function} Wrapped component. */ const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockListBlock => props => { const { clientId, name, attributes } = props; const blockSupportsLayout = hasLayoutBlockSupport(name); const layoutClasses = useLayoutClasses(attributes, name); const extraProps = (0,external_wp_data_namespaceObject.useSelect)(select => { // The callback returns early to avoid block editor subscription. if (!blockSupportsLayout) { return; } const { getSettings, getBlockSettings } = unlock(select(store)); const { disableLayoutStyles } = getSettings(); if (disableLayoutStyles) { return; } const [blockGapSupport] = getBlockSettings(clientId, 'spacing.blockGap'); return { blockGapSupport }; }, [blockSupportsLayout, clientId]); if (!extraProps) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListBlock, { ...props, __unstableLayoutClassNames: blockSupportsLayout ? layoutClasses : undefined }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockWithLayoutStyles, { block: BlockListBlock, props: props, layoutClasses: layoutClasses, ...extraProps }); }, 'withLayoutStyles'); (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/layout/addAttribute', layout_addAttribute); (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/layout/with-layout-styles', withLayoutStyles); ;// ./node_modules/@wordpress/block-editor/build-module/components/grid/utils.js function range(start, length) { return Array.from({ length }, (_, i) => start + i); } class GridRect { constructor({ columnStart, rowStart, columnEnd, rowEnd, columnSpan, rowSpan } = {}) { this.columnStart = columnStart !== null && columnStart !== void 0 ? columnStart : 1; this.rowStart = rowStart !== null && rowStart !== void 0 ? rowStart : 1; if (columnSpan !== undefined) { this.columnEnd = this.columnStart + columnSpan - 1; } else { this.columnEnd = columnEnd !== null && columnEnd !== void 0 ? columnEnd : this.columnStart; } if (rowSpan !== undefined) { this.rowEnd = this.rowStart + rowSpan - 1; } else { this.rowEnd = rowEnd !== null && rowEnd !== void 0 ? rowEnd : this.rowStart; } } get columnSpan() { return this.columnEnd - this.columnStart + 1; } get rowSpan() { return this.rowEnd - this.rowStart + 1; } contains(column, row) { return column >= this.columnStart && column <= this.columnEnd && row >= this.rowStart && row <= this.rowEnd; } containsRect(rect) { return this.contains(rect.columnStart, rect.rowStart) && this.contains(rect.columnEnd, rect.rowEnd); } intersectsRect(rect) { return this.columnStart <= rect.columnEnd && this.columnEnd >= rect.columnStart && this.rowStart <= rect.rowEnd && this.rowEnd >= rect.rowStart; } } function utils_getComputedCSS(element, property) { return element.ownerDocument.defaultView.getComputedStyle(element).getPropertyValue(property); } /** * Given a grid-template-columns or grid-template-rows CSS property value, gets the start and end * position in pixels of each grid track. * * https://css-tricks.com/snippets/css/complete-guide-grid/#aa-grid-track * * @param {string} template The grid-template-columns or grid-template-rows CSS property value. * Only supports fixed sizes in pixels. * @param {number} gap The gap between grid tracks in pixels. * * @return {Array<{start: number, end: number}>} An array of objects with the start and end * position in pixels of each grid track. */ function getGridTracks(template, gap) { const tracks = []; for (const size of template.split(' ')) { const previousTrack = tracks[tracks.length - 1]; const start = previousTrack ? previousTrack.end + gap : 0; const end = start + parseFloat(size); tracks.push({ start, end }); } return tracks; } /** * Given an array of grid tracks and a position in pixels, gets the index of the closest track to * that position. * * https://css-tricks.com/snippets/css/complete-guide-grid/#aa-grid-track * * @param {Array<{start: number, end: number}>} tracks An array of objects with the start and end * position in pixels of each grid track. * @param {number} position The position in pixels. * @param {string} edge The edge of the track to compare the * position to. Either 'start' or 'end'. * * @return {number} The index of the closest track to the position. 0-based, unlike CSS grid which * is 1-based. */ function getClosestTrack(tracks, position, edge = 'start') { return tracks.reduce((closest, track, index) => Math.abs(track[edge] - position) < Math.abs(tracks[closest][edge] - position) ? index : closest, 0); } function getGridRect(gridElement, rect) { const columnGap = parseFloat(utils_getComputedCSS(gridElement, 'column-gap')); const rowGap = parseFloat(utils_getComputedCSS(gridElement, 'row-gap')); const gridColumnTracks = getGridTracks(utils_getComputedCSS(gridElement, 'grid-template-columns'), columnGap); const gridRowTracks = getGridTracks(utils_getComputedCSS(gridElement, 'grid-template-rows'), rowGap); const columnStart = getClosestTrack(gridColumnTracks, rect.left) + 1; const rowStart = getClosestTrack(gridRowTracks, rect.top) + 1; const columnEnd = getClosestTrack(gridColumnTracks, rect.right, 'end') + 1; const rowEnd = getClosestTrack(gridRowTracks, rect.bottom, 'end') + 1; return new GridRect({ columnStart, columnEnd, rowStart, rowEnd }); } function getGridItemRect(gridItemElement) { return getGridRect(gridItemElement.parentElement, new window.DOMRect(gridItemElement.offsetLeft, gridItemElement.offsetTop, gridItemElement.offsetWidth, gridItemElement.offsetHeight)); } function getGridInfo(gridElement) { const gridTemplateColumns = utils_getComputedCSS(gridElement, 'grid-template-columns'); const gridTemplateRows = utils_getComputedCSS(gridElement, 'grid-template-rows'); const borderTopWidth = utils_getComputedCSS(gridElement, 'border-top-width'); const borderRightWidth = utils_getComputedCSS(gridElement, 'border-right-width'); const borderBottomWidth = utils_getComputedCSS(gridElement, 'border-bottom-width'); const borderLeftWidth = utils_getComputedCSS(gridElement, 'border-left-width'); const paddingTop = utils_getComputedCSS(gridElement, 'padding-top'); const paddingRight = utils_getComputedCSS(gridElement, 'padding-right'); const paddingBottom = utils_getComputedCSS(gridElement, 'padding-bottom'); const paddingLeft = utils_getComputedCSS(gridElement, 'padding-left'); const numColumns = gridTemplateColumns.split(' ').length; const numRows = gridTemplateRows.split(' ').length; const numItems = numColumns * numRows; return { numColumns, numRows, numItems, currentColor: utils_getComputedCSS(gridElement, 'color'), style: { gridTemplateColumns, gridTemplateRows, gap: utils_getComputedCSS(gridElement, 'gap'), inset: ` calc(${paddingTop} + ${borderTopWidth}) calc(${paddingRight} + ${borderRightWidth}) calc(${paddingBottom} + ${borderBottomWidth}) calc(${paddingLeft} + ${borderLeftWidth}) ` } }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/tips.js /** * WordPress dependencies */ const globalTips = [(0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('While writing, you can press <kbd>/</kbd> to quickly insert new blocks.'), { kbd: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", {}) }), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Indent a list by pressing <kbd>space</kbd> at the beginning of a line.'), { kbd: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", {}) }), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line.'), { kbd: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("kbd", {}) }), (0,external_wp_i18n_namespaceObject.__)('Drag files into the editor to automatically insert media blocks.'), (0,external_wp_i18n_namespaceObject.__)("Change a block's type by pressing the block icon on the toolbar.")]; function Tips() { const [randomIndex] = (0,external_wp_element_namespaceObject.useState)( // Disable Reason: I'm not generating an HTML id. // eslint-disable-next-line no-restricted-syntax Math.floor(Math.random() * globalTips.length)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tip, { children: globalTips[randomIndex] }); } /* harmony default export */ const tips = (Tips); ;// ./node_modules/@wordpress/icons/build-module/library/chevron-right.js /** * WordPress dependencies */ const chevronRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) }); /* harmony default export */ const chevron_right = (chevronRight); ;// ./node_modules/@wordpress/icons/build-module/library/chevron-left.js /** * WordPress dependencies */ const chevronLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) }); /* harmony default export */ const chevron_left = (chevronLeft); ;// ./node_modules/@wordpress/icons/build-module/library/block-default.js /** * WordPress dependencies */ const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" }) }); /* harmony default export */ const block_default = (blockDefault); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-icon/index.js /** * External dependencies */ /** * WordPress dependencies */ function BlockIcon({ icon, showColors = false, className, context }) { if (icon?.src === 'block-default') { icon = { src: block_default }; } const renderedIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: icon && icon.src ? icon.src : icon, context: context }); const style = showColors ? { backgroundColor: icon && icon.background, color: icon && icon.foreground } : {}; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { style: style, className: dist_clsx('block-editor-block-icon', className, { 'has-colors': showColors }), children: renderedIcon }); } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-icon/README.md */ /* harmony default export */ const block_icon = ((0,external_wp_element_namespaceObject.memo)(BlockIcon)); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-card/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { Badge } = unlock(external_wp_components_namespaceObject.privateApis); /** * A card component that displays block information including title, icon, and description. * Can be used to show block metadata and navigation controls for parent blocks. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-card/README.md * * @example * ```jsx * function Example() { * return ( * <BlockCard * title="My Block" * icon="smiley" * description="A simple block example" * name="Custom Block" * /> * ); * } * ``` * * @param {Object} props Component props. * @param {string} props.title The title of the block. * @param {string|Object} props.icon The icon of the block. This can be any of [WordPress' Dashicons](https://developer.wordpress.org/resource/dashicons/), or a custom `svg` element. * @param {string} props.description The description of the block. * @param {Object} [props.blockType] Deprecated: Object containing block type data. * @param {string} [props.className] Additional classes to apply to the card. * @param {string} [props.name] Custom block name to display before the title. * @return {Element} Block card component. */ function BlockCard({ title, icon, description, blockType, className, name }) { if (blockType) { external_wp_deprecated_default()('`blockType` property in `BlockCard component`', { since: '5.7', alternative: '`title, icon and description` properties' }); ({ title, icon, description } = blockType); } const { parentNavBlockClientId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSelectedBlockClientId, getBlockParentsByBlockName } = select(store); const _selectedBlockClientId = getSelectedBlockClientId(); return { parentNavBlockClientId: getBlockParentsByBlockName(_selectedBlockClientId, 'core/navigation', true)[0] }; }, []); const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx('block-editor-block-card', className), children: [parentNavBlockClientId && /*#__PURE__*/ // This is only used by the Navigation block for now. It's not ideal having Navigation block specific code here. (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { onClick: () => selectBlock(parentNavBlockClientId), label: (0,external_wp_i18n_namespaceObject.__)('Go to parent Navigation block'), style: // TODO: This style override is also used in ToolsPanelHeader. // It should be supported out-of-the-box by Button. { minWidth: 24, padding: 0 }, icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, size: "small" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: icon, showColors: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("h2", { className: "block-editor-block-card__title", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-card__name", children: !!name?.length ? name : title }), !!name?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Badge, { children: title })] }), description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { className: "block-editor-block-card__description", children: description })] })] }); } /* harmony default export */ const block_card = (BlockCard); ;// ./node_modules/@wordpress/upload-media/build-module/store/types.js let Type = /*#__PURE__*/function (Type) { Type["Unknown"] = "REDUX_UNKNOWN"; Type["Add"] = "ADD_ITEM"; Type["Prepare"] = "PREPARE_ITEM"; Type["Cancel"] = "CANCEL_ITEM"; Type["Remove"] = "REMOVE_ITEM"; Type["PauseItem"] = "PAUSE_ITEM"; Type["ResumeItem"] = "RESUME_ITEM"; Type["PauseQueue"] = "PAUSE_QUEUE"; Type["ResumeQueue"] = "RESUME_QUEUE"; Type["OperationStart"] = "OPERATION_START"; Type["OperationFinish"] = "OPERATION_FINISH"; Type["AddOperations"] = "ADD_OPERATIONS"; Type["CacheBlobUrl"] = "CACHE_BLOB_URL"; Type["RevokeBlobUrls"] = "REVOKE_BLOB_URLS"; Type["UpdateSettings"] = "UPDATE_SETTINGS"; return Type; }({}); // Must match the Attachment type from the media-utils package. let ItemStatus = /*#__PURE__*/function (ItemStatus) { ItemStatus["Processing"] = "PROCESSING"; ItemStatus["Paused"] = "PAUSED"; return ItemStatus; }({}); let OperationType = /*#__PURE__*/function (OperationType) { OperationType["Prepare"] = "PREPARE"; OperationType["Upload"] = "UPLOAD"; return OperationType; }({}); ;// ./node_modules/@wordpress/upload-media/build-module/store/reducer.js /** * Internal dependencies */ const reducer_noop = () => {}; const DEFAULT_STATE = { queue: [], queueStatus: 'active', blobUrls: {}, settings: { mediaUpload: reducer_noop } }; function reducer_reducer(state = DEFAULT_STATE, action = { type: Type.Unknown }) { switch (action.type) { case Type.PauseQueue: { return { ...state, queueStatus: 'paused' }; } case Type.ResumeQueue: { return { ...state, queueStatus: 'active' }; } case Type.Add: return { ...state, queue: [...state.queue, action.item] }; case Type.Cancel: return { ...state, queue: state.queue.map(item => item.id === action.id ? { ...item, error: action.error } : item) }; case Type.Remove: return { ...state, queue: state.queue.filter(item => item.id !== action.id) }; case Type.OperationStart: { return { ...state, queue: state.queue.map(item => item.id === action.id ? { ...item, currentOperation: action.operation } : item) }; } case Type.AddOperations: return { ...state, queue: state.queue.map(item => { if (item.id !== action.id) { return item; } return { ...item, operations: [...(item.operations || []), ...action.operations] }; }) }; case Type.OperationFinish: return { ...state, queue: state.queue.map(item => { if (item.id !== action.id) { return item; } const operations = item.operations ? item.operations.slice(1) : []; // Prevent an empty object if there's no attachment data. const attachment = item.attachment || action.item.attachment ? { ...item.attachment, ...action.item.attachment } : undefined; return { ...item, currentOperation: undefined, operations, ...action.item, attachment, additionalData: { ...item.additionalData, ...action.item.additionalData } }; }) }; case Type.CacheBlobUrl: { const blobUrls = state.blobUrls[action.id] || []; return { ...state, blobUrls: { ...state.blobUrls, [action.id]: [...blobUrls, action.blobUrl] } }; } case Type.RevokeBlobUrls: { const newBlobUrls = { ...state.blobUrls }; delete newBlobUrls[action.id]; return { ...state, blobUrls: newBlobUrls }; } case Type.UpdateSettings: { return { ...state, settings: { ...state.settings, ...action.settings } }; } } return state; } /* harmony default export */ const store_reducer = (reducer_reducer); ;// ./node_modules/@wordpress/upload-media/build-module/store/selectors.js /** * Internal dependencies */ /** * Returns all items currently being uploaded. * * @param state Upload state. * * @return Queue items. */ function getItems(state) { return state.queue; } /** * Determines whether any upload is currently in progress. * * @param state Upload state. * * @return Whether any upload is currently in progress. */ function isUploading(state) { return state.queue.length >= 1; } /** * Determines whether an upload is currently in progress given an attachment URL. * * @param state Upload state. * @param url Attachment URL. * * @return Whether upload is currently in progress for the given attachment. */ function isUploadingByUrl(state, url) { return state.queue.some(item => item.attachment?.url === url || item.sourceUrl === url); } /** * Determines whether an upload is currently in progress given an attachment ID. * * @param state Upload state. * @param attachmentId Attachment ID. * * @return Whether upload is currently in progress for the given attachment. */ function isUploadingById(state, attachmentId) { return state.queue.some(item => item.attachment?.id === attachmentId || item.sourceAttachmentId === attachmentId); } /** * Returns the media upload settings. * * @param state Upload state. * * @return Settings */ function selectors_getSettings(state) { return state.settings; } ;// ./node_modules/@wordpress/upload-media/build-module/store/private-selectors.js /** * Internal dependencies */ /** * Returns all items currently being uploaded. * * @param state Upload state. * * @return Queue items. */ function getAllItems(state) { return state.queue; } /** * Returns a specific item given its unique ID. * * @param state Upload state. * @param id Item ID. * * @return Queue item. */ function getItem(state, id) { return state.queue.find(item => item.id === id); } /** * Determines whether a batch has been successfully uploaded, given its unique ID. * * @param state Upload state. * @param batchId Batch ID. * * @return Whether a batch has been uploaded. */ function isBatchUploaded(state, batchId) { const batchItems = state.queue.filter(item => batchId === item.batchId); return batchItems.length === 0; } /** * Determines whether an upload is currently in progress given a post or attachment ID. * * @param state Upload state. * @param postOrAttachmentId Post ID or attachment ID. * * @return Whether upload is currently in progress for the given post or attachment. */ function isUploadingToPost(state, postOrAttachmentId) { return state.queue.some(item => item.currentOperation === OperationType.Upload && item.additionalData.post === postOrAttachmentId); } /** * Returns the next paused upload for a given post or attachment ID. * * @param state Upload state. * @param postOrAttachmentId Post ID or attachment ID. * * @return Paused item. */ function getPausedUploadForPost(state, postOrAttachmentId) { return state.queue.find(item => item.status === ItemStatus.Paused && item.additionalData.post === postOrAttachmentId); } /** * Determines whether uploading is currently paused. * * @param state Upload state. * * @return Whether uploading is currently paused. */ function isPaused(state) { return state.queueStatus === 'paused'; } /** * Returns all cached blob URLs for a given item ID. * * @param state Upload state. * @param id Item ID * * @return List of blob URLs. */ function getBlobUrls(state, id) { return state.blobUrls[id] || []; } ;// ./node_modules/@wordpress/upload-media/node_modules/uuid/dist/esm-browser/native.js const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); /* harmony default export */ const esm_browser_native = ({ randomUUID }); ;// ./node_modules/@wordpress/upload-media/node_modules/uuid/dist/esm-browser/rng.js // Unique ID creation requires a high quality random # generator. In the browser we therefore // require the crypto API and do not support built-in fallback to lower quality random number // generators (like Math.random()). let getRandomValues; const rnds8 = new Uint8Array(16); function rng() { // lazy load so that environments that need to polyfill have a chance to do so if (!getRandomValues) { // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); if (!getRandomValues) { throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); } } return getRandomValues(rnds8); } ;// ./node_modules/@wordpress/upload-media/node_modules/uuid/dist/esm-browser/stringify.js /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ const byteToHex = []; for (let i = 0; i < 256; ++i) { byteToHex.push((i + 0x100).toString(16).slice(1)); } function unsafeStringify(arr, offset = 0) { // Note: Be careful editing this code! It's been tuned for performance // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]; } function stringify(arr, offset = 0) { const uuid = unsafeStringify(arr, offset); // Consistency check for valid UUID. If this throws, it's likely due to one // of the following: // - One or more input array values don't map to a hex octet (leading to // "undefined" in the uuid) // - Invalid input values for the RFC `version` or `variant` fields if (!validate(uuid)) { throw TypeError('Stringified UUID is invalid'); } return uuid; } /* harmony default export */ const esm_browser_stringify = ((/* unused pure expression or super */ null && (stringify))); ;// ./node_modules/@wordpress/upload-media/node_modules/uuid/dist/esm-browser/v4.js function v4(options, buf, offset) { if (esm_browser_native.randomUUID && !buf && !options) { return esm_browser_native.randomUUID(); } options = options || {}; const rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` rnds[6] = rnds[6] & 0x0f | 0x40; rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided if (buf) { offset = offset || 0; for (let i = 0; i < 16; ++i) { buf[offset + i] = rnds[i]; } return buf; } return unsafeStringify(rnds); } /* harmony default export */ const esm_browser_v4 = (v4); ;// ./node_modules/@wordpress/upload-media/build-module/upload-error.js /** * MediaError class. * * Small wrapper around the `Error` class * to hold an error code and a reference to a file object. */ class UploadError extends Error { constructor({ code, message, file, cause }) { super(message, { cause }); Object.setPrototypeOf(this, new.target.prototype); this.code = code; this.file = file; } } ;// ./node_modules/@wordpress/upload-media/build-module/validate-mime-type.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Verifies if the caller (e.g. a block) supports this mime type. * * @param file File object. * @param allowedTypes List of allowed mime types. */ function validateMimeType(file, allowedTypes) { if (!allowedTypes) { return; } // Allowed type specified by consumer. const isAllowedType = allowedTypes.some(allowedType => { // If a complete mimetype is specified verify if it matches exactly the mime type of the file. if (allowedType.includes('/')) { return allowedType === file.type; } // Otherwise a general mime type is used, and we should verify if the file mimetype starts with it. return file.type.startsWith(`${allowedType}/`); }); if (file.type && !isAllowedType) { throw new UploadError({ code: 'MIME_TYPE_NOT_SUPPORTED', message: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: file name. (0,external_wp_i18n_namespaceObject.__)('%s: Sorry, this file type is not supported here.'), file.name), file }); } } ;// ./node_modules/@wordpress/upload-media/build-module/get-mime-types-array.js /** * Browsers may use unexpected mime types, and they differ from browser to browser. * This function computes a flexible array of mime types from the mime type structured provided by the server. * Converts { jpg|jpeg|jpe: "image/jpeg" } into [ "image/jpeg", "image/jpg", "image/jpeg", "image/jpe" ] * * @param {?Object} wpMimeTypesObject Mime type object received from the server. * Extensions are keys separated by '|' and values are mime types associated with an extension. * * @return An array of mime types or null */ function getMimeTypesArray(wpMimeTypesObject) { if (!wpMimeTypesObject) { return null; } return Object.entries(wpMimeTypesObject).flatMap(([extensionsString, mime]) => { const [type] = mime.split('/'); const extensions = extensionsString.split('|'); return [mime, ...extensions.map(extension => `${type}/${extension}`)]; }); } ;// ./node_modules/@wordpress/upload-media/build-module/validate-mime-type-for-user.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Verifies if the user is allowed to upload this mime type. * * @param file File object. * @param wpAllowedMimeTypes List of allowed mime types and file extensions. */ function validateMimeTypeForUser(file, wpAllowedMimeTypes) { // Allowed types for the current WP_User. const allowedMimeTypesForUser = getMimeTypesArray(wpAllowedMimeTypes); if (!allowedMimeTypesForUser) { return; } const isAllowedMimeTypeForUser = allowedMimeTypesForUser.includes(file.type); if (file.type && !isAllowedMimeTypeForUser) { throw new UploadError({ code: 'MIME_TYPE_NOT_ALLOWED_FOR_USER', message: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: file name. (0,external_wp_i18n_namespaceObject.__)('%s: Sorry, you are not allowed to upload this file type.'), file.name), file }); } } ;// ./node_modules/@wordpress/upload-media/build-module/validate-file-size.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Verifies whether the file is within the file upload size limits for the site. * * @param file File object. * @param maxUploadFileSize Maximum upload size in bytes allowed for the site. */ function validateFileSize(file, maxUploadFileSize) { // Don't allow empty files to be uploaded. if (file.size <= 0) { throw new UploadError({ code: 'EMPTY_FILE', message: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: file name. (0,external_wp_i18n_namespaceObject.__)('%s: This file is empty.'), file.name), file }); } if (maxUploadFileSize && file.size > maxUploadFileSize) { throw new UploadError({ code: 'SIZE_ABOVE_LIMIT', message: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: file name. (0,external_wp_i18n_namespaceObject.__)('%s: This file exceeds the maximum upload size for this site.'), file.name), file }); } } ;// ./node_modules/@wordpress/upload-media/build-module/store/actions.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Adds a new item to the upload queue. * * @param $0 * @param $0.files Files * @param [$0.onChange] Function called each time a file or a temporary representation of the file is available. * @param [$0.onSuccess] Function called after the file is uploaded. * @param [$0.onBatchSuccess] Function called after a batch of files is uploaded. * @param [$0.onError] Function called when an error happens. * @param [$0.additionalData] Additional data to include in the request. * @param [$0.allowedTypes] Array with the types of media that can be uploaded, if unset all types are allowed. */ function addItems({ files, onChange, onSuccess, onError, onBatchSuccess, additionalData, allowedTypes }) { return async ({ select, dispatch }) => { const batchId = esm_browser_v4(); for (const file of files) { /* Check if the caller (e.g. a block) supports this mime type. Special case for file types such as HEIC which will be converted before upload anyway. Another check will be done before upload. */ try { validateMimeType(file, allowedTypes); validateMimeTypeForUser(file, select.getSettings().allowedMimeTypes); } catch (error) { onError?.(error); continue; } try { validateFileSize(file, select.getSettings().maxUploadFileSize); } catch (error) { onError?.(error); continue; } dispatch.addItem({ file, batchId, onChange, onSuccess, onBatchSuccess, onError, additionalData }); } }; } /** * Cancels an item in the queue based on an error. * * @param id Item ID. * @param error Error instance. * @param silent Whether to cancel the item silently, * without invoking its `onError` callback. */ function cancelItem(id, error, silent = false) { return async ({ select, dispatch }) => { const item = select.getItem(id); if (!item) { /* * Do nothing if item has already been removed. * This can happen if an upload is cancelled manually * while transcoding with vips is still in progress. * Then, cancelItem() is once invoked manually and once * by the error handler in optimizeImageItem(). */ return; } item.abortController?.abort(); if (!silent) { const { onError } = item; onError?.(error !== null && error !== void 0 ? error : new Error('Upload cancelled')); if (!onError && error) { // TODO: Find better way to surface errors with sideloads etc. // eslint-disable-next-line no-console -- Deliberately log errors here. console.error('Upload cancelled', error); } } dispatch({ type: Type.Cancel, id, error }); dispatch.removeItem(id); dispatch.revokeBlobUrls(id); // All items of this batch were cancelled or finished. if (item.batchId && select.isBatchUploaded(item.batchId)) { item.onBatchSuccess?.(); } }; } ;// ./node_modules/@wordpress/upload-media/build-module/utils.js /** * WordPress dependencies */ /** * Converts a Blob to a File with a default name like "image.png". * * If it is already a File object, it is returned unchanged. * * @param fileOrBlob Blob object. * @return File object. */ function convertBlobToFile(fileOrBlob) { if (fileOrBlob instanceof File) { return fileOrBlob; } // Extension is only an approximation. // The server will override it if incorrect. const ext = fileOrBlob.type.split('/')[1]; const mediaType = 'application/pdf' === fileOrBlob.type ? 'document' : fileOrBlob.type.split('/')[0]; return new File([fileOrBlob], `${mediaType}.${ext}`, { type: fileOrBlob.type }); } /** * Renames a given file and returns a new file. * * Copies over the last modified time. * * @param file File object. * @param name File name. * @return Renamed file object. */ function renameFile(file, name) { return new File([file], name, { type: file.type, lastModified: file.lastModified }); } /** * Clones a given file object. * * @param file File object. * @return New file object. */ function cloneFile(file) { return renameFile(file, file.name); } /** * Returns the file extension from a given file name or URL. * * @param file File URL. * @return File extension or null if it does not have one. */ function getFileExtension(file) { return file.includes('.') ? file.split('.').pop() || null : null; } /** * Returns file basename without extension. * * For example, turns "my-awesome-file.jpeg" into "my-awesome-file". * * @param name File name. * @return File basename. */ function getFileBasename(name) { return name.includes('.') ? name.split('.').slice(0, -1).join('.') : name; } /** * Returns the file name including extension from a URL. * * @param url File URL. * @return File name. */ function getFileNameFromUrl(url) { return getFilename(url) || _x('unnamed', 'file name'); } ;// ./node_modules/@wordpress/upload-media/build-module/stub-file.js class StubFile extends File { constructor(fileName = 'stub-file') { super([], fileName); } } ;// ./node_modules/@wordpress/upload-media/build-module/store/private-actions.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Adds a new item to the upload queue. * * @param $0 * @param $0.file File * @param [$0.batchId] Batch ID. * @param [$0.onChange] Function called each time a file or a temporary representation of the file is available. * @param [$0.onSuccess] Function called after the file is uploaded. * @param [$0.onBatchSuccess] Function called after a batch of files is uploaded. * @param [$0.onError] Function called when an error happens. * @param [$0.additionalData] Additional data to include in the request. * @param [$0.sourceUrl] Source URL. Used when importing a file from a URL or optimizing an existing file. * @param [$0.sourceAttachmentId] Source attachment ID. Used when optimizing an existing file for example. * @param [$0.abortController] Abort controller for upload cancellation. * @param [$0.operations] List of operations to perform. Defaults to automatically determined list, based on the file. */ function addItem({ file: fileOrBlob, batchId, onChange, onSuccess, onBatchSuccess, onError, additionalData = {}, sourceUrl, sourceAttachmentId, abortController, operations }) { return async ({ dispatch }) => { const itemId = esm_browser_v4(); // Hardening in case a Blob is passed instead of a File. // See https://github.com/WordPress/gutenberg/pull/65693 for an example. const file = convertBlobToFile(fileOrBlob); let blobUrl; // StubFile could be coming from addItemFromUrl(). if (!(file instanceof StubFile)) { blobUrl = (0,external_wp_blob_namespaceObject.createBlobURL)(file); dispatch({ type: Type.CacheBlobUrl, id: itemId, blobUrl }); } dispatch({ type: Type.Add, item: { id: itemId, batchId, status: ItemStatus.Processing, sourceFile: cloneFile(file), file, attachment: { url: blobUrl }, additionalData: { convert_format: false, ...additionalData }, onChange, onSuccess, onBatchSuccess, onError, sourceUrl, sourceAttachmentId, abortController: abortController || new AbortController(), operations: Array.isArray(operations) ? operations : [OperationType.Prepare] } }); dispatch.processItem(itemId); }; } /** * Processes a single item in the queue. * * Runs the next operation in line and invokes any callbacks. * * @param id Item ID. */ function processItem(id) { return async ({ select, dispatch }) => { if (select.isPaused()) { return; } const item = select.getItem(id); const { attachment, onChange, onSuccess, onBatchSuccess, batchId } = item; const operation = Array.isArray(item.operations?.[0]) ? item.operations[0][0] : item.operations?.[0]; if (attachment) { onChange?.([attachment]); } /* If there are no more operations, the item can be removed from the queue, but only if there are no thumbnails still being side-loaded, or if itself is a side-loaded item. */ if (!operation) { if (attachment) { onSuccess?.([attachment]); } // dispatch.removeItem( id ); dispatch.revokeBlobUrls(id); if (batchId && select.isBatchUploaded(batchId)) { onBatchSuccess?.(); } /* At this point we are dealing with a parent whose children haven't fully uploaded yet. Do nothing and let the removal happen once the last side-loaded item finishes. */ return; } if (!operation) { // This shouldn't really happen. return; } dispatch({ type: Type.OperationStart, id, operation }); switch (operation) { case OperationType.Prepare: dispatch.prepareItem(item.id); break; case OperationType.Upload: dispatch.uploadItem(id); break; } }; } /** * Returns an action object that pauses all processing in the queue. * * Useful for testing purposes. * * @return Action object. */ function pauseQueue() { return { type: Type.PauseQueue }; } /** * Resumes all processing in the queue. * * Dispatches an action object for resuming the queue itself, * and triggers processing for each remaining item in the queue individually. */ function resumeQueue() { return async ({ select, dispatch }) => { dispatch({ type: Type.ResumeQueue }); for (const item of select.getAllItems()) { dispatch.processItem(item.id); } }; } /** * Removes a specific item from the queue. * * @param id Item ID. */ function removeItem(id) { return async ({ select, dispatch }) => { const item = select.getItem(id); if (!item) { return; } dispatch({ type: Type.Remove, id }); }; } /** * Finishes an operation for a given item ID and immediately triggers processing the next one. * * @param id Item ID. * @param updates Updated item data. */ function finishOperation(id, updates) { return async ({ dispatch }) => { dispatch({ type: Type.OperationFinish, id, item: updates }); dispatch.processItem(id); }; } /** * Prepares an item for initial processing. * * Determines the list of operations to perform for a given image, * depending on its media type. * * For example, HEIF images first need to be converted, resized, * compressed, and then uploaded. * * Or videos need to be compressed, and then need poster generation * before upload. * * @param id Item ID. */ function prepareItem(id) { return async ({ dispatch }) => { const operations = [OperationType.Upload]; dispatch({ type: Type.AddOperations, id, operations }); dispatch.finishOperation(id, {}); }; } /** * Uploads an item to the server. * * @param id Item ID. */ function uploadItem(id) { return async ({ select, dispatch }) => { const item = select.getItem(id); select.getSettings().mediaUpload({ filesList: [item.file], additionalData: item.additionalData, signal: item.abortController?.signal, onFileChange: ([attachment]) => { if (!(0,external_wp_blob_namespaceObject.isBlobURL)(attachment.url)) { dispatch.finishOperation(id, { attachment }); } }, onSuccess: ([attachment]) => { dispatch.finishOperation(id, { attachment }); }, onError: error => { dispatch.cancelItem(id, error); } }); }; } /** * Revokes all blob URLs for a given item, freeing up memory. * * @param id Item ID. */ function revokeBlobUrls(id) { return async ({ select, dispatch }) => { const blobUrls = select.getBlobUrls(id); for (const blobUrl of blobUrls) { (0,external_wp_blob_namespaceObject.revokeBlobURL)(blobUrl); } dispatch({ type: Type.RevokeBlobUrls, id }); }; } /** * Returns an action object that pauses all processing in the queue. * * Useful for testing purposes. * * @param settings * @return Action object. */ function private_actions_updateSettings(settings) { return { type: Type.UpdateSettings, settings }; } ;// ./node_modules/@wordpress/upload-media/build-module/lock-unlock.js /** * WordPress dependencies */ const { lock: lock_unlock_lock, unlock: lock_unlock_unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/upload-media'); ;// ./node_modules/@wordpress/upload-media/build-module/store/constants.js const constants_STORE_NAME = 'core/upload-media'; ;// ./node_modules/@wordpress/upload-media/build-module/store/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Media upload data store configuration. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore */ const store_storeConfig = { reducer: store_reducer, selectors: store_selectors_namespaceObject, actions: store_actions_namespaceObject }; /** * Store definition for the media upload namespace. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore */ const store_store = (0,external_wp_data_namespaceObject.createReduxStore)(constants_STORE_NAME, { reducer: store_reducer, selectors: store_selectors_namespaceObject, actions: store_actions_namespaceObject }); (0,external_wp_data_namespaceObject.register)(store_store); // @ts-ignore lock_unlock_unlock(store_store).registerPrivateActions(store_private_actions_namespaceObject); // @ts-ignore lock_unlock_unlock(store_store).registerPrivateSelectors(store_private_selectors_namespaceObject); ;// ./node_modules/@wordpress/upload-media/build-module/components/provider/with-registry-provider.js /** * WordPress dependencies */ /** * Internal dependencies */ function getSubRegistry(subRegistries, registry, useSubRegistry) { if (!useSubRegistry) { return registry; } let subRegistry = subRegistries.get(registry); if (!subRegistry) { subRegistry = (0,external_wp_data_namespaceObject.createRegistry)({}, registry); subRegistry.registerStore(constants_STORE_NAME, store_storeConfig); subRegistries.set(registry, subRegistry); } return subRegistry; } const withRegistryProvider = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => ({ useSubRegistry = true, ...props }) => { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const [subRegistries] = (0,external_wp_element_namespaceObject.useState)(() => new WeakMap()); const subRegistry = getSubRegistry(subRegistries, registry, useSubRegistry); if (subRegistry === registry) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { registry: registry, ...props }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.RegistryProvider, { value: subRegistry, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { registry: subRegistry, ...props }) }); }, 'withRegistryProvider'); /* harmony default export */ const with_registry_provider = (withRegistryProvider); ;// ./node_modules/@wordpress/upload-media/build-module/components/provider/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const MediaUploadProvider = with_registry_provider(props => { const { children, settings } = props; const { updateSettings } = lock_unlock_unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); (0,external_wp_element_namespaceObject.useEffect)(() => { updateSettings(settings); }, [settings, updateSettings]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: children }); }); /* harmony default export */ const provider = (MediaUploadProvider); ;// ./node_modules/@wordpress/block-editor/build-module/components/provider/with-registry-provider.js /** * WordPress dependencies */ /** * Internal dependencies */ function with_registry_provider_getSubRegistry(subRegistries, registry, useSubRegistry) { if (!useSubRegistry) { return registry; } let subRegistry = subRegistries.get(registry); if (!subRegistry) { subRegistry = (0,external_wp_data_namespaceObject.createRegistry)({}, registry); subRegistry.registerStore(STORE_NAME, storeConfig); subRegistries.set(registry, subRegistry); } return subRegistry; } const with_registry_provider_withRegistryProvider = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => ({ useSubRegistry = true, ...props }) => { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const [subRegistries] = (0,external_wp_element_namespaceObject.useState)(() => new WeakMap()); const subRegistry = with_registry_provider_getSubRegistry(subRegistries, registry, useSubRegistry); if (subRegistry === registry) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { registry: registry, ...props }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.RegistryProvider, { value: subRegistry, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { registry: subRegistry, ...props }) }); }, 'withRegistryProvider'); /* harmony default export */ const provider_with_registry_provider = (with_registry_provider_withRegistryProvider); ;// ./node_modules/@wordpress/block-editor/build-module/components/provider/use-block-sync.js /** * WordPress dependencies */ /** * Internal dependencies */ const use_block_sync_noop = () => {}; /** * A function to call when the block value has been updated in the block-editor * store. * * @callback onBlockUpdate * @param {Object[]} blocks The updated blocks. * @param {Object} options The updated block options, such as selectionStart * and selectionEnd. */ /** * useBlockSync is a side effect which handles bidirectional sync between the * block-editor store and a controlling data source which provides blocks. This * is most commonly used by the BlockEditorProvider to synchronize the contents * of the block-editor store with the root entity, like a post. * * Another example would be the template part block, which provides blocks from * a separate entity data source than a root entity. This hook syncs edits to * the template part in the block editor back to the entity and vice-versa. * * Here are some of its basic functions: * - Initializes the block-editor store for the given clientID to the blocks * given via props. * - Adds incoming changes (like undo) to the block-editor store. * - Adds outgoing changes (like editing content) to the controlling entity, * determining if a change should be considered persistent or not. * - Handles edge cases and race conditions which occur in those operations. * - Ignores changes which happen to other entities (like nested inner block * controllers. * - Passes selection state from the block-editor store to the controlling entity. * * @param {Object} props Props for the block sync hook * @param {string} props.clientId The client ID of the inner block controller. * If none is passed, then it is assumed to be a * root controller rather than an inner block * controller. * @param {Object[]} props.value The control value for the blocks. This value * is used to initialize the block-editor store * and for resetting the blocks to incoming * changes like undo. * @param {Object} props.selection The selection state responsible to restore the selection on undo/redo. * @param {onBlockUpdate} props.onChange Function to call when a persistent * change has been made in the block-editor blocks * for the given clientId. For example, after * this function is called, an entity is marked * dirty because it has changes to save. * @param {onBlockUpdate} props.onInput Function to call when a non-persistent * change has been made in the block-editor blocks * for the given clientId. When this is called, * controlling sources do not become dirty. */ function useBlockSync({ clientId = null, value: controlledBlocks, selection: controlledSelection, onChange = use_block_sync_noop, onInput = use_block_sync_noop }) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { resetBlocks, resetSelection, replaceInnerBlocks, setHasControlledInnerBlocks, __unstableMarkNextChangeAsNotPersistent } = registry.dispatch(store); const { getBlockName, getBlocks, getSelectionStart, getSelectionEnd } = registry.select(store); const isControlled = (0,external_wp_data_namespaceObject.useSelect)(select => { return !clientId || select(store).areInnerBlocksControlled(clientId); }, [clientId]); const pendingChangesRef = (0,external_wp_element_namespaceObject.useRef)({ incoming: null, outgoing: [] }); const subscribedRef = (0,external_wp_element_namespaceObject.useRef)(false); const setControlledBlocks = () => { if (!controlledBlocks) { return; } // We don't need to persist this change because we only replace // controlled inner blocks when the change was caused by an entity, // and so it would already be persisted. __unstableMarkNextChangeAsNotPersistent(); if (clientId) { // It is important to batch here because otherwise, // as soon as `setHasControlledInnerBlocks` is called // the effect to restore might be triggered // before the actual blocks get set properly in state. registry.batch(() => { setHasControlledInnerBlocks(clientId, true); const storeBlocks = controlledBlocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)); if (subscribedRef.current) { pendingChangesRef.current.incoming = storeBlocks; } __unstableMarkNextChangeAsNotPersistent(); replaceInnerBlocks(clientId, storeBlocks); }); } else { if (subscribedRef.current) { pendingChangesRef.current.incoming = controlledBlocks; } resetBlocks(controlledBlocks); } }; // Clean up the changes made by setControlledBlocks() when the component // containing useBlockSync() unmounts. const unsetControlledBlocks = () => { __unstableMarkNextChangeAsNotPersistent(); if (clientId) { setHasControlledInnerBlocks(clientId, false); __unstableMarkNextChangeAsNotPersistent(); replaceInnerBlocks(clientId, []); } else { resetBlocks([]); } }; // Add a subscription to the block-editor registry to detect when changes // have been made. This lets us inform the data source of changes. This // is an effect so that the subscriber can run synchronously without // waiting for React renders for changes. const onInputRef = (0,external_wp_element_namespaceObject.useRef)(onInput); const onChangeRef = (0,external_wp_element_namespaceObject.useRef)(onChange); (0,external_wp_element_namespaceObject.useEffect)(() => { onInputRef.current = onInput; onChangeRef.current = onChange; }, [onInput, onChange]); // Determine if blocks need to be reset when they change. (0,external_wp_element_namespaceObject.useEffect)(() => { if (pendingChangesRef.current.outgoing.includes(controlledBlocks)) { // Skip block reset if the value matches expected outbound sync // triggered by this component by a preceding change detection. // Only skip if the value matches expectation, since a reset should // still occur if the value is modified (not equal by reference), // to allow that the consumer may apply modifications to reflect // back on the editor. if (pendingChangesRef.current.outgoing[pendingChangesRef.current.outgoing.length - 1] === controlledBlocks) { pendingChangesRef.current.outgoing = []; } } else if (getBlocks(clientId) !== controlledBlocks) { // Reset changing value in all other cases than the sync described // above. Since this can be reached in an update following an out- // bound sync, unset the outbound value to avoid considering it in // subsequent renders. pendingChangesRef.current.outgoing = []; setControlledBlocks(); if (controlledSelection) { resetSelection(controlledSelection.selectionStart, controlledSelection.selectionEnd, controlledSelection.initialPosition); } } }, [controlledBlocks, clientId]); const isMountedRef = (0,external_wp_element_namespaceObject.useRef)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { // On mount, controlled blocks are already set in the effect above. if (!isMountedRef.current) { isMountedRef.current = true; return; } // When the block becomes uncontrolled, it means its inner state has been reset // we need to take the blocks again from the external value property. if (!isControlled) { pendingChangesRef.current.outgoing = []; setControlledBlocks(); } }, [isControlled]); (0,external_wp_element_namespaceObject.useEffect)(() => { const { getSelectedBlocksInitialCaretPosition, isLastBlockChangePersistent, __unstableIsLastBlockChangeIgnored, areInnerBlocksControlled } = registry.select(store); let blocks = getBlocks(clientId); let isPersistent = isLastBlockChangePersistent(); let previousAreBlocksDifferent = false; subscribedRef.current = true; const unsubscribe = registry.subscribe(() => { // Sometimes, when changing block lists, lingering subscriptions // might trigger before they are cleaned up. If the block for which // the subscription runs is no longer in the store, this would clear // its parent entity's block list. To avoid this, we bail out if // the subscription is triggering for a block (`clientId !== null`) // and its block name can't be found because it's not on the list. // (`getBlockName( clientId ) === null`). if (clientId !== null && getBlockName(clientId) === null) { return; } // When RESET_BLOCKS on parent blocks get called, the controlled blocks // can reset to uncontrolled, in these situations, it means we need to populate // the blocks again from the external blocks (the value property here) // and we should stop triggering onChange const isStillControlled = !clientId || areInnerBlocksControlled(clientId); if (!isStillControlled) { return; } const newIsPersistent = isLastBlockChangePersistent(); const newBlocks = getBlocks(clientId); const areBlocksDifferent = newBlocks !== blocks; blocks = newBlocks; if (areBlocksDifferent && (pendingChangesRef.current.incoming || __unstableIsLastBlockChangeIgnored())) { pendingChangesRef.current.incoming = null; isPersistent = newIsPersistent; return; } // Since we often dispatch an action to mark the previous action as // persistent, we need to make sure that the blocks changed on the // previous action before committing the change. const didPersistenceChange = previousAreBlocksDifferent && !areBlocksDifferent && newIsPersistent && !isPersistent; if (areBlocksDifferent || didPersistenceChange) { isPersistent = newIsPersistent; // We know that onChange/onInput will update controlledBlocks. // We need to be aware that it was caused by an outgoing change // so that we do not treat it as an incoming change later on, // which would cause a block reset. pendingChangesRef.current.outgoing.push(blocks); // Inform the controlling entity that changes have been made to // the block-editor store they should be aware about. const updateParent = isPersistent ? onChangeRef.current : onInputRef.current; updateParent(blocks, { selection: { selectionStart: getSelectionStart(), selectionEnd: getSelectionEnd(), initialPosition: getSelectedBlocksInitialCaretPosition() } }); } previousAreBlocksDifferent = areBlocksDifferent; }, store); return () => { subscribedRef.current = false; unsubscribe(); }; }, [registry, clientId]); (0,external_wp_element_namespaceObject.useEffect)(() => { return () => { unsetControlledBlocks(); }; }, []); } ;// external ["wp","keyboardShortcuts"] const external_wp_keyboardShortcuts_namespaceObject = window["wp"]["keyboardShortcuts"]; ;// ./node_modules/@wordpress/block-editor/build-module/components/keyboard-shortcuts/index.js /** * WordPress dependencies */ function KeyboardShortcuts() { return null; } function KeyboardShortcutsRegister() { // Registering the shortcuts. const { registerShortcut } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_keyboardShortcuts_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { registerShortcut({ name: 'core/block-editor/copy', category: 'block', description: (0,external_wp_i18n_namespaceObject.__)('Copy the selected block(s).'), keyCombination: { modifier: 'primary', character: 'c' } }); registerShortcut({ name: 'core/block-editor/cut', category: 'block', description: (0,external_wp_i18n_namespaceObject.__)('Cut the selected block(s).'), keyCombination: { modifier: 'primary', character: 'x' } }); registerShortcut({ name: 'core/block-editor/paste', category: 'block', description: (0,external_wp_i18n_namespaceObject.__)('Paste the selected block(s).'), keyCombination: { modifier: 'primary', character: 'v' } }); registerShortcut({ name: 'core/block-editor/duplicate', category: 'block', description: (0,external_wp_i18n_namespaceObject.__)('Duplicate the selected block(s).'), keyCombination: { modifier: 'primaryShift', character: 'd' } }); registerShortcut({ name: 'core/block-editor/remove', category: 'block', description: (0,external_wp_i18n_namespaceObject.__)('Remove the selected block(s).'), keyCombination: { modifier: 'access', character: 'z' } }); registerShortcut({ name: 'core/block-editor/insert-before', category: 'block', description: (0,external_wp_i18n_namespaceObject.__)('Insert a new block before the selected block(s).'), keyCombination: { modifier: 'primaryAlt', character: 't' } }); registerShortcut({ name: 'core/block-editor/insert-after', category: 'block', description: (0,external_wp_i18n_namespaceObject.__)('Insert a new block after the selected block(s).'), keyCombination: { modifier: 'primaryAlt', character: 'y' } }); registerShortcut({ name: 'core/block-editor/delete-multi-selection', category: 'block', description: (0,external_wp_i18n_namespaceObject.__)('Delete selection.'), keyCombination: { character: 'del' }, aliases: [{ character: 'backspace' }] }); registerShortcut({ name: 'core/block-editor/select-all', category: 'selection', description: (0,external_wp_i18n_namespaceObject.__)('Select all text when typing. Press again to select all blocks.'), keyCombination: { modifier: 'primary', character: 'a' } }); registerShortcut({ name: 'core/block-editor/unselect', category: 'selection', description: (0,external_wp_i18n_namespaceObject.__)('Clear selection.'), keyCombination: { character: 'escape' } }); registerShortcut({ name: 'core/block-editor/multi-text-selection', category: 'selection', description: (0,external_wp_i18n_namespaceObject.__)('Select text across multiple blocks.'), keyCombination: { modifier: 'shift', character: 'arrow' } }); registerShortcut({ name: 'core/block-editor/focus-toolbar', category: 'global', description: (0,external_wp_i18n_namespaceObject.__)('Navigate to the nearest toolbar.'), keyCombination: { modifier: 'alt', character: 'F10' } }); registerShortcut({ name: 'core/block-editor/move-up', category: 'block', description: (0,external_wp_i18n_namespaceObject.__)('Move the selected block(s) up.'), keyCombination: { modifier: 'secondary', character: 't' } }); registerShortcut({ name: 'core/block-editor/move-down', category: 'block', description: (0,external_wp_i18n_namespaceObject.__)('Move the selected block(s) down.'), keyCombination: { modifier: 'secondary', character: 'y' } }); // List view shortcuts. registerShortcut({ name: 'core/block-editor/collapse-list-view', category: 'list-view', description: (0,external_wp_i18n_namespaceObject.__)('Collapse all other items.'), keyCombination: { modifier: 'alt', character: 'l' } }); registerShortcut({ name: 'core/block-editor/group', category: 'block', description: (0,external_wp_i18n_namespaceObject.__)('Create a group block from the selected multiple blocks.'), keyCombination: { modifier: 'primary', character: 'g' } }); }, [registerShortcut]); return null; } KeyboardShortcuts.Register = KeyboardShortcutsRegister; /* harmony default export */ const keyboard_shortcuts = (KeyboardShortcuts); ;// ./node_modules/@wordpress/block-editor/build-module/components/provider/use-media-upload-settings.js /** * WordPress dependencies */ /** * React hook used to compute the media upload settings to use in the post editor. * * @param {Object} settings Media upload settings prop. * * @return {Object} Media upload settings. */ function useMediaUploadSettings(settings = {}) { return (0,external_wp_element_namespaceObject.useMemo)(() => ({ mediaUpload: settings.mediaUpload, mediaSideload: settings.mediaSideload, maxUploadFileSize: settings.maxUploadFileSize, allowedMimeTypes: settings.allowedMimeTypes }), [settings]); } /* harmony default export */ const use_media_upload_settings = (useMediaUploadSettings); ;// ./node_modules/@wordpress/block-editor/build-module/components/provider/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('@wordpress/data').WPDataRegistry} WPDataRegistry */ const provider_noop = () => {}; /** * Upload a media file when the file upload button is activated * or when adding a file to the editor via drag & drop. * * @param {WPDataRegistry} registry * @param {Object} $3 Parameters object passed to the function. * @param {Array} $3.allowedTypes Array with the types of media that can be uploaded, if unset all types are allowed. * @param {Object} $3.additionalData Additional data to include in the request. * @param {Array<File>} $3.filesList List of files. * @param {Function} $3.onError Function called when an error happens. * @param {Function} $3.onFileChange Function called each time a file or a temporary representation of the file is available. * @param {Function} $3.onSuccess Function called once a file has completely finished uploading, including thumbnails. * @param {Function} $3.onBatchSuccess Function called once all files in a group have completely finished uploading, including thumbnails. */ function mediaUpload(registry, { allowedTypes, additionalData = {}, filesList, onError = provider_noop, onFileChange, onSuccess, onBatchSuccess }) { void registry.dispatch(store_store).addItems({ files: filesList, onChange: onFileChange, onSuccess, onBatchSuccess, onError: ({ message }) => onError(message), additionalData, allowedTypes }); } const ExperimentalBlockEditorProvider = provider_with_registry_provider(props => { const { settings: _settings, registry, stripExperimentalSettings = false } = props; const mediaUploadSettings = use_media_upload_settings(_settings); let settings = _settings; if (window.__experimentalMediaProcessing && _settings.mediaUpload) { // Create a new variable so that the original props.settings.mediaUpload is not modified. settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ..._settings, mediaUpload: mediaUpload.bind(null, registry) }), [_settings, registry]); } const { __experimentalUpdateSettings } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); (0,external_wp_element_namespaceObject.useEffect)(() => { __experimentalUpdateSettings({ ...settings, __internalIsInitialized: true }, { stripExperimentalSettings, reset: true }); }, [settings, stripExperimentalSettings, __experimentalUpdateSettings]); // Syncs the entity provider with changes in the block-editor store. useBlockSync(props); const children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SlotFillProvider, { passthrough: true, children: [!settings?.isPreviewMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboard_shortcuts.Register, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRefsProvider, { children: props.children })] }); if (window.__experimentalMediaProcessing) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(provider, { settings: mediaUploadSettings, useSubRegistry: false, children: children }); } return children; }); const BlockEditorProvider = props => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockEditorProvider, { ...props, stripExperimentalSettings: true, children: props.children }); }; /* harmony default export */ const components_provider = (BlockEditorProvider); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-context/index.js /** * WordPress dependencies */ /** @typedef {import('react').ReactNode} ReactNode */ /** * @typedef BlockContextProviderProps * * @property {Record<string,*>} value Context value to merge with current * value. * @property {ReactNode} children Component children. */ /** @type {import('react').Context<Record<string,*>>} */ const block_context_Context = (0,external_wp_element_namespaceObject.createContext)({}); /** * Component which merges passed value with current consumed block context. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-context/README.md * * @param {BlockContextProviderProps} props */ function BlockContextProvider({ value, children }) { const context = (0,external_wp_element_namespaceObject.useContext)(block_context_Context); const nextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...context, ...value }), [context, value]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_context_Context.Provider, { value: nextValue, children: children }); } /* harmony default export */ const block_context = (block_context_Context); ;// ./node_modules/@wordpress/block-editor/build-module/utils/block-bindings.js /** * WordPress dependencies */ /** * Internal dependencies */ const DEFAULT_ATTRIBUTE = '__default'; const PATTERN_OVERRIDES_SOURCE = 'core/pattern-overrides'; const BLOCK_BINDINGS_ALLOWED_BLOCKS = { 'core/paragraph': ['content'], 'core/heading': ['content'], 'core/image': ['id', 'url', 'title', 'alt'], 'core/button': ['url', 'text', 'linkTarget', 'rel'] }; /** * Checks if the given object is empty. * * @param {?Object} object The object to check. * * @return {boolean} Whether the object is empty. */ function isObjectEmpty(object) { return !object || Object.keys(object).length === 0; } /** * Based on the given block name, checks if it is possible to bind the block. * * @param {string} blockName The name of the block. * * @return {boolean} Whether it is possible to bind the block to sources. */ function canBindBlock(blockName) { return blockName in BLOCK_BINDINGS_ALLOWED_BLOCKS; } /** * Based on the given block name and attribute name, checks if it is possible to bind the block attribute. * * @param {string} blockName The name of the block. * @param {string} attributeName The name of attribute. * * @return {boolean} Whether it is possible to bind the block attribute. */ function canBindAttribute(blockName, attributeName) { return canBindBlock(blockName) && BLOCK_BINDINGS_ALLOWED_BLOCKS[blockName].includes(attributeName); } /** * Gets the bindable attributes for a given block. * * @param {string} blockName The name of the block. * * @return {string[]} The bindable attributes for the block. */ function getBindableAttributes(blockName) { return BLOCK_BINDINGS_ALLOWED_BLOCKS[blockName]; } /** * Checks if the block has the `__default` binding for pattern overrides. * * @param {?Record<string, object>} bindings A block's bindings from the metadata attribute. * * @return {boolean} Whether the block has the `__default` binding for pattern overrides. */ function hasPatternOverridesDefaultBinding(bindings) { return bindings?.[DEFAULT_ATTRIBUTE]?.source === PATTERN_OVERRIDES_SOURCE; } /** * Returns the bindings with the `__default` binding for pattern overrides * replaced with the full-set of supported attributes. e.g.: * * - bindings passed in: `{ __default: { source: 'core/pattern-overrides' } }` * - bindings returned: `{ content: { source: 'core/pattern-overrides' } }` * * @param {string} blockName The block name (e.g. 'core/paragraph'). * @param {?Record<string, object>} bindings A block's bindings from the metadata attribute. * * @return {Object} The bindings with default replaced for pattern overrides. */ function replacePatternOverridesDefaultBinding(blockName, bindings) { // The `__default` binding currently only works for pattern overrides. if (hasPatternOverridesDefaultBinding(bindings)) { const supportedAttributes = BLOCK_BINDINGS_ALLOWED_BLOCKS[blockName]; const bindingsWithDefaults = {}; for (const attributeName of supportedAttributes) { // If the block has mixed binding sources, retain any non pattern override bindings. const bindingSource = bindings[attributeName] ? bindings[attributeName] : { source: PATTERN_OVERRIDES_SOURCE }; bindingsWithDefaults[attributeName] = bindingSource; } return bindingsWithDefaults; } return bindings; } /** * Contains utils to update the block `bindings` metadata. * * @typedef {Object} WPBlockBindingsUtils * * @property {Function} updateBlockBindings Updates the value of the bindings connected to block attributes. * @property {Function} removeAllBlockBindings Removes the bindings property of the `metadata` attribute. */ /** * Retrieves the existing utils needed to update the block `bindings` metadata. * They can be used to create, modify, or remove connections from the existing block attributes. * * It contains the following utils: * - `updateBlockBindings`: Updates the value of the bindings connected to block attributes. It can be used to remove a specific binding by setting the value to `undefined`. * - `removeAllBlockBindings`: Removes the bindings property of the `metadata` attribute. * * @since 6.7.0 Introduced in WordPress core. * * @param {?string} clientId Optional block client ID. If not set, it will use the current block client ID from the context. * * @return {?WPBlockBindingsUtils} Object containing the block bindings utils. * * @example * ```js * import { useBlockBindingsUtils } from '@wordpress/block-editor' * const { updateBlockBindings, removeAllBlockBindings } = useBlockBindingsUtils(); * * // Update url and alt attributes. * updateBlockBindings( { * url: { * source: 'core/post-meta', * args: { * key: 'url_custom_field', * }, * }, * alt: { * source: 'core/post-meta', * args: { * key: 'text_custom_field', * }, * }, * } ); * * // Remove binding from url attribute. * updateBlockBindings( { url: undefined } ); * * // Remove bindings from all attributes. * removeAllBlockBindings(); * ``` */ function useBlockBindingsUtils(clientId) { const { clientId: contextClientId } = useBlockEditContext(); const blockClientId = clientId || contextClientId; const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { getBlockAttributes } = (0,external_wp_data_namespaceObject.useRegistry)().select(store); /** * Updates the value of the bindings connected to block attributes. * It removes the binding when the new value is `undefined`. * * @param {Object} bindings Bindings including the attributes to update and the new object. * @param {string} bindings.source The source name to connect to. * @param {Object} [bindings.args] Object containing the arguments needed by the source. * * @example * ```js * import { useBlockBindingsUtils } from '@wordpress/block-editor' * * const { updateBlockBindings } = useBlockBindingsUtils(); * updateBlockBindings( { * url: { * source: 'core/post-meta', * args: { * key: 'url_custom_field', * }, * }, * alt: { * source: 'core/post-meta', * args: { * key: 'text_custom_field', * }, * } * } ); * ``` */ const updateBlockBindings = bindings => { const { metadata: { bindings: currentBindings, ...metadata } = {} } = getBlockAttributes(blockClientId); const newBindings = { ...currentBindings }; Object.entries(bindings).forEach(([attribute, binding]) => { if (!binding && newBindings[attribute]) { delete newBindings[attribute]; return; } newBindings[attribute] = binding; }); const newMetadata = { ...metadata, bindings: newBindings }; if (isObjectEmpty(newMetadata.bindings)) { delete newMetadata.bindings; } updateBlockAttributes(blockClientId, { metadata: isObjectEmpty(newMetadata) ? undefined : newMetadata }); }; /** * Removes the bindings property of the `metadata` attribute. * * @example * ```js * import { useBlockBindingsUtils } from '@wordpress/block-editor' * * const { removeAllBlockBindings } = useBlockBindingsUtils(); * removeAllBlockBindings(); * ``` */ const removeAllBlockBindings = () => { const { metadata: { bindings, ...metadata } = {} } = getBlockAttributes(blockClientId); updateBlockAttributes(blockClientId, { metadata: isObjectEmpty(metadata) ? undefined : metadata }); }; return { updateBlockBindings, removeAllBlockBindings }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-edit/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Default value used for blocks which do not define their own context needs, * used to guarantee that a block's `context` prop will always be an object. It * is assigned as a constant since it is always expected to be an empty object, * and in order to avoid unnecessary React reconciliations of a changing object. * * @type {{}} */ const DEFAULT_BLOCK_CONTEXT = {}; const Edit = props => { const { name } = props; const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); if (!blockType) { return null; } // `edit` and `save` are functions or components describing the markup // with which a block is displayed. If `blockType` is valid, assign // them preferentially as the render value for the block. const Component = blockType.edit || blockType.save; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { ...props }); }; const EditWithFilters = (0,external_wp_components_namespaceObject.withFilters)('editor.BlockEdit')(Edit); const EditWithGeneratedProps = props => { const { name, clientId, attributes, setAttributes } = props; const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context); const registeredSources = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(external_wp_blocks_namespaceObject.store)).getAllBlockBindingsSources(), []); const { blockBindings, context, hasPatternOverrides } = (0,external_wp_element_namespaceObject.useMemo)(() => { // Assign context values using the block type's declared context needs. const computedContext = blockType?.usesContext ? Object.fromEntries(Object.entries(blockContext).filter(([key]) => blockType.usesContext.includes(key))) : DEFAULT_BLOCK_CONTEXT; // Add context requested by Block Bindings sources. if (attributes?.metadata?.bindings) { Object.values(attributes?.metadata?.bindings || {}).forEach(binding => { registeredSources[binding?.source]?.usesContext?.forEach(key => { computedContext[key] = blockContext[key]; }); }); } return { blockBindings: replacePatternOverridesDefaultBinding(name, attributes?.metadata?.bindings), context: computedContext, hasPatternOverrides: hasPatternOverridesDefaultBinding(attributes?.metadata?.bindings) }; }, [name, blockType?.usesContext, blockContext, attributes?.metadata?.bindings, registeredSources]); const computedAttributes = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!blockBindings) { return attributes; } const attributesFromSources = {}; const blockBindingsBySource = new Map(); for (const [attributeName, binding] of Object.entries(blockBindings)) { const { source: sourceName, args: sourceArgs } = binding; const source = registeredSources[sourceName]; if (!source || !canBindAttribute(name, attributeName)) { continue; } blockBindingsBySource.set(source, { ...blockBindingsBySource.get(source), [attributeName]: { args: sourceArgs } }); } if (blockBindingsBySource.size) { for (const [source, bindings] of blockBindingsBySource) { // Get values in batch if the source supports it. let values = {}; if (!source.getValues) { Object.keys(bindings).forEach(attr => { // Default to the the source label when `getValues` doesn't exist. values[attr] = source.label; }); } else { values = source.getValues({ select, context, clientId, bindings }); } for (const [attributeName, value] of Object.entries(values)) { if (attributeName === 'url' && (!value || !isURLLike(value))) { // Return null if value is not a valid URL. attributesFromSources[attributeName] = null; } else { attributesFromSources[attributeName] = value; } } } } return { ...attributes, ...attributesFromSources }; }, [attributes, blockBindings, clientId, context, name, registeredSources]); const setBoundAttributes = (0,external_wp_element_namespaceObject.useCallback)(nextAttributes => { if (!blockBindings) { setAttributes(nextAttributes); return; } registry.batch(() => { const keptAttributes = { ...nextAttributes }; const blockBindingsBySource = new Map(); // Loop only over the updated attributes to avoid modifying the bound ones that haven't changed. for (const [attributeName, newValue] of Object.entries(keptAttributes)) { if (!blockBindings[attributeName] || !canBindAttribute(name, attributeName)) { continue; } const binding = blockBindings[attributeName]; const source = registeredSources[binding?.source]; if (!source?.setValues) { continue; } blockBindingsBySource.set(source, { ...blockBindingsBySource.get(source), [attributeName]: { args: binding.args, newValue } }); delete keptAttributes[attributeName]; } if (blockBindingsBySource.size) { for (const [source, bindings] of blockBindingsBySource) { source.setValues({ select: registry.select, dispatch: registry.dispatch, context, clientId, bindings }); } } const hasParentPattern = !!context['pattern/overrides']; if ( // Don't update non-connected attributes if the block is using pattern overrides // and the editing is happening while overriding the pattern (not editing the original). !(hasPatternOverrides && hasParentPattern) && Object.keys(keptAttributes).length) { // Don't update caption and href until they are supported. if (hasPatternOverrides) { delete keptAttributes.caption; delete keptAttributes.href; } setAttributes(keptAttributes); } }); }, [blockBindings, clientId, context, hasPatternOverrides, setAttributes, registeredSources, name, registry]); if (!blockType) { return null; } if (blockType.apiVersion > 1) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditWithFilters, { ...props, attributes: computedAttributes, context: context, setAttributes: setBoundAttributes }); } // Generate a class name for the block's editable form. const generatedClassName = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'className', true) ? (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(name) : null; const className = dist_clsx(generatedClassName, attributes?.className, props.className); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditWithFilters, { ...props, attributes: computedAttributes, className: className, context: context, setAttributes: setBoundAttributes }); }; /* harmony default export */ const block_edit_edit = (EditWithGeneratedProps); ;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js /** * WordPress dependencies */ const moreVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); /* harmony default export */ const more_vertical = (moreVertical); ;// ./node_modules/@wordpress/block-editor/build-module/components/warning/index.js /** * External dependencies */ /** * WordPress dependencies */ function Warning({ className, actions, children, secondaryActions }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { display: 'contents', all: 'initial' }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx(className, 'block-editor-warning'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-warning__contents", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-warning__message", children: children }), (actions?.length > 0 || secondaryActions) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-warning__actions", children: [actions?.length > 0 && actions.map((action, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-warning__action", children: action }, i)), secondaryActions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { className: "block-editor-warning__secondary", icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('More options'), popoverProps: { position: 'bottom left', className: 'block-editor-warning__dropdown' }, noIcons: true, children: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: secondaryActions.map((item, pos) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: item.onClick, children: item.title }, pos)) }) })] })] }) }) }); } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/warning/README.md */ /* harmony default export */ const warning = (Warning); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-edit/multiple-usage-warning.js /** * WordPress dependencies */ /** * Internal dependencies */ function MultipleUsageWarning({ originalBlockClientId, name, onReplace }) { const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(warning, { actions: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: () => selectBlock(originalBlockClientId), children: (0,external_wp_i18n_namespaceObject.__)('Find original') }, "find-original"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: () => onReplace([]), children: (0,external_wp_i18n_namespaceObject.__)('Remove') }, "remove")], children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("strong", { children: [blockType?.title, ": "] }), (0,external_wp_i18n_namespaceObject.__)('This block can only be used once.')] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/private-block-context.js /** * WordPress dependencies */ const PrivateBlockContext = (0,external_wp_element_namespaceObject.createContext)({}); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-edit/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * The `useBlockEditContext` hook provides information about the block this hook is being used in. * It returns an object with the `name`, `isSelected` state, and the `clientId` of the block. * It is useful if you want to create custom hooks that need access to the current blocks clientId * but don't want to rely on the data getting passed in as a parameter. * * @return {Object} Block edit context */ function BlockEdit({ mayDisplayControls, mayDisplayParentControls, blockEditingMode, isPreviewMode, // The remaining props are passed through the BlockEdit filters and are thus // public API! ...props }) { const { name, isSelected, clientId, attributes = {}, __unstableLayoutClassNames } = props; const { layout = null, metadata = {} } = attributes; const { bindings } = metadata; const layoutSupport = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, 'layout', false) || (0,external_wp_blocks_namespaceObject.hasBlockSupport)(name, '__experimentalLayout', false); const { originalBlockClientId } = (0,external_wp_element_namespaceObject.useContext)(PrivateBlockContext); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Provider // It is important to return the same object if props haven't // changed to avoid unnecessary rerenders. // See https://reactjs.org/docs/context.html#caveats. , { value: (0,external_wp_element_namespaceObject.useMemo)(() => ({ name, isSelected, clientId, layout: layoutSupport ? layout : null, __unstableLayoutClassNames, // We use symbols in favour of an __unstable prefix to avoid // usage outside of the package (this context is exposed). [mayDisplayControlsKey]: mayDisplayControls, [mayDisplayParentControlsKey]: mayDisplayParentControls, [blockEditingModeKey]: blockEditingMode, [blockBindingsKey]: bindings, [isPreviewModeKey]: isPreviewMode }), [name, isSelected, clientId, layoutSupport, layout, __unstableLayoutClassNames, mayDisplayControls, mayDisplayParentControls, blockEditingMode, bindings, isPreviewMode]), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_edit_edit, { ...props }), originalBlockClientId && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MultipleUsageWarning, { originalBlockClientId: originalBlockClientId, name: name, onReplace: props.onReplace })] }); } // EXTERNAL MODULE: ./node_modules/diff/lib/diff/character.js var character = __webpack_require__(8021); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-compare/block-view.js /** * WordPress dependencies */ function BlockView({ title, rawContent, renderedContent, action, actionText, className }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: className, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-compare__content", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "block-editor-block-compare__heading", children: title }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-compare__html", children: rawContent }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-compare__preview edit-post-visual-editor", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: (0,external_wp_dom_namespaceObject.safeHTML)(renderedContent) }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-compare__action", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", tabIndex: "0", onClick: action, children: actionText }) })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-compare/index.js /** * External dependencies */ // diff doesn't tree-shake correctly, so we import from the individual // module here, to avoid including too much of the library /** * WordPress dependencies */ /** * Internal dependencies */ function BlockCompare({ block, onKeep, onConvert, convertor, convertButtonText }) { function getDifference(originalContent, newContent) { const difference = (0,character/* diffChars */.JJ)(originalContent, newContent); return difference.map((item, pos) => { const classes = dist_clsx({ 'block-editor-block-compare__added': item.added, 'block-editor-block-compare__removed': item.removed }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: classes, children: item.value }, pos); }); } function getConvertedContent(convertedBlock) { // The convertor may return an array of items or a single item. const newBlocks = Array.isArray(convertedBlock) ? convertedBlock : [convertedBlock]; // Get converted block details. const newContent = newBlocks.map(item => (0,external_wp_blocks_namespaceObject.getSaveContent)(item.name, item.attributes, item.innerBlocks)); return newContent.join(''); } const converted = getConvertedContent(convertor(block)); const difference = getDifference(block.originalContent, converted); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-compare__wrapper", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockView, { title: (0,external_wp_i18n_namespaceObject.__)('Current'), className: "block-editor-block-compare__current", action: onKeep, actionText: (0,external_wp_i18n_namespaceObject.__)('Convert to HTML'), rawContent: block.originalContent, renderedContent: block.originalContent }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockView, { title: (0,external_wp_i18n_namespaceObject.__)('After Conversion'), className: "block-editor-block-compare__converted", action: onConvert, actionText: convertButtonText, rawContent: difference, renderedContent: converted })] }); } /* harmony default export */ const block_compare = (BlockCompare); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-invalid-warning.js /** * WordPress dependencies */ /** * Internal dependencies */ const blockToBlocks = block => (0,external_wp_blocks_namespaceObject.rawHandler)({ HTML: block.originalContent }); function BlockInvalidWarning({ clientId }) { const { block, canInsertHTMLBlock, canInsertClassicBlock } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canInsertBlockType, getBlock, getBlockRootClientId } = select(store); const rootClientId = getBlockRootClientId(clientId); return { block: getBlock(clientId), canInsertHTMLBlock: canInsertBlockType('core/html', rootClientId), canInsertClassicBlock: canInsertBlockType('core/freeform', rootClientId) }; }, [clientId]); const { replaceBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const [compare, setCompare] = (0,external_wp_element_namespaceObject.useState)(false); const onCompareClose = (0,external_wp_element_namespaceObject.useCallback)(() => setCompare(false), []); const convert = (0,external_wp_element_namespaceObject.useMemo)(() => ({ toClassic() { const classicBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', { content: block.originalContent }); return replaceBlock(block.clientId, classicBlock); }, toHTML() { const htmlBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/html', { content: block.originalContent }); return replaceBlock(block.clientId, htmlBlock); }, toBlocks() { const newBlocks = blockToBlocks(block); return replaceBlock(block.clientId, newBlocks); }, toRecoveredBlock() { const recoveredBlock = (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks); return replaceBlock(block.clientId, recoveredBlock); } }), [block, replaceBlock]); const secondaryActions = (0,external_wp_element_namespaceObject.useMemo)(() => [{ // translators: Button to fix block content title: (0,external_wp_i18n_namespaceObject._x)('Resolve', 'imperative verb'), onClick: () => setCompare(true) }, canInsertHTMLBlock && { title: (0,external_wp_i18n_namespaceObject.__)('Convert to HTML'), onClick: convert.toHTML }, canInsertClassicBlock && { title: (0,external_wp_i18n_namespaceObject.__)('Convert to Classic Block'), onClick: convert.toClassic }].filter(Boolean), [canInsertHTMLBlock, canInsertClassicBlock, convert]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(warning, { actions: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, onClick: convert.toRecoveredBlock, variant: "primary", children: (0,external_wp_i18n_namespaceObject.__)('Attempt recovery') }, "recover")], secondaryActions: secondaryActions, children: (0,external_wp_i18n_namespaceObject.__)('Block contains unexpected or invalid content.') }), compare && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: // translators: Dialog title to fix block content (0,external_wp_i18n_namespaceObject.__)('Resolve Block'), onRequestClose: onCompareClose, className: "block-editor-block-compare", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_compare, { block: block, onKeep: convert.toHTML, onConvert: convert.toBlocks, convertor: blockToBlocks, convertButtonText: (0,external_wp_i18n_namespaceObject.__)('Convert to Blocks') }) })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-warning.js /** * WordPress dependencies */ /** * Internal dependencies */ const block_crash_warning_warning = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(warning, { className: "block-editor-block-list__block-crash-warning", children: (0,external_wp_i18n_namespaceObject.__)('This block has encountered an error and cannot be previewed.') }); /* harmony default export */ const block_crash_warning = (() => block_crash_warning_warning); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-crash-boundary.js /** * WordPress dependencies */ class BlockCrashBoundary extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); this.state = { hasError: false }; } componentDidCatch() { this.setState({ hasError: true }); } render() { if (this.state.hasError) { return this.props.fallback; } return this.props.children; } } /* harmony default export */ const block_crash_boundary = (BlockCrashBoundary); // EXTERNAL MODULE: ./node_modules/react-autosize-textarea/lib/index.js var lib = __webpack_require__(4132); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/block-html.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function BlockHTML({ clientId }) { const [html, setHtml] = (0,external_wp_element_namespaceObject.useState)(''); const block = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlock(clientId), [clientId]); const { updateBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const onChange = () => { const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name); if (!blockType) { return; } const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(blockType, html, block.attributes); // If html is empty we reset the block to the default HTML and mark it as valid to avoid triggering an error const content = html ? html : (0,external_wp_blocks_namespaceObject.getSaveContent)(blockType, attributes); const [isValid] = html ? (0,external_wp_blocks_namespaceObject.validateBlock)({ ...block, attributes, originalContent: content }) : [true]; updateBlock(clientId, { attributes, originalContent: content, isValid }); // Ensure the state is updated if we reset so it displays the default content. if (!html) { setHtml(content); } }; (0,external_wp_element_namespaceObject.useEffect)(() => { setHtml((0,external_wp_blocks_namespaceObject.getBlockContent)(block)); }, [block]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(lib/* default */.A, { className: "block-editor-block-list__block-html-textarea", value: html, onBlur: onChange, onChange: event => setHtml(event.target.value) }); } /* harmony default export */ const block_html = (BlockHTML); ;// ./node_modules/@react-spring/rafz/dist/esm/index.js var esm_f=esm_l(),esm_n=e=>esm_c(e,esm_f),esm_m=esm_l();esm_n.write=e=>esm_c(e,esm_m);var esm_d=esm_l();esm_n.onStart=e=>esm_c(e,esm_d);var esm_h=esm_l();esm_n.onFrame=e=>esm_c(e,esm_h);var esm_p=esm_l();esm_n.onFinish=e=>esm_c(e,esm_p);var esm_i=[];esm_n.setTimeout=(e,t)=>{let a=esm_n.now()+t,o=()=>{let F=esm_i.findIndex(z=>z.cancel==o);~F&&esm_i.splice(F,1),esm_u-=~F?1:0},s={time:a,handler:e,cancel:o};return esm_i.splice(esm_w(a),0,s),esm_u+=1,esm_v(),s};var esm_w=e=>~(~esm_i.findIndex(t=>t.time>e)||~esm_i.length);esm_n.cancel=e=>{esm_d.delete(e),esm_h.delete(e),esm_p.delete(e),esm_f.delete(e),esm_m.delete(e)};esm_n.sync=e=>{T=!0,esm_n.batchedUpdates(e),T=!1};esm_n.throttle=e=>{let t;function a(){try{e(...t)}finally{t=null}}function o(...s){t=s,esm_n.onStart(a)}return o.handler=e,o.cancel=()=>{esm_d.delete(a),t=null},o};var esm_y=typeof window<"u"?window.requestAnimationFrame:()=>{};esm_n.use=e=>esm_y=e;esm_n.now=typeof performance<"u"?()=>performance.now():Date.now;esm_n.batchedUpdates=e=>e();esm_n.catch=console.error;esm_n.frameLoop="always";esm_n.advance=()=>{esm_n.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):esm_x()};var esm_r=-1,esm_u=0,T=!1;function esm_c(e,t){T?(t.delete(e),e(0)):(t.add(e),esm_v())}function esm_v(){esm_r<0&&(esm_r=0,esm_n.frameLoop!=="demand"&&esm_y(esm_b))}function esm_R(){esm_r=-1}function esm_b(){~esm_r&&(esm_y(esm_b),esm_n.batchedUpdates(esm_x))}function esm_x(){let e=esm_r;esm_r=esm_n.now();let t=esm_w(esm_r);if(t&&(Q(esm_i.splice(0,t),a=>a.handler()),esm_u-=t),!esm_u){esm_R();return}esm_d.flush(),esm_f.flush(e?Math.min(64,esm_r-e):16.667),esm_h.flush(),esm_m.flush(),esm_p.flush()}function esm_l(){let e=new Set,t=e;return{add(a){esm_u+=t==e&&!e.has(a)?1:0,e.add(a)},delete(a){return esm_u-=t==e&&e.has(a)?1:0,e.delete(a)},flush(a){t.size&&(e=new Set,esm_u-=t.size,Q(t,o=>o(a)&&e.add(o)),esm_u+=e.size,t=e)}}}function Q(e,t){e.forEach(a=>{try{t(a)}catch(o){esm_n.catch(o)}})}var esm_S={count(){return esm_u},isRunning(){return esm_r>=0},clear(){esm_r=-1,esm_i=[],esm_d=esm_l(),esm_f=esm_l(),esm_h=esm_l(),esm_m=esm_l(),esm_p=esm_l(),esm_u=0}}; ;// ./node_modules/@react-spring/shared/dist/esm/index.js var ze=Object.defineProperty;var Le=(e,t)=>{for(var r in t)ze(e,r,{get:t[r],enumerable:!0})};var dist_esm_p={};Le(dist_esm_p,{assign:()=>U,colors:()=>dist_esm_c,createStringInterpolator:()=>esm_k,skipAnimation:()=>ee,to:()=>J,willAdvance:()=>dist_esm_S});function Y(){}var mt=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),dist_esm_l={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function bt(e,t){if(dist_esm_l.arr(e)){if(!dist_esm_l.arr(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return e===t}var esm_Ve=(e,t)=>e.forEach(t);function xt(e,t,r){if(dist_esm_l.arr(e)){for(let n=0;n<e.length;n++)t.call(r,e[n],`${n}`);return}for(let n in e)e.hasOwnProperty(n)&&t.call(r,e[n],n)}var ht=e=>dist_esm_l.und(e)?[]:dist_esm_l.arr(e)?e:[e];function Pe(e,t){if(e.size){let r=Array.from(e);e.clear(),esm_Ve(r,t)}}var yt=(e,...t)=>Pe(e,r=>r(...t)),dist_esm_h=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);var esm_k,J,dist_esm_c=null,ee=!1,dist_esm_S=Y,U=e=>{e.to&&(J=e.to),e.now&&(esm_n.now=e.now),e.colors!==void 0&&(dist_esm_c=e.colors),e.skipAnimation!=null&&(ee=e.skipAnimation),e.createStringInterpolator&&(esm_k=e.createStringInterpolator),e.requestAnimationFrame&&esm_n.use(e.requestAnimationFrame),e.batchedUpdates&&(esm_n.batchedUpdates=e.batchedUpdates),e.willAdvance&&(dist_esm_S=e.willAdvance),e.frameLoop&&(esm_n.frameLoop=e.frameLoop)};var esm_E=new Set,dist_esm_u=[],esm_H=[],A=0,qe={get idle(){return!esm_E.size&&!dist_esm_u.length},start(e){A>e.priority?(esm_E.add(e),esm_n.onStart($e)):(te(e),esm_n(B))},advance:B,sort(e){if(A)esm_n.onFrame(()=>qe.sort(e));else{let t=dist_esm_u.indexOf(e);~t&&(dist_esm_u.splice(t,1),re(e))}},clear(){dist_esm_u=[],esm_E.clear()}};function $e(){esm_E.forEach(te),esm_E.clear(),esm_n(B)}function te(e){dist_esm_u.includes(e)||re(e)}function re(e){dist_esm_u.splice(Ge(dist_esm_u,t=>t.priority>e.priority),0,e)}function B(e){let t=esm_H;for(let r=0;r<dist_esm_u.length;r++){let n=dist_esm_u[r];A=n.priority,n.idle||(dist_esm_S(n),n.advance(e),n.idle||t.push(n))}return A=0,esm_H=dist_esm_u,esm_H.length=0,dist_esm_u=t,dist_esm_u.length>0}function Ge(e,t){let r=e.findIndex(t);return r<0?e.length:r}var ne=(e,t,r)=>Math.min(Math.max(r,e),t);var It={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};var dist_esm_d="[-+]?\\d*\\.?\\d+",esm_M=dist_esm_d+"%";function C(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var oe=new RegExp("rgb"+C(dist_esm_d,dist_esm_d,dist_esm_d)),fe=new RegExp("rgba"+C(dist_esm_d,dist_esm_d,dist_esm_d,dist_esm_d)),ae=new RegExp("hsl"+C(dist_esm_d,esm_M,esm_M)),ie=new RegExp("hsla"+C(dist_esm_d,esm_M,esm_M,dist_esm_d)),se=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ue=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,le=/^#([0-9a-fA-F]{6})$/,esm_ce=/^#([0-9a-fA-F]{8})$/;function be(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=le.exec(e))?parseInt(t[1]+"ff",16)>>>0:dist_esm_c&&dist_esm_c[e]!==void 0?dist_esm_c[e]:(t=oe.exec(e))?(dist_esm_y(t[1])<<24|dist_esm_y(t[2])<<16|dist_esm_y(t[3])<<8|255)>>>0:(t=fe.exec(e))?(dist_esm_y(t[1])<<24|dist_esm_y(t[2])<<16|dist_esm_y(t[3])<<8|me(t[4]))>>>0:(t=se.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=esm_ce.exec(e))?parseInt(t[1],16)>>>0:(t=ue.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=ae.exec(e))?(de(esm_pe(t[1]),esm_z(t[2]),esm_z(t[3]))|255)>>>0:(t=ie.exec(e))?(de(esm_pe(t[1]),esm_z(t[2]),esm_z(t[3]))|me(t[4]))>>>0:null}function esm_j(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function de(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,f=2*r-n,o=esm_j(f,n,e+1/3),i=esm_j(f,n,e),s=esm_j(f,n,e-1/3);return Math.round(o*255)<<24|Math.round(i*255)<<16|Math.round(s*255)<<8}function dist_esm_y(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function esm_pe(e){return(parseFloat(e)%360+360)%360/360}function me(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function esm_z(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function D(e){let t=be(e);if(t===null)return e;t=t||0;let r=(t&4278190080)>>>24,n=(t&16711680)>>>16,f=(t&65280)>>>8,o=(t&255)/255;return`rgba(${r}, ${n}, ${f}, ${o})`}var W=(e,t,r)=>{if(dist_esm_l.fun(e))return e;if(dist_esm_l.arr(e))return W({range:e,output:t,extrapolate:r});if(dist_esm_l.str(e.output[0]))return esm_k(e);let n=e,f=n.output,o=n.range||[0,1],i=n.extrapolateLeft||n.extrapolate||"extend",s=n.extrapolateRight||n.extrapolate||"extend",x=n.easing||(a=>a);return a=>{let F=He(a,o);return Ue(a,o[F],o[F+1],f[F],f[F+1],x,i,s,n.map)}};function Ue(e,t,r,n,f,o,i,s,x){let a=x?x(e):e;if(a<t){if(i==="identity")return a;i==="clamp"&&(a=t)}if(a>r){if(s==="identity")return a;s==="clamp"&&(a=r)}return n===f?n:t===r?e<=t?n:f:(t===-1/0?a=-a:r===1/0?a=a-t:a=(a-t)/(r-t),a=o(a),n===-1/0?a=-a:f===1/0?a=a+n:a=a*(f-n)+n,a)}function He(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}var Be=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);let n=r*e,f=t==="end"?Math.floor(n):Math.ceil(n);return ne(0,1,f/e)},P=1.70158,L=P*1.525,xe=P+1,he=2*Math.PI/3,ye=2*Math.PI/4.5,V=e=>e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375,Lt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>1-(1-e)*(1-e),easeInOutQuad:e=>e<.5?2*e*e:1-Math.pow(-2*e+2,2)/2,easeInCubic:e=>e*e*e,easeOutCubic:e=>1-Math.pow(1-e,3),easeInOutCubic:e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1-Math.pow(1-e,4),easeInOutQuart:e=>e<.5?8*e*e*e*e:1-Math.pow(-2*e+2,4)/2,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1-Math.pow(1-e,5),easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1-Math.pow(-2*e+2,5)/2,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e===0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e===1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e===0?0:e===1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2,easeInCirc:e=>1-Math.sqrt(1-Math.pow(e,2)),easeOutCirc:e=>Math.sqrt(1-Math.pow(e-1,2)),easeInOutCirc:e=>e<.5?(1-Math.sqrt(1-Math.pow(2*e,2)))/2:(Math.sqrt(1-Math.pow(-2*e+2,2))+1)/2,easeInBack:e=>xe*e*e*e-P*e*e,easeOutBack:e=>1+xe*Math.pow(e-1,3)+P*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((L+1)*2*e-L)/2:(Math.pow(2*e-2,2)*((L+1)*(e*2-2)+L)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*he),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*he)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*ye))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*ye)/2+1,easeInBounce:e=>1-V(1-e),easeOutBounce:V,easeInOutBounce:e=>e<.5?(1-V(1-2*e))/2:(1+V(2*e-1))/2,steps:Be};var esm_g=Symbol.for("FluidValue.get"),dist_esm_m=Symbol.for("FluidValue.observers");var Pt=e=>Boolean(e&&e[esm_g]),ve=e=>e&&e[esm_g]?e[esm_g]():e,esm_qt=e=>e[dist_esm_m]||null;function je(e,t){e.eventObserved?e.eventObserved(t):e(t)}function $t(e,t){let r=e[dist_esm_m];r&&r.forEach(n=>{je(n,t)})}var esm_ge=class{[esm_g];[dist_esm_m];constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");De(this,t)}},De=(e,t)=>Ee(e,esm_g,t);function Gt(e,t){if(e[esm_g]){let r=e[dist_esm_m];r||Ee(e,dist_esm_m,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function Qt(e,t){let r=e[dist_esm_m];if(r&&r.has(t)){let n=r.size-1;n?r.delete(t):e[dist_esm_m]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var Ee=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0});var O=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,esm_Oe=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,K=new RegExp(`(${O.source})(%|[a-z]+)`,"i"),we=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,dist_esm_b=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;var esm_N=e=>{let[t,r]=We(e);if(!t||dist_esm_h())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(n)return n.trim();if(r&&r.startsWith("--")){let f=window.getComputedStyle(document.documentElement).getPropertyValue(r);return f||e}else{if(r&&dist_esm_b.test(r))return esm_N(r);if(r)return r}return e},We=e=>{let t=dist_esm_b.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]};var _,esm_Ke=(e,t,r,n,f)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${f})`,Xt=e=>{_||(_=dist_esm_c?new RegExp(`(${Object.keys(dist_esm_c).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map(o=>ve(o).replace(dist_esm_b,esm_N).replace(esm_Oe,D).replace(_,D)),r=t.map(o=>o.match(O).map(Number)),f=r[0].map((o,i)=>r.map(s=>{if(!(i in s))throw Error('The arity of each "output" value must be equal');return s[i]})).map(o=>W({...e,output:o}));return o=>{let i=!K.test(t[0])&&t.find(x=>K.test(x))?.replace(O,""),s=0;return t[0].replace(O,()=>`${f[s++](o)}${i||""}`).replace(we,esm_Ke)}};var Z="react-spring: ",Te=e=>{let t=e,r=!1;if(typeof t!="function")throw new TypeError(`${Z}once requires a function parameter`);return(...n)=>{r||(t(...n),r=!0)}},Ne=Te(console.warn);function Jt(){Ne(`${Z}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var _e=Te(console.warn);function er(){_e(`${Z}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function esm_or(e){return dist_esm_l.str(e)&&(e[0]=="#"||/\d/.test(e)||!dist_esm_h()&&dist_esm_b.test(e)||e in(dist_esm_c||{}))}var dist_esm_v,q=new WeakMap,Ze=e=>e.forEach(({target:t,contentRect:r})=>q.get(t)?.forEach(n=>n(r)));function Fe(e,t){dist_esm_v||typeof ResizeObserver<"u"&&(dist_esm_v=new ResizeObserver(Ze));let r=q.get(t);return r||(r=new Set,q.set(t,r)),r.add(e),dist_esm_v&&dist_esm_v.observe(t),()=>{let n=q.get(t);!n||(n.delete(e),!n.size&&dist_esm_v&&dist_esm_v.unobserve(t))}}var esm_$=new Set,dist_esm_w,esm_Xe=()=>{let e=()=>{esm_$.forEach(t=>t({width:window.innerWidth,height:window.innerHeight}))};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},Ie=e=>(esm_$.add(e),dist_esm_w||(dist_esm_w=esm_Xe()),()=>{esm_$.delete(e),!esm_$.size&&dist_esm_w&&(dist_esm_w(),dist_esm_w=void 0)});var ke=(e,{container:t=document.documentElement}={})=>t===document.documentElement?Ie(e):Fe(e,t);var Se=(e,t,r)=>t-e===0?1:(r-e)/(t-e);var esm_Ye={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}},esm_G=class{callback;container;info;constructor(t,r){this.callback=t,this.container=r,this.info={time:0,x:this.createAxis(),y:this.createAxis()}}createAxis=()=>({current:0,progress:0,scrollLength:0});updateAxis=t=>{let r=this.info[t],{length:n,position:f}=esm_Ye[t];r.current=this.container[`scroll${f}`],r.scrollLength=this.container["scroll"+n]-this.container["client"+n],r.progress=Se(0,r.scrollLength,r.current)};update=()=>{this.updateAxis("x"),this.updateAxis("y")};sendEvent=()=>{this.callback(this.info)};advance=()=>{this.update(),this.sendEvent()}};var esm_T=new WeakMap,Ae=new WeakMap,X=new WeakMap,Me=e=>e===document.documentElement?window:e,yr=(e,{container:t=document.documentElement}={})=>{let r=X.get(t);r||(r=new Set,X.set(t,r));let n=new esm_G(e,t);if(r.add(n),!esm_T.has(t)){let o=()=>(r?.forEach(s=>s.advance()),!0);esm_T.set(t,o);let i=Me(t);window.addEventListener("resize",o,{passive:!0}),t!==document.documentElement&&Ae.set(t,ke(o,{container:t})),i.addEventListener("scroll",o,{passive:!0})}let f=esm_T.get(t);return Re(f),()=>{Re.cancel(f);let o=X.get(t);if(!o||(o.delete(n),o.size))return;let i=esm_T.get(t);esm_T.delete(t),i&&(Me(t).removeEventListener("scroll",i),window.removeEventListener("resize",i),Ae.get(t)?.())}};function Er(e){let t=Je(null);return t.current===null&&(t.current=e()),t.current}var esm_Q=dist_esm_h()?external_React_.useEffect:external_React_.useLayoutEffect;var Ce=()=>{let e=(0,external_React_.useRef)(!1);return esm_Q(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Mr(){let e=(0,external_React_.useState)()[1],t=Ce();return()=>{t.current&&e(Math.random())}}function Lr(e,t){let[r]=(0,external_React_.useState)(()=>({inputs:t,result:e()})),n=(0,external_React_.useRef)(),f=n.current,o=f;return o?Boolean(t&&o.inputs&&it(t,o.inputs))||(o={inputs:t,result:e()}):o=r,(0,external_React_.useEffect)(()=>{n.current=o,f==r&&(r.inputs=r.result=void 0)},[o]),o.result}function it(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}var $r=e=>(0,external_React_.useEffect)(e,ut),ut=[];function Ur(e){let t=ct();return lt(()=>{t.current=e}),t.current}var Wr=()=>{let[e,t]=dt(null);return esm_Q(()=>{let r=window.matchMedia("(prefers-reduced-motion)"),n=f=>{t(f.matches),U({skipAnimation:f.matches})};return n(r),r.addEventListener("change",n),()=>{r.removeEventListener("change",n)}},[]),e}; ;// ./node_modules/@react-spring/animated/dist/esm/index.js var animated_dist_esm_h=Symbol.for("Animated:node"),animated_dist_esm_v=e=>!!e&&e[animated_dist_esm_h]===e,dist_esm_k=e=>e&&e[animated_dist_esm_h],esm_D=(e,t)=>mt(e,animated_dist_esm_h,t),F=e=>e&&e[animated_dist_esm_h]&&e[animated_dist_esm_h].getPayload(),animated_dist_esm_c=class{payload;constructor(){esm_D(this,this)}getPayload(){return this.payload||[]}};var animated_dist_esm_l=class extends animated_dist_esm_c{constructor(r){super();this._value=r;dist_esm_l.num(this._value)&&(this.lastPosition=this._value)}done=!0;elapsedTime;lastPosition;lastVelocity;v0;durationProgress=0;static create(r){return new animated_dist_esm_l(r)}getPayload(){return[this]}getValue(){return this._value}setValue(r,n){return dist_esm_l.num(r)&&(this.lastPosition=r,n&&(r=Math.round(r/n)*n,this.done&&(this.lastPosition=r))),this._value===r?!1:(this._value=r,!0)}reset(){let{done:r}=this;this.done=!1,dist_esm_l.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,r&&(this.lastVelocity=null),this.v0=null)}};var animated_dist_esm_d=class extends animated_dist_esm_l{_string=null;_toString;constructor(t){super(0),this._toString=W({output:[t,t]})}static create(t){return new animated_dist_esm_d(t)}getValue(){let t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(dist_esm_l.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=W({output:[this.getValue(),t]})),this._value=0,super.reset()}};var dist_esm_f={dependencies:null};var animated_dist_esm_u=class extends animated_dist_esm_c{constructor(r){super();this.source=r;this.setValue(r)}getValue(r){let n={};return xt(this.source,(a,i)=>{animated_dist_esm_v(a)?n[i]=a.getValue(r):Pt(a)?n[i]=ve(a):r||(n[i]=a)}),n}setValue(r){this.source=r,this.payload=this._makePayload(r)}reset(){this.payload&&esm_Ve(this.payload,r=>r.reset())}_makePayload(r){if(r){let n=new Set;return xt(r,this._addToPayload,n),Array.from(n)}}_addToPayload(r){dist_esm_f.dependencies&&Pt(r)&&dist_esm_f.dependencies.add(r);let n=F(r);n&&esm_Ve(n,a=>this.add(a))}};var animated_dist_esm_y=class extends animated_dist_esm_u{constructor(t){super(t)}static create(t){return new animated_dist_esm_y(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){let r=this.getPayload();return t.length==r.length?r.map((n,a)=>n.setValue(t[a])).some(Boolean):(super.setValue(t.map(dist_esm_z)),!0)}};function dist_esm_z(e){return(esm_or(e)?animated_dist_esm_d:animated_dist_esm_l).create(e)}function esm_Le(e){let t=dist_esm_k(e);return t?t.constructor:dist_esm_l.arr(e)?animated_dist_esm_y:esm_or(e)?animated_dist_esm_d:animated_dist_esm_l}var dist_esm_x=(e,t)=>{let r=!dist_esm_l.fun(e)||e.prototype&&e.prototype.isReactComponent;return (0,external_React_.forwardRef)((n,a)=>{let i=(0,external_React_.useRef)(null),o=r&&(0,external_React_.useCallback)(s=>{i.current=esm_ae(a,s)},[a]),[m,T]=esm_ne(n,t),W=Mr(),P=()=>{let s=i.current;if(r&&!s)return;(s?t.applyAnimatedValues(s,m.getValue(!0)):!1)===!1&&W()},_=new animated_dist_esm_b(P,T),p=(0,external_React_.useRef)();esm_Q(()=>(p.current=_,esm_Ve(T,s=>Gt(s,_)),()=>{p.current&&(esm_Ve(p.current.deps,s=>Qt(s,p.current)),esm_n.cancel(p.current.update))})),(0,external_React_.useEffect)(P,[]),$r(()=>()=>{let s=p.current;esm_Ve(s.deps,S=>Qt(S,s))});let $=t.getComponentProps(m.getValue());return external_React_.createElement(e,{...$,ref:o})})},animated_dist_esm_b=class{constructor(t,r){this.update=t;this.deps=r}eventObserved(t){t.type=="change"&&esm_n.write(this.update)}};function esm_ne(e,t){let r=new Set;return dist_esm_f.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new animated_dist_esm_u(e),dist_esm_f.dependencies=null,[e,r]}function esm_ae(e,t){return e&&(dist_esm_l.fun(e)?e(t):e.current=t),t}var dist_esm_j=Symbol.for("AnimatedComponent"),dist_esm_Ke=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=a=>new animated_dist_esm_u(a),getComponentProps:n=a=>a}={})=>{let a={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:n},i=o=>{let m=esm_I(o)||"Anonymous";return dist_esm_l.str(o)?o=i[o]||(i[o]=dist_esm_x(o,a)):o=o[dist_esm_j]||(o[dist_esm_j]=dist_esm_x(o,a)),o.displayName=`Animated(${m})`,o};return xt(e,(o,m)=>{dist_esm_l.arr(e)&&(m=esm_I(o)),i[m]=i(o)}),{animated:i}},esm_I=e=>dist_esm_l.str(e)?e:e&&dist_esm_l.str(e.displayName)?e.displayName:dist_esm_l.fun(e)&&e.name||null; ;// ./node_modules/@react-spring/core/dist/esm/index.js function dist_esm_I(t,...e){return dist_esm_l.fun(t)?t(...e):t}var esm_te=(t,e)=>t===!0||!!(e&&t&&(dist_esm_l.fun(t)?t(e):ht(t).includes(e))),et=(t,e)=>dist_esm_l.obj(t)?e&&t[e]:t;var esm_ke=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,nn=t=>t,dist_esm_ne=(t,e=nn)=>{let n=rn;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));let r={};for(let o of n){let s=e(t[o],o);dist_esm_l.und(s)||(r[o]=s)}return r},rn=["config","onProps","onStart","onChange","onPause","onResume","onRest"],on={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function sn(t){let e={},n=0;if(xt(t,(r,o)=>{on[o]||(e[o]=r,n++)}),n)return e}function esm_de(t){let e=sn(t);if(e){let n={to:e};return xt(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function esm_me(t){return t=ve(t),dist_esm_l.arr(t)?t.map(esm_me):esm_or(t)?dist_esm_p.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function esm_Ue(t){for(let e in t)return!0;return!1}function esm_Ee(t){return dist_esm_l.fun(t)||dist_esm_l.arr(t)&&dist_esm_l.obj(t[0])}function esm_xe(t,e){t.ref?.delete(t),e?.delete(t)}function esm_he(t,e){e&&t.ref!==e&&(t.ref?.delete(t),e.add(t),t.ref=e)}function wr(t,e,n=1e3){an(()=>{if(e){let r=0;ge(t,(o,s)=>{let a=o.current;if(a.length){let i=n*e[s];isNaN(i)?i=r:r=i,ge(a,u=>{ge(u.queue,p=>{let f=p.delay;p.delay=d=>i+dist_esm_I(f||0,d)})}),o.start()}})}else{let r=Promise.resolve();ge(t,o=>{let s=o.current;if(s.length){let a=s.map(i=>{let u=i.queue;return i.queue=[],u});r=r.then(()=>(ge(s,(i,u)=>ge(a[u]||[],p=>i.queue.push(p))),Promise.all(o.start())))}})}})}var esm_mt={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}};var tt={...esm_mt.default,mass:1,damping:1,easing:Lt.linear,clamp:!1},esm_we=class{tension;friction;frequency;damping;mass;velocity=0;restVelocity;precision;progress;duration;easing;clamp;bounce;decay;round;constructor(){Object.assign(this,tt)}};function gt(t,e,n){n&&(n={...n},esm_ht(n,e),e={...n,...e}),esm_ht(t,e),Object.assign(t,e);for(let a in tt)t[a]==null&&(t[a]=tt[a]);let{mass:r,frequency:o,damping:s}=t;return dist_esm_l.und(o)||(o<.01&&(o=.01),s<0&&(s=0),t.tension=Math.pow(2*Math.PI/o,2)*r,t.friction=4*Math.PI*s*r/o),t}function esm_ht(t,e){if(!dist_esm_l.und(e.decay))t.duration=void 0;else{let n=!dist_esm_l.und(e.tension)||!dist_esm_l.und(e.friction);(n||!dist_esm_l.und(e.frequency)||!dist_esm_l.und(e.damping)||!dist_esm_l.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var esm_yt=[],dist_esm_Le=class{changed=!1;values=esm_yt;toValues=null;fromValues=esm_yt;to;from;config=new esm_we;immediate=!1};function esm_Me(t,{key:e,props:n,defaultProps:r,state:o,actions:s}){return new Promise((a,i)=>{let u,p,f=esm_te(n.cancel??r?.cancel,e);if(f)b();else{dist_esm_l.und(n.pause)||(o.paused=esm_te(n.pause,e));let c=r?.pause;c!==!0&&(c=o.paused||esm_te(c,e)),u=dist_esm_I(n.delay||0,e),c?(o.resumeQueue.add(m),s.pause()):(s.resume(),m())}function d(){o.resumeQueue.add(m),o.timeouts.delete(p),p.cancel(),u=p.time-esm_n.now()}function m(){u>0&&!dist_esm_p.skipAnimation?(o.delayed=!0,p=esm_n.setTimeout(b,u),o.pauseQueue.add(d),o.timeouts.add(p)):b()}function b(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(d),o.timeouts.delete(p),t<=(o.cancelId||0)&&(f=!0);try{s.start({...n,callId:t,cancel:f},a)}catch(c){i(c)}}})}var esm_be=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?esm_q(t.get()):e.every(n=>n.noop)?nt(t.get()):dist_esm_E(t.get(),e.every(n=>n.finished)),nt=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),dist_esm_E=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),esm_q=t=>({value:t,cancelled:!0,finished:!1});function esm_De(t,e,n,r){let{callId:o,parentId:s,onRest:a}=e,{asyncTo:i,promise:u}=n;return!s&&t===i&&!e.reset?u:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;let p=dist_esm_ne(e,(l,h)=>h==="onRest"?void 0:l),f,d,m=new Promise((l,h)=>(f=l,d=h)),b=l=>{let h=o<=(n.cancelId||0)&&esm_q(r)||o!==n.asyncId&&dist_esm_E(r,!1);if(h)throw l.result=h,d(l),l},c=(l,h)=>{let g=new esm_Ae,x=new esm_Ne;return(async()=>{if(dist_esm_p.skipAnimation)throw esm_oe(n),x.result=dist_esm_E(r,!1),d(x),x;b(g);let S=dist_esm_l.obj(l)?{...l}:{...h,to:l};S.parentId=o,xt(p,(V,_)=>{dist_esm_l.und(S[_])&&(S[_]=V)});let A=await r.start(S);return b(g),n.paused&&await new Promise(V=>{n.resumeQueue.add(V)}),A})()},P;if(dist_esm_p.skipAnimation)return esm_oe(n),dist_esm_E(r,!1);try{let l;dist_esm_l.arr(t)?l=(async h=>{for(let g of h)await c(g)})(t):l=Promise.resolve(t(c,r.stop.bind(r))),await Promise.all([l.then(f),m]),P=dist_esm_E(r.get(),!0,!1)}catch(l){if(l instanceof esm_Ae)P=l.result;else if(l instanceof esm_Ne)P=l.result;else throw l}finally{o==n.asyncId&&(n.asyncId=s,n.asyncTo=s?i:void 0,n.promise=s?u:void 0)}return dist_esm_l.fun(a)&&esm_n.batchedUpdates(()=>{a(P,r,r.item)}),P})()}function esm_oe(t,e){Pe(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var esm_Ae=class extends Error{result;constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},esm_Ne=class extends Error{result;constructor(){super("SkipAnimationSignal")}};var esm_Re=t=>t instanceof esm_X,Sn=1,esm_X=class extends esm_ge{id=Sn++;_priority=0;get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=dist_esm_k(this);return e&&e.getValue()}to(...e){return dist_esm_p.to(this,e)}interpolate(...e){return Jt(),dist_esm_p.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,n=!1){$t(this,{type:"change",parent:this,value:e,idle:n})}_onPriorityChange(e){this.idle||qe.sort(this),$t(this,{type:"priority",parent:this,priority:e})}};var esm_se=Symbol.for("SpringPhase"),esm_bt=1,rt=2,ot=4,esm_qe=t=>(t[esm_se]&esm_bt)>0,dist_esm_Q=t=>(t[esm_se]&rt)>0,esm_ye=t=>(t[esm_se]&ot)>0,st=(t,e)=>e?t[esm_se]|=rt|esm_bt:t[esm_se]&=~rt,esm_it=(t,e)=>e?t[esm_se]|=ot:t[esm_se]&=~ot;var esm_ue=class extends esm_X{key;animation=new dist_esm_Le;queue;defaultProps={};_state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_pendingCalls=new Set;_lastCallId=0;_lastToId=0;_memoizedDuration=0;constructor(e,n){if(super(),!dist_esm_l.und(e)||!dist_esm_l.und(n)){let r=dist_esm_l.obj(e)?{...e}:{...n,from:e};dist_esm_l.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(dist_esm_Q(this)||this._state.asyncTo)||esm_ye(this)}get goal(){return ve(this.animation.to)}get velocity(){let e=dist_esm_k(this);return e instanceof animated_dist_esm_l?e.lastVelocity||0:e.getPayload().map(n=>n.lastVelocity||0)}get hasAnimated(){return esm_qe(this)}get isAnimating(){return dist_esm_Q(this)}get isPaused(){return esm_ye(this)}get isDelayed(){return this._state.delayed}advance(e){let n=!0,r=!1,o=this.animation,{config:s,toValues:a}=o,i=F(o.to);!i&&Pt(o.to)&&(a=ht(ve(o.to))),o.values.forEach((f,d)=>{if(f.done)return;let m=f.constructor==animated_dist_esm_d?1:i?i[d].lastPosition:a[d],b=o.immediate,c=m;if(!b){if(c=f.lastPosition,s.tension<=0){f.done=!0;return}let P=f.elapsedTime+=e,l=o.fromValues[d],h=f.v0!=null?f.v0:f.v0=dist_esm_l.arr(s.velocity)?s.velocity[d]:s.velocity,g,x=s.precision||(l==m?.005:Math.min(1,Math.abs(m-l)*.001));if(dist_esm_l.und(s.duration))if(s.decay){let S=s.decay===!0?.998:s.decay,A=Math.exp(-(1-S)*P);c=l+h/(1-S)*(1-A),b=Math.abs(f.lastPosition-c)<=x,g=h*A}else{g=f.lastVelocity==null?h:f.lastVelocity;let S=s.restVelocity||x/10,A=s.clamp?0:s.bounce,V=!dist_esm_l.und(A),_=l==m?f.v0>0:l<m,v,w=!1,C=1,$=Math.ceil(e/C);for(let L=0;L<$&&(v=Math.abs(g)>S,!(!v&&(b=Math.abs(m-c)<=x,b)));++L){V&&(w=c==m||c>m==_,w&&(g=-g*A,c=m));let N=-s.tension*1e-6*(c-m),y=-s.friction*.001*g,T=(N+y)/s.mass;g=g+T*C,c=c+g*C}}else{let S=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,f.durationProgress>0&&(f.elapsedTime=s.duration*f.durationProgress,P=f.elapsedTime+=e)),S=(s.progress||0)+P/this._memoizedDuration,S=S>1?1:S<0?0:S,f.durationProgress=S),c=l+s.easing(S)*(m-l),g=(c-f.lastPosition)/e,b=S==1}f.lastVelocity=g,Number.isNaN(c)&&(console.warn("Got NaN while animating:",this),b=!0)}i&&!i[d].done&&(b=!1),b?f.done=!0:n=!1,f.setValue(c,s.round)&&(r=!0)});let u=dist_esm_k(this),p=u.getValue();if(n){let f=ve(o.to);(p!==f||r)&&!s.decay?(u.setValue(f),this._onChange(f)):r&&s.decay&&this._onChange(p),this._stop()}else r&&this._onChange(p)}set(e){return esm_n.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(dist_esm_Q(this)){let{to:e,config:n}=this.animation;esm_n.batchedUpdates(()=>{this._onStart(),n.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,n){let r;return dist_esm_l.und(e)?(r=this.queue||[],this.queue=[]):r=[dist_esm_l.obj(e)?e:{...n,to:e}],Promise.all(r.map(o=>this._update(o))).then(o=>esm_be(this,o))}stop(e){let{to:n}=this.animation;return this._focus(this.get()),esm_oe(this._state,e&&this._lastCallId),esm_n.batchedUpdates(()=>this._stop(n,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){let n=this.key||"",{to:r,from:o}=e;r=dist_esm_l.obj(r)?r[n]:r,(r==null||esm_Ee(r))&&(r=void 0),o=dist_esm_l.obj(o)?o[n]:o,o==null&&(o=void 0);let s={to:r,from:o};return esm_qe(this)||(e.reverse&&([r,o]=[o,r]),o=ve(o),dist_esm_l.und(o)?dist_esm_k(this)||this._set(r):this._set(o)),s}_update({...e},n){let{key:r,defaultProps:o}=this;e.default&&Object.assign(o,dist_esm_ne(e,(i,u)=>/^on/.test(u)?et(i,r):i)),_t(this,e,"onProps"),esm_Ie(this,"onProps",e,this);let s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");let a=this._state;return esm_Me(++this._lastCallId,{key:r,props:e,defaultProps:o,state:a,actions:{pause:()=>{esm_ye(this)||(esm_it(this,!0),yt(a.pauseQueue),esm_Ie(this,"onPause",dist_esm_E(this,esm_Ce(this,this.animation.to)),this))},resume:()=>{esm_ye(this)&&(esm_it(this,!1),dist_esm_Q(this)&&this._resume(),yt(a.resumeQueue),esm_Ie(this,"onResume",dist_esm_E(this,esm_Ce(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(i=>{if(e.loop&&i.finished&&!(n&&i.noop)){let u=at(e);if(u)return this._update(u,!0)}return i})}_merge(e,n,r){if(n.cancel)return this.stop(!0),r(esm_q(this));let o=!dist_esm_l.und(e.to),s=!dist_esm_l.und(e.from);if(o||s)if(n.callId>this._lastToId)this._lastToId=n.callId;else return r(esm_q(this));let{key:a,defaultProps:i,animation:u}=this,{to:p,from:f}=u,{to:d=p,from:m=f}=e;s&&!o&&(!n.default||dist_esm_l.und(d))&&(d=m),n.reverse&&([d,m]=[m,d]);let b=!bt(m,f);b&&(u.from=m),m=ve(m);let c=!bt(d,p);c&&this._focus(d);let P=esm_Ee(n.to),{config:l}=u,{decay:h,velocity:g}=l;(o||s)&&(l.velocity=0),n.config&&!P&>(l,dist_esm_I(n.config,a),n.config!==i.config?dist_esm_I(i.config,a):void 0);let x=dist_esm_k(this);if(!x||dist_esm_l.und(d))return r(dist_esm_E(this,!0));let S=dist_esm_l.und(n.reset)?s&&!n.default:!dist_esm_l.und(m)&&esm_te(n.reset,a),A=S?m:this.get(),V=esm_me(d),_=dist_esm_l.num(V)||dist_esm_l.arr(V)||esm_or(V),v=!P&&(!_||esm_te(i.immediate||n.immediate,a));if(c){let L=esm_Le(d);if(L!==x.constructor)if(v)x=this._set(V);else throw Error(`Cannot animate between ${x.constructor.name} and ${L.name}, as the "to" prop suggests`)}let w=x.constructor,C=Pt(d),$=!1;if(!C){let L=S||!esm_qe(this)&&b;(c||L)&&($=bt(esm_me(A),V),C=!$),(!bt(u.immediate,v)&&!v||!bt(l.decay,h)||!bt(l.velocity,g))&&(C=!0)}if($&&dist_esm_Q(this)&&(u.changed&&!S?C=!0:C||this._stop(p)),!P&&((C||Pt(p))&&(u.values=x.getPayload(),u.toValues=Pt(d)?null:w==animated_dist_esm_d?[1]:ht(V)),u.immediate!=v&&(u.immediate=v,!v&&!S&&this._set(p)),C)){let{onRest:L}=u;esm_Ve(_n,y=>_t(this,n,y));let N=dist_esm_E(this,esm_Ce(this,p));yt(this._pendingCalls,N),this._pendingCalls.add(r),u.changed&&esm_n.batchedUpdates(()=>{u.changed=!S,L?.(N,this),S?dist_esm_I(i.onRest,N):u.onStart?.(N,this)})}S&&this._set(A),P?r(esm_De(n.to,n,this._state,this)):C?this._start():dist_esm_Q(this)&&!c?this._pendingCalls.add(r):r(nt(A))}_focus(e){let n=this.animation;e!==n.to&&(esm_qt(this)&&this._detach(),n.to=e,esm_qt(this)&&this._attach())}_attach(){let e=0,{to:n}=this.animation;Pt(n)&&(Gt(n,this),esm_Re(n)&&(e=n.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;Pt(e)&&Qt(e,this)}_set(e,n=!0){let r=ve(e);if(!dist_esm_l.und(r)){let o=dist_esm_k(this);if(!o||!bt(r,o.getValue())){let s=esm_Le(r);!o||o.constructor!=s?esm_D(this,s.create(r)):o.setValue(r),o&&esm_n.batchedUpdates(()=>{this._onChange(r,n)})}}return dist_esm_k(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,esm_Ie(this,"onStart",dist_esm_E(this,esm_Ce(this,e.to)),this))}_onChange(e,n){n||(this._onStart(),dist_esm_I(this.animation.onChange,e,this)),dist_esm_I(this.defaultProps.onChange,e,this),super._onChange(e,n)}_start(){let e=this.animation;dist_esm_k(this).reset(ve(e.to)),e.immediate||(e.fromValues=e.values.map(n=>n.lastPosition)),dist_esm_Q(this)||(st(this,!0),esm_ye(this)||this._resume())}_resume(){dist_esm_p.skipAnimation?this.finish():qe.start(this)}_stop(e,n){if(dist_esm_Q(this)){st(this,!1);let r=this.animation;esm_Ve(r.values,s=>{s.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),$t(this,{type:"idle",parent:this});let o=n?esm_q(this.get()):dist_esm_E(this.get(),esm_Ce(this,e??r.to));yt(this._pendingCalls,o),r.changed&&(r.changed=!1,esm_Ie(this,"onRest",o,this))}}};function esm_Ce(t,e){let n=esm_me(e),r=esm_me(t.get());return bt(r,n)}function at(t,e=t.loop,n=t.to){let r=dist_esm_I(e);if(r){let o=r!==!0&&esm_de(r),s=(o||t).reverse,a=!o||o.reset;return esm_Pe({...t,loop:e,default:!1,pause:void 0,to:!s||esm_Ee(n)?n:void 0,from:a?t.from:void 0,reset:a,...o})}}function esm_Pe(t){let{to:e,from:n}=t=esm_de(t),r=new Set;return dist_esm_l.obj(e)&&Vt(e,r),dist_esm_l.obj(n)&&Vt(n,r),t.keys=r.size?Array.from(r):null,t}function Ot(t){let e=esm_Pe(t);return R.und(e.default)&&(e.default=dist_esm_ne(e)),e}function Vt(t,e){xt(t,(n,r)=>n!=null&&e.add(r))}var _n=["onStart","onRest","onChange","onPause","onResume"];function _t(t,e,n){t.animation[n]=e[n]!==esm_ke(e,n)?et(e[n],t.key):void 0}function esm_Ie(t,e,...n){t.animation[e]?.(...n),t.defaultProps[e]?.(...n)}var Fn=["onStart","onChange","onRest"],kn=1,esm_le=class{id=kn++;springs={};queue=[];ref;_flush;_initialProps;_lastAsyncId=0;_active=new Set;_changed=new Set;_started=!1;_item;_state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set};_events={onStart:new Map,onChange:new Map,onRest:new Map};constructor(e,n){this._onFrame=this._onFrame.bind(this),n&&(this._flush=n),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){let e={};return this.each((n,r)=>e[r]=n.get()),e}set(e){for(let n in e){let r=e[n];dist_esm_l.und(r)||this.springs[n].set(r)}}update(e){return e&&this.queue.push(esm_Pe(e)),this}start(e){let{queue:n}=this;return e?n=ht(e).map(esm_Pe):this.queue=[],this._flush?this._flush(this,n):(jt(this,n),esm_ze(this,n))}stop(e,n){if(e!==!!e&&(n=e),n){let r=this.springs;esm_Ve(ht(n),o=>r[o].stop(!!e))}else esm_oe(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(dist_esm_l.und(e))this.start({pause:!0});else{let n=this.springs;esm_Ve(ht(e),r=>n[r].pause())}return this}resume(e){if(dist_esm_l.und(e))this.start({pause:!1});else{let n=this.springs;esm_Ve(ht(e),r=>n[r].resume())}return this}each(e){xt(this.springs,e)}_onFrame(){let{onStart:e,onChange:n,onRest:r}=this._events,o=this._active.size>0,s=this._changed.size>0;(o&&!this._started||s&&!this._started)&&(this._started=!0,Pe(e,([u,p])=>{p.value=this.get(),u(p,this,this._item)}));let a=!o&&this._started,i=s||a&&r.size?this.get():null;s&&n.size&&Pe(n,([u,p])=>{p.value=i,u(p,this,this._item)}),a&&(this._started=!1,Pe(r,([u,p])=>{p.value=i,u(p,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;esm_n.onFrame(this._onFrame)}};function esm_ze(t,e){return Promise.all(e.map(n=>wt(t,n))).then(n=>esm_be(t,n))}async function wt(t,e,n){let{keys:r,to:o,from:s,loop:a,onRest:i,onResolve:u}=e,p=dist_esm_l.obj(e.default)&&e.default;a&&(e.loop=!1),o===!1&&(e.to=null),s===!1&&(e.from=null);let f=dist_esm_l.arr(o)||dist_esm_l.fun(o)?o:void 0;f?(e.to=void 0,e.onRest=void 0,p&&(p.onRest=void 0)):esm_Ve(Fn,P=>{let l=e[P];if(dist_esm_l.fun(l)){let h=t._events[P];e[P]=({finished:g,cancelled:x})=>{let S=h.get(l);S?(g||(S.finished=!1),x&&(S.cancelled=!0)):h.set(l,{value:null,finished:g||!1,cancelled:x||!1})},p&&(p[P]=e[P])}});let d=t._state;e.pause===!d.paused?(d.paused=e.pause,yt(e.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(e.pause=!0);let m=(r||Object.keys(t.springs)).map(P=>t.springs[P].start(e)),b=e.cancel===!0||esm_ke(e,"cancel")===!0;(f||b&&d.asyncId)&&m.push(esm_Me(++t._lastAsyncId,{props:e,state:d,actions:{pause:Y,resume:Y,start(P,l){b?(esm_oe(d,t._lastAsyncId),l(esm_q(t))):(P.onRest=i,l(esm_De(f,P,d,t)))}}})),d.paused&&await new Promise(P=>{d.resumeQueue.add(P)});let c=esm_be(t,await Promise.all(m));if(a&&c.finished&&!(n&&c.noop)){let P=at(e,a,o);if(P)return jt(t,[P]),wt(t,P,!0)}return u&&esm_n.batchedUpdates(()=>u(c,t,t.item)),c}function esm_e(t,e){let n={...t.springs};return e&&pe(Ve(e),r=>{z.und(r.keys)&&(r=esm_Pe(r)),z.obj(r.to)||(r={...r,to:void 0}),Mt(n,r,o=>esm_Lt(o))}),pt(t,n),n}function pt(t,e){Ut(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Et(n,t))})}function esm_Lt(t,e){let n=new esm_ue;return n.key=t,e&&Gt(n,e),n}function Mt(t,e,n){e.keys&&esm_Ve(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function jt(t,e){esm_Ve(e,n=>{Mt(t.springs,n,r=>esm_Lt(r,t))})}var dist_esm_H=({children:t,...e})=>{let n=(0,external_React_.useContext)(esm_Ge),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=Lr(()=>({pause:r,immediate:o}),[r,o]);let{Provider:s}=esm_Ge;return external_React_.createElement(s,{value:e},t)},esm_Ge=wn(dist_esm_H,{});dist_esm_H.Provider=esm_Ge.Provider;dist_esm_H.Consumer=esm_Ge.Consumer;function wn(t,e){return Object.assign(t,external_React_.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var esm_fe=()=>{let t=[],e=function(r){Ln();let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=n(r,s,a);i&&o.push(s.start(i))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){let o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return ce(t,r=>r.pause(...arguments)),this},e.resume=function(){return ce(t,r=>r.resume(...arguments)),this},e.set=function(r){ce(t,(o,s)=>{let a=Ke.fun(r)?r(s,o):r;a&&o.set(a)})},e.start=function(r){let o=[];return ce(t,(s,a)=>{if(Ke.und(r))o.push(s.start());else{let i=this._getProps(r,s,a);i&&o.push(s.start(i))}}),o},e.stop=function(){return ce(t,r=>r.stop(...arguments)),this},e.update=function(r){return ce(t,(o,s)=>o.update(this._getProps(r,o,s))),this};let n=function(r,o,s){return Ke.fun(r)?r(s,o):r};return e._getProps=n,e};function esm_He(t,e,n){let r=jn.fun(e)&&e;r&&!n&&(n=[]);let o=Xe(()=>r||arguments.length==3?esm_fe():void 0,[]),s=Nt(0),a=Dn(),i=Xe(()=>({ctrls:[],queue:[],flush(h,g){let x=esm_e(h,g);return s.current>0&&!i.queue.length&&!Object.keys(x).some(A=>!h.springs[A])?esm_ze(h,g):new Promise(A=>{pt(h,x),i.queue.push(()=>{A(esm_ze(h,g))}),a()})}}),[]),u=Nt([...i.ctrls]),p=[],f=Dt(t)||0;Xe(()=>{Ye(u.current.slice(t,f),h=>{esm_xe(h,o),h.stop(!0)}),u.current.length=t,d(f,t)},[t]),Xe(()=>{d(0,Math.min(f,t))},n);function d(h,g){for(let x=h;x<g;x++){let S=u.current[x]||(u.current[x]=new esm_le(null,i.flush)),A=r?r(x,S):e[x];A&&(p[x]=Ot(A))}}let m=u.current.map((h,g)=>esm_e(h,p[g])),b=Mn(dist_esm_H),c=Dt(b),P=b!==c&&esm_Ue(b);qn(()=>{s.current++,i.ctrls=u.current;let{queue:h}=i;h.length&&(i.queue=[],Ye(h,g=>g())),Ye(u.current,(g,x)=>{o?.add(g),P&&g.start({default:b});let S=p[x];S&&(esm_he(g,S.ref),g.ref?g.queue.push(S):g.start(S))})}),Nn(()=>()=>{Ye(i.ctrls,h=>h.stop(!0))});let l=m.map(h=>({...h}));return o?[l,o]:l}function esm_J(t,e){let n=Qn.fun(t),[[r],o]=esm_He(1,n?t:[t],n?e||[]:e);return n||arguments.length==2?[r,o]:r}var Gn=()=>esm_fe(),Xo=()=>zn(Gn)[0];var Wo=(t,e)=>{let n=Bn(()=>new esm_ue(t,e));return Kn(()=>()=>{n.stop()}),n};function esm_Qt(t,e,n){let r=qt.fun(e)&&e;r&&!n&&(n=[]);let o=!0,s,a=esm_He(t,(i,u)=>{let p=r?r(i,u):e;return s=p.ref,o=o&&p.reverse,p},n||[{}]);if(Yn(()=>{Xn(a[1].current,(i,u)=>{let p=a[1].current[u+(o?1:-1)];if(esm_he(i,s),i.ref){p&&i.update({to:p.springs});return}p?i.start({to:p.springs}):i.start()})},n),r||arguments.length==3){let i=s??a[1];return i._getProps=(u,p,f)=>{let d=qt.fun(u)?u(f,p):u;if(d){let m=i.current[f+(d.reverse?1:-1)];return m&&(d.to=m.springs),d}},a}return a[0]}function esm_Gt(t,e,n){let r=G.fun(e)&&e,{reset:o,sort:s,trail:a=0,expires:i=!0,exitBeforeEnter:u=!1,onDestroyed:p,ref:f,config:d}=r?r():e,m=Jn(()=>r||arguments.length==3?esm_fe():void 0,[]),b=zt(t),c=[],P=lt(null),l=o?null:P.current;Je(()=>{P.current=c}),$n(()=>(j(c,y=>{m?.add(y.ctrl),y.ctrl.ref=m}),()=>{j(P.current,y=>{y.expired&&clearTimeout(y.expirationId),esm_xe(y.ctrl,m),y.ctrl.stop(!0)})}));let h=tr(b,r?r():e,l),g=o&&P.current||[];Je(()=>j(g,({ctrl:y,item:T,key:F})=>{esm_xe(y,m),dist_esm_I(p,T,F)}));let x=[];if(l&&j(l,(y,T)=>{y.expired?(clearTimeout(y.expirationId),g.push(y)):(T=x[T]=h.indexOf(y.key),~T&&(c[T]=y))}),j(b,(y,T)=>{c[T]||(c[T]={key:h[T],item:y,phase:"mount",ctrl:new esm_le},c[T].ctrl.item=y)}),x.length){let y=-1,{leave:T}=r?r():e;j(x,(F,k)=>{let O=l[k];~F?(y=c.indexOf(O),c[y]={...O,item:b[F]}):T&&c.splice(++y,0,O)})}G.fun(s)&&c.sort((y,T)=>s(y.item,T.item));let S=-a,A=Wn(),V=dist_esm_ne(e),_=new Map,v=lt(new Map),w=lt(!1);j(c,(y,T)=>{let F=y.key,k=y.phase,O=r?r():e,U,D,Jt=dist_esm_I(O.delay||0,F);if(k=="mount")U=O.enter,D="enter";else{let M=h.indexOf(F)<0;if(k!="leave")if(M)U=O.leave,D="leave";else if(U=O.update)D="update";else return;else if(!M)U=O.enter,D="enter";else return}if(U=dist_esm_I(U,y.item,T),U=G.obj(U)?esm_de(U):{to:U},!U.config){let M=d||V.config;U.config=dist_esm_I(M,y.item,T,D)}S+=a;let Z={...V,delay:Jt+S,ref:f,immediate:O.immediate,reset:!1,...U};if(D=="enter"&&G.und(Z.from)){let M=r?r():e,Te=G.und(M.initial)||l?M.from:M.initial;Z.from=dist_esm_I(Te,y.item,T)}let{onResolve:Wt}=Z;Z.onResolve=M=>{dist_esm_I(Wt,M);let Te=P.current,B=Te.find(Fe=>Fe.key===F);if(!!B&&!(M.cancelled&&B.phase!="update")&&B.ctrl.idle){let Fe=Te.every(ee=>ee.ctrl.idle);if(B.phase=="leave"){let ee=dist_esm_I(i,B.item);if(ee!==!1){let Ze=ee===!0?0:ee;if(B.expired=!0,!Fe&&Ze>0){Ze<=2147483647&&(B.expirationId=setTimeout(A,Ze));return}}}Fe&&Te.some(ee=>ee.expired)&&(v.current.delete(B),u&&(w.current=!0),A())}};let ft=esm_e(y.ctrl,Z);D==="leave"&&u?v.current.set(y,{phase:D,springs:ft,payload:Z}):_.set(y,{phase:D,springs:ft,payload:Z})});let C=Hn(dist_esm_H),$=Zn(C),L=C!==$&&esm_Ue(C);Je(()=>{L&&j(c,y=>{y.ctrl.start({default:C})})},[C]),j(_,(y,T)=>{if(v.current.size){let F=c.findIndex(k=>k.key===T.key);c.splice(F,1)}}),Je(()=>{j(v.current.size?v.current:_,({phase:y,payload:T},F)=>{let{ctrl:k}=F;F.phase=y,m?.add(k),L&&y=="enter"&&k.start({default:C}),T&&(esm_he(k,T.ref),(k.ref||m)&&!w.current?k.update(T):(k.start(T),w.current&&(w.current=!1)))})},o?void 0:n);let N=y=>Oe.createElement(Oe.Fragment,null,c.map((T,F)=>{let{springs:k}=_.get(T)||T.ctrl,O=y({...k},T.item,T,F);return O&&O.type?Oe.createElement(O.type,{...O.props,key:G.str(T.key)||G.num(T.key)?T.key:T.ctrl.id,ref:O.ref}):O}));return m?[N,m]:N}var esm_er=1;function tr(t,{key:e,keys:n=e},r){if(n===null){let o=new Set;return t.map(s=>{let a=r&&r.find(i=>i.item===s&&i.phase!=="leave"&&!o.has(i));return a?(o.add(a),a.key):esm_er++})}return G.und(n)?t:G.fun(n)?t.map(n):zt(n)}var hs=({container:t,...e}={})=>{let[n,r]=esm_J(()=>({scrollX:0,scrollY:0,scrollXProgress:0,scrollYProgress:0,...e}),[]);return or(()=>{let o=rr(({x:s,y:a})=>{r.start({scrollX:s.current,scrollXProgress:s.progress,scrollY:a.current,scrollYProgress:a.progress})},{container:t?.current||void 0});return()=>{nr(Object.values(n),s=>s.stop()),o()}},[]),n};var Ps=({container:t,...e})=>{let[n,r]=esm_J(()=>({width:0,height:0,...e}),[]);return ar(()=>{let o=sr(({width:s,height:a})=>{r.start({width:s,height:a,immediate:n.width.get()===0||n.height.get()===0})},{container:t?.current||void 0});return()=>{ir(Object.values(n),s=>s.stop()),o()}},[]),n};var cr={any:0,all:1};function Cs(t,e){let[n,r]=pr(!1),o=ur(),s=Bt.fun(t)&&t,a=s?s():{},{to:i={},from:u={},...p}=a,f=s?e:t,[d,m]=esm_J(()=>({from:u,...p}),[]);return lr(()=>{let b=o.current,{root:c,once:P,amount:l="any",...h}=f??{};if(!b||P&&n||typeof IntersectionObserver>"u")return;let g=new WeakMap,x=()=>(i&&m.start(i),r(!0),P?void 0:()=>{u&&m.start(u),r(!1)}),S=V=>{V.forEach(_=>{let v=g.get(_.target);if(_.isIntersecting!==Boolean(v))if(_.isIntersecting){let w=x();Bt.fun(w)?g.set(_.target,w):A.unobserve(_.target)}else v&&(v(),g.delete(_.target))})},A=new IntersectionObserver(S,{root:c&&c.current||void 0,threshold:typeof l=="number"||Array.isArray(l)?l:cr[l],...h});return A.observe(b),()=>A.unobserve(b)},[f]),s?[o,d]:[o,n]}function qs({children:t,...e}){return t(esm_J(e))}function Bs({items:t,children:e,...n}){let r=esm_Qt(t.length,n);return t.map((o,s)=>{let a=e(o,s);return fr.fun(a)?a(r[s]):a})}function Ys({items:t,children:e,...n}){return esm_Gt(t,n)(e)}var esm_W=class extends esm_X{constructor(n,r){super();this.source=n;this.calc=W(...r);let o=this._get(),s=esm_Le(o);esm_D(this,s.create(o))}key;idle=!0;calc;_active=new Set;advance(n){let r=this._get(),o=this.get();bt(r,o)||(dist_esm_k(this).setValue(r),this._onChange(r,this.idle)),!this.idle&&Yt(this._active)&&esm_ct(this)}_get(){let n=dist_esm_l.arr(this.source)?this.source.map(ve):ht(ve(this.source));return this.calc(...n)}_start(){this.idle&&!Yt(this._active)&&(this.idle=!1,esm_Ve(F(this),n=>{n.done=!1}),dist_esm_p.skipAnimation?(esm_n.batchedUpdates(()=>this.advance()),esm_ct(this)):qe.start(this))}_attach(){let n=1;esm_Ve(ht(this.source),r=>{Pt(r)&&Gt(r,this),esm_Re(r)&&(r.idle||this._active.add(r),n=Math.max(n,r.priority+1))}),this.priority=n,this._start()}_detach(){esm_Ve(ht(this.source),n=>{Pt(n)&&Qt(n,this)}),this._active.clear(),esm_ct(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=ht(this.source).reduce((r,o)=>Math.max(r,(esm_Re(o)?o.priority:0)+1),0))}};function vr(t){return t.idle!==!1}function Yt(t){return!t.size||Array.from(t).every(vr)}function esm_ct(t){t.idle||(t.idle=!0,esm_Ve(F(t),e=>{e.done=!0}),$t(t,{type:"idle",parent:t}))}var esm_ui=(t,...e)=>new esm_W(t,e),pi=(t,...e)=>(Cr(),new esm_W(t,e));dist_esm_p.assign({createStringInterpolator:Xt,to:(t,e)=>new esm_W(t,e)});var di=qe.advance; ;// external "ReactDOM" const external_ReactDOM_namespaceObject = window["ReactDOM"]; ;// ./node_modules/@react-spring/web/dist/esm/index.js var web_dist_esm_k=/^--/;function web_dist_esm_I(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!web_dist_esm_k.test(t)&&!(web_dist_esm_c.hasOwnProperty(t)&&web_dist_esm_c[t])?e+"px":(""+e).trim()}var web_dist_esm_v={};function esm_V(t,e){if(!t.nodeType||!t.setAttribute)return!1;let r=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",{style:i,children:s,scrollTop:u,scrollLeft:l,viewBox:a,...n}=e,d=Object.values(n),m=Object.keys(n).map(o=>r||t.hasAttribute(o)?o:web_dist_esm_v[o]||(web_dist_esm_v[o]=o.replace(/([A-Z])/g,p=>"-"+p.toLowerCase())));s!==void 0&&(t.textContent=s);for(let o in i)if(i.hasOwnProperty(o)){let p=web_dist_esm_I(o,i[o]);web_dist_esm_k.test(o)?t.style.setProperty(o,p):t.style[o]=p}m.forEach((o,p)=>{t.setAttribute(o,d[p])}),u!==void 0&&(t.scrollTop=u),l!==void 0&&(t.scrollLeft=l),a!==void 0&&t.setAttribute("viewBox",a)}var web_dist_esm_c={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},esm_F=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),esm_L=["Webkit","Ms","Moz","O"];web_dist_esm_c=Object.keys(web_dist_esm_c).reduce((t,e)=>(esm_L.forEach(r=>t[esm_F(r,e)]=t[e]),t),web_dist_esm_c);var esm_=/^(matrix|translate|scale|rotate|skew)/,dist_esm_$=/^(translate)/,dist_esm_G=/^(rotate|skew)/,web_dist_esm_y=(t,e)=>dist_esm_l.num(t)&&t!==0?t+e:t,web_dist_esm_h=(t,e)=>dist_esm_l.arr(t)?t.every(r=>web_dist_esm_h(r,e)):dist_esm_l.num(t)?t===e:parseFloat(t)===e,dist_esm_g=class extends animated_dist_esm_u{constructor({x:e,y:r,z:i,...s}){let u=[],l=[];(e||r||i)&&(u.push([e||0,r||0,i||0]),l.push(a=>[`translate3d(${a.map(n=>web_dist_esm_y(n,"px")).join(",")})`,web_dist_esm_h(a,0)])),xt(s,(a,n)=>{if(n==="transform")u.push([a||""]),l.push(d=>[d,d===""]);else if(esm_.test(n)){if(delete s[n],dist_esm_l.und(a))return;let d=dist_esm_$.test(n)?"px":dist_esm_G.test(n)?"deg":"";u.push(ht(a)),l.push(n==="rotate3d"?([m,o,p,O])=>[`rotate3d(${m},${o},${p},${web_dist_esm_y(O,d)})`,web_dist_esm_h(O,0)]:m=>[`${n}(${m.map(o=>web_dist_esm_y(o,d)).join(",")})`,web_dist_esm_h(m,n.startsWith("scale")?1:0)])}}),u.length&&(s.transform=new web_dist_esm_x(u,l)),super(s)}},web_dist_esm_x=class extends esm_ge{constructor(r,i){super();this.inputs=r;this.transforms=i}_value=null;get(){return this._value||(this._value=this._get())}_get(){let r="",i=!0;return esm_Ve(this.inputs,(s,u)=>{let l=ve(s[0]),[a,n]=this.transforms[u](dist_esm_l.arr(l)?l:s.map(ve));r+=" "+a,i=i&&n}),i?"none":r}observerAdded(r){r==1&&esm_Ve(this.inputs,i=>esm_Ve(i,s=>Pt(s)&&Gt(s,this)))}observerRemoved(r){r==0&&esm_Ve(this.inputs,i=>esm_Ve(i,s=>Pt(s)&&Qt(s,this)))}eventObserved(r){r.type=="change"&&(this._value=null),$t(this,r)}};var esm_C=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];dist_esm_p.assign({batchedUpdates:external_ReactDOM_namespaceObject.unstable_batchedUpdates,createStringInterpolator:Xt,colors:It});var dist_esm_q=dist_esm_Ke(esm_C,{applyAnimatedValues:esm_V,createAnimatedStyle:t=>new dist_esm_g(t),getComponentProps:({scrollTop:t,scrollLeft:e,...r})=>r}),dist_esm_it=dist_esm_q.animated; ;// ./node_modules/@wordpress/block-editor/build-module/components/use-moving-animation/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * If the block count exceeds the threshold, we disable the reordering animation * to avoid laginess. */ const BLOCK_ANIMATION_THRESHOLD = 200; function getAbsolutePosition(element) { return { top: element.offsetTop, left: element.offsetLeft }; } /** * Hook used to compute the styles required to move a div into a new position. * * The way this animation works is the following: * - It first renders the element as if there was no animation. * - It takes a snapshot of the position of the block to use it * as a destination point for the animation. * - It restores the element to the previous position using a CSS transform * - It uses the "resetAnimation" flag to reset the animation * from the beginning in order to animate to the new destination point. * * @param {Object} $1 Options * @param {*} $1.triggerAnimationOnChange Variable used to trigger the animation if it changes. * @param {string} $1.clientId */ function useMovingAnimation({ triggerAnimationOnChange, clientId }) { const ref = (0,external_wp_element_namespaceObject.useRef)(); const { isTyping, getGlobalBlockCount, isBlockSelected, isFirstMultiSelectedBlock, isBlockMultiSelected, isAncestorMultiSelected, isDraggingBlocks } = (0,external_wp_data_namespaceObject.useSelect)(store); // Whenever the trigger changes, we need to take a snapshot of the current // position of the block to use it as a destination point for the animation. const { previous, prevRect } = (0,external_wp_element_namespaceObject.useMemo)(() => ({ previous: ref.current && getAbsolutePosition(ref.current), prevRect: ref.current && ref.current.getBoundingClientRect() }), [triggerAnimationOnChange]); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (!previous || !ref.current) { return; } const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(ref.current); const isSelected = isBlockSelected(clientId); const adjustScrolling = isSelected || isFirstMultiSelectedBlock(clientId); const isDragging = isDraggingBlocks(); function preserveScrollPosition() { // The user already scrolled when dragging blocks. if (isDragging) { return; } if (adjustScrolling && prevRect) { const blockRect = ref.current.getBoundingClientRect(); const diff = blockRect.top - prevRect.top; if (diff) { scrollContainer.scrollTop += diff; } } } // We disable the animation if the user has a preference for reduced // motion, if the user is typing (insertion by Enter), or if the block // count exceeds the threshold (insertion caused all the blocks that // follow to animate). // To do: consider enabling the _moving_ animation even for large // posts, while only disabling the _insertion_ animation? const disableAnimation = window.matchMedia('(prefers-reduced-motion: reduce)').matches || isTyping() || getGlobalBlockCount() > BLOCK_ANIMATION_THRESHOLD; if (disableAnimation) { // If the animation is disabled and the scroll needs to be adjusted, // just move directly to the final scroll position. preserveScrollPosition(); return; } const isPartOfSelection = isSelected || isBlockMultiSelected(clientId) || isAncestorMultiSelected(clientId); // The user already dragged the blocks to the new position, so don't // animate the dragged blocks. if (isPartOfSelection && isDragging) { return; } // Make sure the other blocks move under the selected block(s). const zIndex = isPartOfSelection ? '1' : ''; const controller = new esm_le({ x: 0, y: 0, config: { mass: 5, tension: 2000, friction: 200 }, onChange({ value }) { if (!ref.current) { return; } let { x, y } = value; x = Math.round(x); y = Math.round(y); const finishedMoving = x === 0 && y === 0; ref.current.style.transformOrigin = 'center center'; ref.current.style.transform = finishedMoving ? null // Set to `null` to explicitly remove the transform. : `translate3d(${x}px,${y}px,0)`; ref.current.style.zIndex = zIndex; preserveScrollPosition(); } }); ref.current.style.transform = undefined; const destination = getAbsolutePosition(ref.current); const x = Math.round(previous.left - destination.left); const y = Math.round(previous.top - destination.top); controller.start({ x: 0, y: 0, from: { x, y } }); return () => { controller.stop(); controller.set({ x: 0, y: 0 }); }; }, [previous, prevRect, clientId, isTyping, getGlobalBlockCount, isBlockSelected, isFirstMultiSelectedBlock, isBlockMultiSelected, isAncestorMultiSelected, isDraggingBlocks]); return ref; } /* harmony default export */ const use_moving_animation = (useMovingAnimation); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-focus-first-element.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('@wordpress/element').RefObject} RefObject */ /** * Transitions focus to the block or inner tabbable when the block becomes * selected and an initial position is set. * * @param {string} clientId Block client ID. * * @return {RefObject} React ref with the block element. */ function useFocusFirstElement({ clientId, initialPosition }) { const ref = (0,external_wp_element_namespaceObject.useRef)(); const { isBlockSelected, isMultiSelecting, isZoomOut } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); (0,external_wp_element_namespaceObject.useEffect)(() => { // Check if the block is still selected at the time this effect runs. if (!isBlockSelected(clientId) || isMultiSelecting() || isZoomOut()) { return; } if (initialPosition === undefined || initialPosition === null) { return; } if (!ref.current) { return; } const { ownerDocument } = ref.current; // Do not focus the block if it already contains the active element. if (isInsideRootBlock(ref.current, ownerDocument.activeElement)) { return; } // Find all tabbables within node. const textInputs = external_wp_dom_namespaceObject.focus.tabbable.find(ref.current).filter(node => (0,external_wp_dom_namespaceObject.isTextField)(node)); // If reversed (e.g. merge via backspace), use the last in the set of // tabbables. const isReverse = -1 === initialPosition; const target = textInputs[isReverse ? textInputs.length - 1 : 0] || ref.current; if (!isInsideRootBlock(ref.current, target)) { ref.current.focus(); return; } // Check to see if element is focussable before a generic caret insert. if (!ref.current.getAttribute('contenteditable')) { const focusElement = external_wp_dom_namespaceObject.focus.tabbable.findNext(ref.current); // Make sure focusElement is valid, contained in the same block, and a form field. if (focusElement && isInsideRootBlock(ref.current, focusElement) && (0,external_wp_dom_namespaceObject.isFormElement)(focusElement)) { focusElement.focus(); return; } } (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(target, isReverse); }, [initialPosition, clientId]); return ref; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-is-hovered.js /** * WordPress dependencies */ /** * Internal dependencies */ /* * Adds `is-hovered` class when the block is hovered and in navigation or * outline mode. */ function useIsHovered({ clientId }) { const { hoverBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); function listener(event) { if (event.defaultPrevented) { return; } const action = event.type === 'mouseover' ? 'add' : 'remove'; event.preventDefault(); event.currentTarget.classList[action]('is-hovered'); if (action === 'add') { hoverBlock(clientId); } else { hoverBlock(null); } } return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { node.addEventListener('mouseout', listener); node.addEventListener('mouseover', listener); return () => { node.removeEventListener('mouseout', listener); node.removeEventListener('mouseover', listener); // Remove class in case it lingers. node.classList.remove('is-hovered'); hoverBlock(null); }; }, []); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-focus-handler.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Selects the block if it receives focus. * * @param {string} clientId Block client ID. */ function useFocusHandler(clientId) { const { isBlockSelected } = (0,external_wp_data_namespaceObject.useSelect)(store); const { selectBlock, selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(store); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { /** * Marks the block as selected when focused and not already * selected. This specifically handles the case where block does not * set focus on its own (via `setFocus`), typically if there is no * focusable input in the block. * * @param {FocusEvent} event Focus event. */ function onFocus(event) { // When the whole editor is editable, let writing flow handle // selection. if (node.parentElement.closest('[contenteditable="true"]')) { return; } // Check synchronously because a non-selected block might be // getting data through `useSelect` asynchronously. if (isBlockSelected(clientId)) { // Potentially change selection away from rich text. if (!event.target.isContentEditable) { selectionChange(clientId); } return; } // If an inner block is focussed, that block is responsible for // setting the selected block. if (!isInsideRootBlock(node, event.target)) { return; } selectBlock(clientId); } node.addEventListener('focusin', onFocus); return () => { node.removeEventListener('focusin', onFocus); }; }, [isBlockSelected, selectBlock]); } ;// ./node_modules/@wordpress/icons/build-module/library/drag-handle.js /** * WordPress dependencies */ const dragHandle = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z" }) }); /* harmony default export */ const drag_handle = (dragHandle); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/draggable-chip.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockDraggableChip({ count, icon, isPattern, fadeWhenDisabled }) { const patternLabel = isPattern && (0,external_wp_i18n_namespaceObject.__)('Pattern'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-draggable-chip-wrapper", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-draggable-chip", "data-testid": "block-draggable-chip", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { justify: "center", className: "block-editor-block-draggable-chip__content", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: icon ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: icon }) : patternLabel || (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: Number of blocks. */ (0,external_wp_i18n_namespaceObject._n)('%d block', '%d blocks', count), count) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: drag_handle }) }), fadeWhenDisabled && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "block-editor-block-draggable-chip__disabled", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-draggable-chip__disabled-icon" }) })] }) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Adds block behaviour: * - Removes the block on BACKSPACE. * - Inserts a default block on ENTER. * - Disables dragging of block contents. * * @param {string} clientId Block client ID. */ function useEventHandlers({ clientId, isSelected }) { const { getBlockType } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); const { getBlockRootClientId, isZoomOut, hasMultiSelection, getBlockName } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); const { insertAfterBlock, removeBlock, resetZoomLevel, startDraggingBlocks, stopDraggingBlocks } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { if (!isSelected) { return; } /** * Interprets keydown event intent to remove or insert after block if * key event occurs on wrapper node. This can occur when the block has * no text fields of its own, particularly after initial insertion, to * allow for easy deletion and continuous writing flow to add additional * content. * * @param {KeyboardEvent} event Keydown event. */ function onKeyDown(event) { const { keyCode, target } = event; if (keyCode !== external_wp_keycodes_namespaceObject.ENTER && keyCode !== external_wp_keycodes_namespaceObject.BACKSPACE && keyCode !== external_wp_keycodes_namespaceObject.DELETE) { return; } if (target !== node || (0,external_wp_dom_namespaceObject.isTextField)(target)) { return; } event.preventDefault(); if (keyCode === external_wp_keycodes_namespaceObject.ENTER && isZoomOut()) { resetZoomLevel(); } else if (keyCode === external_wp_keycodes_namespaceObject.ENTER) { insertAfterBlock(clientId); } else { removeBlock(clientId); } } /** * Prevents default dragging behavior within a block. To do: we must * handle this in the future and clean up the drag target. * * @param {DragEvent} event Drag event. */ function onDragStart(event) { if (node !== event.target || node.isContentEditable || node.ownerDocument.activeElement !== node || hasMultiSelection()) { event.preventDefault(); return; } const data = JSON.stringify({ type: 'block', srcClientIds: [clientId], srcRootClientId: getBlockRootClientId(clientId) }); event.dataTransfer.effectAllowed = 'move'; // remove "+" cursor event.dataTransfer.clearData(); event.dataTransfer.setData('wp-blocks', data); const { ownerDocument } = node; const { defaultView } = ownerDocument; const selection = defaultView.getSelection(); selection.removeAllRanges(); const domNode = document.createElement('div'); const root = (0,external_wp_element_namespaceObject.createRoot)(domNode); root.render(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockDraggableChip, { icon: getBlockType(getBlockName(clientId)).icon })); document.body.appendChild(domNode); domNode.style.position = 'absolute'; domNode.style.top = '0'; domNode.style.left = '0'; domNode.style.zIndex = '1000'; domNode.style.pointerEvents = 'none'; // Setting the drag chip as the drag image actually works, but // the behaviour is slightly different in every browser. In // Safari, it animates, in Firefox it's slightly transparent... // So we set a fake drag image and have to reposition it // ourselves. const dragElement = ownerDocument.createElement('div'); // Chrome will show a globe icon if the drag element does not // have dimensions. dragElement.style.width = '1px'; dragElement.style.height = '1px'; dragElement.style.position = 'fixed'; dragElement.style.visibility = 'hidden'; ownerDocument.body.appendChild(dragElement); event.dataTransfer.setDragImage(dragElement, 0, 0); let offset = { x: 0, y: 0 }; if (document !== ownerDocument) { const frame = defaultView.frameElement; if (frame) { const rect = frame.getBoundingClientRect(); offset = { x: rect.left, y: rect.top }; } } // chip handle offset offset.x -= 58; function over(e) { domNode.style.transform = `translate( ${e.clientX + offset.x}px, ${e.clientY + offset.y}px )`; } over(event); function end() { ownerDocument.removeEventListener('dragover', over); ownerDocument.removeEventListener('dragend', end); domNode.remove(); dragElement.remove(); stopDraggingBlocks(); document.body.classList.remove('is-dragging-components-draggable'); ownerDocument.documentElement.classList.remove('is-dragging'); } ownerDocument.addEventListener('dragover', over); ownerDocument.addEventListener('dragend', end); ownerDocument.addEventListener('drop', end); startDraggingBlocks([clientId]); // Important because it hides the block toolbar. document.body.classList.add('is-dragging-components-draggable'); ownerDocument.documentElement.classList.add('is-dragging'); } node.addEventListener('keydown', onKeyDown); node.addEventListener('dragstart', onDragStart); return () => { node.removeEventListener('keydown', onKeyDown); node.removeEventListener('dragstart', onDragStart); }; }, [clientId, isSelected, getBlockRootClientId, insertAfterBlock, removeBlock, isZoomOut, resetZoomLevel, hasMultiSelection, startDraggingBlocks, stopDraggingBlocks]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-intersection-observer.js /** * WordPress dependencies */ /** * Internal dependencies */ function useIntersectionObserver() { const observer = (0,external_wp_element_namespaceObject.useContext)(block_list_IntersectionObserver); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { if (observer) { observer.observe(node); return () => { observer.unobserve(node); }; } }, [observer]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-scroll-into-view.js /** * WordPress dependencies */ function useScrollIntoView({ isSelected }) { const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { if (isSelected) { const { ownerDocument } = node; const { defaultView } = ownerDocument; if (!defaultView.IntersectionObserver) { return; } const observer = new defaultView.IntersectionObserver(entries => { // Once observing starts, we always get an initial // entry with the intersecting state. if (!entries[0].isIntersecting) { node.scrollIntoView({ behavior: prefersReducedMotion ? 'instant' : 'smooth' }); } observer.disconnect(); }); observer.observe(node); return () => { observer.disconnect(); }; } }, [isSelected]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/use-flash-editable-blocks/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function useFlashEditableBlocks({ clientId = '', isEnabled = true } = {}) { const { getEnabledClientIdsTree } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { if (!isEnabled) { return; } const flashEditableBlocks = () => { getEnabledClientIdsTree(clientId).forEach(({ clientId: id }) => { const block = element.querySelector(`[data-block="${id}"]`); if (!block) { return; } block.classList.remove('has-editable-outline'); // Force reflow to trigger the animation. // eslint-disable-next-line no-unused-expressions block.offsetWidth; block.classList.add('has-editable-outline'); }); }; const handleClick = event => { const shouldFlash = event.target === element || event.target.classList.contains('is-root-container'); if (!shouldFlash) { return; } if (event.defaultPrevented) { return; } event.preventDefault(); flashEditableBlocks(); }; element.addEventListener('click', handleClick); return () => element.removeEventListener('click', handleClick); }, [isEnabled]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/use-firefox-draggable-compatibility.js /** * WordPress dependencies */ const nodesByDocument = new Map(); function add(doc, node) { let set = nodesByDocument.get(doc); if (!set) { set = new Set(); nodesByDocument.set(doc, set); doc.addEventListener('pointerdown', down); } set.add(node); } function remove(doc, node) { const set = nodesByDocument.get(doc); if (set) { set.delete(node); restore(node); if (set.size === 0) { nodesByDocument.delete(doc); doc.removeEventListener('pointerdown', down); } } } function restore(node) { const prevDraggable = node.getAttribute('data-draggable'); if (prevDraggable) { node.removeAttribute('data-draggable'); // Only restore if `draggable` is still removed. It could have been // changed by React in the meantime. if (prevDraggable === 'true' && !node.getAttribute('draggable')) { node.setAttribute('draggable', 'true'); } } } function down(event) { const { target } = event; const { ownerDocument, isContentEditable, tagName } = target; const isInputOrTextArea = ['INPUT', 'TEXTAREA'].includes(tagName); const nodes = nodesByDocument.get(ownerDocument); if (isContentEditable || isInputOrTextArea) { // Whenever an editable element or an input or textarea is clicked, // check which draggable blocks contain this element, and temporarily // disable draggability. for (const node of nodes) { if (node.getAttribute('draggable') === 'true' && node.contains(target)) { node.removeAttribute('draggable'); node.setAttribute('data-draggable', 'true'); } } } else { // Whenever a non-editable element or an input or textarea is clicked, // re-enable draggability for any blocks that were previously disabled. for (const node of nodes) { restore(node); } } } /** * In Firefox, the `draggable` and `contenteditable` or `input` or `textarea` * elements don't play well together. When these elements are within a * `draggable` element, selection doesn't get set in the right place. The only * solution is to temporarily remove the `draggable` attribute clicking inside * these elements. * @return {Function} Cleanup function. */ function useFirefoxDraggableCompatibility() { return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { add(node.ownerDocument, node); return () => { remove(node.ownerDocument, node); }; }, []); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-block-props/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * This hook is used to lightly mark an element as a block element. The element * should be the outermost element of a block. Call this hook and pass the * returned props to the element to mark as a block. If you define a ref for the * element, it is important to pass the ref to this hook, which the hook in turn * will pass to the component through the props it returns. Optionally, you can * also pass any other props through this hook, and they will be merged and * returned. * * Use of this hook on the outermost element of a block is required if using API >= v2. * * @example * ```js * import { useBlockProps } from '@wordpress/block-editor'; * * export default function Edit() { * * const blockProps = useBlockProps( { * className: 'my-custom-class', * style: { * color: '#222222', * backgroundColor: '#eeeeee' * } * } ) * * return ( * <div { ...blockProps }> * * </div> * ) * } * * ``` * * * @param {Object} props Optional. Props to pass to the element. Must contain * the ref if one is defined. * @param {Object} options Options for internal use only. * @param {boolean} options.__unstableIsHtml * * @return {Object} Props to pass to the element to mark as a block. */ function use_block_props_useBlockProps(props = {}, { __unstableIsHtml } = {}) { const { clientId, className, wrapperProps = {}, isAligned, index, mode, name, blockApiVersion, blockTitle, isSelected, isSubtreeDisabled, hasOverlay, initialPosition, blockEditingMode, isHighlighted, isMultiSelected, isPartiallySelected, isReusable, isDragging, hasChildSelected, isEditingDisabled, hasEditableOutline, isTemporarilyEditingAsBlocks, defaultClassName, isSectionBlock, canMove } = (0,external_wp_element_namespaceObject.useContext)(PrivateBlockContext); // translators: %s: Type of block (i.e. Text, Image etc) const blockLabel = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Block: %s'), blockTitle); const htmlSuffix = mode === 'html' && !__unstableIsHtml ? '-visual' : ''; const ffDragRef = useFirefoxDraggableCompatibility(); const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, useFocusFirstElement({ clientId, initialPosition }), useBlockRefProvider(clientId), useFocusHandler(clientId), useEventHandlers({ clientId, isSelected }), useIsHovered({ clientId }), useIntersectionObserver(), use_moving_animation({ triggerAnimationOnChange: index, clientId }), (0,external_wp_compose_namespaceObject.useDisabled)({ isDisabled: !hasOverlay }), useFlashEditableBlocks({ clientId, isEnabled: isSectionBlock }), useScrollIntoView({ isSelected }), canMove ? ffDragRef : undefined]); const blockEditContext = useBlockEditContext(); const hasBlockBindings = !!blockEditContext[blockBindingsKey]; const bindingsStyle = hasBlockBindings && canBindBlock(name) ? { '--wp-admin-theme-color': 'var(--wp-block-synced-color)', '--wp-admin-theme-color--rgb': 'var(--wp-block-synced-color--rgb)' } : {}; // Ensures it warns only inside the `edit` implementation for the block. if (blockApiVersion < 2 && clientId === blockEditContext.clientId) { true ? external_wp_warning_default()(`Block type "${name}" must support API version 2 or higher to work correctly with "useBlockProps" method.`) : 0; } let hasNegativeMargin = false; if (wrapperProps?.style?.marginTop?.charAt(0) === '-' || wrapperProps?.style?.marginBottom?.charAt(0) === '-' || wrapperProps?.style?.marginLeft?.charAt(0) === '-' || wrapperProps?.style?.marginRight?.charAt(0) === '-') { hasNegativeMargin = true; } return { tabIndex: blockEditingMode === 'disabled' ? -1 : 0, draggable: canMove && !hasChildSelected ? true : undefined, ...wrapperProps, ...props, ref: mergedRefs, id: `block-${clientId}${htmlSuffix}`, role: 'document', 'aria-label': blockLabel, 'data-block': clientId, 'data-type': name, 'data-title': blockTitle, inert: isSubtreeDisabled ? 'true' : undefined, className: dist_clsx('block-editor-block-list__block', { // The wp-block className is important for editor styles. 'wp-block': !isAligned, 'has-block-overlay': hasOverlay, 'is-selected': isSelected, 'is-highlighted': isHighlighted, 'is-multi-selected': isMultiSelected, 'is-partially-selected': isPartiallySelected, 'is-reusable': isReusable, 'is-dragging': isDragging, 'has-child-selected': hasChildSelected, 'is-editing-disabled': isEditingDisabled, 'has-editable-outline': hasEditableOutline, 'has-negative-margin': hasNegativeMargin, 'is-content-locked-temporarily-editing-as-blocks': isTemporarilyEditingAsBlocks }, className, props.className, wrapperProps.className, defaultClassName), style: { ...wrapperProps.style, ...props.style, ...bindingsStyle } }; } /** * Call within a save function to get the props for the block wrapper. * * @param {Object} props Optional. Props to pass to the element. */ use_block_props_useBlockProps.save = external_wp_blocks_namespaceObject.__unstableGetBlockProps; ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/block.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Merges wrapper props with special handling for classNames and styles. * * @param {Object} propsA * @param {Object} propsB * * @return {Object} Merged props. */ function mergeWrapperProps(propsA, propsB) { const newProps = { ...propsA, ...propsB }; // May be set to undefined, so check if the property is set! if (propsA?.hasOwnProperty('className') && propsB?.hasOwnProperty('className')) { newProps.className = dist_clsx(propsA.className, propsB.className); } if (propsA?.hasOwnProperty('style') && propsB?.hasOwnProperty('style')) { newProps.style = { ...propsA.style, ...propsB.style }; } return newProps; } function Block({ children, isHtml, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...use_block_props_useBlockProps(props, { __unstableIsHtml: isHtml }), children: children }); } function BlockListBlock({ block: { __unstableBlockSource }, mode, isLocked, canRemove, clientId, isSelected, isSelectionEnabled, className, __unstableLayoutClassNames: layoutClassNames, name, isValid, attributes, wrapperProps, setAttributes, onReplace, onRemove, onInsertBlocksAfter, onMerge, toggleSelection }) { var _wrapperProps; const { mayDisplayControls, mayDisplayParentControls, themeSupportsLayout, ...context } = (0,external_wp_element_namespaceObject.useContext)(PrivateBlockContext); const parentLayout = useLayout() || {}; // We wrap the BlockEdit component in a div that hides it when editing in // HTML mode. This allows us to render all of the ancillary pieces // (InspectorControls, etc.) which are inside `BlockEdit` but not // `BlockHTML`, even in HTML mode. let blockEdit = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { name: name, isSelected: isSelected, attributes: attributes, setAttributes: setAttributes, insertBlocksAfter: isLocked ? undefined : onInsertBlocksAfter, onReplace: canRemove ? onReplace : undefined, onRemove: canRemove ? onRemove : undefined, mergeBlocks: canRemove ? onMerge : undefined, clientId: clientId, isSelectionEnabled: isSelectionEnabled, toggleSelection: toggleSelection, __unstableLayoutClassNames: layoutClassNames, __unstableParentLayout: Object.keys(parentLayout).length ? parentLayout : undefined, mayDisplayControls: mayDisplayControls, mayDisplayParentControls: mayDisplayParentControls, blockEditingMode: context.blockEditingMode, isPreviewMode: context.isPreviewMode }); const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(name); // Determine whether the block has props to apply to the wrapper. if (blockType?.getEditWrapperProps) { wrapperProps = mergeWrapperProps(wrapperProps, blockType.getEditWrapperProps(attributes)); } const isAligned = wrapperProps && !!wrapperProps['data-align'] && !themeSupportsLayout; // Support for sticky position in classic themes with alignment wrappers. const isSticky = className?.includes('is-position-sticky'); // For aligned blocks, provide a wrapper element so the block can be // positioned relative to the block column. // This is only kept for classic themes that don't support layout // Historically we used to rely on extra divs and data-align to // provide the alignments styles in the editor. // Due to the differences between frontend and backend, we migrated // to the layout feature, and we're now aligning the markup of frontend // and backend. if (isAligned) { blockEdit = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('wp-block', isSticky && className), "data-align": wrapperProps['data-align'], children: blockEdit }); } let block; if (!isValid) { const saveContent = __unstableBlockSource ? (0,external_wp_blocks_namespaceObject.serializeRawBlock)(__unstableBlockSource) : (0,external_wp_blocks_namespaceObject.getSaveContent)(blockType, attributes); block = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Block, { className: "has-warning", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockInvalidWarning, { clientId: clientId }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: (0,external_wp_dom_namespaceObject.safeHTML)(saveContent) })] }); } else if (mode === 'html') { // Render blockEdit so the inspector controls don't disappear. // See #8969. block = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { display: 'none' }, children: blockEdit }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Block, { isHtml: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_html, { clientId: clientId }) })] }); } else if (blockType?.apiVersion > 1) { block = blockEdit; } else { block = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Block, { children: blockEdit }); } const { 'data-align': dataAlign, ...restWrapperProps } = (_wrapperProps = wrapperProps) !== null && _wrapperProps !== void 0 ? _wrapperProps : {}; const updatedWrapperProps = { ...restWrapperProps, className: dist_clsx(restWrapperProps.className, dataAlign && themeSupportsLayout && `align${dataAlign}`, !(dataAlign && isSticky) && className) }; // We set a new context with the adjusted and filtered wrapperProps (through // `editor.BlockListBlock`), which the `BlockListBlockProvider` did not have // access to. // Note that the context value doesn't have to be memoized in this case // because when it changes, this component will be re-rendered anyway, and // none of the consumers (BlockListBlock and useBlockProps) are memoized or // "pure". This is different from the public BlockEditContext, where // consumers might be memoized or "pure". return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockContext.Provider, { value: { wrapperProps: updatedWrapperProps, isAligned, ...context }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_crash_boundary, { fallback: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Block, { className: "has-warning", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_crash_warning, {}) }), children: block }) }); } const applyWithDispatch = (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, registry) => { const { updateBlockAttributes, insertBlocks, mergeBlocks, replaceBlocks, toggleSelection, __unstableMarkLastChangeAsPersistent, moveBlocksToPosition, removeBlock, selectBlock } = dispatch(store); // Do not add new properties here, use `useDispatch` instead to avoid // leaking new props to the public API (editor.BlockListBlock filter). return { setAttributes(newAttributes) { const { getMultiSelectedBlockClientIds } = registry.select(store); const multiSelectedBlockClientIds = getMultiSelectedBlockClientIds(); const { clientId } = ownProps; const clientIds = multiSelectedBlockClientIds.length ? multiSelectedBlockClientIds : [clientId]; updateBlockAttributes(clientIds, newAttributes); }, onInsertBlocks(blocks, index) { const { rootClientId } = ownProps; insertBlocks(blocks, index, rootClientId); }, onInsertBlocksAfter(blocks) { const { clientId, rootClientId } = ownProps; const { getBlockIndex } = registry.select(store); const index = getBlockIndex(clientId); insertBlocks(blocks, index + 1, rootClientId); }, onMerge(forward) { const { clientId, rootClientId } = ownProps; const { getPreviousBlockClientId, getNextBlockClientId, getBlock, getBlockAttributes, getBlockName, getBlockOrder, getBlockIndex, getBlockRootClientId, canInsertBlockType } = registry.select(store); function switchToDefaultOrRemove() { const block = getBlock(clientId); const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)(); const defaultBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(defaultBlockName); if (getBlockName(clientId) !== defaultBlockName) { const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, defaultBlockName); if (replacement && replacement.length) { replaceBlocks(clientId, replacement); } } else if ((0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(block)) { const nextBlockClientId = getNextBlockClientId(clientId); if (nextBlockClientId) { registry.batch(() => { removeBlock(clientId); selectBlock(nextBlockClientId); }); } } else if (defaultBlockType.merge) { const attributes = defaultBlockType.merge({}, block.attributes); replaceBlocks([clientId], [(0,external_wp_blocks_namespaceObject.createBlock)(defaultBlockName, attributes)]); } } /** * Moves the block with clientId up one level. If the block type * cannot be inserted at the new location, it will be attempted to * convert to the default block type. * * @param {string} _clientId The block to move. * @param {boolean} changeSelection Whether to change the selection * to the moved block. */ function moveFirstItemUp(_clientId, changeSelection = true) { const wrapperBlockName = getBlockName(_clientId); const wrapperBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(wrapperBlockName); const isTextualWrapper = wrapperBlockType.category === 'text'; const targetRootClientId = getBlockRootClientId(_clientId); const blockOrder = getBlockOrder(_clientId); const [firstClientId] = blockOrder; if (blockOrder.length === 1 && (0,external_wp_blocks_namespaceObject.isUnmodifiedBlock)(getBlock(firstClientId))) { removeBlock(_clientId); } else if (isTextualWrapper) { registry.batch(() => { if (canInsertBlockType(getBlockName(firstClientId), targetRootClientId)) { moveBlocksToPosition([firstClientId], _clientId, targetRootClientId, getBlockIndex(_clientId)); } else { const replacement = (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(firstClientId), (0,external_wp_blocks_namespaceObject.getDefaultBlockName)()); if (replacement && replacement.length && replacement.every(block => canInsertBlockType(block.name, targetRootClientId))) { insertBlocks(replacement, getBlockIndex(_clientId), targetRootClientId, changeSelection); removeBlock(firstClientId, false); } else { switchToDefaultOrRemove(); } } if (!getBlockOrder(_clientId).length && (0,external_wp_blocks_namespaceObject.isUnmodifiedBlock)(getBlock(_clientId))) { removeBlock(_clientId, false); } }); } else { switchToDefaultOrRemove(); } } // For `Delete` or forward merge, we should do the exact same thing // as `Backspace`, but from the other block. if (forward) { if (rootClientId) { const nextRootClientId = getNextBlockClientId(rootClientId); if (nextRootClientId) { // If there is a block that follows with the same parent // block name and the same attributes, merge the inner // blocks. if (getBlockName(rootClientId) === getBlockName(nextRootClientId)) { const rootAttributes = getBlockAttributes(rootClientId); const previousRootAttributes = getBlockAttributes(nextRootClientId); if (Object.keys(rootAttributes).every(key => rootAttributes[key] === previousRootAttributes[key])) { registry.batch(() => { moveBlocksToPosition(getBlockOrder(nextRootClientId), nextRootClientId, rootClientId); removeBlock(nextRootClientId, false); }); return; } } else { mergeBlocks(rootClientId, nextRootClientId); return; } } } const nextBlockClientId = getNextBlockClientId(clientId); if (!nextBlockClientId) { return; } if (getBlockOrder(nextBlockClientId).length) { moveFirstItemUp(nextBlockClientId, false); } else { mergeBlocks(clientId, nextBlockClientId); } } else { const previousBlockClientId = getPreviousBlockClientId(clientId); if (previousBlockClientId) { mergeBlocks(previousBlockClientId, clientId); } else if (rootClientId) { const previousRootClientId = getPreviousBlockClientId(rootClientId); // If there is a preceding block with the same parent block // name and the same attributes, merge the inner blocks. if (previousRootClientId && getBlockName(rootClientId) === getBlockName(previousRootClientId)) { const rootAttributes = getBlockAttributes(rootClientId); const previousRootAttributes = getBlockAttributes(previousRootClientId); if (Object.keys(rootAttributes).every(key => rootAttributes[key] === previousRootAttributes[key])) { registry.batch(() => { moveBlocksToPosition(getBlockOrder(rootClientId), rootClientId, previousRootClientId); removeBlock(rootClientId, false); }); return; } } moveFirstItemUp(rootClientId); } else { switchToDefaultOrRemove(); } } }, onReplace(blocks, indexToSelect, initialPosition) { if (blocks.length && !(0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(blocks[blocks.length - 1])) { __unstableMarkLastChangeAsPersistent(); } //Unsynced patterns are nested in an array so we need to flatten them. const replacementBlocks = blocks?.length === 1 && Array.isArray(blocks[0]) ? blocks[0] : blocks; replaceBlocks([ownProps.clientId], replacementBlocks, indexToSelect, initialPosition); }, onRemove() { removeBlock(ownProps.clientId); }, toggleSelection(selectionEnabled) { toggleSelection(selectionEnabled); } }; }); // This component is used by the BlockListBlockProvider component below. It will // add the props necessary for the `editor.BlockListBlock` filters. BlockListBlock = (0,external_wp_compose_namespaceObject.compose)(applyWithDispatch, (0,external_wp_components_namespaceObject.withFilters)('editor.BlockListBlock'))(BlockListBlock); // This component provides all the information we need through a single store // subscription (useSelect mapping). Only the necessary props are passed down // to the BlockListBlock component, which is a filtered component, so these // props are public API. To avoid adding to the public API, we use a private // context to pass the rest of the information to the filtered BlockListBlock // component, and useBlockProps. function BlockListBlockProvider(props) { const { clientId, rootClientId } = props; const selectedProps = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isBlockSelected, getBlockMode, isSelectionEnabled, getTemplateLock, isSectionBlock: _isSectionBlock, getBlockWithoutAttributes, getBlockAttributes, canRemoveBlock, canMoveBlock, getSettings, getTemporarilyEditingAsBlocks, getBlockEditingMode, getBlockName, isFirstMultiSelectedBlock, getMultiSelectedBlockClientIds, hasSelectedInnerBlock, getBlocksByName, getBlockIndex, isBlockMultiSelected, isBlockSubtreeDisabled, isBlockHighlighted, __unstableIsFullySelected, __unstableSelectionHasUnmergeableBlock, isBlockBeingDragged, isDragging, __unstableHasActiveBlockOverlayActive, getSelectedBlocksInitialCaretPosition } = unlock(select(store)); const blockWithoutAttributes = getBlockWithoutAttributes(clientId); // This is a temporary fix. // This function should never be called when a block is not // present in the state. It happens now because the order in // withSelect rendering is not correct. if (!blockWithoutAttributes) { return; } const { hasBlockSupport: _hasBlockSupport, getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store); const attributes = getBlockAttributes(clientId); const { name: blockName, isValid } = blockWithoutAttributes; const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName); const { supportsLayout, isPreviewMode } = getSettings(); const hasLightBlockWrapper = blockType?.apiVersion > 1; const previewContext = { isPreviewMode, blockWithoutAttributes, name: blockName, attributes, isValid, themeSupportsLayout: supportsLayout, index: getBlockIndex(clientId), isReusable: (0,external_wp_blocks_namespaceObject.isReusableBlock)(blockType), className: hasLightBlockWrapper ? attributes.className : undefined, defaultClassName: hasLightBlockWrapper ? (0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockName) : undefined, blockTitle: blockType?.title }; // When in preview mode, we can avoid a lot of selection and // editing related selectors. if (isPreviewMode) { return previewContext; } const _isSelected = isBlockSelected(clientId); const canRemove = canRemoveBlock(clientId); const canMove = canMoveBlock(clientId); const match = getActiveBlockVariation(blockName, attributes); const isMultiSelected = isBlockMultiSelected(clientId); const checkDeep = true; const isAncestorOfSelectedBlock = hasSelectedInnerBlock(clientId, checkDeep); const blockEditingMode = getBlockEditingMode(clientId); const multiple = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'multiple', true); // For block types with `multiple` support, there is no "original // block" to be found in the content, as the block itself is valid. const blocksWithSameName = multiple ? [] : getBlocksByName(blockName); const isInvalid = blocksWithSameName.length && blocksWithSameName[0] !== clientId; return { ...previewContext, mode: getBlockMode(clientId), isSelectionEnabled: isSelectionEnabled(), isLocked: !!getTemplateLock(rootClientId), isSectionBlock: _isSectionBlock(clientId), canRemove, canMove, isSelected: _isSelected, isTemporarilyEditingAsBlocks: getTemporarilyEditingAsBlocks() === clientId, blockEditingMode, mayDisplayControls: _isSelected || isFirstMultiSelectedBlock(clientId) && getMultiSelectedBlockClientIds().every(id => getBlockName(id) === blockName), mayDisplayParentControls: _hasBlockSupport(getBlockName(clientId), '__experimentalExposeControlsToChildren', false) && hasSelectedInnerBlock(clientId), blockApiVersion: blockType?.apiVersion || 1, blockTitle: match?.title || blockType?.title, isSubtreeDisabled: blockEditingMode === 'disabled' && isBlockSubtreeDisabled(clientId), hasOverlay: __unstableHasActiveBlockOverlayActive(clientId) && !isDragging(), initialPosition: _isSelected ? getSelectedBlocksInitialCaretPosition() : undefined, isHighlighted: isBlockHighlighted(clientId), isMultiSelected, isPartiallySelected: isMultiSelected && !__unstableIsFullySelected() && !__unstableSelectionHasUnmergeableBlock(), isDragging: isBlockBeingDragged(clientId), hasChildSelected: isAncestorOfSelectedBlock, isEditingDisabled: blockEditingMode === 'disabled', hasEditableOutline: blockEditingMode !== 'disabled' && getBlockEditingMode(rootClientId) === 'disabled', originalBlockClientId: isInvalid ? blocksWithSameName[0] : false }; }, [clientId, rootClientId]); const { isPreviewMode, // Fill values that end up as a public API and may not be defined in // preview mode. mode = 'visual', isSelectionEnabled = false, isLocked = false, canRemove = false, canMove = false, blockWithoutAttributes, name, attributes, isValid, isSelected = false, themeSupportsLayout, isTemporarilyEditingAsBlocks, blockEditingMode, mayDisplayControls, mayDisplayParentControls, index, blockApiVersion, blockTitle, isSubtreeDisabled, hasOverlay, initialPosition, isHighlighted, isMultiSelected, isPartiallySelected, isReusable, isDragging, hasChildSelected, isSectionBlock, isEditingDisabled, hasEditableOutline, className, defaultClassName, originalBlockClientId } = selectedProps; // Users of the editor.BlockListBlock filter used to be able to // access the block prop. // Ideally these blocks would rely on the clientId prop only. // This is kept for backward compatibility reasons. const block = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...blockWithoutAttributes, attributes }), [blockWithoutAttributes, attributes]); // Block is sometimes not mounted at the right time, causing it be // undefined see issue for more info // https://github.com/WordPress/gutenberg/issues/17013 if (!selectedProps) { return null; } const privateContext = { isPreviewMode, clientId, className, index, mode, name, blockApiVersion, blockTitle, isSelected, isSubtreeDisabled, hasOverlay, initialPosition, blockEditingMode, isHighlighted, isMultiSelected, isPartiallySelected, isReusable, isDragging, hasChildSelected, isSectionBlock, isEditingDisabled, hasEditableOutline, isTemporarilyEditingAsBlocks, defaultClassName, mayDisplayControls, mayDisplayParentControls, originalBlockClientId, themeSupportsLayout, canMove }; // Here we separate between the props passed to BlockListBlock and any other // information we selected for internal use. BlockListBlock is a filtered // component and thus ALL the props are PUBLIC API. // Note that the context value doesn't have to be memoized in this case // because when it changes, this component will be re-rendered anyway, and // none of the consumers (BlockListBlock and useBlockProps) are memoized or // "pure". This is different from the public BlockEditContext, where // consumers might be memoized or "pure". return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockContext.Provider, { value: privateContext, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListBlock, { ...props, mode, isSelectionEnabled, isLocked, canRemove, canMove, // Users of the editor.BlockListBlock filter used to be able // to access the block prop. Ideally these blocks would rely // on the clientId prop only. This is kept for backward // compatibility reasons. block, name, attributes, isValid, isSelected }) }); } /* harmony default export */ const block = ((0,external_wp_element_namespaceObject.memo)(BlockListBlockProvider)); ;// external ["wp","htmlEntities"] const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; ;// ./node_modules/@wordpress/block-editor/build-module/components/default-block-appender/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Zero width non-breaking space, used as padding for the paragraph when it is * empty. */ const ZWNBSP = '\ufeff'; function DefaultBlockAppender({ rootClientId }) { const { showPrompt, isLocked, placeholder, isManualGrid } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockCount, getSettings, getTemplateLock, getBlockAttributes } = select(store); const isEmpty = !getBlockCount(rootClientId); const { bodyPlaceholder } = getSettings(); return { showPrompt: isEmpty, isLocked: !!getTemplateLock(rootClientId), placeholder: bodyPlaceholder, isManualGrid: getBlockAttributes(rootClientId)?.layout?.isManualPlacement }; }, [rootClientId]); const { insertDefaultBlock, startTyping } = (0,external_wp_data_namespaceObject.useDispatch)(store); if (isLocked || isManualGrid) { return null; } const value = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(placeholder) || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'); const onAppend = () => { insertDefaultBlock(undefined, rootClientId); startTyping(); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { "data-root-client-id": rootClientId || '', className: dist_clsx('block-editor-default-block-appender', { 'has-visible-prompt': showPrompt }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { tabIndex: "0" // We want this element to be styled as a paragraph by themes. // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role , role: "button", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Add default block') // A wrapping container for this one already has the wp-block className. , className: "block-editor-default-block-appender__content", onKeyDown: event => { if (external_wp_keycodes_namespaceObject.ENTER === event.keyCode || external_wp_keycodes_namespaceObject.SPACE === event.keyCode) { onAppend(); } }, onClick: () => onAppend(), onFocus: () => { if (showPrompt) { onAppend(); } }, children: showPrompt ? value : ZWNBSP }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter, { rootClientId: rootClientId, position: "bottom right", isAppender: true, __experimentalIsQuick: true })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list-appender/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function DefaultAppender({ rootClientId }) { const canInsertDefaultBlock = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).canInsertBlockType((0,external_wp_blocks_namespaceObject.getDefaultBlockName)(), rootClientId)); if (canInsertDefaultBlock) { // Render the default block appender if the context supports use // of the default appender. return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DefaultBlockAppender, { rootClientId: rootClientId }); } // Fallback in case the default block can't be inserted. return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(button_block_appender, { rootClientId: rootClientId, className: "block-list-appender__toggle" }); } function BlockListAppender({ rootClientId, CustomAppender, className, tagName: TagName = 'div' }) { const isDragOver = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockInsertionPoint, isBlockInsertionPointVisible, getBlockCount } = select(store); const insertionPoint = getBlockInsertionPoint(); // Ideally we should also check for `isDragging` but currently it // requires a lot more setup. We can revisit this once we refactor // the DnD utility hooks. return isBlockInsertionPointVisible() && rootClientId === insertionPoint?.rootClientId && getBlockCount(rootClientId) === 0; }, [rootClientId]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName // A `tabIndex` is used on the wrapping `div` element in order to // force a focus event to occur when an appender `button` element // is clicked. In some browsers (Firefox, Safari), button clicks do // not emit a focus event, which could cause this event to propagate // unexpectedly. The `tabIndex` ensures that the interaction is // captured as a focus, without also adding an extra tab stop. // // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus , { tabIndex: -1, className: dist_clsx('block-list-appender wp-block', className, { 'is-drag-over': isDragOver }) // Needed in case the whole editor is content editable (for multi // selection). It fixes an edge case where ArrowDown and ArrowRight // should collapse the selection to the end of that selection and // not into the appender. , contentEditable: false // The appender exists to let you add the first Paragraph before // any is inserted. To that end, this appender should visually be // presented as a block. That means theme CSS should style it as if // it were an empty paragraph block. That means a `wp-block` class to // ensure the width is correct, and a [data-block] attribute to ensure // the correct margin is applied, especially for classic themes which // have commonly targeted that attribute for margins. , "data-block": true, children: CustomAppender ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CustomAppender, {}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DefaultAppender, { rootClientId: rootClientId }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-popover/inbetween.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const inbetween_MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER; const InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)(); function BlockPopoverInbetween({ previousClientId, nextClientId, children, __unstablePopoverSlot, __unstableContentRef, operation = 'insert', nearestSide = 'right', ...props }) { // This is a temporary hack to get the inbetween inserter to recompute properly. const [popoverRecomputeCounter, forcePopoverRecompute] = (0,external_wp_element_namespaceObject.useReducer)( // Module is there to make sure that the counter doesn't overflow. s => (s + 1) % inbetween_MAX_POPOVER_RECOMPUTE_COUNTER, 0); const { orientation, rootClientId, isVisible } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockListSettings, getBlockRootClientId, isBlockVisible } = select(store); const _rootClientId = getBlockRootClientId(previousClientId !== null && previousClientId !== void 0 ? previousClientId : nextClientId); return { orientation: getBlockListSettings(_rootClientId)?.orientation || 'vertical', rootClientId: _rootClientId, isVisible: isBlockVisible(previousClientId) && isBlockVisible(nextClientId) }; }, [previousClientId, nextClientId]); const previousElement = useBlockElement(previousClientId); const nextElement = useBlockElement(nextClientId); const isVertical = orientation === 'vertical'; const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => { if ( // popoverRecomputeCounter is by definition always equal or greater than 0. // This check is only there to satisfy the correctness of the // exhaustive-deps rule for the `useMemo` hook. popoverRecomputeCounter < 0 || !previousElement && !nextElement || !isVisible) { return undefined; } const contextElement = operation === 'group' ? nextElement || previousElement : previousElement || nextElement; return { contextElement, getBoundingClientRect() { const previousRect = previousElement ? previousElement.getBoundingClientRect() : null; const nextRect = nextElement ? nextElement.getBoundingClientRect() : null; let left = 0; let top = 0; let width = 0; let height = 0; if (operation === 'group') { const targetRect = nextRect || previousRect; top = targetRect.top; // No spacing is likely around blocks in this operation. // So width of the inserter containing rect is set to 0. width = 0; height = targetRect.bottom - targetRect.top; // Popover calculates its distance from mid-block so some // adjustments are needed to make it appear in the right place. left = nearestSide === 'left' ? targetRect.left - 2 : targetRect.right - 2; } else if (isVertical) { // vertical top = previousRect ? previousRect.bottom : nextRect.top; width = previousRect ? previousRect.width : nextRect.width; height = nextRect && previousRect ? nextRect.top - previousRect.bottom : 0; left = previousRect ? previousRect.left : nextRect.left; } else { top = previousRect ? previousRect.top : nextRect.top; height = previousRect ? previousRect.height : nextRect.height; if ((0,external_wp_i18n_namespaceObject.isRTL)()) { // non vertical, rtl left = nextRect ? nextRect.right : previousRect.left; width = previousRect && nextRect ? previousRect.left - nextRect.right : 0; } else { // non vertical, ltr left = previousRect ? previousRect.right : nextRect.left; width = previousRect && nextRect ? nextRect.left - previousRect.right : 0; } // Avoid a negative width which happens when the next rect // is on the next line. width = Math.max(width, 0); } return new window.DOMRect(left, top, width, height); } }; }, [previousElement, nextElement, popoverRecomputeCounter, isVertical, isVisible, operation, nearestSide]); const popoverScrollRef = use_popover_scroll(__unstableContentRef); // This is only needed for a smooth transition when moving blocks. // When blocks are moved up/down, their position can be set by // updating the `transform` property manually (i.e. without using CSS // transitions or animations). The animation, which can also scroll the block // editor, can sometimes cause the position of the Popover to get out of sync. // A MutationObserver is therefore used to make sure that changes to the // selectedElement's attribute (i.e. `transform`) can be tracked and used to // trigger the Popover to rerender. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (!previousElement) { return; } const observer = new window.MutationObserver(forcePopoverRecompute); observer.observe(previousElement, { attributes: true }); return () => { observer.disconnect(); }; }, [previousElement]); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (!nextElement) { return; } const observer = new window.MutationObserver(forcePopoverRecompute); observer.observe(nextElement, { attributes: true }); return () => { observer.disconnect(); }; }, [nextElement]); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (!previousElement) { return; } previousElement.ownerDocument.defaultView.addEventListener('resize', forcePopoverRecompute); return () => { previousElement.ownerDocument.defaultView?.removeEventListener('resize', forcePopoverRecompute); }; }, [previousElement]); // If there's either a previous or a next element, show the inbetween popover. // Note that drag and drop uses the inbetween popover to show the drop indicator // before the first block and after the last block. if (!previousElement && !nextElement || !isVisible) { return null; } /* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */ // While ideally it would be enough to capture the // bubbling focus event from the Inserter, due to the // characteristics of click focusing of `button`s in // Firefox and Safari, it is not reliable. // // See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { ref: popoverScrollRef, animate: false, anchor: popoverAnchor, focusOnMount: false // Render in the old slot if needed for backward compatibility, // otherwise render in place (not in the default popover slot). , __unstableSlotName: __unstablePopoverSlot, inline: !__unstablePopoverSlot // Forces a remount of the popover when its position changes // This makes sure the popover doesn't animate from its previous position. , ...props, className: dist_clsx('block-editor-block-popover', 'block-editor-block-popover__inbetween', props.className), resize: false, flip: false, placement: "overlay", variant: "unstyled", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-popover__inbetween-container", children: children }) }, nextClientId + '--' + rootClientId); /* eslint-enable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */ } /* harmony default export */ const inbetween = (BlockPopoverInbetween); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-popover/drop-zone.js /** * WordPress dependencies */ /** * Internal dependencies */ const animateVariants = { hide: { opacity: 0, scaleY: 0.75 }, show: { opacity: 1, scaleY: 1 }, exit: { opacity: 0, scaleY: 0.9 } }; function BlockDropZonePopover({ __unstablePopoverSlot, __unstableContentRef }) { const { clientId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockOrder, getBlockInsertionPoint } = select(store); const insertionPoint = getBlockInsertionPoint(); const order = getBlockOrder(insertionPoint.rootClientId); if (!order.length) { return {}; } return { clientId: order[insertionPoint.index] }; }, []); const reducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(cover, { clientId: clientId, __unstablePopoverSlot: __unstablePopoverSlot, __unstableContentRef: __unstableContentRef, className: "block-editor-block-popover__drop-zone", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { "data-testid": "block-popover-drop-zone", initial: reducedMotion ? animateVariants.show : animateVariants.hide, animate: animateVariants.show, exit: reducedMotion ? animateVariants.show : animateVariants.exit, className: "block-editor-block-popover__drop-zone-foreground" }) }); } /* harmony default export */ const drop_zone = (BlockDropZonePopover); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/insertion-point.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const insertion_point_InsertionPointOpenRef = (0,external_wp_element_namespaceObject.createContext)(); function InbetweenInsertionPointPopover({ __unstablePopoverSlot, __unstableContentRef, operation = 'insert', nearestSide = 'right' }) { const { selectBlock, hideInsertionPoint } = (0,external_wp_data_namespaceObject.useDispatch)(store); const openRef = (0,external_wp_element_namespaceObject.useContext)(insertion_point_InsertionPointOpenRef); const ref = (0,external_wp_element_namespaceObject.useRef)(); const { orientation, previousClientId, nextClientId, rootClientId, isInserterShown, isDistractionFree, isZoomOutMode } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockOrder, getBlockListSettings, getBlockInsertionPoint, isBlockBeingDragged, getPreviousBlockClientId, getNextBlockClientId, getSettings, isZoomOut } = unlock(select(store)); const insertionPoint = getBlockInsertionPoint(); const order = getBlockOrder(insertionPoint.rootClientId); if (!order.length) { return {}; } let _previousClientId = order[insertionPoint.index - 1]; let _nextClientId = order[insertionPoint.index]; while (isBlockBeingDragged(_previousClientId)) { _previousClientId = getPreviousBlockClientId(_previousClientId); } while (isBlockBeingDragged(_nextClientId)) { _nextClientId = getNextBlockClientId(_nextClientId); } const settings = getSettings(); return { previousClientId: _previousClientId, nextClientId: _nextClientId, orientation: getBlockListSettings(insertionPoint.rootClientId)?.orientation || 'vertical', rootClientId: insertionPoint.rootClientId, isDistractionFree: settings.isDistractionFree, isInserterShown: insertionPoint?.__unstableWithInserter, isZoomOutMode: isZoomOut() }; }, []); const { getBlockEditingMode } = (0,external_wp_data_namespaceObject.useSelect)(store); const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); function onClick(event) { if (event.target === ref.current && nextClientId && getBlockEditingMode(nextClientId) !== 'disabled') { selectBlock(nextClientId, -1); } } function maybeHideInserterPoint(event) { // Only hide the inserter if it's triggered on the wrapper, // and the inserter is not open. if (event.target === ref.current && !openRef.current) { hideInsertionPoint(); } } function onFocus(event) { // Only handle click on the wrapper specifically, and not an event // bubbled from the inserter itself. if (event.target !== ref.current) { openRef.current = true; } } const lineVariants = { // Initial position starts from the center and invisible. start: { opacity: 0, scale: 0 }, // The line expands to fill the container. If the inserter is visible it // is delayed so it appears orchestrated. rest: { opacity: 1, scale: 1, transition: { delay: isInserterShown ? 0.5 : 0, type: 'tween' } }, hover: { opacity: 1, scale: 1, transition: { delay: 0.5, type: 'tween' } } }; const inserterVariants = { start: { scale: disableMotion ? 1 : 0 }, rest: { scale: 1, transition: { delay: 0.4, type: 'tween' } } }; if (isDistractionFree) { return null; } // Zoom out mode should only show the insertion point for the insert operation. // Other operations such as "group" are when the editor tries to create a row // block by grouping the block being dragged with the block it's being dropped // onto. if (isZoomOutMode && operation !== 'insert') { return null; } const orientationClassname = orientation === 'horizontal' || operation === 'group' ? 'is-horizontal' : 'is-vertical'; const className = dist_clsx('block-editor-block-list__insertion-point', orientationClassname); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inbetween, { previousClientId: previousClientId, nextClientId: nextClientId, __unstablePopoverSlot: __unstablePopoverSlot, __unstableContentRef: __unstableContentRef, operation: operation, nearestSide: nearestSide, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__unstableMotion.div, { layout: !disableMotion, initial: disableMotion ? 'rest' : 'start', animate: "rest", whileHover: "hover", whileTap: "pressed", exit: "start", ref: ref, tabIndex: -1, onClick: onClick, onFocus: onFocus, className: dist_clsx(className, { 'is-with-inserter': isInserterShown }), onHoverEnd: maybeHideInserterPoint, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { variants: lineVariants, className: "block-editor-block-list__insertion-point-indicator", "data-testid": "block-list-insertion-point-indicator" }), isInserterShown && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { variants: inserterVariants, className: dist_clsx('block-editor-block-list__insertion-point-inserter'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter, { position: "bottom center", clientId: nextClientId, rootClientId: rootClientId, __experimentalIsQuick: true, onToggle: isOpen => { openRef.current = isOpen; }, onSelectOrClose: () => { openRef.current = false; } }) })] }) }); } function InsertionPoint(props) { const { insertionPoint, isVisible, isBlockListEmpty } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockInsertionPoint, isBlockInsertionPointVisible, getBlockCount } = select(store); const blockInsertionPoint = getBlockInsertionPoint(); return { insertionPoint: blockInsertionPoint, isVisible: isBlockInsertionPointVisible(), isBlockListEmpty: getBlockCount(blockInsertionPoint?.rootClientId) === 0 }; }, []); if (!isVisible || // Don't render the insertion point if the block list is empty. // The insertion point will be represented by the appender instead. isBlockListEmpty) { return null; } /** * Render a popover that overlays the block when the desired operation is to replace it. * Otherwise, render a popover in between blocks for the indication of inserting between them. */ return insertionPoint.operation === 'replace' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(drop_zone // Force remount to trigger the animation. , { ...props }, `${insertionPoint.rootClientId}-${insertionPoint.index}`) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InbetweenInsertionPointPopover, { operation: insertionPoint.operation, nearestSide: insertionPoint.nearestSide, ...props }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/use-in-between-inserter.js /** * WordPress dependencies */ /** * Internal dependencies */ function useInBetweenInserter() { const openRef = (0,external_wp_element_namespaceObject.useContext)(insertion_point_InsertionPointOpenRef); const isInBetweenInserterDisabled = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().isDistractionFree || unlock(select(store)).isZoomOut(), []); const { getBlockListSettings, getBlockIndex, isMultiSelecting, getSelectedBlockClientIds, getSettings, getTemplateLock, __unstableIsWithinBlockOverlay, getBlockEditingMode, getBlockName, getBlockAttributes, getParentSectionBlock } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); const { showInsertionPoint, hideInsertionPoint } = (0,external_wp_data_namespaceObject.useDispatch)(store); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { if (isInBetweenInserterDisabled) { return; } function onMouseMove(event) { // openRef is the reference to the insertion point between blocks. // If the reference is not set or the insertion point is already open, return. if (openRef === undefined || openRef.current) { return; } // Ignore text nodes sometimes detected in FireFox. if (event.target.nodeType === event.target.TEXT_NODE) { return; } if (isMultiSelecting()) { return; } if (!event.target.classList.contains('block-editor-block-list__layout')) { hideInsertionPoint(); return; } let rootClientId; if (!event.target.classList.contains('is-root-container')) { const blockElement = !!event.target.getAttribute('data-block') ? event.target : event.target.closest('[data-block]'); rootClientId = blockElement.getAttribute('data-block'); } if (getTemplateLock(rootClientId) || getBlockEditingMode(rootClientId) === 'disabled' || getBlockName(rootClientId) === 'core/block' || rootClientId && getBlockAttributes(rootClientId).layout?.isManualPlacement) { return; } const blockListSettings = getBlockListSettings(rootClientId); const orientation = blockListSettings?.orientation || 'vertical'; const captureToolbars = !!blockListSettings?.__experimentalCaptureToolbars; const offsetTop = event.clientY; const offsetLeft = event.clientX; const children = Array.from(event.target.children); let element = children.find(blockEl => { const blockElRect = blockEl.getBoundingClientRect(); return blockEl.classList.contains('wp-block') && orientation === 'vertical' && blockElRect.top > offsetTop || blockEl.classList.contains('wp-block') && orientation === 'horizontal' && ((0,external_wp_i18n_namespaceObject.isRTL)() ? blockElRect.right < offsetLeft : blockElRect.left > offsetLeft); }); if (!element) { hideInsertionPoint(); return; } // The block may be in an alignment wrapper, so check the first direct // child if the element has no ID. if (!element.id) { element = element.firstElementChild; if (!element) { hideInsertionPoint(); return; } } // Don't show the insertion point if a parent block has an "overlay" // See https://github.com/WordPress/gutenberg/pull/34012#pullrequestreview-727762337 const clientId = element.id.slice('block-'.length); if (!clientId || __unstableIsWithinBlockOverlay(clientId) || !!getParentSectionBlock(clientId)) { return; } // Don't show the inserter if the following conditions are met, // as it conflicts with the block toolbar: // 1. when hovering above or inside selected block(s) // 2. when the orientation is vertical // 3. when the __experimentalCaptureToolbars is not enabled // 4. when the Top Toolbar is not disabled if (getSelectedBlockClientIds().includes(clientId) && orientation === 'vertical' && !captureToolbars && !getSettings().hasFixedToolbar) { return; } const elementRect = element.getBoundingClientRect(); if (orientation === 'horizontal' && (event.clientY > elementRect.bottom || event.clientY < elementRect.top) || orientation === 'vertical' && (event.clientX > elementRect.right || event.clientX < elementRect.left)) { hideInsertionPoint(); return; } const index = getBlockIndex(clientId); // Don't show the in-between inserter before the first block in // the list (preserves the original behaviour). if (index === 0) { hideInsertionPoint(); return; } showInsertionPoint(rootClientId, index, { __unstableWithInserter: true }); } node.addEventListener('mousemove', onMouseMove); return () => { node.removeEventListener('mousemove', onMouseMove); }; }, [openRef, getBlockListSettings, getBlockIndex, isMultiSelecting, showInsertionPoint, hideInsertionPoint, getSelectedBlockClientIds, isInBetweenInserterDisabled]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-selection-clearer/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Pass the returned ref callback to an element that should clear block * selection. Selection will only be cleared if the element is clicked directly, * not if a child element is clicked. * * @return {import('react').RefCallback} Ref callback. */ function useBlockSelectionClearer() { const { getSettings, hasSelectedBlock, hasMultiSelection } = (0,external_wp_data_namespaceObject.useSelect)(store); const { clearSelectedBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { clearBlockSelection: isEnabled } = getSettings(); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { if (!isEnabled) { return; } function onMouseDown(event) { if (!hasSelectedBlock() && !hasMultiSelection()) { return; } // Only handle clicks on the element, not the children. if (event.target !== node) { return; } clearSelectedBlock(); } node.addEventListener('mousedown', onMouseDown); return () => { node.removeEventListener('mousedown', onMouseDown); }; }, [hasSelectedBlock, hasMultiSelection, clearSelectedBlock, isEnabled]); } function BlockSelectionClearer(props) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: useBlockSelectionClearer(), ...props }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/button-block-appender.js /** * External dependencies */ /** * Internal dependencies */ function ButtonBlockAppender({ showSeparator, isFloating, onAddBlock, isToggle }) { const { clientId } = useBlockEditContext(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(button_block_appender, { className: dist_clsx({ 'block-list-appender__toggle': isToggle }), rootClientId: clientId, showSeparator: showSeparator, isFloating: isFloating, onAddBlock: onAddBlock }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/default-block-appender.js /** * Internal dependencies */ function default_block_appender_DefaultBlockAppender() { const { clientId } = useBlockEditContext(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DefaultBlockAppender, { rootClientId: clientId }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/use-nested-settings-update.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('../../selectors').WPDirectInsertBlock } WPDirectInsertBlock */ const pendingSettingsUpdates = new WeakMap(); // Creates a memoizing caching function that remembers the last value and keeps returning it // as long as the new values are shallowly equal. Helps keep dependencies stable. function createShallowMemo() { let value; return newValue => { if (value === undefined || !external_wp_isShallowEqual_default()(value, newValue)) { value = newValue; } return value; }; } function useShallowMemo(value) { const [memo] = (0,external_wp_element_namespaceObject.useState)(createShallowMemo); return memo(value); } /** * This hook is a side effect which updates the block-editor store when changes * happen to inner block settings. The given props are transformed into a * settings object, and if that is different from the current settings object in * the block-editor store, then the store is updated with the new settings which * came from props. * * @param {string} clientId The client ID of the block to update. * @param {string} parentLock * @param {string[]} allowedBlocks An array of block names which are permitted * in inner blocks. * @param {string[]} prioritizedInserterBlocks Block names and/or block variations to be prioritized in the inserter, in the format {blockName}/{variationName}. * @param {?WPDirectInsertBlock} defaultBlock The default block to insert: [ blockName, { blockAttributes } ]. * @param {?boolean} directInsert If a default block should be inserted directly by the appender. * * @param {?WPDirectInsertBlock} __experimentalDefaultBlock A deprecated prop for the default block to insert: [ blockName, { blockAttributes } ]. Use `defaultBlock` instead. * * @param {?boolean} __experimentalDirectInsert A deprecated prop for whether a default block should be inserted directly by the appender. Use `directInsert` instead. * * @param {string} [templateLock] The template lock specified for the inner * blocks component. (e.g. "all") * @param {boolean} captureToolbars Whether or children toolbars should be shown * in the inner blocks component rather than on * the child block. * @param {string} orientation The direction in which the block * should face. * @param {Object} layout The layout object for the block container. */ function useNestedSettingsUpdate(clientId, parentLock, allowedBlocks, prioritizedInserterBlocks, defaultBlock, directInsert, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, layout) { // Instead of adding a useSelect mapping here, please add to the useSelect // mapping in InnerBlocks! Every subscription impacts performance. const registry = (0,external_wp_data_namespaceObject.useRegistry)(); // Implementors often pass a new array on every render, // and the contents of the arrays are just strings, so the entire array // can be passed as dependencies but We need to include the length of the array, // otherwise if the arrays change length but the first elements are equal the comparison, // does not works as expected. const _allowedBlocks = useShallowMemo(allowedBlocks); const _prioritizedInserterBlocks = useShallowMemo(prioritizedInserterBlocks); const _templateLock = templateLock === undefined || parentLock === 'contentOnly' ? parentLock : templateLock; (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { const newSettings = { allowedBlocks: _allowedBlocks, prioritizedInserterBlocks: _prioritizedInserterBlocks, templateLock: _templateLock }; // These values are not defined for RN, so only include them if they // are defined. if (captureToolbars !== undefined) { newSettings.__experimentalCaptureToolbars = captureToolbars; } // Orientation depends on layout, // ideally the separate orientation prop should be deprecated. if (orientation !== undefined) { newSettings.orientation = orientation; } else { const layoutType = getLayoutType(layout?.type); newSettings.orientation = layoutType.getOrientation(layout); } if (__experimentalDefaultBlock !== undefined) { external_wp_deprecated_default()('__experimentalDefaultBlock', { alternative: 'defaultBlock', since: '6.3', version: '6.4' }); newSettings.defaultBlock = __experimentalDefaultBlock; } if (defaultBlock !== undefined) { newSettings.defaultBlock = defaultBlock; } if (__experimentalDirectInsert !== undefined) { external_wp_deprecated_default()('__experimentalDirectInsert', { alternative: 'directInsert', since: '6.3', version: '6.4' }); newSettings.directInsert = __experimentalDirectInsert; } if (directInsert !== undefined) { newSettings.directInsert = directInsert; } if (newSettings.directInsert !== undefined && typeof newSettings.directInsert !== 'boolean') { external_wp_deprecated_default()('Using `Function` as a `directInsert` argument', { alternative: '`boolean` values', since: '6.5' }); } // Batch updates to block list settings to avoid triggering cascading renders // for each container block included in a tree and optimize initial render. // To avoid triggering updateBlockListSettings for each container block // causing X re-renderings for X container blocks, // we batch all the updatedBlockListSettings in a single "data" batch // which results in a single re-render. if (!pendingSettingsUpdates.get(registry)) { pendingSettingsUpdates.set(registry, {}); } pendingSettingsUpdates.get(registry)[clientId] = newSettings; window.queueMicrotask(() => { const settings = pendingSettingsUpdates.get(registry); if (Object.keys(settings).length) { const { updateBlockListSettings } = registry.dispatch(store); updateBlockListSettings(settings); pendingSettingsUpdates.set(registry, {}); } }); }, [clientId, _allowedBlocks, _prioritizedInserterBlocks, _templateLock, defaultBlock, directInsert, __experimentalDefaultBlock, __experimentalDirectInsert, captureToolbars, orientation, layout, registry]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/use-inner-block-template-sync.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * This hook makes sure that a block's inner blocks stay in sync with the given * block "template". The template is a block hierarchy to which inner blocks must * conform. If the blocks get "out of sync" with the template and the template * is meant to be locked (e.g. templateLock = "all" or templateLock = "contentOnly"), * then we replace the inner blocks with the correct value after synchronizing it with the template. * * @param {string} clientId The block client ID. * @param {Object} template The template to match. * @param {string} templateLock The template lock state for the inner blocks. For * example, if the template lock is set to "all", * then the inner blocks will stay in sync with the * template. If not defined or set to false, then * the inner blocks will not be synchronized with * the given template. * @param {boolean} templateInsertUpdatesSelection Whether or not to update the * block-editor selection state when inner blocks * are replaced after template synchronization. */ function useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection) { // Instead of adding a useSelect mapping here, please add to the useSelect // mapping in InnerBlocks! Every subscription impacts performance. const registry = (0,external_wp_data_namespaceObject.useRegistry)(); // Maintain a reference to the previous value so we can do a deep equality check. const existingTemplateRef = (0,external_wp_element_namespaceObject.useRef)(null); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { let isCancelled = false; const { getBlocks, getSelectedBlocksInitialCaretPosition, isBlockSelected } = registry.select(store); const { replaceInnerBlocks, __unstableMarkNextChangeAsNotPersistent } = registry.dispatch(store); // There's an implicit dependency between useInnerBlockTemplateSync and useNestedSettingsUpdate // The former needs to happen after the latter and since the latter is using microtasks to batch updates (performance optimization), // we need to schedule this one in a microtask as well. // Example: If you remove queueMicrotask here, ctrl + click to insert quote block won't close the inserter. window.queueMicrotask(() => { if (isCancelled) { return; } // Only synchronize innerBlocks with template if innerBlocks are empty // or a locking "all" or "contentOnly" exists directly on the block. const currentInnerBlocks = getBlocks(clientId); const shouldApplyTemplate = currentInnerBlocks.length === 0 || templateLock === 'all' || templateLock === 'contentOnly'; const hasTemplateChanged = !es6_default()(template, existingTemplateRef.current); if (!shouldApplyTemplate || !hasTemplateChanged) { return; } existingTemplateRef.current = template; const nextBlocks = (0,external_wp_blocks_namespaceObject.synchronizeBlocksWithTemplate)(currentInnerBlocks, template); if (!es6_default()(nextBlocks, currentInnerBlocks)) { __unstableMarkNextChangeAsNotPersistent(); replaceInnerBlocks(clientId, nextBlocks, currentInnerBlocks.length === 0 && templateInsertUpdatesSelection && nextBlocks.length !== 0 && isBlockSelected(clientId), // This ensures the "initialPosition" doesn't change when applying the template // If we're supposed to focus the block, we'll focus the first inner block // otherwise, we won't apply any auto-focus. // This ensures for instance that the focus stays in the inserter when inserting the "buttons" block. getSelectedBlocksInitialCaretPosition()); } }); return () => { isCancelled = true; }; }, [template, templateLock, clientId, registry, templateInsertUpdatesSelection]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/use-block-context.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns a context object for a given block. * * @param {string} clientId The block client ID. * * @return {Record<string,*>} Context value. */ function useBlockContext(clientId) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const block = select(store).getBlock(clientId); if (!block) { return undefined; } const blockType = select(external_wp_blocks_namespaceObject.store).getBlockType(block.name); if (!blockType) { return undefined; } if (Object.keys(blockType.providesContext).length === 0) { return undefined; } return Object.fromEntries(Object.entries(blockType.providesContext).map(([contextName, attributeName]) => [contextName, block.attributes[attributeName]])); }, [clientId]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/use-on-block-drop/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('react').SyntheticEvent} SyntheticEvent */ /** @typedef {import('./types').WPDropOperation} WPDropOperation */ /** * Retrieve the data for a block drop event. * * @param {SyntheticEvent} event The drop event. * * @return {Object} An object with block drag and drop data. */ function parseDropEvent(event) { let result = { srcRootClientId: null, srcClientIds: null, srcIndex: null, type: null, blocks: null }; if (!event.dataTransfer) { return result; } try { result = Object.assign(result, JSON.parse(event.dataTransfer.getData('wp-blocks'))); } catch (err) { return result; } return result; } /** * A function that returns an event handler function for block drop events. * * @param {string} targetRootClientId The root client id where the block(s) will be inserted. * @param {number} targetBlockIndex The index where the block(s) will be inserted. * @param {Function} getBlockIndex A function that gets the index of a block. * @param {Function} getClientIdsOfDescendants A function that gets the client ids of descendant blocks. * @param {Function} moveBlocks A function that moves blocks. * @param {Function} insertOrReplaceBlocks A function that inserts or replaces blocks. * @param {Function} clearSelectedBlock A function that clears block selection. * @param {string} operation The type of operation to perform on drop. Could be `insert` or `replace` or `group`. * @param {Function} getBlock A function that returns a block given its client id. * @return {Function} The event handler for a block drop event. */ function onBlockDrop(targetRootClientId, targetBlockIndex, getBlockIndex, getClientIdsOfDescendants, moveBlocks, insertOrReplaceBlocks, clearSelectedBlock, operation, getBlock) { return event => { const { srcRootClientId: sourceRootClientId, srcClientIds: sourceClientIds, type: dropType, blocks } = parseDropEvent(event); // If the user is inserting a block. if (dropType === 'inserter') { clearSelectedBlock(); const blocksToInsert = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)); insertOrReplaceBlocks(blocksToInsert, true, null); } // If the user is moving a block. if (dropType === 'block') { const sourceBlockIndex = getBlockIndex(sourceClientIds[0]); // If the user is dropping to the same position, return early. if (sourceRootClientId === targetRootClientId && sourceBlockIndex === targetBlockIndex) { return; } // If the user is attempting to drop a block within its own // nested blocks, return early as this would create infinite // recursion. if (sourceClientIds.includes(targetRootClientId) || getClientIdsOfDescendants(sourceClientIds).some(id => id === targetRootClientId)) { return; } // If the user is dropping a block over another block, replace both blocks // with a group block containing them if (operation === 'group') { const blocksToInsert = sourceClientIds.map(clientId => getBlock(clientId)); insertOrReplaceBlocks(blocksToInsert, true, null, sourceClientIds); return; } const isAtSameLevel = sourceRootClientId === targetRootClientId; const draggedBlockCount = sourceClientIds.length; // If the block is kept at the same level and moved downwards, // subtract to take into account that the blocks being dragged // were removed from the block list above the insertion point. const insertIndex = isAtSameLevel && sourceBlockIndex < targetBlockIndex ? targetBlockIndex - draggedBlockCount : targetBlockIndex; moveBlocks(sourceClientIds, sourceRootClientId, insertIndex); } }; } /** * A function that returns an event handler function for block-related file drop events. * * @param {string} targetRootClientId The root client id where the block(s) will be inserted. * @param {Function} getSettings A function that gets the block editor settings. * @param {Function} updateBlockAttributes A function that updates a block's attributes. * @param {Function} canInsertBlockType A function that returns checks whether a block type can be inserted. * @param {Function} insertOrReplaceBlocks A function that inserts or replaces blocks. * * @return {Function} The event handler for a block-related file drop event. */ function onFilesDrop(targetRootClientId, getSettings, updateBlockAttributes, canInsertBlockType, insertOrReplaceBlocks) { return files => { if (!getSettings().mediaUpload) { return; } const transformation = (0,external_wp_blocks_namespaceObject.findTransform)((0,external_wp_blocks_namespaceObject.getBlockTransforms)('from'), transform => transform.type === 'files' && canInsertBlockType(transform.blockName, targetRootClientId) && transform.isMatch(files)); if (transformation) { const blocks = transformation.transform(files, updateBlockAttributes); insertOrReplaceBlocks(blocks); } }; } /** * A function that returns an event handler function for block-related HTML drop events. * * @param {Function} insertOrReplaceBlocks A function that inserts or replaces blocks. * * @return {Function} The event handler for a block-related HTML drop event. */ function onHTMLDrop(insertOrReplaceBlocks) { return HTML => { const blocks = (0,external_wp_blocks_namespaceObject.pasteHandler)({ HTML, mode: 'BLOCKS' }); if (blocks.length) { insertOrReplaceBlocks(blocks); } }; } /** * A React hook for handling block drop events. * * @param {string} targetRootClientId The root client id where the block(s) will be inserted. * @param {number} targetBlockIndex The index where the block(s) will be inserted. * @param {Object} options The optional options. * @param {WPDropOperation} [options.operation] The type of operation to perform on drop. Could be `insert` or `replace` for now. * * @return {Function} A function to be passed to the onDrop handler. */ function useOnBlockDrop(targetRootClientId, targetBlockIndex, options = {}) { const { operation = 'insert', nearestSide = 'right' } = options; const { canInsertBlockType, getBlockIndex, getClientIdsOfDescendants, getBlockOrder, getBlocksByClientId, getSettings, getBlock } = (0,external_wp_data_namespaceObject.useSelect)(store); const { getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); const { insertBlocks, moveBlocksToPosition, updateBlockAttributes, clearSelectedBlock, replaceBlocks, removeBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store); const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const insertOrReplaceBlocks = (0,external_wp_element_namespaceObject.useCallback)((blocks, updateSelection = true, initialPosition = 0, clientIdsToReplace = []) => { if (!Array.isArray(blocks)) { blocks = [blocks]; } const clientIds = getBlockOrder(targetRootClientId); const clientId = clientIds[targetBlockIndex]; if (operation === 'replace') { replaceBlocks(clientId, blocks, undefined, initialPosition); } else if (operation === 'group') { const targetBlock = getBlock(clientId); if (nearestSide === 'left') { blocks.push(targetBlock); } else { blocks.unshift(targetBlock); } const groupInnerBlocks = blocks.map(block => { return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks); }); const areAllImages = blocks.every(block => { return block.name === 'core/image'; }); const galleryBlock = canInsertBlockType('core/gallery', targetRootClientId); const wrappedBlocks = (0,external_wp_blocks_namespaceObject.createBlock)(areAllImages && galleryBlock ? 'core/gallery' : getGroupingBlockName(), { layout: { type: 'flex', flexWrap: areAllImages && galleryBlock ? null : 'nowrap' } }, groupInnerBlocks); // Need to make sure both the target block and the block being dragged are replaced // otherwise the dragged block will be duplicated. replaceBlocks([clientId, ...clientIdsToReplace], wrappedBlocks, undefined, initialPosition); } else { insertBlocks(blocks, targetBlockIndex, targetRootClientId, updateSelection, initialPosition); } }, [getBlockOrder, targetRootClientId, targetBlockIndex, operation, replaceBlocks, getBlock, nearestSide, canInsertBlockType, getGroupingBlockName, insertBlocks]); const moveBlocks = (0,external_wp_element_namespaceObject.useCallback)((sourceClientIds, sourceRootClientId, insertIndex) => { if (operation === 'replace') { const sourceBlocks = getBlocksByClientId(sourceClientIds); const targetBlockClientIds = getBlockOrder(targetRootClientId); const targetBlockClientId = targetBlockClientIds[targetBlockIndex]; registry.batch(() => { // Remove the source blocks. removeBlocks(sourceClientIds, false); // Replace the target block with the source blocks. replaceBlocks(targetBlockClientId, sourceBlocks, undefined, 0); }); } else { moveBlocksToPosition(sourceClientIds, sourceRootClientId, targetRootClientId, insertIndex); } }, [operation, getBlockOrder, getBlocksByClientId, moveBlocksToPosition, registry, removeBlocks, replaceBlocks, targetBlockIndex, targetRootClientId]); const _onDrop = onBlockDrop(targetRootClientId, targetBlockIndex, getBlockIndex, getClientIdsOfDescendants, moveBlocks, insertOrReplaceBlocks, clearSelectedBlock, operation, getBlock); const _onFilesDrop = onFilesDrop(targetRootClientId, getSettings, updateBlockAttributes, canInsertBlockType, insertOrReplaceBlocks); const _onHTMLDrop = onHTMLDrop(insertOrReplaceBlocks); return event => { const files = (0,external_wp_dom_namespaceObject.getFilesFromDataTransfer)(event.dataTransfer); const html = event.dataTransfer.getData('text/html'); /** * From Windows Chrome 96, the `event.dataTransfer` returns both file object and HTML. * The order of the checks is important to recognise the HTML drop. */ if (html) { _onHTMLDrop(html); } else if (files.length) { _onFilesDrop(files); } else { _onDrop(event); } }; } ;// ./node_modules/@wordpress/block-editor/build-module/utils/math.js /** * A string representing the name of an edge. * * @typedef {'top'|'right'|'bottom'|'left'} WPEdgeName */ /** * @typedef {Object} WPPoint * @property {number} x The horizontal position. * @property {number} y The vertical position. */ /** * Given a point, a DOMRect and the name of an edge, returns the distance to * that edge of the rect. * * This function works for edges that are horizontal or vertical (e.g. not * rotated), the following terms are used so that the function works in both * orientations: * * - Forward, meaning the axis running horizontally when an edge is vertical * and vertically when an edge is horizontal. * - Lateral, meaning the axis running vertically when an edge is vertical * and horizontally when an edge is horizontal. * * @param {WPPoint} point The point to measure distance from. * @param {DOMRect} rect A DOM Rect containing edge positions. * @param {WPEdgeName} edge The edge to measure to. */ function getDistanceFromPointToEdge(point, rect, edge) { const isHorizontal = edge === 'top' || edge === 'bottom'; const { x, y } = point; const pointLateralPosition = isHorizontal ? x : y; const pointForwardPosition = isHorizontal ? y : x; const edgeStart = isHorizontal ? rect.left : rect.top; const edgeEnd = isHorizontal ? rect.right : rect.bottom; const edgeForwardPosition = rect[edge]; // Measure the straight line distance to the edge of the rect, when the // point is adjacent to the edge. // Else, if the point is positioned diagonally to the edge of the rect, // measure diagonally to the nearest corner that the edge meets. let edgeLateralPosition; if (pointLateralPosition >= edgeStart && pointLateralPosition <= edgeEnd) { edgeLateralPosition = pointLateralPosition; } else if (pointLateralPosition < edgeEnd) { edgeLateralPosition = edgeStart; } else { edgeLateralPosition = edgeEnd; } return Math.sqrt((pointLateralPosition - edgeLateralPosition) ** 2 + (pointForwardPosition - edgeForwardPosition) ** 2); } /** * Given a point, a DOMRect and a list of allowed edges returns the name of and * distance to the nearest edge. * * @param {WPPoint} point The point to measure distance from. * @param {DOMRect} rect A DOM Rect containing edge positions. * @param {WPEdgeName[]} allowedEdges A list of the edges included in the * calculation. Defaults to all edges. * * @return {[number, string]} An array where the first value is the distance * and a second is the edge name. */ function getDistanceToNearestEdge(point, rect, allowedEdges = ['top', 'bottom', 'left', 'right']) { let candidateDistance; let candidateEdge; allowedEdges.forEach(edge => { const distance = getDistanceFromPointToEdge(point, rect, edge); if (candidateDistance === undefined || distance < candidateDistance) { candidateDistance = distance; candidateEdge = edge; } }); return [candidateDistance, candidateEdge]; } /** * Is the point contained by the rectangle. * * @param {WPPoint} point The point. * @param {DOMRect} rect The rectangle. * * @return {boolean} True if the point is contained by the rectangle, false otherwise. */ function isPointContainedByRect(point, rect) { return rect.left <= point.x && rect.right >= point.x && rect.top <= point.y && rect.bottom >= point.y; } /** * Is the point within the top and bottom boundaries of the rectangle. * * @param {WPPoint} point The point. * @param {DOMRect} rect The rectangle. * * @return {boolean} True if the point is within top and bottom of rectangle, false otherwise. */ function isPointWithinTopAndBottomBoundariesOfRect(point, rect) { return rect.top <= point.y && rect.bottom >= point.y; } ;// ./node_modules/@wordpress/block-editor/build-module/components/use-block-drop-zone/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const THRESHOLD_DISTANCE = 30; const MINIMUM_HEIGHT_FOR_THRESHOLD = 120; const MINIMUM_WIDTH_FOR_THRESHOLD = 120; /** @typedef {import('../../utils/math').WPPoint} WPPoint */ /** @typedef {import('../use-on-block-drop/types').WPDropOperation} WPDropOperation */ /** * The orientation of a block list. * * @typedef {'horizontal'|'vertical'|undefined} WPBlockListOrientation */ /** * The insert position when dropping a block. * * @typedef {'before'|'after'} WPInsertPosition */ /** * @typedef {Object} WPBlockData * @property {boolean} isUnmodifiedDefaultBlock Is the block unmodified default block. * @property {() => DOMRect} getBoundingClientRect Get the bounding client rect of the block. * @property {number} blockIndex The index of the block. */ /** * Get the drop target position from a given drop point and the orientation. * * @param {WPBlockData[]} blocksData The block data list. * @param {WPPoint} position The position of the item being dragged. * @param {WPBlockListOrientation} orientation The orientation of the block list. * @param {Object} options Additional options. * @return {[number, WPDropOperation]} The drop target position. */ function getDropTargetPosition(blocksData, position, orientation = 'vertical', options = {}) { const allowedEdges = orientation === 'horizontal' ? ['left', 'right'] : ['top', 'bottom']; let nearestIndex = 0; let insertPosition = 'before'; let minDistance = Infinity; let targetBlockIndex = null; let nearestSide = 'right'; const { dropZoneElement, parentBlockOrientation, rootBlockIndex = 0 } = options; // Allow before/after when dragging over the top/bottom edges of the drop zone. if (dropZoneElement && parentBlockOrientation !== 'horizontal') { const rect = dropZoneElement.getBoundingClientRect(); const [distance, edge] = getDistanceToNearestEdge(position, rect, ['top', 'bottom']); // If dragging over the top or bottom of the drop zone, insert the block // before or after the parent block. This only applies to blocks that use // a drop zone element, typically container blocks such as Group or Cover. if (rect.height > MINIMUM_HEIGHT_FOR_THRESHOLD && distance < THRESHOLD_DISTANCE) { if (edge === 'top') { return [rootBlockIndex, 'before']; } if (edge === 'bottom') { return [rootBlockIndex + 1, 'after']; } } } const isRightToLeft = (0,external_wp_i18n_namespaceObject.isRTL)(); // Allow before/after when dragging over the left/right edges of the drop zone. if (dropZoneElement && parentBlockOrientation === 'horizontal') { const rect = dropZoneElement.getBoundingClientRect(); const [distance, edge] = getDistanceToNearestEdge(position, rect, ['left', 'right']); // If dragging over the left or right of the drop zone, insert the block // before or after the parent block. This only applies to blocks that use // a drop zone element, typically container blocks such as Group. if (rect.width > MINIMUM_WIDTH_FOR_THRESHOLD && distance < THRESHOLD_DISTANCE) { if (isRightToLeft && edge === 'right' || !isRightToLeft && edge === 'left') { return [rootBlockIndex, 'before']; } if (isRightToLeft && edge === 'left' || !isRightToLeft && edge === 'right') { return [rootBlockIndex + 1, 'after']; } } } blocksData.forEach(({ isUnmodifiedDefaultBlock, getBoundingClientRect, blockIndex, blockOrientation }) => { const rect = getBoundingClientRect(); let [distance, edge] = getDistanceToNearestEdge(position, rect, allowedEdges); // If the the point is close to a side, prioritize that side. const [sideDistance, sideEdge] = getDistanceToNearestEdge(position, rect, ['left', 'right']); const isPointInsideRect = isPointContainedByRect(position, rect); // Prioritize the element if the point is inside of an unmodified default block. if (isUnmodifiedDefaultBlock && isPointInsideRect) { distance = 0; } else if (orientation === 'vertical' && blockOrientation !== 'horizontal' && (isPointInsideRect && sideDistance < THRESHOLD_DISTANCE || !isPointInsideRect && isPointWithinTopAndBottomBoundariesOfRect(position, rect))) { /** * This condition should only apply when the layout is vertical (otherwise there's * no need to create a Row) and dropzones should only activate when the block is * either within and close to the sides of the target block or on its outer sides. */ targetBlockIndex = blockIndex; nearestSide = sideEdge; } if (distance < minDistance) { // Where the dropped block will be inserted on the nearest block. insertPosition = edge === 'bottom' || !isRightToLeft && edge === 'right' || isRightToLeft && edge === 'left' ? 'after' : 'before'; // Update the currently known best candidate. minDistance = distance; nearestIndex = blockIndex; } }); const adjacentIndex = nearestIndex + (insertPosition === 'after' ? 1 : -1); const isNearestBlockUnmodifiedDefaultBlock = !!blocksData[nearestIndex]?.isUnmodifiedDefaultBlock; const isAdjacentBlockUnmodifiedDefaultBlock = !!blocksData[adjacentIndex]?.isUnmodifiedDefaultBlock; // If the target index is set then group with the block at that index. if (targetBlockIndex !== null) { return [targetBlockIndex, 'group', nearestSide]; } // If both blocks are not unmodified default blocks then just insert between them. if (!isNearestBlockUnmodifiedDefaultBlock && !isAdjacentBlockUnmodifiedDefaultBlock) { // If the user is dropping to the trailing edge of the block // add 1 to the index to represent dragging after. const insertionIndex = insertPosition === 'after' ? nearestIndex + 1 : nearestIndex; return [insertionIndex, 'insert']; } // Otherwise, replace the nearest unmodified default block. return [isNearestBlockUnmodifiedDefaultBlock ? nearestIndex : adjacentIndex, 'replace']; } /** * Check if the dragged blocks can be dropped on the target. * @param {Function} getBlockType * @param {Object[]} allowedBlocks * @param {string[]} draggedBlockNames * @param {string} targetBlockName * @return {boolean} Whether the dragged blocks can be dropped on the target. */ function isDropTargetValid(getBlockType, allowedBlocks, draggedBlockNames, targetBlockName) { // At root level allowedBlocks is undefined and all blocks are allowed. // Otherwise, check if all dragged blocks are allowed. let areBlocksAllowed = true; if (allowedBlocks) { const allowedBlockNames = allowedBlocks?.map(({ name }) => name); areBlocksAllowed = draggedBlockNames.every(name => allowedBlockNames?.includes(name)); } // Work out if dragged blocks have an allowed parent and if so // check target block matches the allowed parent. const draggedBlockTypes = draggedBlockNames.map(name => getBlockType(name)); const targetMatchesDraggedBlockParents = draggedBlockTypes.every(block => { const [allowedParentName] = block?.parent || []; if (!allowedParentName) { return true; } return allowedParentName === targetBlockName; }); return areBlocksAllowed && targetMatchesDraggedBlockParents; } /** * Checks if the given element is an insertion point. * * @param {EventTarget|null} targetToCheck - The element to check. * @param {Document} ownerDocument - The owner document of the element. * @return {boolean} True if the element is a insertion point, false otherwise. */ function isInsertionPoint(targetToCheck, ownerDocument) { const { defaultView } = ownerDocument; return !!(defaultView && targetToCheck instanceof defaultView.HTMLElement && targetToCheck.closest('[data-is-insertion-point]')); } /** * @typedef {Object} WPBlockDropZoneConfig * @property {?HTMLElement} dropZoneElement Optional element to be used as the drop zone. * @property {string} rootClientId The root client id for the block list. */ /** * A React hook that can be used to make a block list handle drag and drop. * * @param {WPBlockDropZoneConfig} dropZoneConfig configuration data for the drop zone. */ function useBlockDropZone({ dropZoneElement, // An undefined value represents a top-level block. Default to an empty // string for this so that `targetRootClientId` can be easily compared to // values returned by the `getRootBlockClientId` selector, which also uses // an empty string to represent top-level blocks. rootClientId: targetRootClientId = '', parentClientId: parentBlockClientId = '', isDisabled = false } = {}) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const [dropTarget, setDropTarget] = (0,external_wp_element_namespaceObject.useState)({ index: null, operation: 'insert' }); const { getBlockType, getBlockVariations, getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); const { canInsertBlockType, getBlockListSettings, getBlocks, getBlockIndex, getDraggedBlockClientIds, getBlockNamesByClientId, getAllowedBlocks, isDragging, isGroupable, isZoomOut, getSectionRootClientId, getBlockParents } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); const { showInsertionPoint, hideInsertionPoint, startDragging, stopDragging } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const onBlockDrop = useOnBlockDrop(dropTarget.operation === 'before' || dropTarget.operation === 'after' ? parentBlockClientId : targetRootClientId, dropTarget.index, { operation: dropTarget.operation, nearestSide: dropTarget.nearestSide }); const throttled = (0,external_wp_compose_namespaceObject.useThrottle)((0,external_wp_element_namespaceObject.useCallback)((event, ownerDocument) => { if (!isDragging()) { // When dragging from the desktop, no drag start event is fired. // So, ensure that the drag state is set when the user drags over a drop zone. startDragging(); } const draggedBlockClientIds = getDraggedBlockClientIds(); const targetParents = [targetRootClientId, ...getBlockParents(targetRootClientId, true)]; // Check if the target is within any of the dragged blocks. const isTargetWithinDraggedBlocks = draggedBlockClientIds.some(clientId => targetParents.includes(clientId)); if (isTargetWithinDraggedBlocks) { return; } const allowedBlocks = getAllowedBlocks(targetRootClientId); const targetBlockName = getBlockNamesByClientId([targetRootClientId])[0]; const draggedBlockNames = getBlockNamesByClientId(draggedBlockClientIds); const isBlockDroppingAllowed = isDropTargetValid(getBlockType, allowedBlocks, draggedBlockNames, targetBlockName); if (!isBlockDroppingAllowed) { return; } const sectionRootClientId = getSectionRootClientId(); // In Zoom Out mode, if the target is not the section root provided by settings then // do not allow dropping as the drop target is not within the root (that which is // treated as "the content" by Zoom Out Mode). if (isZoomOut() && sectionRootClientId !== targetRootClientId) { return; } const blocks = getBlocks(targetRootClientId); // The block list is empty, don't show the insertion point but still allow dropping. if (blocks.length === 0) { registry.batch(() => { setDropTarget({ index: 0, operation: 'insert' }); showInsertionPoint(targetRootClientId, 0, { operation: 'insert' }); }); return; } const blocksData = blocks.map(block => { const clientId = block.clientId; return { isUnmodifiedDefaultBlock: (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(block), getBoundingClientRect: () => ownerDocument.getElementById(`block-${clientId}`).getBoundingClientRect(), blockIndex: getBlockIndex(clientId), blockOrientation: getBlockListSettings(clientId)?.orientation }; }); const dropTargetPosition = getDropTargetPosition(blocksData, { x: event.clientX, y: event.clientY }, getBlockListSettings(targetRootClientId)?.orientation, { dropZoneElement, parentBlockClientId, parentBlockOrientation: parentBlockClientId ? getBlockListSettings(parentBlockClientId)?.orientation : undefined, rootBlockIndex: getBlockIndex(targetRootClientId) }); const [targetIndex, operation, nearestSide] = dropTargetPosition; const isTargetIndexEmptyDefaultBlock = blocksData[targetIndex]?.isUnmodifiedDefaultBlock; if (isZoomOut() && !isTargetIndexEmptyDefaultBlock && operation !== 'insert') { return; } if (operation === 'group') { const targetBlock = blocks[targetIndex]; const areAllImages = [targetBlock.name, ...draggedBlockNames].every(name => name === 'core/image'); const canInsertGalleryBlock = canInsertBlockType('core/gallery', targetRootClientId); const areGroupableBlocks = isGroupable([targetBlock.clientId, getDraggedBlockClientIds()]); const groupBlockVariations = getBlockVariations(getGroupingBlockName(), 'block'); const canInsertRow = groupBlockVariations && groupBlockVariations.find(({ name }) => name === 'group-row'); // If the dragged blocks and the target block are all images, // check if it is creatable either a Row variation or a Gallery block. if (areAllImages && !canInsertGalleryBlock && (!areGroupableBlocks || !canInsertRow)) { return; } // If the dragged blocks and the target block are not all images, // check if it is creatable a Row variation. if (!areAllImages && (!areGroupableBlocks || !canInsertRow)) { return; } } registry.batch(() => { setDropTarget({ index: targetIndex, operation, nearestSide }); const insertionPointClientId = ['before', 'after'].includes(operation) ? parentBlockClientId : targetRootClientId; showInsertionPoint(insertionPointClientId, targetIndex, { operation, nearestSide }); }); }, [isDragging, getAllowedBlocks, targetRootClientId, getBlockNamesByClientId, getDraggedBlockClientIds, getBlockType, getSectionRootClientId, isZoomOut, getBlocks, getBlockListSettings, dropZoneElement, parentBlockClientId, getBlockIndex, registry, startDragging, showInsertionPoint, canInsertBlockType, isGroupable, getBlockVariations, getGroupingBlockName]), 200); return (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({ dropZoneElement, isDisabled, onDrop: onBlockDrop, onDragOver(event) { // `currentTarget` is only available while the event is being // handled, so get it now and pass it to the thottled function. // https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget throttled(event, event.currentTarget.ownerDocument); }, onDragLeave(event) { const { ownerDocument } = event.currentTarget; // If the drag event is leaving the drop zone and entering an insertion point, // do not hide the insertion point as it is conceptually within the dropzone. if (isInsertionPoint(event.relatedTarget, ownerDocument) || isInsertionPoint(event.target, ownerDocument)) { return; } throttled.cancel(); hideInsertionPoint(); }, onDragEnd() { throttled.cancel(); stopDragging(); hideInsertionPoint(); } }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inner-blocks/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const EMPTY_OBJECT = {}; function BlockContext({ children, clientId }) { const context = useBlockContext(clientId); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockContextProvider, { value: context, children: children }); } const BlockListItemsMemo = (0,external_wp_element_namespaceObject.memo)(BlockListItems); /** * InnerBlocks is a component which allows a single block to have multiple blocks * as children. The UncontrolledInnerBlocks component is used whenever the inner * blocks are not controlled by another entity. In other words, it is normally * used for inner blocks in the post editor * * @param {Object} props The component props. */ function UncontrolledInnerBlocks(props) { const { clientId, allowedBlocks, prioritizedInserterBlocks, defaultBlock, directInsert, __experimentalDefaultBlock, __experimentalDirectInsert, template, templateLock, wrapperRef, templateInsertUpdatesSelection, __experimentalCaptureToolbars: captureToolbars, __experimentalAppenderTagName, renderAppender, orientation, placeholder, layout, name, blockType, parentLock, defaultLayout } = props; useNestedSettingsUpdate(clientId, parentLock, allowedBlocks, prioritizedInserterBlocks, defaultBlock, directInsert, __experimentalDefaultBlock, __experimentalDirectInsert, templateLock, captureToolbars, orientation, layout); useInnerBlockTemplateSync(clientId, template, templateLock, templateInsertUpdatesSelection); const defaultLayoutBlockSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, 'layout') || (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, '__experimentalLayout') || EMPTY_OBJECT; const { allowSizingOnChildren = false } = defaultLayoutBlockSupport; const usedLayout = layout || defaultLayoutBlockSupport; const memoedLayout = (0,external_wp_element_namespaceObject.useMemo)(() => ({ // Default layout will know about any content/wide size defined by the theme. ...defaultLayout, ...usedLayout, ...(allowSizingOnChildren && { allowSizingOnChildren: true }) }), [defaultLayout, usedLayout, allowSizingOnChildren]); // For controlled inner blocks, we don't want a change in blocks to // re-render the blocks list. const items = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListItemsMemo, { rootClientId: clientId, renderAppender: renderAppender, __experimentalAppenderTagName: __experimentalAppenderTagName, layout: memoedLayout, wrapperRef: wrapperRef, placeholder: placeholder }); if (!blockType?.providesContext || Object.keys(blockType.providesContext).length === 0) { return items; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockContext, { clientId: clientId, children: items }); } /** * The controlled inner blocks component wraps the uncontrolled inner blocks * component with the blockSync hook. This keeps the innerBlocks of the block in * the block-editor store in sync with the blocks of the controlling entity. An * example of an inner block controller is a template part block, which provides * its own blocks from the template part entity data source. * * @param {Object} props The component props. */ function ControlledInnerBlocks(props) { useBlockSync(props); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UncontrolledInnerBlocks, { ...props }); } const ForwardedInnerBlocks = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { const innerBlocksProps = useInnerBlocksProps({ ref }, props); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inner-blocks", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }) }); }); /** * This hook is used to lightly mark an element as an inner blocks wrapper * element. Call this hook and pass the returned props to the element to mark as * an inner blocks wrapper, automatically rendering inner blocks as children. If * you define a ref for the element, it is important to pass the ref to this * hook, which the hook in turn will pass to the component through the props it * returns. Optionally, you can also pass any other props through this hook, and * they will be merged and returned. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md * * @param {Object} props Optional. Props to pass to the element. Must contain * the ref if one is defined. * @param {Object} options Optional. Inner blocks options. */ function useInnerBlocksProps(props = {}, options = {}) { const { __unstableDisableLayoutClassNames, __unstableDisableDropZone, dropZoneElement } = options; const { clientId, layout = null, __unstableLayoutClassNames: layoutClassNames = '' } = useBlockEditContext(); const selected = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockName, isZoomOut, getTemplateLock, getBlockRootClientId, getBlockEditingMode, getBlockSettings, getSectionRootClientId } = unlock(select(store)); if (!clientId) { const sectionRootClientId = getSectionRootClientId(); // Disable the root drop zone when zoomed out and the section root client id // is not the root block list (represented by an empty string). // This avoids drag handling bugs caused by having two block lists acting as // drop zones - the actual 'root' block list and the section root. return { isDropZoneDisabled: isZoomOut() && sectionRootClientId !== '' }; } const { hasBlockSupport, getBlockType } = select(external_wp_blocks_namespaceObject.store); const blockName = getBlockName(clientId); const blockEditingMode = getBlockEditingMode(clientId); const parentClientId = getBlockRootClientId(clientId); const [defaultLayout] = getBlockSettings(clientId, 'layout'); let _isDropZoneDisabled = blockEditingMode === 'disabled'; if (isZoomOut()) { // In zoom out mode, we want to disable the drop zone for the sections. // The inner blocks belonging to the section drop zone is // already disabled by the blocks themselves being disabled. const sectionRootClientId = getSectionRootClientId(); _isDropZoneDisabled = clientId !== sectionRootClientId; } return { __experimentalCaptureToolbars: hasBlockSupport(blockName, '__experimentalExposeControlsToChildren', false), name: blockName, blockType: getBlockType(blockName), parentLock: getTemplateLock(parentClientId), parentClientId, isDropZoneDisabled: _isDropZoneDisabled, defaultLayout }; }, [clientId]); const { __experimentalCaptureToolbars, name, blockType, parentLock, parentClientId, isDropZoneDisabled, defaultLayout } = selected; const blockDropZoneRef = useBlockDropZone({ dropZoneElement, rootClientId: clientId, parentClientId }); const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, __unstableDisableDropZone || isDropZoneDisabled || layout?.isManualPlacement && window.__experimentalEnableGridInteractivity ? null : blockDropZoneRef]); const innerBlocksProps = { __experimentalCaptureToolbars, layout, name, blockType, parentLock, defaultLayout, ...options }; const InnerBlocks = innerBlocksProps.value && innerBlocksProps.onChange ? ControlledInnerBlocks : UncontrolledInnerBlocks; return { ...props, ref, className: dist_clsx(props.className, 'block-editor-block-list__layout', __unstableDisableLayoutClassNames ? '' : layoutClassNames), children: clientId ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InnerBlocks, { ...innerBlocksProps, clientId: clientId }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListItems, { ...options }) }; } useInnerBlocksProps.save = external_wp_blocks_namespaceObject.__unstableGetInnerBlocksProps; // Expose default appender placeholders as components. ForwardedInnerBlocks.DefaultBlockAppender = default_block_appender_DefaultBlockAppender; ForwardedInnerBlocks.ButtonBlockAppender = ButtonBlockAppender; ForwardedInnerBlocks.Content = () => useInnerBlocksProps.save().children; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inner-blocks/README.md */ /* harmony default export */ const inner_blocks = (ForwardedInnerBlocks); ;// ./node_modules/@wordpress/block-editor/build-module/components/observe-typing/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Set of key codes upon which typing is to be initiated on a keydown event. * * @type {Set<number>} */ const KEY_DOWN_ELIGIBLE_KEY_CODES = new Set([external_wp_keycodes_namespaceObject.UP, external_wp_keycodes_namespaceObject.RIGHT, external_wp_keycodes_namespaceObject.DOWN, external_wp_keycodes_namespaceObject.LEFT, external_wp_keycodes_namespaceObject.ENTER, external_wp_keycodes_namespaceObject.BACKSPACE]); /** * Returns true if a given keydown event can be inferred as intent to start * typing, or false otherwise. A keydown is considered eligible if it is a * text navigation without shift active. * * @param {KeyboardEvent} event Keydown event to test. * * @return {boolean} Whether event is eligible to start typing. */ function isKeyDownEligibleForStartTyping(event) { const { keyCode, shiftKey } = event; return !shiftKey && KEY_DOWN_ELIGIBLE_KEY_CODES.has(keyCode); } /** * Removes the `isTyping` flag when the mouse moves in the document of the given * element. */ function useMouseMoveTypingReset() { const isTyping = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).isTyping(), []); const { stopTyping } = (0,external_wp_data_namespaceObject.useDispatch)(store); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { if (!isTyping) { return; } const { ownerDocument } = node; let lastClientX; let lastClientY; /** * On mouse move, unset typing flag if user has moved cursor. * * @param {MouseEvent} event Mousemove event. */ function stopTypingOnMouseMove(event) { const { clientX, clientY } = event; // We need to check that the mouse really moved because Safari // triggers mousemove events when shift or ctrl are pressed. if (lastClientX && lastClientY && (lastClientX !== clientX || lastClientY !== clientY)) { stopTyping(); } lastClientX = clientX; lastClientY = clientY; } ownerDocument.addEventListener('mousemove', stopTypingOnMouseMove); return () => { ownerDocument.removeEventListener('mousemove', stopTypingOnMouseMove); }; }, [isTyping, stopTyping]); } /** * Sets and removes the `isTyping` flag based on user actions: * * - Sets the flag if the user types within the given element. * - Removes the flag when the user selects some text, focuses a non-text * field, presses ESC or TAB, or moves the mouse in the document. */ function useTypingObserver() { const { isTyping } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isTyping: _isTyping } = select(store); return { isTyping: _isTyping() }; }, []); const { startTyping, stopTyping } = (0,external_wp_data_namespaceObject.useDispatch)(store); const ref1 = useMouseMoveTypingReset(); const ref2 = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { const { ownerDocument } = node; const { defaultView } = ownerDocument; const selection = defaultView.getSelection(); // Listeners to stop typing should only be added when typing. // Listeners to start typing should only be added when not typing. if (isTyping) { let timerId; /** * Stops typing when focus transitions to a non-text field element. * * @param {FocusEvent} event Focus event. */ function stopTypingOnNonTextField(event) { const { target } = event; // Since focus to a non-text field via arrow key will trigger // before the keydown event, wait until after current stack // before evaluating whether typing is to be stopped. Otherwise, // typing will re-start. timerId = defaultView.setTimeout(() => { if (!(0,external_wp_dom_namespaceObject.isTextField)(target)) { stopTyping(); } }); } /** * Unsets typing flag if user presses Escape while typing flag is * active. * * @param {KeyboardEvent} event Keypress or keydown event to * interpret. */ function stopTypingOnEscapeKey(event) { const { keyCode } = event; if (keyCode === external_wp_keycodes_namespaceObject.ESCAPE || keyCode === external_wp_keycodes_namespaceObject.TAB) { stopTyping(); } } /** * On selection change, unset typing flag if user has made an * uncollapsed (shift) selection. */ function stopTypingOnSelectionUncollapse() { if (!selection.isCollapsed) { stopTyping(); } } node.addEventListener('focus', stopTypingOnNonTextField); node.addEventListener('keydown', stopTypingOnEscapeKey); ownerDocument.addEventListener('selectionchange', stopTypingOnSelectionUncollapse); return () => { defaultView.clearTimeout(timerId); node.removeEventListener('focus', stopTypingOnNonTextField); node.removeEventListener('keydown', stopTypingOnEscapeKey); ownerDocument.removeEventListener('selectionchange', stopTypingOnSelectionUncollapse); }; } /** * Handles a keypress or keydown event to infer intention to start * typing. * * @param {KeyboardEvent} event Keypress or keydown event to interpret. */ function startTypingInTextField(event) { const { type, target } = event; // Abort early if already typing, or key press is incurred outside a // text field (e.g. arrow-ing through toolbar buttons). // Ignore typing if outside the current DOM container if (!(0,external_wp_dom_namespaceObject.isTextField)(target) || !node.contains(target)) { return; } // Special-case keydown because certain keys do not emit a keypress // event. Conversely avoid keydown as the canonical event since // there are many keydown which are explicitly not targeted for // typing. if (type === 'keydown' && !isKeyDownEligibleForStartTyping(event)) { return; } startTyping(); } node.addEventListener('keypress', startTypingInTextField); node.addEventListener('keydown', startTypingInTextField); return () => { node.removeEventListener('keypress', startTypingInTextField); node.removeEventListener('keydown', startTypingInTextField); }; }, [isTyping, startTyping, stopTyping]); return (0,external_wp_compose_namespaceObject.useMergeRefs)([ref1, ref2]); } function ObserveTyping({ children }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: useTypingObserver(), children: children }); } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/observe-typing/README.md */ /* harmony default export */ const observe_typing = (ObserveTyping); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/zoom-out-separator.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ZoomOutSeparator({ clientId, rootClientId = '', position = 'top' }) { const [isDraggedOver, setIsDraggedOver] = (0,external_wp_element_namespaceObject.useState)(false); const { sectionRootClientId, sectionClientIds, insertionPoint, blockInsertionPointVisible, blockInsertionPoint, blocksBeingDragged } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getInsertionPoint, getBlockOrder, getSectionRootClientId, isBlockInsertionPointVisible, getBlockInsertionPoint, getDraggedBlockClientIds } = unlock(select(store)); const root = getSectionRootClientId(); const sectionRootClientIds = getBlockOrder(root); return { sectionRootClientId: root, sectionClientIds: sectionRootClientIds, blockOrder: getBlockOrder(root), insertionPoint: getInsertionPoint(), blockInsertionPoint: getBlockInsertionPoint(), blockInsertionPointVisible: isBlockInsertionPointVisible(), blocksBeingDragged: getDraggedBlockClientIds() }; }, []); const isReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); if (!clientId) { return; } let isVisible = false; const isSectionBlock = rootClientId === sectionRootClientId && sectionClientIds && sectionClientIds.includes(clientId); if (!isSectionBlock) { return null; } const hasTopInsertionPoint = insertionPoint?.index === 0 && clientId === sectionClientIds[insertionPoint.index]; const hasBottomInsertionPoint = insertionPoint && insertionPoint.hasOwnProperty('index') && clientId === sectionClientIds[insertionPoint.index - 1]; // We want to show the zoom out separator in either of these conditions: // 1. If the inserter has an insertion index set // 2. We are dragging a pattern over an insertion point if (position === 'top') { isVisible = hasTopInsertionPoint || blockInsertionPointVisible && blockInsertionPoint.index === 0 && clientId === sectionClientIds[blockInsertionPoint.index]; } if (position === 'bottom') { isVisible = hasBottomInsertionPoint || blockInsertionPointVisible && clientId === sectionClientIds[blockInsertionPoint.index - 1]; } const blockBeingDraggedClientId = blocksBeingDragged[0]; const isCurrentBlockBeingDragged = blocksBeingDragged.includes(clientId); const blockBeingDraggedIndex = sectionClientIds.indexOf(blockBeingDraggedClientId); const blockBeingDraggedPreviousSiblingClientId = blockBeingDraggedIndex > 0 ? sectionClientIds[blockBeingDraggedIndex - 1] : null; const isCurrentBlockPreviousSiblingOfBlockBeingDragged = blockBeingDraggedPreviousSiblingClientId === clientId; // The separators are visually top/bottom of the block, but in actual fact // the "top" separator is the "bottom" separator of the previous block. // Therefore, this logic hides the separator if the current block is being dragged // or if the current block is the previous sibling of the block being dragged. if (isCurrentBlockBeingDragged || isCurrentBlockPreviousSiblingOfBlockBeingDragged) { isVisible = false; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableAnimatePresence, { children: isVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { initial: { height: 0 }, animate: { // Use a height equal to that of the zoom out frame size. height: 'calc(1 * var(--wp-block-editor-iframe-zoom-out-frame-size) / var(--wp-block-editor-iframe-zoom-out-scale)' }, exit: { height: 0 }, transition: { type: 'tween', duration: isReducedMotion ? 0 : 0.2, ease: [0.6, 0, 0.4, 1] }, className: dist_clsx('block-editor-block-list__zoom-out-separator', { 'is-dragged-over': isDraggedOver }), "data-is-insertion-point": "true", onDragOver: () => setIsDraggedOver(true), onDragLeave: () => setIsDraggedOver(false), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0, transition: { delay: -0.125 } }, transition: { ease: 'linear', duration: 0.1, delay: 0.125 }, children: (0,external_wp_i18n_namespaceObject.__)('Drop pattern.') }) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-list/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const block_list_IntersectionObserver = (0,external_wp_element_namespaceObject.createContext)(); const pendingBlockVisibilityUpdatesPerRegistry = new WeakMap(); function Root({ className, ...settings }) { const { isOutlineMode, isFocusMode, temporarilyEditingAsBlocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings, getTemporarilyEditingAsBlocks, isTyping } = unlock(select(store)); const { outlineMode, focusMode } = getSettings(); return { isOutlineMode: outlineMode && !isTyping(), isFocusMode: focusMode, temporarilyEditingAsBlocks: getTemporarilyEditingAsBlocks() }; }, []); const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { setBlockVisibility } = (0,external_wp_data_namespaceObject.useDispatch)(store); const delayedBlockVisibilityUpdates = (0,external_wp_compose_namespaceObject.useDebounce)((0,external_wp_element_namespaceObject.useCallback)(() => { const updates = {}; pendingBlockVisibilityUpdatesPerRegistry.get(registry).forEach(([id, isIntersecting]) => { updates[id] = isIntersecting; }); setBlockVisibility(updates); }, [registry]), 300, { trailing: true }); const intersectionObserver = (0,external_wp_element_namespaceObject.useMemo)(() => { const { IntersectionObserver: Observer } = window; if (!Observer) { return; } return new Observer(entries => { if (!pendingBlockVisibilityUpdatesPerRegistry.get(registry)) { pendingBlockVisibilityUpdatesPerRegistry.set(registry, []); } for (const entry of entries) { const clientId = entry.target.getAttribute('data-block'); pendingBlockVisibilityUpdatesPerRegistry.get(registry).push([clientId, entry.isIntersecting]); } delayedBlockVisibilityUpdates(); }); }, []); const innerBlocksProps = useInnerBlocksProps({ ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([useBlockSelectionClearer(), useInBetweenInserter(), useTypingObserver()]), className: dist_clsx('is-root-container', className, { 'is-outline-mode': isOutlineMode, 'is-focus-mode': isFocusMode }) }, settings); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(block_list_IntersectionObserver.Provider, { value: intersectionObserver, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }), !!temporarilyEditingAsBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StopEditingAsBlocksOnOutsideSelect, { clientId: temporarilyEditingAsBlocks })] }); } function StopEditingAsBlocksOnOutsideSelect({ clientId }) { const { stopEditingAsBlocks } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const isBlockOrDescendantSelected = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isBlockSelected, hasSelectedInnerBlock } = select(store); return isBlockSelected(clientId) || hasSelectedInnerBlock(clientId, true); }, [clientId]); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isBlockOrDescendantSelected) { stopEditingAsBlocks(clientId); } }, [isBlockOrDescendantSelected, clientId, stopEditingAsBlocks]); return null; } function BlockList(settings) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Provider, { value: DEFAULT_BLOCK_EDIT_CONTEXT, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Root, { ...settings }) }); } const block_list_EMPTY_ARRAY = []; const block_list_EMPTY_SET = new Set(); function Items({ placeholder, rootClientId, renderAppender: CustomAppender, __experimentalAppenderTagName, layout = defaultLayout }) { // Avoid passing CustomAppender to useSelect because it could be a new // function on every render. const hasAppender = CustomAppender !== false; const hasCustomAppender = !!CustomAppender; const { order, isZoomOut, selectedBlocks, visibleBlocks, shouldRenderAppender } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings, getBlockOrder, getSelectedBlockClientIds, __unstableGetVisibleBlocks, getTemplateLock, getBlockEditingMode, isSectionBlock, isZoomOut: _isZoomOut, canInsertBlockType } = unlock(select(store)); const _order = getBlockOrder(rootClientId); if (getSettings().isPreviewMode) { return { order: _order, selectedBlocks: block_list_EMPTY_ARRAY, visibleBlocks: block_list_EMPTY_SET }; } const selectedBlockClientIds = getSelectedBlockClientIds(); const selectedBlockClientId = selectedBlockClientIds[0]; const showRootAppender = !rootClientId && !selectedBlockClientId && (!_order.length || !canInsertBlockType((0,external_wp_blocks_namespaceObject.getDefaultBlockName)(), rootClientId)); const hasSelectedRoot = !!(rootClientId && selectedBlockClientId && rootClientId === selectedBlockClientId); return { order: _order, selectedBlocks: selectedBlockClientIds, visibleBlocks: __unstableGetVisibleBlocks(), isZoomOut: _isZoomOut(), shouldRenderAppender: !isSectionBlock(rootClientId) && getBlockEditingMode(rootClientId) !== 'disabled' && !getTemplateLock(rootClientId) && hasAppender && !_isZoomOut() && (hasCustomAppender || hasSelectedRoot || showRootAppender) }; }, [rootClientId, hasAppender, hasCustomAppender]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(LayoutProvider, { value: layout, children: [order.map(clientId => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_data_namespaceObject.AsyncModeProvider, { value: // Only provide data asynchronously if the block is // not visible and not selected. !visibleBlocks.has(clientId) && !selectedBlocks.includes(clientId), children: [isZoomOut && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ZoomOutSeparator, { clientId: clientId, rootClientId: rootClientId, position: "top" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block, { rootClientId: rootClientId, clientId: clientId }), isZoomOut && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ZoomOutSeparator, { clientId: clientId, rootClientId: rootClientId, position: "bottom" })] }, clientId)), order.length < 1 && placeholder, shouldRenderAppender && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListAppender, { tagName: __experimentalAppenderTagName, rootClientId: rootClientId, CustomAppender: CustomAppender })] }); } function BlockListItems(props) { // This component needs to always be synchronous as it's the one changing // the async mode depending on the block selection. return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_data_namespaceObject.AsyncModeProvider, { value: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Items, { ...props }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-multi-selection.js /** * WordPress dependencies */ /** * Internal dependencies */ function selector(select) { const { isMultiSelecting, getMultiSelectedBlockClientIds, hasMultiSelection, getSelectedBlockClientId, getSelectedBlocksInitialCaretPosition, __unstableIsFullySelected } = select(store); return { isMultiSelecting: isMultiSelecting(), multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(), hasMultiSelection: hasMultiSelection(), selectedBlockClientId: getSelectedBlockClientId(), initialPosition: getSelectedBlocksInitialCaretPosition(), isFullSelection: __unstableIsFullySelected() }; } function useMultiSelection() { const { initialPosition, isMultiSelecting, multiSelectedBlockClientIds, hasMultiSelection, selectedBlockClientId, isFullSelection } = (0,external_wp_data_namespaceObject.useSelect)(selector, []); /** * When the component updates, and there is multi selection, we need to * select the entire block contents. */ return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { const { ownerDocument } = node; const { defaultView } = ownerDocument; // Allow initialPosition to bypass focus behavior. This is useful // for the list view or other areas where we don't want to transfer // focus to the editor canvas. if (initialPosition === undefined || initialPosition === null) { return; } if (!hasMultiSelection || isMultiSelecting) { return; } const { length } = multiSelectedBlockClientIds; if (length < 2) { return; } if (!isFullSelection) { return; } // Allow cross contentEditable selection by temporarily making // all content editable. We can't rely on using the store and // React because re-rending happens too slowly. We need to be // able to select across instances immediately. node.contentEditable = true; // For some browsers, like Safari, it is important that focus // happens BEFORE selection removal. node.focus(); defaultView.getSelection().removeAllRanges(); }, [hasMultiSelection, isMultiSelecting, multiSelectedBlockClientIds, selectedBlockClientId, initialPosition, isFullSelection]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-tab-nav.js /** * WordPress dependencies */ /** * Internal dependencies */ function useTabNav() { const containerRef = /** @type {typeof useRef<HTMLElement>} */(0,external_wp_element_namespaceObject.useRef)(); const focusCaptureBeforeRef = (0,external_wp_element_namespaceObject.useRef)(); const focusCaptureAfterRef = (0,external_wp_element_namespaceObject.useRef)(); const { hasMultiSelection, getSelectedBlockClientId, getBlockCount, getBlockOrder, getLastFocus, getSectionRootClientId, isZoomOut } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); const { setLastFocus } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); // Reference that holds the a flag for enabling or disabling // capturing on the focus capture elements. const noCaptureRef = (0,external_wp_element_namespaceObject.useRef)(); function onFocusCapture(event) { const canvasElement = containerRef.current.ownerDocument === event.target.ownerDocument ? containerRef.current : containerRef.current.ownerDocument.defaultView.frameElement; // Do not capture incoming focus if set by us in WritingFlow. if (noCaptureRef.current) { noCaptureRef.current = null; } else if (hasMultiSelection()) { containerRef.current.focus(); } else if (getSelectedBlockClientId()) { if (getLastFocus()?.current) { getLastFocus().current.focus(); } else { // Handles when the last focus has not been set yet, or has been cleared by new blocks being added via the inserter. containerRef.current.querySelector(`[data-block="${getSelectedBlockClientId()}"]`).focus(); } } // In "compose" mode without a selected ID, we want to place focus on the section root when tabbing to the canvas. else if (isZoomOut()) { const sectionRootClientId = getSectionRootClientId(); const sectionBlocks = getBlockOrder(sectionRootClientId); // If we have section within the section root, focus the first one. if (sectionBlocks.length) { containerRef.current.querySelector(`[data-block="${sectionBlocks[0]}"]`).focus(); } // If we don't have any section blocks, focus the section root. else if (sectionRootClientId) { containerRef.current.querySelector(`[data-block="${sectionRootClientId}"]`).focus(); } else { // If we don't have any section root, focus the canvas. canvasElement.focus(); } } else { const isBefore = // eslint-disable-next-line no-bitwise event.target.compareDocumentPosition(canvasElement) & event.target.DOCUMENT_POSITION_FOLLOWING; const tabbables = external_wp_dom_namespaceObject.focus.tabbable.find(containerRef.current); if (tabbables.length) { const next = isBefore ? tabbables[0] : tabbables[tabbables.length - 1]; next.focus(); } } } const before = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: focusCaptureBeforeRef, tabIndex: "0", onFocus: onFocusCapture }); const after = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: focusCaptureAfterRef, tabIndex: "0", onFocus: onFocusCapture }); const ref = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { function onKeyDown(event) { if (event.defaultPrevented) { return; } // In Edit mode, Tab should focus the first tabbable element after // the content, which is normally the sidebar (with block controls) // and Shift+Tab should focus the first tabbable element before the // content, which is normally the block toolbar. // Arrow keys can be used, and Tab and arrow keys can be used in // Navigation mode (press Esc), to navigate through blocks. if (event.keyCode !== external_wp_keycodes_namespaceObject.TAB) { return; } if ( // Bails in case the focus capture elements aren’t present. They // may be omitted to avoid silent tab stops in preview mode. // See: https://github.com/WordPress/gutenberg/pull/59317 !focusCaptureAfterRef.current || !focusCaptureBeforeRef.current) { return; } const { target, shiftKey: isShift } = event; const direction = isShift ? 'findPrevious' : 'findNext'; const nextTabbable = external_wp_dom_namespaceObject.focus.tabbable[direction](target); // We want to constrain the tabbing to the block and its child blocks. // If the preceding form element is within a different block, // such as two sibling image blocks in the placeholder state, // we want shift + tab from the first form element to move to the image // block toolbar and not the previous image block's form element. const currentBlock = target.closest('[data-block]'); const isElementPartOfSelectedBlock = currentBlock && nextTabbable && (isInSameBlock(currentBlock, nextTabbable) || isInsideRootBlock(currentBlock, nextTabbable)); // Allow tabbing from the block wrapper to a form element, // and between form elements rendered in a block and its child blocks, // such as inside a placeholder. Form elements are generally // meant to be UI rather than part of the content. Ideally // these are not rendered in the content and perhaps in the // future they can be rendered in an iframe or shadow DOM. if ((0,external_wp_dom_namespaceObject.isFormElement)(nextTabbable) && isElementPartOfSelectedBlock) { return; } const next = isShift ? focusCaptureBeforeRef : focusCaptureAfterRef; // Disable focus capturing on the focus capture element, so it // doesn't refocus this block and so it allows default behaviour // (moving focus to the next tabbable element). noCaptureRef.current = true; // Focusing the focus capture element, which is located above and // below the editor, should not scroll the page all the way up or // down. next.current.focus({ preventScroll: true }); } function onFocusOut(event) { setLastFocus({ ...getLastFocus(), current: event.target }); const { ownerDocument } = node; // If focus disappears due to there being no blocks, move focus to // the writing flow wrapper. if (!event.relatedTarget && event.target.hasAttribute('data-block') && ownerDocument.activeElement === ownerDocument.body && getBlockCount() === 0) { node.focus(); } } // When tabbing back to an element in block list, this event handler prevents scrolling if the // focus capture divs (before/after) are outside of the viewport. (For example shift+tab back to a paragraph // when focus is on a sidebar element. This prevents the scrollable writing area from jumping either to the // top or bottom of the document. // // Note that it isn't possible to disable scrolling in the onFocus event. We need to intercept this // earlier in the keypress handler, and call focus( { preventScroll: true } ) instead. // https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus#parameters function preventScrollOnTab(event) { if (event.keyCode !== external_wp_keycodes_namespaceObject.TAB) { return; } if (event.target?.getAttribute('role') === 'region') { return; } if (containerRef.current === event.target) { return; } const isShift = event.shiftKey; const direction = isShift ? 'findPrevious' : 'findNext'; const target = external_wp_dom_namespaceObject.focus.tabbable[direction](event.target); // Only do something when the next tabbable is a focus capture div (before/after) if (target === focusCaptureBeforeRef.current || target === focusCaptureAfterRef.current) { event.preventDefault(); target.focus({ preventScroll: true }); } } const { ownerDocument } = node; const { defaultView } = ownerDocument; defaultView.addEventListener('keydown', preventScrollOnTab); node.addEventListener('keydown', onKeyDown); node.addEventListener('focusout', onFocusOut); return () => { defaultView.removeEventListener('keydown', preventScrollOnTab); node.removeEventListener('keydown', onKeyDown); node.removeEventListener('focusout', onFocusOut); }; }, []); const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([containerRef, ref]); return [before, mergedRefs, after]; } ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-arrow-nav.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns true if the element should consider edge navigation upon a keyboard * event of the given directional key code, or false otherwise. * * @param {Element} element HTML element to test. * @param {number} keyCode KeyboardEvent keyCode to test. * @param {boolean} hasModifier Whether a modifier is pressed. * * @return {boolean} Whether element should consider edge navigation. */ function isNavigationCandidate(element, keyCode, hasModifier) { const isVertical = keyCode === external_wp_keycodes_namespaceObject.UP || keyCode === external_wp_keycodes_namespaceObject.DOWN; const { tagName } = element; const elementType = element.getAttribute('type'); // Native inputs should not navigate vertically, unless they are simple types that don't need up/down arrow keys. if (isVertical && !hasModifier) { if (tagName === 'INPUT') { const verticalInputTypes = ['date', 'datetime-local', 'month', 'number', 'range', 'time', 'week']; return !verticalInputTypes.includes(elementType); } return true; } // Native inputs should not navigate horizontally, unless they are simple types that don't need left/right arrow keys. if (tagName === 'INPUT') { const simpleInputTypes = ['button', 'checkbox', 'number', 'color', 'file', 'image', 'radio', 'reset', 'submit']; return simpleInputTypes.includes(elementType); } // Native textareas should not navigate horizontally. return tagName !== 'TEXTAREA'; } /** * Returns the optimal tab target from the given focused element in the desired * direction. A preference is made toward text fields, falling back to the block * focus stop if no other candidates exist for the block. * * @param {Element} target Currently focused text field. * @param {boolean} isReverse True if considering as the first field. * @param {Element} containerElement Element containing all blocks. * @param {boolean} onlyVertical Whether to only consider tabbable elements * that are visually above or under the * target. * * @return {?Element} Optimal tab target, if one exists. */ function getClosestTabbable(target, isReverse, containerElement, onlyVertical) { // Since the current focus target is not guaranteed to be a text field, find // all focusables. Tabbability is considered later. let focusableNodes = external_wp_dom_namespaceObject.focus.focusable.find(containerElement); if (isReverse) { focusableNodes.reverse(); } // Consider as candidates those focusables after the current target. It's // assumed this can only be reached if the target is focusable (on its // keydown event), so no need to verify it exists in the set. focusableNodes = focusableNodes.slice(focusableNodes.indexOf(target) + 1); let targetRect; if (onlyVertical) { targetRect = target.getBoundingClientRect(); } function isTabCandidate(node) { if (node.closest('[inert]')) { return; } // Skip if there's only one child that is content editable (and thus a // better candidate). if (node.children.length === 1 && isInSameBlock(node, node.firstElementChild) && node.firstElementChild.getAttribute('contenteditable') === 'true') { return; } // Not a candidate if the node is not tabbable. if (!external_wp_dom_namespaceObject.focus.tabbable.isTabbableIndex(node)) { return false; } // Skip focusable elements such as links within content editable nodes. if (node.isContentEditable && node.contentEditable !== 'true') { return false; } if (onlyVertical) { const nodeRect = node.getBoundingClientRect(); if (nodeRect.left >= targetRect.right || nodeRect.right <= targetRect.left) { return false; } } return true; } return focusableNodes.find(isTabCandidate); } function useArrowNav() { const { getMultiSelectedBlocksStartClientId, getMultiSelectedBlocksEndClientId, getSettings, hasMultiSelection, __unstableIsFullySelected } = (0,external_wp_data_namespaceObject.useSelect)(store); const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { // Here a DOMRect is stored while moving the caret vertically so // vertical position of the start position can be restored. This is to // recreate browser behaviour across blocks. let verticalRect; function onMouseDown() { verticalRect = null; } function isClosestTabbableABlock(target, isReverse) { const closestTabbable = getClosestTabbable(target, isReverse, node); return closestTabbable && getBlockClientId(closestTabbable); } function onKeyDown(event) { // Abort if navigation has already been handled (e.g. RichText // inline boundaries). if (event.defaultPrevented) { return; } const { keyCode, target, shiftKey, ctrlKey, altKey, metaKey } = event; const isUp = keyCode === external_wp_keycodes_namespaceObject.UP; const isDown = keyCode === external_wp_keycodes_namespaceObject.DOWN; const isLeft = keyCode === external_wp_keycodes_namespaceObject.LEFT; const isRight = keyCode === external_wp_keycodes_namespaceObject.RIGHT; const isReverse = isUp || isLeft; const isHorizontal = isLeft || isRight; const isVertical = isUp || isDown; const isNav = isHorizontal || isVertical; const hasModifier = shiftKey || ctrlKey || altKey || metaKey; const isNavEdge = isVertical ? external_wp_dom_namespaceObject.isVerticalEdge : external_wp_dom_namespaceObject.isHorizontalEdge; const { ownerDocument } = node; const { defaultView } = ownerDocument; if (!isNav) { return; } // If there is a multi-selection, the arrow keys should collapse the // selection to the start or end of the selection. if (hasMultiSelection()) { if (shiftKey) { return; } // Only handle if we have a full selection (not a native partial // selection). if (!__unstableIsFullySelected()) { return; } event.preventDefault(); if (isReverse) { selectBlock(getMultiSelectedBlocksStartClientId()); } else { selectBlock(getMultiSelectedBlocksEndClientId(), -1); } return; } // Abort if our current target is not a candidate for navigation // (e.g. preserve native input behaviors). if (!isNavigationCandidate(target, keyCode, hasModifier)) { return; } // When presing any key other than up or down, the initial vertical // position must ALWAYS be reset. The vertical position is saved so // it can be restored as well as possible on sebsequent vertical // arrow key presses. It may not always be possible to restore the // exact same position (such as at an empty line), so it wouldn't be // good to compute the position right before any vertical arrow key // press. if (!isVertical) { verticalRect = null; } else if (!verticalRect) { verticalRect = (0,external_wp_dom_namespaceObject.computeCaretRect)(defaultView); } // In the case of RTL scripts, right means previous and left means // next, which is the exact reverse of LTR. const isReverseDir = (0,external_wp_dom_namespaceObject.isRTL)(target) ? !isReverse : isReverse; const { keepCaretInsideBlock } = getSettings(); if (shiftKey) { if (isClosestTabbableABlock(target, isReverse) && isNavEdge(target, isReverse)) { node.contentEditable = true; // Firefox doesn't automatically move focus. node.focus(); } } else if (isVertical && (0,external_wp_dom_namespaceObject.isVerticalEdge)(target, isReverse) && ( // When Alt is pressed, only intercept if the caret is also at // the horizontal edge. altKey ? (0,external_wp_dom_namespaceObject.isHorizontalEdge)(target, isReverseDir) : true) && !keepCaretInsideBlock) { const closestTabbable = getClosestTabbable(target, isReverse, node, true); if (closestTabbable) { (0,external_wp_dom_namespaceObject.placeCaretAtVerticalEdge)(closestTabbable, // When Alt is pressed, place the caret at the furthest // horizontal edge and the furthest vertical edge. altKey ? !isReverse : isReverse, altKey ? undefined : verticalRect); event.preventDefault(); } } else if (isHorizontal && defaultView.getSelection().isCollapsed && (0,external_wp_dom_namespaceObject.isHorizontalEdge)(target, isReverseDir) && !keepCaretInsideBlock) { const closestTabbable = getClosestTabbable(target, isReverseDir, node); (0,external_wp_dom_namespaceObject.placeCaretAtHorizontalEdge)(closestTabbable, isReverse); event.preventDefault(); } } node.addEventListener('mousedown', onMouseDown); node.addEventListener('keydown', onKeyDown); return () => { node.removeEventListener('mousedown', onMouseDown); node.removeEventListener('keydown', onKeyDown); }; }, []); } ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-select-all.js /** * WordPress dependencies */ /** * Internal dependencies */ function useSelectAll() { const { getBlockOrder, getSelectedBlockClientIds, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store); const { multiSelect, selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)(); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { function onKeyDown(event) { if (!isMatch('core/block-editor/select-all', event)) { return; } const selectedClientIds = getSelectedBlockClientIds(); if (selectedClientIds.length < 2 && !(0,external_wp_dom_namespaceObject.isEntirelySelected)(event.target)) { return; } event.preventDefault(); const [firstSelectedClientId] = selectedClientIds; const rootClientId = getBlockRootClientId(firstSelectedClientId); const blockClientIds = getBlockOrder(rootClientId); // If we have selected all sibling nested blocks, try selecting up a // level. See: https://github.com/WordPress/gutenberg/pull/31859/ if (selectedClientIds.length === blockClientIds.length) { if (rootClientId) { node.ownerDocument.defaultView.getSelection().removeAllRanges(); selectBlock(rootClientId); } return; } multiSelect(blockClientIds[0], blockClientIds[blockClientIds.length - 1]); } node.addEventListener('keydown', onKeyDown); return () => { node.removeEventListener('keydown', onKeyDown); }; }, []); } ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-drag-selection.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Sets the `contenteditable` wrapper element to `value`. * * @param {HTMLElement} node Block element. * @param {boolean} value `contentEditable` value (true or false) */ function setContentEditableWrapper(node, value) { node.contentEditable = value; // Firefox doesn't automatically move focus. if (value) { node.focus(); } } /** * Sets a multi-selection based on the native selection across blocks. */ function useDragSelection() { const { startMultiSelect, stopMultiSelect } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { isSelectionEnabled, hasSelectedBlock, isDraggingBlocks, isMultiSelecting } = (0,external_wp_data_namespaceObject.useSelect)(store); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { const { ownerDocument } = node; const { defaultView } = ownerDocument; let anchorElement; let rafId; function onMouseUp() { stopMultiSelect(); // Equivalent to attaching the listener once. defaultView.removeEventListener('mouseup', onMouseUp); // The browser selection won't have updated yet at this point, // so wait until the next animation frame to get the browser // selection. rafId = defaultView.requestAnimationFrame(() => { if (!hasSelectedBlock()) { return; } // If the selection is complete (on mouse up), and no // multiple blocks have been selected, set focus back to the // anchor element. if the anchor element contains the // selection. Additionally, the contentEditable wrapper can // now be disabled again. setContentEditableWrapper(node, false); const selection = defaultView.getSelection(); if (selection.rangeCount) { const range = selection.getRangeAt(0); const { commonAncestorContainer } = range; const clonedRange = range.cloneRange(); if (anchorElement.contains(commonAncestorContainer)) { anchorElement.focus(); selection.removeAllRanges(); selection.addRange(clonedRange); } } }); } let lastMouseDownTarget; function onMouseDown({ target }) { lastMouseDownTarget = target; } function onMouseLeave({ buttons, target, relatedTarget }) { if (!target.contains(lastMouseDownTarget)) { return; } // If we're moving into a child element, ignore. We're tracking // the mouse leaving the element to a parent, no a child. if (target.contains(relatedTarget)) { return; } // Avoid triggering a multi-selection if the user is already // dragging blocks. if (isDraggingBlocks()) { return; } // The primary button must be pressed to initiate selection. // See https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/buttons if (buttons !== 1) { return; } // Abort if we are already multi-selecting. if (isMultiSelecting()) { return; } // Abort if selection is leaving writing flow. if (node === target) { return; } // Check the attribute, not the contentEditable attribute. All // child elements of the content editable wrapper are editable // and return true for this property. We only want to start // multi selecting when the mouse leaves the wrapper. if (target.getAttribute('contenteditable') !== 'true') { return; } if (!isSelectionEnabled()) { return; } // Do not rely on the active element because it may change after // the mouse leaves for the first time. See // https://github.com/WordPress/gutenberg/issues/48747. anchorElement = target; startMultiSelect(); // `onSelectionStart` is called after `mousedown` and // `mouseleave` (from a block). The selection ends when // `mouseup` happens anywhere in the window. defaultView.addEventListener('mouseup', onMouseUp); // Allow cross contentEditable selection by temporarily making // all content editable. We can't rely on using the store and // React because re-rending happens too slowly. We need to be // able to select across instances immediately. setContentEditableWrapper(node, true); } node.addEventListener('mouseout', onMouseLeave); node.addEventListener('mousedown', onMouseDown); return () => { node.removeEventListener('mouseout', onMouseLeave); defaultView.removeEventListener('mouseup', onMouseUp); defaultView.cancelAnimationFrame(rafId); }; }, [startMultiSelect, stopMultiSelect, isSelectionEnabled, hasSelectedBlock]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-selection-observer.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Extract the selection start node from the selection. When the anchor node is * not a text node, the selection offset is the index of a child node. * * @param {Selection} selection The selection. * * @return {Element} The selection start node. */ function extractSelectionStartNode(selection) { const { anchorNode, anchorOffset } = selection; if (anchorNode.nodeType === anchorNode.TEXT_NODE) { return anchorNode; } if (anchorOffset === 0) { return anchorNode; } return anchorNode.childNodes[anchorOffset - 1]; } /** * Extract the selection end node from the selection. When the focus node is not * a text node, the selection offset is the index of a child node. The selection * reaches up to but excluding that child node. * * @param {Selection} selection The selection. * * @return {Element} The selection start node. */ function extractSelectionEndNode(selection) { const { focusNode, focusOffset } = selection; if (focusNode.nodeType === focusNode.TEXT_NODE) { return focusNode; } if (focusOffset === focusNode.childNodes.length) { return focusNode; } // When the selection is forward (the selection ends with the focus node), // the selection may extend into the next element with an offset of 0. This // may trigger multi selection even though the selection does not visually // end in the next block. if (focusOffset === 0 && (0,external_wp_dom_namespaceObject.isSelectionForward)(selection)) { var _focusNode$previousSi; return (_focusNode$previousSi = focusNode.previousSibling) !== null && _focusNode$previousSi !== void 0 ? _focusNode$previousSi : focusNode.parentElement; } return focusNode.childNodes[focusOffset]; } function findDepth(a, b) { let depth = 0; while (a[depth] === b[depth]) { depth++; } return depth; } /** * Sets the `contenteditable` wrapper element to `value`. * * @param {HTMLElement} node Block element. * @param {boolean} value `contentEditable` value (true or false) */ function use_selection_observer_setContentEditableWrapper(node, value) { // Since we are calling this on every selection change, check if the value // needs to be updated first because it trigger the browser to recalculate // style. if (node.contentEditable !== String(value)) { node.contentEditable = value; // Firefox doesn't automatically move focus. if (value) { node.focus(); } } } function getRichTextElement(node) { const element = node.nodeType === node.ELEMENT_NODE ? node : node.parentElement; return element?.closest('[data-wp-block-attribute-key]'); } /** * Sets a multi-selection based on the native selection across blocks. */ function useSelectionObserver() { const { multiSelect, selectBlock, selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { getBlockParents, getBlockSelectionStart, isMultiSelecting } = (0,external_wp_data_namespaceObject.useSelect)(store); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { const { ownerDocument } = node; const { defaultView } = ownerDocument; function onSelectionChange(event) { const selection = defaultView.getSelection(); if (!selection.rangeCount) { return; } const startNode = extractSelectionStartNode(selection); const endNode = extractSelectionEndNode(selection); if (!node.contains(startNode) || !node.contains(endNode)) { return; } // If selection is collapsed and we haven't used `shift+click`, // end multi selection and disable the contentEditable wrapper. // We have to check about `shift+click` case because elements // that don't support text selection might be involved, and we might // update the clientIds to multi-select blocks. // For now we check if the event is a `mouse` event. const isClickShift = event.shiftKey && event.type === 'mouseup'; if (selection.isCollapsed && !isClickShift) { if (node.contentEditable === 'true' && !isMultiSelecting()) { use_selection_observer_setContentEditableWrapper(node, false); let element = startNode.nodeType === startNode.ELEMENT_NODE ? startNode : startNode.parentElement; element = element?.closest('[contenteditable]'); element?.focus(); } return; } let startClientId = getBlockClientId(startNode); let endClientId = getBlockClientId(endNode); // If the selection has changed and we had pressed `shift+click`, // we need to check if in an element that doesn't support // text selection has been clicked. if (isClickShift) { const selectedClientId = getBlockSelectionStart(); const clickedClientId = getBlockClientId(event.target); // `endClientId` is not defined if we end the selection by clicking a non-selectable block. // We need to check if there was already a selection with a non-selectable focusNode. const focusNodeIsNonSelectable = clickedClientId !== endClientId; if (startClientId === endClientId && selection.isCollapsed || !endClientId || focusNodeIsNonSelectable) { endClientId = clickedClientId; } // Handle the case when we have a non-selectable block // selected and click another one. if (startClientId !== selectedClientId) { startClientId = selectedClientId; } } // If the selection did not involve a block, return. if (startClientId === undefined && endClientId === undefined) { use_selection_observer_setContentEditableWrapper(node, false); return; } const isSingularSelection = startClientId === endClientId; if (isSingularSelection) { if (!isMultiSelecting()) { selectBlock(startClientId); } else { multiSelect(startClientId, startClientId); } } else { const startPath = [...getBlockParents(startClientId), startClientId]; const endPath = [...getBlockParents(endClientId), endClientId]; const depth = findDepth(startPath, endPath); if (startPath[depth] !== startClientId || endPath[depth] !== endClientId) { multiSelect(startPath[depth], endPath[depth]); return; } const richTextElementStart = getRichTextElement(startNode); const richTextElementEnd = getRichTextElement(endNode); if (richTextElementStart && richTextElementEnd) { var _richTextDataStart$st, _richTextDataEnd$star; const range = selection.getRangeAt(0); const richTextDataStart = (0,external_wp_richText_namespaceObject.create)({ element: richTextElementStart, range, __unstableIsEditableTree: true }); const richTextDataEnd = (0,external_wp_richText_namespaceObject.create)({ element: richTextElementEnd, range, __unstableIsEditableTree: true }); const startOffset = (_richTextDataStart$st = richTextDataStart.start) !== null && _richTextDataStart$st !== void 0 ? _richTextDataStart$st : richTextDataStart.end; const endOffset = (_richTextDataEnd$star = richTextDataEnd.start) !== null && _richTextDataEnd$star !== void 0 ? _richTextDataEnd$star : richTextDataEnd.end; selectionChange({ start: { clientId: startClientId, attributeKey: richTextElementStart.dataset.wpBlockAttributeKey, offset: startOffset }, end: { clientId: endClientId, attributeKey: richTextElementEnd.dataset.wpBlockAttributeKey, offset: endOffset } }); } else { multiSelect(startClientId, endClientId); } } } ownerDocument.addEventListener('selectionchange', onSelectionChange); defaultView.addEventListener('mouseup', onSelectionChange); return () => { ownerDocument.removeEventListener('selectionchange', onSelectionChange); defaultView.removeEventListener('mouseup', onSelectionChange); }; }, [multiSelect, selectBlock, selectionChange, getBlockParents]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-click-selection.js /** * WordPress dependencies */ /** * Internal dependencies */ function useClickSelection() { const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { isSelectionEnabled, getBlockSelectionStart, hasMultiSelection } = (0,external_wp_data_namespaceObject.useSelect)(store); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { function onMouseDown(event) { // The main button. // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button if (!isSelectionEnabled() || event.button !== 0) { return; } const startClientId = getBlockSelectionStart(); const clickedClientId = getBlockClientId(event.target); if (event.shiftKey) { if (startClientId !== clickedClientId) { node.contentEditable = true; // Firefox doesn't automatically move focus. node.focus(); } } else if (hasMultiSelection()) { // Allow user to escape out of a multi-selection to a // singular selection of a block via click. This is handled // here since focus handling excludes blocks when there is // multiselection, as focus can be incurred by starting a // multiselection (focus moved to first block's multi- // controls). selectBlock(clickedClientId); } } node.addEventListener('mousedown', onMouseDown); return () => { node.removeEventListener('mousedown', onMouseDown); }; }, [selectBlock, isSelectionEnabled, getBlockSelectionStart, hasMultiSelection]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-input.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Handles input for selections across blocks. */ function useInput() { const { __unstableIsFullySelected, getSelectedBlockClientIds, getSelectedBlockClientId, __unstableIsSelectionMergeable, hasMultiSelection, getBlockName, canInsertBlockType, getBlockRootClientId, getSelectionStart, getSelectionEnd, getBlockAttributes } = (0,external_wp_data_namespaceObject.useSelect)(store); const { replaceBlocks, __unstableSplitSelection, removeBlocks, __unstableDeleteSelection, __unstableExpandSelection, __unstableMarkAutomaticChange } = (0,external_wp_data_namespaceObject.useDispatch)(store); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { function onBeforeInput(event) { // If writing flow is editable, NEVER allow the browser to alter the // DOM. This will cause React errors (and the DOM should only be // altered in a controlled fashion). if (node.contentEditable === 'true') { event.preventDefault(); } } function onKeyDown(event) { if (event.defaultPrevented) { return; } if (!hasMultiSelection()) { if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) { if (event.shiftKey || __unstableIsFullySelected()) { return; } const clientId = getSelectedBlockClientId(); const blockName = getBlockName(clientId); const selectionStart = getSelectionStart(); const selectionEnd = getSelectionEnd(); if (selectionStart.attributeKey === selectionEnd.attributeKey) { const selectedAttributeValue = getBlockAttributes(clientId)[selectionStart.attributeKey]; const transforms = (0,external_wp_blocks_namespaceObject.getBlockTransforms)('from').filter(({ type }) => type === 'enter'); const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(transforms, item => { return item.regExp.test(selectedAttributeValue); }); if (transformation) { replaceBlocks(clientId, transformation.transform({ content: selectedAttributeValue })); __unstableMarkAutomaticChange(); return; } } if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, 'splitting', false) && !event.__deprecatedOnSplit) { return; } // Ensure template is not locked. if (canInsertBlockType(blockName, getBlockRootClientId(clientId))) { __unstableSplitSelection(); event.preventDefault(); } } return; } if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) { node.contentEditable = false; event.preventDefault(); if (__unstableIsFullySelected()) { replaceBlocks(getSelectedBlockClientIds(), (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())); } else { __unstableSplitSelection(); } } else if (event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) { node.contentEditable = false; event.preventDefault(); if (__unstableIsFullySelected()) { removeBlocks(getSelectedBlockClientIds()); } else if (__unstableIsSelectionMergeable()) { __unstableDeleteSelection(event.keyCode === external_wp_keycodes_namespaceObject.DELETE); } else { __unstableExpandSelection(); } } else if ( // If key.length is longer than 1, it's a control key that doesn't // input anything. event.key.length === 1 && !(event.metaKey || event.ctrlKey)) { node.contentEditable = false; if (__unstableIsSelectionMergeable()) { __unstableDeleteSelection(event.keyCode === external_wp_keycodes_namespaceObject.DELETE); } else { event.preventDefault(); // Safari does not stop default behaviour with either // event.preventDefault() or node.contentEditable = false, so // remove the selection to stop browser manipulation. node.ownerDocument.defaultView.getSelection().removeAllRanges(); } } } function onCompositionStart(event) { if (!hasMultiSelection()) { return; } node.contentEditable = false; if (__unstableIsSelectionMergeable()) { __unstableDeleteSelection(); } else { event.preventDefault(); // Safari does not stop default behaviour with either // event.preventDefault() or node.contentEditable = false, so // remove the selection to stop browser manipulation. node.ownerDocument.defaultView.getSelection().removeAllRanges(); } } node.addEventListener('beforeinput', onBeforeInput); node.addEventListener('keydown', onKeyDown); node.addEventListener('compositionstart', onCompositionStart); return () => { node.removeEventListener('beforeinput', onBeforeInput); node.removeEventListener('keydown', onKeyDown); node.removeEventListener('compositionstart', onCompositionStart); }; }, []); } ;// ./node_modules/@wordpress/block-editor/build-module/utils/use-notify-copy.js /** * WordPress dependencies */ /** * Internal dependencies */ function useNotifyCopy() { const { getBlockName } = (0,external_wp_data_namespaceObject.useSelect)(store); const { getBlockType } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); return (0,external_wp_element_namespaceObject.useCallback)((eventType, selectedBlockClientIds) => { let notice = ''; if (eventType === 'copyStyles') { notice = (0,external_wp_i18n_namespaceObject.__)('Styles copied to clipboard.'); } else if (selectedBlockClientIds.length === 1) { const clientId = selectedBlockClientIds[0]; const title = getBlockType(getBlockName(clientId))?.title; if (eventType === 'copy') { notice = (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: Name of the block being copied, e.g. "Paragraph". (0,external_wp_i18n_namespaceObject.__)('Copied "%s" to clipboard.'), title); } else { notice = (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: Name of the block being cut, e.g. "Paragraph". (0,external_wp_i18n_namespaceObject.__)('Moved "%s" to clipboard.'), title); } } else if (eventType === 'copy') { notice = (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %d: Number of blocks being copied. (0,external_wp_i18n_namespaceObject._n)('Copied %d block to clipboard.', 'Copied %d blocks to clipboard.', selectedBlockClientIds.length), selectedBlockClientIds.length); } else { notice = (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %d: Number of blocks being moved. (0,external_wp_i18n_namespaceObject._n)('Moved %d block to clipboard.', 'Moved %d blocks to clipboard.', selectedBlockClientIds.length), selectedBlockClientIds.length); } createSuccessNotice(notice, { type: 'snackbar' }); }, [createSuccessNotice, getBlockName, getBlockType]); } ;// ./node_modules/@wordpress/block-editor/build-module/utils/pasting.js /** * WordPress dependencies */ /** * Normalizes a given string of HTML to remove the Windows-specific "Fragment" * comments and any preceding and trailing content. * * @param {string} html the html to be normalized * @return {string} the normalized html */ function removeWindowsFragments(html) { const startStr = '<!--StartFragment-->'; const startIdx = html.indexOf(startStr); if (startIdx > -1) { html = html.substring(startIdx + startStr.length); } else { // No point looking for EndFragment return html; } const endStr = '<!--EndFragment-->'; const endIdx = html.indexOf(endStr); if (endIdx > -1) { html = html.substring(0, endIdx); } return html; } /** * Removes the charset meta tag inserted by Chromium. * See: * - https://github.com/WordPress/gutenberg/issues/33585 * - https://bugs.chromium.org/p/chromium/issues/detail?id=1264616#c4 * * @param {string} html the html to be stripped of the meta tag. * @return {string} the cleaned html */ function removeCharsetMetaTag(html) { const metaTag = `<meta charset='utf-8'>`; if (html.startsWith(metaTag)) { return html.slice(metaTag.length); } return html; } function getPasteEventData({ clipboardData }) { let plainText = ''; let html = ''; try { plainText = clipboardData.getData('text/plain'); html = clipboardData.getData('text/html'); } catch (error) { // Some browsers like UC Browser paste plain text by default and // don't support clipboardData at all, so allow default // behaviour. return; } // Remove Windows-specific metadata appended within copied HTML text. html = removeWindowsFragments(html); // Strip meta tag. html = removeCharsetMetaTag(html); const files = (0,external_wp_dom_namespaceObject.getFilesFromDataTransfer)(clipboardData); if (files.length && !shouldDismissPastedFiles(files, html)) { return { files }; } return { html, plainText, files: [] }; } /** * Given a collection of DataTransfer files and HTML and plain text strings, * determine whether the files are to be dismissed in favor of the HTML. * * Certain office-type programs, like Microsoft Word or Apple Numbers, * will, upon copy, generate a screenshot of the content being copied and * attach it to the clipboard alongside the actual rich text that the user * sought to copy. In those cases, we should let Gutenberg handle the rich text * content and not the screenshot, since this allows Gutenberg to insert * meaningful blocks, like paragraphs, lists or even tables. * * @param {File[]} files File objects obtained from a paste event * @param {string} html HTML content obtained from a paste event * @return {boolean} True if the files should be dismissed */ function shouldDismissPastedFiles(files, html /*, plainText */) { // The question is only relevant when there is actual HTML content and when // there is exactly one image file. if (html && files?.length === 1 && files[0].type.indexOf('image/') === 0) { // A single <img> tag found in the HTML source suggests that the // content being pasted revolves around an image. Sometimes there are // other elements found, like <figure>, but we assume that the user's // intention is to paste the actual image file. const IMAGE_TAG = /<\s*img\b/gi; if (html.match(IMAGE_TAG)?.length !== 1) { return true; } // Even when there is exactly one <img> tag in the HTML payload, we // choose to weed out local images, i.e. those whose source starts with // "file://". These payloads occur in specific configurations, such as // when copying an entire document from Microsoft Word, that contains // text and exactly one image, and pasting that content using Google // Chrome. const IMG_WITH_LOCAL_SRC = /<\s*img\b[^>]*\bsrc="file:\/\//i; if (html.match(IMG_WITH_LOCAL_SRC)) { return true; } } return false; } ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/utils.js /** * WordPress dependencies */ /** * Internal dependencies */ const requiresWrapperOnCopy = Symbol('requiresWrapperOnCopy'); /** * Sets the clipboard data for the provided blocks, with both HTML and plain * text representations. * * @param {ClipboardEvent} event Clipboard event. * @param {WPBlock[]} blocks Blocks to set as clipboard data. * @param {Object} registry The registry to select from. */ function setClipboardBlocks(event, blocks, registry) { let _blocks = blocks; const [firstBlock] = blocks; if (firstBlock) { const firstBlockType = registry.select(external_wp_blocks_namespaceObject.store).getBlockType(firstBlock.name); if (firstBlockType[requiresWrapperOnCopy]) { const { getBlockRootClientId, getBlockName, getBlockAttributes } = registry.select(store); const wrapperBlockClientId = getBlockRootClientId(firstBlock.clientId); const wrapperBlockName = getBlockName(wrapperBlockClientId); if (wrapperBlockName) { _blocks = (0,external_wp_blocks_namespaceObject.createBlock)(wrapperBlockName, getBlockAttributes(wrapperBlockClientId), _blocks); } } } const serialized = (0,external_wp_blocks_namespaceObject.serialize)(_blocks); event.clipboardData.setData('text/plain', toPlainText(serialized)); event.clipboardData.setData('text/html', serialized); } /** * Returns the blocks to be pasted from the clipboard event. * * @param {ClipboardEvent} event The clipboard event. * @param {boolean} canUserUseUnfilteredHTML Whether the user can or can't post unfiltered HTML. * @return {Array|string} A list of blocks or a string, depending on `handlerMode`. */ function getPasteBlocks(event, canUserUseUnfilteredHTML) { const { plainText, html, files } = getPasteEventData(event); let blocks = []; if (files.length) { const fromTransforms = (0,external_wp_blocks_namespaceObject.getBlockTransforms)('from'); blocks = files.reduce((accumulator, file) => { const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(fromTransforms, transform => transform.type === 'files' && transform.isMatch([file])); if (transformation) { accumulator.push(transformation.transform([file])); } return accumulator; }, []).flat(); } else { blocks = (0,external_wp_blocks_namespaceObject.pasteHandler)({ HTML: html, plainText, mode: 'BLOCKS', canUserUseUnfilteredHTML }); } return blocks; } /** * Given a string of HTML representing serialized blocks, returns the plain * text extracted after stripping the HTML of any tags and fixing line breaks. * * @param {string} html Serialized blocks. * @return {string} The plain-text content with any html removed. */ function toPlainText(html) { // Manually handle BR tags as line breaks prior to `stripHTML` call html = html.replace(/<br>/g, '\n'); const plainText = (0,external_wp_dom_namespaceObject.__unstableStripHTML)(html).trim(); // Merge any consecutive line breaks return plainText.replace(/\n\n+/g, '\n\n'); } ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/use-clipboard-handler.js /** * WordPress dependencies */ /** * Internal dependencies */ function useClipboardHandler() { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { getBlocksByClientId, getSelectedBlockClientIds, hasMultiSelection, getSettings, getBlockName, __unstableIsFullySelected, __unstableIsSelectionCollapsed, __unstableIsSelectionMergeable, __unstableGetSelectedBlocksWithPartialSelection, canInsertBlockType, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store); const { flashBlock, removeBlocks, replaceBlocks, __unstableDeleteSelection, __unstableExpandSelection, __unstableSplitSelection } = (0,external_wp_data_namespaceObject.useDispatch)(store); const notifyCopy = useNotifyCopy(); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { function handler(event) { if (event.defaultPrevented) { // This was likely already handled in rich-text/use-paste-handler.js. return; } const selectedBlockClientIds = getSelectedBlockClientIds(); if (selectedBlockClientIds.length === 0) { return; } // Let native copy/paste behaviour take over in input fields. // But always handle multiple selected blocks. if (!hasMultiSelection()) { const { target } = event; const { ownerDocument } = target; // If copying, only consider actual text selection as selection. // Otherwise, any focus on an input field is considered. const hasSelection = event.type === 'copy' || event.type === 'cut' ? (0,external_wp_dom_namespaceObject.documentHasUncollapsedSelection)(ownerDocument) : (0,external_wp_dom_namespaceObject.documentHasSelection)(ownerDocument) && !ownerDocument.activeElement.isContentEditable; // Let native copy behaviour take over in input fields. if (hasSelection) { return; } } const { activeElement } = event.target.ownerDocument; if (!node.contains(activeElement)) { return; } const isSelectionMergeable = __unstableIsSelectionMergeable(); const shouldHandleWholeBlocks = __unstableIsSelectionCollapsed() || __unstableIsFullySelected(); const expandSelectionIsNeeded = !shouldHandleWholeBlocks && !isSelectionMergeable; if (event.type === 'copy' || event.type === 'cut') { event.preventDefault(); if (selectedBlockClientIds.length === 1) { flashBlock(selectedBlockClientIds[0]); } // If we have a partial selection that is not mergeable, just // expand the selection to the whole blocks. if (expandSelectionIsNeeded) { __unstableExpandSelection(); } else { notifyCopy(event.type, selectedBlockClientIds); let blocks; // Check if we have partial selection. if (shouldHandleWholeBlocks) { blocks = getBlocksByClientId(selectedBlockClientIds); } else { const [head, tail] = __unstableGetSelectedBlocksWithPartialSelection(); const inBetweenBlocks = getBlocksByClientId(selectedBlockClientIds.slice(1, selectedBlockClientIds.length - 1)); blocks = [head, ...inBetweenBlocks, tail]; } setClipboardBlocks(event, blocks, registry); } } if (event.type === 'cut') { // We need to also check if at the start we needed to // expand the selection, as in this point we might have // programmatically fully selected the blocks above. if (shouldHandleWholeBlocks && !expandSelectionIsNeeded) { removeBlocks(selectedBlockClientIds); } else { event.target.ownerDocument.activeElement.contentEditable = false; __unstableDeleteSelection(); } } else if (event.type === 'paste') { const { __experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML } = getSettings(); const isInternal = event.clipboardData.getData('rich-text') === 'true'; if (isInternal) { return; } const { plainText, html, files } = getPasteEventData(event); const isFullySelected = __unstableIsFullySelected(); let blocks = []; if (files.length) { const fromTransforms = (0,external_wp_blocks_namespaceObject.getBlockTransforms)('from'); blocks = files.reduce((accumulator, file) => { const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(fromTransforms, transform => transform.type === 'files' && transform.isMatch([file])); if (transformation) { accumulator.push(transformation.transform([file])); } return accumulator; }, []).flat(); } else { blocks = (0,external_wp_blocks_namespaceObject.pasteHandler)({ HTML: html, plainText, mode: isFullySelected ? 'BLOCKS' : 'AUTO', canUserUseUnfilteredHTML }); } // Inline paste: let rich text handle it. if (typeof blocks === 'string') { return; } if (isFullySelected) { replaceBlocks(selectedBlockClientIds, blocks, blocks.length - 1, -1); event.preventDefault(); return; } // If a block doesn't support splitting, let rich text paste // inline. if (!hasMultiSelection() && !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(getBlockName(selectedBlockClientIds[0]), 'splitting', false) && !event.__deprecatedOnSplit) { return; } const [firstSelectedClientId] = selectedBlockClientIds; const rootClientId = getBlockRootClientId(firstSelectedClientId); const newBlocks = []; for (const block of blocks) { if (canInsertBlockType(block.name, rootClientId)) { newBlocks.push(block); } else { // If a block cannot be inserted in a root block, try // converting it to that root block type and insert the // inner blocks. // Example: paragraphs cannot be inserted into a list, // so convert the paragraphs to a list for list items. const rootBlockName = getBlockName(rootClientId); const switchedBlocks = block.name !== rootBlockName ? (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, rootBlockName) : [block]; if (!switchedBlocks) { return; } for (const switchedBlock of switchedBlocks) { for (const innerBlock of switchedBlock.innerBlocks) { newBlocks.push(innerBlock); } } } } __unstableSplitSelection(newBlocks); event.preventDefault(); } } node.ownerDocument.addEventListener('copy', handler); node.ownerDocument.addEventListener('cut', handler); node.ownerDocument.addEventListener('paste', handler); return () => { node.ownerDocument.removeEventListener('copy', handler); node.ownerDocument.removeEventListener('cut', handler); node.ownerDocument.removeEventListener('paste', handler); }; }, []); } ;// ./node_modules/@wordpress/block-editor/build-module/components/writing-flow/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function useWritingFlow() { const [before, ref, after] = useTabNav(); const hasMultiSelection = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).hasMultiSelection(), []); return [before, (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, useClipboardHandler(), useInput(), useDragSelection(), useSelectionObserver(), useClickSelection(), useMultiSelection(), useSelectAll(), useArrowNav(), (0,external_wp_compose_namespaceObject.useRefEffect)(node => { node.tabIndex = 0; node.dataset.hasMultiSelection = hasMultiSelection; if (!hasMultiSelection) { return () => { delete node.dataset.hasMultiSelection; }; } node.setAttribute('aria-label', (0,external_wp_i18n_namespaceObject.__)('Multiple selected blocks')); return () => { delete node.dataset.hasMultiSelection; node.removeAttribute('aria-label'); }; }, [hasMultiSelection])]), after]; } function WritingFlow({ children, ...props }, forwardedRef) { const [before, ref, after] = useWritingFlow(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [before, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...props, ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, forwardedRef]), className: dist_clsx(props.className, 'block-editor-writing-flow'), children: children }), after] }); } /** * Handles selection and navigation across blocks. This component should be * wrapped around BlockList. * * @param {Object} props Component properties. * @param {Element} props.children Children to be rendered. */ /* harmony default export */ const writing_flow = ((0,external_wp_element_namespaceObject.forwardRef)(WritingFlow)); ;// ./node_modules/@wordpress/block-editor/build-module/components/iframe/get-compatibility-styles.js let compatibilityStyles = null; /** * Returns a list of stylesheets that target the editor canvas. A stylesheet is * considered targeting the editor a canvas if it contains the * `editor-styles-wrapper`, `wp-block`, or `wp-block-*` class selectors. * * Ideally, this hook should be removed in the future and styles should be added * explicitly as editor styles. */ function getCompatibilityStyles() { if (compatibilityStyles) { return compatibilityStyles; } // Only memoize the result once on load, since these stylesheets should not // change. compatibilityStyles = Array.from(document.styleSheets).reduce((accumulator, styleSheet) => { try { // May fail for external styles. // eslint-disable-next-line no-unused-expressions styleSheet.cssRules; } catch (e) { return accumulator; } const { ownerNode, cssRules } = styleSheet; // Stylesheet is added by another stylesheet. See // https://developer.mozilla.org/en-US/docs/Web/API/StyleSheet/ownerNode#notes. if (ownerNode === null) { return accumulator; } if (!cssRules) { return accumulator; } // Don't try to add core WP styles. We are responsible for adding // them. This compatibility layer is only meant to add styles added // by plugins or themes. if (ownerNode.id.startsWith('wp-')) { return accumulator; } // Don't try to add styles without ID. Styles enqueued via the WP dependency system will always have IDs. if (!ownerNode.id) { return accumulator; } function matchFromRules(_cssRules) { return Array.from(_cssRules).find(({ selectorText, conditionText, cssRules: __cssRules }) => { // If the rule is conditional then it will not have selector text. // Recurse into child CSS ruleset to determine selector eligibility. if (conditionText) { return matchFromRules(__cssRules); } return selectorText && (selectorText.includes('.editor-styles-wrapper') || selectorText.includes('.wp-block')); }); } if (matchFromRules(cssRules)) { const isInline = ownerNode.tagName === 'STYLE'; if (isInline) { // If the current target is inline, // it could be a dependency of an existing stylesheet. // Look for that dependency and add it BEFORE the current target. const mainStylesCssId = ownerNode.id.replace('-inline-css', '-css'); const mainStylesElement = document.getElementById(mainStylesCssId); if (mainStylesElement) { accumulator.push(mainStylesElement.cloneNode(true)); } } accumulator.push(ownerNode.cloneNode(true)); if (!isInline) { // If the current target is not inline, // we still look for inline styles that could be relevant for the current target. // If they exist, add them AFTER the current target. const inlineStylesCssId = ownerNode.id.replace('-css', '-inline-css'); const inlineStylesElement = document.getElementById(inlineStylesCssId); if (inlineStylesElement) { accumulator.push(inlineStylesElement.cloneNode(true)); } } } return accumulator; }, []); return compatibilityStyles; } ;// ./node_modules/@wordpress/block-editor/build-module/components/iframe/use-scale-canvas.js /** * WordPress dependencies */ /** * @typedef {Object} TransitionState * @property {number} scaleValue Scale of the canvas. * @property {number} frameSize Size of the frame/offset around the canvas. * @property {number} containerHeight containerHeight of the iframe. * @property {number} scrollTop ScrollTop of the iframe. * @property {number} scrollHeight ScrollHeight of the iframe. */ /** * Calculate the scale of the canvas. * * @param {Object} options Object of options * @param {number} options.frameSize Size of the frame/offset around the canvas * @param {number} options.containerWidth Actual width of the canvas container * @param {number} options.maxContainerWidth Maximum width of the container to use for the scale calculation. This locks the canvas to a maximum width when zooming out. * @param {number} options.scaleContainerWidth Width the of the container wrapping the canvas container * @return {number} Scale value between 0 and/or equal to 1 */ function calculateScale({ frameSize, containerWidth, maxContainerWidth, scaleContainerWidth }) { return (Math.min(containerWidth, maxContainerWidth) - frameSize * 2) / scaleContainerWidth; } /** * Compute the next scrollHeight based on the transition states. * * @param {TransitionState} transitionFrom Starting point of the transition * @param {TransitionState} transitionTo Ending state of the transition * @return {number} Next scrollHeight based on scale and frame value changes. */ function computeScrollHeightNext(transitionFrom, transitionTo) { const { scaleValue: prevScale, scrollHeight: prevScrollHeight } = transitionFrom; const { frameSize, scaleValue } = transitionTo; return prevScrollHeight * (scaleValue / prevScale) + frameSize * 2; } /** * Compute the next scrollTop position after scaling the iframe content. * * @param {TransitionState} transitionFrom Starting point of the transition * @param {TransitionState} transitionTo Ending state of the transition * @return {number} Next scrollTop position after scaling the iframe content. */ function computeScrollTopNext(transitionFrom, transitionTo) { const { containerHeight: prevContainerHeight, frameSize: prevFrameSize, scaleValue: prevScale, scrollTop: prevScrollTop } = transitionFrom; const { containerHeight, frameSize, scaleValue, scrollHeight } = transitionTo; // Step 0: Start with the current scrollTop. let scrollTopNext = prevScrollTop; // Step 1: Undo the effects of the previous scale and frame around the // midpoint of the visible area. scrollTopNext = (scrollTopNext + prevContainerHeight / 2 - prevFrameSize) / prevScale - prevContainerHeight / 2; // Step 2: Apply the new scale and frame around the midpoint of the // visible area. scrollTopNext = (scrollTopNext + containerHeight / 2) * scaleValue + frameSize - containerHeight / 2; // Step 3: Handle an edge case so that you scroll to the top of the // iframe if the top of the iframe content is visible in the container. // The same edge case for the bottom is skipped because changing content // makes calculating it impossible. scrollTopNext = prevScrollTop <= prevFrameSize ? 0 : scrollTopNext; // This is the scrollTop value if you are scrolled to the bottom of the // iframe. We can't just let the browser handle it because we need to // animate the scaling. const maxScrollTop = scrollHeight - containerHeight; // Step 4: Clamp the scrollTopNext between the minimum and maximum // possible scrollTop positions. Round the value to avoid subpixel // truncation by the browser which sometimes causes a 1px error. return Math.round(Math.min(Math.max(0, scrollTopNext), Math.max(0, maxScrollTop))); } /** * Generate the keyframes to use for the zoom out animation. * * @param {TransitionState} transitionFrom Starting transition state. * @param {TransitionState} transitionTo Ending transition state. * @return {Object[]} An array of keyframes to use for the animation. */ function getAnimationKeyframes(transitionFrom, transitionTo) { const { scaleValue: prevScale, frameSize: prevFrameSize, scrollTop } = transitionFrom; const { scaleValue, frameSize, scrollTop: scrollTopNext } = transitionTo; return [{ translate: `0 0`, scale: prevScale, paddingTop: `${prevFrameSize / prevScale}px`, paddingBottom: `${prevFrameSize / prevScale}px` }, { translate: `0 ${scrollTop - scrollTopNext}px`, scale: scaleValue, paddingTop: `${frameSize / scaleValue}px`, paddingBottom: `${frameSize / scaleValue}px` }]; } /** * @typedef {Object} ScaleCanvasResult * @property {boolean} isZoomedOut A boolean indicating if the canvas is zoomed out. * @property {number} scaleContainerWidth The width of the container used to calculate the scale. * @property {Object} contentResizeListener A resize observer for the content. * @property {Object} containerResizeListener A resize observer for the container. */ /** * Handles scaling the canvas for the zoom out mode and animating between * the states. * * @param {Object} options Object of options. * @param {number} options.frameSize Size of the frame around the content. * @param {Document} options.iframeDocument Document of the iframe. * @param {number} options.maxContainerWidth Max width of the canvas to use as the starting scale point. Defaults to 750. * @param {number|string} options.scale Scale of the canvas. Can be an decimal between 0 and 1, 1, or 'auto-scaled'. * @return {ScaleCanvasResult} Properties of the result. */ function useScaleCanvas({ frameSize, iframeDocument, maxContainerWidth = 750, scale }) { const [contentResizeListener, { height: contentHeight }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const [containerResizeListener, { width: containerWidth, height: containerHeight }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const initialContainerWidthRef = (0,external_wp_element_namespaceObject.useRef)(0); const isZoomedOut = scale !== 1; const prefersReducedMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const isAutoScaled = scale === 'auto-scaled'; // Track if the animation should start when the useEffect runs. const startAnimationRef = (0,external_wp_element_namespaceObject.useRef)(false); // Track the animation so we know if we have an animation running, // and can cancel it, reverse it, call a finish event, etc. const animationRef = (0,external_wp_element_namespaceObject.useRef)(null); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isZoomedOut) { initialContainerWidthRef.current = containerWidth; } }, [containerWidth, isZoomedOut]); const scaleContainerWidth = Math.max(initialContainerWidthRef.current, containerWidth); const scaleValue = isAutoScaled ? calculateScale({ frameSize, containerWidth, maxContainerWidth, scaleContainerWidth }) : scale; /** * The starting transition state for the zoom out animation. * @type {import('react').RefObject<TransitionState>} */ const transitionFromRef = (0,external_wp_element_namespaceObject.useRef)({ scaleValue, frameSize, containerHeight: 0, scrollTop: 0, scrollHeight: 0 }); /** * The ending transition state for the zoom out animation. * @type {import('react').RefObject<TransitionState>} */ const transitionToRef = (0,external_wp_element_namespaceObject.useRef)({ scaleValue, frameSize, containerHeight: 0, scrollTop: 0, scrollHeight: 0 }); /** * Start the zoom out animation. This sets the necessary CSS variables * for animating the canvas and returns the Animation object. * * @return {Animation} The animation object for the zoom out animation. */ const startZoomOutAnimation = (0,external_wp_element_namespaceObject.useCallback)(() => { const { scrollTop } = transitionFromRef.current; const { scrollTop: scrollTopNext } = transitionToRef.current; iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scroll-top', `${scrollTop}px`); iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scroll-top-next', `${scrollTopNext}px`); // If the container has a scrolllbar, force a scrollbar to prevent the content from shifting while animating. iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-overflow-behavior', transitionFromRef.current.scrollHeight === transitionFromRef.current.containerHeight ? 'auto' : 'scroll'); iframeDocument.documentElement.classList.add('zoom-out-animation'); return iframeDocument.documentElement.animate(getAnimationKeyframes(transitionFromRef.current, transitionToRef.current), { easing: 'cubic-bezier(0.46, 0.03, 0.52, 0.96)', duration: 400 }); }, [iframeDocument]); /** * Callback when the zoom out animation is finished. * - Cleans up animations refs. * - Adds final CSS vars for scale and frame size to preserve the state. * - Removes the 'zoom-out-animation' class (which has the fixed positioning). * - Sets the final scroll position after the canvas is no longer in fixed position. * - Removes CSS vars related to the animation. * - Sets the transitionFrom to the transitionTo state to be ready for the next animation. */ const finishZoomOutAnimation = (0,external_wp_element_namespaceObject.useCallback)(() => { startAnimationRef.current = false; animationRef.current = null; // Add our final scale and frame size now that the animation is done. iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale', transitionToRef.current.scaleValue); iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-frame-size', `${transitionToRef.current.frameSize}px`); iframeDocument.documentElement.classList.remove('zoom-out-animation'); // Set the final scroll position that was just animated to. // Disable reason: Eslint isn't smart enough to know that this is a // DOM element. https://github.com/facebook/react/issues/31483 // eslint-disable-next-line react-compiler/react-compiler iframeDocument.documentElement.scrollTop = transitionToRef.current.scrollTop; iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-scroll-top'); iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-scroll-top-next'); iframeDocument.documentElement.style.removeProperty('--wp-block-editor-iframe-zoom-out-overflow-behavior'); // Update previous values. transitionFromRef.current = transitionToRef.current; }, [iframeDocument]); const previousIsZoomedOut = (0,external_wp_element_namespaceObject.useRef)(false); /** * Runs when zoom out mode is toggled, and sets the startAnimation flag * so the animation will start when the next useEffect runs. We _only_ * want to animate when the zoom out mode is toggled, not when the scale * changes due to the container resizing. */ (0,external_wp_element_namespaceObject.useEffect)(() => { const trigger = iframeDocument && previousIsZoomedOut.current !== isZoomedOut; previousIsZoomedOut.current = isZoomedOut; if (!trigger) { return; } startAnimationRef.current = true; if (!isZoomedOut) { return; } iframeDocument.documentElement.classList.add('is-zoomed-out'); return () => { iframeDocument.documentElement.classList.remove('is-zoomed-out'); }; }, [iframeDocument, isZoomedOut]); /** * This handles: * 1. Setting the correct scale and vars of the canvas when zoomed out * 2. If zoom out mode has been toggled, runs the animation of zooming in/out */ (0,external_wp_element_namespaceObject.useEffect)(() => { if (!iframeDocument) { return; } // We need to update the appropriate scale to exit from. If sidebars have been opened since setting the // original scale, we will snap to a much smaller scale due to the scale container immediately changing sizes when exiting. if (isAutoScaled && transitionFromRef.current.scaleValue !== 1) { // We use containerWidth as the divisor, as scaleContainerWidth will always match the containerWidth when // exiting. transitionFromRef.current.scaleValue = calculateScale({ frameSize: transitionFromRef.current.frameSize, containerWidth, maxContainerWidth, scaleContainerWidth: containerWidth }); } if (scaleValue < 1) { // If we are not going to animate the transition, set the scale and frame size directly. // If we are animating, these values will be set when the animation is finished. // Example: Opening sidebars that reduce the scale of the canvas, but we don't want to // animate the transition. if (!startAnimationRef.current) { iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale', scaleValue); iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-frame-size', `${frameSize}px`); } iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-content-height', `${contentHeight}px`); iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-inner-height', `${containerHeight}px`); iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-container-width', `${containerWidth}px`); iframeDocument.documentElement.style.setProperty('--wp-block-editor-iframe-zoom-out-scale-container-width', `${scaleContainerWidth}px`); } /** * Handle the zoom out animation: * * - Get the current scrollTop position. * - Calculate where the same scroll position is after scaling. * - Apply fixed positioning to the canvas with a transform offset * to keep the canvas centered. * - Animate the scale and padding to the new scale and frame size. * - After the animation is complete, remove the fixed positioning * and set the scroll position that keeps everything centered. */ if (startAnimationRef.current) { // Don't allow a new transition to start again unless it was started by the zoom out mode changing. startAnimationRef.current = false; /** * If we already have an animation running, reverse it. */ if (animationRef.current) { animationRef.current.reverse(); // Swap the transition to/from refs so that we set the correct values when // finishZoomOutAnimation runs. const tempTransitionFrom = transitionFromRef.current; const tempTransitionTo = transitionToRef.current; transitionFromRef.current = tempTransitionTo; transitionToRef.current = tempTransitionFrom; } else { /** * Start a new zoom animation. */ // We can't trust the set value from contentHeight, as it was measured // before the zoom out mode was changed. After zoom out mode is changed, // appenders may appear or disappear, so we need to get the height from // the iframe at this point when we're about to animate the zoom out. // The iframe scrollTop, scrollHeight, and clientHeight will all be // the most accurate. transitionFromRef.current.scrollTop = iframeDocument.documentElement.scrollTop; transitionFromRef.current.scrollHeight = iframeDocument.documentElement.scrollHeight; // Use containerHeight, as it's the previous container height before the zoom out animation starts. transitionFromRef.current.containerHeight = containerHeight; transitionToRef.current = { scaleValue, frameSize, containerHeight: iframeDocument.documentElement.clientHeight // use clientHeight to get the actual height of the new container after zoom state changes have rendered, as it will be the most up-to-date. }; transitionToRef.current.scrollHeight = computeScrollHeightNext(transitionFromRef.current, transitionToRef.current); transitionToRef.current.scrollTop = computeScrollTopNext(transitionFromRef.current, transitionToRef.current); animationRef.current = startZoomOutAnimation(); // If the user prefers reduced motion, finish the animation immediately and set the final state. if (prefersReducedMotion) { finishZoomOutAnimation(); } else { animationRef.current.onfinish = finishZoomOutAnimation; } } } }, [startZoomOutAnimation, finishZoomOutAnimation, prefersReducedMotion, isAutoScaled, scaleValue, frameSize, iframeDocument, contentHeight, containerWidth, containerHeight, maxContainerWidth, scaleContainerWidth]); return { isZoomedOut, scaleContainerWidth, contentResizeListener, containerResizeListener }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/iframe/index.js /* wp:polyfill */ /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function bubbleEvent(event, Constructor, frame) { const init = {}; for (const key in event) { init[key] = event[key]; } // Check if the event is a MouseEvent generated within the iframe. // If so, adjust the coordinates to be relative to the position of // the iframe. This ensures that components such as Draggable // receive coordinates relative to the window, instead of relative // to the iframe. Without this, the Draggable event handler would // result in components "jumping" position as soon as the user // drags over the iframe. if (event instanceof frame.contentDocument.defaultView.MouseEvent) { const rect = frame.getBoundingClientRect(); init.clientX += rect.left; init.clientY += rect.top; } const newEvent = new Constructor(event.type, init); if (init.defaultPrevented) { newEvent.preventDefault(); } const cancelled = !frame.dispatchEvent(newEvent); if (cancelled) { event.preventDefault(); } } /** * Bubbles some event types (keydown, keypress, and dragover) to parent document * document to ensure that the keyboard shortcuts and drag and drop work. * * Ideally, we should remove event bubbling in the future. Keyboard shortcuts * should be context dependent, e.g. actions on blocks like Cmd+A should not * work globally outside the block editor. * * @param {Document} iframeDocument Document to attach listeners to. */ function useBubbleEvents(iframeDocument) { return (0,external_wp_compose_namespaceObject.useRefEffect)(() => { const { defaultView } = iframeDocument; if (!defaultView) { return; } const { frameElement } = defaultView; const html = iframeDocument.documentElement; const eventTypes = ['dragover', 'mousemove']; const handlers = {}; for (const name of eventTypes) { handlers[name] = event => { const prototype = Object.getPrototypeOf(event); const constructorName = prototype.constructor.name; const Constructor = window[constructorName]; bubbleEvent(event, Constructor, frameElement); }; html.addEventListener(name, handlers[name]); } return () => { for (const name of eventTypes) { html.removeEventListener(name, handlers[name]); } }; }); } function Iframe({ contentRef, children, tabIndex = 0, scale = 1, frameSize = 0, readonly, forwardedRef: ref, title = (0,external_wp_i18n_namespaceObject.__)('Editor canvas'), ...props }) { const { resolvedAssets, isPreviewMode } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(store); const settings = getSettings(); return { resolvedAssets: settings.__unstableResolvedAssets, isPreviewMode: settings.isPreviewMode }; }, []); const { styles = '', scripts = '' } = resolvedAssets; /** @type {[Document, import('react').Dispatch<Document>]} */ const [iframeDocument, setIframeDocument] = (0,external_wp_element_namespaceObject.useState)(); const [bodyClasses, setBodyClasses] = (0,external_wp_element_namespaceObject.useState)([]); const clearerRef = useBlockSelectionClearer(); const [before, writingFlowRef, after] = useWritingFlow(); const setRef = (0,external_wp_compose_namespaceObject.useRefEffect)(node => { node._load = () => { setIframeDocument(node.contentDocument); }; let iFrameDocument; // Prevent the default browser action for files dropped outside of dropzones. function preventFileDropDefault(event) { event.preventDefault(); } const { ownerDocument } = node; // Ideally ALL classes that are added through get_body_class should // be added in the editor too, which we'll somehow have to get from // the server in the future (which will run the PHP filters). setBodyClasses(Array.from(ownerDocument.body.classList).filter(name => name.startsWith('admin-color-') || name.startsWith('post-type-') || name === 'wp-embed-responsive')); function onLoad() { const { contentDocument } = node; const { documentElement } = contentDocument; iFrameDocument = contentDocument; documentElement.classList.add('block-editor-iframe__html'); clearerRef(documentElement); contentDocument.dir = ownerDocument.dir; for (const compatStyle of getCompatibilityStyles()) { if (contentDocument.getElementById(compatStyle.id)) { continue; } contentDocument.head.appendChild(compatStyle.cloneNode(true)); if (!isPreviewMode) { // eslint-disable-next-line no-console console.warn(`${compatStyle.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`, compatStyle); } } iFrameDocument.addEventListener('dragover', preventFileDropDefault, false); iFrameDocument.addEventListener('drop', preventFileDropDefault, false); // Prevent clicks on links from navigating away. Note that links // inside `contenteditable` are already disabled by the browser, so // this is for links in blocks outside of `contenteditable`. iFrameDocument.addEventListener('click', event => { if (event.target.tagName === 'A') { event.preventDefault(); // Appending a hash to the current URL will not reload the // page. This is useful for e.g. footnotes. const href = event.target.getAttribute('href'); if (href?.startsWith('#')) { iFrameDocument.defaultView.location.hash = href.slice(1); } } }); } node.addEventListener('load', onLoad); return () => { delete node._load; node.removeEventListener('load', onLoad); iFrameDocument?.removeEventListener('dragover', preventFileDropDefault); iFrameDocument?.removeEventListener('drop', preventFileDropDefault); }; }, []); const { contentResizeListener, containerResizeListener, isZoomedOut, scaleContainerWidth } = useScaleCanvas({ scale, frameSize: parseInt(frameSize), iframeDocument }); const disabledRef = (0,external_wp_compose_namespaceObject.useDisabled)({ isDisabled: !readonly }); const bodyRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([useBubbleEvents(iframeDocument), contentRef, clearerRef, writingFlowRef, disabledRef]); // Correct doctype is required to enable rendering in standards // mode. Also preload the styles to avoid a flash of unstyled // content. const html = `<!doctype html> <html> <head> <meta charset="utf-8"> <base href="${window.location.origin}"> <script>window.frameElement._load()</script> <style> html{ height: auto !important; min-height: 100%; } /* Lowest specificity to not override global styles */ :where(body) { margin: 0; /* Default background color in case zoom out mode background colors the html element */ background-color: white; } </style> ${styles} ${scripts} </head> <body> <script>document.currentScript.parentElement.remove()</script> </body> </html>`; const [src, cleanup] = (0,external_wp_element_namespaceObject.useMemo)(() => { const _src = URL.createObjectURL(new window.Blob([html], { type: 'text/html' })); return [_src, () => URL.revokeObjectURL(_src)]; }, [html]); (0,external_wp_element_namespaceObject.useEffect)(() => cleanup, [cleanup]); // Make sure to not render the before and after focusable div elements in view // mode. They're only needed to capture focus in edit mode. const shouldRenderFocusCaptureElements = tabIndex >= 0 && !isPreviewMode; const iframe = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [shouldRenderFocusCaptureElements && before, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", { ...props, style: { ...props.style, height: props.style?.height, border: 0 }, ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, setRef]), tabIndex: tabIndex // Correct doctype is required to enable rendering in standards // mode. Also preload the styles to avoid a flash of unstyled // content. , src: src, title: title, onKeyDown: event => { if (props.onKeyDown) { props.onKeyDown(event); } // If the event originates from inside the iframe, it means // it bubbled through the portal, but only with React // events. We need to to bubble native events as well, // though by doing so we also trigger another React event, // so we need to stop the propagation of this event to avoid // duplication. if (event.currentTarget.ownerDocument !== event.target.ownerDocument) { // We should only stop propagation of the React event, // the native event should further bubble inside the // iframe to the document and window. // Alternatively, we could consider redispatching the // native event in the iframe. const { stopPropagation } = event.nativeEvent; event.nativeEvent.stopPropagation = () => {}; event.stopPropagation(); event.nativeEvent.stopPropagation = stopPropagation; bubbleEvent(event, window.KeyboardEvent, event.currentTarget); } }, children: iframeDocument && (0,external_wp_element_namespaceObject.createPortal)( /*#__PURE__*/ // We want to prevent React events from bubbling through the iframe // we bubble these manually. /* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)("body", { ref: bodyRef, className: dist_clsx('block-editor-iframe__body', 'editor-styles-wrapper', ...bodyClasses), children: [contentResizeListener, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalStyleProvider, { document: iframeDocument, children: children })] }), iframeDocument.documentElement) }), shouldRenderFocusCaptureElements && after] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-iframe__container", children: [containerResizeListener, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('block-editor-iframe__scale-container', isZoomedOut && 'is-zoomed-out'), style: { '--wp-block-editor-iframe-zoom-out-scale-container-width': isZoomedOut && `${scaleContainerWidth}px` }, children: iframe })] }); } function IframeIfReady(props, ref) { const isInitialised = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().__internalIsInitialized, []); // We shouldn't render the iframe until the editor settings are initialised. // The initial settings are needed to get the styles for the srcDoc, which // cannot be changed after the iframe is mounted. srcDoc is used to to set // the initial iframe HTML, which is required to avoid a flash of unstyled // content. if (!isInitialised) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Iframe, { ...props, forwardedRef: ref }); } /* harmony default export */ const iframe = ((0,external_wp_element_namespaceObject.forwardRef)(IframeIfReady)); ;// ./node_modules/parsel-js/dist/parsel.js const TOKENS = { attribute: /\[\s*(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)\s*(?:(?<operator>\W?=)\s*(?<value>.+?)\s*(\s(?<caseSensitive>[iIsS]))?\s*)?\]/gu, id: /#(?<name>[-\w\P{ASCII}]+)/gu, class: /\.(?<name>[-\w\P{ASCII}]+)/gu, comma: /\s*,\s*/g, combinator: /\s*[\s>+~]\s*/g, 'pseudo-element': /::(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu, 'pseudo-class': /:(?<name>[-\w\P{ASCII}]+)(?:\((?<argument>¶*)\))?/gu, universal: /(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?\*/gu, type: /(?:(?<namespace>\*|[-\w\P{ASCII}]*)\|)?(?<name>[-\w\P{ASCII}]+)/gu, // this must be last }; const TRIM_TOKENS = new Set(['combinator', 'comma']); const RECURSIVE_PSEUDO_CLASSES = new Set([ 'not', 'is', 'where', 'has', 'matches', '-moz-any', '-webkit-any', 'nth-child', 'nth-last-child', ]); const nthChildRegExp = /(?<index>[\dn+-]+)\s+of\s+(?<subtree>.+)/; const RECURSIVE_PSEUDO_CLASSES_ARGS = { 'nth-child': nthChildRegExp, 'nth-last-child': nthChildRegExp, }; const getArgumentPatternByType = (type) => { switch (type) { case 'pseudo-element': case 'pseudo-class': return new RegExp(TOKENS[type].source.replace('(?<argument>¶*)', '(?<argument>.*)'), 'gu'); default: return TOKENS[type]; } }; function gobbleParens(text, offset) { let nesting = 0; let result = ''; for (; offset < text.length; offset++) { const char = text[offset]; switch (char) { case '(': ++nesting; break; case ')': --nesting; break; } result += char; if (nesting === 0) { return result; } } return result; } function tokenizeBy(text, grammar = TOKENS) { if (!text) { return []; } const tokens = [text]; for (const [type, pattern] of Object.entries(grammar)) { for (let i = 0; i < tokens.length; i++) { const token = tokens[i]; if (typeof token !== 'string') { continue; } pattern.lastIndex = 0; const match = pattern.exec(token); if (!match) { continue; } const from = match.index - 1; const args = []; const content = match[0]; const before = token.slice(0, from + 1); if (before) { args.push(before); } args.push({ ...match.groups, type, content, }); const after = token.slice(from + content.length + 1); if (after) { args.push(after); } tokens.splice(i, 1, ...args); } } let offset = 0; for (const token of tokens) { switch (typeof token) { case 'string': throw new Error(`Unexpected sequence ${token} found at index ${offset}`); case 'object': offset += token.content.length; token.pos = [offset - token.content.length, offset]; if (TRIM_TOKENS.has(token.type)) { token.content = token.content.trim() || ' '; } break; } } return tokens; } const STRING_PATTERN = /(['"])([^\\\n]+?)\1/g; const ESCAPE_PATTERN = /\\./g; function parsel_tokenize(selector, grammar = TOKENS) { // Prevent leading/trailing whitespaces from being interpreted as combinators selector = selector.trim(); if (selector === '') { return []; } const replacements = []; // Replace escapes with placeholders. selector = selector.replace(ESCAPE_PATTERN, (value, offset) => { replacements.push({ value, offset }); return '\uE000'.repeat(value.length); }); // Replace strings with placeholders. selector = selector.replace(STRING_PATTERN, (value, quote, content, offset) => { replacements.push({ value, offset }); return `${quote}${'\uE001'.repeat(content.length)}${quote}`; }); // Replace parentheses with placeholders. { let pos = 0; let offset; while ((offset = selector.indexOf('(', pos)) > -1) { const value = gobbleParens(selector, offset); replacements.push({ value, offset }); selector = `${selector.substring(0, offset)}(${'¶'.repeat(value.length - 2)})${selector.substring(offset + value.length)}`; pos = offset + value.length; } } // Now we have no nested structures and we can parse with regexes const tokens = tokenizeBy(selector, grammar); // Replace placeholders in reverse order. const changedTokens = new Set(); for (const replacement of replacements.reverse()) { for (const token of tokens) { const { offset, value } = replacement; if (!(token.pos[0] <= offset && offset + value.length <= token.pos[1])) { continue; } const { content } = token; const tokenOffset = offset - token.pos[0]; token.content = content.slice(0, tokenOffset) + value + content.slice(tokenOffset + value.length); if (token.content !== content) { changedTokens.add(token); } } } // Update changed tokens. for (const token of changedTokens) { const pattern = getArgumentPatternByType(token.type); if (!pattern) { throw new Error(`Unknown token type: ${token.type}`); } pattern.lastIndex = 0; const match = pattern.exec(token.content); if (!match) { throw new Error(`Unable to parse content for ${token.type}: ${token.content}`); } Object.assign(token, match.groups); } return tokens; } /** * Convert a flat list of tokens into a tree of complex & compound selectors */ function nestTokens(tokens, { list = true } = {}) { if (list && tokens.find((t) => t.type === 'comma')) { const selectors = []; const temp = []; for (let i = 0; i < tokens.length; i++) { if (tokens[i].type === 'comma') { if (temp.length === 0) { throw new Error('Incorrect comma at ' + i); } selectors.push(nestTokens(temp, { list: false })); temp.length = 0; } else { temp.push(tokens[i]); } } if (temp.length === 0) { throw new Error('Trailing comma'); } else { selectors.push(nestTokens(temp, { list: false })); } return { type: 'list', list: selectors }; } for (let i = tokens.length - 1; i >= 0; i--) { let token = tokens[i]; if (token.type === 'combinator') { let left = tokens.slice(0, i); let right = tokens.slice(i + 1); return { type: 'complex', combinator: token.content, left: nestTokens(left), right: nestTokens(right), }; } } switch (tokens.length) { case 0: throw new Error('Could not build AST.'); case 1: // If we're here, there are no combinators, so it's just a list. return tokens[0]; default: return { type: 'compound', list: [...tokens], // clone to avoid pointers messing up the AST }; } } /** * Traverse an AST in depth-first order */ function* flatten(node, /** * @internal */ parent) { switch (node.type) { case 'list': for (let child of node.list) { yield* flatten(child, node); } break; case 'complex': yield* flatten(node.left, node); yield* flatten(node.right, node); break; case 'compound': yield* node.list.map((token) => [token, node]); break; default: yield [node, parent]; } } /** * Traverse an AST (or part thereof), in depth-first order */ function walk(node, visit, /** * @internal */ parent) { if (!node) { return; } for (const [token, ast] of flatten(node, parent)) { visit(token, ast); } } /** * Parse a CSS selector * * @param selector - The selector to parse * @param options.recursive - Whether to parse the arguments of pseudo-classes like :is(), :has() etc. Defaults to true. * @param options.list - Whether this can be a selector list (A, B, C etc). Defaults to true. */ function parse(selector, { recursive = true, list = true } = {}) { const tokens = parsel_tokenize(selector); if (!tokens) { return; } const ast = nestTokens(tokens, { list }); if (!recursive) { return ast; } for (const [token] of flatten(ast)) { if (token.type !== 'pseudo-class' || !token.argument) { continue; } if (!RECURSIVE_PSEUDO_CLASSES.has(token.name)) { continue; } let argument = token.argument; const childArg = RECURSIVE_PSEUDO_CLASSES_ARGS[token.name]; if (childArg) { const match = childArg.exec(argument); if (!match) { continue; } Object.assign(token, match.groups); argument = match.groups['subtree']; } if (!argument) { continue; } Object.assign(token, { subtree: parse(argument, { recursive: true, list: true, }), }); } return ast; } /** * Converts the given list or (sub)tree to a string. */ function parsel_stringify(listOrNode) { let tokens; if (Array.isArray(listOrNode)) { tokens = listOrNode; } else { tokens = [...flatten(listOrNode)].map(([token]) => token); } return tokens.map(token => token.content).join(''); } /** * To convert the specificity array to a number */ function specificityToNumber(specificity, base) { base = base || Math.max(...specificity) + 1; return (specificity[0] * (base << 1) + specificity[1] * base + specificity[2]); } /** * Calculate specificity of a selector. * * If the selector is a list, the max specificity is returned. */ function specificity(selector) { let ast = selector; if (typeof ast === 'string') { ast = parse(ast, { recursive: true }); } if (!ast) { return []; } if (ast.type === 'list' && 'list' in ast) { let base = 10; const specificities = ast.list.map((ast) => { const sp = specificity(ast); base = Math.max(base, ...specificity(ast)); return sp; }); const numbers = specificities.map((ast) => specificityToNumber(ast, base)); return specificities[numbers.indexOf(Math.max(...numbers))]; } const ret = [0, 0, 0]; for (const [token] of flatten(ast)) { switch (token.type) { case 'id': ret[0]++; break; case 'class': case 'attribute': ret[1]++; break; case 'pseudo-element': case 'type': ret[2]++; break; case 'pseudo-class': if (token.name === 'where') { break; } if (!RECURSIVE_PSEUDO_CLASSES.has(token.name) || !token.subtree) { ret[1]++; break; } const sub = specificity(token.subtree); sub.forEach((s, i) => (ret[i] += s)); // :nth-child() & :nth-last-child() add (0, 1, 0) to the specificity of their most complex selector if (token.name === 'nth-child' || token.name === 'nth-last-child') { ret[1]++; } } } return ret; } // EXTERNAL MODULE: ./node_modules/postcss/lib/processor.js var processor = __webpack_require__(9656); var processor_default = /*#__PURE__*/__webpack_require__.n(processor); // EXTERNAL MODULE: ./node_modules/postcss/lib/css-syntax-error.js var css_syntax_error = __webpack_require__(356); var css_syntax_error_default = /*#__PURE__*/__webpack_require__.n(css_syntax_error); // EXTERNAL MODULE: ./node_modules/postcss-prefix-selector/index.js var postcss_prefix_selector = __webpack_require__(1443); var postcss_prefix_selector_default = /*#__PURE__*/__webpack_require__.n(postcss_prefix_selector); // EXTERNAL MODULE: ./node_modules/postcss-urlrebase/index.js var postcss_urlrebase = __webpack_require__(5404); var postcss_urlrebase_default = /*#__PURE__*/__webpack_require__.n(postcss_urlrebase); ;// ./node_modules/@wordpress/block-editor/build-module/utils/transform-styles/index.js /** * External dependencies */ const cacheByWrapperSelector = new Map(); const ROOT_SELECTOR_TOKENS = [{ type: 'type', content: 'body' }, { type: 'type', content: 'html' }, { type: 'pseudo-class', content: ':root' }, { type: 'pseudo-class', content: ':where(body)' }, { type: 'pseudo-class', content: ':where(:root)' }, { type: 'pseudo-class', content: ':where(html)' }]; /** * Prefixes root selectors in a way that ensures consistent specificity. * This requires special handling, since prefixing a classname before * html, body, or :root will generally result in an invalid selector. * * Some libraries will simply replace the root selector with the prefix * instead, but this results in inconsistent specificity. * * This function instead inserts the prefix after the root tags but before * any other part of the selector. This results in consistent specificity: * - If a `:where()` selector is used for the prefix, all selectors output * by `transformStyles` will have no specificity increase. * - If a classname, id, or something else is used as the prefix, all selectors * will have the same specificity bump when transformed. * * @param {string} prefix The prefix. * @param {string} selector The selector. * * @return {string} The prefixed root selector. */ function prefixRootSelector(prefix, selector) { // Use a tokenizer, since regular expressions are unreliable. const tokenized = parsel_tokenize(selector); // Find the last token that contains a root selector by walking back // through the tokens. const lastRootIndex = tokenized.findLastIndex(({ content, type }) => { return ROOT_SELECTOR_TOKENS.some(rootSelector => content === rootSelector.content && type === rootSelector.type); }); // Walk forwards to find the combinator after the last root. // This is where the root ends and the rest of the selector begins, // and the index to insert before. // Doing it this way takes into account that a root selector like // 'body' may have additional id/class/pseudo-class/attribute-selector // parts chained to it, which is difficult to quantify using a regex. let insertionPoint = -1; for (let i = lastRootIndex + 1; i < tokenized.length; i++) { if (tokenized[i].type === 'combinator') { insertionPoint = i; break; } } // Tokenize and insert the prefix with a ' ' combinator before it. const tokenizedPrefix = parsel_tokenize(prefix); tokenized.splice( // Insert at the insertion point, or the end. insertionPoint === -1 ? tokenized.length : insertionPoint, 0, { type: 'combinator', content: ' ' }, ...tokenizedPrefix); return parsel_stringify(tokenized); } function transformStyle({ css, ignoredSelectors = [], baseURL }, wrapperSelector = '', transformOptions) { // When there is no wrapper selector and no base URL, there is no need // to transform the CSS. This is most cases because in the default // iframed editor, no wrapping is needed, and not many styles // provide a base URL. if (!wrapperSelector && !baseURL) { return css; } try { var _transformOptions$ign; const excludedSelectors = [...ignoredSelectors, ...((_transformOptions$ign = transformOptions?.ignoredSelectors) !== null && _transformOptions$ign !== void 0 ? _transformOptions$ign : []), wrapperSelector]; return new (processor_default())([wrapperSelector && postcss_prefix_selector_default()({ prefix: wrapperSelector, transform(prefix, selector, prefixedSelector) { // For backwards compatibility, don't use the `exclude` option // of postcss-prefix-selector, instead handle it here to match // the behavior of the old library (postcss-prefix-wrap) that // `transformStyle` previously used. if (excludedSelectors.some(excludedSelector => excludedSelector instanceof RegExp ? selector.match(excludedSelector) : selector.includes(excludedSelector))) { return selector; } const hasRootSelector = ROOT_SELECTOR_TOKENS.some(rootSelector => selector.startsWith(rootSelector.content)); // Reorganize root selectors such that the root part comes before the prefix, // but the prefix still comes before the remaining part of the selector. if (hasRootSelector) { return prefixRootSelector(prefix, selector); } return prefixedSelector; } }), baseURL && postcss_urlrebase_default()({ rootUrl: baseURL })].filter(Boolean)).process(css, {}).css; // use sync PostCSS API } catch (error) { if (error instanceof (css_syntax_error_default())) { // eslint-disable-next-line no-console console.warn('wp.blockEditor.transformStyles Failed to transform CSS.', error.message + '\n' + error.showSourceCode(false)); } else { // eslint-disable-next-line no-console console.warn('wp.blockEditor.transformStyles Failed to transform CSS.', error); } return null; } } /** * @typedef {Object} EditorStyle * @property {string} css the CSS block(s), as a single string. * @property {?string} baseURL the base URL to be used as the reference when rewriting urls. * @property {?string[]} ignoredSelectors the selectors not to wrap. */ /** * @typedef {Object} TransformOptions * @property {?string[]} ignoredSelectors the selectors not to wrap. */ /** * Applies a series of CSS rule transforms to wrap selectors inside a given class and/or rewrite URLs depending on the parameters passed. * * @param {EditorStyle[]} styles CSS rules. * @param {string} wrapperSelector Wrapper selector. * @param {TransformOptions} transformOptions Additional options for style transformation. * @return {Array} converted rules. */ const transform_styles_transformStyles = (styles, wrapperSelector = '', transformOptions) => { let cache = cacheByWrapperSelector.get(wrapperSelector); if (!cache) { cache = new WeakMap(); cacheByWrapperSelector.set(wrapperSelector, cache); } return styles.map(style => { let css = cache.get(style); if (!css) { css = transformStyle(style, wrapperSelector, transformOptions); cache.set(style, css); } return css; }); }; /* harmony default export */ const transform_styles = (transform_styles_transformStyles); ;// ./node_modules/@wordpress/block-editor/build-module/components/editor-styles/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ k([names, a11y]); function useDarkThemeBodyClassName(styles, scope) { return (0,external_wp_element_namespaceObject.useCallback)(node => { if (!node) { return; } const { ownerDocument } = node; const { defaultView, body } = ownerDocument; const canvas = scope ? ownerDocument.querySelector(scope) : body; let backgroundColor; if (!canvas) { // The real .editor-styles-wrapper element might not exist in the // DOM, so calculate the background color by creating a fake // wrapper. const tempCanvas = ownerDocument.createElement('div'); tempCanvas.classList.add('editor-styles-wrapper'); body.appendChild(tempCanvas); backgroundColor = defaultView?.getComputedStyle(tempCanvas, null).getPropertyValue('background-color'); body.removeChild(tempCanvas); } else { backgroundColor = defaultView?.getComputedStyle(canvas, null).getPropertyValue('background-color'); } const colordBackgroundColor = w(backgroundColor); // If background is transparent, it should be treated as light color. if (colordBackgroundColor.luminance() > 0.5 || colordBackgroundColor.alpha() === 0) { body.classList.remove('is-dark-theme'); } else { body.classList.add('is-dark-theme'); } }, [styles, scope]); } function EditorStyles({ styles, scope, transformOptions }) { const overrides = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getStyleOverrides(), []); const [transformedStyles, transformedSvgs] = (0,external_wp_element_namespaceObject.useMemo)(() => { const _styles = Object.values(styles !== null && styles !== void 0 ? styles : []); for (const [id, override] of overrides) { const index = _styles.findIndex(({ id: _id }) => id === _id); const overrideWithId = { ...override, id }; if (index === -1) { _styles.push(overrideWithId); } else { _styles[index] = overrideWithId; } } return [transform_styles(_styles.filter(style => style?.css), scope, transformOptions), _styles.filter(style => style.__unstableType === 'svgs').map(style => style.assets).join('')]; }, [styles, overrides, scope, transformOptions]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("style", { ref: useDarkThemeBodyClassName(transformedStyles, scope) }), transformedStyles.map((css, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("style", { children: css }, index)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 0 0", width: "0", height: "0", role: "none", style: { visibility: 'hidden', position: 'absolute', left: '-9999px', overflow: 'hidden' }, dangerouslySetInnerHTML: { __html: transformedSvgs } })] }); } /* harmony default export */ const editor_styles = ((0,external_wp_element_namespaceObject.memo)(EditorStyles)); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-preview/auto.js /** * WordPress dependencies */ /** * Internal dependencies */ // This is used to avoid rendering the block list if the sizes change. const MemoizedBlockList = (0,external_wp_element_namespaceObject.memo)(BlockList); const MAX_HEIGHT = 2000; const EMPTY_ADDITIONAL_STYLES = []; function ScaledBlockPreview({ viewportWidth, containerWidth, minHeight, additionalStyles = EMPTY_ADDITIONAL_STYLES }) { if (!viewportWidth) { viewportWidth = containerWidth; } const [contentResizeListener, { height: contentHeight }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const { styles } = (0,external_wp_data_namespaceObject.useSelect)(select => { const settings = select(store).getSettings(); return { styles: settings.styles }; }, []); // Avoid scrollbars for pattern previews. const editorStyles = (0,external_wp_element_namespaceObject.useMemo)(() => { if (styles) { return [...styles, { css: 'body{height:auto;overflow:hidden;border:none;padding:0;}', __unstableType: 'presets' }, ...additionalStyles]; } return styles; }, [styles, additionalStyles]); const scale = containerWidth / viewportWidth; const aspectRatio = contentHeight ? containerWidth / (contentHeight * scale) : 0; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { className: "block-editor-block-preview__content", style: { transform: `scale(${scale})`, // Using width + aspect-ratio instead of height here triggers browsers' native // handling of scrollbar's visibility. It prevents the flickering issue seen // in https://github.com/WordPress/gutenberg/issues/52027. // See https://github.com/WordPress/gutenberg/pull/52921 for more info. aspectRatio, maxHeight: contentHeight > MAX_HEIGHT ? MAX_HEIGHT * scale : undefined, minHeight }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(iframe, { contentRef: (0,external_wp_compose_namespaceObject.useRefEffect)(bodyElement => { const { ownerDocument: { documentElement } } = bodyElement; documentElement.classList.add('block-editor-block-preview__content-iframe'); documentElement.style.position = 'absolute'; documentElement.style.width = '100%'; // Necessary for contentResizeListener to work. bodyElement.style.boxSizing = 'border-box'; bodyElement.style.position = 'absolute'; bodyElement.style.width = '100%'; }, []), "aria-hidden": true, tabIndex: -1, style: { position: 'absolute', width: viewportWidth, height: contentHeight, pointerEvents: 'none', // This is a catch-all max-height for patterns. // See: https://github.com/WordPress/gutenberg/pull/38175. maxHeight: MAX_HEIGHT, minHeight: scale !== 0 && scale < 1 && minHeight ? minHeight / scale : minHeight }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_styles, { styles: editorStyles }), contentResizeListener, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedBlockList, { renderAppender: false })] }) }); } function AutoBlockPreview(props) { const [containerResizeListener, { width: containerWidth }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { position: 'relative', width: '100%', height: 0 }, children: containerResizeListener }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-preview__container", children: !!containerWidth && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScaledBlockPreview, { ...props, containerWidth: containerWidth }) })] }); } ;// external ["wp","priorityQueue"] const external_wp_priorityQueue_namespaceObject = window["wp"]["priorityQueue"]; ;// ./node_modules/@wordpress/block-editor/build-module/components/block-preview/async.js /** * WordPress dependencies */ const blockPreviewQueue = (0,external_wp_priorityQueue_namespaceObject.createQueue)(); /** * Renders a component at the next idle time. * @param {*} props */ function Async({ children, placeholder }) { const [shouldRender, setShouldRender] = (0,external_wp_element_namespaceObject.useState)(false); // In the future, we could try to use startTransition here, but currently // react will batch all transitions, which means all previews will be // rendered at the same time. // https://react.dev/reference/react/startTransition#caveats // > If there are multiple ongoing Transitions, React currently batches them // > together. This is a limitation that will likely be removed in a future // > release. (0,external_wp_element_namespaceObject.useEffect)(() => { const context = {}; blockPreviewQueue.add(context, () => { // Synchronously run all renders so it consumes timeRemaining. // See https://github.com/WordPress/gutenberg/pull/48238 (0,external_wp_element_namespaceObject.flushSync)(() => { setShouldRender(true); }); }); return () => { blockPreviewQueue.cancel(context); }; }, []); if (!shouldRender) { return placeholder; } return children; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-preview/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const block_preview_EMPTY_ADDITIONAL_STYLES = []; function BlockPreview({ blocks, viewportWidth = 1200, minHeight, additionalStyles = block_preview_EMPTY_ADDITIONAL_STYLES, // Deprecated props: __experimentalMinHeight, __experimentalPadding }) { if (__experimentalMinHeight) { minHeight = __experimentalMinHeight; external_wp_deprecated_default()('The __experimentalMinHeight prop', { since: '6.2', version: '6.4', alternative: 'minHeight' }); } if (__experimentalPadding) { additionalStyles = [...additionalStyles, { css: `body { padding: ${__experimentalPadding}px; }` }]; external_wp_deprecated_default()('The __experimentalPadding prop of BlockPreview', { since: '6.2', version: '6.4', alternative: 'additionalStyles' }); } const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []); const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings, focusMode: false, // Disable "Spotlight mode". isPreviewMode: true }), [originalSettings]); const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => Array.isArray(blocks) ? blocks : [blocks], [blocks]); if (!blocks || blocks.length === 0) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockEditorProvider, { value: renderedBlocks, settings: settings, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AutoBlockPreview, { viewportWidth: viewportWidth, minHeight: minHeight, additionalStyles: additionalStyles }) }); } const MemoizedBlockPreview = (0,external_wp_element_namespaceObject.memo)(BlockPreview); MemoizedBlockPreview.Async = Async; /** * BlockPreview renders a preview of a block or array of blocks. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-preview/README.md * * @param {Object} preview options for how the preview should be shown * @param {Array|Object} preview.blocks A block instance (object) or an array of blocks to be previewed. * @param {number} preview.viewportWidth Width of the preview container in pixels. Controls at what size the blocks will be rendered inside the preview. Default: 700. * * @return {Component} The component to be rendered. */ /* harmony default export */ const block_preview = (MemoizedBlockPreview); /** * This hook is used to lightly mark an element as a block preview wrapper * element. Call this hook and pass the returned props to the element to mark as * a block preview wrapper, automatically rendering inner blocks as children. If * you define a ref for the element, it is important to pass the ref to this * hook, which the hook in turn will pass to the component through the props it * returns. Optionally, you can also pass any other props through this hook, and * they will be merged and returned. * * @param {Object} options Preview options. * @param {WPBlock[]} options.blocks Block objects. * @param {Object} options.props Optional. Props to pass to the element. Must contain * the ref if one is defined. * @param {Object} options.layout Layout settings to be used in the preview. */ function useBlockPreview({ blocks, props = {}, layout }) { const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []); const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...originalSettings, styles: undefined, // Clear styles included by the parent settings, as they are already output by the parent's EditorStyles. focusMode: false, // Disable "Spotlight mode". isPreviewMode: true }), [originalSettings]); const disabledRef = (0,external_wp_compose_namespaceObject.useDisabled)(); const ref = (0,external_wp_compose_namespaceObject.useMergeRefs)([props.ref, disabledRef]); const renderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => Array.isArray(blocks) ? blocks : [blocks], [blocks]); const children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ExperimentalBlockEditorProvider, { value: renderedBlocks, settings: settings, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_styles, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockListItems, { renderAppender: false, layout: layout })] }); return { ...props, ref, className: dist_clsx(props.className, 'block-editor-block-preview__live-content', 'components-disabled'), children: blocks?.length ? children : null }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/preview-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ function InserterPreviewPanel({ item }) { var _example$viewportWidt; const { name, title, icon, description, initialAttributes, example } = item; const isReusable = (0,external_wp_blocks_namespaceObject.isReusableBlock)(item); const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!example) { return (0,external_wp_blocks_namespaceObject.createBlock)(name, initialAttributes); } return (0,external_wp_blocks_namespaceObject.getBlockFromExample)(name, { attributes: { ...example.attributes, ...initialAttributes }, innerBlocks: example.innerBlocks }); }, [name, example, initialAttributes]); // Same as height of BlockPreviewPanel. const previewHeight = 144; const sidebarWidth = 280; const viewportWidth = (_example$viewportWidt = example?.viewportWidth) !== null && _example$viewportWidt !== void 0 ? _example$viewportWidt : 500; const scale = sidebarWidth / viewportWidth; const minHeight = scale !== 0 && scale < 1 && previewHeight ? previewHeight / scale : previewHeight; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-inserter__preview-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__preview", children: isReusable || example ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__preview-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview, { blocks: blocks, viewportWidth: viewportWidth, minHeight: previewHeight, additionalStyles: //We want this CSS to be in sync with the one in BlockPreviewPanel. [{ css: ` body { padding: 24px; min-height:${Math.round(minHeight)}px; display:flex; align-items:center; } .is-root-container { width: 100%; } ` }] }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__preview-content-missing", children: (0,external_wp_i18n_namespaceObject.__)('No preview available.') }) }), !isReusable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_card, { title: title, icon: icon, description: description })] }); } /* harmony default export */ const preview_panel = (InserterPreviewPanel); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/item.js /** * WordPress dependencies */ function InserterListboxItem({ isFirst, as: Component, children, ...props }, ref) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Item, { ref: ref, role: "option" // Use the Composite.Item `accessibleWhenDisabled` prop // over Button's `isFocusable`. The latter was shown to // cause an issue with tab order in the inserter list. , accessibleWhenDisabled: true, ...props, render: htmlProps => { const propsWithTabIndex = { ...htmlProps, tabIndex: isFirst ? 0 : htmlProps.tabIndex }; if (Component) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { ...propsWithTabIndex, children: children }); } if (typeof children === 'function') { return children(propsWithTabIndex); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ...propsWithTabIndex, children: children }); } }); } /* harmony default export */ const inserter_listbox_item = ((0,external_wp_element_namespaceObject.forwardRef)(InserterListboxItem)); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-draggable-blocks/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const InserterDraggableBlocks = ({ isEnabled, blocks, icon, children, pattern }) => { const blockTypeIcon = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockType } = select(external_wp_blocks_namespaceObject.store); return blocks.length === 1 && getBlockType(blocks[0].name)?.icon; }, [blocks]); const { startDragging, stopDragging } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const patternBlock = (0,external_wp_element_namespaceObject.useMemo)(() => { return pattern?.type === INSERTER_PATTERN_TYPES.user && pattern?.syncStatus !== 'unsynced' ? [(0,external_wp_blocks_namespaceObject.createBlock)('core/block', { ref: pattern.id })] : undefined; }, [pattern?.type, pattern?.syncStatus, pattern?.id]); if (!isEnabled) { return children({ draggable: false, onDragStart: undefined, onDragEnd: undefined }); } const draggableBlocks = patternBlock !== null && patternBlock !== void 0 ? patternBlock : blocks; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Draggable, { __experimentalTransferDataType: "wp-blocks", transferData: { type: 'inserter', blocks: draggableBlocks }, onDragStart: event => { startDragging(); for (const block of draggableBlocks) { const type = `wp-block:${block.name}`; // This will fill in the dataTransfer.types array so that // the drop zone can check if the draggable is eligible. // Unfortuantely, on drag start, we don't have access to the // actual data, only the data keys/types. event.dataTransfer.items.add('', type); } }, onDragEnd: () => { stopDragging(); }, __experimentalDragComponent: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockDraggableChip, { count: blocks.length, icon: icon || !pattern && blockTypeIcon, isPattern: !!pattern }), children: ({ onDraggableStart, onDraggableEnd }) => { return children({ draggable: true, onDragStart: onDraggableStart, onDragEnd: onDraggableEnd }); } }); }; /* harmony default export */ const inserter_draggable_blocks = (InserterDraggableBlocks); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-list-item/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function InserterListItem({ className, isFirst, item, onSelect, onHover, isDraggable, ...props }) { const isDraggingRef = (0,external_wp_element_namespaceObject.useRef)(false); const itemIconStyle = item.icon ? { backgroundColor: item.icon.background, color: item.icon.foreground } : {}; const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => [(0,external_wp_blocks_namespaceObject.createBlock)(item.name, item.initialAttributes, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(item.innerBlocks))], [item.name, item.initialAttributes, item.innerBlocks]); const isSynced = (0,external_wp_blocks_namespaceObject.isReusableBlock)(item) && item.syncStatus !== 'unsynced' || (0,external_wp_blocks_namespaceObject.isTemplatePart)(item); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_draggable_blocks, { isEnabled: isDraggable && !item.isDisabled, blocks: blocks, icon: item.icon, children: ({ draggable, onDragStart, onDragEnd }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('block-editor-block-types-list__list-item', { 'is-synced': isSynced }), draggable: draggable, onDragStart: event => { isDraggingRef.current = true; if (onDragStart) { onHover(null); onDragStart(event); } }, onDragEnd: event => { isDraggingRef.current = false; if (onDragEnd) { onDragEnd(event); } }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(inserter_listbox_item, { isFirst: isFirst, className: dist_clsx('block-editor-block-types-list__item', className), disabled: item.isDisabled, onClick: event => { event.preventDefault(); onSelect(item, (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? event.metaKey : event.ctrlKey); onHover(null); }, onKeyDown: event => { const { keyCode } = event; if (keyCode === external_wp_keycodes_namespaceObject.ENTER) { event.preventDefault(); onSelect(item, (0,external_wp_keycodes_namespaceObject.isAppleOS)() ? event.metaKey : event.ctrlKey); onHover(null); } }, onMouseEnter: () => { if (isDraggingRef.current) { return; } onHover(item); }, onMouseLeave: () => onHover(null), ...props, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-types-list__item-icon", style: itemIconStyle, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: item.icon, showColors: true }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-types-list__item-title", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 3, children: item.title }) })] }) }) }); } /* harmony default export */ const inserter_list_item = ((0,external_wp_element_namespaceObject.memo)(InserterListItem)); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/group.js /** * WordPress dependencies */ function InserterListboxGroup(props, ref) { const [shouldSpeak, setShouldSpeak] = (0,external_wp_element_namespaceObject.useState)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { if (shouldSpeak) { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Use left and right arrow keys to move through blocks')); } }, [shouldSpeak]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: ref, role: "listbox", "aria-orientation": "horizontal", onFocus: () => { setShouldSpeak(true); }, onBlur: event => { const focusingOutsideGroup = !event.currentTarget.contains(event.relatedTarget); if (focusingOutsideGroup) { setShouldSpeak(false); } }, ...props }); } /* harmony default export */ const group = ((0,external_wp_element_namespaceObject.forwardRef)(InserterListboxGroup)); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/row.js /** * WordPress dependencies */ function InserterListboxRow(props, ref) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Group, { role: "presentation", ref: ref, ...props }); } /* harmony default export */ const inserter_listbox_row = ((0,external_wp_element_namespaceObject.forwardRef)(InserterListboxRow)); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-types-list/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function chunk(array, size) { const chunks = []; for (let i = 0, j = array.length; i < j; i += size) { chunks.push(array.slice(i, i + size)); } return chunks; } function BlockTypesList({ items = [], onSelect, onHover = () => {}, children, label, isDraggable = true }) { const className = 'block-editor-block-types-list'; const listId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockTypesList, className); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(group, { className: className, "aria-label": label, children: [chunk(items, 3).map((row, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_listbox_row, { children: row.map((item, j) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_list_item, { item: item, className: (0,external_wp_blocks_namespaceObject.getBlockMenuDefaultClassName)(item.id), onSelect: onSelect, onHover: onHover, isDraggable: isDraggable && !item.isDisabled, isFirst: i === 0 && j === 0, rowId: `${listId}-${i}` }, item.id)) }, i)), children] }); } /* harmony default export */ const block_types_list = (BlockTypesList); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/panel.js /** * WordPress dependencies */ function InserterPanel({ title, icon, children }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-inserter__panel-header", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { className: "block-editor-inserter__panel-title", children: title }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: icon })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__panel-content", children: children })] }); } /* harmony default export */ const panel = (InserterPanel); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-block-types-state.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Retrieves the block types inserter state. * * @param {string=} rootClientId Insertion's root client ID. * @param {Function} onInsert function called when inserter a list of blocks. * @param {boolean} isQuick * @return {Array} Returns the block types state. (block types, categories, collections, onSelect handler) */ const useBlockTypesState = (rootClientId, onInsert, isQuick) => { const options = (0,external_wp_element_namespaceObject.useMemo)(() => ({ [isFiltered]: !!isQuick }), [isQuick]); const [items] = (0,external_wp_data_namespaceObject.useSelect)(select => [select(store).getInserterItems(rootClientId, options)], [rootClientId, options]); const { getClosestAllowedInsertionPoint } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const [categories, collections] = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCategories, getCollections } = select(external_wp_blocks_namespaceObject.store); return [getCategories(), getCollections()]; }, []); const onSelectItem = (0,external_wp_element_namespaceObject.useCallback)(({ name, initialAttributes, innerBlocks, syncStatus, content }, shouldFocusBlock) => { const destinationClientId = getClosestAllowedInsertionPoint(name, rootClientId); if (destinationClientId === null) { var _getBlockType$title; const title = (_getBlockType$title = (0,external_wp_blocks_namespaceObject.getBlockType)(name)?.title) !== null && _getBlockType$title !== void 0 ? _getBlockType$title : name; createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block pattern title. */ (0,external_wp_i18n_namespaceObject.__)('Block "%s" can\'t be inserted.'), title), { type: 'snackbar', id: 'inserter-notice' }); return; } const insertedBlock = syncStatus === 'unsynced' ? (0,external_wp_blocks_namespaceObject.parse)(content, { __unstableSkipMigrationLogs: true }) : (0,external_wp_blocks_namespaceObject.createBlock)(name, initialAttributes, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocks)); onInsert(insertedBlock, undefined, shouldFocusBlock, destinationClientId); }, [getClosestAllowedInsertionPoint, rootClientId, onInsert, createErrorNotice]); return [items, categories, collections, onSelectItem]; }; /* harmony default export */ const use_block_types_state = (useBlockTypesState); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-listbox/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function InserterListbox({ children }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { focusShift: true, focusWrap: "horizontal", render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, {}), children: children }); } /* harmony default export */ const inserter_listbox = (InserterListbox); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/no-results.js /** * WordPress dependencies */ function InserterNoResults() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__no-results", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('No results found.') }) }); } /* harmony default export */ const no_results = (InserterNoResults); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-types-tab.js /** * WordPress dependencies */ /** * Internal dependencies */ const getBlockNamespace = item => item.name.split('/')[0]; const MAX_SUGGESTED_ITEMS = 6; /** * Shared reference to an empty array for cases where it is important to avoid * returning a new array reference on every invocation and rerendering the component. * * @type {Array} */ const block_types_tab_EMPTY_ARRAY = []; function BlockTypesTabPanel({ items, collections, categories, onSelectItem, onHover, showMostUsedBlocks, className }) { const suggestedItems = (0,external_wp_element_namespaceObject.useMemo)(() => { return orderBy(items, 'frecency', 'desc').slice(0, MAX_SUGGESTED_ITEMS); }, [items]); const uncategorizedItems = (0,external_wp_element_namespaceObject.useMemo)(() => { return items.filter(item => !item.category); }, [items]); const itemsPerCollection = (0,external_wp_element_namespaceObject.useMemo)(() => { // Create a new Object to avoid mutating collection. const result = { ...collections }; Object.keys(collections).forEach(namespace => { result[namespace] = items.filter(item => getBlockNamespace(item) === namespace); if (result[namespace].length === 0) { delete result[namespace]; } }); return result; }, [items, collections]); // Hide block preview on unmount. (0,external_wp_element_namespaceObject.useEffect)(() => () => onHover(null), []); /** * The inserter contains a big number of blocks and opening it is a costful operation. * The rendering is the most costful part of it, in order to improve the responsiveness * of the "opening" action, these lazy lists allow us to render the inserter category per category, * once all the categories are rendered, we start rendering the collections and the uncategorized block types. */ const currentlyRenderedCategories = (0,external_wp_compose_namespaceObject.useAsyncList)(categories); const didRenderAllCategories = categories.length === currentlyRenderedCategories.length; // Async List requires an array. const collectionEntries = (0,external_wp_element_namespaceObject.useMemo)(() => { return Object.entries(collections); }, [collections]); const currentlyRenderedCollections = (0,external_wp_compose_namespaceObject.useAsyncList)(didRenderAllCategories ? collectionEntries : block_types_tab_EMPTY_ARRAY); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: className, children: [showMostUsedBlocks && // Only show the most used blocks if the total amount of block // is larger than 1 row, otherwise it is not so useful. items.length > 3 && !!suggestedItems.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, { title: (0,external_wp_i18n_namespaceObject._x)('Most used', 'blocks'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_types_list, { items: suggestedItems, onSelect: onSelectItem, onHover: onHover, label: (0,external_wp_i18n_namespaceObject._x)('Most used', 'blocks') }) }), currentlyRenderedCategories.map(category => { const categoryItems = items.filter(item => item.category === category.slug); if (!categoryItems || !categoryItems.length) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, { title: category.title, icon: category.icon, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_types_list, { items: categoryItems, onSelect: onSelectItem, onHover: onHover, label: category.title }) }, category.slug); }), didRenderAllCategories && uncategorizedItems.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, { className: "block-editor-inserter__uncategorized-blocks-panel", title: (0,external_wp_i18n_namespaceObject.__)('Uncategorized'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_types_list, { items: uncategorizedItems, onSelect: onSelectItem, onHover: onHover, label: (0,external_wp_i18n_namespaceObject.__)('Uncategorized') }) }), currentlyRenderedCollections.map(([namespace, collection]) => { const collectionItems = itemsPerCollection[namespace]; if (!collectionItems || !collectionItems.length) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, { title: collection.title, icon: collection.icon, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_types_list, { items: collectionItems, onSelect: onSelectItem, onHover: onHover, label: collection.title }) }, namespace); })] }); } function BlockTypesTab({ rootClientId, onInsert, onHover, showMostUsedBlocks }, ref) { const [items, categories, collections, onSelectItem] = use_block_types_state(rootClientId, onInsert); if (!items.length) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results, {}); } const itemsForCurrentRoot = []; const itemsRemaining = []; for (const item of items) { // Skip reusable blocks, they moved to the patterns tab. if (item.category === 'reusable') { continue; } if (item.isAllowedInCurrentRoot) { itemsForCurrentRoot.push(item); } else { itemsRemaining.push(item); } } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_listbox, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ref: ref, children: [!!itemsForCurrentRoot.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockTypesTabPanel, { items: itemsForCurrentRoot, categories: categories, collections: collections, onSelectItem: onSelectItem, onHover: onHover, showMostUsedBlocks: showMostUsedBlocks, className: "block-editor-inserter__insertable-blocks-at-selection" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockTypesTabPanel, { items: itemsRemaining, categories: categories, collections: collections, onSelectItem: onSelectItem, onHover: onHover, showMostUsedBlocks: showMostUsedBlocks, className: "block-editor-inserter__all-blocks" })] }) }); } /* harmony default export */ const block_types_tab = ((0,external_wp_element_namespaceObject.forwardRef)(BlockTypesTab)); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/pattern-explorer-sidebar.js /** * WordPress dependencies */ function PatternCategoriesList({ selectedCategory, patternCategories, onClickCategory }) { const baseClassName = 'block-editor-block-patterns-explorer__sidebar'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${baseClassName}__categories-list`, children: patternCategories.map(({ name, label }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, label: label, className: `${baseClassName}__categories-list__item`, isPressed: selectedCategory === name, onClick: () => { onClickCategory(name); }, children: label }, name); }) }); } function PatternsExplorerSearch({ searchValue, setSearchValue }) { const baseClassName = 'block-editor-block-patterns-explorer__search'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: baseClassName, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { __nextHasNoMarginBottom: true, onChange: setSearchValue, value: searchValue, label: (0,external_wp_i18n_namespaceObject.__)('Search'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') }) }); } function PatternExplorerSidebar({ selectedCategory, patternCategories, onClickCategory, searchValue, setSearchValue }) { const baseClassName = 'block-editor-block-patterns-explorer__sidebar'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: baseClassName, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsExplorerSearch, { searchValue: searchValue, setSearchValue: setSearchValue }), !searchValue && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternCategoriesList, { selectedCategory: selectedCategory, patternCategories: patternCategories, onClickCategory: onClickCategory })] }); } /* harmony default export */ const pattern_explorer_sidebar = (PatternExplorerSidebar); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-patterns-paging/index.js /** * WordPress dependencies */ function Pagination({ currentPage, numPages, changePage, totalItems }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "block-editor-patterns__grid-pagination-wrapper", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", children: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Total number of patterns. (0,external_wp_i18n_namespaceObject._n)('%s item', '%s items', totalItems), totalItems) }), numPages > 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, spacing: 3, justify: "flex-start", className: "block-editor-patterns__grid-pagination", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, spacing: 1, className: "block-editor-patterns__grid-pagination-previous", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: () => changePage(1), disabled: currentPage === 1, "aria-label": (0,external_wp_i18n_namespaceObject.__)('First page'), size: "compact", accessibleWhenDisabled: true, className: "block-editor-patterns__grid-pagination-button", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: "\xAB" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: () => changePage(currentPage - 1), disabled: currentPage === 1, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page'), size: "compact", accessibleWhenDisabled: true, className: "block-editor-patterns__grid-pagination-button", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: "\u2039" }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", children: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Current page number. 2: Total number of pages. (0,external_wp_i18n_namespaceObject._x)('%1$s of %2$s', 'paging'), currentPage, numPages) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, spacing: 1, className: "block-editor-patterns__grid-pagination-next", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: () => changePage(currentPage + 1), disabled: currentPage === numPages, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page'), size: "compact", accessibleWhenDisabled: true, className: "block-editor-patterns__grid-pagination-button", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: "\u203A" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: () => changePage(numPages), disabled: currentPage === numPages, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Last page'), size: "compact", accessibleWhenDisabled: true, className: "block-editor-patterns__grid-pagination-button", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: "\xBB" }) })] })] })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-patterns-list/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const WithToolTip = ({ showTooltip, title, children }) => { if (showTooltip) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: title, children: children }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: children }); }; function BlockPattern({ id, isDraggable, pattern, onClick, onHover, showTitlesAsTooltip, category, isSelected }) { const [isDragging, setIsDragging] = (0,external_wp_element_namespaceObject.useState)(false); const { blocks, viewportWidth } = pattern; const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockPattern); const descriptionId = `block-editor-block-patterns-list__item-description-${instanceId}`; const isUserPattern = pattern.type === INSERTER_PATTERN_TYPES.user; // When we have a selected category and the pattern is draggable, we need to update the // pattern's categories in metadata to only contain the selected category, and pass this to // InserterDraggableBlocks component. We do that because we use this information for pattern // shuffling and it makes more sense to show only the ones from the initially selected category during insertion. const patternBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!category || !isDraggable) { return blocks; } return (blocks !== null && blocks !== void 0 ? blocks : []).map(block => { const clonedBlock = (0,external_wp_blocks_namespaceObject.cloneBlock)(block); if (clonedBlock.attributes.metadata?.categories?.includes(category)) { clonedBlock.attributes.metadata.categories = [category]; } return clonedBlock; }); }, [blocks, isDraggable, category]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_draggable_blocks, { isEnabled: isDraggable, blocks: patternBlocks, pattern: pattern, children: ({ draggable, onDragStart, onDragEnd }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-patterns-list__list-item", draggable: draggable, onDragStart: event => { setIsDragging(true); if (onDragStart) { onHover?.(null); onDragStart(event); } }, onDragEnd: event => { setIsDragging(false); if (onDragEnd) { onDragEnd(event); } }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WithToolTip, { showTooltip: showTitlesAsTooltip && !isUserPattern, title: pattern.title, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Item, { render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "option", "aria-label": pattern.title, "aria-describedby": pattern.description ? descriptionId : undefined, className: dist_clsx('block-editor-block-patterns-list__item', { 'block-editor-block-patterns-list__list-item-synced': pattern.type === INSERTER_PATTERN_TYPES.user && !pattern.syncStatus, 'is-selected': isSelected }) }), id: id, onClick: () => { onClick(pattern, blocks); onHover?.(null); }, onMouseEnter: () => { if (isDragging) { return; } onHover?.(pattern); }, onMouseLeave: () => onHover?.(null), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview.Async, { placeholder: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockPatternPlaceholder, {}), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview, { blocks: blocks, viewportWidth: viewportWidth }) }), (!showTitlesAsTooltip || isUserPattern) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "block-editor-patterns__pattern-details", spacing: 2, children: [isUserPattern && !pattern.syncStatus && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-patterns__pattern-icon-wrapper", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { className: "block-editor-patterns__pattern-icon", icon: library_symbol }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-patterns-list__item-title", children: pattern.title })] }), !!pattern.description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: pattern.description })] }) }) }) }); } function BlockPatternPlaceholder() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-patterns-list__item is-placeholder" }); } function BlockPatternsList({ isDraggable, blockPatterns, onHover, onClickPattern, orientation, label = (0,external_wp_i18n_namespaceObject.__)('Block patterns'), category, showTitlesAsTooltip, pagingProps }, ref) { const [activeCompositeId, setActiveCompositeId] = (0,external_wp_element_namespaceObject.useState)(undefined); const [activePattern, setActivePattern] = (0,external_wp_element_namespaceObject.useState)(null); // State to track active pattern (0,external_wp_element_namespaceObject.useEffect)(() => { // Reset the active composite item whenever the available patterns change, // to make sure that Composite widget can receive focus correctly when its // composite items change. The first composite item will receive focus. const firstCompositeItemId = blockPatterns[0]?.name; setActiveCompositeId(firstCompositeItemId); }, [blockPatterns]); const handleClickPattern = (pattern, blocks) => { setActivePattern(pattern.name); onClickPattern(pattern, blocks); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite, { orientation: orientation, activeId: activeCompositeId, setActiveId: setActiveCompositeId, role: "listbox", className: "block-editor-block-patterns-list", "aria-label": label, ref: ref, children: [blockPatterns.map(pattern => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockPattern, { id: pattern.name, pattern: pattern, onClick: handleClickPattern, onHover: onHover, isDraggable: isDraggable, showTitlesAsTooltip: showTitlesAsTooltip, category: category, isSelected: !!activePattern && activePattern === pattern.name }, pattern.name)), pagingProps && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Pagination, { ...pagingProps })] }); } /* harmony default export */ const block_patterns_list = ((0,external_wp_element_namespaceObject.forwardRef)(BlockPatternsList)); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-insertion-point.js /** * WordPress dependencies */ /** * Internal dependencies */ function getIndex({ destinationRootClientId, destinationIndex, rootClientId, registry }) { if (rootClientId === destinationRootClientId) { return destinationIndex; } const parents = ['', ...registry.select(store).getBlockParents(destinationRootClientId), destinationRootClientId]; const parentIndex = parents.indexOf(rootClientId); if (parentIndex !== -1) { return registry.select(store).getBlockIndex(parents[parentIndex + 1]) + 1; } return registry.select(store).getBlockOrder(rootClientId).length; } /** * @typedef WPInserterConfig * * @property {string=} rootClientId If set, insertion will be into the * block with this ID. * @property {number=} insertionIndex If set, insertion will be into this * explicit position. * @property {string=} clientId If set, insertion will be after the * block with this ID. * @property {boolean=} isAppender Whether the inserter is an appender * or not. * @property {Function=} onSelect Called after insertion. */ /** * Returns the insertion point state given the inserter config. * * @param {WPInserterConfig} config Inserter Config. * @return {Array} Insertion Point State (rootClientID, onInsertBlocks and onToggle). */ function useInsertionPoint({ rootClientId = '', insertionIndex, clientId, isAppender, onSelect, shouldFocusBlock = true, selectBlockOnInsert = true }) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { getSelectedBlock, getClosestAllowedInsertionPoint, isBlockInsertionPointVisible } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); const { destinationRootClientId, destinationIndex } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSelectedBlockClientId, getBlockRootClientId, getBlockIndex, getBlockOrder, getInsertionPoint } = unlock(select(store)); const selectedBlockClientId = getSelectedBlockClientId(); let _destinationRootClientId = rootClientId; let _destinationIndex; const insertionPoint = getInsertionPoint(); if (insertionIndex !== undefined) { // Insert into a specific index. _destinationIndex = insertionIndex; } else if (insertionPoint && insertionPoint.hasOwnProperty('index')) { _destinationRootClientId = insertionPoint?.rootClientId ? insertionPoint.rootClientId : rootClientId; _destinationIndex = insertionPoint.index; } else if (clientId) { // Insert after a specific client ID. _destinationIndex = getBlockIndex(clientId); } else if (!isAppender && selectedBlockClientId) { _destinationRootClientId = getBlockRootClientId(selectedBlockClientId); _destinationIndex = getBlockIndex(selectedBlockClientId) + 1; } else { // Insert at the end of the list. _destinationIndex = getBlockOrder(_destinationRootClientId).length; } return { destinationRootClientId: _destinationRootClientId, destinationIndex: _destinationIndex }; }, [rootClientId, insertionIndex, clientId, isAppender]); const { replaceBlocks, insertBlocks, showInsertionPoint, hideInsertionPoint, setLastFocus } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const onInsertBlocks = (0,external_wp_element_namespaceObject.useCallback)((blocks, meta, shouldForceFocusBlock = false, _rootClientId) => { // When we are trying to move focus or select a new block on insert, we also // need to clear the last focus to avoid the focus being set to the wrong block // when tabbing back into the canvas if the block was added from outside the // editor canvas. if (shouldForceFocusBlock || shouldFocusBlock || selectBlockOnInsert) { setLastFocus(null); } const selectedBlock = getSelectedBlock(); if (!isAppender && selectedBlock && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(selectedBlock)) { replaceBlocks(selectedBlock.clientId, blocks, null, shouldFocusBlock || shouldForceFocusBlock ? 0 : null, meta); } else { insertBlocks(blocks, isAppender || _rootClientId === undefined ? destinationIndex : getIndex({ destinationRootClientId, destinationIndex, rootClientId: _rootClientId, registry }), isAppender || _rootClientId === undefined ? destinationRootClientId : _rootClientId, selectBlockOnInsert, shouldFocusBlock || shouldForceFocusBlock ? 0 : null, meta); } const blockLength = Array.isArray(blocks) ? blocks.length : 1; const message = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: the name of the block that has been added (0,external_wp_i18n_namespaceObject._n)('%d block added.', '%d blocks added.', blockLength), blockLength); (0,external_wp_a11y_namespaceObject.speak)(message); if (onSelect) { onSelect(blocks); } }, [isAppender, getSelectedBlock, replaceBlocks, insertBlocks, destinationRootClientId, destinationIndex, onSelect, shouldFocusBlock, selectBlockOnInsert]); const onToggleInsertionPoint = (0,external_wp_element_namespaceObject.useCallback)(item => { if (item && !isBlockInsertionPointVisible()) { const allowedDestinationRootClientId = getClosestAllowedInsertionPoint(item.name, destinationRootClientId); if (allowedDestinationRootClientId !== null) { showInsertionPoint(allowedDestinationRootClientId, getIndex({ destinationRootClientId, destinationIndex, rootClientId: allowedDestinationRootClientId, registry })); } } else { hideInsertionPoint(); } }, [getClosestAllowedInsertionPoint, isBlockInsertionPointVisible, showInsertionPoint, hideInsertionPoint, destinationRootClientId, destinationIndex]); return [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint]; } /* harmony default export */ const use_insertion_point = (useInsertionPoint); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-patterns-state.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Retrieves the block patterns inserter state. * * @param {Function} onInsert function called when inserter a list of blocks. * @param {string=} rootClientId Insertion's root client ID. * @param {string} selectedCategory The selected pattern category. * @param {boolean} isQuick For the quick inserter render only allowed patterns. * * @return {Array} Returns the patterns state. (patterns, categories, onSelect handler) */ const usePatternsState = (onInsert, rootClientId, selectedCategory, isQuick) => { const options = (0,external_wp_element_namespaceObject.useMemo)(() => ({ [isFiltered]: !!isQuick }), [isQuick]); const { patternCategories, patterns, userPatternCategories } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings, __experimentalGetAllowedPatterns } = unlock(select(store)); const { __experimentalUserPatternCategories, __experimentalBlockPatternCategories } = getSettings(); return { patterns: __experimentalGetAllowedPatterns(rootClientId, options), userPatternCategories: __experimentalUserPatternCategories, patternCategories: __experimentalBlockPatternCategories }; }, [rootClientId, options]); const { getClosestAllowedInsertionPointForPattern } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); const allCategories = (0,external_wp_element_namespaceObject.useMemo)(() => { const categories = [...patternCategories]; userPatternCategories?.forEach(userCategory => { if (!categories.find(existingCategory => existingCategory.name === userCategory.name)) { categories.push(userCategory); } }); return categories; }, [patternCategories, userPatternCategories]); const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const onClickPattern = (0,external_wp_element_namespaceObject.useCallback)((pattern, blocks) => { const destinationRootClientId = isQuick ? rootClientId : getClosestAllowedInsertionPointForPattern(pattern, rootClientId); if (destinationRootClientId === null) { return; } const patternBlocks = pattern.type === INSERTER_PATTERN_TYPES.user && pattern.syncStatus !== 'unsynced' ? [(0,external_wp_blocks_namespaceObject.createBlock)('core/block', { ref: pattern.id })] : blocks; onInsert((patternBlocks !== null && patternBlocks !== void 0 ? patternBlocks : []).map(block => { const clonedBlock = (0,external_wp_blocks_namespaceObject.cloneBlock)(block); if (clonedBlock.attributes.metadata?.categories?.includes(selectedCategory)) { clonedBlock.attributes.metadata.categories = [selectedCategory]; } return clonedBlock; }), pattern.name, false, destinationRootClientId); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block pattern title. */ (0,external_wp_i18n_namespaceObject.__)('Block pattern "%s" inserted.'), pattern.title), { type: 'snackbar', id: 'inserter-notice' }); }, [createSuccessNotice, onInsert, selectedCategory, rootClientId, getClosestAllowedInsertionPointForPattern, isQuick]); return [patterns, allCategories, onClickPattern]; }; /* harmony default export */ const use_patterns_state = (usePatternsState); // EXTERNAL MODULE: ./node_modules/remove-accents/index.js var remove_accents = __webpack_require__(9681); var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); ;// ./node_modules/lower-case/dist.es2015/index.js /** * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt */ var SUPPORTED_LOCALE = { tr: { regexp: /\u0130|\u0049|\u0049\u0307/g, map: { İ: "\u0069", I: "\u0131", İ: "\u0069", }, }, az: { regexp: /\u0130/g, map: { İ: "\u0069", I: "\u0131", İ: "\u0069", }, }, lt: { regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, map: { I: "\u0069\u0307", J: "\u006A\u0307", Į: "\u012F\u0307", Ì: "\u0069\u0307\u0300", Í: "\u0069\u0307\u0301", Ĩ: "\u0069\u0307\u0303", }, }, }; /** * Localized lower case. */ function localeLowerCase(str, locale) { var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; if (lang) return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); return lowerCase(str); } /** * Lower case as a function. */ function lowerCase(str) { return str.toLowerCase(); } ;// ./node_modules/no-case/dist.es2015/index.js // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; // Remove all non-word characters. var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; /** * Normalize the string into something other libraries can manipulate easier. */ function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; var result = dist_es2015_replace(dist_es2015_replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); var start = 0; var end = result.length; // Trim the delimiter from around the output string. while (result.charAt(start) === "\0") start++; while (result.charAt(end - 1) === "\0") end--; // Transform each token independently. return result.slice(start, end).split("\0").map(transform).join(delimiter); } /** * Replace `re` in the input string with the replacement value. */ function dist_es2015_replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function (input, re) { return input.replace(re, value); }, input); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-items.js /** * External dependencies */ // Default search helpers. const defaultGetName = item => item.name || ''; const defaultGetTitle = item => item.title; const defaultGetDescription = item => item.description || ''; const defaultGetKeywords = item => item.keywords || []; const defaultGetCategory = item => item.category; const defaultGetCollection = () => null; // Normalization regexes const splitRegexp = [/([\p{Ll}\p{Lo}\p{N}])([\p{Lu}\p{Lt}])/gu, // One lowercase or digit, followed by one uppercase. /([\p{Lu}\p{Lt}])([\p{Lu}\p{Lt}][\p{Ll}\p{Lo}])/gu // One uppercase followed by one uppercase and one lowercase. ]; const stripRegexp = /(\p{C}|\p{P}|\p{S})+/giu; // Anything that's not a punctuation, symbol or control/format character. // Normalization cache const extractedWords = new Map(); const normalizedStrings = new Map(); /** * Extracts words from an input string. * * @param {string} input The input string. * * @return {Array} Words, extracted from the input string. */ function extractWords(input = '') { if (extractedWords.has(input)) { return extractedWords.get(input); } const result = noCase(input, { splitRegexp, stripRegexp }).split(' ').filter(Boolean); extractedWords.set(input, result); return result; } /** * Sanitizes the search input string. * * @param {string} input The search input to normalize. * * @return {string} The normalized search input. */ function normalizeString(input = '') { if (normalizedStrings.has(input)) { return normalizedStrings.get(input); } // Disregard diacritics. // Input: "média" let result = remove_accents_default()(input); // Accommodate leading slash, matching autocomplete expectations. // Input: "/media" result = result.replace(/^\//, ''); // Lowercase. // Input: "MEDIA" result = result.toLowerCase(); normalizedStrings.set(input, result); return result; } /** * Converts the search term into a list of normalized terms. * * @param {string} input The search term to normalize. * * @return {string[]} The normalized list of search terms. */ const getNormalizedSearchTerms = (input = '') => { return extractWords(normalizeString(input)); }; const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => { return unmatchedTerms.filter(term => !getNormalizedSearchTerms(unprocessedTerms).some(unprocessedTerm => unprocessedTerm.includes(term))); }; const searchBlockItems = (items, categories, collections, searchInput) => { const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); if (normalizedSearchTerms.length === 0) { return items; } const config = { getCategory: item => categories.find(({ slug }) => slug === item.category)?.title, getCollection: item => collections[item.name.split('/')[0]]?.title }; return searchItems(items, searchInput, config); }; /** * Filters an item list given a search term. * * @param {Array} items Item list * @param {string} searchInput Search input. * @param {Object} config Search Config. * * @return {Array} Filtered item list. */ const searchItems = (items = [], searchInput = '', config = {}) => { const normalizedSearchTerms = getNormalizedSearchTerms(searchInput); if (normalizedSearchTerms.length === 0) { return items; } const rankedItems = items.map(item => { return [item, getItemSearchRank(item, searchInput, config)]; }).filter(([, rank]) => rank > 0); rankedItems.sort(([, rank1], [, rank2]) => rank2 - rank1); return rankedItems.map(([item]) => item); }; /** * Get the search rank for a given item and a specific search term. * The better the match, the higher the rank. * If the rank equals 0, it should be excluded from the results. * * @param {Object} item Item to filter. * @param {string} searchTerm Search term. * @param {Object} config Search Config. * * @return {number} Search Rank. */ function getItemSearchRank(item, searchTerm, config = {}) { const { getName = defaultGetName, getTitle = defaultGetTitle, getDescription = defaultGetDescription, getKeywords = defaultGetKeywords, getCategory = defaultGetCategory, getCollection = defaultGetCollection } = config; const name = getName(item); const title = getTitle(item); const description = getDescription(item); const keywords = getKeywords(item); const category = getCategory(item); const collection = getCollection(item); const normalizedSearchInput = normalizeString(searchTerm); const normalizedTitle = normalizeString(title); let rank = 0; // Prefers exact matches // Then prefers if the beginning of the title matches the search term // name, keywords, categories, collection, variations match come later. if (normalizedSearchInput === normalizedTitle) { rank += 30; } else if (normalizedTitle.startsWith(normalizedSearchInput)) { rank += 20; } else { const terms = [name, title, description, ...keywords, category, collection].join(' '); const normalizedSearchTerms = extractWords(normalizedSearchInput); const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms); if (unmatchedTerms.length === 0) { rank += 10; } } // Give a better rank to "core" namespaced items. if (rank !== 0 && name.startsWith('core/')) { const isCoreBlockVariation = name !== item.id; // Give a bit better rank to "core" blocks over "core" block variations. rank += isCoreBlockVariation ? 1 : 2; } return rank; } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/hooks/use-patterns-paging.js /** * WordPress dependencies */ const PAGE_SIZE = 20; /** * Supplies values needed to page the patterns list client side. * * @param {Array} currentCategoryPatterns An array of the current patterns to display. * @param {string} currentCategory The currently selected category. * @param {Object} scrollContainerRef Ref of container to to find scroll container for when moving between pages. * @param {string} currentFilter The currently search filter. * * @return {Object} Returns the relevant paging values. (totalItems, categoryPatternsList, numPages, changePage, currentPage) */ function usePatternsPaging(currentCategoryPatterns, currentCategory, scrollContainerRef, currentFilter = '') { const [currentPage, setCurrentPage] = (0,external_wp_element_namespaceObject.useState)(1); const previousCategory = (0,external_wp_compose_namespaceObject.usePrevious)(currentCategory); const previousFilter = (0,external_wp_compose_namespaceObject.usePrevious)(currentFilter); if ((previousCategory !== currentCategory || previousFilter !== currentFilter) && currentPage !== 1) { setCurrentPage(1); } const totalItems = currentCategoryPatterns.length; const pageIndex = currentPage - 1; const categoryPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { return currentCategoryPatterns.slice(pageIndex * PAGE_SIZE, pageIndex * PAGE_SIZE + PAGE_SIZE); }, [pageIndex, currentCategoryPatterns]); const numPages = Math.ceil(currentCategoryPatterns.length / PAGE_SIZE); const changePage = page => { const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(scrollContainerRef?.current); scrollContainer?.scrollTo(0, 0); setCurrentPage(page); }; (0,external_wp_element_namespaceObject.useEffect)(function scrollToTopOnCategoryChange() { const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(scrollContainerRef?.current); scrollContainer?.scrollTo(0, 0); }, [currentCategory, scrollContainerRef]); return { totalItems, categoryPatterns, numPages, changePage, currentPage }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/pattern-list.js /** * WordPress dependencies */ /** * Internal dependencies */ function PatternsListHeader({ filterValue, filteredBlockPatternsLength }) { if (!filterValue) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 2, lineHeight: "48px", className: "block-editor-block-patterns-explorer__search-results-count", children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of patterns. */ (0,external_wp_i18n_namespaceObject._n)('%d pattern found', '%d patterns found', filteredBlockPatternsLength), filteredBlockPatternsLength) }); } function PatternList({ searchValue, selectedCategory, patternCategories, rootClientId, onModalClose }) { const container = (0,external_wp_element_namespaceObject.useRef)(); const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500); const [destinationRootClientId, onInsertBlocks] = use_insertion_point({ rootClientId, shouldFocusBlock: true }); const [patterns,, onClickPattern] = use_patterns_state(onInsertBlocks, destinationRootClientId, selectedCategory); const registeredPatternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => patternCategories.map(patternCategory => patternCategory.name), [patternCategories]); const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { const filteredPatterns = patterns.filter(pattern => { if (selectedCategory === allPatternsCategory.name) { return true; } if (selectedCategory === myPatternsCategory.name && pattern.type === INSERTER_PATTERN_TYPES.user) { return true; } if (selectedCategory === starterPatternsCategory.name && pattern.blockTypes?.includes('core/post-content')) { return true; } if (selectedCategory === 'uncategorized') { var _pattern$categories$s; const hasKnownCategory = (_pattern$categories$s = pattern.categories?.some(category => registeredPatternCategories.includes(category))) !== null && _pattern$categories$s !== void 0 ? _pattern$categories$s : false; return !pattern.categories?.length || !hasKnownCategory; } return pattern.categories?.includes(selectedCategory); }); if (!searchValue) { return filteredPatterns; } return searchItems(filteredPatterns, searchValue); }, [searchValue, patterns, selectedCategory, registeredPatternCategories]); // Announce search results on change. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!searchValue) { return; } const count = filteredBlockPatterns.length; const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of results. */ (0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', count), count); debouncedSpeak(resultsFoundMessage); }, [searchValue, debouncedSpeak, filteredBlockPatterns.length]); const pagingProps = usePatternsPaging(filteredBlockPatterns, selectedCategory, container); // Reset page when search value changes. const [previousSearchValue, setPreviousSearchValue] = (0,external_wp_element_namespaceObject.useState)(searchValue); if (searchValue !== previousSearchValue) { setPreviousSearchValue(searchValue); pagingProps.changePage(1); } const hasItems = !!filteredBlockPatterns?.length; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-patterns-explorer__list", ref: container, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsListHeader, { filterValue: searchValue, filteredBlockPatternsLength: filteredBlockPatterns.length }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_listbox, { children: hasItems && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_patterns_list, { blockPatterns: pagingProps.categoryPatterns, onClickPattern: (pattern, blocks) => { onClickPattern(pattern, blocks); onModalClose(); }, isDraggable: false }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Pagination, { ...pagingProps })] }) })] }); } /* harmony default export */ const pattern_list = (PatternList); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js /** * WordPress dependencies */ /** * Internal dependencies */ function hasRegisteredCategory(pattern, allCategories) { if (!pattern.categories || !pattern.categories.length) { return false; } return pattern.categories.some(cat => allCategories.some(category => category.name === cat)); } function usePatternCategories(rootClientId, sourceFilter = 'all') { const [patterns, allCategories] = use_patterns_state(undefined, rootClientId); const filteredPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => sourceFilter === 'all' ? patterns : patterns.filter(pattern => !isPatternFiltered(pattern, sourceFilter)), [sourceFilter, patterns]); // Remove any empty categories. const populatedCategories = (0,external_wp_element_namespaceObject.useMemo)(() => { const categories = allCategories.filter(category => filteredPatterns.some(pattern => pattern.categories?.includes(category.name))).sort((a, b) => a.label.localeCompare(b.label)); if (filteredPatterns.some(pattern => !hasRegisteredCategory(pattern, allCategories)) && !categories.find(category => category.name === 'uncategorized')) { categories.push({ name: 'uncategorized', label: (0,external_wp_i18n_namespaceObject._x)('Uncategorized') }); } if (filteredPatterns.some(pattern => pattern.blockTypes?.includes('core/post-content'))) { categories.unshift(starterPatternsCategory); } if (filteredPatterns.some(pattern => pattern.type === INSERTER_PATTERN_TYPES.user)) { categories.unshift(myPatternsCategory); } if (filteredPatterns.length > 0) { categories.unshift({ name: allPatternsCategory.name, label: allPatternsCategory.label }); } (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of categories . */ (0,external_wp_i18n_namespaceObject._n)('%d category button displayed.', '%d category buttons displayed.', categories.length), categories.length)); return categories; }, [allCategories, filteredPatterns]); return populatedCategories; } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-explorer/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function PatternsExplorer({ initialCategory, rootClientId, onModalClose }) { const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)(''); const [selectedCategory, setSelectedCategory] = (0,external_wp_element_namespaceObject.useState)(initialCategory?.name); const patternCategories = usePatternCategories(rootClientId); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-patterns-explorer", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pattern_explorer_sidebar, { selectedCategory: selectedCategory, patternCategories: patternCategories, onClickCategory: setSelectedCategory, searchValue: searchValue, setSearchValue: setSearchValue }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pattern_list, { searchValue: searchValue, selectedCategory: selectedCategory, patternCategories: patternCategories, rootClientId: rootClientId, onModalClose: onModalClose })] }); } function PatternsExplorerModal({ onModalClose, ...restProps }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Patterns'), onRequestClose: onModalClose, isFullScreen: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsExplorer, { onModalClose: onModalClose, ...restProps }) }); } /* harmony default export */ const block_patterns_explorer = (PatternsExplorerModal); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/mobile-tab-navigation.js /** * WordPress dependencies */ function ScreenHeader({ title }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 0, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalView, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginBottom: 0, paddingX: 4, paddingY: 3, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { spacing: 2, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.BackButton, { style: // TODO: This style override is also used in ToolsPanelHeader. // It should be supported out-of-the-box by Button. { minWidth: 24, padding: 0 }, icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, size: "small", label: (0,external_wp_i18n_namespaceObject.__)('Back') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { level: 5, children: title }) })] }) }) }) }); } function MobileTabNavigation({ categories, children }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator, { initialPath: "/", className: "block-editor-inserter__mobile-tab-navigation", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Screen, { path: "/", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { children: categories.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Navigator.Button, { path: `/category/${category.name}`, as: external_wp_components_namespaceObject.__experimentalItem, isAction: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { children: category.label }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right })] }) }, category.name)) }) }), categories.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Navigator.Screen, { path: `/category/${category.name}`, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScreenHeader, { title: (0,external_wp_i18n_namespaceObject.__)('Back') }), children(category)] }, category.name))] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/patterns-filter.js /** * WordPress dependencies */ /** * Internal dependencies */ const getShouldDisableSyncFilter = sourceFilter => sourceFilter !== 'all' && sourceFilter !== 'user'; const getShouldHideSourcesFilter = category => { return category.name === myPatternsCategory.name; }; const PATTERN_SOURCE_MENU_OPTIONS = [{ value: 'all', label: (0,external_wp_i18n_namespaceObject._x)('All', 'patterns') }, { value: INSERTER_PATTERN_TYPES.directory, label: (0,external_wp_i18n_namespaceObject.__)('Pattern Directory') }, { value: INSERTER_PATTERN_TYPES.theme, label: (0,external_wp_i18n_namespaceObject.__)('Theme & Plugins') }, { value: INSERTER_PATTERN_TYPES.user, label: (0,external_wp_i18n_namespaceObject.__)('User') }]; function PatternsFilter({ setPatternSyncFilter, setPatternSourceFilter, patternSyncFilter, patternSourceFilter, scrollContainerRef, category }) { // If the category is `myPatterns` then we need to set the source filter to `user`, but // we do this by deriving from props rather than calling setPatternSourceFilter otherwise // the user may be confused when switching to another category if the haven't explicitly set // this filter themselves. const currentPatternSourceFilter = category.name === myPatternsCategory.name ? INSERTER_PATTERN_TYPES.user : patternSourceFilter; // We need to disable the sync filter option if the source filter is not 'all' or 'user' // otherwise applying them will just result in no patterns being shown. const shouldDisableSyncFilter = getShouldDisableSyncFilter(currentPatternSourceFilter); // We also hide the directory and theme source filter if the category is `myPatterns` // otherwise there will only be one option available. const shouldHideSourcesFilter = getShouldHideSourcesFilter(category); const patternSyncMenuOptions = (0,external_wp_element_namespaceObject.useMemo)(() => [{ value: 'all', label: (0,external_wp_i18n_namespaceObject._x)('All', 'patterns') }, { value: INSERTER_SYNC_TYPES.full, label: (0,external_wp_i18n_namespaceObject._x)('Synced', 'patterns'), disabled: shouldDisableSyncFilter }, { value: INSERTER_SYNC_TYPES.unsynced, label: (0,external_wp_i18n_namespaceObject._x)('Not synced', 'patterns'), disabled: shouldDisableSyncFilter }], [shouldDisableSyncFilter]); function handleSetSourceFilterChange(newSourceFilter) { setPatternSourceFilter(newSourceFilter); if (getShouldDisableSyncFilter(newSourceFilter)) { setPatternSyncFilter('all'); } } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { popoverProps: { placement: 'right-end' }, label: (0,external_wp_i18n_namespaceObject.__)('Filter patterns'), toggleProps: { size: 'compact' }, icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z", fill: "currentColor" }) }) }), children: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [!shouldHideSourcesFilter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Source'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, { choices: PATTERN_SOURCE_MENU_OPTIONS, onSelect: value => { handleSetSourceFilterChange(value); scrollContainerRef.current?.scrollTo(0, 0); }, value: currentPatternSourceFilter }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Type'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, { choices: patternSyncMenuOptions, onSelect: value => { setPatternSyncFilter(value); scrollContainerRef.current?.scrollTo(0, 0); }, value: patternSyncFilter }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__patterns-filter-help", children: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Patterns are available from the <Link>WordPress.org Pattern Directory</Link>, bundled in the active theme, or created by users on this site. Only patterns created on this site can be synced.'), { Link: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/patterns/') }) }) })] }) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js /** * WordPress dependencies */ /** * Internal dependencies */ const pattern_category_previews_noop = () => {}; function PatternCategoryPreviews({ rootClientId, onInsert, onHover = pattern_category_previews_noop, category, showTitlesAsTooltip }) { const [allPatterns,, onClickPattern] = use_patterns_state(onInsert, rootClientId, category?.name); const [patternSyncFilter, setPatternSyncFilter] = (0,external_wp_element_namespaceObject.useState)('all'); const [patternSourceFilter, setPatternSourceFilter] = (0,external_wp_element_namespaceObject.useState)('all'); const availableCategories = usePatternCategories(rootClientId, patternSourceFilter); const scrollContainerRef = (0,external_wp_element_namespaceObject.useRef)(); const currentCategoryPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => allPatterns.filter(pattern => { if (isPatternFiltered(pattern, patternSourceFilter, patternSyncFilter)) { return false; } if (category.name === allPatternsCategory.name) { return true; } if (category.name === myPatternsCategory.name && pattern.type === INSERTER_PATTERN_TYPES.user) { return true; } if (category.name === starterPatternsCategory.name && pattern.blockTypes?.includes('core/post-content')) { return true; } if (category.name === 'uncategorized') { // The uncategorized category should show all the patterns without any category... if (!pattern.categories) { return true; } // ...or with no available category. return !pattern.categories.some(catName => availableCategories.some(c => c.name === catName)); } return pattern.categories?.includes(category.name); }), [allPatterns, availableCategories, category.name, patternSourceFilter, patternSyncFilter]); const pagingProps = usePatternsPaging(currentCategoryPatterns, category, scrollContainerRef); const { changePage } = pagingProps; // Hide block pattern preview on unmount. (0,external_wp_element_namespaceObject.useEffect)(() => () => onHover(null), []); const onSetPatternSyncFilter = (0,external_wp_element_namespaceObject.useCallback)(value => { setPatternSyncFilter(value); changePage(1); }, [setPatternSyncFilter, changePage]); const onSetPatternSourceFilter = (0,external_wp_element_namespaceObject.useCallback)(value => { setPatternSourceFilter(value); changePage(1); }, [setPatternSourceFilter, changePage]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 2, className: "block-editor-inserter__patterns-category-panel-header", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { className: "block-editor-inserter__patterns-category-panel-title", size: 13, level: 4, as: "div", children: category.label }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternsFilter, { patternSyncFilter: patternSyncFilter, patternSourceFilter: patternSourceFilter, setPatternSyncFilter: onSetPatternSyncFilter, setPatternSourceFilter: onSetPatternSourceFilter, scrollContainerRef: scrollContainerRef, category: category })] }), !currentCategoryPatterns.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { variant: "muted", className: "block-editor-inserter__patterns-category-no-results", children: (0,external_wp_i18n_namespaceObject.__)('No results found') })] }), currentCategoryPatterns.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { size: "12", as: "p", className: "block-editor-inserter__help-text", children: (0,external_wp_i18n_namespaceObject.__)('Drag and drop patterns into the canvas.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_patterns_list, { ref: scrollContainerRef, blockPatterns: pagingProps.categoryPatterns, onClickPattern: onClickPattern, onHover: onHover, label: category.label, orientation: "vertical", category: category.name, isDraggable: true, showTitlesAsTooltip: showTitlesAsTooltip, patternFilter: patternSourceFilter, pagingProps: pagingProps })] })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/category-tabs/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { Tabs: category_tabs_Tabs } = unlock(external_wp_components_namespaceObject.privateApis); function CategoryTabs({ categories, selectedCategory, onSelectCategory, children }) { // Copied from InterfaceSkeleton. const ANIMATION_DURATION = 0.25; const disableMotion = (0,external_wp_compose_namespaceObject.useReducedMotion)(); const defaultTransition = { type: 'tween', duration: disableMotion ? 0 : ANIMATION_DURATION, ease: [0.6, 0, 0.4, 1] }; const previousSelectedCategory = (0,external_wp_compose_namespaceObject.usePrevious)(selectedCategory); const selectedTabId = selectedCategory ? selectedCategory.name : null; const [activeTabId, setActiveId] = (0,external_wp_element_namespaceObject.useState)(); const firstTabId = categories?.[0]?.name; // If there is no active tab, make the first tab the active tab, so that // when focus is moved to the tablist, the first tab will be focused // despite not being selected if (selectedTabId === null && !activeTabId && firstTabId) { setActiveId(firstTabId); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(category_tabs_Tabs, { selectOnMove: false, selectedTabId: selectedTabId, orientation: "vertical", onSelect: categoryId => { // Pass the full category object onSelectCategory(categories.find(category => category.name === categoryId)); }, activeTabId: activeTabId, onActiveTabIdChange: setActiveId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(category_tabs_Tabs.TabList, { className: "block-editor-inserter__category-tablist", children: categories.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(category_tabs_Tabs.Tab, { tabId: category.name, "aria-current": category === selectedCategory ? 'true' : undefined, children: category.label }, category.name)) }), categories.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(category_tabs_Tabs.TabPanel, { tabId: category.name, focusable: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { className: "block-editor-inserter__category-panel", initial: !previousSelectedCategory ? 'closed' : 'open', animate: "open", variants: { open: { transform: 'translateX( 0 )', transitionEnd: { zIndex: '1' } }, closed: { transform: 'translateX( -100% )', zIndex: '-1' } }, transition: defaultTransition, children: children }) }, category.name))] }); } /* harmony default export */ const category_tabs = (CategoryTabs); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/block-patterns-tab/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockPatternsTab({ onSelectCategory, selectedCategory, onInsert, rootClientId, children }) { const [showPatternsExplorer, setShowPatternsExplorer] = (0,external_wp_element_namespaceObject.useState)(false); const categories = usePatternCategories(rootClientId); const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); if (!categories.length) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results, {}); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [!isMobile && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-inserter__block-patterns-tabs-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(category_tabs, { categories: categories, selectedCategory: selectedCategory, onSelectCategory: onSelectCategory, children: children }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: "block-editor-inserter__patterns-explore-button", onClick: () => setShowPatternsExplorer(true), variant: "secondary", children: (0,external_wp_i18n_namespaceObject.__)('Explore all patterns') })] }), isMobile && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileTabNavigation, { categories: categories, children: category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__category-panel", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternCategoryPreviews, { onInsert: onInsert, rootClientId: rootClientId, category: category }, category.name) }) }), showPatternsExplorer && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_patterns_explorer, { initialCategory: selectedCategory || categories[0], patternCategories: categories, onModalClose: () => setShowPatternsExplorer(false), rootClientId: rootClientId })] }); } /* harmony default export */ const block_patterns_tab = (BlockPatternsTab); ;// ./node_modules/@wordpress/icons/build-module/library/external.js /** * WordPress dependencies */ const external = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) }); /* harmony default export */ const library_external = (external); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/utils.js /** * WordPress dependencies */ const mediaTypeTag = { image: 'img', video: 'video', audio: 'audio' }; /** @typedef {import('./hooks').InserterMediaItem} InserterMediaItem */ /** * Creates a block and a preview element from a media object. * * @param {InserterMediaItem} media The media object to create the block from. * @param {('image'|'audio'|'video')} mediaType The media type to create the block for. * @return {[WPBlock, JSX.Element]} An array containing the block and the preview element. */ function getBlockAndPreviewFromMedia(media, mediaType) { // Add the common attributes between the different media types. const attributes = { id: media.id || undefined, caption: media.caption || undefined }; const mediaSrc = media.url; const alt = media.alt || undefined; if (mediaType === 'image') { attributes.url = mediaSrc; attributes.alt = alt; } else if (['video', 'audio'].includes(mediaType)) { attributes.src = mediaSrc; } const PreviewTag = mediaTypeTag[mediaType]; const preview = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewTag, { src: media.previewUrl || mediaSrc, alt: alt, controls: mediaType === 'audio' ? true : undefined, inert: "true", onError: ({ currentTarget }) => { // Fall back to the media source if the preview cannot be loaded. if (currentTarget.src === media.previewUrl) { currentTarget.src = mediaSrc; } } }); return [(0,external_wp_blocks_namespaceObject.createBlock)(`core/${mediaType}`, attributes), preview]; } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/media-preview.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const ALLOWED_MEDIA_TYPES = ['image']; const MAXIMUM_TITLE_LENGTH = 25; const MEDIA_OPTIONS_POPOVER_PROPS = { position: 'bottom left', className: 'block-editor-inserter__media-list__item-preview-options__popover' }; function MediaPreviewOptions({ category, media }) { if (!category.getReportUrl) { return null; } const reportUrl = category.getReportUrl(media); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { className: "block-editor-inserter__media-list__item-preview-options", label: (0,external_wp_i18n_namespaceObject.__)('Options'), popoverProps: MEDIA_OPTIONS_POPOVER_PROPS, icon: more_vertical, children: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => window.open(reportUrl, '_blank').focus(), icon: library_external, children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The media type to report e.g: "image", "video", "audio" */ (0,external_wp_i18n_namespaceObject.__)('Report %s'), category.mediaType) }) }) }); } function InsertExternalImageModal({ onClose, onSubmit }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Insert external image'), onRequestClose: onClose, className: "block-editor-inserter-media-tab-media-preview-inserter-external-image-modal", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('This image cannot be uploaded to your Media Library, but it can still be inserted as an external image.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('External images can be removed by the external provider without warning and could even have legal compliance issues related to privacy legislation.') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { className: "block-editor-block-lock-modal__actions", justify: "flex-end", expanded: false, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onClose, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", onClick: onSubmit, children: (0,external_wp_i18n_namespaceObject.__)('Insert') }) })] })] }); } function MediaPreview({ media, onClick, category }) { const [showExternalUploadModal, setShowExternalUploadModal] = (0,external_wp_element_namespaceObject.useState)(false); const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); const [isInserting, setIsInserting] = (0,external_wp_element_namespaceObject.useState)(false); const [block, preview] = (0,external_wp_element_namespaceObject.useMemo)(() => getBlockAndPreviewFromMedia(media, category.mediaType), [media, category.mediaType]); const { createErrorNotice, createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { getSettings, getBlock } = (0,external_wp_data_namespaceObject.useSelect)(store); const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); const onMediaInsert = (0,external_wp_element_namespaceObject.useCallback)(previewBlock => { // Prevent multiple uploads when we're in the process of inserting. if (isInserting) { return; } const settings = getSettings(); const clonedBlock = (0,external_wp_blocks_namespaceObject.cloneBlock)(previewBlock); const { id, url, caption } = clonedBlock.attributes; // User has no permission to upload media. if (!id && !settings.mediaUpload) { setShowExternalUploadModal(true); return; } // Media item already exists in library, so just insert it. if (!!id) { onClick(clonedBlock); return; } setIsInserting(true); // Media item does not exist in library, so try to upload it. // Fist fetch the image data. This may fail if the image host // doesn't allow CORS with the domain. // If this happens, we insert the image block using the external // URL and let the user know about the possible implications. window.fetch(url).then(response => response.blob()).then(blob => { const fileName = (0,external_wp_url_namespaceObject.getFilename)(url) || 'image.jpg'; const file = new File([blob], fileName, { type: blob.type }); settings.mediaUpload({ filesList: [file], additionalData: { caption }, onFileChange([img]) { if ((0,external_wp_blob_namespaceObject.isBlobURL)(img.url)) { return; } if (!getBlock(clonedBlock.clientId)) { // Ensure the block is only inserted once. onClick({ ...clonedBlock, attributes: { ...clonedBlock.attributes, id: img.id, url: img.url } }); createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Image uploaded and inserted.'), { type: 'snackbar', id: 'inserter-notice' }); } else { // For subsequent calls, update the existing block. updateBlockAttributes(clonedBlock.clientId, { ...clonedBlock.attributes, id: img.id, url: img.url }); } setIsInserting(false); }, allowedTypes: ALLOWED_MEDIA_TYPES, onError(message) { createErrorNotice(message, { type: 'snackbar', id: 'inserter-notice' }); setIsInserting(false); } }); }).catch(() => { setShowExternalUploadModal(true); setIsInserting(false); }); }, [isInserting, getSettings, onClick, createSuccessNotice, updateBlockAttributes, createErrorNotice, getBlock]); const title = typeof media.title === 'string' ? media.title : media.title?.rendered || (0,external_wp_i18n_namespaceObject.__)('no title'); let truncatedTitle; if (title.length > MAXIMUM_TITLE_LENGTH) { const omission = '...'; truncatedTitle = title.slice(0, MAXIMUM_TITLE_LENGTH - omission.length) + omission; } const onMouseEnter = (0,external_wp_element_namespaceObject.useCallback)(() => setIsHovered(true), []); const onMouseLeave = (0,external_wp_element_namespaceObject.useCallback)(() => setIsHovered(false), []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_draggable_blocks, { isEnabled: true, blocks: [block], children: ({ draggable, onDragStart, onDragEnd }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('block-editor-inserter__media-list__list-item', { 'is-hovered': isHovered }), draggable: draggable, onDragStart: onDragStart, onDragEnd: onDragEnd, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: truncatedTitle || title, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite.Item, { render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { "aria-label": title, role: "option", className: "block-editor-inserter__media-list__item" }), onClick: () => onMediaInsert(block), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-inserter__media-list__item-preview", children: [preview, isInserting && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__media-list__item-preview-spinner", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) })] }) }) }), !isInserting && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MediaPreviewOptions, { category: category, media: media })] }) }) }), showExternalUploadModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InsertExternalImageModal, { onClose: () => setShowExternalUploadModal(false), onSubmit: () => { onClick((0,external_wp_blocks_namespaceObject.cloneBlock)(block)); createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Image inserted.'), { type: 'snackbar', id: 'inserter-notice' }); setShowExternalUploadModal(false); } })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/media-list.js /** * WordPress dependencies */ /** * Internal dependencies */ function MediaList({ mediaList, category, onClick, label = (0,external_wp_i18n_namespaceObject.__)('Media List') }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { role: "listbox", className: "block-editor-inserter__media-list", "aria-label": label, children: mediaList.map((media, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MediaPreview, { media: media, category: category, onClick: onClick }, media.id || media.sourceId || index)) }); } /* harmony default export */ const media_list = (MediaList); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/hooks.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('../../../store/actions').InserterMediaRequest} InserterMediaRequest */ /** @typedef {import('../../../store/actions').InserterMediaItem} InserterMediaItem */ /** * Fetches media items based on the provided category. * Each media category is responsible for providing a `fetch` function. * * @param {Object} category The media category to fetch results for. * @param {InserterMediaRequest} query The query args to use for the request. * @return {InserterMediaItem[]} The media results. */ function useMediaResults(category, query = {}) { const [mediaList, setMediaList] = (0,external_wp_element_namespaceObject.useState)(); const [isLoading, setIsLoading] = (0,external_wp_element_namespaceObject.useState)(false); // We need to keep track of the last request made because // multiple request can be fired without knowing the order // of resolution, and we need to ensure we are showing // the results of the last request. // In the future we could use AbortController to cancel previous // requests, but we don't for now as it involves adding support // for this to `core-data` package. const lastRequestRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { (async () => { const key = JSON.stringify({ category: category.name, ...query }); lastRequestRef.current = key; setIsLoading(true); setMediaList([]); // Empty the previous results. const _media = await category.fetch?.(query); if (key === lastRequestRef.current) { setMediaList(_media); setIsLoading(false); } })(); }, [category.name, ...Object.values(query)]); return { mediaList, isLoading }; } function useMediaCategories(rootClientId) { const [categories, setCategories] = (0,external_wp_element_namespaceObject.useState)([]); const inserterMediaCategories = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getInserterMediaCategories(), []); const { canInsertImage, canInsertVideo, canInsertAudio } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canInsertBlockType } = select(store); return { canInsertImage: canInsertBlockType('core/image', rootClientId), canInsertVideo: canInsertBlockType('core/video', rootClientId), canInsertAudio: canInsertBlockType('core/audio', rootClientId) }; }, [rootClientId]); (0,external_wp_element_namespaceObject.useEffect)(() => { (async () => { const _categories = []; // If `inserterMediaCategories` is not defined in // block editor settings, do not show any media categories. if (!inserterMediaCategories) { return; } // Loop through categories to check if they have at least one media item. const categoriesHaveMedia = new Map(await Promise.all(inserterMediaCategories.map(async category => { // Some sources are external and we don't need to make a request. if (category.isExternalResource) { return [category.name, true]; } let results = []; try { results = await category.fetch({ per_page: 1 }); } catch (e) { // If the request fails, we shallow the error and just don't show // the category, in order to not break the media tab. } return [category.name, !!results.length]; }))); // We need to filter out categories that don't have any media items or // whose corresponding block type is not allowed to be inserted, based // on the category's `mediaType`. const canInsertMediaType = { image: canInsertImage, video: canInsertVideo, audio: canInsertAudio }; inserterMediaCategories.forEach(category => { if (canInsertMediaType[category.mediaType] && categoriesHaveMedia.get(category.name)) { _categories.push(category); } }); if (!!_categories.length) { setCategories(_categories); } })(); }, [canInsertImage, canInsertVideo, canInsertAudio, inserterMediaCategories]); return categories; } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/media-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ const INITIAL_MEDIA_ITEMS_PER_PAGE = 10; function MediaCategoryPanel({ rootClientId, onInsert, category }) { const [search, setSearch, debouncedSearch] = (0,external_wp_compose_namespaceObject.useDebouncedInput)(); const { mediaList, isLoading } = useMediaResults(category, { per_page: !!debouncedSearch ? 20 : INITIAL_MEDIA_ITEMS_PER_PAGE, search: debouncedSearch }); const baseCssClass = 'block-editor-inserter__media-panel'; const searchLabel = category.labels.search_items || (0,external_wp_i18n_namespaceObject.__)('Search'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: baseCssClass, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { __nextHasNoMarginBottom: true, className: `${baseCssClass}-search`, onChange: setSearch, value: search, label: searchLabel, placeholder: searchLabel }), isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${baseCssClass}-spinner`, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }), !isLoading && !mediaList?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results, {}), !isLoading && !!mediaList?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(media_list, { rootClientId: rootClientId, onClick: onInsert, mediaList: mediaList, category: category })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/media-tab/media-tab.js /** * WordPress dependencies */ /** * Internal dependencies */ const media_tab_ALLOWED_MEDIA_TYPES = ['image', 'video', 'audio']; function MediaTab({ rootClientId, selectedCategory, onSelectCategory, onInsert, children }) { const mediaCategories = useMediaCategories(rootClientId); const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const baseCssClass = 'block-editor-inserter__media-tabs'; const onSelectMedia = (0,external_wp_element_namespaceObject.useCallback)(media => { if (!media?.url) { return; } const [block] = getBlockAndPreviewFromMedia(media, media.type); onInsert(block); }, [onInsert]); const categories = (0,external_wp_element_namespaceObject.useMemo)(() => mediaCategories.map(mediaCategory => ({ ...mediaCategory, label: mediaCategory.labels.name })), [mediaCategories]); if (!categories.length) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results, {}); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [!isMobile && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: `${baseCssClass}-container`, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(category_tabs, { categories: categories, selectedCategory: selectedCategory, onSelectCategory: onSelectCategory, children: children }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(check, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(media_upload, { multiple: false, onSelect: onSelectMedia, allowedTypes: media_tab_ALLOWED_MEDIA_TYPES, render: ({ open }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, onClick: event => { // Safari doesn't emit a focus event on button elements when // clicked and we need to manually focus the button here. // The reason is that core's Media Library modal explicitly triggers a // focus event and therefore a `blur` event is triggered on a different // element, which doesn't contain the `data-unstable-ignore-focus-outside-for-relatedtarget` // attribute making the Inserter dialog to close. event.target.focus(); open(); }, className: "block-editor-inserter__media-library-button", variant: "secondary", "data-unstable-ignore-focus-outside-for-relatedtarget": ".media-modal", children: (0,external_wp_i18n_namespaceObject.__)('Open Media Library') }) }) })] }), isMobile && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MobileTabNavigation, { categories: categories, children: category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MediaCategoryPanel, { onInsert: onInsert, rootClientId: rootClientId, category: category }) })] }); } /* harmony default export */ const media_tab = (MediaTab); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter-menu-extension/index.js /** * WordPress dependencies */ const { Fill: __unstableInserterMenuExtension, Slot } = (0,external_wp_components_namespaceObject.createSlotFill)('__unstableInserterMenuExtension'); __unstableInserterMenuExtension.Slot = Slot; /* harmony default export */ const inserter_menu_extension = (__unstableInserterMenuExtension); ;// ./node_modules/@wordpress/block-editor/build-module/utils/order-inserter-block-items.js /** @typedef {import('../store/selectors').WPEditorInserterItem} WPEditorInserterItem */ /** * Helper function to order inserter block items according to a provided array of prioritized blocks. * * @param {WPEditorInserterItem[]} items The array of editor inserter block items to be sorted. * @param {string[]} priority The array of block names to be prioritized. * @return {WPEditorInserterItem[]} The sorted array of editor inserter block items. */ const orderInserterBlockItems = (items, priority) => { if (!priority) { return items; } items.sort(({ id: aName }, { id: bName }) => { // Sort block items according to `priority`. let aIndex = priority.indexOf(aName); let bIndex = priority.indexOf(bName); // All other block items should come after that. if (aIndex < 0) { aIndex = priority.length; } if (bIndex < 0) { bIndex = priority.length; } return aIndex - bIndex; }); return items; }; ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/search-results.js /** * WordPress dependencies */ /** * Internal dependencies */ const INITIAL_INSERTER_RESULTS = 9; /** * Shared reference to an empty array for cases where it is important to avoid * returning a new array reference on every invocation and rerendering the component. * * @type {Array} */ const search_results_EMPTY_ARRAY = []; function InserterSearchResults({ filterValue, onSelect, onHover, onHoverPattern, rootClientId, clientId, isAppender, __experimentalInsertionIndex, maxBlockPatterns, maxBlockTypes, showBlockDirectory = false, isDraggable = true, shouldFocusBlock = true, prioritizePatterns, selectBlockOnInsert, isQuick }) { const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500); const { prioritizedBlocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const blockListSettings = select(store).getBlockListSettings(rootClientId); return { prioritizedBlocks: blockListSettings?.prioritizedInserterBlocks || search_results_EMPTY_ARRAY }; }, [rootClientId]); const [destinationRootClientId, onInsertBlocks] = use_insertion_point({ onSelect, rootClientId, clientId, isAppender, insertionIndex: __experimentalInsertionIndex, shouldFocusBlock, selectBlockOnInsert }); const [blockTypes, blockTypeCategories, blockTypeCollections, onSelectBlockType] = use_block_types_state(destinationRootClientId, onInsertBlocks, isQuick); const [patterns,, onClickPattern] = use_patterns_state(onInsertBlocks, destinationRootClientId, undefined, isQuick); const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { if (maxBlockPatterns === 0) { return []; } const results = searchItems(patterns, filterValue); return maxBlockPatterns !== undefined ? results.slice(0, maxBlockPatterns) : results; }, [filterValue, patterns, maxBlockPatterns]); let maxBlockTypesToShow = maxBlockTypes; if (prioritizePatterns && filteredBlockPatterns.length > 2) { maxBlockTypesToShow = 0; } const filteredBlockTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { if (maxBlockTypesToShow === 0) { return []; } const nonPatternBlockTypes = blockTypes.filter(blockType => blockType.name !== 'core/block'); let orderedItems = orderBy(nonPatternBlockTypes, 'frecency', 'desc'); if (!filterValue && prioritizedBlocks.length) { orderedItems = orderInserterBlockItems(orderedItems, prioritizedBlocks); } const results = searchBlockItems(orderedItems, blockTypeCategories, blockTypeCollections, filterValue); return maxBlockTypesToShow !== undefined ? results.slice(0, maxBlockTypesToShow) : results; }, [filterValue, blockTypes, blockTypeCategories, blockTypeCollections, maxBlockTypesToShow, prioritizedBlocks]); // Announce search results on change. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!filterValue) { return; } const count = filteredBlockTypes.length + filteredBlockPatterns.length; const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of results. */ (0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', count), count); debouncedSpeak(resultsFoundMessage); }, [filterValue, debouncedSpeak, filteredBlockTypes, filteredBlockPatterns]); const currentShownBlockTypes = (0,external_wp_compose_namespaceObject.useAsyncList)(filteredBlockTypes, { step: INITIAL_INSERTER_RESULTS }); const hasItems = filteredBlockTypes.length > 0 || filteredBlockPatterns.length > 0; const blocksUI = !!filteredBlockTypes.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, { title: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { children: (0,external_wp_i18n_namespaceObject.__)('Blocks') }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_types_list, { items: currentShownBlockTypes, onSelect: onSelectBlockType, onHover: onHover, label: (0,external_wp_i18n_namespaceObject.__)('Blocks'), isDraggable: isDraggable }) }); const patternsUI = !!filteredBlockPatterns.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel, { title: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { children: (0,external_wp_i18n_namespaceObject.__)('Block patterns') }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__quick-inserter-patterns", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_patterns_list, { blockPatterns: filteredBlockPatterns, onClickPattern: onClickPattern, onHover: onHoverPattern, isDraggable: isDraggable }) }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(inserter_listbox, { children: [!showBlockDirectory && !hasItems && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results, {}), prioritizePatterns ? patternsUI : blocksUI, !!filteredBlockTypes.length && !!filteredBlockPatterns.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__quick-inserter-separator" }), prioritizePatterns ? blocksUI : patternsUI, showBlockDirectory && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_menu_extension.Slot, { fillProps: { onSelect: onSelectBlockType, onHover, filterValue, hasItems, rootClientId: destinationRootClientId }, children: fills => { if (fills.length) { return fills; } if (!hasItems) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(no_results, {}); } return null; } })] }); } /* harmony default export */ const inserter_search_results = (InserterSearchResults); ;// ./node_modules/@wordpress/icons/build-module/library/close-small.js /** * WordPress dependencies */ const closeSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) }); /* harmony default export */ const close_small = (closeSmall); ;// ./node_modules/@wordpress/block-editor/build-module/components/tabbed-sidebar/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { Tabs: tabbed_sidebar_Tabs } = unlock(external_wp_components_namespaceObject.privateApis); /** * A component that creates a tabbed sidebar with a close button. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/tabbed-sidebar/README.md * * @example * ```jsx * function MyTabbedSidebar() { * return ( * <TabbedSidebar * tabs={ [ * { * name: 'tab1', * title: 'Settings', * panel: <PanelContents />, * } * ] } * onClose={ () => {} } * onSelect={ () => {} } * defaultTabId="tab1" * selectedTab="tab1" * closeButtonLabel="Close sidebar" * /> * ); * } * ``` * * @param {Object} props Component props. * @param {string} [props.defaultTabId] The ID of the tab to be selected by default when the component renders. * @param {Function} props.onClose Function called when the close button is clicked. * @param {Function} props.onSelect Function called when a tab is selected. Receives the selected tab's ID as an argument. * @param {string} props.selectedTab The ID of the currently selected tab. * @param {Array} props.tabs Array of tab objects. Each tab should have: name (string), title (string), * panel (React.Node), and optionally panelRef (React.Ref). * @param {string} props.closeButtonLabel Accessibility label for the close button. * @param {Object} ref Forward ref to the tabs list element. * @return {Element} The tabbed sidebar component. */ function TabbedSidebar({ defaultTabId, onClose, onSelect, selectedTab, tabs, closeButtonLabel }, ref) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-tabbed-sidebar", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(tabbed_sidebar_Tabs, { selectOnMove: false, defaultTabId: defaultTabId, onSelect: onSelect, selectedTabId: selectedTab, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-tabbed-sidebar__tablist-and-close-button", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "block-editor-tabbed-sidebar__close-button", icon: close_small, label: closeButtonLabel, onClick: () => onClose(), size: "compact" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tabbed_sidebar_Tabs.TabList, { className: "block-editor-tabbed-sidebar__tablist", ref: ref, children: tabs.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tabbed_sidebar_Tabs.Tab, { tabId: tab.name, className: "block-editor-tabbed-sidebar__tab", children: tab.title }, tab.name)) })] }), tabs.map(tab => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tabbed_sidebar_Tabs.TabPanel, { tabId: tab.name, focusable: false, className: "block-editor-tabbed-sidebar__tabpanel", ref: tab.panelRef, children: tab.panel }, tab.name))] }) }); } /* harmony default export */ const tabbed_sidebar = ((0,external_wp_element_namespaceObject.forwardRef)(TabbedSidebar)); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-zoom-out.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * A hook used to set the editor mode to zoomed out mode, invoking the hook sets the mode. * Concepts: * - If we most recently changed the zoom level for them (in or out), we always resetZoomLevel() level when unmounting. * - If the user most recently changed the zoom level (manually toggling), we do nothing when unmounting. * * @param {boolean} enabled If we should enter into zoomOut mode or not */ function useZoomOut(enabled = true) { const { setZoomLevel, resetZoomLevel } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); /** * We need access to both the value and the function. The value is to trigger a useEffect hook * and the function is to check zoom out within another hook without triggering a re-render. */ const { isZoomedOut, isZoomOut } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isZoomOut: _isZoomOut } = unlock(select(store)); return { isZoomedOut: _isZoomOut(), isZoomOut: _isZoomOut }; }, []); const controlZoomLevelRef = (0,external_wp_element_namespaceObject.useRef)(false); const isEnabledRef = (0,external_wp_element_namespaceObject.useRef)(enabled); /** * This hook tracks if the zoom state was changed manually by the user via clicking * the zoom out button. We only want this to run when isZoomedOut changes, so we use * a ref to track the enabled state. */ (0,external_wp_element_namespaceObject.useEffect)(() => { // If the zoom state changed (isZoomOut) and it does not match the requested zoom // state (zoomOut), then it means the user manually changed the zoom state while // this hook was mounted, and we should no longer control the zoom state. if (isZoomedOut !== isEnabledRef.current) { controlZoomLevelRef.current = false; } }, [isZoomedOut]); (0,external_wp_element_namespaceObject.useEffect)(() => { isEnabledRef.current = enabled; if (enabled !== isZoomOut()) { controlZoomLevelRef.current = true; if (enabled) { setZoomLevel('auto-scaled'); } else { resetZoomLevel(); } } return () => { // If we are controlling zoom level and are zoomed out, reset the zoom level. if (controlZoomLevelRef.current && isZoomOut()) { resetZoomLevel(); } }; }, [enabled, isZoomOut, resetZoomLevel, setZoomLevel]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/menu.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const NOOP = () => {}; function InserterMenu({ rootClientId, clientId, isAppender, __experimentalInsertionIndex, onSelect, showInserterHelpPanel, showMostUsedBlocks, __experimentalFilterValue = '', shouldFocusBlock = true, onPatternCategorySelection, onClose, __experimentalInitialTab, __experimentalInitialCategory }, ref) { const { isZoomOutMode, hasSectionRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isZoomOut, getSectionRootClientId } = unlock(select(store)); return { isZoomOutMode: isZoomOut(), hasSectionRootClientId: !!getSectionRootClientId() }; }, []); const [filterValue, setFilterValue, delayedFilterValue] = (0,external_wp_compose_namespaceObject.useDebouncedInput)(__experimentalFilterValue); const [hoveredItem, setHoveredItem] = (0,external_wp_element_namespaceObject.useState)(null); const [selectedPatternCategory, setSelectedPatternCategory] = (0,external_wp_element_namespaceObject.useState)(__experimentalInitialCategory); const [patternFilter, setPatternFilter] = (0,external_wp_element_namespaceObject.useState)('all'); const [selectedMediaCategory, setSelectedMediaCategory] = (0,external_wp_element_namespaceObject.useState)(null); const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('large'); function getInitialTab() { if (__experimentalInitialTab) { return __experimentalInitialTab; } if (isZoomOutMode) { return 'patterns'; } return 'blocks'; } const [selectedTab, setSelectedTab] = (0,external_wp_element_namespaceObject.useState)(getInitialTab()); const shouldUseZoomOut = hasSectionRootClientId && (selectedTab === 'patterns' || selectedTab === 'media'); useZoomOut(shouldUseZoomOut && isLargeViewport); const [destinationRootClientId, onInsertBlocks, onToggleInsertionPoint] = use_insertion_point({ rootClientId, clientId, isAppender, insertionIndex: __experimentalInsertionIndex, shouldFocusBlock }); const blockTypesTabRef = (0,external_wp_element_namespaceObject.useRef)(); const onInsert = (0,external_wp_element_namespaceObject.useCallback)((blocks, meta, shouldForceFocusBlock, _rootClientId) => { onInsertBlocks(blocks, meta, shouldForceFocusBlock, _rootClientId); onSelect(blocks); // Check for focus loss due to filtering blocks by selected block type window.requestAnimationFrame(() => { if (!shouldFocusBlock && !blockTypesTabRef.current?.contains(ref.current.ownerDocument.activeElement)) { // There has been a focus loss, so focus the first button in the block types tab blockTypesTabRef.current?.querySelector('button').focus(); } }); }, [onInsertBlocks, onSelect, shouldFocusBlock]); const onInsertPattern = (0,external_wp_element_namespaceObject.useCallback)((blocks, patternName, ...args) => { onToggleInsertionPoint(false); onInsertBlocks(blocks, { patternName }, ...args); onSelect(); }, [onInsertBlocks, onSelect]); const onHover = (0,external_wp_element_namespaceObject.useCallback)(item => { onToggleInsertionPoint(item); setHoveredItem(item); }, [onToggleInsertionPoint, setHoveredItem]); const onClickPatternCategory = (0,external_wp_element_namespaceObject.useCallback)((patternCategory, filter) => { setSelectedPatternCategory(patternCategory); setPatternFilter(filter); onPatternCategorySelection?.(); }, [setSelectedPatternCategory, onPatternCategorySelection]); const showPatternPanel = selectedTab === 'patterns' && !delayedFilterValue && !!selectedPatternCategory; const showMediaPanel = selectedTab === 'media' && !!selectedMediaCategory; const inserterSearch = (0,external_wp_element_namespaceObject.useMemo)(() => { if (selectedTab === 'media') { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { __nextHasNoMarginBottom: true, className: "block-editor-inserter__search", onChange: value => { if (hoveredItem) { setHoveredItem(null); } setFilterValue(value); }, value: filterValue, label: (0,external_wp_i18n_namespaceObject.__)('Search'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') }), !!delayedFilterValue && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_search_results, { filterValue: delayedFilterValue, onSelect: onSelect, onHover: onHover, rootClientId: rootClientId, clientId: clientId, isAppender: isAppender, __experimentalInsertionIndex: __experimentalInsertionIndex, showBlockDirectory: true, shouldFocusBlock: shouldFocusBlock, prioritizePatterns: selectedTab === 'patterns' })] }); }, [selectedTab, hoveredItem, setHoveredItem, setFilterValue, filterValue, delayedFilterValue, onSelect, onHover, shouldFocusBlock, clientId, rootClientId, __experimentalInsertionIndex, isAppender]); const blocksTab = (0,external_wp_element_namespaceObject.useMemo)(() => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__block-list", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_types_tab, { ref: blockTypesTabRef, rootClientId: destinationRootClientId, onInsert: onInsert, onHover: onHover, showMostUsedBlocks: showMostUsedBlocks }) }), showInserterHelpPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-inserter__tips", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "h2", children: (0,external_wp_i18n_namespaceObject.__)('A tip for using the block editor') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tips, {})] })] }); }, [destinationRootClientId, onInsert, onHover, showMostUsedBlocks, showInserterHelpPanel]); const patternsTab = (0,external_wp_element_namespaceObject.useMemo)(() => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_patterns_tab, { rootClientId: destinationRootClientId, onInsert: onInsertPattern, onSelectCategory: onClickPatternCategory, selectedCategory: selectedPatternCategory, children: showPatternPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternCategoryPreviews, { rootClientId: destinationRootClientId, onInsert: onInsertPattern, category: selectedPatternCategory, patternFilter: patternFilter, showTitlesAsTooltip: true }) }); }, [destinationRootClientId, onInsertPattern, onClickPatternCategory, patternFilter, selectedPatternCategory, showPatternPanel]); const mediaTab = (0,external_wp_element_namespaceObject.useMemo)(() => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(media_tab, { rootClientId: destinationRootClientId, selectedCategory: selectedMediaCategory, onSelectCategory: setSelectedMediaCategory, onInsert: onInsert, children: showMediaPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MediaCategoryPanel, { rootClientId: destinationRootClientId, onInsert: onInsert, category: selectedMediaCategory }) }); }, [destinationRootClientId, onInsert, selectedMediaCategory, setSelectedMediaCategory, showMediaPanel]); const handleSetSelectedTab = value => { // If no longer on patterns tab remove the category setting. if (value !== 'patterns') { setSelectedPatternCategory(null); } setSelectedTab(value); }; // Focus first active tab, if any const tabsRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (tabsRef.current) { window.requestAnimationFrame(() => { tabsRef.current.querySelector('[role="tab"][aria-selected="true"]')?.focus(); }); } }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx('block-editor-inserter__menu', { 'show-panel': showPatternPanel || showMediaPanel, 'is-zoom-out': isZoomOutMode }), ref: ref, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__main-area", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tabbed_sidebar, { ref: tabsRef, onSelect: handleSetSelectedTab, onClose: onClose, selectedTab: selectedTab, closeButtonLabel: (0,external_wp_i18n_namespaceObject.__)('Close Block Inserter'), tabs: [{ name: 'blocks', title: (0,external_wp_i18n_namespaceObject.__)('Blocks'), panel: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [inserterSearch, selectedTab === 'blocks' && !delayedFilterValue && blocksTab] }) }, { name: 'patterns', title: (0,external_wp_i18n_namespaceObject.__)('Patterns'), panel: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [inserterSearch, selectedTab === 'patterns' && !delayedFilterValue && patternsTab] }) }, { name: 'media', title: (0,external_wp_i18n_namespaceObject.__)('Media'), panel: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [inserterSearch, mediaTab] }) }] }) }), showInserterHelpPanel && hoveredItem && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { className: "block-editor-inserter__preview-container__popover", placement: "right-start", offset: 16, focusOnMount: false, animate: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(preview_panel, { item: hoveredItem }) })] }); } const PrivateInserterMenu = (0,external_wp_element_namespaceObject.forwardRef)(InserterMenu); function PublicInserterMenu(props, ref) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateInserterMenu, { ...props, onPatternCategorySelection: NOOP, ref: ref }); } /* harmony default export */ const menu = ((0,external_wp_element_namespaceObject.forwardRef)(PublicInserterMenu)); ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/quick-inserter.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const SEARCH_THRESHOLD = 6; const SHOWN_BLOCK_TYPES = 6; const SHOWN_BLOCK_PATTERNS = 2; function QuickInserter({ onSelect, rootClientId, clientId, isAppender, selectBlockOnInsert, hasSearch = true }) { const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)(''); const [destinationRootClientId, onInsertBlocks] = use_insertion_point({ onSelect, rootClientId, clientId, isAppender, selectBlockOnInsert }); const [blockTypes] = use_block_types_state(destinationRootClientId, onInsertBlocks, true); const { setInserterIsOpened, insertionIndex } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings, getBlockIndex, getBlockCount } = select(store); const settings = getSettings(); const index = getBlockIndex(clientId); const blockCount = getBlockCount(); return { setInserterIsOpened: settings.__experimentalSetIsInserterOpened, insertionIndex: index === -1 ? blockCount : index }; }, [clientId]); const showSearch = hasSearch && blockTypes.length > SEARCH_THRESHOLD; (0,external_wp_element_namespaceObject.useEffect)(() => { if (setInserterIsOpened) { setInserterIsOpened(false); } }, [setInserterIsOpened]); // When clicking Browse All select the appropriate block so as // the insertion point can work as expected. const onBrowseAll = () => { setInserterIsOpened({ filterValue, onSelect, rootClientId, insertionIndex }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx('block-editor-inserter__quick-inserter', { 'has-search': showSearch, 'has-expand': setInserterIsOpened }), children: [showSearch && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { __nextHasNoMarginBottom: true, className: "block-editor-inserter__search", value: filterValue, onChange: value => { setFilterValue(value); }, label: (0,external_wp_i18n_namespaceObject.__)('Search'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-inserter__quick-inserter-results", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter_search_results, { filterValue: filterValue, onSelect: onSelect, rootClientId: rootClientId, clientId: clientId, isAppender: isAppender, maxBlockPatterns: !!filterValue ? SHOWN_BLOCK_PATTERNS : 0, maxBlockTypes: SHOWN_BLOCK_TYPES, isDraggable: false, selectBlockOnInsert: selectBlockOnInsert, isQuick: true }) }), setInserterIsOpened && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: "block-editor-inserter__quick-inserter-expand", onClick: onBrowseAll, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Browse all. This will open the main inserter panel in the editor toolbar.'), children: (0,external_wp_i18n_namespaceObject.__)('Browse all') })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const defaultRenderToggle = ({ onToggle, disabled, isOpen, blockTitle, hasSingleBlockType, toggleProps = {} }) => { const { as: Wrapper = external_wp_components_namespaceObject.Button, label: labelProp, onClick, ...rest } = toggleProps; let label = labelProp; if (!label && hasSingleBlockType) { label = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of the block when there is only one (0,external_wp_i18n_namespaceObject._x)('Add %s', 'directly add the only allowed block'), blockTitle); } else if (!label) { label = (0,external_wp_i18n_namespaceObject._x)('Add block', 'Generic label for block inserter button'); } // Handle both onClick functions from the toggle and the parent component. function handleClick(event) { if (onToggle) { onToggle(event); } if (onClick) { onClick(event); } } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, { __next40pxDefaultSize: toggleProps.as ? undefined : true, icon: library_plus, label: label, tooltipPosition: "bottom", onClick: handleClick, className: "block-editor-inserter__toggle", "aria-haspopup": !hasSingleBlockType ? 'true' : false, "aria-expanded": !hasSingleBlockType ? isOpen : false, disabled: disabled, ...rest }); }; class Inserter extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); this.onToggle = this.onToggle.bind(this); this.renderToggle = this.renderToggle.bind(this); this.renderContent = this.renderContent.bind(this); } onToggle(isOpen) { const { onToggle } = this.props; // Surface toggle callback to parent component. if (onToggle) { onToggle(isOpen); } } /** * Render callback to display Dropdown toggle element. * * @param {Object} options * @param {Function} options.onToggle Callback to invoke when toggle is * pressed. * @param {boolean} options.isOpen Whether dropdown is currently open. * * @return {Element} Dropdown toggle element. */ renderToggle({ onToggle, isOpen }) { const { disabled, blockTitle, hasSingleBlockType, directInsertBlock, toggleProps, hasItems, renderToggle = defaultRenderToggle } = this.props; return renderToggle({ onToggle, isOpen, disabled: disabled || !hasItems, blockTitle, hasSingleBlockType, directInsertBlock, toggleProps }); } /** * Render callback to display Dropdown content element. * * @param {Object} options * @param {Function} options.onClose Callback to invoke when dropdown is * closed. * * @return {Element} Dropdown content element. */ renderContent({ onClose }) { const { rootClientId, clientId, isAppender, showInserterHelpPanel, // This prop is experimental to give some time for the quick inserter to mature // Feel free to make them stable after a few releases. __experimentalIsQuick: isQuick, onSelectOrClose, selectBlockOnInsert } = this.props; if (isQuick) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QuickInserter, { onSelect: blocks => { const firstBlock = Array.isArray(blocks) && blocks?.length ? blocks[0] : blocks; if (onSelectOrClose && typeof onSelectOrClose === 'function') { onSelectOrClose(firstBlock); } onClose(); }, rootClientId: rootClientId, clientId: clientId, isAppender: isAppender, selectBlockOnInsert: selectBlockOnInsert }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(menu, { onSelect: () => { onClose(); }, rootClientId: rootClientId, clientId: clientId, isAppender: isAppender, showInserterHelpPanel: showInserterHelpPanel }); } render() { const { position, hasSingleBlockType, directInsertBlock, insertOnlyAllowedBlock, __experimentalIsQuick: isQuick, onSelectOrClose } = this.props; if (hasSingleBlockType || directInsertBlock) { return this.renderToggle({ onToggle: insertOnlyAllowedBlock }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { className: "block-editor-inserter", contentClassName: dist_clsx('block-editor-inserter__popover', { 'is-quick': isQuick }), popoverProps: { position, shift: true }, onToggle: this.onToggle, expandOnMobile: true, headerTitle: (0,external_wp_i18n_namespaceObject.__)('Add a block'), renderToggle: this.renderToggle, renderContent: this.renderContent, onClose: onSelectOrClose }); } } /* harmony default export */ const inserter = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, { clientId, rootClientId, shouldDirectInsert = true }) => { const { getBlockRootClientId, hasInserterItems, getAllowedBlocks, getDirectInsertBlock } = select(store); const { getBlockVariations } = select(external_wp_blocks_namespaceObject.store); rootClientId = rootClientId || getBlockRootClientId(clientId) || undefined; const allowedBlocks = getAllowedBlocks(rootClientId); const directInsertBlock = shouldDirectInsert && getDirectInsertBlock(rootClientId); const hasSingleBlockType = allowedBlocks?.length === 1 && getBlockVariations(allowedBlocks[0].name, 'inserter')?.length === 0; let allowedBlockType = false; if (hasSingleBlockType) { allowedBlockType = allowedBlocks[0]; } return { hasItems: hasInserterItems(rootClientId), hasSingleBlockType, blockTitle: allowedBlockType ? allowedBlockType.title : '', allowedBlockType, directInsertBlock, rootClientId }; }), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, { select }) => { return { insertOnlyAllowedBlock() { const { rootClientId, clientId, isAppender, hasSingleBlockType, allowedBlockType, directInsertBlock, onSelectOrClose, selectBlockOnInsert } = ownProps; if (!hasSingleBlockType && !directInsertBlock) { return; } function getAdjacentBlockAttributes(attributesToCopy) { const { getBlock, getPreviousBlockClientId } = select(store); if (!attributesToCopy || !clientId && !rootClientId) { return {}; } const result = {}; let adjacentAttributes = {}; // If there is no clientId, then attempt to get attributes // from the last block within innerBlocks of the root block. if (!clientId) { const parentBlock = getBlock(rootClientId); if (parentBlock?.innerBlocks?.length) { const lastInnerBlock = parentBlock.innerBlocks[parentBlock.innerBlocks.length - 1]; if (directInsertBlock && directInsertBlock?.name === lastInnerBlock.name) { adjacentAttributes = lastInnerBlock.attributes; } } } else { // Otherwise, attempt to get attributes from the // previous block relative to the current clientId. const currentBlock = getBlock(clientId); const previousBlock = getBlock(getPreviousBlockClientId(clientId)); if (currentBlock?.name === previousBlock?.name) { adjacentAttributes = previousBlock?.attributes || {}; } } // Copy over only those attributes flagged to be copied. attributesToCopy.forEach(attribute => { if (adjacentAttributes.hasOwnProperty(attribute)) { result[attribute] = adjacentAttributes[attribute]; } }); return result; } function getInsertionIndex() { const { getBlockIndex, getBlockSelectionEnd, getBlockOrder, getBlockRootClientId } = select(store); // If the clientId is defined, we insert at the position of the block. if (clientId) { return getBlockIndex(clientId); } // If there a selected block, we insert after the selected block. const end = getBlockSelectionEnd(); if (!isAppender && end && getBlockRootClientId(end) === rootClientId) { return getBlockIndex(end) + 1; } // Otherwise, we insert at the end of the current rootClientId. return getBlockOrder(rootClientId).length; } const { insertBlock } = dispatch(store); let blockToInsert; // Attempt to augment the directInsertBlock with attributes from an adjacent block. // This ensures styling from nearby blocks is preserved in the newly inserted block. // See: https://github.com/WordPress/gutenberg/issues/37904 if (directInsertBlock) { const newAttributes = getAdjacentBlockAttributes(directInsertBlock.attributesToCopy); blockToInsert = (0,external_wp_blocks_namespaceObject.createBlock)(directInsertBlock.name, { ...(directInsertBlock.attributes || {}), ...newAttributes }); } else { blockToInsert = (0,external_wp_blocks_namespaceObject.createBlock)(allowedBlockType.name); } insertBlock(blockToInsert, getInsertionIndex(), rootClientId, selectBlockOnInsert); if (onSelectOrClose) { onSelectOrClose({ clientId: blockToInsert?.clientId }); } const message = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of the block that has been added (0,external_wp_i18n_namespaceObject.__)('%s block added'), allowedBlockType.title); (0,external_wp_a11y_namespaceObject.speak)(message); } }; }), // The global inserter should always be visible, we are using ( ! isAppender && ! rootClientId && ! clientId ) as // a way to detect the global Inserter. (0,external_wp_compose_namespaceObject.ifCondition)(({ hasItems, isAppender, rootClientId, clientId }) => hasItems || !isAppender && !rootClientId && !clientId)])(Inserter)); ;// ./node_modules/@wordpress/block-editor/build-module/components/button-block-appender/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function button_block_appender_ButtonBlockAppender({ rootClientId, className, onFocus, tabIndex, onSelect }, ref) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter, { position: "bottom center", rootClientId: rootClientId, __experimentalIsQuick: true, onSelectOrClose: (...args) => { if (onSelect && typeof onSelect === 'function') { onSelect(...args); } }, renderToggle: ({ onToggle, disabled, isOpen, blockTitle, hasSingleBlockType }) => { const isToggleButton = !hasSingleBlockType; const label = hasSingleBlockType ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of the block when there is only one (0,external_wp_i18n_namespaceObject._x)('Add %s', 'directly add the only allowed block'), blockTitle) : (0,external_wp_i18n_namespaceObject._x)('Add block', 'Generic label for block inserter button'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ref: ref, onFocus: onFocus, tabIndex: tabIndex, className: dist_clsx(className, 'block-editor-button-block-appender'), onClick: onToggle, "aria-haspopup": isToggleButton ? 'true' : undefined, "aria-expanded": isToggleButton ? isOpen : undefined // Disable reason: There shouldn't be a case where this button is disabled but not visually hidden. // eslint-disable-next-line no-restricted-syntax , disabled: disabled, label: label, showTooltip: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_plus }) }); }, isAppender: true }); } /** * Use `ButtonBlockAppender` instead. * * @deprecated */ const ButtonBlockerAppender = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { external_wp_deprecated_default()(`wp.blockEditor.ButtonBlockerAppender`, { alternative: 'wp.blockEditor.ButtonBlockAppender', since: '5.9' }); return button_block_appender_ButtonBlockAppender(props, ref); }); /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/button-block-appender/README.md */ /* harmony default export */ const button_block_appender = ((0,external_wp_element_namespaceObject.forwardRef)(button_block_appender_ButtonBlockAppender)); ;// ./node_modules/@wordpress/block-editor/build-module/components/grid/grid-visualizer.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function GridVisualizer({ clientId, contentRef, parentLayout }) { const isDistractionFree = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().isDistractionFree, []); const gridElement = useBlockElement(clientId); if (isDistractionFree || !gridElement) { return null; } const isManualGrid = parentLayout?.isManualPlacement && window.__experimentalEnableGridInteractivity; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridVisualizerGrid, { gridClientId: clientId, gridElement: gridElement, isManualGrid: isManualGrid, ref: contentRef }); } const GridVisualizerGrid = (0,external_wp_element_namespaceObject.forwardRef)(({ gridClientId, gridElement, isManualGrid }, ref) => { const [gridInfo, setGridInfo] = (0,external_wp_element_namespaceObject.useState)(() => getGridInfo(gridElement)); const [isDroppingAllowed, setIsDroppingAllowed] = (0,external_wp_element_namespaceObject.useState)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { const resizeCallback = () => setGridInfo(getGridInfo(gridElement)); // Both border-box and content-box are observed as they may change // independently. This requires two observers because a single one // can’t be made to monitor both on the same element. const borderBoxSpy = new window.ResizeObserver(resizeCallback); borderBoxSpy.observe(gridElement, { box: 'border-box' }); const contentBoxSpy = new window.ResizeObserver(resizeCallback); contentBoxSpy.observe(gridElement); return () => { borderBoxSpy.disconnect(); contentBoxSpy.disconnect(); }; }, [gridElement]); (0,external_wp_element_namespaceObject.useEffect)(() => { function onGlobalDrag() { setIsDroppingAllowed(true); } function onGlobalDragEnd() { setIsDroppingAllowed(false); } document.addEventListener('drag', onGlobalDrag); document.addEventListener('dragend', onGlobalDragEnd); return () => { document.removeEventListener('drag', onGlobalDrag); document.removeEventListener('dragend', onGlobalDragEnd); }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(cover, { className: dist_clsx('block-editor-grid-visualizer', { 'is-dropping-allowed': isDroppingAllowed }), clientId: gridClientId, __unstablePopoverSlot: "__unstable-block-tools-after", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: ref, className: "block-editor-grid-visualizer__grid", style: gridInfo.style, children: isManualGrid ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ManualGridVisualizer, { gridClientId: gridClientId, gridInfo: gridInfo }) : Array.from({ length: gridInfo.numItems }, (_, i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridVisualizerCell, { color: gridInfo.currentColor }, i)) }) }); }); function ManualGridVisualizer({ gridClientId, gridInfo }) { const [highlightedRect, setHighlightedRect] = (0,external_wp_element_namespaceObject.useState)(null); const gridItemStyles = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockOrder, getBlockStyles } = unlock(select(store)); const blockOrder = getBlockOrder(gridClientId); return getBlockStyles(blockOrder); }, [gridClientId]); const occupiedRects = (0,external_wp_element_namespaceObject.useMemo)(() => { const rects = []; for (const style of Object.values(gridItemStyles)) { var _style$layout; const { columnStart, rowStart, columnSpan = 1, rowSpan = 1 } = (_style$layout = style?.layout) !== null && _style$layout !== void 0 ? _style$layout : {}; if (!columnStart || !rowStart) { continue; } rects.push(new GridRect({ columnStart, rowStart, columnSpan, rowSpan })); } return rects; }, [gridItemStyles]); return range(1, gridInfo.numRows).map(row => range(1, gridInfo.numColumns).map(column => { var _highlightedRect$cont; const isCellOccupied = occupiedRects.some(rect => rect.contains(column, row)); const isHighlighted = (_highlightedRect$cont = highlightedRect?.contains(column, row)) !== null && _highlightedRect$cont !== void 0 ? _highlightedRect$cont : false; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridVisualizerCell, { color: gridInfo.currentColor, className: isHighlighted && 'is-highlighted', children: isCellOccupied ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridVisualizerDropZone, { column: column, row: row, gridClientId: gridClientId, gridInfo: gridInfo, setHighlightedRect: setHighlightedRect }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridVisualizerAppender, { column: column, row: row, gridClientId: gridClientId, gridInfo: gridInfo, setHighlightedRect: setHighlightedRect }) }, `${row}-${column}`); })); } function GridVisualizerCell({ color, children, className }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('block-editor-grid-visualizer__cell', className), style: { boxShadow: `inset 0 0 0 1px color-mix(in srgb, ${color} 20%, #0000)`, color }, children: children }); } function useGridVisualizerDropZone(column, row, gridClientId, gridInfo, setHighlightedRect) { const { getBlockAttributes, getBlockRootClientId, canInsertBlockType, getBlockName } = (0,external_wp_data_namespaceObject.useSelect)(store); const { updateBlockAttributes, moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(store); const getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(gridClientId, gridInfo.numColumns); return useDropZoneWithValidation({ validateDrag(srcClientId) { const blockName = getBlockName(srcClientId); if (!canInsertBlockType(blockName, gridClientId)) { return false; } const attributes = getBlockAttributes(srcClientId); const rect = new GridRect({ columnStart: column, rowStart: row, columnSpan: attributes.style?.layout?.columnSpan, rowSpan: attributes.style?.layout?.rowSpan }); const isInBounds = new GridRect({ columnSpan: gridInfo.numColumns, rowSpan: gridInfo.numRows }).containsRect(rect); return isInBounds; }, onDragEnter(srcClientId) { const attributes = getBlockAttributes(srcClientId); setHighlightedRect(new GridRect({ columnStart: column, rowStart: row, columnSpan: attributes.style?.layout?.columnSpan, rowSpan: attributes.style?.layout?.rowSpan })); }, onDragLeave() { // onDragEnter can be called before onDragLeave if the user moves // their mouse quickly, so only clear the highlight if it was set // by this cell. setHighlightedRect(prevHighlightedRect => prevHighlightedRect?.columnStart === column && prevHighlightedRect?.rowStart === row ? null : prevHighlightedRect); }, onDrop(srcClientId) { setHighlightedRect(null); const attributes = getBlockAttributes(srcClientId); updateBlockAttributes(srcClientId, { style: { ...attributes.style, layout: { ...attributes.style?.layout, columnStart: column, rowStart: row } } }); __unstableMarkNextChangeAsNotPersistent(); moveBlocksToPosition([srcClientId], getBlockRootClientId(srcClientId), gridClientId, getNumberOfBlocksBeforeCell(column, row)); } }); } function GridVisualizerDropZone({ column, row, gridClientId, gridInfo, setHighlightedRect }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-grid-visualizer__drop-zone", ref: useGridVisualizerDropZone(column, row, gridClientId, gridInfo, setHighlightedRect) }); } function GridVisualizerAppender({ column, row, gridClientId, gridInfo, setHighlightedRect }) { const { updateBlockAttributes, moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(store); const getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(gridClientId, gridInfo.numColumns); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(button_block_appender, { rootClientId: gridClientId, className: "block-editor-grid-visualizer__appender", ref: useGridVisualizerDropZone(column, row, gridClientId, gridInfo, setHighlightedRect), style: { color: gridInfo.currentColor }, onSelect: block => { if (!block) { return; } updateBlockAttributes(block.clientId, { style: { layout: { columnStart: column, rowStart: row } } }); __unstableMarkNextChangeAsNotPersistent(); moveBlocksToPosition([block.clientId], gridClientId, gridClientId, getNumberOfBlocksBeforeCell(column, row)); } }); } function useDropZoneWithValidation({ validateDrag, onDragEnter, onDragLeave, onDrop }) { const { getDraggedBlockClientIds } = (0,external_wp_data_namespaceObject.useSelect)(store); return (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({ onDragEnter() { const [srcClientId] = getDraggedBlockClientIds(); if (srcClientId && validateDrag(srcClientId)) { onDragEnter(srcClientId); } }, onDragLeave() { onDragLeave(); }, onDrop() { const [srcClientId] = getDraggedBlockClientIds(); if (srcClientId && validateDrag(srcClientId)) { onDrop(srcClientId); } } }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/grid/grid-item-resizer.js /** * WordPress dependencies */ /** * Internal dependencies */ function GridItemResizer({ clientId, bounds, onChange, parentLayout }) { const blockElement = useBlockElement(clientId); const rootBlockElement = blockElement?.parentElement; const { isManualPlacement } = parentLayout; if (!blockElement || !rootBlockElement) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridItemResizerInner, { clientId: clientId, bounds: bounds, blockElement: blockElement, rootBlockElement: rootBlockElement, onChange: onChange, isManualGrid: isManualPlacement && window.__experimentalEnableGridInteractivity }); } function GridItemResizerInner({ clientId, bounds, blockElement, rootBlockElement, onChange, isManualGrid }) { const [resizeDirection, setResizeDirection] = (0,external_wp_element_namespaceObject.useState)(null); const [enableSide, setEnableSide] = (0,external_wp_element_namespaceObject.useState)({ top: false, bottom: false, left: false, right: false }); (0,external_wp_element_namespaceObject.useEffect)(() => { const observer = new window.ResizeObserver(() => { const blockClientRect = blockElement.getBoundingClientRect(); const rootBlockClientRect = rootBlockElement.getBoundingClientRect(); setEnableSide({ top: blockClientRect.top > rootBlockClientRect.top, bottom: blockClientRect.bottom < rootBlockClientRect.bottom, left: blockClientRect.left > rootBlockClientRect.left, right: blockClientRect.right < rootBlockClientRect.right }); }); observer.observe(blockElement); return () => observer.disconnect(); }, [blockElement, rootBlockElement]); const justification = { right: 'left', left: 'right' }; const alignment = { top: 'flex-end', bottom: 'flex-start' }; const styles = { display: 'flex', justifyContent: 'center', alignItems: 'center', ...(justification[resizeDirection] && { justifyContent: justification[resizeDirection] }), ...(alignment[resizeDirection] && { alignItems: alignment[resizeDirection] }) }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(cover, { className: "block-editor-grid-item-resizer", clientId: clientId, __unstablePopoverSlot: "__unstable-block-tools-after", additionalStyles: styles, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { className: "block-editor-grid-item-resizer__box", size: { width: '100%', height: '100%' }, enable: { bottom: enableSide.bottom, bottomLeft: false, bottomRight: false, left: enableSide.left, right: enableSide.right, top: enableSide.top, topLeft: false, topRight: false }, bounds: bounds, boundsByDirection: true, onPointerDown: ({ target, pointerId }) => { /* * Captures the pointer to avoid hiccups while dragging over objects * like iframes and ensures that the event to end the drag is * captured by the target (resize handle) whether or not it’s under * the pointer. */ target.setPointerCapture(pointerId); }, onResizeStart: (event, direction) => { /* * The container justification and alignment need to be set * according to the direction the resizer is being dragged in, * so that it resizes in the right direction. */ setResizeDirection(direction); }, onResizeStop: (event, direction, boxElement) => { const columnGap = parseFloat(utils_getComputedCSS(rootBlockElement, 'column-gap')); const rowGap = parseFloat(utils_getComputedCSS(rootBlockElement, 'row-gap')); const gridColumnTracks = getGridTracks(utils_getComputedCSS(rootBlockElement, 'grid-template-columns'), columnGap); const gridRowTracks = getGridTracks(utils_getComputedCSS(rootBlockElement, 'grid-template-rows'), rowGap); const rect = new window.DOMRect(blockElement.offsetLeft + boxElement.offsetLeft, blockElement.offsetTop + boxElement.offsetTop, boxElement.offsetWidth, boxElement.offsetHeight); const columnStart = getClosestTrack(gridColumnTracks, rect.left) + 1; const rowStart = getClosestTrack(gridRowTracks, rect.top) + 1; const columnEnd = getClosestTrack(gridColumnTracks, rect.right, 'end') + 1; const rowEnd = getClosestTrack(gridRowTracks, rect.bottom, 'end') + 1; onChange({ columnSpan: columnEnd - columnStart + 1, rowSpan: rowEnd - rowStart + 1, columnStart: isManualGrid ? columnStart : undefined, rowStart: isManualGrid ? rowStart : undefined }); } }) }); } ;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js /** * WordPress dependencies */ const chevronUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) }); /* harmony default export */ const chevron_up = (chevronUp); ;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js /** * WordPress dependencies */ const chevronDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) }); /* harmony default export */ const chevron_down = (chevronDown); ;// ./node_modules/@wordpress/block-editor/build-module/components/grid/grid-item-movers.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function GridItemMovers({ layout, parentLayout, onChange, gridClientId, blockClientId }) { var _layout$columnStart, _layout$rowStart, _layout$columnSpan, _layout$rowSpan; const { moveBlocksToPosition, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(store); const columnStart = (_layout$columnStart = layout?.columnStart) !== null && _layout$columnStart !== void 0 ? _layout$columnStart : 1; const rowStart = (_layout$rowStart = layout?.rowStart) !== null && _layout$rowStart !== void 0 ? _layout$rowStart : 1; const columnSpan = (_layout$columnSpan = layout?.columnSpan) !== null && _layout$columnSpan !== void 0 ? _layout$columnSpan : 1; const rowSpan = (_layout$rowSpan = layout?.rowSpan) !== null && _layout$rowSpan !== void 0 ? _layout$rowSpan : 1; const columnEnd = columnStart + columnSpan - 1; const rowEnd = rowStart + rowSpan - 1; const columnCount = parentLayout?.columnCount; const rowCount = parentLayout?.rowCount; const getNumberOfBlocksBeforeCell = useGetNumberOfBlocksBeforeCell(gridClientId, columnCount); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls, { group: "parent", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { className: "block-editor-grid-item-mover__move-button-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-grid-item-mover__move-horizontal-button-container is-left", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridItemMover, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, label: (0,external_wp_i18n_namespaceObject.__)('Move left'), description: (0,external_wp_i18n_namespaceObject.__)('Move left'), isDisabled: columnStart <= 1, onClick: () => { onChange({ columnStart: columnStart - 1 }); __unstableMarkNextChangeAsNotPersistent(); moveBlocksToPosition([blockClientId], gridClientId, gridClientId, getNumberOfBlocksBeforeCell(columnStart - 1, rowStart)); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-grid-item-mover__move-vertical-button-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridItemMover, { className: "is-up-button", icon: chevron_up, label: (0,external_wp_i18n_namespaceObject.__)('Move up'), description: (0,external_wp_i18n_namespaceObject.__)('Move up'), isDisabled: rowStart <= 1, onClick: () => { onChange({ rowStart: rowStart - 1 }); __unstableMarkNextChangeAsNotPersistent(); moveBlocksToPosition([blockClientId], gridClientId, gridClientId, getNumberOfBlocksBeforeCell(columnStart, rowStart - 1)); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridItemMover, { className: "is-down-button", icon: chevron_down, label: (0,external_wp_i18n_namespaceObject.__)('Move down'), description: (0,external_wp_i18n_namespaceObject.__)('Move down'), isDisabled: rowCount && rowEnd >= rowCount, onClick: () => { onChange({ rowStart: rowStart + 1 }); __unstableMarkNextChangeAsNotPersistent(); moveBlocksToPosition([blockClientId], gridClientId, gridClientId, getNumberOfBlocksBeforeCell(columnStart, rowStart + 1)); } })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-grid-item-mover__move-horizontal-button-container is-right", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridItemMover, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right, label: (0,external_wp_i18n_namespaceObject.__)('Move right'), description: (0,external_wp_i18n_namespaceObject.__)('Move right'), isDisabled: columnCount && columnEnd >= columnCount, onClick: () => { onChange({ columnStart: columnStart + 1 }); __unstableMarkNextChangeAsNotPersistent(); moveBlocksToPosition([blockClientId], gridClientId, gridClientId, getNumberOfBlocksBeforeCell(columnStart + 1, rowStart)); } }) })] }) }); } function GridItemMover({ className, icon, label, isDisabled, onClick, description }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(GridItemMover); const descriptionId = `block-editor-grid-item-mover-button__description-${instanceId}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { className: dist_clsx('block-editor-grid-item-mover-button', className), icon: icon, label: label, "aria-describedby": descriptionId, onClick: isDisabled ? null : onClick, disabled: isDisabled, accessibleWhenDisabled: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: description })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/layout-child.js /** * WordPress dependencies */ /** * Internal dependencies */ // Used for generating the instance ID const LAYOUT_CHILD_BLOCK_PROPS_REFERENCE = {}; function useBlockPropsChildLayoutStyles({ style }) { var _style$layout; const shouldRenderChildLayoutStyles = (0,external_wp_data_namespaceObject.useSelect)(select => { return !select(store).getSettings().disableLayoutStyles; }); const layout = (_style$layout = style?.layout) !== null && _style$layout !== void 0 ? _style$layout : {}; const { selfStretch, flexSize, columnStart, rowStart, columnSpan, rowSpan } = layout; const parentLayout = useLayout() || {}; const { columnCount, minimumColumnWidth } = parentLayout; const id = (0,external_wp_compose_namespaceObject.useInstanceId)(LAYOUT_CHILD_BLOCK_PROPS_REFERENCE); const selector = `.wp-container-content-${id}`; // Check that the grid layout attributes are of the correct type, so that we don't accidentally // write code that stores a string attribute instead of a number. if (false) {} let css = ''; if (shouldRenderChildLayoutStyles) { if (selfStretch === 'fixed' && flexSize) { css = `${selector} { flex-basis: ${flexSize}; box-sizing: border-box; }`; } else if (selfStretch === 'fill') { css = `${selector} { flex-grow: 1; }`; } else if (columnStart && columnSpan) { css = `${selector} { grid-column: ${columnStart} / span ${columnSpan}; }`; } else if (columnStart) { css = `${selector} { grid-column: ${columnStart}; }`; } else if (columnSpan) { css = `${selector} { grid-column: span ${columnSpan}; }`; } if (rowStart && rowSpan) { css += `${selector} { grid-row: ${rowStart} / span ${rowSpan}; }`; } else if (rowStart) { css += `${selector} { grid-row: ${rowStart}; }`; } else if (rowSpan) { css += `${selector} { grid-row: span ${rowSpan}; }`; } /** * If minimumColumnWidth is set on the parent, or if no * columnCount is set, the grid is responsive so a * container query is needed for the span to resize. */ if ((columnSpan || columnStart) && (minimumColumnWidth || !columnCount)) { let parentColumnValue = parseFloat(minimumColumnWidth); /** * 12rem is the default minimumColumnWidth value. * If parentColumnValue is not a number, default to 12. */ if (isNaN(parentColumnValue)) { parentColumnValue = 12; } let parentColumnUnit = minimumColumnWidth?.replace(parentColumnValue, ''); /** * Check that parent column unit is either 'px', 'rem' or 'em'. * If not, default to 'rem'. */ if (!['px', 'rem', 'em'].includes(parentColumnUnit)) { parentColumnUnit = 'rem'; } let numColsToBreakAt = 2; if (columnSpan && columnStart) { numColsToBreakAt = columnSpan + columnStart - 1; } else if (columnSpan) { numColsToBreakAt = columnSpan; } else { numColsToBreakAt = columnStart; } const defaultGapValue = parentColumnUnit === 'px' ? 24 : 1.5; const containerQueryValue = numColsToBreakAt * parentColumnValue + (numColsToBreakAt - 1) * defaultGapValue; // For blocks that only span one column, we want to remove any rowStart values as // the container reduces in size, so that blocks are still arranged in markup order. const minimumContainerQueryValue = parentColumnValue * 2 + defaultGapValue - 1; // If a span is set we want to preserve it as long as possible, otherwise we just reset the value. const gridColumnValue = columnSpan && columnSpan > 1 ? '1/-1' : 'auto'; css += `@container (max-width: ${Math.max(containerQueryValue, minimumContainerQueryValue)}${parentColumnUnit}) { ${selector} { grid-column: ${gridColumnValue}; grid-row: auto; } }`; } } useStyleOverride({ css }); // Only attach a container class if there is generated CSS to be attached. if (!css) { return; } // Attach a `wp-container-content` id-based classname. return { className: `wp-container-content-${id}` }; } function ChildLayoutControlsPure({ clientId, style, setAttributes }) { const parentLayout = useLayout() || {}; const { type: parentLayoutType = 'default', allowSizingOnChildren = false, isManualPlacement } = parentLayout; if (parentLayoutType !== 'grid') { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridTools, { clientId: clientId, style: style, setAttributes: setAttributes, allowSizingOnChildren: allowSizingOnChildren, isManualPlacement: isManualPlacement, parentLayout: parentLayout }); } function GridTools({ clientId, style, setAttributes, allowSizingOnChildren, isManualPlacement, parentLayout }) { const { rootClientId, isVisible } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId, getBlockEditingMode, getTemplateLock } = select(store); const _rootClientId = getBlockRootClientId(clientId); if (getTemplateLock(_rootClientId) || getBlockEditingMode(_rootClientId) !== 'default') { return { rootClientId: _rootClientId, isVisible: false }; } return { rootClientId: _rootClientId, isVisible: true }; }, [clientId]); // Use useState() instead of useRef() so that GridItemResizer updates when ref is set. const [resizerBounds, setResizerBounds] = (0,external_wp_element_namespaceObject.useState)(); if (!isVisible) { return null; } function updateLayout(layout) { setAttributes({ style: { ...style, layout: { ...style?.layout, ...layout } } }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridVisualizer, { clientId: rootClientId, contentRef: setResizerBounds, parentLayout: parentLayout }), allowSizingOnChildren && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridItemResizer, { clientId: clientId // Don't allow resizing beyond the grid visualizer. , bounds: resizerBounds, onChange: updateLayout, parentLayout: parentLayout }), isManualPlacement && window.__experimentalEnableGridInteractivity && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridItemMovers, { layout: style?.layout, parentLayout: parentLayout, onChange: updateLayout, gridClientId: rootClientId, blockClientId: clientId })] }); } /* harmony default export */ const layout_child = ({ useBlockProps: useBlockPropsChildLayoutStyles, edit: ChildLayoutControlsPure, attributeKeys: ['style'], hasSupport() { return true; } }); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/content-lock-ui.js /** * WordPress dependencies */ /** * Internal dependencies */ // The implementation of content locking is mainly in this file, although the mechanism // to stop temporarily editing as blocks when an outside block is selected is on component StopEditingAsBlocksOnOutsideSelect // at block-editor/src/components/block-list/index.js. // Besides the components on this file and the file referenced above the implementation // also includes artifacts on the store (actions, reducers, and selector). function ContentLockControlsPure({ clientId }) { const { templateLock, isLockedByParent, isEditingAsBlocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getContentLockingParent, getTemplateLock, getTemporarilyEditingAsBlocks } = unlock(select(store)); return { templateLock: getTemplateLock(clientId), isLockedByParent: !!getContentLockingParent(clientId), isEditingAsBlocks: getTemporarilyEditingAsBlocks() === clientId }; }, [clientId]); const { stopEditingAsBlocks } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const isContentLocked = !isLockedByParent && templateLock === 'contentOnly'; const stopEditingAsBlockCallback = (0,external_wp_element_namespaceObject.useCallback)(() => { stopEditingAsBlocks(clientId); }, [clientId, stopEditingAsBlocks]); if (!isContentLocked && !isEditingAsBlocks) { return null; } const showStopEditingAsBlocks = isEditingAsBlocks && !isContentLocked; return showStopEditingAsBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: stopEditingAsBlockCallback, children: (0,external_wp_i18n_namespaceObject.__)('Done') }) }); } /* harmony default export */ const content_lock_ui = ({ edit: ContentLockControlsPure, hasSupport() { return true; } }); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/metadata.js /** * WordPress dependencies */ const META_ATTRIBUTE_NAME = 'metadata'; /** * Filters registered block settings, extending attributes to include `metadata`. * * see: https://github.com/WordPress/gutenberg/pull/40393/files#r864632012 * * @param {Object} blockTypeSettings Original block settings. * @return {Object} Filtered block settings. */ function addMetaAttribute(blockTypeSettings) { // Allow blocks to specify their own attribute definition with default values if needed. if (blockTypeSettings?.attributes?.[META_ATTRIBUTE_NAME]?.type) { return blockTypeSettings; } blockTypeSettings.attributes = { ...blockTypeSettings.attributes, [META_ATTRIBUTE_NAME]: { type: 'object' } }; return blockTypeSettings; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/metadata/addMetaAttribute', addMetaAttribute); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/block-hooks.js /** * WordPress dependencies */ /** * Internal dependencies */ const block_hooks_EMPTY_OBJECT = {}; function BlockHooksControlPure({ name, clientId, metadata: { ignoredHookedBlocks = [] } = {} }) { const blockTypes = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getBlockTypes(), []); // A hooked block added via a filter will not be exposed through a block // type's `blockHooks` property; however, if the containing layout has been // modified, it will be present in the anchor block's `ignoredHookedBlocks` // metadata. const hookedBlocksForCurrentBlock = (0,external_wp_element_namespaceObject.useMemo)(() => blockTypes?.filter(({ name: blockName, blockHooks }) => blockHooks && name in blockHooks || ignoredHookedBlocks.includes(blockName)), [blockTypes, name, ignoredHookedBlocks]); const hookedBlockClientIds = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlocks, getBlockRootClientId, getGlobalBlockCount } = select(store); const rootClientId = getBlockRootClientId(clientId); const _hookedBlockClientIds = hookedBlocksForCurrentBlock.reduce((clientIds, block) => { // If the block doesn't exist anywhere in the block tree, // we know that we have to set the toggle to disabled. if (getGlobalBlockCount(block.name) === 0) { return clientIds; } const relativePosition = block?.blockHooks?.[name]; let candidates; switch (relativePosition) { case 'before': case 'after': // Any of the current block's siblings (with the right block type) qualifies // as a hooked block (inserted `before` or `after` the current one), as the block // might've been automatically inserted and then moved around a bit by the user. candidates = getBlocks(rootClientId); break; case 'first_child': case 'last_child': // Any of the current block's child blocks (with the right block type) qualifies // as a hooked first or last child block, as the block might've been automatically // inserted and then moved around a bit by the user. candidates = getBlocks(clientId); break; case undefined: // If we haven't found a blockHooks field with a relative position for the hooked // block, it means that it was added by a filter. In this case, we look for the block // both among the current block's siblings and its children. candidates = [...getBlocks(rootClientId), ...getBlocks(clientId)]; break; } const hookedBlock = candidates?.find(candidate => candidate.name === block.name); // If the block exists in the designated location, we consider it hooked // and show the toggle as enabled. if (hookedBlock) { return { ...clientIds, [block.name]: hookedBlock.clientId }; } // If no hooked block was found in any of its designated locations, // we set the toggle to disabled. return clientIds; }, {}); if (Object.values(_hookedBlockClientIds).length > 0) { return _hookedBlockClientIds; } return block_hooks_EMPTY_OBJECT; }, [hookedBlocksForCurrentBlock, name, clientId]); const { getBlockIndex, getBlockCount, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store); const { insertBlock, removeBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); if (!hookedBlocksForCurrentBlock.length) { return null; } // Group by block namespace (i.e. prefix before the slash). const groupedHookedBlocks = hookedBlocksForCurrentBlock.reduce((groups, block) => { const [namespace] = block.name.split('/'); if (!groups[namespace]) { groups[namespace] = []; } groups[namespace].push(block); return groups; }, {}); const insertBlockIntoDesignatedLocation = (block, relativePosition) => { const blockIndex = getBlockIndex(clientId); const innerBlocksLength = getBlockCount(clientId); const rootClientId = getBlockRootClientId(clientId); switch (relativePosition) { case 'before': case 'after': insertBlock(block, relativePosition === 'after' ? blockIndex + 1 : blockIndex, rootClientId, // Insert as a child of the current block's parent false); break; case 'first_child': case 'last_child': insertBlock(block, // TODO: It'd be great if insertBlock() would accept negative indices for insertion. relativePosition === 'first_child' ? 0 : innerBlocksLength, clientId, // Insert as a child of the current block. false); break; case undefined: // If we do not know the relative position, it is because the block was // added via a filter. In this case, we default to inserting it after the // current block. insertBlock(block, blockIndex + 1, rootClientId, // Insert as a child of the current block's parent false); break; } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { className: "block-editor-hooks__block-hooks", title: (0,external_wp_i18n_namespaceObject.__)('Plugins'), initialOpen: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-hooks__block-hooks-helptext", children: (0,external_wp_i18n_namespaceObject.__)('Manage the inclusion of blocks added automatically by plugins.') }), Object.keys(groupedHookedBlocks).map(vendor => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_element_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { children: vendor }), groupedHookedBlocks[vendor].map(block => { const checked = block.name in hookedBlockClientIds; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, checked: checked, label: block.title, onChange: () => { if (!checked) { // Create and insert block. const relativePosition = block.blockHooks[name]; insertBlockIntoDesignatedLocation((0,external_wp_blocks_namespaceObject.createBlock)(block.name), relativePosition); return; } // Remove block. removeBlock(hookedBlockClientIds[block.name], false); } }, block.title); })] }, vendor); })] }) }); } /* harmony default export */ const block_hooks = ({ edit: BlockHooksControlPure, attributeKeys: ['metadata'], hasSupport() { return true; } }); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/block-bindings.js /** * WordPress dependencies */ /** * Internal dependencies */ const { Menu } = unlock(external_wp_components_namespaceObject.privateApis); const block_bindings_EMPTY_OBJECT = {}; const block_bindings_useToolsPanelDropdownMenuProps = () => { const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); return !isMobile ? { popoverProps: { placement: 'left-start', // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) offset: 259 } } : {}; }; function BlockBindingsPanelMenuContent({ fieldsList, attribute, binding }) { const { clientId } = useBlockEditContext(); const registeredSources = (0,external_wp_blocks_namespaceObject.getBlockBindingsSources)(); const { updateBlockBindings } = useBlockBindingsUtils(); const currentKey = binding?.args?.key; const attributeType = (0,external_wp_data_namespaceObject.useSelect)(select => { const { name: blockName } = select(store).getBlock(clientId); const _attributeType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName).attributes?.[attribute]?.type; return _attributeType === 'rich-text' ? 'string' : _attributeType; }, [clientId, attribute]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: Object.entries(fieldsList).map(([name, fields], i) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_element_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu.Group, { children: [Object.keys(fieldsList).length > 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.GroupLabel, { children: registeredSources[name].label }), Object.entries(fields).filter(([, args]) => args?.type === attributeType).map(([key, args]) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu.RadioItem, { onChange: () => updateBlockBindings({ [attribute]: { source: name, args: { key } } }), name: attribute + '-binding', value: key, checked: key === currentKey, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemLabel, { children: args?.label }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.ItemHelpText, { children: args?.value })] }, key))] }), i !== Object.keys(fieldsList).length - 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Separator, {})] }, name)) }); } function BlockBindingsAttribute({ attribute, binding, fieldsList }) { const { source: sourceName, args } = binding || {}; const sourceProps = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(sourceName); const isSourceInvalid = !sourceProps; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "block-editor-bindings__item", spacing: 0, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { truncate: true, children: attribute }), !!binding && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { truncate: true, variant: !isSourceInvalid && 'muted', isDestructive: isSourceInvalid, children: isSourceInvalid ? (0,external_wp_i18n_namespaceObject.__)('Invalid source') : fieldsList?.[sourceName]?.[args?.key]?.label || sourceProps?.label || sourceName })] }); } function ReadOnlyBlockBindingsPanelItems({ bindings, fieldsList }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: Object.entries(bindings).map(([attribute, binding]) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockBindingsAttribute, { attribute: attribute, binding: binding, fieldsList: fieldsList }) }, attribute)) }); } function EditableBlockBindingsPanelItems({ attributes, bindings, fieldsList }) { const { updateBlockBindings } = useBlockBindingsUtils(); const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: attributes.map(attribute => { const binding = bindings[attribute]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!binding, label: attribute, onDeselect: () => { updateBlockBindings({ [attribute]: undefined }); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Menu, { placement: isMobile ? 'bottom-start' : 'left-start', children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.TriggerButton, { render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItem, {}), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockBindingsAttribute, { attribute: attribute, binding: binding, fieldsList: fieldsList }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Menu.Popover, { gutter: isMobile ? 8 : 36, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockBindingsPanelMenuContent, { fieldsList: fieldsList, attribute: attribute, binding: binding }) })] }) }, attribute); }) }); } const BlockBindingsPanel = ({ name: blockName, metadata }) => { const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context); const { removeAllBlockBindings } = useBlockBindingsUtils(); const bindableAttributes = getBindableAttributes(blockName); const dropdownMenuProps = block_bindings_useToolsPanelDropdownMenuProps(); // `useSelect` is used purposely here to ensure `getFieldsList` // is updated whenever there are updates in block context. // `source.getFieldsList` may also call a selector via `select`. const _fieldsList = {}; const { fieldsList, canUpdateBlockBindings } = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!bindableAttributes || bindableAttributes.length === 0) { return block_bindings_EMPTY_OBJECT; } const registeredSources = (0,external_wp_blocks_namespaceObject.getBlockBindingsSources)(); Object.entries(registeredSources).forEach(([sourceName, { getFieldsList, usesContext }]) => { if (getFieldsList) { // Populate context. const context = {}; if (usesContext?.length) { for (const key of usesContext) { context[key] = blockContext[key]; } } const sourceList = getFieldsList({ select, context }); // Only add source if the list is not empty. if (Object.keys(sourceList || {}).length) { _fieldsList[sourceName] = { ...sourceList }; } } }); return { fieldsList: Object.values(_fieldsList).length > 0 ? _fieldsList : block_bindings_EMPTY_OBJECT, canUpdateBlockBindings: select(store).getSettings().canUpdateBlockBindings }; }, [blockContext, bindableAttributes]); // Return early if there are no bindable attributes. if (!bindableAttributes || bindableAttributes.length === 0) { return null; } // Filter bindings to only show bindable attributes and remove pattern overrides. const { bindings } = metadata || {}; const filteredBindings = { ...bindings }; Object.keys(filteredBindings).forEach(key => { if (!canBindAttribute(blockName, key) || filteredBindings[key].source === 'core/pattern-overrides') { delete filteredBindings[key]; } }); // Lock the UI when the user can't update bindings or there are no fields to connect to. const readOnly = !canUpdateBlockBindings || !Object.keys(fieldsList).length; if (readOnly && Object.keys(filteredBindings).length === 0) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls, { group: "bindings", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Attributes'), resetAll: () => { removeAllBlockBindings(); }, dropdownMenuProps: dropdownMenuProps, className: "block-editor-bindings__panel", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { isBordered: true, isSeparated: true, children: readOnly ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReadOnlyBlockBindingsPanelItems, { bindings: filteredBindings, fieldsList: fieldsList }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditableBlockBindingsPanelItems, { attributes: bindableAttributes, bindings: filteredBindings, fieldsList: fieldsList }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { as: "div", variant: "muted", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('Attributes connected to custom fields or other dynamic data.') }) })] }) }); }; /* harmony default export */ const block_bindings = ({ edit: BlockBindingsPanel, attributeKeys: ['metadata'], hasSupport() { return true; } }); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/block-renaming.js /** * WordPress dependencies */ /** * Filters registered block settings, adding an `__experimentalLabel` callback if one does not already exist. * * @param {Object} settings Original block settings. * * @return {Object} Filtered block settings. */ function addLabelCallback(settings) { // If blocks provide their own label callback, do not override it. if (settings.__experimentalLabel) { return settings; } const supportsBlockNaming = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(settings, 'renaming', true // default value ); // Check whether block metadata is supported before using it. if (supportsBlockNaming) { settings.__experimentalLabel = (attributes, { context }) => { const { metadata } = attributes; // In the list view, use the block's name attribute as the label. if (context === 'list-view' && metadata?.name) { return metadata.name; } }; } return settings; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/metadata/addLabelCallback', addLabelCallback); ;// ./node_modules/@wordpress/block-editor/build-module/components/grid/use-grid-layout-sync.js /** * WordPress dependencies */ /** * Internal dependencies */ function useGridLayoutSync({ clientId: gridClientId }) { const { gridLayout, blockOrder, selectedBlockLayout } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getBlockAttributes$l; const { getBlockAttributes, getBlockOrder } = select(store); const selectedBlock = select(store).getSelectedBlock(); return { gridLayout: (_getBlockAttributes$l = getBlockAttributes(gridClientId).layout) !== null && _getBlockAttributes$l !== void 0 ? _getBlockAttributes$l : {}, blockOrder: getBlockOrder(gridClientId), selectedBlockLayout: selectedBlock?.attributes.style?.layout }; }, [gridClientId]); const { getBlockAttributes, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store); const { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(store); const selectedBlockRect = (0,external_wp_element_namespaceObject.useMemo)(() => selectedBlockLayout ? new GridRect(selectedBlockLayout) : null, [selectedBlockLayout]); const previouslySelectedBlockRect = (0,external_wp_compose_namespaceObject.usePrevious)(selectedBlockRect); const previousIsManualPlacement = (0,external_wp_compose_namespaceObject.usePrevious)(gridLayout.isManualPlacement); const previousBlockOrder = (0,external_wp_compose_namespaceObject.usePrevious)(blockOrder); (0,external_wp_element_namespaceObject.useEffect)(() => { const updates = {}; if (gridLayout.isManualPlacement) { const occupiedRects = []; // Respect the position of blocks that already have a columnStart and rowStart value. for (const clientId of blockOrder) { var _getBlockAttributes$s; const { columnStart, rowStart, columnSpan = 1, rowSpan = 1 } = (_getBlockAttributes$s = getBlockAttributes(clientId).style?.layout) !== null && _getBlockAttributes$s !== void 0 ? _getBlockAttributes$s : {}; if (!columnStart || !rowStart) { continue; } occupiedRects.push(new GridRect({ columnStart, rowStart, columnSpan, rowSpan })); } // When in manual mode, ensure that every block has a columnStart and rowStart value. for (const clientId of blockOrder) { var _attributes$style$lay; const attributes = getBlockAttributes(clientId); const { columnStart, rowStart, columnSpan = 1, rowSpan = 1 } = (_attributes$style$lay = attributes.style?.layout) !== null && _attributes$style$lay !== void 0 ? _attributes$style$lay : {}; if (columnStart && rowStart) { continue; } const [newColumnStart, newRowStart] = placeBlock(occupiedRects, gridLayout.columnCount, columnSpan, rowSpan, previouslySelectedBlockRect?.columnEnd, previouslySelectedBlockRect?.rowEnd); occupiedRects.push(new GridRect({ columnStart: newColumnStart, rowStart: newRowStart, columnSpan, rowSpan })); updates[clientId] = { style: { ...attributes.style, layout: { ...attributes.style?.layout, columnStart: newColumnStart, rowStart: newRowStart } } }; } // Ensure there's enough rows to fit all blocks. const bottomMostRow = Math.max(...occupiedRects.map(r => r.rowEnd)); if (!gridLayout.rowCount || gridLayout.rowCount < bottomMostRow) { updates[gridClientId] = { layout: { ...gridLayout, rowCount: bottomMostRow } }; } // Unset grid layout attributes for blocks removed from the grid. for (const clientId of previousBlockOrder !== null && previousBlockOrder !== void 0 ? previousBlockOrder : []) { if (!blockOrder.includes(clientId)) { var _attributes$style$lay2; const rootClientId = getBlockRootClientId(clientId); // Block was removed from the editor, so nothing to do. if (rootClientId === null) { continue; } // Check if the block is being moved to another grid. // If so, do nothing and let the new grid parent handle // the attributes. const rootAttributes = getBlockAttributes(rootClientId); if (rootAttributes?.layout?.type === 'grid') { continue; } const attributes = getBlockAttributes(clientId); const { columnStart, rowStart, columnSpan, rowSpan, ...layout } = (_attributes$style$lay2 = attributes.style?.layout) !== null && _attributes$style$lay2 !== void 0 ? _attributes$style$lay2 : {}; if (columnStart || rowStart || columnSpan || rowSpan) { const hasEmptyLayoutAttribute = Object.keys(layout).length === 0; updates[clientId] = setImmutably(attributes, ['style', 'layout'], hasEmptyLayoutAttribute ? undefined : layout); } } } } else { // Remove all of the columnStart and rowStart values // when switching from manual to auto mode, if (previousIsManualPlacement === true) { for (const clientId of blockOrder) { var _attributes$style$lay3; const attributes = getBlockAttributes(clientId); const { columnStart, rowStart, ...layout } = (_attributes$style$lay3 = attributes.style?.layout) !== null && _attributes$style$lay3 !== void 0 ? _attributes$style$lay3 : {}; // Only update attributes if columnStart or rowStart are set. if (columnStart || rowStart) { const hasEmptyLayoutAttribute = Object.keys(layout).length === 0; updates[clientId] = setImmutably(attributes, ['style', 'layout'], hasEmptyLayoutAttribute ? undefined : layout); } } } // Remove row styles in auto mode if (gridLayout.rowCount) { updates[gridClientId] = { layout: { ...gridLayout, rowCount: undefined } }; } } if (Object.keys(updates).length) { __unstableMarkNextChangeAsNotPersistent(); updateBlockAttributes(Object.keys(updates), updates, /* uniqueByBlock: */true); } }, [ // Actual deps to sync: gridClientId, gridLayout, previousBlockOrder, blockOrder, previouslySelectedBlockRect, previousIsManualPlacement, // These won't change, but the linter thinks they might: __unstableMarkNextChangeAsNotPersistent, getBlockAttributes, getBlockRootClientId, updateBlockAttributes]); } /** * @param {GridRect[]} occupiedRects * @param {number} gridColumnCount * @param {number} blockColumnSpan * @param {number} blockRowSpan * @param {number?} startColumn * @param {number?} startRow */ function placeBlock(occupiedRects, gridColumnCount, blockColumnSpan, blockRowSpan, startColumn = 1, startRow = 1) { for (let row = startRow;; row++) { for (let column = row === startRow ? startColumn : 1; column <= gridColumnCount; column++) { const candidateRect = new GridRect({ columnStart: column, rowStart: row, columnSpan: blockColumnSpan, rowSpan: blockRowSpan }); if (!occupiedRects.some(r => r.intersectsRect(candidateRect))) { return [column, row]; } } } } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/grid-visualizer.js /** * WordPress dependencies */ /** * Internal dependencies */ function GridLayoutSync(props) { useGridLayoutSync(props); } function grid_visualizer_GridTools({ clientId, layout }) { const isVisible = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isBlockSelected, isDraggingBlocks, getTemplateLock, getBlockEditingMode } = select(store); // These calls are purposely ordered from least expensive to most expensive. // Hides the visualizer in cases where the user is not or cannot interact with it. if (!isDraggingBlocks() && !isBlockSelected(clientId) || getTemplateLock(clientId) || getBlockEditingMode(clientId) !== 'default') { return false; } return true; }, [clientId]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridLayoutSync, { clientId: clientId }), isVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GridVisualizer, { clientId: clientId, parentLayout: layout })] }); } const addGridVisualizerToBlockEdit = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => { if (props.attributes.layout?.type !== 'grid') { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props }, "edit"); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(grid_visualizer_GridTools, { clientId: props.clientId, layout: props.attributes.layout }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEdit, { ...props }, "edit")] }); }, 'addGridVisualizerToBlockEdit'); (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/editor/grid-visualizer', addGridVisualizerToBlockEdit); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-border-props.js /** * Internal dependencies */ // This utility is intended to assist where the serialization of the border // block support is being skipped for a block but the border related CSS classes // & styles still need to be generated so they can be applied to inner elements. /** * Provides the CSS class names and inline styles for a block's border support * attributes. * * @param {Object} attributes Block attributes. * @return {Object} Border block support derived CSS classes & styles. */ function getBorderClassesAndStyles(attributes) { const border = attributes.style?.border || {}; const className = getBorderClasses(attributes); return { className: className || undefined, style: getInlineStyles({ border }) }; } /** * Derives the border related props for a block from its border block support * attributes. * * Inline styles are forced for named colors to ensure these selections are * reflected when themes do not load their color stylesheets in the editor. * * @param {Object} attributes Block attributes. * * @return {Object} ClassName & style props from border block support. */ function useBorderProps(attributes) { const { colors } = useMultipleOriginColorsAndGradients(); const borderProps = getBorderClassesAndStyles(attributes); const { borderColor } = attributes; // Force inline styles to apply named border colors when themes do not load // their color stylesheets in the editor. if (borderColor) { const borderColorObject = getMultiOriginColor({ colors, namedColor: borderColor }); borderProps.style.borderColor = borderColorObject.color; } return borderProps; } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-shadow-props.js /** * Internal dependencies */ // This utility is intended to assist where the serialization of the shadow // block support is being skipped for a block but the shadow related CSS classes // & styles still need to be generated so they can be applied to inner elements. /** * Provides the CSS class names and inline styles for a block's shadow support * attributes. * * @param {Object} attributes Block attributes. * @return {Object} Shadow block support derived CSS classes & styles. */ function getShadowClassesAndStyles(attributes) { const shadow = attributes.style?.shadow || ''; return { style: getInlineStyles({ shadow }) }; } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-color-props.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ // The code in this file has largely been lifted from the color block support // hook. // // This utility is intended to assist where the serialization of the colors // block support is being skipped for a block but the color related CSS classes // & styles still need to be generated so they can be applied to inner elements. /** * Provides the CSS class names and inline styles for a block's color support * attributes. * * @param {Object} attributes Block attributes. * * @return {Object} Color block support derived CSS classes & styles. */ function getColorClassesAndStyles(attributes) { const { backgroundColor, textColor, gradient, style } = attributes; // Collect color CSS classes. const backgroundClass = getColorClassName('background-color', backgroundColor); const textClass = getColorClassName('color', textColor); const gradientClass = __experimentalGetGradientClass(gradient); const hasGradient = gradientClass || style?.color?.gradient; // Determine color CSS class name list. const className = dist_clsx(textClass, gradientClass, { // Don't apply the background class if there's a gradient. [backgroundClass]: !hasGradient && !!backgroundClass, 'has-text-color': textColor || style?.color?.text, 'has-background': backgroundColor || style?.color?.background || gradient || style?.color?.gradient, 'has-link-color': style?.elements?.link?.color }); // Collect inline styles for colors. const colorStyles = style?.color || {}; const styleProp = getInlineStyles({ color: colorStyles }); return { className: className || undefined, style: styleProp }; } /** * Determines the color related props for a block derived from its color block * support attributes. * * Inline styles are forced for named colors to ensure these selections are * reflected when themes do not load their color stylesheets in the editor. * * @param {Object} attributes Block attributes. * * @return {Object} ClassName & style props from colors block support. */ function useColorProps(attributes) { const { backgroundColor, textColor, gradient } = attributes; const [userPalette, themePalette, defaultPalette, userGradients, themeGradients, defaultGradients] = use_settings_useSettings('color.palette.custom', 'color.palette.theme', 'color.palette.default', 'color.gradients.custom', 'color.gradients.theme', 'color.gradients.default'); const colors = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]); const gradients = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userGradients || []), ...(themeGradients || []), ...(defaultGradients || [])], [userGradients, themeGradients, defaultGradients]); const colorProps = getColorClassesAndStyles(attributes); // Force inline styles to apply colors when themes do not load their color // stylesheets in the editor. if (backgroundColor) { const backgroundColorObject = getColorObjectByAttributeValues(colors, backgroundColor); colorProps.style.backgroundColor = backgroundColorObject.color; } if (gradient) { colorProps.style.background = getGradientValueBySlug(gradients, gradient); } if (textColor) { const textColorObject = getColorObjectByAttributeValues(colors, textColor); colorProps.style.color = textColorObject.color; } return colorProps; } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-spacing-props.js /** * Internal dependencies */ // This utility is intended to assist where the serialization of the spacing // block support is being skipped for a block but the spacing related CSS // styles still need to be generated so they can be applied to inner elements. /** * Provides the CSS class names and inline styles for a block's spacing support * attributes. * * @param {Object} attributes Block attributes. * * @return {Object} Spacing block support derived CSS classes & styles. */ function getSpacingClassesAndStyles(attributes) { const { style } = attributes; // Collect inline styles for spacing. const spacingStyles = style?.spacing || {}; const styleProp = getInlineStyles({ spacing: spacingStyles }); return { style: styleProp }; } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-typography-props.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { kebabCase: use_typography_props_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); /* * This utility is intended to assist where the serialization of the typography * block support is being skipped for a block but the typography related CSS * styles still need to be generated so they can be applied to inner elements. */ /** * Provides the CSS class names and inline styles for a block's typography support * attributes. * * @param {Object} attributes Block attributes. * @param {Object|boolean} settings Merged theme.json settings * * @return {Object} Typography block support derived CSS classes & styles. */ function getTypographyClassesAndStyles(attributes, settings) { let typographyStyles = attributes?.style?.typography || {}; typographyStyles = { ...typographyStyles, fontSize: getTypographyFontSizeValue({ size: attributes?.style?.typography?.fontSize }, settings) }; const style = getInlineStyles({ typography: typographyStyles }); const fontFamilyClassName = !!attributes?.fontFamily ? `has-${use_typography_props_kebabCase(attributes.fontFamily)}-font-family` : ''; const textAlignClassName = !!attributes?.style?.typography?.textAlign ? `has-text-align-${attributes?.style?.typography?.textAlign}` : ''; const className = dist_clsx(fontFamilyClassName, textAlignClassName, getFontSizeClass(attributes?.fontSize)); return { className, style }; } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/use-cached-truthy.js /** * WordPress dependencies */ /** * Keeps an up-to-date copy of the passed value and returns it. If value becomes falsy, it will return the last truthy copy. * * @param {any} value * @return {any} value */ function useCachedTruthy(value) { const [cachedValue, setCachedValue] = (0,external_wp_element_namespaceObject.useState)(value); (0,external_wp_element_namespaceObject.useEffect)(() => { if (value) { setCachedValue(value); } }, [value]); return cachedValue; } ;// ./node_modules/@wordpress/block-editor/build-module/hooks/index.js /** * Internal dependencies */ createBlockEditFilter([align, text_align, hooks_anchor, custom_class_name, style, duotone, position, layout, content_lock_ui, block_hooks, block_bindings, layout_child].filter(Boolean)); createBlockListBlockFilter([align, text_align, background, style, color, dimensions, duotone, font_family, font_size, border, position, block_style_variation, layout_child]); createBlockSaveFilter([align, text_align, hooks_anchor, aria_label, custom_class_name, border, color, style, font_family, font_size]); ;// ./node_modules/@wordpress/block-editor/build-module/components/colors/with-colors.js /** * WordPress dependencies */ /** * Internal dependencies */ const { kebabCase: with_colors_kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); /** * Capitalizes the first letter in a string. * * @param {string} str The string whose first letter the function will capitalize. * * @return {string} Capitalized string. */ const upperFirst = ([firstLetter, ...rest]) => firstLetter.toUpperCase() + rest.join(''); /** * Higher order component factory for injecting the `colorsArray` argument as * the colors prop in the `withCustomColors` HOC. * * @param {Array} colorsArray An array of color objects. * * @return {Function} The higher order component. */ const withCustomColorPalette = colorsArray => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...props, colors: colorsArray }), 'withCustomColorPalette'); /** * Higher order component factory for injecting the editor colors as the * `colors` prop in the `withColors` HOC. * * @return {Function} The higher order component. */ const withEditorColorPalette = () => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => { const [userPalette, themePalette, defaultPalette] = use_settings_useSettings('color.palette.custom', 'color.palette.theme', 'color.palette.default'); const allColors = (0,external_wp_element_namespaceObject.useMemo)(() => [...(userPalette || []), ...(themePalette || []), ...(defaultPalette || [])], [userPalette, themePalette, defaultPalette]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...props, colors: allColors }); }, 'withEditorColorPalette'); /** * Helper function used with `createHigherOrderComponent` to create * higher order components for managing color logic. * * @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor). * @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent. * * @return {Component} The component that can be used as a HOC. */ function createColorHOC(colorTypes, withColorPalette) { const colorMap = colorTypes.reduce((colorObject, colorType) => { return { ...colorObject, ...(typeof colorType === 'string' ? { [colorType]: with_colors_kebabCase(colorType) } : colorType) }; }, {}); return (0,external_wp_compose_namespaceObject.compose)([withColorPalette, WrappedComponent => { return class extends external_wp_element_namespaceObject.Component { constructor(props) { super(props); this.setters = this.createSetters(); this.colorUtils = { getMostReadableColor: this.getMostReadableColor.bind(this) }; this.state = {}; } getMostReadableColor(colorValue) { const { colors } = this.props; return getMostReadableColor(colors, colorValue); } createSetters() { return Object.keys(colorMap).reduce((settersAccumulator, colorAttributeName) => { const upperFirstColorAttributeName = upperFirst(colorAttributeName); const customColorAttributeName = `custom${upperFirstColorAttributeName}`; settersAccumulator[`set${upperFirstColorAttributeName}`] = this.createSetColor(colorAttributeName, customColorAttributeName); return settersAccumulator; }, {}); } createSetColor(colorAttributeName, customColorAttributeName) { return colorValue => { const colorObject = getColorObjectByColorValue(this.props.colors, colorValue); this.props.setAttributes({ [colorAttributeName]: colorObject && colorObject.slug ? colorObject.slug : undefined, [customColorAttributeName]: colorObject && colorObject.slug ? undefined : colorValue }); }; } static getDerivedStateFromProps({ attributes, colors }, previousState) { return Object.entries(colorMap).reduce((newState, [colorAttributeName, colorContext]) => { const colorObject = getColorObjectByAttributeValues(colors, attributes[colorAttributeName], attributes[`custom${upperFirst(colorAttributeName)}`]); const previousColorObject = previousState[colorAttributeName]; const previousColor = previousColorObject?.color; /** * The "and previousColorObject" condition checks that a previous color object was already computed. * At the start previousColorObject and colorValue are both equal to undefined * bus as previousColorObject does not exist we should compute the object. */ if (previousColor === colorObject.color && previousColorObject) { newState[colorAttributeName] = previousColorObject; } else { newState[colorAttributeName] = { ...colorObject, class: getColorClassName(colorContext, colorObject.slug) }; } return newState; }, {}); } render() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...this.props, colors: undefined, ...this.state, ...this.setters, colorUtils: this.colorUtils }); } }; }]); } /** * A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic * for class generation color value, retrieval and color attribute setting. * * Use this higher-order component to work with a custom set of colors. * * @example * * ```jsx * const CUSTOM_COLORS = [ { name: 'Red', slug: 'red', color: '#ff0000' }, { name: 'Blue', slug: 'blue', color: '#0000ff' } ]; * const withCustomColors = createCustomColorsHOC( CUSTOM_COLORS ); * // ... * export default compose( * withCustomColors( 'backgroundColor', 'borderColor' ), * MyColorfulComponent, * ); * ``` * * @param {Array} colorsArray The array of color objects (name, slug, color, etc... ). * * @return {Function} Higher-order component. */ function createCustomColorsHOC(colorsArray) { return (...colorTypes) => { const withColorPalette = withCustomColorPalette(colorsArray); return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(createColorHOC(colorTypes, withColorPalette), 'withCustomColors'); }; } /** * A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting. * * For use with the default editor/theme color palette. * * @example * * ```jsx * export default compose( * withColors( 'backgroundColor', { textColor: 'color' } ), * MyColorfulComponent, * ); * ``` * * @param {...(Object|string)} colorTypes The arguments can be strings or objects. If the argument is an object, * it should contain the color attribute name as key and the color context as value. * If the argument is a string the value should be the color attribute name, * the color context is computed by applying a kebab case transform to the value. * Color context represents the context/place where the color is going to be used. * The class name of the color is generated using 'has' followed by the color name * and ending with the color context all in kebab case e.g: has-green-background-color. * * @return {Function} Higher-order component. */ function withColors(...colorTypes) { const withColorPalette = withEditorColorPalette(); return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(createColorHOC(colorTypes, withColorPalette), 'withColors'); } ;// ./node_modules/@wordpress/block-editor/build-module/components/colors/index.js ;// ./node_modules/@wordpress/block-editor/build-module/components/gradients/index.js ;// ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/font-size-picker.js /** * WordPress dependencies */ /** * Internal dependencies */ function font_size_picker_FontSizePicker(props) { const [fontSizes, customFontSize] = use_settings_useSettings('typography.fontSizes', 'typography.customFontSize'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FontSizePicker, { ...props, fontSizes: fontSizes, disableCustomFontSizes: !customFontSize }); } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/font-sizes/README.md */ /* harmony default export */ const font_size_picker = (font_size_picker_FontSizePicker); ;// ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/with-font-sizes.js /** * WordPress dependencies */ /** * Internal dependencies */ const DEFAULT_FONT_SIZES = []; /** * Capitalizes the first letter in a string. * * @param {string} str The string whose first letter the function will capitalize. * * @return {string} Capitalized string. */ const with_font_sizes_upperFirst = ([firstLetter, ...rest]) => firstLetter.toUpperCase() + rest.join(''); /** * Higher-order component, which handles font size logic for class generation, * font size value retrieval, and font size change handling. * * @param {...(Object|string)} fontSizeNames The arguments should all be strings. * Each string contains the font size * attribute name e.g: 'fontSize'. * * @return {Function} Higher-order component. */ /* harmony default export */ const with_font_sizes = ((...fontSizeNames) => { /* * Computes an object whose key is the font size attribute name as passed in the array, * and the value is the custom font size attribute name. * Custom font size is automatically compted by appending custom followed by the font size attribute name in with the first letter capitalized. */ const fontSizeAttributeNames = fontSizeNames.reduce((fontSizeAttributeNamesAccumulator, fontSizeAttributeName) => { fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = `custom${with_font_sizes_upperFirst(fontSizeAttributeName)}`; return fontSizeAttributeNamesAccumulator; }, {}); return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => { const [fontSizes] = use_settings_useSettings('typography.fontSizes'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...props, fontSizes: fontSizes || DEFAULT_FONT_SIZES }); }, 'withFontSizes'), WrappedComponent => { return class extends external_wp_element_namespaceObject.Component { constructor(props) { super(props); this.setters = this.createSetters(); this.state = {}; } createSetters() { return Object.entries(fontSizeAttributeNames).reduce((settersAccumulator, [fontSizeAttributeName, customFontSizeAttributeName]) => { const upperFirstFontSizeAttributeName = with_font_sizes_upperFirst(fontSizeAttributeName); settersAccumulator[`set${upperFirstFontSizeAttributeName}`] = this.createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName); return settersAccumulator; }, {}); } createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName) { return fontSizeValue => { const fontSizeObject = this.props.fontSizes?.find(({ size }) => size === Number(fontSizeValue)); this.props.setAttributes({ [fontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? fontSizeObject.slug : undefined, [customFontSizeAttributeName]: fontSizeObject && fontSizeObject.slug ? undefined : fontSizeValue }); }; } static getDerivedStateFromProps({ attributes, fontSizes }, previousState) { const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => { if (previousState[fontSizeAttributeName]) { // If new font size is name compare with the previous slug. if (attributes[fontSizeAttributeName]) { return attributes[fontSizeAttributeName] !== previousState[fontSizeAttributeName].slug; } // If font size is not named, update when the font size value changes. return previousState[fontSizeAttributeName].size !== attributes[customFontSizeAttributeName]; } // In this case we need to build the font size object. return true; }; if (!Object.values(fontSizeAttributeNames).some(didAttributesChange)) { return null; } const newState = Object.entries(fontSizeAttributeNames).filter(([key, value]) => didAttributesChange(value, key)).reduce((newStateAccumulator, [fontSizeAttributeName, customFontSizeAttributeName]) => { const fontSizeAttributeValue = attributes[fontSizeAttributeName]; const fontSizeObject = utils_getFontSize(fontSizes, fontSizeAttributeValue, attributes[customFontSizeAttributeName]); newStateAccumulator[fontSizeAttributeName] = { ...fontSizeObject, class: getFontSizeClass(fontSizeAttributeValue) }; return newStateAccumulator; }, {}); return { ...previousState, ...newState }; } render() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...this.props, fontSizes: undefined, ...this.state, ...this.setters }); } }; }]), 'withFontSizes'); }); ;// ./node_modules/@wordpress/block-editor/build-module/components/font-sizes/index.js ;// ./node_modules/@wordpress/block-editor/build-module/autocompleters/block.js /** * WordPress dependencies */ /** * Internal dependencies */ const block_noop = () => {}; const block_SHOWN_BLOCK_TYPES = 9; /** * Creates a blocks repeater for replacing the current block with a selected block type. * * @return {Object} A blocks completer. */ function createBlockCompleter() { return { name: 'blocks', className: 'block-editor-autocompleters__block', triggerPrefix: '/', useItems(filterValue) { const { rootClientId, selectedBlockId, prioritizedBlocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSelectedBlockClientId, getBlock, getBlockListSettings, getBlockRootClientId } = select(store); const { getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store); const selectedBlockClientId = getSelectedBlockClientId(); const { name: blockName, attributes } = getBlock(selectedBlockClientId); const activeBlockVariation = getActiveBlockVariation(blockName, attributes); const _rootClientId = getBlockRootClientId(selectedBlockClientId); return { selectedBlockId: activeBlockVariation ? `${blockName}/${activeBlockVariation.name}` : blockName, rootClientId: _rootClientId, prioritizedBlocks: getBlockListSettings(_rootClientId)?.prioritizedInserterBlocks }; }, []); const [items, categories, collections] = use_block_types_state(rootClientId, block_noop, true); const filteredItems = (0,external_wp_element_namespaceObject.useMemo)(() => { const initialFilteredItems = !!filterValue.trim() ? searchBlockItems(items, categories, collections, filterValue) : orderInserterBlockItems(orderBy(items, 'frecency', 'desc'), prioritizedBlocks); return initialFilteredItems.filter(item => item.id !== selectedBlockId).slice(0, block_SHOWN_BLOCK_TYPES); }, [filterValue, selectedBlockId, items, categories, collections, prioritizedBlocks]); const options = (0,external_wp_element_namespaceObject.useMemo)(() => filteredItems.map(blockItem => { const { title, icon, isDisabled } = blockItem; return { key: `block-${blockItem.id}`, value: blockItem, label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: icon, showColors: true }, "icon"), title] }), isDisabled }; }), [filteredItems]); return [options]; }, allowContext(before, after) { return !(/\S/.test(before) || /\S/.test(after)); }, getOptionCompletion(inserterItem) { const { name, initialAttributes, innerBlocks, syncStatus, content } = inserterItem; return { action: 'replace', value: syncStatus === 'unsynced' ? (0,external_wp_blocks_namespaceObject.parse)(content, { __unstableSkipMigrationLogs: true }) : (0,external_wp_blocks_namespaceObject.createBlock)(name, initialAttributes, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocks)) }; } }; } /** * Creates a blocks repeater for replacing the current block with a selected block type. * * @return {Object} A blocks completer. */ /* harmony default export */ const autocompleters_block = (createBlockCompleter()); ;// external ["wp","apiFetch"] const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); ;// ./node_modules/@wordpress/icons/build-module/library/post.js /** * WordPress dependencies */ const post = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z" }) }); /* harmony default export */ const library_post = (post); ;// ./node_modules/@wordpress/block-editor/build-module/autocompleters/link.js /** * WordPress dependencies */ // Disable Reason: Needs to be refactored. // eslint-disable-next-line no-restricted-imports const SHOWN_SUGGESTIONS = 10; /** * Creates a suggestion list for links to posts or pages. * * @return {Object} A links completer. */ function createLinkCompleter() { return { name: 'links', className: 'block-editor-autocompleters__link', triggerPrefix: '[[', options: async letters => { let options = await external_wp_apiFetch_default()({ path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/search', { per_page: SHOWN_SUGGESTIONS, search: letters, type: 'post', order_by: 'menu_order' }) }); options = options.filter(option => option.title !== ''); return options; }, getOptionKeywords(item) { const expansionWords = item.title.split(/\s+/); return [...expansionWords]; }, getOptionLabel(item) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: item.subtype === 'page' ? library_page : library_post }, "icon"), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title)] }); }, getOptionCompletion(item) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: item.url, children: item.title }); } }; } /** * Creates a suggestion list for links to posts or pages.. * * @return {Object} A link completer. */ /* harmony default export */ const autocompleters_link = (createLinkCompleter()); ;// ./node_modules/@wordpress/block-editor/build-module/components/autocomplete/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Shared reference to an empty array for cases where it is important to avoid * returning a new array reference on every invocation. * * @type {Array} */ const autocomplete_EMPTY_ARRAY = []; function useCompleters({ completers = autocomplete_EMPTY_ARRAY }) { const { name } = useBlockEditContext(); return (0,external_wp_element_namespaceObject.useMemo)(() => { let filteredCompleters = [...completers, autocompleters_link]; if (name === (0,external_wp_blocks_namespaceObject.getDefaultBlockName)() || (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, '__experimentalSlashInserter', false)) { filteredCompleters = [...filteredCompleters, autocompleters_block]; } if ((0,external_wp_hooks_namespaceObject.hasFilter)('editor.Autocomplete.completers')) { // Provide copies so filters may directly modify them. if (filteredCompleters === completers) { filteredCompleters = filteredCompleters.map(completer => ({ ...completer })); } filteredCompleters = (0,external_wp_hooks_namespaceObject.applyFilters)('editor.Autocomplete.completers', filteredCompleters, name); } return filteredCompleters; }, [completers, name]); } function useBlockEditorAutocompleteProps(props) { return (0,external_wp_components_namespaceObject.__unstableUseAutocompleteProps)({ ...props, completers: useCompleters(props) }); } /** * Wrap the default Autocomplete component with one that supports a filter hook * for customizing its list of autocompleters. * * @type {import('react').FC} */ function BlockEditorAutocomplete(props) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Autocomplete, { ...props, completers: useCompleters(props) }); } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/autocomplete/README.md */ /* harmony default export */ const autocomplete = (BlockEditorAutocomplete); ;// ./node_modules/@wordpress/icons/build-module/library/fullscreen.js /** * WordPress dependencies */ const fullscreen = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) }); /* harmony default export */ const library_fullscreen = (fullscreen); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-full-height-alignment-control/index.js /** * WordPress dependencies */ function BlockFullHeightAlignmentControl({ isActive, label = (0,external_wp_i18n_namespaceObject.__)('Full height'), onToggle, isDisabled }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { isActive: isActive, icon: library_fullscreen, label: label, onClick: () => onToggle(!isActive), disabled: isDisabled }); } /* harmony default export */ const block_full_height_alignment_control = (BlockFullHeightAlignmentControl); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-alignment-matrix-control/index.js /** * WordPress dependencies */ const block_alignment_matrix_control_noop = () => {}; /** * The alignment matrix control allows users to quickly adjust inner block alignment. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-alignment-matrix-control/README.md * * @example * ```jsx * function Example() { * return ( * <BlockControls> * <BlockAlignmentMatrixControl * label={ __( 'Change content position' ) } * value="center" * onChange={ ( nextPosition ) => * setAttributes( { contentPosition: nextPosition } ) * } * /> * </BlockControls> * ); * } * ``` * * @param {Object} props Component props. * @param {string} props.label Label for the control. Defaults to 'Change matrix alignment'. * @param {Function} props.onChange Function to execute upon change of matrix state. * @param {string} props.value Content alignment location. One of: 'center', 'center center', * 'center left', 'center right', 'top center', 'top left', * 'top right', 'bottom center', 'bottom left', 'bottom right'. * @param {boolean} props.isDisabled Whether the control should be disabled. * @return {Element} The BlockAlignmentMatrixControl component. */ function BlockAlignmentMatrixControl(props) { const { label = (0,external_wp_i18n_namespaceObject.__)('Change matrix alignment'), onChange = block_alignment_matrix_control_noop, value = 'center', isDisabled } = props; const icon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.AlignmentMatrixControl.Icon, { value: value }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: { placement: 'bottom-start' }, renderToggle: ({ onToggle, isOpen }) => { const openOnArrowDown = event => { if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { event.preventDefault(); onToggle(); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: onToggle, "aria-haspopup": "true", "aria-expanded": isOpen, onKeyDown: openOnArrowDown, label: label, icon: icon, showTooltip: true, disabled: isDisabled }); }, renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.AlignmentMatrixControl, { hasFocusBorder: false, onChange: onChange, value: value }) }); } /* harmony default export */ const block_alignment_matrix_control = (BlockAlignmentMatrixControl); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-title/use-block-display-title.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns the block's configured title as a string, or empty if the title * cannot be determined. * * @example * * ```js * useBlockDisplayTitle( { clientId: 'afd1cb17-2c08-4e7a-91be-007ba7ddc3a1', maximumLength: 17 } ); * ``` * * @param {Object} props * @param {string} props.clientId Client ID of block. * @param {number|undefined} props.maximumLength The maximum length that the block title string may be before truncated. * @param {string|undefined} props.context The context to pass to `getBlockLabel`. * @return {?string} Block title. */ function useBlockDisplayTitle({ clientId, maximumLength, context }) { const blockTitle = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!clientId) { return null; } const { getBlockName, getBlockAttributes } = select(store); const { getBlockType, getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store); const blockName = getBlockName(clientId); const blockType = getBlockType(blockName); if (!blockType) { return null; } const attributes = getBlockAttributes(clientId); const label = (0,external_wp_blocks_namespaceObject.__experimentalGetBlockLabel)(blockType, attributes, context); // If the label is defined we prioritize it over a possible block variation title match. if (label !== blockType.title) { return label; } const match = getActiveBlockVariation(blockName, attributes); // Label will fallback to the title if no label is defined for the current label context. return match?.title || blockType.title; }, [clientId, context]); if (!blockTitle) { return null; } if (maximumLength && maximumLength > 0 && blockTitle.length > maximumLength) { const omission = '...'; return blockTitle.slice(0, maximumLength - omission.length) + omission; } return blockTitle; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-title/index.js /** * Internal dependencies */ /** * Renders the block's configured title as a string, or empty if the title * cannot be determined. * * @example * * ```jsx * <BlockTitle clientId="afd1cb17-2c08-4e7a-91be-007ba7ddc3a1" maximumLength={ 17 }/> * ``` * * @param {Object} props * @param {string} props.clientId Client ID of block. * @param {number|undefined} props.maximumLength The maximum length that the block title string may be before truncated. * @param {string|undefined} props.context The context to pass to `getBlockLabel`. * * @return {JSX.Element} Block title. */ function BlockTitle({ clientId, maximumLength, context }) { return useBlockDisplayTitle({ clientId, maximumLength, context }); } ;// ./node_modules/@wordpress/block-editor/build-module/utils/get-editor-region.js /** * Gets the editor region for a given editor canvas element or * returns the passed element if no region is found * * @param { Object } editor The editor canvas element. * @return { Object } The editor region or given editor element */ function getEditorRegion(editor) { var _Array$from$find, _editorCanvas$closest; if (!editor) { return null; } // If there are multiple editors, we need to find the iframe that contains our contentRef to make sure // we're focusing the region that contains this editor. const editorCanvas = (_Array$from$find = Array.from(document.querySelectorAll('iframe[name="editor-canvas"]').values()).find(iframe => { // Find the iframe that contains our contentRef const iframeDocument = iframe.contentDocument || iframe.contentWindow.document; return iframeDocument === editor.ownerDocument; })) !== null && _Array$from$find !== void 0 ? _Array$from$find : editor; // The region is provided by the editor, not the block-editor. // We should send focus to the region if one is available to reuse the // same interface for navigating landmarks. If no region is available, // use the canvas instead. return (_editorCanvas$closest = editorCanvas?.closest('[role="region"]')) !== null && _editorCanvas$closest !== void 0 ? _editorCanvas$closest : editorCanvas; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-breadcrumb/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Block breadcrumb component, displaying the hierarchy of the current block selection as a breadcrumb. * * @param {Object} props Component props. * @param {string} props.rootLabelText Translated label for the root element of the breadcrumb trail. * @return {Element} Block Breadcrumb. */ function BlockBreadcrumb({ rootLabelText }) { const { selectBlock, clearSelectedBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { clientId, parents, hasSelection } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSelectionStart, getSelectedBlockClientId, getEnabledBlockParents } = unlock(select(store)); const selectedBlockClientId = getSelectedBlockClientId(); return { parents: getEnabledBlockParents(selectedBlockClientId), clientId: selectedBlockClientId, hasSelection: !!getSelectionStart().clientId }; }, []); const rootLabel = rootLabelText || (0,external_wp_i18n_namespaceObject.__)('Document'); // We don't care about this specific ref, but this is a way // to get a ref within the editor canvas so we can focus it later. const blockRef = (0,external_wp_element_namespaceObject.useRef)(); useBlockElementRef(clientId, blockRef); /* * Disable reason: The `list` ARIA role is redundant but * Safari+VoiceOver won't announce the list otherwise. */ /* eslint-disable jsx-a11y/no-redundant-roles */ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("ul", { className: "block-editor-block-breadcrumb", role: "list", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block breadcrumb'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: !hasSelection ? 'block-editor-block-breadcrumb__current' : undefined, "aria-current": !hasSelection ? 'true' : undefined, children: [hasSelection && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "small", className: "block-editor-block-breadcrumb__button", onClick: () => { // Find the block editor wrapper for the selected block const blockEditor = blockRef.current?.closest('.editor-styles-wrapper'); clearSelectedBlock(); getEditorRegion(blockEditor)?.focus(); }, children: rootLabel }), !hasSelection && rootLabel, !!clientId && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: chevron_right_small, className: "block-editor-block-breadcrumb__separator" })] }), parents.map(parentClientId => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "small", className: "block-editor-block-breadcrumb__button", onClick: () => selectBlock(parentClientId), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockTitle, { clientId: parentClientId, maximumLength: 35 }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: chevron_right_small, className: "block-editor-block-breadcrumb__separator" })] }, parentClientId)), !!clientId && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { className: "block-editor-block-breadcrumb__current", "aria-current": "true", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockTitle, { clientId: clientId, maximumLength: 35 }) })] }) /* eslint-enable jsx-a11y/no-redundant-roles */; } /* harmony default export */ const block_breadcrumb = (BlockBreadcrumb); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-content-overlay/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function useBlockOverlayActive(clientId) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { __unstableHasActiveBlockOverlayActive } = select(store); return __unstableHasActiveBlockOverlayActive(clientId); }, [clientId]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-block-toolbar-popover-props.js /** * WordPress dependencies */ /** * Internal dependencies */ const COMMON_PROPS = { placement: 'top-start' }; // By default the toolbar sets the `shift` prop. If the user scrolls the page // down the toolbar will stay on screen by adopting a sticky position at the // top of the viewport. const DEFAULT_PROPS = { ...COMMON_PROPS, flip: false, shift: true }; // When there isn't enough height between the top of the block and the editor // canvas, the `shift` prop is set to `false`, as it will cause the block to be // obscured. The `flip` behavior is enabled, which positions the toolbar below // the block. This only happens if the block is smaller than the viewport, as // otherwise the toolbar will be off-screen. const RESTRICTED_HEIGHT_PROPS = { ...COMMON_PROPS, flip: true, shift: false }; /** * Get the popover props for the block toolbar, determined by the space at the top of the canvas and the toolbar height. * * @param {Element} contentElement The DOM element that represents the editor content or canvas. * @param {Element} selectedBlockElement The outer DOM element of the first selected block. * @param {Element} scrollContainer The scrollable container for the contentElement. * @param {number} toolbarHeight The height of the toolbar in pixels. * @param {boolean} isSticky Whether or not the selected block is sticky or fixed. * * @return {Object} The popover props used to determine the position of the toolbar. */ function getProps(contentElement, selectedBlockElement, scrollContainer, toolbarHeight, isSticky) { if (!contentElement || !selectedBlockElement) { return DEFAULT_PROPS; } // Get how far the content area has been scrolled. const scrollTop = scrollContainer?.scrollTop || 0; const blockRect = getElementBounds(selectedBlockElement); const contentRect = contentElement.getBoundingClientRect(); // Get the vertical position of top of the visible content area. const topOfContentElementInViewport = scrollTop + contentRect.top; // The document element's clientHeight represents the viewport height. const viewportHeight = contentElement.ownerDocument.documentElement.clientHeight; // The restricted height area is calculated as the sum of the // vertical position of the visible content area, plus the height // of the block toolbar. const restrictedTopArea = topOfContentElementInViewport + toolbarHeight; const hasSpaceForToolbarAbove = blockRect.top > restrictedTopArea; const isBlockTallerThanViewport = blockRect.height > viewportHeight - toolbarHeight; // Sticky blocks are treated as if they will never have enough space for the toolbar above. if (!isSticky && (hasSpaceForToolbarAbove || isBlockTallerThanViewport)) { return DEFAULT_PROPS; } return RESTRICTED_HEIGHT_PROPS; } /** * Determines the desired popover positioning behavior, returning a set of appropriate props. * * @param {Object} elements * @param {Element} elements.contentElement The DOM element that represents the editor content or canvas. * @param {string} elements.clientId The clientId of the first selected block. * * @return {Object} The popover props used to determine the position of the toolbar. */ function useBlockToolbarPopoverProps({ contentElement, clientId }) { const selectedBlockElement = useBlockElement(clientId); const [toolbarHeight, setToolbarHeight] = (0,external_wp_element_namespaceObject.useState)(0); const { blockIndex, isSticky } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockIndex, getBlockAttributes } = select(store); return { blockIndex: getBlockIndex(clientId), isSticky: hasStickyOrFixedPositionValue(getBlockAttributes(clientId)) }; }, [clientId]); const scrollContainer = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!contentElement) { return; } return (0,external_wp_dom_namespaceObject.getScrollContainer)(contentElement); }, [contentElement]); const [props, setProps] = (0,external_wp_element_namespaceObject.useState)(() => getProps(contentElement, selectedBlockElement, scrollContainer, toolbarHeight, isSticky)); const popoverRef = (0,external_wp_compose_namespaceObject.useRefEffect)(popoverNode => { setToolbarHeight(popoverNode.offsetHeight); }, []); const updateProps = (0,external_wp_element_namespaceObject.useCallback)(() => setProps(getProps(contentElement, selectedBlockElement, scrollContainer, toolbarHeight, isSticky)), [contentElement, selectedBlockElement, scrollContainer, toolbarHeight]); // Update props when the block is moved. This also ensures the props are // correct on initial mount, and when the selected block or content element // changes (since the callback ref will update). (0,external_wp_element_namespaceObject.useLayoutEffect)(updateProps, [blockIndex, updateProps]); // Update props when the viewport is resized or the block is resized. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { if (!contentElement || !selectedBlockElement) { return; } // Update the toolbar props on viewport resize. const contentView = contentElement?.ownerDocument?.defaultView; contentView?.addEventHandler?.('resize', updateProps); // Update the toolbar props on block resize. let resizeObserver; const blockView = selectedBlockElement?.ownerDocument?.defaultView; if (blockView.ResizeObserver) { resizeObserver = new blockView.ResizeObserver(updateProps); resizeObserver.observe(selectedBlockElement); } return () => { contentView?.removeEventHandler?.('resize', updateProps); if (resizeObserver) { resizeObserver.disconnect(); } }; }, [updateProps, contentElement, selectedBlockElement]); return { ...props, ref: popoverRef }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-selected-block-tool-props.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns props for the selected block tools and empty block inserter. * * @param {string} clientId Selected block client ID. */ function useSelectedBlockToolProps(clientId) { const selectedBlockProps = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId, getBlockParents, __experimentalGetBlockListSettingsForBlocks, isBlockInsertionPointVisible, getBlockInsertionPoint, getBlockOrder, hasMultiSelection, getLastMultiSelectedBlockClientId } = select(store); const blockParentsClientIds = getBlockParents(clientId); // Get Block List Settings for all ancestors of the current Block clientId. const parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(blockParentsClientIds); // Get the clientId of the topmost parent with the capture toolbars setting. const capturingClientId = blockParentsClientIds.find(parentClientId => parentBlockListSettings[parentClientId]?.__experimentalCaptureToolbars); let isInsertionPointVisible = false; if (isBlockInsertionPointVisible()) { const insertionPoint = getBlockInsertionPoint(); const order = getBlockOrder(insertionPoint.rootClientId); isInsertionPointVisible = order[insertionPoint.index] === clientId; } return { capturingClientId, isInsertionPointVisible, lastClientId: hasMultiSelection() ? getLastMultiSelectedBlockClientId() : null, rootClientId: getBlockRootClientId(clientId) }; }, [clientId]); return selectedBlockProps; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/empty-block-inserter.js /** * External dependencies */ /** * Internal dependencies */ function EmptyBlockInserter({ clientId, __unstableContentRef }) { const { capturingClientId, isInsertionPointVisible, lastClientId, rootClientId } = useSelectedBlockToolProps(clientId); const popoverProps = useBlockToolbarPopoverProps({ contentElement: __unstableContentRef?.current, clientId }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(cover, { clientId: capturingClientId || clientId, bottomClientId: lastClientId, className: dist_clsx('block-editor-block-list__block-side-inserter-popover', { 'is-insertion-point-visible': isInsertionPointVisible }), __unstableContentRef: __unstableContentRef, ...popoverProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-list__empty-block-inserter", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter, { position: "bottom right", rootClientId: rootClientId, clientId: clientId, __experimentalIsQuick: true }) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/use-scroll-when-dragging.js /** * WordPress dependencies */ const SCROLL_INACTIVE_DISTANCE_PX = 50; const SCROLL_INTERVAL_MS = 25; const PIXELS_PER_SECOND_PER_PERCENTAGE = 1000; const VELOCITY_MULTIPLIER = PIXELS_PER_SECOND_PER_PERCENTAGE * (SCROLL_INTERVAL_MS / 1000); /** * React hook that scrolls the scroll container when a block is being dragged. * * @return {Function[]} `startScrolling`, `scrollOnDragOver`, `stopScrolling` * functions to be called in `onDragStart`, `onDragOver` * and `onDragEnd` events respectively. */ function useScrollWhenDragging() { const dragStartYRef = (0,external_wp_element_namespaceObject.useRef)(null); const velocityYRef = (0,external_wp_element_namespaceObject.useRef)(null); const scrollParentYRef = (0,external_wp_element_namespaceObject.useRef)(null); const scrollEditorIntervalRef = (0,external_wp_element_namespaceObject.useRef)(null); // Clear interval when unmounting. (0,external_wp_element_namespaceObject.useEffect)(() => () => { if (scrollEditorIntervalRef.current) { clearInterval(scrollEditorIntervalRef.current); scrollEditorIntervalRef.current = null; } }, []); const startScrolling = (0,external_wp_element_namespaceObject.useCallback)(event => { dragStartYRef.current = event.clientY; // Find nearest parent(s) to scroll. scrollParentYRef.current = (0,external_wp_dom_namespaceObject.getScrollContainer)(event.target); scrollEditorIntervalRef.current = setInterval(() => { if (scrollParentYRef.current && velocityYRef.current) { const newTop = scrollParentYRef.current.scrollTop + velocityYRef.current; // Setting `behavior: 'smooth'` as a scroll property seems to hurt performance. // Better to use a small scroll interval. scrollParentYRef.current.scroll({ top: newTop }); } }, SCROLL_INTERVAL_MS); }, []); const scrollOnDragOver = (0,external_wp_element_namespaceObject.useCallback)(event => { if (!scrollParentYRef.current) { return; } const scrollParentHeight = scrollParentYRef.current.offsetHeight; const offsetDragStartPosition = dragStartYRef.current - scrollParentYRef.current.offsetTop; const offsetDragPosition = event.clientY - scrollParentYRef.current.offsetTop; if (event.clientY > offsetDragStartPosition) { // User is dragging downwards. const moveableDistance = Math.max(scrollParentHeight - offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); const dragDistance = Math.max(offsetDragPosition - offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); const distancePercentage = moveableDistance === 0 || dragDistance === 0 ? 0 : dragDistance / moveableDistance; velocityYRef.current = VELOCITY_MULTIPLIER * distancePercentage; } else if (event.clientY < offsetDragStartPosition) { // User is dragging upwards. const moveableDistance = Math.max(offsetDragStartPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); const dragDistance = Math.max(offsetDragStartPosition - offsetDragPosition - SCROLL_INACTIVE_DISTANCE_PX, 0); const distancePercentage = moveableDistance === 0 || dragDistance === 0 ? 0 : dragDistance / moveableDistance; velocityYRef.current = -VELOCITY_MULTIPLIER * distancePercentage; } else { velocityYRef.current = 0; } }, []); const stopScrolling = () => { dragStartYRef.current = null; scrollParentYRef.current = null; if (scrollEditorIntervalRef.current) { clearInterval(scrollEditorIntervalRef.current); scrollEditorIntervalRef.current = null; } }; return [startScrolling, scrollOnDragOver, stopScrolling]; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-draggable/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const BlockDraggable = ({ appendToOwnerDocument, children, clientIds, cloneClassname, elementId, onDragStart, onDragEnd, fadeWhenDisabled = false, dragComponent }) => { const { srcRootClientId, isDraggable, icon, visibleInserter, getBlockType } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canMoveBlocks, getBlockRootClientId, getBlockName, getBlockAttributes, isBlockInsertionPointVisible } = select(store); const { getBlockType: _getBlockType, getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store); const rootClientId = getBlockRootClientId(clientIds[0]); const blockName = getBlockName(clientIds[0]); const variation = getActiveBlockVariation(blockName, getBlockAttributes(clientIds[0])); return { srcRootClientId: rootClientId, isDraggable: canMoveBlocks(clientIds), icon: variation?.icon || _getBlockType(blockName)?.icon, visibleInserter: isBlockInsertionPointVisible(), getBlockType: _getBlockType }; }, [clientIds]); const isDraggingRef = (0,external_wp_element_namespaceObject.useRef)(false); const [startScrolling, scrollOnDragOver, stopScrolling] = useScrollWhenDragging(); const { getAllowedBlocks, getBlockNamesByClientId, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store); const { startDraggingBlocks, stopDraggingBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store); // Stop dragging blocks if the block draggable is unmounted. (0,external_wp_element_namespaceObject.useEffect)(() => { return () => { if (isDraggingRef.current) { stopDraggingBlocks(); } }; }, []); // Find the root of the editor iframe. const blockEl = useBlockElement(clientIds[0]); const editorRoot = blockEl?.closest('body'); /* * Add a dragover event listener to the editor root to track the blocks being dragged over. * The listener has to be inside the editor iframe otherwise the target isn't accessible. */ (0,external_wp_element_namespaceObject.useEffect)(() => { if (!editorRoot || !fadeWhenDisabled) { return; } const onDragOver = event => { if (!event.target.closest('[data-block]')) { return; } const draggedBlockNames = getBlockNamesByClientId(clientIds); const targetClientId = event.target.closest('[data-block]').getAttribute('data-block'); const allowedBlocks = getAllowedBlocks(targetClientId); const targetBlockName = getBlockNamesByClientId([targetClientId])[0]; /* * Check if the target is valid to drop in. * If the target's allowedBlocks is an empty array, * it isn't a container block, in which case we check * its parent's validity instead. */ let dropTargetValid; if (allowedBlocks?.length === 0) { const targetRootClientId = getBlockRootClientId(targetClientId); const targetRootBlockName = getBlockNamesByClientId([targetRootClientId])[0]; const rootAllowedBlocks = getAllowedBlocks(targetRootClientId); dropTargetValid = isDropTargetValid(getBlockType, rootAllowedBlocks, draggedBlockNames, targetRootBlockName); } else { dropTargetValid = isDropTargetValid(getBlockType, allowedBlocks, draggedBlockNames, targetBlockName); } /* * Update the body class to reflect if drop target is valid. * This has to be done on the document body because the draggable * chip is rendered outside of the editor iframe. */ if (!dropTargetValid && !visibleInserter) { window?.document?.body?.classList?.add('block-draggable-invalid-drag-token'); } else { window?.document?.body?.classList?.remove('block-draggable-invalid-drag-token'); } }; const throttledOnDragOver = (0,external_wp_compose_namespaceObject.throttle)(onDragOver, 200); editorRoot.addEventListener('dragover', throttledOnDragOver); return () => { editorRoot.removeEventListener('dragover', throttledOnDragOver); }; }, [clientIds, editorRoot, fadeWhenDisabled, getAllowedBlocks, getBlockNamesByClientId, getBlockRootClientId, getBlockType, visibleInserter]); if (!isDraggable) { return children({ draggable: false }); } const transferData = { type: 'block', srcClientIds: clientIds, srcRootClientId }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Draggable, { appendToOwnerDocument: appendToOwnerDocument, cloneClassname: cloneClassname, __experimentalTransferDataType: "wp-blocks", transferData: transferData, onDragStart: event => { // Defer hiding the dragged source element to the next // frame to enable dragging. window.requestAnimationFrame(() => { startDraggingBlocks(clientIds); isDraggingRef.current = true; startScrolling(event); if (onDragStart) { onDragStart(); } }); }, onDragOver: scrollOnDragOver, onDragEnd: () => { stopDraggingBlocks(); isDraggingRef.current = false; stopScrolling(); if (onDragEnd) { onDragEnd(); } }, __experimentalDragComponent: // Check against `undefined` so that `null` can be used to disable // the default drag component. dragComponent !== undefined ? dragComponent : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockDraggableChip, { count: clientIds.length, icon: icon, fadeWhenDisabled: true }), elementId: elementId, children: ({ onDraggableStart, onDraggableEnd }) => { return children({ draggable: true, onDragStart: onDraggableStart, onDragEnd: onDraggableEnd }); } }); }; /* harmony default export */ const block_draggable = (BlockDraggable); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-mover/mover-description.js /** * WordPress dependencies */ const getMovementDirection = (moveDirection, orientation) => { if (moveDirection === 'up') { if (orientation === 'horizontal') { return (0,external_wp_i18n_namespaceObject.isRTL)() ? 'right' : 'left'; } return 'up'; } else if (moveDirection === 'down') { if (orientation === 'horizontal') { return (0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right'; } return 'down'; } return null; }; /** * Return a label for the block movement controls depending on block position. * * @param {number} selectedCount Number of blocks selected. * @param {string} type Block type - in the case of a single block, should * define its 'type'. I.e. 'Text', 'Heading', 'Image' etc. * @param {number} firstIndex The index (position - 1) of the first block selected. * @param {boolean} isFirst This is the first block. * @param {boolean} isLast This is the last block. * @param {number} dir Direction of movement (> 0 is considered to be going * down, < 0 is up). * @param {string} orientation The orientation of the block movers, vertical or * horizontal. * * @return {string | undefined} Label for the block movement controls. */ function getBlockMoverDescription(selectedCount, type, firstIndex, isFirst, isLast, dir, orientation) { const position = firstIndex + 1; if (selectedCount > 1) { return getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir, orientation); } if (isFirst && isLast) { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Type of block (i.e. Text, Image etc) (0,external_wp_i18n_namespaceObject.__)('Block %s is the only block, and cannot be moved'), type); } if (dir > 0 && !isLast) { // Moving down. const movementDirection = getMovementDirection('down', orientation); if (movementDirection === 'down') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d down to position %3$d'), type, position, position + 1); } if (movementDirection === 'left') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d left to position %3$d'), type, position, position + 1); } if (movementDirection === 'right') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d right to position %3$d'), type, position, position + 1); } } if (dir > 0 && isLast) { // Moving down, and is the last item. const movementDirection = getMovementDirection('down', orientation); if (movementDirection === 'down') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the end of the content and can’t be moved down'), type); } if (movementDirection === 'left') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the end of the content and can’t be moved left'), type); } if (movementDirection === 'right') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the end of the content and can’t be moved right'), type); } } if (dir < 0 && !isFirst) { // Moving up. const movementDirection = getMovementDirection('up', orientation); if (movementDirection === 'up') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d up to position %3$d'), type, position, position - 1); } if (movementDirection === 'left') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d left to position %3$d'), type, position, position - 1); } if (movementDirection === 'right') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position (0,external_wp_i18n_namespaceObject.__)('Move %1$s block from position %2$d right to position %3$d'), type, position, position - 1); } } if (dir < 0 && isFirst) { // Moving up, and is the first item. const movementDirection = getMovementDirection('up', orientation); if (movementDirection === 'up') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the beginning of the content and can’t be moved up'), type); } if (movementDirection === 'left') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the beginning of the content and can’t be moved left'), type); } if (movementDirection === 'right') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Type of block (i.e. Text, Image etc) (0,external_wp_i18n_namespaceObject.__)('Block %1$s is at the beginning of the content and can’t be moved right'), type); } } } /** * Return a label for the block movement controls depending on block position. * * @param {number} selectedCount Number of blocks selected. * @param {number} firstIndex The index (position - 1) of the first block selected. * @param {boolean} isFirst This is the first block. * @param {boolean} isLast This is the last block. * @param {number} dir Direction of movement (> 0 is considered to be going * down, < 0 is up). * @param {string} orientation The orientation of the block movers, vertical or * horizontal. * * @return {string | undefined} Label for the block movement controls. */ function getMultiBlockMoverDescription(selectedCount, firstIndex, isFirst, isLast, dir, orientation) { const position = firstIndex + 1; if (isFirst && isLast) { // All blocks are selected return (0,external_wp_i18n_namespaceObject.__)('All blocks are selected, and cannot be moved'); } if (dir > 0 && !isLast) { // moving down const movementDirection = getMovementDirection('down', orientation); if (movementDirection === 'down') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,external_wp_i18n_namespaceObject.__)('Move %1$d blocks from position %2$d down by one place'), selectedCount, position); } if (movementDirection === 'left') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,external_wp_i18n_namespaceObject.__)('Move %1$d blocks from position %2$d left by one place'), selectedCount, position); } if (movementDirection === 'right') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,external_wp_i18n_namespaceObject.__)('Move %1$d blocks from position %2$d right by one place'), selectedCount, position); } } if (dir > 0 && isLast) { // moving down, and the selected blocks are the last item const movementDirection = getMovementDirection('down', orientation); if (movementDirection === 'down') { return (0,external_wp_i18n_namespaceObject.__)('Blocks cannot be moved down as they are already at the bottom'); } if (movementDirection === 'left') { return (0,external_wp_i18n_namespaceObject.__)('Blocks cannot be moved left as they are already are at the leftmost position'); } if (movementDirection === 'right') { return (0,external_wp_i18n_namespaceObject.__)('Blocks cannot be moved right as they are already are at the rightmost position'); } } if (dir < 0 && !isFirst) { // moving up const movementDirection = getMovementDirection('up', orientation); if (movementDirection === 'up') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,external_wp_i18n_namespaceObject.__)('Move %1$d blocks from position %2$d up by one place'), selectedCount, position); } if (movementDirection === 'left') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,external_wp_i18n_namespaceObject.__)('Move %1$d blocks from position %2$d left by one place'), selectedCount, position); } if (movementDirection === 'right') { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: Number of selected blocks, 2: Position of selected blocks (0,external_wp_i18n_namespaceObject.__)('Move %1$d blocks from position %2$d right by one place'), selectedCount, position); } } if (dir < 0 && isFirst) { // moving up, and the selected blocks are the first item const movementDirection = getMovementDirection('up', orientation); if (movementDirection === 'up') { return (0,external_wp_i18n_namespaceObject.__)('Blocks cannot be moved up as they are already at the top'); } if (movementDirection === 'left') { return (0,external_wp_i18n_namespaceObject.__)('Blocks cannot be moved left as they are already are at the leftmost position'); } if (movementDirection === 'right') { return (0,external_wp_i18n_namespaceObject.__)('Blocks cannot be moved right as they are already are at the rightmost position'); } } } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-mover/button.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const getArrowIcon = (direction, orientation) => { if (direction === 'up') { if (orientation === 'horizontal') { return (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left; } return chevron_up; } else if (direction === 'down') { if (orientation === 'horizontal') { return (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right; } return chevron_down; } return null; }; const getMovementDirectionLabel = (moveDirection, orientation) => { if (moveDirection === 'up') { if (orientation === 'horizontal') { return (0,external_wp_i18n_namespaceObject.isRTL)() ? (0,external_wp_i18n_namespaceObject.__)('Move right') : (0,external_wp_i18n_namespaceObject.__)('Move left'); } return (0,external_wp_i18n_namespaceObject.__)('Move up'); } else if (moveDirection === 'down') { if (orientation === 'horizontal') { return (0,external_wp_i18n_namespaceObject.isRTL)() ? (0,external_wp_i18n_namespaceObject.__)('Move left') : (0,external_wp_i18n_namespaceObject.__)('Move right'); } return (0,external_wp_i18n_namespaceObject.__)('Move down'); } return null; }; const BlockMoverButton = (0,external_wp_element_namespaceObject.forwardRef)(({ clientIds, direction, orientation: moverOrientation, ...props }, ref) => { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockMoverButton); const normalizedClientIds = Array.isArray(clientIds) ? clientIds : [clientIds]; const blocksCount = normalizedClientIds.length; const { disabled } = props; const { blockType, isDisabled, rootClientId, isFirst, isLast, firstIndex, orientation = 'vertical' } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockIndex, getBlockRootClientId, getBlockOrder, getBlock, getBlockListSettings } = select(store); const firstClientId = normalizedClientIds[0]; const blockRootClientId = getBlockRootClientId(firstClientId); const firstBlockIndex = getBlockIndex(firstClientId); const lastBlockIndex = getBlockIndex(normalizedClientIds[normalizedClientIds.length - 1]); const blockOrder = getBlockOrder(blockRootClientId); const block = getBlock(firstClientId); const isFirstBlock = firstBlockIndex === 0; const isLastBlock = lastBlockIndex === blockOrder.length - 1; const { orientation: blockListOrientation } = getBlockListSettings(blockRootClientId) || {}; return { blockType: block ? (0,external_wp_blocks_namespaceObject.getBlockType)(block.name) : null, isDisabled: disabled || (direction === 'up' ? isFirstBlock : isLastBlock), rootClientId: blockRootClientId, firstIndex: firstBlockIndex, isFirst: isFirstBlock, isLast: isLastBlock, orientation: moverOrientation || blockListOrientation }; }, [clientIds, direction]); const { moveBlocksDown, moveBlocksUp } = (0,external_wp_data_namespaceObject.useDispatch)(store); const moverFunction = direction === 'up' ? moveBlocksUp : moveBlocksDown; const onClick = event => { moverFunction(clientIds, rootClientId); if (props.onClick) { props.onClick(event); } }; const descriptionId = `block-editor-block-mover-button__description-${instanceId}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ref: ref, className: dist_clsx('block-editor-block-mover-button', `is-${direction}-button`), icon: getArrowIcon(direction, orientation), label: getMovementDirectionLabel(direction, orientation), "aria-describedby": descriptionId, ...props, onClick: isDisabled ? null : onClick, disabled: isDisabled, accessibleWhenDisabled: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: getBlockMoverDescription(blocksCount, blockType && blockType.title, firstIndex, isFirst, isLast, direction === 'up' ? -1 : 1, orientation) })] }); }); const BlockMoverUpButton = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockMoverButton, { direction: "up", ref: ref, ...props }); }); const BlockMoverDownButton = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockMoverButton, { direction: "down", ref: ref, ...props }); }); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-mover/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function BlockMover({ clientIds, hideDragHandle, isBlockMoverUpButtonDisabled, isBlockMoverDownButtonDisabled }) { const { canMove, rootClientId, isFirst, isLast, orientation, isManualGrid } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getBlockAttributes; const { getBlockIndex, getBlockListSettings, canMoveBlocks, getBlockOrder, getBlockRootClientId, getBlockAttributes } = select(store); const normalizedClientIds = Array.isArray(clientIds) ? clientIds : [clientIds]; const firstClientId = normalizedClientIds[0]; const _rootClientId = getBlockRootClientId(firstClientId); const firstIndex = getBlockIndex(firstClientId); const lastIndex = getBlockIndex(normalizedClientIds[normalizedClientIds.length - 1]); const blockOrder = getBlockOrder(_rootClientId); const { layout = {} } = (_getBlockAttributes = getBlockAttributes(_rootClientId)) !== null && _getBlockAttributes !== void 0 ? _getBlockAttributes : {}; return { canMove: canMoveBlocks(clientIds), rootClientId: _rootClientId, isFirst: firstIndex === 0, isLast: lastIndex === blockOrder.length - 1, orientation: getBlockListSettings(_rootClientId)?.orientation, isManualGrid: layout.type === 'grid' && layout.isManualPlacement && window.__experimentalEnableGridInteractivity }; }, [clientIds]); if (!canMove || isFirst && isLast && !rootClientId || hideDragHandle && isManualGrid) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { className: dist_clsx('block-editor-block-mover', { 'is-horizontal': orientation === 'horizontal' }), children: [!hideDragHandle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_draggable, { clientIds: clientIds, fadeWhenDisabled: true, children: draggableProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, icon: drag_handle, className: "block-editor-block-mover__drag-handle", label: (0,external_wp_i18n_namespaceObject.__)('Drag') // Should not be able to tab to drag handle as this // button can only be used with a pointer device. , tabIndex: "-1", ...draggableProps }) }), !isManualGrid && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-mover__move-button-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: itemProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockMoverUpButton, { disabled: isBlockMoverUpButtonDisabled, clientIds: clientIds, ...itemProps }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: itemProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockMoverDownButton, { disabled: isBlockMoverDownButtonDisabled, clientIds: clientIds, ...itemProps }) })] })] }); } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-mover/README.md */ /* harmony default export */ const block_mover = (BlockMover); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/utils.js /** * WordPress dependencies */ /** * Internal dependencies */ const { clearTimeout: utils_clearTimeout, setTimeout: utils_setTimeout } = window; const DEBOUNCE_TIMEOUT = 200; /** * Hook that creates debounced callbacks when the node is hovered or focused. * * @param {Object} props Component props. * @param {Object} props.ref Element reference. * @param {boolean} props.isFocused Whether the component has current focus. * @param {number} props.highlightParent Whether to highlight the parent block. It defaults in highlighting the selected block. * @param {number} [props.debounceTimeout=250] Debounce timeout in milliseconds. */ function useDebouncedShowGestures({ ref, isFocused, highlightParent, debounceTimeout = DEBOUNCE_TIMEOUT }) { const { getSelectedBlockClientId, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store); const { toggleBlockHighlight } = (0,external_wp_data_namespaceObject.useDispatch)(store); const timeoutRef = (0,external_wp_element_namespaceObject.useRef)(); const isDistractionFree = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().isDistractionFree, []); const handleOnChange = nextIsFocused => { if (nextIsFocused && isDistractionFree) { return; } const selectedBlockClientId = getSelectedBlockClientId(); const clientId = highlightParent ? getBlockRootClientId(selectedBlockClientId) : selectedBlockClientId; toggleBlockHighlight(clientId, nextIsFocused); }; const getIsHovered = () => { return ref?.current && ref.current.matches(':hover'); }; const shouldHideGestures = () => { const isHovered = getIsHovered(); return !isFocused && !isHovered; }; const clearTimeoutRef = () => { const timeout = timeoutRef.current; if (timeout && utils_clearTimeout) { utils_clearTimeout(timeout); } }; const debouncedShowGestures = event => { if (event) { event.stopPropagation(); } clearTimeoutRef(); handleOnChange(true); }; const debouncedHideGestures = event => { if (event) { event.stopPropagation(); } clearTimeoutRef(); timeoutRef.current = utils_setTimeout(() => { if (shouldHideGestures()) { handleOnChange(false); } }, debounceTimeout); }; (0,external_wp_element_namespaceObject.useEffect)(() => () => { /** * We need to call the change handler with `isFocused` * set to false on unmount because we also clear the * timeout that would handle that. */ handleOnChange(false); clearTimeoutRef(); }, []); return { debouncedShowGestures, debouncedHideGestures }; } /** * Hook that provides gesture events for DOM elements * that interact with the isFocused state. * * @param {Object} props Component props. * @param {Object} props.ref Element reference. * @param {number} [props.highlightParent=false] Whether to highlight the parent block. It defaults to highlighting the selected block. * @param {number} [props.debounceTimeout=250] Debounce timeout in milliseconds. */ function useShowHoveredOrFocusedGestures({ ref, highlightParent = false, debounceTimeout = DEBOUNCE_TIMEOUT }) { const [isFocused, setIsFocused] = (0,external_wp_element_namespaceObject.useState)(false); const { debouncedShowGestures, debouncedHideGestures } = useDebouncedShowGestures({ ref, debounceTimeout, isFocused, highlightParent }); const registerRef = (0,external_wp_element_namespaceObject.useRef)(false); const isFocusedWithin = () => { return ref?.current && ref.current.contains(ref.current.ownerDocument.activeElement); }; (0,external_wp_element_namespaceObject.useEffect)(() => { const node = ref.current; const handleOnFocus = () => { if (isFocusedWithin()) { setIsFocused(true); debouncedShowGestures(); } }; const handleOnBlur = () => { if (!isFocusedWithin()) { setIsFocused(false); debouncedHideGestures(); } }; /** * Events are added via DOM events (vs. React synthetic events), * as the child React components swallow mouse events. */ if (node && !registerRef.current) { node.addEventListener('focus', handleOnFocus, true); node.addEventListener('blur', handleOnBlur, true); registerRef.current = true; } return () => { if (node) { node.removeEventListener('focus', handleOnFocus); node.removeEventListener('blur', handleOnBlur); } }; }, [ref, registerRef, setIsFocused, debouncedShowGestures, debouncedHideGestures]); return { onMouseMove: debouncedShowGestures, onMouseLeave: debouncedHideGestures }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-parent-selector/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Block parent selector component, displaying the hierarchy of the * current block selection as a single icon to "go up" a level. * * @return {Component} Parent block selector. */ function BlockParentSelector() { const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { parentClientId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockParents, getSelectedBlockClientId, getParentSectionBlock } = unlock(select(store)); const selectedBlockClientId = getSelectedBlockClientId(); const parentSection = getParentSectionBlock(selectedBlockClientId); const parents = getBlockParents(selectedBlockClientId); const _parentClientId = parentSection !== null && parentSection !== void 0 ? parentSection : parents[parents.length - 1]; return { parentClientId: _parentClientId }; }, []); const blockInformation = useBlockDisplayInformation(parentClientId); // Allows highlighting the parent block outline when focusing or hovering // the parent block selector within the child. const nodeRef = (0,external_wp_element_namespaceObject.useRef)(); const showHoveredOrFocusedGestures = useShowHoveredOrFocusedGestures({ ref: nodeRef, highlightParent: true }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-parent-selector", ref: nodeRef, ...showHoveredOrFocusedGestures, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { className: "block-editor-block-parent-selector__button", onClick: () => selectBlock(parentClientId), label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Name of the block's parent. */ (0,external_wp_i18n_namespaceObject.__)('Select parent block: %s'), blockInformation?.title), showTooltip: true, icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: blockInformation?.icon }) }) }, parentClientId); } ;// ./node_modules/@wordpress/icons/build-module/library/copy.js /** * WordPress dependencies */ const copy_copy = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z" }) }); /* harmony default export */ const library_copy = (copy_copy); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/preview-block-popover.js /** * WordPress dependencies */ /** * Internal dependencies */ function PreviewBlockPopover({ blocks }) { const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); if (isMobile) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-switcher__popover-preview-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { className: "block-editor-block-switcher__popover-preview", placement: "right-start", focusOnMount: false, offset: 16, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-switcher__preview", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-switcher__preview-title", children: (0,external_wp_i18n_namespaceObject.__)('Preview') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview, { viewportWidth: 500, blocks: blocks })] }) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-variation-transformations.js /** * WordPress dependencies */ /** * Internal dependencies */ const block_variation_transformations_EMPTY_OBJECT = {}; function useBlockVariationTransforms({ clientIds, blocks }) { const { activeBlockVariation, blockVariationTransformations } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockAttributes, canRemoveBlocks } = select(store); const { getActiveBlockVariation, getBlockVariations } = select(external_wp_blocks_namespaceObject.store); const canRemove = canRemoveBlocks(clientIds); // Only handle single selected blocks for now. if (blocks.length !== 1 || !canRemove) { return block_variation_transformations_EMPTY_OBJECT; } const [firstBlock] = blocks; return { blockVariationTransformations: getBlockVariations(firstBlock.name, 'transform'), activeBlockVariation: getActiveBlockVariation(firstBlock.name, getBlockAttributes(firstBlock.clientId)) }; }, [clientIds, blocks]); const transformations = (0,external_wp_element_namespaceObject.useMemo)(() => { return blockVariationTransformations?.filter(({ name }) => name !== activeBlockVariation?.name); }, [blockVariationTransformations, activeBlockVariation]); return transformations; } const BlockVariationTransformations = ({ transformations, onSelect, blocks }) => { const [hoveredTransformItemName, setHoveredTransformItemName] = (0,external_wp_element_namespaceObject.useState)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [hoveredTransformItemName && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewBlockPopover, { blocks: (0,external_wp_blocks_namespaceObject.cloneBlock)(blocks[0], transformations.find(({ name }) => name === hoveredTransformItemName).attributes) }), transformations?.map(item => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockVariationTransformationItem, { item: item, onSelect: onSelect, setHoveredTransformItemName: setHoveredTransformItemName }, item.name))] }); }; function BlockVariationTransformationItem({ item, onSelect, setHoveredTransformItemName }) { const { name, icon, title } = item; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuItem, { className: (0,external_wp_blocks_namespaceObject.getBlockMenuDefaultClassName)(name), onClick: event => { event.preventDefault(); onSelect(name); }, onMouseLeave: () => setHoveredTransformItemName(null), onMouseEnter: () => setHoveredTransformItemName(name), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: icon, showColors: true }), title] }); } /* harmony default export */ const block_variation_transformations = (BlockVariationTransformations); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-transformations-menu.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Helper hook to group transformations to display them in a specific order in the UI. * For now we group only priority content driven transformations(ex. paragraph -> heading). * * Later on we could also group 'layout' transformations(ex. paragraph -> group) and * display them in different sections. * * @param {Object[]} possibleBlockTransformations The available block transformations. * @return {Record<string, Object[]>} The grouped block transformations. */ function useGroupedTransforms(possibleBlockTransformations) { const priorityContentTransformationBlocks = { 'core/paragraph': 1, 'core/heading': 2, 'core/list': 3, 'core/quote': 4 }; const transformations = (0,external_wp_element_namespaceObject.useMemo)(() => { const priorityTextTransformsNames = Object.keys(priorityContentTransformationBlocks); const groupedPossibleTransforms = possibleBlockTransformations.reduce((accumulator, item) => { const { name } = item; if (priorityTextTransformsNames.includes(name)) { accumulator.priorityTextTransformations.push(item); } else { accumulator.restTransformations.push(item); } return accumulator; }, { priorityTextTransformations: [], restTransformations: [] }); /** * If there is only one priority text transformation and it's a Quote, * is should move to the rest transformations. This is because Quote can * be a container for any block type, so in multi-block selection it will * always be suggested, even for non-text blocks. */ if (groupedPossibleTransforms.priorityTextTransformations.length === 1 && groupedPossibleTransforms.priorityTextTransformations[0].name === 'core/quote') { const singleQuote = groupedPossibleTransforms.priorityTextTransformations.pop(); groupedPossibleTransforms.restTransformations.push(singleQuote); } return groupedPossibleTransforms; }, [possibleBlockTransformations]); // Order the priority text transformations. transformations.priorityTextTransformations.sort(({ name: currentName }, { name: nextName }) => { return priorityContentTransformationBlocks[currentName] < priorityContentTransformationBlocks[nextName] ? -1 : 1; }); return transformations; } const BlockTransformationsMenu = ({ className, possibleBlockTransformations, possibleBlockVariationTransformations, onSelect, onSelectVariation, blocks }) => { const [hoveredTransformItemName, setHoveredTransformItemName] = (0,external_wp_element_namespaceObject.useState)(); const { priorityTextTransformations, restTransformations } = useGroupedTransforms(possibleBlockTransformations); // We have to check if both content transformations(priority and rest) are set // in order to create a separate MenuGroup for them. const hasBothContentTransformations = priorityTextTransformations.length && restTransformations.length; const restTransformItems = !!restTransformations.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RestTransformationItems, { restTransformations: restTransformations, onSelect: onSelect, setHoveredTransformItemName: setHoveredTransformItemName }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Transform to'), className: className, children: [hoveredTransformItemName && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewBlockPopover, { blocks: (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, hoveredTransformItemName) }), !!possibleBlockVariationTransformations?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_variation_transformations, { transformations: possibleBlockVariationTransformations, blocks: blocks, onSelect: onSelectVariation }), priorityTextTransformations.map(item => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockTransformationItem, { item: item, onSelect: onSelect, setHoveredTransformItemName: setHoveredTransformItemName }, item.name)), !hasBothContentTransformations && restTransformItems] }), !!hasBothContentTransformations && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { className: className, children: restTransformItems })] }); }; function RestTransformationItems({ restTransformations, onSelect, setHoveredTransformItemName }) { return restTransformations.map(item => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockTransformationItem, { item: item, onSelect: onSelect, setHoveredTransformItemName: setHoveredTransformItemName }, item.name)); } function BlockTransformationItem({ item, onSelect, setHoveredTransformItemName }) { const { name, icon, title, isDisabled } = item; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuItem, { className: (0,external_wp_blocks_namespaceObject.getBlockMenuDefaultClassName)(name), onClick: event => { event.preventDefault(); onSelect(name); }, disabled: isDisabled, onMouseLeave: () => setHoveredTransformItemName(null), onMouseEnter: () => setHoveredTransformItemName(name), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: icon, showColors: true }), title] }); } /* harmony default export */ const block_transformations_menu = (BlockTransformationsMenu); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-styles/utils.js /** * WordPress dependencies */ /** * Returns the active style from the given className. * * @param {Array} styles Block styles. * @param {string} className Class name * * @return {?Object} The active style. */ function getActiveStyle(styles, className) { for (const style of new (external_wp_tokenList_default())(className).values()) { if (style.indexOf('is-style-') === -1) { continue; } const potentialStyleName = style.substring(9); const activeStyle = styles?.find(({ name }) => name === potentialStyleName); if (activeStyle) { return activeStyle; } } return getDefaultStyle(styles); } /** * Replaces the active style in the block's className. * * @param {string} className Class name. * @param {?Object} activeStyle The replaced style. * @param {Object} newStyle The replacing style. * * @return {string} The updated className. */ function replaceActiveStyle(className, activeStyle, newStyle) { const list = new (external_wp_tokenList_default())(className); if (activeStyle) { list.remove('is-style-' + activeStyle.name); } list.add('is-style-' + newStyle.name); return list.value; } /** * Returns a collection of styles that can be represented on the frontend. * The function checks a style collection for a default style. If none is found, it adds one to * act as a fallback for when there is no active style applied to a block. The default item also serves * as a switch on the frontend to deactivate non-default styles. * * @param {Array} styles Block styles. * * @return {Array<Object?>} The style collection. */ function getRenderedStyles(styles) { if (!styles || styles.length === 0) { return []; } return getDefaultStyle(styles) ? styles : [{ name: 'default', label: (0,external_wp_i18n_namespaceObject._x)('Default', 'block style'), isDefault: true }, ...styles]; } /** * Returns a style object from a collection of styles where that style object is the default block style. * * @param {Array} styles Block styles. * * @return {?Object} The default style object, if found. */ function getDefaultStyle(styles) { return styles?.find(style => style.isDefault); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-styles/use-styles-for-block.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * * @param {WPBlock} block Block object. * @param {WPBlockType} type Block type settings. * @return {WPBlock} A generic block ready for styles preview. */ function useGenericPreviewBlock(block, type) { return (0,external_wp_element_namespaceObject.useMemo)(() => { const example = type?.example; const blockName = type?.name; if (example && blockName) { return (0,external_wp_blocks_namespaceObject.getBlockFromExample)(blockName, { attributes: example.attributes, innerBlocks: example.innerBlocks }); } if (block) { return (0,external_wp_blocks_namespaceObject.cloneBlock)(block); } }, [type?.example ? block?.name : block, type]); } /** * @typedef useStylesForBlocksArguments * @property {string} clientId Block client ID. * @property {() => void} onSwitch Block style switch callback function. */ /** * * @param {useStylesForBlocksArguments} useStylesForBlocks arguments. * @return {Object} Results of the select methods. */ function useStylesForBlocks({ clientId, onSwitch }) { const selector = select => { const { getBlock } = select(store); const block = getBlock(clientId); if (!block) { return {}; } const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(block.name); const { getBlockStyles } = select(external_wp_blocks_namespaceObject.store); return { block, blockType, styles: getBlockStyles(block.name), className: block.attributes.className || '' }; }; const { styles, block, blockType, className } = (0,external_wp_data_namespaceObject.useSelect)(selector, [clientId]); const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); const stylesToRender = getRenderedStyles(styles); const activeStyle = getActiveStyle(stylesToRender, className); const genericPreviewBlock = useGenericPreviewBlock(block, blockType); const onSelect = style => { const styleClassName = replaceActiveStyle(className, activeStyle, style); updateBlockAttributes(clientId, { className: styleClassName }); onSwitch(); }; return { onSelect, stylesToRender, activeStyle, genericPreviewBlock, className }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-styles/menu-items.js /** * WordPress dependencies */ /** * Internal dependencies */ const menu_items_noop = () => {}; function BlockStylesMenuItems({ clientId, onSwitch = menu_items_noop }) { const { onSelect, stylesToRender, activeStyle } = useStylesForBlocks({ clientId, onSwitch }); if (!stylesToRender || stylesToRender.length === 0) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: stylesToRender.map(style => { const menuItemText = style.label || style.name; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: activeStyle.name === style.name ? library_check : null, onClick: () => onSelect(style), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { as: "span", limit: 18, ellipsizeMode: "tail", truncate: true, children: menuItemText }) }, style.name); }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/block-styles-menu.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockStylesMenu({ hoveredBlock, onSwitch }) { const { clientId } = hoveredBlock; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Styles'), className: "block-editor-block-switcher__styles__menugroup", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockStylesMenuItems, { clientId: clientId, onSwitch: onSwitch }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/utils.js /** * WordPress dependencies */ /** * Try to find a matching block by a block's name in a provided * block. We recurse through InnerBlocks and return the reference * of the matched block (it could be an InnerBlock). * If no match is found return nothing. * * @param {WPBlock} block The block to try to find a match. * @param {string} selectedBlockName The block's name to use for matching condition. * @param {Set} consumedBlocks A set holding the previously matched/consumed blocks. * * @return {WPBlock | undefined} The matched block if found or nothing(`undefined`). */ const getMatchingBlockByName = (block, selectedBlockName, consumedBlocks = new Set()) => { const { clientId, name, innerBlocks = [] } = block; // Check if block has been consumed already. if (consumedBlocks.has(clientId)) { return; } if (name === selectedBlockName) { return block; } // Try to find a matching block from InnerBlocks recursively. for (const innerBlock of innerBlocks) { const match = getMatchingBlockByName(innerBlock, selectedBlockName, consumedBlocks); if (match) { return match; } } }; /** * Find and return the block attributes to retain through * the transformation, based on Block Type's `role:content` * attributes. If no `role:content` attributes exist, * return selected block's attributes. * * @param {string} name Block type's namespaced name. * @param {Object} attributes Selected block's attributes. * @return {Object} The block's attributes to retain. */ const getRetainedBlockAttributes = (name, attributes) => { const contentAttributes = (0,external_wp_blocks_namespaceObject.getBlockAttributesNamesByRole)(name, 'content'); if (!contentAttributes?.length) { return attributes; } return contentAttributes.reduce((_accumulator, attribute) => { if (attributes[attribute]) { _accumulator[attribute] = attributes[attribute]; } return _accumulator; }, {}); }; ;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/use-transformed-patterns.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Mutate the matched block's attributes by getting * which block type's attributes to retain and prioritize * them in the merging of the attributes. * * @param {WPBlock} match The matched block. * @param {WPBlock} selectedBlock The selected block. * @return {void} */ const transformMatchingBlock = (match, selectedBlock) => { // Get the block attributes to retain through the transformation. const retainedBlockAttributes = getRetainedBlockAttributes(selectedBlock.name, selectedBlock.attributes); match.attributes = { ...match.attributes, ...retainedBlockAttributes }; }; /** * By providing the selected blocks and pattern's blocks * find the matching blocks, transform them and return them. * If not all selected blocks are matched, return nothing. * * @param {WPBlock[]} selectedBlocks The selected blocks. * @param {WPBlock[]} patternBlocks The pattern's blocks. * @return {WPBlock[]|void} The transformed pattern's blocks or undefined if not all selected blocks have been matched. */ const getPatternTransformedBlocks = (selectedBlocks, patternBlocks) => { // Clone Pattern's blocks to produce new clientIds and be able to mutate the matches. const _patternBlocks = patternBlocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)); /** * Keep track of the consumed pattern blocks. * This is needed because we loop the selected blocks * and for example we may have selected two paragraphs and * the pattern's blocks could have more `paragraphs`. */ const consumedBlocks = new Set(); for (const selectedBlock of selectedBlocks) { let isMatch = false; for (const patternBlock of _patternBlocks) { const match = getMatchingBlockByName(patternBlock, selectedBlock.name, consumedBlocks); if (!match) { continue; } isMatch = true; consumedBlocks.add(match.clientId); // We update (mutate) the matching pattern block. transformMatchingBlock(match, selectedBlock); // No need to loop through other pattern's blocks. break; } // Bail early if a selected block has not been matched. if (!isMatch) { return; } } return _patternBlocks; }; /** * @typedef {WPBlockPattern & {transformedBlocks: WPBlock[]}} TransformedBlockPattern */ /** * Custom hook that accepts patterns from state and the selected * blocks and tries to match these with the pattern's blocks. * If all selected blocks are matched with a Pattern's block, * we transform them by retaining block's attributes with `role:content`. * The transformed pattern's blocks are set to a new pattern * property `transformedBlocks`. * * @param {WPBlockPattern[]} patterns Patterns from state. * @param {WPBlock[]} selectedBlocks The currently selected blocks. * @return {TransformedBlockPattern[]} Returns the eligible matched patterns with all the selected blocks. */ const useTransformedPatterns = (patterns, selectedBlocks) => { return (0,external_wp_element_namespaceObject.useMemo)(() => patterns.reduce((accumulator, _pattern) => { const transformedBlocks = getPatternTransformedBlocks(selectedBlocks, _pattern.blocks); if (transformedBlocks) { accumulator.push({ ..._pattern, transformedBlocks }); } return accumulator; }, []), [patterns, selectedBlocks]); }; /* harmony default export */ const use_transformed_patterns = (useTransformedPatterns); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/pattern-transformations-menu.js /** * WordPress dependencies */ /** * Internal dependencies */ function PatternTransformationsMenu({ blocks, patterns: statePatterns, onSelect }) { const [showTransforms, setShowTransforms] = (0,external_wp_element_namespaceObject.useState)(false); const patterns = use_transformed_patterns(statePatterns, blocks); if (!patterns.length) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { className: "block-editor-block-switcher__pattern__transforms__menugroup", children: [showTransforms && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PreviewPatternsPopover, { patterns: patterns, onSelect: onSelect }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: event => { event.preventDefault(); setShowTransforms(!showTransforms); }, icon: chevron_right, children: (0,external_wp_i18n_namespaceObject.__)('Patterns') })] }); } function PreviewPatternsPopover({ patterns, onSelect }) { const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-switcher__popover-preview-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { className: "block-editor-block-switcher__popover-preview", placement: isMobile ? 'bottom' : 'right-start', offset: 16, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-switcher__preview is-pattern-list-preview", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pattern_transformations_menu_BlockPatternsList, { patterns: patterns, onSelect: onSelect }) }) }) }); } function pattern_transformations_menu_BlockPatternsList({ patterns, onSelect }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { role: "listbox", className: "block-editor-block-switcher__preview-patterns-container", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Patterns list'), children: patterns.map(pattern => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pattern_transformations_menu_BlockPattern, { pattern: pattern, onSelect: onSelect }, pattern.name)) }); } function pattern_transformations_menu_BlockPattern({ pattern, onSelect }) { // TODO check pattern/preview width... const baseClassName = 'block-editor-block-switcher__preview-patterns-container'; const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(pattern_transformations_menu_BlockPattern, `${baseClassName}-list__item-description`); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: `${baseClassName}-list__list-item`, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Item, { render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "option", "aria-label": pattern.title, "aria-describedby": pattern.description ? descriptionId : undefined, className: `${baseClassName}-list__item` }), onClick: () => onSelect(pattern.transformedBlocks), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview, { blocks: pattern.transformedBlocks, viewportWidth: pattern.viewportWidth || 500 }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${baseClassName}-list__item-title`, children: pattern.title })] }), !!pattern.description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: pattern.description })] }); } /* harmony default export */ const pattern_transformations_menu = (PatternTransformationsMenu); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-switcher/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockSwitcherDropdownMenuContents({ onClose, clientIds, hasBlockStyles, canRemove }) { const { replaceBlocks, multiSelect, updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { possibleBlockTransformations, patterns, blocks, isUsingBindings } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockAttributes, getBlocksByClientId, getBlockRootClientId, getBlockTransformItems, __experimentalGetPatternTransformItems } = select(store); const rootClientId = getBlockRootClientId(clientIds[0]); const _blocks = getBlocksByClientId(clientIds); return { blocks: _blocks, possibleBlockTransformations: getBlockTransformItems(_blocks, rootClientId), patterns: __experimentalGetPatternTransformItems(_blocks, rootClientId), isUsingBindings: clientIds.every(clientId => !!getBlockAttributes(clientId)?.metadata?.bindings) }; }, [clientIds]); const blockVariationTransformations = useBlockVariationTransforms({ clientIds, blocks }); function selectForMultipleBlocks(insertedBlocks) { if (insertedBlocks.length > 1) { multiSelect(insertedBlocks[0].clientId, insertedBlocks[insertedBlocks.length - 1].clientId); } } // Simple block transformation based on the `Block Transforms` API. function onBlockTransform(name) { const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, name); replaceBlocks(clientIds, newBlocks); selectForMultipleBlocks(newBlocks); } function onBlockVariationTransform(name) { updateBlockAttributes(blocks[0].clientId, { ...blockVariationTransformations.find(({ name: variationName }) => variationName === name).attributes }); } // Pattern transformation through the `Patterns` API. function onPatternTransform(transformedBlocks) { replaceBlocks(clientIds, transformedBlocks); selectForMultipleBlocks(transformedBlocks); } /** * The `isTemplate` check is a stopgap solution here. * Ideally, the Transforms API should handle this * by allowing to exclude blocks from wildcard transformations. */ const isSingleBlock = blocks.length === 1; const isTemplate = isSingleBlock && (0,external_wp_blocks_namespaceObject.isTemplatePart)(blocks[0]); const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove && !isTemplate; const hasPossibleBlockVariationTransformations = !!blockVariationTransformations?.length; const hasPatternTransformation = !!patterns?.length && canRemove; const hasBlockOrBlockVariationTransforms = hasPossibleBlockTransformations || hasPossibleBlockVariationTransformations; const hasContents = hasBlockStyles || hasBlockOrBlockVariationTransforms || hasPatternTransformation; if (!hasContents) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-block-switcher__no-transforms", children: (0,external_wp_i18n_namespaceObject.__)('No transforms.') }); } const connectedBlockDescription = isSingleBlock ? (0,external_wp_i18n_namespaceObject._x)('This block is connected.', 'block toolbar button label and description') : (0,external_wp_i18n_namespaceObject._x)('These blocks are connected.', 'block toolbar button label and description'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-switcher__container", children: [hasPatternTransformation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pattern_transformations_menu, { blocks: blocks, patterns: patterns, onSelect: transformedBlocks => { onPatternTransform(transformedBlocks); onClose(); } }), hasBlockOrBlockVariationTransforms && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_transformations_menu, { className: "block-editor-block-switcher__transforms__menugroup", possibleBlockTransformations: possibleBlockTransformations, possibleBlockVariationTransformations: blockVariationTransformations, blocks: blocks, onSelect: name => { onBlockTransform(name); onClose(); }, onSelectVariation: name => { onBlockVariationTransform(name); onClose(); } }), hasBlockStyles && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockStylesMenu, { hoveredBlock: blocks[0], onSwitch: onClose }), isUsingBindings && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { className: "block-editor-block-switcher__binding-indicator", children: connectedBlockDescription }) })] }); } const BlockSwitcher = ({ clientIds }) => { const { hasContentOnlyLocking, canRemove, hasBlockStyles, icon, invalidBlocks, isReusable, isTemplate, isDisabled } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getTemplateLock, getBlocksByClientId, getBlockAttributes, canRemoveBlocks, getBlockEditingMode } = select(store); const { getBlockStyles, getBlockType, getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store); const _blocks = getBlocksByClientId(clientIds); if (!_blocks.length || _blocks.some(block => !block)) { return { invalidBlocks: true }; } const [{ name: firstBlockName }] = _blocks; const _isSingleBlockSelected = _blocks.length === 1; const blockType = getBlockType(firstBlockName); const editingMode = getBlockEditingMode(clientIds[0]); let _icon; let _hasTemplateLock; if (_isSingleBlockSelected) { const match = getActiveBlockVariation(firstBlockName, getBlockAttributes(clientIds[0])); // Take into account active block variations. _icon = match?.icon || blockType.icon; _hasTemplateLock = getTemplateLock(clientIds[0]) === 'contentOnly'; } else { const isSelectionOfSameType = new Set(_blocks.map(({ name }) => name)).size === 1; _hasTemplateLock = clientIds.some(id => getTemplateLock(id) === 'contentOnly'); // When selection consists of blocks of multiple types, display an // appropriate icon to communicate the non-uniformity. _icon = isSelectionOfSameType ? blockType.icon : library_copy; } return { canRemove: canRemoveBlocks(clientIds), hasBlockStyles: _isSingleBlockSelected && !!getBlockStyles(firstBlockName)?.length, icon: _icon, isReusable: _isSingleBlockSelected && (0,external_wp_blocks_namespaceObject.isReusableBlock)(_blocks[0]), isTemplate: _isSingleBlockSelected && (0,external_wp_blocks_namespaceObject.isTemplatePart)(_blocks[0]), hasContentOnlyLocking: _hasTemplateLock, isDisabled: editingMode !== 'default' }; }, [clientIds]); const blockTitle = useBlockDisplayTitle({ clientId: clientIds?.[0], maximumLength: 35 }); const showIconLabels = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_preferences_namespaceObject.store).get('core', 'showIconLabels'), []); if (invalidBlocks) { return null; } const isSingleBlock = clientIds.length === 1; const blockSwitcherLabel = isSingleBlock ? blockTitle : (0,external_wp_i18n_namespaceObject.__)('Multiple blocks selected'); const blockIndicatorText = (isReusable || isTemplate) && !showIconLabels && blockTitle ? blockTitle : undefined; const hideDropdown = isDisabled || !hasBlockStyles && !canRemove || hasContentOnlyLocking; if (hideDropdown) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { disabled: true, className: "block-editor-block-switcher__no-switcher-icon", title: blockSwitcherLabel, icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { className: "block-editor-block-switcher__toggle", icon: icon, showColors: true }), text: blockIndicatorText }) }); } const blockSwitcherDescription = isSingleBlock ? (0,external_wp_i18n_namespaceObject.__)('Change block type or style') : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of blocks. */ (0,external_wp_i18n_namespaceObject._n)('Change type of %d block', 'Change type of %d blocks', clientIds.length), clientIds.length); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: toggleProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { className: "block-editor-block-switcher", label: blockSwitcherLabel, popoverProps: { placement: 'bottom-start', className: 'block-editor-block-switcher__popover' }, icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { className: "block-editor-block-switcher__toggle", icon: icon, showColors: true }), text: blockIndicatorText, toggleProps: { description: blockSwitcherDescription, ...toggleProps }, menuProps: { orientation: 'both' }, children: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockSwitcherDropdownMenuContents, { onClose: onClose, clientIds: clientIds, hasBlockStyles: hasBlockStyles, canRemove: canRemove }) }) }) }); }; /* harmony default export */ const block_switcher = (BlockSwitcher); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/block-toolbar-last-item.js /** * WordPress dependencies */ const { Fill: __unstableBlockToolbarLastItem, Slot: block_toolbar_last_item_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)('__unstableBlockToolbarLastItem'); __unstableBlockToolbarLastItem.Slot = block_toolbar_last_item_Slot; /* harmony default export */ const block_toolbar_last_item = (__unstableBlockToolbarLastItem); ;// ./node_modules/@wordpress/block-editor/build-module/hooks/supports.js /** * WordPress dependencies */ const ALIGN_SUPPORT_KEY = 'align'; const ALIGN_WIDE_SUPPORT_KEY = 'alignWide'; const supports_BORDER_SUPPORT_KEY = '__experimentalBorder'; const supports_COLOR_SUPPORT_KEY = 'color'; const CUSTOM_CLASS_NAME_SUPPORT_KEY = 'customClassName'; const supports_FONT_FAMILY_SUPPORT_KEY = 'typography.__experimentalFontFamily'; const supports_FONT_SIZE_SUPPORT_KEY = 'typography.fontSize'; const supports_LINE_HEIGHT_SUPPORT_KEY = 'typography.lineHeight'; /** * Key within block settings' support array indicating support for font style. */ const supports_FONT_STYLE_SUPPORT_KEY = 'typography.__experimentalFontStyle'; /** * Key within block settings' support array indicating support for font weight. */ const supports_FONT_WEIGHT_SUPPORT_KEY = 'typography.__experimentalFontWeight'; /** * Key within block settings' supports array indicating support for text * align e.g. settings found in `block.json`. */ const supports_TEXT_ALIGN_SUPPORT_KEY = 'typography.textAlign'; /** * Key within block settings' supports array indicating support for text * columns e.g. settings found in `block.json`. */ const supports_TEXT_COLUMNS_SUPPORT_KEY = 'typography.textColumns'; /** * Key within block settings' supports array indicating support for text * decorations e.g. settings found in `block.json`. */ const supports_TEXT_DECORATION_SUPPORT_KEY = 'typography.__experimentalTextDecoration'; /** * Key within block settings' supports array indicating support for writing mode * e.g. settings found in `block.json`. */ const supports_WRITING_MODE_SUPPORT_KEY = 'typography.__experimentalWritingMode'; /** * Key within block settings' supports array indicating support for text * transforms e.g. settings found in `block.json`. */ const supports_TEXT_TRANSFORM_SUPPORT_KEY = 'typography.__experimentalTextTransform'; /** * Key within block settings' supports array indicating support for letter-spacing * e.g. settings found in `block.json`. */ const supports_LETTER_SPACING_SUPPORT_KEY = 'typography.__experimentalLetterSpacing'; const LAYOUT_SUPPORT_KEY = 'layout'; const supports_TYPOGRAPHY_SUPPORT_KEYS = [supports_LINE_HEIGHT_SUPPORT_KEY, supports_FONT_SIZE_SUPPORT_KEY, supports_FONT_STYLE_SUPPORT_KEY, supports_FONT_WEIGHT_SUPPORT_KEY, supports_FONT_FAMILY_SUPPORT_KEY, supports_TEXT_ALIGN_SUPPORT_KEY, supports_TEXT_COLUMNS_SUPPORT_KEY, supports_TEXT_DECORATION_SUPPORT_KEY, supports_TEXT_TRANSFORM_SUPPORT_KEY, supports_WRITING_MODE_SUPPORT_KEY, supports_LETTER_SPACING_SUPPORT_KEY]; const EFFECTS_SUPPORT_KEYS = ['shadow']; const supports_SPACING_SUPPORT_KEY = 'spacing'; const supports_styleSupportKeys = [...EFFECTS_SUPPORT_KEYS, ...supports_TYPOGRAPHY_SUPPORT_KEYS, supports_BORDER_SUPPORT_KEY, supports_COLOR_SUPPORT_KEY, supports_SPACING_SUPPORT_KEY]; /** * Returns true if the block defines support for align. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const hasAlignSupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, ALIGN_SUPPORT_KEY); /** * Returns the block support value for align, if defined. * * @param {string|Object} nameOrType Block name or type object. * @return {unknown} The block support value. */ const getAlignSupport = nameOrType => getBlockSupport(nameOrType, ALIGN_SUPPORT_KEY); /** * Returns true if the block defines support for align wide. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const hasAlignWideSupport = nameOrType => hasBlockSupport(nameOrType, ALIGN_WIDE_SUPPORT_KEY); /** * Returns the block support value for align wide, if defined. * * @param {string|Object} nameOrType Block name or type object. * @return {unknown} The block support value. */ const getAlignWideSupport = nameOrType => getBlockSupport(nameOrType, ALIGN_WIDE_SUPPORT_KEY); /** * Determine whether there is block support for border properties. * * @param {string|Object} nameOrType Block name or type object. * @param {string} feature Border feature to check support for. * * @return {boolean} Whether there is support. */ function supports_hasBorderSupport(nameOrType, feature = 'any') { if (external_wp_element_namespaceObject.Platform.OS !== 'web') { return false; } const support = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_BORDER_SUPPORT_KEY); if (support === true) { return true; } if (feature === 'any') { return !!(support?.color || support?.radius || support?.width || support?.style); } return !!support?.[feature]; } /** * Get block support for border properties. * * @param {string|Object} nameOrType Block name or type object. * @param {string} feature Border feature to get. * * @return {unknown} The block support. */ const getBorderSupport = (nameOrType, feature) => getBlockSupport(nameOrType, [supports_BORDER_SUPPORT_KEY, feature]); /** * Returns true if the block defines support for color. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const supports_hasColorSupport = nameOrType => { const colorSupport = getBlockSupport(nameOrType, supports_COLOR_SUPPORT_KEY); return colorSupport && (colorSupport.link === true || colorSupport.gradient === true || colorSupport.background !== false || colorSupport.text !== false); }; /** * Returns true if the block defines support for link color. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const supports_hasLinkColorSupport = nameOrType => { if (Platform.OS !== 'web') { return false; } const colorSupport = getBlockSupport(nameOrType, supports_COLOR_SUPPORT_KEY); return colorSupport !== null && typeof colorSupport === 'object' && !!colorSupport.link; }; /** * Returns true if the block defines support for gradient color. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const supports_hasGradientSupport = nameOrType => { const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_COLOR_SUPPORT_KEY); return colorSupport !== null && typeof colorSupport === 'object' && !!colorSupport.gradients; }; /** * Returns true if the block defines support for background color. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const supports_hasBackgroundColorSupport = nameOrType => { const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_COLOR_SUPPORT_KEY); return colorSupport && colorSupport.background !== false; }; /** * Returns true if the block defines support for text-align. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const hasTextAlignSupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, supports_TEXT_ALIGN_SUPPORT_KEY); /** * Returns the block support value for text-align, if defined. * * @param {string|Object} nameOrType Block name or type object. * @return {unknown} The block support value. */ const getTextAlignSupport = nameOrType => getBlockSupport(nameOrType, supports_TEXT_ALIGN_SUPPORT_KEY); /** * Returns true if the block defines support for background color. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const supports_hasTextColorSupport = nameOrType => { const colorSupport = (0,external_wp_blocks_namespaceObject.getBlockSupport)(nameOrType, supports_COLOR_SUPPORT_KEY); return colorSupport && colorSupport.text !== false; }; /** * Get block support for color properties. * * @param {string|Object} nameOrType Block name or type object. * @param {string} feature Color feature to get. * * @return {unknown} The block support. */ const getColorSupport = (nameOrType, feature) => getBlockSupport(nameOrType, [supports_COLOR_SUPPORT_KEY, feature]); /** * Returns true if the block defines support for custom class name. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const hasCustomClassNameSupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true); /** * Returns the block support value for custom class name, if defined. * * @param {string|Object} nameOrType Block name or type object. * @return {unknown} The block support value. */ const getCustomClassNameSupport = nameOrType => getBlockSupport(nameOrType, CUSTOM_CLASS_NAME_SUPPORT_KEY, true); /** * Returns true if the block defines support for font family. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const hasFontFamilySupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, supports_FONT_FAMILY_SUPPORT_KEY); /** * Returns the block support value for font family, if defined. * * @param {string|Object} nameOrType Block name or type object. * @return {unknown} The block support value. */ const getFontFamilySupport = nameOrType => getBlockSupport(nameOrType, supports_FONT_FAMILY_SUPPORT_KEY); /** * Returns true if the block defines support for font size. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const hasFontSizeSupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, supports_FONT_SIZE_SUPPORT_KEY); /** * Returns the block support value for font size, if defined. * * @param {string|Object} nameOrType Block name or type object. * @return {unknown} The block support value. */ const getFontSizeSupport = nameOrType => getBlockSupport(nameOrType, supports_FONT_SIZE_SUPPORT_KEY); /** * Returns true if the block defines support for layout. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const hasLayoutSupport = nameOrType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, LAYOUT_SUPPORT_KEY); /** * Returns the block support value for layout, if defined. * * @param {string|Object} nameOrType Block name or type object. * @return {unknown} The block support value. */ const getLayoutSupport = nameOrType => getBlockSupport(nameOrType, LAYOUT_SUPPORT_KEY); /** * Returns true if the block defines support for style. * * @param {string|Object} nameOrType Block name or type object. * @return {boolean} Whether the block supports the feature. */ const supports_hasStyleSupport = nameOrType => supports_styleSupportKeys.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(nameOrType, key)); ;// ./node_modules/@wordpress/block-editor/build-module/components/use-paste-styles/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Determine if the copied text looks like serialized blocks or not. * Since plain text will always get parsed into a freeform block, * we check that if the parsed blocks is anything other than that. * * @param {string} text The copied text. * @return {boolean} True if the text looks like serialized blocks, false otherwise. */ function hasSerializedBlocks(text) { try { const blocks = (0,external_wp_blocks_namespaceObject.parse)(text, { __unstableSkipMigrationLogs: true, __unstableSkipAutop: true }); if (blocks.length === 1 && blocks[0].name === 'core/freeform') { // It's likely that the text is just plain text and not serialized blocks. return false; } return true; } catch (err) { // Parsing error, the text is not serialized blocks. // (Even though that it technically won't happen) return false; } } /** * Style attributes are attributes being added in `block-editor/src/hooks/*`. * (Except for some unrelated to style like `anchor` or `settings`.) * They generally represent the default block supports. */ const STYLE_ATTRIBUTES = { align: hasAlignSupport, borderColor: nameOrType => supports_hasBorderSupport(nameOrType, 'color'), backgroundColor: supports_hasBackgroundColorSupport, textAlign: hasTextAlignSupport, textColor: supports_hasTextColorSupport, gradient: supports_hasGradientSupport, className: hasCustomClassNameSupport, fontFamily: hasFontFamilySupport, fontSize: hasFontSizeSupport, layout: hasLayoutSupport, style: supports_hasStyleSupport }; /** * Get the "style attributes" from a given block to a target block. * * @param {WPBlock} sourceBlock The source block. * @param {WPBlock} targetBlock The target block. * @return {Object} the filtered attributes object. */ function getStyleAttributes(sourceBlock, targetBlock) { return Object.entries(STYLE_ATTRIBUTES).reduce((attributes, [attributeKey, hasSupport]) => { // Only apply the attribute if both blocks support it. if (hasSupport(sourceBlock.name) && hasSupport(targetBlock.name)) { // Override attributes that are not present in the block to their defaults. attributes[attributeKey] = sourceBlock.attributes[attributeKey]; } return attributes; }, {}); } /** * Update the target blocks with style attributes recursively. * * @param {WPBlock[]} targetBlocks The target blocks to be updated. * @param {WPBlock[]} sourceBlocks The source blocks to get th style attributes from. * @param {Function} updateBlockAttributes The function to update the attributes. */ function recursivelyUpdateBlockAttributes(targetBlocks, sourceBlocks, updateBlockAttributes) { for (let index = 0; index < Math.min(sourceBlocks.length, targetBlocks.length); index += 1) { updateBlockAttributes(targetBlocks[index].clientId, getStyleAttributes(sourceBlocks[index], targetBlocks[index])); recursivelyUpdateBlockAttributes(targetBlocks[index].innerBlocks, sourceBlocks[index].innerBlocks, updateBlockAttributes); } } /** * A hook to return a pasteStyles event function for handling pasting styles to blocks. * * @return {Function} A function to update the styles to the blocks. */ function usePasteStyles() { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { createSuccessNotice, createWarningNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); return (0,external_wp_element_namespaceObject.useCallback)(async targetBlocks => { let html = ''; try { // `http:` sites won't have the clipboard property on navigator. // (with the exception of localhost.) if (!window.navigator.clipboard) { createErrorNotice((0,external_wp_i18n_namespaceObject.__)('Unable to paste styles. This feature is only available on secure (https) sites in supporting browsers.'), { type: 'snackbar' }); return; } html = await window.navigator.clipboard.readText(); } catch (error) { // Possibly the permission is denied. createErrorNotice((0,external_wp_i18n_namespaceObject.__)('Unable to paste styles. Please allow browser clipboard permissions before continuing.'), { type: 'snackbar' }); return; } // Abort if the copied text is empty or doesn't look like serialized blocks. if (!html || !hasSerializedBlocks(html)) { createWarningNotice((0,external_wp_i18n_namespaceObject.__)("Unable to paste styles. Block styles couldn't be found within the copied content."), { type: 'snackbar' }); return; } const copiedBlocks = (0,external_wp_blocks_namespaceObject.parse)(html); if (copiedBlocks.length === 1) { // Apply styles of the block to all the target blocks. registry.batch(() => { recursivelyUpdateBlockAttributes(targetBlocks, targetBlocks.map(() => copiedBlocks[0]), updateBlockAttributes); }); } else { registry.batch(() => { recursivelyUpdateBlockAttributes(targetBlocks, copiedBlocks, updateBlockAttributes); }); } if (targetBlocks.length === 1) { const title = (0,external_wp_blocks_namespaceObject.getBlockType)(targetBlocks[0].name)?.title; createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // Translators: Name of the block being pasted, e.g. "Paragraph". (0,external_wp_i18n_namespaceObject.__)('Pasted styles to %s.'), title), { type: 'snackbar' }); } else { createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)( // Translators: The number of the blocks. (0,external_wp_i18n_namespaceObject.__)('Pasted styles to %d blocks.'), targetBlocks.length), { type: 'snackbar' }); } }, [registry.batch, updateBlockAttributes, createSuccessNotice, createWarningNotice, createErrorNotice]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-actions/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockActions({ clientIds, children, __experimentalUpdateSelection: updateSelection }) { const { getDefaultBlockName, getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); const selected = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canInsertBlockType, getBlockRootClientId, getBlocksByClientId, getDirectInsertBlock, canRemoveBlocks } = select(store); const blocks = getBlocksByClientId(clientIds); const rootClientId = getBlockRootClientId(clientIds[0]); const canInsertDefaultBlock = canInsertBlockType(getDefaultBlockName(), rootClientId); const directInsertBlock = rootClientId ? getDirectInsertBlock(rootClientId) : null; return { canRemove: canRemoveBlocks(clientIds), canInsertBlock: canInsertDefaultBlock || !!directInsertBlock, canCopyStyles: blocks.every(block => { return !!block && ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, 'color') || (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, 'typography')); }), canDuplicate: blocks.every(block => { return !!block && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, 'multiple', true) && canInsertBlockType(block.name, rootClientId); }) }; }, [clientIds, getDefaultBlockName]); const { getBlocksByClientId, getBlocks } = (0,external_wp_data_namespaceObject.useSelect)(store); const { canRemove, canInsertBlock, canCopyStyles, canDuplicate } = selected; const { removeBlocks, replaceBlocks, duplicateBlocks, insertAfterBlock, insertBeforeBlock, flashBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const pasteStyles = usePasteStyles(); return children({ canCopyStyles, canDuplicate, canInsertBlock, canRemove, onDuplicate() { return duplicateBlocks(clientIds, updateSelection); }, onRemove() { return removeBlocks(clientIds, updateSelection); }, onInsertBefore() { insertBeforeBlock(clientIds[0]); }, onInsertAfter() { insertAfterBlock(clientIds[clientIds.length - 1]); }, onGroup() { if (!clientIds.length) { return; } const groupingBlockName = getGroupingBlockName(); // Activate the `transform` on `core/group` which does the conversion. const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlocksByClientId(clientIds), groupingBlockName); if (!newBlocks) { return; } replaceBlocks(clientIds, newBlocks); }, onUngroup() { if (!clientIds.length) { return; } const innerBlocks = getBlocks(clientIds[0]); if (!innerBlocks.length) { return; } replaceBlocks(clientIds, innerBlocks); }, onCopy() { if (clientIds.length === 1) { flashBlock(clientIds[0]); } }, async onPasteStyles() { await pasteStyles(getBlocksByClientId(clientIds)); } }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/collab/block-comment-icon-slot.js /** * WordPress dependencies */ const CommentIconSlotFill = (0,external_wp_components_namespaceObject.createSlotFill)(Symbol('CommentIconSlotFill')); /* harmony default export */ const block_comment_icon_slot = (CommentIconSlotFill); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-html-convert-button.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockHTMLConvertButton({ clientId }) { const block = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlock(clientId), [clientId]); const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store); if (!block || block.name !== 'core/html') { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({ HTML: (0,external_wp_blocks_namespaceObject.getBlockContent)(block) })), children: (0,external_wp_i18n_namespaceObject.__)('Convert to Blocks') }); } /* harmony default export */ const block_html_convert_button = (BlockHTMLConvertButton); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-menu-first-item.js /** * WordPress dependencies */ const { Fill: __unstableBlockSettingsMenuFirstItem, Slot: block_settings_menu_first_item_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)('__unstableBlockSettingsMenuFirstItem'); __unstableBlockSettingsMenuFirstItem.Slot = block_settings_menu_first_item_Slot; /* harmony default export */ const block_settings_menu_first_item = (__unstableBlockSettingsMenuFirstItem); ;// ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Contains the properties `ConvertToGroupButton` component needs. * * @typedef {Object} ConvertToGroupButtonProps * @property {string[]} clientIds An array of the selected client ids. * @property {boolean} isGroupable Indicates if the selected blocks can be grouped. * @property {boolean} isUngroupable Indicates if the selected blocks can be ungrouped. * @property {WPBlock[]} blocksSelection An array of the selected blocks. * @property {string} groupingBlockName The name of block used for handling grouping interactions. */ /** * Returns the properties `ConvertToGroupButton` component needs to work properly. * It is used in `BlockSettingsMenuControls` to know if `ConvertToGroupButton` * should be rendered, to avoid ending up with an empty MenuGroup. * * @param {?string[]} selectedClientIds An optional array of clientIds to group. The selected blocks * from the block editor store are used if this is not provided. * * @return {ConvertToGroupButtonProps} Returns the properties needed by `ConvertToGroupButton`. */ function useConvertToGroupButtonProps(selectedClientIds) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlocksByClientId, getSelectedBlockClientIds, isUngroupable, isGroupable } = select(store); const { getGroupingBlockName, getBlockType } = select(external_wp_blocks_namespaceObject.store); const clientIds = selectedClientIds?.length ? selectedClientIds : getSelectedBlockClientIds(); const blocksSelection = getBlocksByClientId(clientIds); const [firstSelectedBlock] = blocksSelection; const _isUngroupable = clientIds.length === 1 && isUngroupable(clientIds[0]); return { clientIds, isGroupable: isGroupable(clientIds), isUngroupable: _isUngroupable, blocksSelection, groupingBlockName: getGroupingBlockName(), onUngroup: _isUngroupable && getBlockType(firstSelectedBlock.name)?.transforms?.ungroup }; }, [selectedClientIds]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function ConvertToGroupButton({ clientIds, isGroupable, isUngroupable, onUngroup, blocksSelection, groupingBlockName, onClose = () => {} }) { const { getSelectedBlockClientIds } = (0,external_wp_data_namespaceObject.useSelect)(store); const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store); const onConvertToGroup = () => { // Activate the `transform` on the Grouping Block which does the conversion. const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocksSelection, groupingBlockName); if (newBlocks) { replaceBlocks(clientIds, newBlocks); } }; const onConvertFromGroup = () => { let innerBlocks = blocksSelection[0].innerBlocks; if (!innerBlocks.length) { return; } if (onUngroup) { innerBlocks = onUngroup(blocksSelection[0].attributes, blocksSelection[0].innerBlocks); } replaceBlocks(clientIds, innerBlocks); }; if (!isGroupable && !isUngroupable) { return null; } const selectedBlockClientIds = getSelectedBlockClientIds(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isGroupable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { shortcut: selectedBlockClientIds.length > 1 ? external_wp_keycodes_namespaceObject.displayShortcut.primary('g') : undefined, onClick: () => { onConvertToGroup(); onClose(); }, children: (0,external_wp_i18n_namespaceObject._x)('Group', 'verb') }), isUngroupable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { onConvertFromGroup(); onClose(); }, children: (0,external_wp_i18n_namespaceObject._x)('Ungroup', 'Ungrouping blocks from within a grouping block back into individual blocks within the Editor') })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-lock/use-block-lock.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Return details about the block lock status. * * @param {string} clientId The block client Id. * * @return {Object} Block lock status */ function useBlockLock(clientId) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { canEditBlock, canMoveBlock, canRemoveBlock, canLockBlockType, getBlockName, getTemplateLock } = select(store); const canEdit = canEditBlock(clientId); const canMove = canMoveBlock(clientId); const canRemove = canRemoveBlock(clientId); return { canEdit, canMove, canRemove, canLock: canLockBlockType(getBlockName(clientId)), isContentLocked: getTemplateLock(clientId) === 'contentOnly', isLocked: !canEdit || !canMove || !canRemove }; }, [clientId]); } ;// ./node_modules/@wordpress/icons/build-module/library/unlock.js /** * WordPress dependencies */ const unlock_unlock = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z" }) }); /* harmony default export */ const library_unlock = (unlock_unlock); ;// ./node_modules/@wordpress/icons/build-module/library/lock-outline.js /** * WordPress dependencies */ const lockOutline = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zM9.8 7c0-1.2 1-2.2 2.2-2.2 1.2 0 2.2 1 2.2 2.2v3H9.8V7zm6.7 11.5h-9v-7h9v7z" }) }); /* harmony default export */ const lock_outline = (lockOutline); ;// ./node_modules/@wordpress/icons/build-module/library/lock.js /** * WordPress dependencies */ const lock_lock = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z" }) }); /* harmony default export */ const library_lock = (lock_lock); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-lock/modal.js /** * WordPress dependencies */ /** * Internal dependencies */ // Entity based blocks which allow edit locking const ALLOWS_EDIT_LOCKING = ['core/navigation']; function getTemplateLockValue(lock) { // Prevents all operations. if (lock.remove && lock.move) { return 'all'; } // Prevents inserting or removing blocks, but allows moving existing blocks. if (lock.remove && !lock.move) { return 'insert'; } return false; } function BlockLockModal({ clientId, onClose }) { const [lock, setLock] = (0,external_wp_element_namespaceObject.useState)({ move: false, remove: false }); const { canEdit, canMove, canRemove } = useBlockLock(clientId); const { allowsEditLocking, templateLock, hasTemplateLock } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockName, getBlockAttributes } = select(store); const blockName = getBlockName(clientId); const blockType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockName); return { allowsEditLocking: ALLOWS_EDIT_LOCKING.includes(blockName), templateLock: getBlockAttributes(clientId)?.templateLock, hasTemplateLock: !!blockType?.attributes?.templateLock }; }, [clientId]); const [applyTemplateLock, setApplyTemplateLock] = (0,external_wp_element_namespaceObject.useState)(!!templateLock); const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); const blockInformation = useBlockDisplayInformation(clientId); (0,external_wp_element_namespaceObject.useEffect)(() => { setLock({ move: !canMove, remove: !canRemove, ...(allowsEditLocking ? { edit: !canEdit } : {}) }); }, [canEdit, canMove, canRemove, allowsEditLocking]); const isAllChecked = Object.values(lock).every(Boolean); const isMixed = Object.values(lock).some(Boolean) && !isAllChecked; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Name of the block. */ (0,external_wp_i18n_namespaceObject.__)('Lock %s'), blockInformation.title), overlayClassName: "block-editor-block-lock-modal", onRequestClose: onClose, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { onSubmit: event => { event.preventDefault(); updateBlockAttributes([clientId], { lock, templateLock: applyTemplateLock ? getTemplateLockValue(lock) : undefined }); onClose(); }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "block-editor-block-lock-modal__options", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("legend", { children: (0,external_wp_i18n_namespaceObject.__)('Select the features you want to lock') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { role: "list", className: "block-editor-block-lock-modal__checklist", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { __nextHasNoMarginBottom: true, className: "block-editor-block-lock-modal__options-all", label: (0,external_wp_i18n_namespaceObject.__)('Lock all'), checked: isAllChecked, indeterminate: isMixed, onChange: newValue => setLock({ move: newValue, remove: newValue, ...(allowsEditLocking ? { edit: newValue } : {}) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("ul", { role: "list", className: "block-editor-block-lock-modal__checklist", children: [allowsEditLocking && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "block-editor-block-lock-modal__checklist-item", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Lock editing'), checked: !!lock.edit, onChange: edit => setLock(prevLock => ({ ...prevLock, edit })) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { className: "block-editor-block-lock-modal__lock-icon", icon: lock.edit ? library_lock : library_unlock })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "block-editor-block-lock-modal__checklist-item", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Lock movement'), checked: lock.move, onChange: move => setLock(prevLock => ({ ...prevLock, move })) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { className: "block-editor-block-lock-modal__lock-icon", icon: lock.move ? library_lock : library_unlock })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "block-editor-block-lock-modal__checklist-item", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Lock removal'), checked: lock.remove, onChange: remove => setLock(prevLock => ({ ...prevLock, remove })) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { className: "block-editor-block-lock-modal__lock-icon", icon: lock.remove ? library_lock : library_unlock })] })] })] }) }), hasTemplateLock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, className: "block-editor-block-lock-modal__template-lock", label: (0,external_wp_i18n_namespaceObject.__)('Apply to all blocks inside'), checked: applyTemplateLock, disabled: lock.move && !lock.remove, onChange: () => setApplyTemplateLock(!applyTemplateLock) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { className: "block-editor-block-lock-modal__actions", justify: "flex-end", expanded: false, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: onClose, __next40pxDefaultSize: true, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", __next40pxDefaultSize: true, children: (0,external_wp_i18n_namespaceObject.__)('Apply') }) })] })] }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-lock/menu-item.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockLockMenuItem({ clientId }) { const { canLock, isLocked } = useBlockLock(clientId); const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false); if (!canLock) { return null; } const label = isLocked ? (0,external_wp_i18n_namespaceObject.__)('Unlock') : (0,external_wp_i18n_namespaceObject.__)('Lock'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: isLocked ? library_unlock : lock_outline, onClick: toggleModal, "aria-expanded": isModalOpen, "aria-haspopup": "dialog", children: label }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockLockModal, { clientId: clientId, onClose: toggleModal })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-mode-toggle.js /** * WordPress dependencies */ /** * Internal dependencies */ const block_mode_toggle_noop = () => {}; function BlockModeToggle({ clientId, onToggle = block_mode_toggle_noop }) { const { blockType, mode, isCodeEditingEnabled } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlock, getBlockMode, getSettings } = select(store); const block = getBlock(clientId); return { mode: getBlockMode(clientId), blockType: block ? (0,external_wp_blocks_namespaceObject.getBlockType)(block.name) : null, isCodeEditingEnabled: getSettings().codeEditingEnabled }; }, [clientId]); const { toggleBlockMode } = (0,external_wp_data_namespaceObject.useDispatch)(store); if (!blockType || !(0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, 'html', true) || !isCodeEditingEnabled) { return null; } const label = mode === 'visual' ? (0,external_wp_i18n_namespaceObject.__)('Edit as HTML') : (0,external_wp_i18n_namespaceObject.__)('Edit visually'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { toggleBlockMode(clientId); onToggle(); }, children: label }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/content-lock/modify-content-lock-menu-item.js /** * WordPress dependencies */ /** * Internal dependencies */ // The implementation of content locking is mainly in this file, although the mechanism // to stop temporarily editing as blocks when an outside block is selected is on component StopEditingAsBlocksOnOutsideSelect // at block-editor/src/components/block-list/index.js. // Besides the components on this file and the file referenced above the implementation // also includes artifacts on the store (actions, reducers, and selector). function ModifyContentLockMenuItem({ clientId, onClose }) { const { templateLock, isLockedByParent, isEditingAsBlocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getContentLockingParent, getTemplateLock, getTemporarilyEditingAsBlocks } = unlock(select(store)); return { templateLock: getTemplateLock(clientId), isLockedByParent: !!getContentLockingParent(clientId), isEditingAsBlocks: getTemporarilyEditingAsBlocks() === clientId }; }, [clientId]); const blockEditorActions = (0,external_wp_data_namespaceObject.useDispatch)(store); const isContentLocked = !isLockedByParent && templateLock === 'contentOnly'; if (!isContentLocked && !isEditingAsBlocks) { return null; } const { modifyContentLockBlock } = unlock(blockEditorActions); const showStartEditingAsBlocks = !isEditingAsBlocks && isContentLocked; return showStartEditingAsBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { modifyContentLockBlock(clientId); onClose(); }, children: (0,external_wp_i18n_namespaceObject._x)('Modify', 'Unlock content locked blocks') }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-rename/use-block-rename.js /** * WordPress dependencies */ function useBlockRename(name) { return { canRename: (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, 'renaming', true) }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-rename/is-empty-string.js function isEmptyString(testString) { return testString?.trim()?.length === 0; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-rename/modal.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockRenameModal({ clientId, onClose }) { const [editedBlockName, setEditedBlockName] = (0,external_wp_element_namespaceObject.useState)(); const blockInformation = useBlockDisplayInformation(clientId); const { metadata } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockAttributes } = select(store); return { metadata: getBlockAttributes(clientId)?.metadata }; }, [clientId]); const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); const blockName = metadata?.name || ''; const originalBlockName = blockInformation?.title; // Pattern Overrides is a WordPress-only feature but it also uses the Block Binding API. // Ideally this should not be inside the block editor package, but we keep it here for simplicity. const hasOverridesWarning = !!blockName && !!metadata?.bindings && Object.values(metadata.bindings).some(binding => binding.source === 'core/pattern-overrides'); const nameHasChanged = editedBlockName !== undefined && editedBlockName !== blockName; const nameIsOriginal = editedBlockName === originalBlockName; const nameIsEmpty = isEmptyString(editedBlockName); const isNameValid = nameHasChanged || nameIsOriginal; const autoSelectInputText = event => event.target.select(); const handleSubmit = () => { const newName = nameIsOriginal || nameIsEmpty ? undefined : editedBlockName; const message = nameIsOriginal || nameIsEmpty ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: new name/label for the block */ (0,external_wp_i18n_namespaceObject.__)('Block name reset to: "%s".'), editedBlockName) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: new name/label for the block */ (0,external_wp_i18n_namespaceObject.__)('Block name changed to: "%s".'), editedBlockName); // Must be assertive to immediately announce change. (0,external_wp_a11y_namespaceObject.speak)(message, 'assertive'); updateBlockAttributes([clientId], { metadata: { ...metadata, name: newName } }); // Immediate close avoids ability to hit save multiple times. onClose(); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Rename'), onRequestClose: onClose, overlayClassName: "block-editor-block-rename-modal", focusOnMount: "firstContentElement", size: "small", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: e => { e.preventDefault(); if (!isNameValid) { return; } handleSubmit(); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "3", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, value: editedBlockName !== null && editedBlockName !== void 0 ? editedBlockName : blockName, label: (0,external_wp_i18n_namespaceObject.__)('Name'), help: hasOverridesWarning ? (0,external_wp_i18n_namespaceObject.__)('This block allows overrides. Changing the name can cause problems with content entered into instances of this pattern.') : undefined, placeholder: originalBlockName, onChange: setEditedBlockName, onFocus: autoSelectInputText }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onClose, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, accessibleWhenDisabled: true, disabled: !isNameValid, variant: "primary", type: "submit", children: (0,external_wp_i18n_namespaceObject.__)('Save') })] })] }) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-rename/rename-control.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockRenameControl({ clientId }) { const [renamingBlock, setRenamingBlock] = (0,external_wp_element_namespaceObject.useState)(false); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { setRenamingBlock(true); }, "aria-expanded": renamingBlock, "aria-haspopup": "dialog", children: (0,external_wp_i18n_namespaceObject.__)('Rename') }), renamingBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRenameModal, { clientId: clientId, onClose: () => setRenamingBlock(false) })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu-controls/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { Fill, Slot: block_settings_menu_controls_Slot } = (0,external_wp_components_namespaceObject.createSlotFill)('BlockSettingsMenuControls'); const BlockSettingsMenuControlsSlot = ({ fillProps, clientIds = null }) => { const { selectedBlocks, selectedClientIds, isContentOnly } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockNamesByClientId, getSelectedBlockClientIds, getBlockEditingMode } = select(store); const ids = clientIds !== null ? clientIds : getSelectedBlockClientIds(); return { selectedBlocks: getBlockNamesByClientId(ids), selectedClientIds: ids, isContentOnly: getBlockEditingMode(ids[0]) === 'contentOnly' }; }, [clientIds]); const { canLock } = useBlockLock(selectedClientIds[0]); const { canRename } = useBlockRename(selectedBlocks[0]); const showLockButton = selectedClientIds.length === 1 && canLock && !isContentOnly; const showRenameButton = selectedClientIds.length === 1 && canRename && !isContentOnly; // Check if current selection of blocks is Groupable or Ungroupable // and pass this props down to ConvertToGroupButton. const convertToGroupButtonProps = useConvertToGroupButtonProps(selectedClientIds); const { isGroupable, isUngroupable } = convertToGroupButtonProps; const showConvertToGroupButton = (isGroupable || isUngroupable) && !isContentOnly; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_settings_menu_controls_Slot, { fillProps: { ...fillProps, selectedBlocks, selectedClientIds }, children: fills => { if (!fills?.length > 0 && !showConvertToGroupButton && !showLockButton) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [showConvertToGroupButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToGroupButton, { ...convertToGroupButtonProps, onClose: fillProps?.onClose }), showLockButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockLockMenuItem, { clientId: selectedClientIds[0] }), showRenameButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockRenameControl, { clientId: selectedClientIds[0] }), fills, selectedClientIds.length === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ModifyContentLockMenuItem, { clientId: selectedClientIds[0], onClose: fillProps?.onClose }), fillProps?.count === 1 && !isContentOnly && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockModeToggle, { clientId: fillProps?.firstBlockClientId, onToggle: fillProps?.onClose })] }); } }); }; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-settings-menu-controls/README.md * * @param {Object} props Fill props. * @return {Element} Element. */ function BlockSettingsMenuControls({ ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalStyleProvider, { document: document, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Fill, { ...props }) }); } BlockSettingsMenuControls.Slot = BlockSettingsMenuControlsSlot; /* harmony default export */ const block_settings_menu_controls = (BlockSettingsMenuControls); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-parent-selector-menu-item.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockParentSelectorMenuItem({ parentClientId, parentBlockType }) { const isSmallViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); // Allows highlighting the parent block outline when focusing or hovering // the parent block selector within the child. const menuItemRef = (0,external_wp_element_namespaceObject.useRef)(); const gesturesProps = useShowHoveredOrFocusedGestures({ ref: menuItemRef, highlightParent: true }); if (!isSmallViewport) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { ...gesturesProps, ref: menuItemRef, icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: parentBlockType.icon }), onClick: () => selectBlock(parentClientId), children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Name of the block's parent. */ (0,external_wp_i18n_namespaceObject.__)('Select parent block (%s)'), parentBlockType.title) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/block-settings-dropdown.js /** * WordPress dependencies */ /** * Internal dependencies */ const block_settings_dropdown_POPOVER_PROPS = { className: 'block-editor-block-settings-menu__popover', placement: 'bottom-start' }; function CopyMenuItem({ clientIds, onCopy, label, shortcut, eventType = 'copy', __experimentalUpdateSelection: updateSelection = false }) { const { getBlocksByClientId } = (0,external_wp_data_namespaceObject.useSelect)(store); const { removeBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store); const notifyCopy = useNotifyCopy(); const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(() => (0,external_wp_blocks_namespaceObject.serialize)(getBlocksByClientId(clientIds)), () => { switch (eventType) { case 'copy': case 'copyStyles': onCopy(); notifyCopy(eventType, clientIds); break; case 'cut': notifyCopy(eventType, clientIds); removeBlocks(clientIds, updateSelection); break; default: break; } }); const copyMenuItemLabel = label ? label : (0,external_wp_i18n_namespaceObject.__)('Copy'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { ref: ref, shortcut: shortcut, children: copyMenuItemLabel }); } function BlockSettingsDropdown({ block, clientIds, children, __experimentalSelectBlock, ...props }) { // Get the client id of the current block for this menu, if one is set. const currentClientId = block?.clientId; const count = clientIds.length; const firstBlockClientId = clientIds[0]; const { firstParentClientId, parentBlockType, previousBlockClientId, selectedBlockClientIds, openedBlockSettingsMenu, isContentOnly } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockName, getBlockRootClientId, getPreviousBlockClientId, getSelectedBlockClientIds, getBlockAttributes, getOpenedBlockSettingsMenu, getBlockEditingMode } = unlock(select(store)); const { getActiveBlockVariation } = select(external_wp_blocks_namespaceObject.store); const _firstParentClientId = getBlockRootClientId(firstBlockClientId); const parentBlockName = _firstParentClientId && getBlockName(_firstParentClientId); return { firstParentClientId: _firstParentClientId, parentBlockType: _firstParentClientId && (getActiveBlockVariation(parentBlockName, getBlockAttributes(_firstParentClientId)) || (0,external_wp_blocks_namespaceObject.getBlockType)(parentBlockName)), previousBlockClientId: getPreviousBlockClientId(firstBlockClientId), selectedBlockClientIds: getSelectedBlockClientIds(), openedBlockSettingsMenu: getOpenedBlockSettingsMenu(), isContentOnly: getBlockEditingMode(firstBlockClientId) === 'contentOnly' }; }, [firstBlockClientId]); const { getBlockOrder, getSelectedBlockClientIds } = (0,external_wp_data_namespaceObject.useSelect)(store); const { setOpenedBlockSettingsMenu } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const shortcuts = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getShortcutRepresentation } = select(external_wp_keyboardShortcuts_namespaceObject.store); return { copy: getShortcutRepresentation('core/block-editor/copy'), cut: getShortcutRepresentation('core/block-editor/cut'), duplicate: getShortcutRepresentation('core/block-editor/duplicate'), remove: getShortcutRepresentation('core/block-editor/remove'), insertAfter: getShortcutRepresentation('core/block-editor/insert-after'), insertBefore: getShortcutRepresentation('core/block-editor/insert-before') }; }, []); const hasSelectedBlocks = selectedBlockClientIds.length > 0; async function updateSelectionAfterDuplicate(clientIdsPromise) { if (!__experimentalSelectBlock) { return; } const ids = await clientIdsPromise; if (ids && ids[0]) { __experimentalSelectBlock(ids[0], false); } } function updateSelectionAfterRemove() { if (!__experimentalSelectBlock) { return; } let blockToFocus = previousBlockClientId || firstParentClientId; // Focus the first block if there's no previous block nor parent block. if (!blockToFocus) { blockToFocus = getBlockOrder()[0]; } // Only update the selection if the original selection is removed. const shouldUpdateSelection = hasSelectedBlocks && getSelectedBlockClientIds().length === 0; __experimentalSelectBlock(blockToFocus, shouldUpdateSelection); } // This can occur when the selected block (the parent) // displays child blocks within a List View. const parentBlockIsSelected = selectedBlockClientIds?.includes(firstParentClientId); // When a currentClientId is in use, treat the menu as a controlled component. // This ensures that only one block settings menu is open at a time. // This is a temporary solution to work around an issue with `onFocusOutside` // where it does not allow a dropdown to be closed if focus was never within // the dropdown to begin with. Examples include a user either CMD+Clicking or // right clicking into an inactive window. // See: https://github.com/WordPress/gutenberg/pull/54083 const open = !currentClientId ? undefined : openedBlockSettingsMenu === currentClientId || false; function onToggle(localOpen) { if (localOpen && openedBlockSettingsMenu !== currentClientId) { setOpenedBlockSettingsMenu(currentClientId); } else if (!localOpen && openedBlockSettingsMenu && openedBlockSettingsMenu === currentClientId) { setOpenedBlockSettingsMenu(undefined); } } const shouldShowBlockParentMenuItem = !parentBlockIsSelected && !!firstParentClientId; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockActions, { clientIds: clientIds, __experimentalUpdateSelection: !__experimentalSelectBlock, children: ({ canCopyStyles, canDuplicate, canInsertBlock, canRemove, onDuplicate, onInsertAfter, onInsertBefore, onRemove, onCopy, onPasteStyles }) => { // It is possible that some plugins register fills for this menu // even if Core doesn't render anything in the block settings menu. // in which case, we may want to render the menu anyway. // That said for now, we can start more conservative. const isEmpty = !canRemove && !canDuplicate && !canInsertBlock && isContentOnly; if (isEmpty) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Options'), className: "block-editor-block-settings-menu", popoverProps: block_settings_dropdown_POPOVER_PROPS, open: open, onToggle: onToggle, noIcons: true, ...props, children: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_settings_menu_first_item.Slot, { fillProps: { onClose } }), shouldShowBlockParentMenuItem && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockParentSelectorMenuItem, { parentClientId: firstParentClientId, parentBlockType: parentBlockType }), count === 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_html_convert_button, { clientId: firstBlockClientId }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyMenuItem, { clientIds: clientIds, onCopy: onCopy, shortcut: shortcuts.copy }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyMenuItem, { clientIds: clientIds, label: (0,external_wp_i18n_namespaceObject.__)('Cut'), eventType: "cut", shortcut: shortcuts.cut, __experimentalUpdateSelection: !__experimentalSelectBlock }), canDuplicate && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: (0,external_wp_compose_namespaceObject.pipe)(onClose, onDuplicate, updateSelectionAfterDuplicate), shortcut: shortcuts.duplicate, children: (0,external_wp_i18n_namespaceObject.__)('Duplicate') }), canInsertBlock && !isContentOnly && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: (0,external_wp_compose_namespaceObject.pipe)(onClose, onInsertBefore), shortcut: shortcuts.insertBefore, children: (0,external_wp_i18n_namespaceObject.__)('Add before') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: (0,external_wp_compose_namespaceObject.pipe)(onClose, onInsertAfter), shortcut: shortcuts.insertAfter, children: (0,external_wp_i18n_namespaceObject.__)('Add after') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_comment_icon_slot.Slot, { fillProps: { onClose } })] }), canCopyStyles && !isContentOnly && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CopyMenuItem, { clientIds: clientIds, onCopy: onCopy, label: (0,external_wp_i18n_namespaceObject.__)('Copy styles'), eventType: "copyStyles" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: onPasteStyles, children: (0,external_wp_i18n_namespaceObject.__)('Paste styles') })] }), !isContentOnly && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_settings_menu_controls.Slot, { fillProps: { onClose, count, firstBlockClientId }, clientIds: clientIds }), typeof children === 'function' ? children({ onClose }) : external_wp_element_namespaceObject.Children.map(child => (0,external_wp_element_namespaceObject.cloneElement)(child, { onClose })), canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: (0,external_wp_compose_namespaceObject.pipe)(onClose, onRemove, updateSelectionAfterRemove), shortcut: shortcuts.remove, children: (0,external_wp_i18n_namespaceObject.__)('Delete') }) })] }) }); } }); } /* harmony default export */ const block_settings_dropdown = (BlockSettingsDropdown); ;// ./node_modules/@wordpress/block-editor/build-module/components/collab/block-comment-icon-toolbar-slot.js /** * WordPress dependencies */ const CommentIconToolbarSlotFill = (0,external_wp_components_namespaceObject.createSlotFill)(Symbol('CommentIconToolbarSlotFill')); /* harmony default export */ const block_comment_icon_toolbar_slot = (CommentIconToolbarSlotFill); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-settings-menu/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockSettingsMenu({ clientIds, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_comment_icon_toolbar_slot.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: toggleProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_settings_dropdown, { clientIds: clientIds, toggleProps: toggleProps, ...props }) })] }); } /* harmony default export */ const block_settings_menu = (BlockSettingsMenu); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-lock/toolbar.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockLockToolbar({ clientId }) { const { canLock, isLocked } = useBlockLock(clientId); const [isModalOpen, toggleModal] = (0,external_wp_element_namespaceObject.useReducer)(isActive => !isActive, false); const hasLockButtonShownRef = (0,external_wp_element_namespaceObject.useRef)(false); // If the block lock button has been shown, we don't want to remove it // from the toolbar until the toolbar is rendered again without it. // Removing it beforehand can cause focus loss issues, such as when // unlocking the block from the modal. It needs to return focus from // whence it came, and to do that, we need to leave the button in the toolbar. (0,external_wp_element_namespaceObject.useEffect)(() => { if (isLocked) { hasLockButtonShownRef.current = true; } }, [isLocked]); if (!isLocked && !hasLockButtonShownRef.current) { return null; } let label = isLocked ? (0,external_wp_i18n_namespaceObject.__)('Unlock') : (0,external_wp_i18n_namespaceObject.__)('Lock'); if (!canLock && isLocked) { label = (0,external_wp_i18n_namespaceObject.__)('Locked'); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { className: "block-editor-block-lock-toolbar", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { disabled: !canLock, icon: isLocked ? library_lock : library_unlock, label: label, onClick: toggleModal, "aria-expanded": isModalOpen, "aria-haspopup": "dialog" }) }), isModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockLockModal, { clientId: clientId, onClose: toggleModal })] }); } ;// ./node_modules/@wordpress/icons/build-module/library/group.js /** * WordPress dependencies */ const group_group = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z" }) }); /* harmony default export */ const library_group = (group_group); ;// ./node_modules/@wordpress/icons/build-module/library/row.js /** * WordPress dependencies */ const row = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z" }) }); /* harmony default export */ const library_row = (row); ;// ./node_modules/@wordpress/icons/build-module/library/stack.js /** * WordPress dependencies */ const stack = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z" }) }); /* harmony default export */ const library_stack = (stack); ;// ./node_modules/@wordpress/icons/build-module/library/grid.js /** * WordPress dependencies */ const grid_grid = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z", fillRule: "evenodd", clipRule: "evenodd" }) }); /* harmony default export */ const library_grid = (grid_grid); ;// ./node_modules/@wordpress/block-editor/build-module/components/convert-to-group-buttons/toolbar.js /** * WordPress dependencies */ /** * Internal dependencies */ const layouts = { group: { type: 'constrained' }, row: { type: 'flex', flexWrap: 'nowrap' }, stack: { type: 'flex', orientation: 'vertical' }, grid: { type: 'grid' } }; function BlockGroupToolbar() { const { blocksSelection, clientIds, groupingBlockName, isGroupable } = useConvertToGroupButtonProps(); const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { canRemove, variations } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canRemoveBlocks } = select(store); const { getBlockVariations } = select(external_wp_blocks_namespaceObject.store); return { canRemove: canRemoveBlocks(clientIds), variations: getBlockVariations(groupingBlockName, 'transform') }; }, [clientIds, groupingBlockName]); const onConvertToGroup = layout => { const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocksSelection, groupingBlockName); if (typeof layout !== 'string') { layout = 'group'; } if (newBlocks && newBlocks.length > 0) { // Because the block is not in the store yet we can't use // updateBlockAttributes so need to manually update attributes. newBlocks[0].attributes.layout = layouts[layout]; replaceBlocks(clientIds, newBlocks); } }; const onConvertToRow = () => onConvertToGroup('row'); const onConvertToStack = () => onConvertToGroup('stack'); const onConvertToGrid = () => onConvertToGroup('grid'); // Don't render the button if the current selection cannot be grouped. // A good example is selecting multiple button blocks within a Buttons block: // The group block is not a valid child of Buttons, so we should not show the button. // Any blocks that are locked against removal also cannot be grouped. if (!isGroupable || !canRemove) { return null; } const canInsertRow = !!variations.find(({ name }) => name === 'group-row'); const canInsertStack = !!variations.find(({ name }) => name === 'group-stack'); const canInsertGrid = !!variations.find(({ name }) => name === 'group-grid'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: library_group, label: (0,external_wp_i18n_namespaceObject._x)('Group', 'action: convert blocks to group'), onClick: onConvertToGroup }), canInsertRow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: library_row, label: (0,external_wp_i18n_namespaceObject._x)('Row', 'action: convert blocks to row'), onClick: onConvertToRow }), canInsertStack && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: library_stack, label: (0,external_wp_i18n_namespaceObject._x)('Stack', 'action: convert blocks to stack'), onClick: onConvertToStack }), canInsertGrid && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: library_grid, label: (0,external_wp_i18n_namespaceObject._x)('Grid', 'action: convert blocks to grid'), onClick: onConvertToGrid })] }); } /* harmony default export */ const toolbar = (BlockGroupToolbar); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-edit-visually-button/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockEditVisuallyButton({ clientIds }) { // Edit visually only works for single block selection. const clientId = clientIds.length === 1 ? clientIds[0] : undefined; const canEditVisually = (0,external_wp_data_namespaceObject.useSelect)(select => !!clientId && select(store).getBlockMode(clientId) === 'html', [clientId]); const { toggleBlockMode } = (0,external_wp_data_namespaceObject.useDispatch)(store); if (!canEditVisually) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => { toggleBlockMode(clientId); }, children: (0,external_wp_i18n_namespaceObject.__)('Edit visually') }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/block-name-context.js /** * WordPress dependencies */ const __unstableBlockNameContext = (0,external_wp_element_namespaceObject.createContext)(''); /* harmony default export */ const block_name_context = (__unstableBlockNameContext); ;// ./node_modules/@wordpress/block-editor/build-module/components/navigable-toolbar/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function hasOnlyToolbarItem(elements) { const dataProp = 'toolbarItem'; return !elements.some(element => !(dataProp in element.dataset)); } function getAllFocusableToolbarItemsIn(container) { return Array.from(container.querySelectorAll('[data-toolbar-item]:not([disabled])')); } function hasFocusWithin(container) { return container.contains(container.ownerDocument.activeElement); } function focusFirstTabbableIn(container) { const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(container); if (firstTabbable) { firstTabbable.focus({ // When focusing newly mounted toolbars, // the position of the popover is often not right on the first render // This prevents the layout shifts when focusing the dialogs. preventScroll: true }); } } function useIsAccessibleToolbar(toolbarRef) { /* * By default, we'll assume the starting accessible state of the Toolbar * is true, as it seems to be the most common case. * * Transitioning from an (initial) false to true state causes the * <Toolbar /> component to mount twice, which is causing undesired * side-effects. These side-effects appear to only affect certain * E2E tests. * * This was initial discovered in this pull-request: * https://github.com/WordPress/gutenberg/pull/23425 */ const initialAccessibleToolbarState = true; // By default, it's gonna render NavigableMenu. If all the tabbable elements // inside the toolbar are ToolbarItem components (or derived components like // ToolbarButton), then we can wrap them with the accessible Toolbar // component. const [isAccessibleToolbar, setIsAccessibleToolbar] = (0,external_wp_element_namespaceObject.useState)(initialAccessibleToolbarState); const determineIsAccessibleToolbar = (0,external_wp_element_namespaceObject.useCallback)(() => { const tabbables = external_wp_dom_namespaceObject.focus.tabbable.find(toolbarRef.current); const onlyToolbarItem = hasOnlyToolbarItem(tabbables); if (!onlyToolbarItem) { external_wp_deprecated_default()('Using custom components as toolbar controls', { since: '5.6', alternative: 'ToolbarItem, ToolbarButton or ToolbarDropdownMenu components', link: 'https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols' }); } setIsAccessibleToolbar(onlyToolbarItem); }, [toolbarRef]); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { // Toolbar buttons may be rendered asynchronously, so we use // MutationObserver to check if the toolbar subtree has been modified. const observer = new window.MutationObserver(determineIsAccessibleToolbar); observer.observe(toolbarRef.current, { childList: true, subtree: true }); return () => observer.disconnect(); }, [determineIsAccessibleToolbar, isAccessibleToolbar, toolbarRef]); return isAccessibleToolbar; } function useToolbarFocus({ toolbarRef, focusOnMount, isAccessibleToolbar, defaultIndex, onIndexChange, shouldUseKeyboardFocusShortcut, focusEditorOnEscape }) { // Make sure we don't use modified versions of this prop. const [initialFocusOnMount] = (0,external_wp_element_namespaceObject.useState)(focusOnMount); const [initialIndex] = (0,external_wp_element_namespaceObject.useState)(defaultIndex); const focusToolbar = (0,external_wp_element_namespaceObject.useCallback)(() => { focusFirstTabbableIn(toolbarRef.current); }, [toolbarRef]); const focusToolbarViaShortcut = () => { if (shouldUseKeyboardFocusShortcut) { focusToolbar(); } }; // Focus on toolbar when pressing alt+F10 when the toolbar is visible. (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', focusToolbarViaShortcut); (0,external_wp_element_namespaceObject.useEffect)(() => { if (initialFocusOnMount) { focusToolbar(); } }, [isAccessibleToolbar, initialFocusOnMount, focusToolbar]); (0,external_wp_element_namespaceObject.useEffect)(() => { // Store ref so we have access on useEffect cleanup: https://legacy.reactjs.org/blog/2020/08/10/react-v17-rc.html#effect-cleanup-timing const navigableToolbarRef = toolbarRef.current; // If initialIndex is passed, we focus on that toolbar item when the // toolbar gets mounted and initial focus is not forced. // We have to wait for the next browser paint because block controls aren't // rendered right away when the toolbar gets mounted. let raf = 0; // If the toolbar already had focus before the render, we don't want to move it. // https://github.com/WordPress/gutenberg/issues/58511 if (!initialFocusOnMount && !hasFocusWithin(navigableToolbarRef)) { raf = window.requestAnimationFrame(() => { const items = getAllFocusableToolbarItemsIn(navigableToolbarRef); const index = initialIndex || 0; if (items[index] && hasFocusWithin(navigableToolbarRef)) { items[index].focus({ // When focusing newly mounted toolbars, // the position of the popover is often not right on the first render // This prevents the layout shifts when focusing the dialogs. preventScroll: true }); } }); } return () => { window.cancelAnimationFrame(raf); if (!onIndexChange || !navigableToolbarRef) { return; } // When the toolbar element is unmounted and onIndexChange is passed, we // pass the focused toolbar item index so it can be hydrated later. const items = getAllFocusableToolbarItemsIn(navigableToolbarRef); const index = items.findIndex(item => item.tabIndex === 0); onIndexChange(index); }; }, [initialIndex, initialFocusOnMount, onIndexChange, toolbarRef]); const { getLastFocus } = unlock((0,external_wp_data_namespaceObject.useSelect)(store)); /** * Handles returning focus to the block editor canvas when pressing escape. */ (0,external_wp_element_namespaceObject.useEffect)(() => { const navigableToolbarRef = toolbarRef.current; if (focusEditorOnEscape) { const handleKeyDown = event => { const lastFocus = getLastFocus(); if (event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE && lastFocus?.current) { // Focus the last focused element when pressing escape. event.preventDefault(); lastFocus.current.focus(); } }; navigableToolbarRef.addEventListener('keydown', handleKeyDown); return () => { navigableToolbarRef.removeEventListener('keydown', handleKeyDown); }; } }, [focusEditorOnEscape, getLastFocus, toolbarRef]); } function NavigableToolbar({ children, focusOnMount, focusEditorOnEscape = false, shouldUseKeyboardFocusShortcut = true, __experimentalInitialIndex: initialIndex, __experimentalOnIndexChange: onIndexChange, orientation = 'horizontal', ...props }) { const toolbarRef = (0,external_wp_element_namespaceObject.useRef)(); const isAccessibleToolbar = useIsAccessibleToolbar(toolbarRef); useToolbarFocus({ toolbarRef, focusOnMount, defaultIndex: initialIndex, onIndexChange, isAccessibleToolbar, shouldUseKeyboardFocusShortcut, focusEditorOnEscape }); if (isAccessibleToolbar) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Toolbar, { label: props['aria-label'], ref: toolbarRef, orientation: orientation, ...props, children: children }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.NavigableMenu, { orientation: orientation, role: "toolbar", ref: toolbarRef, ...props, children: children }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/use-has-block-toolbar.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns true if the block toolbar should be shown. * * @return {boolean} Whether the block toolbar component will be rendered. */ function useHasBlockToolbar() { const { isToolbarEnabled, isBlockDisabled } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockEditingMode, getBlockName, getBlockSelectionStart } = select(store); // we only care about the 1st selected block // for the toolbar, so we use getBlockSelectionStart // instead of getSelectedBlockClientIds const selectedBlockClientId = getBlockSelectionStart(); const blockType = selectedBlockClientId && (0,external_wp_blocks_namespaceObject.getBlockType)(getBlockName(selectedBlockClientId)); return { isToolbarEnabled: blockType && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, '__experimentalToolbar', true), isBlockDisabled: getBlockEditingMode(selectedBlockClientId) === 'disabled' }; }, []); if (!isToolbarEnabled || isBlockDisabled) { return false; } return true; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/change-design.js /** * WordPress dependencies */ /** * Internal dependencies */ const change_design_EMPTY_ARRAY = []; const MAX_PATTERNS_TO_SHOW = 6; const change_design_POPOVER_PROPS = { placement: 'bottom-start' }; function ChangeDesign({ clientId }) { const { categories, currentPatternName, patterns } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockAttributes, getBlockRootClientId, __experimentalGetAllowedPatterns } = select(store); const attributes = getBlockAttributes(clientId); const _categories = attributes?.metadata?.categories || change_design_EMPTY_ARRAY; const rootBlock = getBlockRootClientId(clientId); // Calling `__experimentalGetAllowedPatterns` is expensive. // Checking if the block can be changed prevents unnecessary selector calls. // See: https://github.com/WordPress/gutenberg/pull/64736. const _patterns = _categories.length > 0 ? __experimentalGetAllowedPatterns(rootBlock) : change_design_EMPTY_ARRAY; return { categories: _categories, currentPatternName: attributes?.metadata?.patternName, patterns: _patterns }; }, [clientId]); const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store); const sameCategoryPatternsWithSingleWrapper = (0,external_wp_element_namespaceObject.useMemo)(() => { if (categories.length === 0 || !patterns || patterns.length === 0) { return change_design_EMPTY_ARRAY; } return patterns.filter(pattern => { const isCorePattern = pattern.source === 'core' || pattern.source?.startsWith('pattern-directory') && pattern.source !== 'pattern-directory/theme'; return ( // Check if the pattern has only one top level block, // otherwise we may switch to a pattern that doesn't have replacement suggestions. pattern.blocks.length === 1 && // We exclude the core patterns and pattern directory patterns that are not theme patterns. !isCorePattern && // Exclude current pattern. currentPatternName !== pattern.name && pattern.categories?.some(category => { return categories.includes(category); }) && ( // Check if the pattern is not a synced pattern. pattern.syncStatus === 'unsynced' || !pattern.id) ); }).slice(0, MAX_PATTERNS_TO_SHOW); }, [categories, currentPatternName, patterns]); if (sameCategoryPatternsWithSingleWrapper.length < 2) { return null; } const onClickPattern = pattern => { var _pattern$blocks; const newBlocks = ((_pattern$blocks = pattern.blocks) !== null && _pattern$blocks !== void 0 ? _pattern$blocks : []).map(block => { return (0,external_wp_blocks_namespaceObject.cloneBlock)(block); }); newBlocks[0].attributes.metadata = { ...newBlocks[0].attributes.metadata, categories }; replaceBlocks(clientId, newBlocks); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: change_design_POPOVER_PROPS, renderToggle: ({ onToggle, isOpen }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => onToggle(!isOpen), "aria-expanded": isOpen, children: (0,external_wp_i18n_namespaceObject.__)('Change design') }) }); }, renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { className: "block-editor-block-toolbar-change-design-content-wrapper", paddingSize: "none", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_patterns_list, { blockPatterns: sameCategoryPatternsWithSingleWrapper, onClickPattern: onClickPattern, showTitlesAsTooltip: true }) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/switch-section-style.js /** * WordPress dependencies */ /** * Internal dependencies */ const styleIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", "aria-hidden": "true", focusable: "false", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { stroke: "currentColor", strokeWidth: "1.5", d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3z" })] }); function SwitchSectionStyle({ clientId }) { var _mergedConfig$setting, _mergedConfig$styles; const { stylesToRender, activeStyle, className } = useStylesForBlocks({ clientId }); const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); // Get global styles data const { merged: mergedConfig } = (0,external_wp_element_namespaceObject.useContext)(GlobalStylesContext); const { globalSettings, globalStyles, blockName } = (0,external_wp_data_namespaceObject.useSelect)(select => { const settings = select(store).getSettings(); return { globalSettings: settings.__experimentalFeatures, globalStyles: settings[globalStylesDataKey], blockName: select(store).getBlockName(clientId) }; }, [clientId]); // Get the background color for the active style const activeStyleBackground = activeStyle?.name ? getVariationStylesWithRefValues({ settings: (_mergedConfig$setting = mergedConfig?.settings) !== null && _mergedConfig$setting !== void 0 ? _mergedConfig$setting : globalSettings, styles: (_mergedConfig$styles = mergedConfig?.styles) !== null && _mergedConfig$styles !== void 0 ? _mergedConfig$styles : globalStyles }, blockName, activeStyle.name)?.color?.background : undefined; if (!stylesToRender || stylesToRender.length === 0) { return null; } const handleStyleSwitch = () => { const currentIndex = stylesToRender.findIndex(style => style.name === activeStyle.name); const nextIndex = (currentIndex + 1) % stylesToRender.length; const nextStyle = stylesToRender[nextIndex]; const styleClassName = replaceActiveStyle(className, activeStyle, nextStyle); updateBlockAttributes(clientId, { className: styleClassName }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: handleStyleSwitch, label: (0,external_wp_i18n_namespaceObject.__)('Shuffle styles'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: styleIcon, style: { fill: activeStyleBackground || 'transparent' } }) }) }); } /* harmony default export */ const switch_section_style = (SwitchSectionStyle); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-toolbar/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Renders the block toolbar. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md * * @param {Object} props Components props. * @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality. * @param {boolean} props.focusOnMount Focus the toolbar when mounted. * @param {number} props.__experimentalInitialIndex The initial index of the toolbar item to focus. * @param {Function} props.__experimentalOnIndexChange Callback function to be called when the index of the focused toolbar item changes. * @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons. */ function PrivateBlockToolbar({ hideDragHandle, focusOnMount, __experimentalInitialIndex, __experimentalOnIndexChange, variant = 'unstyled' }) { const { blockClientId, blockClientIds, isDefaultEditingMode, blockType, toolbarKey, shouldShowVisualToolbar, showParentSelector, isUsingBindings, hasParentPattern, hasContentOnlyLocking, showShuffleButton, showSlots, showGroupButtons, showLockButtons, showSwitchSectionStyleButton, hasFixedToolbar, isNavigationMode } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockName, getBlockMode, getBlockParents, getSelectedBlockClientIds, isBlockValid, getBlockEditingMode, getBlockAttributes, getBlockParentsByBlockName, getTemplateLock, getSettings, getParentSectionBlock, isZoomOut, isNavigationMode: _isNavigationMode } = unlock(select(store)); const selectedBlockClientIds = getSelectedBlockClientIds(); const selectedBlockClientId = selectedBlockClientIds[0]; const parents = getBlockParents(selectedBlockClientId); const parentSection = getParentSectionBlock(selectedBlockClientId); const parentClientId = parentSection !== null && parentSection !== void 0 ? parentSection : parents[parents.length - 1]; const parentBlockName = getBlockName(parentClientId); const parentBlockType = (0,external_wp_blocks_namespaceObject.getBlockType)(parentBlockName); const editingMode = getBlockEditingMode(selectedBlockClientId); const _isDefaultEditingMode = editingMode === 'default'; const _blockName = getBlockName(selectedBlockClientId); const isValid = selectedBlockClientIds.every(id => isBlockValid(id)); const isVisual = selectedBlockClientIds.every(id => getBlockMode(id) === 'visual'); const _isUsingBindings = selectedBlockClientIds.every(clientId => !!getBlockAttributes(clientId)?.metadata?.bindings); const _hasParentPattern = selectedBlockClientIds.every(clientId => getBlockParentsByBlockName(clientId, 'core/block', true).length > 0); // If one or more selected blocks are locked, do not show the BlockGroupToolbar. const _hasTemplateLock = selectedBlockClientIds.some(id => getTemplateLock(id) === 'contentOnly'); const _isZoomOut = isZoomOut(); return { blockClientId: selectedBlockClientId, blockClientIds: selectedBlockClientIds, isDefaultEditingMode: _isDefaultEditingMode, blockType: selectedBlockClientId && (0,external_wp_blocks_namespaceObject.getBlockType)(_blockName), shouldShowVisualToolbar: isValid && isVisual, toolbarKey: `${selectedBlockClientId}${parentClientId}`, showParentSelector: !_isZoomOut && parentBlockType && editingMode !== 'contentOnly' && getBlockEditingMode(parentClientId) !== 'disabled' && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(parentBlockType, '__experimentalParentSelector', true) && selectedBlockClientIds.length === 1, isUsingBindings: _isUsingBindings, hasParentPattern: _hasParentPattern, hasContentOnlyLocking: _hasTemplateLock, showShuffleButton: _isZoomOut, showSlots: !_isZoomOut, showGroupButtons: !_isZoomOut, showLockButtons: !_isZoomOut, showSwitchSectionStyleButton: _isZoomOut, hasFixedToolbar: getSettings().hasFixedToolbar, isNavigationMode: _isNavigationMode() }; }, []); const toolbarWrapperRef = (0,external_wp_element_namespaceObject.useRef)(null); // Handles highlighting the current block outline on hover or focus of the // block type toolbar area. const nodeRef = (0,external_wp_element_namespaceObject.useRef)(); const showHoveredOrFocusedGestures = useShowHoveredOrFocusedGestures({ ref: nodeRef }); const isLargeViewport = !(0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const hasBlockToolbar = useHasBlockToolbar(); if (!hasBlockToolbar) { return null; } const isMultiToolbar = blockClientIds.length > 1; const isSynced = (0,external_wp_blocks_namespaceObject.isReusableBlock)(blockType) || (0,external_wp_blocks_namespaceObject.isTemplatePart)(blockType); // Shifts the toolbar to make room for the parent block selector. const classes = dist_clsx('block-editor-block-contextual-toolbar', { 'has-parent': showParentSelector, 'is-inverted-toolbar': isNavigationMode && !hasFixedToolbar }); const innerClasses = dist_clsx('block-editor-block-toolbar', { 'is-synced': isSynced, 'is-connected': isUsingBindings }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableToolbar, { focusEditorOnEscape: true, className: classes /* translators: accessibility text for the block toolbar */, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block tools') // The variant is applied as "toolbar" when undefined, which is the black border style of the dropdown from the toolbar popover. , variant: variant === 'toolbar' ? undefined : variant, focusOnMount: focusOnMount, __experimentalInitialIndex: __experimentalInitialIndex, __experimentalOnIndexChange: __experimentalOnIndexChange // Resets the index whenever the active block changes so // this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169 , children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ref: toolbarWrapperRef, className: innerClasses, children: [showParentSelector && !isMultiToolbar && isLargeViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockParentSelector, {}), (shouldShowVisualToolbar || isMultiToolbar) && !hasParentPattern && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: nodeRef, ...showHoveredOrFocusedGestures, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { className: "block-editor-block-toolbar__block-controls", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_switcher, { clientIds: blockClientIds }), !isMultiToolbar && isDefaultEditingMode && showLockButtons && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockLockToolbar, { clientId: blockClientId }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_mover, { clientIds: blockClientIds, hideDragHandle: hideDragHandle })] }) }), !hasContentOnlyLocking && shouldShowVisualToolbar && isMultiToolbar && showGroupButtons && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(toolbar, {}), showShuffleButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ChangeDesign, { clientId: blockClientIds[0] }), showSwitchSectionStyleButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(switch_section_style, { clientId: blockClientIds[0] }), shouldShowVisualToolbar && showSlots && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls.Slot, { group: "parent", className: "block-editor-block-toolbar__slot" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls.Slot, { group: "block", className: "block-editor-block-toolbar__slot" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls.Slot, { className: "block-editor-block-toolbar__slot" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls.Slot, { group: "inline", className: "block-editor-block-toolbar__slot" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls.Slot, { group: "other", className: "block-editor-block-toolbar__slot" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_name_context.Provider, { value: blockType?.name, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_toolbar_last_item.Slot, {}) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockEditVisuallyButton, { clientIds: blockClientIds }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_settings_menu, { clientIds: blockClientIds })] }) }, toolbarKey); } /** * Renders the block toolbar. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-toolbar/README.md * * @param {Object} props Components props. * @param {boolean} props.hideDragHandle Show or hide the Drag Handle for drag and drop functionality. * @param {string} props.variant Style variant of the toolbar, also passed to the Dropdowns rendered from Block Toolbar Buttons. */ function BlockToolbar({ hideDragHandle, variant }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockToolbar, { hideDragHandle: hideDragHandle, variant: variant, focusOnMount: undefined, __experimentalInitialIndex: undefined, __experimentalOnIndexChange: undefined }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/block-toolbar-popover.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function BlockToolbarPopover({ clientId, isTyping, __unstableContentRef }) { const { capturingClientId, isInsertionPointVisible, lastClientId } = useSelectedBlockToolProps(clientId); // Stores the active toolbar item index so the block toolbar can return focus // to it when re-mounting. const initialToolbarItemIndexRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { // Resets the index whenever the active block changes so this is not // persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169 initialToolbarItemIndexRef.current = undefined; }, [clientId]); const { stopTyping } = (0,external_wp_data_namespaceObject.useDispatch)(store); const isToolbarForcedRef = (0,external_wp_element_namespaceObject.useRef)(false); (0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/block-editor/focus-toolbar', () => { isToolbarForcedRef.current = true; stopTyping(true); }); (0,external_wp_element_namespaceObject.useEffect)(() => { isToolbarForcedRef.current = false; }); // If the block has a parent with __experimentalCaptureToolbars enabled, // the toolbar should be positioned over the topmost capturing parent. const clientIdToPositionOver = capturingClientId || clientId; const popoverProps = useBlockToolbarPopoverProps({ contentElement: __unstableContentRef?.current, clientId: clientIdToPositionOver }); return !isTyping && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockPopover, { clientId: clientIdToPositionOver, bottomClientId: lastClientId, className: dist_clsx('block-editor-block-list__block-popover', { 'is-insertion-point-visible': isInsertionPointVisible }), resize: false, ...popoverProps, __unstableContentRef: __unstableContentRef, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateBlockToolbar // If the toolbar is being shown because of being forced // it should focus the toolbar right after the mount. , { focusOnMount: isToolbarForcedRef.current, __experimentalInitialIndex: initialToolbarItemIndexRef.current, __experimentalOnIndexChange: index => { initialToolbarItemIndexRef.current = index; }, variant: "toolbar" }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/zoom-out-mode-inserter-button.js /** * External dependencies */ /** * WordPress dependencies */ function ZoomOutModeInserterButton({ onClick }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", icon: library_plus, size: "compact", className: dist_clsx('block-editor-button-pattern-inserter__button', 'block-editor-block-tools__zoom-out-mode-inserter-button'), onClick: onClick, label: (0,external_wp_i18n_namespaceObject._x)('Add pattern', 'Generic label for pattern inserter button') }); } /* harmony default export */ const zoom_out_mode_inserter_button = (ZoomOutModeInserterButton); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/zoom-out-mode-inserters.js /** * WordPress dependencies */ /** * Internal dependencies */ function ZoomOutModeInserters() { const [isReady, setIsReady] = (0,external_wp_element_namespaceObject.useState)(false); const { hasSelection, blockOrder, setInserterIsOpened, sectionRootClientId, selectedBlockClientId, blockInsertionPoint, insertionPointVisible } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings, getBlockOrder, getSelectionStart, getSelectedBlockClientId, getSectionRootClientId, getBlockInsertionPoint, isBlockInsertionPointVisible } = unlock(select(store)); const root = getSectionRootClientId(); return { hasSelection: !!getSelectionStart().clientId, blockOrder: getBlockOrder(root), sectionRootClientId: root, setInserterIsOpened: getSettings().__experimentalSetIsInserterOpened, selectedBlockClientId: getSelectedBlockClientId(), blockInsertionPoint: getBlockInsertionPoint(), insertionPointVisible: isBlockInsertionPointVisible() }; }, []); // eslint-disable-next-line @wordpress/no-unused-vars-before-return const { showInsertionPoint } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); // Defer the initial rendering to avoid the jumps due to the animation. (0,external_wp_element_namespaceObject.useEffect)(() => { const timeout = setTimeout(() => { setIsReady(true); }, 500); return () => { clearTimeout(timeout); }; }, []); if (!isReady || !hasSelection) { return null; } const previousClientId = selectedBlockClientId; const index = blockOrder.findIndex(clientId => selectedBlockClientId === clientId); const insertionIndex = index + 1; const nextClientId = blockOrder[insertionIndex]; // If the block insertion point is visible, and the insertion // Indices match then we don't need to render the inserter. if (insertionPointVisible && blockInsertionPoint?.index === insertionIndex) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inbetween, { previousClientId: previousClientId, nextClientId: nextClientId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(zoom_out_mode_inserter_button, { onClick: () => { setInserterIsOpened({ rootClientId: sectionRootClientId, insertionIndex, tab: 'patterns', category: 'all' }); showInsertionPoint(sectionRootClientId, insertionIndex, { operation: 'insert' }); } }) }); } /* harmony default export */ const zoom_out_mode_inserters = (ZoomOutModeInserters); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/use-show-block-tools.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Source of truth for which block tools are showing in the block editor. * * @return {Object} Object of which block tools will be shown. */ function useShowBlockTools() { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSelectedBlockClientId, getFirstMultiSelectedBlockClientId, getBlock, getBlockMode, getSettings, __unstableGetEditorMode, isTyping } = unlock(select(store)); const clientId = getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId(); const block = getBlock(clientId); const editorMode = __unstableGetEditorMode(); const hasSelectedBlock = !!clientId && !!block; const isEmptyDefaultBlock = hasSelectedBlock && (0,external_wp_blocks_namespaceObject.isUnmodifiedDefaultBlock)(block) && getBlockMode(clientId) !== 'html'; const _showEmptyBlockSideInserter = clientId && !isTyping() && // Hide the block inserter on the navigation mode. // See https://github.com/WordPress/gutenberg/pull/66636#discussion_r1824728483. editorMode !== 'navigation' && isEmptyDefaultBlock; const _showBlockToolbarPopover = !getSettings().hasFixedToolbar && !_showEmptyBlockSideInserter && hasSelectedBlock && !isEmptyDefaultBlock; return { showEmptyBlockSideInserter: _showEmptyBlockSideInserter, showBlockToolbarPopover: _showBlockToolbarPopover }; }, []); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-tools/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function block_tools_selector(select) { const { getSelectedBlockClientId, getFirstMultiSelectedBlockClientId, getSettings, isTyping, isDragging, isZoomOut } = unlock(select(store)); const clientId = getSelectedBlockClientId() || getFirstMultiSelectedBlockClientId(); return { clientId, hasFixedToolbar: getSettings().hasFixedToolbar, isTyping: isTyping(), isZoomOutMode: isZoomOut(), isDragging: isDragging() }; } /** * Renders block tools (the block toolbar, select/navigation mode toolbar, the * insertion point and a slot for the inline rich text toolbar). Must be wrapped * around the block content and editor styles wrapper or iframe. * * @param {Object} $0 Props. * @param {Object} $0.children The block content and style container. * @param {Object} $0.__unstableContentRef Ref holding the content scroll container. */ function BlockTools({ children, __unstableContentRef, ...props }) { const { clientId, hasFixedToolbar, isTyping, isZoomOutMode, isDragging } = (0,external_wp_data_namespaceObject.useSelect)(block_tools_selector, []); const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)(); const { getBlocksByClientId, getSelectedBlockClientIds, getBlockRootClientId, isGroupable } = (0,external_wp_data_namespaceObject.useSelect)(store); const { getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); const { showEmptyBlockSideInserter, showBlockToolbarPopover } = useShowBlockTools(); const { duplicateBlocks, removeBlocks, replaceBlocks, insertAfterBlock, insertBeforeBlock, selectBlock, moveBlocksUp, moveBlocksDown, expandBlock } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); function onKeyDown(event) { if (event.defaultPrevented) { return; } if (isMatch('core/block-editor/move-up', event) || isMatch('core/block-editor/move-down', event)) { const clientIds = getSelectedBlockClientIds(); if (clientIds.length) { event.preventDefault(); const rootClientId = getBlockRootClientId(clientIds[0]); const direction = isMatch('core/block-editor/move-up', event) ? 'up' : 'down'; if (direction === 'up') { moveBlocksUp(clientIds, rootClientId); } else { moveBlocksDown(clientIds, rootClientId); } const blockLength = Array.isArray(clientIds) ? clientIds.length : 1; const message = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: the name of the block that has been moved (0,external_wp_i18n_namespaceObject._n)('%d block moved.', '%d blocks moved.', clientIds.length), blockLength); (0,external_wp_a11y_namespaceObject.speak)(message); } } else if (isMatch('core/block-editor/duplicate', event)) { const clientIds = getSelectedBlockClientIds(); if (clientIds.length) { event.preventDefault(); duplicateBlocks(clientIds); } } else if (isMatch('core/block-editor/remove', event)) { const clientIds = getSelectedBlockClientIds(); if (clientIds.length) { event.preventDefault(); removeBlocks(clientIds); } } else if (isMatch('core/block-editor/insert-after', event)) { const clientIds = getSelectedBlockClientIds(); if (clientIds.length) { event.preventDefault(); insertAfterBlock(clientIds[clientIds.length - 1]); } } else if (isMatch('core/block-editor/insert-before', event)) { const clientIds = getSelectedBlockClientIds(); if (clientIds.length) { event.preventDefault(); insertBeforeBlock(clientIds[0]); } } else if (isMatch('core/block-editor/unselect', event)) { if (event.target.closest('[role=toolbar]')) { // This shouldn't be necessary, but we have a combination of a few things all combining to create a situation where: // - Because the block toolbar uses createPortal to populate the block toolbar fills, we can't rely on the React event bubbling to hit the onKeyDown listener for the block toolbar // - Since we can't use the React tree, we use the DOM tree which _should_ handle the event bubbling correctly from a `createPortal` element. // - This bubbles via the React tree, which hits this `unselect` escape keypress before the block toolbar DOM event listener has access to it. // An alternative would be to remove the addEventListener on the navigableToolbar and use this event to handle it directly right here. That feels hacky too though. return; } const clientIds = getSelectedBlockClientIds(); if (clientIds.length > 1) { event.preventDefault(); // If there is more than one block selected, select the first // block so that focus is directed back to the beginning of the selection. // In effect, to the user this feels like deselecting the multi-selection. selectBlock(clientIds[0]); } } else if (isMatch('core/block-editor/collapse-list-view', event)) { // If focus is currently within a text field, such as a rich text block or other editable field, // skip collapsing the list view, and allow the keyboard shortcut to be handled by the text field. // This condition checks for both the active element and the active element within an iframed editor. if ((0,external_wp_dom_namespaceObject.isTextField)(event.target) || (0,external_wp_dom_namespaceObject.isTextField)(event.target?.contentWindow?.document?.activeElement)) { return; } event.preventDefault(); expandBlock(clientId); } else if (isMatch('core/block-editor/group', event)) { const clientIds = getSelectedBlockClientIds(); if (clientIds.length > 1 && isGroupable(clientIds)) { event.preventDefault(); const blocks = getBlocksByClientId(clientIds); const groupingBlockName = getGroupingBlockName(); const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, groupingBlockName); replaceBlocks(clientIds, newBlocks); (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Selected blocks are grouped.')); } } } const blockToolbarRef = use_popover_scroll(__unstableContentRef); const blockToolbarAfterRef = use_popover_scroll(__unstableContentRef); return ( /*#__PURE__*/ // eslint-disable-next-line jsx-a11y/no-static-element-interactions (0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...props, onKeyDown: onKeyDown, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(insertion_point_InsertionPointOpenRef.Provider, { value: (0,external_wp_element_namespaceObject.useRef)(false), children: [!isTyping && !isZoomOutMode && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InsertionPoint, { __unstableContentRef: __unstableContentRef }), showEmptyBlockSideInserter && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EmptyBlockInserter, { __unstableContentRef: __unstableContentRef, clientId: clientId }), showBlockToolbarPopover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockToolbarPopover, { __unstableContentRef: __unstableContentRef, clientId: clientId, isTyping: isTyping }), !isZoomOutMode && !hasFixedToolbar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover.Slot, { name: "block-toolbar", ref: blockToolbarRef }), children, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover.Slot, { name: "__unstable-block-tools-after", ref: blockToolbarAfterRef }), isZoomOutMode && !isDragging && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(zoom_out_mode_inserters, { __unstableContentRef: __unstableContentRef })] }) }) ); } ;// external ["wp","commands"] const external_wp_commands_namespaceObject = window["wp"]["commands"]; ;// ./node_modules/@wordpress/icons/build-module/library/ungroup.js /** * WordPress dependencies */ const ungroup = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7zm-5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h1V9H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-1h-1.5v1z" }) }); /* harmony default export */ const library_ungroup = (ungroup); ;// ./node_modules/@wordpress/icons/build-module/library/trash.js /** * WordPress dependencies */ const trash = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" }) }); /* harmony default export */ const library_trash = (trash); ;// ./node_modules/@wordpress/block-editor/build-module/components/use-block-commands/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const getTransformCommands = () => function useTransformCommands() { const { replaceBlocks, multiSelect } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { blocks, clientIds, canRemove, possibleBlockTransformations, invalidSelection } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId, getBlockTransformItems, getSelectedBlockClientIds, getBlocksByClientId, canRemoveBlocks } = select(store); const selectedBlockClientIds = getSelectedBlockClientIds(); const selectedBlocks = getBlocksByClientId(selectedBlockClientIds); // selectedBlocks can have `null`s when something tries to call `selectBlock` with an inexistent clientId. // These nulls will cause fatal errors down the line. // In order to prevent discrepancies between selectedBlockClientIds and selectedBlocks, we effectively treat the entire selection as invalid. // @see https://github.com/WordPress/gutenberg/pull/59410#issuecomment-2006304536 if (selectedBlocks.filter(block => !block).length > 0) { return { invalidSelection: true }; } const rootClientId = getBlockRootClientId(selectedBlockClientIds[0]); return { blocks: selectedBlocks, clientIds: selectedBlockClientIds, possibleBlockTransformations: getBlockTransformItems(selectedBlocks, rootClientId), canRemove: canRemoveBlocks(selectedBlockClientIds), invalidSelection: false }; }, []); if (invalidSelection) { return { isLoading: false, commands: [] }; } const isTemplate = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isTemplatePart)(blocks[0]); function selectForMultipleBlocks(insertedBlocks) { if (insertedBlocks.length > 1) { multiSelect(insertedBlocks[0].clientId, insertedBlocks[insertedBlocks.length - 1].clientId); } } // Simple block transformation based on the `Block Transforms` API. function onBlockTransform(name) { const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, name); replaceBlocks(clientIds, newBlocks); selectForMultipleBlocks(newBlocks); } /** * The `isTemplate` check is a stopgap solution here. * Ideally, the Transforms API should handle this * by allowing to exclude blocks from wildcard transformations. */ const hasPossibleBlockTransformations = !!possibleBlockTransformations.length && canRemove && !isTemplate; if (!clientIds || clientIds.length < 1 || !hasPossibleBlockTransformations) { return { isLoading: false, commands: [] }; } const commands = possibleBlockTransformations.map(transformation => { const { name, title, icon } = transformation; return { name: 'core/block-editor/transform-to-' + name.replace('/', '-'), /* translators: %s: Block or block variation name. */ label: (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Transform to %s'), title), icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: icon }), callback: ({ close }) => { onBlockTransform(name); close(); } }; }); return { isLoading: false, commands }; }; const getQuickActionsCommands = () => function useQuickActionsCommands() { const { clientIds, isUngroupable, isGroupable } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSelectedBlockClientIds, isUngroupable: _isUngroupable, isGroupable: _isGroupable } = select(store); const selectedBlockClientIds = getSelectedBlockClientIds(); return { clientIds: selectedBlockClientIds, isUngroupable: _isUngroupable(), isGroupable: _isGroupable() }; }, []); const { canInsertBlockType, getBlockRootClientId, getBlocksByClientId, canRemoveBlocks } = (0,external_wp_data_namespaceObject.useSelect)(store); const { getDefaultBlockName, getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); const blocks = getBlocksByClientId(clientIds); const { removeBlocks, replaceBlocks, duplicateBlocks, insertAfterBlock, insertBeforeBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const onGroup = () => { if (!blocks.length) { return; } const groupingBlockName = getGroupingBlockName(); // Activate the `transform` on `core/group` which does the conversion. const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, groupingBlockName); if (!newBlocks) { return; } replaceBlocks(clientIds, newBlocks); }; const onUngroup = () => { if (!blocks.length) { return; } const innerBlocks = blocks[0].innerBlocks; if (!innerBlocks.length) { return; } replaceBlocks(clientIds, innerBlocks); }; if (!clientIds || clientIds.length < 1) { return { isLoading: false, commands: [] }; } const rootClientId = getBlockRootClientId(clientIds[0]); const canInsertDefaultBlock = canInsertBlockType(getDefaultBlockName(), rootClientId); const canDuplicate = blocks.every(block => { return !!block && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(block.name, 'multiple', true) && canInsertBlockType(block.name, rootClientId); }); const canRemove = canRemoveBlocks(clientIds); const commands = []; if (canDuplicate) { commands.push({ name: 'duplicate', label: (0,external_wp_i18n_namespaceObject.__)('Duplicate'), callback: () => duplicateBlocks(clientIds, true), icon: library_copy }); } if (canInsertDefaultBlock) { commands.push({ name: 'add-before', label: (0,external_wp_i18n_namespaceObject.__)('Add before'), callback: () => { const clientId = Array.isArray(clientIds) ? clientIds[0] : clientId; insertBeforeBlock(clientId); }, icon: library_plus }, { name: 'add-after', label: (0,external_wp_i18n_namespaceObject.__)('Add after'), callback: () => { const clientId = Array.isArray(clientIds) ? clientIds[clientIds.length - 1] : clientId; insertAfterBlock(clientId); }, icon: library_plus }); } if (isGroupable) { commands.push({ name: 'Group', label: (0,external_wp_i18n_namespaceObject.__)('Group'), callback: onGroup, icon: library_group }); } if (isUngroupable) { commands.push({ name: 'ungroup', label: (0,external_wp_i18n_namespaceObject.__)('Ungroup'), callback: onUngroup, icon: library_ungroup }); } if (canRemove) { commands.push({ name: 'remove', label: (0,external_wp_i18n_namespaceObject.__)('Delete'), callback: () => removeBlocks(clientIds, true), icon: library_trash }); } return { isLoading: false, commands: commands.map(command => ({ ...command, name: 'core/block-editor/action-' + command.name, callback: ({ close }) => { command.callback(); close(); } })) }; }; const useBlockCommands = () => { (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/block-editor/blockTransforms', hook: getTransformCommands() }); (0,external_wp_commands_namespaceObject.useCommandLoader)({ name: 'core/block-editor/blockQuickActions', hook: getQuickActionsCommands(), context: 'block-selection-edit' }); }; ;// ./node_modules/@wordpress/block-editor/build-module/components/block-canvas/index.js /** * WordPress dependencies */ /** * Internal dependencies */ // EditorStyles is a memoized component, so avoid passing a new // object reference on each render. const EDITOR_STYLE_TRANSFORM_OPTIONS = { // Don't transform selectors that already specify `.editor-styles-wrapper`. ignoredSelectors: [/\.editor-styles-wrapper/gi] }; function ExperimentalBlockCanvas({ shouldIframe = true, height = '300px', children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockList, {}), styles, contentRef: contentRefProp, iframeProps }) { useBlockCommands(); const isTabletViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); const resetTypingRef = useMouseMoveTypingReset(); const clearerRef = useBlockSelectionClearer(); const localRef = (0,external_wp_element_namespaceObject.useRef)(); const contentRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([contentRefProp, clearerRef, localRef]); const zoomLevel = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getZoomLevel(), []); const zoomOutIframeProps = zoomLevel !== 100 && !isTabletViewport ? { scale: zoomLevel, frameSize: '40px' } : {}; if (!shouldIframe) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockTools, { __unstableContentRef: localRef, style: { height, display: 'flex' }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_styles, { styles: styles, scope: ":where(.editor-styles-wrapper)", transformOptions: EDITOR_STYLE_TRANSFORM_OPTIONS }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(writing_flow, { ref: contentRef, className: "editor-styles-wrapper", tabIndex: -1, style: { height: '100%', width: '100%' }, children: children })] }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockTools, { __unstableContentRef: localRef, style: { height, display: 'flex' }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(iframe, { ...iframeProps, ...zoomOutIframeProps, ref: resetTypingRef, contentRef: contentRef, style: { ...iframeProps?.style }, name: "editor-canvas", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editor_styles, { styles: styles }), children] }) }); } /** * BlockCanvas component is a component used to display the canvas of the block editor. * What we call the canvas is an iframe containing the block list that you can manipulate. * The component is also responsible of wiring up all the necessary hooks to enable * the keyboard navigation across blocks in the editor and inject content styles into the iframe. * * @example * * ```jsx * function MyBlockEditor() { * const [ blocks, updateBlocks ] = useState([]); * return ( * <BlockEditorProvider * value={ blocks } * onInput={ updateBlocks } * onChange={ persistBlocks } * > * <BlockCanvas height="400px" /> * </BlockEditorProvider> * ); * } * ``` * * @param {Object} props Component props. * @param {string} props.height Canvas height, defaults to 300px. * @param {Array} props.styles Content styles to inject into the iframe. * @param {Element} props.children Content of the canvas, defaults to the BlockList component. * @return {Element} Block Breadcrumb. */ function BlockCanvas({ children, height, styles }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ExperimentalBlockCanvas, { height: height, styles: styles, children: children }); } /* harmony default export */ const block_canvas = (BlockCanvas); ;// ./node_modules/@wordpress/block-editor/build-module/components/color-style-selector/index.js /** * WordPress dependencies */ const ColorSelectorSVGIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z" }) }); /** * Color Selector Icon component. * * @param {Object} props Component properties. * @param {Object} props.style Style object. * @param {string} props.className Class name for component. * * @return {*} React Icon component. */ const ColorSelectorIcon = ({ style, className }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-library-colors-selector__icon-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${className} block-library-colors-selector__state-selection`, style: style, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorSelectorSVGIcon, {}) }) }); }; /** * Renders the Colors Selector Toolbar with the icon button. * * @param {Object} props Component properties. * @param {Object} props.TextColor Text color component that wraps icon. * @param {Object} props.BackgroundColor Background color component that wraps icon. * * @return {*} React toggle button component. */ const renderToggleComponent = ({ TextColor, BackgroundColor }) => ({ onToggle, isOpen }) => { const openOnArrowDown = event => { if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { event.preventDefault(); onToggle(); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { className: "components-toolbar__control block-library-colors-selector__toggle", label: (0,external_wp_i18n_namespaceObject.__)('Open Colors Selector'), onClick: onToggle, onKeyDown: openOnArrowDown, icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BackgroundColor, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TextColor, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorSelectorIcon, {}) }) }) }) }); }; const BlockColorsStyleSelector = ({ children, ...other }) => { external_wp_deprecated_default()(`wp.blockEditor.BlockColorsStyleSelector`, { alternative: 'block supports API', since: '6.1', version: '6.3' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: { placement: 'bottom-start' }, className: "block-library-colors-selector", contentClassName: "block-library-colors-selector__popover", renderToggle: renderToggleComponent(other), renderContent: () => children }); }; /* harmony default export */ const color_style_selector = (BlockColorsStyleSelector); ;// ./node_modules/@wordpress/icons/build-module/library/list-view.js /** * WordPress dependencies */ const listView = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z" }) }); /* harmony default export */ const list_view = (listView); ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/context.js /** * WordPress dependencies */ const ListViewContext = (0,external_wp_element_namespaceObject.createContext)({}); const useListViewContext = () => (0,external_wp_element_namespaceObject.useContext)(ListViewContext); ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/aria-referenced-text.js /** * WordPress dependencies */ /** * A component specifically designed to be used as an element referenced * by ARIA attributes such as `aria-labelledby` or `aria-describedby`. * * @param {Object} props Props. * @param {import('react').ReactNode} props.children */ function AriaReferencedText({ children, ...props }) { const ref = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { if (ref.current) { // This seems like a no-op, but it fixes a bug in Firefox where // it fails to recompute the text when only the text node changes. // @see https://github.com/WordPress/gutenberg/pull/51035 ref.current.textContent = ref.current.textContent; } }, [children]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { hidden: true, ...props, ref: ref, children: children }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/appender.js /** * WordPress dependencies */ /** * Internal dependencies */ const Appender = (0,external_wp_element_namespaceObject.forwardRef)(({ nestingLevel, blockCount, clientId, ...props }, ref) => { const { insertedBlock, setInsertedBlock } = useListViewContext(); const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(Appender); const hideInserter = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getTemplateLock, isZoomOut } = unlock(select(store)); return !!getTemplateLock(clientId) || isZoomOut(); }, [clientId]); const blockTitle = useBlockDisplayTitle({ clientId, context: 'list-view' }); const insertedBlockTitle = useBlockDisplayTitle({ clientId: insertedBlock?.clientId, context: 'list-view' }); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!insertedBlockTitle?.length) { return; } (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc) (0,external_wp_i18n_namespaceObject.__)('%s block inserted'), insertedBlockTitle), 'assertive'); }, [insertedBlockTitle]); if (hideInserter) { return null; } const descriptionId = `list-view-appender__${instanceId}`; const description = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */ (0,external_wp_i18n_namespaceObject.__)('Append to %1$s block at position %2$d, Level %3$d'), blockTitle, blockCount + 1, nestingLevel); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "list-view-appender", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inserter, { ref: ref, rootClientId: clientId, position: "bottom right", isAppender: true, selectBlockOnInsert: false, shouldDirectInsert: false, __experimentalIsQuick: true, ...props, toggleProps: { 'aria-describedby': descriptionId }, onSelectOrClose: maybeInsertedBlock => { if (maybeInsertedBlock?.clientId) { setInsertedBlock(maybeInsertedBlock); } } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AriaReferencedText, { id: descriptionId, children: description })] }); }); ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/leaf.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const AnimatedTreeGridRow = dist_esm_it(external_wp_components_namespaceObject.__experimentalTreeGridRow); const ListViewLeaf = (0,external_wp_element_namespaceObject.forwardRef)(({ isDragged, isSelected, position, level, rowCount, children, className, path, ...props }, ref) => { const animationRef = use_moving_animation({ clientId: props['data-block'], enableAnimation: true, triggerAnimationOnChange: path }); const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, animationRef]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AnimatedTreeGridRow, { ref: mergedRef, className: dist_clsx('block-editor-list-view-leaf', className), level: level, positionInSet: position, setSize: rowCount, isExpanded: undefined, ...props, children: children }); }); /* harmony default export */ const leaf = (ListViewLeaf); ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-scroll-into-view.js /** * WordPress dependencies */ function useListViewScrollIntoView({ isSelected, selectedClientIds, rowItemRef }) { const isSingleSelection = selectedClientIds.length === 1; (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { // Skip scrolling into view if this particular block isn't selected, // or if more than one block is selected overall. This is to avoid // scrolling the view in a multi selection where the user has intentionally // selected multiple blocks within the list view, but the initially // selected block may be out of view. if (!isSelected || !isSingleSelection || !rowItemRef.current) { return; } const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(rowItemRef.current); const { ownerDocument } = rowItemRef.current; const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement; // If the there is no scroll container, of if the scroll container is the window, // do not scroll into view, as the block is already in view. if (windowScroll || !scrollContainer) { return; } const rowRect = rowItemRef.current.getBoundingClientRect(); const scrollContainerRect = scrollContainer.getBoundingClientRect(); // If the selected block is not currently visible, scroll to it. if (rowRect.top < scrollContainerRect.top || rowRect.bottom > scrollContainerRect.bottom) { rowItemRef.current.scrollIntoView(); } }, [isSelected, isSingleSelection, rowItemRef]); } ;// ./node_modules/@wordpress/icons/build-module/library/pin-small.js /** * WordPress dependencies */ const pinSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.97 10.159a3.382 3.382 0 0 0-2.857.955l1.724 1.723-2.836 2.913L7 17h1.25l2.913-2.837 1.723 1.723a3.38 3.38 0 0 0 .606-.825c.33-.63.446-1.343.35-2.032L17 10.695 13.305 7l-2.334 3.159Z" }) }); /* harmony default export */ const pin_small = (pinSmall); ;// ./node_modules/@wordpress/icons/build-module/library/lock-small.js /** * WordPress dependencies */ const lockSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z" }) }); /* harmony default export */ const lock_small = (lockSmall); ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/expander.js /** * WordPress dependencies */ function ListViewExpander({ onClick }) { return ( /*#__PURE__*/ // Keyboard events are handled by TreeGrid see: components/src/tree-grid/index.js // // The expander component is implemented as a pseudo element in the w3 example // https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html // // We've mimicked this by adding an icon with aria-hidden set to true to hide this from the accessibility tree. // For the current tree grid implementation, please do not try to make this a button. // // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions (0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view__expander", onClick: event => onClick(event, { forceToggle: true }), "aria-hidden": "true", "data-testid": "list-view-expander", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left_small : chevron_right_small }) }) ); } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-images.js /** * WordPress dependencies */ /** * Internal dependencies */ // Maximum number of images to display in a list view row. const MAX_IMAGES = 3; function getImage(block) { if (block.name !== 'core/image') { return; } if (block.attributes?.url) { return { url: block.attributes.url, alt: block.attributes.alt, clientId: block.clientId }; } } function getImagesFromGallery(block) { if (block.name !== 'core/gallery' || !block.innerBlocks) { return []; } const images = []; for (const innerBlock of block.innerBlocks) { const img = getImage(innerBlock); if (img) { images.push(img); } if (images.length >= MAX_IMAGES) { return images; } } return images; } function getImagesFromBlock(block, isExpanded) { const img = getImage(block); if (img) { return [img]; } return isExpanded ? [] : getImagesFromGallery(block); } /** * Get a block's preview images for display within a list view row. * * TODO: Currently only supports images from the core/image and core/gallery * blocks. This should be expanded to support other blocks that have images, * potentially via an API that blocks can opt into / provide their own logic. * * @param {Object} props Hook properties. * @param {string} props.clientId The block's clientId. * @param {boolean} props.isExpanded Whether or not the block is expanded in the list view. * @return {Array} Images. */ function useListViewImages({ clientId, isExpanded }) { const { block } = (0,external_wp_data_namespaceObject.useSelect)(select => { const _block = select(store).getBlock(clientId); return { block: _block }; }, [clientId]); const images = (0,external_wp_element_namespaceObject.useMemo)(() => { return getImagesFromBlock(block, isExpanded); }, [block, isExpanded]); return images; } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/block-select-button.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { Badge: block_select_button_Badge } = unlock(external_wp_components_namespaceObject.privateApis); function ListViewBlockSelectButton({ className, block: { clientId }, onClick, onContextMenu, onMouseDown, onToggleExpanded, tabIndex, onFocus, onDragStart, onDragEnd, draggable, isExpanded, ariaDescribedBy }, ref) { const blockInformation = useBlockDisplayInformation(clientId); const blockTitle = useBlockDisplayTitle({ clientId, context: 'list-view' }); const { isLocked } = useBlockLock(clientId); const { isContentOnly } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ isContentOnly: select(store).getBlockEditingMode(clientId) === 'contentOnly' }), [clientId]); const shouldShowLockIcon = isLocked && !isContentOnly; const isSticky = blockInformation?.positionType === 'sticky'; const images = useListViewImages({ clientId, isExpanded }); // The `href` attribute triggers the browser's native HTML drag operations. // When the link is dragged, the element's outerHTML is set in DataTransfer object as text/html. // We need to clear any HTML drag data to prevent `pasteHandler` from firing // inside the `useOnBlockDrop` hook. const onDragStartHandler = event => { event.dataTransfer.clearData(); onDragStart?.(event); }; /** * @param {KeyboardEvent} event */ function onKeyDown(event) { if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER || event.keyCode === external_wp_keycodes_namespaceObject.SPACE) { onClick(event); } } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { className: dist_clsx('block-editor-list-view-block-select-button', className), onClick: onClick, onContextMenu: onContextMenu, onKeyDown: onKeyDown, onMouseDown: onMouseDown, ref: ref, tabIndex: tabIndex, onFocus: onFocus, onDragStart: onDragStartHandler, onDragEnd: onDragEnd, draggable: draggable, href: `#block-${clientId}`, "aria-describedby": ariaDescribedBy, "aria-expanded": isExpanded, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewExpander, { onClick: onToggleExpanded }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: blockInformation?.icon, showColors: true, context: "list-view" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "center", className: "block-editor-list-view-block-select-button__label-wrapper", justify: "flex-start", spacing: 1, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__title", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { ellipsizeMode: "auto", children: blockTitle }) }), blockInformation?.anchor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__anchor-wrapper", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_select_button_Badge, { className: "block-editor-list-view-block-select-button__anchor", children: blockInformation.anchor }) }), isSticky && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__sticky", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: pin_small }) }), images.length ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__images", "aria-hidden": true, children: images.map((image, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__image", style: { backgroundImage: `url(${image.url})`, zIndex: images.length - index // Ensure the first image is on top, and subsequent images are behind. } }, image.clientId)) }) : null, shouldShowLockIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__lock", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: lock_small }) })] })] }); } /* harmony default export */ const block_select_button = ((0,external_wp_element_namespaceObject.forwardRef)(ListViewBlockSelectButton)); ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/block-contents.js /** * WordPress dependencies */ /** * Internal dependencies */ const ListViewBlockContents = (0,external_wp_element_namespaceObject.forwardRef)(({ onClick, onToggleExpanded, block, isSelected, position, siblingBlockCount, level, isExpanded, selectedClientIds, ...props }, ref) => { const { clientId } = block; const { AdditionalBlockContent, insertedBlock, setInsertedBlock } = useListViewContext(); // Only include all selected blocks if the currently clicked on block // is one of the selected blocks. This ensures that if a user attempts // to drag a block that isn't part of the selection, they're still able // to drag it and rearrange its position. const draggableClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [AdditionalBlockContent && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AdditionalBlockContent, { block: block, insertedBlock: insertedBlock, setInsertedBlock: setInsertedBlock }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_draggable, { appendToOwnerDocument: true, clientIds: draggableClientIds, cloneClassname: "block-editor-list-view-draggable-chip", children: ({ draggable, onDragStart, onDragEnd }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_select_button, { ref: ref, className: "block-editor-list-view-block-contents", block: block, onClick: onClick, onToggleExpanded: onToggleExpanded, isSelected: isSelected, position: position, siblingBlockCount: siblingBlockCount, level: level, draggable: draggable, onDragStart: onDragStart, onDragEnd: onDragEnd, isExpanded: isExpanded, ...props }) })] }); }); /* harmony default export */ const block_contents = (ListViewBlockContents); ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/utils.js /** * WordPress dependencies */ const getBlockPositionDescription = (position, siblingCount, level) => (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */ (0,external_wp_i18n_namespaceObject.__)('Block %1$d of %2$d, Level %3$d.'), position, siblingCount, level); const getBlockPropertiesDescription = (blockInformation, isLocked) => [blockInformation?.positionLabel ? `${(0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Position of selected block, e.g. "Sticky" or "Fixed". (0,external_wp_i18n_namespaceObject.__)('Position: %s'), blockInformation.positionLabel)}.` : undefined, isLocked ? (0,external_wp_i18n_namespaceObject.__)('This block is locked.') : undefined].filter(Boolean).join(' '); /** * Returns true if the client ID occurs within the block selection or multi-selection, * or false otherwise. * * @param {string} clientId Block client ID. * @param {string|string[]} selectedBlockClientIds Selected block client ID, or an array of multi-selected blocks client IDs. * * @return {boolean} Whether the block is in multi-selection set. */ const isClientIdSelected = (clientId, selectedBlockClientIds) => Array.isArray(selectedBlockClientIds) && selectedBlockClientIds.length ? selectedBlockClientIds.indexOf(clientId) !== -1 : selectedBlockClientIds === clientId; /** * From a start and end clientId of potentially different nesting levels, * return the nearest-depth ids that have a common level of depth in the * nesting hierarchy. For multiple block selection, this ensure that the * selection is always at the same nesting level, and not split across * separate levels. * * @param {string} startId The first id of a selection. * @param {string} endId The end id of a selection, usually one that has been clicked on. * @param {string[]} startParents An array of ancestor ids for the start id, in descending order. * @param {string[]} endParents An array of ancestor ids for the end id, in descending order. * @return {Object} An object containing the start and end ids. */ function getCommonDepthClientIds(startId, endId, startParents, endParents) { const startPath = [...startParents, startId]; const endPath = [...endParents, endId]; const depth = Math.min(startPath.length, endPath.length) - 1; const start = startPath[depth]; const end = endPath[depth]; return { start, end }; } /** * Shift focus to the list view item associated with a particular clientId. * * @typedef {import('@wordpress/element').RefObject} RefObject * * @param {string} focusClientId The client ID of the block to focus. * @param {?HTMLElement} treeGridElement The container element to search within. */ function focusListItem(focusClientId, treeGridElement) { const getFocusElement = () => { const row = treeGridElement?.querySelector(`[role=row][data-block="${focusClientId}"]`); if (!row) { return null; } // Focus the first focusable in the row, which is the ListViewBlockSelectButton. return external_wp_dom_namespaceObject.focus.focusable.find(row)[0]; }; let focusElement = getFocusElement(); if (focusElement) { focusElement.focus(); } else { // The element hasn't been painted yet. Defer focusing on the next frame. // This could happen when all blocks have been deleted and the default block // hasn't been added to the editor yet. window.requestAnimationFrame(() => { focusElement = getFocusElement(); // Ignore if the element still doesn't exist. if (focusElement) { focusElement.focus(); } }); } } /** * Get values for the block that flag whether the block should be displaced up or down, * whether the block is being nested, and whether the block appears after the dragged * blocks. These values are used to determine the class names to apply to the block. * The list view rows are displaced visually via CSS rules. Displacement rules: * - `normal`: no displacement — used to apply a translateY of `0` so that the block * appears in its original position, and moves to that position smoothly when dragging * outside of the list view area. * - `up`: the block should be displaced up, creating room beneath the block for the drop indicator. * - `down`: the block should be displaced down, creating room above the block for the drop indicator. * * @param {Object} props * @param {Object} props.blockIndexes The indexes of all the blocks in the list view, keyed by clientId. * @param {number|null|undefined} props.blockDropTargetIndex The index of the block that the user is dropping to. * @param {?string} props.blockDropPosition The position relative to the block that the user is dropping to. * @param {string} props.clientId The client id for the current block. * @param {?number} props.firstDraggedBlockIndex The index of the first dragged block. * @param {?boolean} props.isDragged Whether the current block is being dragged. Dragged blocks skip displacement. * @return {Object} An object containing the `displacement`, `isAfterDraggedBlocks` and `isNesting` values. */ function getDragDisplacementValues({ blockIndexes, blockDropTargetIndex, blockDropPosition, clientId, firstDraggedBlockIndex, isDragged }) { let displacement; let isNesting; let isAfterDraggedBlocks; if (!isDragged) { isNesting = false; const thisBlockIndex = blockIndexes[clientId]; isAfterDraggedBlocks = thisBlockIndex > firstDraggedBlockIndex; // Determine where to displace the position of the current block, relative // to the blocks being dragged (in their original position) and the drop target // (the position where a user is currently dragging the blocks to). if (blockDropTargetIndex !== undefined && blockDropTargetIndex !== null && firstDraggedBlockIndex !== undefined) { // If the block is being dragged and there is a valid drop target, // determine if the block being rendered should be displaced up or down. if (thisBlockIndex !== undefined) { if (thisBlockIndex >= firstDraggedBlockIndex && thisBlockIndex < blockDropTargetIndex) { // If the current block appears after the set of dragged blocks // (in their original position), but is before the drop target, // then the current block should be displaced up. displacement = 'up'; } else if (thisBlockIndex < firstDraggedBlockIndex && thisBlockIndex >= blockDropTargetIndex) { // If the current block appears before the set of dragged blocks // (in their original position), but is after the drop target, // then the current block should be displaced down. displacement = 'down'; } else { displacement = 'normal'; } isNesting = typeof blockDropTargetIndex === 'number' && blockDropTargetIndex - 1 === thisBlockIndex && blockDropPosition === 'inside'; } } else if (blockDropTargetIndex === null && firstDraggedBlockIndex !== undefined) { // A `null` value for `blockDropTargetIndex` indicates that the // drop target is outside of the valid areas within the list view. // In this case, the drag is still active, but as there is no // valid drop target, we should remove the gap indicating where // the block would be inserted. if (thisBlockIndex !== undefined && thisBlockIndex >= firstDraggedBlockIndex) { displacement = 'up'; } else { displacement = 'normal'; } } else if (blockDropTargetIndex !== undefined && blockDropTargetIndex !== null && firstDraggedBlockIndex === undefined) { // If the blockdrop target is defined, but there are no dragged blocks, // then the block should be displaced relative to the drop target. if (thisBlockIndex !== undefined) { if (thisBlockIndex < blockDropTargetIndex) { displacement = 'normal'; } else { displacement = 'down'; } } } else if (blockDropTargetIndex === null) { displacement = 'normal'; } } return { displacement, isNesting, isAfterDraggedBlocks }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/block.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ListViewBlock({ block: { clientId }, displacement, isAfterDraggedBlocks, isDragged, isNesting, isSelected, isBranchSelected, selectBlock, position, level, rowCount, siblingBlockCount, showBlockMovers, path, isExpanded, selectedClientIds, isSyncedBranch }) { const cellRef = (0,external_wp_element_namespaceObject.useRef)(null); const rowRef = (0,external_wp_element_namespaceObject.useRef)(null); const settingsRef = (0,external_wp_element_namespaceObject.useRef)(null); const [isHovered, setIsHovered] = (0,external_wp_element_namespaceObject.useState)(false); const [settingsAnchorRect, setSettingsAnchorRect] = (0,external_wp_element_namespaceObject.useState)(); const { isLocked, canEdit, canMove } = useBlockLock(clientId); const isFirstSelectedBlock = isSelected && selectedClientIds[0] === clientId; const isLastSelectedBlock = isSelected && selectedClientIds[selectedClientIds.length - 1] === clientId; const { toggleBlockHighlight, duplicateBlocks, multiSelect, replaceBlocks, removeBlocks, insertAfterBlock, insertBeforeBlock, setOpenedBlockSettingsMenu } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); const { canInsertBlockType, getSelectedBlockClientIds, getPreviousBlockClientId, getBlockRootClientId, getBlockOrder, getBlockParents, getBlocksByClientId, canRemoveBlocks, isGroupable } = (0,external_wp_data_namespaceObject.useSelect)(store); const { getGroupingBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); const blockInformation = useBlockDisplayInformation(clientId); const { block, blockName, allowRightClickOverrides } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlock, getBlockName, getSettings } = select(store); return { block: getBlock(clientId), blockName: getBlockName(clientId), allowRightClickOverrides: getSettings().allowRightClickOverrides }; }, [clientId]); const showBlockActions = // When a block hides its toolbar it also hides the block settings menu, // since that menu is part of the toolbar in the editor canvas. // List View respects this by also hiding the block settings menu. (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, '__experimentalToolbar', true); const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewBlock); const descriptionId = `list-view-block-select-button__description-${instanceId}`; const { expand, collapse, collapseAll, BlockSettingsMenu, listViewInstanceId, expandedState, setInsertedBlock, treeGridElementRef, rootClientId } = useListViewContext(); const isMatch = (0,external_wp_keyboardShortcuts_namespaceObject.__unstableUseShortcutEventMatch)(); // Determine which blocks to update: // If the current (focused) block is part of the block selection, use the whole selection. // If the focused block is not part of the block selection, only update the focused block. function getBlocksToUpdate() { const selectedBlockClientIds = getSelectedBlockClientIds(); const isUpdatingSelectedBlocks = selectedBlockClientIds.includes(clientId); const firstBlockClientId = isUpdatingSelectedBlocks ? selectedBlockClientIds[0] : clientId; const firstBlockRootClientId = getBlockRootClientId(firstBlockClientId); const blocksToUpdate = isUpdatingSelectedBlocks ? selectedBlockClientIds : [clientId]; return { blocksToUpdate, firstBlockClientId, firstBlockRootClientId, selectedBlockClientIds }; } /** * @param {KeyboardEvent} event */ async function onKeyDown(event) { if (event.defaultPrevented) { return; } // Do not handle events if it comes from modals; // retain the default behavior for these keys. if (event.target.closest('[role=dialog]')) { return; } const isDeleteKey = [external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].includes(event.keyCode); // If multiple blocks are selected, deselect all blocks when the user // presses the escape key. if (isMatch('core/block-editor/unselect', event) && selectedClientIds.length > 0) { event.stopPropagation(); event.preventDefault(); selectBlock(event, undefined); } else if (isDeleteKey || isMatch('core/block-editor/remove', event)) { var _getPreviousBlockClie; const { blocksToUpdate: blocksToDelete, firstBlockClientId, firstBlockRootClientId, selectedBlockClientIds } = getBlocksToUpdate(); // Don't update the selection if the blocks cannot be deleted. if (!canRemoveBlocks(blocksToDelete)) { return; } let blockToFocus = (_getPreviousBlockClie = getPreviousBlockClientId(firstBlockClientId)) !== null && _getPreviousBlockClie !== void 0 ? _getPreviousBlockClie : // If the previous block is not found (when the first block is deleted), // fallback to focus the parent block. firstBlockRootClientId; removeBlocks(blocksToDelete, false); // Update the selection if the original selection has been removed. const shouldUpdateSelection = selectedBlockClientIds.length > 0 && getSelectedBlockClientIds().length === 0; // If there's no previous block nor parent block, focus the first block. if (!blockToFocus) { blockToFocus = getBlockOrder()[0]; } updateFocusAndSelection(blockToFocus, shouldUpdateSelection); } else if (isMatch('core/block-editor/duplicate', event)) { event.preventDefault(); const { blocksToUpdate, firstBlockRootClientId } = getBlocksToUpdate(); const canDuplicate = getBlocksByClientId(blocksToUpdate).every(blockToUpdate => { return !!blockToUpdate && (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockToUpdate.name, 'multiple', true) && canInsertBlockType(blockToUpdate.name, firstBlockRootClientId); }); if (canDuplicate) { const updatedBlocks = await duplicateBlocks(blocksToUpdate, false); if (updatedBlocks?.length) { // If blocks have been duplicated, focus the first duplicated block. updateFocusAndSelection(updatedBlocks[0], false); } } } else if (isMatch('core/block-editor/insert-before', event)) { event.preventDefault(); const { blocksToUpdate } = getBlocksToUpdate(); await insertBeforeBlock(blocksToUpdate[0]); const newlySelectedBlocks = getSelectedBlockClientIds(); // Focus the first block of the newly inserted blocks, to keep focus within the list view. setOpenedBlockSettingsMenu(undefined); updateFocusAndSelection(newlySelectedBlocks[0], false); } else if (isMatch('core/block-editor/insert-after', event)) { event.preventDefault(); const { blocksToUpdate } = getBlocksToUpdate(); await insertAfterBlock(blocksToUpdate.at(-1)); const newlySelectedBlocks = getSelectedBlockClientIds(); // Focus the first block of the newly inserted blocks, to keep focus within the list view. setOpenedBlockSettingsMenu(undefined); updateFocusAndSelection(newlySelectedBlocks[0], false); } else if (isMatch('core/block-editor/select-all', event)) { event.preventDefault(); const { firstBlockRootClientId, selectedBlockClientIds } = getBlocksToUpdate(); const blockClientIds = getBlockOrder(firstBlockRootClientId); if (!blockClientIds.length) { return; } // If we have selected all sibling nested blocks, try selecting up a level. // This is a similar implementation to that used by `useSelectAll`. // `isShallowEqual` is used for the list view instead of a length check, // as the array of siblings of the currently focused block may be a different // set of blocks from the current block selection if the user is focused // on a different part of the list view from the block selection. if (external_wp_isShallowEqual_default()(selectedBlockClientIds, blockClientIds)) { // Only select up a level if the first block is not the root block. // This ensures that the block selection can't break out of the root block // used by the list view, if the list view is only showing a partial hierarchy. if (firstBlockRootClientId && firstBlockRootClientId !== rootClientId) { updateFocusAndSelection(firstBlockRootClientId, true); return; } } // Select all while passing `null` to skip focusing to the editor canvas, // and retain focus within the list view. multiSelect(blockClientIds[0], blockClientIds[blockClientIds.length - 1], null); } else if (isMatch('core/block-editor/collapse-list-view', event)) { event.preventDefault(); const { firstBlockClientId } = getBlocksToUpdate(); const blockParents = getBlockParents(firstBlockClientId, false); // Collapse all blocks. collapseAll(); // Expand all parents of the current block. expand(blockParents); } else if (isMatch('core/block-editor/group', event)) { const { blocksToUpdate } = getBlocksToUpdate(); if (blocksToUpdate.length > 1 && isGroupable(blocksToUpdate)) { event.preventDefault(); const blocks = getBlocksByClientId(blocksToUpdate); const groupingBlockName = getGroupingBlockName(); const newBlocks = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blocks, groupingBlockName); replaceBlocks(blocksToUpdate, newBlocks); (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Selected blocks are grouped.')); const newlySelectedBlocks = getSelectedBlockClientIds(); // Focus the first block of the newly inserted blocks, to keep focus within the list view. setOpenedBlockSettingsMenu(undefined); updateFocusAndSelection(newlySelectedBlocks[0], false); } } } const onMouseEnter = (0,external_wp_element_namespaceObject.useCallback)(() => { setIsHovered(true); toggleBlockHighlight(clientId, true); }, [clientId, setIsHovered, toggleBlockHighlight]); const onMouseLeave = (0,external_wp_element_namespaceObject.useCallback)(() => { setIsHovered(false); toggleBlockHighlight(clientId, false); }, [clientId, setIsHovered, toggleBlockHighlight]); const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)(event => { selectBlock(event, clientId); event.preventDefault(); }, [clientId, selectBlock]); const updateFocusAndSelection = (0,external_wp_element_namespaceObject.useCallback)((focusClientId, shouldSelectBlock) => { if (shouldSelectBlock) { selectBlock(undefined, focusClientId, null, null); } focusListItem(focusClientId, treeGridElementRef?.current); }, [selectBlock, treeGridElementRef]); const toggleExpanded = (0,external_wp_element_namespaceObject.useCallback)(event => { // Prevent shift+click from opening link in a new window when toggling. event.preventDefault(); event.stopPropagation(); if (isExpanded === true) { collapse(clientId); } else if (isExpanded === false) { expand(clientId); } }, [clientId, expand, collapse, isExpanded]); // Allow right-clicking an item in the List View to open up the block settings dropdown. const onContextMenu = (0,external_wp_element_namespaceObject.useCallback)(event => { if (showBlockActions && allowRightClickOverrides) { settingsRef.current?.click(); // Ensure the position of the settings dropdown is at the cursor. setSettingsAnchorRect(new window.DOMRect(event.clientX, event.clientY, 0, 0)); event.preventDefault(); } }, [allowRightClickOverrides, settingsRef, showBlockActions]); const onMouseDown = (0,external_wp_element_namespaceObject.useCallback)(event => { // Prevent right-click from focusing the block, // because focus will be handled when opening the block settings dropdown. if (allowRightClickOverrides && event.button === 2) { event.preventDefault(); } }, [allowRightClickOverrides]); const settingsPopoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => { const { ownerDocument } = rowRef?.current || {}; // If no custom position is set, the settings dropdown will be anchored to the // DropdownMenu toggle button. if (!settingsAnchorRect || !ownerDocument) { return undefined; } // Position the settings dropdown at the cursor when right-clicking a block. return { ownerDocument, getBoundingClientRect() { return settingsAnchorRect; } }; }, [settingsAnchorRect]); const clearSettingsAnchorRect = (0,external_wp_element_namespaceObject.useCallback)(() => { // Clear the custom position for the settings dropdown so that it is restored back // to being anchored to the DropdownMenu toggle button. setSettingsAnchorRect(undefined); }, [setSettingsAnchorRect]); // Pass in a ref to the row, so that it can be scrolled // into view when selected. For long lists, the placeholder for the // selected block is also observed, within ListViewLeafPlaceholder. useListViewScrollIntoView({ isSelected, rowItemRef: rowRef, selectedClientIds }); // When switching between rendering modes (such as template preview and content only), // it is possible for a block to temporarily be unavailable. In this case, we should not // render the leaf, to avoid errors further down the tree. if (!block) { return null; } const blockPositionDescription = getBlockPositionDescription(position, siblingBlockCount, level); const blockPropertiesDescription = getBlockPropertiesDescription(blockInformation, isLocked); const hasSiblings = siblingBlockCount > 0; const hasRenderedMovers = showBlockMovers && hasSiblings; const moverCellClassName = dist_clsx('block-editor-list-view-block__mover-cell', { 'is-visible': isHovered || isSelected }); const listViewBlockSettingsClassName = dist_clsx('block-editor-list-view-block__menu-cell', { 'is-visible': isHovered || isFirstSelectedBlock }); let colSpan; if (hasRenderedMovers) { colSpan = 2; } else if (!showBlockActions) { colSpan = 3; } const classes = dist_clsx({ 'is-selected': isSelected, 'is-first-selected': isFirstSelectedBlock, 'is-last-selected': isLastSelectedBlock, 'is-branch-selected': isBranchSelected, 'is-synced-branch': isSyncedBranch, 'is-dragging': isDragged, 'has-single-cell': !showBlockActions, 'is-synced': blockInformation?.isSynced, 'is-draggable': canMove, 'is-displacement-normal': displacement === 'normal', 'is-displacement-up': displacement === 'up', 'is-displacement-down': displacement === 'down', 'is-after-dragged-blocks': isAfterDraggedBlocks, 'is-nesting': isNesting }); // Only include all selected blocks if the currently clicked on block // is one of the selected blocks. This ensures that if a user attempts // to alter a block that isn't part of the selection, they're still able // to do so. const dropdownClientIds = selectedClientIds.includes(clientId) ? selectedClientIds : [clientId]; // Detect if there is a block in the canvas currently being edited and multi-selection is not happening. const currentlyEditingBlockInCanvas = isSelected && selectedClientIds.length === 1; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(leaf, { className: classes, isDragged: isDragged, onKeyDown: onKeyDown, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onFocus: onMouseEnter, onBlur: onMouseLeave, level: level, position: position, rowCount: rowCount, path: path, id: `list-view-${listViewInstanceId}-block-${clientId}`, "data-block": clientId, "data-expanded": canEdit ? isExpanded : undefined, ref: rowRef, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGridCell, { className: "block-editor-list-view-block__contents-cell", colSpan: colSpan, ref: cellRef, "aria-selected": !!isSelected, children: ({ ref, tabIndex, onFocus }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-list-view-block__contents-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_contents, { block: block, onClick: selectEditorBlock, onContextMenu: onContextMenu, onMouseDown: onMouseDown, onToggleExpanded: toggleExpanded, isSelected: isSelected, position: position, siblingBlockCount: siblingBlockCount, level: level, ref: ref, tabIndex: currentlyEditingBlockInCanvas ? 0 : tabIndex, onFocus: onFocus, isExpanded: canEdit ? isExpanded : undefined, selectedClientIds: selectedClientIds, ariaDescribedBy: descriptionId }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AriaReferencedText, { id: descriptionId, children: [blockPositionDescription, blockPropertiesDescription].filter(Boolean).join(' ') })] }) }), hasRenderedMovers && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalTreeGridCell, { className: moverCellClassName, withoutGridItem: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGridItem, { children: ({ ref, tabIndex, onFocus }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockMoverUpButton, { orientation: "vertical", clientIds: [clientId], ref: ref, tabIndex: tabIndex, onFocus: onFocus }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGridItem, { children: ({ ref, tabIndex, onFocus }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockMoverDownButton, { orientation: "vertical", clientIds: [clientId], ref: ref, tabIndex: tabIndex, onFocus: onFocus }) })] }) }), showBlockActions && BlockSettingsMenu && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGridCell, { className: listViewBlockSettingsClassName, "aria-selected": !!isSelected, ref: settingsRef, children: ({ ref, tabIndex, onFocus }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockSettingsMenu, { clientIds: dropdownClientIds, block: block, icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Options'), popoverProps: { anchor: settingsPopoverAnchor // Used to position the settings at the cursor on right-click. }, toggleProps: { ref, className: 'block-editor-list-view-block__menu', tabIndex, onClick: clearSettingsAnchorRect, onFocus }, disableOpenOnArrowDown: true, expand: expand, expandedState: expandedState, setInsertedBlock: setInsertedBlock, __experimentalSelectBlock: updateFocusAndSelection }) })] }); } /* harmony default export */ const list_view_block = ((0,external_wp_element_namespaceObject.memo)(ListViewBlock)); ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/branch.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Given a block, returns the total number of blocks in that subtree. This is used to help determine * the list position of a block. * * When a block is collapsed, we do not count their children as part of that total. In the current drag * implementation dragged blocks and their children are not counted. * * @param {Object} block block tree * @param {Object} expandedState state that notes which branches are collapsed * @param {Array} draggedClientIds a list of dragged client ids * @param {boolean} isExpandedByDefault flag to determine the default fallback expanded state. * @return {number} block count */ function countBlocks(block, expandedState, draggedClientIds, isExpandedByDefault) { var _expandedState$block$; const isDragged = draggedClientIds?.includes(block.clientId); if (isDragged) { return 0; } const isExpanded = (_expandedState$block$ = expandedState[block.clientId]) !== null && _expandedState$block$ !== void 0 ? _expandedState$block$ : isExpandedByDefault; if (isExpanded) { return 1 + block.innerBlocks.reduce(countReducer(expandedState, draggedClientIds, isExpandedByDefault), 0); } return 1; } const countReducer = (expandedState, draggedClientIds, isExpandedByDefault) => (count, block) => { var _expandedState$block$2; const isDragged = draggedClientIds?.includes(block.clientId); if (isDragged) { return count; } const isExpanded = (_expandedState$block$2 = expandedState[block.clientId]) !== null && _expandedState$block$2 !== void 0 ? _expandedState$block$2 : isExpandedByDefault; if (isExpanded && block.innerBlocks.length > 0) { return count + countBlocks(block, expandedState, draggedClientIds, isExpandedByDefault); } return count + 1; }; const branch_noop = () => {}; function ListViewBranch(props) { const { blocks, selectBlock = branch_noop, showBlockMovers, selectedClientIds, level = 1, path = '', isBranchSelected = false, listPosition = 0, fixedListWindow, isExpanded, parentId, shouldShowInnerBlocks = true, isSyncedBranch = false, showAppender: showAppenderProp = true } = props; const parentBlockInformation = useBlockDisplayInformation(parentId); const syncedBranch = isSyncedBranch || !!parentBlockInformation?.isSynced; const canParentExpand = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!parentId) { return true; } return select(store).canEditBlock(parentId); }, [parentId]); const { blockDropPosition, blockDropTargetIndex, firstDraggedBlockIndex, blockIndexes, expandedState, draggedClientIds } = useListViewContext(); const nextPositionRef = (0,external_wp_element_namespaceObject.useRef)(); if (!canParentExpand) { return null; } // Only show the appender at the first level. const showAppender = showAppenderProp && level === 1; const filteredBlocks = blocks.filter(Boolean); const blockCount = filteredBlocks.length; // The appender means an extra row in List View, so add 1 to the row count. const rowCount = showAppender ? blockCount + 1 : blockCount; nextPositionRef.current = listPosition; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [filteredBlocks.map((block, index) => { var _expandedState$client; const { clientId, innerBlocks } = block; if (index > 0) { nextPositionRef.current += countBlocks(filteredBlocks[index - 1], expandedState, draggedClientIds, isExpanded); } const isDragged = !!draggedClientIds?.includes(clientId); // Determine the displacement of the block while dragging. This // works out whether the current block should be displaced up or // down, relative to the dragged blocks and the drop target. const { displacement, isAfterDraggedBlocks, isNesting } = getDragDisplacementValues({ blockIndexes, blockDropTargetIndex, blockDropPosition, clientId, firstDraggedBlockIndex, isDragged }); const { itemInView } = fixedListWindow; const blockInView = itemInView(nextPositionRef.current); const position = index + 1; const updatedPath = path.length > 0 ? `${path}_${position}` : `${position}`; const hasNestedBlocks = !!innerBlocks?.length; const shouldExpand = hasNestedBlocks && shouldShowInnerBlocks ? (_expandedState$client = expandedState[clientId]) !== null && _expandedState$client !== void 0 ? _expandedState$client : isExpanded : undefined; // Make updates to the selected or dragged blocks synchronous, // but asynchronous for any other block. const isSelected = isClientIdSelected(clientId, selectedClientIds); const isSelectedBranch = isBranchSelected || isSelected && hasNestedBlocks; // To avoid performance issues, we only render blocks that are in view, // or blocks that are selected or dragged. If a block is selected, // it is only counted if it is the first of the block selection. // This prevents the entire tree from being rendered when a branch is // selected, or a user selects all blocks, while still enabling scroll // into view behavior when selecting a block or opening the list view. // The first and last blocks of the list are always rendered, to ensure // that Home and End keys work as expected. const showBlock = isDragged || blockInView || isSelected && clientId === selectedClientIds[0] || index === 0 || index === blockCount - 1; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_data_namespaceObject.AsyncModeProvider, { value: !isSelected, children: [showBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(list_view_block, { block: block, selectBlock: selectBlock, isSelected: isSelected, isBranchSelected: isSelectedBranch, isDragged: isDragged, level: level, position: position, rowCount: rowCount, siblingBlockCount: blockCount, showBlockMovers: showBlockMovers, path: updatedPath, isExpanded: isDragged ? false : shouldExpand, listPosition: nextPositionRef.current, selectedClientIds: selectedClientIds, isSyncedBranch: syncedBranch, displacement: displacement, isAfterDraggedBlocks: isAfterDraggedBlocks, isNesting: isNesting }), !showBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("td", { className: "block-editor-list-view-placeholder" }) }), hasNestedBlocks && shouldExpand && !isDragged && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewBranch, { parentId: clientId, blocks: innerBlocks, selectBlock: selectBlock, showBlockMovers: showBlockMovers, level: level + 1, path: updatedPath, listPosition: nextPositionRef.current + 1, fixedListWindow: fixedListWindow, isBranchSelected: isSelectedBranch, selectedClientIds: selectedClientIds, isExpanded: isExpanded, isSyncedBranch: syncedBranch })] }, clientId); }), showAppender && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGridRow, { level: level, setSize: rowCount, positionInSet: rowCount, isExpanded: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGridCell, { children: treeGridCellProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Appender, { clientId: parentId, nestingLevel: level, blockCount: blockCount, ...treeGridCellProps }) }) })] }); } /* harmony default export */ const branch = ((0,external_wp_element_namespaceObject.memo)(ListViewBranch)); ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/drop-indicator.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ListViewDropIndicatorPreview({ draggedBlockClientId, listViewRef, blockDropTarget }) { const blockInformation = useBlockDisplayInformation(draggedBlockClientId); const blockTitle = useBlockDisplayTitle({ clientId: draggedBlockClientId, context: 'list-view' }); const { rootClientId, clientId, dropPosition } = blockDropTarget || {}; const [rootBlockElement, blockElement] = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!listViewRef.current) { return []; } // The rootClientId will be defined whenever dropping into inner // block lists, but is undefined when dropping at the root level. const _rootBlockElement = rootClientId ? listViewRef.current.querySelector(`[data-block="${rootClientId}"]`) : undefined; // The clientId represents the sibling block, the dragged block will // usually be inserted adjacent to it. It will be undefined when // dropping a block into an empty block list. const _blockElement = clientId ? listViewRef.current.querySelector(`[data-block="${clientId}"]`) : undefined; return [_rootBlockElement, _blockElement]; }, [listViewRef, rootClientId, clientId]); // The targetElement is the element that the drop indicator will appear // before or after. When dropping into an empty block list, blockElement // is undefined, so the indicator will appear after the rootBlockElement. const targetElement = blockElement || rootBlockElement; const rtl = (0,external_wp_i18n_namespaceObject.isRTL)(); const getDropIndicatorWidth = (0,external_wp_element_namespaceObject.useCallback)((targetElementRect, indent) => { if (!targetElement) { return 0; } // Default to assuming that the width of the drop indicator // should be the same as the target element. let width = targetElement.offsetWidth; // In deeply nested lists, where a scrollbar is present, // the width of the drop indicator should be the width of // the scroll container, minus the distance from the left // edge of the scroll container to the left edge of the // target element. const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(targetElement, 'horizontal'); const ownerDocument = targetElement.ownerDocument; const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement; if (scrollContainer && !windowScroll) { const scrollContainerRect = scrollContainer.getBoundingClientRect(); const distanceBetweenContainerAndTarget = (0,external_wp_i18n_namespaceObject.isRTL)() ? scrollContainerRect.right - targetElementRect.right : targetElementRect.left - scrollContainerRect.left; const scrollContainerWidth = scrollContainer.clientWidth; if (scrollContainerWidth < width + distanceBetweenContainerAndTarget) { width = scrollContainerWidth - distanceBetweenContainerAndTarget; } // LTR logic for ensuring the drop indicator does not extend // beyond the right edge of the scroll container. if (!rtl && targetElementRect.left + indent < scrollContainerRect.left) { width -= scrollContainerRect.left - targetElementRect.left; return width; } // RTL logic for ensuring the drop indicator does not extend // beyond the right edge of the scroll container. if (rtl && targetElementRect.right - indent > scrollContainerRect.right) { width -= targetElementRect.right - scrollContainerRect.right; return width; } } // Subtract the indent from the final width of the indicator. return width - indent; }, [rtl, targetElement]); const style = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!targetElement) { return {}; } const targetElementRect = targetElement.getBoundingClientRect(); return { width: getDropIndicatorWidth(targetElementRect, 0) }; }, [getDropIndicatorWidth, targetElement]); const horizontalScrollOffsetStyle = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!targetElement) { return {}; } const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(targetElement); const ownerDocument = targetElement.ownerDocument; const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement; if (scrollContainer && !windowScroll) { const scrollContainerRect = scrollContainer.getBoundingClientRect(); const targetElementRect = targetElement.getBoundingClientRect(); const distanceBetweenContainerAndTarget = rtl ? scrollContainerRect.right - targetElementRect.right : targetElementRect.left - scrollContainerRect.left; if (!rtl && scrollContainerRect.left > targetElementRect.left) { return { transform: `translateX( ${distanceBetweenContainerAndTarget}px )` }; } if (rtl && scrollContainerRect.right < targetElementRect.right) { return { transform: `translateX( ${distanceBetweenContainerAndTarget * -1}px )` }; } } return {}; }, [rtl, targetElement]); const ariaLevel = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!rootBlockElement) { return 1; } const _ariaLevel = parseInt(rootBlockElement.getAttribute('aria-level'), 10); return _ariaLevel ? _ariaLevel + 1 : 1; }, [rootBlockElement]); const hasAdjacentSelectedBranch = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!targetElement) { return false; } return targetElement.classList.contains('is-branch-selected'); }, [targetElement]); const popoverAnchor = (0,external_wp_element_namespaceObject.useMemo)(() => { const isValidDropPosition = dropPosition === 'top' || dropPosition === 'bottom' || dropPosition === 'inside'; if (!targetElement || !isValidDropPosition) { return undefined; } return { contextElement: targetElement, getBoundingClientRect() { const rect = targetElement.getBoundingClientRect(); // In RTL languages, the drop indicator should be positioned // to the left of the target element, with the width of the // indicator determining the indent at the right edge of the // target element. In LTR languages, the drop indicator should // end at the right edge of the target element, with the indent // added to the position of the left edge of the target element. // let left = rtl ? rect.left : rect.left + indent; let left = rect.left; let top = 0; // In deeply nested lists, where a scrollbar is present, // the width of the drop indicator should be the width of // the visible area of the scroll container. Additionally, // the left edge of the drop indicator line needs to be // offset by the distance the left edge of the target element // and the left edge of the scroll container. The ensures // that the drop indicator position never breaks out of the // visible area of the scroll container. const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(targetElement, 'horizontal'); const doc = targetElement.ownerDocument; const windowScroll = scrollContainer === doc.body || scrollContainer === doc.documentElement; // If the scroll container is not the window, offset the left position, if need be. if (scrollContainer && !windowScroll) { const scrollContainerRect = scrollContainer.getBoundingClientRect(); // In RTL languages, a vertical scrollbar is present on the // left edge of the scroll container. The width of the // scrollbar needs to be accounted for when positioning the // drop indicator. const scrollbarWidth = rtl ? scrollContainer.offsetWidth - scrollContainer.clientWidth : 0; if (left < scrollContainerRect.left + scrollbarWidth) { left = scrollContainerRect.left + scrollbarWidth; } } if (dropPosition === 'top') { top = rect.top - rect.height * 2; } else { // `dropPosition` is either `bottom` or `inside` top = rect.top; } const width = getDropIndicatorWidth(rect, 0); const height = rect.height; return new window.DOMRect(left, top, width, height); } }; }, [targetElement, dropPosition, getDropIndicatorWidth, rtl]); if (!targetElement) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { animate: false, anchor: popoverAnchor, focusOnMount: false, className: "block-editor-list-view-drop-indicator--preview", variant: "unstyled", flip: false, resize: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: style, className: dist_clsx('block-editor-list-view-drop-indicator__line', { 'block-editor-list-view-drop-indicator__line--darker': hasAdjacentSelectedBranch }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-list-view-leaf", "aria-level": ariaLevel, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx('block-editor-list-view-block-select-button', 'block-editor-list-view-block-contents'), style: horizontalScrollOffsetStyle, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewExpander, { onClick: () => {} }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: blockInformation?.icon, showColors: true, context: "list-view" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "center", className: "block-editor-list-view-block-select-button__label-wrapper", justify: "flex-start", spacing: 1, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-list-view-block-select-button__title", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { ellipsizeMode: "auto", children: blockTitle }) }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-list-view-block__menu-cell" })] }) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-block-selection.js /** * WordPress dependencies */ /** * Internal dependencies */ function useBlockSelection() { const { clearSelectedBlock, multiSelect, selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { getBlockName, getBlockParents, getBlockSelectionStart, getSelectedBlockClientIds, hasMultiSelection, hasSelectedBlock } = (0,external_wp_data_namespaceObject.useSelect)(store); const { getBlockType } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blocks_namespaceObject.store); const updateBlockSelection = (0,external_wp_element_namespaceObject.useCallback)(async (event, clientId, destinationClientId, focusPosition) => { if (!event?.shiftKey && event?.keyCode !== external_wp_keycodes_namespaceObject.ESCAPE) { selectBlock(clientId, focusPosition); return; } // To handle multiple block selection via the `SHIFT` key, prevent // the browser default behavior of opening the link in a new window. event.preventDefault(); const isOnlyDeselection = event.type === 'keydown' && event.keyCode === external_wp_keycodes_namespaceObject.ESCAPE; const isKeyPress = event.type === 'keydown' && (event.keyCode === external_wp_keycodes_namespaceObject.UP || event.keyCode === external_wp_keycodes_namespaceObject.DOWN || event.keyCode === external_wp_keycodes_namespaceObject.HOME || event.keyCode === external_wp_keycodes_namespaceObject.END); // Handle clicking on a block when no blocks are selected, and return early. if (!isKeyPress && !hasSelectedBlock() && !hasMultiSelection()) { selectBlock(clientId, null); return; } const selectedBlocks = getSelectedBlockClientIds(); const clientIdWithParents = [...getBlockParents(clientId), clientId]; if (isOnlyDeselection || isKeyPress && !selectedBlocks.some(blockId => clientIdWithParents.includes(blockId))) { // Ensure that shift-selecting blocks via the keyboard only // expands the current selection if focusing over already // selected blocks. Otherwise, clear the selection so that // a user can create a new selection entirely by keyboard. await clearSelectedBlock(); } // Update selection, if not only clearing the selection. if (!isOnlyDeselection) { let startTarget = getBlockSelectionStart(); let endTarget = clientId; // Handle keyboard behavior for selecting multiple blocks. if (isKeyPress) { if (!hasSelectedBlock() && !hasMultiSelection()) { // Set the starting point of the selection to the currently // focused block, if there are no blocks currently selected. // This ensures that as the selection is expanded or contracted, // the starting point of the selection is anchored to that block. startTarget = clientId; } if (destinationClientId) { // If the user presses UP or DOWN, we want to ensure that the block they're // moving to is the target for selection, and not the currently focused one. endTarget = destinationClientId; } } const startParents = getBlockParents(startTarget); const endParents = getBlockParents(endTarget); const { start, end } = getCommonDepthClientIds(startTarget, endTarget, startParents, endParents); await multiSelect(start, end, null); } // Announce deselected block, or number of deselected blocks if // the total number of blocks deselected is greater than one. const updatedSelectedBlocks = getSelectedBlockClientIds(); // If the selection is greater than 1 and the Home or End keys // were used to generate the selection, then skip announcing the // deselected blocks. if ((event.keyCode === external_wp_keycodes_namespaceObject.HOME || event.keyCode === external_wp_keycodes_namespaceObject.END) && updatedSelectedBlocks.length > 1) { return; } const selectionDiff = selectedBlocks.filter(blockId => !updatedSelectedBlocks.includes(blockId)); let label; if (selectionDiff.length === 1) { const title = getBlockType(getBlockName(selectionDiff[0]))?.title; if (title) { label = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ (0,external_wp_i18n_namespaceObject.__)('%s deselected.'), title); } } else if (selectionDiff.length > 1) { label = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: number of deselected blocks */ (0,external_wp_i18n_namespaceObject.__)('%s blocks deselected.'), selectionDiff.length); } if (label) { (0,external_wp_a11y_namespaceObject.speak)(label, 'assertive'); } }, [clearSelectedBlock, getBlockName, getBlockType, getBlockParents, getBlockSelectionStart, getSelectedBlockClientIds, hasMultiSelection, hasSelectedBlock, multiSelect, selectBlock]); return { updateBlockSelection }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-block-indexes.js /** * WordPress dependencies */ function useListViewBlockIndexes(blocks) { const blockIndexes = (0,external_wp_element_namespaceObject.useMemo)(() => { const indexes = {}; let currentGlobalIndex = 0; const traverseBlocks = blockList => { blockList.forEach(block => { indexes[block.clientId] = currentGlobalIndex; currentGlobalIndex++; if (block.innerBlocks.length > 0) { traverseBlocks(block.innerBlocks); } }); }; traverseBlocks(blocks); return indexes; }, [blocks]); return blockIndexes; } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-client-ids.js /** * WordPress dependencies */ /** * Internal dependencies */ function useListViewClientIds({ blocks, rootClientId }) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getDraggedBlockClientIds, getSelectedBlockClientIds, getEnabledClientIdsTree } = unlock(select(store)); return { selectedClientIds: getSelectedBlockClientIds(), draggedClientIds: getDraggedBlockClientIds(), clientIdsTree: blocks !== null && blocks !== void 0 ? blocks : getEnabledClientIdsTree(rootClientId) }; }, [blocks, rootClientId]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-collapse-items.js /** * WordPress dependencies */ /** * Internal dependencies */ function useListViewCollapseItems({ collapseAll, expand }) { const { expandedBlock, getBlockParents } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockParents: _getBlockParents, getExpandedBlock } = unlock(select(store)); return { expandedBlock: getExpandedBlock(), getBlockParents: _getBlockParents }; }, []); // Collapse all but the specified block when the expanded block client Id changes. (0,external_wp_element_namespaceObject.useEffect)(() => { if (expandedBlock) { const blockParents = getBlockParents(expandedBlock, false); // Collapse all blocks and expand the block's parents. collapseAll(); expand(blockParents); } }, [collapseAll, expand, expandedBlock, getBlockParents]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-drop-zone.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('../../utils/math').WPPoint} WPPoint */ /** * The type of a drag event. * * @typedef {'default'|'file'|'html'} WPDragEventType */ /** * An object representing data for blocks in the DOM used by drag and drop. * * @typedef {Object} WPListViewDropZoneBlock * @property {string} clientId The client id for the block. * @property {string} rootClientId The root client id for the block. * @property {number} blockIndex The block's index. * @property {Element} element The DOM element representing the block. * @property {number} innerBlockCount The number of inner blocks the block has. * @property {boolean} isDraggedBlock Whether the block is currently being dragged. * @property {boolean} isExpanded Whether the block is expanded in the UI. * @property {boolean} canInsertDraggedBlocksAsSibling Whether the dragged block can be a sibling of this block. * @property {boolean} canInsertDraggedBlocksAsChild Whether the dragged block can be a child of this block. */ /** * An array representing data for blocks in the DOM used by drag and drop. * * @typedef {WPListViewDropZoneBlock[]} WPListViewDropZoneBlocks */ /** * An object containing details of a drop target. * * @typedef {Object} WPListViewDropZoneTarget * @property {string} blockIndex The insertion index. * @property {string} rootClientId The root client id for the block. * @property {string|undefined} clientId The client id for the block. * @property {'top'|'bottom'|'inside'} dropPosition The position relative to the block that the user is dropping to. * 'inside' refers to nesting as an inner block. */ // When the indentation level, the corresponding left margin in `style.scss` // must be updated as well to ensure the drop zone is aligned with the indentation. const NESTING_LEVEL_INDENTATION = 24; /** * Determines whether the user is positioning the dragged block to be * moved up to a parent level. * * Determined based on nesting level indentation of the current block. * * @param {WPPoint} point The point representing the cursor position when dragging. * @param {DOMRect} rect The rectangle. * @param {number} nestingLevel The nesting level of the block. * @param {boolean} rtl Whether the editor is in RTL mode. * @return {boolean} Whether the gesture is an upward gesture. */ function isUpGesture(point, rect, nestingLevel = 1, rtl = false) { // If the block is nested, and the user is dragging to the bottom // left of the block (or bottom right in RTL languages), then it is an upward gesture. const blockIndentPosition = rtl ? rect.right - nestingLevel * NESTING_LEVEL_INDENTATION : rect.left + nestingLevel * NESTING_LEVEL_INDENTATION; return rtl ? point.x > blockIndentPosition : point.x < blockIndentPosition; } /** * Returns how many nesting levels up the user is attempting to drag to. * * The relative parent level is calculated based on how far * the cursor is from the provided nesting level (e.g. of a candidate block * that the user is hovering over). The nesting level is considered "desired" * because it is not guaranteed that the user will be able to drag to the desired level. * * The returned integer can be used to access an ascending array * of parent blocks, where the first item is the block the user * is hovering over, and the last item is the root block. * * @param {WPPoint} point The point representing the cursor position when dragging. * @param {DOMRect} rect The rectangle. * @param {number} nestingLevel The nesting level of the block. * @param {boolean} rtl Whether the editor is in RTL mode. * @return {number} The desired relative parent level. */ function getDesiredRelativeParentLevel(point, rect, nestingLevel = 1, rtl = false) { // In RTL languages, the block indent position is from the right edge of the block. // In LTR languages, the block indent position is from the left edge of the block. const blockIndentPosition = rtl ? rect.right - nestingLevel * NESTING_LEVEL_INDENTATION : rect.left + nestingLevel * NESTING_LEVEL_INDENTATION; const distanceBetweenPointAndBlockIndentPosition = rtl ? blockIndentPosition - point.x : point.x - blockIndentPosition; const desiredParentLevel = Math.round(distanceBetweenPointAndBlockIndentPosition / NESTING_LEVEL_INDENTATION); return Math.abs(desiredParentLevel); } /** * Returns an array of the parent blocks of the block the user is dropping to. * * @param {WPListViewDropZoneBlock} candidateBlockData The block the user is dropping to. * @param {WPListViewDropZoneBlocks} blocksData Data about the blocks in list view. * @return {WPListViewDropZoneBlocks} An array of block parents, including the block the user is dropping to. */ function getCandidateBlockParents(candidateBlockData, blocksData) { const candidateBlockParents = []; let currentBlockData = candidateBlockData; while (currentBlockData) { candidateBlockParents.push({ ...currentBlockData }); currentBlockData = blocksData.find(blockData => blockData.clientId === currentBlockData.rootClientId); } return candidateBlockParents; } /** * Given a list of blocks data and a block index, return the next non-dragged * block. This is used to determine the block that the user is dropping to, * while ignoring the dragged block. * * @param {WPListViewDropZoneBlocks} blocksData Data about the blocks in list view. * @param {number} index The index to begin searching from. * @return {WPListViewDropZoneBlock | undefined} The next non-dragged block. */ function getNextNonDraggedBlock(blocksData, index) { const nextBlockData = blocksData[index + 1]; if (nextBlockData && nextBlockData.isDraggedBlock) { return getNextNonDraggedBlock(blocksData, index + 1); } return nextBlockData; } /** * Determines whether the user positioning the dragged block to nest as an * inner block. * * Determined based on nesting level indentation of the current block, plus * the indentation of the next level of nesting. The vertical position of the * cursor must also be within the block. * * @param {WPPoint} point The point representing the cursor position when dragging. * @param {DOMRect} rect The rectangle. * @param {number} nestingLevel The nesting level of the block. * @param {boolean} rtl Whether the editor is in RTL mode. */ function isNestingGesture(point, rect, nestingLevel = 1, rtl = false) { const blockIndentPosition = rtl ? rect.right - nestingLevel * NESTING_LEVEL_INDENTATION : rect.left + nestingLevel * NESTING_LEVEL_INDENTATION; const isNestingHorizontalGesture = rtl ? point.x < blockIndentPosition - NESTING_LEVEL_INDENTATION : point.x > blockIndentPosition + NESTING_LEVEL_INDENTATION; return isNestingHorizontalGesture && point.y < rect.bottom; } // Block navigation is always a vertical list, so only allow dropping // to the above or below a block. const ALLOWED_DROP_EDGES = ['top', 'bottom']; /** * Given blocks data and the cursor position, compute the drop target. * * @param {WPListViewDropZoneBlocks} blocksData Data about the blocks in list view. * @param {WPPoint} position The point representing the cursor position when dragging. * @param {boolean} rtl Whether the editor is in RTL mode. * * @return {WPListViewDropZoneTarget | undefined} An object containing data about the drop target. */ function getListViewDropTarget(blocksData, position, rtl = false) { let candidateEdge; let candidateBlockData; let candidateDistance; let candidateRect; let candidateBlockIndex; for (let i = 0; i < blocksData.length; i++) { const blockData = blocksData[i]; if (blockData.isDraggedBlock) { continue; } const rect = blockData.element.getBoundingClientRect(); const [distance, edge] = getDistanceToNearestEdge(position, rect, ALLOWED_DROP_EDGES); const isCursorWithinBlock = isPointContainedByRect(position, rect); if (candidateDistance === undefined || distance < candidateDistance || isCursorWithinBlock) { candidateDistance = distance; const index = blocksData.indexOf(blockData); const previousBlockData = blocksData[index - 1]; // If dragging near the top of a block and the preceding block // is at the same level, use the preceding block as the candidate // instead, as later it makes determining a nesting drop easier. if (edge === 'top' && previousBlockData && previousBlockData.rootClientId === blockData.rootClientId && !previousBlockData.isDraggedBlock) { candidateBlockData = previousBlockData; candidateEdge = 'bottom'; candidateRect = previousBlockData.element.getBoundingClientRect(); candidateBlockIndex = index - 1; } else { candidateBlockData = blockData; candidateEdge = edge; candidateRect = rect; candidateBlockIndex = index; } // If the mouse position is within the block, break early // as the user would intend to drop either before or after // this block. // // This solves an issue where some rows in the list view // tree overlap slightly due to sub-pixel rendering. if (isCursorWithinBlock) { break; } } } if (!candidateBlockData) { return; } const candidateBlockParents = getCandidateBlockParents(candidateBlockData, blocksData); const isDraggingBelow = candidateEdge === 'bottom'; // If the user is dragging towards the bottom of the block check whether // they might be trying to nest the block as a child. // If the block already has inner blocks, and is expanded, this should be treated // as nesting since the next block in the tree will be the first child. // However, if the block is collapsed, dragging beneath the block should // still be allowed, as the next visible block in the tree will be a sibling. if (isDraggingBelow && candidateBlockData.canInsertDraggedBlocksAsChild && (candidateBlockData.innerBlockCount > 0 && candidateBlockData.isExpanded || isNestingGesture(position, candidateRect, candidateBlockParents.length, rtl))) { // If the block is expanded, insert the block as the first child. // Otherwise, for collapsed blocks, insert the block as the last child. const newBlockIndex = candidateBlockData.isExpanded ? 0 : candidateBlockData.innerBlockCount || 0; return { rootClientId: candidateBlockData.clientId, clientId: candidateBlockData.clientId, blockIndex: newBlockIndex, dropPosition: 'inside' }; } // If the user is dragging towards the bottom of the block check whether // they might be trying to move the block to be at a parent level. if (isDraggingBelow && candidateBlockData.rootClientId && isUpGesture(position, candidateRect, candidateBlockParents.length, rtl)) { const nextBlock = getNextNonDraggedBlock(blocksData, candidateBlockIndex); const currentLevel = candidateBlockData.nestingLevel; const nextLevel = nextBlock ? nextBlock.nestingLevel : 1; if (currentLevel && nextLevel) { // Determine the desired relative level of the block to be dropped. const desiredRelativeLevel = getDesiredRelativeParentLevel(position, candidateRect, candidateBlockParents.length, rtl); const targetParentIndex = Math.max(Math.min(desiredRelativeLevel, currentLevel - nextLevel), 0); if (candidateBlockParents[targetParentIndex]) { // Default to the block index of the candidate block. let newBlockIndex = candidateBlockData.blockIndex; // If the next block is at the same level, use that as the default // block index. This ensures that the block is dropped in the correct // position when dragging to the bottom of a block. if (candidateBlockParents[targetParentIndex].nestingLevel === nextBlock?.nestingLevel) { newBlockIndex = nextBlock?.blockIndex; } else { // Otherwise, search from the current block index back // to find the last block index within the same target parent. for (let i = candidateBlockIndex; i >= 0; i--) { const blockData = blocksData[i]; if (blockData.rootClientId === candidateBlockParents[targetParentIndex].rootClientId) { newBlockIndex = blockData.blockIndex + 1; break; } } } return { rootClientId: candidateBlockParents[targetParentIndex].rootClientId, clientId: candidateBlockData.clientId, blockIndex: newBlockIndex, dropPosition: candidateEdge }; } } } // If dropping as a sibling, but block cannot be inserted in // this context, return early. if (!candidateBlockData.canInsertDraggedBlocksAsSibling) { return; } const offset = isDraggingBelow ? 1 : 0; return { rootClientId: candidateBlockData.rootClientId, clientId: candidateBlockData.clientId, blockIndex: candidateBlockData.blockIndex + offset, dropPosition: candidateEdge }; } // Throttle options need to be defined outside of the hook to avoid // re-creating the object on every render. This is due to a limitation // of the `useThrottle` hook, where the options object is included // in the dependency array for memoization. const EXPAND_THROTTLE_OPTIONS = { leading: false, // Don't call the function immediately on the first call. trailing: true // Do call the function on the last call. }; /** * A react hook for implementing a drop zone in list view. * * @param {Object} props Named parameters. * @param {?HTMLElement} [props.dropZoneElement] Optional element to be used as the drop zone. * @param {Object} [props.expandedState] The expanded state of the blocks in the list view. * @param {Function} [props.setExpandedState] Function to set the expanded state of a list of block clientIds. * * @return {WPListViewDropZoneTarget} The drop target. */ function useListViewDropZone({ dropZoneElement, expandedState, setExpandedState }) { const { getBlockRootClientId, getBlockIndex, getBlockCount, getDraggedBlockClientIds, canInsertBlocks } = (0,external_wp_data_namespaceObject.useSelect)(store); const [target, setTarget] = (0,external_wp_element_namespaceObject.useState)(); const { rootClientId: targetRootClientId, blockIndex: targetBlockIndex } = target || {}; const onBlockDrop = useOnBlockDrop(targetRootClientId, targetBlockIndex); const rtl = (0,external_wp_i18n_namespaceObject.isRTL)(); const previousRootClientId = (0,external_wp_compose_namespaceObject.usePrevious)(targetRootClientId); const maybeExpandBlock = (0,external_wp_element_namespaceObject.useCallback)((_expandedState, _target) => { // If the user is attempting to drop a block inside a collapsed block, // that is, using a nesting gesture flagged by 'inside' dropPosition, // expand the block within the list view, if it isn't already. const { rootClientId } = _target || {}; if (!rootClientId) { return; } if (_target?.dropPosition === 'inside' && !_expandedState[rootClientId]) { setExpandedState({ type: 'expand', clientIds: [rootClientId] }); } }, [setExpandedState]); // Throttle the maybeExpandBlock function to avoid expanding the block // too quickly when the user is dragging over the block. This is to // avoid expanding the block when the user is just passing over it. const throttledMaybeExpandBlock = (0,external_wp_compose_namespaceObject.useThrottle)(maybeExpandBlock, 500, EXPAND_THROTTLE_OPTIONS); (0,external_wp_element_namespaceObject.useEffect)(() => { if (target?.dropPosition !== 'inside' || previousRootClientId !== target?.rootClientId) { throttledMaybeExpandBlock.cancel(); return; } throttledMaybeExpandBlock(expandedState, target); }, [expandedState, previousRootClientId, target, throttledMaybeExpandBlock]); const draggedBlockClientIds = getDraggedBlockClientIds(); const throttled = (0,external_wp_compose_namespaceObject.useThrottle)((0,external_wp_element_namespaceObject.useCallback)((event, currentTarget) => { const position = { x: event.clientX, y: event.clientY }; const isBlockDrag = !!draggedBlockClientIds?.length; const blockElements = Array.from(currentTarget.querySelectorAll('[data-block]')); const blocksData = blockElements.map(blockElement => { const clientId = blockElement.dataset.block; const isExpanded = blockElement.dataset.expanded === 'true'; const isDraggedBlock = blockElement.classList.contains('is-dragging'); // Get nesting level from `aria-level` attribute because Firefox does not support `element.ariaLevel`. const nestingLevel = parseInt(blockElement.getAttribute('aria-level'), 10); const rootClientId = getBlockRootClientId(clientId); return { clientId, isExpanded, rootClientId, blockIndex: getBlockIndex(clientId), element: blockElement, nestingLevel: nestingLevel || undefined, isDraggedBlock: isBlockDrag ? isDraggedBlock : false, innerBlockCount: getBlockCount(clientId), canInsertDraggedBlocksAsSibling: isBlockDrag ? canInsertBlocks(draggedBlockClientIds, rootClientId) : true, canInsertDraggedBlocksAsChild: isBlockDrag ? canInsertBlocks(draggedBlockClientIds, clientId) : true }; }); const newTarget = getListViewDropTarget(blocksData, position, rtl); if (newTarget) { setTarget(newTarget); } }, [canInsertBlocks, draggedBlockClientIds, getBlockCount, getBlockIndex, getBlockRootClientId, rtl]), 50); const ref = (0,external_wp_compose_namespaceObject.__experimentalUseDropZone)({ dropZoneElement, onDrop(event) { throttled.cancel(); if (target) { onBlockDrop(event); } // Use `undefined` value to indicate that the drag has concluded. // This allows styling rules that are active only when a user is // dragging to be removed. setTarget(undefined); }, onDragLeave() { throttled.cancel(); // Use `null` value to indicate that the drop target is not valid, // but that the drag is still active. This allows for styling rules // that are active only when a user drags outside of the list view. setTarget(null); }, onDragOver(event) { // `currentTarget` is only available while the event is being // handled, so get it now and pass it to the thottled function. // https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget throttled(event, event.currentTarget); }, onDragEnd() { throttled.cancel(); // Use `undefined` value to indicate that the drag has concluded. // This allows styling rules that are active only when a user is // dragging to be removed. setTarget(undefined); } }); return { ref, target }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-list-view-expand-selected-item.js /** * WordPress dependencies */ /** * Internal dependencies */ function useListViewExpandSelectedItem({ firstSelectedBlockClientId, setExpandedState }) { const [selectedTreeId, setSelectedTreeId] = (0,external_wp_element_namespaceObject.useState)(null); const { selectedBlockParentClientIds } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockParents } = select(store); return { selectedBlockParentClientIds: getBlockParents(firstSelectedBlockClientId, false) }; }, [firstSelectedBlockClientId]); // Expand tree when a block is selected. (0,external_wp_element_namespaceObject.useEffect)(() => { // If the selectedTreeId is the same as the selected block, // it means that the block was selected using the block list tree. if (selectedTreeId === firstSelectedBlockClientId) { return; } // If the selected block has parents, get the top-level parent. if (selectedBlockParentClientIds?.length) { // If the selected block has parents, // expand the tree branch. setExpandedState({ type: 'expand', clientIds: selectedBlockParentClientIds }); } }, [firstSelectedBlockClientId, selectedBlockParentClientIds, selectedTreeId, setExpandedState]); return { setSelectedTreeId }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/use-clipboard-handler.js /** * WordPress dependencies */ /** * Internal dependencies */ // This hook borrows from useClipboardHandler in ../writing-flow/use-clipboard-handler.js // and adds behaviour for the list view, while skipping partial selection. function use_clipboard_handler_useClipboardHandler({ selectBlock }) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { getBlockOrder, getBlockRootClientId, getBlocksByClientId, getPreviousBlockClientId, getSelectedBlockClientIds, getSettings, canInsertBlockType, canRemoveBlocks } = (0,external_wp_data_namespaceObject.useSelect)(store); const { flashBlock, removeBlocks, replaceBlocks, insertBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(store); const notifyCopy = useNotifyCopy(); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { function updateFocusAndSelection(focusClientId, shouldSelectBlock) { if (shouldSelectBlock) { selectBlock(undefined, focusClientId, null, null); } focusListItem(focusClientId, node); } // Determine which blocks to update: // If the current (focused) block is part of the block selection, use the whole selection. // If the focused block is not part of the block selection, only update the focused block. function getBlocksToUpdate(clientId) { const selectedBlockClientIds = getSelectedBlockClientIds(); const isUpdatingSelectedBlocks = selectedBlockClientIds.includes(clientId); const firstBlockClientId = isUpdatingSelectedBlocks ? selectedBlockClientIds[0] : clientId; const firstBlockRootClientId = getBlockRootClientId(firstBlockClientId); const blocksToUpdate = isUpdatingSelectedBlocks ? selectedBlockClientIds : [clientId]; return { blocksToUpdate, firstBlockClientId, firstBlockRootClientId, originallySelectedBlockClientIds: selectedBlockClientIds }; } function handler(event) { if (event.defaultPrevented) { // This was possibly already handled in rich-text/use-paste-handler.js. return; } // Only handle events that occur within the list view. if (!node.contains(event.target.ownerDocument.activeElement)) { return; } // Retrieve the block clientId associated with the focused list view row. // This enables applying copy / cut / paste behavior to the focused block, // rather than just the blocks that are currently selected. const listViewRow = event.target.ownerDocument.activeElement?.closest('[role=row]'); const clientId = listViewRow?.dataset?.block; if (!clientId) { return; } const { blocksToUpdate: selectedBlockClientIds, firstBlockClientId, firstBlockRootClientId, originallySelectedBlockClientIds } = getBlocksToUpdate(clientId); if (selectedBlockClientIds.length === 0) { return; } event.preventDefault(); if (event.type === 'copy' || event.type === 'cut') { if (selectedBlockClientIds.length === 1) { flashBlock(selectedBlockClientIds[0]); } notifyCopy(event.type, selectedBlockClientIds); const blocks = getBlocksByClientId(selectedBlockClientIds); setClipboardBlocks(event, blocks, registry); } if (event.type === 'cut') { var _getPreviousBlockClie; // Don't update the selection if the blocks cannot be deleted. if (!canRemoveBlocks(selectedBlockClientIds)) { return; } let blockToFocus = (_getPreviousBlockClie = getPreviousBlockClientId(firstBlockClientId)) !== null && _getPreviousBlockClie !== void 0 ? _getPreviousBlockClie : // If the previous block is not found (when the first block is deleted), // fallback to focus the parent block. firstBlockRootClientId; // Remove blocks, but don't update selection, and it will be handled below. removeBlocks(selectedBlockClientIds, false); // Update the selection if the original selection has been removed. const shouldUpdateSelection = originallySelectedBlockClientIds.length > 0 && getSelectedBlockClientIds().length === 0; // If there's no previous block nor parent block, focus the first block. if (!blockToFocus) { blockToFocus = getBlockOrder()[0]; } updateFocusAndSelection(blockToFocus, shouldUpdateSelection); } else if (event.type === 'paste') { const { __experimentalCanUserUseUnfilteredHTML: canUserUseUnfilteredHTML } = getSettings(); const blocks = getPasteBlocks(event, canUserUseUnfilteredHTML); if (selectedBlockClientIds.length === 1) { const [selectedBlockClientId] = selectedBlockClientIds; // If a single block is focused, and the blocks to be posted can // be inserted within the block, then append the pasted blocks // within the focused block. For example, if you have copied a paragraph // block and paste it within a single Group block, this will append // the paragraph block within the Group block. if (blocks.every(block => canInsertBlockType(block.name, selectedBlockClientId))) { insertBlocks(blocks, undefined, selectedBlockClientId); updateFocusAndSelection(blocks[0]?.clientId, false); return; } } replaceBlocks(selectedBlockClientIds, blocks, blocks.length - 1, -1); updateFocusAndSelection(blocks[0]?.clientId, false); } } node.ownerDocument.addEventListener('copy', handler); node.ownerDocument.addEventListener('cut', handler); node.ownerDocument.addEventListener('paste', handler); return () => { node.ownerDocument.removeEventListener('copy', handler); node.ownerDocument.removeEventListener('cut', handler); node.ownerDocument.removeEventListener('paste', handler); }; }, []); } ;// ./node_modules/@wordpress/block-editor/build-module/components/list-view/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const expanded = (state, action) => { if (action.type === 'clear') { return {}; } if (Array.isArray(action.clientIds)) { return { ...state, ...action.clientIds.reduce((newState, id) => ({ ...newState, [id]: action.type === 'expand' }), {}) }; } return state; }; const BLOCK_LIST_ITEM_HEIGHT = 32; /** @typedef {import('react').ComponentType} ComponentType */ /** @typedef {import('react').Ref<HTMLElement>} Ref */ /** * Show a hierarchical list of blocks. * * @param {Object} props Components props. * @param {string} props.id An HTML element id for the root element of ListView. * @param {Array} props.blocks _deprecated_ Custom subset of block client IDs to be used instead of the default hierarchy. * @param {?HTMLElement} props.dropZoneElement Optional element to be used as the drop zone. * @param {?boolean} props.showBlockMovers Flag to enable block movers. Defaults to `false`. * @param {?boolean} props.isExpanded Flag to determine whether nested levels are expanded by default. Defaults to `false`. * @param {?boolean} props.showAppender Flag to show or hide the block appender. Defaults to `false`. * @param {?ComponentType} props.blockSettingsMenu Optional more menu substitution. Defaults to the standard `BlockSettingsDropdown` component. * @param {string} props.rootClientId The client id of the root block from which we determine the blocks to show in the list. * @param {string} props.description Optional accessible description for the tree grid component. * @param {?Function} props.onSelect Optional callback to be invoked when a block is selected. Receives the block object that was selected. * @param {?ComponentType} props.additionalBlockContent Component that renders additional block content UI. * @param {Ref} ref Forwarded ref */ function ListViewComponent({ id, blocks, dropZoneElement, showBlockMovers = false, isExpanded = false, showAppender = false, blockSettingsMenu: BlockSettingsMenu = BlockSettingsDropdown, rootClientId, description, onSelect, additionalBlockContent: AdditionalBlockContent }, ref) { // This can be removed once we no longer need to support the blocks prop. if (blocks) { external_wp_deprecated_default()('`blocks` property in `wp.blockEditor.__experimentalListView`', { since: '6.3', alternative: '`rootClientId` property' }); } const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ListViewComponent); const { clientIdsTree, draggedClientIds, selectedClientIds } = useListViewClientIds({ blocks, rootClientId }); const blockIndexes = useListViewBlockIndexes(clientIdsTree); const { getBlock } = (0,external_wp_data_namespaceObject.useSelect)(store); const { visibleBlockCount } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getGlobalBlockCount, getClientIdsOfDescendants } = select(store); const draggedBlockCount = draggedClientIds?.length > 0 ? getClientIdsOfDescendants(draggedClientIds).length + 1 : 0; return { visibleBlockCount: getGlobalBlockCount() - draggedBlockCount }; }, [draggedClientIds]); const { updateBlockSelection } = useBlockSelection(); const [expandedState, setExpandedState] = (0,external_wp_element_namespaceObject.useReducer)(expanded, {}); const [insertedBlock, setInsertedBlock] = (0,external_wp_element_namespaceObject.useState)(null); const { setSelectedTreeId } = useListViewExpandSelectedItem({ firstSelectedBlockClientId: selectedClientIds[0], setExpandedState }); const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)( /** * @param {MouseEvent | KeyboardEvent | undefined} event * @param {string} blockClientId * @param {null | undefined | -1 | 1} focusPosition */ (event, blockClientId, focusPosition) => { updateBlockSelection(event, blockClientId, null, focusPosition); setSelectedTreeId(blockClientId); if (onSelect) { onSelect(getBlock(blockClientId)); } }, [setSelectedTreeId, updateBlockSelection, onSelect, getBlock]); const { ref: dropZoneRef, target: blockDropTarget } = useListViewDropZone({ dropZoneElement, expandedState, setExpandedState }); const elementRef = (0,external_wp_element_namespaceObject.useRef)(); // Allow handling of copy, cut, and paste events. const clipBoardRef = use_clipboard_handler_useClipboardHandler({ selectBlock: selectEditorBlock }); const treeGridRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([clipBoardRef, elementRef, dropZoneRef, ref]); (0,external_wp_element_namespaceObject.useEffect)(() => { // If a blocks are already selected when the list view is initially // mounted, shift focus to the first selected block. if (selectedClientIds?.length) { focusListItem(selectedClientIds[0], elementRef?.current); } // Only focus on the selected item when the list view is mounted. }, []); const expand = (0,external_wp_element_namespaceObject.useCallback)(clientId => { if (!clientId) { return; } const clientIds = Array.isArray(clientId) ? clientId : [clientId]; setExpandedState({ type: 'expand', clientIds }); }, [setExpandedState]); const collapse = (0,external_wp_element_namespaceObject.useCallback)(clientId => { if (!clientId) { return; } setExpandedState({ type: 'collapse', clientIds: [clientId] }); }, [setExpandedState]); const collapseAll = (0,external_wp_element_namespaceObject.useCallback)(() => { setExpandedState({ type: 'clear' }); }, [setExpandedState]); const expandRow = (0,external_wp_element_namespaceObject.useCallback)(row => { expand(row?.dataset?.block); }, [expand]); const collapseRow = (0,external_wp_element_namespaceObject.useCallback)(row => { collapse(row?.dataset?.block); }, [collapse]); const focusRow = (0,external_wp_element_namespaceObject.useCallback)((event, startRow, endRow) => { if (event.shiftKey) { updateBlockSelection(event, startRow?.dataset?.block, endRow?.dataset?.block); } }, [updateBlockSelection]); useListViewCollapseItems({ collapseAll, expand }); const firstDraggedBlockClientId = draggedClientIds?.[0]; // Convert a blockDropTarget into indexes relative to the blocks in the list view. // These values are used to determine which blocks should be displaced to make room // for the drop indicator. See `ListViewBranch` and `getDragDisplacementValues`. const { blockDropTargetIndex, blockDropPosition, firstDraggedBlockIndex } = (0,external_wp_element_namespaceObject.useMemo)(() => { let _blockDropTargetIndex, _firstDraggedBlockIndex; if (blockDropTarget?.clientId) { const foundBlockIndex = blockIndexes[blockDropTarget.clientId]; // If dragging below or inside the block, treat the drop target as the next block. _blockDropTargetIndex = foundBlockIndex === undefined || blockDropTarget?.dropPosition === 'top' ? foundBlockIndex : foundBlockIndex + 1; } else if (blockDropTarget === null) { // A `null` value is used to indicate that the user is dragging outside of the list view. _blockDropTargetIndex = null; } if (firstDraggedBlockClientId) { const foundBlockIndex = blockIndexes[firstDraggedBlockClientId]; _firstDraggedBlockIndex = foundBlockIndex === undefined || blockDropTarget?.dropPosition === 'top' ? foundBlockIndex : foundBlockIndex + 1; } return { blockDropTargetIndex: _blockDropTargetIndex, blockDropPosition: blockDropTarget?.dropPosition, firstDraggedBlockIndex: _firstDraggedBlockIndex }; }, [blockDropTarget, blockIndexes, firstDraggedBlockClientId]); const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ blockDropPosition, blockDropTargetIndex, blockIndexes, draggedClientIds, expandedState, expand, firstDraggedBlockIndex, collapse, collapseAll, BlockSettingsMenu, listViewInstanceId: instanceId, AdditionalBlockContent, insertedBlock, setInsertedBlock, treeGridElementRef: elementRef, rootClientId }), [blockDropPosition, blockDropTargetIndex, blockIndexes, draggedClientIds, expandedState, expand, firstDraggedBlockIndex, collapse, collapseAll, BlockSettingsMenu, instanceId, AdditionalBlockContent, insertedBlock, setInsertedBlock, rootClientId]); // List View renders a fixed number of items and relies on each having a fixed item height of 36px. // If this value changes, we should also change the itemHeight value set in useFixedWindowList. // See: https://github.com/WordPress/gutenberg/pull/35230 for additional context. const [fixedListWindow] = (0,external_wp_compose_namespaceObject.__experimentalUseFixedWindowList)(elementRef, BLOCK_LIST_ITEM_HEIGHT, visibleBlockCount, { // Ensure that the windowing logic is recalculated when the expanded state changes. // This is necessary because expanding a collapsed block in a short list view can // switch the list view to a tall list view with a scrollbar, and vice versa. // When this happens, the windowing logic needs to be recalculated to ensure that // the correct number of blocks are rendered, by rechecking for a scroll container. expandedState, useWindowing: true, windowOverscan: 40 }); // If there are no blocks to show and we're not showing the appender, do not render the list view. if (!clientIdsTree.length && !showAppender) { return null; } const describedById = description && `block-editor-list-view-description-${instanceId}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_data_namespaceObject.AsyncModeProvider, { value: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewDropIndicatorPreview, { draggedBlockClientId: firstDraggedBlockClientId, listViewRef: elementRef, blockDropTarget: blockDropTarget }), description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: describedById, children: description }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTreeGrid, { id: id, className: dist_clsx('block-editor-list-view-tree', { 'is-dragging': draggedClientIds?.length > 0 && blockDropTargetIndex !== undefined }), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block navigation structure'), ref: treeGridRef, onCollapseRow: collapseRow, onExpandRow: expandRow, onFocusRow: focusRow, applicationAriaLabel: (0,external_wp_i18n_namespaceObject.__)('Block navigation structure'), "aria-describedby": describedById, style: { '--wp-admin--list-view-dragged-items-height': draggedClientIds?.length ? `${BLOCK_LIST_ITEM_HEIGHT * (draggedClientIds.length - 1)}px` : null }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ListViewContext.Provider, { value: contextValue, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(branch, { blocks: clientIdsTree, parentId: rootClientId, selectBlock: selectEditorBlock, showBlockMovers: showBlockMovers, fixedListWindow: fixedListWindow, selectedClientIds: selectedClientIds, isExpanded: isExpanded, showAppender: showAppender }) }) })] }); } // This is the private API for the ListView component. // It allows access to all props, not just the public ones. const PrivateListView = (0,external_wp_element_namespaceObject.forwardRef)(ListViewComponent); // This is the public API for the ListView component. // We wrap the PrivateListView component to hide some props from the public API. /* harmony default export */ const components_list_view = ((0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateListView, { ref: ref, ...props, showAppender: false, rootClientId: null, onSelect: null, additionalBlockContent: null, blockSettingsMenu: undefined }); })); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-navigation/dropdown.js /** * WordPress dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function BlockNavigationDropdownToggle({ isEnabled, onToggle, isOpen, innerRef, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ...props, ref: innerRef, icon: list_view, "aria-expanded": isOpen, "aria-haspopup": "true", onClick: isEnabled ? onToggle : undefined /* translators: button label text should, if possible, be under 16 characters. */, label: (0,external_wp_i18n_namespaceObject.__)('List view'), className: "block-editor-block-navigation", "aria-disabled": !isEnabled }); } function BlockNavigationDropdown({ isDisabled, ...props }, ref) { external_wp_deprecated_default()('wp.blockEditor.BlockNavigationDropdown', { since: '6.1', alternative: 'wp.components.Dropdown and wp.blockEditor.ListView' }); const hasBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(store).getBlockCount(), []); const isEnabled = hasBlocks && !isDisabled; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { contentClassName: "block-editor-block-navigation__popover", popoverProps: { placement: 'bottom-start' }, renderToggle: ({ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockNavigationDropdownToggle, { ...props, innerRef: ref, isOpen: isOpen, onToggle: onToggle, isEnabled: isEnabled }), renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-navigation__container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-block-navigation__label", children: (0,external_wp_i18n_namespaceObject.__)('List view') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(components_list_view, {})] }) }); } /* harmony default export */ const dropdown = ((0,external_wp_element_namespaceObject.forwardRef)(BlockNavigationDropdown)); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-styles/preview-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockStylesPreviewPanel({ genericPreviewBlock, style, className, activeStyle }) { const example = (0,external_wp_blocks_namespaceObject.getBlockType)(genericPreviewBlock.name)?.example; const styleClassName = replaceActiveStyle(className, activeStyle, style); const previewBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => { return { ...genericPreviewBlock, title: style.label || style.name, description: style.description, initialAttributes: { ...genericPreviewBlock.attributes, className: styleClassName + ' block-editor-block-styles__block-preview-container' }, example }; }, [genericPreviewBlock, styleClassName]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(preview_panel, { item: previewBlocks }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-styles/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const block_styles_noop = () => {}; // Block Styles component for the Settings Sidebar. function BlockStyles({ clientId, onSwitch = block_styles_noop, onHoverClassName = block_styles_noop }) { const { onSelect, stylesToRender, activeStyle, genericPreviewBlock, className: previewClassName } = useStylesForBlocks({ clientId, onSwitch }); const [hoveredStyle, setHoveredStyle] = (0,external_wp_element_namespaceObject.useState)(null); const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); if (!stylesToRender || stylesToRender.length === 0) { return null; } const debouncedSetHoveredStyle = (0,external_wp_compose_namespaceObject.debounce)(setHoveredStyle, 250); const onSelectStylePreview = style => { onSelect(style); onHoverClassName(null); setHoveredStyle(null); debouncedSetHoveredStyle.cancel(); }; const styleItemHandler = item => { var _item$name; if (hoveredStyle === item) { debouncedSetHoveredStyle.cancel(); return; } debouncedSetHoveredStyle(item); onHoverClassName((_item$name = item?.name) !== null && _item$name !== void 0 ? _item$name : null); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-styles", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-styles__variants", children: stylesToRender.map(style => { const buttonText = style.label || style.name; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: dist_clsx('block-editor-block-styles__item', { 'is-active': activeStyle.name === style.name }), variant: "secondary", label: buttonText, onMouseEnter: () => styleItemHandler(style), onFocus: () => styleItemHandler(style), onMouseLeave: () => styleItemHandler(null), onBlur: () => styleItemHandler(null), onClick: () => onSelectStylePreview(style), "aria-current": activeStyle.name === style.name, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 1, className: "block-editor-block-styles__item-text", children: buttonText }) }, style.name); }) }), hoveredStyle && !isMobileViewport && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { placement: "left-start", offset: 34, focusOnMount: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-styles__preview-panel", onMouseLeave: () => styleItemHandler(null), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockStylesPreviewPanel, { activeStyle: activeStyle, className: previewClassName, genericPreviewBlock: genericPreviewBlock, style: hoveredStyle }) }) })] }); } /* harmony default export */ const block_styles = (BlockStyles); ;// ./node_modules/@wordpress/icons/build-module/library/paragraph.js /** * WordPress dependencies */ const paragraph = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z" }) }); /* harmony default export */ const library_paragraph = (paragraph); ;// ./node_modules/@wordpress/icons/build-module/library/heading-level-1.js /** * WordPress dependencies */ const headingLevel1 = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z" }) }); /* harmony default export */ const heading_level_1 = (headingLevel1); ;// ./node_modules/@wordpress/icons/build-module/library/heading-level-2.js /** * WordPress dependencies */ const headingLevel2 = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z" }) }); /* harmony default export */ const heading_level_2 = (headingLevel2); ;// ./node_modules/@wordpress/icons/build-module/library/heading-level-3.js /** * WordPress dependencies */ const headingLevel3 = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z" }) }); /* harmony default export */ const heading_level_3 = (headingLevel3); ;// ./node_modules/@wordpress/icons/build-module/library/heading-level-4.js /** * WordPress dependencies */ const headingLevel4 = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z" }) }); /* harmony default export */ const heading_level_4 = (headingLevel4); ;// ./node_modules/@wordpress/icons/build-module/library/heading-level-5.js /** * WordPress dependencies */ const headingLevel5 = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z" }) }); /* harmony default export */ const heading_level_5 = (headingLevel5); ;// ./node_modules/@wordpress/icons/build-module/library/heading-level-6.js /** * WordPress dependencies */ const headingLevel6 = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z" }) }); /* harmony default export */ const heading_level_6 = (headingLevel6); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-heading-level-dropdown/heading-level-icon.js /** * WordPress dependencies */ /** @typedef {import('react').ComponentType} ComponentType */ /** * HeadingLevelIcon props. * * @typedef WPHeadingLevelIconProps * * @property {number} level The heading level to show an icon for. */ const LEVEL_TO_PATH = { 0: library_paragraph, 1: heading_level_1, 2: heading_level_2, 3: heading_level_3, 4: heading_level_4, 5: heading_level_5, 6: heading_level_6 }; /** * Heading level icon. * * @param {WPHeadingLevelIconProps} props Component props. * * @return {?ComponentType} The icon. */ function HeadingLevelIcon({ level }) { if (LEVEL_TO_PATH[level]) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: LEVEL_TO_PATH[level] }); } return null; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-heading-level-dropdown/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const HEADING_LEVELS = [1, 2, 3, 4, 5, 6]; const block_heading_level_dropdown_POPOVER_PROPS = { className: 'block-library-heading-level-dropdown' }; /** @typedef {import('react').ComponentType} ComponentType */ /** * HeadingLevelDropdown props. * * @typedef WPHeadingLevelDropdownProps * * @property {number} value The chosen heading level. * @property {number[]} options An array of supported heading levels. * @property {()=>number} onChange Function called with * the selected value changes. */ /** * Dropdown for selecting a heading level (1 through 6) or paragraph (0). * * @param {WPHeadingLevelDropdownProps} props Component props. * * @return {ComponentType} The toolbar. */ function HeadingLevelDropdown({ options = HEADING_LEVELS, value, onChange }) { const validOptions = options.filter(option => option === 0 || HEADING_LEVELS.includes(option)).sort((a, b) => a - b); // Sorts numerically in ascending order; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { popoverProps: block_heading_level_dropdown_POPOVER_PROPS, icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingLevelIcon, { level: value }), label: (0,external_wp_i18n_namespaceObject.__)('Change level'), controls: validOptions.map(targetLevel => { const isActive = targetLevel === value; return { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingLevelIcon, { level: targetLevel }), title: targetLevel === 0 ? (0,external_wp_i18n_namespaceObject.__)('Paragraph') : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: heading level e.g: "1", "2", "3" (0,external_wp_i18n_namespaceObject.__)('Heading %d'), targetLevel), isActive, onClick() { onChange(targetLevel); }, role: 'menuitemradio' }; }) }); } ;// ./node_modules/@wordpress/icons/build-module/library/layout.js /** * WordPress dependencies */ const layout_layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); /* harmony default export */ const library_layout = (layout_layout); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-variation-picker/index.js /** * External dependencies */ /** * WordPress dependencies */ function BlockVariationPicker({ icon = library_layout, label = (0,external_wp_i18n_namespaceObject.__)('Choose variation'), instructions = (0,external_wp_i18n_namespaceObject.__)('Select a variation to start with:'), variations, onSelect, allowSkip }) { const classes = dist_clsx('block-editor-block-variation-picker', { 'has-many-variations': variations.length > 4 }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { icon: icon, label: label, instructions: instructions, className: classes, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "block-editor-block-variation-picker__variations", role: "list", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block variations'), children: variations.map(variation => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", icon: variation.icon && variation.icon.src ? variation.icon.src : variation.icon, iconSize: 48, onClick: () => onSelect(variation), className: "block-editor-block-variation-picker__variation", label: variation.description || variation.title }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-variation-picker__variation-label", children: variation.title })] }, variation.name)) }), allowSkip && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-variation-picker__skip", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "link", onClick: () => onSelect(), children: (0,external_wp_i18n_namespaceObject.__)('Skip') }) })] }); } /* harmony default export */ const block_variation_picker = (BlockVariationPicker); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/constants.js const VIEWMODES = { carousel: 'carousel', grid: 'grid' }; ;// ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/setup-toolbar.js /** * WordPress dependencies */ /** * Internal dependencies */ const Actions = ({ onBlockPatternSelect }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-pattern-setup__actions", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", onClick: onBlockPatternSelect, children: (0,external_wp_i18n_namespaceObject.__)('Choose') }) }); const CarouselNavigation = ({ handlePrevious, handleNext, activeSlide, totalSlides }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-pattern-setup__navigation", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left, label: (0,external_wp_i18n_namespaceObject.__)('Previous pattern'), onClick: handlePrevious, disabled: activeSlide === 0, accessibleWhenDisabled: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_left : chevron_right, label: (0,external_wp_i18n_namespaceObject.__)('Next pattern'), onClick: handleNext, disabled: activeSlide === totalSlides - 1, accessibleWhenDisabled: true })] }); const SetupToolbar = ({ viewMode, setViewMode, handlePrevious, handleNext, activeSlide, totalSlides, onBlockPatternSelect }) => { const isCarouselView = viewMode === VIEWMODES.carousel; const displayControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-pattern-setup__display-controls", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", icon: stretch_full_width, label: (0,external_wp_i18n_namespaceObject.__)('Carousel view'), onClick: () => setViewMode(VIEWMODES.carousel), isPressed: isCarouselView }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", icon: library_grid, label: (0,external_wp_i18n_namespaceObject.__)('Grid view'), onClick: () => setViewMode(VIEWMODES.grid), isPressed: viewMode === VIEWMODES.grid })] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-pattern-setup__toolbar", children: [isCarouselView && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CarouselNavigation, { handlePrevious: handlePrevious, handleNext: handleNext, activeSlide: activeSlide, totalSlides: totalSlides }), displayControls, isCarouselView && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Actions, { onBlockPatternSelect: onBlockPatternSelect })] }); }; /* harmony default export */ const setup_toolbar = (SetupToolbar); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/use-patterns-setup.js /** * WordPress dependencies */ /** * Internal dependencies */ function usePatternsSetup(clientId, blockName, filterPatternsFn) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId, getPatternsByBlockTypes, __experimentalGetAllowedPatterns } = select(store); const rootClientId = getBlockRootClientId(clientId); if (filterPatternsFn) { return __experimentalGetAllowedPatterns(rootClientId).filter(filterPatternsFn); } return getPatternsByBlockTypes(blockName, rootClientId); }, [clientId, blockName, filterPatternsFn]); } /* harmony default export */ const use_patterns_setup = (usePatternsSetup); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-pattern-setup/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const SetupContent = ({ viewMode, activeSlide, patterns, onBlockPatternSelect, showTitles }) => { const containerClass = 'block-editor-block-pattern-setup__container'; if (viewMode === VIEWMODES.carousel) { const slideClass = new Map([[activeSlide, 'active-slide'], [activeSlide - 1, 'previous-slide'], [activeSlide + 1, 'next-slide']]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-pattern-setup__carousel", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: containerClass, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "carousel-container", children: patterns.map((pattern, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockPatternSlide, { active: index === activeSlide, className: slideClass.get(index) || '', pattern: pattern }, pattern.name)) }) }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-pattern-setup__grid", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Composite, { role: "listbox", className: containerClass, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Patterns list'), children: patterns.map(pattern => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_pattern_setup_BlockPattern, { pattern: pattern, onSelect: onBlockPatternSelect, showTitles: showTitles }, pattern.name)) }) }); }; function block_pattern_setup_BlockPattern({ pattern, onSelect, showTitles }) { const baseClassName = 'block-editor-block-pattern-setup-list'; const { blocks, description, viewportWidth = 700 } = pattern; const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(block_pattern_setup_BlockPattern, `${baseClassName}__item-description`); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${baseClassName}__list-item`, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Composite.Item, { render: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { "aria-describedby": description ? descriptionId : undefined, "aria-label": pattern.title, className: `${baseClassName}__item` }), id: `${baseClassName}__pattern__${pattern.name}`, role: "option", onClick: () => onSelect(blocks), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview, { blocks: blocks, viewportWidth: viewportWidth }), showTitles && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${baseClassName}__item-title`, children: pattern.title }), !!description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: description })] }) }); } function BlockPatternSlide({ active, className, pattern, minHeight }) { const { blocks, title, description } = pattern; const descriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockPatternSlide, 'block-editor-block-pattern-setup-list__item-description'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { "aria-hidden": !active, role: "img", className: `pattern-slide ${className}`, "aria-label": title, "aria-describedby": description ? descriptionId : undefined, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_preview, { blocks: blocks, minHeight: minHeight }), !!description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: descriptionId, children: description })] }); } const BlockPatternSetup = ({ clientId, blockName, filterPatternsFn, onBlockPatternSelect, initialViewMode = VIEWMODES.carousel, showTitles = false }) => { const [viewMode, setViewMode] = (0,external_wp_element_namespaceObject.useState)(initialViewMode); const [activeSlide, setActiveSlide] = (0,external_wp_element_namespaceObject.useState)(0); const { replaceBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); const patterns = use_patterns_setup(clientId, blockName, filterPatternsFn); if (!patterns?.length) { return null; } const onBlockPatternSelectDefault = blocks => { const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)); replaceBlock(clientId, clonedBlocks); }; const onPatternSelectCallback = onBlockPatternSelect || onBlockPatternSelectDefault; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: `block-editor-block-pattern-setup view-mode-${viewMode}`, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SetupContent, { viewMode: viewMode, activeSlide: activeSlide, patterns: patterns, onBlockPatternSelect: onPatternSelectCallback, showTitles: showTitles }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(setup_toolbar, { viewMode: viewMode, setViewMode: setViewMode, activeSlide: activeSlide, totalSlides: patterns.length, handleNext: () => { setActiveSlide(active => Math.min(active + 1, patterns.length - 1)); }, handlePrevious: () => { setActiveSlide(active => Math.max(active - 1, 0)); }, onBlockPatternSelect: () => { onPatternSelectCallback(patterns[activeSlide].blocks); } })] }) }); }; /* harmony default export */ const block_pattern_setup = (BlockPatternSetup); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-variation-transforms/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function VariationsButtons({ className, onSelectVariation, selectedValue, variations }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: className, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)('Transform to variation') }), variations.map(variation => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, size: "compact", icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: variation.icon, showColors: true }), isPressed: selectedValue === variation.name, label: selectedValue === variation.name ? variation.title : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Block or block variation name. */ (0,external_wp_i18n_namespaceObject.__)('Transform to %s'), variation.title), onClick: () => onSelectVariation(variation.name), "aria-label": variation.title, showTooltip: true }, variation.name))] }); } function VariationsDropdown({ className, onSelectVariation, selectedValue, variations }) { const selectOptions = variations.map(({ name, title, description }) => ({ value: name, label: title, info: description })); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { className: className, label: (0,external_wp_i18n_namespaceObject.__)('Transform to variation'), text: (0,external_wp_i18n_namespaceObject.__)('Transform to variation'), popoverProps: { position: 'bottom center', className: `${className}__popover` }, icon: chevron_down, toggleProps: { iconPosition: 'right' }, children: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `${className}__container`, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, { choices: selectOptions, value: selectedValue, onSelect: onSelectVariation }) }) }) }); } function VariationsToggleGroupControl({ className, onSelectVariation, selectedValue, variations }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: className, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { label: (0,external_wp_i18n_namespaceObject.__)('Transform to variation'), value: selectedValue, hideLabelFromVision: true, onChange: onSelectVariation, __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, children: variations.map(variation => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: variation.icon, showColors: true }), value: variation.name, label: selectedValue === variation.name ? variation.title : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Block or block variation name. */ (0,external_wp_i18n_namespaceObject.__)('Transform to %s'), variation.title) }, variation.name)) }) }); } function __experimentalBlockVariationTransforms({ blockClientId }) { const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); const { activeBlockVariation, variations, isContentOnly } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getActiveBlockVariation, getBlockVariations } = select(external_wp_blocks_namespaceObject.store); const { getBlockName, getBlockAttributes, getBlockEditingMode } = select(store); const name = blockClientId && getBlockName(blockClientId); const { hasContentRoleAttribute } = unlock(select(external_wp_blocks_namespaceObject.store)); const isContentBlock = hasContentRoleAttribute(name); return { activeBlockVariation: getActiveBlockVariation(name, getBlockAttributes(blockClientId)), variations: name && getBlockVariations(name, 'transform'), isContentOnly: getBlockEditingMode(blockClientId) === 'contentOnly' && !isContentBlock }; }, [blockClientId]); const selectedValue = activeBlockVariation?.name; // Check if each variation has a unique icon. const hasUniqueIcons = (0,external_wp_element_namespaceObject.useMemo)(() => { const variationIcons = new Set(); if (!variations) { return false; } variations.forEach(variation => { if (variation.icon) { variationIcons.add(variation.icon?.src || variation.icon); } }); return variationIcons.size === variations.length; }, [variations]); const onSelectVariation = variationName => { updateBlockAttributes(blockClientId, { ...variations.find(({ name }) => name === variationName).attributes }); }; if (!variations?.length || isContentOnly) { return null; } const baseClass = 'block-editor-block-variation-transforms'; // Show buttons if there are more than 5 variations because the ToggleGroupControl does not wrap const showButtons = variations.length > 5; const ButtonComponent = showButtons ? VariationsButtons : VariationsToggleGroupControl; const Component = hasUniqueIcons ? ButtonComponent : VariationsDropdown; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { className: baseClass, onSelectVariation: onSelectVariation, selectedValue: selectedValue, variations: variations }); } /* harmony default export */ const block_variation_transforms = (__experimentalBlockVariationTransforms); ;// ./node_modules/@wordpress/block-editor/build-module/components/color-palette/with-color-context.js /** * WordPress dependencies */ /** * Internal dependencies */ /* harmony default export */ const with_color_context = ((0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => { return props => { // Get the default colors, theme colors, and custom colors const [defaultColors, themeColors, customColors, enableCustomColors, enableDefaultColors] = use_settings_useSettings('color.palette.default', 'color.palette.theme', 'color.palette.custom', 'color.custom', 'color.defaultPalette'); const _colors = enableDefaultColors ? [...(themeColors || []), ...(defaultColors || []), ...(customColors || [])] : [...(themeColors || []), ...(customColors || [])]; const { colors = _colors, disableCustomColors = !enableCustomColors } = props; const hasColorsToChoose = colors && colors.length > 0 || !disableCustomColors; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WrappedComponent, { ...props, colors, disableCustomColors, hasColorsToChoose }); }; }, 'withColorContext')); ;// ./node_modules/@wordpress/block-editor/build-module/components/color-palette/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /* harmony default export */ const color_palette = (with_color_context(external_wp_components_namespaceObject.ColorPalette)); ;// ./node_modules/@wordpress/block-editor/build-module/components/color-palette/control.js /** * Internal dependencies */ function ColorPaletteControl({ onChange, value, ...otherProps }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(control, { ...otherProps, onColorChange: onChange, colorValue: value, gradients: [], disableCustomGradients: true }); } ;// external ["wp","date"] const external_wp_date_namespaceObject = window["wp"]["date"]; ;// ./node_modules/@wordpress/block-editor/build-module/components/date-format-picker/index.js /** * WordPress dependencies */ // So that we illustrate the different formats in the dropdown properly, show a date that is // somewhat recent, has a day greater than 12, and a month with more than three letters. const exampleDate = new Date(); exampleDate.setDate(20); exampleDate.setMonth(exampleDate.getMonth() - 3); if (exampleDate.getMonth() === 4) { // May has three letters, so use March. exampleDate.setMonth(3); } /** * The `DateFormatPicker` component renders controls that let the user choose a * _date format_. That is, how they want their dates to be formatted. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/date-format-picker/README.md * * @param {Object} props * @param {string|null} props.format The selected date format. If `null`, _Default_ is selected. * @param {string} props.defaultFormat The date format that will be used if the user selects 'Default'. * @param {Function} props.onChange Called when a selection is made. If `null`, _Default_ is selected. */ function DateFormatPicker({ format, defaultFormat, onChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { as: "fieldset", spacing: 4, className: "block-editor-date-format-picker", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "legend", children: (0,external_wp_i18n_namespaceObject.__)('Date format') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Default format'), help: `${(0,external_wp_i18n_namespaceObject.__)('Example:')} ${(0,external_wp_date_namespaceObject.dateI18n)(defaultFormat, exampleDate)}`, checked: !format, onChange: checked => onChange(checked ? null : defaultFormat) }), format && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NonDefaultControls, { format: format, onChange: onChange })] }); } function NonDefaultControls({ format, onChange }) { var _suggestedOptions$fin; // Suggest a short format, medium format, long format, and a standardised // (YYYY-MM-DD) format. The short, medium, and long formats are localised as // different languages have different ways of writing these. For example, 'F // j, Y' (April 20, 2022) in American English (en_US) is 'j. F Y' (20. April // 2022) in German (de). The resultant array is de-duplicated as some // languages will use the same format string for short, medium, and long // formats. const suggestedFormats = [...new Set([/* translators: See https://www.php.net/manual/datetime.format.php */ 'Y-m-d', /* translators: See https://www.php.net/manual/datetime.format.php */ (0,external_wp_i18n_namespaceObject._x)('n/j/Y', 'short date format'), /* translators: See https://www.php.net/manual/datetime.format.php */ (0,external_wp_i18n_namespaceObject._x)('n/j/Y g:i A', 'short date format with time'), /* translators: See https://www.php.net/manual/datetime.format.php */ (0,external_wp_i18n_namespaceObject._x)('M j, Y', 'medium date format'), /* translators: See https://www.php.net/manual/datetime.format.php */ (0,external_wp_i18n_namespaceObject._x)('M j, Y g:i A', 'medium date format with time'), /* translators: See https://www.php.net/manual/datetime.format.php */ (0,external_wp_i18n_namespaceObject._x)('F j, Y', 'long date format'), /* translators: See https://www.php.net/manual/datetime.format.php */ (0,external_wp_i18n_namespaceObject._x)('M j', 'short date format without the year')])]; const suggestedOptions = [...suggestedFormats.map((suggestedFormat, index) => ({ key: `suggested-${index}`, name: (0,external_wp_date_namespaceObject.dateI18n)(suggestedFormat, exampleDate), format: suggestedFormat })), { key: 'human-diff', name: (0,external_wp_date_namespaceObject.humanTimeDiff)(exampleDate), format: 'human-diff' }]; const customOption = { key: 'custom', name: (0,external_wp_i18n_namespaceObject.__)('Custom'), className: 'block-editor-date-format-picker__custom-format-select-control__custom-option', hint: (0,external_wp_i18n_namespaceObject.__)('Enter your own date format') }; const [isCustom, setIsCustom] = (0,external_wp_element_namespaceObject.useState)(() => !!format && !suggestedOptions.some(option => option.format === format)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CustomSelectControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Choose a format'), options: [...suggestedOptions, customOption], value: isCustom ? customOption : (_suggestedOptions$fin = suggestedOptions.find(option => option.format === format)) !== null && _suggestedOptions$fin !== void 0 ? _suggestedOptions$fin : customOption, onChange: ({ selectedItem }) => { if (selectedItem === customOption) { setIsCustom(true); } else { setIsCustom(false); onChange(selectedItem.format); } } }), isCustom && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Custom format'), hideLabelFromVision: true, help: (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Enter a date or time <Link>format string</Link>.'), { Link: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/customize-date-and-time-format/') }) }), value: format, onChange: value => onChange(value) })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/dropdown.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Internal dependencies */ // When the `ColorGradientSettingsDropdown` controls are being rendered to a // `ToolsPanel` they must be wrapped in a `ToolsPanelItem`. const WithToolsPanelItem = ({ setting, children, panelId, ...props }) => { const clearValue = () => { if (setting.colorValue) { setting.onColorChange(); } else if (setting.gradientValue) { setting.onGradientChange(); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => { return !!setting.colorValue || !!setting.gradientValue; }, label: setting.label, onDeselect: clearValue, isShownByDefault: setting.isShownByDefault !== undefined ? setting.isShownByDefault : true, ...props, className: "block-editor-tools-panel-color-gradient-settings__item", panelId: panelId // Pass resetAllFilter if supplied due to rendering via SlotFill // into parent ToolsPanel. , resetAllFilter: setting.resetAllFilter, children: children }); }; const dropdown_LabeledColorIndicator = ({ colorValue, label }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ColorIndicator, { className: "block-editor-panel-color-gradient-settings__color-indicator", colorValue: colorValue }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { className: "block-editor-panel-color-gradient-settings__color-name", title: label, children: label })] }); // Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup` // or as a `Button` if it isn't e.g. the controls are being rendered in // a `ToolsPanel`. const dropdown_renderToggle = settings => ({ onToggle, isOpen }) => { const { clearable, colorValue, gradientValue, onColorChange, onGradientChange, label } = settings; const colorButtonRef = (0,external_wp_element_namespaceObject.useRef)(undefined); const toggleProps = { onClick: onToggle, className: dist_clsx('block-editor-panel-color-gradient-settings__dropdown', { 'is-open': isOpen }), 'aria-expanded': isOpen, ref: colorButtonRef }; const clearValue = () => { if (colorValue) { onColorChange(); } else if (gradientValue) { onGradientChange(); } }; const value = colorValue !== null && colorValue !== void 0 ? colorValue : gradientValue; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ...toggleProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dropdown_LabeledColorIndicator, { colorValue: value, label: label }) }), clearable && value && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Reset'), className: "block-editor-panel-color-gradient-settings__reset", size: "small", icon: library_reset, onClick: () => { clearValue(); if (isOpen) { onToggle(); } // Return focus to parent button colorButtonRef.current?.focus(); } })] }); }; // Renders a collection of color controls as dropdowns. Depending upon the // context in which these dropdowns are being rendered, they may be wrapped // in an `ItemGroup` with each dropdown's toggle as an `Item`, or alternatively, // the may be individually wrapped in a `ToolsPanelItem` with the toggle as // a regular `Button`. // // For more context see: https://github.com/WordPress/gutenberg/pull/40084 function ColorGradientSettingsDropdown({ colors, disableCustomColors, disableCustomGradients, enableAlpha, gradients, settings, __experimentalIsRenderedInSidebar, ...props }) { let popoverProps; if (__experimentalIsRenderedInSidebar) { popoverProps = { placement: 'left-start', offset: 36, shift: true }; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: settings.map((setting, index) => { const controlProps = { clearable: false, colorValue: setting.colorValue, colors, disableCustomColors, disableCustomGradients, enableAlpha, gradientValue: setting.gradientValue, gradients, label: setting.label, onColorChange: setting.onColorChange, onGradientChange: setting.onGradientChange, showTitle: false, __experimentalIsRenderedInSidebar, ...setting }; const toggleSettings = { clearable: setting.clearable, label: setting.label, colorValue: setting.colorValue, gradientValue: setting.gradientValue, onColorChange: setting.onColorChange, onGradientChange: setting.onGradientChange }; return setting && /*#__PURE__*/ // If not in an `ItemGroup` wrap the dropdown in a // `ToolsPanelItem` (0,external_ReactJSXRuntime_namespaceObject.jsx)(WithToolsPanelItem, { setting: setting, ...props, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: popoverProps, className: "block-editor-tools-panel-color-gradient-settings__dropdown", renderToggle: dropdown_renderToggle(toggleSettings), renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { paddingSize: "none", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-panel-color-gradient-settings__dropdown-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(control, { ...controlProps }) }) }) }) }, index); }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/colors-gradients/panel-color-gradient-settings.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const panel_color_gradient_settings_colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients']; const PanelColorGradientSettingsInner = ({ className, colors, gradients, disableCustomColors, disableCustomGradients, children, settings, title, showTitle = true, __experimentalIsRenderedInSidebar, enableAlpha }) => { const panelId = (0,external_wp_compose_namespaceObject.useInstanceId)(PanelColorGradientSettingsInner); const { batch } = (0,external_wp_data_namespaceObject.useRegistry)(); if ((!colors || colors.length === 0) && (!gradients || gradients.length === 0) && disableCustomColors && disableCustomGradients && settings?.every(setting => (!setting.colors || setting.colors.length === 0) && (!setting.gradients || setting.gradients.length === 0) && (setting.disableCustomColors === undefined || setting.disableCustomColors) && (setting.disableCustomGradients === undefined || setting.disableCustomGradients))) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { className: dist_clsx('block-editor-panel-color-gradient-settings', className), label: showTitle ? title : undefined, resetAll: () => { batch(() => { settings.forEach(({ colorValue, gradientValue, onColorChange, onGradientChange }) => { if (colorValue) { onColorChange(); } else if (gradientValue) { onGradientChange(); } }); }); }, panelId: panelId, __experimentalFirstVisibleItemClass: "first", __experimentalLastVisibleItemClass: "last", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorGradientSettingsDropdown, { settings: settings, panelId: panelId, colors, gradients, disableCustomColors, disableCustomGradients, __experimentalIsRenderedInSidebar, enableAlpha }), !!children && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginY: 4 }), " ", children] })] }); }; const PanelColorGradientSettingsSelect = props => { const colorGradientSettings = useMultipleOriginColorsAndGradients(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelColorGradientSettingsInner, { ...colorGradientSettings, ...props }); }; const PanelColorGradientSettings = props => { if (panel_color_gradient_settings_colorsAndGradientKeys.every(key => props.hasOwnProperty(key))) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelColorGradientSettingsInner, { ...props }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PanelColorGradientSettingsSelect, { ...props }); }; /* harmony default export */ const panel_color_gradient_settings = (PanelColorGradientSettings); ;// ./node_modules/@wordpress/icons/build-module/library/aspect-ratio.js /** * WordPress dependencies */ const aspectRatio = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z" }) }); /* harmony default export */ const aspect_ratio = (aspectRatio); ;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/constants.js const MIN_ZOOM = 100; const MAX_ZOOM = 300; const constants_POPOVER_PROPS = { placement: 'bottom-start' }; ;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/use-save-image.js /** * WordPress dependencies */ // Disable Reason: Needs to be refactored. // eslint-disable-next-line no-restricted-imports const messages = { crop: (0,external_wp_i18n_namespaceObject.__)('Image cropped.'), rotate: (0,external_wp_i18n_namespaceObject.__)('Image rotated.'), cropAndRotate: (0,external_wp_i18n_namespaceObject.__)('Image cropped and rotated.') }; function useSaveImage({ crop, rotation, url, id, onSaveImage, onFinishEditing }) { const { createErrorNotice, createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const [isInProgress, setIsInProgress] = (0,external_wp_element_namespaceObject.useState)(false); const cancel = (0,external_wp_element_namespaceObject.useCallback)(() => { setIsInProgress(false); onFinishEditing(); }, [onFinishEditing]); const apply = (0,external_wp_element_namespaceObject.useCallback)(() => { setIsInProgress(true); const modifiers = []; if (rotation > 0) { modifiers.push({ type: 'rotate', args: { angle: rotation } }); } // The crop script may return some very small, sub-pixel values when the image was not cropped. // Crop only when the new size has changed by more than 0.1%. if (crop.width < 99.9 || crop.height < 99.9) { modifiers.push({ type: 'crop', args: { left: crop.x, top: crop.y, width: crop.width, height: crop.height } }); } if (modifiers.length === 0) { // No changes to apply. setIsInProgress(false); onFinishEditing(); return; } const modifierType = modifiers.length === 1 ? modifiers[0].type : 'cropAndRotate'; external_wp_apiFetch_default()({ path: `/wp/v2/media/${id}/edit`, method: 'POST', data: { src: url, modifiers } }).then(response => { onSaveImage({ id: response.id, url: response.source_url }); createSuccessNotice(messages[modifierType], { type: 'snackbar', actions: [{ label: (0,external_wp_i18n_namespaceObject.__)('Undo'), onClick: () => { onSaveImage({ id, url }); } }] }); }).catch(error => { createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Error message. */ (0,external_wp_i18n_namespaceObject.__)('Could not edit image. %s'), (0,external_wp_dom_namespaceObject.__unstableStripHTML)(error.message)), { id: 'image-editing-error', type: 'snackbar' }); }).finally(() => { setIsInProgress(false); onFinishEditing(); }); }, [crop, rotation, id, url, onSaveImage, createErrorNotice, createSuccessNotice, onFinishEditing]); return (0,external_wp_element_namespaceObject.useMemo)(() => ({ isInProgress, apply, cancel }), [isInProgress, apply, cancel]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/use-transform-image.js /* wp:polyfill */ /** * WordPress dependencies */ function useTransformImage({ url, naturalWidth, naturalHeight }) { const [editedUrl, setEditedUrl] = (0,external_wp_element_namespaceObject.useState)(); const [crop, setCrop] = (0,external_wp_element_namespaceObject.useState)(); const [position, setPosition] = (0,external_wp_element_namespaceObject.useState)({ x: 0, y: 0 }); const [zoom, setZoom] = (0,external_wp_element_namespaceObject.useState)(100); const [rotation, setRotation] = (0,external_wp_element_namespaceObject.useState)(0); const defaultAspect = naturalWidth / naturalHeight; const [aspect, setAspect] = (0,external_wp_element_namespaceObject.useState)(defaultAspect); const rotateClockwise = (0,external_wp_element_namespaceObject.useCallback)(() => { const angle = (rotation + 90) % 360; let naturalAspectRatio = defaultAspect; if (rotation % 180 === 90) { naturalAspectRatio = 1 / defaultAspect; } if (angle === 0) { setEditedUrl(); setRotation(angle); setAspect(defaultAspect); setPosition(prevPosition => ({ x: -(prevPosition.y * naturalAspectRatio), y: prevPosition.x * naturalAspectRatio })); return; } function editImage(event) { const canvas = document.createElement('canvas'); let translateX = 0; let translateY = 0; if (angle % 180) { canvas.width = event.target.height; canvas.height = event.target.width; } else { canvas.width = event.target.width; canvas.height = event.target.height; } if (angle === 90 || angle === 180) { translateX = canvas.width; } if (angle === 270 || angle === 180) { translateY = canvas.height; } const context = canvas.getContext('2d'); context.translate(translateX, translateY); context.rotate(angle * Math.PI / 180); context.drawImage(event.target, 0, 0); canvas.toBlob(blob => { setEditedUrl(URL.createObjectURL(blob)); setRotation(angle); setAspect(canvas.width / canvas.height); setPosition(prevPosition => ({ x: -(prevPosition.y * naturalAspectRatio), y: prevPosition.x * naturalAspectRatio })); }); } const el = new window.Image(); el.src = url; el.onload = editImage; const imgCrossOrigin = (0,external_wp_hooks_namespaceObject.applyFilters)('media.crossOrigin', undefined, url); if (typeof imgCrossOrigin === 'string') { el.crossOrigin = imgCrossOrigin; } }, [rotation, defaultAspect, url]); return (0,external_wp_element_namespaceObject.useMemo)(() => ({ editedUrl, setEditedUrl, crop, setCrop, position, setPosition, zoom, setZoom, rotation, setRotation, rotateClockwise, aspect, setAspect, defaultAspect }), [editedUrl, crop, position, zoom, rotation, rotateClockwise, aspect, defaultAspect]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/context.js /** * WordPress dependencies */ /** * Internal dependencies */ const ImageEditingContext = (0,external_wp_element_namespaceObject.createContext)({}); const useImageEditingContext = () => (0,external_wp_element_namespaceObject.useContext)(ImageEditingContext); function ImageEditingProvider({ id, url, naturalWidth, naturalHeight, onFinishEditing, onSaveImage, children }) { const transformImage = useTransformImage({ url, naturalWidth, naturalHeight }); const saveImage = useSaveImage({ id, url, onSaveImage, onFinishEditing, ...transformImage }); const providerValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ ...transformImage, ...saveImage }), [transformImage, saveImage]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ImageEditingContext.Provider, { value: providerValue, children: children }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/aspect-ratio-dropdown.js /** * WordPress dependencies */ /** * Internal dependencies */ function AspectRatioGroup({ aspectRatios, isDisabled, label, onClick, value }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: label, children: aspectRatios.map(({ name, slug, ratio }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { disabled: isDisabled, onClick: () => { onClick(ratio); }, role: "menuitemradio", isSelected: ratio === value, icon: ratio === value ? library_check : undefined, children: name }, slug)) }); } function ratioToNumber(str) { // TODO: support two-value aspect ratio? // https://css-tricks.com/almanac/properties/a/aspect-ratio/#aa-it-can-take-two-values const [a, b, ...rest] = str.split('/').map(Number); if (a <= 0 || b <= 0 || Number.isNaN(a) || Number.isNaN(b) || rest.length) { return NaN; } return b ? a / b : a; } function presetRatioAsNumber({ ratio, ...rest }) { return { ratio: ratioToNumber(ratio), ...rest }; } function AspectRatioDropdown({ toggleProps }) { const { isInProgress, aspect, setAspect, defaultAspect } = useImageEditingContext(); const [defaultRatios, themeRatios, showDefaultRatios] = use_settings_useSettings('dimensions.aspectRatios.default', 'dimensions.aspectRatios.theme', 'dimensions.defaultAspectRatios'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { icon: aspect_ratio, label: (0,external_wp_i18n_namespaceObject.__)('Aspect Ratio'), popoverProps: constants_POPOVER_PROPS, toggleProps: toggleProps, children: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AspectRatioGroup, { isDisabled: isInProgress, onClick: newAspect => { setAspect(newAspect); onClose(); }, value: aspect, aspectRatios: [ // All ratios should be mirrored in AspectRatioTool in @wordpress/block-editor. { slug: 'original', name: (0,external_wp_i18n_namespaceObject.__)('Original'), ratio: defaultAspect }, ...(showDefaultRatios ? defaultRatios.map(presetRatioAsNumber).filter(({ ratio }) => ratio === 1) : [])] }), themeRatios?.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AspectRatioGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Theme'), isDisabled: isInProgress, onClick: newAspect => { setAspect(newAspect); onClose(); }, value: aspect, aspectRatios: themeRatios }), showDefaultRatios && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AspectRatioGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Landscape'), isDisabled: isInProgress, onClick: newAspect => { setAspect(newAspect); onClose(); }, value: aspect, aspectRatios: defaultRatios.map(presetRatioAsNumber).filter(({ ratio }) => ratio > 1) }), showDefaultRatios && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AspectRatioGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Portrait'), isDisabled: isInProgress, onClick: newAspect => { setAspect(newAspect); onClose(); }, value: aspect, aspectRatios: defaultRatios.map(presetRatioAsNumber).filter(({ ratio }) => ratio < 1) })] }) }); } ;// ./node_modules/tslib/tslib.es6.mjs /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { var context = {}; for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; for (var p in contextIn.access) context.access[p] = contextIn.access[p]; context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); if (_ = accept(result.get)) descriptor.get = _; if (_ = accept(result.set)) descriptor.set = _; if (_ = accept(result.init)) initializers.unshift(_); } else if (_ = accept(result)) { if (kind === "field") initializers.unshift(_); else descriptor[key] = _; } } if (target) Object.defineProperty(target, contextIn.name, descriptor); done = true; }; function __runInitializers(thisArg, initializers, value) { var useValue = arguments.length > 2; for (var i = 0; i < initializers.length; i++) { value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); } return useValue ? value : void 0; }; function __propKey(x) { return typeof x === "symbol" ? x : "".concat(x); }; function __setFunctionName(f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); }; function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } function __classPrivateFieldIn(state, receiver) { if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); return typeof state === "function" ? receiver === state : state.has(receiver); } function __addDisposableResource(env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); var dispose, inner; if (async) { if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); dispose = value[Symbol.asyncDispose]; } if (dispose === void 0) { if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); dispose = value[Symbol.dispose]; if (async) inner = dispose; } if (typeof dispose !== "function") throw new TypeError("Object not disposable."); if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; env.stack.push({ value: value, dispose: dispose, async: async }); } else if (async) { env.stack.push({ async: true }); } return value; } var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { var e = new Error(message); return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }; function __disposeResources(env) { function fail(e) { env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; env.hasError = true; } var r, s = 0; function next() { while (r = env.stack.pop()) { try { if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); if (r.dispose) { var result = r.dispose.call(r.value); if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); } else s |= 1; } catch (e) { fail(e); } } if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); if (env.hasError) throw env.error; } return next(); } function __rewriteRelativeImportExtension(path, preserveJsx) { if (typeof path === "string" && /^\.\.?\//.test(path)) { return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); }); } return path; } /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources, __rewriteRelativeImportExtension, }); // EXTERNAL MODULE: ./node_modules/normalize-wheel/index.js var normalize_wheel = __webpack_require__(7520); var normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(normalize_wheel); ;// ./node_modules/react-easy-crop/index.module.js /** * Compute the dimension of the crop area based on media size, * aspect ratio and optionally rotation */ function getCropSize(mediaWidth, mediaHeight, containerWidth, containerHeight, aspect, rotation) { if (rotation === void 0) { rotation = 0; } var _a = rotateSize(mediaWidth, mediaHeight, rotation), width = _a.width, height = _a.height; var fittingWidth = Math.min(width, containerWidth); var fittingHeight = Math.min(height, containerHeight); if (fittingWidth > fittingHeight * aspect) { return { width: fittingHeight * aspect, height: fittingHeight }; } return { width: fittingWidth, height: fittingWidth / aspect }; } /** * Compute media zoom. * We fit the media into the container with "max-width: 100%; max-height: 100%;" */ function getMediaZoom(mediaSize) { // Take the axis with more pixels to improve accuracy return mediaSize.width > mediaSize.height ? mediaSize.width / mediaSize.naturalWidth : mediaSize.height / mediaSize.naturalHeight; } /** * Ensure a new media position stays in the crop area. */ function restrictPosition(position, mediaSize, cropSize, zoom, rotation) { if (rotation === void 0) { rotation = 0; } var _a = rotateSize(mediaSize.width, mediaSize.height, rotation), width = _a.width, height = _a.height; return { x: restrictPositionCoord(position.x, width, cropSize.width, zoom), y: restrictPositionCoord(position.y, height, cropSize.height, zoom) }; } function restrictPositionCoord(position, mediaSize, cropSize, zoom) { var maxPosition = mediaSize * zoom / 2 - cropSize / 2; return clamp(position, -maxPosition, maxPosition); } function getDistanceBetweenPoints(pointA, pointB) { return Math.sqrt(Math.pow(pointA.y - pointB.y, 2) + Math.pow(pointA.x - pointB.x, 2)); } function getRotationBetweenPoints(pointA, pointB) { return Math.atan2(pointB.y - pointA.y, pointB.x - pointA.x) * 180 / Math.PI; } /** * Compute the output cropped area of the media in percentages and pixels. * x/y are the top-left coordinates on the src media */ function computeCroppedArea(crop, mediaSize, cropSize, aspect, zoom, rotation, restrictPosition) { if (rotation === void 0) { rotation = 0; } if (restrictPosition === void 0) { restrictPosition = true; } // if the media is rotated by the user, we cannot limit the position anymore // as it might need to be negative. var limitAreaFn = restrictPosition ? limitArea : noOp; var mediaBBoxSize = rotateSize(mediaSize.width, mediaSize.height, rotation); var mediaNaturalBBoxSize = rotateSize(mediaSize.naturalWidth, mediaSize.naturalHeight, rotation); // calculate the crop area in percentages // in the rotated space var croppedAreaPercentages = { x: limitAreaFn(100, ((mediaBBoxSize.width - cropSize.width / zoom) / 2 - crop.x / zoom) / mediaBBoxSize.width * 100), y: limitAreaFn(100, ((mediaBBoxSize.height - cropSize.height / zoom) / 2 - crop.y / zoom) / mediaBBoxSize.height * 100), width: limitAreaFn(100, cropSize.width / mediaBBoxSize.width * 100 / zoom), height: limitAreaFn(100, cropSize.height / mediaBBoxSize.height * 100 / zoom) }; // we compute the pixels size naively var widthInPixels = Math.round(limitAreaFn(mediaNaturalBBoxSize.width, croppedAreaPercentages.width * mediaNaturalBBoxSize.width / 100)); var heightInPixels = Math.round(limitAreaFn(mediaNaturalBBoxSize.height, croppedAreaPercentages.height * mediaNaturalBBoxSize.height / 100)); var isImgWiderThanHigh = mediaNaturalBBoxSize.width >= mediaNaturalBBoxSize.height * aspect; // then we ensure the width and height exactly match the aspect (to avoid rounding approximations) // if the media is wider than high, when zoom is 0, the crop height will be equals to image height // thus we want to compute the width from the height and aspect for accuracy. // Otherwise, we compute the height from width and aspect. var sizePixels = isImgWiderThanHigh ? { width: Math.round(heightInPixels * aspect), height: heightInPixels } : { width: widthInPixels, height: Math.round(widthInPixels / aspect) }; var croppedAreaPixels = __assign(__assign({}, sizePixels), { x: Math.round(limitAreaFn(mediaNaturalBBoxSize.width - sizePixels.width, croppedAreaPercentages.x * mediaNaturalBBoxSize.width / 100)), y: Math.round(limitAreaFn(mediaNaturalBBoxSize.height - sizePixels.height, croppedAreaPercentages.y * mediaNaturalBBoxSize.height / 100)) }); return { croppedAreaPercentages: croppedAreaPercentages, croppedAreaPixels: croppedAreaPixels }; } /** * Ensure the returned value is between 0 and max */ function limitArea(max, value) { return Math.min(max, Math.max(0, value)); } function noOp(_max, value) { return value; } /** * Compute crop and zoom from the croppedAreaPercentages. */ function getInitialCropFromCroppedAreaPercentages(croppedAreaPercentages, mediaSize, rotation, cropSize, minZoom, maxZoom) { var mediaBBoxSize = rotateSize(mediaSize.width, mediaSize.height, rotation); // This is the inverse process of computeCroppedArea var zoom = clamp(cropSize.width / mediaBBoxSize.width * (100 / croppedAreaPercentages.width), minZoom, maxZoom); var crop = { x: zoom * mediaBBoxSize.width / 2 - cropSize.width / 2 - mediaBBoxSize.width * zoom * (croppedAreaPercentages.x / 100), y: zoom * mediaBBoxSize.height / 2 - cropSize.height / 2 - mediaBBoxSize.height * zoom * (croppedAreaPercentages.y / 100) }; return { crop: crop, zoom: zoom }; } /** * Compute zoom from the croppedAreaPixels */ function getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize) { var mediaZoom = getMediaZoom(mediaSize); return cropSize.height > cropSize.width ? cropSize.height / (croppedAreaPixels.height * mediaZoom) : cropSize.width / (croppedAreaPixels.width * mediaZoom); } /** * Compute crop and zoom from the croppedAreaPixels */ function getInitialCropFromCroppedAreaPixels(croppedAreaPixels, mediaSize, rotation, cropSize, minZoom, maxZoom) { if (rotation === void 0) { rotation = 0; } var mediaNaturalBBoxSize = rotateSize(mediaSize.naturalWidth, mediaSize.naturalHeight, rotation); var zoom = clamp(getZoomFromCroppedAreaPixels(croppedAreaPixels, mediaSize, cropSize), minZoom, maxZoom); var cropZoom = cropSize.height > cropSize.width ? cropSize.height / croppedAreaPixels.height : cropSize.width / croppedAreaPixels.width; var crop = { x: ((mediaNaturalBBoxSize.width - croppedAreaPixels.width) / 2 - croppedAreaPixels.x) * cropZoom, y: ((mediaNaturalBBoxSize.height - croppedAreaPixels.height) / 2 - croppedAreaPixels.y) * cropZoom }; return { crop: crop, zoom: zoom }; } /** * Return the point that is the center of point a and b */ function getCenter(a, b) { return { x: (b.x + a.x) / 2, y: (b.y + a.y) / 2 }; } function getRadianAngle(degreeValue) { return degreeValue * Math.PI / 180; } /** * Returns the new bounding area of a rotated rectangle. */ function rotateSize(width, height, rotation) { var rotRad = getRadianAngle(rotation); return { width: Math.abs(Math.cos(rotRad) * width) + Math.abs(Math.sin(rotRad) * height), height: Math.abs(Math.sin(rotRad) * width) + Math.abs(Math.cos(rotRad) * height) }; } /** * Clamp value between min and max */ function clamp(value, min, max) { return Math.min(Math.max(value, min), max); } /** * Combine multiple class names into a single string. */ function classNames() { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } return args.filter(function (value) { if (typeof value === 'string' && value.length > 0) { return true; } return false; }).join(' ').trim(); } var css_248z = ".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n"; var index_module_MIN_ZOOM = 1; var index_module_MAX_ZOOM = 3; var Cropper = /** @class */function (_super) { __extends(Cropper, _super); function Cropper() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.imageRef = external_React_.createRef(); _this.videoRef = external_React_.createRef(); _this.containerPosition = { x: 0, y: 0 }; _this.containerRef = null; _this.styleRef = null; _this.containerRect = null; _this.mediaSize = { width: 0, height: 0, naturalWidth: 0, naturalHeight: 0 }; _this.dragStartPosition = { x: 0, y: 0 }; _this.dragStartCrop = { x: 0, y: 0 }; _this.gestureZoomStart = 0; _this.gestureRotationStart = 0; _this.isTouching = false; _this.lastPinchDistance = 0; _this.lastPinchRotation = 0; _this.rafDragTimeout = null; _this.rafPinchTimeout = null; _this.wheelTimer = null; _this.currentDoc = typeof document !== 'undefined' ? document : null; _this.currentWindow = typeof window !== 'undefined' ? window : null; _this.resizeObserver = null; _this.state = { cropSize: null, hasWheelJustStarted: false, mediaObjectFit: undefined }; _this.initResizeObserver = function () { if (typeof window.ResizeObserver === 'undefined' || !_this.containerRef) { return; } var isFirstResize = true; _this.resizeObserver = new window.ResizeObserver(function (entries) { if (isFirstResize) { isFirstResize = false; // observe() is called on mount, we don't want to trigger a recompute on mount return; } _this.computeSizes(); }); _this.resizeObserver.observe(_this.containerRef); }; // this is to prevent Safari on iOS >= 10 to zoom the page _this.preventZoomSafari = function (e) { return e.preventDefault(); }; _this.cleanEvents = function () { if (!_this.currentDoc) return; _this.currentDoc.removeEventListener('mousemove', _this.onMouseMove); _this.currentDoc.removeEventListener('mouseup', _this.onDragStopped); _this.currentDoc.removeEventListener('touchmove', _this.onTouchMove); _this.currentDoc.removeEventListener('touchend', _this.onDragStopped); _this.currentDoc.removeEventListener('gesturemove', _this.onGestureMove); _this.currentDoc.removeEventListener('gestureend', _this.onGestureEnd); _this.currentDoc.removeEventListener('scroll', _this.onScroll); }; _this.clearScrollEvent = function () { if (_this.containerRef) _this.containerRef.removeEventListener('wheel', _this.onWheel); if (_this.wheelTimer) { clearTimeout(_this.wheelTimer); } }; _this.onMediaLoad = function () { var cropSize = _this.computeSizes(); if (cropSize) { _this.emitCropData(); _this.setInitialCrop(cropSize); } if (_this.props.onMediaLoaded) { _this.props.onMediaLoaded(_this.mediaSize); } }; _this.setInitialCrop = function (cropSize) { if (_this.props.initialCroppedAreaPercentages) { var _a = getInitialCropFromCroppedAreaPercentages(_this.props.initialCroppedAreaPercentages, _this.mediaSize, _this.props.rotation, cropSize, _this.props.minZoom, _this.props.maxZoom), crop = _a.crop, zoom = _a.zoom; _this.props.onCropChange(crop); _this.props.onZoomChange && _this.props.onZoomChange(zoom); } else if (_this.props.initialCroppedAreaPixels) { var _b = getInitialCropFromCroppedAreaPixels(_this.props.initialCroppedAreaPixels, _this.mediaSize, _this.props.rotation, cropSize, _this.props.minZoom, _this.props.maxZoom), crop = _b.crop, zoom = _b.zoom; _this.props.onCropChange(crop); _this.props.onZoomChange && _this.props.onZoomChange(zoom); } }; _this.computeSizes = function () { var _a, _b, _c, _d, _e, _f; var mediaRef = _this.imageRef.current || _this.videoRef.current; if (mediaRef && _this.containerRef) { _this.containerRect = _this.containerRef.getBoundingClientRect(); _this.saveContainerPosition(); var containerAspect = _this.containerRect.width / _this.containerRect.height; var naturalWidth = ((_a = _this.imageRef.current) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = _this.videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0; var naturalHeight = ((_c = _this.imageRef.current) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = _this.videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0; var isMediaScaledDown = mediaRef.offsetWidth < naturalWidth || mediaRef.offsetHeight < naturalHeight; var mediaAspect = naturalWidth / naturalHeight; // We do not rely on the offsetWidth/offsetHeight if the media is scaled down // as the values they report are rounded. That will result in precision losses // when calculating zoom. We use the fact that the media is positionned relative // to the container. That allows us to use the container's dimensions // and natural aspect ratio of the media to calculate accurate media size. // However, for this to work, the container should not be rotated var renderedMediaSize = void 0; if (isMediaScaledDown) { switch (_this.state.mediaObjectFit) { default: case 'contain': renderedMediaSize = containerAspect > mediaAspect ? { width: _this.containerRect.height * mediaAspect, height: _this.containerRect.height } : { width: _this.containerRect.width, height: _this.containerRect.width / mediaAspect }; break; case 'horizontal-cover': renderedMediaSize = { width: _this.containerRect.width, height: _this.containerRect.width / mediaAspect }; break; case 'vertical-cover': renderedMediaSize = { width: _this.containerRect.height * mediaAspect, height: _this.containerRect.height }; break; } } else { renderedMediaSize = { width: mediaRef.offsetWidth, height: mediaRef.offsetHeight }; } _this.mediaSize = __assign(__assign({}, renderedMediaSize), { naturalWidth: naturalWidth, naturalHeight: naturalHeight }); // set media size in the parent if (_this.props.setMediaSize) { _this.props.setMediaSize(_this.mediaSize); } var cropSize = _this.props.cropSize ? _this.props.cropSize : getCropSize(_this.mediaSize.width, _this.mediaSize.height, _this.containerRect.width, _this.containerRect.height, _this.props.aspect, _this.props.rotation); if (((_e = _this.state.cropSize) === null || _e === void 0 ? void 0 : _e.height) !== cropSize.height || ((_f = _this.state.cropSize) === null || _f === void 0 ? void 0 : _f.width) !== cropSize.width) { _this.props.onCropSizeChange && _this.props.onCropSizeChange(cropSize); } _this.setState({ cropSize: cropSize }, _this.recomputeCropPosition); // pass crop size to parent if (_this.props.setCropSize) { _this.props.setCropSize(cropSize); } return cropSize; } }; _this.saveContainerPosition = function () { if (_this.containerRef) { var bounds = _this.containerRef.getBoundingClientRect(); _this.containerPosition = { x: bounds.left, y: bounds.top }; } }; _this.onMouseDown = function (e) { if (!_this.currentDoc) return; e.preventDefault(); _this.currentDoc.addEventListener('mousemove', _this.onMouseMove); _this.currentDoc.addEventListener('mouseup', _this.onDragStopped); _this.saveContainerPosition(); _this.onDragStart(Cropper.getMousePoint(e)); }; _this.onMouseMove = function (e) { return _this.onDrag(Cropper.getMousePoint(e)); }; _this.onScroll = function (e) { if (!_this.currentDoc) return; e.preventDefault(); _this.saveContainerPosition(); }; _this.onTouchStart = function (e) { if (!_this.currentDoc) return; _this.isTouching = true; if (_this.props.onTouchRequest && !_this.props.onTouchRequest(e)) { return; } _this.currentDoc.addEventListener('touchmove', _this.onTouchMove, { passive: false }); // iOS 11 now defaults to passive: true _this.currentDoc.addEventListener('touchend', _this.onDragStopped); _this.saveContainerPosition(); if (e.touches.length === 2) { _this.onPinchStart(e); } else if (e.touches.length === 1) { _this.onDragStart(Cropper.getTouchPoint(e.touches[0])); } }; _this.onTouchMove = function (e) { // Prevent whole page from scrolling on iOS. e.preventDefault(); if (e.touches.length === 2) { _this.onPinchMove(e); } else if (e.touches.length === 1) { _this.onDrag(Cropper.getTouchPoint(e.touches[0])); } }; _this.onGestureStart = function (e) { if (!_this.currentDoc) return; e.preventDefault(); _this.currentDoc.addEventListener('gesturechange', _this.onGestureMove); _this.currentDoc.addEventListener('gestureend', _this.onGestureEnd); _this.gestureZoomStart = _this.props.zoom; _this.gestureRotationStart = _this.props.rotation; }; _this.onGestureMove = function (e) { e.preventDefault(); if (_this.isTouching) { // this is to avoid conflict between gesture and touch events return; } var point = Cropper.getMousePoint(e); var newZoom = _this.gestureZoomStart - 1 + e.scale; _this.setNewZoom(newZoom, point, { shouldUpdatePosition: true }); if (_this.props.onRotationChange) { var newRotation = _this.gestureRotationStart + e.rotation; _this.props.onRotationChange(newRotation); } }; _this.onGestureEnd = function (e) { _this.cleanEvents(); }; _this.onDragStart = function (_a) { var _b, _c; var x = _a.x, y = _a.y; _this.dragStartPosition = { x: x, y: y }; _this.dragStartCrop = __assign({}, _this.props.crop); (_c = (_b = _this.props).onInteractionStart) === null || _c === void 0 ? void 0 : _c.call(_b); }; _this.onDrag = function (_a) { var x = _a.x, y = _a.y; if (!_this.currentWindow) return; if (_this.rafDragTimeout) _this.currentWindow.cancelAnimationFrame(_this.rafDragTimeout); _this.rafDragTimeout = _this.currentWindow.requestAnimationFrame(function () { if (!_this.state.cropSize) return; if (x === undefined || y === undefined) return; var offsetX = x - _this.dragStartPosition.x; var offsetY = y - _this.dragStartPosition.y; var requestedPosition = { x: _this.dragStartCrop.x + offsetX, y: _this.dragStartCrop.y + offsetY }; var newPosition = _this.props.restrictPosition ? restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : requestedPosition; _this.props.onCropChange(newPosition); }); }; _this.onDragStopped = function () { var _a, _b; _this.isTouching = false; _this.cleanEvents(); _this.emitCropData(); (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a); }; _this.onWheel = function (e) { if (!_this.currentWindow) return; if (_this.props.onWheelRequest && !_this.props.onWheelRequest(e)) { return; } e.preventDefault(); var point = Cropper.getMousePoint(e); var pixelY = normalize_wheel_default()(e).pixelY; var newZoom = _this.props.zoom - pixelY * _this.props.zoomSpeed / 200; _this.setNewZoom(newZoom, point, { shouldUpdatePosition: true }); if (!_this.state.hasWheelJustStarted) { _this.setState({ hasWheelJustStarted: true }, function () { var _a, _b; return (_b = (_a = _this.props).onInteractionStart) === null || _b === void 0 ? void 0 : _b.call(_a); }); } if (_this.wheelTimer) { clearTimeout(_this.wheelTimer); } _this.wheelTimer = _this.currentWindow.setTimeout(function () { return _this.setState({ hasWheelJustStarted: false }, function () { var _a, _b; return (_b = (_a = _this.props).onInteractionEnd) === null || _b === void 0 ? void 0 : _b.call(_a); }); }, 250); }; _this.getPointOnContainer = function (_a, containerTopLeft) { var x = _a.x, y = _a.y; if (!_this.containerRect) { throw new Error('The Cropper is not mounted'); } return { x: _this.containerRect.width / 2 - (x - containerTopLeft.x), y: _this.containerRect.height / 2 - (y - containerTopLeft.y) }; }; _this.getPointOnMedia = function (_a) { var x = _a.x, y = _a.y; var _b = _this.props, crop = _b.crop, zoom = _b.zoom; return { x: (x + crop.x) / zoom, y: (y + crop.y) / zoom }; }; _this.setNewZoom = function (zoom, point, _a) { var _b = _a === void 0 ? {} : _a, _c = _b.shouldUpdatePosition, shouldUpdatePosition = _c === void 0 ? true : _c; if (!_this.state.cropSize || !_this.props.onZoomChange) return; var newZoom = clamp(zoom, _this.props.minZoom, _this.props.maxZoom); if (shouldUpdatePosition) { var zoomPoint = _this.getPointOnContainer(point, _this.containerPosition); var zoomTarget = _this.getPointOnMedia(zoomPoint); var requestedPosition = { x: zoomTarget.x * newZoom - zoomPoint.x, y: zoomTarget.y * newZoom - zoomPoint.y }; var newPosition = _this.props.restrictPosition ? restrictPosition(requestedPosition, _this.mediaSize, _this.state.cropSize, newZoom, _this.props.rotation) : requestedPosition; _this.props.onCropChange(newPosition); } _this.props.onZoomChange(newZoom); }; _this.getCropData = function () { if (!_this.state.cropSize) { return null; } // this is to ensure the crop is correctly restricted after a zoom back (https://github.com/ValentinH/react-easy-crop/issues/6) var restrictedPosition = _this.props.restrictPosition ? restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop; return computeCroppedArea(restrictedPosition, _this.mediaSize, _this.state.cropSize, _this.getAspect(), _this.props.zoom, _this.props.rotation, _this.props.restrictPosition); }; _this.emitCropData = function () { var cropData = _this.getCropData(); if (!cropData) return; var croppedAreaPercentages = cropData.croppedAreaPercentages, croppedAreaPixels = cropData.croppedAreaPixels; if (_this.props.onCropComplete) { _this.props.onCropComplete(croppedAreaPercentages, croppedAreaPixels); } if (_this.props.onCropAreaChange) { _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels); } }; _this.emitCropAreaChange = function () { var cropData = _this.getCropData(); if (!cropData) return; var croppedAreaPercentages = cropData.croppedAreaPercentages, croppedAreaPixels = cropData.croppedAreaPixels; if (_this.props.onCropAreaChange) { _this.props.onCropAreaChange(croppedAreaPercentages, croppedAreaPixels); } }; _this.recomputeCropPosition = function () { if (!_this.state.cropSize) return; var newPosition = _this.props.restrictPosition ? restrictPosition(_this.props.crop, _this.mediaSize, _this.state.cropSize, _this.props.zoom, _this.props.rotation) : _this.props.crop; _this.props.onCropChange(newPosition); _this.emitCropData(); }; return _this; } Cropper.prototype.componentDidMount = function () { if (!this.currentDoc || !this.currentWindow) return; if (this.containerRef) { if (this.containerRef.ownerDocument) { this.currentDoc = this.containerRef.ownerDocument; } if (this.currentDoc.defaultView) { this.currentWindow = this.currentDoc.defaultView; } this.initResizeObserver(); // only add window resize listener if ResizeObserver is not supported. Otherwise, it would be redundant if (typeof window.ResizeObserver === 'undefined') { this.currentWindow.addEventListener('resize', this.computeSizes); } this.props.zoomWithScroll && this.containerRef.addEventListener('wheel', this.onWheel, { passive: false }); this.containerRef.addEventListener('gesturestart', this.onGestureStart); } this.currentDoc.addEventListener('scroll', this.onScroll); if (!this.props.disableAutomaticStylesInjection) { this.styleRef = this.currentDoc.createElement('style'); this.styleRef.setAttribute('type', 'text/css'); if (this.props.nonce) { this.styleRef.setAttribute('nonce', this.props.nonce); } this.styleRef.innerHTML = css_248z; this.currentDoc.head.appendChild(this.styleRef); } // when rendered via SSR, the image can already be loaded and its onLoad callback will never be called if (this.imageRef.current && this.imageRef.current.complete) { this.onMediaLoad(); } // set image and video refs in the parent if the callbacks exist if (this.props.setImageRef) { this.props.setImageRef(this.imageRef); } if (this.props.setVideoRef) { this.props.setVideoRef(this.videoRef); } }; Cropper.prototype.componentWillUnmount = function () { var _a, _b; if (!this.currentDoc || !this.currentWindow) return; if (typeof window.ResizeObserver === 'undefined') { this.currentWindow.removeEventListener('resize', this.computeSizes); } (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect(); if (this.containerRef) { this.containerRef.removeEventListener('gesturestart', this.preventZoomSafari); } if (this.styleRef) { (_b = this.styleRef.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.styleRef); } this.cleanEvents(); this.props.zoomWithScroll && this.clearScrollEvent(); }; Cropper.prototype.componentDidUpdate = function (prevProps) { var _a, _b, _c, _d, _e, _f, _g, _h, _j; if (prevProps.rotation !== this.props.rotation) { this.computeSizes(); this.recomputeCropPosition(); } else if (prevProps.aspect !== this.props.aspect) { this.computeSizes(); } else if (prevProps.objectFit !== this.props.objectFit) { this.computeSizes(); } else if (prevProps.zoom !== this.props.zoom) { this.recomputeCropPosition(); } else if (((_a = prevProps.cropSize) === null || _a === void 0 ? void 0 : _a.height) !== ((_b = this.props.cropSize) === null || _b === void 0 ? void 0 : _b.height) || ((_c = prevProps.cropSize) === null || _c === void 0 ? void 0 : _c.width) !== ((_d = this.props.cropSize) === null || _d === void 0 ? void 0 : _d.width)) { this.computeSizes(); } else if (((_e = prevProps.crop) === null || _e === void 0 ? void 0 : _e.x) !== ((_f = this.props.crop) === null || _f === void 0 ? void 0 : _f.x) || ((_g = prevProps.crop) === null || _g === void 0 ? void 0 : _g.y) !== ((_h = this.props.crop) === null || _h === void 0 ? void 0 : _h.y)) { this.emitCropAreaChange(); } if (prevProps.zoomWithScroll !== this.props.zoomWithScroll && this.containerRef) { this.props.zoomWithScroll ? this.containerRef.addEventListener('wheel', this.onWheel, { passive: false }) : this.clearScrollEvent(); } if (prevProps.video !== this.props.video) { (_j = this.videoRef.current) === null || _j === void 0 ? void 0 : _j.load(); } var objectFit = this.getObjectFit(); if (objectFit !== this.state.mediaObjectFit) { this.setState({ mediaObjectFit: objectFit }, this.computeSizes); } }; Cropper.prototype.getAspect = function () { var _a = this.props, cropSize = _a.cropSize, aspect = _a.aspect; if (cropSize) { return cropSize.width / cropSize.height; } return aspect; }; Cropper.prototype.getObjectFit = function () { var _a, _b, _c, _d; if (this.props.objectFit === 'cover') { var mediaRef = this.imageRef.current || this.videoRef.current; if (mediaRef && this.containerRef) { this.containerRect = this.containerRef.getBoundingClientRect(); var containerAspect = this.containerRect.width / this.containerRect.height; var naturalWidth = ((_a = this.imageRef.current) === null || _a === void 0 ? void 0 : _a.naturalWidth) || ((_b = this.videoRef.current) === null || _b === void 0 ? void 0 : _b.videoWidth) || 0; var naturalHeight = ((_c = this.imageRef.current) === null || _c === void 0 ? void 0 : _c.naturalHeight) || ((_d = this.videoRef.current) === null || _d === void 0 ? void 0 : _d.videoHeight) || 0; var mediaAspect = naturalWidth / naturalHeight; return mediaAspect < containerAspect ? 'horizontal-cover' : 'vertical-cover'; } return 'horizontal-cover'; } return this.props.objectFit; }; Cropper.prototype.onPinchStart = function (e) { var pointA = Cropper.getTouchPoint(e.touches[0]); var pointB = Cropper.getTouchPoint(e.touches[1]); this.lastPinchDistance = getDistanceBetweenPoints(pointA, pointB); this.lastPinchRotation = getRotationBetweenPoints(pointA, pointB); this.onDragStart(getCenter(pointA, pointB)); }; Cropper.prototype.onPinchMove = function (e) { var _this = this; if (!this.currentDoc || !this.currentWindow) return; var pointA = Cropper.getTouchPoint(e.touches[0]); var pointB = Cropper.getTouchPoint(e.touches[1]); var center = getCenter(pointA, pointB); this.onDrag(center); if (this.rafPinchTimeout) this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout); this.rafPinchTimeout = this.currentWindow.requestAnimationFrame(function () { var distance = getDistanceBetweenPoints(pointA, pointB); var newZoom = _this.props.zoom * (distance / _this.lastPinchDistance); _this.setNewZoom(newZoom, center, { shouldUpdatePosition: false }); _this.lastPinchDistance = distance; var rotation = getRotationBetweenPoints(pointA, pointB); var newRotation = _this.props.rotation + (rotation - _this.lastPinchRotation); _this.props.onRotationChange && _this.props.onRotationChange(newRotation); _this.lastPinchRotation = rotation; }); }; Cropper.prototype.render = function () { var _this = this; var _a = this.props, image = _a.image, video = _a.video, mediaProps = _a.mediaProps, transform = _a.transform, _b = _a.crop, x = _b.x, y = _b.y, rotation = _a.rotation, zoom = _a.zoom, cropShape = _a.cropShape, showGrid = _a.showGrid, _c = _a.style, containerStyle = _c.containerStyle, cropAreaStyle = _c.cropAreaStyle, mediaStyle = _c.mediaStyle, _d = _a.classes, containerClassName = _d.containerClassName, cropAreaClassName = _d.cropAreaClassName, mediaClassName = _d.mediaClassName; var objectFit = this.state.mediaObjectFit; return external_React_.createElement("div", { onMouseDown: this.onMouseDown, onTouchStart: this.onTouchStart, ref: function ref(el) { return _this.containerRef = el; }, "data-testid": "container", style: containerStyle, className: classNames('reactEasyCrop_Container', containerClassName) }, image ? external_React_.createElement("img", __assign({ alt: "", className: classNames('reactEasyCrop_Image', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName) }, mediaProps, { src: image, ref: this.imageRef, style: __assign(__assign({}, mediaStyle), { transform: transform || "translate(".concat(x, "px, ").concat(y, "px) rotate(").concat(rotation, "deg) scale(").concat(zoom, ")") }), onLoad: this.onMediaLoad })) : video && external_React_.createElement("video", __assign({ autoPlay: true, loop: true, muted: true, className: classNames('reactEasyCrop_Video', objectFit === 'contain' && 'reactEasyCrop_Contain', objectFit === 'horizontal-cover' && 'reactEasyCrop_Cover_Horizontal', objectFit === 'vertical-cover' && 'reactEasyCrop_Cover_Vertical', mediaClassName) }, mediaProps, { ref: this.videoRef, onLoadedMetadata: this.onMediaLoad, style: __assign(__assign({}, mediaStyle), { transform: transform || "translate(".concat(x, "px, ").concat(y, "px) rotate(").concat(rotation, "deg) scale(").concat(zoom, ")") }), controls: false }), (Array.isArray(video) ? video : [{ src: video }]).map(function (item) { return external_React_.createElement("source", __assign({ key: item.src }, item)); })), this.state.cropSize && external_React_.createElement("div", { style: __assign(__assign({}, cropAreaStyle), { width: this.state.cropSize.width, height: this.state.cropSize.height }), "data-testid": "cropper", className: classNames('reactEasyCrop_CropArea', cropShape === 'round' && 'reactEasyCrop_CropAreaRound', showGrid && 'reactEasyCrop_CropAreaGrid', cropAreaClassName) })); }; Cropper.defaultProps = { zoom: 1, rotation: 0, aspect: 4 / 3, maxZoom: index_module_MAX_ZOOM, minZoom: index_module_MIN_ZOOM, cropShape: 'rect', objectFit: 'contain', showGrid: true, style: {}, classes: {}, mediaProps: {}, zoomSpeed: 1, restrictPosition: true, zoomWithScroll: true }; Cropper.getMousePoint = function (e) { return { x: Number(e.clientX), y: Number(e.clientY) }; }; Cropper.getTouchPoint = function (touch) { return { x: Number(touch.clientX), y: Number(touch.clientY) }; }; return Cropper; }(external_React_.Component); ;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/cropper.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ImageCropper({ url, width, height, naturalHeight, naturalWidth, borderProps }) { const { isInProgress, editedUrl, position, zoom, aspect, setPosition, setCrop, setZoom, rotation } = useImageEditingContext(); const [contentResizeListener, { width: clientWidth }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); let editedHeight = height || clientWidth * naturalHeight / naturalWidth; if (rotation % 180 === 90) { editedHeight = clientWidth * naturalWidth / naturalHeight; } const area = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx('wp-block-image__crop-area', borderProps?.className, { 'is-applying': isInProgress }), style: { ...borderProps?.style, width: width || clientWidth, height: editedHeight }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Cropper, { image: editedUrl || url, disabled: isInProgress, minZoom: MIN_ZOOM / 100, maxZoom: MAX_ZOOM / 100, crop: position, zoom: zoom / 100, aspect: aspect, onCropChange: pos => { setPosition(pos); }, onCropComplete: newCropPercent => { setCrop(newCropPercent); }, onZoomChange: newZoom => { setZoom(newZoom * 100); } }), isInProgress && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [contentResizeListener, area] }); } ;// ./node_modules/@wordpress/icons/build-module/library/search.js /** * WordPress dependencies */ const search = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) }); /* harmony default export */ const library_search = (search); ;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/zoom-dropdown.js /** * WordPress dependencies */ /** * Internal dependencies */ function ZoomDropdown() { const { isInProgress, zoom, setZoom } = useImageEditingContext(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { contentClassName: "wp-block-image__zoom", popoverProps: constants_POPOVER_PROPS, renderToggle: ({ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: library_search, label: (0,external_wp_i18n_namespaceObject.__)('Zoom'), onClick: onToggle, "aria-expanded": isOpen, disabled: isInProgress }), renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { paddingSize: "medium", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Zoom'), min: MIN_ZOOM, max: MAX_ZOOM, value: Math.round(zoom), onChange: setZoom }) }) }); } ;// ./node_modules/@wordpress/icons/build-module/library/rotate-right.js /** * WordPress dependencies */ const rotateRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z" }) }); /* harmony default export */ const rotate_right = (rotateRight); ;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/rotation-button.js /** * WordPress dependencies */ /** * Internal dependencies */ function RotationButton() { const { isInProgress, rotateClockwise } = useImageEditingContext(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: rotate_right, label: (0,external_wp_i18n_namespaceObject.__)('Rotate'), onClick: rotateClockwise, disabled: isInProgress }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/form-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ function FormControls() { const { isInProgress, apply, cancel } = useImageEditingContext(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: apply, disabled: isInProgress, children: (0,external_wp_i18n_namespaceObject.__)('Apply') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: cancel, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/image-editor/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function ImageEditor({ id, url, width, height, naturalHeight, naturalWidth, onSaveImage, onFinishEditing, borderProps }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ImageEditingProvider, { id: id, url: url, naturalWidth: naturalWidth, naturalHeight: naturalHeight, onSaveImage: onSaveImage, onFinishEditing: onFinishEditing, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ImageCropper, { borderProps: borderProps, url: url, width: width, height: height, naturalHeight: naturalHeight, naturalWidth: naturalWidth }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(block_controls, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ZoomDropdown, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: toggleProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AspectRatioDropdown, { toggleProps: toggleProps }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RotationButton, {})] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FormControls, {}) })] })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/image-size-control/use-dimension-handler.js /** * WordPress dependencies */ function useDimensionHandler(customHeight, customWidth, defaultHeight, defaultWidth, onChange) { var _ref, _ref2; const [currentWidth, setCurrentWidth] = (0,external_wp_element_namespaceObject.useState)((_ref = customWidth !== null && customWidth !== void 0 ? customWidth : defaultWidth) !== null && _ref !== void 0 ? _ref : ''); const [currentHeight, setCurrentHeight] = (0,external_wp_element_namespaceObject.useState)((_ref2 = customHeight !== null && customHeight !== void 0 ? customHeight : defaultHeight) !== null && _ref2 !== void 0 ? _ref2 : ''); // When an image is first inserted, the default dimensions are initially // undefined. This effect updates the dimensions when the default values // come through. (0,external_wp_element_namespaceObject.useEffect)(() => { if (customWidth === undefined && defaultWidth !== undefined) { setCurrentWidth(defaultWidth); } if (customHeight === undefined && defaultHeight !== undefined) { setCurrentHeight(defaultHeight); } }, [defaultWidth, defaultHeight]); // If custom values change, it means an outsider has resized the image using some other method (eg resize box) // this keeps track of these values too. We need to parse before comparing; custom values can be strings. (0,external_wp_element_namespaceObject.useEffect)(() => { if (customWidth !== undefined && Number.parseInt(customWidth) !== Number.parseInt(currentWidth)) { setCurrentWidth(customWidth); } if (customHeight !== undefined && Number.parseInt(customHeight) !== Number.parseInt(currentHeight)) { setCurrentHeight(customHeight); } }, [customWidth, customHeight]); const updateDimension = (dimension, value) => { const parsedValue = value === '' ? undefined : parseInt(value, 10); if (dimension === 'width') { setCurrentWidth(parsedValue); } else { setCurrentHeight(parsedValue); } onChange({ [dimension]: parsedValue }); }; const updateDimensions = (nextHeight, nextWidth) => { setCurrentHeight(nextHeight !== null && nextHeight !== void 0 ? nextHeight : defaultHeight); setCurrentWidth(nextWidth !== null && nextWidth !== void 0 ? nextWidth : defaultWidth); onChange({ height: nextHeight, width: nextWidth }); }; return { currentHeight, currentWidth, updateDimension, updateDimensions }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/image-size-control/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const IMAGE_SIZE_PRESETS = [25, 50, 75, 100]; const image_size_control_noop = () => {}; /** * Get scaled width and height for the given scale. * * @param {number} scale The scale to get the scaled width and height for. * @param {number} imageWidth The image width. * @param {number} imageHeight The image height. * * @return {Object} The scaled width and height. */ function getScaledWidthAndHeight(scale, imageWidth, imageHeight) { const scaledWidth = Math.round(imageWidth * (scale / 100)); const scaledHeight = Math.round(imageHeight * (scale / 100)); return { scaledWidth, scaledHeight }; } function ImageSizeControl({ imageSizeHelp, imageWidth, imageHeight, imageSizeOptions = [], isResizable = true, slug, width, height, onChange, onChangeImage = image_size_control_noop }) { const { currentHeight, currentWidth, updateDimension, updateDimensions } = useDimensionHandler(height, width, imageHeight, imageWidth, onChange); /** * Updates the dimensions for the given scale. * Handler for toggle group control change. * * @param {number} scale The scale to update the dimensions for. */ const handleUpdateDimensions = scale => { if (undefined === scale) { updateDimensions(); return; } const { scaledWidth, scaledHeight } = getScaledWidthAndHeight(scale, imageWidth, imageHeight); updateDimensions(scaledHeight, scaledWidth); }; /** * Add the stored image preset value to toggle group control. */ const selectedValue = IMAGE_SIZE_PRESETS.find(scale => { const { scaledWidth, scaledHeight } = getScaledWidthAndHeight(scale, imageWidth, imageHeight); return currentWidth === scaledWidth && currentHeight === scaledHeight; }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [imageSizeOptions && imageSizeOptions.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Resolution'), value: slug, options: imageSizeOptions, onChange: onChangeImage, help: imageSizeHelp, size: "__unstable-large" }), isResizable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-image-size-control", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { align: "baseline", spacing: "3", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { className: "block-editor-image-size-control__width", label: (0,external_wp_i18n_namespaceObject.__)('Width'), value: currentWidth, min: 1, onChange: value => updateDimension('width', value), size: "__unstable-large" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { className: "block-editor-image-size-control__height", label: (0,external_wp_i18n_namespaceObject.__)('Height'), value: currentHeight, min: 1, onChange: value => updateDimension('height', value), size: "__unstable-large" })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { label: (0,external_wp_i18n_namespaceObject.__)('Image size presets'), hideLabelFromVision: true, onChange: handleUpdateDimensions, value: selectedValue, isBlock: true, __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, children: IMAGE_SIZE_PRESETS.map(scale => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: scale, label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: Percentage value. */ (0,external_wp_i18n_namespaceObject.__)('%d%%'), scale) }, scale); }) })] })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-viewer-url.js /** * External dependencies */ /** * WordPress dependencies */ function LinkViewerURL({ url, urlLabel, className }) { const linkClassName = dist_clsx(className, 'block-editor-url-popover__link-viewer-url'); if (!url) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: linkClassName }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { className: linkClassName, href: url, children: urlLabel || (0,external_wp_url_namespaceObject.filterURLForDisplay)((0,external_wp_url_namespaceObject.safeDecodeURI)(url)) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-viewer.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function LinkViewer({ className, linkClassName, onEditLinkClick, url, urlLabel, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx('block-editor-url-popover__link-viewer', className), ...props, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkViewerURL, { url: url, urlLabel: urlLabel, className: linkClassName }), onEditLinkClick && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { icon: edit, label: (0,external_wp_i18n_namespaceObject.__)('Edit'), onClick: onEditLinkClick, size: "compact" })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/url-popover/link-editor.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function LinkEditor({ autocompleteRef, className, onChangeInputValue, value, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { className: dist_clsx('block-editor-url-popover__link-editor', className), ...props, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(url_input, { value: value, onChange: onChangeInputValue, autocompleteRef: autocompleteRef }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { icon: keyboard_return, label: (0,external_wp_i18n_namespaceObject.__)('Apply'), type: "submit", size: "compact" })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/url-popover/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { __experimentalPopoverLegacyPositionToPlacement } = unlock(external_wp_components_namespaceObject.privateApis); const DEFAULT_PLACEMENT = 'bottom'; const URLPopover = (0,external_wp_element_namespaceObject.forwardRef)(({ additionalControls, children, renderSettings, // The DEFAULT_PLACEMENT value is assigned inside the function's body placement, focusOnMount = 'firstElement', // Deprecated position, // Rest ...popoverProps }, ref) => { if (position !== undefined) { external_wp_deprecated_default()('`position` prop in wp.blockEditor.URLPopover', { since: '6.2', alternative: '`placement` prop' }); } // Compute popover's placement: // - give priority to `placement` prop, if defined // - otherwise, compute it from the legacy `position` prop (if defined) // - finally, fallback to the DEFAULT_PLACEMENT. let computedPlacement; if (placement !== undefined) { computedPlacement = placement; } else if (position !== undefined) { computedPlacement = __experimentalPopoverLegacyPositionToPlacement(position); } computedPlacement = computedPlacement || DEFAULT_PLACEMENT; const [isSettingsExpanded, setIsSettingsExpanded] = (0,external_wp_element_namespaceObject.useState)(false); const showSettings = !!renderSettings && isSettingsExpanded; const toggleSettingsVisibility = () => { setIsSettingsExpanded(!isSettingsExpanded); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Popover, { ref: ref, role: "dialog", "aria-modal": "true", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Edit URL'), className: "block-editor-url-popover", focusOnMount: focusOnMount, placement: computedPlacement, shift: true, variant: "toolbar", ...popoverProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-url-popover__input-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-url-popover__row", children: [children, !!renderSettings && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "block-editor-url-popover__settings-toggle", icon: chevron_down, label: (0,external_wp_i18n_namespaceObject.__)('Link settings'), onClick: toggleSettingsVisibility, "aria-expanded": isSettingsExpanded, size: "compact" })] }) }), showSettings && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-url-popover__settings", children: renderSettings() }), additionalControls && !showSettings && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-url-popover__additional-controls", children: additionalControls })] }); }); URLPopover.LinkEditor = LinkEditor; URLPopover.LinkViewer = LinkViewer; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-popover/README.md */ /* harmony default export */ const url_popover = (URLPopover); ;// ./node_modules/@wordpress/block-editor/build-module/components/media-placeholder/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const media_placeholder_noop = () => {}; const InsertFromURLPopover = ({ src, onChange, onSubmit, onClose, popoverAnchor }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(url_popover, { anchor: popoverAnchor, onClose: onClose, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { className: "block-editor-media-placeholder__url-input-form", onSubmit: onSubmit, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('URL'), type: "url", hideLabelFromVision: true, placeholder: (0,external_wp_i18n_namespaceObject.__)('Paste or type URL'), onChange: onChange, value: src, suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, { variant: "control", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "small", icon: keyboard_return, label: (0,external_wp_i18n_namespaceObject.__)('Apply'), type: "submit" }) }) }) }) }); const URLSelectionUI = ({ src, onChangeSrc, onSelectURL }) => { // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); const [isURLInputVisible, setIsURLInputVisible] = (0,external_wp_element_namespaceObject.useState)(false); const openURLInput = () => { setIsURLInputVisible(true); }; const closeURLInput = () => { setIsURLInputVisible(false); popoverAnchor?.focus(); }; const onSubmitSrc = event => { event.preventDefault(); if (src && onSelectURL) { onSelectURL(src); closeURLInput(); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-media-placeholder__url-input-container", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: "block-editor-media-placeholder__button", onClick: openURLInput, isPressed: isURLInputVisible, variant: "secondary", "aria-haspopup": "dialog", ref: setPopoverAnchor, children: (0,external_wp_i18n_namespaceObject.__)('Insert from URL') }), isURLInputVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InsertFromURLPopover, { src: src, onChange: onChangeSrc, onSubmit: onSubmitSrc, onClose: closeURLInput, popoverAnchor: popoverAnchor })] }); }; function MediaPlaceholder({ value = {}, allowedTypes, className, icon, labels = {}, mediaPreview, notices, isAppender, accept, addToGallery, multiple = false, handleUpload = true, disableDropZone, disableMediaButtons, onError, onSelect, onCancel, onSelectURL, onToggleFeaturedImage, onDoubleClick, onFilesPreUpload = media_placeholder_noop, onHTMLDrop: deprecatedOnHTMLDrop, children, mediaLibraryButton, placeholder, style }) { if (deprecatedOnHTMLDrop) { external_wp_deprecated_default()('wp.blockEditor.MediaPlaceholder onHTMLDrop prop', { since: '6.2', version: '6.4' }); } const mediaUpload = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(store); return getSettings().mediaUpload; }, []); const [src, setSrc] = (0,external_wp_element_namespaceObject.useState)(''); (0,external_wp_element_namespaceObject.useEffect)(() => { var _value$src; setSrc((_value$src = value?.src) !== null && _value$src !== void 0 ? _value$src : ''); }, [value?.src]); const onlyAllowsImages = () => { if (!allowedTypes || allowedTypes.length === 0) { return false; } return allowedTypes.every(allowedType => allowedType === 'image' || allowedType.startsWith('image/')); }; const onFilesUpload = files => { if (!handleUpload || typeof handleUpload === 'function' && !handleUpload(files)) { return onSelect(files); } onFilesPreUpload(files); let setMedia; if (multiple) { if (addToGallery) { // Since the setMedia function runs multiple times per upload group // and is passed newMedia containing every item in its group each time, we must // filter out whatever this upload group had previously returned to the // gallery before adding and returning the image array with replacement newMedia // values. // Define an array to store urls from newMedia between subsequent function calls. let lastMediaPassed = []; setMedia = newMedia => { // Remove any images this upload group is responsible for (lastMediaPassed). // Their replacements are contained in newMedia. const filteredMedia = (value !== null && value !== void 0 ? value : []).filter(item => { // If Item has id, only remove it if lastMediaPassed has an item with that id. if (item.id) { return !lastMediaPassed.some( // Be sure to convert to number for comparison. ({ id }) => Number(id) === Number(item.id)); } // Compare transient images via .includes since gallery may append extra info onto the url. return !lastMediaPassed.some(({ urlSlug }) => item.url.includes(urlSlug)); }); // Return the filtered media array along with newMedia. onSelect(filteredMedia.concat(newMedia)); // Reset lastMediaPassed and set it with ids and urls from newMedia. lastMediaPassed = newMedia.map(media => { // Add everything up to '.fileType' to compare via .includes. const cutOffIndex = media.url.lastIndexOf('.'); const urlSlug = media.url.slice(0, cutOffIndex); return { id: media.id, urlSlug }; }); }; } else { setMedia = onSelect; } } else { setMedia = ([media]) => onSelect(media); } mediaUpload({ allowedTypes, filesList: files, onFileChange: setMedia, onError, multiple }); }; async function handleBlocksDrop(event) { const { blocks } = parseDropEvent(event); if (!blocks?.length) { return; } const uploadedMediaList = await Promise.all(blocks.map(block => { const blockType = block.name.split('/')[1]; if (block.attributes.id) { block.attributes.type = blockType; return block.attributes; } return new Promise((resolve, reject) => { window.fetch(block.attributes.url).then(response => response.blob()).then(blob => mediaUpload({ filesList: [blob], additionalData: { title: block.attributes.title, alt_text: block.attributes.alt, caption: block.attributes.caption, type: blockType }, onFileChange: ([media]) => { if (media.id) { resolve(media); } }, allowedTypes, onError: reject })).catch(() => resolve(block.attributes.url)); }); })).catch(err => onError(err)); if (multiple) { onSelect(uploadedMediaList); } else { onSelect(uploadedMediaList[0]); } } const onUpload = event => { onFilesUpload(event.target.files); }; const defaultRenderPlaceholder = content => { let { instructions, title } = labels; if (!mediaUpload && !onSelectURL) { instructions = (0,external_wp_i18n_namespaceObject.__)('To edit this block, you need permission to upload media.'); } if (instructions === undefined || title === undefined) { const typesAllowed = allowedTypes !== null && allowedTypes !== void 0 ? allowedTypes : []; const [firstAllowedType] = typesAllowed; const isOneType = 1 === typesAllowed.length; const isAudio = isOneType && 'audio' === firstAllowedType; const isImage = isOneType && 'image' === firstAllowedType; const isVideo = isOneType && 'video' === firstAllowedType; if (instructions === undefined && mediaUpload) { instructions = (0,external_wp_i18n_namespaceObject.__)('Drag and drop an image or video, upload, or choose from your library.'); if (isAudio) { instructions = (0,external_wp_i18n_namespaceObject.__)('Drag and drop an audio file, upload, or choose from your library.'); } else if (isImage) { instructions = (0,external_wp_i18n_namespaceObject.__)('Drag and drop an image, upload, or choose from your library.'); } else if (isVideo) { instructions = (0,external_wp_i18n_namespaceObject.__)('Drag and drop a video, upload, or choose from your library.'); } } if (title === undefined) { title = (0,external_wp_i18n_namespaceObject.__)('Media'); if (isAudio) { title = (0,external_wp_i18n_namespaceObject.__)('Audio'); } else if (isImage) { title = (0,external_wp_i18n_namespaceObject.__)('Image'); } else if (isVideo) { title = (0,external_wp_i18n_namespaceObject.__)('Video'); } } } const placeholderClassName = dist_clsx('block-editor-media-placeholder', className, { 'is-appender': isAppender }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { icon: icon, label: title, instructions: instructions, className: placeholderClassName, notices: notices, onDoubleClick: onDoubleClick, preview: mediaPreview, style: style, children: [content, children] }); }; const renderPlaceholder = placeholder !== null && placeholder !== void 0 ? placeholder : defaultRenderPlaceholder; const renderDropZone = () => { if (disableDropZone) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, { onFilesDrop: onFilesUpload, onDrop: handleBlocksDrop, isEligible: dataTransfer => { const prefix = 'wp-block:core/'; const types = []; for (const type of dataTransfer.types) { if (type.startsWith(prefix)) { types.push(type.slice(prefix.length)); } } return types.every(type => allowedTypes.includes(type)) && (multiple ? true : types.length === 1); } }); }; const renderCancelLink = () => { return onCancel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: "block-editor-media-placeholder__cancel-button", title: (0,external_wp_i18n_namespaceObject.__)('Cancel'), variant: "link", onClick: onCancel, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }); }; const renderUrlSelectionUI = () => { return onSelectURL && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(URLSelectionUI, { src: src, onChangeSrc: setSrc, onSelectURL: onSelectURL }); }; const renderFeaturedImageToggle = () => { return onToggleFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-media-placeholder__url-input-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: "block-editor-media-placeholder__button", onClick: onToggleFeaturedImage, variant: "secondary", children: (0,external_wp_i18n_namespaceObject.__)('Use featured image') }) }); }; const renderMediaUploadChecked = () => { const defaultButton = ({ open }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: () => { open(); }, children: (0,external_wp_i18n_namespaceObject.__)('Media Library') }); }; const libraryButton = mediaLibraryButton !== null && mediaLibraryButton !== void 0 ? mediaLibraryButton : defaultButton; const uploadMediaLibraryButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(media_upload, { addToGallery: addToGallery, gallery: multiple && onlyAllowsImages(), multiple: multiple, onSelect: onSelect, allowedTypes: allowedTypes, mode: "browse", value: Array.isArray(value) ? value.map(({ id }) => id) : value.id, render: libraryButton }); if (mediaUpload && isAppender) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [renderDropZone(), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormFileUpload, { onChange: onUpload, accept: accept, multiple: !!multiple, render: ({ openFileDialog }) => { const content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", className: dist_clsx('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'), onClick: openFileDialog, children: (0,external_wp_i18n_namespaceObject._x)('Upload', 'verb') }), uploadMediaLibraryButton, renderUrlSelectionUI(), renderFeaturedImageToggle(), renderCancelLink()] }); return renderPlaceholder(content); } })] }); } if (mediaUpload) { const content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [renderDropZone(), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormFileUpload, { render: ({ openFileDialog }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, onClick: openFileDialog, variant: "primary", className: dist_clsx('block-editor-media-placeholder__button', 'block-editor-media-placeholder__upload-button'), children: (0,external_wp_i18n_namespaceObject._x)('Upload', 'verb') }), onChange: onUpload, accept: accept, multiple: !!multiple }), uploadMediaLibraryButton, renderUrlSelectionUI(), renderFeaturedImageToggle(), renderCancelLink()] }); return renderPlaceholder(content); } return renderPlaceholder(uploadMediaLibraryButton); }; if (disableMediaButtons) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(check, { children: renderDropZone() }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(check, { fallback: renderPlaceholder(renderUrlSelectionUI()), children: renderMediaUploadChecked() }); } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/media-placeholder/README.md */ /* harmony default export */ const media_placeholder = ((0,external_wp_components_namespaceObject.withFilters)('editor.MediaPlaceholder')(MediaPlaceholder)); ;// ./node_modules/@wordpress/block-editor/build-module/components/panel-color-settings/index.js /** * Internal dependencies */ const PanelColorSettings = ({ colorSettings, ...props }) => { const settings = colorSettings.map(setting => { if (!setting) { return setting; } const { value, onChange, ...otherSettings } = setting; return { ...otherSettings, colorValue: value, onColorChange: onChange }; }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(panel_color_gradient_settings, { settings: settings, gradients: [], disableCustomGradients: true, ...props }); }; /* harmony default export */ const panel_color_settings = (PanelColorSettings); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-toolbar/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const format_toolbar_POPOVER_PROPS = { placement: 'bottom-start' }; const FormatToolbar = () => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [['bold', 'italic', 'link', 'unknown'].map(format => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: `RichText.ToolbarControls.${format}` }, format)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Slot, { name: "RichText.ToolbarControls", children: fills => { if (!fills.length) { return null; } const allProps = fills.map(([{ props }]) => props); const hasActive = allProps.some(({ isActive }) => isActive); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { children: toggleProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { icon: chevron_down /* translators: button label text should, if possible, be under 16 characters. */, label: (0,external_wp_i18n_namespaceObject.__)('More'), toggleProps: { ...toggleProps, className: dist_clsx(toggleProps.className, { 'is-pressed': hasActive }), description: (0,external_wp_i18n_namespaceObject.__)('Displays more block tools') }, controls: orderBy(fills.map(([{ props }]) => props), 'title'), popoverProps: format_toolbar_POPOVER_PROPS }) }); } })] }); }; /* harmony default export */ const format_toolbar = (FormatToolbar); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-toolbar-container.js /** * WordPress dependencies */ /** * Internal dependencies */ function InlineToolbar({ popoverAnchor }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { placement: "top", focusOnMount: false, anchor: popoverAnchor, className: "block-editor-rich-text__inline-format-toolbar", __unstableSlotName: "block-toolbar", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigableToolbar, { className: "block-editor-rich-text__inline-format-toolbar-group" /* translators: accessibility text for the inline format toolbar */, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Format tools'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(format_toolbar, {}) }) }) }); } const FormatToolbarContainer = ({ inline, editableContentElement }) => { if (inline) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InlineToolbar, { popoverAnchor: editableContentElement }); } // Render regular toolbar. return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_controls, { group: "inline", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(format_toolbar, {}) }); }; /* harmony default export */ const format_toolbar_container = (FormatToolbarContainer); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-mark-persistent.js /** * WordPress dependencies */ /** * Internal dependencies */ function useMarkPersistent({ html, value }) { const previousTextRef = (0,external_wp_element_namespaceObject.useRef)(); const hasActiveFormats = !!value.activeFormats?.length; const { __unstableMarkLastChangeAsPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(store); // Must be set synchronously to make sure it applies to the last change. (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { // Ignore mount. if (!previousTextRef.current) { previousTextRef.current = value.text; return; } // Text input, so don't create an undo level for every character. // Create an undo level after 1 second of no input. if (previousTextRef.current !== value.text) { const timeout = window.setTimeout(() => { __unstableMarkLastChangeAsPersistent(); }, 1000); previousTextRef.current = value.text; return () => { window.clearTimeout(timeout); }; } __unstableMarkLastChangeAsPersistent(); }, [html, hasActiveFormats]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/use-format-types.js /** * WordPress dependencies */ function formatTypesSelector(select) { return select(external_wp_richText_namespaceObject.store).getFormatTypes(); } /** * Set of all interactive content tags. * * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content */ const interactiveContentTags = new Set(['a', 'audio', 'button', 'details', 'embed', 'iframe', 'input', 'label', 'select', 'textarea', 'video']); function prefixSelectKeys(selected, prefix) { if (typeof selected !== 'object') { return { [prefix]: selected }; } return Object.fromEntries(Object.entries(selected).map(([key, value]) => [`${prefix}.${key}`, value])); } function getPrefixedSelectKeys(selected, prefix) { if (selected[prefix]) { return selected[prefix]; } return Object.keys(selected).filter(key => key.startsWith(prefix + '.')).reduce((accumulator, key) => { accumulator[key.slice(prefix.length + 1)] = selected[key]; return accumulator; }, {}); } /** * This hook provides RichText with the `formatTypes` and its derived props from * experimental format type settings. * * @param {Object} $0 Options * @param {string} $0.clientId Block client ID. * @param {string} $0.identifier Block attribute. * @param {boolean} $0.withoutInteractiveFormatting Whether to clean the interactive formatting or not. * @param {Array} $0.allowedFormats Allowed formats */ function useFormatTypes({ clientId, identifier, withoutInteractiveFormatting, allowedFormats }) { const allFormatTypes = (0,external_wp_data_namespaceObject.useSelect)(formatTypesSelector, []); const formatTypes = (0,external_wp_element_namespaceObject.useMemo)(() => { return allFormatTypes.filter(({ name, interactive, tagName }) => { if (allowedFormats && !allowedFormats.includes(name)) { return false; } if (withoutInteractiveFormatting && (interactive || interactiveContentTags.has(tagName))) { return false; } return true; }); }, [allFormatTypes, allowedFormats, withoutInteractiveFormatting]); const keyedSelected = (0,external_wp_data_namespaceObject.useSelect)(select => formatTypes.reduce((accumulator, type) => { if (!type.__experimentalGetPropsForEditableTreePreparation) { return accumulator; } return { ...accumulator, ...prefixSelectKeys(type.__experimentalGetPropsForEditableTreePreparation(select, { richTextIdentifier: identifier, blockClientId: clientId }), type.name) }; }, {}), [formatTypes, clientId, identifier]); const dispatch = (0,external_wp_data_namespaceObject.useDispatch)(); const prepareHandlers = []; const valueHandlers = []; const changeHandlers = []; const dependencies = []; for (const key in keyedSelected) { dependencies.push(keyedSelected[key]); } formatTypes.forEach(type => { if (type.__experimentalCreatePrepareEditableTree) { const handler = type.__experimentalCreatePrepareEditableTree(getPrefixedSelectKeys(keyedSelected, type.name), { richTextIdentifier: identifier, blockClientId: clientId }); if (type.__experimentalCreateOnChangeEditableValue) { valueHandlers.push(handler); } else { prepareHandlers.push(handler); } } if (type.__experimentalCreateOnChangeEditableValue) { let dispatchers = {}; if (type.__experimentalGetPropsForEditableTreeChangeHandler) { dispatchers = type.__experimentalGetPropsForEditableTreeChangeHandler(dispatch, { richTextIdentifier: identifier, blockClientId: clientId }); } const selected = getPrefixedSelectKeys(keyedSelected, type.name); changeHandlers.push(type.__experimentalCreateOnChangeEditableValue({ ...(typeof selected === 'object' ? selected : {}), ...dispatchers }, { richTextIdentifier: identifier, blockClientId: clientId })); } }); return { formatTypes, prepareHandlers, valueHandlers, changeHandlers, dependencies }; } ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/before-input-rules.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * When typing over a selection, the selection will we wrapped by a matching * character pair. The second character is optional, it defaults to the first * character. * * @type {string[]} Array of character pairs. */ const wrapSelectionSettings = ['`', '"', "'", '“”', '‘’']; /* harmony default export */ const before_input_rules = (props => element => { function onInput(event) { const { inputType, data } = event; const { value, onChange, registry } = props.current; // Only run the rules when inserting text. if (inputType !== 'insertText') { return; } if ((0,external_wp_richText_namespaceObject.isCollapsed)(value)) { return; } const pair = (0,external_wp_hooks_namespaceObject.applyFilters)('blockEditor.wrapSelectionSettings', wrapSelectionSettings).find(([startChar, endChar]) => startChar === data || endChar === data); if (!pair) { return; } const [startChar, endChar = startChar] = pair; const start = value.start; const end = value.end + startChar.length; let newValue = (0,external_wp_richText_namespaceObject.insert)(value, startChar, start, start); newValue = (0,external_wp_richText_namespaceObject.insert)(newValue, endChar, end, end); const { __unstableMarkLastChangeAsPersistent, __unstableMarkAutomaticChange } = registry.dispatch(store); __unstableMarkLastChangeAsPersistent(); onChange(newValue); __unstableMarkAutomaticChange(); const init = {}; for (const key in event) { init[key] = event[key]; } init.data = endChar; const { ownerDocument } = element; const { defaultView } = ownerDocument; const newEvent = new defaultView.InputEvent('input', init); // Dispatch an `input` event with the new data. This will trigger the // input rules. // Postpone the `input` to the next event loop tick so that the dispatch // doesn't happen synchronously in the middle of `beforeinput` dispatch. // This is closer to how native `input` event would be timed, and also // makes sure that the `input` event is dispatched only after the `onChange` // call few lines above has fully updated the data store state and rerendered // all affected components. window.queueMicrotask(() => { event.target.dispatchEvent(newEvent); }); event.preventDefault(); } element.addEventListener('beforeinput', onInput); return () => { element.removeEventListener('beforeinput', onInput); }; }); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/prevent-event-discovery.js /** * WordPress dependencies */ function preventEventDiscovery(value) { const searchText = 'tales of gutenberg'; const addText = ' 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️'; const { start, text } = value; if (start < searchText.length) { return value; } const charactersBefore = text.slice(start - searchText.length, start); if (charactersBefore.toLowerCase() !== searchText) { return value; } return (0,external_wp_richText_namespaceObject.insert)(value, addText); } ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/input-rules.js /** * WordPress dependencies */ /** * Internal dependencies */ function findSelection(blocks) { let i = blocks.length; while (i--) { const attributeKey = retrieveSelectedAttribute(blocks[i].attributes); if (attributeKey) { blocks[i].attributes[attributeKey] = blocks[i].attributes[attributeKey] // To do: refactor this to use rich text's selection instead, so // we no longer have to use on this hack inserting a special // character. .toString().replace(START_OF_SELECTED_AREA, ''); return [blocks[i].clientId, attributeKey, 0, 0]; } const nestedSelection = findSelection(blocks[i].innerBlocks); if (nestedSelection) { return nestedSelection; } } return []; } /* harmony default export */ const input_rules = (props => element => { function inputRule() { const { getValue, onReplace, selectionChange, registry } = props.current; if (!onReplace) { return; } // We must use getValue() here because value may be update // asynchronously. const value = getValue(); const { start, text } = value; const characterBefore = text.slice(start - 1, start); // The character right before the caret must be a plain space. if (characterBefore !== ' ') { return; } const trimmedTextBefore = text.slice(0, start).trim(); const prefixTransforms = (0,external_wp_blocks_namespaceObject.getBlockTransforms)('from').filter(({ type }) => type === 'prefix'); const transformation = (0,external_wp_blocks_namespaceObject.findTransform)(prefixTransforms, ({ prefix }) => { return trimmedTextBefore === prefix; }); if (!transformation) { return; } const content = (0,external_wp_richText_namespaceObject.toHTMLString)({ value: (0,external_wp_richText_namespaceObject.insert)(value, START_OF_SELECTED_AREA, 0, start) }); const block = transformation.transform(content); selectionChange(...findSelection([block])); onReplace([block]); registry.dispatch(store).__unstableMarkAutomaticChange(); return true; } function onInput(event) { const { inputType, type } = event; const { getValue, onChange, __unstableAllowPrefixTransformations, formatTypes, registry } = props.current; // Only run input rules when inserting text. if (inputType !== 'insertText' && type !== 'compositionend') { return; } if (__unstableAllowPrefixTransformations && inputRule()) { return; } const value = getValue(); const transformed = formatTypes.reduce((accumulator, { __unstableInputRule }) => { if (__unstableInputRule) { accumulator = __unstableInputRule(accumulator); } return accumulator; }, preventEventDiscovery(value)); const { __unstableMarkLastChangeAsPersistent, __unstableMarkAutomaticChange } = registry.dispatch(store); if (transformed !== value) { __unstableMarkLastChangeAsPersistent(); onChange({ ...transformed, activeFormats: value.activeFormats }); __unstableMarkAutomaticChange(); } } element.addEventListener('input', onInput); element.addEventListener('compositionend', onInput); return () => { element.removeEventListener('input', onInput); element.removeEventListener('compositionend', onInput); }; }); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/insert-replacement-text.js /** * Internal dependencies */ /** * When the browser is about to auto correct, add an undo level so the user can * revert the change. * * @param {Object} props */ /* harmony default export */ const insert_replacement_text = (props => element => { function onInput(event) { if (event.inputType !== 'insertReplacementText') { return; } const { registry } = props.current; registry.dispatch(store).__unstableMarkLastChangeAsPersistent(); } element.addEventListener('beforeinput', onInput); return () => { element.removeEventListener('beforeinput', onInput); }; }); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.js /** * WordPress dependencies */ /** * Hook to prevent default behaviors for key combinations otherwise handled * internally by RichText. */ /* harmony default export */ const remove_browser_shortcuts = (() => node => { function onKeydown(event) { if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'z') || external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'y') || external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, 'z')) { event.preventDefault(); } } node.addEventListener('keydown', onKeydown); return () => { node.removeEventListener('keydown', onKeydown); }; }); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/shortcuts.js /* harmony default export */ const shortcuts = (props => element => { const { keyboardShortcuts } = props.current; function onKeyDown(event) { for (const keyboardShortcut of keyboardShortcuts.current) { keyboardShortcut(event); } } element.addEventListener('keydown', onKeyDown); return () => { element.removeEventListener('keydown', onKeyDown); }; }); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/input-events.js /* harmony default export */ const input_events = (props => element => { const { inputEvents } = props.current; function onInput(event) { for (const keyboardShortcut of inputEvents.current) { keyboardShortcut(event); } } element.addEventListener('input', onInput); return () => { element.removeEventListener('input', onInput); }; }); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/undo-automatic-change.js /** * WordPress dependencies */ /** * Internal dependencies */ /* harmony default export */ const undo_automatic_change = (props => element => { function onKeyDown(event) { const { keyCode } = event; if (event.defaultPrevented) { return; } if (keyCode !== external_wp_keycodes_namespaceObject.BACKSPACE && keyCode !== external_wp_keycodes_namespaceObject.ESCAPE) { return; } const { registry } = props.current; const { didAutomaticChange, getSettings } = registry.select(store); const { __experimentalUndo } = getSettings(); if (!__experimentalUndo) { return; } if (!didAutomaticChange()) { return; } event.preventDefault(); __experimentalUndo(); } element.addEventListener('keydown', onKeyDown); return () => { element.removeEventListener('keydown', onKeyDown); }; }); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/utils.js /** * WordPress dependencies */ function addActiveFormats(value, activeFormats) { if (activeFormats?.length) { let index = value.formats.length; while (index--) { value.formats[index] = [...activeFormats, ...(value.formats[index] || [])]; } } } /** * Get the multiline tag based on the multiline prop. * * @param {?(string|boolean)} multiline The multiline prop. * * @return {string | undefined} The multiline tag. */ function getMultilineTag(multiline) { if (multiline !== true && multiline !== 'p' && multiline !== 'li') { return; } return multiline === true ? 'p' : multiline; } function getAllowedFormats({ allowedFormats, disableFormats }) { if (disableFormats) { return getAllowedFormats.EMPTY_ARRAY; } return allowedFormats; } getAllowedFormats.EMPTY_ARRAY = []; /** * Creates a link from pasted URL. * Creates a paragraph block containing a link to the URL, and calls `onReplace`. * * @param {string} url The URL that could not be embedded. * @param {Function} onReplace Function to call with the created fallback block. */ function createLinkInParagraph(url, onReplace) { const link = /*#__PURE__*/_jsx("a", { href: url, children: url }); onReplace(createBlock('core/paragraph', { content: renderToString(link) })); } ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/paste-handler.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('@wordpress/rich-text').RichTextValue} RichTextValue */ /* harmony default export */ const paste_handler = (props => element => { function _onPaste(event) { const { disableFormats, onChange, value, formatTypes, tagName, onReplace, __unstableEmbedURLOnPaste, preserveWhiteSpace, pastePlainText } = props.current; // The event listener is attached to the window, so we need to check if // the target is the element or inside the element. if (!element.contains(event.target)) { return; } if (event.defaultPrevented) { return; } const { plainText, html } = getPasteEventData(event); event.preventDefault(); // Allows us to ask for this information when we get a report. window.console.log('Received HTML:\n\n', html); window.console.log('Received plain text:\n\n', plainText); if (disableFormats) { onChange((0,external_wp_richText_namespaceObject.insert)(value, plainText)); return; } const isInternal = event.clipboardData.getData('rich-text') === 'true'; function pasteInline(content) { const transformed = formatTypes.reduce((accumulator, { __unstablePasteRule }) => { // Only allow one transform. if (__unstablePasteRule && accumulator === value) { accumulator = __unstablePasteRule(value, { html, plainText }); } return accumulator; }, value); if (transformed !== value) { onChange(transformed); } else { const valueToInsert = (0,external_wp_richText_namespaceObject.create)({ html: content }); addActiveFormats(valueToInsert, value.activeFormats); onChange((0,external_wp_richText_namespaceObject.insert)(value, valueToInsert)); } } // If the data comes from a rich text instance, we can directly use it // without filtering the data. The filters are only meant for externally // pasted content and remove inline styles. if (isInternal) { pasteInline(html); return; } if (pastePlainText) { onChange((0,external_wp_richText_namespaceObject.insert)(value, (0,external_wp_richText_namespaceObject.create)({ text: plainText }))); return; } let mode = 'INLINE'; const trimmedPlainText = plainText.trim(); if (__unstableEmbedURLOnPaste && (0,external_wp_richText_namespaceObject.isEmpty)(value) && (0,external_wp_url_namespaceObject.isURL)(trimmedPlainText) && // For the link pasting feature, allow only http(s) protocols. /^https?:/.test(trimmedPlainText)) { mode = 'BLOCKS'; } const content = (0,external_wp_blocks_namespaceObject.pasteHandler)({ HTML: html, plainText, mode, tagName, preserveWhiteSpace }); if (typeof content === 'string') { pasteInline(content); } else if (content.length > 0) { if (onReplace && (0,external_wp_richText_namespaceObject.isEmpty)(value)) { onReplace(content, content.length - 1, -1); } } } const { defaultView } = element.ownerDocument; // Attach the listener to the window so parent elements have the chance to // prevent the default behavior. defaultView.addEventListener('paste', _onPaste); return () => { defaultView.removeEventListener('paste', _onPaste); }; }); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/delete.js /** * WordPress dependencies */ /* harmony default export */ const event_listeners_delete = (props => element => { function onKeyDown(event) { const { keyCode } = event; if (event.defaultPrevented) { return; } const { value, onMerge, onRemove } = props.current; if (keyCode === external_wp_keycodes_namespaceObject.DELETE || keyCode === external_wp_keycodes_namespaceObject.BACKSPACE) { const { start, end, text } = value; const isReverse = keyCode === external_wp_keycodes_namespaceObject.BACKSPACE; const hasActiveFormats = value.activeFormats && !!value.activeFormats.length; // Only process delete if the key press occurs at an uncollapsed edge. if (!(0,external_wp_richText_namespaceObject.isCollapsed)(value) || hasActiveFormats || isReverse && start !== 0 || !isReverse && end !== text.length) { return; } if (onMerge) { onMerge(!isReverse); } // Only handle remove on Backspace. This serves dual-purpose of being // an intentional user interaction distinguishing between Backspace and // Delete to remove the empty field, but also to avoid merge & remove // causing destruction of two fields (merge, then removed merged). else if (onRemove && (0,external_wp_richText_namespaceObject.isEmpty)(value) && isReverse) { onRemove(!isReverse); } event.preventDefault(); } } element.addEventListener('keydown', onKeyDown); return () => { element.removeEventListener('keydown', onKeyDown); }; }); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/enter.js /** * WordPress dependencies */ /* harmony default export */ const enter = (props => element => { function onKeyDownDeprecated(event) { if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { return; } const { onReplace, onSplit } = props.current; if (onReplace && onSplit) { event.__deprecatedOnSplit = true; } } function onKeyDown(event) { if (event.defaultPrevented) { return; } // The event listener is attached to the window, so we need to check if // the target is the element. if (event.target !== element) { return; } if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { return; } const { value, onChange, disableLineBreaks, onSplitAtEnd, onSplitAtDoubleLineEnd, registry } = props.current; event.preventDefault(); const { text, start, end } = value; if (event.shiftKey) { if (!disableLineBreaks) { onChange((0,external_wp_richText_namespaceObject.insert)(value, '\n')); } } else if (onSplitAtEnd && start === end && end === text.length) { onSplitAtEnd(); } else if ( // For some blocks it's desirable to split at the end of the // block when there are two line breaks at the end of the // block, so triple Enter exits the block. onSplitAtDoubleLineEnd && start === end && end === text.length && text.slice(-2) === '\n\n') { registry.batch(() => { const _value = { ...value }; _value.start = _value.end - 2; onChange((0,external_wp_richText_namespaceObject.remove)(_value)); onSplitAtDoubleLineEnd(); }); } else if (!disableLineBreaks) { onChange((0,external_wp_richText_namespaceObject.insert)(value, '\n')); } } const { defaultView } = element.ownerDocument; // Attach the listener to the window so parent elements have the chance to // prevent the default behavior. defaultView.addEventListener('keydown', onKeyDown); element.addEventListener('keydown', onKeyDownDeprecated); return () => { defaultView.removeEventListener('keydown', onKeyDown); element.removeEventListener('keydown', onKeyDownDeprecated); }; }); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/firefox-compat.js /** * Internal dependencies */ /* harmony default export */ const firefox_compat = (props => element => { function onFocus() { const { registry } = props.current; if (!registry.select(store).isMultiSelecting()) { return; } // This is a little hack to work around focus issues with nested // editable elements in Firefox. For some reason the editable child // element sometimes regains focus, while it should not be focusable // and focus should remain on the editable parent element. // To do: try to find the cause of the shifting focus. const parentEditable = element.parentElement.closest('[contenteditable="true"]'); if (parentEditable) { parentEditable.focus(); } } element.addEventListener('focus', onFocus); return () => { element.removeEventListener('focus', onFocus); }; }); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/event-listeners/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const allEventListeners = [before_input_rules, input_rules, insert_replacement_text, remove_browser_shortcuts, shortcuts, input_events, undo_automatic_change, paste_handler, event_listeners_delete, enter, firefox_compat]; function useEventListeners(props) { const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); (0,external_wp_element_namespaceObject.useInsertionEffect)(() => { propsRef.current = props; }); const refEffects = (0,external_wp_element_namespaceObject.useMemo)(() => allEventListeners.map(refEffect => refEffect(propsRef)), [propsRef]); return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { if (!props.isSelected) { return; } const cleanups = refEffects.map(effect => effect(element)); return () => { cleanups.forEach(cleanup => cleanup()); }; }, [refEffects, props.isSelected]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/format-edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const format_edit_DEFAULT_BLOCK_CONTEXT = {}; const usesContextKey = Symbol('usesContext'); function format_edit_Edit({ onChange, onFocus, value, forwardedRef, settings }) { const { name, edit: EditFunction, [usesContextKey]: usesContext } = settings; const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context); // Assign context values using the block type's declared context needs. const context = (0,external_wp_element_namespaceObject.useMemo)(() => { return usesContext ? Object.fromEntries(Object.entries(blockContext).filter(([key]) => usesContext.includes(key))) : format_edit_DEFAULT_BLOCK_CONTEXT; }, [usesContext, blockContext]); if (!EditFunction) { return null; } const activeFormat = (0,external_wp_richText_namespaceObject.getActiveFormat)(value, name); const isActive = activeFormat !== undefined; const activeObject = (0,external_wp_richText_namespaceObject.getActiveObject)(value); const isObjectActive = activeObject !== undefined && activeObject.type === name; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditFunction, { isActive: isActive, activeAttributes: isActive ? activeFormat.attributes || {} : {}, isObjectActive: isObjectActive, activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {}, value: value, onChange: onChange, onFocus: onFocus, contentRef: forwardedRef, context: context }, name); } function FormatEdit({ formatTypes, ...props }) { return formatTypes.map(settings => /*#__PURE__*/(0,external_React_.createElement)(format_edit_Edit, { settings: settings, ...props, key: settings.name })); } ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/content.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Internal dependencies */ function valueToHTMLString(value, multiline) { if (rich_text.isEmpty(value)) { const multilineTag = getMultilineTag(multiline); return multilineTag ? `<${multilineTag}></${multilineTag}>` : ''; } if (Array.isArray(value)) { external_wp_deprecated_default()('wp.blockEditor.RichText value prop as children type', { since: '6.1', version: '6.3', alternative: 'value prop as string', link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/' }); return external_wp_blocks_namespaceObject.children.toHTML(value); } // To do: deprecate string type. if (typeof value === 'string') { return value; } // To do: create a toReactComponent method on RichTextData, which we // might in the future also use for the editable tree. See // https://github.com/WordPress/gutenberg/pull/41655. return value.toHTMLString(); } function Content({ value, tagName: Tag, multiline, format, ...props }) { value = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: valueToHTMLString(value, multiline) }); return Tag ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...props, children: value }) : value; } ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/multiline.js /** * WordPress dependencies */ /** * Internal dependencies */ function RichTextMultiline({ children, identifier, tagName: TagName = 'div', value = '', onChange, multiline, ...props }, forwardedRef) { external_wp_deprecated_default()('wp.blockEditor.RichText multiline prop', { since: '6.1', version: '6.3', alternative: 'nested blocks (InnerBlocks)', link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/nested-blocks-inner-blocks/' }); const { clientId } = useBlockEditContext(); const { getSelectionStart, getSelectionEnd } = (0,external_wp_data_namespaceObject.useSelect)(store); const { selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(store); const multilineTagName = getMultilineTag(multiline); value = value || `<${multilineTagName}></${multilineTagName}>`; const padded = `</${multilineTagName}>${value}<${multilineTagName}>`; const values = padded.split(`</${multilineTagName}><${multilineTagName}>`); values.shift(); values.pop(); function _onChange(newValues) { onChange(`<${multilineTagName}>${newValues.join(`</${multilineTagName}><${multilineTagName}>`)}</${multilineTagName}>`); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ref: forwardedRef, children: values.map((_value, index) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RichTextWrapper, { identifier: `${identifier}-${index}`, tagName: multilineTagName, value: _value, onChange: newValue => { const newValues = values.slice(); newValues[index] = newValue; _onChange(newValues); }, isSelected: undefined, onKeyDown: event => { if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { return; } event.preventDefault(); const { offset: start } = getSelectionStart(); const { offset: end } = getSelectionEnd(); // Cannot split if there is no selection. if (typeof start !== 'number' || typeof end !== 'number') { return; } const richTextValue = (0,external_wp_richText_namespaceObject.create)({ html: _value }); richTextValue.start = start; richTextValue.end = end; const array = (0,external_wp_richText_namespaceObject.split)(richTextValue).map(v => (0,external_wp_richText_namespaceObject.toHTMLString)({ value: v })); const newValues = values.slice(); newValues.splice(index, 1, ...array); _onChange(newValues); selectionChange(clientId, `${identifier}-${index + 1}`, 0, 0); }, onMerge: forward => { const newValues = values.slice(); let offset = 0; if (forward) { if (!newValues[index + 1]) { return; } newValues.splice(index, 2, newValues[index] + newValues[index + 1]); offset = newValues[index].length - 1; } else { if (!newValues[index - 1]) { return; } newValues.splice(index - 1, 2, newValues[index - 1] + newValues[index]); offset = newValues[index - 1].length - 1; } _onChange(newValues); selectionChange(clientId, `${identifier}-${index - (forward ? 0 : 1)}`, offset, offset); }, ...props }, index); }) }); } /* harmony default export */ const multiline = ((0,external_wp_element_namespaceObject.forwardRef)(RichTextMultiline)); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/with-deprecations.js /** * WordPress dependencies */ /** * Internal dependencies */ function withDeprecations(Component) { return (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { let value = props.value; let onChange = props.onChange; // Handle deprecated format. if (Array.isArray(value)) { external_wp_deprecated_default()('wp.blockEditor.RichText value prop as children type', { since: '6.1', version: '6.3', alternative: 'value prop as string', link: 'https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/introducing-attributes-and-editable-fields/' }); value = external_wp_blocks_namespaceObject.children.toHTML(props.value); onChange = newValue => props.onChange(external_wp_blocks_namespaceObject.children.fromDOM((0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, newValue).childNodes)); } const NewComponent = props.multiline ? multiline : Component; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NewComponent, { ...props, value: value, onChange: onChange, ref: ref }); }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const keyboardShortcutContext = (0,external_wp_element_namespaceObject.createContext)(); const inputEventContext = (0,external_wp_element_namespaceObject.createContext)(); const instanceIdKey = Symbol('instanceId'); /** * Removes props used for the native version of RichText so that they are not * passed to the DOM element and log warnings. * * @param {Object} props Props to filter. * * @return {Object} Filtered props. */ function removeNativeProps(props) { const { __unstableMobileNoFocusOnMount, deleteEnter, placeholderTextColor, textAlign, selectionColor, tagsToEliminate, disableEditingMenu, fontSize, fontFamily, fontWeight, fontStyle, minWidth, maxWidth, disableSuggestions, disableAutocorrection, ...restProps } = props; return restProps; } function RichTextWrapper({ children, tagName = 'div', value: adjustedValue = '', onChange: adjustedOnChange, isSelected: originalIsSelected, multiline, inlineToolbar, wrapperClassName, autocompleters, onReplace, placeholder, allowedFormats, withoutInteractiveFormatting, onRemove, onMerge, onSplit, __unstableOnSplitAtEnd: onSplitAtEnd, __unstableOnSplitAtDoubleLineEnd: onSplitAtDoubleLineEnd, identifier, preserveWhiteSpace, __unstablePastePlainText: pastePlainText, __unstableEmbedURLOnPaste, __unstableDisableFormats: disableFormats, disableLineBreaks, __unstableAllowPrefixTransformations, readOnly, ...props }, forwardedRef) { props = removeNativeProps(props); if (onSplit) { external_wp_deprecated_default()('wp.blockEditor.RichText onSplit prop', { since: '6.4', alternative: 'block.json support key: "splitting"' }); } const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(RichTextWrapper); const anchorRef = (0,external_wp_element_namespaceObject.useRef)(); const context = useBlockEditContext(); const { clientId, isSelected: isBlockSelected, name: blockName } = context; const blockBindings = context[blockBindingsKey]; const blockContext = (0,external_wp_element_namespaceObject.useContext)(block_context); const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const selector = select => { // Avoid subscribing to the block editor store if the block is not // selected. if (!isBlockSelected) { return { isSelected: false }; } const { getSelectionStart, getSelectionEnd } = select(store); const selectionStart = getSelectionStart(); const selectionEnd = getSelectionEnd(); let isSelected; if (originalIsSelected === undefined) { isSelected = selectionStart.clientId === clientId && selectionEnd.clientId === clientId && (identifier ? selectionStart.attributeKey === identifier : selectionStart[instanceIdKey] === instanceId); } else if (originalIsSelected) { isSelected = selectionStart.clientId === clientId; } return { selectionStart: isSelected ? selectionStart.offset : undefined, selectionEnd: isSelected ? selectionEnd.offset : undefined, isSelected }; }; const { selectionStart, selectionEnd, isSelected } = (0,external_wp_data_namespaceObject.useSelect)(selector, [clientId, identifier, instanceId, originalIsSelected, isBlockSelected]); const { disableBoundBlock, bindingsPlaceholder, bindingsLabel } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _fieldsList$relatedBi; if (!blockBindings?.[identifier] || !canBindBlock(blockName)) { return {}; } const relatedBinding = blockBindings[identifier]; const blockBindingsSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(relatedBinding.source); const blockBindingsContext = {}; if (blockBindingsSource?.usesContext?.length) { for (const key of blockBindingsSource.usesContext) { blockBindingsContext[key] = blockContext[key]; } } const _disableBoundBlock = !blockBindingsSource?.canUserEditValue?.({ select, context: blockBindingsContext, args: relatedBinding.args }); // Don't modify placeholders if value is not empty. if (adjustedValue.length > 0) { return { disableBoundBlock: _disableBoundBlock, // Null values will make them fall back to the default behavior. bindingsPlaceholder: null, bindingsLabel: null }; } const { getBlockAttributes } = select(store); const blockAttributes = getBlockAttributes(clientId); const fieldsList = blockBindingsSource?.getFieldsList?.({ select, context: blockBindingsContext }); const bindingKey = (_fieldsList$relatedBi = fieldsList?.[relatedBinding?.args?.key]?.label) !== null && _fieldsList$relatedBi !== void 0 ? _fieldsList$relatedBi : blockBindingsSource?.label; const _bindingsPlaceholder = _disableBoundBlock ? bindingKey : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: connected field label or source label */ (0,external_wp_i18n_namespaceObject.__)('Add %s'), bindingKey); const _bindingsLabel = _disableBoundBlock ? relatedBinding?.args?.key || blockBindingsSource?.label : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: source label or key */ (0,external_wp_i18n_namespaceObject.__)('Empty %s; start writing to edit its value'), relatedBinding?.args?.key || blockBindingsSource?.label); return { disableBoundBlock: _disableBoundBlock, bindingsPlaceholder: blockAttributes?.placeholder || _bindingsPlaceholder, bindingsLabel: _bindingsLabel }; }, [blockBindings, identifier, blockName, adjustedValue, clientId, blockContext]); const shouldDisableEditing = readOnly || disableBoundBlock; const { getSelectionStart, getSelectionEnd, getBlockRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(store); const { selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(store); const adjustedAllowedFormats = getAllowedFormats({ allowedFormats, disableFormats }); const hasFormats = !adjustedAllowedFormats || adjustedAllowedFormats.length > 0; const onSelectionChange = (0,external_wp_element_namespaceObject.useCallback)((start, end) => { const selection = {}; const unset = start === undefined && end === undefined; const baseSelection = { clientId, [identifier ? 'attributeKey' : instanceIdKey]: identifier ? identifier : instanceId }; if (typeof start === 'number' || unset) { // If we are only setting the start (or the end below), which // means a partial selection, and we're not updating a selection // with the same client ID, abort. This means the selected block // is a parent block. if (end === undefined && getBlockRootClientId(clientId) !== getBlockRootClientId(getSelectionEnd().clientId)) { return; } selection.start = { ...baseSelection, offset: start }; } if (typeof end === 'number' || unset) { if (start === undefined && getBlockRootClientId(clientId) !== getBlockRootClientId(getSelectionStart().clientId)) { return; } selection.end = { ...baseSelection, offset: end }; } selectionChange(selection); }, [clientId, getBlockRootClientId, getSelectionEnd, getSelectionStart, identifier, instanceId, selectionChange]); const { formatTypes, prepareHandlers, valueHandlers, changeHandlers, dependencies } = useFormatTypes({ clientId, identifier, withoutInteractiveFormatting, allowedFormats: adjustedAllowedFormats }); function addEditorOnlyFormats(value) { return valueHandlers.reduce((accumulator, fn) => fn(accumulator, value.text), value.formats); } function removeEditorOnlyFormats(value) { formatTypes.forEach(formatType => { // Remove formats created by prepareEditableTree, because they are editor only. if (formatType.__experimentalCreatePrepareEditableTree) { value = (0,external_wp_richText_namespaceObject.removeFormat)(value, formatType.name, 0, value.text.length); } }); return value.formats; } function addInvisibleFormats(value) { return prepareHandlers.reduce((accumulator, fn) => fn(accumulator, value.text), value.formats); } const { value, getValue, onChange, ref: richTextRef } = (0,external_wp_richText_namespaceObject.__unstableUseRichText)({ value: adjustedValue, onChange(html, { __unstableFormats, __unstableText }) { adjustedOnChange(html); Object.values(changeHandlers).forEach(changeHandler => { changeHandler(__unstableFormats, __unstableText); }); }, selectionStart, selectionEnd, onSelectionChange, placeholder: bindingsPlaceholder || placeholder, __unstableIsSelected: isSelected, __unstableDisableFormats: disableFormats, preserveWhiteSpace, __unstableDependencies: [...dependencies, tagName], __unstableAfterParse: addEditorOnlyFormats, __unstableBeforeSerialize: removeEditorOnlyFormats, __unstableAddInvisibleFormats: addInvisibleFormats }); const autocompleteProps = useBlockEditorAutocompleteProps({ onReplace, completers: autocompleters, record: value, onChange }); useMarkPersistent({ html: adjustedValue, value }); const keyboardShortcuts = (0,external_wp_element_namespaceObject.useRef)(new Set()); const inputEvents = (0,external_wp_element_namespaceObject.useRef)(new Set()); function onFocus() { anchorRef.current?.focus(); } const TagName = tagName; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(keyboardShortcutContext.Provider, { value: keyboardShortcuts, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inputEventContext.Provider, { value: inputEvents, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Popover.__unstableSlotNameProvider, { value: "__unstable-block-tools-after", children: [children && children({ value, onChange, onFocus }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FormatEdit, { value: value, onChange: onChange, onFocus: onFocus, formatTypes: formatTypes, forwardedRef: anchorRef })] }) }) }), isSelected && hasFormats && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(format_toolbar_container, { inline: inlineToolbar, editableContentElement: anchorRef.current }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName // Overridable props. , { role: "textbox", "aria-multiline": !disableLineBreaks, "aria-readonly": shouldDisableEditing, ...props, // Unset draggable (coming from block props) for contentEditable // elements because it will interfere with multi block selection // when the contentEditable and draggable elements are the same // element. draggable: undefined, "aria-label": bindingsLabel || props['aria-label'] || placeholder, ...autocompleteProps, ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ // Rich text ref must be first because its focus listener // must be set up before any other ref calls .focus() on // mount. richTextRef, forwardedRef, autocompleteProps.ref, props.ref, useEventListeners({ registry, getValue, onChange, __unstableAllowPrefixTransformations, formatTypes, onReplace, selectionChange, isSelected, disableFormats, value, tagName, onSplit, __unstableEmbedURLOnPaste, pastePlainText, onMerge, onRemove, removeEditorOnlyFormats, disableLineBreaks, onSplitAtEnd, onSplitAtDoubleLineEnd, keyboardShortcuts, inputEvents }), anchorRef]), contentEditable: !shouldDisableEditing, suppressContentEditableWarning: true, className: dist_clsx('block-editor-rich-text__editable', props.className, 'rich-text') // Setting tabIndex to 0 is unnecessary, the element is already // focusable because it's contentEditable. This also fixes a // Safari bug where it's not possible to Shift+Click multi // select blocks when Shift Clicking into an element with // tabIndex because Safari will focus the element. However, // Safari will correctly ignore nested contentEditable elements. , tabIndex: props.tabIndex === 0 && !shouldDisableEditing ? null : props.tabIndex, "data-wp-block-attribute-key": identifier })] }); } // This is the private API for the RichText component. // It allows access to all props, not just the public ones. const PrivateRichText = withDeprecations((0,external_wp_element_namespaceObject.forwardRef)(RichTextWrapper)); PrivateRichText.Content = Content; PrivateRichText.isEmpty = value => { return !value || value.length === 0; }; // This is the public API for the RichText component. // We wrap the PrivateRichText component to hide some props from the public API. /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/rich-text/README.md */ const PublicForwardedRichTextContainer = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { const context = useBlockEditContext(); const isPreviewMode = context[isPreviewModeKey]; if (isPreviewMode) { // Remove all non-content props. const { children, tagName: Tag = 'div', value, onChange, isSelected, multiline, inlineToolbar, wrapperClassName, autocompleters, onReplace, placeholder, allowedFormats, withoutInteractiveFormatting, onRemove, onMerge, onSplit, __unstableOnSplitAtEnd, __unstableOnSplitAtDoubleLineEnd, identifier, preserveWhiteSpace, __unstablePastePlainText, __unstableEmbedURLOnPaste, __unstableDisableFormats, disableLineBreaks, __unstableAllowPrefixTransformations, readOnly, ...contentProps } = removeNativeProps(props); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...contentProps, dangerouslySetInnerHTML: { __html: valueToHTMLString(value, multiline) } }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateRichText, { ref: ref, ...props, readOnly: false }); }); PublicForwardedRichTextContainer.Content = Content; PublicForwardedRichTextContainer.isEmpty = value => { return !value || value.length === 0; }; /* harmony default export */ const rich_text = (PublicForwardedRichTextContainer); ;// ./node_modules/@wordpress/block-editor/build-module/components/editable-text/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const EditableText = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(rich_text, { ref: ref, ...props, __unstableDisableFormats: true }); }); EditableText.Content = ({ value = '', tagName: Tag = 'div', ...props }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...props, children: value }); }; /** * Renders an editable text input in which text formatting is not allowed. */ /* harmony default export */ const editable_text = (EditableText); ;// ./node_modules/@wordpress/block-editor/build-module/components/plain-text/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Render an auto-growing textarea allow users to fill any textual content. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/plain-text/README.md * * @example * ```jsx * import { registerBlockType } from '@wordpress/blocks'; * import { PlainText } from '@wordpress/block-editor'; * * registerBlockType( 'my-plugin/example-block', { * // ... * * attributes: { * content: { * type: 'string', * }, * }, * * edit( { className, attributes, setAttributes } ) { * return ( * <PlainText * className={ className } * value={ attributes.content } * onChange={ ( content ) => setAttributes( { content } ) } * /> * ); * }, * } ); * ```` * * @param {Object} props Component props. * @param {string} props.value String value of the textarea. * @param {Function} props.onChange Function called when the text value changes. * @param {Object} [props.ref] The component forwards the `ref` property to the `TextareaAutosize` component. * @return {Element} Plain text component */ const PlainText = (0,external_wp_element_namespaceObject.forwardRef)(({ __experimentalVersion, ...props }, ref) => { if (__experimentalVersion === 2) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(editable_text, { ref: ref, ...props }); } const { className, onChange, ...remainingProps } = props; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(lib/* default */.A, { ref: ref, className: dist_clsx('block-editor-plain-text', className), onChange: event => onChange(event.target.value), ...remainingProps }); }); /* harmony default export */ const plain_text = (PlainText); ;// ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/label.js /** * WordPress dependencies */ function ResponsiveBlockControlLabel({ property, viewport, desc }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ResponsiveBlockControlLabel); const accessibleLabel = desc || (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: property name. 2: viewport name. */ (0,external_wp_i18n_namespaceObject._x)('Controls the %1$s property for %2$s viewports.', 'Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size.'), property, viewport.label); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-describedby": `rbc-desc-${instanceId}`, children: viewport.label }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "span", id: `rbc-desc-${instanceId}`, children: accessibleLabel })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/responsive-block-control/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ResponsiveBlockControl(props) { const { title, property, toggleLabel, onIsResponsiveChange, renderDefaultControl, renderResponsiveControls, isResponsive = false, defaultLabel = { id: 'all', label: (0,external_wp_i18n_namespaceObject._x)('All', 'screen sizes') }, viewports = [{ id: 'small', label: (0,external_wp_i18n_namespaceObject.__)('Small screens') }, { id: 'medium', label: (0,external_wp_i18n_namespaceObject.__)('Medium screens') }, { id: 'large', label: (0,external_wp_i18n_namespaceObject.__)('Large screens') }] } = props; if (!title || !property || !renderDefaultControl) { return null; } const toggleControlLabel = toggleLabel || (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Property value for the control (eg: margin, padding, etc.). */ (0,external_wp_i18n_namespaceObject.__)('Use the same %s on all screen sizes.'), property); const toggleHelpText = (0,external_wp_i18n_namespaceObject.__)('Choose whether to use the same value for all screen sizes or a unique value for each screen size.'); const defaultControl = renderDefaultControl(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResponsiveBlockControlLabel, { property: property, viewport: defaultLabel }), defaultLabel); const defaultResponsiveControls = () => { return viewports.map(viewport => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.Fragment, { children: renderDefaultControl(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResponsiveBlockControlLabel, { property: property, viewport: viewport }), viewport) }, viewport.id)); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("fieldset", { className: "block-editor-responsive-block-control", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("legend", { className: "block-editor-responsive-block-control__title", children: title }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-responsive-block-control__inner", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, className: "block-editor-responsive-block-control__toggle", label: toggleControlLabel, checked: !isResponsive, onChange: onIsResponsiveChange, help: toggleHelpText }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: dist_clsx('block-editor-responsive-block-control__group', { 'is-responsive': isResponsive }), children: [!isResponsive && defaultControl, isResponsive && (renderResponsiveControls ? renderResponsiveControls(viewports) : defaultResponsiveControls())] })] })] }); } /* harmony default export */ const responsive_block_control = (ResponsiveBlockControl); ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/shortcut.js /** * WordPress dependencies */ /** * Internal dependencies */ function RichTextShortcut({ character, type, onUse }) { const keyboardShortcuts = (0,external_wp_element_namespaceObject.useContext)(keyboardShortcutContext); const onUseRef = (0,external_wp_element_namespaceObject.useRef)(); onUseRef.current = onUse; (0,external_wp_element_namespaceObject.useEffect)(() => { function callback(event) { if (external_wp_keycodes_namespaceObject.isKeyboardEvent[type](event, character)) { onUseRef.current(); event.preventDefault(); } } keyboardShortcuts.current.add(callback); return () => { keyboardShortcuts.current.delete(callback); }; }, [character, type]); return null; } ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/toolbar-button.js /** * WordPress dependencies */ function RichTextToolbarButton({ name, shortcutType, shortcutCharacter, ...props }) { let shortcut; let fillName = 'RichText.ToolbarControls'; if (name) { fillName += `.${name}`; } if (shortcutType && shortcutCharacter) { shortcut = external_wp_keycodes_namespaceObject.displayShortcut[shortcutType](shortcutCharacter); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Fill, { name: fillName, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { ...props, shortcut: shortcut }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/input-event.js /** * WordPress dependencies */ /** * Internal dependencies */ function __unstableRichTextInputEvent({ inputType, onInput }) { const callbacks = (0,external_wp_element_namespaceObject.useContext)(inputEventContext); const onInputRef = (0,external_wp_element_namespaceObject.useRef)(); onInputRef.current = onInput; (0,external_wp_element_namespaceObject.useEffect)(() => { function callback(event) { if (event.inputType === inputType) { onInputRef.current(); event.preventDefault(); } } callbacks.current.add(callback); return () => { callbacks.current.delete(callback); }; }, [inputType]); return null; } ;// ./node_modules/@wordpress/block-editor/build-module/components/tool-selector/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const selectIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z" }) }); function ToolSelector(props, ref) { const mode = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).__unstableGetEditorMode(), []); const { __unstableSetEditorMode } = (0,external_wp_data_namespaceObject.useDispatch)(store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { renderToggle: ({ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", ...props, ref: ref, icon: mode === 'navigation' ? edit : selectIcon, "aria-expanded": isOpen, "aria-haspopup": "true", onClick: onToggle /* translators: button label text should, if possible, be under 16 characters. */, label: (0,external_wp_i18n_namespaceObject.__)('Tools') }), popoverProps: { placement: 'bottom-start' }, renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.NavigableMenu, { className: "block-editor-tool-selector__menu", role: "menu", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Tools'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, { value: mode === 'navigation' ? 'navigation' : 'edit', onSelect: newMode => { __unstableSetEditorMode(newMode); }, choices: [{ value: 'navigation', label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: edit }), (0,external_wp_i18n_namespaceObject.__)('Write')] }), info: (0,external_wp_i18n_namespaceObject.__)('Focus on content.'), 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Write') }, { value: 'edit', label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [selectIcon, (0,external_wp_i18n_namespaceObject.__)('Design')] }), info: (0,external_wp_i18n_namespaceObject.__)('Edit layout and styles.'), 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Design') }] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-tool-selector__help", children: (0,external_wp_i18n_namespaceObject.__)('Tools provide different sets of interactions for blocks. Choose between simplified content tools (Write) and advanced visual editing tools (Design).') })] }) }); } /* harmony default export */ const tool_selector = ((0,external_wp_element_namespaceObject.forwardRef)(ToolSelector)); ;// ./node_modules/@wordpress/block-editor/build-module/components/unit-control/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function UnitControl({ units: unitsProp, ...props }) { const [availableUnits] = use_settings_useSettings('spacing.units'); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vw'], units: unitsProp }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { units: units, ...props }); } ;// ./node_modules/@wordpress/icons/build-module/library/arrow-left.js /** * WordPress dependencies */ const arrowLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) }); /* harmony default export */ const arrow_left = (arrowLeft); ;// ./node_modules/@wordpress/block-editor/build-module/components/url-input/button.js /** * WordPress dependencies */ /** * Internal dependencies */ class URLInputButton extends external_wp_element_namespaceObject.Component { constructor() { super(...arguments); this.toggle = this.toggle.bind(this); this.submitLink = this.submitLink.bind(this); this.state = { expanded: false }; } toggle() { this.setState({ expanded: !this.state.expanded }); } submitLink(event) { event.preventDefault(); this.toggle(); } render() { const { url, onChange } = this.props; const { expanded } = this.state; const buttonLabel = url ? (0,external_wp_i18n_namespaceObject.__)('Edit link') : (0,external_wp_i18n_namespaceObject.__)('Insert link'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-url-input__button", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", icon: library_link, label: buttonLabel, onClick: this.toggle, className: "components-toolbar__control", isPressed: !!url }), expanded && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { className: "block-editor-url-input__button-modal", onSubmit: this.submitLink, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-url-input__button-modal-line", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: "block-editor-url-input__back", icon: arrow_left, label: (0,external_wp_i18n_namespaceObject.__)('Close'), onClick: this.toggle }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(url_input, { value: url || '', onChange: onChange, suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, { variant: "control", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "small", icon: keyboard_return, label: (0,external_wp_i18n_namespaceObject.__)('Submit'), type: "submit" }) }) })] }) })] }); } } /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/url-input/README.md */ /* harmony default export */ const url_input_button = (URLInputButton); ;// ./node_modules/@wordpress/icons/build-module/library/image.js /** * WordPress dependencies */ const image_image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" }) }); /* harmony default export */ const library_image = (image_image); ;// ./node_modules/@wordpress/block-editor/build-module/components/url-popover/image-url-input-ui.js /** * WordPress dependencies */ /** * Internal dependencies */ const LINK_DESTINATION_NONE = 'none'; const LINK_DESTINATION_CUSTOM = 'custom'; const LINK_DESTINATION_MEDIA = 'media'; const LINK_DESTINATION_ATTACHMENT = 'attachment'; const NEW_TAB_REL = ['noreferrer', 'noopener']; const ImageURLInputUI = ({ linkDestination, onChangeUrl, url, mediaType = 'image', mediaUrl, mediaLink, linkTarget, linkClass, rel, showLightboxSetting, lightboxEnabled, onSetLightbox, resetLightbox }) => { const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(false); // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); const openLinkUI = () => { setIsOpen(true); }; const [isEditingLink, setIsEditingLink] = (0,external_wp_element_namespaceObject.useState)(false); const [urlInput, setUrlInput] = (0,external_wp_element_namespaceObject.useState)(null); const autocompleteRef = (0,external_wp_element_namespaceObject.useRef)(null); const wrapperRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!wrapperRef.current) { return; } const nextFocusTarget = external_wp_dom_namespaceObject.focus.focusable.find(wrapperRef.current)[0] || wrapperRef.current; nextFocusTarget.focus(); }, [isEditingLink, url, lightboxEnabled]); const startEditLink = () => { if (linkDestination === LINK_DESTINATION_MEDIA || linkDestination === LINK_DESTINATION_ATTACHMENT) { setUrlInput(''); } setIsEditingLink(true); }; const stopEditLink = () => { setIsEditingLink(false); }; const closeLinkUI = () => { setUrlInput(null); stopEditLink(); setIsOpen(false); }; const getUpdatedLinkTargetSettings = value => { const newLinkTarget = value ? '_blank' : undefined; let updatedRel; if (newLinkTarget) { const rels = (rel !== null && rel !== void 0 ? rel : '').split(' '); NEW_TAB_REL.forEach(relVal => { if (!rels.includes(relVal)) { rels.push(relVal); } }); updatedRel = rels.join(' '); } else { const rels = (rel !== null && rel !== void 0 ? rel : '').split(' ').filter(relVal => NEW_TAB_REL.includes(relVal) === false); updatedRel = rels.length ? rels.join(' ') : undefined; } return { linkTarget: newLinkTarget, rel: updatedRel }; }; const onFocusOutside = () => { return event => { // The autocomplete suggestions list renders in a separate popover (in a portal), // so onFocusOutside fails to detect that a click on a suggestion occurred in the // LinkContainer. Detect clicks on autocomplete suggestions using a ref here, and // return to avoid the popover being closed. const autocompleteElement = autocompleteRef.current; if (autocompleteElement && autocompleteElement.contains(event.target)) { return; } setIsOpen(false); setUrlInput(null); stopEditLink(); }; }; const onSubmitLinkChange = () => { return event => { if (urlInput) { // It is possible the entered URL actually matches a named link destination. // This check will ensure our link destination is correct. const selectedDestination = getLinkDestinations().find(destination => destination.url === urlInput)?.linkDestination || LINK_DESTINATION_CUSTOM; onChangeUrl({ href: urlInput, linkDestination: selectedDestination, lightbox: { enabled: false } }); } stopEditLink(); setUrlInput(null); event.preventDefault(); }; }; const onLinkRemove = () => { onChangeUrl({ linkDestination: LINK_DESTINATION_NONE, href: '' }); }; const getLinkDestinations = () => { const linkDestinations = [{ linkDestination: LINK_DESTINATION_MEDIA, title: (0,external_wp_i18n_namespaceObject.__)('Link to image file'), url: mediaType === 'image' ? mediaUrl : undefined, icon: library_image }]; if (mediaType === 'image' && mediaLink) { linkDestinations.push({ linkDestination: LINK_DESTINATION_ATTACHMENT, title: (0,external_wp_i18n_namespaceObject.__)('Link to attachment page'), url: mediaType === 'image' ? mediaLink : undefined, icon: library_page }); } return linkDestinations; }; const onSetHref = value => { const linkDestinations = getLinkDestinations(); let linkDestinationInput; if (!value) { linkDestinationInput = LINK_DESTINATION_NONE; } else { linkDestinationInput = (linkDestinations.find(destination => { return destination.url === value; }) || { linkDestination: LINK_DESTINATION_CUSTOM }).linkDestination; } onChangeUrl({ linkDestination: linkDestinationInput, href: value }); }; const onSetNewTab = value => { const updatedLinkTarget = getUpdatedLinkTargetSettings(value); onChangeUrl(updatedLinkTarget); }; const onSetLinkRel = value => { onChangeUrl({ rel: value }); }; const onSetLinkClass = value => { onChangeUrl({ linkClass: value }); }; const advancedOptions = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "3", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: onSetNewTab, checked: linkTarget === '_blank' }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), value: rel !== null && rel !== void 0 ? rel : '', onChange: onSetLinkRel }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link CSS class'), value: linkClass || '', onChange: onSetLinkClass })] }); const linkEditorValue = urlInput !== null ? urlInput : url; const hideLightboxPanel = !lightboxEnabled || lightboxEnabled && !showLightboxSetting; const showLinkEditor = !linkEditorValue && hideLightboxPanel; const urlLabel = (getLinkDestinations().find(destination => destination.linkDestination === linkDestination) || {}).title; const PopoverChildren = () => { if (lightboxEnabled && showLightboxSetting && !url && !isEditingLink) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-url-popover__expand-on-click", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_fullscreen }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "text", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('Enlarge on click') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "description", children: (0,external_wp_i18n_namespaceObject.__)('Scales the image with a lightbox effect') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { icon: link_off, label: (0,external_wp_i18n_namespaceObject.__)('Disable enlarge on click'), onClick: () => { onSetLightbox?.(false); }, size: "compact" })] }); } else if (!url || isEditingLink) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(url_popover.LinkEditor, { className: "block-editor-format-toolbar__link-container-content", value: linkEditorValue, onChangeInputValue: setUrlInput, onSubmit: onSubmitLinkChange(), autocompleteRef: autocompleteRef }); } else if (url && !isEditingLink) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(url_popover.LinkViewer, { className: "block-editor-format-toolbar__link-container-content", url: url, onEditLinkClick: startEditLink, urlLabel: urlLabel }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { icon: link_off, label: (0,external_wp_i18n_namespaceObject.__)('Remove link'), onClick: () => { onLinkRemove(); resetLightbox?.(); }, size: "compact" })] }); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: library_link, className: "components-toolbar__control", label: (0,external_wp_i18n_namespaceObject.__)('Link'), "aria-expanded": isOpen, onClick: openLinkUI, ref: setPopoverAnchor, isActive: !!url || lightboxEnabled && showLightboxSetting }), isOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(url_popover, { ref: wrapperRef, anchor: popoverAnchor, onFocusOutside: onFocusOutside(), onClose: closeLinkUI, renderSettings: hideLightboxPanel ? () => advancedOptions : null, additionalControls: showLinkEditor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.NavigableMenu, { children: [getLinkDestinations().map(link => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: link.icon, iconPosition: "left", onClick: () => { setUrlInput(null); onSetHref(link.url); stopEditLink(); }, children: link.title }, link.linkDestination)), showLightboxSetting && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { className: "block-editor-url-popover__expand-on-click", icon: library_fullscreen, info: (0,external_wp_i18n_namespaceObject.__)('Scale the image with a lightbox effect.'), iconPosition: "left", onClick: () => { setUrlInput(null); onChangeUrl({ linkDestination: LINK_DESTINATION_NONE, href: '' }); onSetLightbox?.(true); stopEditLink(); }, children: (0,external_wp_i18n_namespaceObject.__)('Enlarge on click') }, "expand-on-click")] }), offset: 13, children: PopoverChildren() })] }); }; ;// ./node_modules/@wordpress/block-editor/build-module/components/preview-options/index.js /** * WordPress dependencies */ function PreviewOptions() { external_wp_deprecated_default()('wp.blockEditor.PreviewOptions', { version: '6.5' }); return null; } ;// ./node_modules/@wordpress/block-editor/build-module/components/use-resize-canvas/index.js /** * WordPress dependencies */ /** * Function to resize the editor window. * * @param {string} deviceType Used for determining the size of the container (e.g. Desktop, Tablet, Mobile) * * @return {Object} Inline styles to be added to resizable container. */ function useResizeCanvas(deviceType) { const [actualWidth, updateActualWidth] = (0,external_wp_element_namespaceObject.useState)(window.innerWidth); (0,external_wp_element_namespaceObject.useEffect)(() => { if (deviceType === 'Desktop') { return; } const resizeListener = () => updateActualWidth(window.innerWidth); window.addEventListener('resize', resizeListener); return () => { window.removeEventListener('resize', resizeListener); }; }, [deviceType]); const getCanvasWidth = device => { let deviceWidth; switch (device) { case 'Tablet': deviceWidth = 780; break; case 'Mobile': deviceWidth = 360; break; default: return null; } return deviceWidth < actualWidth ? deviceWidth : actualWidth; }; const contentInlineStyles = device => { const height = device === 'Mobile' ? '768px' : '1024px'; const marginVertical = '40px'; const marginHorizontal = 'auto'; switch (device) { case 'Tablet': case 'Mobile': return { width: getCanvasWidth(device), // Keeping margin styles separate to avoid warnings // when those props get overridden in the iframe component marginTop: marginVertical, marginBottom: marginVertical, marginLeft: marginHorizontal, marginRight: marginHorizontal, height, overflowY: 'auto' }; default: return { marginLeft: marginHorizontal, marginRight: marginHorizontal }; } }; return contentInlineStyles(deviceType); } ;// ./node_modules/@wordpress/block-editor/build-module/components/skip-to-selected-block/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/skip-to-selected-block/README.md */ function SkipToSelectedBlock() { const selectedBlockClientId = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlockSelectionStart(), []); const ref = (0,external_wp_element_namespaceObject.useRef)(); useBlockElementRef(selectedBlockClientId, ref); const onClick = () => { ref.current?.focus(); }; return selectedBlockClientId ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", className: "block-editor-skip-to-selected-block", onClick: onClick, children: (0,external_wp_i18n_namespaceObject.__)('Skip to the selected block') }) : null; } ;// ./node_modules/@wordpress/block-editor/build-module/components/multi-selection-inspector/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function MultiSelectionInspector() { const selectedBlockCount = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSelectedBlockCount(), []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", spacing: 2, className: "block-editor-multi-selection-inspector__card", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: library_copy, showColors: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-multi-selection-inspector__card-title", children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of blocks */ (0,external_wp_i18n_namespaceObject._n)('%d Block', '%d Blocks', selectedBlockCount), selectedBlockCount) })] }); } ;// ./node_modules/@wordpress/icons/build-module/library/cog.js /** * WordPress dependencies */ const cog = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z", clipRule: "evenodd" }) }); /* harmony default export */ const library_cog = (cog); ;// ./node_modules/@wordpress/icons/build-module/library/styles.js /** * WordPress dependencies */ const styles = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z" }) }); /* harmony default export */ const library_styles = (styles); ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/utils.js /** * WordPress dependencies */ const TAB_SETTINGS = { name: 'settings', title: (0,external_wp_i18n_namespaceObject.__)('Settings'), value: 'settings', icon: library_cog }; const TAB_STYLES = { name: 'styles', title: (0,external_wp_i18n_namespaceObject.__)('Styles'), value: 'styles', icon: library_styles }; const TAB_LIST_VIEW = { name: 'list', title: (0,external_wp_i18n_namespaceObject.__)('List View'), value: 'list-view', icon: list_view }; ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/advanced-controls-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ const AdvancedControls = () => { const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(InspectorAdvancedControls.slotName); const hasFills = Boolean(fills && fills.length); if (!hasFills) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { className: "block-editor-block-inspector__advanced", title: (0,external_wp_i18n_namespaceObject.__)('Advanced'), initialOpen: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "advanced" }) }); }; /* harmony default export */ const advanced_controls_panel = (AdvancedControls); ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/position-controls-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ const PositionControlsPanel = () => { const { selectedClientIds, selectedBlocks, hasPositionAttribute } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlocksByClientId, getSelectedBlockClientIds } = select(store); const selectedBlockClientIds = getSelectedBlockClientIds(); const _selectedBlocks = getBlocksByClientId(selectedBlockClientIds); return { selectedClientIds: selectedBlockClientIds, selectedBlocks: _selectedBlocks, hasPositionAttribute: _selectedBlocks?.some(({ attributes }) => !!attributes?.style?.position?.type) }; }, []); const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(store); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); function resetPosition() { if (!selectedClientIds?.length || !selectedBlocks?.length) { return; } const attributesByClientId = Object.fromEntries(selectedBlocks?.map(({ clientId, attributes }) => [clientId, { style: utils_cleanEmptyObject({ ...attributes?.style, position: { ...attributes?.style?.position, type: undefined, top: undefined, right: undefined, bottom: undefined, left: undefined } }) }])); updateBlockAttributes(selectedClientIds, attributesByClientId, true); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { className: "block-editor-block-inspector__position", label: (0,external_wp_i18n_namespaceObject.__)('Position'), resetAll: resetPosition, dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { isShownByDefault: hasPositionAttribute, label: (0,external_wp_i18n_namespaceObject.__)('Position'), hasValue: () => hasPositionAttribute, onDeselect: resetPosition, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "position" }) }) }); }; const PositionControls = () => { const fills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(inspector_controls_groups.position.name); const hasFills = Boolean(fills && fills.length); if (!hasFills) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PositionControlsPanel, {}); }; /* harmony default export */ const position_controls_panel = (PositionControls); ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/settings-tab.js /** * Internal dependencies */ const SettingsTab = ({ showAdvancedControls = false }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(position_controls_panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "bindings" }), showAdvancedControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(advanced_controls_panel, {}) })] }); /* harmony default export */ const settings_tab = (SettingsTab); ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/styles-tab.js /** * WordPress dependencies */ /** * Internal dependencies */ const StylesTab = ({ blockName, clientId, hasBlockStyles }) => { const borderPanelLabel = useBorderPanelLabel({ blockName }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [hasBlockStyles && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Styles'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_styles, { clientId: clientId }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "color", label: (0,external_wp_i18n_namespaceObject.__)('Color'), className: "color-block-support-panel__inner-wrapper" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "background", label: (0,external_wp_i18n_namespaceObject.__)('Background image') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "filter" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "typography", label: (0,external_wp_i18n_namespaceObject.__)('Typography') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "dimensions", label: (0,external_wp_i18n_namespaceObject.__)('Dimensions') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "border", label: borderPanelLabel }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "styles" })] }); }; /* harmony default export */ const styles_tab = (StylesTab); ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/use-is-list-view-tab-disabled.js // List view tab restricts the blocks that may render to it via the // allowlist below. const allowlist = ['core/navigation']; const useIsListViewTabDisabled = blockName => { return !allowlist.includes(blockName); }; /* harmony default export */ const use_is_list_view_tab_disabled = (useIsListViewTabDisabled); ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const { Tabs: inspector_controls_tabs_Tabs } = unlock(external_wp_components_namespaceObject.privateApis); function InspectorControlsTabs({ blockName, clientId, hasBlockStyles, tabs }) { const showIconLabels = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_preferences_namespaceObject.store).get('core', 'showIconLabels'); }, []); // The tabs panel will mount before fills are rendered to the list view // slot. This means the list view tab isn't initially included in the // available tabs so the panel defaults selection to the settings tab // which at the time is the first tab. This check allows blocks known to // include the list view tab to set it as the tab selected by default. const initialTabName = !use_is_list_view_tab_disabled(blockName) ? TAB_LIST_VIEW.name : undefined; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-block-inspector__tabs", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(inspector_controls_tabs_Tabs, { defaultTabId: initialTabName, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.TabList, { children: tabs.map(tab => showIconLabels ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.Tab, { tabId: tab.name, children: tab.title }, tab.name) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Tooltip, { text: tab.title, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.Tab, { tabId: tab.name, "aria-label": tab.title, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Icon, { icon: tab.icon }) }) }, tab.name)) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.TabPanel, { tabId: TAB_SETTINGS.name, focusable: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(settings_tab, { showAdvancedControls: !!blockName }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.TabPanel, { tabId: TAB_STYLES.name, focusable: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(styles_tab, { blockName: blockName, clientId: clientId, hasBlockStyles: hasBlockStyles }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls_tabs_Tabs.TabPanel, { tabId: TAB_LIST_VIEW.name, focusable: false, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "list" }) })] }, clientId) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js /** * WordPress dependencies */ /** * Internal dependencies */ const use_inspector_controls_tabs_EMPTY_ARRAY = []; function getShowTabs(blockName, tabSettings = {}) { // Block specific setting takes precedence over generic default. if (tabSettings[blockName] !== undefined) { return tabSettings[blockName]; } // Use generic default if set over the Gutenberg experiment option. if (tabSettings.default !== undefined) { return tabSettings.default; } return true; } function useInspectorControlsTabs(blockName) { const tabs = []; const { bindings: bindingsGroup, border: borderGroup, color: colorGroup, default: defaultGroup, dimensions: dimensionsGroup, list: listGroup, position: positionGroup, styles: stylesGroup, typography: typographyGroup, effects: effectsGroup } = inspector_controls_groups; // List View Tab: If there are any fills for the list group add that tab. const listViewDisabled = use_is_list_view_tab_disabled(blockName); const listFills = (0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(listGroup.name); const hasListFills = !listViewDisabled && !!listFills && listFills.length; // Styles Tab: Add this tab if there are any fills for block supports // e.g. border, color, spacing, typography, etc. const styleFills = [...((0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(borderGroup.name) || []), ...((0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(colorGroup.name) || []), ...((0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(dimensionsGroup.name) || []), ...((0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(stylesGroup.name) || []), ...((0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(typographyGroup.name) || []), ...((0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(effectsGroup.name) || [])]; const hasStyleFills = styleFills.length; // Settings Tab: If we don't have multiple tabs to display // (i.e. both list view and styles), check only the default and position // InspectorControls slots. If we have multiple tabs, we'll need to check // the advanced controls slot as well to ensure they are rendered. const advancedFills = [...((0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(InspectorAdvancedControls.slotName) || []), ...((0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(bindingsGroup.name) || [])]; const settingsFills = [...((0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(defaultGroup.name) || []), ...((0,external_wp_components_namespaceObject.__experimentalUseSlotFills)(positionGroup.name) || []), ...(hasListFills && hasStyleFills > 1 ? advancedFills : [])]; // Add the tabs in the order that they will default to if available. // List View > Settings > Styles. if (hasListFills) { tabs.push(TAB_LIST_VIEW); } if (settingsFills.length) { tabs.push(TAB_SETTINGS); } if (hasStyleFills) { tabs.push(TAB_STYLES); } const tabSettings = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(store).getSettings().blockInspectorTabs; }, []); const showTabs = getShowTabs(blockName, tabSettings); return showTabs ? tabs : use_inspector_controls_tabs_EMPTY_ARRAY; } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js /** * WordPress dependencies */ /** * Internal dependencies */ function useBlockInspectorAnimationSettings(blockType) { return (0,external_wp_data_namespaceObject.useSelect)(select => { if (blockType) { const globalBlockInspectorAnimationSettings = select(store).getSettings().blockInspectorAnimation; // Get the name of the block that will allow it's children to be animated. const animationParent = globalBlockInspectorAnimationSettings?.animationParent; // Determine whether the animationParent block is a parent of the selected block. const { getSelectedBlockClientId, getBlockParentsByBlockName } = select(store); const _selectedBlockClientId = getSelectedBlockClientId(); const animationParentBlockClientId = getBlockParentsByBlockName(_selectedBlockClientId, animationParent, true)[0]; // If the selected block is not a child of the animationParent block, // and not an animationParent block itself, don't animate. if (!animationParentBlockClientId && blockType.name !== animationParent) { return null; } return globalBlockInspectorAnimationSettings?.[blockType.name]; } return null; }, [blockType]); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-quick-navigation/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockQuickNavigation({ clientIds, onSelect }) { if (!clientIds.length) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 1, children: clientIds.map(clientId => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockQuickNavigationItem, { onSelect: onSelect, clientId: clientId }, clientId)) }); } function BlockQuickNavigationItem({ clientId, onSelect }) { const blockInformation = useBlockDisplayInformation(clientId); const blockTitle = useBlockDisplayTitle({ clientId, context: 'list-view' }); const { isSelected } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { isBlockSelected, hasSelectedInnerBlock } = select(store); return { isSelected: isBlockSelected(clientId) || hasSelectedInnerBlock(clientId, /* deep: */true) }; }, [clientId]); const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, isPressed: isSelected, onClick: async () => { await selectBlock(clientId); if (onSelect) { onSelect(clientId); } }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: blockInformation?.icon }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { style: { textAlign: 'left' }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { children: blockTitle }) })] }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-inspector/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockStylesPanel({ clientId }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Styles'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_styles, { clientId: clientId }) }); } function BlockInspector() { const { count, selectedBlockName, selectedBlockClientId, blockType, isSectionBlock } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSelectedBlockClientId, getSelectedBlockCount, getBlockName, getParentSectionBlock, isSectionBlock: _isSectionBlock } = unlock(select(store)); const _selectedBlockClientId = getSelectedBlockClientId(); const renderedBlockClientId = getParentSectionBlock(_selectedBlockClientId) || getSelectedBlockClientId(); const _selectedBlockName = renderedBlockClientId && getBlockName(renderedBlockClientId); const _blockType = _selectedBlockName && (0,external_wp_blocks_namespaceObject.getBlockType)(_selectedBlockName); return { count: getSelectedBlockCount(), selectedBlockClientId: renderedBlockClientId, selectedBlockName: _selectedBlockName, blockType: _blockType, isSectionBlock: _isSectionBlock(renderedBlockClientId) }; }, []); const availableTabs = useInspectorControlsTabs(blockType?.name); const showTabs = availableTabs?.length > 1; // The block inspector animation settings will be completely // removed in the future to create an API which allows the block // inspector to transition between what it // displays based on the relationship between the selected block // and its parent, and only enable it if the parent is controlling // its children blocks. const blockInspectorAnimationSettings = useBlockInspectorAnimationSettings(blockType); const borderPanelLabel = useBorderPanelLabel({ blockName: selectedBlockName }); if (count > 1 && !isSectionBlock) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-inspector", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MultiSelectionInspector, {}), showTabs ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorControlsTabs, { tabs: availableTabs }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "color", label: (0,external_wp_i18n_namespaceObject.__)('Color'), className: "color-block-support-panel__inner-wrapper" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "background", label: (0,external_wp_i18n_namespaceObject.__)('Background image') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "typography", label: (0,external_wp_i18n_namespaceObject.__)('Typography') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "dimensions", label: (0,external_wp_i18n_namespaceObject.__)('Dimensions') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "border", label: borderPanelLabel }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "styles" })] })] }); } const isSelectedBlockUnregistered = selectedBlockName === (0,external_wp_blocks_namespaceObject.getUnregisteredTypeHandlerName)(); /* * If the selected block is of an unregistered type, avoid showing it as an actual selection * because we want the user to focus on the unregistered block warning, not block settings. */ if (!blockType || !selectedBlockClientId || isSelectedBlockUnregistered) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "block-editor-block-inspector__no-blocks", children: (0,external_wp_i18n_namespaceObject.__)('No block selected.') }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockInspectorSingleBlockWrapper, { animate: blockInspectorAnimationSettings, wrapper: children => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AnimatedContainer, { blockInspectorAnimationSettings: blockInspectorAnimationSettings, selectedBlockClientId: selectedBlockClientId, children: children }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockInspectorSingleBlock, { clientId: selectedBlockClientId, blockName: blockType.name, isSectionBlock: isSectionBlock }) }); } const BlockInspectorSingleBlockWrapper = ({ animate, wrapper, children }) => { return animate ? wrapper(children) : children; }; const AnimatedContainer = ({ blockInspectorAnimationSettings, selectedBlockClientId, children }) => { const animationOrigin = blockInspectorAnimationSettings && blockInspectorAnimationSettings.enterDirection === 'leftToRight' ? -50 : 50; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__unstableMotion.div, { animate: { x: 0, opacity: 1, transition: { ease: 'easeInOut', duration: 0.14 } }, initial: { x: animationOrigin, opacity: 0 }, children: children }, selectedBlockClientId); }; const BlockInspectorSingleBlock = ({ clientId, blockName, isSectionBlock }) => { const availableTabs = useInspectorControlsTabs(blockName); const showTabs = !isSectionBlock && availableTabs?.length > 1; const hasBlockStyles = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockStyles } = select(external_wp_blocks_namespaceObject.store); const blockStyles = getBlockStyles(blockName); return blockStyles && blockStyles.length > 0; }, [blockName]); const blockInformation = useBlockDisplayInformation(clientId); const borderPanelLabel = useBorderPanelLabel({ blockName }); const contentClientIds = (0,external_wp_data_namespaceObject.useSelect)(select => { // Avoid unnecessary subscription. if (!isSectionBlock) { return; } const { getClientIdsOfDescendants, getBlockName, getBlockEditingMode } = select(store); return getClientIdsOfDescendants(clientId).filter(current => getBlockName(current) !== 'core/list-item' && getBlockEditingMode(current) === 'contentOnly'); }, [isSectionBlock, clientId]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-inspector", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_card, { ...blockInformation, className: blockInformation.isSynced && 'is-synced' }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_variation_transforms, { blockClientId: clientId }), showTabs && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorControlsTabs, { hasBlockStyles: hasBlockStyles, clientId: clientId, blockName: blockName, tabs: availableTabs }), !showTabs && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [hasBlockStyles && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockStylesPanel, { clientId: clientId }), contentClientIds && contentClientIds?.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Content'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockQuickNavigation, { clientIds: contentClientIds }) }), !isSectionBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "list" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "color", label: (0,external_wp_i18n_namespaceObject.__)('Color'), className: "color-block-support-panel__inner-wrapper" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "background", label: (0,external_wp_i18n_namespaceObject.__)('Background image') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "typography", label: (0,external_wp_i18n_namespaceObject.__)('Typography') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "dimensions", label: (0,external_wp_i18n_namespaceObject.__)('Dimensions') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "border", label: borderPanelLabel }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "styles" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(position_controls_panel, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(inspector_controls.Slot, { group: "bindings" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(advanced_controls_panel, {}) })] })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SkipToSelectedBlock, {}, "back")] }); }; /** * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-inspector/README.md */ /* harmony default export */ const block_inspector = (BlockInspector); ;// ./node_modules/@wordpress/block-editor/build-module/components/copy-handler/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * @deprecated */ const __unstableUseClipboardHandler = () => { external_wp_deprecated_default()('__unstableUseClipboardHandler', { alternative: 'BlockCanvas or WritingFlow', since: '6.4', version: '6.7' }); return useClipboardHandler(); }; /** * @deprecated * @param {Object} props */ function CopyHandler(props) { external_wp_deprecated_default()('CopyHandler', { alternative: 'BlockCanvas or WritingFlow', since: '6.4', version: '6.7' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...props, ref: useClipboardHandler() }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/inserter/library.js /** * WordPress dependencies */ /** * Internal dependencies */ const library_noop = () => {}; function InserterLibrary({ rootClientId, clientId, isAppender, showInserterHelpPanel, showMostUsedBlocks = false, __experimentalInsertionIndex, __experimentalInitialTab, __experimentalInitialCategory, __experimentalFilterValue, onPatternCategorySelection, onSelect = library_noop, shouldFocusBlock = false, onClose }, ref) { const { destinationRootClientId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId } = select(store); const _rootClientId = rootClientId || getBlockRootClientId(clientId) || undefined; return { destinationRootClientId: _rootClientId }; }, [clientId, rootClientId]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateInserterMenu, { onSelect: onSelect, rootClientId: destinationRootClientId, clientId: clientId, isAppender: isAppender, showInserterHelpPanel: showInserterHelpPanel, showMostUsedBlocks: showMostUsedBlocks, __experimentalInsertionIndex: __experimentalInsertionIndex, __experimentalFilterValue: __experimentalFilterValue, onPatternCategorySelection: onPatternCategorySelection, __experimentalInitialTab: __experimentalInitialTab, __experimentalInitialCategory: __experimentalInitialCategory, shouldFocusBlock: shouldFocusBlock, ref: ref, onClose: onClose }); } const PrivateInserterLibrary = (0,external_wp_element_namespaceObject.forwardRef)(InserterLibrary); function PublicInserterLibrary(props, ref) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateInserterLibrary, { ...props, onPatternCategorySelection: undefined, ref: ref }); } /* harmony default export */ const library = ((0,external_wp_element_namespaceObject.forwardRef)(PublicInserterLibrary)); ;// ./node_modules/@wordpress/block-editor/build-module/components/selection-scroll-into-view/index.js /** * WordPress dependencies */ /** * Scrolls the multi block selection end into view if not in view already. This * is important to do after selection by keyboard. * * @deprecated */ function MultiSelectScrollIntoView() { external_wp_deprecated_default()('wp.blockEditor.MultiSelectScrollIntoView', { hint: 'This behaviour is now built-in.', since: '5.8' }); return null; } ;// ./node_modules/@wordpress/block-editor/build-module/components/typewriter/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const isIE = window.navigator.userAgent.indexOf('Trident') !== -1; const arrowKeyCodes = new Set([external_wp_keycodes_namespaceObject.UP, external_wp_keycodes_namespaceObject.DOWN, external_wp_keycodes_namespaceObject.LEFT, external_wp_keycodes_namespaceObject.RIGHT]); const initialTriggerPercentage = 0.75; function useTypewriter() { const hasSelectedBlock = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).hasSelectedBlock(), []); return (0,external_wp_compose_namespaceObject.useRefEffect)(node => { if (!hasSelectedBlock) { return; } const { ownerDocument } = node; const { defaultView } = ownerDocument; let scrollResizeRafId; let onKeyDownRafId; let caretRect; function onScrollResize() { if (scrollResizeRafId) { return; } scrollResizeRafId = defaultView.requestAnimationFrame(() => { computeCaretRectangle(); scrollResizeRafId = null; }); } function onKeyDown(event) { // Ensure the any remaining request is cancelled. if (onKeyDownRafId) { defaultView.cancelAnimationFrame(onKeyDownRafId); } // Use an animation frame for a smooth result. onKeyDownRafId = defaultView.requestAnimationFrame(() => { maintainCaretPosition(event); onKeyDownRafId = null; }); } /** * Maintains the scroll position after a selection change caused by a * keyboard event. * * @param {KeyboardEvent} event Keyboard event. */ function maintainCaretPosition({ keyCode }) { if (!isSelectionEligibleForScroll()) { return; } const currentCaretRect = (0,external_wp_dom_namespaceObject.computeCaretRect)(defaultView); if (!currentCaretRect) { return; } // If for some reason there is no position set to be scrolled to, let // this be the position to be scrolled to in the future. if (!caretRect) { caretRect = currentCaretRect; return; } // Even though enabling the typewriter effect for arrow keys results in // a pleasant experience, it may not be the case for everyone, so, for // now, let's disable it. if (arrowKeyCodes.has(keyCode)) { // Reset the caret position to maintain. caretRect = currentCaretRect; return; } const diff = currentCaretRect.top - caretRect.top; if (diff === 0) { return; } const scrollContainer = (0,external_wp_dom_namespaceObject.getScrollContainer)(node); // The page must be scrollable. if (!scrollContainer) { return; } const windowScroll = scrollContainer === ownerDocument.body || scrollContainer === ownerDocument.documentElement; const scrollY = windowScroll ? defaultView.scrollY : scrollContainer.scrollTop; const scrollContainerY = windowScroll ? 0 : scrollContainer.getBoundingClientRect().top; const relativeScrollPosition = windowScroll ? caretRect.top / defaultView.innerHeight : (caretRect.top - scrollContainerY) / (defaultView.innerHeight - scrollContainerY); // If the scroll position is at the start, the active editable element // is the last one, and the caret is positioned within the initial // trigger percentage of the page, do not scroll the page. // The typewriter effect should not kick in until an empty page has been // filled with the initial trigger percentage or the user scrolls // intentionally down. if (scrollY === 0 && relativeScrollPosition < initialTriggerPercentage && isLastEditableNode()) { // Reset the caret position to maintain. caretRect = currentCaretRect; return; } const scrollContainerHeight = windowScroll ? defaultView.innerHeight : scrollContainer.clientHeight; // Abort if the target scroll position would scroll the caret out of // view. if ( // The caret is under the lower fold. caretRect.top + caretRect.height > scrollContainerY + scrollContainerHeight || // The caret is above the upper fold. caretRect.top < scrollContainerY) { // Reset the caret position to maintain. caretRect = currentCaretRect; return; } if (windowScroll) { defaultView.scrollBy(0, diff); } else { scrollContainer.scrollTop += diff; } } /** * Adds a `selectionchange` listener to reset the scroll position to be * maintained. */ function addSelectionChangeListener() { ownerDocument.addEventListener('selectionchange', computeCaretRectOnSelectionChange); } /** * Resets the scroll position to be maintained during a `selectionchange` * event. Also removes the listener, so it acts as a one-time listener. */ function computeCaretRectOnSelectionChange() { ownerDocument.removeEventListener('selectionchange', computeCaretRectOnSelectionChange); computeCaretRectangle(); } /** * Resets the scroll position to be maintained. */ function computeCaretRectangle() { if (isSelectionEligibleForScroll()) { caretRect = (0,external_wp_dom_namespaceObject.computeCaretRect)(defaultView); } } /** * Checks if the current situation is eligible for scroll: * - There should be one and only one block selected. * - The component must contain the selection. * - The active element must be contenteditable. */ function isSelectionEligibleForScroll() { return node.contains(ownerDocument.activeElement) && ownerDocument.activeElement.isContentEditable; } function isLastEditableNode() { const editableNodes = node.querySelectorAll('[contenteditable="true"]'); const lastEditableNode = editableNodes[editableNodes.length - 1]; return lastEditableNode === ownerDocument.activeElement; } // When the user scrolls or resizes, the scroll position should be // reset. defaultView.addEventListener('scroll', onScrollResize, true); defaultView.addEventListener('resize', onScrollResize, true); node.addEventListener('keydown', onKeyDown); node.addEventListener('keyup', maintainCaretPosition); node.addEventListener('mousedown', addSelectionChangeListener); node.addEventListener('touchstart', addSelectionChangeListener); return () => { defaultView.removeEventListener('scroll', onScrollResize, true); defaultView.removeEventListener('resize', onScrollResize, true); node.removeEventListener('keydown', onKeyDown); node.removeEventListener('keyup', maintainCaretPosition); node.removeEventListener('mousedown', addSelectionChangeListener); node.removeEventListener('touchstart', addSelectionChangeListener); ownerDocument.removeEventListener('selectionchange', computeCaretRectOnSelectionChange); defaultView.cancelAnimationFrame(scrollResizeRafId); defaultView.cancelAnimationFrame(onKeyDownRafId); }; }, [hasSelectedBlock]); } function Typewriter({ children }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: useTypewriter(), className: "block-editor__typewriter", children: children }); } /** * The exported component. The implementation of Typewriter faced technical * challenges in Internet Explorer, and is simply skipped, rendering the given * props children instead. * * @type {Component} */ const TypewriterOrIEBypass = isIE ? props => props.children : Typewriter; /** * Ensures that the text selection keeps the same vertical distance from the * viewport during keyboard events within this component. The vertical distance * can vary. It is the last clicked or scrolled to position. */ /* harmony default export */ const typewriter = (TypewriterOrIEBypass); ;// ./node_modules/@wordpress/block-editor/build-module/components/recursion-provider/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const RenderedRefsContext = (0,external_wp_element_namespaceObject.createContext)({}); /** * Immutably adds an unique identifier to a set scoped for a given block type. * * @param {Object} renderedBlocks Rendered blocks grouped by block name * @param {string} blockName Name of the block. * @param {*} uniqueId Any value that acts as a unique identifier for a block instance. * * @return {Object} The list of rendered blocks grouped by block name. */ function addToBlockType(renderedBlocks, blockName, uniqueId) { const result = { ...renderedBlocks, [blockName]: renderedBlocks[blockName] ? new Set(renderedBlocks[blockName]) : new Set() }; result[blockName].add(uniqueId); return result; } /** * A React context provider for use with the `useHasRecursion` hook to prevent recursive * renders. * * Wrap block content with this provider and provide the same `uniqueId` prop as used * with `useHasRecursion`. * * @param {Object} props * @param {*} props.uniqueId Any value that acts as a unique identifier for a block instance. * @param {string} props.blockName Optional block name. * @param {JSX.Element} props.children React children. * * @return {JSX.Element} A React element. */ function RecursionProvider({ children, uniqueId, blockName = '' }) { const previouslyRenderedBlocks = (0,external_wp_element_namespaceObject.useContext)(RenderedRefsContext); const { name } = useBlockEditContext(); blockName = blockName || name; const newRenderedBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => addToBlockType(previouslyRenderedBlocks, blockName, uniqueId), [previouslyRenderedBlocks, blockName, uniqueId]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RenderedRefsContext.Provider, { value: newRenderedBlocks, children: children }); } /** * A React hook for keeping track of blocks previously rendered up in the block * tree. Blocks susceptible to recursion can use this hook in their `Edit` * function to prevent said recursion. * * Use this with the `RecursionProvider` component, using the same `uniqueId` value * for both the hook and the provider. * * @param {*} uniqueId Any value that acts as a unique identifier for a block instance. * @param {string} blockName Optional block name. * * @return {boolean} A boolean describing whether the provided id has already been rendered. */ function useHasRecursion(uniqueId, blockName = '') { const previouslyRenderedBlocks = (0,external_wp_element_namespaceObject.useContext)(RenderedRefsContext); const { name } = useBlockEditContext(); blockName = blockName || name; return Boolean(previouslyRenderedBlocks[blockName]?.has(uniqueId)); } const DeprecatedExperimentalRecursionProvider = props => { external_wp_deprecated_default()('wp.blockEditor.__experimentalRecursionProvider', { since: '6.5', alternative: 'wp.blockEditor.RecursionProvider' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RecursionProvider, { ...props }); }; const DeprecatedExperimentalUseHasRecursion = (...args) => { external_wp_deprecated_default()('wp.blockEditor.__experimentalUseHasRecursion', { since: '6.5', alternative: 'wp.blockEditor.useHasRecursion' }); return useHasRecursion(...args); }; ;// ./node_modules/@wordpress/block-editor/build-module/components/inspector-popover-header/index.js /** * WordPress dependencies */ function InspectorPopoverHeader({ title, help, actions = [], onClose }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { className: "block-editor-inspector-popover-header", spacing: 4, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "center", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { className: "block-editor-inspector-popover-header__heading", level: 2, size: 13, children: title }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, {}), actions.map(({ label, icon, onClick }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "small", className: "block-editor-inspector-popover-header__action", label: label, icon: icon, variant: !icon && 'tertiary', onClick: onClick, children: !icon && label }, label)), onClose && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "small", className: "block-editor-inspector-popover-header__action", label: (0,external_wp_i18n_namespaceObject.__)('Close'), icon: close_small, onClick: onClose })] }), help && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, { children: help })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/publish-date-time-picker/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function PublishDateTimePicker({ onClose, onChange, showPopoverHeaderActions, isCompact, currentDate, ...additionalProps }, ref) { const datePickerProps = { startOfWeek: (0,external_wp_date_namespaceObject.getSettings)().l10n.startOfWeek, onChange, currentDate: isCompact ? undefined : currentDate, currentTime: isCompact ? currentDate : undefined, ...additionalProps }; const DatePickerComponent = isCompact ? external_wp_components_namespaceObject.TimePicker : external_wp_components_namespaceObject.DateTimePicker; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ref: ref, className: "block-editor-publish-date-time-picker", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorPopoverHeader, { title: (0,external_wp_i18n_namespaceObject.__)('Publish'), actions: showPopoverHeaderActions ? [{ label: (0,external_wp_i18n_namespaceObject.__)('Now'), onClick: () => onChange?.(null) }] : undefined, onClose: onClose }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DatePickerComponent, { ...datePickerProps })] }); } const PrivatePublishDateTimePicker = (0,external_wp_element_namespaceObject.forwardRef)(PublishDateTimePicker); function PublicPublishDateTimePicker(props, ref) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePublishDateTimePicker, { ...props, showPopoverHeaderActions: true, isCompact: false, ref: ref }); } /* harmony default export */ const publish_date_time_picker = ((0,external_wp_element_namespaceObject.forwardRef)(PublicPublishDateTimePicker)); ;// ./node_modules/@wordpress/block-editor/build-module/components/index.js /* * Block Creation Components */ /* * Content Related Components */ /* * State Related Components */ ;// ./node_modules/@wordpress/block-editor/build-module/elements/index.js const elements_ELEMENT_CLASS_NAMES = { button: 'wp-element-button', caption: 'wp-element-caption' }; const __experimentalGetElementClassName = element => { return elements_ELEMENT_CLASS_NAMES[element] ? elements_ELEMENT_CLASS_NAMES[element] : ''; }; ;// ./node_modules/@wordpress/block-editor/build-module/utils/get-px-from-css-unit.js /** * This function was accidentally exposed for mobile/native usage. * * @deprecated * * @return {string} Empty string. */ /* harmony default export */ const get_px_from_css_unit = (() => ''); ;// ./node_modules/@wordpress/block-editor/build-module/utils/index.js ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/image-settings-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ function useHasImageSettingsPanel(name, value, inheritedValue) { // Note: If lightbox `value` exists, that means it was // defined via the the Global Styles UI and will NOT // be a boolean value or contain the `allowEditing` property, // so we should show the settings panel in those cases. return name === 'core/image' && inheritedValue?.lightbox?.allowEditing || !!value?.lightbox; } function ImageSettingsPanel({ onChange, value, inheritedValue, panelId }) { const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const resetLightbox = () => { onChange(undefined); }; const onChangeLightbox = newSetting => { onChange({ enabled: newSetting }); }; let lightboxChecked = false; if (inheritedValue?.lightbox?.enabled) { lightboxChecked = inheritedValue.lightbox.enabled; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject._x)('Settings', 'Image settings'), resetAll: resetLightbox, panelId: panelId, dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem // We use the `userSettings` prop instead of `settings`, because `settings` // contains the core/theme values for the lightbox and we want to show the // "RESET" button ONLY when the user has explicitly set a value in the // Global Styles. , { hasValue: () => !!value?.lightbox, label: (0,external_wp_i18n_namespaceObject.__)('Enlarge on click'), onDeselect: resetLightbox, isShownByDefault: true, panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Enlarge on click'), checked: lightboxChecked, onChange: onChangeLightbox }) }) }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/advanced-panel.js /** * WordPress dependencies */ /** * Internal dependencies */ function AdvancedPanel({ value, onChange, inheritedValue = value }) { // Custom CSS const [cssError, setCSSError] = (0,external_wp_element_namespaceObject.useState)(null); const customCSS = inheritedValue?.css; function handleOnChange(newValue) { onChange({ ...value, css: newValue }); if (cssError) { // Check if the new value is valid CSS, and pass a wrapping selector // to ensure that `transformStyles` validates the CSS. Note that the // wrapping selector here is not used in the actual output of any styles. const [transformed] = transform_styles([{ css: newValue }], '.for-validation-only'); if (transformed) { setCSSError(null); } } } function handleOnBlur(event) { if (!event?.target?.value) { setCSSError(null); return; } // Check if the new value is valid CSS, and pass a wrapping selector // to ensure that `transformStyles` validates the CSS. Note that the // wrapping selector here is not used in the actual output of any styles. const [transformed] = transform_styles([{ css: event.target.value }], '.for-validation-only'); setCSSError(transformed === null ? (0,external_wp_i18n_namespaceObject.__)('There is an error with your CSS structure.') : null); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, children: [cssError && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "error", onRemove: () => setCSSError(null), children: cssError }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { label: (0,external_wp_i18n_namespaceObject.__)('Additional CSS'), __nextHasNoMarginBottom: true, value: customCSS, onChange: newValue => handleOnChange(newValue), onBlur: handleOnBlur, className: "block-editor-global-styles-advanced-panel__custom-css-input", spellCheck: false })] }); } ;// ./node_modules/memize/dist/index.js /** * Memize options object. * * @typedef MemizeOptions * * @property {number} [maxSize] Maximum size of the cache. */ /** * Internal cache entry. * * @typedef MemizeCacheNode * * @property {?MemizeCacheNode|undefined} [prev] Previous node. * @property {?MemizeCacheNode|undefined} [next] Next node. * @property {Array<*>} args Function arguments for cache * entry. * @property {*} val Function result. */ /** * Properties of the enhanced function for controlling cache. * * @typedef MemizeMemoizedFunction * * @property {()=>void} clear Clear the cache. */ /** * Accepts a function to be memoized, and returns a new memoized function, with * optional options. * * @template {(...args: any[]) => any} F * * @param {F} fn Function to memoize. * @param {MemizeOptions} [options] Options object. * * @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function. */ function memize(fn, options) { var size = 0; /** @type {?MemizeCacheNode|undefined} */ var head; /** @type {?MemizeCacheNode|undefined} */ var tail; options = options || {}; function memoized(/* ...args */) { var node = head, len = arguments.length, args, i; searchCache: while (node) { // Perform a shallow equality test to confirm that whether the node // under test is a candidate for the arguments passed. Two arrays // are shallowly equal if their length matches and each entry is // strictly equal between the two sets. Avoid abstracting to a // function which could incur an arguments leaking deoptimization. // Check whether node arguments match arguments length if (node.args.length !== arguments.length) { node = node.next; continue; } // Check whether node arguments match arguments values for (i = 0; i < len; i++) { if (node.args[i] !== arguments[i]) { node = node.next; continue searchCache; } } // At this point we can assume we've found a match // Surface matched node to head if not already if (node !== head) { // As tail, shift to previous. Must only shift if not also // head, since if both head and tail, there is no previous. if (node === tail) { tail = node.prev; } // Adjust siblings to point to each other. If node was tail, // this also handles new tail's empty `next` assignment. /** @type {MemizeCacheNode} */ (node.prev).next = node.next; if (node.next) { node.next.prev = node.prev; } node.next = head; node.prev = null; /** @type {MemizeCacheNode} */ (head).prev = node; head = node; } // Return immediately return node.val; } // No cached value found. Continue to insertion phase: // Create a copy of arguments (avoid leaking deoptimization) args = new Array(len); for (i = 0; i < len; i++) { args[i] = arguments[i]; } node = { args: args, // Generate the result from original function val: fn.apply(null, args), }; // Don't need to check whether node is already head, since it would // have been returned above already if it was // Shift existing head down list if (head) { head.prev = node; node.next = head; } else { // If no head, follows that there's no tail (at initial or reset) tail = node; } // Trim tail if we're reached max size and are pending cache insertion if (size === /** @type {MemizeOptions} */ (options).maxSize) { tail = /** @type {MemizeCacheNode} */ (tail).prev; /** @type {MemizeCacheNode} */ (tail).next = null; } else { size++; } head = node; return node.val; } memoized.clear = function () { head = null; tail = null; size = 0; }; // Ignore reason: There's not a clear solution to create an intersection of // the function with additional properties, where the goal is to retain the // function signature of the incoming argument and add control properties // on the return value. // @ts-ignore return memoized; } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/get-global-styles-changes.js /** * External dependencies */ /** * WordPress dependencies */ const globalStylesChangesCache = new Map(); const get_global_styles_changes_EMPTY_ARRAY = []; const translationMap = { caption: (0,external_wp_i18n_namespaceObject.__)('Caption'), link: (0,external_wp_i18n_namespaceObject.__)('Link'), button: (0,external_wp_i18n_namespaceObject.__)('Button'), heading: (0,external_wp_i18n_namespaceObject.__)('Heading'), h1: (0,external_wp_i18n_namespaceObject.__)('H1'), h2: (0,external_wp_i18n_namespaceObject.__)('H2'), h3: (0,external_wp_i18n_namespaceObject.__)('H3'), h4: (0,external_wp_i18n_namespaceObject.__)('H4'), h5: (0,external_wp_i18n_namespaceObject.__)('H5'), h6: (0,external_wp_i18n_namespaceObject.__)('H6'), 'settings.color': (0,external_wp_i18n_namespaceObject.__)('Color'), 'settings.typography': (0,external_wp_i18n_namespaceObject.__)('Typography'), 'styles.color': (0,external_wp_i18n_namespaceObject.__)('Colors'), 'styles.spacing': (0,external_wp_i18n_namespaceObject.__)('Spacing'), 'styles.background': (0,external_wp_i18n_namespaceObject.__)('Background'), 'styles.typography': (0,external_wp_i18n_namespaceObject.__)('Typography') }; const getBlockNames = memize(() => (0,external_wp_blocks_namespaceObject.getBlockTypes)().reduce((accumulator, { name, title }) => { accumulator[name] = title; return accumulator; }, {})); const isObject = obj => obj !== null && typeof obj === 'object'; /** * Get the translation for a given global styles key. * @param {string} key A key representing a path to a global style property or setting. * @return {string|undefined} A translated key or undefined if no translation exists. */ function getTranslation(key) { if (translationMap[key]) { return translationMap[key]; } const keyArray = key.split('.'); if (keyArray?.[0] === 'blocks') { const blockName = getBlockNames()?.[keyArray[1]]; return blockName || keyArray[1]; } if (keyArray?.[0] === 'elements') { return translationMap[keyArray[1]] || keyArray[1]; } return undefined; } /** * A deep comparison of two objects, optimized for comparing global styles. * @param {Object} changedObject The changed object to compare. * @param {Object} originalObject The original object to compare against. * @param {string} parentPath A key/value pair object of block names and their rendered titles. * @return {string[]} An array of paths whose values have changed. */ function deepCompare(changedObject, originalObject, parentPath = '') { // We have two non-object values to compare. if (!isObject(changedObject) && !isObject(originalObject)) { /* * Only return a path if the value has changed. * And then only the path name up to 2 levels deep. */ return changedObject !== originalObject ? parentPath.split('.').slice(0, 2).join('.') : undefined; } // Enable comparison when an object doesn't have a corresponding property to compare. changedObject = isObject(changedObject) ? changedObject : {}; originalObject = isObject(originalObject) ? originalObject : {}; const allKeys = new Set([...Object.keys(changedObject), ...Object.keys(originalObject)]); let diffs = []; for (const key of allKeys) { const path = parentPath ? parentPath + '.' + key : key; const changedPath = deepCompare(changedObject[key], originalObject[key], path); if (changedPath) { diffs = diffs.concat(changedPath); } } return diffs; } /** * Returns an array of translated summarized global styles changes. * Results are cached using a Map() key of `JSON.stringify( { next, previous } )`. * * @param {Object} next The changed object to compare. * @param {Object} previous The original object to compare against. * @return {Array[]} A 2-dimensional array of tuples: [ "group", "translated change" ]. */ function getGlobalStylesChangelist(next, previous) { const cacheKey = JSON.stringify({ next, previous }); if (globalStylesChangesCache.has(cacheKey)) { return globalStylesChangesCache.get(cacheKey); } /* * Compare the two changesets with normalized keys. * The order of these keys determines the order in which * they'll appear in the results. */ const changedValueTree = deepCompare({ styles: { background: next?.styles?.background, color: next?.styles?.color, typography: next?.styles?.typography, spacing: next?.styles?.spacing }, blocks: next?.styles?.blocks, elements: next?.styles?.elements, settings: next?.settings }, { styles: { background: previous?.styles?.background, color: previous?.styles?.color, typography: previous?.styles?.typography, spacing: previous?.styles?.spacing }, blocks: previous?.styles?.blocks, elements: previous?.styles?.elements, settings: previous?.settings }); if (!changedValueTree.length) { globalStylesChangesCache.set(cacheKey, get_global_styles_changes_EMPTY_ARRAY); return get_global_styles_changes_EMPTY_ARRAY; } // Remove duplicate results. const result = [...new Set(changedValueTree)] /* * Translate the keys. * Remove empty translations. */.reduce((acc, curr) => { const translation = getTranslation(curr); if (translation) { acc.push([curr.split('.')[0], translation]); } return acc; }, []); globalStylesChangesCache.set(cacheKey, result); return result; } /** * From a getGlobalStylesChangelist() result, returns an array of translated global styles changes, grouped by type. * The types are 'blocks', 'elements', 'settings', and 'styles'. * * @param {Object} next The changed object to compare. * @param {Object} previous The original object to compare against. * @param {{maxResults:number}} options Options. maxResults: results to return before truncating. * @return {string[]} An array of translated changes. */ function getGlobalStylesChanges(next, previous, options = {}) { let changeList = getGlobalStylesChangelist(next, previous); const changesLength = changeList.length; const { maxResults } = options; if (changesLength) { // Truncate to `n` results if necessary. if (!!maxResults && changesLength > maxResults) { changeList = changeList.slice(0, maxResults); } return Object.entries(changeList.reduce((acc, curr) => { const group = acc[curr[0]] || []; if (!group.includes(curr[1])) { acc[curr[0]] = [...group, curr[1]]; } return acc; }, {})).map(([key, changeValues]) => { const changeValuesLength = changeValues.length; const joinedChangesValue = changeValues.join(/* translators: Used between list items, there is a space after the comma. */ (0,external_wp_i18n_namespaceObject.__)(', ') // eslint-disable-line @wordpress/i18n-no-flanking-whitespace ); switch (key) { case 'blocks': { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: a list of block names separated by a comma. (0,external_wp_i18n_namespaceObject._n)('%s block.', '%s blocks.', changeValuesLength), joinedChangesValue); } case 'elements': { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: a list of element names separated by a comma. (0,external_wp_i18n_namespaceObject._n)('%s element.', '%s elements.', changeValuesLength), joinedChangesValue); } case 'settings': { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: a list of theme.json setting labels separated by a comma. (0,external_wp_i18n_namespaceObject.__)('%s settings.'), joinedChangesValue); } case 'styles': { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: a list of theme.json top-level styles labels separated by a comma. (0,external_wp_i18n_namespaceObject.__)('%s styles.'), joinedChangesValue); } default: { return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: a list of global styles changes separated by a comma. (0,external_wp_i18n_namespaceObject.__)('%s.'), joinedChangesValue); } } }); } return get_global_styles_changes_EMPTY_ARRAY; } ;// ./node_modules/@wordpress/block-editor/build-module/components/global-styles/index.js ;// ./node_modules/@wordpress/block-editor/build-module/components/rich-text/get-rich-text-values.js /** * WordPress dependencies */ /** * Internal dependencies */ /* * This function is similar to `@wordpress/element`'s `renderToString` function, * except that it does not render the elements to a string, but instead collects * the values of all rich text `Content` elements. */ function addValuesForElement(element, values, innerBlocks) { if (null === element || undefined === element || false === element) { return; } if (Array.isArray(element)) { return addValuesForElements(element, values, innerBlocks); } switch (typeof element) { case 'string': case 'number': return; } const { type, props } = element; switch (type) { case external_wp_element_namespaceObject.StrictMode: case external_wp_element_namespaceObject.Fragment: return addValuesForElements(props.children, values, innerBlocks); case external_wp_element_namespaceObject.RawHTML: return; case inner_blocks.Content: return addValuesForBlocks(values, innerBlocks); case Content: values.push(props.value); return; } switch (typeof type) { case 'string': if (typeof props.children !== 'undefined') { return addValuesForElements(props.children, values, innerBlocks); } return; case 'function': const el = type.prototype && typeof type.prototype.render === 'function' ? new type(props).render() : type(props); return addValuesForElement(el, values, innerBlocks); } } function addValuesForElements(children, ...args) { children = Array.isArray(children) ? children : [children]; for (let i = 0; i < children.length; i++) { addValuesForElement(children[i], ...args); } } function addValuesForBlocks(values, blocks) { for (let i = 0; i < blocks.length; i++) { const { name, attributes, innerBlocks } = blocks[i]; const saveElement = (0,external_wp_blocks_namespaceObject.getSaveElement)(name, attributes, /*#__PURE__*/ // Instead of letting save elements use `useInnerBlocksProps.save`, // force them to use InnerBlocks.Content instead so we can intercept // a single component. (0,external_ReactJSXRuntime_namespaceObject.jsx)(inner_blocks.Content, {})); addValuesForElement(saveElement, values, innerBlocks); } } function getRichTextValues(blocks = []) { external_wp_blocks_namespaceObject.__unstableGetBlockProps.skipFilters = true; const values = []; addValuesForBlocks(values, blocks); external_wp_blocks_namespaceObject.__unstableGetBlockProps.skipFilters = false; return values.map(value => value instanceof external_wp_richText_namespaceObject.RichTextData ? value : external_wp_richText_namespaceObject.RichTextData.fromHTMLString(value)); } ;// ./node_modules/@wordpress/block-editor/build-module/components/resizable-box-popover/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function ResizableBoxPopover({ clientId, resizableBoxProps, ...props }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(cover, { clientId: clientId, __unstablePopoverSlot: "block-toolbar", ...props, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { ...resizableBoxProps }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-manager/checklist.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockTypesChecklist({ blockTypes, value, onItemChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "block-editor-block-manager__checklist", children: blockTypes.map(blockType => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: "block-editor-block-manager__checklist-item", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { __nextHasNoMarginBottom: true, label: blockType.title, checked: value.includes(blockType.name), onChange: (...args) => onItemChange(blockType, ...args) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_icon, { icon: blockType.icon })] }, blockType.name)) }); } /* harmony default export */ const checklist = (BlockTypesChecklist); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-manager/category.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockManagerCategory({ title, blockTypes, selectedBlockTypes, onChange }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(BlockManagerCategory); const toggleVisible = (0,external_wp_element_namespaceObject.useCallback)((blockType, nextIsChecked) => { if (nextIsChecked) { onChange([...selectedBlockTypes, blockType]); } else { onChange(selectedBlockTypes.filter(({ name }) => name !== blockType.name)); } }, [selectedBlockTypes, onChange]); const toggleAllVisible = (0,external_wp_element_namespaceObject.useCallback)(nextIsChecked => { if (nextIsChecked) { onChange([...selectedBlockTypes, ...blockTypes.filter(blockType => !selectedBlockTypes.find(({ name }) => name === blockType.name))]); } else { onChange(selectedBlockTypes.filter(selectedBlockType => !blockTypes.find(({ name }) => name === selectedBlockType.name))); } }, [blockTypes, selectedBlockTypes, onChange]); if (!blockTypes.length) { return null; } const checkedBlockNames = blockTypes.map(({ name }) => name).filter(type => (selectedBlockTypes !== null && selectedBlockTypes !== void 0 ? selectedBlockTypes : []).some(selectedBlockType => selectedBlockType.name === type)); const titleId = 'block-editor-block-manager__category-title-' + instanceId; const isAllChecked = checkedBlockNames.length === blockTypes.length; const isIndeterminate = !isAllChecked && checkedBlockNames.length > 0; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { role: "group", "aria-labelledby": titleId, className: "block-editor-block-manager__category", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { __nextHasNoMarginBottom: true, checked: isAllChecked, onChange: toggleAllVisible, className: "block-editor-block-manager__category-title", indeterminate: isIndeterminate, label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { id: titleId, children: title }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(checklist, { blockTypes: blockTypes, value: checkedBlockNames, onItemChange: toggleVisible })] }); } /* harmony default export */ const block_manager_category = (BlockManagerCategory); ;// ./node_modules/@wordpress/block-editor/build-module/components/block-manager/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Provides a list of blocks with checkboxes. * * @param {Object} props Props. * @param {Array} props.blockTypes An array of blocks. * @param {Array} props.selectedBlockTypes An array of selected blocks. * @param {Function} props.onChange Function to be called when the selected blocks change. */ function BlockManager({ blockTypes, selectedBlockTypes, onChange }) { const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500); const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)(''); const { categories, isMatchingSearchTerm } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { categories: select(external_wp_blocks_namespaceObject.store).getCategories(), isMatchingSearchTerm: select(external_wp_blocks_namespaceObject.store).isMatchingSearchTerm }; }, []); function enableAllBlockTypes() { onChange(blockTypes); } const filteredBlockTypes = blockTypes.filter(blockType => { return !search || isMatchingSearchTerm(blockType, search); }); const numberOfHiddenBlocks = blockTypes.length - selectedBlockTypes.length; // Announce search results on change (0,external_wp_element_namespaceObject.useEffect)(() => { if (!search) { return; } const count = filteredBlockTypes.length; const resultsFoundMessage = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of results. */ (0,external_wp_i18n_namespaceObject._n)('%d result found.', '%d results found.', count), count); debouncedSpeak(resultsFoundMessage); }, [filteredBlockTypes?.length, search, debouncedSpeak]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-manager__content", children: [!!numberOfHiddenBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-editor-block-manager__disabled-blocks-count", children: [(0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %d: number of blocks. */ (0,external_wp_i18n_namespaceObject._n)('%d block is hidden.', '%d blocks are hidden.', numberOfHiddenBlocks), numberOfHiddenBlocks), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "link", onClick: enableAllBlockTypes, children: (0,external_wp_i18n_namespaceObject.__)('Reset') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Search for a block'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Search for a block'), value: search, onChange: nextSearch => setSearch(nextSearch), className: "block-editor-block-manager__search" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { tabIndex: "0", role: "region", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Available block types'), className: "block-editor-block-manager__results", children: [filteredBlockTypes.length === 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "block-editor-block-manager__no-results", children: (0,external_wp_i18n_namespaceObject.__)('No blocks found.') }), categories.map(category => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_manager_category, { title: category.title, blockTypes: filteredBlockTypes.filter(blockType => blockType.category === category.slug), selectedBlockTypes: selectedBlockTypes, onChange: onChange }, category.slug)), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(block_manager_category, { title: (0,external_wp_i18n_namespaceObject.__)('Uncategorized'), blockTypes: filteredBlockTypes.filter(({ category }) => !category), selectedBlockTypes: selectedBlockTypes, onChange: onChange })] })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/block-removal-warning-modal/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function BlockRemovalWarningModal({ rules }) { const { clientIds, selectPrevious, message } = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getRemovalPromptData()); const { clearBlockRemovalPrompt, setBlockRemovalRules, privateRemoveBlocks } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); // Load block removal rules, simultaneously signalling that the block // removal prompt is in place. (0,external_wp_element_namespaceObject.useEffect)(() => { setBlockRemovalRules(rules); return () => { setBlockRemovalRules(); }; }, [rules, setBlockRemovalRules]); if (!message) { return; } const onConfirmRemoval = () => { privateRemoveBlocks(clientIds, selectPrevious, /* force */true); clearBlockRemovalPrompt(); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Be careful!'), onRequestClose: clearBlockRemovalPrompt, size: "medium", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: message }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "tertiary", onClick: clearBlockRemovalPrompt, __next40pxDefaultSize: true, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", onClick: onConfirmRemoval, __next40pxDefaultSize: true, children: (0,external_wp_i18n_namespaceObject.__)('Delete') })] })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/dimensions-tool/scale-tool.js /** * WordPress dependencies */ /** * @typedef {import('@wordpress/components/build-types/select-control/types').SelectControlProps} SelectControlProps */ /** * The descriptions are purposely made generic as object-fit could be used for * any replaced element. Provide your own set of options if you need different * help text or labels. * * @see https://developer.mozilla.org/en-US/docs/Web/CSS/Replaced_element * * @type {SelectControlProps[]} */ const DEFAULT_SCALE_OPTIONS = [{ value: 'fill', label: (0,external_wp_i18n_namespaceObject._x)('Fill', 'Scale option for dimensions control'), help: (0,external_wp_i18n_namespaceObject.__)('Fill the space by stretching the content.') }, { value: 'contain', label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for dimensions control'), help: (0,external_wp_i18n_namespaceObject.__)('Fit the content to the space without clipping.') }, { value: 'cover', label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for dimensions control'), help: (0,external_wp_i18n_namespaceObject.__)("Fill the space by clipping what doesn't fit.") }, { value: 'none', label: (0,external_wp_i18n_namespaceObject._x)('None', 'Scale option for dimensions control'), help: (0,external_wp_i18n_namespaceObject.__)('Do not adjust the sizing of the content. Content that is too large will be clipped, and content that is too small will have additional padding.') }, { value: 'scale-down', label: (0,external_wp_i18n_namespaceObject._x)('Scale down', 'Scale option for dimensions control'), help: (0,external_wp_i18n_namespaceObject.__)('Scale down the content to fit the space if it is too big. Content that is too small will have additional padding.') }]; /** * @callback ScaleToolPropsOnChange * @param {string} nextValue New scale value. * @return {void} */ /** * @typedef {Object} ScaleToolProps * @property {string} [panelId] ID of the panel that contains the controls. * @property {string} [value] Current scale value. * @property {ScaleToolPropsOnChange} [onChange] Callback to update the scale value. * @property {SelectControlProps[]} [options] Scale options. * @property {string} [defaultValue] Default scale value. * @property {boolean} [showControl=true] Whether to show the control. * @property {boolean} [isShownByDefault=true] Whether the tool panel is shown by default. */ /** * A tool to select the CSS object-fit property for the image. * * @param {ScaleToolProps} props * * @return {import('react').ReactElement} The scale tool. */ function ScaleTool({ panelId, value, onChange, options = DEFAULT_SCALE_OPTIONS, defaultValue = DEFAULT_SCALE_OPTIONS[0].value, isShownByDefault = true }) { // Match the CSS default so if the value is used directly in CSS it will look correct in the control. const displayValue = value !== null && value !== void 0 ? value : 'fill'; const scaleHelp = (0,external_wp_element_namespaceObject.useMemo)(() => { return options.reduce((acc, option) => { acc[option.value] = option.help; return acc; }, {}); }, [options]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Scale'), isShownByDefault: isShownByDefault, hasValue: () => displayValue !== defaultValue, onDeselect: () => onChange(defaultValue), panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Scale'), isBlock: true, help: scaleHelp[displayValue], value: displayValue, onChange: onChange, size: "__unstable-large", children: options.map(option => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { ...option }, option.value)) }) }); } ;// ./node_modules/@babel/runtime/helpers/esm/extends.js function extends_extends() { return extends_extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, extends_extends.apply(null, arguments); } ;// ./node_modules/@emotion/memoize/dist/emotion-memoize.esm.js function memoize(fn) { var cache = Object.create(null); return function (arg) { if (cache[arg] === undefined) cache[arg] = fn(arg); return cache[arg]; }; } ;// ./node_modules/@emotion/styled/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 var isPropValid = /* #__PURE__ */memoize(function (prop) { return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 /* o */ && prop.charCodeAt(1) === 110 /* n */ && prop.charCodeAt(2) < 91; } /* Z+1 */ ); ;// ./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js /* Based off glamor's StyleSheet, thanks Sunil ❤️ high performance StyleSheet for css-in-js systems - uses multiple style tags behind the scenes for millions of rules - uses `insertRule` for appending in production for *much* faster performance // usage import { StyleSheet } from '@emotion/sheet' let styleSheet = new StyleSheet({ key: '', container: document.head }) styleSheet.insert('#box { border: 1px solid red; }') - appends a css rule into the stylesheet styleSheet.flush() - empties the stylesheet of all its contents */ // $FlowFixMe function sheetForTag(tag) { if (tag.sheet) { // $FlowFixMe return tag.sheet; } // this weirdness brought to you by firefox /* istanbul ignore next */ for (var i = 0; i < document.styleSheets.length; i++) { if (document.styleSheets[i].ownerNode === tag) { // $FlowFixMe return document.styleSheets[i]; } } } function createStyleElement(options) { var tag = document.createElement('style'); tag.setAttribute('data-emotion', options.key); if (options.nonce !== undefined) { tag.setAttribute('nonce', options.nonce); } tag.appendChild(document.createTextNode('')); tag.setAttribute('data-s', ''); return tag; } var StyleSheet = /*#__PURE__*/function () { // Using Node instead of HTMLElement since container may be a ShadowRoot function StyleSheet(options) { var _this = this; this._insertTag = function (tag) { var before; if (_this.tags.length === 0) { if (_this.insertionPoint) { before = _this.insertionPoint.nextSibling; } else if (_this.prepend) { before = _this.container.firstChild; } else { before = _this.before; } } else { before = _this.tags[_this.tags.length - 1].nextSibling; } _this.container.insertBefore(tag, before); _this.tags.push(tag); }; this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy; this.tags = []; this.ctr = 0; this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets this.key = options.key; this.container = options.container; this.prepend = options.prepend; this.insertionPoint = options.insertionPoint; this.before = null; } var _proto = StyleSheet.prototype; _proto.hydrate = function hydrate(nodes) { nodes.forEach(this._insertTag); }; _proto.insert = function insert(rule) { // the max length is how many rules we have per style tag, it's 65000 in speedy mode // it's 1 in dev because we insert source maps that map a single rule to a location // and you can only have one source map per style tag if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) { this._insertTag(createStyleElement(this)); } var tag = this.tags[this.tags.length - 1]; if (false) { var isImportRule; } if (this.isSpeedy) { var sheet = sheetForTag(tag); try { // this is the ultrafast version, works across browsers // the big drawback is that the css won't be editable in devtools sheet.insertRule(rule, sheet.cssRules.length); } catch (e) { if (false) {} } } else { tag.appendChild(document.createTextNode(rule)); } this.ctr++; }; _proto.flush = function flush() { // $FlowFixMe this.tags.forEach(function (tag) { return tag.parentNode && tag.parentNode.removeChild(tag); }); this.tags = []; this.ctr = 0; if (false) {} }; return StyleSheet; }(); ;// ./node_modules/stylis/src/Utility.js /** * @param {number} * @return {number} */ var abs = Math.abs /** * @param {number} * @return {string} */ var Utility_from = String.fromCharCode /** * @param {object} * @return {object} */ var Utility_assign = Object.assign /** * @param {string} value * @param {number} length * @return {number} */ function hash (value, length) { return Utility_charat(value, 0) ^ 45 ? (((((((length << 2) ^ Utility_charat(value, 0)) << 2) ^ Utility_charat(value, 1)) << 2) ^ Utility_charat(value, 2)) << 2) ^ Utility_charat(value, 3) : 0 } /** * @param {string} value * @return {string} */ function trim (value) { return value.trim() } /** * @param {string} value * @param {RegExp} pattern * @return {string?} */ function Utility_match (value, pattern) { return (value = pattern.exec(value)) ? value[0] : value } /** * @param {string} value * @param {(string|RegExp)} pattern * @param {string} replacement * @return {string} */ function Utility_replace (value, pattern, replacement) { return value.replace(pattern, replacement) } /** * @param {string} value * @param {string} search * @return {number} */ function indexof (value, search) { return value.indexOf(search) } /** * @param {string} value * @param {number} index * @return {number} */ function Utility_charat (value, index) { return value.charCodeAt(index) | 0 } /** * @param {string} value * @param {number} begin * @param {number} end * @return {string} */ function Utility_substr (value, begin, end) { return value.slice(begin, end) } /** * @param {string} value * @return {number} */ function Utility_strlen (value) { return value.length } /** * @param {any[]} value * @return {number} */ function Utility_sizeof (value) { return value.length } /** * @param {any} value * @param {any[]} array * @return {any} */ function Utility_append (value, array) { return array.push(value), value } /** * @param {string[]} array * @param {function} callback * @return {string} */ function Utility_combine (array, callback) { return array.map(callback).join('') } ;// ./node_modules/stylis/src/Tokenizer.js var line = 1 var column = 1 var Tokenizer_length = 0 var Tokenizer_position = 0 var Tokenizer_character = 0 var characters = '' /** * @param {string} value * @param {object | null} root * @param {object | null} parent * @param {string} type * @param {string[] | string} props * @param {object[] | string} children * @param {number} length */ function node (value, root, parent, type, props, children, length) { return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''} } /** * @param {object} root * @param {object} props * @return {object} */ function Tokenizer_copy (root, props) { return Utility_assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props) } /** * @return {number} */ function Tokenizer_char () { return Tokenizer_character } /** * @return {number} */ function prev () { Tokenizer_character = Tokenizer_position > 0 ? Utility_charat(characters, --Tokenizer_position) : 0 if (column--, Tokenizer_character === 10) column = 1, line-- return Tokenizer_character } /** * @return {number} */ function next () { Tokenizer_character = Tokenizer_position < Tokenizer_length ? Utility_charat(characters, Tokenizer_position++) : 0 if (column++, Tokenizer_character === 10) column = 1, line++ return Tokenizer_character } /** * @return {number} */ function peek () { return Utility_charat(characters, Tokenizer_position) } /** * @return {number} */ function caret () { return Tokenizer_position } /** * @param {number} begin * @param {number} end * @return {string} */ function slice (begin, end) { return Utility_substr(characters, begin, end) } /** * @param {number} type * @return {number} */ function token (type) { switch (type) { // \0 \t \n \r \s whitespace token case 0: case 9: case 10: case 13: case 32: return 5 // ! + , / > @ ~ isolate token case 33: case 43: case 44: case 47: case 62: case 64: case 126: // ; { } breakpoint token case 59: case 123: case 125: return 4 // : accompanied token case 58: return 3 // " ' ( [ opening delimit token case 34: case 39: case 40: case 91: return 2 // ) ] closing delimit token case 41: case 93: return 1 } return 0 } /** * @param {string} value * @return {any[]} */ function alloc (value) { return line = column = 1, Tokenizer_length = Utility_strlen(characters = value), Tokenizer_position = 0, [] } /** * @param {any} value * @return {any} */ function dealloc (value) { return characters = '', value } /** * @param {number} type * @return {string} */ function delimit (type) { return trim(slice(Tokenizer_position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type))) } /** * @param {string} value * @return {string[]} */ function Tokenizer_tokenize (value) { return dealloc(tokenizer(alloc(value))) } /** * @param {number} type * @return {string} */ function whitespace (type) { while (Tokenizer_character = peek()) if (Tokenizer_character < 33) next() else break return token(type) > 2 || token(Tokenizer_character) > 3 ? '' : ' ' } /** * @param {string[]} children * @return {string[]} */ function tokenizer (children) { while (next()) switch (token(Tokenizer_character)) { case 0: append(identifier(Tokenizer_position - 1), children) break case 2: append(delimit(Tokenizer_character), children) break default: append(from(Tokenizer_character), children) } return children } /** * @param {number} index * @param {number} count * @return {string} */ function escaping (index, count) { while (--count && next()) // not 0-9 A-F a-f if (Tokenizer_character < 48 || Tokenizer_character > 102 || (Tokenizer_character > 57 && Tokenizer_character < 65) || (Tokenizer_character > 70 && Tokenizer_character < 97)) break return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32)) } /** * @param {number} type * @return {number} */ function delimiter (type) { while (next()) switch (Tokenizer_character) { // ] ) " ' case type: return Tokenizer_position // " ' case 34: case 39: if (type !== 34 && type !== 39) delimiter(Tokenizer_character) break // ( case 40: if (type === 41) delimiter(type) break // \ case 92: next() break } return Tokenizer_position } /** * @param {number} type * @param {number} index * @return {number} */ function commenter (type, index) { while (next()) // // if (type + Tokenizer_character === 47 + 10) break // /* else if (type + Tokenizer_character === 42 + 42 && peek() === 47) break return '/*' + slice(index, Tokenizer_position - 1) + '*' + Utility_from(type === 47 ? type : next()) } /** * @param {number} index * @return {string} */ function identifier (index) { while (!token(peek())) next() return slice(index, Tokenizer_position) } ;// ./node_modules/stylis/src/Enum.js var Enum_MS = '-ms-' var Enum_MOZ = '-moz-' var Enum_WEBKIT = '-webkit-' var COMMENT = 'comm' var Enum_RULESET = 'rule' var Enum_DECLARATION = 'decl' var PAGE = '@page' var MEDIA = '@media' var IMPORT = '@import' var CHARSET = '@charset' var VIEWPORT = '@viewport' var SUPPORTS = '@supports' var DOCUMENT = '@document' var NAMESPACE = '@namespace' var Enum_KEYFRAMES = '@keyframes' var FONT_FACE = '@font-face' var COUNTER_STYLE = '@counter-style' var FONT_FEATURE_VALUES = '@font-feature-values' ;// ./node_modules/stylis/src/Serializer.js /** * @param {object[]} children * @param {function} callback * @return {string} */ function Serializer_serialize (children, callback) { var output = '' var length = Utility_sizeof(children) for (var i = 0; i < length; i++) output += callback(children[i], i, children, callback) || '' return output } /** * @param {object} element * @param {number} index * @param {object[]} children * @param {function} callback * @return {string} */ function Serializer_stringify (element, index, children, callback) { switch (element.type) { case IMPORT: case Enum_DECLARATION: return element.return = element.return || element.value case COMMENT: return '' case Enum_KEYFRAMES: return element.return = element.value + '{' + Serializer_serialize(element.children, callback) + '}' case Enum_RULESET: element.value = element.props.join(',') } return Utility_strlen(children = Serializer_serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : '' } ;// ./node_modules/stylis/src/Middleware.js /** * @param {function[]} collection * @return {function} */ function middleware (collection) { var length = Utility_sizeof(collection) return function (element, index, children, callback) { var output = '' for (var i = 0; i < length; i++) output += collection[i](element, index, children, callback) || '' return output } } /** * @param {function} callback * @return {function} */ function rulesheet (callback) { return function (element) { if (!element.root) if (element = element.return) callback(element) } } /** * @param {object} element * @param {number} index * @param {object[]} children * @param {function} callback */ function prefixer (element, index, children, callback) { if (element.length > -1) if (!element.return) switch (element.type) { case DECLARATION: element.return = prefix(element.value, element.length, children) return case KEYFRAMES: return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback) case RULESET: if (element.length) return combine(element.props, function (value) { switch (match(value, /(::plac\w+|:read-\w+)/)) { // :read-(only|write) case ':read-only': case ':read-write': return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback) // :placeholder case '::placeholder': return serialize([ copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}), copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}), copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]}) ], callback) } return '' }) } } /** * @param {object} element * @param {number} index * @param {object[]} children */ function namespace (element) { switch (element.type) { case RULESET: element.props = element.props.map(function (value) { return combine(tokenize(value), function (value, index, children) { switch (charat(value, 0)) { // \f case 12: return substr(value, 1, strlen(value)) // \0 ( + > ~ case 0: case 40: case 43: case 62: case 126: return value // : case 58: if (children[++index] === 'global') children[index] = '', children[++index] = '\f' + substr(children[index], index = 1, -1) // \s case 32: return index === 1 ? '' : value default: switch (index) { case 0: element = value return sizeof(children) > 1 ? '' : value case index = sizeof(children) - 1: case 2: return index === 2 ? value + element + element : value + element default: return value } } }) }) } } ;// ./node_modules/stylis/src/Parser.js /** * @param {string} value * @return {object[]} */ function compile (value) { return dealloc(Parser_parse('', null, null, null, [''], value = alloc(value), 0, [0], value)) } /** * @param {string} value * @param {object} root * @param {object?} parent * @param {string[]} rule * @param {string[]} rules * @param {string[]} rulesets * @param {number[]} pseudo * @param {number[]} points * @param {string[]} declarations * @return {object} */ function Parser_parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) { var index = 0 var offset = 0 var length = pseudo var atrule = 0 var property = 0 var previous = 0 var variable = 1 var scanning = 1 var ampersand = 1 var character = 0 var type = '' var props = rules var children = rulesets var reference = rule var characters = type while (scanning) switch (previous = character, character = next()) { // ( case 40: if (previous != 108 && Utility_charat(characters, length - 1) == 58) { if (indexof(characters += Utility_replace(delimit(character), '&', '&\f'), '&\f') != -1) ampersand = -1 break } // " ' [ case 34: case 39: case 91: characters += delimit(character) break // \t \n \r \s case 9: case 10: case 13: case 32: characters += whitespace(previous) break // \ case 92: characters += escaping(caret() - 1, 7) continue // / case 47: switch (peek()) { case 42: case 47: Utility_append(comment(commenter(next(), caret()), root, parent), declarations) break default: characters += '/' } break // { case 123 * variable: points[index++] = Utility_strlen(characters) * ampersand // } ; \0 case 125 * variable: case 59: case 0: switch (character) { // \0 } case 0: case 125: scanning = 0 // ; case 59 + offset: if (property > 0 && (Utility_strlen(characters) - length)) Utility_append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(Utility_replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations) break // @ ; case 59: characters += ';' // { rule/at-rule default: Utility_append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets) if (character === 123) if (offset === 0) Parser_parse(characters, root, reference, reference, props, rulesets, length, points, children) else switch (atrule === 99 && Utility_charat(characters, 3) === 110 ? 100 : atrule) { // d m s case 100: case 109: case 115: Parser_parse(value, reference, reference, rule && Utility_append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children) break default: Parser_parse(characters, reference, reference, reference, [''], children, 0, points, children) } } index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo break // : case 58: length = 1 + Utility_strlen(characters), property = previous default: if (variable < 1) if (character == 123) --variable else if (character == 125 && variable++ == 0 && prev() == 125) continue switch (characters += Utility_from(character), character * variable) { // & case 38: ampersand = offset > 0 ? 1 : (characters += '\f', -1) break // , case 44: points[index++] = (Utility_strlen(characters) - 1) * ampersand, ampersand = 1 break // @ case 64: // - if (peek() === 45) characters += delimit(next()) atrule = peek(), offset = length = Utility_strlen(type = characters += identifier(caret())), character++ break // - case 45: if (previous === 45 && Utility_strlen(characters) == 2) variable = 0 } } return rulesets } /** * @param {string} value * @param {object} root * @param {object?} parent * @param {number} index * @param {number} offset * @param {string[]} rules * @param {number[]} points * @param {string} type * @param {string[]} props * @param {string[]} children * @param {number} length * @return {object} */ function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) { var post = offset - 1 var rule = offset === 0 ? rules : [''] var size = Utility_sizeof(rule) for (var i = 0, j = 0, k = 0; i < index; ++i) for (var x = 0, y = Utility_substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x) if (z = trim(j > 0 ? rule[x] + ' ' + y : Utility_replace(y, /&\f/g, rule[x]))) props[k++] = z return node(value, root, parent, offset === 0 ? Enum_RULESET : type, props, children, length) } /** * @param {number} value * @param {object} root * @param {object?} parent * @return {object} */ function comment (value, root, parent) { return node(value, root, parent, COMMENT, Utility_from(Tokenizer_char()), Utility_substr(value, 2, -2), 0) } /** * @param {string} value * @param {object} root * @param {object?} parent * @param {number} length * @return {object} */ function declaration (value, root, parent, length) { return node(value, root, parent, Enum_DECLARATION, Utility_substr(value, 0, length), Utility_substr(value, length + 1, -1), length) } ;// ./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) { var previous = 0; var character = 0; while (true) { previous = character; character = peek(); // &\f if (previous === 38 && character === 12) { points[index] = 1; } if (token(character)) { break; } next(); } return slice(begin, Tokenizer_position); }; var toRules = function toRules(parsed, points) { // pretend we've started with a comma var index = -1; var character = 44; do { switch (token(character)) { case 0: // &\f if (character === 38 && peek() === 12) { // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings // stylis inserts \f after & to know when & where it should replace this sequence with the context selector // and when it should just concatenate the outer and inner selectors // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here points[index] = 1; } parsed[index] += identifierWithPointTracking(Tokenizer_position - 1, points, index); break; case 2: parsed[index] += delimit(character); break; case 4: // comma if (character === 44) { // colon parsed[++index] = peek() === 58 ? '&\f' : ''; points[index] = parsed[index].length; break; } // fallthrough default: parsed[index] += Utility_from(character); } } while (character = next()); return parsed; }; var getRules = function getRules(value, points) { return dealloc(toRules(alloc(value), points)); }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11 var fixedElements = /* #__PURE__ */new WeakMap(); var compat = function compat(element) { if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo // negative .length indicates that this rule has been already prefixed element.length < 1) { return; } var value = element.value, parent = element.parent; var isImplicitRule = element.column === parent.column && element.line === parent.line; while (parent.type !== 'rule') { parent = parent.parent; if (!parent) return; } // short-circuit for the simplest case if (element.props.length === 1 && value.charCodeAt(0) !== 58 /* colon */ && !fixedElements.get(parent)) { return; } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level) // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent" if (isImplicitRule) { return; } fixedElements.set(element, true); var points = []; var rules = getRules(value, points); var parentRules = parent.props; for (var i = 0, k = 0; i < rules.length; i++) { for (var j = 0; j < parentRules.length; j++, k++) { element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i]; } } }; var removeLabel = function removeLabel(element) { if (element.type === 'decl') { var value = element.value; if ( // charcode for l value.charCodeAt(0) === 108 && // charcode for b value.charCodeAt(2) === 98) { // this ignores label element["return"] = ''; element.value = ''; } } }; var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason'; var isIgnoringComment = function isIgnoringComment(element) { return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1; }; var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) { return function (element, index, children) { if (element.type !== 'rule' || cache.compat) return; var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g); if (unsafePseudoClasses) { var isNested = element.parent === children[0]; // in nested rules comments become children of the "auto-inserted" rule // // considering this input: // .a { // .b /* comm */ {} // color: hotpink; // } // we get output corresponding to this: // .a { // & { // /* comm */ // color: hotpink; // } // .b {} // } var commentContainer = isNested ? children[0].children : // global rule at the root level children; for (var i = commentContainer.length - 1; i >= 0; i--) { var node = commentContainer[i]; if (node.line < element.line) { break; } // it is quite weird but comments are *usually* put at `column: element.column - 1` // so we seek *from the end* for the node that is earlier than the rule's `element` and check that // this will also match inputs like this: // .a { // /* comm */ // .b {} // } // // but that is fine // // it would be the easiest to change the placement of the comment to be the first child of the rule: // .a { // .b { /* comm */ } // } // with such inputs we wouldn't have to search for the comment at all // TODO: consider changing this comment placement in the next major version if (node.column < element.column) { if (isIgnoringComment(node)) { return; } break; } } unsafePseudoClasses.forEach(function (unsafePseudoClass) { console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\"."); }); } }; }; var isImportRule = function isImportRule(element) { return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64; }; var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) { for (var i = index - 1; i >= 0; i--) { if (!isImportRule(children[i])) { return true; } } return false; }; // use this to remove incorrect elements from further processing // so they don't get handed to the `sheet` (or anything else) // as that could potentially lead to additional logs which in turn could be overhelming to the user var nullifyElement = function nullifyElement(element) { element.type = ''; element.value = ''; element["return"] = ''; element.children = ''; element.props = ''; }; var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) { if (!isImportRule(element)) { return; } if (element.parent) { console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles."); nullifyElement(element); } else if (isPrependedWithRegularRules(index, children)) { console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules."); nullifyElement(element); } }; /* eslint-disable no-fallthrough */ function emotion_cache_browser_esm_prefix(value, length) { switch (hash(value, length)) { // color-adjust case 5103: return Enum_WEBKIT + 'print-' + value + value; // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function) case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break case 5572: case 6356: case 5844: case 3191: case 6645: case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite, case 6391: case 5879: case 5623: case 6135: case 4599: case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width) case 4215: case 6389: case 5109: case 5365: case 5621: case 3829: return Enum_WEBKIT + value + value; // appearance, user-select, transform, hyphens, text-size-adjust case 5349: case 4246: case 4810: case 6968: case 2756: return Enum_WEBKIT + value + Enum_MOZ + value + Enum_MS + value + value; // flex, flex-direction case 6828: case 4268: return Enum_WEBKIT + value + Enum_MS + value + value; // order case 6165: return Enum_WEBKIT + value + Enum_MS + 'flex-' + value + value; // align-items case 5187: return Enum_WEBKIT + value + Utility_replace(value, /(\w+).+(:[^]+)/, Enum_WEBKIT + 'box-$1$2' + Enum_MS + 'flex-$1$2') + value; // align-self case 5443: return Enum_WEBKIT + value + Enum_MS + 'flex-item-' + Utility_replace(value, /flex-|-self/, '') + value; // align-content case 4675: return Enum_WEBKIT + value + Enum_MS + 'flex-line-pack' + Utility_replace(value, /align-content|flex-|-self/, '') + value; // flex-shrink case 5548: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'shrink', 'negative') + value; // flex-basis case 5292: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'basis', 'preferred-size') + value; // flex-grow case 6060: return Enum_WEBKIT + 'box-' + Utility_replace(value, '-grow', '') + Enum_WEBKIT + value + Enum_MS + Utility_replace(value, 'grow', 'positive') + value; // transition case 4554: return Enum_WEBKIT + Utility_replace(value, /([^-])(transform)/g, '$1' + Enum_WEBKIT + '$2') + value; // cursor case 6187: return Utility_replace(Utility_replace(Utility_replace(value, /(zoom-|grab)/, Enum_WEBKIT + '$1'), /(image-set)/, Enum_WEBKIT + '$1'), value, '') + value; // background, background-image case 5495: case 3959: return Utility_replace(value, /(image-set\([^]*)/, Enum_WEBKIT + '$1' + '$`$1'); // justify-content case 4968: return Utility_replace(Utility_replace(value, /(.+:)(flex-)?(.*)/, Enum_WEBKIT + 'box-pack:$3' + Enum_MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + Enum_WEBKIT + value + value; // (margin|padding)-inline-(start|end) case 4095: case 3583: case 4068: case 2532: return Utility_replace(value, /(.+)-inline(.+)/, Enum_WEBKIT + '$1$2') + value; // (min|max)?(width|height|inline-size|block-size) case 8116: case 7059: case 5753: case 5535: case 5445: case 5701: case 4933: case 4677: case 5533: case 5789: case 5021: case 4765: // stretch, max-content, min-content, fill-available if (Utility_strlen(value) - 1 - length > 6) switch (Utility_charat(value, length + 1)) { // (m)ax-content, (m)in-content case 109: // - if (Utility_charat(value, length + 4) !== 45) break; // (f)ill-available, (f)it-content case 102: return Utility_replace(value, /(.+:)(.+)-([^]+)/, '$1' + Enum_WEBKIT + '$2-$3' + '$1' + Enum_MOZ + (Utility_charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value; // (s)tretch case 115: return ~indexof(value, 'stretch') ? emotion_cache_browser_esm_prefix(Utility_replace(value, 'stretch', 'fill-available'), length) + value : value; } break; // position: sticky case 4949: // (s)ticky? if (Utility_charat(value, length + 1) !== 115) break; // display: (flex|inline-flex) case 6444: switch (Utility_charat(value, Utility_strlen(value) - 3 - (~indexof(value, '!important') && 10))) { // stic(k)y case 107: return Utility_replace(value, ':', ':' + Enum_WEBKIT) + value; // (inline-)?fl(e)x case 101: return Utility_replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + Enum_WEBKIT + (Utility_charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + Enum_WEBKIT + '$2$3' + '$1' + Enum_MS + '$2box$3') + value; } break; // writing-mode case 5936: switch (Utility_charat(value, length + 11)) { // vertical-l(r) case 114: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value; // vertical-r(l) case 108: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value; // horizontal(-)tb case 45: return Enum_WEBKIT + value + Enum_MS + Utility_replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value; } return Enum_WEBKIT + value + Enum_MS + value + value; } return value; } var emotion_cache_browser_esm_prefixer = function prefixer(element, index, children, callback) { if (element.length > -1) if (!element["return"]) switch (element.type) { case Enum_DECLARATION: element["return"] = emotion_cache_browser_esm_prefix(element.value, element.length); break; case Enum_KEYFRAMES: return Serializer_serialize([Tokenizer_copy(element, { value: Utility_replace(element.value, '@', '@' + Enum_WEBKIT) })], callback); case Enum_RULESET: if (element.length) return Utility_combine(element.props, function (value) { switch (Utility_match(value, /(::plac\w+|:read-\w+)/)) { // :read-(only|write) case ':read-only': case ':read-write': return Serializer_serialize([Tokenizer_copy(element, { props: [Utility_replace(value, /:(read-\w+)/, ':' + Enum_MOZ + '$1')] })], callback); // :placeholder case '::placeholder': return Serializer_serialize([Tokenizer_copy(element, { props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_WEBKIT + 'input-$1')] }), Tokenizer_copy(element, { props: [Utility_replace(value, /:(plac\w+)/, ':' + Enum_MOZ + '$1')] }), Tokenizer_copy(element, { props: [Utility_replace(value, /:(plac\w+)/, Enum_MS + 'input-$1')] })], callback); } return ''; }); } }; var defaultStylisPlugins = [emotion_cache_browser_esm_prefixer]; var createCache = function createCache(options) { var key = options.key; if (false) {} if ( key === 'css') { var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be) // note this very very intentionally targets all style elements regardless of the key to ensure // that creating a cache works inside of render of a React component Array.prototype.forEach.call(ssrStyles, function (node) { // we want to only move elements which have a space in the data-emotion attribute value // because that indicates that it is an Emotion 11 server-side rendered style elements // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes) // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles // will not result in the Emotion 10 styles being destroyed var dataEmotionAttribute = node.getAttribute('data-emotion'); if (dataEmotionAttribute.indexOf(' ') === -1) { return; } document.head.appendChild(node); node.setAttribute('data-s', ''); }); } var stylisPlugins = options.stylisPlugins || defaultStylisPlugins; if (false) {} var inserted = {}; var container; var nodesToHydrate = []; { container = options.container || document.head; Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which // means that the style elements we're looking at are only Emotion 11 server-rendered style elements document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) { var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe for (var i = 1; i < attrib.length; i++) { inserted[attrib[i]] = true; } nodesToHydrate.push(node); }); } var _insert; var omnipresentPlugins = [compat, removeLabel]; if (false) {} { var currentSheet; var finalizingPlugins = [Serializer_stringify, false ? 0 : rulesheet(function (rule) { currentSheet.insert(rule); })]; var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins)); var stylis = function stylis(styles) { return Serializer_serialize(compile(styles), serializer); }; _insert = function insert(selector, serialized, sheet, shouldCache) { currentSheet = sheet; if (false) {} stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles); if (shouldCache) { cache.inserted[serialized.name] = true; } }; } var cache = { key: key, sheet: new StyleSheet({ key: key, container: container, nonce: options.nonce, speedy: options.speedy, prepend: options.prepend, insertionPoint: options.insertionPoint }), nonce: options.nonce, inserted: inserted, registered: {}, insert: _insert }; cache.sheet.hydrate(nodesToHydrate); return cache; }; /* harmony default export */ const emotion_cache_browser_esm = (createCache); ;// ./node_modules/@emotion/hash/dist/emotion-hash.esm.js /* eslint-disable */ // Inspired by https://github.com/garycourt/murmurhash-js // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86 function murmur2(str) { // 'm' and 'r' are mixing constants generated offline. // They're not really 'magic', they just happen to work well. // const m = 0x5bd1e995; // const r = 24; // Initialize the hash var h = 0; // Mix 4 bytes at a time into the hash var k, i = 0, len = str.length; for (; len >= 4; ++i, len -= 4) { k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; k = /* Math.imul(k, m): */ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16); k ^= /* k >>> r: */ k >>> 24; h = /* Math.imul(k, m): */ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); } // Handle the last few bytes of the input array switch (len) { case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16; case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8; case 1: h ^= str.charCodeAt(i) & 0xff; h = /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); } // Do a few final mixes of the hash to ensure the last few // bytes are well-incorporated. h ^= h >>> 13; h = /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); return ((h ^ h >>> 15) >>> 0).toString(36); } /* harmony default export */ const emotion_hash_esm = (murmur2); ;// ./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js var unitlessKeys = { animationIterationCount: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, // SVG-related properties fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }; /* harmony default export */ const emotion_unitless_esm = (unitlessKeys); ;// ./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."; var hyphenateRegex = /[A-Z]|^ms/g; var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; var isCustomProperty = function isCustomProperty(property) { return property.charCodeAt(1) === 45; }; var isProcessableValue = function isProcessableValue(value) { return value != null && typeof value !== 'boolean'; }; var processStyleName = /* #__PURE__ */memoize(function (styleName) { return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); }); var processStyleValue = function processStyleValue(key, value) { switch (key) { case 'animation': case 'animationName': { if (typeof value === 'string') { return value.replace(animationRegex, function (match, p1, p2) { cursor = { name: p1, styles: p2, next: cursor }; return p1; }); } } } if (emotion_unitless_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) { return value + 'px'; } return value; }; if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; } var noComponentSelectorMessage = (/* unused pure expression or super */ null && ('Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.')); function handleInterpolation(mergedProps, registered, interpolation) { if (interpolation == null) { return ''; } if (interpolation.__emotion_styles !== undefined) { if (false) {} return interpolation; } switch (typeof interpolation) { case 'boolean': { return ''; } case 'object': { if (interpolation.anim === 1) { cursor = { name: interpolation.name, styles: interpolation.styles, next: cursor }; return interpolation.name; } if (interpolation.styles !== undefined) { var next = interpolation.next; if (next !== undefined) { // not the most efficient thing ever but this is a pretty rare case // and there will be very few iterations of this generally while (next !== undefined) { cursor = { name: next.name, styles: next.styles, next: cursor }; next = next.next; } } var styles = interpolation.styles + ";"; if (false) {} return styles; } return createStringFromObject(mergedProps, registered, interpolation); } case 'function': { if (mergedProps !== undefined) { var previousCursor = cursor; var result = interpolation(mergedProps); cursor = previousCursor; return handleInterpolation(mergedProps, registered, result); } else if (false) {} break; } case 'string': if (false) { var replaced, matched; } break; } // finalize string values (regular strings and functions interpolated into css calls) if (registered == null) { return interpolation; } var cached = registered[interpolation]; return cached !== undefined ? cached : interpolation; } function createStringFromObject(mergedProps, registered, obj) { var string = ''; if (Array.isArray(obj)) { for (var i = 0; i < obj.length; i++) { string += handleInterpolation(mergedProps, registered, obj[i]) + ";"; } } else { for (var _key in obj) { var value = obj[_key]; if (typeof value !== 'object') { if (registered != null && registered[value] !== undefined) { string += _key + "{" + registered[value] + "}"; } else if (isProcessableValue(value)) { string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";"; } } else { if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') {} if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) { for (var _i = 0; _i < value.length; _i++) { if (isProcessableValue(value[_i])) { string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";"; } } } else { var interpolated = handleInterpolation(mergedProps, registered, value); switch (_key) { case 'animation': case 'animationName': { string += processStyleName(_key) + ":" + interpolated + ";"; break; } default: { if (false) {} string += _key + "{" + interpolated + "}"; } } } } } } return string; } var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g; var sourceMapPattern; if (false) {} // this is the cursor for keyframes // keyframes are stored on the SerializedStyles object as a linked list var cursor; var emotion_serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) { if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) { return args[0]; } var stringMode = true; var styles = ''; cursor = undefined; var strings = args[0]; if (strings == null || strings.raw === undefined) { stringMode = false; styles += handleInterpolation(mergedProps, registered, strings); } else { if (false) {} styles += strings[0]; } // we start at 1 since we've already handled the first arg for (var i = 1; i < args.length; i++) { styles += handleInterpolation(mergedProps, registered, args[i]); if (stringMode) { if (false) {} styles += strings[i]; } } var sourceMap; if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time labelPattern.lastIndex = 0; var identifierName = ''; var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5 while ((match = labelPattern.exec(styles)) !== null) { identifierName += '-' + // $FlowFixMe we know it's not null match[1]; } var name = emotion_hash_esm(styles) + identifierName; if (false) {} return { name: name, styles: styles, next: cursor }; }; ;// ./node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js var syncFallback = function syncFallback(create) { return create(); }; var useInsertionEffect = external_React_['useInsertion' + 'Effect'] ? external_React_['useInsertion' + 'Effect'] : false; var emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback; var useInsertionEffectWithLayoutFallback = (/* unused pure expression or super */ null && (useInsertionEffect || useLayoutEffect)); ;// ./node_modules/@emotion/react/dist/emotion-element-6a883da9.browser.esm.js var emotion_element_6a883da9_browser_esm_hasOwnProperty = {}.hasOwnProperty; var EmotionCacheContext = /* #__PURE__ */(0,external_React_.createContext)( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway typeof HTMLElement !== 'undefined' ? /* #__PURE__ */emotion_cache_browser_esm({ key: 'css' }) : null); if (false) {} var CacheProvider = EmotionCacheContext.Provider; var __unsafe_useEmotionCache = function useEmotionCache() { return useContext(EmotionCacheContext); }; var withEmotionCache = function withEmotionCache(func) { // $FlowFixMe return /*#__PURE__*/(0,external_React_.forwardRef)(function (props, ref) { // the cache will never be null in the browser var cache = (0,external_React_.useContext)(EmotionCacheContext); return func(props, cache, ref); }); }; var ThemeContext = /* #__PURE__ */(0,external_React_.createContext)({}); if (false) {} var useTheme = function useTheme() { return useContext(ThemeContext); }; var getTheme = function getTheme(outerTheme, theme) { if (typeof theme === 'function') { var mergedTheme = theme(outerTheme); if (false) {} return mergedTheme; } if (false) {} return _extends({}, outerTheme, theme); }; var createCacheWithTheme = /* #__PURE__ */(/* unused pure expression or super */ null && (weakMemoize(function (outerTheme) { return weakMemoize(function (theme) { return getTheme(outerTheme, theme); }); }))); var ThemeProvider = function ThemeProvider(props) { var theme = useContext(ThemeContext); if (props.theme !== theme) { theme = createCacheWithTheme(theme)(props.theme); } return /*#__PURE__*/createElement(ThemeContext.Provider, { value: theme }, props.children); }; function withTheme(Component) { var componentName = Component.displayName || Component.name || 'Component'; var render = function render(props, ref) { var theme = useContext(ThemeContext); return /*#__PURE__*/createElement(Component, _extends({ theme: theme, ref: ref }, props)); }; // $FlowFixMe var WithTheme = /*#__PURE__*/forwardRef(render); WithTheme.displayName = "WithTheme(" + componentName + ")"; return hoistNonReactStatics(WithTheme, Component); } var getLastPart = function getLastPart(functionName) { // The match may be something like 'Object.createEmotionProps' or // 'Loader.prototype.render' var parts = functionName.split('.'); return parts[parts.length - 1]; }; var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) { // V8 var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line); if (match) return getLastPart(match[1]); // Safari / Firefox match = /^([A-Za-z0-9$.]+)@/.exec(line); if (match) return getLastPart(match[1]); return undefined; }; var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS // identifiers, thus we only need to replace what is a valid character for JS, // but not for CSS. var sanitizeIdentifier = function sanitizeIdentifier(identifier) { return identifier.replace(/\$/g, '-'); }; var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) { if (!stackTrace) return undefined; var lines = stackTrace.split('\n'); for (var i = 0; i < lines.length; i++) { var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error" if (!functionName) continue; // If we reach one of these, we have gone too far and should quit if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an // uppercase letter if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName); } return undefined; }; var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__'; var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__'; var createEmotionProps = function createEmotionProps(type, props) { if (false) {} var newProps = {}; for (var key in props) { if (emotion_element_6a883da9_browser_esm_hasOwnProperty.call(props, key)) { newProps[key] = props[key]; } } newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when // the label hasn't already been computed if (false) { var label; } return newProps; }; var Insertion = function Insertion(_ref) { var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag; registerStyles(cache, serialized, isStringTag); var rules = useInsertionEffectAlwaysWithSyncFallback(function () { return insertStyles(cache, serialized, isStringTag); }); return null; }; var Emotion = /* #__PURE__ */(/* unused pure expression or super */ null && (withEmotionCache(function (props, cache, ref) { var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works // not passing the registered cache to serializeStyles because it would // make certain babel optimisations not possible if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) { cssProp = cache.registered[cssProp]; } var WrappedComponent = props[typePropName]; var registeredStyles = [cssProp]; var className = ''; if (typeof props.className === 'string') { className = getRegisteredStyles(cache.registered, registeredStyles, props.className); } else if (props.className != null) { className = props.className + " "; } var serialized = serializeStyles(registeredStyles, undefined, useContext(ThemeContext)); if (false) { var labelFromStack; } className += cache.key + "-" + serialized.name; var newProps = {}; for (var key in props) { if (emotion_element_6a883da9_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || 0)) { newProps[key] = props[key]; } } newProps.ref = ref; newProps.className = className; return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, { cache: cache, serialized: serialized, isStringTag: typeof WrappedComponent === 'string' }), /*#__PURE__*/createElement(WrappedComponent, newProps)); }))); if (false) {} ;// ./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js var isBrowser = "object" !== 'undefined'; function emotion_utils_browser_esm_getRegisteredStyles(registered, registeredStyles, classNames) { var rawClassName = ''; classNames.split(' ').forEach(function (className) { if (registered[className] !== undefined) { registeredStyles.push(registered[className] + ";"); } else { rawClassName += className + " "; } }); return rawClassName; } var emotion_utils_browser_esm_registerStyles = function registerStyles(cache, serialized, isStringTag) { var className = cache.key + "-" + serialized.name; if ( // we only need to add the styles to the registered cache if the // class name could be used further down // the tree but if it's a string tag, we know it won't // so we don't have to add it to registered cache. // this improves memory usage since we can avoid storing the whole style string (isStringTag === false || // we need to always store it if we're in compat mode and // in node since emotion-server relies on whether a style is in // the registered cache to know whether a style is global or not // also, note that this check will be dead code eliminated in the browser isBrowser === false ) && cache.registered[className] === undefined) { cache.registered[className] = serialized.styles; } }; var emotion_utils_browser_esm_insertStyles = function insertStyles(cache, serialized, isStringTag) { emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag); var className = cache.key + "-" + serialized.name; if (cache.inserted[serialized.name] === undefined) { var current = serialized; do { var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true); current = current.next; } while (current !== undefined); } }; ;// ./node_modules/@emotion/styled/base/dist/emotion-styled-base.browser.esm.js var testOmitPropsOnStringTag = isPropValid; var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) { return key !== 'theme'; }; var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) { return typeof tag === 'string' && // 96 is one less than the char code // for "a" so this is checking that // it's a lowercase character tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent; }; var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) { var shouldForwardProp; if (options) { var optionsShouldForwardProp = options.shouldForwardProp; shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) { return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName); } : optionsShouldForwardProp; } if (typeof shouldForwardProp !== 'function' && isReal) { shouldForwardProp = tag.__emotion_forwardProp; } return shouldForwardProp; }; var emotion_styled_base_browser_esm_ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; var emotion_styled_base_browser_esm_Insertion = function Insertion(_ref) { var cache = _ref.cache, serialized = _ref.serialized, isStringTag = _ref.isStringTag; emotion_utils_browser_esm_registerStyles(cache, serialized, isStringTag); var rules = emotion_use_insertion_effect_with_fallbacks_browser_esm_useInsertionEffectAlwaysWithSyncFallback(function () { return emotion_utils_browser_esm_insertStyles(cache, serialized, isStringTag); }); return null; }; var createStyled = function createStyled(tag, options) { if (false) {} var isReal = tag.__emotion_real === tag; var baseTag = isReal && tag.__emotion_base || tag; var identifierName; var targetClassName; if (options !== undefined) { identifierName = options.label; targetClassName = options.target; } var shouldForwardProp = composeShouldForwardProps(tag, options, isReal); var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag); var shouldUseAs = !defaultShouldForwardProp('as'); return function () { var args = arguments; var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : []; if (identifierName !== undefined) { styles.push("label:" + identifierName + ";"); } if (args[0] == null || args[0].raw === undefined) { styles.push.apply(styles, args); } else { if (false) {} styles.push(args[0][0]); var len = args.length; var i = 1; for (; i < len; i++) { if (false) {} styles.push(args[i], args[0][i]); } } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class var Styled = withEmotionCache(function (props, cache, ref) { var FinalTag = shouldUseAs && props.as || baseTag; var className = ''; var classInterpolations = []; var mergedProps = props; if (props.theme == null) { mergedProps = {}; for (var key in props) { mergedProps[key] = props[key]; } mergedProps.theme = (0,external_React_.useContext)(ThemeContext); } if (typeof props.className === 'string') { className = emotion_utils_browser_esm_getRegisteredStyles(cache.registered, classInterpolations, props.className); } else if (props.className != null) { className = props.className + " "; } var serialized = emotion_serialize_browser_esm_serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps); className += cache.key + "-" + serialized.name; if (targetClassName !== undefined) { className += " " + targetClassName; } var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp; var newProps = {}; for (var _key in props) { if (shouldUseAs && _key === 'as') continue; if ( // $FlowFixMe finalShouldForwardProp(_key)) { newProps[_key] = props[_key]; } } newProps.className = className; newProps.ref = ref; return /*#__PURE__*/(0,external_React_.createElement)(external_React_.Fragment, null, /*#__PURE__*/(0,external_React_.createElement)(emotion_styled_base_browser_esm_Insertion, { cache: cache, serialized: serialized, isStringTag: typeof FinalTag === 'string' }), /*#__PURE__*/(0,external_React_.createElement)(FinalTag, newProps)); }); Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")"; Styled.defaultProps = tag.defaultProps; Styled.__emotion_real = Styled; Styled.__emotion_base = baseTag; Styled.__emotion_styles = styles; Styled.__emotion_forwardProp = shouldForwardProp; Object.defineProperty(Styled, 'toString', { value: function value() { if (targetClassName === undefined && "production" !== 'production') {} // $FlowFixMe: coerce undefined to string return "." + targetClassName; } }); Styled.withComponent = function (nextTag, nextOptions) { return createStyled(nextTag, extends_extends({}, options, nextOptions, { shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true) })).apply(void 0, styles); }; return Styled; }; }; /* harmony default export */ const emotion_styled_base_browser_esm = (createStyled); ;// ./node_modules/@wordpress/block-editor/build-module/components/dimensions-tool/width-height-tool.js function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ /** * WordPress dependencies */ const SingleColumnToolsPanelItem = /*#__PURE__*/emotion_styled_base_browser_esm(external_wp_components_namespaceObject.__experimentalToolsPanelItem, true ? { target: "ef8pe3d0" } : 0)( true ? { name: "957xgf", styles: "grid-column:span 1" } : 0); /** * @typedef {import('@wordpress/components/build-types/unit-control/types').WPUnitControlUnit} WPUnitControlUnit */ /** * @typedef {Object} WidthHeightToolValue * @property {string} [width] Width CSS value. * @property {string} [height] Height CSS value. */ /** * @callback WidthHeightToolOnChange * @param {WidthHeightToolValue} nextValue Next dimensions value. * @return {void} */ /** * @typedef {Object} WidthHeightToolProps * @property {string} [panelId] ID of the panel that contains the controls. * @property {WidthHeightToolValue} [value] Current dimensions values. * @property {WidthHeightToolOnChange} [onChange] Callback to update the dimensions values. * @property {WPUnitControlUnit[]} [units] Units options. * @property {boolean} [isShownByDefault] Whether the panel is shown by default. */ /** * Component that renders controls to edit the dimensions of an image or container. * * @param {WidthHeightToolProps} props The component props. * * @return {import('react').ReactElement} The width and height tool. */ function WidthHeightTool({ panelId, value = {}, onChange = () => {}, units, isShownByDefault = true }) { var _value$width, _value$height; // null, undefined, and 'auto' all represent the default value. const width = value.width === 'auto' ? '' : (_value$width = value.width) !== null && _value$width !== void 0 ? _value$width : ''; const height = value.height === 'auto' ? '' : (_value$height = value.height) !== null && _value$height !== void 0 ? _value$height : ''; const onDimensionChange = dimension => nextDimension => { const nextValue = { ...value }; // Empty strings or undefined may be passed and both represent removing the value. if (!nextDimension) { delete nextValue[dimension]; } else { nextValue[dimension] = nextDimension; } onChange(nextValue); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleColumnToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Width'), isShownByDefault: isShownByDefault, hasValue: () => width !== '', onDeselect: onDimensionChange('width'), panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { label: (0,external_wp_i18n_namespaceObject.__)('Width'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Auto'), labelPosition: "top", units: units, min: 0, value: width, onChange: onDimensionChange('width'), size: "__unstable-large" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SingleColumnToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Height'), isShownByDefault: isShownByDefault, hasValue: () => height !== '', onDeselect: onDimensionChange('height'), panelId: panelId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { label: (0,external_wp_i18n_namespaceObject.__)('Height'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Auto'), labelPosition: "top", units: units, min: 0, value: height, onChange: onDimensionChange('height'), size: "__unstable-large" }) })] }); } ;// ./node_modules/@wordpress/block-editor/build-module/components/dimensions-tool/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * @typedef {import('@wordpress/components/build-types/select-control/types').SelectControlProps} SelectControlProps */ /** * @typedef {import('@wordpress/components/build-types/unit-control/types').WPUnitControlUnit} WPUnitControlUnit */ /** * @typedef {Object} Dimensions * @property {string} [width] CSS width property. * @property {string} [height] CSS height property. * @property {string} [scale] CSS object-fit property. * @property {string} [aspectRatio] CSS aspect-ratio property. */ /** * @callback DimensionsControlsOnChange * @param {Dimensions} nextValue * @return {void} */ /** * @typedef {Object} DimensionsControlsProps * @property {string} [panelId] ID of the panel that contains the controls. * @property {Dimensions} [value] Current dimensions values. * @property {DimensionsControlsOnChange} [onChange] Callback to update the dimensions values. * @property {SelectControlProps[]} [aspectRatioOptions] Aspect ratio options. * @property {SelectControlProps[]} [scaleOptions] Scale options. * @property {WPUnitControlUnit[]} [unitsOptions] Units options. */ /** * Component that renders controls to edit the dimensions of an image or container. * * @param {DimensionsControlsProps} props The component props. * * @return {Element} The dimensions controls. */ function DimensionsTool({ panelId, value = {}, onChange = () => {}, aspectRatioOptions, // Default options handled by AspectRatioTool. defaultAspectRatio = 'auto', // Match CSS default value for aspect-ratio. scaleOptions, // Default options handled by ScaleTool. defaultScale = 'fill', // Match CSS default value for object-fit. unitsOptions, // Default options handled by UnitControl. tools = ['aspectRatio', 'widthHeight', 'scale'] }) { // Coerce undefined and CSS default values to be null. const width = value.width === undefined || value.width === 'auto' ? null : value.width; const height = value.height === undefined || value.height === 'auto' ? null : value.height; const aspectRatio = value.aspectRatio === undefined || value.aspectRatio === 'auto' ? null : value.aspectRatio; const scale = value.scale === undefined || value.scale === 'fill' ? null : value.scale; // Keep track of state internally, so when the value is cleared by means // other than directly editing that field, it's easier to restore the // previous value. const [lastScale, setLastScale] = (0,external_wp_element_namespaceObject.useState)(scale); const [lastAspectRatio, setLastAspectRatio] = (0,external_wp_element_namespaceObject.useState)(aspectRatio); // 'custom' is not a valid value for CSS aspect-ratio, but it is used in the // dropdown to indicate that setting both the width and height is the same // as a custom aspect ratio. const aspectRatioValue = width && height ? 'custom' : lastAspectRatio; const showScaleControl = aspectRatio || width && height; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [tools.includes('aspectRatio') && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AspectRatioTool, { panelId: panelId, options: aspectRatioOptions, defaultValue: defaultAspectRatio, value: aspectRatioValue, onChange: nextAspectRatio => { const nextValue = { ...value }; // 'auto' is CSS default, so it gets treated as null. nextAspectRatio = nextAspectRatio === 'auto' ? null : nextAspectRatio; setLastAspectRatio(nextAspectRatio); // Update aspectRatio. if (!nextAspectRatio) { delete nextValue.aspectRatio; } else { nextValue.aspectRatio = nextAspectRatio; } // Auto-update scale. if (!nextAspectRatio) { delete nextValue.scale; } else if (lastScale) { nextValue.scale = lastScale; } else { nextValue.scale = defaultScale; setLastScale(defaultScale); } // Auto-update width and height. if ('custom' !== nextAspectRatio && width && height) { delete nextValue.height; } onChange(nextValue); } }), tools.includes('widthHeight') && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidthHeightTool, { panelId: panelId, units: unitsOptions, value: { width, height }, onChange: ({ width: nextWidth, height: nextHeight }) => { const nextValue = { ...value }; // 'auto' is CSS default, so it gets treated as null. nextWidth = nextWidth === 'auto' ? null : nextWidth; nextHeight = nextHeight === 'auto' ? null : nextHeight; // Update width. if (!nextWidth) { delete nextValue.width; } else { nextValue.width = nextWidth; } // Update height. if (!nextHeight) { delete nextValue.height; } else { nextValue.height = nextHeight; } // Auto-update aspectRatio. if (nextWidth && nextHeight) { delete nextValue.aspectRatio; } else if (lastAspectRatio) { nextValue.aspectRatio = lastAspectRatio; } else { // No setting defaultAspectRatio here, because // aspectRatio is optional in this scenario, // unlike scale. } // Auto-update scale. if (!lastAspectRatio && !!nextWidth !== !!nextHeight) { delete nextValue.scale; } else if (lastScale) { nextValue.scale = lastScale; } else { nextValue.scale = defaultScale; setLastScale(defaultScale); } onChange(nextValue); } }), tools.includes('scale') && showScaleControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ScaleTool, { panelId: panelId, options: scaleOptions, defaultValue: defaultScale, value: lastScale, onChange: nextScale => { const nextValue = { ...value }; // 'fill' is CSS default, so it gets treated as null. nextScale = nextScale === 'fill' ? null : nextScale; setLastScale(nextScale); // Update scale. if (!nextScale) { delete nextValue.scale; } else { nextValue.scale = nextScale; } onChange(nextValue); } })] }); } /* harmony default export */ const dimensions_tool = (DimensionsTool); ;// ./node_modules/@wordpress/block-editor/build-module/components/resolution-tool/index.js /** * WordPress dependencies */ const DEFAULT_SIZE_OPTIONS = [{ label: (0,external_wp_i18n_namespaceObject._x)('Thumbnail', 'Image size option for resolution control'), value: 'thumbnail' }, { label: (0,external_wp_i18n_namespaceObject._x)('Medium', 'Image size option for resolution control'), value: 'medium' }, { label: (0,external_wp_i18n_namespaceObject._x)('Large', 'Image size option for resolution control'), value: 'large' }, { label: (0,external_wp_i18n_namespaceObject._x)('Full Size', 'Image size option for resolution control'), value: 'full' }]; function ResolutionTool({ panelId, value, onChange, options = DEFAULT_SIZE_OPTIONS, defaultValue = DEFAULT_SIZE_OPTIONS[0].value, isShownByDefault = true, resetAllFilter }) { const displayValue = value !== null && value !== void 0 ? value : defaultValue; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => displayValue !== defaultValue, label: (0,external_wp_i18n_namespaceObject.__)('Resolution'), onDeselect: () => onChange(defaultValue), isShownByDefault: isShownByDefault, panelId: panelId, resetAllFilter: resetAllFilter, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Resolution'), value: displayValue, options: options, onChange: onChange, help: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source image.'), size: "__unstable-large" }) }); } ;// ./node_modules/@wordpress/block-editor/build-module/private-apis.js /** * Internal dependencies */ /** * Private @wordpress/block-editor APIs. */ const privateApis = {}; lock(privateApis, { ...global_styles_namespaceObject, ExperimentalBlockCanvas: ExperimentalBlockCanvas, ExperimentalBlockEditorProvider: ExperimentalBlockEditorProvider, getDuotoneFilter: getDuotoneFilter, getRichTextValues: getRichTextValues, PrivateQuickInserter: QuickInserter, extractWords: extractWords, getNormalizedSearchTerms: getNormalizedSearchTerms, normalizeString: normalizeString, PrivateListView: PrivateListView, ResizableBoxPopover: ResizableBoxPopover, useHasBlockToolbar: useHasBlockToolbar, cleanEmptyObject: utils_cleanEmptyObject, BlockQuickNavigation: BlockQuickNavigation, LayoutStyle: LayoutStyle, BlockManager: BlockManager, BlockRemovalWarningModal: BlockRemovalWarningModal, useLayoutClasses: useLayoutClasses, useLayoutStyles: useLayoutStyles, DimensionsTool: dimensions_tool, ResolutionTool: ResolutionTool, TabbedSidebar: tabbed_sidebar, TextAlignmentControl: TextAlignmentControl, usesContextKey: usesContextKey, useFlashEditableBlocks: useFlashEditableBlocks, useZoomOut: useZoomOut, globalStylesDataKey: globalStylesDataKey, globalStylesLinksDataKey: globalStylesLinksDataKey, selectBlockPatternsKey: selectBlockPatternsKey, requiresWrapperOnCopy: requiresWrapperOnCopy, PrivateRichText: PrivateRichText, PrivateInserterLibrary: PrivateInserterLibrary, reusableBlocksSelectKey: reusableBlocksSelectKey, PrivateBlockPopover: PrivateBlockPopover, PrivatePublishDateTimePicker: PrivatePublishDateTimePicker, useSpacingSizes: useSpacingSizes, useBlockDisplayTitle: useBlockDisplayTitle, __unstableBlockStyleVariationOverridesWithConfig: __unstableBlockStyleVariationOverridesWithConfig, setBackgroundStyleDefaults: setBackgroundStyleDefaults, sectionRootClientIdKey: sectionRootClientIdKey, CommentIconSlotFill: block_comment_icon_slot, CommentIconToolbarSlotFill: block_comment_icon_toolbar_slot }); ;// ./node_modules/@wordpress/block-editor/build-module/index.js /** * Internal dependencies */ })(); (window.wp = window.wp || {}).blockEditor = __webpack_exports__; /******/ })() ; nux.js 0000644 00000031757 15013651111 0005723 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { DotTip: () => (/* reexport */ dot_tip), store: () => (/* reexport */ store) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/actions.js var actions_namespaceObject = {}; __webpack_require__.r(actions_namespaceObject); __webpack_require__.d(actions_namespaceObject, { disableTips: () => (disableTips), dismissTip: () => (dismissTip), enableTips: () => (enableTips), triggerGuide: () => (triggerGuide) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/nux/build-module/store/selectors.js var selectors_namespaceObject = {}; __webpack_require__.r(selectors_namespaceObject); __webpack_require__.d(selectors_namespaceObject, { areTipsEnabled: () => (selectors_areTipsEnabled), getAssociatedGuide: () => (getAssociatedGuide), isTipVisible: () => (isTipVisible) }); ;// external ["wp","deprecated"] const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); ;// external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// ./node_modules/@wordpress/nux/build-module/store/reducer.js /** * WordPress dependencies */ /** * Reducer that tracks which tips are in a guide. Each guide is represented by * an array which contains the tip identifiers contained within that guide. * * @param {Array} state Current state. * @param {Object} action Dispatched action. * * @return {Array} Updated state. */ function guides(state = [], action) { switch (action.type) { case 'TRIGGER_GUIDE': return [...state, action.tipIds]; } return state; } /** * Reducer that tracks whether or not tips are globally enabled. * * @param {boolean} state Current state. * @param {Object} action Dispatched action. * * @return {boolean} Updated state. */ function areTipsEnabled(state = true, action) { switch (action.type) { case 'DISABLE_TIPS': return false; case 'ENABLE_TIPS': return true; } return state; } /** * Reducer that tracks which tips have been dismissed. If the state object * contains a tip identifier, then that tip is dismissed. * * @param {Object} state Current state. * @param {Object} action Dispatched action. * * @return {Object} Updated state. */ function dismissedTips(state = {}, action) { switch (action.type) { case 'DISMISS_TIP': return { ...state, [action.id]: true }; case 'ENABLE_TIPS': return {}; } return state; } const preferences = (0,external_wp_data_namespaceObject.combineReducers)({ areTipsEnabled, dismissedTips }); /* harmony default export */ const reducer = ((0,external_wp_data_namespaceObject.combineReducers)({ guides, preferences })); ;// ./node_modules/@wordpress/nux/build-module/store/actions.js /** * Returns an action object that, when dispatched, presents a guide that takes * the user through a series of tips step by step. * * @param {string[]} tipIds Which tips to show in the guide. * * @return {Object} Action object. */ function triggerGuide(tipIds) { return { type: 'TRIGGER_GUIDE', tipIds }; } /** * Returns an action object that, when dispatched, dismisses the given tip. A * dismissed tip will not show again. * * @param {string} id The tip to dismiss. * * @return {Object} Action object. */ function dismissTip(id) { return { type: 'DISMISS_TIP', id }; } /** * Returns an action object that, when dispatched, prevents all tips from * showing again. * * @return {Object} Action object. */ function disableTips() { return { type: 'DISABLE_TIPS' }; } /** * Returns an action object that, when dispatched, makes all tips show again. * * @return {Object} Action object. */ function enableTips() { return { type: 'ENABLE_TIPS' }; } ;// ./node_modules/@wordpress/nux/build-module/store/selectors.js /** * WordPress dependencies */ /** * An object containing information about a guide. * * @typedef {Object} NUXGuideInfo * @property {string[]} tipIds Which tips the guide contains. * @property {?string} currentTipId The guide's currently showing tip. * @property {?string} nextTipId The guide's next tip to show. */ /** * Returns an object describing the guide, if any, that the given tip is a part * of. * * @param {Object} state Global application state. * @param {string} tipId The tip to query. * * @return {?NUXGuideInfo} Information about the associated guide. */ const getAssociatedGuide = (0,external_wp_data_namespaceObject.createSelector)((state, tipId) => { for (const tipIds of state.guides) { if (tipIds.includes(tipId)) { const nonDismissedTips = tipIds.filter(tId => !Object.keys(state.preferences.dismissedTips).includes(tId)); const [currentTipId = null, nextTipId = null] = nonDismissedTips; return { tipIds, currentTipId, nextTipId }; } } return null; }, state => [state.guides, state.preferences.dismissedTips]); /** * Determines whether or not the given tip is showing. Tips are hidden if they * are disabled, have been dismissed, or are not the current tip in any * guide that they have been added to. * * @param {Object} state Global application state. * @param {string} tipId The tip to query. * * @return {boolean} Whether or not the given tip is showing. */ function isTipVisible(state, tipId) { if (!state.preferences.areTipsEnabled) { return false; } if (state.preferences.dismissedTips?.hasOwnProperty(tipId)) { return false; } const associatedGuide = getAssociatedGuide(state, tipId); if (associatedGuide && associatedGuide.currentTipId !== tipId) { return false; } return true; } /** * Returns whether or not tips are globally enabled. * * @param {Object} state Global application state. * * @return {boolean} Whether tips are globally enabled. */ function selectors_areTipsEnabled(state) { return state.preferences.areTipsEnabled; } ;// ./node_modules/@wordpress/nux/build-module/store/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const STORE_NAME = 'core/nux'; /** * Store definition for the nux namespace. * * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore * * @type {Object} */ const store = (0,external_wp_data_namespaceObject.createReduxStore)(STORE_NAME, { reducer: reducer, actions: actions_namespaceObject, selectors: selectors_namespaceObject, persist: ['preferences'] }); // Once we build a more generic persistence plugin that works across types of stores // we'd be able to replace this with a register call. (0,external_wp_data_namespaceObject.registerStore)(STORE_NAME, { reducer: reducer, actions: actions_namespaceObject, selectors: selectors_namespaceObject, persist: ['preferences'] }); ;// external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; ;// external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; ;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// external ["wp","primitives"] const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; ;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// ./node_modules/@wordpress/icons/build-module/library/close.js /** * WordPress dependencies */ const close_close = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" }) }); /* harmony default export */ const library_close = (close_close); ;// ./node_modules/@wordpress/nux/build-module/components/dot-tip/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function onClick(event) { // Tips are often nested within buttons. We stop propagation so that clicking // on a tip doesn't result in the button being clicked. event.stopPropagation(); } function DotTip({ position = 'middle right', children, isVisible, hasNextTip, onDismiss, onDisable }) { const anchorParent = (0,external_wp_element_namespaceObject.useRef)(null); const onFocusOutsideCallback = (0,external_wp_element_namespaceObject.useCallback)(event => { if (!anchorParent.current) { return; } if (anchorParent.current.contains(event.relatedTarget)) { return; } onDisable(); }, [onDisable, anchorParent]); if (!isVisible) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Popover, { className: "nux-dot-tip", position: position, focusOnMount: true, role: "dialog", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Editor tips'), onClick: onClick, onFocusOutside: onFocusOutsideCallback, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: children }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "link", onClick: onDismiss, children: hasNextTip ? (0,external_wp_i18n_namespaceObject.__)('See next tip') : (0,external_wp_i18n_namespaceObject.__)('Got it') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "small", className: "nux-dot-tip__disable", icon: library_close, label: (0,external_wp_i18n_namespaceObject.__)('Disable tips'), onClick: onDisable })] }); } /* harmony default export */ const dot_tip = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, { tipId }) => { const { isTipVisible, getAssociatedGuide } = select(store); const associatedGuide = getAssociatedGuide(tipId); return { isVisible: isTipVisible(tipId), hasNextTip: !!(associatedGuide && associatedGuide.nextTipId) }; }), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, { tipId }) => { const { dismissTip, disableTips } = dispatch(store); return { onDismiss() { dismissTip(tipId); }, onDisable() { disableTips(); } }; }))(DotTip)); ;// ./node_modules/@wordpress/nux/build-module/index.js /** * WordPress dependencies */ external_wp_deprecated_default()('wp.nux', { since: '5.4', hint: 'wp.components.Guide can be used to show a user guide.', version: '6.2' }); (window.wp = window.wp || {}).nux = __webpack_exports__; /******/ })() ; deprecated.js 0000644 00000011126 15013651111 0007175 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ deprecated) }); // UNUSED EXPORTS: logged ;// external ["wp","hooks"] const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; ;// ./node_modules/@wordpress/deprecated/build-module/index.js /** * WordPress dependencies */ /** * Object map tracking messages which have been logged, for use in ensuring a * message is only logged once. * * @type {Record<string, true | undefined>} */ const logged = Object.create(null); /** * Logs a message to notify developers about a deprecated feature. * * @param {string} feature Name of the deprecated feature. * @param {Object} [options] Personalisation options * @param {string} [options.since] Version in which the feature was deprecated. * @param {string} [options.version] Version in which the feature will be removed. * @param {string} [options.alternative] Feature to use instead * @param {string} [options.plugin] Plugin name if it's a plugin feature * @param {string} [options.link] Link to documentation * @param {string} [options.hint] Additional message to help transition away from the deprecated feature. * * @example * ```js * import deprecated from '@wordpress/deprecated'; * * deprecated( 'Eating meat', { * since: '2019.01.01' * version: '2020.01.01', * alternative: 'vegetables', * plugin: 'the earth', * hint: 'You may find it beneficial to transition gradually.', * } ); * * // Logs: 'Eating meat is deprecated since version 2019.01.01 and will be removed from the earth in version 2020.01.01. Please use vegetables instead. Note: You may find it beneficial to transition gradually.' * ``` */ function deprecated(feature, options = {}) { const { since, version, alternative, plugin, link, hint } = options; const pluginMessage = plugin ? ` from ${plugin}` : ''; const sinceMessage = since ? ` since version ${since}` : ''; const versionMessage = version ? ` and will be removed${pluginMessage} in version ${version}` : ''; const useInsteadMessage = alternative ? ` Please use ${alternative} instead.` : ''; const linkMessage = link ? ` See: ${link}` : ''; const hintMessage = hint ? ` Note: ${hint}` : ''; const message = `${feature} is deprecated${sinceMessage}${versionMessage}.${useInsteadMessage}${linkMessage}${hintMessage}`; // Skip if already logged. if (message in logged) { return; } /** * Fires whenever a deprecated feature is encountered * * @param {string} feature Name of the deprecated feature. * @param {?Object} options Personalisation options * @param {string} options.since Version in which the feature was deprecated. * @param {?string} options.version Version in which the feature will be removed. * @param {?string} options.alternative Feature to use instead * @param {?string} options.plugin Plugin name if it's a plugin feature * @param {?string} options.link Link to documentation * @param {?string} options.hint Additional message to help transition away from the deprecated feature. * @param {?string} message Message sent to console.warn */ (0,external_wp_hooks_namespaceObject.doAction)('deprecated', feature, options, message); // eslint-disable-next-line no-console console.warn(message); logged[message] = true; } /** @typedef {import('utility-types').NonUndefined<Parameters<typeof deprecated>[1]>} DeprecatedOptions */ (window.wp = window.wp || {}).deprecated = __webpack_exports__["default"]; /******/ })() ; a11y.js 0000644 00000020572 15013651111 0005655 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { setup: () => (/* binding */ setup), speak: () => (/* reexport */ speak) }); ;// external ["wp","domReady"] const external_wp_domReady_namespaceObject = window["wp"]["domReady"]; var external_wp_domReady_default = /*#__PURE__*/__webpack_require__.n(external_wp_domReady_namespaceObject); ;// ./node_modules/@wordpress/a11y/build-module/script/add-container.js /** * Build the live regions markup. * * @param {string} [ariaLive] Value for the 'aria-live' attribute; default: 'polite'. * * @return {HTMLDivElement} The ARIA live region HTML element. */ function addContainer(ariaLive = 'polite') { const container = document.createElement('div'); container.id = `a11y-speak-${ariaLive}`; container.className = 'a11y-speak-region'; container.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;'); container.setAttribute('aria-live', ariaLive); container.setAttribute('aria-relevant', 'additions text'); container.setAttribute('aria-atomic', 'true'); const { body } = document; if (body) { body.appendChild(container); } return container; } ;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// ./node_modules/@wordpress/a11y/build-module/script/add-intro-text.js /** * WordPress dependencies */ /** * Build the explanatory text to be placed before the aria live regions. * * This text is initially hidden from assistive technologies by using a `hidden` * HTML attribute which is then removed once a message fills the aria-live regions. * * @return {HTMLParagraphElement} The explanatory text HTML element. */ function addIntroText() { const introText = document.createElement('p'); introText.id = 'a11y-speak-intro-text'; introText.className = 'a11y-speak-intro-text'; introText.textContent = (0,external_wp_i18n_namespaceObject.__)('Notifications'); introText.setAttribute('style', 'position: absolute;' + 'margin: -1px;' + 'padding: 0;' + 'height: 1px;' + 'width: 1px;' + 'overflow: hidden;' + 'clip: rect(1px, 1px, 1px, 1px);' + '-webkit-clip-path: inset(50%);' + 'clip-path: inset(50%);' + 'border: 0;' + 'word-wrap: normal !important;'); introText.setAttribute('hidden', 'hidden'); const { body } = document; if (body) { body.appendChild(introText); } return introText; } ;// ./node_modules/@wordpress/a11y/build-module/shared/clear.js /** * Clears the a11y-speak-region elements and hides the explanatory text. */ function clear() { const regions = document.getElementsByClassName('a11y-speak-region'); const introText = document.getElementById('a11y-speak-intro-text'); for (let i = 0; i < regions.length; i++) { regions[i].textContent = ''; } // Make sure the explanatory text is hidden from assistive technologies. if (introText) { introText.setAttribute('hidden', 'hidden'); } } ;// ./node_modules/@wordpress/a11y/build-module/shared/filter-message.js let previousMessage = ''; /** * Filter the message to be announced to the screenreader. * * @param {string} message The message to be announced. * * @return {string} The filtered message. */ function filterMessage(message) { /* * Strip HTML tags (if any) from the message string. Ideally, messages should * be simple strings, carefully crafted for specific use with A11ySpeak. * When re-using already existing strings this will ensure simple HTML to be * stripped out and replaced with a space. Browsers will collapse multiple * spaces natively. */ message = message.replace(/<[^<>]+>/g, ' '); /* * Safari + VoiceOver don't announce repeated, identical strings. We use * a `no-break space` to force them to think identical strings are different. */ if (previousMessage === message) { message += '\u00A0'; } previousMessage = message; return message; } ;// ./node_modules/@wordpress/a11y/build-module/shared/index.js /** * Internal dependencies */ /** * Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions. * This module is inspired by the `speak` function in `wp-a11y.js`. * * @param {string} message The message to be announced by assistive technologies. * @param {'polite'|'assertive'} [ariaLive] The politeness level for aria-live; default: 'polite'. * * @example * ```js * import { speak } from '@wordpress/a11y'; * * // For polite messages that shouldn't interrupt what screen readers are currently announcing. * speak( 'The message you want to send to the ARIA live region' ); * * // For assertive messages that should interrupt what screen readers are currently announcing. * speak( 'The message you want to send to the ARIA live region', 'assertive' ); * ``` */ function speak(message, ariaLive) { /* * Clear previous messages to allow repeated strings being read out and hide * the explanatory text from assistive technologies. */ clear(); message = filterMessage(message); const introText = document.getElementById('a11y-speak-intro-text'); const containerAssertive = document.getElementById('a11y-speak-assertive'); const containerPolite = document.getElementById('a11y-speak-polite'); if (containerAssertive && ariaLive === 'assertive') { containerAssertive.textContent = message; } else if (containerPolite) { containerPolite.textContent = message; } /* * Make the explanatory text available to assistive technologies by removing * the 'hidden' HTML attribute. */ if (introText) { introText.removeAttribute('hidden'); } } ;// ./node_modules/@wordpress/a11y/build-module/index.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Create the live regions. */ function setup() { const introText = document.getElementById('a11y-speak-intro-text'); const containerAssertive = document.getElementById('a11y-speak-assertive'); const containerPolite = document.getElementById('a11y-speak-polite'); if (introText === null) { addIntroText(); } if (containerAssertive === null) { addContainer('assertive'); } if (containerPolite === null) { addContainer('polite'); } } /** * Run setup on domReady. */ external_wp_domReady_default()(setup); (window.wp = window.wp || {}).a11y = __webpack_exports__; /******/ })() ; is-shallow-equal.min.js 0000644 00000001772 15013651111 0011054 0 ustar 00 /*! This file is auto-generated */ (()=>{"use strict";var r={d:(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e),r:r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},e={};function t(r,e){if(r===e)return!0;const t=Object.keys(r),n=Object.keys(e);if(t.length!==n.length)return!1;let o=0;for(;o<t.length;){const n=t[o],i=r[n];if(void 0===i&&!e.hasOwnProperty(n)||i!==e[n])return!1;o++}return!0}function n(r,e){if(r===e)return!0;if(r.length!==e.length)return!1;for(let t=0,n=r.length;t<n;t++)if(r[t]!==e[t])return!1;return!0}function o(r,e){if(r&&e){if(r.constructor===Object&&e.constructor===Object)return t(r,e);if(Array.isArray(r)&&Array.isArray(e))return n(r,e)}return r===e}r.r(e),r.d(e,{default:()=>o,isShallowEqualArrays:()=>n,isShallowEqualObjects:()=>t}),(window.wp=window.wp||{}).isShallowEqual=e})(); block-directory.min.js 0000644 00000050376 15013651111 0010765 0 ustar 00 /*! This file is auto-generated */ (()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var s in l)e.o(l,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:l[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:()=>U});var l={};e.r(l),e.d(l,{getDownloadableBlocks:()=>k,getErrorNoticeForBlock:()=>y,getErrorNotices:()=>f,getInstalledBlockTypes:()=>m,getNewBlockTypes:()=>g,getUnusedBlockTypes:()=>_,isInstalling:()=>w,isRequestingDownloadableBlocks:()=>h});var s={};e.r(s),e.d(s,{addInstalledBlockType:()=>O,clearErrorNotice:()=>P,fetchDownloadableBlocks:()=>T,installBlockType:()=>L,receiveDownloadableBlocks:()=>S,removeInstalledBlockType:()=>D,setErrorNotice:()=>R,setIsInstalling:()=>A,uninstallBlockType:()=>C});var n={};e.r(n),e.d(n,{getDownloadableBlocks:()=>Y});const o=window.wp.plugins,r=window.wp.hooks,i=window.wp.blocks,a=window.wp.data,c=window.wp.element,d=window.wp.editor,u=(0,a.combineReducers)({downloadableBlocks:(e={},t)=>{switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},blockManagement:(e={installedBlockTypes:[],isInstalling:{}},t)=>{switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter((e=>e.name!==t.item.name))};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},errorNotices:(e={},t)=>{switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":const{[t.blockId]:l,...s}=e;return s}return e}}),p=window.wp.blockEditor,b=[];function h(e,t){var l;return null!==(l=e.downloadableBlocks[t]?.isRequesting)&&void 0!==l&&l}function k(e,t){var l;return null!==(l=e.downloadableBlocks[t]?.results)&&void 0!==l?l:b}function m(e){return e.blockManagement.installedBlockTypes}const g=(0,a.createRegistrySelector)((e=>(0,a.createSelector)((t=>{const l=m(t);if(!l.length)return b;const{getBlockName:s,getClientIdsWithDescendants:n}=e(p.store),o=l.map((e=>e.name)),r=n().flatMap((e=>{const t=s(e);return o.includes(t)?t:[]})),i=l.filter((e=>r.includes(e.name)));return i.length>0?i:b}),(t=>[m(t),e(p.store).getClientIdsWithDescendants()])))),_=(0,a.createRegistrySelector)((e=>(0,a.createSelector)((t=>{const l=m(t);if(!l.length)return b;const{getBlockName:s,getClientIdsWithDescendants:n}=e(p.store),o=l.map((e=>e.name)),r=n().flatMap((e=>{const t=s(e);return o.includes(t)?t:[]})),i=l.filter((e=>!r.includes(e.name)));return i.length>0?i:b}),(t=>[m(t),e(p.store).getClientIdsWithDescendants()]))));function w(e,t){return e.blockManagement.isInstalling[t]||!1}function f(e){return e.errorNotices}function y(e,t){return e.errorNotices[t]}const x=window.wp.i18n,v=window.wp.apiFetch;var j=e.n(v);const B=window.wp.notices,E=window.wp.url,N=e=>new Promise(((t,l)=>{const s=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach((t=>{e[t]&&(s[t]=e[t])})),e.innerHTML&&s.appendChild(document.createTextNode(e.innerHTML)),s.onload=()=>t(!0),s.onerror=()=>l(new Error("Error loading asset.")),document.body.appendChild(s),("link"===s.nodeName.toLowerCase()||"script"===s.nodeName.toLowerCase()&&!s.src)&&t()}));function I(e){if(!e)return!1;const t=e.links["wp:plugin"]||e.links.self;return!(!t||!t.length)&&t[0].href}function T(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function S(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}const L=e=>async({registry:t,dispatch:l})=>{const{id:s,name:n}=e;let o=!1;l.clearErrorNotice(s);try{l.setIsInstalling(s,!0);const r=I(e);let a={};if(r)await j()({method:"PUT",url:r,data:{status:"active"}});else{a=(await j()({method:"POST",path:"wp/v2/plugins",data:{slug:s,status:"active"}}))._links}l.addInstalledBlockType({...e,links:{...e.links,...a}});const c=["api_version","title","category","parent","icon","description","keywords","attributes","provides_context","uses_context","supports","styles","example","variations"];await j()({path:(0,E.addQueryArgs)(`/wp/v2/block-types/${n}`,{_fields:c})}).catch((()=>{})).then((e=>{e&&(0,i.unstable__bootstrapServerSideBlockDefinitions)({[n]:Object.fromEntries(Object.entries(e).filter((([e])=>c.includes(e))))})})),await async function(){const e=await j()({url:document.location.href,parse:!1}),t=await e.text(),l=(new window.DOMParser).parseFromString(t,"text/html"),s=Array.from(l.querySelectorAll('link[rel="stylesheet"],script')).filter((e=>e.id&&!document.getElementById(e.id)));for(const e of s)await N(e)}();if(!t.select(i.store).getBlockTypes().some((e=>e.name===n)))throw new Error((0,x.__)("Error registering block. Try reloading the page."));t.dispatch(B.store).createInfoNotice((0,x.sprintf)((0,x.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),o=!0}catch(e){let n=e.message||(0,x.__)("An error occurred."),o=e instanceof Error;const r={folder_exists:(0,x.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:(0,x.__)("Error installing block. You can reload the page and try again.")};r[e.code]&&(o=!0,n=r[e.code]),l.setErrorNotice(s,n,o),t.dispatch(B.store).createErrorNotice(n,{speak:!0,isDismissible:!0})}return l.setIsInstalling(s,!1),o},C=e=>async({registry:t,dispatch:l})=>{try{const t=I(e);await j()({method:"PUT",url:t,data:{status:"inactive"}}),await j()({method:"DELETE",url:t}),l.removeInstalledBlockType(e)}catch(e){t.dispatch(B.store).createErrorNotice(e.message||(0,x.__)("An error occurred."))}};function O(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function D(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function A(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function R(e,t,l=!1){return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:l}}function P(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}var M=function(){return M=Object.assign||function(e){for(var t,l=1,s=arguments.length;l<s;l++)for(var n in t=arguments[l])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},M.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function F(e){return e.toLowerCase()}var $=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],V=/[^A-Z0-9]+/gi;function H(e,t,l){return t instanceof RegExp?e.replace(t,l):t.reduce((function(e,t){return e.replace(t,l)}),e)}function z(e,t){var l=e.charAt(0),s=e.substr(1).toLowerCase();return t>0&&l>="0"&&l<="9"?"_"+l+s:""+l.toUpperCase()+s}function K(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var l=t.splitRegexp,s=void 0===l?$:l,n=t.stripRegexp,o=void 0===n?V:n,r=t.transform,i=void 0===r?F:r,a=t.delimiter,c=void 0===a?" ":a,d=H(H(e,s,"$1\0$2"),o,"\0"),u=0,p=d.length;"\0"===d.charAt(u);)u++;for(;"\0"===d.charAt(p-1);)p--;return d.slice(u,p).split("\0").map(i).join(c)}(e,M({delimiter:"",transform:z},t))}function W(e,t){return 0===t?e.toLowerCase():z(e,t)}const Y=e=>async({dispatch:t})=>{if(e)try{t(T(e));const l=await j()({path:`wp/v2/block-directory/search?term=${e}`});t(S(l.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>{return[(l=e,void 0===s&&(s={}),K(l,M({transform:W},s))),t];var l,s}))))),e))}catch{t(S([],e))}},q={reducer:u,selectors:l,actions:s,resolvers:n},U=(0,a.createReduxStore)("core/block-directory",q);function G(){const{uninstallBlockType:e}=(0,a.useDispatch)(U),t=(0,a.useSelect)((e=>{const{isAutosavingPost:t,isSavingPost:l}=e(d.store);return l()&&!t()}),[]),l=(0,a.useSelect)((e=>e(U).getUnusedBlockTypes()),[]);return(0,c.useEffect)((()=>{t&&l.length&&l.forEach((t=>{e(t),(0,i.unregisterBlockType)(t.name)}))}),[t]),null}(0,a.register)(U);const Z=window.wp.compose,J=window.wp.components,Q=window.wp.coreData;function X(e){var t,l,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(l=X(e[t]))&&(s&&(s+=" "),s+=l)}else for(l in e)e[l]&&(s&&(s+=" "),s+=l);return s}const ee=function(){for(var e,t,l=0,s="",n=arguments.length;l<n;l++)(e=arguments[l])&&(t=X(e))&&(s&&(s+=" "),s+=t);return s},te=window.wp.htmlEntities;const le=(0,c.forwardRef)((function({icon:e,size:t=24,...l},s){return(0,c.cloneElement)(e,{width:t,height:t,...l,ref:s})})),se=window.wp.primitives,ne=window.ReactJSXRuntime,oe=(0,ne.jsx)(se.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ne.jsx)(se.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})}),re=(0,ne.jsx)(se.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ne.jsx)(se.Path,{d:"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"})}),ie=(0,ne.jsx)(se.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,ne.jsx)(se.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})});const ae=function({rating:e}){const t=.5*Math.round(e/.5),l=Math.floor(e),s=Math.ceil(e-l),n=5-(l+s);return(0,ne.jsxs)("span",{"aria-label":(0,x.sprintf)((0,x.__)("%s out of 5 stars"),t),children:[Array.from({length:l}).map(((e,t)=>(0,ne.jsx)(le,{className:"block-directory-block-ratings__star-full",icon:oe,size:16},`full_stars_${t}`))),Array.from({length:s}).map(((e,t)=>(0,ne.jsx)(le,{className:"block-directory-block-ratings__star-half-full",icon:re,size:16},`half_stars_${t}`))),Array.from({length:n}).map(((e,t)=>(0,ne.jsx)(le,{className:"block-directory-block-ratings__star-empty",icon:ie,size:16},`empty_stars_${t}`)))]})},ce=({rating:e})=>(0,ne.jsx)("span",{className:"block-directory-block-ratings",children:(0,ne.jsx)(ae,{rating:e})});const de=function({icon:e}){const t="block-directory-downloadable-block-icon";return null!==e.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)?(0,ne.jsx)("img",{className:t,src:e,alt:""}):(0,ne.jsx)(p.BlockIcon,{className:t,icon:e,showColors:!0})},ue=({block:e})=>{const t=(0,a.useSelect)((t=>t(U).getErrorNoticeForBlock(e.id)),[e]);return t?(0,ne.jsx)("div",{className:"block-directory-downloadable-block-notice",children:(0,ne.jsxs)("div",{className:"block-directory-downloadable-block-notice__content",children:[t.message,t.isFatal?" "+(0,x.__)("Try reloading the page."):null]})}):null};const pe=function({item:e,onClick:t}){const{author:l,description:s,icon:n,rating:o,title:r}=e,d=!!(0,i.getBlockType)(e.name),{hasNotice:u,isInstalling:p,isInstallable:b}=(0,a.useSelect)((t=>{const{getErrorNoticeForBlock:l,isInstalling:s}=t(U),n=l(e.id),o=n&&n.isFatal;return{hasNotice:!!n,isInstalling:s(e.id),isInstallable:!o}}),[e]);let h="";d?h=(0,x.__)("Installed!"):p&&(h=(0,x.__)("Installing…"));const k=function({title:e,rating:t,ratingCount:l},{hasNotice:s,isInstalled:n,isInstalling:o}){const r=.5*Math.round(t/.5);return!n&&s?(0,x.sprintf)("Retry installing %s.",(0,te.decodeEntities)(e)):n?(0,x.sprintf)("Add %s.",(0,te.decodeEntities)(e)):o?(0,x.sprintf)("Installing %s.",(0,te.decodeEntities)(e)):l<1?(0,x.sprintf)("Install %s.",(0,te.decodeEntities)(e)):(0,x.sprintf)((0,x._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",l),(0,te.decodeEntities)(e),r,l)}(e,{hasNotice:u,isInstalled:d,isInstalling:p});return(0,ne.jsx)(J.Tooltip,{placement:"top",text:k,children:(0,ne.jsxs)(J.Composite.Item,{className:ee("block-directory-downloadable-block-list-item",p&&"is-installing"),accessibleWhenDisabled:!0,disabled:p||!b,onClick:e=>{e.preventDefault(),t()},"aria-label":k,type:"button",role:"option",children:[(0,ne.jsxs)("div",{className:"block-directory-downloadable-block-list-item__icon",children:[(0,ne.jsx)(de,{icon:n,title:r}),p?(0,ne.jsx)("span",{className:"block-directory-downloadable-block-list-item__spinner",children:(0,ne.jsx)(J.Spinner,{})}):(0,ne.jsx)(ce,{rating:o})]}),(0,ne.jsxs)("span",{className:"block-directory-downloadable-block-list-item__details",children:[(0,ne.jsx)("span",{className:"block-directory-downloadable-block-list-item__title",children:(0,c.createInterpolateElement)((0,x.sprintf)((0,x.__)("%1$s <span>by %2$s</span>"),(0,te.decodeEntities)(r),l),{span:(0,ne.jsx)("span",{className:"block-directory-downloadable-block-list-item__author"})})}),u?(0,ne.jsx)(ue,{block:e}):(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("span",{className:"block-directory-downloadable-block-list-item__desc",children:h||(0,te.decodeEntities)(s)}),b&&!(d||p)&&(0,ne.jsx)(J.VisuallyHidden,{children:(0,x.__)("Install block")})]})]})]})})},be=()=>{};const he=function({items:e,onHover:t=be,onSelect:l}){const{installBlockType:s}=(0,a.useDispatch)(U);return e.length?(0,ne.jsx)(J.Composite,{role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":(0,x.__)("Blocks available for install"),children:e.map((e=>(0,ne.jsx)(pe,{onClick:()=>{(0,i.getBlockType)(e.name)?l(e):s(e).then((t=>{t&&l(e)})),t(null)},onHover:t,item:e},e.id)))}):null},ke=window.wp.a11y;const me=function({children:e,downloadableItems:t,hasLocalBlocks:l}){const s=t.length;return(0,c.useEffect)((()=>{(0,ke.speak)((0,x.sprintf)((0,x._n)("%d additional block is available to install.","%d additional blocks are available to install.",s),s))}),[s]),(0,ne.jsxs)(ne.Fragment,{children:[!l&&(0,ne.jsx)("p",{className:"block-directory-downloadable-blocks-panel__no-local",children:(0,x.__)("No results available from your installed blocks.")}),(0,ne.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,ne.jsxs)("div",{className:"block-directory-downloadable-blocks-panel",children:[(0,ne.jsxs)("div",{className:"block-directory-downloadable-blocks-panel__header",children:[(0,ne.jsx)("h2",{className:"block-directory-downloadable-blocks-panel__title",children:(0,x.__)("Available to install")}),(0,ne.jsx)("p",{className:"block-directory-downloadable-blocks-panel__description",children:(0,x.__)("Select a block to install and add it to your post.")})]}),e]})]})};const ge=function(){return(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("div",{className:"block-editor-inserter__no-results",children:(0,ne.jsx)("p",{children:(0,x.__)("No results found.")})}),(0,ne.jsx)("div",{className:"block-editor-inserter__tips",children:(0,ne.jsxs)(J.Tip,{children:[(0,x.__)("Interested in creating your own block?"),(0,ne.jsx)("br",{}),(0,ne.jsxs)(J.ExternalLink,{href:"https://developer.wordpress.org/block-editor/",children:[(0,x.__)("Get started here"),"."]})]})})]})},_e=[];function we({onSelect:e,onHover:t,hasLocalBlocks:l,isTyping:s,filterValue:n}){const{hasPermission:o,downloadableBlocks:r,isLoading:c}=(e=>(0,a.useSelect)((t=>{const{getDownloadableBlocks:l,isRequestingDownloadableBlocks:s,getInstalledBlockTypes:n}=t(U),o=t(Q.store).canUser("read","block-directory/search");let r=_e;if(o){r=l(e);const t=n(),s=r.filter((({name:e})=>{const l=t.some((t=>t.name===e)),s=(0,i.getBlockType)(e);return l||!s}));s.length!==r.length&&(r=s),0===r.length&&(r=_e)}return{hasPermission:o,downloadableBlocks:r,isLoading:s(e)}}),[e]))(n);return void 0===o||c||s?(0,ne.jsxs)(ne.Fragment,{children:[o&&!l&&(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)("p",{className:"block-directory-downloadable-blocks-panel__no-local",children:(0,x.__)("No results available from your installed blocks.")}),(0,ne.jsx)("div",{className:"block-editor-inserter__quick-inserter-separator"})]}),(0,ne.jsx)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading",children:(0,ne.jsx)(J.Spinner,{})})]}):!1===o||0===r.length?l?null:(0,ne.jsx)(ge,{}):(0,ne.jsx)(me,{downloadableItems:r,hasLocalBlocks:l,children:(0,ne.jsx)(he,{items:r,onSelect:e,onHover:t})})}const fe=function(){const[e,t]=(0,c.useState)(""),l=(0,Z.debounce)(t,400);return(0,ne.jsx)(p.__unstableInserterMenuExtension,{children:({onSelect:t,onHover:s,filterValue:n,hasItems:o})=>(e!==n&&l(n),e?(0,ne.jsx)(we,{onSelect:t,onHover:s,filterValue:e,hasLocalBlocks:o,isTyping:n!==e}):null)})};function ye({items:e}){return e.length?(0,ne.jsx)("ul",{className:"block-directory-compact-list",children:e.map((({icon:e,id:t,title:l,author:s})=>(0,ne.jsxs)("li",{className:"block-directory-compact-list__item",children:[(0,ne.jsx)(de,{icon:e,title:l}),(0,ne.jsxs)("div",{className:"block-directory-compact-list__item-details",children:[(0,ne.jsx)("div",{className:"block-directory-compact-list__item-title",children:l}),(0,ne.jsx)("div",{className:"block-directory-compact-list__item-author",children:(0,x.sprintf)((0,x.__)("By %s"),s)})]})]},t)))}):null}function xe(){const e=(0,a.useSelect)((e=>e(U).getNewBlockTypes()),[]);return e.length?(0,ne.jsxs)(d.PluginPrePublishPanel,{title:(0,x.sprintf)((0,x._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0,children:[(0,ne.jsx)("p",{className:"installed-blocks-pre-publish-panel__copy",children:(0,x._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)}),(0,ne.jsx)(ye,{items:e})]}):null}function ve({attributes:e,block:t,clientId:l}){const s=(0,a.useSelect)((e=>e(U).isInstalling(t.id)),[t.id]),{installBlockType:n}=(0,a.useDispatch)(U),{replaceBlock:o}=(0,a.useDispatch)(p.store);return(0,ne.jsx)(J.Button,{__next40pxDefaultSize:!0,onClick:()=>n(t).then((s=>{if(s){const s=(0,i.getBlockType)(t.name),[n]=(0,i.parse)(e.originalContent);n&&s&&o(l,(0,i.createBlock)(s.name,n.attributes,n.innerBlocks))}})),accessibleWhenDisabled:!0,disabled:s,isBusy:s,variant:"primary",children:(0,x.sprintf)((0,x.__)("Install %s"),t.title)})}const je=({originalBlock:e,...t})=>{const{originalName:l,originalUndelimitedContent:s,clientId:n}=t.attributes,{replaceBlock:o}=(0,a.useDispatch)(p.store),r=()=>{o(t.clientId,(0,i.createBlock)("core/html",{content:s}))},d=!!s,u=(0,a.useSelect)((e=>{const{canInsertBlockType:t,getBlockRootClientId:l}=e(p.store);return t("core/html",l(n))}),[n]);let b=(0,x.sprintf)((0,x.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),e.title||l);const h=[(0,ne.jsx)(ve,{block:e,attributes:t.attributes,clientId:t.clientId},"install")];return d&&u&&(b=(0,x.sprintf)((0,x.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),e.title||l),h.push((0,ne.jsx)(J.Button,{__next40pxDefaultSize:!0,onClick:r,variant:"tertiary",children:(0,x.__)("Keep as HTML")},"convert"))),(0,ne.jsxs)("div",{...(0,p.useBlockProps)(),children:[(0,ne.jsx)(p.Warning,{actions:h,children:b}),(0,ne.jsx)(c.RawHTML,{children:s})]})},Be=e=>t=>{const{originalName:l}=t.attributes,{block:s,hasPermission:n}=(0,a.useSelect)((e=>{const{getDownloadableBlocks:t}=e(U),s=t("block:"+l).filter((({name:e})=>l===e));return{hasPermission:e(Q.store).canUser("read","block-directory/search"),block:s.length&&s[0]}}),[l]);return n&&s?(0,ne.jsx)(je,{...t,originalBlock:s}):(0,ne.jsx)(e,{...t})};(0,o.registerPlugin)("block-directory",{icon:void 0,render:()=>(0,ne.jsxs)(ne.Fragment,{children:[(0,ne.jsx)(G,{}),(0,ne.jsx)(fe,{}),(0,ne.jsx)(xe,{})]})}),(0,r.addFilter)("blocks.registerBlockType","block-directory/fallback",((e,t)=>("core/missing"!==t||(e.edit=Be(e.edit)),e))),(window.wp=window.wp||{}).blockDirectory=t})(); autop.js 0000644 00000037156 15013651111 0006240 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ autop: () => (/* binding */ autop), /* harmony export */ removep: () => (/* binding */ removep) /* harmony export */ }); /** * The regular expression for an HTML element. */ const htmlSplitRegex = (() => { /* eslint-disable no-multi-spaces */ const comments = '!' + // Start of comment, after the <. '(?:' + // Unroll the loop: Consume everything until --> is found. '-(?!->)' + // Dash not followed by end of comment. '[^\\-]*' + // Consume non-dashes. ')*' + // Loop possessively. '(?:-->)?'; // End of comment. If not found, match all input. const cdata = '!\\[CDATA\\[' + // Start of comment, after the <. '[^\\]]*' + // Consume non-]. '(?:' + // Unroll the loop: Consume everything until ]]> is found. '](?!]>)' + // One ] not followed by end of comment. '[^\\]]*' + // Consume non-]. ')*?' + // Loop possessively. '(?:]]>)?'; // End of comment. If not found, match all input. const escaped = '(?=' + // Is the element escaped? '!--' + '|' + '!\\[CDATA\\[' + ')' + '((?=!-)' + // If yes, which type? comments + '|' + cdata + ')'; const regex = '(' + // Capture the entire match. '<' + // Find start of element. '(' + // Conditional expression follows. escaped + // Find end of escaped element. '|' + // ... else ... '[^>]*>?' + // Find end of normal element. ')' + ')'; return new RegExp(regex); /* eslint-enable no-multi-spaces */ })(); /** * Separate HTML elements and comments from the text. * * @param input The text which has to be formatted. * * @return The formatted text. */ function htmlSplit(input) { const parts = []; let workingInput = input; let match; while (match = workingInput.match(htmlSplitRegex)) { // The `match` result, when invoked on a RegExp with the `g` flag (`/foo/g`) will not include `index`. // If the `g` flag is omitted, `index` is included. // `htmlSplitRegex` does not have the `g` flag so we can assert it will have an index number. // Assert `match.index` is a number. const index = match.index; parts.push(workingInput.slice(0, index)); parts.push(match[0]); workingInput = workingInput.slice(index + match[0].length); } if (workingInput.length) { parts.push(workingInput); } return parts; } /** * Replace characters or phrases within HTML elements only. * * @param haystack The text which has to be formatted. * @param replacePairs In the form {from: 'to', …}. * * @return The formatted text. */ function replaceInHtmlTags(haystack, replacePairs) { // Find all elements. const textArr = htmlSplit(haystack); let changed = false; // Extract all needles. const needles = Object.keys(replacePairs); // Loop through delimiters (elements) only. for (let i = 1; i < textArr.length; i += 2) { for (let j = 0; j < needles.length; j++) { const needle = needles[j]; if (-1 !== textArr[i].indexOf(needle)) { textArr[i] = textArr[i].replace(new RegExp(needle, 'g'), replacePairs[needle]); changed = true; // After one strtr() break out of the foreach loop and look at next element. break; } } } if (changed) { haystack = textArr.join(''); } return haystack; } /** * Replaces double line-breaks with paragraph elements. * * A group of regex replaces used to identify text formatted with newlines and * replace double line-breaks with HTML paragraph tags. The remaining line- * breaks after conversion become `<br />` tags, unless br is set to 'false'. * * @param text The text which has to be formatted. * @param br Optional. If set, will convert all remaining line- * breaks after paragraphing. Default true. * * @example *```js * import { autop } from '@wordpress/autop'; * autop( 'my text' ); // "<p>my text</p>" * ``` * * @return Text which has been converted into paragraph tags. */ function autop(text, br = true) { const preTags = []; if (text.trim() === '') { return ''; } // Just to make things a little easier, pad the end. text = text + '\n'; /* * Pre tags shouldn't be touched by autop. * Replace pre tags with placeholders and bring them back after autop. */ if (text.indexOf('<pre') !== -1) { const textParts = text.split('</pre>'); const lastText = textParts.pop(); text = ''; for (let i = 0; i < textParts.length; i++) { const textPart = textParts[i]; const start = textPart.indexOf('<pre'); // Malformed html? if (start === -1) { text += textPart; continue; } const name = '<pre wp-pre-tag-' + i + '></pre>'; preTags.push([name, textPart.substr(start) + '</pre>']); text += textPart.substr(0, start) + name; } text += lastText; } // Change multiple <br>s into two line breaks, which will turn into paragraphs. text = text.replace(/<br\s*\/?>\s*<br\s*\/?>/g, '\n\n'); const allBlocks = '(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)'; // Add a double line break above block-level opening tags. text = text.replace(new RegExp('(<' + allBlocks + '[\\s/>])', 'g'), '\n\n$1'); // Add a double line break below block-level closing tags. text = text.replace(new RegExp('(</' + allBlocks + '>)', 'g'), '$1\n\n'); // Standardize newline characters to "\n". text = text.replace(/\r\n|\r/g, '\n'); // Find newlines in all elements and add placeholders. text = replaceInHtmlTags(text, { '\n': ' <!-- wpnl --> ' }); // Collapse line breaks before and after <option> elements so they don't get autop'd. if (text.indexOf('<option') !== -1) { text = text.replace(/\s*<option/g, '<option'); text = text.replace(/<\/option>\s*/g, '</option>'); } /* * Collapse line breaks inside <object> elements, before <param> and <embed> elements * so they don't get autop'd. */ if (text.indexOf('</object>') !== -1) { text = text.replace(/(<object[^>]*>)\s*/g, '$1'); text = text.replace(/\s*<\/object>/g, '</object>'); text = text.replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/g, '$1'); } /* * Collapse line breaks inside <audio> and <video> elements, * before and after <source> and <track> elements. */ if (text.indexOf('<source') !== -1 || text.indexOf('<track') !== -1) { text = text.replace(/([<\[](?:audio|video)[^>\]]*[>\]])\s*/g, '$1'); text = text.replace(/\s*([<\[]\/(?:audio|video)[>\]])/g, '$1'); text = text.replace(/\s*(<(?:source|track)[^>]*>)\s*/g, '$1'); } // Collapse line breaks before and after <figcaption> elements. if (text.indexOf('<figcaption') !== -1) { text = text.replace(/\s*(<figcaption[^>]*>)/, '$1'); text = text.replace(/<\/figcaption>\s*/, '</figcaption>'); } // Remove more than two contiguous line breaks. text = text.replace(/\n\n+/g, '\n\n'); // Split up the contents into an array of strings, separated by double line breaks. const texts = text.split(/\n\s*\n/).filter(Boolean); // Reset text prior to rebuilding. text = ''; // Rebuild the content as a string, wrapping every bit with a <p>. texts.forEach(textPiece => { text += '<p>' + textPiece.replace(/^\n*|\n*$/g, '') + '</p>\n'; }); // Under certain strange conditions it could create a P of entirely whitespace. text = text.replace(/<p>\s*<\/p>/g, ''); // Add a closing <p> inside <div>, <address>, or <form> tag if missing. text = text.replace(/<p>([^<]+)<\/(div|address|form)>/g, '<p>$1</p></$2>'); // If an opening or closing block element tag is wrapped in a <p>, unwrap it. text = text.replace(new RegExp('<p>\\s*(</?' + allBlocks + '[^>]*>)\\s*</p>', 'g'), '$1'); // In some cases <li> may get wrapped in <p>, fix them. text = text.replace(/<p>(<li.+?)<\/p>/g, '$1'); // If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>. text = text.replace(/<p><blockquote([^>]*)>/gi, '<blockquote$1><p>'); text = text.replace(/<\/blockquote><\/p>/g, '</p></blockquote>'); // If an opening or closing block element tag is preceded by an opening <p> tag, remove it. text = text.replace(new RegExp('<p>\\s*(</?' + allBlocks + '[^>]*>)', 'g'), '$1'); // If an opening or closing block element tag is followed by a closing <p> tag, remove it. text = text.replace(new RegExp('(</?' + allBlocks + '[^>]*>)\\s*</p>', 'g'), '$1'); // Optionally insert line breaks. if (br) { // Replace newlines that shouldn't be touched with a placeholder. text = text.replace(/<(script|style).*?<\/\\1>/g, match => match[0].replace(/\n/g, '<WPPreserveNewline />')); // Normalize <br> text = text.replace(/<br>|<br\/>/g, '<br />'); // Replace any new line characters that aren't preceded by a <br /> with a <br />. text = text.replace(/(<br \/>)?\s*\n/g, (a, b) => b ? a : '<br />\n'); // Replace newline placeholders with newlines. text = text.replace(/<WPPreserveNewline \/>/g, '\n'); } // If a <br /> tag is after an opening or closing block tag, remove it. text = text.replace(new RegExp('(</?' + allBlocks + '[^>]*>)\\s*<br />', 'g'), '$1'); // If a <br /> tag is before a subset of opening or closing block tags, remove it. text = text.replace(/<br \/>(\s*<\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g, '$1'); text = text.replace(/\n<\/p>$/g, '</p>'); // Replace placeholder <pre> tags with their original content. preTags.forEach(preTag => { const [name, original] = preTag; text = text.replace(name, original); }); // Restore newlines in all elements. if (-1 !== text.indexOf('<!-- wpnl -->')) { text = text.replace(/\s?<!-- wpnl -->\s?/g, '\n'); } return text; } /** * Replaces `<p>` tags with two line breaks. "Opposite" of autop(). * * Replaces `<p>` tags with two line breaks except where the `<p>` has attributes. * Unifies whitespace. Indents `<li>`, `<dt>` and `<dd>` for better readability. * * @param html The content from the editor. * * @example * ```js * import { removep } from '@wordpress/autop'; * removep( '<p>my text</p>' ); // "my text" * ``` * * @return The content with stripped paragraph tags. */ function removep(html) { const blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure'; const blocklist1 = blocklist + '|div|p'; const blocklist2 = blocklist + '|pre'; const preserve = []; let preserveLinebreaks = false; let preserveBr = false; if (!html) { return ''; } // Protect script and style tags. if (html.indexOf('<script') !== -1 || html.indexOf('<style') !== -1) { html = html.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/g, match => { preserve.push(match); return '<wp-preserve>'; }); } // Protect pre tags. if (html.indexOf('<pre') !== -1) { preserveLinebreaks = true; html = html.replace(/<pre[^>]*>[\s\S]+?<\/pre>/g, a => { a = a.replace(/<br ?\/?>(\r\n|\n)?/g, '<wp-line-break>'); a = a.replace(/<\/?p( [^>]*)?>(\r\n|\n)?/g, '<wp-line-break>'); return a.replace(/\r?\n/g, '<wp-line-break>'); }); } // Remove line breaks but keep <br> tags inside image captions. if (html.indexOf('[caption') !== -1) { preserveBr = true; html = html.replace(/\[caption[\s\S]+?\[\/caption\]/g, a => { return a.replace(/<br([^>]*)>/g, '<wp-temp-br$1>').replace(/[\r\n\t]+/, ''); }); } // Normalize white space characters before and after block tags. html = html.replace(new RegExp('\\s*</(' + blocklist1 + ')>\\s*', 'g'), '</$1>\n'); html = html.replace(new RegExp('\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g'), '\n<$1>'); // Mark </p> if it has any attributes. html = html.replace(/(<p [^>]+>[\s\S]*?)<\/p>/g, '$1</p#>'); // Preserve the first <p> inside a <div>. html = html.replace(/<div( [^>]*)?>\s*<p>/gi, '<div$1>\n\n'); // Remove paragraph tags. html = html.replace(/\s*<p>/gi, ''); html = html.replace(/\s*<\/p>\s*/gi, '\n\n'); // Normalize white space chars and remove multiple line breaks. html = html.replace(/\n[\s\u00a0]+\n/g, '\n\n'); // Replace <br> tags with line breaks. html = html.replace(/(\s*)<br ?\/?>\s*/gi, (_, space) => { if (space && space.indexOf('\n') !== -1) { return '\n\n'; } return '\n'; }); // Fix line breaks around <div>. html = html.replace(/\s*<div/g, '\n<div'); html = html.replace(/<\/div>\s*/g, '</div>\n'); // Fix line breaks around caption shortcodes. html = html.replace(/\s*\[caption([^\[]+)\[\/caption\]\s*/gi, '\n\n[caption$1[/caption]\n\n'); html = html.replace(/caption\]\n\n+\[caption/g, 'caption]\n\n[caption'); // Pad block elements tags with a line break. html = html.replace(new RegExp('\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\s*>', 'g'), '\n<$1>'); html = html.replace(new RegExp('\\s*</(' + blocklist2 + ')>\\s*', 'g'), '</$1>\n'); // Indent <li>, <dt> and <dd> tags. html = html.replace(/<((li|dt|dd)[^>]*)>/g, ' \t<$1>'); // Fix line breaks around <select> and <option>. if (html.indexOf('<option') !== -1) { html = html.replace(/\s*<option/g, '\n<option'); html = html.replace(/\s*<\/select>/g, '\n</select>'); } // Pad <hr> with two line breaks. if (html.indexOf('<hr') !== -1) { html = html.replace(/\s*<hr( [^>]*)?>\s*/g, '\n\n<hr$1>\n\n'); } // Remove line breaks in <object> tags. if (html.indexOf('<object') !== -1) { html = html.replace(/<object[\s\S]+?<\/object>/g, a => { return a.replace(/[\r\n]+/g, ''); }); } // Unmark special paragraph closing tags. html = html.replace(/<\/p#>/g, '</p>\n'); // Pad remaining <p> tags whit a line break. html = html.replace(/\s*(<p [^>]+>[\s\S]*?<\/p>)/g, '\n$1'); // Trim. html = html.replace(/^\s+/, ''); html = html.replace(/[\s\u00a0]+$/, ''); if (preserveLinebreaks) { html = html.replace(/<wp-line-break>/g, '\n'); } if (preserveBr) { html = html.replace(/<wp-temp-br([^>]*)>/g, '<br$1>'); } // Restore preserved tags. if (preserve.length) { html = html.replace(/<wp-preserve>/g, () => { return preserve.shift(); }); } return html; } (window.wp = window.wp || {}).autop = __webpack_exports__; /******/ })() ; wordcount.js 0000644 00000034634 15013651111 0007132 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ "use strict"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { count: () => (/* binding */ count) }); ;// ./node_modules/@wordpress/wordcount/build-module/defaultSettings.js /** @typedef {import('./index').WPWordCountStrategy} WPWordCountStrategy */ /** @typedef {Partial<{type: WPWordCountStrategy, shortcodes: string[]}>} WPWordCountL10n */ /** * @typedef WPWordCountSettingsFields * @property {RegExp} HTMLRegExp Regular expression that matches HTML tags * @property {RegExp} HTMLcommentRegExp Regular expression that matches HTML comments * @property {RegExp} spaceRegExp Regular expression that matches spaces in HTML * @property {RegExp} HTMLEntityRegExp Regular expression that matches HTML entities * @property {RegExp} connectorRegExp Regular expression that matches word connectors, like em-dash * @property {RegExp} removeRegExp Regular expression that matches various characters to be removed when counting * @property {RegExp} astralRegExp Regular expression that matches astral UTF-16 code points * @property {RegExp} wordsRegExp Regular expression that matches words * @property {RegExp} characters_excluding_spacesRegExp Regular expression that matches characters excluding spaces * @property {RegExp} characters_including_spacesRegExp Regular expression that matches characters including spaces * @property {RegExp} shortcodesRegExp Regular expression that matches WordPress shortcodes * @property {string[]} shortcodes List of all shortcodes * @property {WPWordCountStrategy} type Describes what and how are we counting * @property {WPWordCountL10n} l10n Object with human translations */ /** * Lower-level settings for word counting that can be overridden. * * @typedef {Partial<WPWordCountSettingsFields>} WPWordCountUserSettings */ // Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly: https://github.com/jsdoc/jsdoc/issues/1285 /* eslint-disable jsdoc/valid-types */ /** * Word counting settings that include non-optional values we set if missing * * @typedef {WPWordCountUserSettings & typeof defaultSettings} WPWordCountDefaultSettings */ /* eslint-enable jsdoc/valid-types */ const defaultSettings = { HTMLRegExp: /<\/?[a-z][^>]*?>/gi, HTMLcommentRegExp: /<!--[\s\S]*?-->/g, spaceRegExp: / | /gi, HTMLEntityRegExp: /&\S+?;/g, // \u2014 = em-dash. connectorRegExp: /--|\u2014/g, // Characters to be removed from input text. removeRegExp: new RegExp(['[', // Basic Latin (extract) '\u0021-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E', // Latin-1 Supplement (extract) '\u0080-\u00BF\u00D7\u00F7', /* * The following range consists of: * General Punctuation * Superscripts and Subscripts * Currency Symbols * Combining Diacritical Marks for Symbols * Letterlike Symbols * Number Forms * Arrows * Mathematical Operators * Miscellaneous Technical * Control Pictures * Optical Character Recognition * Enclosed Alphanumerics * Box Drawing * Block Elements * Geometric Shapes * Miscellaneous Symbols * Dingbats * Miscellaneous Mathematical Symbols-A * Supplemental Arrows-A * Braille Patterns * Supplemental Arrows-B * Miscellaneous Mathematical Symbols-B * Supplemental Mathematical Operators * Miscellaneous Symbols and Arrows */ '\u2000-\u2BFF', // Supplemental Punctuation. '\u2E00-\u2E7F', ']'].join(''), 'g'), // Remove UTF-16 surrogate points, see https://en.wikipedia.org/wiki/UTF-16#U.2BD800_to_U.2BDFFF astralRegExp: /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, wordsRegExp: /\S\s+/g, characters_excluding_spacesRegExp: /\S/g, /* * Match anything that is not a formatting character, excluding: * \f = form feed * \n = new line * \r = carriage return * \t = tab * \v = vertical tab * \u00AD = soft hyphen * \u2028 = line separator * \u2029 = paragraph separator */ characters_including_spacesRegExp: /[^\f\n\r\t\v\u00AD\u2028\u2029]/g, l10n: { type: 'words' } }; ;// ./node_modules/@wordpress/wordcount/build-module/stripTags.js /** * Replaces items matched in the regex with new line * * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions * @param {string} text The string being counted. * * @return {string} The manipulated text. */ function stripTags(settings, text) { return text.replace(settings.HTMLRegExp, '\n'); } ;// ./node_modules/@wordpress/wordcount/build-module/transposeAstralsToCountableChar.js /** * Replaces items matched in the regex with character. * * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions * @param {string} text The string being counted. * * @return {string} The manipulated text. */ function transposeAstralsToCountableChar(settings, text) { return text.replace(settings.astralRegExp, 'a'); } ;// ./node_modules/@wordpress/wordcount/build-module/stripHTMLEntities.js /** * Removes items matched in the regex. * * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions * @param {string} text The string being counted. * * @return {string} The manipulated text. */ function stripHTMLEntities(settings, text) { return text.replace(settings.HTMLEntityRegExp, ''); } ;// ./node_modules/@wordpress/wordcount/build-module/stripConnectors.js /** * Replaces items matched in the regex with spaces. * * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions * @param {string} text The string being counted. * * @return {string} The manipulated text. */ function stripConnectors(settings, text) { return text.replace(settings.connectorRegExp, ' '); } ;// ./node_modules/@wordpress/wordcount/build-module/stripRemovables.js /** * Removes items matched in the regex. * * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions * @param {string} text The string being counted. * * @return {string} The manipulated text. */ function stripRemovables(settings, text) { return text.replace(settings.removeRegExp, ''); } ;// ./node_modules/@wordpress/wordcount/build-module/stripHTMLComments.js /** * Removes items matched in the regex. * * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions * @param {string} text The string being counted. * * @return {string} The manipulated text. */ function stripHTMLComments(settings, text) { return text.replace(settings.HTMLcommentRegExp, ''); } ;// ./node_modules/@wordpress/wordcount/build-module/stripShortcodes.js /** * Replaces items matched in the regex with a new line. * * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions * @param {string} text The string being counted. * * @return {string} The manipulated text. */ function stripShortcodes(settings, text) { if (settings.shortcodesRegExp) { return text.replace(settings.shortcodesRegExp, '\n'); } return text; } ;// ./node_modules/@wordpress/wordcount/build-module/stripSpaces.js /** * Replaces items matched in the regex with spaces. * * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions * @param {string} text The string being counted. * * @return {string} The manipulated text. */ function stripSpaces(settings, text) { return text.replace(settings.spaceRegExp, ' '); } ;// ./node_modules/@wordpress/wordcount/build-module/transposeHTMLEntitiesToCountableChars.js /** * Replaces items matched in the regex with a single character. * * @param {import('./index').WPWordCountSettings} settings The main settings object containing regular expressions * @param {string} text The string being counted. * * @return {string} The manipulated text. */ function transposeHTMLEntitiesToCountableChars(settings, text) { return text.replace(settings.HTMLEntityRegExp, 'a'); } ;// ./node_modules/@wordpress/wordcount/build-module/index.js /** * Internal dependencies */ /** * @typedef {import('./defaultSettings').WPWordCountDefaultSettings} WPWordCountSettings * @typedef {import('./defaultSettings').WPWordCountUserSettings} WPWordCountUserSettings */ /** * Possible ways of counting. * * @typedef {'words'|'characters_excluding_spaces'|'characters_including_spaces'} WPWordCountStrategy */ /** * Private function to manage the settings. * * @param {WPWordCountStrategy} type The type of count to be done. * @param {WPWordCountUserSettings} userSettings Custom settings for the count. * * @return {WPWordCountSettings} The combined settings object to be used. */ function loadSettings(type, userSettings) { var _settings$l10n$shortc; const settings = Object.assign({}, defaultSettings, userSettings); settings.shortcodes = (_settings$l10n$shortc = settings.l10n?.shortcodes) !== null && _settings$l10n$shortc !== void 0 ? _settings$l10n$shortc : []; if (settings.shortcodes && settings.shortcodes.length) { settings.shortcodesRegExp = new RegExp('\\[\\/?(?:' + settings.shortcodes.join('|') + ')[^\\]]*?\\]', 'g'); } settings.type = type; if (settings.type !== 'characters_excluding_spaces' && settings.type !== 'characters_including_spaces') { settings.type = 'words'; } return settings; } /** * Count the words in text * * @param {string} text The text being processed * @param {RegExp} regex The regular expression pattern being matched * @param {WPWordCountSettings} settings Settings object containing regular expressions for each strip function * * @return {number} Count of words. */ function countWords(text, regex, settings) { var _text$match$length; text = [stripTags.bind(null, settings), stripHTMLComments.bind(null, settings), stripShortcodes.bind(null, settings), stripSpaces.bind(null, settings), stripHTMLEntities.bind(null, settings), stripConnectors.bind(null, settings), stripRemovables.bind(null, settings)].reduce((result, fn) => fn(result), text); text = text + '\n'; return (_text$match$length = text.match(regex)?.length) !== null && _text$match$length !== void 0 ? _text$match$length : 0; } /** * Count the characters in text * * @param {string} text The text being processed * @param {RegExp} regex The regular expression pattern being matched * @param {WPWordCountSettings} settings Settings object containing regular expressions for each strip function * * @return {number} Count of characters. */ function countCharacters(text, regex, settings) { var _text$match$length2; text = [stripTags.bind(null, settings), stripHTMLComments.bind(null, settings), stripShortcodes.bind(null, settings), transposeAstralsToCountableChar.bind(null, settings), stripSpaces.bind(null, settings), transposeHTMLEntitiesToCountableChars.bind(null, settings)].reduce((result, fn) => fn(result), text); text = text + '\n'; return (_text$match$length2 = text.match(regex)?.length) !== null && _text$match$length2 !== void 0 ? _text$match$length2 : 0; } /** * Count some words. * * @param {string} text The text being processed * @param {WPWordCountStrategy} type The type of count. Accepts 'words', 'characters_excluding_spaces', or 'characters_including_spaces'. * @param {WPWordCountUserSettings} userSettings Custom settings object. * * @example * ```js * import { count } from '@wordpress/wordcount'; * const numberOfWords = count( 'Words to count', 'words', {} ) * ``` * * @return {number} The word or character count. */ function count(text, type, userSettings) { const settings = loadSettings(type, userSettings); let matchRegExp; switch (settings.type) { case 'words': matchRegExp = settings.wordsRegExp; return countWords(text, matchRegExp, settings); case 'characters_including_spaces': matchRegExp = settings.characters_including_spacesRegExp; return countCharacters(text, matchRegExp, settings); case 'characters_excluding_spaces': matchRegExp = settings.characters_excluding_spacesRegExp; return countCharacters(text, matchRegExp, settings); default: return 0; } } (window.wp = window.wp || {}).wordcount = __webpack_exports__; /******/ })() ; edit-widgets.min.js 0000644 00000162355 15013651111 0010263 0 ustar 00 /*! This file is auto-generated */ (()=>{"use strict";var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{initialize:()=>Er,initializeEditor:()=>Sr,reinitializeEditor:()=>Ar,store:()=>nt});var r={};e.r(r),e.d(r,{closeModal:()=>$,disableComplementaryArea:()=>V,enableComplementaryArea:()=>O,openModal:()=>U,pinItem:()=>D,setDefaultComplementaryArea:()=>M,setFeatureDefaults:()=>H,setFeatureValue:()=>z,toggleFeature:()=>G,unpinItem:()=>F});var i={};e.r(i),e.d(i,{getActiveComplementaryArea:()=>Y,isComplementaryAreaLoading:()=>Z,isFeatureActive:()=>q,isItemPinned:()=>K,isModalActive:()=>J});var s={};e.r(s),e.d(s,{closeGeneralSidebar:()=>Pe,moveBlockToWidgetArea:()=>Me,persistStubPost:()=>Ee,saveEditedWidgetAreas:()=>Ae,saveWidgetArea:()=>Ce,saveWidgetAreas:()=>Ie,setIsInserterOpened:()=>Re,setIsListViewOpened:()=>We,setIsWidgetAreaOpen:()=>Le,setWidgetAreasOpenState:()=>Te,setWidgetIdForClientId:()=>Be});var o={};e.r(o),e.d(o,{getWidgetAreas:()=>Oe,getWidgets:()=>Ve});var n={};e.r(n),e.d(n,{__experimentalGetInsertionPoint:()=>Je,canInsertBlockInWidgetArea:()=>Qe,getEditedWidgetAreas:()=>$e,getIsWidgetAreaOpen:()=>Ke,getParentWidgetAreaBlock:()=>Ue,getReferenceWidgetBlocks:()=>Ye,getWidget:()=>Ge,getWidgetAreaForWidgetId:()=>He,getWidgetAreas:()=>ze,getWidgets:()=>Fe,isInserterOpened:()=>qe,isListViewOpened:()=>Xe,isSavingWidgetAreas:()=>Ze});var a={};e.r(a),e.d(a,{getInserterSidebarToggleRef:()=>tt,getListViewToggleRef:()=>et});var c={};e.r(c),e.d(c,{metadata:()=>pt,name:()=>ht,settings:()=>mt});const d=window.wp.blocks,l=window.wp.data,u=window.wp.deprecated;var g=e.n(u);const p=window.wp.element,h=window.wp.blockLibrary,m=window.wp.coreData,w=window.wp.widgets,_=window.wp.preferences,b=window.wp.apiFetch;var f=e.n(b);const x=(0,l.combineReducers)({blockInserterPanel:function(e=!1,t){switch(t.type){case"SET_IS_LIST_VIEW_OPENED":return!t.isOpen&&e;case"SET_IS_INSERTER_OPENED":return t.value}return e},inserterSidebarToggleRef:function(e={current:null}){return e},listViewPanel:function(e=!1,t){switch(t.type){case"SET_IS_INSERTER_OPENED":return!t.value&&e;case"SET_IS_LIST_VIEW_OPENED":return t.isOpen}return e},listViewToggleRef:function(e={current:null}){return e},widgetAreasOpenState:function(e={},t){const{type:r}=t;switch(r){case"SET_WIDGET_AREAS_OPEN_STATE":return t.widgetAreasOpenState;case"SET_IS_WIDGET_AREA_OPEN":{const{clientId:r,isOpen:i}=t;return{...e,[r]:i}}default:return e}}}),y=window.wp.i18n,v=window.wp.notices;function k(e){var t,r,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=k(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}const j=function(){for(var e,t,r=0,i="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=k(e))&&(i&&(i+=" "),i+=t);return i},S=window.wp.components,E=window.wp.primitives,A=window.ReactJSXRuntime,I=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),C=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})}),N=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})}),B=window.wp.viewport,T=window.wp.compose,L=window.wp.plugins,R=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})});function W(e){return["core/edit-post","core/edit-site"].includes(e)?(g()(`${e} interface scope`,{alternative:"core interface scope",hint:"core/edit-post and core/edit-site are merging.",version:"6.6"}),"core"):e}function P(e,t){return"core"===e&&"edit-site/template"===t?(g()("edit-site/template sidebar",{alternative:"edit-post/document",version:"6.6"}),"edit-post/document"):"core"===e&&"edit-site/block-inspector"===t?(g()("edit-site/block-inspector sidebar",{alternative:"edit-post/block",version:"6.6"}),"edit-post/block"):t}const M=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e=W(e),area:t=P(e,t)}),O=(e,t)=>({registry:r,dispatch:i})=>{if(!t)return;e=W(e),t=P(e,t);r.select(_.store).get(e,"isComplementaryAreaVisible")||r.dispatch(_.store).set(e,"isComplementaryAreaVisible",!0),i({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t})},V=e=>({registry:t})=>{e=W(e);t.select(_.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(_.store).set(e,"isComplementaryAreaVisible",!1)},D=(e,t)=>({registry:r})=>{if(!t)return;e=W(e),t=P(e,t);const i=r.select(_.store).get(e,"pinnedItems");!0!==i?.[t]&&r.dispatch(_.store).set(e,"pinnedItems",{...i,[t]:!0})},F=(e,t)=>({registry:r})=>{if(!t)return;e=W(e),t=P(e,t);const i=r.select(_.store).get(e,"pinnedItems");r.dispatch(_.store).set(e,"pinnedItems",{...i,[t]:!1})};function G(e,t){return function({registry:r}){g()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),r.dispatch(_.store).toggle(e,t)}}function z(e,t,r){return function({registry:i}){g()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),i.dispatch(_.store).set(e,t,!!r)}}function H(e,t){return function({registry:r}){g()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),r.dispatch(_.store).setDefaults(e,t)}}function U(e){return{type:"OPEN_MODAL",name:e}}function $(){return{type:"CLOSE_MODAL"}}const Y=(0,l.createRegistrySelector)((e=>(t,r)=>{r=W(r);const i=e(_.store).get(r,"isComplementaryAreaVisible");if(void 0!==i)return!1===i?null:t?.complementaryAreas?.[r]})),Z=(0,l.createRegistrySelector)((e=>(t,r)=>{r=W(r);const i=e(_.store).get(r,"isComplementaryAreaVisible"),s=t?.complementaryAreas?.[r];return i&&void 0===s})),K=(0,l.createRegistrySelector)((e=>(t,r,i)=>{var s;i=P(r=W(r),i);const o=e(_.store).get(r,"pinnedItems");return null===(s=o?.[i])||void 0===s||s})),q=(0,l.createRegistrySelector)((e=>(t,r,i)=>(g()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(_.store).get(r,i))));function J(e,t){return e.activeModal===t}const Q=(0,l.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:r,area:i}=t;return e[r]?e:{...e,[r]:i}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:r,area:i}=t;return{...e,[r]:i}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),X=(0,l.createReduxStore)("core/interface",{reducer:Q,actions:r,selectors:i});function ee({as:e=S.Button,scope:t,identifier:r,icon:i,selectedIcon:s,name:o,shortcut:n,...a}){const c=e,d=(0,L.usePluginContext)(),u=i||d.icon,g=r||`${d.name}/${o}`,p=(0,l.useSelect)((e=>e(X).getActiveComplementaryArea(t)===g),[g,t]),{enableComplementaryArea:h,disableComplementaryArea:m}=(0,l.useDispatch)(X);return(0,A.jsx)(c,{icon:s&&p?s:u,"aria-controls":g.replace("/",":"),"aria-checked":(w=a.role,["checkbox","option","radio","switch","menuitemcheckbox","menuitemradio","treeitem"].includes(w)?p:void 0),onClick:()=>{p?m(t):h(t,g)},shortcut:n,...a});var w}(0,l.register)(X);const te=({children:e,className:t,toggleButtonProps:r})=>{const i=(0,A.jsx)(ee,{icon:R,...r});return(0,A.jsxs)("div",{className:j("components-panel__header","interface-complementary-area-header",t),tabIndex:-1,children:[e,i]})},re=()=>{};function ie({name:e,as:t=S.Button,onClick:r,...i}){return(0,A.jsx)(S.Fill,{name:e,children:({onClick:e})=>(0,A.jsx)(t,{onClick:r||e?(...t)=>{(r||re)(...t),(e||re)(...t)}:void 0,...i})})}ie.Slot=function({name:e,as:t=S.MenuGroup,fillProps:r={},bubblesVirtually:i,...s}){return(0,A.jsx)(S.Slot,{name:e,bubblesVirtually:i,fillProps:r,children:e=>{if(!p.Children.toArray(e).length)return null;const r=[];p.Children.forEach(e,(({props:{__unstableExplicitMenuItem:e,__unstableTarget:t}})=>{t&&e&&r.push(t)}));const i=p.Children.map(e,(e=>!e.props.__unstableExplicitMenuItem&&r.includes(e.props.__unstableTarget)?null:e));return(0,A.jsx)(t,{...s,children:i})}})};const se=ie,oe=({__unstableExplicitMenuItem:e,__unstableTarget:t,...r})=>(0,A.jsx)(S.MenuItem,{...r});function ne({scope:e,target:t,__unstableExplicitMenuItem:r,...i}){return(0,A.jsx)(ee,{as:i=>(0,A.jsx)(se,{__unstableExplicitMenuItem:r,__unstableTarget:`${e}/${t}`,as:oe,name:`${e}/plugin-more-menu`,...i}),role:"menuitemcheckbox",selectedIcon:I,name:t,scope:e,...i})}function ae({scope:e,...t}){return(0,A.jsx)(S.Fill,{name:`PinnedItems/${e}`,...t})}ae.Slot=function({scope:e,className:t,...r}){return(0,A.jsx)(S.Slot,{name:`PinnedItems/${e}`,...r,children:e=>e?.length>0&&(0,A.jsx)("div",{className:j(t,"interface-pinned-items"),children:e})})};const ce=ae;const de={open:{width:280},closed:{width:0},mobileOpen:{width:"100vw"}};function le({activeArea:e,isActive:t,scope:r,children:i,className:s,id:o}){const n=(0,T.useReducedMotion)(),a=(0,T.useViewportMatch)("medium","<"),c=(0,T.usePrevious)(e),d=(0,T.usePrevious)(t),[,l]=(0,p.useState)({});(0,p.useEffect)((()=>{l({})}),[t]);const u={type:"tween",duration:n||a||c&&e&&e!==c?0:.3,ease:[.6,0,.4,1]};return(0,A.jsx)(S.Fill,{name:`ComplementaryArea/${r}`,children:(0,A.jsx)(S.__unstableAnimatePresence,{initial:!1,children:(d||t)&&(0,A.jsx)(S.__unstableMotion.div,{variants:de,initial:"closed",animate:a?"mobileOpen":"open",exit:"closed",transition:u,className:"interface-complementary-area__fill",children:(0,A.jsx)("div",{id:o,className:s,style:{width:a?"100vw":280},children:i})})})})}function ue({children:e,className:t,closeLabel:r=(0,y.__)("Close plugin"),identifier:i,header:s,headerClassName:o,icon:n,isPinnable:a=!0,panelClassName:c,scope:d,name:u,title:g,toggleShortcut:h,isActiveByDefault:m}){const w=(0,L.usePluginContext)(),b=n||w.icon,f=i||`${w.name}/${u}`,[x,v]=(0,p.useState)(!1),{isLoading:k,isActive:E,isPinned:R,activeArea:W,isSmall:P,isLarge:M,showIconLabels:O}=(0,l.useSelect)((e=>{const{getActiveComplementaryArea:t,isComplementaryAreaLoading:r,isItemPinned:i}=e(X),{get:s}=e(_.store),o=t(d);return{isLoading:r(d),isActive:o===f,isPinned:i(d,f),activeArea:o,isSmall:e(B.store).isViewportMatch("< medium"),isLarge:e(B.store).isViewportMatch("large"),showIconLabels:s("core","showIconLabels")}}),[f,d]),V=(0,T.useViewportMatch)("medium","<");!function(e,t,r,i,s){const o=(0,p.useRef)(!1),n=(0,p.useRef)(!1),{enableComplementaryArea:a,disableComplementaryArea:c}=(0,l.useDispatch)(X);(0,p.useEffect)((()=>{i&&s&&!o.current?(c(e),n.current=!0):n.current&&!s&&o.current?(n.current=!1,a(e,t)):n.current&&r&&r!==t&&(n.current=!1),s!==o.current&&(o.current=s)}),[i,s,e,t,r,c,a])}(d,f,W,E,P);const{enableComplementaryArea:D,disableComplementaryArea:F,pinItem:G,unpinItem:z}=(0,l.useDispatch)(X);if((0,p.useEffect)((()=>{m&&void 0===W&&!P?D(d,f):void 0===W&&P&&F(d,f),v(!0)}),[W,m,d,f,P,D,F]),x)return(0,A.jsxs)(A.Fragment,{children:[a&&(0,A.jsx)(ce,{scope:d,children:R&&(0,A.jsx)(ee,{scope:d,identifier:f,isPressed:E&&(!O||M),"aria-expanded":E,"aria-disabled":k,label:g,icon:O?I:b,showTooltip:!O,variant:O?"tertiary":void 0,size:"compact",shortcut:h})}),u&&a&&(0,A.jsx)(ne,{target:u,scope:d,icon:b,children:g}),(0,A.jsxs)(le,{activeArea:W,isActive:E,className:j("interface-complementary-area",t),scope:d,id:f.replace("/",":"),children:[(0,A.jsx)(te,{className:o,closeLabel:r,onClose:()=>F(d),toggleButtonProps:{label:r,size:"compact",shortcut:h,scope:d,identifier:f},children:s||(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h2",{className:"interface-complementary-area-header__title",children:g}),a&&!V&&(0,A.jsx)(S.Button,{className:"interface-complementary-area__pin-unpin-item",icon:R?C:N,label:R?(0,y.__)("Unpin from toolbar"):(0,y.__)("Pin to toolbar"),onClick:()=>(R?z:G)(d,f),isPressed:R,"aria-expanded":R,size:"compact"})]})}),(0,A.jsx)(S.Panel,{className:c,children:e})]})]})}ue.Slot=function({scope:e,...t}){return(0,A.jsx)(S.Slot,{name:`ComplementaryArea/${e}`,...t})};const ge=ue,pe=(0,p.forwardRef)((({children:e,className:t,ariaLabel:r,as:i="div",...s},o)=>(0,A.jsx)(i,{ref:o,className:j("interface-navigable-region",t),"aria-label":r,role:"region",tabIndex:"-1",...s,children:e})));pe.displayName="NavigableRegion";const he=pe,me={type:"tween",duration:.25,ease:[.6,0,.4,1]};const we={hidden:{opacity:1,marginTop:-60},visible:{opacity:1,marginTop:0},distractionFreeHover:{opacity:1,marginTop:0,transition:{...me,delay:.2,delayChildren:.2}},distractionFreeHidden:{opacity:0,marginTop:-60},distractionFreeDisabled:{opacity:0,marginTop:0,transition:{...me,delay:.8,delayChildren:.8}}};const _e=(0,p.forwardRef)((function({isDistractionFree:e,footer:t,header:r,editorNotices:i,sidebar:s,secondarySidebar:o,content:n,actions:a,labels:c,className:d},l){const[u,g]=(0,T.useResizeObserver)(),h=(0,T.useViewportMatch)("medium","<"),m={type:"tween",duration:(0,T.useReducedMotion)()?0:.25,ease:[.6,0,.4,1]};!function(e){(0,p.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const w={...{header:(0,y._x)("Header","header landmark area"),body:(0,y.__)("Content"),secondarySidebar:(0,y.__)("Block Library"),sidebar:(0,y._x)("Settings","settings landmark area"),actions:(0,y.__)("Publish"),footer:(0,y.__)("Footer")},...c};return(0,A.jsxs)("div",{ref:l,className:j(d,"interface-interface-skeleton",!!t&&"has-footer"),children:[(0,A.jsxs)("div",{className:"interface-interface-skeleton__editor",children:[(0,A.jsx)(S.__unstableAnimatePresence,{initial:!1,children:!!r&&(0,A.jsx)(he,{as:S.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":w.header,initial:e&&!h?"distractionFreeHidden":"hidden",whileHover:e&&!h?"distractionFreeHover":"visible",animate:e&&!h?"distractionFreeDisabled":"visible",exit:e&&!h?"distractionFreeHidden":"hidden",variants:we,transition:m,children:r})}),e&&(0,A.jsx)("div",{className:"interface-interface-skeleton__header",children:i}),(0,A.jsxs)("div",{className:"interface-interface-skeleton__body",children:[(0,A.jsx)(S.__unstableAnimatePresence,{initial:!1,children:!!o&&(0,A.jsx)(he,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:w.secondarySidebar,as:S.__unstableMotion.div,initial:"closed",animate:"open",exit:"closed",variants:{open:{width:g.width},closed:{width:0}},transition:m,children:(0,A.jsxs)(S.__unstableMotion.div,{style:{position:"absolute",width:h?"100vw":"fit-content",height:"100%",left:0},variants:{open:{x:0},closed:{x:"-100%"}},transition:m,children:[u,o]})})}),(0,A.jsx)(he,{className:"interface-interface-skeleton__content",ariaLabel:w.body,children:n}),!!s&&(0,A.jsx)(he,{className:"interface-interface-skeleton__sidebar",ariaLabel:w.sidebar,children:s}),!!a&&(0,A.jsx)(he,{className:"interface-interface-skeleton__actions",ariaLabel:w.actions,children:a})]})]}),!!t&&(0,A.jsx)(he,{className:"interface-interface-skeleton__footer",ariaLabel:w.footer,children:t})]})})),be=window.wp.blockEditor;function fe(e){if("block"===e.id_base){const t=(0,d.parse)(e.instance.raw.content,{__unstableSkipAutop:!0});return t.length?(0,w.addWidgetIdToBlock)(t[0],e.id):(0,w.addWidgetIdToBlock)((0,d.createBlock)("core/paragraph",{},[]),e.id)}let t;return t=e._embedded.about[0].is_multi?{idBase:e.id_base,instance:e.instance}:{id:e.id},(0,w.addWidgetIdToBlock)((0,d.createBlock)("core/legacy-widget",t,[]),e.id)}function xe(e,t={}){let r;var i,s,o;"core/legacy-widget"===e.name&&(e.attributes.id||e.attributes.instance)?r={...t,id:null!==(i=e.attributes.id)&&void 0!==i?i:t.id,id_base:null!==(s=e.attributes.idBase)&&void 0!==s?s:t.id_base,instance:null!==(o=e.attributes.instance)&&void 0!==o?o:t.instance}:r={...t,id_base:"block",instance:{raw:{content:(0,d.serialize)(e)}}};return delete r.rendered,delete r.rendered_form,r}const ye="root",ve="sidebar",ke="postType",je=e=>`widget-area-${e}`;const Se="core/edit-widgets",Ee=(e,t)=>({registry:r})=>{const i=((e,t)=>({id:e,slug:e,status:"draft",type:"page",blocks:t,meta:{widgetAreaId:e}}))(e,t);return r.dispatch(m.store).receiveEntityRecords(ye,ke,i,{id:i.id},!1),i},Ae=()=>async({select:e,dispatch:t,registry:r})=>{const i=e.getEditedWidgetAreas();if(i?.length)try{await t.saveWidgetAreas(i),r.dispatch(v.store).createSuccessNotice((0,y.__)("Widgets saved."),{type:"snackbar"})}catch(e){r.dispatch(v.store).createErrorNotice((0,y.sprintf)((0,y.__)("There was an error. %s"),e.message),{type:"snackbar"})}},Ie=e=>async({dispatch:t,registry:r})=>{try{for(const r of e)await t.saveWidgetArea(r.id)}finally{await r.dispatch(m.store).finishResolution("getEntityRecord",ye,ve,{per_page:-1})}},Ce=e=>async({dispatch:t,select:r,registry:i})=>{const s=r.getWidgets(),o=i.select(m.store).getEditedEntityRecord(ye,ke,je(e)),n=Object.values(s).filter((({sidebar:t})=>t===e)),a=[],c=o.blocks.filter((e=>{const{id:t}=e.attributes;if("core/legacy-widget"===e.name&&t){if(a.includes(t))return!1;a.push(t)}return!0})),d=[];for(const e of n){r.getWidgetAreaForWidgetId(e.id)||d.push(e)}const l=[],u=[],g=[];for(let t=0;t<c.length;t++){const r=c[t],o=(0,w.getWidgetIdFromBlock)(r),n=s[o],a=xe(r,n);if(g.push(o),n){i.dispatch(m.store).editEntityRecord("root","widget",o,{...a,sidebar:e},{undoIgnore:!0});if(!i.select(m.store).hasEditsForEntityRecord("root","widget",o))continue;u.push((({saveEditedEntityRecord:e})=>e("root","widget",o)))}else u.push((({saveEntityRecord:t})=>t("root","widget",{...a,sidebar:e})));l.push({block:r,position:t,clientId:r.clientId})}for(const e of d)u.push((({deleteEntityRecord:t})=>t("root","widget",e.id,{force:!0})));const p=(await i.dispatch(m.store).__experimentalBatch(u)).filter((e=>!e.hasOwnProperty("deleted"))),h=[];for(let e=0;e<p.length;e++){const t=p[e],{block:r,position:s}=l[e];o.blocks[s].attributes.__internalWidgetId=t.id;i.select(m.store).getLastEntitySaveError("root","widget",t.id)&&h.push(r.attributes?.name||r?.name),g[s]||(g[s]=t.id)}if(h.length)throw new Error((0,y.sprintf)((0,y.__)("Could not save the following widgets: %s."),h.join(", ")));i.dispatch(m.store).editEntityRecord(ye,ve,e,{widgets:g},{undoIgnore:!0}),t(Ne(e)),i.dispatch(m.store).receiveEntityRecords(ye,ke,o,void 0)},Ne=e=>({registry:t})=>{t.dispatch(m.store).saveEditedEntityRecord(ye,ve,e,{throwOnError:!0})};function Be(e,t){return{type:"SET_WIDGET_ID_FOR_CLIENT_ID",clientId:e,widgetId:t}}function Te(e){return{type:"SET_WIDGET_AREAS_OPEN_STATE",widgetAreasOpenState:e}}function Le(e,t){return{type:"SET_IS_WIDGET_AREA_OPEN",clientId:e,isOpen:t}}function Re(e){return{type:"SET_IS_INSERTER_OPENED",value:e}}function We(e){return{type:"SET_IS_LIST_VIEW_OPENED",isOpen:e}}const Pe=()=>({registry:e})=>{e.dispatch(X).disableComplementaryArea(Se)},Me=(e,t)=>async({dispatch:r,select:i,registry:s})=>{const o=s.select(be.store).getBlockRootClientId(e),n=s.select(be.store).getBlocks().find((({attributes:e})=>e.id===t)).clientId,a=s.select(be.store).getBlockOrder(n).length;i.getIsWidgetAreaOpen(n)||r.setIsWidgetAreaOpen(n,!0),s.dispatch(be.store).moveBlocksToPosition([e],o,n,a)},Oe=()=>async({dispatch:e,registry:t})=>{const r={per_page:-1},i=[],s=(await t.resolveSelect(m.store).getEntityRecords(ye,ve,r)).sort(((e,t)=>"wp_inactive_widgets"===e.id?1:"wp_inactive_widgets"===t.id?-1:0));for(const t of s)i.push((0,d.createBlock)("core/widget-area",{id:t.id,name:t.name})),t.widgets.length||e(Ee(je(t.id),[]));const o={};i.forEach(((e,t)=>{o[e.clientId]=0===t})),e(Te(o)),e(Ee("widget-areas",i))},Ve=()=>async({dispatch:e,registry:t})=>{const r={per_page:-1,_embed:"about"},i=await t.resolveSelect(m.store).getEntityRecords("root","widget",r),s={};for(const e of i){const t=fe(e);s[e.sidebar]=s[e.sidebar]||[],s[e.sidebar].push(t)}for(const t in s)s.hasOwnProperty(t)&&e(Ee(je(t),s[t]))},De={rootClientId:void 0,insertionIndex:void 0},Fe=(0,l.createRegistrySelector)((e=>(0,l.createSelector)((()=>{var t;const r=e(m.store).getEntityRecords("root","widget",{per_page:-1,_embed:"about"});return null!==(t=r?.reduce(((e,t)=>({...e,[t.id]:t})),{}))&&void 0!==t?t:{}}),(()=>[e(m.store).getEntityRecords("root","widget",{per_page:-1,_embed:"about"})])))),Ge=(0,l.createRegistrySelector)((e=>(t,r)=>e(Se).getWidgets()[r])),ze=(0,l.createRegistrySelector)((e=>()=>{const t={per_page:-1};return e(m.store).getEntityRecords(ye,ve,t)})),He=(0,l.createRegistrySelector)((e=>(t,r)=>e(Se).getWidgetAreas().find((t=>e(m.store).getEditedEntityRecord(ye,ke,je(t.id)).blocks.map((e=>(0,w.getWidgetIdFromBlock)(e))).includes(r))))),Ue=(0,l.createRegistrySelector)((e=>(t,r)=>{const{getBlock:i,getBlockName:s,getBlockParents:o}=e(be.store);return i(o(r).find((e=>"core/widget-area"===s(e))))})),$e=(0,l.createRegistrySelector)((e=>(t,r)=>{let i=e(Se).getWidgetAreas();return i?(r&&(i=i.filter((({id:e})=>r.includes(e)))),i.filter((({id:t})=>e(m.store).hasEditsForEntityRecord(ye,ke,je(t)))).map((({id:t})=>e(m.store).getEditedEntityRecord(ye,ve,t)))):[]})),Ye=(0,l.createRegistrySelector)((e=>(t,r=null)=>{const i=[],s=e(Se).getWidgetAreas();for(const t of s){const s=e(m.store).getEditedEntityRecord(ye,ke,je(t.id));for(const e of s.blocks)"core/legacy-widget"!==e.name||r&&e.attributes?.referenceWidgetName!==r||i.push(e)}return i})),Ze=(0,l.createRegistrySelector)((e=>()=>{const t=e(Se).getWidgetAreas()?.map((({id:e})=>e));if(!t)return!1;for(const r of t){if(e(m.store).isSavingEntityRecord(ye,ve,r))return!0}const r=[...Object.keys(e(Se).getWidgets()),void 0];for(const t of r){if(e(m.store).isSavingEntityRecord("root","widget",t))return!0}return!1})),Ke=(e,t)=>{const{widgetAreasOpenState:r}=e;return!!r[t]};function qe(e){return!!e.blockInserterPanel}function Je(e){return"boolean"==typeof e.blockInserterPanel?De:e.blockInserterPanel}const Qe=(0,l.createRegistrySelector)((e=>(t,r)=>{const i=e(be.store).getBlocks(),[s]=i;return e(be.store).canInsertBlockType(r,s.clientId)}));function Xe(e){return e.listViewPanel}function et(e){return e.listViewToggleRef}function tt(e){return e.inserterSidebarToggleRef}const rt=window.wp.privateApis,{lock:it,unlock:st}=(0,rt.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/edit-widgets"),ot={reducer:x,selectors:n,resolvers:o,actions:s},nt=(0,l.createReduxStore)(Se,ot);(0,l.register)(nt),f().use((function(e,t){return 0===e.path?.indexOf("/wp/v2/types/widget-area")?Promise.resolve({}):t(e)})),st(nt).registerPrivateSelectors(a);const at=window.wp.hooks,ct=(0,T.createHigherOrderComponent)((e=>t=>{const{clientId:r,name:i}=t,{widgetAreas:s,currentWidgetAreaId:o,canInsertBlockInWidgetArea:n}=(0,l.useSelect)((e=>{if("core/widget-area"===i)return{};const t=e(nt),s=t.getParentWidgetAreaBlock(r);return{widgetAreas:t.getWidgetAreas(),currentWidgetAreaId:s?.attributes?.id,canInsertBlockInWidgetArea:t.canInsertBlockInWidgetArea(i)}}),[r,i]),{moveBlockToWidgetArea:a}=(0,l.useDispatch)(nt),c="core/widget-area"!==i&&s?.length>1&&n;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(e,{...t},"edit"),c&&(0,A.jsx)(be.BlockControls,{children:(0,A.jsx)(w.MoveToWidgetArea,{widgetAreas:s,currentWidgetAreaId:o,onSelect:e=>{a(t.clientId,e)}})})]})}),"withMoveToWidgetAreaToolbarItem");(0,at.addFilter)("editor.BlockEdit","core/edit-widgets/block-edit",ct);const dt=window.wp.mediaUtils;(0,at.addFilter)("editor.MediaUpload","core/edit-widgets/replace-media-upload",(()=>dt.MediaUpload));const lt=e=>{const[t,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const{ownerDocument:t}=e.current;function i(e){o(e)}function s(){r(!1)}function o(t){e.current.contains(t.target)?r(!0):r(!1)}return t.addEventListener("dragstart",i),t.addEventListener("dragend",s),t.addEventListener("dragenter",o),()=>{t.removeEventListener("dragstart",i),t.removeEventListener("dragend",s),t.removeEventListener("dragenter",o)}}),[]),t};function ut({id:e}){const[t,r,i]=(0,m.useEntityBlockEditor)("root","postType"),s=(0,p.useRef)(),o=lt(s),n=(0,be.useInnerBlocksProps)({ref:s},{value:t,onInput:r,onChange:i,templateLock:!1,renderAppender:be.InnerBlocks.ButtonBlockAppender});return(0,A.jsx)("div",{"data-widget-area-id":e,className:j("wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper",{"wp-block-widget-area__highlight-drop-zone":o}),children:(0,A.jsx)("div",{...n})})}const gt=e=>{const[t,r]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{const{ownerDocument:t}=e.current;function i(){r(!0)}function s(){r(!1)}return t.addEventListener("dragstart",i),t.addEventListener("dragend",s),()=>{t.removeEventListener("dragstart",i),t.removeEventListener("dragend",s)}}),[]),t},pt={$schema:"https://schemas.wp.org/trunk/block.json",name:"core/widget-area",title:"Widget Area",category:"widgets",attributes:{id:{type:"string"},name:{type:"string"}},supports:{html:!1,inserter:!1,customClassName:!1,reusable:!1,__experimentalToolbar:!1,__experimentalParentSelector:!1,__experimentalDisableBlockOverlay:!0},editorStyle:"wp-block-widget-area-editor",style:"wp-block-widget-area"},{name:ht}=pt,mt={title:(0,y.__)("Widget Area"),description:(0,y.__)("A widget area container."),__experimentalLabel:({name:e})=>e,edit:function({clientId:e,className:t,attributes:{id:r,name:i}}){const s=(0,l.useSelect)((t=>t(nt).getIsWidgetAreaOpen(e)),[e]),{setIsWidgetAreaOpen:o}=(0,l.useDispatch)(nt),n=(0,p.useRef)(),a=(0,p.useCallback)((t=>o(e,t)),[e]),c=gt(n),d=lt(n),[u,g]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{c?d&&!s?(a(!0),g(!0)):!d&&s&&u&&a(!1):g(!1)}),[s,c,d,u]),(0,A.jsx)(S.Panel,{className:t,ref:n,children:(0,A.jsx)(S.PanelBody,{title:i,opened:s,onToggle:()=>{o(e,!s)},scrollAfterOpen:!c,children:({opened:e})=>(0,A.jsx)(S.__unstableDisclosureContent,{className:"wp-block-widget-area__panel-body-content",visible:e,children:(0,A.jsx)(m.EntityProvider,{kind:"root",type:"postType",id:`widget-area-${r}`,children:(0,A.jsx)(ut,{id:r})})})})})}};function wt({text:e,children:t}){const r=(0,T.useCopyToClipboard)(e);return(0,A.jsx)(S.Button,{__next40pxDefaultSize:!0,variant:"secondary",ref:r,children:t})}function _t({message:e,error:t}){const r=[(0,A.jsx)(wt,{text:t.stack,children:(0,y.__)("Copy Error")},"copy-error")];return(0,A.jsx)(be.Warning,{className:"edit-widgets-error-boundary",actions:r,children:e})}class bt extends p.Component{constructor(){super(...arguments),this.state={error:null}}componentDidCatch(e){(0,at.doAction)("editor.ErrorBoundary.errorLogged",e)}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,A.jsx)(_t,{message:(0,y.__)("The editor has encountered an unexpected error."),error:this.state.error}):this.props.children}}const ft=window.wp.patterns,xt=window.wp.keyboardShortcuts,yt=window.wp.keycodes;function vt(){const{redo:e,undo:t}=(0,l.useDispatch)(m.store),{saveEditedWidgetAreas:r}=(0,l.useDispatch)(nt);return(0,xt.useShortcut)("core/edit-widgets/undo",(e=>{t(),e.preventDefault()})),(0,xt.useShortcut)("core/edit-widgets/redo",(t=>{e(),t.preventDefault()})),(0,xt.useShortcut)("core/edit-widgets/save",(e=>{e.preventDefault(),r()})),null}vt.Register=function(){const{registerShortcut:e}=(0,l.useDispatch)(xt.store);return(0,p.useEffect)((()=>{e({name:"core/edit-widgets/undo",category:"global",description:(0,y.__)("Undo your last changes."),keyCombination:{modifier:"primary",character:"z"}}),e({name:"core/edit-widgets/redo",category:"global",description:(0,y.__)("Redo your last undo."),keyCombination:{modifier:"primaryShift",character:"z"},aliases:(0,yt.isAppleOS)()?[]:[{modifier:"primary",character:"y"}]}),e({name:"core/edit-widgets/save",category:"global",description:(0,y.__)("Save your changes."),keyCombination:{modifier:"primary",character:"s"}}),e({name:"core/edit-widgets/keyboard-shortcuts",category:"main",description:(0,y.__)("Display these keyboard shortcuts."),keyCombination:{modifier:"access",character:"h"}}),e({name:"core/edit-widgets/next-region",category:"global",description:(0,y.__)("Navigate to the next part of the editor."),keyCombination:{modifier:"ctrl",character:"`"},aliases:[{modifier:"access",character:"n"}]}),e({name:"core/edit-widgets/previous-region",category:"global",description:(0,y.__)("Navigate to the previous part of the editor."),keyCombination:{modifier:"ctrlShift",character:"`"},aliases:[{modifier:"access",character:"p"},{modifier:"ctrlShift",character:"~"}]})}),[e]),null};const kt=vt,jt=()=>(0,l.useSelect)((e=>{const{getBlockSelectionEnd:t,getBlockName:r}=e(be.store),i=t();if("core/widget-area"===r(i))return i;const{getParentWidgetAreaBlock:s}=e(nt),o=s(i),n=o?.clientId;if(n)return n;const{getEntityRecord:a}=e(m.store),c=a(ye,ke,"widget-areas");return c?.blocks[0]?.clientId}),[]),{ExperimentalBlockEditorProvider:St}=st(be.privateApis),{PatternsMenuItems:Et}=st(ft.privateApis),{BlockKeyboardShortcuts:At}=st(h.privateApis),It=[];function Ct({blockEditorSettings:e,children:t,...r}){const i=(0,T.useViewportMatch)("medium"),{hasUploadPermissions:s,reusableBlocks:o,isFixedToolbarActive:n,keepCaretInsideBlock:a,pageOnFront:c,pageForPosts:d}=(0,l.useSelect)((e=>{var t;const{canUser:r,getEntityRecord:i,getEntityRecords:s}=e(m.store),o=r("read",{kind:"root",name:"site"})?i("root","site"):void 0;return{hasUploadPermissions:null===(t=r("create",{kind:"root",name:"media"}))||void 0===t||t,reusableBlocks:It,isFixedToolbarActive:!!e(_.store).get("core/edit-widgets","fixedToolbar"),keepCaretInsideBlock:!!e(_.store).get("core/edit-widgets","keepCaretInsideBlock"),pageOnFront:o?.page_on_front,pageForPosts:o?.page_for_posts}}),[]),{setIsInserterOpened:u}=(0,l.useDispatch)(nt),g=(0,p.useMemo)((()=>{let t;return s&&(t=({onError:t,...r})=>{(0,dt.uploadMedia)({wpAllowedMimeTypes:e.allowedMimeTypes,onError:({message:e})=>t(e),...r})}),{...e,__experimentalReusableBlocks:o,hasFixedToolbar:n||!i,keepCaretInsideBlock:a,mediaUpload:t,templateLock:"all",__experimentalSetIsInserterOpened:u,pageOnFront:c,pageForPosts:d,editorTool:"edit"}}),[s,e,n,i,a,o,u,c,d]),h=jt(),[w,b,f]=(0,m.useEntityBlockEditor)(ye,ke,{id:"widget-areas"});return(0,A.jsxs)(S.SlotFillProvider,{children:[(0,A.jsx)(kt.Register,{}),(0,A.jsx)(At,{}),(0,A.jsxs)(St,{value:w,onInput:b,onChange:f,settings:g,useSubRegistry:!1,...r,children:[t,(0,A.jsx)(Et,{rootClientId:h})]})]})}const Nt=(0,A.jsx)(E.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.5 18.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h2.5v13zm10-.5c0 .3-.2.5-.5.5h-8v-13h8c.3 0 .5.2.5.5v12z"})}),Bt=(0,A.jsx)(E.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})}),Tt=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})}),Lt=window.wp.url,Rt=window.wp.dom;function Wt({selectedWidgetAreaId:e}){const t=(0,l.useSelect)((e=>e(nt).getWidgetAreas()),[]),r=(0,p.useMemo)((()=>e&&t?.find((t=>t.id===e))),[e,t]);let i;return i=r?"wp_inactive_widgets"===e?(0,y.__)("Blocks in this Widget Area will not be displayed in your site."):r.description:(0,y.__)("Widget Areas are global parts in your site’s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer."),(0,A.jsx)("div",{className:"edit-widgets-widget-areas",children:(0,A.jsxs)("div",{className:"edit-widgets-widget-areas__top-container",children:[(0,A.jsx)(be.BlockIcon,{icon:Tt}),(0,A.jsxs)("div",{children:[(0,A.jsx)("p",{dangerouslySetInnerHTML:{__html:(0,Rt.safeHTML)(i)}}),0===t?.length&&(0,A.jsx)("p",{children:(0,y.__)("Your theme does not contain any Widget Areas.")}),!r&&(0,A.jsx)(S.Button,{__next40pxDefaultSize:!0,href:(0,Lt.addQueryArgs)("customize.php",{"autofocus[panel]":"widgets",return:window.location.pathname}),variant:"tertiary",children:(0,y.__)("Manage with live preview")})]})]})})}const Pt=p.Platform.select({web:!0,native:!1}),Mt="edit-widgets/block-inspector",Ot="edit-widgets/block-areas",{Tabs:Vt}=st(S.privateApis);function Dt({selectedWidgetAreaBlock:e}){return(0,A.jsxs)(Vt.TabList,{children:[(0,A.jsx)(Vt.Tab,{tabId:Ot,children:e?e.attributes.name:(0,y.__)("Widget Areas")}),(0,A.jsx)(Vt.Tab,{tabId:Mt,children:(0,y.__)("Block")})]})}function Ft({hasSelectedNonAreaBlock:e,currentArea:t,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i}){const{enableComplementaryArea:s}=(0,l.useDispatch)(X);(0,p.useEffect)((()=>{e&&t===Ot&&r&&s("core/edit-widgets",Mt),!e&&t===Mt&&r&&s("core/edit-widgets",Ot)}),[e,s]);const o=(0,p.useContext)(Vt.Context);return(0,A.jsx)(ge,{className:"edit-widgets-sidebar",header:(0,A.jsx)(Vt.Context.Provider,{value:o,children:(0,A.jsx)(Dt,{selectedWidgetAreaBlock:i})}),headerClassName:"edit-widgets-sidebar__panel-tabs",title:(0,y.__)("Settings"),closeLabel:(0,y.__)("Close Settings"),scope:"core/edit-widgets",identifier:t,icon:(0,y.isRTL)()?Nt:Bt,isActiveByDefault:Pt,children:(0,A.jsxs)(Vt.Context.Provider,{value:o,children:[(0,A.jsx)(Vt.TabPanel,{tabId:Ot,focusable:!1,children:(0,A.jsx)(Wt,{selectedWidgetAreaId:i?.attributes.id})}),(0,A.jsx)(Vt.TabPanel,{tabId:Mt,focusable:!1,children:e?(0,A.jsx)(be.BlockInspector,{}):(0,A.jsx)("span",{className:"block-editor-block-inspector__no-blocks",children:(0,y.__)("No block selected.")})})]})})}function Gt(){const{currentArea:e,hasSelectedNonAreaBlock:t,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i}=(0,l.useSelect)((e=>{const{getSelectedBlock:t,getBlock:r,getBlockParentsByBlockName:i}=e(be.store),{getActiveComplementaryArea:s}=e(X),o=t(),n=s(nt.name);let a,c=n;return c||(c=o?Mt:Ot),o&&(a="core/widget-area"===o.name?o:r(i(o.clientId,"core/widget-area")[0])),{currentArea:c,hasSelectedNonAreaBlock:!(!o||"core/widget-area"===o.name),isGeneralSidebarOpen:!!n,selectedWidgetAreaBlock:a}}),[]),{enableComplementaryArea:s}=(0,l.useDispatch)(X),o=(0,p.useCallback)((e=>{e&&s(nt.name,e)}),[s]);return(0,A.jsx)(Vt,{selectedTabId:r?e:null,onSelect:o,selectOnMove:!1,children:(0,A.jsx)(Ft,{hasSelectedNonAreaBlock:t,currentArea:e,isGeneralSidebarOpen:r,selectedWidgetAreaBlock:i})})}const zt=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"})}),Ht=(0,A.jsx)(E.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,A.jsx)(E.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"})}),Ut=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z"})}),$t=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z"})});const Yt=(0,p.forwardRef)((function(e,t){const r=(0,l.useSelect)((e=>e(m.store).hasUndo()),[]),{undo:i}=(0,l.useDispatch)(m.store);return(0,A.jsx)(S.Button,{...e,ref:t,icon:(0,y.isRTL)()?$t:Ut,label:(0,y.__)("Undo"),shortcut:yt.displayShortcut.primary("z"),"aria-disabled":!r,onClick:r?i:void 0,size:"compact"})}));const Zt=(0,p.forwardRef)((function(e,t){const r=(0,yt.isAppleOS)()?yt.displayShortcut.primaryShift("z"):yt.displayShortcut.primary("y"),i=(0,l.useSelect)((e=>e(m.store).hasRedo()),[]),{redo:s}=(0,l.useDispatch)(m.store);return(0,A.jsx)(S.Button,{...e,ref:t,icon:(0,y.isRTL)()?Ut:$t,label:(0,y.__)("Redo"),shortcut:r,"aria-disabled":!i,onClick:i?s:void 0,size:"compact"})}));const Kt=function(){const e=(0,T.useViewportMatch)("medium"),{isInserterOpen:t,isListViewOpen:r,inserterSidebarToggleRef:i,listViewToggleRef:s}=(0,l.useSelect)((e=>{const{isInserterOpened:t,getInserterSidebarToggleRef:r,isListViewOpened:i,getListViewToggleRef:s}=st(e(nt));return{isInserterOpen:t(),isListViewOpen:i(),inserterSidebarToggleRef:r(),listViewToggleRef:s()}}),[]),{setIsInserterOpened:o,setIsListViewOpened:n}=(0,l.useDispatch)(nt),a=(0,p.useCallback)((()=>n(!r)),[n,r]),c=(0,p.useCallback)((()=>o(!t)),[o,t]);return(0,A.jsxs)(be.NavigableToolbar,{className:"edit-widgets-header-toolbar","aria-label":(0,y.__)("Document tools"),variant:"unstyled",children:[(0,A.jsx)(S.ToolbarItem,{ref:i,as:S.Button,className:"edit-widgets-header-toolbar__inserter-toggle",variant:"primary",isPressed:t,onMouseDown:e=>{e.preventDefault()},onClick:c,icon:zt,label:(0,y._x)("Block Inserter","Generic label for block inserter button"),size:"compact"}),e&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(S.ToolbarItem,{as:Yt}),(0,A.jsx)(S.ToolbarItem,{as:Zt}),(0,A.jsx)(S.ToolbarItem,{as:S.Button,className:"edit-widgets-header-toolbar__list-view-toggle",icon:Ht,isPressed:r,label:(0,y.__)("List View"),onClick:a,ref:s,size:"compact"})]})]})};const qt=function(){const{hasEditedWidgetAreaIds:e,isSaving:t}=(0,l.useSelect)((e=>{const{getEditedWidgetAreas:t,isSavingWidgetAreas:r}=e(nt);return{hasEditedWidgetAreaIds:t()?.length>0,isSaving:r()}}),[]),{saveEditedWidgetAreas:r}=(0,l.useDispatch)(nt),i=t||!e;return(0,A.jsx)(S.Button,{variant:"primary",isBusy:t,"aria-disabled":i,onClick:i?void 0:r,size:"compact",children:t?(0,y.__)("Saving…"):(0,y.__)("Update")})},Jt=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),Qt=(0,A.jsx)(E.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,A.jsx)(E.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})}),Xt=[{keyCombination:{modifier:"primary",character:"b"},description:(0,y.__)("Make the selected text bold.")},{keyCombination:{modifier:"primary",character:"i"},description:(0,y.__)("Make the selected text italic.")},{keyCombination:{modifier:"primary",character:"k"},description:(0,y.__)("Convert the selected text into a link.")},{keyCombination:{modifier:"primaryShift",character:"k"},description:(0,y.__)("Remove a link.")},{keyCombination:{character:"[["},description:(0,y.__)("Insert a link to a post or page.")},{keyCombination:{modifier:"primary",character:"u"},description:(0,y.__)("Underline the selected text.")},{keyCombination:{modifier:"access",character:"d"},description:(0,y.__)("Strikethrough the selected text.")},{keyCombination:{modifier:"access",character:"x"},description:(0,y.__)("Make the selected text inline code.")},{keyCombination:{modifier:"access",character:"0"},aliases:[{modifier:"access",character:"7"}],description:(0,y.__)("Convert the current heading to a paragraph.")},{keyCombination:{modifier:"access",character:"1-6"},description:(0,y.__)("Convert the current paragraph or heading to a heading of level 1 to 6.")},{keyCombination:{modifier:"primaryShift",character:"SPACE"},description:(0,y.__)("Add non breaking space.")}];function er({keyCombination:e,forceAriaLabel:t}){const r=e.modifier?yt.displayShortcutList[e.modifier](e.character):e.character,i=e.modifier?yt.shortcutAriaLabel[e.modifier](e.character):e.character,s=Array.isArray(r)?r:[r];return(0,A.jsx)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination","aria-label":t||i,children:s.map(((e,t)=>"+"===e?(0,A.jsx)(p.Fragment,{children:e},t):(0,A.jsx)("kbd",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-key",children:e},t)))})}const tr=function({description:e,keyCombination:t,aliases:r=[],ariaLabel:i}){return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-description",children:e}),(0,A.jsxs)("div",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-term",children:[(0,A.jsx)(er,{keyCombination:t,forceAriaLabel:i}),r.map(((e,t)=>(0,A.jsx)(er,{keyCombination:e,forceAriaLabel:i},t)))]})]})};const rr=function({name:e}){const{keyCombination:t,description:r,aliases:i}=(0,l.useSelect)((t=>{const{getShortcutKeyCombination:r,getShortcutDescription:i,getShortcutAliases:s}=t(xt.store);return{keyCombination:r(e),aliases:s(e),description:i(e)}}),[e]);return t?(0,A.jsx)(tr,{keyCombination:t,description:r,aliases:i}):null},ir=({shortcuts:e})=>(0,A.jsx)("ul",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut-list",role:"list",children:e.map(((e,t)=>(0,A.jsx)("li",{className:"edit-widgets-keyboard-shortcut-help-modal__shortcut",children:"string"==typeof e?(0,A.jsx)(rr,{name:e}):(0,A.jsx)(tr,{...e})},t)))}),sr=({title:e,shortcuts:t,className:r})=>(0,A.jsxs)("section",{className:j("edit-widgets-keyboard-shortcut-help-modal__section",r),children:[!!e&&(0,A.jsx)("h2",{className:"edit-widgets-keyboard-shortcut-help-modal__section-title",children:e}),(0,A.jsx)(ir,{shortcuts:t})]}),or=({title:e,categoryName:t,additionalShortcuts:r=[]})=>{const i=(0,l.useSelect)((e=>e(xt.store).getCategoryShortcuts(t)),[t]);return(0,A.jsx)(sr,{title:e,shortcuts:i.concat(r)})};function nr({isModalActive:e,toggleModal:t}){return(0,xt.useShortcut)("core/edit-widgets/keyboard-shortcuts",t,{bindGlobal:!0}),e?(0,A.jsxs)(S.Modal,{className:"edit-widgets-keyboard-shortcut-help-modal",title:(0,y.__)("Keyboard shortcuts"),onRequestClose:t,children:[(0,A.jsx)(sr,{className:"edit-widgets-keyboard-shortcut-help-modal__main-shortcuts",shortcuts:["core/edit-widgets/keyboard-shortcuts"]}),(0,A.jsx)(or,{title:(0,y.__)("Global shortcuts"),categoryName:"global"}),(0,A.jsx)(or,{title:(0,y.__)("Selection shortcuts"),categoryName:"selection"}),(0,A.jsx)(or,{title:(0,y.__)("Block shortcuts"),categoryName:"block",additionalShortcuts:[{keyCombination:{character:"/"},description:(0,y.__)("Change the block type after adding a new paragraph."),ariaLabel:(0,y.__)("Forward-slash")}]}),(0,A.jsx)(sr,{title:(0,y.__)("Text formatting"),shortcuts:Xt}),(0,A.jsx)(or,{title:(0,y.__)("List View shortcuts"),categoryName:"list-view"})]}):null}const{Fill:ar,Slot:cr}=(0,S.createSlotFill)("EditWidgetsToolsMoreMenuGroup");ar.Slot=({fillProps:e})=>(0,A.jsx)(cr,{fillProps:e,children:e=>e.length>0&&e});const dr=ar;function lr(){const[e,t]=(0,p.useState)(!1),r=()=>t(!e);(0,xt.useShortcut)("core/edit-widgets/keyboard-shortcuts",r);const i=(0,T.useViewportMatch)("medium");return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(S.DropdownMenu,{icon:Jt,label:(0,y.__)("Options"),popoverProps:{placement:"bottom-end",className:"more-menu-dropdown__content"},toggleProps:{tooltipPosition:"bottom",size:"compact"},children:e=>(0,A.jsxs)(A.Fragment,{children:[i&&(0,A.jsx)(S.MenuGroup,{label:(0,y._x)("View","noun"),children:(0,A.jsx)(_.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"fixedToolbar",label:(0,y.__)("Top toolbar"),info:(0,y.__)("Access all block and document tools in a single place"),messageActivated:(0,y.__)("Top toolbar activated"),messageDeactivated:(0,y.__)("Top toolbar deactivated")})}),(0,A.jsxs)(S.MenuGroup,{label:(0,y.__)("Tools"),children:[(0,A.jsx)(S.MenuItem,{onClick:()=>{t(!0)},shortcut:yt.displayShortcut.access("h"),children:(0,y.__)("Keyboard shortcuts")}),(0,A.jsx)(_.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"welcomeGuide",label:(0,y.__)("Welcome Guide")}),(0,A.jsxs)(S.MenuItem,{role:"menuitem",icon:Qt,href:(0,y.__)("https://wordpress.org/documentation/article/block-based-widgets-editor/"),target:"_blank",rel:"noopener noreferrer",children:[(0,y.__)("Help"),(0,A.jsx)(S.VisuallyHidden,{as:"span",children:(0,y.__)("(opens in a new tab)")})]}),(0,A.jsx)(dr.Slot,{fillProps:{onClose:e}})]}),(0,A.jsxs)(S.MenuGroup,{label:(0,y.__)("Preferences"),children:[(0,A.jsx)(_.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"keepCaretInsideBlock",label:(0,y.__)("Contain text cursor inside block"),info:(0,y.__)("Aids screen readers by stopping text caret from leaving blocks."),messageActivated:(0,y.__)("Contain text cursor inside block activated"),messageDeactivated:(0,y.__)("Contain text cursor inside block deactivated")}),(0,A.jsx)(_.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"themeStyles",info:(0,y.__)("Make the editor look like your theme."),label:(0,y.__)("Use theme styles")}),i&&(0,A.jsx)(_.PreferenceToggleMenuItem,{scope:"core/edit-widgets",name:"showBlockBreadcrumbs",label:(0,y.__)("Display block breadcrumbs"),info:(0,y.__)("Shows block breadcrumbs at the bottom of the editor."),messageActivated:(0,y.__)("Display block breadcrumbs activated"),messageDeactivated:(0,y.__)("Display block breadcrumbs deactivated")})]})]})}),(0,A.jsx)(nr,{isModalActive:e,toggleModal:r})]})}const ur=function(){const e=(0,T.useViewportMatch)("medium"),t=(0,p.useRef)(),{hasFixedToolbar:r}=(0,l.useSelect)((e=>({hasFixedToolbar:!!e(_.store).get("core/edit-widgets","fixedToolbar")})),[]);return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)("div",{className:"edit-widgets-header",children:[(0,A.jsxs)("div",{className:"edit-widgets-header__navigable-toolbar-wrapper",children:[e&&(0,A.jsx)("h1",{className:"edit-widgets-header__title",children:(0,y.__)("Widgets")}),!e&&(0,A.jsx)(S.VisuallyHidden,{as:"h1",className:"edit-widgets-header__title",children:(0,y.__)("Widgets")}),(0,A.jsx)(Kt,{}),r&&e&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("div",{className:"selected-block-tools-wrapper",children:(0,A.jsx)(be.BlockToolbar,{hideDragHandle:!0})}),(0,A.jsx)(S.Popover.Slot,{ref:t,name:"block-toolbar"})]})]}),(0,A.jsxs)("div",{className:"edit-widgets-header__actions",children:[(0,A.jsx)(ce.Slot,{scope:"core/edit-widgets"}),(0,A.jsx)(qt,{}),(0,A.jsx)(lr,{})]})]})})};const gr=function(){const{removeNotice:e}=(0,l.useDispatch)(v.store),{notices:t}=(0,l.useSelect)((e=>({notices:e(v.store).getNotices()})),[]),r=t.filter((({isDismissible:e,type:t})=>e&&"default"===t)),i=t.filter((({isDismissible:e,type:t})=>!e&&"default"===t)),s=t.filter((({type:e})=>"snackbar"===e)).slice(-3);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(S.NoticeList,{notices:i,className:"edit-widgets-notices__pinned"}),(0,A.jsx)(S.NoticeList,{notices:r,className:"edit-widgets-notices__dismissible",onRemove:e}),(0,A.jsx)(S.SnackbarList,{notices:s,className:"edit-widgets-notices__snackbar",onRemove:e})]})};function pr({blockEditorSettings:e}){const t=(0,l.useSelect)((e=>!!e(_.store).get("core/edit-widgets","themeStyles")),[]),r=(0,T.useViewportMatch)("medium"),i=(0,p.useMemo)((()=>t?e.styles:[]),[e,t]);return(0,A.jsxs)("div",{className:"edit-widgets-block-editor",children:[(0,A.jsx)(gr,{}),!r&&(0,A.jsx)(be.BlockToolbar,{hideDragHandle:!0}),(0,A.jsxs)(be.BlockTools,{children:[(0,A.jsx)(kt,{}),(0,A.jsx)(be.__unstableEditorStyles,{styles:i,scope:":where(.editor-styles-wrapper)"}),(0,A.jsx)(be.BlockSelectionClearer,{children:(0,A.jsx)(be.WritingFlow,{children:(0,A.jsx)(be.BlockList,{className:"edit-widgets-main-block-list"})})})]})]})}const hr=()=>{const e=(0,l.useSelect)((e=>{const{getEntityRecord:t}=e(m.store),r=t(ye,ke,"widget-areas");return r?.blocks[0]?.clientId}),[]);return(0,l.useSelect)((t=>{const{getBlockRootClientId:r,getBlockSelectionEnd:i,getBlockOrder:s,getBlockIndex:o}=t(be.store),n=t(nt).__experimentalGetInsertionPoint();if(n.rootClientId)return n;const a=i()||e,c=r(a);return a&&""===c?{rootClientId:a,insertionIndex:s(a).length}:{rootClientId:c,insertionIndex:o(a)+1}}),[e])};function mr(){const e=(0,T.useViewportMatch)("medium","<"),{rootClientId:t,insertionIndex:r}=hr(),{setIsInserterOpened:i}=(0,l.useDispatch)(nt),s=(0,p.useCallback)((()=>i(!1)),[i]),[o,n]=(0,T.__experimentalUseDialog)({onClose:s,focusOnMount:!0}),a=(0,p.useRef)();return(0,A.jsx)("div",{ref:o,...n,className:"edit-widgets-layout__inserter-panel",children:(0,A.jsx)("div",{className:"edit-widgets-layout__inserter-panel-content",children:(0,A.jsx)(be.__experimentalLibrary,{showInserterHelpPanel:!0,shouldFocusBlock:e,rootClientId:t,__experimentalInsertionIndex:r,ref:a,onClose:s})})})}function wr(){const{setIsListViewOpened:e}=(0,l.useDispatch)(nt),{getListViewToggleRef:t}=st((0,l.useSelect)(nt)),[r,i]=(0,p.useState)(null),s=(0,T.useFocusOnMount)("firstElement"),o=(0,p.useCallback)((()=>{e(!1),t().current?.focus()}),[t,e]),n=(0,p.useCallback)((e=>{e.keyCode!==yt.ESCAPE||e.defaultPrevented||(e.preventDefault(),o())}),[o]);return(0,A.jsxs)("div",{className:"edit-widgets-editor__list-view-panel",onKeyDown:n,children:[(0,A.jsxs)("div",{className:"edit-widgets-editor__list-view-panel-header",children:[(0,A.jsx)("strong",{children:(0,y.__)("List View")}),(0,A.jsx)(S.Button,{icon:R,label:(0,y.__)("Close"),onClick:o,size:"compact"})]}),(0,A.jsx)("div",{className:"edit-widgets-editor__list-view-panel-content",ref:(0,T.useMergeRefs)([s,i]),children:(0,A.jsx)(be.__experimentalListView,{dropZoneElement:r})})]})}function _r(){const{isInserterOpen:e,isListViewOpen:t}=(0,l.useSelect)((e=>{const{isInserterOpened:t,isListViewOpened:r}=e(nt);return{isInserterOpen:t(),isListViewOpen:r()}}),[]);return e?(0,A.jsx)(mr,{}):t?(0,A.jsx)(wr,{}):null}const br={header:(0,y.__)("Widgets top bar"),body:(0,y.__)("Widgets and blocks"),sidebar:(0,y.__)("Widgets settings"),footer:(0,y.__)("Widgets footer")};const fr=function({blockEditorSettings:e}){const t=(0,T.useViewportMatch)("medium","<"),r=(0,T.useViewportMatch)("huge",">="),{setIsInserterOpened:i,setIsListViewOpened:s,closeGeneralSidebar:o}=(0,l.useDispatch)(nt),{hasBlockBreadCrumbsEnabled:n,hasSidebarEnabled:a,isInserterOpened:c,isListViewOpened:d}=(0,l.useSelect)((e=>({hasSidebarEnabled:!!e(X).getActiveComplementaryArea(nt.name),isInserterOpened:!!e(nt).isInserterOpened(),isListViewOpened:!!e(nt).isListViewOpened(),hasBlockBreadCrumbsEnabled:!!e(_.store).get("core/edit-widgets","showBlockBreadcrumbs")})),[]);(0,p.useEffect)((()=>{a&&!r&&(i(!1),s(!1))}),[a,r]),(0,p.useEffect)((()=>{!c&&!d||r||o()}),[c,d,r]);const u=d?(0,y.__)("List View"):(0,y.__)("Block Library"),g=d||c;return(0,A.jsx)(_e,{labels:{...br,secondarySidebar:u},header:(0,A.jsx)(ur,{}),secondarySidebar:g&&(0,A.jsx)(_r,{}),sidebar:(0,A.jsx)(ge.Slot,{scope:"core/edit-widgets"}),content:(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(pr,{blockEditorSettings:e})}),footer:n&&!t&&(0,A.jsx)("div",{className:"edit-widgets-layout__footer",children:(0,A.jsx)(be.BlockBreadcrumb,{rootLabelText:(0,y.__)("Widgets")})})})};function xr(){const e=(0,l.useSelect)((e=>{const{getEditedWidgetAreas:t}=e(nt),r=t();return r?.length>0}),[]);return(0,p.useEffect)((()=>{const t=t=>{if(e)return t.returnValue=(0,y.__)("You have unsaved changes. If you proceed, they will be lost."),t.returnValue};return window.addEventListener("beforeunload",t),()=>{window.removeEventListener("beforeunload",t)}}),[e]),null}function yr(){var e;const t=(0,l.useSelect)((e=>!!e(_.store).get("core/edit-widgets","welcomeGuide")),[]),{toggle:r}=(0,l.useDispatch)(_.store),i=(0,l.useSelect)((e=>e(nt).getWidgetAreas({per_page:-1})),[]);if(!t)return null;const s=i?.every((e=>"wp_inactive_widgets"===e.id||e.widgets.every((e=>e.startsWith("block-"))))),o=null!==(e=i?.filter((e=>"wp_inactive_widgets"!==e.id)).length)&&void 0!==e?e:0;return(0,A.jsx)(S.Guide,{className:"edit-widgets-welcome-guide",contentLabel:(0,y.__)("Welcome to block Widgets"),finishButtonText:(0,y.__)("Get started"),onFinish:()=>r("core/edit-widgets","welcomeGuide"),pages:[{image:(0,A.jsx)(vr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-canvas.gif"}),content:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Welcome to block Widgets")}),s?(0,A.jsx)(A.Fragment,{children:(0,A.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.sprintf)((0,y._n)("Your theme provides %s “block” area for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.","Your theme provides %s different “block” areas for you to add and edit content. Try adding a search bar, social icons, or other types of blocks here and see how they’ll look on your site.",o),o)})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.__)("You can now add any block to your site’s widget areas. Don’t worry, all of your favorite widgets still work flawlessly.")}),(0,A.jsxs)("p",{className:"edit-widgets-welcome-guide__text",children:[(0,A.jsx)("strong",{children:(0,y.__)("Want to stick with the old widgets?")})," ",(0,A.jsx)(S.ExternalLink,{href:(0,y.__)("https://wordpress.org/plugins/classic-widgets/"),children:(0,y.__)("Get the Classic Widgets plugin.")})]})]})]})},{image:(0,A.jsx)(vr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-editor.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-editor.gif"}),content:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Customize each block")}),(0,A.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,y.__)("Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.")})]})},{image:(0,A.jsx)(vr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-library.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-library.gif"}),content:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Explore all blocks")}),(0,A.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,p.createInterpolateElement)((0,y.__)("All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon."),{InserterIconImage:(0,A.jsx)("img",{className:"edit-widgets-welcome-guide__inserter-icon",alt:(0,y.__)("inserter"),src:"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A"})})})]})},{image:(0,A.jsx)(vr,{nonAnimatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.svg",animatedSrc:"https://s.w.org/images/block-editor/welcome-documentation.gif"}),content:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)("h1",{className:"edit-widgets-welcome-guide__heading",children:(0,y.__)("Learn more")}),(0,A.jsx)("p",{className:"edit-widgets-welcome-guide__text",children:(0,p.createInterpolateElement)((0,y.__)("New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>"),{a:(0,A.jsx)(S.ExternalLink,{href:(0,y.__)("https://wordpress.org/documentation/article/wordpress-block-editor/")})})})]})}]})}function vr({nonAnimatedSrc:e,animatedSrc:t}){return(0,A.jsxs)("picture",{className:"edit-widgets-welcome-guide__image",children:[(0,A.jsx)("source",{srcSet:e,media:"(prefers-reduced-motion: reduce)"}),(0,A.jsx)("img",{src:t,width:"312",height:"240",alt:""})]})}const kr=function({blockEditorSettings:e}){const{createErrorNotice:t}=(0,l.useDispatch)(v.store),r=(0,S.__unstableUseNavigateRegions)();return(0,A.jsx)(bt,{children:(0,A.jsx)("div",{className:r.className,...r,ref:r.ref,children:(0,A.jsxs)(Ct,{blockEditorSettings:e,children:[(0,A.jsx)(fr,{blockEditorSettings:e}),(0,A.jsx)(Gt,{}),(0,A.jsx)(L.PluginArea,{onError:function(e){t((0,y.sprintf)((0,y.__)('The "%s" plugin has encountered an error and cannot be rendered.'),e))}}),(0,A.jsx)(xr,{}),(0,A.jsx)(yr,{})]})})})},jr=["core/more","core/freeform","core/template-part","core/block"];function Sr(e,t){const r=document.getElementById(e),i=(0,p.createRoot)(r),s=(0,h.__experimentalGetCoreBlocks)().filter((e=>!(jr.includes(e.name)||e.name.startsWith("core/post")||e.name.startsWith("core/query")||e.name.startsWith("core/site")||e.name.startsWith("core/navigation"))));return(0,l.dispatch)(_.store).setDefaults("core/edit-widgets",{fixedToolbar:!1,welcomeGuide:!0,showBlockBreadcrumbs:!0,themeStyles:!0}),(0,l.dispatch)(d.store).reapplyBlockTypeFilters(),(0,h.registerCoreBlocks)(s),(0,w.registerLegacyWidgetBlock)(),(0,w.registerLegacyWidgetVariations)(t),Ir(c),(0,w.registerWidgetGroupBlock)(),t.__experimentalFetchLinkSuggestions=(e,r)=>(0,m.__experimentalFetchLinkSuggestions)(e,r,t),(0,d.setFreeformContentHandlerName)("core/html"),i.render((0,A.jsx)(p.StrictMode,{children:(0,A.jsx)(kr,{blockEditorSettings:t})})),i}const Er=Sr;function Ar(){g()("wp.editWidgets.reinitializeEditor",{since:"6.2",version:"6.3"})}const Ir=e=>{if(!e)return;const{metadata:t,settings:r,name:i}=e;t&&(0,d.unstable__bootstrapServerSideBlockDefinitions)({[i]:t}),(0,d.registerBlockType)(i,r)};(window.wp=window.wp||{}).editWidgets=t})(); wordcount.min.js 0000644 00000004660 15013651111 0007710 0 ustar 00 /*! This file is auto-generated */ (()=>{"use strict";var e={d:(n,r)=>{for(var t in r)e.o(r,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:r[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{count:()=>d});const r={HTMLRegExp:/<\/?[a-z][^>]*?>/gi,HTMLcommentRegExp:/<!--[\s\S]*?-->/g,spaceRegExp:/ | /gi,HTMLEntityRegExp:/&\S+?;/g,connectorRegExp:/--|\u2014/g,removeRegExp:new RegExp(["[","!-/:-@[-`{-~","-¿×÷"," -⯿","⸀-","]"].join(""),"g"),astralRegExp:/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,wordsRegExp:/\S\s+/g,characters_excluding_spacesRegExp:/\S/g,characters_including_spacesRegExp:/[^\f\n\r\t\v\u00AD\u2028\u2029]/g,l10n:{type:"words"}};function t(e,n){return n.replace(e.HTMLRegExp,"\n")}function c(e,n){return n.replace(e.astralRegExp,"a")}function o(e,n){return n.replace(e.HTMLEntityRegExp,"")}function u(e,n){return n.replace(e.connectorRegExp," ")}function l(e,n){return n.replace(e.removeRegExp,"")}function s(e,n){return n.replace(e.HTMLcommentRegExp,"")}function a(e,n){return e.shortcodesRegExp?n.replace(e.shortcodesRegExp,"\n"):n}function p(e,n){return n.replace(e.spaceRegExp," ")}function i(e,n){return n.replace(e.HTMLEntityRegExp,"a")}function g(e,n,r){var o;return e=[t.bind(null,r),s.bind(null,r),a.bind(null,r),c.bind(null,r),p.bind(null,r),i.bind(null,r)].reduce(((e,n)=>n(e)),e),e+="\n",null!==(o=e.match(n)?.length)&&void 0!==o?o:0}function d(e,n,c){const i=function(e,n){var t;const c=Object.assign({},r,n);return c.shortcodes=null!==(t=c.l10n?.shortcodes)&&void 0!==t?t:[],c.shortcodes&&c.shortcodes.length&&(c.shortcodesRegExp=new RegExp("\\[\\/?(?:"+c.shortcodes.join("|")+")[^\\]]*?\\]","g")),c.type=e,"characters_excluding_spaces"!==c.type&&"characters_including_spaces"!==c.type&&(c.type="words"),c}(n,c);let d;switch(i.type){case"words":return d=i.wordsRegExp,function(e,n,r){var c;return e=[t.bind(null,r),s.bind(null,r),a.bind(null,r),p.bind(null,r),o.bind(null,r),u.bind(null,r),l.bind(null,r)].reduce(((e,n)=>n(e)),e),e+="\n",null!==(c=e.match(n)?.length)&&void 0!==c?c:0}(e,d,i);case"characters_including_spaces":return d=i.characters_including_spacesRegExp,g(e,d,i);case"characters_excluding_spaces":return d=i.characters_excluding_spacesRegExp,g(e,d,i);default:return 0}}(window.wp=window.wp||{}).wordcount=n})(); block-library.js 0000644 00010404601 15013651111 0007636 0 ustar 00 /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 2321: /***/ ((module) => { /** * Checks if the block is experimental based on the metadata loaded * from block.json. * * This function is in a separate file and uses the older JS syntax so * that it can be imported in both: * – block-library/src/index.js * – block-library/src/babel-plugin.js * * @param {Object} metadata Parsed block.json metadata. * @return {boolean} Is the block experimental? */ module.exports = function isBlockMetadataExperimental(metadata) { return metadata && '__experimental' in metadata && metadata.__experimental !== false; }; /***/ }), /***/ 7734: /***/ ((module) => { "use strict"; // do not edit .js files directly - edit src/index.jst var envHasBigInt64Array = typeof BigInt64Array !== 'undefined'; module.exports = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if ((a instanceof Map) && (b instanceof Map)) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; for (i of a.entries()) if (!equal(i[1], b.get(i[0]))) return false; return true; } if ((a instanceof Set) && (b instanceof Set)) { if (a.size !== b.size) return false; for (i of a.entries()) if (!b.has(i[0])) return false; return true; } if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (a[i] !== b[i]) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } // true if both NaN, false otherwise return a!==a && b!==b; }; /***/ }), /***/ 9681: /***/ ((module) => { var characterMap = { "À": "A", "Á": "A", "Â": "A", "Ã": "A", "Ä": "A", "Å": "A", "Ấ": "A", "Ắ": "A", "Ẳ": "A", "Ẵ": "A", "Ặ": "A", "Æ": "AE", "Ầ": "A", "Ằ": "A", "Ȃ": "A", "Ả": "A", "Ạ": "A", "Ẩ": "A", "Ẫ": "A", "Ậ": "A", "Ç": "C", "Ḉ": "C", "È": "E", "É": "E", "Ê": "E", "Ë": "E", "Ế": "E", "Ḗ": "E", "Ề": "E", "Ḕ": "E", "Ḝ": "E", "Ȇ": "E", "Ẻ": "E", "Ẽ": "E", "Ẹ": "E", "Ể": "E", "Ễ": "E", "Ệ": "E", "Ì": "I", "Í": "I", "Î": "I", "Ï": "I", "Ḯ": "I", "Ȋ": "I", "Ỉ": "I", "Ị": "I", "Ð": "D", "Ñ": "N", "Ò": "O", "Ó": "O", "Ô": "O", "Õ": "O", "Ö": "O", "Ø": "O", "Ố": "O", "Ṍ": "O", "Ṓ": "O", "Ȏ": "O", "Ỏ": "O", "Ọ": "O", "Ổ": "O", "Ỗ": "O", "Ộ": "O", "Ờ": "O", "Ở": "O", "Ỡ": "O", "Ớ": "O", "Ợ": "O", "Ù": "U", "Ú": "U", "Û": "U", "Ü": "U", "Ủ": "U", "Ụ": "U", "Ử": "U", "Ữ": "U", "Ự": "U", "Ý": "Y", "à": "a", "á": "a", "â": "a", "ã": "a", "ä": "a", "å": "a", "ấ": "a", "ắ": "a", "ẳ": "a", "ẵ": "a", "ặ": "a", "æ": "ae", "ầ": "a", "ằ": "a", "ȃ": "a", "ả": "a", "ạ": "a", "ẩ": "a", "ẫ": "a", "ậ": "a", "ç": "c", "ḉ": "c", "è": "e", "é": "e", "ê": "e", "ë": "e", "ế": "e", "ḗ": "e", "ề": "e", "ḕ": "e", "ḝ": "e", "ȇ": "e", "ẻ": "e", "ẽ": "e", "ẹ": "e", "ể": "e", "ễ": "e", "ệ": "e", "ì": "i", "í": "i", "î": "i", "ï": "i", "ḯ": "i", "ȋ": "i", "ỉ": "i", "ị": "i", "ð": "d", "ñ": "n", "ò": "o", "ó": "o", "ô": "o", "õ": "o", "ö": "o", "ø": "o", "ố": "o", "ṍ": "o", "ṓ": "o", "ȏ": "o", "ỏ": "o", "ọ": "o", "ổ": "o", "ỗ": "o", "ộ": "o", "ờ": "o", "ở": "o", "ỡ": "o", "ớ": "o", "ợ": "o", "ù": "u", "ú": "u", "û": "u", "ü": "u", "ủ": "u", "ụ": "u", "ử": "u", "ữ": "u", "ự": "u", "ý": "y", "ÿ": "y", "Ā": "A", "ā": "a", "Ă": "A", "ă": "a", "Ą": "A", "ą": "a", "Ć": "C", "ć": "c", "Ĉ": "C", "ĉ": "c", "Ċ": "C", "ċ": "c", "Č": "C", "č": "c", "C̆": "C", "c̆": "c", "Ď": "D", "ď": "d", "Đ": "D", "đ": "d", "Ē": "E", "ē": "e", "Ĕ": "E", "ĕ": "e", "Ė": "E", "ė": "e", "Ę": "E", "ę": "e", "Ě": "E", "ě": "e", "Ĝ": "G", "Ǵ": "G", "ĝ": "g", "ǵ": "g", "Ğ": "G", "ğ": "g", "Ġ": "G", "ġ": "g", "Ģ": "G", "ģ": "g", "Ĥ": "H", "ĥ": "h", "Ħ": "H", "ħ": "h", "Ḫ": "H", "ḫ": "h", "Ĩ": "I", "ĩ": "i", "Ī": "I", "ī": "i", "Ĭ": "I", "ĭ": "i", "Į": "I", "į": "i", "İ": "I", "ı": "i", "IJ": "IJ", "ij": "ij", "Ĵ": "J", "ĵ": "j", "Ķ": "K", "ķ": "k", "Ḱ": "K", "ḱ": "k", "K̆": "K", "k̆": "k", "Ĺ": "L", "ĺ": "l", "Ļ": "L", "ļ": "l", "Ľ": "L", "ľ": "l", "Ŀ": "L", "ŀ": "l", "Ł": "l", "ł": "l", "Ḿ": "M", "ḿ": "m", "M̆": "M", "m̆": "m", "Ń": "N", "ń": "n", "Ņ": "N", "ņ": "n", "Ň": "N", "ň": "n", "ʼn": "n", "N̆": "N", "n̆": "n", "Ō": "O", "ō": "o", "Ŏ": "O", "ŏ": "o", "Ő": "O", "ő": "o", "Œ": "OE", "œ": "oe", "P̆": "P", "p̆": "p", "Ŕ": "R", "ŕ": "r", "Ŗ": "R", "ŗ": "r", "Ř": "R", "ř": "r", "R̆": "R", "r̆": "r", "Ȓ": "R", "ȓ": "r", "Ś": "S", "ś": "s", "Ŝ": "S", "ŝ": "s", "Ş": "S", "Ș": "S", "ș": "s", "ş": "s", "Š": "S", "š": "s", "Ţ": "T", "ţ": "t", "ț": "t", "Ț": "T", "Ť": "T", "ť": "t", "Ŧ": "T", "ŧ": "t", "T̆": "T", "t̆": "t", "Ũ": "U", "ũ": "u", "Ū": "U", "ū": "u", "Ŭ": "U", "ŭ": "u", "Ů": "U", "ů": "u", "Ű": "U", "ű": "u", "Ų": "U", "ų": "u", "Ȗ": "U", "ȗ": "u", "V̆": "V", "v̆": "v", "Ŵ": "W", "ŵ": "w", "Ẃ": "W", "ẃ": "w", "X̆": "X", "x̆": "x", "Ŷ": "Y", "ŷ": "y", "Ÿ": "Y", "Y̆": "Y", "y̆": "y", "Ź": "Z", "ź": "z", "Ż": "Z", "ż": "z", "Ž": "Z", "ž": "z", "ſ": "s", "ƒ": "f", "Ơ": "O", "ơ": "o", "Ư": "U", "ư": "u", "Ǎ": "A", "ǎ": "a", "Ǐ": "I", "ǐ": "i", "Ǒ": "O", "ǒ": "o", "Ǔ": "U", "ǔ": "u", "Ǖ": "U", "ǖ": "u", "Ǘ": "U", "ǘ": "u", "Ǚ": "U", "ǚ": "u", "Ǜ": "U", "ǜ": "u", "Ứ": "U", "ứ": "u", "Ṹ": "U", "ṹ": "u", "Ǻ": "A", "ǻ": "a", "Ǽ": "AE", "ǽ": "ae", "Ǿ": "O", "ǿ": "o", "Þ": "TH", "þ": "th", "Ṕ": "P", "ṕ": "p", "Ṥ": "S", "ṥ": "s", "X́": "X", "x́": "x", "Ѓ": "Г", "ѓ": "г", "Ќ": "К", "ќ": "к", "A̋": "A", "a̋": "a", "E̋": "E", "e̋": "e", "I̋": "I", "i̋": "i", "Ǹ": "N", "ǹ": "n", "Ồ": "O", "ồ": "o", "Ṑ": "O", "ṑ": "o", "Ừ": "U", "ừ": "u", "Ẁ": "W", "ẁ": "w", "Ỳ": "Y", "ỳ": "y", "Ȁ": "A", "ȁ": "a", "Ȅ": "E", "ȅ": "e", "Ȉ": "I", "ȉ": "i", "Ȍ": "O", "ȍ": "o", "Ȑ": "R", "ȑ": "r", "Ȕ": "U", "ȕ": "u", "B̌": "B", "b̌": "b", "Č̣": "C", "č̣": "c", "Ê̌": "E", "ê̌": "e", "F̌": "F", "f̌": "f", "Ǧ": "G", "ǧ": "g", "Ȟ": "H", "ȟ": "h", "J̌": "J", "ǰ": "j", "Ǩ": "K", "ǩ": "k", "M̌": "M", "m̌": "m", "P̌": "P", "p̌": "p", "Q̌": "Q", "q̌": "q", "Ř̩": "R", "ř̩": "r", "Ṧ": "S", "ṧ": "s", "V̌": "V", "v̌": "v", "W̌": "W", "w̌": "w", "X̌": "X", "x̌": "x", "Y̌": "Y", "y̌": "y", "A̧": "A", "a̧": "a", "B̧": "B", "b̧": "b", "Ḑ": "D", "ḑ": "d", "Ȩ": "E", "ȩ": "e", "Ɛ̧": "E", "ɛ̧": "e", "Ḩ": "H", "ḩ": "h", "I̧": "I", "i̧": "i", "Ɨ̧": "I", "ɨ̧": "i", "M̧": "M", "m̧": "m", "O̧": "O", "o̧": "o", "Q̧": "Q", "q̧": "q", "U̧": "U", "u̧": "u", "X̧": "X", "x̧": "x", "Z̧": "Z", "z̧": "z", "й":"и", "Й":"И", "ё":"е", "Ё":"Е", }; var chars = Object.keys(characterMap).join('|'); var allAccents = new RegExp(chars, 'g'); var firstAccent = new RegExp(chars, ''); function matcher(match) { return characterMap[match]; } var removeAccents = function(string) { return string.replace(allAccents, matcher); }; var hasAccents = function(string) { return !!string.match(firstAccent); }; module.exports = removeAccents; module.exports.has = hasAccents; module.exports.remove = removeAccents; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat get default export */ /******/ (() => { /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = (module) => { /******/ var getter = module && module.__esModule ? /******/ () => (module['default']) : /******/ () => (module); /******/ __webpack_require__.d(getter, { a: getter }); /******/ return getter; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/make namespace object */ /******/ (() => { /******/ // define __esModule on exports /******/ __webpack_require__.r = (exports) => { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. (() => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { __experimentalGetCoreBlocks: () => (/* binding */ __experimentalGetCoreBlocks), __experimentalRegisterExperimentalCoreBlocks: () => (/* binding */ __experimentalRegisterExperimentalCoreBlocks), privateApis: () => (/* reexport */ privateApis), registerCoreBlocks: () => (/* binding */ registerCoreBlocks) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/archives/index.js var archives_namespaceObject = {}; __webpack_require__.r(archives_namespaceObject); __webpack_require__.d(archives_namespaceObject, { init: () => (init), metadata: () => (metadata), name: () => (archives_name), settings: () => (settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/avatar/index.js var avatar_namespaceObject = {}; __webpack_require__.r(avatar_namespaceObject); __webpack_require__.d(avatar_namespaceObject, { init: () => (avatar_init), metadata: () => (avatar_metadata), name: () => (avatar_name), settings: () => (avatar_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/audio/index.js var build_module_audio_namespaceObject = {}; __webpack_require__.r(build_module_audio_namespaceObject); __webpack_require__.d(build_module_audio_namespaceObject, { init: () => (audio_init), metadata: () => (audio_metadata), name: () => (audio_name), settings: () => (audio_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/button/index.js var build_module_button_namespaceObject = {}; __webpack_require__.r(build_module_button_namespaceObject); __webpack_require__.d(build_module_button_namespaceObject, { init: () => (button_init), metadata: () => (button_metadata), name: () => (button_name), settings: () => (button_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/buttons/index.js var build_module_buttons_namespaceObject = {}; __webpack_require__.r(build_module_buttons_namespaceObject); __webpack_require__.d(build_module_buttons_namespaceObject, { init: () => (buttons_init), metadata: () => (buttons_metadata), name: () => (buttons_name), settings: () => (buttons_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/calendar/index.js var build_module_calendar_namespaceObject = {}; __webpack_require__.r(build_module_calendar_namespaceObject); __webpack_require__.d(build_module_calendar_namespaceObject, { init: () => (calendar_init), metadata: () => (calendar_metadata), name: () => (calendar_name), settings: () => (calendar_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/categories/index.js var categories_namespaceObject = {}; __webpack_require__.r(categories_namespaceObject); __webpack_require__.d(categories_namespaceObject, { init: () => (categories_init), metadata: () => (categories_metadata), name: () => (categories_name), settings: () => (categories_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/freeform/index.js var freeform_namespaceObject = {}; __webpack_require__.r(freeform_namespaceObject); __webpack_require__.d(freeform_namespaceObject, { init: () => (freeform_init), metadata: () => (freeform_metadata), name: () => (freeform_name), settings: () => (freeform_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/code/index.js var build_module_code_namespaceObject = {}; __webpack_require__.r(build_module_code_namespaceObject); __webpack_require__.d(build_module_code_namespaceObject, { init: () => (code_init), metadata: () => (code_metadata), name: () => (code_name), settings: () => (code_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/column/index.js var build_module_column_namespaceObject = {}; __webpack_require__.r(build_module_column_namespaceObject); __webpack_require__.d(build_module_column_namespaceObject, { init: () => (column_init), metadata: () => (column_metadata), name: () => (column_name), settings: () => (column_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/columns/index.js var build_module_columns_namespaceObject = {}; __webpack_require__.r(build_module_columns_namespaceObject); __webpack_require__.d(build_module_columns_namespaceObject, { init: () => (columns_init), metadata: () => (columns_metadata), name: () => (columns_name), settings: () => (columns_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments/index.js var comments_namespaceObject = {}; __webpack_require__.r(comments_namespaceObject); __webpack_require__.d(comments_namespaceObject, { init: () => (comments_init), metadata: () => (comments_metadata), name: () => (comments_name), settings: () => (comments_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js var build_module_comment_author_avatar_namespaceObject = {}; __webpack_require__.r(build_module_comment_author_avatar_namespaceObject); __webpack_require__.d(build_module_comment_author_avatar_namespaceObject, { init: () => (comment_author_avatar_init), metadata: () => (comment_author_avatar_metadata), name: () => (comment_author_avatar_name), settings: () => (comment_author_avatar_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js var build_module_comment_author_name_namespaceObject = {}; __webpack_require__.r(build_module_comment_author_name_namespaceObject); __webpack_require__.d(build_module_comment_author_name_namespaceObject, { init: () => (comment_author_name_init), metadata: () => (comment_author_name_metadata), name: () => (comment_author_name_name), settings: () => (comment_author_name_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-content/index.js var build_module_comment_content_namespaceObject = {}; __webpack_require__.r(build_module_comment_content_namespaceObject); __webpack_require__.d(build_module_comment_content_namespaceObject, { init: () => (comment_content_init), metadata: () => (comment_content_metadata), name: () => (comment_content_name), settings: () => (comment_content_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-date/index.js var comment_date_namespaceObject = {}; __webpack_require__.r(comment_date_namespaceObject); __webpack_require__.d(comment_date_namespaceObject, { init: () => (comment_date_init), metadata: () => (comment_date_metadata), name: () => (comment_date_name), settings: () => (comment_date_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js var build_module_comment_edit_link_namespaceObject = {}; __webpack_require__.r(build_module_comment_edit_link_namespaceObject); __webpack_require__.d(build_module_comment_edit_link_namespaceObject, { init: () => (comment_edit_link_init), metadata: () => (comment_edit_link_metadata), name: () => (comment_edit_link_name), settings: () => (comment_edit_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js var build_module_comment_reply_link_namespaceObject = {}; __webpack_require__.r(build_module_comment_reply_link_namespaceObject); __webpack_require__.d(build_module_comment_reply_link_namespaceObject, { init: () => (comment_reply_link_init), metadata: () => (comment_reply_link_metadata), name: () => (comment_reply_link_name), settings: () => (comment_reply_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comment-template/index.js var comment_template_namespaceObject = {}; __webpack_require__.r(comment_template_namespaceObject); __webpack_require__.d(comment_template_namespaceObject, { init: () => (comment_template_init), metadata: () => (comment_template_metadata), name: () => (comment_template_name), settings: () => (comment_template_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js var comments_pagination_previous_namespaceObject = {}; __webpack_require__.r(comments_pagination_previous_namespaceObject); __webpack_require__.d(comments_pagination_previous_namespaceObject, { init: () => (comments_pagination_previous_init), metadata: () => (comments_pagination_previous_metadata), name: () => (comments_pagination_previous_name), settings: () => (comments_pagination_previous_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js var comments_pagination_namespaceObject = {}; __webpack_require__.r(comments_pagination_namespaceObject); __webpack_require__.d(comments_pagination_namespaceObject, { init: () => (comments_pagination_init), metadata: () => (comments_pagination_metadata), name: () => (comments_pagination_name), settings: () => (comments_pagination_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js var comments_pagination_next_namespaceObject = {}; __webpack_require__.r(comments_pagination_next_namespaceObject); __webpack_require__.d(comments_pagination_next_namespaceObject, { init: () => (comments_pagination_next_init), metadata: () => (comments_pagination_next_metadata), name: () => (comments_pagination_next_name), settings: () => (comments_pagination_next_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js var comments_pagination_numbers_namespaceObject = {}; __webpack_require__.r(comments_pagination_numbers_namespaceObject); __webpack_require__.d(comments_pagination_numbers_namespaceObject, { init: () => (comments_pagination_numbers_init), metadata: () => (comments_pagination_numbers_metadata), name: () => (comments_pagination_numbers_name), settings: () => (comments_pagination_numbers_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/comments-title/index.js var comments_title_namespaceObject = {}; __webpack_require__.r(comments_title_namespaceObject); __webpack_require__.d(comments_title_namespaceObject, { init: () => (comments_title_init), metadata: () => (comments_title_metadata), name: () => (comments_title_name), settings: () => (comments_title_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/cover/index.js var build_module_cover_namespaceObject = {}; __webpack_require__.r(build_module_cover_namespaceObject); __webpack_require__.d(build_module_cover_namespaceObject, { init: () => (cover_init), metadata: () => (cover_metadata), name: () => (cover_name), settings: () => (cover_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/details/index.js var build_module_details_namespaceObject = {}; __webpack_require__.r(build_module_details_namespaceObject); __webpack_require__.d(build_module_details_namespaceObject, { init: () => (details_init), metadata: () => (details_metadata), name: () => (details_name), settings: () => (details_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/embed/index.js var embed_namespaceObject = {}; __webpack_require__.r(embed_namespaceObject); __webpack_require__.d(embed_namespaceObject, { init: () => (embed_init), metadata: () => (embed_metadata), name: () => (embed_name), settings: () => (embed_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/file/index.js var build_module_file_namespaceObject = {}; __webpack_require__.r(build_module_file_namespaceObject); __webpack_require__.d(build_module_file_namespaceObject, { init: () => (file_init), metadata: () => (file_metadata), name: () => (file_name), settings: () => (file_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form/index.js var build_module_form_namespaceObject = {}; __webpack_require__.r(build_module_form_namespaceObject); __webpack_require__.d(build_module_form_namespaceObject, { init: () => (form_init), metadata: () => (form_metadata), name: () => (form_name), settings: () => (form_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-input/index.js var form_input_namespaceObject = {}; __webpack_require__.r(form_input_namespaceObject); __webpack_require__.d(form_input_namespaceObject, { init: () => (form_input_init), metadata: () => (form_input_metadata), name: () => (form_input_name), settings: () => (form_input_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-submit-button/index.js var form_submit_button_namespaceObject = {}; __webpack_require__.r(form_submit_button_namespaceObject); __webpack_require__.d(form_submit_button_namespaceObject, { init: () => (form_submit_button_init), metadata: () => (form_submit_button_metadata), name: () => (form_submit_button_name), settings: () => (form_submit_button_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/form-submission-notification/index.js var form_submission_notification_namespaceObject = {}; __webpack_require__.r(form_submission_notification_namespaceObject); __webpack_require__.d(form_submission_notification_namespaceObject, { init: () => (form_submission_notification_init), metadata: () => (form_submission_notification_metadata), name: () => (form_submission_notification_name), settings: () => (form_submission_notification_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/gallery/index.js var build_module_gallery_namespaceObject = {}; __webpack_require__.r(build_module_gallery_namespaceObject); __webpack_require__.d(build_module_gallery_namespaceObject, { init: () => (gallery_init), metadata: () => (gallery_metadata), name: () => (gallery_name), settings: () => (gallery_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/group/index.js var build_module_group_namespaceObject = {}; __webpack_require__.r(build_module_group_namespaceObject); __webpack_require__.d(build_module_group_namespaceObject, { init: () => (group_init), metadata: () => (group_metadata), name: () => (group_name), settings: () => (group_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/heading/index.js var build_module_heading_namespaceObject = {}; __webpack_require__.r(build_module_heading_namespaceObject); __webpack_require__.d(build_module_heading_namespaceObject, { init: () => (heading_init), metadata: () => (heading_metadata), name: () => (heading_name), settings: () => (heading_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/home-link/index.js var home_link_namespaceObject = {}; __webpack_require__.r(home_link_namespaceObject); __webpack_require__.d(home_link_namespaceObject, { init: () => (home_link_init), metadata: () => (home_link_metadata), name: () => (home_link_name), settings: () => (home_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/html/index.js var build_module_html_namespaceObject = {}; __webpack_require__.r(build_module_html_namespaceObject); __webpack_require__.d(build_module_html_namespaceObject, { init: () => (html_init), metadata: () => (html_metadata), name: () => (html_name), settings: () => (html_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/image/index.js var build_module_image_namespaceObject = {}; __webpack_require__.r(build_module_image_namespaceObject); __webpack_require__.d(build_module_image_namespaceObject, { init: () => (image_init), metadata: () => (image_metadata), name: () => (image_name), settings: () => (image_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js var latest_comments_namespaceObject = {}; __webpack_require__.r(latest_comments_namespaceObject); __webpack_require__.d(latest_comments_namespaceObject, { init: () => (latest_comments_init), metadata: () => (latest_comments_metadata), name: () => (latest_comments_name), settings: () => (latest_comments_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js var latest_posts_namespaceObject = {}; __webpack_require__.r(latest_posts_namespaceObject); __webpack_require__.d(latest_posts_namespaceObject, { init: () => (latest_posts_init), metadata: () => (latest_posts_metadata), name: () => (latest_posts_name), settings: () => (latest_posts_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list/index.js var build_module_list_namespaceObject = {}; __webpack_require__.r(build_module_list_namespaceObject); __webpack_require__.d(build_module_list_namespaceObject, { init: () => (list_init), metadata: () => (list_metadata), name: () => (list_name), settings: () => (list_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/list-item/index.js var build_module_list_item_namespaceObject = {}; __webpack_require__.r(build_module_list_item_namespaceObject); __webpack_require__.d(build_module_list_item_namespaceObject, { init: () => (list_item_init), metadata: () => (list_item_metadata), name: () => (list_item_name), settings: () => (list_item_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/loginout/index.js var loginout_namespaceObject = {}; __webpack_require__.r(loginout_namespaceObject); __webpack_require__.d(loginout_namespaceObject, { init: () => (loginout_init), metadata: () => (loginout_metadata), name: () => (loginout_name), settings: () => (loginout_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/media-text/index.js var media_text_namespaceObject = {}; __webpack_require__.r(media_text_namespaceObject); __webpack_require__.d(media_text_namespaceObject, { init: () => (media_text_init), metadata: () => (media_text_metadata), name: () => (media_text_name), settings: () => (media_text_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/missing/index.js var missing_namespaceObject = {}; __webpack_require__.r(missing_namespaceObject); __webpack_require__.d(missing_namespaceObject, { init: () => (missing_init), metadata: () => (missing_metadata), name: () => (missing_name), settings: () => (missing_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/more/index.js var build_module_more_namespaceObject = {}; __webpack_require__.r(build_module_more_namespaceObject); __webpack_require__.d(build_module_more_namespaceObject, { init: () => (more_init), metadata: () => (more_metadata), name: () => (more_name), settings: () => (more_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation/index.js var build_module_navigation_namespaceObject = {}; __webpack_require__.r(build_module_navigation_namespaceObject); __webpack_require__.d(build_module_navigation_namespaceObject, { init: () => (navigation_init), metadata: () => (navigation_metadata), name: () => (navigation_name), settings: () => (navigation_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js var navigation_link_namespaceObject = {}; __webpack_require__.r(navigation_link_namespaceObject); __webpack_require__.d(navigation_link_namespaceObject, { init: () => (navigation_link_init), metadata: () => (navigation_link_metadata), name: () => (navigation_link_name), settings: () => (navigation_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js var navigation_submenu_namespaceObject = {}; __webpack_require__.r(navigation_submenu_namespaceObject); __webpack_require__.d(navigation_submenu_namespaceObject, { init: () => (navigation_submenu_init), metadata: () => (navigation_submenu_metadata), name: () => (navigation_submenu_name), settings: () => (navigation_submenu_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/nextpage/index.js var nextpage_namespaceObject = {}; __webpack_require__.r(nextpage_namespaceObject); __webpack_require__.d(nextpage_namespaceObject, { init: () => (nextpage_init), metadata: () => (nextpage_metadata), name: () => (nextpage_name), settings: () => (nextpage_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pattern/index.js var pattern_namespaceObject = {}; __webpack_require__.r(pattern_namespaceObject); __webpack_require__.d(pattern_namespaceObject, { init: () => (pattern_init), metadata: () => (pattern_metadata), name: () => (pattern_name), settings: () => (pattern_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list/index.js var page_list_namespaceObject = {}; __webpack_require__.r(page_list_namespaceObject); __webpack_require__.d(page_list_namespaceObject, { init: () => (page_list_init), metadata: () => (page_list_metadata), name: () => (page_list_name), settings: () => (page_list_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/page-list-item/index.js var page_list_item_namespaceObject = {}; __webpack_require__.r(page_list_item_namespaceObject); __webpack_require__.d(page_list_item_namespaceObject, { init: () => (page_list_item_init), metadata: () => (page_list_item_metadata), name: () => (page_list_item_name), settings: () => (page_list_item_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/paragraph/index.js var build_module_paragraph_namespaceObject = {}; __webpack_require__.r(build_module_paragraph_namespaceObject); __webpack_require__.d(build_module_paragraph_namespaceObject, { init: () => (paragraph_init), metadata: () => (paragraph_metadata), name: () => (paragraph_name), settings: () => (paragraph_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author/index.js var build_module_post_author_namespaceObject = {}; __webpack_require__.r(build_module_post_author_namespaceObject); __webpack_require__.d(build_module_post_author_namespaceObject, { init: () => (post_author_init), metadata: () => (post_author_metadata), name: () => (post_author_name), settings: () => (post_author_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-name/index.js var post_author_name_namespaceObject = {}; __webpack_require__.r(post_author_name_namespaceObject); __webpack_require__.d(post_author_name_namespaceObject, { init: () => (post_author_name_init), metadata: () => (post_author_name_metadata), name: () => (post_author_name_name), settings: () => (post_author_name_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js var post_author_biography_namespaceObject = {}; __webpack_require__.r(post_author_biography_namespaceObject); __webpack_require__.d(post_author_biography_namespaceObject, { init: () => (post_author_biography_init), metadata: () => (post_author_biography_metadata), name: () => (post_author_biography_name), settings: () => (post_author_biography_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comment/index.js var post_comment_namespaceObject = {}; __webpack_require__.r(post_comment_namespaceObject); __webpack_require__.d(post_comment_namespaceObject, { init: () => (post_comment_init), metadata: () => (post_comment_metadata), name: () => (post_comment_name), settings: () => (post_comment_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-count/index.js var build_module_post_comments_count_namespaceObject = {}; __webpack_require__.r(build_module_post_comments_count_namespaceObject); __webpack_require__.d(build_module_post_comments_count_namespaceObject, { init: () => (post_comments_count_init), metadata: () => (post_comments_count_metadata), name: () => (post_comments_count_name), settings: () => (post_comments_count_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js var build_module_post_comments_form_namespaceObject = {}; __webpack_require__.r(build_module_post_comments_form_namespaceObject); __webpack_require__.d(build_module_post_comments_form_namespaceObject, { init: () => (post_comments_form_init), metadata: () => (post_comments_form_metadata), name: () => (post_comments_form_name), settings: () => (post_comments_form_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-comments-link/index.js var post_comments_link_namespaceObject = {}; __webpack_require__.r(post_comments_link_namespaceObject); __webpack_require__.d(post_comments_link_namespaceObject, { init: () => (post_comments_link_init), metadata: () => (post_comments_link_metadata), name: () => (post_comments_link_name), settings: () => (post_comments_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-content/index.js var build_module_post_content_namespaceObject = {}; __webpack_require__.r(build_module_post_content_namespaceObject); __webpack_require__.d(build_module_post_content_namespaceObject, { init: () => (post_content_init), metadata: () => (post_content_metadata), name: () => (post_content_name), settings: () => (post_content_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-date/index.js var build_module_post_date_namespaceObject = {}; __webpack_require__.r(build_module_post_date_namespaceObject); __webpack_require__.d(build_module_post_date_namespaceObject, { init: () => (post_date_init), metadata: () => (post_date_metadata), name: () => (post_date_name), settings: () => (post_date_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js var build_module_post_excerpt_namespaceObject = {}; __webpack_require__.r(build_module_post_excerpt_namespaceObject); __webpack_require__.d(build_module_post_excerpt_namespaceObject, { init: () => (post_excerpt_init), metadata: () => (post_excerpt_metadata), name: () => (post_excerpt_name), settings: () => (post_excerpt_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js var build_module_post_featured_image_namespaceObject = {}; __webpack_require__.r(build_module_post_featured_image_namespaceObject); __webpack_require__.d(build_module_post_featured_image_namespaceObject, { init: () => (post_featured_image_init), metadata: () => (post_featured_image_metadata), name: () => (post_featured_image_name), settings: () => (post_featured_image_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js var post_navigation_link_namespaceObject = {}; __webpack_require__.r(post_navigation_link_namespaceObject); __webpack_require__.d(post_navigation_link_namespaceObject, { init: () => (post_navigation_link_init), metadata: () => (post_navigation_link_metadata), name: () => (post_navigation_link_name), settings: () => (post_navigation_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-template/index.js var post_template_namespaceObject = {}; __webpack_require__.r(post_template_namespaceObject); __webpack_require__.d(post_template_namespaceObject, { init: () => (post_template_init), metadata: () => (post_template_metadata), name: () => (post_template_name), settings: () => (post_template_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-terms/index.js var build_module_post_terms_namespaceObject = {}; __webpack_require__.r(build_module_post_terms_namespaceObject); __webpack_require__.d(build_module_post_terms_namespaceObject, { init: () => (post_terms_init), metadata: () => (post_terms_metadata), name: () => (post_terms_name), settings: () => (post_terms_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-time-to-read/index.js var post_time_to_read_namespaceObject = {}; __webpack_require__.r(post_time_to_read_namespaceObject); __webpack_require__.d(post_time_to_read_namespaceObject, { init: () => (post_time_to_read_init), metadata: () => (post_time_to_read_metadata), name: () => (post_time_to_read_name), settings: () => (post_time_to_read_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/post-title/index.js var post_title_namespaceObject = {}; __webpack_require__.r(post_title_namespaceObject); __webpack_require__.d(post_title_namespaceObject, { init: () => (post_title_init), metadata: () => (post_title_metadata), name: () => (post_title_name), settings: () => (post_title_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/preformatted/index.js var build_module_preformatted_namespaceObject = {}; __webpack_require__.r(build_module_preformatted_namespaceObject); __webpack_require__.d(build_module_preformatted_namespaceObject, { init: () => (preformatted_init), metadata: () => (preformatted_metadata), name: () => (preformatted_name), settings: () => (preformatted_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/pullquote/index.js var build_module_pullquote_namespaceObject = {}; __webpack_require__.r(build_module_pullquote_namespaceObject); __webpack_require__.d(build_module_pullquote_namespaceObject, { init: () => (pullquote_init), metadata: () => (pullquote_metadata), name: () => (pullquote_name), settings: () => (pullquote_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query/index.js var query_namespaceObject = {}; __webpack_require__.r(query_namespaceObject); __webpack_require__.d(query_namespaceObject, { init: () => (query_init), metadata: () => (query_metadata), name: () => (query_name), settings: () => (query_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js var query_no_results_namespaceObject = {}; __webpack_require__.r(query_no_results_namespaceObject); __webpack_require__.d(query_no_results_namespaceObject, { init: () => (query_no_results_init), metadata: () => (query_no_results_metadata), name: () => (query_no_results_name), settings: () => (query_no_results_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js var build_module_query_pagination_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_namespaceObject); __webpack_require__.d(build_module_query_pagination_namespaceObject, { init: () => (query_pagination_init), metadata: () => (query_pagination_metadata), name: () => (query_pagination_name), settings: () => (query_pagination_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js var build_module_query_pagination_next_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_next_namespaceObject); __webpack_require__.d(build_module_query_pagination_next_namespaceObject, { init: () => (query_pagination_next_init), metadata: () => (query_pagination_next_metadata), name: () => (query_pagination_next_name), settings: () => (query_pagination_next_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js var build_module_query_pagination_numbers_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_numbers_namespaceObject); __webpack_require__.d(build_module_query_pagination_numbers_namespaceObject, { init: () => (query_pagination_numbers_init), metadata: () => (query_pagination_numbers_metadata), name: () => (query_pagination_numbers_name), settings: () => (query_pagination_numbers_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js var build_module_query_pagination_previous_namespaceObject = {}; __webpack_require__.r(build_module_query_pagination_previous_namespaceObject); __webpack_require__.d(build_module_query_pagination_previous_namespaceObject, { init: () => (query_pagination_previous_init), metadata: () => (query_pagination_previous_metadata), name: () => (query_pagination_previous_name), settings: () => (query_pagination_previous_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-title/index.js var query_title_namespaceObject = {}; __webpack_require__.r(query_title_namespaceObject); __webpack_require__.d(query_title_namespaceObject, { init: () => (query_title_init), metadata: () => (query_title_metadata), name: () => (query_title_name), settings: () => (query_title_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/query-total/index.js var query_total_namespaceObject = {}; __webpack_require__.r(query_total_namespaceObject); __webpack_require__.d(query_total_namespaceObject, { init: () => (query_total_init), metadata: () => (query_total_metadata), name: () => (query_total_name), settings: () => (query_total_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/quote/index.js var build_module_quote_namespaceObject = {}; __webpack_require__.r(build_module_quote_namespaceObject); __webpack_require__.d(build_module_quote_namespaceObject, { init: () => (quote_init), metadata: () => (quote_metadata), name: () => (quote_name), settings: () => (quote_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/block/index.js var block_namespaceObject = {}; __webpack_require__.r(block_namespaceObject); __webpack_require__.d(block_namespaceObject, { init: () => (block_init), metadata: () => (block_metadata), name: () => (block_name), settings: () => (block_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/read-more/index.js var read_more_namespaceObject = {}; __webpack_require__.r(read_more_namespaceObject); __webpack_require__.d(read_more_namespaceObject, { init: () => (read_more_init), metadata: () => (read_more_metadata), name: () => (read_more_name), settings: () => (read_more_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/rss/index.js var build_module_rss_namespaceObject = {}; __webpack_require__.r(build_module_rss_namespaceObject); __webpack_require__.d(build_module_rss_namespaceObject, { init: () => (rss_init), metadata: () => (rss_metadata), name: () => (rss_name), settings: () => (rss_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/search/index.js var build_module_search_namespaceObject = {}; __webpack_require__.r(build_module_search_namespaceObject); __webpack_require__.d(build_module_search_namespaceObject, { init: () => (search_init), metadata: () => (search_metadata), name: () => (search_name), settings: () => (search_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/separator/index.js var build_module_separator_namespaceObject = {}; __webpack_require__.r(build_module_separator_namespaceObject); __webpack_require__.d(build_module_separator_namespaceObject, { init: () => (separator_init), metadata: () => (separator_metadata), name: () => (separator_name), settings: () => (separator_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/shortcode/index.js var build_module_shortcode_namespaceObject = {}; __webpack_require__.r(build_module_shortcode_namespaceObject); __webpack_require__.d(build_module_shortcode_namespaceObject, { init: () => (shortcode_init), metadata: () => (shortcode_metadata), name: () => (shortcode_name), settings: () => (shortcode_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-logo/index.js var build_module_site_logo_namespaceObject = {}; __webpack_require__.r(build_module_site_logo_namespaceObject); __webpack_require__.d(build_module_site_logo_namespaceObject, { init: () => (site_logo_init), metadata: () => (site_logo_metadata), name: () => (site_logo_name), settings: () => (site_logo_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js var site_tagline_namespaceObject = {}; __webpack_require__.r(site_tagline_namespaceObject); __webpack_require__.d(site_tagline_namespaceObject, { init: () => (site_tagline_init), metadata: () => (site_tagline_metadata), name: () => (site_tagline_name), settings: () => (site_tagline_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/site-title/index.js var site_title_namespaceObject = {}; __webpack_require__.r(site_title_namespaceObject); __webpack_require__.d(site_title_namespaceObject, { init: () => (site_title_init), metadata: () => (site_title_metadata), name: () => (site_title_name), settings: () => (site_title_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-link/index.js var social_link_namespaceObject = {}; __webpack_require__.r(social_link_namespaceObject); __webpack_require__.d(social_link_namespaceObject, { init: () => (social_link_init), metadata: () => (social_link_metadata), name: () => (social_link_name), settings: () => (social_link_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/social-links/index.js var social_links_namespaceObject = {}; __webpack_require__.r(social_links_namespaceObject); __webpack_require__.d(social_links_namespaceObject, { init: () => (social_links_init), metadata: () => (social_links_metadata), name: () => (social_links_name), settings: () => (social_links_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/spacer/index.js var spacer_namespaceObject = {}; __webpack_require__.r(spacer_namespaceObject); __webpack_require__.d(spacer_namespaceObject, { init: () => (spacer_init), metadata: () => (spacer_metadata), name: () => (spacer_name), settings: () => (spacer_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table/index.js var build_module_table_namespaceObject = {}; __webpack_require__.r(build_module_table_namespaceObject); __webpack_require__.d(build_module_table_namespaceObject, { init: () => (table_init), metadata: () => (table_metadata), name: () => (table_name), settings: () => (table_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js var build_module_table_of_contents_namespaceObject = {}; __webpack_require__.r(build_module_table_of_contents_namespaceObject); __webpack_require__.d(build_module_table_of_contents_namespaceObject, { init: () => (table_of_contents_init), metadata: () => (table_of_contents_metadata), name: () => (table_of_contents_name), settings: () => (table_of_contents_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js var tag_cloud_namespaceObject = {}; __webpack_require__.r(tag_cloud_namespaceObject); __webpack_require__.d(tag_cloud_namespaceObject, { init: () => (tag_cloud_init), metadata: () => (tag_cloud_metadata), name: () => (tag_cloud_name), settings: () => (tag_cloud_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/template-part/index.js var template_part_namespaceObject = {}; __webpack_require__.r(template_part_namespaceObject); __webpack_require__.d(template_part_namespaceObject, { init: () => (template_part_init), metadata: () => (template_part_metadata), name: () => (template_part_name), settings: () => (template_part_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/term-description/index.js var build_module_term_description_namespaceObject = {}; __webpack_require__.r(build_module_term_description_namespaceObject); __webpack_require__.d(build_module_term_description_namespaceObject, { init: () => (term_description_init), metadata: () => (term_description_metadata), name: () => (term_description_name), settings: () => (term_description_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/text-columns/index.js var text_columns_namespaceObject = {}; __webpack_require__.r(text_columns_namespaceObject); __webpack_require__.d(text_columns_namespaceObject, { init: () => (text_columns_init), metadata: () => (text_columns_metadata), name: () => (text_columns_name), settings: () => (text_columns_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/verse/index.js var build_module_verse_namespaceObject = {}; __webpack_require__.r(build_module_verse_namespaceObject); __webpack_require__.d(build_module_verse_namespaceObject, { init: () => (verse_init), metadata: () => (verse_metadata), name: () => (verse_name), settings: () => (verse_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/video/index.js var build_module_video_namespaceObject = {}; __webpack_require__.r(build_module_video_namespaceObject); __webpack_require__.d(build_module_video_namespaceObject, { init: () => (video_init), metadata: () => (video_metadata), name: () => (video_name), settings: () => (video_settings) }); // NAMESPACE OBJECT: ./node_modules/@wordpress/block-library/build-module/footnotes/index.js var footnotes_namespaceObject = {}; __webpack_require__.r(footnotes_namespaceObject); __webpack_require__.d(footnotes_namespaceObject, { init: () => (footnotes_init), metadata: () => (footnotes_metadata), name: () => (footnotes_name), settings: () => (footnotes_settings) }); ;// external ["wp","blocks"] const external_wp_blocks_namespaceObject = window["wp"]["blocks"]; ;// external ["wp","primitives"] const external_wp_primitives_namespaceObject = window["wp"]["primitives"]; ;// external "ReactJSXRuntime" const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"]; ;// ./node_modules/@wordpress/icons/build-module/library/archive.js /** * WordPress dependencies */ const archive = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z" }) }); /* harmony default export */ const library_archive = (archive); ;// ./node_modules/@wordpress/block-library/build-module/utils/init-block.js /** * WordPress dependencies */ /** * Function to register an individual block. * * @param {Object} block The block to be registered. * * @return {WPBlockType | undefined} The block, if it has been successfully registered; * otherwise `undefined`. */ function initBlock(block) { if (!block) { return; } const { metadata, settings, name } = block; return (0,external_wp_blocks_namespaceObject.registerBlockType)({ name, ...metadata }, settings); } ;// external ["wp","components"] const external_wp_components_namespaceObject = window["wp"]["components"]; ;// external ["wp","i18n"] const external_wp_i18n_namespaceObject = window["wp"]["i18n"]; ;// external ["wp","blockEditor"] const external_wp_blockEditor_namespaceObject = window["wp"]["blockEditor"]; ;// external ["wp","serverSideRender"] const external_wp_serverSideRender_namespaceObject = window["wp"]["serverSideRender"]; var external_wp_serverSideRender_default = /*#__PURE__*/__webpack_require__.n(external_wp_serverSideRender_namespaceObject); ;// external ["wp","data"] const external_wp_data_namespaceObject = window["wp"]["data"]; ;// external ["wp","element"] const external_wp_element_namespaceObject = window["wp"]["element"]; ;// external ["wp","blob"] const external_wp_blob_namespaceObject = window["wp"]["blob"]; ;// external ["wp","coreData"] const external_wp_coreData_namespaceObject = window["wp"]["coreData"]; ;// external ["wp","compose"] const external_wp_compose_namespaceObject = window["wp"]["compose"]; ;// ./node_modules/@wordpress/block-library/build-module/utils/hooks.js /** * WordPress dependencies */ /** * Returns whether the current user can edit the given entity. * * @param {string} kind Entity kind. * @param {string} name Entity name. * @param {string} recordId Record's id. */ function useCanEditEntity(kind, name, recordId) { return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).canUser('update', { kind, name, id: recordId }), [kind, name, recordId]); } /** * Handles uploading a media file from a blob URL on mount. * * @param {Object} args Upload media arguments. * @param {string} args.url Blob URL. * @param {?Array} args.allowedTypes Array of allowed media types. * @param {Function} args.onChange Function called when the media is uploaded. * @param {Function} args.onError Function called when an error happens. */ function useUploadMediaFromBlobURL(args = {}) { const latestArgsRef = (0,external_wp_element_namespaceObject.useRef)(args); const hasUploadStartedRef = (0,external_wp_element_namespaceObject.useRef)(false); const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); (0,external_wp_element_namespaceObject.useLayoutEffect)(() => { latestArgsRef.current = args; }); (0,external_wp_element_namespaceObject.useEffect)(() => { // Uploading is a special effect that can't be canceled via the cleanup method. // The extra check avoids duplicate uploads in development mode (React.StrictMode). if (hasUploadStartedRef.current) { return; } if (!latestArgsRef.current.url || !(0,external_wp_blob_namespaceObject.isBlobURL)(latestArgsRef.current.url)) { return; } const file = (0,external_wp_blob_namespaceObject.getBlobByURL)(latestArgsRef.current.url); if (!file) { return; } const { url, allowedTypes, onChange, onError } = latestArgsRef.current; const { mediaUpload } = getSettings(); hasUploadStartedRef.current = true; mediaUpload({ filesList: [file], allowedTypes, onFileChange: ([media]) => { if ((0,external_wp_blob_namespaceObject.isBlobURL)(media?.url)) { return; } (0,external_wp_blob_namespaceObject.revokeBlobURL)(url); onChange(media); hasUploadStartedRef.current = false; }, onError: message => { (0,external_wp_blob_namespaceObject.revokeBlobURL)(url); onError(message); hasUploadStartedRef.current = false; } }); }, [getSettings]); } function useToolsPanelDropdownMenuProps() { const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium', '<'); return !isMobile ? { popoverProps: { placement: 'left-start', // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) offset: 259 } } : {}; } ;// ./node_modules/@wordpress/block-library/build-module/archives/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ function ArchivesEdit({ attributes, setAttributes }) { const { showLabel, showPostCounts, displayAsDropdown, type } = attributes; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ displayAsDropdown: false, showLabel: false, showPostCounts: false, type: 'monthly' }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), isShownByDefault: true, hasValue: () => displayAsDropdown, onDeselect: () => setAttributes({ displayAsDropdown: false }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), checked: displayAsDropdown, onChange: () => setAttributes({ displayAsDropdown: !displayAsDropdown }) }) }), displayAsDropdown && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Show label'), isShownByDefault: true, hasValue: () => !showLabel, onDeselect: () => setAttributes({ showLabel: false }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show label'), checked: showLabel, onChange: () => setAttributes({ showLabel: !showLabel }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), isShownByDefault: true, hasValue: () => showPostCounts, onDeselect: () => setAttributes({ showPostCounts: false }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), checked: showPostCounts, onChange: () => setAttributes({ showPostCounts: !showPostCounts }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Group by'), isShownByDefault: true, hasValue: () => type !== 'monthly', onDeselect: () => setAttributes({ type: 'monthly' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Group by'), options: [{ label: (0,external_wp_i18n_namespaceObject.__)('Year'), value: 'yearly' }, { label: (0,external_wp_i18n_namespaceObject.__)('Month'), value: 'monthly' }, { label: (0,external_wp_i18n_namespaceObject.__)('Week'), value: 'weekly' }, { label: (0,external_wp_i18n_namespaceObject.__)('Day'), value: 'daily' }], value: type, onChange: value => setAttributes({ type: value }) }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { block: "core/archives", skipBlockSupportAttributes: true, attributes: attributes }) }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/archives/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/archives", title: "Archives", category: "widgets", description: "Display a date archive of your posts.", textdomain: "default", attributes: { displayAsDropdown: { type: "boolean", "default": false }, showLabel: { type: "boolean", "default": true }, showPostCounts: { type: "boolean", "default": false }, type: { type: "string", "default": "monthly" } }, supports: { align: true, __experimentalBorder: { radius: true, color: true, width: true, style: true }, html: false, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-archives-editor" }; const { name: archives_name } = metadata; const settings = { icon: library_archive, example: {}, edit: ArchivesEdit }; const init = () => initBlock({ name: archives_name, metadata, settings }); ;// ./node_modules/@wordpress/icons/build-module/library/comment-author-avatar.js /** * WordPress dependencies */ const commentAuthorAvatar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M7.25 16.437a6.5 6.5 0 1 1 9.5 0V16A2.75 2.75 0 0 0 14 13.25h-4A2.75 2.75 0 0 0 7.25 16v.437Zm1.5 1.193a6.47 6.47 0 0 0 3.25.87 6.47 6.47 0 0 0 3.25-.87V16c0-.69-.56-1.25-1.25-1.25h-4c-.69 0-1.25.56-1.25 1.25v1.63ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm10-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z", clipRule: "evenodd" }) }); /* harmony default export */ const comment_author_avatar = (commentAuthorAvatar); ;// ./node_modules/clsx/dist/clsx.mjs function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f)}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const dist_clsx = (clsx); ;// external ["wp","url"] const external_wp_url_namespaceObject = window["wp"]["url"]; ;// ./node_modules/@wordpress/block-library/build-module/avatar/hooks.js /** * WordPress dependencies */ function getAvatarSizes(sizes) { const minSize = sizes ? sizes[0] : 24; const maxSize = sizes ? sizes[sizes.length - 1] : 96; const maxSizeBuffer = Math.floor(maxSize * 2.5); return { minSize, maxSize: maxSizeBuffer }; } function useDefaultAvatar() { const { avatarURL: defaultAvatarUrl } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); const { __experimentalDiscussionSettings } = getSettings(); return __experimentalDiscussionSettings; }); return defaultAvatarUrl; } function useCommentAvatar({ commentId }) { const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId); const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId); const avatarUrls = avatars ? Object.values(avatars) : null; const sizes = avatars ? Object.keys(avatars) : null; const { minSize, maxSize } = getAvatarSizes(sizes); const defaultAvatar = useDefaultAvatar(); return { src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar, minSize, maxSize, alt: authorName ? // translators: %s: Author name. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorName) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar') }; } function useUserAvatar({ userId, postId, postType }) { const { authorDetails } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedEntityRecord, getUser } = select(external_wp_coreData_namespaceObject.store); if (userId) { return { authorDetails: getUser(userId) }; } const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; return { authorDetails: _authorId ? getUser(_authorId) : null }; }, [postType, postId, userId]); const avatarUrls = authorDetails?.avatar_urls ? Object.values(authorDetails.avatar_urls) : null; const sizes = authorDetails?.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null; const { minSize, maxSize } = getAvatarSizes(sizes); const defaultAvatar = useDefaultAvatar(); return { src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar, minSize, maxSize, alt: authorDetails ? // translators: %s: Author name. (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s Avatar'), authorDetails?.name) : (0,external_wp_i18n_namespaceObject.__)('Default Avatar') }; } ;// ./node_modules/@wordpress/block-library/build-module/avatar/user-control.js /** * WordPress dependencies */ const AUTHORS_QUERY = { who: 'authors', per_page: -1, _fields: 'id,name', context: 'view' }; function UserControl({ value, onChange }) { const [filteredAuthorsList, setFilteredAuthorsList] = (0,external_wp_element_namespaceObject.useState)(); const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getUsers } = select(external_wp_coreData_namespaceObject.store); return getUsers(AUTHORS_QUERY); }, []); if (!authorsList) { return null; } const options = authorsList.map(author => { return { label: author.name, value: author.id }; }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('User'), help: (0,external_wp_i18n_namespaceObject.__)('Select the avatar user to display, if it is blank it will use the post/page author.'), value: value, onChange: onChange, options: filteredAuthorsList || options, onFilterValueChange: inputValue => setFilteredAuthorsList(options.filter(option => option.label.toLowerCase().startsWith(inputValue.toLowerCase()))) }); } /* harmony default export */ const user_control = (UserControl); ;// ./node_modules/@wordpress/block-library/build-module/avatar/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const AvatarInspectorControls = ({ setAttributes, avatar, attributes, selectUser }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Image size'), onChange: newSize => setAttributes({ size: newSize }), min: avatar.minSize, max: avatar.maxSize, initialPosition: attributes?.size, value: attributes?.size }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link to user profile'), onChange: () => setAttributes({ isLink: !attributes.isLink }), checked: attributes.isLink }), attributes.isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: value => setAttributes({ linkTarget: value ? '_blank' : '_self' }), checked: attributes.linkTarget === '_blank' }), selectUser && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(user_control, { value: attributes?.userId, onChange: value => { setAttributes({ userId: value }); } })] }) }); const ResizableAvatar = ({ setAttributes, attributes, avatar, blockProps, isSelected }) => { const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); const doubledSizedSrc = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(avatar?.src, ['s']), { s: attributes?.size * 2 }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { size: { width: attributes.size, height: attributes.size }, showHandle: isSelected, onResizeStop: (event, direction, elt, delta) => { setAttributes({ size: parseInt(attributes.size + (delta.height || delta.width), 10) }); }, lockAspectRatio: true, enable: { top: false, right: !(0,external_wp_i18n_namespaceObject.isRTL)(), bottom: true, left: (0,external_wp_i18n_namespaceObject.isRTL)() }, minWidth: avatar.minSize, maxWidth: avatar.maxSize, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: doubledSizedSrc, alt: avatar.alt, className: dist_clsx('avatar', 'avatar-' + attributes.size, 'photo', 'wp-block-avatar__image', borderProps.className), style: borderProps.style }) }) }); }; const CommentEdit = ({ attributes, context, setAttributes, isSelected }) => { const { commentId } = context; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const avatar = useCommentAvatar({ commentId }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AvatarInspectorControls, { avatar: avatar, setAttributes: setAttributes, attributes: attributes, selectUser: false }), attributes.isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#avatar-pseudo-link", className: "wp-block-avatar__link", onClick: event => event.preventDefault(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { attributes: attributes, avatar: avatar, blockProps: blockProps, isSelected: isSelected, setAttributes: setAttributes }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { attributes: attributes, avatar: avatar, blockProps: blockProps, isSelected: isSelected, setAttributes: setAttributes })] }); }; const UserEdit = ({ attributes, context, setAttributes, isSelected }) => { const { postId, postType } = context; const avatar = useUserAvatar({ userId: attributes?.userId, postId, postType }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AvatarInspectorControls, { selectUser: true, attributes: attributes, avatar: avatar, setAttributes: setAttributes }), attributes.isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#avatar-pseudo-link", className: "wp-block-avatar__link", onClick: event => event.preventDefault(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { attributes: attributes, avatar: avatar, blockProps: blockProps, isSelected: isSelected, setAttributes: setAttributes }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableAvatar, { attributes: attributes, avatar: avatar, blockProps: blockProps, isSelected: isSelected, setAttributes: setAttributes })] }); }; function Edit(props) { // Don't show the Comment Edit controls if we have a comment ID set, or if we're in the Site Editor (where it is `null`). if (props?.context?.commentId || props?.context?.commentId === null) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentEdit, { ...props }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UserEdit, { ...props }); } ;// ./node_modules/@wordpress/block-library/build-module/avatar/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const avatar_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/avatar", title: "Avatar", category: "theme", description: "Add a user\u2019s avatar.", textdomain: "default", attributes: { userId: { type: "number" }, size: { type: "number", "default": 96 }, isLink: { type: "boolean", "default": false }, linkTarget: { type: "string", "default": "_self" } }, usesContext: ["postType", "postId", "commentId"], supports: { html: false, align: true, alignWide: false, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, __experimentalBorder: { __experimentalSkipSerialization: true, radius: true, width: true, color: true, style: true, __experimentalDefaultControls: { radius: true } }, color: { text: false, background: false, __experimentalDuotone: "img" }, interactivity: { clientNavigation: true } }, selectors: { border: ".wp-block-avatar img" }, editorStyle: "wp-block-avatar-editor", style: "wp-block-avatar" }; const { name: avatar_name } = avatar_metadata; const avatar_settings = { icon: comment_author_avatar, edit: Edit, example: {} }; const avatar_init = () => initBlock({ name: avatar_name, metadata: avatar_metadata, settings: avatar_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/audio.js /** * WordPress dependencies */ const audio = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z" }) }); /* harmony default export */ const library_audio = (audio); ;// ./node_modules/@wordpress/block-library/build-module/audio/deprecated.js /** * WordPress dependencies */ /* harmony default export */ const deprecated = ([{ attributes: { src: { type: 'string', source: 'attribute', selector: 'audio', attribute: 'src' }, caption: { type: 'string', source: 'html', selector: 'figcaption' }, id: { type: 'number' }, autoplay: { type: 'boolean', source: 'attribute', selector: 'audio', attribute: 'autoplay' }, loop: { type: 'boolean', source: 'attribute', selector: 'audio', attribute: 'loop' }, preload: { type: 'string', source: 'attribute', selector: 'audio', attribute: 'preload' } }, supports: { align: true }, save({ attributes }) { const { autoplay, caption, loop, preload, src } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("audio", { controls: "controls", src: src, autoPlay: autoplay, loop: loop, preload: preload }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); } }]); ;// external ["wp","notices"] const external_wp_notices_namespaceObject = window["wp"]["notices"]; ;// ./node_modules/memize/dist/index.js /** * Memize options object. * * @typedef MemizeOptions * * @property {number} [maxSize] Maximum size of the cache. */ /** * Internal cache entry. * * @typedef MemizeCacheNode * * @property {?MemizeCacheNode|undefined} [prev] Previous node. * @property {?MemizeCacheNode|undefined} [next] Next node. * @property {Array<*>} args Function arguments for cache * entry. * @property {*} val Function result. */ /** * Properties of the enhanced function for controlling cache. * * @typedef MemizeMemoizedFunction * * @property {()=>void} clear Clear the cache. */ /** * Accepts a function to be memoized, and returns a new memoized function, with * optional options. * * @template {(...args: any[]) => any} F * * @param {F} fn Function to memoize. * @param {MemizeOptions} [options] Options object. * * @return {((...args: Parameters<F>) => ReturnType<F>) & MemizeMemoizedFunction} Memoized function. */ function memize(fn, options) { var size = 0; /** @type {?MemizeCacheNode|undefined} */ var head; /** @type {?MemizeCacheNode|undefined} */ var tail; options = options || {}; function memoized(/* ...args */) { var node = head, len = arguments.length, args, i; searchCache: while (node) { // Perform a shallow equality test to confirm that whether the node // under test is a candidate for the arguments passed. Two arrays // are shallowly equal if their length matches and each entry is // strictly equal between the two sets. Avoid abstracting to a // function which could incur an arguments leaking deoptimization. // Check whether node arguments match arguments length if (node.args.length !== arguments.length) { node = node.next; continue; } // Check whether node arguments match arguments values for (i = 0; i < len; i++) { if (node.args[i] !== arguments[i]) { node = node.next; continue searchCache; } } // At this point we can assume we've found a match // Surface matched node to head if not already if (node !== head) { // As tail, shift to previous. Must only shift if not also // head, since if both head and tail, there is no previous. if (node === tail) { tail = node.prev; } // Adjust siblings to point to each other. If node was tail, // this also handles new tail's empty `next` assignment. /** @type {MemizeCacheNode} */ (node.prev).next = node.next; if (node.next) { node.next.prev = node.prev; } node.next = head; node.prev = null; /** @type {MemizeCacheNode} */ (head).prev = node; head = node; } // Return immediately return node.val; } // No cached value found. Continue to insertion phase: // Create a copy of arguments (avoid leaking deoptimization) args = new Array(len); for (i = 0; i < len; i++) { args[i] = arguments[i]; } node = { args: args, // Generate the result from original function val: fn.apply(null, args), }; // Don't need to check whether node is already head, since it would // have been returned above already if it was // Shift existing head down list if (head) { head.prev = node; node.next = head; } else { // If no head, follows that there's no tail (at initial or reset) tail = node; } // Trim tail if we're reached max size and are pending cache insertion if (size === /** @type {MemizeOptions} */ (options).maxSize) { tail = /** @type {MemizeCacheNode} */ (tail).prev; /** @type {MemizeCacheNode} */ (tail).next = null; } else { size++; } head = node; return node.val; } memoized.clear = function () { head = null; tail = null; size = 0; }; // Ignore reason: There's not a clear solution to create an intersection of // the function with additional properties, where the goal is to retain the // function signature of the incoming argument and add control properties // on the return value. // @ts-ignore return memoized; } ;// ./node_modules/@wordpress/block-library/build-module/embed/constants.js const ASPECT_RATIOS = [ // Common video resolutions. { ratio: '2.33', className: 'wp-embed-aspect-21-9' }, { ratio: '2.00', className: 'wp-embed-aspect-18-9' }, { ratio: '1.78', className: 'wp-embed-aspect-16-9' }, { ratio: '1.33', className: 'wp-embed-aspect-4-3' }, // Vertical video and instagram square video support. { ratio: '1.00', className: 'wp-embed-aspect-1-1' }, { ratio: '0.56', className: 'wp-embed-aspect-9-16' }, { ratio: '0.50', className: 'wp-embed-aspect-1-2' }]; const WP_EMBED_TYPE = 'wp-embed'; ;// external ["wp","privateApis"] const external_wp_privateApis_namespaceObject = window["wp"]["privateApis"]; ;// ./node_modules/@wordpress/block-library/build-module/lock-unlock.js /** * WordPress dependencies */ const { lock, unlock } = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.', '@wordpress/block-library'); ;// ./node_modules/@wordpress/block-library/build-module/embed/util.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const util_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/embed", title: "Embed", category: "embed", description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", textdomain: "default", attributes: { url: { type: "string", role: "content" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", role: "content" }, type: { type: "string", role: "content" }, providerNameSlug: { type: "string", role: "content" }, allowResponsive: { type: "boolean", "default": true }, responsive: { type: "boolean", "default": false, role: "content" }, previewable: { type: "boolean", "default": true, role: "content" } }, supports: { align: true, spacing: { margin: true }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-embed-editor", style: "wp-block-embed" }; const { name: DEFAULT_EMBED_BLOCK } = util_metadata; const { kebabCase } = unlock(external_wp_components_namespaceObject.privateApis); /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ /** * Returns the embed block's information by matching the provided service provider * * @param {string} provider The embed block's provider * @return {WPBlockVariation} The embed block's information */ const getEmbedInfoByProvider = provider => (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ name }) => name === provider); /** * Returns true if any of the regular expressions match the URL. * * @param {string} url The URL to test. * @param {Array} patterns The list of regular expressions to test against. * @return {boolean} True if any of the regular expressions match the URL. */ const matchesPatterns = (url, patterns = []) => patterns.some(pattern => url.match(pattern)); /** * Finds the block variation that should be used for the URL, * based on the provided URL and the variation's patterns. * * @param {string} url The URL to test. * @return {WPBlockVariation} The block variation that should be used for this URL */ const findMoreSuitableBlock = url => (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ patterns }) => matchesPatterns(url, patterns)); const isFromWordPress = html => html && html.includes('class="wp-embedded-content"'); const getPhotoHtml = photo => { // If full image url not found use thumbnail. const imageUrl = photo.url || photo.thumbnail_url; // 100% width for the preview so it fits nicely into the document, some "thumbnails" are // actually the full size photo. const photoPreview = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: imageUrl, alt: photo.title, width: "100%" }) }); return (0,external_wp_element_namespaceObject.renderToString)(photoPreview); }; /** * Creates a more suitable embed block based on the passed in props * and attributes generated from an embed block's preview. * * We require `attributesFromPreview` to be generated from the latest attributes * and preview, and because of the way the react lifecycle operates, we can't * guarantee that the attributes contained in the block's props are the latest * versions, so we require that these are generated separately. * See `getAttributesFromPreview` in the generated embed edit component. * * @param {Object} props The block's props. * @param {Object} [attributesFromPreview] Attributes generated from the block's most up to date preview. * @return {Object|undefined} A more suitable embed block if one exists. */ const createUpgradedEmbedBlock = (props, attributesFromPreview = {}) => { const { preview, attributes = {} } = props; const { url, providerNameSlug, type, ...restAttributes } = attributes; if (!url || !(0,external_wp_blocks_namespaceObject.getBlockType)(DEFAULT_EMBED_BLOCK)) { return; } const matchedBlock = findMoreSuitableBlock(url); // WordPress blocks can work on multiple sites, and so don't have patterns, // so if we're in a WordPress block, assume the user has chosen it for a WordPress URL. const isCurrentBlockWP = providerNameSlug === 'wordpress' || type === WP_EMBED_TYPE; // If current block is not WordPress and a more suitable block found // that is different from the current one, create the new matched block. const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug); if (shouldCreateNewBlock) { return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, { url, ...restAttributes, ...matchedBlock.attributes }); } const wpVariation = (0,external_wp_blocks_namespaceObject.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find(({ name }) => name === 'wordpress'); // We can't match the URL for WordPress embeds, we have to check the HTML instead. if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) { return; } // This is not the WordPress embed block so transform it into one. return (0,external_wp_blocks_namespaceObject.createBlock)(DEFAULT_EMBED_BLOCK, { url, ...wpVariation.attributes, // By now we have the preview, but when the new block first renders, it // won't have had all the attributes set, and so won't get the correct // type and it won't render correctly. So, we pass through the current attributes // here so that the initial render works when we switch to the WordPress // block. This only affects the WordPress block because it can't be // rendered in the usual Sandbox (it has a sandbox of its own) and it // relies on the preview to set the correct render type. ...attributesFromPreview }); }; /** * Determine if the block already has an aspect ratio class applied. * * @param {string} existingClassNames Existing block classes. * @return {boolean} True or false if the classnames contain an aspect ratio class. */ const hasAspectRatioClass = existingClassNames => { if (!existingClassNames) { return false; } return ASPECT_RATIOS.some(({ className }) => existingClassNames.includes(className)); }; /** * Removes all previously set aspect ratio related classes and return the rest * existing class names. * * @param {string} existingClassNames Any existing class names. * @return {string} The class names without any aspect ratio related class. */ const removeAspectRatioClasses = existingClassNames => { if (!existingClassNames) { // Avoids extraneous work and also, by returning the same value as // received, ensures the post is not dirtied by a change of the block // attribute from `undefined` to an empty string. return existingClassNames; } const aspectRatioClassNames = ASPECT_RATIOS.reduce((accumulator, { className }) => { accumulator.push(className); return accumulator; }, ['wp-has-aspect-ratio']); let outputClassNames = existingClassNames; for (const className of aspectRatioClassNames) { outputClassNames = outputClassNames.replace(className, ''); } return outputClassNames.trim(); }; /** * Returns class names with any relevant responsive aspect ratio names. * * @param {string} html The preview HTML that possibly contains an iframe with width and height set. * @param {string} existingClassNames Any existing class names. * @param {boolean} allowResponsive If the responsive class names should be added, or removed. * @return {string} Deduped class names. */ function getClassNames(html, existingClassNames, allowResponsive = true) { if (!allowResponsive) { return removeAspectRatioClasses(existingClassNames); } const previewDocument = document.implementation.createHTMLDocument(''); previewDocument.body.innerHTML = html; const iframe = previewDocument.body.querySelector('iframe'); // If we have a fixed aspect iframe, and it's a responsive embed block. if (iframe && iframe.height && iframe.width) { const aspectRatio = (iframe.width / iframe.height).toFixed(2); // Given the actual aspect ratio, find the widest ratio to support it. for (let ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) { const potentialRatio = ASPECT_RATIOS[ratioIndex]; if (aspectRatio >= potentialRatio.ratio) { // Evaluate the difference between actual aspect ratio and closest match. // If the difference is too big, do not scale the embed according to aspect ratio. const ratioDiff = aspectRatio - potentialRatio.ratio; if (ratioDiff > 0.1) { // No close aspect ratio match found. return removeAspectRatioClasses(existingClassNames); } // Close aspect ratio match found. return dist_clsx(removeAspectRatioClasses(existingClassNames), potentialRatio.className, 'wp-has-aspect-ratio'); } } } return existingClassNames; } /** * Fallback behaviour for unembeddable URLs. * Creates a paragraph block containing a link to the URL, and calls `onReplace`. * * @param {string} url The URL that could not be embedded. * @param {Function} onReplace Function to call with the created fallback block. */ function fallback(url, onReplace) { const link = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: url, children: url }); onReplace((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: (0,external_wp_element_namespaceObject.renderToString)(link) })); } /*** * Gets block attributes based on the preview and responsive state. * * @param {Object} preview The preview data. * @param {string} title The block's title, e.g. Twitter. * @param {Object} currentClassNames The block's current class names. * @param {boolean} isResponsive Boolean indicating if the block supports responsive content. * @param {boolean} allowResponsive Apply responsive classes to fixed size content. * @return {Object} Attributes and values. */ const getAttributesFromPreview = memize((preview, title, currentClassNames, isResponsive, allowResponsive = true) => { if (!preview) { return {}; } const attributes = {}; // Some plugins only return HTML with no type info, so default this to 'rich'. let { type = 'rich' } = preview; // If we got a provider name from the API, use it for the slug, otherwise we use the title, // because not all embed code gives us a provider name. const { html, provider_name: providerName } = preview; const providerNameSlug = kebabCase((providerName || title).toLowerCase()); if (isFromWordPress(html)) { type = WP_EMBED_TYPE; } if (html || 'photo' === type) { attributes.type = type; attributes.providerNameSlug = providerNameSlug; } // Aspect ratio classes are removed when the embed URL is updated. // If the embed already has an aspect ratio class, that means the URL has not changed. // Which also means no need to regenerate it with getClassNames. if (hasAspectRatioClass(currentClassNames)) { return attributes; } attributes.className = getClassNames(html, currentClassNames, isResponsive && allowResponsive); return attributes; }); /** * Returns the attributes derived from the preview, merged with the current attributes. * * @param {Object} currentAttributes The current attributes of the block. * @param {Object} preview The preview data. * @param {string} title The block's title, e.g. Twitter. * @param {boolean} isResponsive Boolean indicating if the block supports responsive content. * @return {Object} Merged attributes. */ const getMergedAttributesWithPreview = (currentAttributes, preview, title, isResponsive) => { const { allowResponsive, className } = currentAttributes; return { ...currentAttributes, ...getAttributesFromPreview(preview, title, className, isResponsive, allowResponsive) }; }; ;// ./node_modules/@wordpress/icons/build-module/library/caption.js /** * WordPress dependencies */ const caption = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M6 5.5h12a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5ZM4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6Zm4 10h2v-1.5H8V16Zm5 0h-2v-1.5h2V16Zm1 0h2v-1.5h-2V16Z" }) }); /* harmony default export */ const library_caption = (caption); ;// ./node_modules/@wordpress/block-library/build-module/utils/caption.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function Caption({ attributeKey = 'caption', attributes, setAttributes, isSelected, insertBlocksAfter, placeholder = (0,external_wp_i18n_namespaceObject.__)('Add caption'), label = (0,external_wp_i18n_namespaceObject.__)('Caption text'), showToolbarButton = true, excludeElementClassName, className, readOnly, tagName = 'figcaption', addLabel = (0,external_wp_i18n_namespaceObject.__)('Add caption'), removeLabel = (0,external_wp_i18n_namespaceObject.__)('Remove caption'), icon = library_caption, ...props }) { const caption = attributes[attributeKey]; const prevCaption = (0,external_wp_compose_namespaceObject.usePrevious)(caption); const { PrivateRichText: RichText } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const isCaptionEmpty = RichText.isEmpty(caption); const isPrevCaptionEmpty = RichText.isEmpty(prevCaption); const [showCaption, setShowCaption] = (0,external_wp_element_namespaceObject.useState)(!isCaptionEmpty); // We need to show the caption when changes come from // history navigation(undo/redo). (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isCaptionEmpty && isPrevCaptionEmpty) { setShowCaption(true); } }, [isCaptionEmpty, isPrevCaptionEmpty]); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isSelected && isCaptionEmpty) { setShowCaption(false); } }, [isSelected, isCaptionEmpty]); // Focus the caption when we click to add one. const ref = (0,external_wp_element_namespaceObject.useCallback)(node => { if (node && isCaptionEmpty) { node.focus(); } }, [isCaptionEmpty]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [showToolbarButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => { setShowCaption(!showCaption); if (showCaption && caption) { setAttributes({ [attributeKey]: undefined }); } }, icon: icon, isPressed: showCaption, label: showCaption ? removeLabel : addLabel }) }), showCaption && (!RichText.isEmpty(caption) || isSelected) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RichText, { identifier: attributeKey, tagName: tagName, className: dist_clsx(className, excludeElementClassName ? '' : (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')), ref: ref, "aria-label": label, placeholder: placeholder, value: caption, onChange: value => setAttributes({ [attributeKey]: value }), inlineToolbar: true, __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())), readOnly: readOnly, ...props })] }); } ;// ./node_modules/@wordpress/block-library/build-module/audio/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const ALLOWED_MEDIA_TYPES = ['audio']; function AudioEdit({ attributes, className, setAttributes, onReplace, isSelected: isSingleSelected, insertBlocksAfter }) { const { id, autoplay, loop, preload, src } = attributes; const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(attributes.blob); useUploadMediaFromBlobURL({ url: temporaryURL, allowedTypes: ALLOWED_MEDIA_TYPES, onChange: onSelectAudio, onError: onUploadError }); function toggleAttribute(attribute) { return newValue => { setAttributes({ [attribute]: newValue }); }; } function onSelectURL(newSrc) { // Set the block's src from the edit component's state, and switch off // the editing UI. if (newSrc !== src) { // Check if there's an embed block that handles this URL. const embedBlock = createUpgradedEmbedBlock({ attributes: { url: newSrc } }); if (undefined !== embedBlock && onReplace) { onReplace(embedBlock); return; } setAttributes({ src: newSrc, id: undefined, blob: undefined }); setTemporaryURL(); } } const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); function onUploadError(message) { createErrorNotice(message, { type: 'snackbar' }); } function getAutoplayHelp(checked) { return checked ? (0,external_wp_i18n_namespaceObject.__)('Autoplay may cause usability issues for some users.') : null; } function onSelectAudio(media) { if (!media || !media.url) { // In this case there was an error and we should continue in the editing state // previous attributes should be removed because they may be temporary blob urls. setAttributes({ src: undefined, id: undefined, caption: undefined, blob: undefined }); setTemporaryURL(); return; } if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { setTemporaryURL(media.url); return; } // Sets the block's attribute and updates the edit component from the // selected media, then switches off the editing UI. setAttributes({ blob: undefined, src: media.url, id: media.id, caption: media.caption }); setTemporaryURL(); } const classes = dist_clsx(className, { 'is-transient': !!temporaryURL }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes }); if (!src && !temporaryURL) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_audio }), onSelect: onSelectAudio, onSelectURL: onSelectURL, accept: "audio/*", allowedTypes: ALLOWED_MEDIA_TYPES, value: attributes, onError: onUploadError }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isSingleSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: id, mediaURL: src, allowedTypes: ALLOWED_MEDIA_TYPES, accept: "audio/*", onSelect: onSelectAudio, onSelectURL: onSelectURL, onError: onUploadError, onReset: () => onSelectAudio(undefined) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Autoplay'), onChange: toggleAttribute('autoplay'), checked: autoplay, help: getAutoplayHelp }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Loop'), onChange: toggleAttribute('loop'), checked: loop }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject._x)('Preload', 'noun; Audio block parameter'), value: preload || '' // `undefined` is required for the preload attribute to be unset. , onChange: value => setAttributes({ preload: value || undefined }), options: [{ value: '', label: (0,external_wp_i18n_namespaceObject.__)('Browser default') }, { value: 'auto', label: (0,external_wp_i18n_namespaceObject.__)('Auto') }, { value: 'metadata', label: (0,external_wp_i18n_namespaceObject.__)('Metadata') }, { value: 'none', label: (0,external_wp_i18n_namespaceObject._x)('None', 'Preload value') }] })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { isDisabled: !isSingleSelected, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("audio", { controls: "controls", src: src !== null && src !== void 0 ? src : temporaryURL }) }), !!temporaryURL && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { attributes: attributes, setAttributes: setAttributes, isSelected: isSingleSelected, insertBlocksAfter: insertBlocksAfter, label: (0,external_wp_i18n_namespaceObject.__)('Audio caption text'), showToolbarButton: isSingleSelected })] })] }); } /* harmony default export */ const edit = (AudioEdit); ;// ./node_modules/@wordpress/block-library/build-module/audio/save.js /** * WordPress dependencies */ function save({ attributes }) { const { autoplay, caption, loop, preload, src } = attributes; return src && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("audio", { controls: "controls", src: src, autoPlay: autoplay, loop: loop, preload: preload }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption, className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption') })] }); } ;// ./node_modules/@wordpress/block-library/build-module/audio/transforms.js /** * WordPress dependencies */ const transforms = { from: [{ type: 'files', isMatch(files) { return files.length === 1 && files[0].type.indexOf('audio/') === 0; }, transform(files) { const file = files[0]; // We don't need to upload the media directly here // It's already done as part of the `componentDidMount` // in the audio block. const block = (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) }); return block; } }, { type: 'shortcode', tag: 'audio', attributes: { src: { type: 'string', shortcode: ({ named: { src, mp3, m4a, ogg, wav, wma } }) => { return src || mp3 || m4a || ogg || wav || wma; } }, loop: { type: 'string', shortcode: ({ named: { loop } }) => { return loop; } }, autoplay: { type: 'string', shortcode: ({ named: { autoplay } }) => { return autoplay; } }, preload: { type: 'string', shortcode: ({ named: { preload } }) => { return preload; } } } }] }; /* harmony default export */ const audio_transforms = (transforms); ;// ./node_modules/@wordpress/block-library/build-module/audio/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const audio_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/audio", title: "Audio", category: "media", description: "Embed a simple audio player.", keywords: ["music", "sound", "podcast", "recording"], textdomain: "default", attributes: { blob: { type: "string", role: "local" }, src: { type: "string", source: "attribute", selector: "audio", attribute: "src", role: "content" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", role: "content" }, id: { type: "number", role: "content" }, autoplay: { type: "boolean", source: "attribute", selector: "audio", attribute: "autoplay" }, loop: { type: "boolean", source: "attribute", selector: "audio", attribute: "loop" }, preload: { type: "string", source: "attribute", selector: "audio", attribute: "preload" } }, supports: { anchor: true, align: true, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-audio-editor", style: "wp-block-audio" }; const { name: audio_name } = audio_metadata; const audio_settings = { icon: library_audio, example: { attributes: { src: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg' }, viewportWidth: 350 }, transforms: audio_transforms, deprecated: deprecated, edit: edit, save: save }; const audio_init = () => initBlock({ name: audio_name, metadata: audio_metadata, settings: audio_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/button.js /** * WordPress dependencies */ const button_button = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z" }) }); /* harmony default export */ const library_button = (button_button); ;// ./node_modules/@wordpress/block-library/build-module/utils/migrate-font-family.js /** * WordPress dependencies */ /** * Internal dependencies */ const { cleanEmptyObject } = unlock(external_wp_blockEditor_namespaceObject.privateApis); /** * Migrates the current style.typography.fontFamily attribute, * whose value was "var:preset|font-family|helvetica-arial", * to the style.fontFamily attribute, whose value will be "helvetica-arial". * * @param {Object} attributes The current attributes * @return {Object} The updated attributes. */ /* harmony default export */ function migrate_font_family(attributes) { if (!attributes?.style?.typography?.fontFamily) { return attributes; } const { fontFamily, ...typography } = attributes.style.typography; return { ...attributes, style: cleanEmptyObject({ ...attributes.style, typography }), fontFamily: fontFamily.split('|').pop() }; } ;// ./node_modules/@wordpress/block-library/build-module/button/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const migrateBorderRadius = attributes => { const { borderRadius, ...newAttributes } = attributes; // We have to check old property `borderRadius` and if // `styles.border.radius` is a `number` const oldBorderRadius = [borderRadius, newAttributes.style?.border?.radius].find(possibleBorderRadius => { return typeof possibleBorderRadius === 'number' && possibleBorderRadius !== 0; }); if (!oldBorderRadius) { return newAttributes; } return { ...newAttributes, style: { ...newAttributes.style, border: { ...newAttributes.style?.border, radius: `${oldBorderRadius}px` } } }; }; function migrateAlign(attributes) { if (!attributes.align) { return attributes; } const { align, ...otherAttributes } = attributes; return { ...otherAttributes, className: dist_clsx(otherAttributes.className, `align${attributes.align}`) }; } const migrateCustomColorsAndGradients = attributes => { if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customGradient) { return attributes; } const style = { color: {} }; if (attributes.customTextColor) { style.color.text = attributes.customTextColor; } if (attributes.customBackgroundColor) { style.color.background = attributes.customBackgroundColor; } if (attributes.customGradient) { style.color.gradient = attributes.customGradient; } const { customTextColor, customBackgroundColor, customGradient, ...restAttributes } = attributes; return { ...restAttributes, style }; }; const oldColorsMigration = attributes => { const { color, textColor, ...restAttributes } = { ...attributes, customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined, customBackgroundColor: attributes.color && '#' === attributes.color[0] ? attributes.color : undefined }; return migrateCustomColorsAndGradients(restAttributes); }; const blockAttributes = { url: { type: 'string', source: 'attribute', selector: 'a', attribute: 'href' }, title: { type: 'string', source: 'attribute', selector: 'a', attribute: 'title' }, text: { type: 'string', source: 'html', selector: 'a' } }; const v12 = { attributes: { tagName: { type: 'string', enum: ['a', 'button'], default: 'a' }, type: { type: 'string', default: 'button' }, textAlign: { type: 'string' }, url: { type: 'string', source: 'attribute', selector: 'a', attribute: 'href' }, title: { type: 'string', source: 'attribute', selector: 'a,button', attribute: 'title', role: 'content' }, text: { type: 'rich-text', source: 'rich-text', selector: 'a,button', role: 'content' }, linkTarget: { type: 'string', source: 'attribute', selector: 'a', attribute: 'target', role: 'content' }, rel: { type: 'string', source: 'attribute', selector: 'a', attribute: 'rel', role: 'content' }, placeholder: { type: 'string' }, backgroundColor: { type: 'string' }, textColor: { type: 'string' }, gradient: { type: 'string' }, width: { type: 'number' } }, supports: { anchor: true, align: true, alignWide: false, color: { __experimentalSkipSerialization: true, gradients: true, __experimentalDefaultControls: { background: true, text: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalWritingMode: true, __experimentalDefaultControls: { fontSize: true } }, reusable: false, shadow: { __experimentalSkipSerialization: true }, spacing: { __experimentalSkipSerialization: true, padding: ['horizontal', 'vertical'], __experimentalDefaultControls: { padding: true } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, __experimentalSelector: '.wp-block-button__link', interactivity: { clientNavigation: true } }, save({ attributes, className }) { const { tagName, type, textAlign, fontSize, linkTarget, rel, style, text, title, url, width } = attributes; const TagName = tagName || 'a'; const isButtonTag = 'button' === TagName; const buttonType = type || 'button'; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, { [`has-text-align-${textAlign}`]: textAlign, // For backwards compatibility add style that isn't provided via // block support. 'no-border-radius': style?.border?.radius === 0 }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')); const buttonStyle = { ...borderProps.style, ...colorProps.style, ...spacingProps.style, ...shadowProps.style }; // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width, [`has-custom-font-size`]: fontSize || style?.typography?.fontSize }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: TagName, type: isButtonTag ? buttonType : null, className: buttonClasses, href: isButtonTag ? null : url, title: title, style: buttonStyle, value: text, target: isButtonTag ? null : linkTarget, rel: isButtonTag ? null : rel }) }); } }; const v11 = { attributes: { url: { type: 'string', source: 'attribute', selector: 'a', attribute: 'href' }, title: { type: 'string', source: 'attribute', selector: 'a', attribute: 'title' }, text: { type: 'string', source: 'html', selector: 'a' }, linkTarget: { type: 'string', source: 'attribute', selector: 'a', attribute: 'target' }, rel: { type: 'string', source: 'attribute', selector: 'a', attribute: 'rel' }, placeholder: { type: 'string' }, backgroundColor: { type: 'string' }, textColor: { type: 'string' }, gradient: { type: 'string' }, width: { type: 'number' } }, supports: { anchor: true, align: true, alignWide: false, color: { __experimentalSkipSerialization: true, gradients: true, __experimentalDefaultControls: { background: true, text: true } }, typography: { fontSize: true, __experimentalFontFamily: true, __experimentalDefaultControls: { fontSize: true } }, reusable: false, spacing: { __experimentalSkipSerialization: true, padding: ['horizontal', 'vertical'], __experimentalDefaultControls: { padding: true } }, __experimentalBorder: { radius: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { radius: true } }, __experimentalSelector: '.wp-block-button__link' }, save({ attributes, className }) { const { fontSize, linkTarget, rel, style, text, title, url, width } = attributes; if (!text) { return null; } const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, { // For backwards compatibility add style that isn't provided via // block support. 'no-border-radius': style?.border?.radius === 0 }); const buttonStyle = { ...borderProps.style, ...colorProps.style, ...spacingProps.style }; // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width, [`has-custom-font-size`]: fontSize || style?.typography?.fontSize }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, title: title, style: buttonStyle, value: text, target: linkTarget, rel: rel }) }); } }; const v10 = { attributes: { url: { type: 'string', source: 'attribute', selector: 'a', attribute: 'href' }, title: { type: 'string', source: 'attribute', selector: 'a', attribute: 'title' }, text: { type: 'string', source: 'html', selector: 'a' }, linkTarget: { type: 'string', source: 'attribute', selector: 'a', attribute: 'target' }, rel: { type: 'string', source: 'attribute', selector: 'a', attribute: 'rel' }, placeholder: { type: 'string' }, backgroundColor: { type: 'string' }, textColor: { type: 'string' }, gradient: { type: 'string' }, width: { type: 'number' } }, supports: { anchor: true, align: true, alignWide: false, color: { __experimentalSkipSerialization: true, gradients: true }, typography: { fontSize: true, __experimentalFontFamily: true }, reusable: false, spacing: { __experimentalSkipSerialization: true, padding: ['horizontal', 'vertical'], __experimentalDefaultControls: { padding: true } }, __experimentalBorder: { radius: true, __experimentalSkipSerialization: true }, __experimentalSelector: '.wp-block-button__link' }, save({ attributes, className }) { const { fontSize, linkTarget, rel, style, text, title, url, width } = attributes; if (!text) { return null; } const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, { // For backwards compatibility add style that isn't provided via // block support. 'no-border-radius': style?.border?.radius === 0 }); const buttonStyle = { ...borderProps.style, ...colorProps.style, ...spacingProps.style }; // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width, [`has-custom-font-size`]: fontSize || style?.typography?.fontSize }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, title: title, style: buttonStyle, value: text, target: linkTarget, rel: rel }) }); }, migrate: migrate_font_family, isEligible({ style }) { return style?.typography?.fontFamily; } }; const deprecated_deprecated = [v12, v11, v10, { supports: { anchor: true, align: true, alignWide: false, color: { __experimentalSkipSerialization: true, gradients: true }, typography: { fontSize: true, __experimentalFontFamily: true }, reusable: false, __experimentalSelector: '.wp-block-button__link' }, attributes: { ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', selector: 'a', attribute: 'target' }, rel: { type: 'string', source: 'attribute', selector: 'a', attribute: 'rel' }, placeholder: { type: 'string' }, backgroundColor: { type: 'string' }, textColor: { type: 'string' }, gradient: { type: 'string' }, width: { type: 'number' } }, isEligible({ style }) { return typeof style?.border?.radius === 'number'; }, save({ attributes, className }) { const { fontSize, linkTarget, rel, style, text, title, url, width } = attributes; if (!text) { return null; } const borderRadius = style?.border?.radius; const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, { 'no-border-radius': style?.border?.radius === 0 }); const buttonStyle = { borderRadius: borderRadius ? borderRadius : undefined, ...colorProps.style }; // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width, [`has-custom-font-size`]: fontSize || style?.typography?.fontSize }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, title: title, style: buttonStyle, value: text, target: linkTarget, rel: rel }) }); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) }, { supports: { anchor: true, align: true, alignWide: false, color: { __experimentalSkipSerialization: true }, reusable: false, __experimentalSelector: '.wp-block-button__link' }, attributes: { ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', selector: 'a', attribute: 'target' }, rel: { type: 'string', source: 'attribute', selector: 'a', attribute: 'rel' }, placeholder: { type: 'string' }, borderRadius: { type: 'number' }, backgroundColor: { type: 'string' }, textColor: { type: 'string' }, gradient: { type: 'string' }, style: { type: 'object' }, width: { type: 'number' } }, save({ attributes, className }) { const { borderRadius, linkTarget, rel, text, title, url, width } = attributes; const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, { 'no-border-radius': borderRadius === 0 }); const buttonStyle = { borderRadius: borderRadius ? borderRadius + 'px' : undefined, ...colorProps.style }; // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, title: title, style: buttonStyle, value: text, target: linkTarget, rel: rel }) }); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) }, { supports: { anchor: true, align: true, alignWide: false, color: { __experimentalSkipSerialization: true }, reusable: false, __experimentalSelector: '.wp-block-button__link' }, attributes: { ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', selector: 'a', attribute: 'target' }, rel: { type: 'string', source: 'attribute', selector: 'a', attribute: 'rel' }, placeholder: { type: 'string' }, borderRadius: { type: 'number' }, backgroundColor: { type: 'string' }, textColor: { type: 'string' }, gradient: { type: 'string' }, style: { type: 'object' }, width: { type: 'number' } }, save({ attributes, className }) { const { borderRadius, linkTarget, rel, text, title, url, width } = attributes; const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, { 'no-border-radius': borderRadius === 0 }); const buttonStyle = { borderRadius: borderRadius ? borderRadius + 'px' : undefined, ...colorProps.style }; // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, title: title, style: buttonStyle, value: text, target: linkTarget, rel: rel }) }); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrate_font_family, migrateBorderRadius) }, { supports: { align: true, alignWide: false, color: { gradients: true } }, attributes: { ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', selector: 'a', attribute: 'target' }, rel: { type: 'string', source: 'attribute', selector: 'a', attribute: 'rel' }, placeholder: { type: 'string' }, borderRadius: { type: 'number' }, backgroundColor: { type: 'string' }, textColor: { type: 'string' }, gradient: { type: 'string' }, style: { type: 'object' } }, save({ attributes }) { const { borderRadius, linkTarget, rel, text, title, url } = attributes; const buttonClasses = dist_clsx('wp-block-button__link', { 'no-border-radius': borderRadius === 0 }); const buttonStyle = { borderRadius: borderRadius ? borderRadius + 'px' : undefined }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, title: title, style: buttonStyle, value: text, target: linkTarget, rel: rel }); }, migrate: migrateBorderRadius }, { supports: { align: true, alignWide: false }, attributes: { ...blockAttributes, linkTarget: { type: 'string', source: 'attribute', selector: 'a', attribute: 'target' }, rel: { type: 'string', source: 'attribute', selector: 'a', attribute: 'rel' }, placeholder: { type: 'string' }, borderRadius: { type: 'number' }, backgroundColor: { type: 'string' }, textColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, customTextColor: { type: 'string' }, customGradient: { type: 'string' }, gradient: { type: 'string' } }, isEligible: attributes => !!attributes.customTextColor || !!attributes.customBackgroundColor || !!attributes.customGradient || !!attributes.align, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateBorderRadius, migrateCustomColorsAndGradients, migrateAlign), save({ attributes }) { const { backgroundColor, borderRadius, customBackgroundColor, customTextColor, customGradient, linkTarget, gradient, rel, text, textColor, title, url } = attributes; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const backgroundClass = !customGradient && (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const buttonClasses = dist_clsx('wp-block-button__link', { 'has-text-color': textColor || customTextColor, [textClass]: textClass, 'has-background': backgroundColor || customBackgroundColor || customGradient || gradient, [backgroundClass]: backgroundClass, 'no-border-radius': borderRadius === 0, [gradientClass]: gradientClass }); const buttonStyle = { background: customGradient ? customGradient : undefined, backgroundColor: backgroundClass || customGradient || gradient ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor, borderRadius: borderRadius ? borderRadius + 'px' : undefined }; // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, title: title, style: buttonStyle, value: text, target: linkTarget, rel: rel }) }); } }, { attributes: { ...blockAttributes, align: { type: 'string', default: 'none' }, backgroundColor: { type: 'string' }, textColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, customTextColor: { type: 'string' }, linkTarget: { type: 'string', source: 'attribute', selector: 'a', attribute: 'target' }, rel: { type: 'string', source: 'attribute', selector: 'a', attribute: 'rel' }, placeholder: { type: 'string' } }, isEligible(attribute) { return attribute.className && attribute.className.includes('is-style-squared'); }, migrate(attributes) { let newClassName = attributes.className; if (newClassName) { newClassName = newClassName.replace(/is-style-squared[\s]?/, '').trim(); } return migrateBorderRadius(migrateCustomColorsAndGradients({ ...attributes, className: newClassName ? newClassName : undefined, borderRadius: 0 })); }, save({ attributes }) { const { backgroundColor, customBackgroundColor, customTextColor, linkTarget, rel, text, textColor, title, url } = attributes; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const buttonClasses = dist_clsx('wp-block-button__link', { 'has-text-color': textColor || customTextColor, [textClass]: textClass, 'has-background': backgroundColor || customBackgroundColor, [backgroundClass]: backgroundClass }); const buttonStyle = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, title: title, style: buttonStyle, value: text, target: linkTarget, rel: rel }) }); } }, { attributes: { ...blockAttributes, align: { type: 'string', default: 'none' }, backgroundColor: { type: 'string' }, textColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, customTextColor: { type: 'string' } }, migrate: oldColorsMigration, save({ attributes }) { const { url, text, title, backgroundColor, textColor, customBackgroundColor, customTextColor } = attributes; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const buttonClasses = dist_clsx('wp-block-button__link', { 'has-text-color': textColor || customTextColor, [textClass]: textClass, 'has-background': backgroundColor || customBackgroundColor, [backgroundClass]: backgroundClass }); const buttonStyle = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: buttonClasses, href: url, title: title, style: buttonStyle, value: text }) }); } }, { attributes: { ...blockAttributes, color: { type: 'string' }, textColor: { type: 'string' }, align: { type: 'string', default: 'none' } }, save({ attributes }) { const { url, text, title, align, color, textColor } = attributes; const buttonStyle = { backgroundColor: color, color: textColor }; const linkClass = 'wp-block-button__link'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `align${align}`, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", className: linkClass, href: url, title: title, style: buttonStyle, value: text }) }); }, migrate: oldColorsMigration }, { attributes: { ...blockAttributes, color: { type: 'string' }, textColor: { type: 'string' }, align: { type: 'string', default: 'none' } }, save({ attributes }) { const { url, text, title, align, color, textColor } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `align${align}`, style: { backgroundColor: color }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "a", href: url, title: title, style: { color: textColor }, value: text }) }); }, migrate: oldColorsMigration }]; /* harmony default export */ const button_deprecated = (deprecated_deprecated); ;// ./node_modules/@wordpress/block-library/build-module/button/constants.js const NEW_TAB_REL = 'noreferrer noopener'; const NEW_TAB_TARGET = '_blank'; const NOFOLLOW_REL = 'nofollow'; ;// ./node_modules/@wordpress/block-library/build-module/button/get-updated-link-attributes.js /** * Internal dependencies */ /** * WordPress dependencies */ /** * Updates the link attributes. * * @param {Object} attributes The current block attributes. * @param {string} attributes.rel The current link rel attribute. * @param {string} attributes.url The current link url. * @param {boolean} attributes.opensInNewTab Whether the link should open in a new window. * @param {boolean} attributes.nofollow Whether the link should be marked as nofollow. */ function getUpdatedLinkAttributes({ rel = '', url = '', opensInNewTab, nofollow }) { let newLinkTarget; // Since `rel` is editable attribute, we need to check for existing values and proceed accordingly. let updatedRel = rel; if (opensInNewTab) { newLinkTarget = NEW_TAB_TARGET; updatedRel = updatedRel?.includes(NEW_TAB_REL) ? updatedRel : updatedRel + ` ${NEW_TAB_REL}`; } else { const relRegex = new RegExp(`\\b${NEW_TAB_REL}\\s*`, 'g'); updatedRel = updatedRel?.replace(relRegex, '').trim(); } if (nofollow) { updatedRel = updatedRel?.includes(NOFOLLOW_REL) ? updatedRel : (updatedRel + ` ${NOFOLLOW_REL}`).trim(); } else { const relRegex = new RegExp(`\\b${NOFOLLOW_REL}\\s*`, 'g'); updatedRel = updatedRel?.replace(relRegex, '').trim(); } return { url: (0,external_wp_url_namespaceObject.prependHTTP)(url), linkTarget: newLinkTarget, rel: updatedRel || undefined }; } ;// ./node_modules/@wordpress/block-library/build-module/utils/remove-anchor-tag.js /** * Removes anchor tags from a string. * * @param {string} value The value to remove anchor tags from. * * @return {string} The value with anchor tags removed. */ function removeAnchorTag(value) { // To do: Refactor this to use rich text's removeFormat instead. return value.toString().replace(/<\/?a[^>]*>/g, ''); } ;// external ["wp","keycodes"] const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"]; ;// ./node_modules/@wordpress/icons/build-module/library/link.js /** * WordPress dependencies */ const link_link = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) }); /* harmony default export */ const library_link = (link_link); ;// ./node_modules/@wordpress/icons/build-module/library/link-off.js /** * WordPress dependencies */ const linkOff = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.031 4.703 15.576 4l-1.56 3H14v.03l-2.324 4.47H9.5V13h1.396l-1.502 2.889h-.95a3.694 3.694 0 0 1 0-7.389H10V7H8.444a5.194 5.194 0 1 0 0 10.389h.17L7.5 19.53l1.416.719L15.049 8.5h.507a3.694 3.694 0 0 1 0 7.39H14v1.5h1.556a5.194 5.194 0 0 0 .273-10.383l1.202-2.304Z" }) }); /* harmony default export */ const link_off = (linkOff); ;// ./node_modules/@wordpress/block-library/build-module/button/edit.js /** * External dependencies */ /** * Internal dependencies */ /** * WordPress dependencies */ const LINK_SETTINGS = [...external_wp_blockEditor_namespaceObject.LinkControl.DEFAULT_LINK_SETTINGS, { id: 'nofollow', title: (0,external_wp_i18n_namespaceObject.__)('Mark as nofollow') }]; function useEnter(props) { const { replaceBlocks, selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { getBlock, getBlockRootClientId, getBlockIndex } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); propsRef.current = props; return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { function onKeyDown(event) { if (event.defaultPrevented || event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { return; } const { content, clientId } = propsRef.current; if (content.length) { return; } event.preventDefault(); const topParentListBlock = getBlock(getBlockRootClientId(clientId)); const blockIndex = getBlockIndex(clientId); const head = (0,external_wp_blocks_namespaceObject.cloneBlock)({ ...topParentListBlock, innerBlocks: topParentListBlock.innerBlocks.slice(0, blockIndex) }); const middle = (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()); const after = topParentListBlock.innerBlocks.slice(blockIndex + 1); const tail = after.length ? [(0,external_wp_blocks_namespaceObject.cloneBlock)({ ...topParentListBlock, innerBlocks: after })] : []; replaceBlocks(topParentListBlock.clientId, [head, middle, ...tail], 1); // We manually change the selection here because we are replacing // a different block than the selected one. selectionChange(middle.clientId); } element.addEventListener('keydown', onKeyDown); return () => { element.removeEventListener('keydown', onKeyDown); }; }, []); } function WidthPanel({ selectedWidth, setAttributes }) { const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => setAttributes({ width: undefined }), dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Width'), isShownByDefault: true, hasValue: () => !!selectedWidth, onDeselect: () => setAttributes({ width: undefined }), __nextHasNoMarginBottom: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { label: (0,external_wp_i18n_namespaceObject.__)('Width'), value: selectedWidth, onChange: newWidth => setAttributes({ width: newWidth }), isBlock: true, __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, children: [25, 50, 75, 100].map(widthValue => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: widthValue, label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: Percentage value. */ (0,external_wp_i18n_namespaceObject.__)('%d%%'), widthValue) }, widthValue); }) }) }) }); } function ButtonEdit(props) { const { attributes, setAttributes, className, isSelected, onReplace, mergeBlocks, clientId, context } = props; const { tagName, textAlign, linkTarget, placeholder, rel, style, text, url, width, metadata } = attributes; const TagName = tagName || 'a'; function onKeyDown(event) { if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) { startEditing(event); } else if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primaryShift(event, 'k')) { unlink(); richTextRef.current?.focus(); } } // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); const ref = (0,external_wp_element_namespaceObject.useRef)(); const richTextRef = (0,external_wp_element_namespaceObject.useRef)(); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, ref]), onKeyDown }); const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false); const isURLSet = !!url; const opensInNewTab = linkTarget === NEW_TAB_TARGET; const nofollow = !!rel?.includes(NOFOLLOW_REL); const isLinkTag = 'a' === TagName; function startEditing(event) { event.preventDefault(); setIsEditingURL(true); } function unlink() { setAttributes({ url: undefined, linkTarget: undefined, rel: undefined }); setIsEditingURL(false); } (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isSelected) { setIsEditingURL(false); } }, [isSelected]); // Memoize link value to avoid overriding the LinkControl's internal state. // This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/51256. const linkValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({ url, opensInNewTab, nofollow }), [url, opensInNewTab, nofollow]); const useEnterRef = useEnter({ content: text, clientId }); const mergedRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([useEnterRef, richTextRef]); const { lockUrlControls = false } = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!isSelected) { return {}; } const blockBindingsSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(metadata?.bindings?.url?.source); return { lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue?.({ select, context, args: metadata?.bindings?.url?.args }) }; }, [context, isSelected, metadata?.bindings?.url]); const [fluidTypographySettings, layout] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.fluid', 'layout'); const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, { typography: { fluid: fluidTypographySettings }, layout: { wideSize: layout?.wideSize } }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, className: dist_clsx(blockProps.className, { [`has-custom-width wp-block-button__width-${width}`]: width }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { ref: mergedRef, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'), placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Add text…'), value: text, onChange: value => setAttributes({ text: removeAnchorTag(value) }), withoutInteractiveFormatting: true, className: dist_clsx(className, 'wp-block-button__link', colorProps.className, borderProps.className, typographyProps.className, { [`has-text-align-${textAlign}`]: textAlign, // For backwards compatibility add style that isn't // provided via block support. 'no-border-radius': style?.border?.radius === 0, [`has-custom-font-size`]: blockProps.style.fontSize }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), style: { ...borderProps.style, ...colorProps.style, ...spacingProps.style, ...shadowProps.style, ...typographyProps.style, writingMode: undefined }, onReplace: onReplace, onMerge: mergeBlocks, identifier: "text" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }), !isURLSet && isLinkTag && !lockUrlControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { name: "link", icon: library_link, title: (0,external_wp_i18n_namespaceObject.__)('Link'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), onClick: startEditing }), isURLSet && isLinkTag && !lockUrlControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { name: "link", icon: link_off, title: (0,external_wp_i18n_namespaceObject.__)('Unlink'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primaryShift('k'), onClick: unlink, isActive: true })] }), isLinkTag && isSelected && (isEditingURL || isURLSet) && !lockUrlControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { placement: "bottom", onClose: () => { setIsEditingURL(false); richTextRef.current?.focus(); }, anchor: popoverAnchor, focusOnMount: isEditingURL ? 'firstElement' : false, __unstableSlotName: "__unstable-block-tools-after", shift: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.LinkControl, { value: linkValue, onChange: ({ url: newURL, opensInNewTab: newOpensInNewTab, nofollow: newNofollow }) => setAttributes(getUpdatedLinkAttributes({ rel, url: newURL, opensInNewTab: newOpensInNewTab, nofollow: newNofollow })), onRemove: () => { unlink(); richTextRef.current?.focus(); }, forceIsEditingLink: isEditingURL, settings: LINK_SETTINGS }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WidthPanel, { selectedWidth: width, setAttributes: setAttributes }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: isLinkTag && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), value: rel || '', onChange: newRel => setAttributes({ rel: newRel }) }) })] }); } /* harmony default export */ const button_edit = (ButtonEdit); ;// ./node_modules/@wordpress/block-library/build-module/button/save.js /** * External dependencies */ /** * WordPress dependencies */ function save_save({ attributes, className }) { const { tagName, type, textAlign, fontSize, linkTarget, rel, style, text, title, url, width } = attributes; const TagName = tagName || 'a'; const isButtonTag = 'button' === TagName; const buttonType = type || 'button'; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes); const buttonClasses = dist_clsx('wp-block-button__link', colorProps.className, borderProps.className, typographyProps.className, { [`has-text-align-${textAlign}`]: textAlign, // For backwards compatibility add style that isn't provided via // block support. 'no-border-radius': style?.border?.radius === 0, [`has-custom-font-size`]: fontSize || style?.typography?.fontSize }, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')); const buttonStyle = { ...borderProps.style, ...colorProps.style, ...spacingProps.style, ...shadowProps.style, ...typographyProps.style, writingMode: undefined }; // The use of a `title` attribute here is soft-deprecated, but still applied // if it had already been assigned, for the sake of backward-compatibility. // A title will no longer be assigned for new or updated button block links. const wrapperClasses = dist_clsx(className, { [`has-custom-width wp-block-button__width-${width}`]: width }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: TagName, type: isButtonTag ? buttonType : null, className: buttonClasses, href: isButtonTag ? null : url, title: title, style: buttonStyle, value: text, target: isButtonTag ? null : linkTarget, rel: isButtonTag ? null : rel }) }); } ;// ./node_modules/@wordpress/block-library/build-module/button/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const button_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/button", title: "Button", category: "design", parent: ["core/buttons"], description: "Prompt visitors to take action with a button-style link.", keywords: ["link"], textdomain: "default", attributes: { tagName: { type: "string", "enum": ["a", "button"], "default": "a" }, type: { type: "string", "default": "button" }, textAlign: { type: "string" }, url: { type: "string", source: "attribute", selector: "a", attribute: "href", role: "content" }, title: { type: "string", source: "attribute", selector: "a,button", attribute: "title", role: "content" }, text: { type: "rich-text", source: "rich-text", selector: "a,button", role: "content" }, linkTarget: { type: "string", source: "attribute", selector: "a", attribute: "target", role: "content" }, rel: { type: "string", source: "attribute", selector: "a", attribute: "rel", role: "content" }, placeholder: { type: "string" }, backgroundColor: { type: "string" }, textColor: { type: "string" }, gradient: { type: "string" }, width: { type: "number" } }, supports: { anchor: true, splitting: true, align: false, alignWide: false, color: { __experimentalSkipSerialization: true, gradients: true, __experimentalDefaultControls: { background: true, text: true } }, typography: { __experimentalSkipSerialization: ["fontSize", "lineHeight", "fontFamily", "fontWeight", "fontStyle", "textTransform", "textDecoration", "letterSpacing"], fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalWritingMode: true, __experimentalDefaultControls: { fontSize: true } }, reusable: false, shadow: { __experimentalSkipSerialization: true }, spacing: { __experimentalSkipSerialization: true, padding: ["horizontal", "vertical"], __experimentalDefaultControls: { padding: true } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, interactivity: { clientNavigation: true } }, styles: [{ name: "fill", label: "Fill", isDefault: true }, { name: "outline", label: "Outline" }], editorStyle: "wp-block-button-editor", style: "wp-block-button", selectors: { root: ".wp-block-button .wp-block-button__link", typography: { writingMode: ".wp-block-button" } } }; const { name: button_name } = button_metadata; const button_settings = { icon: library_button, example: { attributes: { className: 'is-style-fill', text: (0,external_wp_i18n_namespaceObject.__)('Call to action') } }, edit: button_edit, save: save_save, deprecated: button_deprecated, merge: (a, { text = '' }) => ({ ...a, text: (a.text || '') + text }) }; const button_init = () => initBlock({ name: button_name, metadata: button_metadata, settings: button_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/buttons.js /** * WordPress dependencies */ const buttons = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.5 17.5H9.5V16H14.5V17.5Z M14.5 8H9.5V6.5H14.5V8Z M7 3.5H17C18.1046 3.5 19 4.39543 19 5.5V9C19 10.1046 18.1046 11 17 11H7C5.89543 11 5 10.1046 5 9V5.5C5 4.39543 5.89543 3.5 7 3.5ZM17 5H7C6.72386 5 6.5 5.22386 6.5 5.5V9C6.5 9.27614 6.72386 9.5 7 9.5H17C17.2761 9.5 17.5 9.27614 17.5 9V5.5C17.5 5.22386 17.2761 5 17 5Z M7 13H17C18.1046 13 19 13.8954 19 15V18.5C19 19.6046 18.1046 20.5 17 20.5H7C5.89543 20.5 5 19.6046 5 18.5V15C5 13.8954 5.89543 13 7 13ZM17 14.5H7C6.72386 14.5 6.5 14.7239 6.5 15V18.5C6.5 18.7761 6.72386 19 7 19H17C17.2761 19 17.5 18.7761 17.5 18.5V15C17.5 14.7239 17.2761 14.5 17 14.5Z" }) }); /* harmony default export */ const library_buttons = (buttons); ;// ./node_modules/@wordpress/block-library/build-module/buttons/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * @param {Object} attributes Block's attributes. */ const migrateWithLayout = attributes => { if (!!attributes.layout) { return attributes; } const { contentJustification, orientation, ...updatedAttributes } = attributes; if (contentJustification || orientation) { Object.assign(updatedAttributes, { layout: { type: 'flex', ...(contentJustification && { justifyContent: contentJustification }), ...(orientation && { orientation }) } }); } return updatedAttributes; }; const buttons_deprecated_deprecated = [{ attributes: { contentJustification: { type: 'string' }, orientation: { type: 'string', default: 'horizontal' } }, supports: { anchor: true, align: ['wide', 'full'], __experimentalExposeControlsToChildren: true, spacing: { blockGap: true, margin: ['top', 'bottom'], __experimentalDefaultControls: { blockGap: true } } }, isEligible: ({ contentJustification, orientation }) => !!contentJustification || !!orientation, migrate: migrateWithLayout, save({ attributes: { contentJustification, orientation } }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: dist_clsx({ [`is-content-justification-${contentJustification}`]: contentJustification, 'is-vertical': orientation === 'vertical' }) }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } }, { supports: { align: ['center', 'left', 'right'], anchor: true }, save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); }, isEligible({ align }) { return align && ['center', 'left', 'right'].includes(align); }, migrate(attributes) { return migrateWithLayout({ ...attributes, align: undefined, // Floating Buttons blocks shouldn't have been supported in the // first place. Most users using them probably expected them to // act like content justification controls, so these blocks are // migrated to use content justification. // As for center-aligned Buttons blocks, the content justification // equivalent will create an identical end result in most cases. contentJustification: attributes.align }); } }]; /* harmony default export */ const buttons_deprecated = (buttons_deprecated_deprecated); ;// external ["wp","richText"] const external_wp_richText_namespaceObject = window["wp"]["richText"]; ;// ./node_modules/@wordpress/block-library/build-module/utils/get-transformed-metadata.js /** * WordPress dependencies */ /** * Transform the metadata attribute with only the values and bindings specified by each transform. * Returns `undefined` if the input metadata is falsy. * * @param {Object} metadata Original metadata attribute from the block that is being transformed. * @param {Object} newBlockName Name of the final block after the transformation. * @param {Function} bindingsCallback Optional callback to transform the `bindings` property object. * @return {Object|undefined} New metadata object only with the relevant properties. */ function getTransformedMetadata(metadata, newBlockName, bindingsCallback) { if (!metadata) { return; } const { supports } = (0,external_wp_blocks_namespaceObject.getBlockType)(newBlockName); // Fixed until an opt-in mechanism is implemented. const BLOCK_BINDINGS_SUPPORTED_BLOCKS = ['core/paragraph', 'core/heading', 'core/image', 'core/button']; // The metadata properties that should be preserved after the transform. const transformSupportedProps = []; // If it support bindings, and there is a transform bindings callback, add the `id` and `bindings` properties. if (BLOCK_BINDINGS_SUPPORTED_BLOCKS.includes(newBlockName) && bindingsCallback) { transformSupportedProps.push('id', 'bindings'); } // If it support block naming (true by default), add the `name` property. if (supports.renaming !== false) { transformSupportedProps.push('name'); } // Return early if no supported properties. if (!transformSupportedProps.length) { return; } const newMetadata = Object.entries(metadata).reduce((obj, [prop, value]) => { // If prop is not supported, don't add it to the new metadata object. if (!transformSupportedProps.includes(prop)) { return obj; } obj[prop] = prop === 'bindings' ? bindingsCallback(value) : value; return obj; }, {}); // Return undefined if object is empty. return Object.keys(newMetadata).length ? newMetadata : undefined; } ;// ./node_modules/@wordpress/block-library/build-module/buttons/transforms.js /** * WordPress dependencies */ /** * Internal dependencies */ const transforms_transforms = { from: [{ type: 'block', isMultiBlock: true, blocks: ['core/button'], transform: buttons => // Creates the buttons block. (0,external_wp_blocks_namespaceObject.createBlock)('core/buttons', {}, // Loop the selected buttons. buttons.map(attributes => // Create singular button in the buttons block. (0,external_wp_blocks_namespaceObject.createBlock)('core/button', attributes))) }, { type: 'block', isMultiBlock: true, blocks: ['core/paragraph'], transform: buttons => // Creates the buttons block. (0,external_wp_blocks_namespaceObject.createBlock)('core/buttons', {}, // Loop the selected buttons. buttons.map(attributes => { const { content, metadata } = attributes; const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, content); // Remove any HTML tags. const text = element.innerText || ''; // Get first url. const link = element.querySelector('a'); const url = link?.getAttribute('href'); // Create singular button in the buttons block. return (0,external_wp_blocks_namespaceObject.createBlock)('core/button', { text, url, metadata: getTransformedMetadata(metadata, 'core/button', ({ content: contentBinding }) => ({ text: contentBinding })) }); })), isMatch: paragraphs => { return paragraphs.every(attributes => { const element = (0,external_wp_richText_namespaceObject.__unstableCreateElement)(document, attributes.content); const text = element.innerText || ''; const links = element.querySelectorAll('a'); return text.length <= 30 && links.length <= 1; }); } }] }; /* harmony default export */ const buttons_transforms = (transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/buttons/edit.js /** * External dependencies */ /** * WordPress dependencies */ const DEFAULT_BLOCK = { name: 'core/button', attributesToCopy: ['backgroundColor', 'border', 'className', 'fontFamily', 'fontSize', 'gradient', 'style', 'textColor', 'width'] }; function ButtonsEdit({ attributes, className }) { var _layout$orientation; const { fontSize, layout, style } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx(className, { 'has-custom-font-size': fontSize || style?.typography?.fontSize }) }); const { hasButtonVariations } = (0,external_wp_data_namespaceObject.useSelect)(select => { const buttonVariations = select(external_wp_blocks_namespaceObject.store).getBlockVariations('core/button', 'inserter'); return { hasButtonVariations: buttonVariations.length > 0 }; }, []); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { defaultBlock: DEFAULT_BLOCK, // This check should be handled by the `Inserter` internally to be consistent across all blocks that use it. directInsert: !hasButtonVariations, template: [['core/button']], templateInsertUpdatesSelection: true, orientation: (_layout$orientation = layout?.orientation) !== null && _layout$orientation !== void 0 ? _layout$orientation : 'horizontal' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }); } /* harmony default export */ const buttons_edit = (ButtonsEdit); ;// ./node_modules/@wordpress/block-library/build-module/buttons/save.js /** * External dependencies */ /** * WordPress dependencies */ function buttons_save_save({ attributes, className }) { const { fontSize, style } = attributes; const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: dist_clsx(className, { 'has-custom-font-size': fontSize || style?.typography?.fontSize }) }); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }); } ;// ./node_modules/@wordpress/block-library/build-module/buttons/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const buttons_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/buttons", title: "Buttons", category: "design", allowedBlocks: ["core/button"], description: "Prompt visitors to take action with a group of button-style links.", keywords: ["link"], textdomain: "default", supports: { anchor: true, align: ["wide", "full"], html: false, __experimentalExposeControlsToChildren: true, color: { gradients: true, text: false, __experimentalDefaultControls: { background: true } }, spacing: { blockGap: ["horizontal", "vertical"], padding: true, margin: ["top", "bottom"], __experimentalDefaultControls: { blockGap: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, layout: { allowSwitching: false, allowInheriting: false, "default": { type: "flex" } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-buttons-editor", style: "wp-block-buttons" }; const { name: buttons_name } = buttons_metadata; const buttons_settings = { icon: library_buttons, example: { attributes: { layout: { type: 'flex', justifyContent: 'center' } }, innerBlocks: [{ name: 'core/button', attributes: { text: (0,external_wp_i18n_namespaceObject.__)('Find out more') } }, { name: 'core/button', attributes: { text: (0,external_wp_i18n_namespaceObject.__)('Contact us') } }] }, deprecated: buttons_deprecated, transforms: buttons_transforms, edit: buttons_edit, save: buttons_save_save }; const buttons_init = () => initBlock({ name: buttons_name, metadata: buttons_metadata, settings: buttons_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/calendar.js /** * WordPress dependencies */ const calendar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z" }) }); /* harmony default export */ const library_calendar = (calendar); ;// ./node_modules/@wordpress/block-library/build-module/calendar/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Returns the year and month of a specified date. * * @see `WP_REST_Posts_Controller::prepare_date_response()`. * * @param {string} date Date in `ISO8601/RFC3339` format. * @return {Object} Year and date of the specified date. */ const getYearMonth = memize(date => { if (!date) { return {}; } const dateObj = new Date(date); return { year: dateObj.getFullYear(), month: dateObj.getMonth() + 1 }; }); function CalendarEdit({ attributes }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const { date, hasPosts, hasPostsResolved } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecords, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); const singlePublishedPostQuery = { status: 'publish', per_page: 1 }; const posts = getEntityRecords('postType', 'post', singlePublishedPostQuery); const postsResolved = hasFinishedResolution('getEntityRecords', ['postType', 'post', singlePublishedPostQuery]); let _date; // FIXME: @wordpress/block-library should not depend on @wordpress/editor. // Blocks can be loaded into a *non-post* block editor. // eslint-disable-next-line @wordpress/data-no-store-string-literals const editorSelectors = select('core/editor'); if (editorSelectors) { const postType = editorSelectors.getEditedPostAttribute('type'); // Dates are used to overwrite year and month used on the calendar. // This overwrite should only happen for 'post' post types. // For other post types the calendar always displays the current month. if (postType === 'post') { _date = editorSelectors.getEditedPostAttribute('date'); } } return { date: _date, hasPostsResolved: postsResolved, hasPosts: postsResolved && posts?.length === 1 }; }, []); if (!hasPosts) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { icon: library_calendar, label: (0,external_wp_i18n_namespaceObject.__)('Calendar'), children: !hasPostsResolved ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)('No published posts found.') }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { block: "core/calendar", attributes: { ...attributes, ...getYearMonth(date) } }) }) }); } ;// ./node_modules/@wordpress/block-library/build-module/calendar/transforms.js /** * WordPress dependencies */ const calendar_transforms_transforms = { from: [{ type: 'block', blocks: ['core/archives'], transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/calendar') }], to: [{ type: 'block', blocks: ['core/archives'], transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/archives') }] }; /* harmony default export */ const calendar_transforms = (calendar_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/calendar/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const calendar_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/calendar", title: "Calendar", category: "widgets", description: "A calendar of your site\u2019s posts.", keywords: ["posts", "archive"], textdomain: "default", attributes: { month: { type: "integer" }, year: { type: "integer" } }, supports: { align: true, color: { link: true, __experimentalSkipSerialization: ["text", "background"], __experimentalDefaultControls: { background: true, text: true }, __experimentalSelector: "table, th" }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, style: "wp-block-calendar" }; const { name: calendar_name } = calendar_metadata; const calendar_settings = { icon: library_calendar, example: {}, edit: CalendarEdit, transforms: calendar_transforms }; const calendar_init = () => initBlock({ name: calendar_name, metadata: calendar_metadata, settings: calendar_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/category.js /** * WordPress dependencies */ const category = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z", fillRule: "evenodd", clipRule: "evenodd" }) }); /* harmony default export */ const library_category = (category); ;// external ["wp","htmlEntities"] const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"]; ;// ./node_modules/@wordpress/icons/build-module/library/pin.js /** * WordPress dependencies */ const pin = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" }) }); /* harmony default export */ const library_pin = (pin); ;// ./node_modules/@wordpress/block-library/build-module/categories/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function CategoriesEdit({ attributes: { displayAsDropdown, showHierarchy, showPostCounts, showOnlyTopLevel, showEmpty, label, showLabel, taxonomy: taxonomySlug }, setAttributes, className }) { const selectId = (0,external_wp_compose_namespaceObject.useInstanceId)(CategoriesEdit, 'blocks-category-select'); const { records: allTaxonomies, isResolvingTaxonomies } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'taxonomy'); const taxonomies = allTaxonomies?.filter(t => t.visibility.public); const taxonomy = taxonomies?.find(t => t.slug === taxonomySlug); const isHierarchicalTaxonomy = !isResolvingTaxonomies && taxonomy?.hierarchical; const query = { per_page: -1, hide_empty: !showEmpty, context: 'view' }; if (isHierarchicalTaxonomy && showOnlyTopLevel) { query.parent = 0; } const { records: categories, isResolving } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('taxonomy', taxonomySlug, query); const getCategoriesList = parentId => { if (!categories?.length) { return []; } if (parentId === null) { return categories; } return categories.filter(({ parent }) => parent === parentId); }; const toggleAttribute = attributeName => newValue => setAttributes({ [attributeName]: newValue }); const renderCategoryName = name => !name ? (0,external_wp_i18n_namespaceObject.__)('(Untitled)') : (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(name).trim(); const renderCategoryList = () => { const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null; const categoriesList = getCategoriesList(parentId); return categoriesList.map(category => renderCategoryListItem(category)); }; const renderCategoryListItem = category => { const childCategories = getCategoriesList(category.id); const { id, link, count, name } = category; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: `cat-item cat-item-${id}`, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: link, target: "_blank", rel: "noreferrer noopener", children: renderCategoryName(name) }), showPostCounts && ` (${count})`, isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "children", children: childCategories.map(childCategory => renderCategoryListItem(childCategory)) })] }, id); }; const renderCategoryDropdown = () => { const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null; const categoriesList = getCategoriesList(parentId); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [showLabel ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { className: "wp-block-categories__label", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'), placeholder: taxonomy.name, withoutInteractiveFormatting: true, value: label, onChange: html => setAttributes({ label: html }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { as: "label", htmlFor: selectId, children: label ? label : taxonomy.name }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("select", { id: selectId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("option", { children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: taxonomy's singular name */ (0,external_wp_i18n_namespaceObject.__)('Select %s'), taxonomy.labels.singular_name) }), categoriesList.map(category => renderCategoryDropdownItem(category, 0))] })] }); }; const renderCategoryDropdownItem = (category, level) => { const { id, count, name } = category; const childCategories = getCategoriesList(id); return [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("option", { className: `level-${level}`, children: [Array.from({ length: level * 3 }).map(() => '\xa0'), renderCategoryName(name), showPostCounts && ` (${count})`] }, id), isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && childCategories.map(childCategory => renderCategoryDropdownItem(childCategory, level + 1))]; }; const TagName = !!categories?.length && !displayAsDropdown && !isResolving ? 'ul' : 'div'; const classes = dist_clsx(className, { 'wp-block-categories-list': !!categories?.length && !displayAsDropdown && !isResolving, 'wp-block-categories-dropdown': !!categories?.length && displayAsDropdown && !isResolving }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes }); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ taxonomy: 'category', displayAsDropdown: false, showHierarchy: false, showPostCounts: false, showOnlyTopLevel: false, showEmpty: false, showLabel: true }); }, dropdownMenuProps: dropdownMenuProps, children: [Array.isArray(taxonomies) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => { return taxonomySlug !== 'category'; }, label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'), onDeselect: () => { setAttributes({ taxonomy: 'category' }); }, isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'), options: taxonomies.map(t => ({ label: t.name, value: t.slug })), value: taxonomySlug, onChange: selectedTaxonomy => setAttributes({ taxonomy: selectedTaxonomy }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!displayAsDropdown, label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), onDeselect: () => setAttributes({ displayAsDropdown: false }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display as dropdown'), checked: displayAsDropdown, onChange: toggleAttribute('displayAsDropdown') }) }), displayAsDropdown && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !showLabel, label: (0,external_wp_i18n_namespaceObject.__)('Show label'), onDeselect: () => setAttributes({ showLabel: true }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, className: "wp-block-categories__indentation", label: (0,external_wp_i18n_namespaceObject.__)('Show label'), checked: showLabel, onChange: toggleAttribute('showLabel') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!showPostCounts, label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), onDeselect: () => setAttributes({ showPostCounts: false }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show post counts'), checked: showPostCounts, onChange: toggleAttribute('showPostCounts') }) }), isHierarchicalTaxonomy && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!showOnlyTopLevel, label: (0,external_wp_i18n_namespaceObject.__)('Show only top level terms'), onDeselect: () => setAttributes({ showOnlyTopLevel: false }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show only top level terms'), checked: showOnlyTopLevel, onChange: toggleAttribute('showOnlyTopLevel') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!showEmpty, label: (0,external_wp_i18n_namespaceObject.__)('Show empty terms'), onDeselect: () => setAttributes({ showEmpty: false }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show empty terms'), checked: showEmpty, onChange: toggleAttribute('showEmpty') }) }), isHierarchicalTaxonomy && !showOnlyTopLevel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!showHierarchy, label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'), onDeselect: () => setAttributes({ showHierarchy: false }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show hierarchy'), checked: showHierarchy, onChange: toggleAttribute('showHierarchy') }) })] }) }), isResolving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { icon: library_pin, label: (0,external_wp_i18n_namespaceObject.__)('Terms'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }), !isResolving && categories?.length === 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: taxonomy.labels.no_terms }), !isResolving && categories?.length > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList())] }); } ;// ./node_modules/@wordpress/block-library/build-module/categories/variations.js /** * WordPress dependencies */ const variations = [{ name: 'terms', title: (0,external_wp_i18n_namespaceObject.__)('Terms List'), icon: library_category, attributes: { // We need to set an attribute here that will be set when inserting the block. // We cannot leave this empty, as that would be interpreted as the default value, // which is `category` -- for which we're defining a distinct variation below, // for backwards compatibility reasons. // The logical fallback is thus the only other built-in and public taxonomy: Tags. taxonomy: 'post_tag' }, isActive: blockAttributes => // This variation is used for any taxonomy other than `category`. blockAttributes.taxonomy !== 'category' }, { name: 'categories', title: (0,external_wp_i18n_namespaceObject.__)('Categories List'), description: (0,external_wp_i18n_namespaceObject.__)('Display a list of all categories.'), icon: library_category, attributes: { taxonomy: 'category' }, isActive: ['taxonomy'], // The following is needed to prevent "Terms List" from showing up twice in the inserter // (once for the block, once for the variation). Fortunately, it does not collide with // `categories` being the default value of the `taxonomy` attribute. isDefault: true }]; /* harmony default export */ const categories_variations = (variations); ;// ./node_modules/@wordpress/block-library/build-module/categories/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const categories_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/categories", title: "Terms List", category: "widgets", description: "Display a list of all terms of a given taxonomy.", keywords: ["categories"], textdomain: "default", attributes: { taxonomy: { type: "string", "default": "category" }, displayAsDropdown: { type: "boolean", "default": false }, showHierarchy: { type: "boolean", "default": false }, showPostCounts: { type: "boolean", "default": false }, showOnlyTopLevel: { type: "boolean", "default": false }, showEmpty: { type: "boolean", "default": false }, label: { type: "string", role: "content" }, showLabel: { type: "boolean", "default": true } }, usesContext: ["enhancedPagination"], supports: { align: true, html: false, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, editorStyle: "wp-block-categories-editor", style: "wp-block-categories" }; const { name: categories_name } = categories_metadata; const categories_settings = { icon: library_category, example: {}, edit: CategoriesEdit, variations: categories_variations }; const categories_init = () => initBlock({ name: categories_name, metadata: categories_metadata, settings: categories_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/classic.js /** * WordPress dependencies */ const classic = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z" }) }); /* harmony default export */ const library_classic = (classic); ;// ./node_modules/@wordpress/block-library/build-module/freeform/convert-to-blocks-button.js /** * WordPress dependencies */ const ConvertToBlocksButton = ({ clientId }) => { const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const block = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId); }, [clientId]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => replaceBlocks(block.clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({ HTML: (0,external_wp_blocks_namespaceObject.serialize)(block) })), children: (0,external_wp_i18n_namespaceObject.__)('Convert to blocks') }); }; /* harmony default export */ const convert_to_blocks_button = (ConvertToBlocksButton); ;// ./node_modules/@wordpress/icons/build-module/library/fullscreen.js /** * WordPress dependencies */ const fullscreen = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) }); /* harmony default export */ const library_fullscreen = (fullscreen); ;// ./node_modules/@wordpress/block-library/build-module/freeform/modal.js /** * WordPress dependencies */ function ModalAuxiliaryActions({ onClick, isModalFullScreen }) { // 'small' to match the rules in editor.scss. const isMobileViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<'); if (isMobileViewport) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { size: "compact", onClick: onClick, icon: library_fullscreen, isPressed: isModalFullScreen, label: isModalFullScreen ? (0,external_wp_i18n_namespaceObject.__)('Exit fullscreen') : (0,external_wp_i18n_namespaceObject.__)('Enter fullscreen') }); } function ClassicEdit(props) { const styles = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().styles); (0,external_wp_element_namespaceObject.useEffect)(() => { const { baseURL, suffix, settings } = window.wpEditorL10n.tinymce; window.tinymce.EditorManager.overrideDefaults({ base_url: baseURL, suffix }); window.wp.oldEditor.initialize(props.id, { tinymce: { ...settings, setup(editor) { editor.on('init', () => { const doc = editor.getDoc(); styles.forEach(({ css }) => { const styleEl = doc.createElement('style'); styleEl.innerHTML = css; doc.head.appendChild(styleEl); }); }); } } }); return () => { window.wp.oldEditor.remove(props.id); }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("textarea", { ...props }); } function ModalEdit(props) { const { clientId, attributes: { content }, setAttributes, onReplace } = props; const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false); const [isModalFullScreen, setIsModalFullScreen] = (0,external_wp_element_namespaceObject.useState)(false); const id = `editor-${clientId}`; const onClose = () => content ? setOpen(false) : onReplace([]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => setOpen(true), children: (0,external_wp_i18n_namespaceObject.__)('Edit') }) }) }), content && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: content }), (isOpen || !content) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Classic Editor'), onRequestClose: onClose, shouldCloseOnClickOutside: false, overlayClassName: "block-editor-freeform-modal", isFullScreen: isModalFullScreen, className: "block-editor-freeform-modal__content", headerActions: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ModalAuxiliaryActions, { onClick: () => setIsModalFullScreen(!isModalFullScreen), isModalFullScreen: isModalFullScreen }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ClassicEdit, { id: id, defaultValue: content }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { className: "block-editor-freeform-modal__actions", justify: "flex-end", expanded: false, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onClose, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", onClick: () => { setAttributes({ content: window.wp.oldEditor.getContent(id) }); setOpen(false); }, children: (0,external_wp_i18n_namespaceObject.__)('Save') }) })] })] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/freeform/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const { wp } = window; function isTmceEmpty(editor) { // When tinyMce is empty the content seems to be: // <p><br data-mce-bogus="1"></p> // avoid expensive checks for large documents const body = editor.getBody(); if (body.childNodes.length > 1) { return false; } else if (body.childNodes.length === 0) { return true; } if (body.childNodes[0].childNodes.length > 1) { return false; } return /^\n?$/.test(body.innerText || body.textContent); } function FreeformEdit(props) { const { clientId } = props; const canRemove = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).canRemoveBlock(clientId), [clientId]); const [isIframed, setIsIframed] = (0,external_wp_element_namespaceObject.useState)(false); const ref = (0,external_wp_compose_namespaceObject.useRefEffect)(element => { setIsIframed(element.ownerDocument !== document); }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [canRemove && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(convert_to_blocks_button, { clientId: clientId }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref }), children: isIframed ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ModalEdit, { ...props }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_ClassicEdit, { ...props }) })] }); } function edit_ClassicEdit({ clientId, attributes: { content }, setAttributes, onReplace }) { const { getMultiSelectedBlockClientIds } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const didMountRef = (0,external_wp_element_namespaceObject.useRef)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!didMountRef.current) { return; } const editor = window.tinymce.get(`editor-${clientId}`); if (!editor) { return; } const currentContent = editor.getContent(); if (currentContent !== content) { editor.setContent(content || ''); } }, [clientId, content]); (0,external_wp_element_namespaceObject.useEffect)(() => { const { baseURL, suffix } = window.wpEditorL10n.tinymce; didMountRef.current = true; window.tinymce.EditorManager.overrideDefaults({ base_url: baseURL, suffix }); function onSetup(editor) { let bookmark; if (content) { editor.on('loadContent', () => editor.setContent(content)); } editor.on('blur', () => { bookmark = editor.selection.getBookmark(2, true); // There is an issue with Chrome and the editor.focus call in core at https://core.trac.wordpress.org/browser/trunk/src/js/_enqueues/lib/link.js#L451. // This causes a scroll to the top of editor content on return from some content updating dialogs so tracking // scroll position until this is fixed in core. const scrollContainer = document.querySelector('.interface-interface-skeleton__content'); const scrollPosition = scrollContainer.scrollTop; // Only update attributes if we aren't multi-selecting blocks. // Updating during multi-selection can overwrite attributes of other blocks. if (!getMultiSelectedBlockClientIds()?.length) { setAttributes({ content: editor.getContent() }); } editor.once('focus', () => { if (bookmark) { editor.selection.moveToBookmark(bookmark); if (scrollContainer.scrollTop !== scrollPosition) { scrollContainer.scrollTop = scrollPosition; } } }); return false; }); editor.on('mousedown touchstart', () => { bookmark = null; }); const debouncedOnChange = (0,external_wp_compose_namespaceObject.debounce)(() => { const value = editor.getContent(); if (value !== editor._lastChange) { editor._lastChange = value; setAttributes({ content: value }); } }, 250); editor.on('Paste Change input Undo Redo', debouncedOnChange); // We need to cancel the debounce call because when we remove // the editor (onUnmount) this callback is executed in // another tick. This results in setting the content to empty. editor.on('remove', debouncedOnChange.cancel); editor.on('keydown', event => { if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'z')) { // Prevent the gutenberg undo kicking in so TinyMCE undo stack works as expected. event.stopPropagation(); } if ((event.keyCode === external_wp_keycodes_namespaceObject.BACKSPACE || event.keyCode === external_wp_keycodes_namespaceObject.DELETE) && isTmceEmpty(editor)) { // Delete the block. onReplace([]); event.preventDefault(); event.stopImmediatePropagation(); } const { altKey } = event; /* * Prevent Mousetrap from kicking in: TinyMCE already uses its own * `alt+f10` shortcut to focus its toolbar. */ if (altKey && event.keyCode === external_wp_keycodes_namespaceObject.F10) { event.stopPropagation(); } }); editor.on('init', () => { const rootNode = editor.getBody(); // Create the toolbar by refocussing the editor. if (rootNode.ownerDocument.activeElement === rootNode) { rootNode.blur(); editor.focus(); } }); } function initialize() { const { settings } = window.wpEditorL10n.tinymce; wp.oldEditor.initialize(`editor-${clientId}`, { tinymce: { ...settings, inline: true, content_css: false, fixed_toolbar_container: `#toolbar-${clientId}`, setup: onSetup } }); } function onReadyStateChange() { if (document.readyState === 'complete') { initialize(); } } if (document.readyState === 'complete') { initialize(); } else { document.addEventListener('readystatechange', onReadyStateChange); } return () => { document.removeEventListener('readystatechange', onReadyStateChange); wp.oldEditor.remove(`editor-${clientId}`); didMountRef.current = false; }; }, []); function focus() { const editor = window.tinymce.get(`editor-${clientId}`); if (editor) { editor.focus(); } } function onToolbarKeyDown(event) { // Prevent WritingFlow from kicking in and allow arrows navigation on the toolbar. event.stopPropagation(); // Prevent Mousetrap from moving focus to the top toolbar when pressing `alt+f10` on this block toolbar. event.nativeEvent.stopImmediatePropagation(); } // Disable reasons: // // jsx-a11y/no-static-element-interactions // - the toolbar itself is non-interactive, but must capture events // from the KeyboardShortcuts component to stop their propagation. /* eslint-disable jsx-a11y/no-static-element-interactions */ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { id: `toolbar-${clientId}`, className: "block-library-classic__toolbar", onClick: focus, "data-placeholder": (0,external_wp_i18n_namespaceObject.__)('Classic'), onKeyDown: onToolbarKeyDown }, "toolbar"), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { id: `editor-${clientId}`, className: "wp-block-freeform block-library-rich-text__tinymce" }, "editor")] }); /* eslint-enable jsx-a11y/no-static-element-interactions */ } ;// ./node_modules/@wordpress/block-library/build-module/freeform/save.js /** * WordPress dependencies */ function freeform_save_save({ attributes }) { const { content } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: content }); } ;// ./node_modules/@wordpress/block-library/build-module/freeform/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const freeform_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/freeform", title: "Classic", category: "text", description: "Use the classic WordPress editor.", textdomain: "default", attributes: { content: { type: "string", source: "raw" } }, supports: { className: false, customClassName: false, reusable: false }, editorStyle: "wp-block-freeform-editor" }; const { name: freeform_name } = freeform_metadata; const freeform_settings = { icon: library_classic, edit: FreeformEdit, save: freeform_save_save }; const freeform_init = () => initBlock({ name: freeform_name, metadata: freeform_metadata, settings: freeform_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/code.js /** * WordPress dependencies */ const code = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" }) }); /* harmony default export */ const library_code = (code); ;// ./node_modules/@wordpress/block-library/build-module/code/edit.js /** * WordPress dependencies */ function CodeEdit({ attributes, setAttributes, onRemove, insertBlocksAfter, mergeBlocks }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "code", identifier: "content", value: attributes.content, onChange: content => setAttributes({ content }), onRemove: onRemove, onMerge: mergeBlocks, placeholder: (0,external_wp_i18n_namespaceObject.__)('Write code…'), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Code'), preserveWhiteSpace: true, __unstablePastePlainText: true, __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) }) }); } ;// ./node_modules/@wordpress/block-library/build-module/code/utils.js /** * WordPress dependencies */ /** * Escapes ampersands, shortcodes, and links. * * @param {string} content The content of a code block. * @return {string} The given content with some characters escaped. */ function utils_escape(content) { return (0,external_wp_compose_namespaceObject.pipe)(escapeOpeningSquareBrackets, escapeProtocolInIsolatedUrls)(content || ''); } /** * Returns the given content with all opening shortcode characters converted * into their HTML entity counterpart (i.e. [ => [). For instance, a * shortcode like [embed] becomes [embed] * * This function replicates the escaping of HTML tags, where a tag like * <strong> becomes <strong>. * * @param {string} content The content of a code block. * @return {string} The given content with its opening shortcode characters * converted into their HTML entity counterpart * (i.e. [ => [) */ function escapeOpeningSquareBrackets(content) { return content.replace(/\[/g, '['); } /** * Converts the first two forward slashes of any isolated URL into their HTML * counterparts (i.e. // => //). For instance, https://youtube.com/watch?x * becomes https://youtube.com/watch?x. * * An isolated URL is a URL that sits in its own line, surrounded only by spacing * characters. * * See https://github.com/WordPress/wordpress-develop/blob/5.1.1/src/wp-includes/class-wp-embed.php#L403 * * @param {string} content The content of a code block. * @return {string} The given content with its ampersands converted into * their HTML entity counterpart (i.e. & => &) */ function escapeProtocolInIsolatedUrls(content) { return content.replace(/^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, '$1//$2'); } ;// ./node_modules/@wordpress/block-library/build-module/code/save.js /** * WordPress dependencies */ /** * Internal dependencies */ function code_save_save({ attributes }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "code" // To do: `escape` encodes characters in shortcodes and URLs to // prevent embedding in PHP. Ideally checks for the code block, // or pre/code tags, should be made on the PHP side? , value: utils_escape(typeof attributes.content === 'string' ? attributes.content : attributes.content.toHTMLString({ preserveWhiteSpace: true })) }) }); } ;// ./node_modules/@wordpress/block-library/build-module/code/transforms.js /** * WordPress dependencies */ /** * Internal dependencies */ const code_transforms_transforms = { from: [{ type: 'enter', regExp: /^```$/, transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/code') }, { type: 'block', blocks: ['core/paragraph'], transform: ({ content, metadata }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', { content, metadata: getTransformedMetadata(metadata, 'core/code') }) }, { type: 'block', blocks: ['core/html'], transform: ({ content: text, metadata }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/code', { // The HTML is plain text (with plain line breaks), so // convert it to rich text. content: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: (0,external_wp_richText_namespaceObject.create)({ text }) }), metadata: getTransformedMetadata(metadata, 'core/code') }); } }, { type: 'raw', isMatch: node => node.nodeName === 'PRE' && node.children.length === 1 && node.firstChild.nodeName === 'CODE', schema: { pre: { children: { code: { children: { '#text': {} } } } } } }], to: [{ type: 'block', blocks: ['core/paragraph'], transform: ({ content, metadata }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content, metadata: getTransformedMetadata(metadata, 'core/paragraph') }) }] }; /* harmony default export */ const code_transforms = (code_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/code/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const code_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/code", title: "Code", category: "text", description: "Display code snippets that respect your spacing and tabs.", textdomain: "default", attributes: { content: { type: "rich-text", source: "rich-text", selector: "code", __unstablePreserveWhiteSpace: true } }, supports: { align: ["wide"], anchor: true, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, spacing: { margin: ["top", "bottom"], padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { width: true, color: true } }, color: { text: true, background: true, gradients: true, __experimentalDefaultControls: { background: true, text: true } }, interactivity: { clientNavigation: true } }, style: "wp-block-code" }; const { name: code_name } = code_metadata; const code_settings = { icon: library_code, example: { attributes: { /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ // translators: Preserve \n markers for line breaks content: (0,external_wp_i18n_namespaceObject.__)('// A “block” is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );') /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ } }, merge(attributes, attributesToMerge) { return { content: attributes.content + '\n\n' + attributesToMerge.content }; }, transforms: code_transforms, edit: CodeEdit, save: code_save_save }; const code_init = () => initBlock({ name: code_name, metadata: code_metadata, settings: code_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/column.js /** * WordPress dependencies */ const column = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z" }) }); /* harmony default export */ const library_column = (column); ;// ./node_modules/@wordpress/block-library/build-module/column/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ const column_deprecated_deprecated = [{ attributes: { verticalAlignment: { type: 'string' }, width: { type: 'number', min: 0, max: 100 } }, isEligible({ width }) { return isFinite(width); }, migrate(attributes) { return { ...attributes, width: `${attributes.width}%` }; }, save({ attributes }) { const { verticalAlignment, width } = attributes; const wrapperClasses = dist_clsx({ [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); const style = { flexBasis: width + '%' }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: wrapperClasses, style: style, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } }]; /* harmony default export */ const column_deprecated = (column_deprecated_deprecated); ;// ./node_modules/@wordpress/block-library/build-module/column/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ColumnInspectorControls({ width, setAttributes }) { const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['%', 'px', 'em', 'rem', 'vw'] }); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ width: undefined }); }, dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => width !== undefined, label: (0,external_wp_i18n_namespaceObject.__)('Width'), onDeselect: () => setAttributes({ width: undefined }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { label: (0,external_wp_i18n_namespaceObject.__)('Width'), __unstableInputWidth: "calc(50% - 8px)", __next40pxDefaultSize: true, value: width || '', onChange: nextWidth => { nextWidth = 0 > parseFloat(nextWidth) ? '0' : nextWidth; setAttributes({ width: nextWidth }); }, units: units }) }) }); } function ColumnEdit({ attributes: { verticalAlignment, width, templateLock, allowedBlocks }, setAttributes, clientId }) { const classes = dist_clsx('block-core-columns', { [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); const { columnsIds, hasChildBlocks, rootClientId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockOrder, getBlockRootClientId } = select(external_wp_blockEditor_namespaceObject.store); const rootId = getBlockRootClientId(clientId); return { hasChildBlocks: getBlockOrder(clientId).length > 0, rootClientId: rootId, columnsIds: getBlockOrder(rootId) }; }, [clientId]); const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const updateAlignment = value => { // Update own alignment. setAttributes({ verticalAlignment: value }); // Reset parent Columns block. updateBlockAttributes(rootClientId, { verticalAlignment: null }); }; const widthWithUnit = Number.isFinite(width) ? width + '%' : width; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes, style: widthWithUnit ? { flexBasis: widthWithUnit } : undefined }); const columnsCount = columnsIds.length; const currentColumnPosition = columnsIds.indexOf(clientId) + 1; const label = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */ (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$d of %3$d)'), blockProps['aria-label'], currentColumnPosition, columnsCount); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ ...blockProps, 'aria-label': label }, { templateLock, allowedBlocks, renderAppender: hasChildBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { onChange: updateAlignment, value: verticalAlignment, controls: ['top', 'center', 'bottom', 'stretch'] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColumnInspectorControls, { width: width, setAttributes: setAttributes }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })] }); } /* harmony default export */ const column_edit = (ColumnEdit); ;// ./node_modules/@wordpress/block-library/build-module/column/save.js /** * External dependencies */ /** * WordPress dependencies */ function column_save_save({ attributes }) { const { verticalAlignment, width } = attributes; const wrapperClasses = dist_clsx({ [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); let style; if (width && /\d/.test(width)) { // Numbers are handled for backward compatibility as they can be still provided with templates. let flexBasis = Number.isFinite(width) ? width + '%' : width; // In some cases we need to round the width to a shorter float. if (!Number.isFinite(width) && width?.endsWith('%')) { const multiplier = 1000000000000; // Shrink the number back to a reasonable float. flexBasis = Math.round(Number.parseFloat(width) * multiplier) / multiplier + '%'; } style = { flexBasis }; } const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: wrapperClasses, style }); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }); } ;// ./node_modules/@wordpress/block-library/build-module/column/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const column_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/column", title: "Column", category: "design", parent: ["core/columns"], description: "A single column within a columns block.", textdomain: "default", attributes: { verticalAlignment: { type: "string" }, width: { type: "string" }, allowedBlocks: { type: "array" }, templateLock: { type: ["string", "boolean"], "enum": ["all", "insert", "contentOnly", false] } }, supports: { __experimentalOnEnter: true, anchor: true, reusable: false, html: false, color: { gradients: true, heading: true, button: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, shadow: true, spacing: { blockGap: true, padding: true, __experimentalDefaultControls: { padding: true, blockGap: true } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, layout: true, interactivity: { clientNavigation: true } } }; const { name: column_name } = column_metadata; const column_settings = { icon: library_column, edit: column_edit, save: column_save_save, deprecated: column_deprecated }; const column_init = () => initBlock({ name: column_name, metadata: column_metadata, settings: column_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/columns.js /** * WordPress dependencies */ const columns = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M15 7.5h-5v10h5v-10Zm1.5 0v10H19a.5.5 0 0 0 .5-.5V8a.5.5 0 0 0-.5-.5h-2.5ZM6 7.5h2.5v10H6a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5ZM6 6h13a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2Z" }) }); /* harmony default export */ const library_columns = (columns); ;// ./node_modules/@wordpress/block-library/build-module/columns/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * Given an HTML string for a deprecated columns inner block, returns the * column index to which the migrated inner block should be assigned. Returns * undefined if the inner block was not assigned to a column. * * @param {string} originalContent Deprecated Columns inner block HTML. * * @return {number | undefined} Column to which inner block is to be assigned. */ function getDeprecatedLayoutColumn(originalContent) { let { doc } = getDeprecatedLayoutColumn; if (!doc) { doc = document.implementation.createHTMLDocument(''); getDeprecatedLayoutColumn.doc = doc; } let columnMatch; doc.body.innerHTML = originalContent; for (const classListItem of doc.body.firstChild.classList) { if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) { return Number(columnMatch[1]) - 1; } } } const migrateCustomColors = attributes => { if (!attributes.customTextColor && !attributes.customBackgroundColor) { return attributes; } const style = { color: {} }; if (attributes.customTextColor) { style.color.text = attributes.customTextColor; } if (attributes.customBackgroundColor) { style.color.background = attributes.customBackgroundColor; } const { customTextColor, customBackgroundColor, ...restAttributes } = attributes; return { ...restAttributes, style, isStackedOnMobile: true }; }; /* harmony default export */ const columns_deprecated = ([{ attributes: { verticalAlignment: { type: 'string' }, backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, customTextColor: { type: 'string' }, textColor: { type: 'string' } }, migrate: migrateCustomColors, save({ attributes }) { const { verticalAlignment, backgroundColor, customBackgroundColor, textColor, customTextColor } = attributes; const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const className = dist_clsx({ 'has-background': backgroundColor || customBackgroundColor, 'has-text-color': textColor || customTextColor, [backgroundClass]: backgroundClass, [textClass]: textClass, [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); const style = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: className ? className : undefined, style: style, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } }, { attributes: { columns: { type: 'number', default: 2 } }, isEligible(attributes, innerBlocks) { // Since isEligible is called on every valid instance of the // Columns block and a deprecation is the unlikely case due to // its subsequent migration, optimize for the `false` condition // by performing a naive, inaccurate pass at inner blocks. const isFastPassEligible = innerBlocks.some(innerBlock => /layout-column-\d+/.test(innerBlock.originalContent)); if (!isFastPassEligible) { return false; } // Only if the fast pass is considered eligible is the more // accurate, durable, slower condition performed. return innerBlocks.some(innerBlock => getDeprecatedLayoutColumn(innerBlock.originalContent) !== undefined); }, migrate(attributes, innerBlocks) { const columns = innerBlocks.reduce((accumulator, innerBlock) => { const { originalContent } = innerBlock; let columnIndex = getDeprecatedLayoutColumn(originalContent); if (columnIndex === undefined) { columnIndex = 0; } if (!accumulator[columnIndex]) { accumulator[columnIndex] = []; } accumulator[columnIndex].push(innerBlock); return accumulator; }, []); const migratedInnerBlocks = columns.map(columnBlocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, columnBlocks)); const { columns: ignoredColumns, ...restAttributes } = attributes; return [{ ...restAttributes, isStackedOnMobile: true }, migratedInnerBlocks]; }, save({ attributes }) { const { columns } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: `has-${columns}-columns`, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } }, { attributes: { columns: { type: 'number', default: 2 } }, migrate(attributes, innerBlocks) { const { columns, ...restAttributes } = attributes; attributes = { ...restAttributes, isStackedOnMobile: true }; return [attributes, innerBlocks]; }, save({ attributes }) { const { verticalAlignment, columns } = attributes; const wrapperClasses = dist_clsx(`has-${columns}-columns`, { [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: wrapperClasses, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } }]); ;// ./node_modules/@wordpress/block-library/build-module/columns/utils.js /** * Returns a column width attribute value rounded to standard precision. * Returns `undefined` if the value is not a valid finite number. * * @param {?number} value Raw value. * * @return {number} Value rounded to standard precision. */ const toWidthPrecision = value => { const unitlessValue = parseFloat(value); return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : undefined; }; /** * Returns an effective width for a given block. An effective width is equal to * its attribute value if set, or a computed value assuming equal distribution. * * @param {WPBlock} block Block object. * @param {number} totalBlockCount Total number of blocks in Columns. * * @return {number} Effective column width. */ function getEffectiveColumnWidth(block, totalBlockCount) { const { width = 100 / totalBlockCount } = block.attributes; return toWidthPrecision(width); } /** * Returns the total width occupied by the given set of column blocks. * * @param {WPBlock[]} blocks Block objects. * @param {?number} totalBlockCount Total number of blocks in Columns. * Defaults to number of blocks passed. * * @return {number} Total width occupied by blocks. */ function getTotalColumnsWidth(blocks, totalBlockCount = blocks.length) { return blocks.reduce((sum, block) => sum + getEffectiveColumnWidth(block, totalBlockCount), 0); } /** * Returns an object of `clientId` → `width` of effective column widths. * * @param {WPBlock[]} blocks Block objects. * @param {?number} totalBlockCount Total number of blocks in Columns. * Defaults to number of blocks passed. * * @return {Object<string,number>} Column widths. */ function getColumnWidths(blocks, totalBlockCount = blocks.length) { return blocks.reduce((accumulator, block) => { const width = getEffectiveColumnWidth(block, totalBlockCount); return Object.assign(accumulator, { [block.clientId]: width }); }, {}); } /** * Returns an object of `clientId` → `width` of column widths as redistributed * proportional to their current widths, constrained or expanded to fit within * the given available width. * * @param {WPBlock[]} blocks Block objects. * @param {number} availableWidth Maximum width to fit within. * @param {?number} totalBlockCount Total number of blocks in Columns. * Defaults to number of blocks passed. * * @return {Object<string,number>} Redistributed column widths. */ function getRedistributedColumnWidths(blocks, availableWidth, totalBlockCount = blocks.length) { const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount); return Object.fromEntries(Object.entries(getColumnWidths(blocks, totalBlockCount)).map(([clientId, width]) => { const newWidth = availableWidth * width / totalWidth; return [clientId, toWidthPrecision(newWidth)]; })); } /** * Returns true if column blocks within the provided set are assigned with * explicit widths, or false otherwise. * * @param {WPBlock[]} blocks Block objects. * * @return {boolean} Whether columns have explicit widths. */ function hasExplicitPercentColumnWidths(blocks) { return blocks.every(block => { const blockWidth = block.attributes.width; return Number.isFinite(blockWidth?.endsWith?.('%') ? parseFloat(blockWidth) : blockWidth); }); } /** * Returns a copy of the given set of blocks with new widths assigned from the * provided object of redistributed column widths. * * @param {WPBlock[]} blocks Block objects. * @param {Object<string,number>} widths Redistributed column widths. * * @return {WPBlock[]} blocks Mapped block objects. */ function getMappedColumnWidths(blocks, widths) { return blocks.map(block => ({ ...block, attributes: { ...block.attributes, width: `${widths[block.clientId]}%` } })); } /** * Returns an array with columns widths values, parsed or no depends on `withParsing` flag. * * @param {WPBlock[]} blocks Block objects. * @param {?boolean} withParsing Whether value has to be parsed. * * @return {Array<number,string>} Column widths. */ function getWidths(blocks, withParsing = true) { return blocks.map(innerColumn => { const innerColumnWidth = innerColumn.attributes.width || 100 / blocks.length; return withParsing ? parseFloat(innerColumnWidth) : innerColumnWidth; }); } /** * Returns a column width with unit. * * @param {string} width Column width. * @param {string} unit Column width unit. * * @return {string} Column width with unit. */ function getWidthWithUnit(width, unit) { width = 0 > parseFloat(width) ? '0' : width; if (isPercentageUnit(unit)) { width = Math.min(width, 100); } return `${width}${unit}`; } /** * Returns a boolean whether passed unit is percentage * * @param {string} unit Column width unit. * * @return {boolean} Whether unit is '%'. */ function isPercentageUnit(unit) { return unit === '%'; } ;// ./node_modules/@wordpress/block-library/build-module/columns/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const edit_DEFAULT_BLOCK = { name: 'core/column' }; function edit_ColumnInspectorControls({ clientId, setAttributes, isStackedOnMobile }) { const { count, canInsertColumnBlock, minCount } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canInsertBlockType, canRemoveBlock, getBlockOrder } = select(external_wp_blockEditor_namespaceObject.store); const blockOrder = getBlockOrder(clientId); // Get the indexes of columns for which removal is prevented. // The highest index will be used to determine the minimum column count. const preventRemovalBlockIndexes = blockOrder.reduce((acc, blockId, index) => { if (!canRemoveBlock(blockId)) { acc.push(index); } return acc; }, []); return { count: blockOrder.length, canInsertColumnBlock: canInsertBlockType('core/column', clientId), minCount: Math.max(...preventRemovalBlockIndexes) + 1 }; }, [clientId]); const { getBlocks } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const { replaceInnerBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); /** * Updates the column count, including necessary revisions to child Column * blocks to grant required or redistribute available space. * * @param {number} previousColumns Previous column count. * @param {number} newColumns New column count. */ function updateColumns(previousColumns, newColumns) { let innerBlocks = getBlocks(clientId); const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); // Redistribute available width for existing inner blocks. const isAddingColumn = newColumns > previousColumns; if (isAddingColumn && hasExplicitWidths) { // If adding a new column, assign width to the new column equal to // as if it were `1 / columns` of the total available space. const newColumnWidth = toWidthPrecision(100 / newColumns); const newlyAddedColumns = newColumns - previousColumns; // Redistribute in consideration of pending block insertion as // constraining the available working width. const widths = getRedistributedColumnWidths(innerBlocks, 100 - newColumnWidth * newlyAddedColumns); innerBlocks = [...getMappedColumnWidths(innerBlocks, widths), ...Array.from({ length: newlyAddedColumns }).map(() => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/column', { width: `${newColumnWidth}%` }); })]; } else if (isAddingColumn) { innerBlocks = [...innerBlocks, ...Array.from({ length: newColumns - previousColumns }).map(() => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/column'); })]; } else if (newColumns < previousColumns) { // The removed column will be the last of the inner blocks. innerBlocks = innerBlocks.slice(0, -(previousColumns - newColumns)); if (hasExplicitWidths) { // Redistribute as if block is already removed. const widths = getRedistributedColumnWidths(innerBlocks, 100); innerBlocks = getMappedColumnWidths(innerBlocks, widths); } } replaceInnerBlocks(clientId, innerBlocks); } const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { updateColumns(count, minCount); setAttributes({ isStackedOnMobile: true }); }, dropdownMenuProps: dropdownMenuProps, children: [canInsertColumnBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Columns'), isShownByDefault: true, hasValue: () => count, onDeselect: () => updateColumns(count, minCount), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Columns'), value: count, onChange: value => updateColumns(count, Math.max(minCount, value)), min: Math.max(1, minCount), max: Math.max(6, count) }), count > 6 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "warning", isDismissible: false, children: (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.') })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), isShownByDefault: true, hasValue: () => isStackedOnMobile !== true, onDeselect: () => setAttributes({ isStackedOnMobile: true }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), checked: isStackedOnMobile, onChange: () => setAttributes({ isStackedOnMobile: !isStackedOnMobile }) }) })] }); } function ColumnsEditContainer({ attributes, setAttributes, clientId }) { const { isStackedOnMobile, verticalAlignment, templateLock } = attributes; const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { getBlockOrder } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const classes = dist_clsx({ [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment, [`is-not-stacked-on-mobile`]: !isStackedOnMobile }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { defaultBlock: edit_DEFAULT_BLOCK, directInsert: true, orientation: 'horizontal', renderAppender: false, templateLock }); /** * Update all child Column blocks with a new vertical alignment setting * based on whatever alignment is passed in. This allows change to parent * to override anything set on a individual column basis. * * @param {string} newVerticalAlignment The vertical alignment setting. */ function updateAlignment(newVerticalAlignment) { const innerBlockClientIds = getBlockOrder(clientId); // Update own and child Column block vertical alignments. // This is a single action; the batching prevents creating multiple history records. registry.batch(() => { setAttributes({ verticalAlignment: newVerticalAlignment }); updateBlockAttributes(innerBlockClientIds, { verticalAlignment: newVerticalAlignment }); }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentToolbar, { onChange: updateAlignment, value: verticalAlignment }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_ColumnInspectorControls, { clientId: clientId, setAttributes: setAttributes, isStackedOnMobile: isStackedOnMobile }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })] }); } function Placeholder({ clientId, name, setAttributes }) { const { blockType, defaultVariation, variations } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockVariations, getBlockType, getDefaultBlockVariation } = select(external_wp_blocks_namespaceObject.store); return { blockType: getBlockType(name), defaultVariation: getDefaultBlockVariation(name, 'block'), variations: getBlockVariations(name, 'block') }; }, [name]); const { replaceInnerBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, { icon: blockType?.icon?.src, label: blockType?.title, variations: variations, instructions: (0,external_wp_i18n_namespaceObject.__)('Divide into columns. Select a layout:'), onSelect: (nextVariation = defaultVariation) => { if (nextVariation.attributes) { setAttributes(nextVariation.attributes); } if (nextVariation.innerBlocks) { replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(nextVariation.innerBlocks), true); } }, allowSkip: true }) }); } const ColumnsEdit = props => { const { clientId } = props; const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length > 0, [clientId]); const Component = hasInnerBlocks ? ColumnsEditContainer : Placeholder; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { ...props }); }; /* harmony default export */ const columns_edit = (ColumnsEdit); ;// ./node_modules/@wordpress/block-library/build-module/columns/save.js /** * External dependencies */ /** * WordPress dependencies */ function columns_save_save({ attributes }) { const { isStackedOnMobile, verticalAlignment } = attributes; const className = dist_clsx({ [`are-vertically-aligned-${verticalAlignment}`]: verticalAlignment, [`is-not-stacked-on-mobile`]: !isStackedOnMobile }); const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }); } ;// ./node_modules/@wordpress/block-library/build-module/columns/variations.js /** * WordPress dependencies */ /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ /** * Template option choices for predefined columns layouts. * * @type {WPBlockVariation[]} */ const variations_variations = [{ name: 'one-column-full', title: (0,external_wp_i18n_namespaceObject.__)('100'), description: (0,external_wp_i18n_namespaceObject.__)('One column'), icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z" }) }), innerBlocks: [['core/column']], scope: ['block'] }, { name: 'two-columns-equal', title: (0,external_wp_i18n_namespaceObject.__)('50 / 50'), description: (0,external_wp_i18n_namespaceObject.__)('Two columns; equal split'), icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z" }) }), isDefault: true, innerBlocks: [['core/column'], ['core/column']], scope: ['block'] }, { name: 'two-columns-one-third-two-thirds', title: (0,external_wp_i18n_namespaceObject.__)('33 / 66'), description: (0,external_wp_i18n_namespaceObject.__)('Two columns; one-third, two-thirds split'), icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm17 0a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V10Z" }) }), innerBlocks: [['core/column', { width: '33.33%' }], ['core/column', { width: '66.66%' }]], scope: ['block'] }, { name: 'two-columns-two-thirds-one-third', title: (0,external_wp_i18n_namespaceObject.__)('66 / 33'), description: (0,external_wp_i18n_namespaceObject.__)('Two columns; two-thirds, one-third split'), icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm33 0a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35a2 2 0 0 1-2-2V10Z" }) }), innerBlocks: [['core/column', { width: '66.66%' }], ['core/column', { width: '33.33%' }]], scope: ['block'] }, { name: 'three-columns-equal', title: (0,external_wp_i18n_namespaceObject.__)('33 / 33 / 33'), description: (0,external_wp_i18n_namespaceObject.__)('Three columns; equal split'), icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h10.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm16.5 0c0-1.105.864-2 1.969-2H29.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H18.47c-1.105 0-1.969-.895-1.969-2V10Zm17 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35.469c-1.105 0-1.969-.895-1.969-2V10Z" }) }), innerBlocks: [['core/column'], ['core/column'], ['core/column']], scope: ['block'] }, { name: 'three-columns-wider-center', title: (0,external_wp_i18n_namespaceObject.__)('25 / 50 / 25'), description: (0,external_wp_i18n_namespaceObject.__)('Three columns; wide center column'), icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h7.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm13.5 0c0-1.105.864-2 1.969-2H32.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H15.47c-1.105 0-1.969-.895-1.969-2V10Zm23 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2h-7.531c-1.105 0-1.969-.895-1.969-2V10Z" }) }), innerBlocks: [['core/column', { width: '25%' }], ['core/column', { width: '50%' }], ['core/column', { width: '25%' }]], scope: ['block'] }]; /* harmony default export */ const columns_variations = (variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/columns/transforms.js /** * WordPress dependencies */ const MAXIMUM_SELECTED_BLOCKS = 6; const columns_transforms_transforms = { from: [{ type: 'block', isMultiBlock: true, blocks: ['*'], __experimentalConvert: blocks => { const columnWidth = +(100 / blocks.length).toFixed(2); const innerBlocksTemplate = blocks.map(({ name, attributes, innerBlocks }) => ['core/column', { width: `${columnWidth}%` }, [[name, { ...attributes }, innerBlocks]]]); return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', {}, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)); }, isMatch: ({ length: selectedBlocksLength }, blocks) => { // If a user is trying to transform a single Columns block, skip // the transformation. Enabling this functiontionality creates // nested Columns blocks resulting in an unintuitive user experience. // Multiple Columns blocks can still be transformed. if (blocks.length === 1 && blocks[0].name === 'core/columns') { return false; } return selectedBlocksLength && selectedBlocksLength <= MAXIMUM_SELECTED_BLOCKS; } }, { type: 'block', blocks: ['core/media-text'], priority: 1, transform: (attributes, innerBlocks) => { const { align, backgroundColor, textColor, style, mediaAlt: alt, mediaId: id, mediaPosition, mediaSizeSlug: sizeSlug, mediaType, mediaUrl: url, mediaWidth, verticalAlignment } = attributes; let media; if (mediaType === 'image' || !mediaType) { const imageAttrs = { id, alt, url, sizeSlug }; const linkAttrs = { href: attributes.href, linkClass: attributes.linkClass, linkDestination: attributes.linkDestination, linkTarget: attributes.linkTarget, rel: attributes.rel }; media = ['core/image', { ...imageAttrs, ...linkAttrs }]; } else { media = ['core/video', { id, src: url }]; } const innerBlocksTemplate = [['core/column', { width: `${mediaWidth}%` }, [media]], ['core/column', { width: `${100 - mediaWidth}%` }, innerBlocks]]; if (mediaPosition === 'right') { innerBlocksTemplate.reverse(); } return (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', { align, backgroundColor, textColor, style, verticalAlignment }, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate)); } }], ungroup: (attributes, innerBlocks) => innerBlocks.flatMap(innerBlock => innerBlock.innerBlocks) }; /* harmony default export */ const columns_transforms = (columns_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/columns/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const columns_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/columns", title: "Columns", category: "design", allowedBlocks: ["core/column"], description: "Display content in multiple columns, with blocks added to each column.", textdomain: "default", attributes: { verticalAlignment: { type: "string" }, isStackedOnMobile: { type: "boolean", "default": true }, templateLock: { type: ["string", "boolean"], "enum": ["all", "insert", "contentOnly", false] } }, supports: { anchor: true, align: ["wide", "full"], html: false, color: { gradients: true, link: true, heading: true, button: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { blockGap: { __experimentalDefault: "2em", sides: ["horizontal", "vertical"] }, margin: ["top", "bottom"], padding: true, __experimentalDefaultControls: { padding: true, blockGap: true } }, layout: { allowSwitching: false, allowInheriting: false, allowEditing: false, "default": { type: "flex", flexWrap: "nowrap" } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, shadow: true }, editorStyle: "wp-block-columns-editor", style: "wp-block-columns" }; const { name: columns_name } = columns_metadata; const columns_settings = { icon: library_columns, variations: columns_variations, example: { viewportWidth: 782, // Columns collapse "@media (max-width: 781px)". innerBlocks: [{ name: 'core/column', innerBlocks: [{ name: 'core/paragraph', attributes: { /* translators: example text. */ content: (0,external_wp_i18n_namespaceObject.__)('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis.') } }, { name: 'core/image', attributes: { url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg' } }, { name: 'core/paragraph', attributes: { /* translators: example text. */ content: (0,external_wp_i18n_namespaceObject.__)('Suspendisse commodo neque lacus, a dictum orci interdum et.') } }] }, { name: 'core/column', innerBlocks: [{ name: 'core/paragraph', attributes: { /* translators: example text. */ content: (0,external_wp_i18n_namespaceObject.__)('Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit.') } }, { name: 'core/paragraph', attributes: { /* translators: example text. */ content: (0,external_wp_i18n_namespaceObject.__)('Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim.') } }] }] }, deprecated: columns_deprecated, edit: columns_edit, save: columns_save_save, transforms: columns_transforms }; const columns_init = () => initBlock({ name: columns_name, metadata: columns_metadata, settings: columns_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/post-comments.js /** * WordPress dependencies */ const postComments = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z" }) }); /* harmony default export */ const post_comments = (postComments); ;// ./node_modules/@wordpress/block-library/build-module/comments/deprecated.js /** * WordPress dependencies */ // v1: Deprecate the initial version of the block which was called "Comments // Query Loop" instead of "Comments". const v1 = { attributes: { tagName: { type: 'string', default: 'div' } }, apiVersion: 3, supports: { align: ['wide', 'full'], html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } } }, save({ attributes: { tagName: Tag } }) { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); const { className } = blockProps; const classes = className?.split(' ') || []; // The ID of the previous version of the block // didn't have the `wp-block-comments` class, // so we need to remove it here in order to mimic it. const newClasses = classes?.filter(cls => cls !== 'wp-block-comments'); const newBlockProps = { ...blockProps, className: newClasses.join(' ') }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...newBlockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } }; /* harmony default export */ const comments_deprecated = ([v1]); ;// ./node_modules/@wordpress/block-library/build-module/utils/messages.js /** * WordPress dependencies */ const htmlElementMessages = { article: (0,external_wp_i18n_namespaceObject.__)('The <article> element should represent a self-contained, syndicatable portion of the document.'), aside: (0,external_wp_i18n_namespaceObject.__)("The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."), div: (0,external_wp_i18n_namespaceObject.__)('The <div> element should only be used if the block is a design element with no semantic meaning.'), footer: (0,external_wp_i18n_namespaceObject.__)('The <footer> element should represent a footer for its nearest sectioning element (e.g.: <section>, <article>, <main> etc.).'), header: (0,external_wp_i18n_namespaceObject.__)('The <header> element should represent introductory content, typically a group of introductory or navigational aids.'), main: (0,external_wp_i18n_namespaceObject.__)('The <main> element should be used for the primary content of your document only.'), nav: (0,external_wp_i18n_namespaceObject.__)('The <nav> element should be used to identify groups of links that are intended to be used for website or page content navigation.'), section: (0,external_wp_i18n_namespaceObject.__)("The <section> element should represent a standalone portion of the document that can't be better represented by another element.") }; ;// ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-inspector-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ function CommentsInspectorControls({ attributes: { tagName }, setAttributes }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), options: [{ label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), value: 'div' }, { label: '<section>', value: 'section' }, { label: '<aside>', value: 'aside' }], value: tagName, onChange: value => setAttributes({ tagName: value }), help: htmlElementMessages[tagName] }) }) }); } ;// ./node_modules/@wordpress/block-library/build-module/post-comments-form/form.js /** * External dependencies */ /** * WordPress dependencies */ const CommentsFormPlaceholder = () => { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(CommentsFormPlaceholder); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "comment-respond", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { className: "comment-reply-title", children: (0,external_wp_i18n_namespaceObject.__)('Leave a Reply') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { noValidate: true, className: "comment-form", onSubmit: event => event.preventDefault(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("label", { htmlFor: `comment-${instanceId}`, children: (0,external_wp_i18n_namespaceObject.__)('Comment') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("textarea", { id: `comment-${instanceId}`, name: "comment", cols: "45", rows: "8", readOnly: true })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "form-submit wp-block-button", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { name: "submit", type: "submit", className: dist_clsx('wp-block-button__link', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), label: (0,external_wp_i18n_namespaceObject.__)('Post Comment'), value: (0,external_wp_i18n_namespaceObject.__)('Post Comment'), "aria-disabled": "true" }) })] })] }); }; const CommentsForm = ({ postId, postType }) => { const [commentStatus, setCommentStatus] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'comment_status', postId); const isSiteEditor = postType === undefined || postId === undefined; const { defaultCommentStatus } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings); const postTypeSupportsComments = (0,external_wp_data_namespaceObject.useSelect)(select => postType ? !!select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.supports.comments : false); if (!isSiteEditor && 'open' !== commentStatus) { if ('closed' === commentStatus) { const actions = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, onClick: () => setCommentStatus('open'), variant: "primary", children: (0,external_wp_i18n_namespaceObject._x)('Enable comments', 'action that affects the current post') }, "enableComments")]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { actions: actions, children: (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this item.') }); } else if (!postTypeSupportsComments) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Post type (i.e. "post", "page") */ (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled for this post type (%s).'), postType) }); } else if ('open' !== defaultCommentStatus) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Post Comments Form block: Comments are not enabled.') }); } } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsFormPlaceholder, {}); }; /* harmony default export */ const post_comments_form_form = (CommentsForm); ;// ./node_modules/@wordpress/block-library/build-module/comments/edit/placeholder.js /** * WordPress dependencies */ /** * Internal dependencies */ function PostCommentsPlaceholder({ postType, postId }) { let [postTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId); postTitle = postTitle || (0,external_wp_i18n_namespaceObject.__)('Post Title'); const { avatarURL } = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().__experimentalDiscussionSettings); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-comments__legacy-placeholder", inert: "true", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { children: /* translators: %s: Post title. */ (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "navigation", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "alignleft", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#top", children: ["\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments')] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "alignright", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#top", children: [(0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"] }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { className: "commentlist", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { className: "comment even thread-even depth-1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("article", { className: "comment-body", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("footer", { className: "comment-meta", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "comment-author vcard", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { alt: (0,external_wp_i18n_namespaceObject.__)('Commenter Avatar'), src: avatarURL, className: "avatar avatar-32 photo", height: "32", width: "32", loading: "lazy" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("b", { className: "fn", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#top", className: "url", children: (0,external_wp_i18n_namespaceObject.__)('A WordPress Commenter') }) }), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: "says", children: [(0,external_wp_i18n_namespaceObject.__)('says'), ":"] })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "comment-metadata", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#top", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { dateTime: "2000-01-01T00:00:00+00:00", children: (0,external_wp_i18n_namespaceObject.__)('January 1, 2000 at 00:00 am') }) }), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "edit-link", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: "comment-edit-link", href: "#top", children: (0,external_wp_i18n_namespaceObject.__)('Edit') }) })] })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "comment-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { children: [(0,external_wp_i18n_namespaceObject.__)('Hi, this is a comment.'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Commenter avatars come from <a>Gravatar</a>.'), { a: /*#__PURE__*/ // eslint-disable-next-line jsx-a11y/anchor-has-content (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "https://gravatar.com/" }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "reply", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: "comment-reply-link", href: "#top", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Reply to A WordPress Commenter'), children: (0,external_wp_i18n_namespaceObject.__)('Reply') }) })] }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "navigation", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "alignleft", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#top", children: ["\xAB ", (0,external_wp_i18n_namespaceObject.__)('Older Comments')] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "alignright", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#top", children: [(0,external_wp_i18n_namespaceObject.__)('Newer Comments'), " \xBB"] }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_comments_form_form, { postId: postId, postType: postType })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comments/edit/comments-legacy.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function CommentsLegacy({ attributes, setAttributes, context: { postType, postId } }) { const { textAlign } = attributes; const actions = [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, onClick: () => void setAttributes({ legacy: false }), variant: "primary", children: (0,external_wp_i18n_namespaceObject.__)('Switch to editable mode') }, "convert")]; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { actions: actions, children: (0,external_wp_i18n_namespaceObject.__)('Comments block: You’re currently using the legacy version of the block. ' + 'The following is just a placeholder - the final styling will likely look different. ' + 'For a better representation and more customization options, ' + 'switch the block to its editable mode.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostCommentsPlaceholder, { postId: postId, postType: postType })] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comments/edit/template.js const TEMPLATE = [['core/comments-title'], ['core/comment-template', {}, [['core/columns', {}, [['core/column', { width: '40px' }, [['core/avatar', { size: 40, style: { border: { radius: '20px' } } }]]], ['core/column', {}, [['core/comment-author-name', { fontSize: 'small' }], ['core/group', { layout: { type: 'flex' }, style: { spacing: { margin: { top: '0px', bottom: '0px' } } } }, [['core/comment-date', { fontSize: 'small' }], ['core/comment-edit-link', { fontSize: 'small' }]]], ['core/comment-content'], ['core/comment-reply-link', { fontSize: 'small' }]]]]]]], ['core/comments-pagination'], ['core/post-comments-form']]; /* harmony default export */ const template = (TEMPLATE); ;// ./node_modules/@wordpress/block-library/build-module/comments/edit/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function CommentsEdit(props) { const { attributes, setAttributes } = props; const { tagName: TagName, legacy } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: template }); if (legacy) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsLegacy, { ...props }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsInspectorControls, { attributes: attributes, setAttributes: setAttributes }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...innerBlocksProps })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comments/save.js /** * WordPress dependencies */ function comments_save_save({ attributes: { tagName: Tag, legacy } }) { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); // The legacy version is dynamic (i.e. PHP rendered) and doesn't allow inner // blocks, so nothing is saved in that case. return legacy ? null : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...innerBlocksProps }); } ;// ./node_modules/@wordpress/block-library/build-module/comments/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments", title: "Comments", category: "theme", description: "An advanced block that allows displaying post comments using different visual configurations.", textdomain: "default", attributes: { tagName: { type: "string", "default": "div" }, legacy: { type: "boolean", "default": false } }, supports: { align: ["wide", "full"], html: false, color: { gradients: true, heading: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, editorStyle: "wp-block-comments-editor", usesContext: ["postId", "postType"] }; const { name: comments_name } = comments_metadata; const comments_settings = { icon: post_comments, example: {}, edit: CommentsEdit, save: comments_save_save, deprecated: comments_deprecated }; const comments_init = () => initBlock({ name: comments_name, metadata: comments_metadata, settings: comments_settings }); ;// ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/edit.js /** * WordPress dependencies */ function edit_Edit({ attributes, context: { commentId }, setAttributes, isSelected }) { const { height, width } = attributes; const [avatars] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_avatar_urls', commentId); const [authorName] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'author_name', commentId); const avatarUrls = avatars ? Object.values(avatars) : null; const sizes = avatars ? Object.keys(avatars) : null; const minSize = sizes ? sizes[0] : 24; const maxSize = sizes ? sizes[sizes.length - 1] : 96; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const spacingProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetSpacingClassesAndStyles)(attributes); const maxSizeBuffer = Math.floor(maxSize * 2.5); const { avatarURL } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); const { __experimentalDiscussionSettings } = getSettings(); return __experimentalDiscussionSettings; }); const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Image size'), onChange: newWidth => setAttributes({ width: newWidth, height: newWidth }), min: minSize, max: maxSizeBuffer, initialPosition: width, value: width }) }) }); const resizableAvatar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { size: { width, height }, showHandle: isSelected, onResizeStop: (event, direction, elt, delta) => { setAttributes({ height: parseInt(height + delta.height, 10), width: parseInt(width + delta.width, 10) }); }, lockAspectRatio: true, enable: { top: false, right: !(0,external_wp_i18n_namespaceObject.isRTL)(), bottom: true, left: (0,external_wp_i18n_namespaceObject.isRTL)() }, minWidth: minSize, maxWidth: maxSizeBuffer, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : avatarURL, alt: `${authorName} ${(0,external_wp_i18n_namespaceObject.__)('Avatar')}`, ...blockProps }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...spacingProps, children: resizableAvatar })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comment-author-avatar/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comment_author_avatar_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: "fse", name: "core/comment-author-avatar", title: "Comment Author Avatar (deprecated)", category: "theme", ancestor: ["core/comment-template"], description: "This block is deprecated. Please use the Avatar block instead.", textdomain: "default", attributes: { width: { type: "number", "default": 96 }, height: { type: "number", "default": 96 } }, usesContext: ["commentId"], supports: { html: false, inserter: false, __experimentalBorder: { radius: true, width: true, color: true, style: true }, color: { background: true, text: false, __experimentalDefaultControls: { background: true } }, spacing: { __experimentalSkipSerialization: true, margin: true, padding: true }, interactivity: { clientNavigation: true } } }; const { name: comment_author_avatar_name } = comment_author_avatar_metadata; const comment_author_avatar_settings = { icon: comment_author_avatar, edit: edit_Edit }; const comment_author_avatar_init = () => initBlock({ name: comment_author_avatar_name, metadata: comment_author_avatar_metadata, settings: comment_author_avatar_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/comment-author-name.js /** * WordPress dependencies */ const commentAuthorName = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z", fillRule: "evenodd", clipRule: "evenodd" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15", fillRule: "evenodd", clipRule: "evenodd" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Circle, { cx: "12", cy: "9", r: "2", fillRule: "evenodd", clipRule: "evenodd" })] }); /* harmony default export */ const comment_author_name = (commentAuthorName); ;// ./node_modules/@wordpress/block-library/build-module/comment-author-name/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Renders the `core/comment-author-name` block on the editor. * * @param {Object} props React props. * @param {Object} props.setAttributes Callback for updating block attributes. * @param {Object} props.attributes Block attributes. * @param {string} props.attributes.isLink Whether the author name should be linked. * @param {string} props.attributes.linkTarget Target of the link. * @param {string} props.attributes.textAlign Text alignment. * @param {Object} props.context Inherited context. * @param {string} props.context.commentId The comment ID. * * @return {JSX.Element} React element. */ function comment_author_name_edit_Edit({ attributes: { isLink, linkTarget, textAlign }, context: { commentId }, setAttributes }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); let displayName = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); const comment = getEntityRecord('root', 'comment', commentId); const authorName = comment?.author_name; // eslint-disable-line camelcase if (comment && !authorName) { var _user$name; const user = getEntityRecord('root', 'user', comment.author); return (_user$name = user?.name) !== null && _user$name !== void 0 ? _user$name : (0,external_wp_i18n_namespaceObject.__)('Anonymous'); } return authorName !== null && authorName !== void 0 ? authorName : ''; }, [commentId]); const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: newAlign => setAttributes({ textAlign: newAlign }) }) }); const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link to authors URL'), onChange: () => setAttributes({ isLink: !isLink }), checked: isLink }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: value => setAttributes({ linkTarget: value ? '_blank' : '_self' }), checked: linkTarget === '_blank' })] }) }); if (!commentId || !displayName) { displayName = (0,external_wp_i18n_namespaceObject._x)('Comment Author', 'block title'); } const displayAuthor = isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#comment-author-pseudo-link", onClick: event => event.preventDefault(), children: displayName }) : displayName; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [inspectorControls, blockControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: displayAuthor })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comment-author-name/deprecated.js /** * Internal dependencies */ const deprecated_v1 = { attributes: { isLink: { type: 'boolean', default: false }, linkTarget: { type: 'string', default: '_self' } }, supports: { html: false, color: { gradients: true, link: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalLetterSpacing: true } }, save() { return null; }, migrate: migrate_font_family, isEligible({ style }) { return style?.typography?.fontFamily; } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const comment_author_name_deprecated = ([deprecated_v1]); ;// ./node_modules/@wordpress/block-library/build-module/comment-author-name/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comment_author_name_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comment-author-name", title: "Comment Author Name", category: "theme", ancestor: ["core/comment-template"], description: "Displays the name of the author of the comment.", textdomain: "default", attributes: { isLink: { type: "boolean", "default": true }, linkTarget: { type: "string", "default": "_self" }, textAlign: { type: "string" } }, usesContext: ["commentId"], supports: { html: false, spacing: { margin: true, padding: true }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-comment-author-name" }; const { name: comment_author_name_name } = comment_author_name_metadata; const comment_author_name_settings = { icon: comment_author_name, edit: comment_author_name_edit_Edit, deprecated: comment_author_name_deprecated, example: {} }; const comment_author_name_init = () => initBlock({ name: comment_author_name_name, metadata: comment_author_name_metadata, settings: comment_author_name_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/comment-content.js /** * WordPress dependencies */ const commentContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z" }) }); /* harmony default export */ const comment_content = (commentContent); ;// ./node_modules/@wordpress/block-library/build-module/comment-content/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Renders the `core/comment-content` block on the editor. * * @param {Object} props React props. * @param {Object} props.setAttributes Callback for updating block attributes. * @param {Object} props.attributes Block attributes. * @param {string} props.attributes.textAlign The `textAlign` attribute. * @param {Object} props.context Inherited context. * @param {string} props.context.commentId The comment ID. * * @return {JSX.Element} React element. */ function comment_content_edit_Edit({ setAttributes, attributes: { textAlign }, context: { commentId } }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const [content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'content', commentId); const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: newAlign => setAttributes({ textAlign: newAlign }) }) }); if (!commentId || !content) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject._x)('Comment Content', 'block title') }) })] }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: content.rendered }, "html") }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comment-content/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comment_content_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comment-content", title: "Comment Content", category: "theme", ancestor: ["core/comment-template"], description: "Displays the contents of a comment.", textdomain: "default", usesContext: ["commentId"], attributes: { textAlign: { type: "string" } }, supports: { color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } }, spacing: { padding: ["horizontal", "vertical"], __experimentalDefaultControls: { padding: true } }, html: false }, style: "wp-block-comment-content" }; const { name: comment_content_name } = comment_content_metadata; const comment_content_settings = { icon: comment_content, edit: comment_content_edit_Edit, example: {} }; const comment_content_init = () => initBlock({ name: comment_content_name, metadata: comment_content_metadata, settings: comment_content_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/post-date.js /** * WordPress dependencies */ const postDate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z" })] }); /* harmony default export */ const post_date = (postDate); ;// external ["wp","date"] const external_wp_date_namespaceObject = window["wp"]["date"]; ;// ./node_modules/@wordpress/block-library/build-module/comment-date/edit.js /** * WordPress dependencies */ /** * Renders the `core/comment-date` block on the editor. * * @param {Object} props React props. * @param {Object} props.setAttributes Callback for updating block attributes. * @param {Object} props.attributes Block attributes. * @param {string} props.attributes.format Format of the date. * @param {string} props.attributes.isLink Whether the author name should be linked. * @param {Object} props.context Inherited context. * @param {string} props.context.commentId The comment ID. * * @return {JSX.Element} React element. */ function comment_date_edit_Edit({ attributes: { format, isLink }, context: { commentId }, setAttributes }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); let [date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'comment', 'date', commentId); const [siteFormat = (0,external_wp_date_namespaceObject.getSettings)().formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format'); const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, { format: format, defaultFormat: siteFormat, onChange: nextFormat => setAttributes({ format: nextFormat }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link to comment'), onChange: () => setAttributes({ isLink: !isLink }), checked: isLink })] }) }); if (!commentId || !date) { date = (0,external_wp_i18n_namespaceObject._x)('Comment Date', 'block title'); } let commentDate = date instanceof Date ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date), children: format === 'human-diff' ? (0,external_wp_date_namespaceObject.humanTimeDiff)(date) : (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { children: date }); if (isLink) { commentDate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#comment-date-pseudo-link", onClick: event => event.preventDefault(), children: commentDate }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: commentDate })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comment-date/deprecated.js /** * Internal dependencies */ const comment_date_deprecated_v1 = { attributes: { format: { type: 'string' }, isLink: { type: 'boolean', default: false } }, supports: { html: false, color: { gradients: true, link: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalLetterSpacing: true } }, save() { return null; }, migrate: migrate_font_family, isEligible({ style }) { return style?.typography?.fontFamily; } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const comment_date_deprecated = ([comment_date_deprecated_v1]); ;// ./node_modules/@wordpress/block-library/build-module/comment-date/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comment_date_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comment-date", title: "Comment Date", category: "theme", ancestor: ["core/comment-template"], description: "Displays the date on which the comment was posted.", textdomain: "default", attributes: { format: { type: "string" }, isLink: { type: "boolean", "default": true } }, usesContext: ["commentId"], supports: { html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-comment-date" }; const { name: comment_date_name } = comment_date_metadata; const comment_date_settings = { icon: post_date, edit: comment_date_edit_Edit, deprecated: comment_date_deprecated, example: {} }; const comment_date_init = () => initBlock({ name: comment_date_name, metadata: comment_date_metadata, settings: comment_date_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/comment-edit-link.js /** * WordPress dependencies */ const commentEditLink = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m6.249 11.065.44-.44h3.186l-1.5 1.5H7.31l-1.957 1.96A.792.792 0 0 1 4 13.524V5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1.5L12.5 8V5.5h-7v6.315l.749-.75ZM20 19.75H7v-1.5h13v1.5Zm0-12.653-8.967 9.064L8 17l.867-2.935L17.833 5 20 7.097Z" }) }); /* harmony default export */ const comment_edit_link = (commentEditLink); ;// ./node_modules/@wordpress/block-library/build-module/comment-edit-link/edit.js /** * External dependencies */ /** * WordPress dependencies */ function comment_edit_link_edit_Edit({ attributes: { linkTarget, textAlign }, setAttributes }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: newAlign => setAttributes({ textAlign: newAlign }) }) }); const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: value => setAttributes({ linkTarget: value ? '_blank' : '_self' }), checked: linkTarget === '_blank' }) }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#edit-comment-pseudo-link", onClick: event => event.preventDefault(), children: (0,external_wp_i18n_namespaceObject.__)('Edit') }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comment-edit-link/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comment_edit_link_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comment-edit-link", title: "Comment Edit Link", category: "theme", ancestor: ["core/comment-template"], description: "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.", textdomain: "default", usesContext: ["commentId"], attributes: { linkTarget: { type: "string", "default": "_self" }, textAlign: { type: "string" } }, supports: { html: false, color: { link: true, gradients: true, text: false, __experimentalDefaultControls: { background: true, link: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true } }, style: "wp-block-comment-edit-link" }; const { name: comment_edit_link_name } = comment_edit_link_metadata; const comment_edit_link_settings = { icon: comment_edit_link, edit: comment_edit_link_edit_Edit, example: {} }; const comment_edit_link_init = () => initBlock({ name: comment_edit_link_name, metadata: comment_edit_link_metadata, settings: comment_edit_link_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/comment-reply-link.js /** * WordPress dependencies */ const commentReplyLink = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z" }) }); /* harmony default export */ const comment_reply_link = (commentReplyLink); ;// ./node_modules/@wordpress/block-library/build-module/comment-reply-link/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Renders the `core/comment-reply-link` block on the editor. * * @param {Object} props React props. * @param {Object} props.setAttributes Callback for updating block attributes. * @param {Object} props.attributes Block attributes. * @param {string} props.attributes.textAlign The `textAlign` attribute. * * @return {JSX.Element} React element. */ function comment_reply_link_edit_Edit({ setAttributes, attributes: { textAlign } }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: newAlign => setAttributes({ textAlign: newAlign }) }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#comment-reply-pseudo-link", onClick: event => event.preventDefault(), children: (0,external_wp_i18n_namespaceObject.__)('Reply') }) })] }); } /* harmony default export */ const comment_reply_link_edit = (comment_reply_link_edit_Edit); ;// ./node_modules/@wordpress/block-library/build-module/comment-reply-link/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comment_reply_link_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comment-reply-link", title: "Comment Reply Link", category: "theme", ancestor: ["core/comment-template"], description: "Displays a link to reply to a comment.", textdomain: "default", usesContext: ["commentId"], attributes: { textAlign: { type: "string" } }, supports: { color: { gradients: true, link: true, text: false, __experimentalDefaultControls: { background: true, link: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true }, html: false }, style: "wp-block-comment-reply-link" }; const { name: comment_reply_link_name } = comment_reply_link_metadata; const comment_reply_link_settings = { edit: comment_reply_link_edit, icon: comment_reply_link, example: {} }; const comment_reply_link_init = () => initBlock({ name: comment_reply_link_name, metadata: comment_reply_link_metadata, settings: comment_reply_link_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/layout.js /** * WordPress dependencies */ const layout = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); /* harmony default export */ const library_layout = (layout); ;// external ["wp","apiFetch"] const external_wp_apiFetch_namespaceObject = window["wp"]["apiFetch"]; var external_wp_apiFetch_default = /*#__PURE__*/__webpack_require__.n(external_wp_apiFetch_namespaceObject); ;// ./node_modules/@wordpress/block-library/build-module/comment-template/hooks.js /** * WordPress dependencies */ // This is limited by WP REST API const MAX_COMMENTS_PER_PAGE = 100; /** * Return an object with the query args needed to fetch the default page of * comments. * * @param {Object} props Hook props. * @param {number} props.postId ID of the post that contains the comments. * discussion settings. * * @return {Object} Query args to retrieve the comments. */ const useCommentQueryArgs = ({ postId }) => { // Initialize the query args that are not going to change. const queryArgs = { status: 'approve', order: 'asc', context: 'embed', parent: 0, _embed: 'children' }; // Get the Discussion settings that may be needed to query the comments. const { pageComments, commentsPerPage, defaultCommentsPage: defaultPage } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); const { __experimentalDiscussionSettings } = getSettings(); return __experimentalDiscussionSettings; }); // WP REST API doesn't allow fetching more than max items limit set per single page of data. // As for the editor performance is more important than completeness of data and fetching only the // max allowed for single page should be enough for the purpose of design and laying out the page. // Fetching over the limit would return an error here but would work with backend query. const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE; // Get the number of the default page. const page = useDefaultPageIndex({ defaultPage, postId, perPage, queryArgs }); // Merge, memoize and return all query arguments, unless the default page's // number is not known yet. return (0,external_wp_element_namespaceObject.useMemo)(() => { return page ? { ...queryArgs, post: postId, per_page: perPage, page } : null; }, [postId, perPage, page]); }; /** * Return the index of the default page, depending on whether `defaultPage` is * `newest` or `oldest`. In the first case, the only way to know the page's * index is by using the `X-WP-TotalPages` header, which forces to make an * additional request. * * @param {Object} props Hook props. * @param {string} props.defaultPage Page shown by default (newest/oldest). * @param {number} props.postId ID of the post that contains the comments. * @param {number} props.perPage The number of comments included per page. * @param {Object} props.queryArgs Other query args. * * @return {number} Index of the default comments page. */ const useDefaultPageIndex = ({ defaultPage, postId, perPage, queryArgs }) => { // Store the default page indices. const [defaultPages, setDefaultPages] = (0,external_wp_element_namespaceObject.useState)({}); const key = `${postId}_${perPage}`; const page = defaultPages[key] || 0; (0,external_wp_element_namespaceObject.useEffect)(() => { // Do nothing if the page is already known or not the newest page. if (page || defaultPage !== 'newest') { return; } // We need to fetch comments to know the index. Use HEAD and limit // fields just to ID, to make this call as light as possible. external_wp_apiFetch_default()({ path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { ...queryArgs, post: postId, per_page: perPage, _fields: 'id' }), method: 'HEAD', parse: false }).then(res => { const pages = parseInt(res.headers.get('X-WP-TotalPages')); setDefaultPages({ ...defaultPages, [key]: pages <= 1 ? 1 : pages // If there are 0 pages, it means that there are no comments, but there is no 0th page. }); }); }, [defaultPage, postId, perPage, setDefaultPages]); // The oldest one is always the first one. return defaultPage === 'newest' ? page : 1; }; /** * Generate a tree structure of comment IDs from a list of comment entities. The * children of each comment are obtained from `_embedded`. * * @typedef {{ commentId: number, children: CommentNode }} CommentNode * * @param {Object[]} topLevelComments List of comment entities. * @return {{ commentTree: CommentNode[]}} Tree of comment IDs. */ const useCommentTree = topLevelComments => { const commentTree = (0,external_wp_element_namespaceObject.useMemo)(() => topLevelComments?.map(({ id, _embedded }) => { const [children] = _embedded?.children || [[]]; return { commentId: id, children: children.map(child => ({ commentId: child.id })) }; }), [topLevelComments]); return commentTree; }; ;// ./node_modules/@wordpress/block-library/build-module/comment-template/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']]; /** * Function that returns a comment structure that will be rendered with default placehoders. * * Each comment has a `commentId` property that is always a negative number in * case of the placeholders. This is to ensure that the comment does not * conflict with the actual (real) comments. * * @param {Object} settings Discussion Settings. * @param {number} [settings.perPage] - Comments per page setting or block attribute. * @param {boolean} [settings.pageComments] - Enable break comments into pages setting. * @param {boolean} [settings.threadComments] - Enable threaded (nested) comments setting. * @param {number} [settings.threadCommentsDepth] - Level deep of threaded comments. * * @typedef {{id: null, children: EmptyComment[]}} EmptyComment * @return {EmptyComment[]} Inner blocks of the Comment Template */ const getCommentsPlaceholder = ({ perPage, pageComments, threadComments, threadCommentsDepth }) => { // Limit commentsDepth to 3 const commentsDepth = !threadComments ? 1 : Math.min(threadCommentsDepth, 3); const buildChildrenComment = commentsLevel => { // Render children comments until commentsDepth is reached if (commentsLevel < commentsDepth) { const nextLevel = commentsLevel + 1; return [{ commentId: -(commentsLevel + 3), children: buildChildrenComment(nextLevel) }]; } return []; }; // Add the first comment and its children const placeholderComments = [{ commentId: -1, children: buildChildrenComment(1) }]; // Add a second comment unless the break comments setting is active and set to less than 2, and there is one nested comment max if ((!pageComments || perPage >= 2) && commentsDepth < 3) { placeholderComments.push({ commentId: -2, children: [] }); } // Add a third comment unless the break comments setting is active and set to less than 3, and there aren't nested comments if ((!pageComments || perPage >= 3) && commentsDepth < 2) { placeholderComments.push({ commentId: -3, children: [] }); } // In case that the value is set but larger than 3 we truncate it to 3. return placeholderComments; }; /** * Component which renders the inner blocks of the Comment Template. * * @param {Object} props Component props. * @param {Array} [props.comment] - A comment object. * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active. * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId. * @param {Array} [props.firstCommentId] - ID of the first comment in the array. * @param {Array} [props.blocks] - Array of blocks returned from * getBlocks() in parent . * @return {Element} Inner blocks of the Comment Template */ function CommentTemplateInnerBlocks({ comment, activeCommentId, setActiveCommentId, firstCommentId, blocks }) { const { children, ...innerBlocksProps } = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({}, { template: edit_TEMPLATE }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { ...innerBlocksProps, children: [comment.commentId === (activeCommentId || firstCommentId) ? children : null, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedCommentTemplatePreview, { blocks: blocks, commentId: comment.commentId, setActiveCommentId: setActiveCommentId, isHidden: comment.commentId === (activeCommentId || firstCommentId) }), comment?.children?.length > 0 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsList, { comments: comment.children, activeCommentId: activeCommentId, setActiveCommentId: setActiveCommentId, blocks: blocks, firstCommentId: firstCommentId }) : null] }); } const CommentTemplatePreview = ({ blocks, commentId, setActiveCommentId, isHidden }) => { const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({ blocks }); const handleOnClick = () => { setActiveCommentId(commentId); }; // We have to hide the preview block if the `comment` props points to // the currently active block! // Or, to put it differently, every preview block is visible unless it is the // currently active block - in this case we render its inner blocks. const style = { display: isHidden ? 'none' : undefined }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockPreviewProps, tabIndex: 0, role: "button", style: style // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role , onClick: handleOnClick, onKeyPress: handleOnClick }); }; const MemoizedCommentTemplatePreview = (0,external_wp_element_namespaceObject.memo)(CommentTemplatePreview); /** * Component that renders a list of (nested) comments. It is called recursively. * * @param {Object} props Component props. * @param {Array} [props.comments] - Array of comment objects. * @param {Array} [props.blockProps] - Props from parent's `useBlockProps()`. * @param {Array} [props.activeCommentId] - The ID of the comment that is currently active. * @param {Array} [props.setActiveCommentId] - The setter for activeCommentId. * @param {Array} [props.blocks] - Array of blocks returned from getBlocks() in parent. * @param {Object} [props.firstCommentId] - The ID of the first comment in the array of * comment objects. * @return {Element} List of comments. */ const CommentsList = ({ comments, blockProps, activeCommentId, setActiveCommentId, blocks, firstCommentId }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { ...blockProps, children: comments && comments.map(({ commentId, ...comment }, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { value: { // If the commentId is negative it means that this comment is a // "placeholder" and that the block is most likely being used in the // site editor. In this case, we have to set the commentId to `null` // because otherwise the (non-existent) comment with a negative ID // would be requested from the REST API. commentId: commentId < 0 ? null : commentId }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentTemplateInnerBlocks, { comment: { commentId, ...comment }, activeCommentId: activeCommentId, setActiveCommentId: setActiveCommentId, blocks: blocks, firstCommentId: firstCommentId }) }, comment.commentId || index)) }); function CommentTemplateEdit({ clientId, context: { postId } }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const [activeCommentId, setActiveCommentId] = (0,external_wp_element_namespaceObject.useState)(); const { commentOrder, threadCommentsDepth, threadComments, commentsPerPage, pageComments } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); return getSettings().__experimentalDiscussionSettings; }); const commentQuery = useCommentQueryArgs({ postId }); const { topLevelComments, blocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecords } = select(external_wp_coreData_namespaceObject.store); const { getBlocks } = select(external_wp_blockEditor_namespaceObject.store); return { // Request only top-level comments. Replies are embedded. topLevelComments: commentQuery ? getEntityRecords('root', 'comment', commentQuery) : null, blocks: getBlocks(clientId) }; }, [clientId, commentQuery]); // Generate a tree structure of comment IDs. let commentTree = useCommentTree( // Reverse the order of top comments if needed. commentOrder === 'desc' && topLevelComments ? [...topLevelComments].reverse() : topLevelComments); if (!topLevelComments) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }); } if (!postId) { commentTree = getCommentsPlaceholder({ perPage: commentsPerPage, pageComments, threadComments, threadCommentsDepth }); } if (!commentTree.length) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { ...blockProps, children: (0,external_wp_i18n_namespaceObject.__)('No results found.') }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsList, { comments: commentTree, blockProps: blockProps, blocks: blocks, activeCommentId: activeCommentId, setActiveCommentId: setActiveCommentId, firstCommentId: commentTree[0]?.commentId }); } ;// ./node_modules/@wordpress/block-library/build-module/comment-template/save.js /** * WordPress dependencies */ function CommentTemplateSave() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } ;// ./node_modules/@wordpress/block-library/build-module/comment-template/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comment_template_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comment-template", title: "Comment Template", category: "design", parent: ["core/comments"], description: "Contains the block elements used to display a comment, like the title, date, author, avatar and more.", textdomain: "default", usesContext: ["postId"], supports: { align: true, html: false, reusable: false, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-comment-template" }; const { name: comment_template_name } = comment_template_metadata; const comment_template_settings = { icon: library_layout, edit: CommentTemplateEdit, save: CommentTemplateSave }; const comment_template_init = () => initBlock({ name: comment_template_name, metadata: comment_template_metadata, settings: comment_template_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/query-pagination-previous.js /** * WordPress dependencies */ const queryPaginationPrevious = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z" }) }); /* harmony default export */ const query_pagination_previous = (queryPaginationPrevious); ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/edit.js /** * WordPress dependencies */ const arrowMap = { none: '', arrow: '←', chevron: '«' }; function CommentsPaginationPreviousEdit({ attributes: { label }, setAttributes, context: { 'comments/paginationArrow': paginationArrow } }) { const displayArrow = arrowMap[paginationArrow]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#comments-pagination-previous-pseudo-link", onClick: event => event.preventDefault(), ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: [displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: `wp-block-comments-pagination-previous-arrow is-arrow-${paginationArrow}`, children: displayArrow }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { __experimentalVersion: 2, tagName: "span", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Older comments page link'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Older Comments'), value: label, onChange: newLabel => setAttributes({ label: newLabel }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-previous/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_pagination_previous_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-pagination-previous", title: "Comments Previous Page", category: "theme", parent: ["core/comments-pagination"], description: "Displays the previous comment's page link.", textdomain: "default", attributes: { label: { type: "string" } }, usesContext: ["postId", "comments/paginationArrow"], supports: { reusable: false, html: false, color: { gradients: true, text: false, __experimentalDefaultControls: { background: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } } }; const { name: comments_pagination_previous_name } = comments_pagination_previous_metadata; const comments_pagination_previous_settings = { icon: query_pagination_previous, edit: CommentsPaginationPreviousEdit, example: { attributes: { label: (0,external_wp_i18n_namespaceObject.__)('Older Comments') } } }; const comments_pagination_previous_init = () => initBlock({ name: comments_pagination_previous_name, metadata: comments_pagination_previous_metadata, settings: comments_pagination_previous_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/query-pagination.js /** * WordPress dependencies */ const queryPagination = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z" }) }); /* harmony default export */ const query_pagination = (queryPagination); ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.js /** * WordPress dependencies */ function CommentsPaginationArrowControls({ value, onChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Arrow'), value: value, onChange: onChange, help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous comments link.'), isBlock: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "none", label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Comments Pagination Next/Previous blocks') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "arrow", label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Comments Pagination Next/Previous blocks') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "chevron", label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Comments Pagination Next/Previous blocks') })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_pagination_edit_TEMPLATE = [['core/comments-pagination-previous'], ['core/comments-pagination-numbers'], ['core/comments-pagination-next']]; function QueryPaginationEdit({ attributes: { paginationArrow }, setAttributes, clientId }) { const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlocks } = select(external_wp_blockEditor_namespaceObject.store); const innerBlocks = getBlocks(clientId); /** * Show the `paginationArrow` control only if a * Comments Pagination Next or Comments Pagination Previous * block exists. */ return innerBlocks?.find(innerBlock => { return ['core/comments-pagination-previous', 'core/comments-pagination-next'].includes(innerBlock.name); }); }, []); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: comments_pagination_edit_TEMPLATE }); // Get the Discussion settings const pageComments = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); const { __experimentalDiscussionSettings } = getSettings(); return __experimentalDiscussionSettings?.pageComments; }, []); // If paging comments is not enabled in the Discussion Settings then hide the pagination // controls. We don't want to remove them from the template so that when the user enables // paging comments, the controls will be visible. if (!pageComments) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Comments Pagination block: paging comments is disabled in the Discussion Settings') }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [hasNextPreviousBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CommentsPaginationArrowControls, { value: paginationArrow, onChange: value => { setAttributes({ paginationArrow: value }); } }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/save.js /** * WordPress dependencies */ function comments_pagination_save_save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_pagination_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-pagination", title: "Comments Pagination", category: "theme", parent: ["core/comments"], allowedBlocks: ["core/comments-pagination-previous", "core/comments-pagination-numbers", "core/comments-pagination-next"], description: "Displays a paginated navigation to next/previous set of comments, when applicable.", textdomain: "default", attributes: { paginationArrow: { type: "string", "default": "none" } }, example: { attributes: { paginationArrow: "none" } }, providesContext: { "comments/paginationArrow": "paginationArrow" }, supports: { align: true, reusable: false, html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, layout: { allowSwitching: false, allowInheriting: false, "default": { type: "flex" } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-comments-pagination-editor", style: "wp-block-comments-pagination" }; const { name: comments_pagination_name } = comments_pagination_metadata; const comments_pagination_settings = { icon: query_pagination, edit: QueryPaginationEdit, save: comments_pagination_save_save }; const comments_pagination_init = () => initBlock({ name: comments_pagination_name, metadata: comments_pagination_metadata, settings: comments_pagination_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/query-pagination-next.js /** * WordPress dependencies */ const queryPaginationNext = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z" }) }); /* harmony default export */ const query_pagination_next = (queryPaginationNext); ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/edit.js /** * WordPress dependencies */ const edit_arrowMap = { none: '', arrow: '→', chevron: '»' }; function CommentsPaginationNextEdit({ attributes: { label }, setAttributes, context: { 'comments/paginationArrow': paginationArrow } }) { const displayArrow = edit_arrowMap[paginationArrow]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#comments-pagination-next-pseudo-link", onClick: event => event.preventDefault(), ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { __experimentalVersion: 2, tagName: "span", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Newer comments page link'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Newer Comments'), value: label, onChange: newLabel => setAttributes({ label: newLabel }) }), displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: `wp-block-comments-pagination-next-arrow is-arrow-${paginationArrow}`, children: displayArrow })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-next/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_pagination_next_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-pagination-next", title: "Comments Next Page", category: "theme", parent: ["core/comments-pagination"], description: "Displays the next comment's page link.", textdomain: "default", attributes: { label: { type: "string" } }, usesContext: ["postId", "comments/paginationArrow"], supports: { reusable: false, html: false, color: { gradients: true, text: false, __experimentalDefaultControls: { background: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } } }; const { name: comments_pagination_next_name } = comments_pagination_next_metadata; const comments_pagination_next_settings = { icon: query_pagination_next, edit: CommentsPaginationNextEdit, example: { attributes: { label: (0,external_wp_i18n_namespaceObject.__)('Newer Comments') } } }; const comments_pagination_next_init = () => initBlock({ name: comments_pagination_next_name, metadata: comments_pagination_next_metadata, settings: comments_pagination_next_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/query-pagination-numbers.js /** * WordPress dependencies */ const queryPaginationNumbers = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z" }) }); /* harmony default export */ const query_pagination_numbers = (queryPaginationNumbers); ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/edit.js /** * WordPress dependencies */ const PaginationItem = ({ content, tag: Tag = 'a', extraClass = '' }) => Tag === 'a' ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { className: `page-numbers ${extraClass}`, href: "#comments-pagination-numbers-pseudo-link", onClick: event => event.preventDefault(), children: content }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { className: `page-numbers ${extraClass}`, children: content }); function CommentsPaginationNumbersEdit() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "1" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "2" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "3", tag: "span", extraClass: "current" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "4" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "5" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "...", tag: "span", extraClass: "dots" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PaginationItem, { content: "8" })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comments-pagination-numbers/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_pagination_numbers_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-pagination-numbers", title: "Comments Page Numbers", category: "theme", parent: ["core/comments-pagination"], description: "Displays a list of page numbers for comments pagination.", textdomain: "default", usesContext: ["postId"], supports: { reusable: false, html: false, color: { gradients: true, text: false, __experimentalDefaultControls: { background: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } } }; const { name: comments_pagination_numbers_name } = comments_pagination_numbers_metadata; const comments_pagination_numbers_settings = { icon: query_pagination_numbers, edit: CommentsPaginationNumbersEdit, example: {} }; const comments_pagination_numbers_init = () => initBlock({ name: comments_pagination_numbers_name, metadata: comments_pagination_numbers_metadata, settings: comments_pagination_numbers_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/title.js /** * WordPress dependencies */ const title = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m4 5.5h2v6.5h1.5v-6.5h2v-1.5h-5.5zm16 10.5h-16v-1.5h16zm-7 4h-9v-1.5h9z" }) }); /* harmony default export */ const library_title = (title); ;// ./node_modules/@wordpress/block-library/build-module/comments-title/edit.js /** * External dependencies */ /** * WordPress dependencies */ function comments_title_edit_Edit({ attributes: { textAlign, showPostTitle, showCommentsCount, level, levelOptions }, setAttributes, context: { postType, postId } }) { const TagName = 'h' + level; const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)(); const [rawTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId); const isSiteEditor = typeof postId === 'undefined'; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const { threadCommentsDepth, threadComments, commentsPerPage, pageComments } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); return getSettings().__experimentalDiscussionSettings; }); (0,external_wp_element_namespaceObject.useEffect)(() => { if (isSiteEditor) { // Match the number of comments that will be shown in the comment-template/edit.js placeholder const nestedCommentsNumber = threadComments ? Math.min(threadCommentsDepth, 3) - 1 : 0; const topLevelCommentsNumber = pageComments ? commentsPerPage : 3; const commentsNumber = parseInt(nestedCommentsNumber) + parseInt(topLevelCommentsNumber); setCommentsCount(Math.min(commentsNumber, 3)); return; } const currentPostId = postId; external_wp_apiFetch_default()({ path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { post: postId, _fields: 'id' }), method: 'HEAD', parse: false }).then(res => { // Stale requests will have the `currentPostId` of an older closure. if (currentPostId === postId) { setCommentsCount(parseInt(res.headers.get('X-WP-Total'))); } }).catch(() => { setCommentsCount(0); }); }, [postId]); const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: newAlign => setAttributes({ textAlign: newAlign }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { value: level, options: levelOptions, onChange: newLevel => setAttributes({ level: newLevel }) })] }); const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show post title'), checked: showPostTitle, onChange: value => setAttributes({ showPostTitle: value }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show comments count'), checked: showCommentsCount, onChange: value => setAttributes({ showCommentsCount: value }) })] }) }); const postTitle = isSiteEditor ? (0,external_wp_i18n_namespaceObject.__)('“Post Title”') : `"${rawTitle}"`; let placeholder; if (showCommentsCount && commentsCount !== undefined) { if (showPostTitle) { if (commentsCount === 1) { /* translators: %s: Post title. */ placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('One response to %s'), postTitle); } else { placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Number of comments, 2: Post title. */ (0,external_wp_i18n_namespaceObject._n)('%1$s response to %2$s', '%1$s responses to %2$s', commentsCount), commentsCount, postTitle); } } else if (commentsCount === 1) { placeholder = (0,external_wp_i18n_namespaceObject.__)('One response'); } else { placeholder = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Number of comments. */ (0,external_wp_i18n_namespaceObject._n)('%s response', '%s responses', commentsCount), commentsCount); } } else if (showPostTitle) { if (commentsCount === 1) { /* translators: %s: Post title. */ placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Response to %s'), postTitle); } else { /* translators: %s: Post title. */ placeholder = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Responses to %s'), postTitle); } } else if (commentsCount === 1) { placeholder = (0,external_wp_i18n_namespaceObject.__)('Response'); } else { placeholder = (0,external_wp_i18n_namespaceObject.__)('Responses'); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: placeholder })] }); } ;// ./node_modules/@wordpress/block-library/build-module/comments-title/deprecated.js /** * Internal dependencies */ const deprecated_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-title", title: "Comments Title", category: "theme", ancestor: ["core/comments"], description: "Displays a title with the number of comments.", textdomain: "default", usesContext: ["postId", "postType"], attributes: { textAlign: { type: "string" }, showPostTitle: { type: "boolean", "default": true }, showCommentsCount: { type: "boolean", "default": true }, level: { type: "number", "default": 2 }, levelOptions: { type: "array" } }, supports: { anchor: false, align: true, html: false, __experimentalBorder: { radius: true, color: true, width: true, style: true }, color: { gradients: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true, __experimentalFontFamily: true, __experimentalFontStyle: true, __experimentalFontWeight: true } }, interactivity: { clientNavigation: true } } }; const { attributes, supports } = deprecated_metadata; /* harmony default export */ const comments_title_deprecated = ([{ attributes: { ...attributes, singleCommentLabel: { type: 'string' }, multipleCommentsLabel: { type: 'string' } }, supports, migrate: oldAttributes => { const { singleCommentLabel, multipleCommentsLabel, ...newAttributes } = oldAttributes; return newAttributes; }, isEligible: ({ multipleCommentsLabel, singleCommentLabel }) => multipleCommentsLabel || singleCommentLabel, save: () => null }]); ;// ./node_modules/@wordpress/block-library/build-module/comments-title/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const comments_title_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/comments-title", title: "Comments Title", category: "theme", ancestor: ["core/comments"], description: "Displays a title with the number of comments.", textdomain: "default", usesContext: ["postId", "postType"], attributes: { textAlign: { type: "string" }, showPostTitle: { type: "boolean", "default": true }, showCommentsCount: { type: "boolean", "default": true }, level: { type: "number", "default": 2 }, levelOptions: { type: "array" } }, supports: { anchor: false, align: true, html: false, __experimentalBorder: { radius: true, color: true, width: true, style: true }, color: { gradients: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true, __experimentalFontFamily: true, __experimentalFontStyle: true, __experimentalFontWeight: true } }, interactivity: { clientNavigation: true } } }; const { name: comments_title_name } = comments_title_metadata; const comments_title_settings = { icon: library_title, edit: comments_title_edit_Edit, deprecated: comments_title_deprecated, example: {} }; const comments_title_init = () => initBlock({ name: comments_title_name, metadata: comments_title_metadata, settings: comments_title_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/cover.js /** * WordPress dependencies */ const cover = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h6.2v8.9l2.5-3.1 2.5 3.1V4.5h2.2c.4 0 .8.4.8.8v13.4z" }) }); /* harmony default export */ const library_cover = (cover); ;// ./node_modules/@wordpress/block-library/build-module/cover/shared.js /** * WordPress dependencies */ const POSITION_CLASSNAMES = { 'top left': 'is-position-top-left', 'top center': 'is-position-top-center', 'top right': 'is-position-top-right', 'center left': 'is-position-center-left', 'center center': 'is-position-center-center', center: 'is-position-center-center', 'center right': 'is-position-center-right', 'bottom left': 'is-position-bottom-left', 'bottom center': 'is-position-bottom-center', 'bottom right': 'is-position-bottom-right' }; const IMAGE_BACKGROUND_TYPE = 'image'; const VIDEO_BACKGROUND_TYPE = 'video'; const COVER_MIN_HEIGHT = 50; const COVER_MAX_HEIGHT = 1000; const COVER_DEFAULT_HEIGHT = 300; const DEFAULT_FOCAL_POINT = { x: 0.5, y: 0.5 }; const shared_ALLOWED_MEDIA_TYPES = ['image', 'video']; function mediaPosition({ x, y } = DEFAULT_FOCAL_POINT) { return `${Math.round(x * 100)}% ${Math.round(y * 100)}%`; } function dimRatioToClass(ratio) { return ratio === 50 || ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10); } function attributesFromMedia(media) { if (!media || !media.url && !media.src) { return { url: undefined, id: undefined }; } if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url); } let mediaType; // For media selections originated from a file upload. if (media.media_type) { if (media.media_type === IMAGE_BACKGROUND_TYPE) { mediaType = IMAGE_BACKGROUND_TYPE; } else { // Only images and videos are accepted so if the media_type is not an image we can assume it is a video. // Videos contain the media type of 'file' in the object returned from the rest api. mediaType = VIDEO_BACKGROUND_TYPE; } // For media selections originated from existing files in the media library. } else if (media.type && (media.type === IMAGE_BACKGROUND_TYPE || media.type === VIDEO_BACKGROUND_TYPE)) { mediaType = media.type; } else { return; } return { url: media.url || media.src, id: media.id, alt: media?.alt, backgroundType: mediaType, ...(mediaType === VIDEO_BACKGROUND_TYPE ? { hasParallax: undefined } : {}) }; } /** * Checks of the contentPosition is the center (default) position. * * @param {string} contentPosition The current content position. * @return {boolean} Whether the contentPosition is center. */ function isContentPositionCenter(contentPosition) { return !contentPosition || contentPosition === 'center center' || contentPosition === 'center'; } /** * Retrieves the className for the current contentPosition. * The default position (center) will not have a className. * * @param {string} contentPosition The current content position. * @return {string} The className assigned to the contentPosition. */ function getPositionClassName(contentPosition) { /* * Only render a className if the contentPosition is not center (the default). */ if (isContentPositionCenter(contentPosition)) { return ''; } return POSITION_CLASSNAMES[contentPosition]; } ;// ./node_modules/@wordpress/block-library/build-module/cover/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function backgroundImageStyles(url) { return url ? { backgroundImage: `url(${url})` } : {}; } /** * Original function to determine the background opacity classname * * Used in deprecations: v1-7. * * @param {number} ratio ratio to use for opacity. * @return {string} background opacity class . */ function dimRatioToClassV1(ratio) { return ratio === 0 || ratio === 50 || !ratio ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10); } function migrateDimRatio(attributes) { return { ...attributes, dimRatio: !attributes.url ? 100 : attributes.dimRatio }; } function migrateTag(attributes) { if (!attributes.tagName) { attributes = { ...attributes, tagName: 'div' }; } return { ...attributes }; } const deprecated_blockAttributes = { url: { type: 'string' }, id: { type: 'number' }, hasParallax: { type: 'boolean', default: false }, dimRatio: { type: 'number', default: 50 }, overlayColor: { type: 'string' }, customOverlayColor: { type: 'string' }, backgroundType: { type: 'string', default: 'image' }, focalPoint: { type: 'object' } }; const v8ToV11BlockAttributes = { url: { type: 'string' }, id: { type: 'number' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, hasParallax: { type: 'boolean', default: false }, isRepeated: { type: 'boolean', default: false }, dimRatio: { type: 'number', default: 100 }, overlayColor: { type: 'string' }, customOverlayColor: { type: 'string' }, backgroundType: { type: 'string', default: 'image' }, focalPoint: { type: 'object' }, minHeight: { type: 'number' }, minHeightUnit: { type: 'string' }, gradient: { type: 'string' }, customGradient: { type: 'string' }, contentPosition: { type: 'string' }, isDark: { type: 'boolean', default: true }, allowedBlocks: { type: 'array' }, templateLock: { type: ['string', 'boolean'], enum: ['all', 'insert', false] } }; const v12toV13BlockAttributes = { ...v8ToV11BlockAttributes, useFeaturedImage: { type: 'boolean', default: false }, tagName: { type: 'string', default: 'div' } }; const v14BlockAttributes = { ...v12toV13BlockAttributes, isUserOverlayColor: { type: 'boolean' }, sizeSlug: { type: 'string' }, alt: { type: 'string', default: '' } }; const v7toV11BlockSupports = { anchor: true, align: true, html: false, spacing: { padding: true, __experimentalDefaultControls: { padding: true } }, color: { __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background', text: false, background: false } }; const v12BlockSupports = { ...v7toV11BlockSupports, spacing: { padding: true, margin: ['top', 'bottom'], blockGap: true, __experimentalDefaultControls: { padding: true, blockGap: true } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, color: { __experimentalDuotone: '> .wp-block-cover__image-background, > .wp-block-cover__video-background', heading: true, text: true, background: false, __experimentalSkipSerialization: ['gradients'], enableContrastChecker: false }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, layout: { allowJustification: false } }; const v14BlockSupports = { ...v12BlockSupports, shadow: true, dimensions: { aspectRatio: true }, interactivity: { clientNavigation: true } }; // Deprecation for blocks that have z-index. const v14 = { attributes: v14BlockAttributes, supports: v14BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, useFeaturedImage, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit, tagName: Tag, sizeSlug } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; const backgroundImage = url ? `url(${url})` : undefined; const backgroundPosition = mediaPosition(focalPoint); const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null, { [`size-${sizeSlug}`]: sizeSlug, 'has-parallax': hasParallax, 'is-repeated': isRepeated }); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: imgClasses, alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: alt ? 'img' : undefined, "aria-label": alt ? alt : undefined, className: imgClasses, style: { backgroundPosition, backgroundImage } })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); } }; // Deprecation for blocks that does not have the aria-label when the image background is fixed or repeated. const v13 = { attributes: v12toV13BlockAttributes, supports: v12BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, useFeaturedImage, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit, tagName: Tag } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; const backgroundImage = url ? `url(${url})` : undefined; const backgroundPosition = mediaPosition(focalPoint); const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null, { 'has-parallax': hasParallax, 'is-repeated': isRepeated }); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: imgClasses, alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "img", className: imgClasses, style: { backgroundPosition, backgroundImage } })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); } }; // Deprecation for blocks to prevent auto overlay color from overriding previously set values. const deprecated_v12 = { attributes: v12toV13BlockAttributes, supports: v12BlockSupports, isEligible(attributes) { return (attributes.customOverlayColor !== undefined || attributes.overlayColor !== undefined) && attributes.isUserOverlayColor === undefined; }, migrate(attributes) { return { ...attributes, isUserOverlayColor: true }; }, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, useFeaturedImage, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit, tagName: Tag } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; const backgroundImage = url ? `url(${url})` : undefined; const backgroundPosition = mediaPosition(focalPoint); const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null, { 'has-parallax': hasParallax, 'is-repeated': isRepeated }); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: imgClasses, alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "img", className: imgClasses, style: { backgroundPosition, backgroundImage } })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); } }; // Deprecation for blocks that does not have a HTML tag option. const deprecated_v11 = { attributes: v8ToV11BlockAttributes, supports: v7toV11BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, useFeaturedImage, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; const backgroundImage = url ? `url(${url})` : undefined; const backgroundPosition = mediaPosition(focalPoint); const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null, { 'has-parallax': hasParallax, 'is-repeated': isRepeated }); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), !useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: imgClasses, alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: "img", className: imgClasses, style: { backgroundPosition, backgroundImage } })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); }, migrate: migrateTag }; // Deprecation for blocks that renders fixed background as background from the main block container. const deprecated_v10 = { attributes: v8ToV11BlockAttributes, supports: v7toV11BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, useFeaturedImage, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { ...(isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}), minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined; const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), !useFeaturedImage && isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null), alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); }, migrate: migrateTag }; // Deprecation for blocks with `minHeightUnit` set but no `minHeight`. const v9 = { attributes: v8ToV11BlockAttributes, supports: v7toV11BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined; const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null), alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); }, migrate: migrateTag }; // v8: deprecated to remove duplicated gradient classes and swap `wp-block-cover__gradient-background` for `wp-block-cover__background`. const v8 = { attributes: v8ToV11BlockAttributes, supports: v7toV11BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined; const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx(overlayColorClass, dimRatioToClass(dimRatio), 'wp-block-cover__gradient-background', gradientClass, { 'has-background-dim': dimRatio !== undefined, 'has-background-gradient': gradient || customGradient, [gradientClass]: !url && gradientClass }), style: bgStyle }), isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null), alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); }, migrate: migrateTag }; const v7 = { attributes: { ...deprecated_blockAttributes, isRepeated: { type: 'boolean', default: false }, minHeight: { type: 'number' }, minHeightUnit: { type: 'string' }, gradient: { type: 'string' }, customGradient: { type: 'string' }, contentPosition: { type: 'string' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' } }, supports: v7toV11BlockSupports, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { ...(isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}), backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient && !url ? customGradient : undefined, minHeight: minHeight || undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : undefined; const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-background-gradient': gradient || customGradient, [gradientClass]: !url && gradientClass, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined }), isImageBackground && isImgElement && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null), alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })] }); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) }; const v6 = { attributes: { ...deprecated_blockAttributes, isRepeated: { type: 'boolean', default: false }, minHeight: { type: 'number' }, minHeightUnit: { type: 'string' }, gradient: { type: 'string' }, customGradient: { type: 'string' }, contentPosition: { type: 'string' } }, supports: { align: true }, save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, isRepeated, overlayColor, url, minHeight: minHeightProp, minHeightUnit } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const style = isImageBackground ? backgroundImageStyles(url) : {}; const videoStyle = {}; if (!overlayColorClass) { style.backgroundColor = customOverlayColor; } if (customGradient && !url) { style.background = customGradient; } style.minHeight = minHeight || undefined; let positionValue; if (focalPoint) { positionValue = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`; if (isImageBackground && !hasParallax) { style.backgroundPosition = positionValue; } if (isVideoBackground) { videoStyle.objectPosition = positionValue; } } const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-background-gradient': gradient || customGradient, [gradientClass]: !url && gradientClass, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined }), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: videoStyle }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })] }); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) }; const v5 = { attributes: { ...deprecated_blockAttributes, minHeight: { type: 'number' }, gradient: { type: 'string' }, customGradient: { type: 'string' } }, supports: { align: true }, save({ attributes }) { const { backgroundType, gradient, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, overlayColor, url, minHeight } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; if (!overlayColorClass) { style.backgroundColor = customOverlayColor; } if (focalPoint && !hasParallax) { style.backgroundPosition = `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%`; } if (customGradient && !url) { style.background = customGradient; } style.minHeight = minHeight || undefined; const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, 'has-background-gradient': customGradient, [gradientClass]: !url && gradientClass }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: classes, style: style, children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined }), VIDEO_BACKGROUND_TYPE === backgroundType && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, src: url }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })] }); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) }; const v4 = { attributes: { ...deprecated_blockAttributes, minHeight: { type: 'number' }, gradient: { type: 'string' }, customGradient: { type: 'string' } }, supports: { align: true }, save({ attributes }) { const { backgroundType, gradient, customGradient, customOverlayColor, dimRatio, focalPoint, hasParallax, overlayColor, url, minHeight } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; if (!overlayColorClass) { style.backgroundColor = customOverlayColor; } if (focalPoint && !hasParallax) { style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`; } if (customGradient && !url) { style.background = customGradient; } style.minHeight = minHeight || undefined; const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, 'has-background-gradient': customGradient, [gradientClass]: !url && gradientClass }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: classes, style: style, children: [url && (gradient || customGradient) && dimRatio !== 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__gradient-background', gradientClass), style: customGradient ? { background: customGradient } : undefined }), VIDEO_BACKGROUND_TYPE === backgroundType && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, src: url }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__inner-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })] }); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateDimRatio, migrateTag) }; const v3 = { attributes: { ...deprecated_blockAttributes, title: { type: 'string', source: 'html', selector: 'p' }, contentAlign: { type: 'string', default: 'center' } }, supports: { align: true }, save({ attributes }) { const { backgroundType, contentAlign, customOverlayColor, dimRatio, focalPoint, hasParallax, overlayColor, title, url } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const style = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; if (!overlayColorClass) { style.backgroundColor = customOverlayColor; } if (focalPoint && !hasParallax) { style.backgroundPosition = `${focalPoint.x * 100}% ${focalPoint.y * 100}%`; } const classes = dist_clsx(dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, [`has-${contentAlign}-content`]: contentAlign !== 'center' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: classes, style: style, children: [VIDEO_BACKGROUND_TYPE === backgroundType && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, src: url }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", className: "wp-block-cover-text", value: title })] }); }, migrate(attributes) { const newAttribs = { ...attributes, dimRatio: !attributes.url ? 100 : attributes.dimRatio, tagName: !attributes.tagName ? 'div' : attributes.tagName }; const { title, contentAlign, ...restAttributes } = newAttribs; return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: attributes.title, align: attributes.contentAlign, fontSize: 'large', placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') })]]; } }; const v2 = { attributes: { ...deprecated_blockAttributes, title: { type: 'string', source: 'html', selector: 'p' }, contentAlign: { type: 'string', default: 'center' }, align: { type: 'string' } }, supports: { className: false }, save({ attributes }) { const { url, title, hasParallax, dimRatio, align, contentAlign, overlayColor, customOverlayColor } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const style = backgroundImageStyles(url); if (!overlayColorClass) { style.backgroundColor = customOverlayColor; } const classes = dist_clsx('wp-block-cover-image', dimRatioToClassV1(dimRatio), overlayColorClass, { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax, [`has-${contentAlign}-content`]: contentAlign !== 'center' }, align ? `align${align}` : null); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: classes, style: style, children: !external_wp_blockEditor_namespaceObject.RichText.isEmpty(title) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", className: "wp-block-cover-image-text", value: title }) }); }, migrate(attributes) { const newAttribs = { ...attributes, dimRatio: !attributes.url ? 100 : attributes.dimRatio, tagName: !attributes.tagName ? 'div' : attributes.tagName }; const { title, contentAlign, align, ...restAttributes } = newAttribs; return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: attributes.title, align: attributes.contentAlign, fontSize: 'large', placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') })]]; } }; const cover_deprecated_v1 = { attributes: { ...deprecated_blockAttributes, title: { type: 'string', source: 'html', selector: 'h2' }, align: { type: 'string' }, contentAlign: { type: 'string', default: 'center' } }, supports: { className: false }, save({ attributes }) { const { url, title, hasParallax, dimRatio, align } = attributes; const style = backgroundImageStyles(url); const classes = dist_clsx('wp-block-cover-image', dimRatioToClassV1(dimRatio), { 'has-background-dim': dimRatio !== 0, 'has-parallax': hasParallax }, align ? `align${align}` : null); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("section", { className: classes, style: style, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "h2", value: title }) }); }, migrate(attributes) { const newAttribs = { ...attributes, dimRatio: !attributes.url ? 100 : attributes.dimRatio, tagName: !attributes.tagName ? 'div' : attributes.tagName }; const { title, contentAlign, align, ...restAttributes } = newAttribs; return [restAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: attributes.title, align: attributes.contentAlign, fontSize: 'large', placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…') })]]; } }; /* harmony default export */ const cover_deprecated = ([v14, v13, deprecated_v12, deprecated_v11, deprecated_v10, v9, v8, v7, v6, v5, v4, v3, v2, cover_deprecated_v1]); ;// ./node_modules/@wordpress/block-library/build-module/cover/constants.js const DEFAULT_MEDIA_SIZE_SLUG = 'full'; ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/inspector-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ const { cleanEmptyObject: inspector_controls_cleanEmptyObject, ResolutionTool } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function CoverHeightInput({ onChange, onUnitChange, unit = 'px', value = '' }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl); const inputId = `block-cover-height-input-${instanceId}`; const isPx = unit === 'px'; const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['px', 'em', 'rem', 'vw', 'vh'], defaultValues: { px: 430, '%': 20, em: 20, rem: 20, vw: 20, vh: 50 } }); const handleOnChange = unprocessedValue => { const inputValue = unprocessedValue !== '' ? parseFloat(unprocessedValue) : undefined; if (isNaN(inputValue) && inputValue !== undefined) { return; } onChange(inputValue); }; const computedValue = (0,external_wp_element_namespaceObject.useMemo)(() => { const [parsedQuantity] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value); return [parsedQuantity, unit].join(''); }, [unit, value]); const min = isPx ? COVER_MIN_HEIGHT : 0; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'), id: inputId, isResetValueOnUnitChange: true, min: min, onChange: handleOnChange, onUnitChange: onUnitChange, units: units, value: computedValue }); } function CoverInspectorControls({ attributes, setAttributes, clientId, setOverlayColor, coverRef, currentSettings, updateDimRatio, featuredImage }) { const { useFeaturedImage, id, dimRatio, focalPoint, hasParallax, isRepeated, minHeight, minHeightUnit, alt, tagName } = attributes; const { isVideoBackground, isImageBackground, mediaElement, url, overlayColor } = currentSettings; const sizeSlug = attributes.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG; const { gradientValue, setGradient } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const imageSizes = getSettings()?.imageSizes; const image = (0,external_wp_data_namespaceObject.useSelect)(select => id && isImageBackground ? select(external_wp_coreData_namespaceObject.store).getMedia(id, { context: 'view' }) : null, [id, isImageBackground]); const currentBackgroundImage = useFeaturedImage ? featuredImage : image; function updateImage(newSizeSlug) { const newUrl = currentBackgroundImage?.media_details?.sizes?.[newSizeSlug]?.source_url; if (!newUrl) { return null; } setAttributes({ url: newUrl, sizeSlug: newSizeSlug }); } const imageSizeOptions = imageSizes?.filter(({ slug }) => currentBackgroundImage?.media_details?.sizes?.[slug]?.source_url)?.map(({ name, slug }) => ({ value: slug, label: name })); const toggleParallax = () => { setAttributes({ hasParallax: !hasParallax, ...(!hasParallax ? { focalPoint: undefined } : {}) }); }; const toggleIsRepeated = () => { setAttributes({ isRepeated: !isRepeated }); }; const showFocalPointPicker = isVideoBackground || isImageBackground && (!hasParallax || isRepeated); const imperativeFocalPointPreview = value => { const [styleOfRef, property] = mediaElement.current ? [mediaElement.current.style, 'objectPosition'] : [coverRef.current.style, 'backgroundPosition']; styleOfRef[property] = mediaPosition(value); }; const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: !!url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ hasParallax: false, focalPoint: undefined, isRepeated: false, alt: '', sizeSlug: undefined }); }, dropdownMenuProps: dropdownMenuProps, children: [isImageBackground && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'), isShownByDefault: true, hasValue: () => hasParallax, onDeselect: () => setAttributes({ hasParallax: false, focalPoint: undefined }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Fixed background'), checked: hasParallax, onChange: toggleParallax }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'), isShownByDefault: true, hasValue: () => isRepeated, onDeselect: () => setAttributes({ isRepeated: false }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Repeated background'), checked: isRepeated, onChange: toggleIsRepeated }) })] }), showFocalPointPicker && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), isShownByDefault: true, hasValue: () => !!focalPoint, onDeselect: () => setAttributes({ focalPoint: undefined }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FocalPointPicker, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), url: url, value: focalPoint, onDragStart: imperativeFocalPointPreview, onDrag: imperativeFocalPointPreview, onChange: newFocalPoint => setAttributes({ focalPoint: newFocalPoint }) }) }), !useFeaturedImage && url && !isVideoBackground && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), isShownByDefault: true, hasValue: () => !!alt, onDeselect: () => setAttributes({ alt: '' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), value: alt, onChange: newAlt => setAttributes({ alt: newAlt }), help: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. (0,external_wp_i18n_namespaceObject.__)('https://www.w3.org/WAI/tutorials/images/decision-tree/'), children: (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')] }) }) }), !!imageSizeOptions?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResolutionTool, { value: sizeSlug, onChange: updateImage, options: imageSizeOptions, defaultValue: DEFAULT_MEDIA_SIZE_SLUG })] }) }), colorGradientSettings.hasColorsOrGradients && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "color", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { __experimentalIsRenderedInSidebar: true, settings: [{ colorValue: overlayColor.color, gradientValue, label: (0,external_wp_i18n_namespaceObject.__)('Overlay'), onColorChange: setOverlayColor, onGradientChange: setGradient, isShownByDefault: true, resetAllFilter: () => ({ overlayColor: undefined, customOverlayColor: undefined, gradient: undefined, customGradient: undefined }), clearable: true }], panelId: clientId, ...colorGradientSettings }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => { // If there's a media background the dimRatio will be // defaulted to 50 whereas it will be 100 for colors. return dimRatio === undefined ? false : dimRatio !== (url ? 50 : 100); }, label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), onDeselect: () => updateDimRatio(url ? 50 : 100), resetAllFilter: () => ({ dimRatio: url ? 50 : 100 }), isShownByDefault: true, panelId: clientId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), value: dimRatio, onChange: newDimRatio => updateDimRatio(newDimRatio), min: 0, max: 100, step: 10, required: true, __next40pxDefaultSize: true }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "dimensions", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { className: "single-column", hasValue: () => !!minHeight, label: (0,external_wp_i18n_namespaceObject.__)('Minimum height'), onDeselect: () => setAttributes({ minHeight: undefined, minHeightUnit: undefined }), resetAllFilter: () => ({ minHeight: undefined, minHeightUnit: undefined }), isShownByDefault: true, panelId: clientId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverHeightInput, { value: attributes?.style?.dimensions?.aspectRatio ? '' : minHeight, unit: minHeightUnit, onChange: newMinHeight => setAttributes({ minHeight: newMinHeight, style: inspector_controls_cleanEmptyObject({ ...attributes?.style, dimensions: { ...attributes?.style?.dimensions, aspectRatio: undefined // Reset aspect ratio when minHeight is set. } }) }), onUnitChange: nextUnit => setAttributes({ minHeightUnit: nextUnit }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), options: [{ label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), value: 'div' }, { label: '<header>', value: 'header' }, { label: '<main>', value: 'main' }, { label: '<section>', value: 'section' }, { label: '<article>', value: 'article' }, { label: '<aside>', value: 'aside' }, { label: '<footer>', value: 'footer' }], value: tagName, onChange: value => setAttributes({ tagName: value }), help: htmlElementMessages[tagName] }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/block-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ const { cleanEmptyObject: block_controls_cleanEmptyObject } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function CoverBlockControls({ attributes, setAttributes, onSelectMedia, currentSettings, toggleUseFeaturedImage, onClearMedia }) { const { contentPosition, id, useFeaturedImage, minHeight, minHeightUnit } = attributes; const { hasInnerBlocks, url } = currentSettings; const [prevMinHeightValue, setPrevMinHeightValue] = (0,external_wp_element_namespaceObject.useState)(minHeight); const [prevMinHeightUnit, setPrevMinHeightUnit] = (0,external_wp_element_namespaceObject.useState)(minHeightUnit); const isMinFullHeight = minHeightUnit === 'vh' && minHeight === 100 && !attributes?.style?.dimensions?.aspectRatio; const toggleMinFullHeight = () => { if (isMinFullHeight) { // If there aren't previous values, take the default ones. if (prevMinHeightUnit === 'vh' && prevMinHeightValue === 100) { return setAttributes({ minHeight: undefined, minHeightUnit: undefined }); } // Set the previous values of height. return setAttributes({ minHeight: prevMinHeightValue, minHeightUnit: prevMinHeightUnit }); } setPrevMinHeightValue(minHeight); setPrevMinHeightUnit(minHeightUnit); // Set full height, and clear any aspect ratio value. return setAttributes({ minHeight: 100, minHeightUnit: 'vh', style: block_controls_cleanEmptyObject({ ...attributes?.style, dimensions: { ...attributes?.style?.dimensions, aspectRatio: undefined // Reset aspect ratio when minHeight is set. } }) }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockAlignmentMatrixControl, { label: (0,external_wp_i18n_namespaceObject.__)('Change content position'), value: contentPosition, onChange: nextPosition => setAttributes({ contentPosition: nextPosition }), isDisabled: !hasInnerBlocks }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockFullHeightAligmentControl, { isActive: isMinFullHeight, onToggle: toggleMinFullHeight, isDisabled: !hasInnerBlocks })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: id, mediaURL: url, allowedTypes: shared_ALLOWED_MEDIA_TYPES, accept: "image/*,video/*", onSelect: onSelectMedia, onToggleFeaturedImage: toggleUseFeaturedImage, useFeaturedImage: useFeaturedImage, name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add media') : (0,external_wp_i18n_namespaceObject.__)('Replace'), onReset: onClearMedia }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/cover-placeholder.js /** * WordPress dependencies */ /** * Internal dependencies */ function CoverPlaceholder({ disableMediaButtons = false, children, onSelectMedia, onError, style, toggleUseFeaturedImage }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_cover }), labels: { title: (0,external_wp_i18n_namespaceObject.__)('Cover') }, onSelect: onSelectMedia, accept: "image/*,video/*", allowedTypes: shared_ALLOWED_MEDIA_TYPES, disableMediaButtons: disableMediaButtons, onToggleFeaturedImage: toggleUseFeaturedImage, onError: onError, style: style, children: children }); } ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/resizable-cover-popover.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const RESIZABLE_BOX_ENABLE_OPTION = { top: false, right: false, bottom: true, left: false, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }; const { ResizableBoxPopover } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function ResizableCoverPopover({ className, height, minHeight, onResize, onResizeStart, onResizeStop, showHandle, size, width, ...props }) { const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false); const resizableBoxProps = { className: dist_clsx(className, { 'is-resizing': isResizing }), enable: RESIZABLE_BOX_ENABLE_OPTION, onResizeStart: (_event, _direction, elt) => { onResizeStart(elt.clientHeight); onResize(elt.clientHeight); }, onResize: (_event, _direction, elt) => { onResize(elt.clientHeight); if (!isResizing) { setIsResizing(true); } }, onResizeStop: (_event, _direction, elt) => { onResizeStop(elt.clientHeight); setIsResizing(false); }, showHandle, size, __experimentalShowTooltip: true, __experimentalTooltipProps: { axis: 'y', position: 'bottom', isVisible: isResizing } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableBoxPopover, { className: "block-library-cover__resizable-box-popover", resizableBoxProps: resizableBoxProps, ...props }); } ;// ./node_modules/colord/index.mjs var colord_r={grad:.9,turn:360,rad:360/(2*Math.PI)},t=function(r){return"string"==typeof r?r.length>0:"number"==typeof r},n=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},a=function(r){return{r:e(r.r,0,255),g:e(r.g,0,255),b:e(r.b,0,255),a:e(r.a)}},o=function(r){return{r:n(r.r),g:n(r.g),b:n(r.b),a:n(r.a,3)}},i=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return{h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return{r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return{h:u(r.h),s:e(r.s,0,100),l:e(r.l,0,100),a:e(r.a)}},d=function(r){return{h:n(r.h),s:n(r.s),l:n(r.l),a:n(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e},c=function(r){return{h:(t=h(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u},l=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l.exec(t)||p.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(colord_r[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t(n)&&t(e)&&t(u)?a({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t(n)||!t(e)||!t(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t(n)||!t(a)||!t(o))return null;var h=function(r){return{h:u(r.h),s:e(r.s,0,100),v:e(r.v,0,100),a:e(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n<t.length;n++){var e=t[n][0](r);if(e)return[e,t[n][1]]}return[null,void 0]},x=function(r){return"string"==typeof r?N(r.trim(),y.string):"object"==typeof r&&null!==r?N(r,y.object):[null,void 0]},I=function(r){return x(r)[1]},M=function(r,t){var n=c(r);return{h:n.h,s:e(n.s+100*t,0,100),l:n.l,a:n.a}},H=function(r){return(299*r.r+587*r.g+114*r.b)/1e3/255},$=function(r,t){var n=c(r);return{h:n.h,s:n.s,l:e(n.l+100*t,0,100),a:n.a}},j=function(){function r(r){this.parsed=x(r)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return r.prototype.isValid=function(){return null!==this.parsed},r.prototype.brightness=function(){return n(H(this.rgba),2)},r.prototype.isDark=function(){return H(this.rgba)<.5},r.prototype.isLight=function(){return H(this.rgba)>=.5},r.prototype.toHex=function(){return r=o(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i},r.prototype.toRgb=function(){return o(this.rgba)},r.prototype.toRgbString=function(){return r=o(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u},r.prototype.toHsv=function(){return r=h(this.rgba),{h:n(r.h),s:n(r.s),v:n(r.v),a:n(r.a,3)};var r},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w($(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w($(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return"number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n(this.rgba.a,3);var t},r.prototype.hue=function(r){var t=c(this.rgba);return"number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n(t.h)},r.prototype.isEqual=function(r){return this.toHex()===w(r).toHex()},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r))})},E=function(){return new j({r:255*Math.random(),g:255*Math.random(),b:255*Math.random()})}; ;// ./node_modules/colord/plugins/names.mjs /* harmony default export */ function names(e,f){var a={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var d in a)r[a[d]]=d;var l={};e.prototype.toName=function(f){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,i,n=r[this.toHex()];if(n)return n;if(null==f?void 0:f.closest){var o=this.toRgb(),t=1/0,b="black";if(!l.length)for(var c in a)l[c]=new e(a[c]).toRgb();for(var g in a){var u=(d=o,i=l[g],Math.pow(d.r-i.r,2)+Math.pow(d.g-i.g,2)+Math.pow(d.b-i.b,2));u<t&&(t=u,b=g)}return b}};f.string.push([function(f){var r=f.toLowerCase(),d="transparent"===r?"#0000":a[r];return d?new e(d).toRgb():null},"name"])} ;// ./node_modules/fast-average-color/dist/index.esm.js /*! Fast Average Color | © 2022 Denis Seleznev | MIT License | https://github.com/fast-average-color/fast-average-color */ function toHex(num) { var str = num.toString(16); return str.length === 1 ? '0' + str : str; } function arrayToHex(arr) { return '#' + arr.map(toHex).join(''); } function isDark(color) { // http://www.w3.org/TR/AERT#color-contrast var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1000; return result < 128; } function prepareIgnoredColor(color) { if (!color) { return []; } return isRGBArray(color) ? color : [color]; } function isRGBArray(value) { return Array.isArray(value[0]); } function isIgnoredColor(data, index, ignoredColor) { for (var i = 0; i < ignoredColor.length; i++) { if (isIgnoredColorAsNumbers(data, index, ignoredColor[i])) { return true; } } return false; } function isIgnoredColorAsNumbers(data, index, ignoredColor) { switch (ignoredColor.length) { case 3: // [red, green, blue] if (isIgnoredRGBColor(data, index, ignoredColor)) { return true; } break; case 4: // [red, green, blue, alpha] if (isIgnoredRGBAColor(data, index, ignoredColor)) { return true; } break; case 5: // [red, green, blue, alpha, threshold] if (isIgnoredRGBAColorWithThreshold(data, index, ignoredColor)) { return true; } break; default: return false; } } function isIgnoredRGBColor(data, index, ignoredColor) { // Ignore if the pixel are transparent. if (data[index + 3] !== 255) { return true; } if (data[index] === ignoredColor[0] && data[index + 1] === ignoredColor[1] && data[index + 2] === ignoredColor[2]) { return true; } return false; } function isIgnoredRGBAColor(data, index, ignoredColor) { if (data[index + 3] && ignoredColor[3]) { return data[index] === ignoredColor[0] && data[index + 1] === ignoredColor[1] && data[index + 2] === ignoredColor[2] && data[index + 3] === ignoredColor[3]; } // Ignore rgb components if the pixel are fully transparent. return data[index + 3] === ignoredColor[3]; } function inRange(colorComponent, ignoredColorComponent, value) { return colorComponent >= (ignoredColorComponent - value) && colorComponent <= (ignoredColorComponent + value); } function isIgnoredRGBAColorWithThreshold(data, index, ignoredColor) { var redIgnored = ignoredColor[0]; var greenIgnored = ignoredColor[1]; var blueIgnored = ignoredColor[2]; var alphaIgnored = ignoredColor[3]; var threshold = ignoredColor[4]; var alphaData = data[index + 3]; var alphaInRange = inRange(alphaData, alphaIgnored, threshold); if (!alphaIgnored) { return alphaInRange; } if (!alphaData && alphaInRange) { return true; } if (inRange(data[index], redIgnored, threshold) && inRange(data[index + 1], greenIgnored, threshold) && inRange(data[index + 2], blueIgnored, threshold) && alphaInRange) { return true; } return false; } function dominantAlgorithm(arr, len, options) { var colorHash = {}; var divider = 24; var ignoredColor = options.ignoredColor; var step = options.step; var max = [0, 0, 0, 0, 0]; for (var i = 0; i < len; i += step) { var red = arr[i]; var green = arr[i + 1]; var blue = arr[i + 2]; var alpha = arr[i + 3]; if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { continue; } var key = Math.round(red / divider) + ',' + Math.round(green / divider) + ',' + Math.round(blue / divider); if (colorHash[key]) { colorHash[key] = [ colorHash[key][0] + red * alpha, colorHash[key][1] + green * alpha, colorHash[key][2] + blue * alpha, colorHash[key][3] + alpha, colorHash[key][4] + 1 ]; } else { colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1]; } if (max[4] < colorHash[key][4]) { max = colorHash[key]; } } var redTotal = max[0]; var greenTotal = max[1]; var blueTotal = max[2]; var alphaTotal = max[3]; var count = max[4]; return alphaTotal ? [ Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count) ] : options.defaultColor; } function simpleAlgorithm(arr, len, options) { var redTotal = 0; var greenTotal = 0; var blueTotal = 0; var alphaTotal = 0; var count = 0; var ignoredColor = options.ignoredColor; var step = options.step; for (var i = 0; i < len; i += step) { var alpha = arr[i + 3]; var red = arr[i] * alpha; var green = arr[i + 1] * alpha; var blue = arr[i + 2] * alpha; if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { continue; } redTotal += red; greenTotal += green; blueTotal += blue; alphaTotal += alpha; count++; } return alphaTotal ? [ Math.round(redTotal / alphaTotal), Math.round(greenTotal / alphaTotal), Math.round(blueTotal / alphaTotal), Math.round(alphaTotal / count) ] : options.defaultColor; } function sqrtAlgorithm(arr, len, options) { var redTotal = 0; var greenTotal = 0; var blueTotal = 0; var alphaTotal = 0; var count = 0; var ignoredColor = options.ignoredColor; var step = options.step; for (var i = 0; i < len; i += step) { var red = arr[i]; var green = arr[i + 1]; var blue = arr[i + 2]; var alpha = arr[i + 3]; if (ignoredColor && isIgnoredColor(arr, i, ignoredColor)) { continue; } redTotal += red * red * alpha; greenTotal += green * green * alpha; blueTotal += blue * blue * alpha; alphaTotal += alpha; count++; } return alphaTotal ? [ Math.round(Math.sqrt(redTotal / alphaTotal)), Math.round(Math.sqrt(greenTotal / alphaTotal)), Math.round(Math.sqrt(blueTotal / alphaTotal)), Math.round(alphaTotal / count) ] : options.defaultColor; } function getDefaultColor(options) { return getOption(options, 'defaultColor', [0, 0, 0, 0]); } function getOption(options, name, defaultValue) { return (options[name] === undefined ? defaultValue : options[name]); } var MIN_SIZE = 10; var MAX_SIZE = 100; function isSvg(filename) { return filename.search(/\.svg(\?|$)/i) !== -1; } function getOriginalSize(resource) { if (isInstanceOfHTMLImageElement(resource)) { var width = resource.naturalWidth; var height = resource.naturalHeight; // For SVG images with only viewBox attribute if (!resource.naturalWidth && isSvg(resource.src)) { width = height = MAX_SIZE; } return { width: width, height: height, }; } if (isInstanceOfHTMLVideoElement(resource)) { return { width: resource.videoWidth, height: resource.videoHeight }; } return { width: resource.width, height: resource.height }; } function getSrc(resource) { if (isInstanceOfHTMLCanvasElement(resource)) { return 'canvas'; } if (isInstanceOfOffscreenCanvas(resource)) { return 'offscreencanvas'; } if (isInstanceOfImageBitmap(resource)) { return 'imagebitmap'; } return resource.src; } function isInstanceOfHTMLImageElement(resource) { return typeof HTMLImageElement !== 'undefined' && resource instanceof HTMLImageElement; } var hasOffscreenCanvas = typeof OffscreenCanvas !== 'undefined'; function isInstanceOfOffscreenCanvas(resource) { return hasOffscreenCanvas && resource instanceof OffscreenCanvas; } function isInstanceOfHTMLVideoElement(resource) { return typeof HTMLVideoElement !== 'undefined' && resource instanceof HTMLVideoElement; } function isInstanceOfHTMLCanvasElement(resource) { return typeof HTMLCanvasElement !== 'undefined' && resource instanceof HTMLCanvasElement; } function isInstanceOfImageBitmap(resource) { return typeof ImageBitmap !== 'undefined' && resource instanceof ImageBitmap; } function prepareSizeAndPosition(originalSize, options) { var srcLeft = getOption(options, 'left', 0); var srcTop = getOption(options, 'top', 0); var srcWidth = getOption(options, 'width', originalSize.width); var srcHeight = getOption(options, 'height', originalSize.height); var destWidth = srcWidth; var destHeight = srcHeight; if (options.mode === 'precision') { return { srcLeft: srcLeft, srcTop: srcTop, srcWidth: srcWidth, srcHeight: srcHeight, destWidth: destWidth, destHeight: destHeight }; } var factor; if (srcWidth > srcHeight) { factor = srcWidth / srcHeight; destWidth = MAX_SIZE; destHeight = Math.round(destWidth / factor); } else { factor = srcHeight / srcWidth; destHeight = MAX_SIZE; destWidth = Math.round(destHeight / factor); } if (destWidth > srcWidth || destHeight > srcHeight || destWidth < MIN_SIZE || destHeight < MIN_SIZE) { destWidth = srcWidth; destHeight = srcHeight; } return { srcLeft: srcLeft, srcTop: srcTop, srcWidth: srcWidth, srcHeight: srcHeight, destWidth: destWidth, destHeight: destHeight }; } var isWebWorkers = typeof window === 'undefined'; function makeCanvas() { if (isWebWorkers) { return hasOffscreenCanvas ? new OffscreenCanvas(1, 1) : null; } return document.createElement('canvas'); } var ERROR_PREFIX = 'FastAverageColor: '; function getError(message) { return Error(ERROR_PREFIX + message); } function outputError(error, silent) { if (!silent) { console.error(error); } } var FastAverageColor = /** @class */ (function () { function FastAverageColor() { this.canvas = null; this.ctx = null; } /** * Get asynchronously the average color from not loaded image. */ FastAverageColor.prototype.getColorAsync = function (resource, options) { if (!resource) { return Promise.reject(getError('call .getColorAsync() without resource.')); } if (typeof resource === 'string') { // Web workers if (typeof Image === 'undefined') { return Promise.reject(getError('resource as string is not supported in this environment')); } var img = new Image(); img.crossOrigin = options && options.crossOrigin || ''; img.src = resource; return this.bindImageEvents(img, options); } else if (isInstanceOfHTMLImageElement(resource) && !resource.complete) { return this.bindImageEvents(resource, options); } else { var result = this.getColor(resource, options); return result.error ? Promise.reject(result.error) : Promise.resolve(result); } }; /** * Get the average color from images, videos and canvas. */ FastAverageColor.prototype.getColor = function (resource, options) { options = options || {}; var defaultColor = getDefaultColor(options); if (!resource) { var error = getError('call .getColor(null) without resource'); outputError(error, options.silent); return this.prepareResult(defaultColor, error); } var originalSize = getOriginalSize(resource); var size = prepareSizeAndPosition(originalSize, options); if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) { var error = getError("incorrect sizes for resource \"".concat(getSrc(resource), "\"")); outputError(error, options.silent); return this.prepareResult(defaultColor, error); } if (!this.canvas) { this.canvas = makeCanvas(); if (!this.canvas) { var error = getError('OffscreenCanvas is not supported in this browser'); outputError(error, options.silent); return this.prepareResult(defaultColor, error); } } if (!this.ctx) { this.ctx = this.canvas.getContext('2d', { willReadFrequently: true }); if (!this.ctx) { var error = getError('Canvas Context 2D is not supported in this browser'); outputError(error, options.silent); return this.prepareResult(defaultColor); } this.ctx.imageSmoothingEnabled = false; } this.canvas.width = size.destWidth; this.canvas.height = size.destHeight; try { this.ctx.clearRect(0, 0, size.destWidth, size.destHeight); this.ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight); var bitmapData = this.ctx.getImageData(0, 0, size.destWidth, size.destHeight).data; return this.prepareResult(this.getColorFromArray4(bitmapData, options)); } catch (originalError) { var error = getError("security error (CORS) for resource ".concat(getSrc(resource), ".\nDetails: https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image")); outputError(error, options.silent); !options.silent && console.error(originalError); return this.prepareResult(defaultColor, error); } }; /** * Get the average color from a array when 1 pixel is 4 bytes. */ FastAverageColor.prototype.getColorFromArray4 = function (arr, options) { options = options || {}; var bytesPerPixel = 4; var arrLength = arr.length; var defaultColor = getDefaultColor(options); if (arrLength < bytesPerPixel) { return defaultColor; } var len = arrLength - arrLength % bytesPerPixel; var step = (options.step || 1) * bytesPerPixel; var algorithm; switch (options.algorithm || 'sqrt') { case 'simple': algorithm = simpleAlgorithm; break; case 'sqrt': algorithm = sqrtAlgorithm; break; case 'dominant': algorithm = dominantAlgorithm; break; default: throw getError("".concat(options.algorithm, " is unknown algorithm")); } return algorithm(arr, len, { defaultColor: defaultColor, ignoredColor: prepareIgnoredColor(options.ignoredColor), step: step }); }; /** * Get color data from value ([r, g, b, a]). */ FastAverageColor.prototype.prepareResult = function (value, error) { var rgb = value.slice(0, 3); var rgba = [value[0], value[1], value[2], value[3] / 255]; var isDarkColor = isDark(value); return { value: [value[0], value[1], value[2], value[3]], rgb: 'rgb(' + rgb.join(',') + ')', rgba: 'rgba(' + rgba.join(',') + ')', hex: arrayToHex(rgb), hexa: arrayToHex(value), isDark: isDarkColor, isLight: !isDarkColor, error: error, }; }; /** * Destroy the instance. */ FastAverageColor.prototype.destroy = function () { if (this.canvas) { this.canvas.width = 1; this.canvas.height = 1; this.canvas = null; } this.ctx = null; }; FastAverageColor.prototype.bindImageEvents = function (resource, options) { var _this = this; return new Promise(function (resolve, reject) { var onload = function () { unbindEvents(); var result = _this.getColor(resource, options); if (result.error) { reject(result.error); } else { resolve(result); } }; var onerror = function () { unbindEvents(); reject(getError("Error loading image \"".concat(resource.src, "\"."))); }; var onabort = function () { unbindEvents(); reject(getError("Image \"".concat(resource.src, "\" loading aborted"))); }; var unbindEvents = function () { resource.removeEventListener('load', onload); resource.removeEventListener('error', onerror); resource.removeEventListener('abort', onabort); }; resource.addEventListener('load', onload); resource.addEventListener('error', onerror); resource.addEventListener('abort', onabort); }); }; return FastAverageColor; }()); ;// external ["wp","hooks"] const external_wp_hooks_namespaceObject = window["wp"]["hooks"]; ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/color-utils.js /** * External dependencies */ /** * WordPress dependencies */ /** * @typedef {import('colord').RgbaColor} RgbaColor */ k([names]); /** * Fallback color when the average color can't be computed. The image may be * rendering as transparent, and most sites have a light color background. */ const DEFAULT_BACKGROUND_COLOR = '#FFF'; /** * Default dim color specified in style.css. */ const DEFAULT_OVERLAY_COLOR = '#000'; /** * Performs a Porter Duff composite source over operation on two rgba colors. * * @see {@link https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators_srcover} * * @param {RgbaColor} source Source color. * @param {RgbaColor} dest Destination color. * * @return {RgbaColor} Composite color. */ function compositeSourceOver(source, dest) { return { r: source.r * source.a + dest.r * dest.a * (1 - source.a), g: source.g * source.a + dest.g * dest.a * (1 - source.a), b: source.b * source.a + dest.b * dest.a * (1 - source.a), a: source.a + dest.a * (1 - source.a) }; } /** * Retrieves the FastAverageColor singleton. * * @return {FastAverageColor} The FastAverageColor singleton. */ function retrieveFastAverageColor() { if (!retrieveFastAverageColor.fastAverageColor) { retrieveFastAverageColor.fastAverageColor = new FastAverageColor(); } return retrieveFastAverageColor.fastAverageColor; } /** * Computes the average color of an image. * * @param {string} url The url of the image. * * @return {Promise<string>} Promise of an average color as a hex string. */ const getMediaColor = memize(async url => { if (!url) { return DEFAULT_BACKGROUND_COLOR; } // making the default color rgb for compat with FAC const { r, g, b, a } = w(DEFAULT_BACKGROUND_COLOR).toRgb(); try { const imgCrossOrigin = (0,external_wp_hooks_namespaceObject.applyFilters)('media.crossOrigin', undefined, url); const color = await retrieveFastAverageColor().getColorAsync(url, { // The default color is white, which is the color // that is returned if there's an error. // colord returns alpga 0-1, FAC needs 0-255 defaultColor: [r, g, b, a * 255], // Errors that come up don't reject the promise, // so error logging has to be silenced // with this option. silent: "production" === 'production', crossOrigin: imgCrossOrigin }); return color.hex; } catch (error) { // If there's an error return the fallback color. return DEFAULT_BACKGROUND_COLOR; } }); /** * Computes if the color combination of the overlay and background color is dark. * * @param {number} dimRatio Opacity of the overlay between 0 and 100. * @param {string} overlayColor CSS color string for the overlay. * @param {string} backgroundColor CSS color string for the background. * * @return {boolean} true if the color combination composite result is dark. */ function compositeIsDark(dimRatio, overlayColor, backgroundColor) { // Opacity doesn't matter if you're overlaying the same color on top of itself. // And background doesn't matter when overlay is fully opaque. if (overlayColor === backgroundColor || dimRatio === 100) { return w(overlayColor).isDark(); } const overlay = w(overlayColor).alpha(dimRatio / 100).toRgb(); const background = w(backgroundColor).toRgb(); const composite = compositeSourceOver(overlay, background); return w(composite).isDark(); } ;// ./node_modules/@wordpress/block-library/build-module/cover/edit/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function getInnerBlocksTemplate(attributes) { return [['core/paragraph', { align: 'center', placeholder: (0,external_wp_i18n_namespaceObject.__)('Write title…'), ...attributes }]]; } /** * Is the URL a temporary blob URL? A blob URL is one that is used temporarily while * the media (image or video) is being uploaded and will not have an id allocated yet. * * @param {number} id The id of the media. * @param {string} url The url of the media. * * @return {boolean} Is the URL a Blob URL. */ const isTemporaryMedia = (id, url) => !id && (0,external_wp_blob_namespaceObject.isBlobURL)(url); function CoverEdit({ attributes, clientId, isSelected, overlayColor, setAttributes, setOverlayColor, toggleSelection, context: { postId, postType } }) { var _media$media_details$; const { contentPosition, id, url: originalUrl, backgroundType: originalBackgroundType, useFeaturedImage, dimRatio, focalPoint, hasParallax, isDark, isRepeated, minHeight, minHeightUnit, alt, allowedBlocks, templateLock, tagName: TagName = 'div', isUserOverlayColor, sizeSlug } = attributes; const [featuredImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId); const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const { __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { media } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { media: featuredImage && useFeaturedImage ? select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, { context: 'view' }) : undefined }; }, [featuredImage, useFeaturedImage]); const mediaUrl = (_media$media_details$ = media?.media_details?.sizes?.[sizeSlug]?.source_url) !== null && _media$media_details$ !== void 0 ? _media$media_details$ : media?.source_url; // User can change the featured image outside of the block, but we still // need to update the block when that happens. This effect should only // run when the featured image changes in that case. All other cases are // handled in their respective callbacks. (0,external_wp_element_namespaceObject.useEffect)(() => { (async () => { if (!useFeaturedImage) { return; } const averageBackgroundColor = await getMediaColor(mediaUrl); let newOverlayColor = overlayColor.color; if (!isUserOverlayColor) { newOverlayColor = averageBackgroundColor; __unstableMarkNextChangeAsNotPersistent(); setOverlayColor(newOverlayColor); } const newIsDark = compositeIsDark(dimRatio, newOverlayColor, averageBackgroundColor); __unstableMarkNextChangeAsNotPersistent(); setAttributes({ isDark: newIsDark, isUserOverlayColor: isUserOverlayColor || false }); })(); // Update the block only when the featured image changes. }, [mediaUrl]); // instead of destructuring the attributes // we define the url and background type // depending on the value of the useFeaturedImage flag // to preview in edit the dynamic featured image const url = useFeaturedImage ? mediaUrl : // Ensure the url is not malformed due to sanitization through `wp_kses`. originalUrl?.replaceAll('&', '&'); const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : originalBackgroundType; const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { gradientClass, gradientValue } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); const onSelectMedia = async newMedia => { const mediaAttributes = attributesFromMedia(newMedia); const isImage = [newMedia?.type, newMedia?.media_type].includes(IMAGE_BACKGROUND_TYPE); const averageBackgroundColor = await getMediaColor(isImage ? newMedia?.url : undefined); let newOverlayColor = overlayColor.color; if (!isUserOverlayColor) { newOverlayColor = averageBackgroundColor; setOverlayColor(newOverlayColor); // Make undo revert the next setAttributes and the previous setOverlayColor. __unstableMarkNextChangeAsNotPersistent(); } // Only set a new dimRatio if there was no previous media selected // to avoid resetting to 50 if it has been explicitly set to 100. // See issue #52835 for context. const newDimRatio = originalUrl === undefined && dimRatio === 100 ? 50 : dimRatio; const newIsDark = compositeIsDark(newDimRatio, newOverlayColor, averageBackgroundColor); if (backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id) { const { imageDefaultSize } = getSettings(); // Try to use the previous selected image size if it's available // otherwise try the default image size or fallback to full size. if (sizeSlug && (newMedia?.sizes?.[sizeSlug] || newMedia?.media_details?.sizes?.[sizeSlug])) { mediaAttributes.sizeSlug = sizeSlug; mediaAttributes.url = newMedia?.sizes?.[sizeSlug]?.url || newMedia?.media_details?.sizes?.[sizeSlug]?.source_url; } else if (newMedia?.sizes?.[imageDefaultSize] || newMedia?.media_details?.sizes?.[imageDefaultSize]) { mediaAttributes.sizeSlug = imageDefaultSize; mediaAttributes.url = newMedia?.sizes?.[imageDefaultSize]?.url || newMedia?.media_details?.sizes?.[imageDefaultSize]?.source_url; } else { mediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG; } } setAttributes({ ...mediaAttributes, focalPoint: undefined, useFeaturedImage: undefined, dimRatio: newDimRatio, isDark: newIsDark, isUserOverlayColor: isUserOverlayColor || false }); }; const onClearMedia = () => { let newOverlayColor = overlayColor.color; if (!isUserOverlayColor) { newOverlayColor = DEFAULT_OVERLAY_COLOR; setOverlayColor(undefined); // Make undo revert the next setAttributes and the previous setOverlayColor. __unstableMarkNextChangeAsNotPersistent(); } const newIsDark = compositeIsDark(dimRatio, newOverlayColor, DEFAULT_BACKGROUND_COLOR); setAttributes({ url: undefined, id: undefined, backgroundType: undefined, focalPoint: undefined, hasParallax: undefined, isRepeated: undefined, useFeaturedImage: undefined, isDark: newIsDark }); }; const onSetOverlayColor = async newOverlayColor => { const averageBackgroundColor = await getMediaColor(url); const newIsDark = compositeIsDark(dimRatio, newOverlayColor, averageBackgroundColor); setOverlayColor(newOverlayColor); // Make undo revert the next setAttributes and the previous setOverlayColor. __unstableMarkNextChangeAsNotPersistent(); setAttributes({ isUserOverlayColor: true, isDark: newIsDark }); }; const onUpdateDimRatio = async newDimRatio => { const averageBackgroundColor = await getMediaColor(url); const newIsDark = compositeIsDark(newDimRatio, overlayColor.color, averageBackgroundColor); setAttributes({ dimRatio: newDimRatio, isDark: newIsDark }); }; const onUploadError = message => { createErrorNotice(message, { type: 'snackbar' }); }; const isUploadingMedia = isTemporaryMedia(id, url); const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); const hasNonContentControls = blockEditingMode === 'default'; const [resizeListener, { height, width }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const resizableBoxDimensions = (0,external_wp_element_namespaceObject.useMemo)(() => { return { height: minHeightUnit === 'px' ? minHeight : 'auto', width: 'auto' }; }, [minHeight, minHeightUnit]); const minHeightWithUnit = minHeight && minHeightUnit ? `${minHeight}${minHeightUnit}` : minHeight; const isImgElement = !(hasParallax || isRepeated); const style = { minHeight: minHeightWithUnit || undefined }; const backgroundImage = url ? `url(${url})` : undefined; const backgroundPosition = mediaPosition(focalPoint); const bgStyle = { backgroundColor: overlayColor.color }; const mediaStyle = { objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined }; const hasBackground = !!(url || overlayColor.color || gradientValue); const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getBlock(clientId).innerBlocks.length > 0, [clientId]); const ref = (0,external_wp_element_namespaceObject.useRef)(); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref }); // Check for fontSize support before we pass a fontSize attribute to the innerBlocks. const [fontSizes] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.fontSizes'); const hasFontSizes = fontSizes?.length > 0; const innerBlocksTemplate = getInnerBlocksTemplate({ fontSize: hasFontSizes ? 'large' : undefined }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ className: 'wp-block-cover__inner-container' }, { // Avoid template sync when the `templateLock` value is `all` or `contentOnly`. // See: https://github.com/WordPress/gutenberg/pull/45632 template: !hasInnerBlocks ? innerBlocksTemplate : undefined, templateInsertUpdatesSelection: true, allowedBlocks, templateLock, dropZoneElement: ref.current }); const mediaElement = (0,external_wp_element_namespaceObject.useRef)(); const currentSettings = { isVideoBackground, isImageBackground, mediaElement, hasInnerBlocks, url, isImgElement, overlayColor }; const toggleUseFeaturedImage = async () => { const newUseFeaturedImage = !useFeaturedImage; const averageBackgroundColor = newUseFeaturedImage ? await getMediaColor(mediaUrl) : DEFAULT_BACKGROUND_COLOR; const newOverlayColor = !isUserOverlayColor ? averageBackgroundColor : overlayColor.color; if (!isUserOverlayColor) { if (newUseFeaturedImage) { setOverlayColor(newOverlayColor); } else { setOverlayColor(undefined); } // Make undo revert the next setAttributes and the previous setOverlayColor. __unstableMarkNextChangeAsNotPersistent(); } const newDimRatio = dimRatio === 100 ? 50 : dimRatio; const newIsDark = compositeIsDark(newDimRatio, newOverlayColor, averageBackgroundColor); setAttributes({ id: undefined, url: undefined, useFeaturedImage: newUseFeaturedImage, dimRatio: newDimRatio, backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : undefined, isDark: newIsDark }); }; const blockControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverBlockControls, { attributes: attributes, setAttributes: setAttributes, onSelectMedia: onSelectMedia, currentSettings: currentSettings, toggleUseFeaturedImage: toggleUseFeaturedImage, onClearMedia: onClearMedia }); const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverInspectorControls, { attributes: attributes, setAttributes: setAttributes, clientId: clientId, setOverlayColor: onSetOverlayColor, coverRef: ref, currentSettings: currentSettings, toggleUseFeaturedImage: toggleUseFeaturedImage, updateDimRatio: onUpdateDimRatio, onClearMedia: onClearMedia, featuredImage: media }); const resizableCoverProps = { className: 'block-library-cover__resize-container', clientId, height, minHeight: minHeightWithUnit, onResizeStart: () => { setAttributes({ minHeightUnit: 'px' }); toggleSelection(false); }, onResize: value => { setAttributes({ minHeight: value }); }, onResizeStop: newMinHeight => { toggleSelection(true); setAttributes({ minHeight: newMinHeight }); }, // Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence. showHandle: !attributes.style?.dimensions?.aspectRatio, size: resizableBoxDimensions, width }; if (!useFeaturedImage && !hasInnerBlocks && !hasBackground) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, inspectorControls, hasNonContentControls && isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableCoverPopover, { ...resizableCoverProps }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { ...blockProps, className: dist_clsx('is-placeholder', blockProps.className), style: { ...blockProps.style, minHeight: minHeightWithUnit || undefined }, children: [resizeListener, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverPlaceholder, { onSelectMedia: onSelectMedia, onError: onUploadError, toggleUseFeaturedImage: toggleUseFeaturedImage, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-cover__placeholder-background-options", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ColorPalette, { disableCustomColors: true, value: overlayColor.color, onChange: onSetOverlayColor, clearable: false, asButtons: true, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Overlay color') }) }) })] })] }); } const classes = dist_clsx({ 'is-dark-theme': isDark, 'is-light': !isDark, 'is-transient': isUploadingMedia, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const showOverlay = url || !useFeaturedImage || useFeaturedImage && !url; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockControls, inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { ...blockProps, className: dist_clsx(classes, blockProps.className), style: { ...style, ...blockProps.style }, "data-url": url, children: [resizeListener, !url && useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className: "wp-block-cover__image--placeholder-image", withIllustration: true }), url && isImageBackground && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { ref: mediaElement, className: "wp-block-cover__image-background", alt: alt, src: url, style: mediaStyle }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ref: mediaElement, role: alt ? 'img' : undefined, "aria-label": alt ? alt : undefined, className: dist_clsx(classes, 'wp-block-cover__image-background'), style: { backgroundImage, backgroundPosition } })), url && isVideoBackground && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { ref: mediaElement, className: "wp-block-cover__video-background", autoPlay: true, muted: true, loop: true, src: url, style: mediaStyle }), showOverlay && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', dimRatioToClass(dimRatio), { [overlayColor.class]: overlayColor.class, 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: { backgroundImage: gradientValue, ...bgStyle } }), isUploadingMedia && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CoverPlaceholder, { disableMediaButtons: true, onSelectMedia: onSelectMedia, onError: onUploadError, toggleUseFeaturedImage: toggleUseFeaturedImage }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })] }), hasNonContentControls && isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableCoverPopover, { ...resizableCoverProps })] }); } /* harmony default export */ const cover_edit = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({ overlayColor: 'background-color' })])(CoverEdit)); ;// ./node_modules/@wordpress/block-library/build-module/cover/save.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function cover_save_save({ attributes }) { const { backgroundType, gradient, contentPosition, customGradient, customOverlayColor, dimRatio, focalPoint, useFeaturedImage, hasParallax, isDark, isRepeated, overlayColor, url, alt, id, minHeight: minHeightProp, minHeightUnit, tagName: Tag, sizeSlug } = attributes; const overlayColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayColor); const gradientClass = (0,external_wp_blockEditor_namespaceObject.__experimentalGetGradientClass)(gradient); const minHeight = minHeightProp && minHeightUnit ? `${minHeightProp}${minHeightUnit}` : minHeightProp; const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; const isImgElement = !(hasParallax || isRepeated); const style = { minHeight: minHeight || undefined }; const bgStyle = { backgroundColor: !overlayColorClass ? customOverlayColor : undefined, background: customGradient ? customGradient : undefined }; const objectPosition = // prettier-ignore focalPoint && isImgElement ? mediaPosition(focalPoint) : undefined; const backgroundImage = url ? `url(${url})` : undefined; const backgroundPosition = mediaPosition(focalPoint); const classes = dist_clsx({ 'is-light': !isDark, 'has-parallax': hasParallax, 'is-repeated': isRepeated, 'has-custom-content-position': !isContentPositionCenter(contentPosition) }, getPositionClassName(contentPosition)); const imgClasses = dist_clsx('wp-block-cover__image-background', id ? `wp-image-${id}` : null, { [`size-${sizeSlug}`]: sizeSlug, 'has-parallax': hasParallax, 'is-repeated': isRepeated }); const gradientValue = gradient || customGradient; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes, style }), children: [!useFeaturedImage && isImageBackground && url && (isImgElement ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: imgClasses, alt: alt, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { role: alt ? 'img' : undefined, "aria-label": alt ? alt : undefined, className: imgClasses, style: { backgroundPosition, backgroundImage } })), isVideoBackground && url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { className: dist_clsx('wp-block-cover__video-background', 'intrinsic-ignore'), autoPlay: true, muted: true, loop: true, playsInline: true, src: url, style: { objectPosition }, "data-object-fit": "cover", "data-object-position": objectPosition }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-cover__background', overlayColorClass, dimRatioToClass(dimRatio), { 'has-background-dim': dimRatio !== undefined, // For backwards compatibility. Former versions of the Cover Block applied // `.wp-block-cover__gradient-background` in the presence of // media, a gradient and a dim. 'wp-block-cover__gradient-background': url && gradientValue && dimRatio !== 0, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }), style: bgStyle }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-cover__inner-container' }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/cover/transforms.js /** * WordPress dependencies */ /** * Internal dependencies */ const { cleanEmptyObject: transforms_cleanEmptyObject } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const cover_transforms_transforms = { from: [{ type: 'block', blocks: ['core/image'], transform: ({ caption, url, alt, align, id, anchor, style }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', { dimRatio: 50, url, alt, align, id, anchor, style: { color: { duotone: style?.color?.duotone } } }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: caption, fontSize: 'large', align: 'center' })]) }, { type: 'block', blocks: ['core/video'], transform: ({ caption, src, align, id, anchor }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', { dimRatio: 50, url: src, align, id, backgroundType: VIDEO_BACKGROUND_TYPE, anchor }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: caption, fontSize: 'large', align: 'center' })]) }, { type: 'block', blocks: ['core/group'], transform: (attributes, innerBlocks) => { const { align, anchor, backgroundColor, gradient, style } = attributes; // If the Group block being transformed has a Cover block as its // only child return that Cover block. if (innerBlocks?.length === 1 && innerBlocks[0]?.name === 'core/cover') { return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', innerBlocks[0].attributes, innerBlocks[0].innerBlocks); } // If no background or gradient color is provided, default to 50% opacity. // This matches the styling of a Cover block with a background image, // in the state where a background image has been removed. const dimRatio = backgroundColor || gradient || style?.color?.background || style?.color?.gradient ? undefined : 50; // Move the background or gradient color to the parent Cover block. const parentAttributes = { align, anchor, dimRatio, overlayColor: backgroundColor, customOverlayColor: style?.color?.background, gradient, customGradient: style?.color?.gradient }; const attributesWithoutBackgroundColors = { ...attributes, backgroundColor: undefined, gradient: undefined, style: transforms_cleanEmptyObject({ ...attributes?.style, color: style?.color ? { ...style?.color, background: undefined, gradient: undefined } : undefined }) }; // Preserve the block by nesting it within the Cover block, // instead of converting the Group block directly to the Cover block. return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', parentAttributes, [(0,external_wp_blocks_namespaceObject.createBlock)('core/group', attributesWithoutBackgroundColors, innerBlocks)]); } }], to: [{ type: 'block', blocks: ['core/image'], isMatch: ({ backgroundType, url, overlayColor, customOverlayColor, gradient, customGradient }) => { if (url) { // If a url exists the transform could happen if that URL represents an image background. return backgroundType === IMAGE_BACKGROUND_TYPE; } // If a url is not set the transform could happen if the cover has no background color or gradient; return !overlayColor && !customOverlayColor && !gradient && !customGradient; }, transform: ({ title, url, alt, align, id, anchor, style }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { caption: title, url, alt, align, id, anchor, style: { color: { duotone: style?.color?.duotone } } }) }, { type: 'block', blocks: ['core/video'], isMatch: ({ backgroundType, url, overlayColor, customOverlayColor, gradient, customGradient }) => { if (url) { // If a url exists the transform could happen if that URL represents a video background. return backgroundType === VIDEO_BACKGROUND_TYPE; } // If a url is not set the transform could happen if the cover has no background color or gradient; return !overlayColor && !customOverlayColor && !gradient && !customGradient; }, transform: ({ title, url, align, id, anchor }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { caption: title, src: url, id, align, anchor }) }, { type: 'block', blocks: ['core/group'], isMatch: ({ url, useFeaturedImage }) => { // If the Cover block uses background media, skip this transform, // and instead use the Group block's default transform. if (url || useFeaturedImage) { return false; } return true; }, transform: (attributes, innerBlocks) => { // Convert Cover overlay colors to comparable Group background colors. const transformedColorAttributes = { backgroundColor: attributes?.overlayColor, gradient: attributes?.gradient, style: transforms_cleanEmptyObject({ ...attributes?.style, color: attributes?.customOverlayColor || attributes?.customGradient || attributes?.style?.color ? { background: attributes?.customOverlayColor, gradient: attributes?.customGradient, ...attributes?.style?.color } : undefined }) }; // If the Cover block contains only a single Group block as a direct child, // then attempt to merge the Cover's background colors with the child Group block, // and remove the Cover block as the wrapper. if (innerBlocks?.length === 1 && innerBlocks[0]?.name === 'core/group') { const groupAttributes = transforms_cleanEmptyObject(innerBlocks[0].attributes || {}); // If the Group block contains any kind of background color or gradient, // skip merging Cover background colors, and preserve the Group block's colors. if (groupAttributes?.backgroundColor || groupAttributes?.gradient || groupAttributes?.style?.color?.background || groupAttributes?.style?.color?.gradient) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', groupAttributes, innerBlocks[0]?.innerBlocks); } return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { ...transformedColorAttributes, ...groupAttributes, style: transforms_cleanEmptyObject({ ...groupAttributes?.style, color: transformedColorAttributes?.style?.color || groupAttributes?.style?.color ? { ...transformedColorAttributes?.style?.color, ...groupAttributes?.style?.color } : undefined }) }, innerBlocks[0]?.innerBlocks); } // In all other cases, transform the Cover block directly to a Group block. return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { ...attributes, ...transformedColorAttributes }, innerBlocks); } }] }; /* harmony default export */ const cover_transforms = (cover_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/cover/variations.js /** * WordPress dependencies */ const cover_variations_variations = [{ name: 'cover', title: (0,external_wp_i18n_namespaceObject.__)('Cover'), description: (0,external_wp_i18n_namespaceObject.__)('Add an image or video with a text overlay.'), attributes: { layout: { type: 'constrained' } }, isDefault: true, icon: library_cover }]; /* harmony default export */ const cover_variations = (cover_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/cover/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const cover_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/cover", title: "Cover", category: "media", description: "Add an image or video with a text overlay.", textdomain: "default", attributes: { url: { type: "string" }, useFeaturedImage: { type: "boolean", "default": false }, id: { type: "number" }, alt: { type: "string", "default": "" }, hasParallax: { type: "boolean", "default": false }, isRepeated: { type: "boolean", "default": false }, dimRatio: { type: "number", "default": 100 }, overlayColor: { type: "string" }, customOverlayColor: { type: "string" }, isUserOverlayColor: { type: "boolean" }, backgroundType: { type: "string", "default": "image" }, focalPoint: { type: "object" }, minHeight: { type: "number" }, minHeightUnit: { type: "string" }, gradient: { type: "string" }, customGradient: { type: "string" }, contentPosition: { type: "string" }, isDark: { type: "boolean", "default": true }, allowedBlocks: { type: "array" }, templateLock: { type: ["string", "boolean"], "enum": ["all", "insert", "contentOnly", false] }, tagName: { type: "string", "default": "div" }, sizeSlug: { type: "string" } }, usesContext: ["postId", "postType"], supports: { anchor: true, align: true, html: false, shadow: true, spacing: { padding: true, margin: ["top", "bottom"], blockGap: true, __experimentalDefaultControls: { padding: true, blockGap: true } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, color: { __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background", heading: true, text: true, background: false, __experimentalSkipSerialization: ["gradients"], enableContrastChecker: false }, dimensions: { aspectRatio: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, layout: { allowJustification: false }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-cover-editor", style: "wp-block-cover" }; const { name: cover_name } = cover_metadata; const cover_settings = { icon: library_cover, example: { attributes: { customOverlayColor: '#065174', dimRatio: 40, url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg', style: { typography: { fontSize: 48 }, color: { text: 'white' } } }, innerBlocks: [{ name: 'core/paragraph', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('<strong>Snow Patrol</strong>'), align: 'center' } }] }, transforms: cover_transforms, save: cover_save_save, edit: cover_edit, deprecated: cover_deprecated, variations: cover_variations }; const cover_init = () => initBlock({ name: cover_name, metadata: cover_metadata, settings: cover_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/details.js /** * WordPress dependencies */ const details = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 16h10v1.5H4V16Zm0-4.5h16V13H4v-1.5ZM10 7h10v1.5H10V7Z", fillRule: "evenodd", clipRule: "evenodd" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m4 5.25 4 2.5-4 2.5v-5Z" })] }); /* harmony default export */ const library_details = (details); ;// ./node_modules/@wordpress/block-library/build-module/details/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const details_edit_TEMPLATE = [['core/paragraph', { placeholder: (0,external_wp_i18n_namespaceObject.__)('Type / to add a hidden block') }]]; function DetailsEdit({ attributes, setAttributes }) { const { name, showContent, summary, allowedBlocks, placeholder } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: details_edit_TEMPLATE, __experimentalCaptureToolbars: true, allowedBlocks }); const [isOpen, setIsOpen] = (0,external_wp_element_namespaceObject.useState)(showContent); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ showContent: false }); }, dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { isShownByDefault: true, label: (0,external_wp_i18n_namespaceObject.__)('Open by default'), hasValue: () => showContent, onDeselect: () => { setAttributes({ showContent: false }); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open by default'), checked: showContent, onChange: () => setAttributes({ showContent: !showContent }) }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Name attribute'), value: name || '', onChange: newName => setAttributes({ name: newName }), help: (0,external_wp_i18n_namespaceObject.__)('Enables multiple Details blocks with the same name attribute to be connected, with only one open at a time.') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("details", { ...innerBlocksProps, open: isOpen, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("summary", { onClick: event => { event.preventDefault(); setIsOpen(!isOpen); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "summary", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Write summary'), placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Write summary…'), allowedFormats: [], withoutInteractiveFormatting: true, value: summary, onChange: newSummary => setAttributes({ summary: newSummary }) }) }), innerBlocksProps.children] })] }); } /* harmony default export */ const details_edit = (DetailsEdit); ;// ./node_modules/@wordpress/block-library/build-module/details/save.js /** * WordPress dependencies */ function details_save_save({ attributes }) { const { name, showContent } = attributes; const summary = attributes.summary ? attributes.summary : 'Details'; const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("details", { ...blockProps, name: name || undefined, open: showContent, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("summary", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: summary }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})] }); } ;// ./node_modules/@wordpress/block-library/build-module/details/transforms.js /** * WordPress dependencies */ /* harmony default export */ const details_transforms = ({ from: [{ type: 'block', isMultiBlock: true, blocks: ['*'], isMatch({}, blocks) { return !(blocks.length === 1 && blocks[0].name === 'core/details'); }, __experimentalConvert(blocks) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/details', {}, blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block))); } }] }); ;// ./node_modules/@wordpress/block-library/build-module/details/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const details_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/details", title: "Details", category: "text", description: "Hide and show additional content.", keywords: ["accordion", "summary", "toggle", "disclosure"], textdomain: "default", attributes: { showContent: { type: "boolean", "default": false }, summary: { type: "rich-text", source: "rich-text", selector: "summary" }, name: { type: "string", source: "attribute", attribute: "name", selector: ".wp-block-details" }, allowedBlocks: { type: "array" }, placeholder: { type: "string" } }, supports: { __experimentalOnEnter: true, align: ["wide", "full"], anchor: true, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, __experimentalBorder: { color: true, width: true, style: true }, html: false, spacing: { margin: true, padding: true, blockGap: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, layout: { allowEditing: false }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-details-editor", style: "wp-block-details" }; const { name: details_name } = details_metadata; const details_settings = { icon: library_details, example: { attributes: { summary: 'La Mancha', showContent: true }, innerBlocks: [{ name: 'core/paragraph', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.') } }] }, __experimentalLabel(attributes, { context }) { const { summary } = attributes; const customName = attributes?.metadata?.name; const hasSummary = summary?.trim().length > 0; // In the list view, use the block's summary as the label. // If the summary is empty, fall back to the default label. if (context === 'list-view' && (customName || hasSummary)) { return customName || summary; } if (context === 'accessibility') { return !hasSummary ? (0,external_wp_i18n_namespaceObject.__)('Details. Empty.') : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: accessibility text; summary title. */ (0,external_wp_i18n_namespaceObject.__)('Details. %s'), summary); } }, save: details_save_save, edit: details_edit, transforms: details_transforms }; const details_init = () => initBlock({ name: details_name, metadata: details_metadata, settings: details_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/pencil.js /** * WordPress dependencies */ const pencil = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) }); /* harmony default export */ const library_pencil = (pencil); ;// ./node_modules/@wordpress/icons/build-module/library/edit.js /** * Internal dependencies */ /* harmony default export */ const library_edit = (library_pencil); ;// ./node_modules/@wordpress/block-library/build-module/embed/embed-controls.js /** * WordPress dependencies */ function getResponsiveHelp(checked) { return checked ? (0,external_wp_i18n_namespaceObject.__)('This embed will preserve its aspect ratio when the browser is resized.') : (0,external_wp_i18n_namespaceObject.__)('This embed may not preserve its aspect ratio when the browser is resized.'); } const EmbedControls = ({ blockSupportsResponsive, showEditButton, themeSupportsResponsive, allowResponsive, toggleResponsive, switchBackToURLInput }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: showEditButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { className: "components-toolbar__control", label: (0,external_wp_i18n_namespaceObject.__)('Edit URL'), icon: library_edit, onClick: switchBackToURLInput }) }) }), themeSupportsResponsive && blockSupportsResponsive && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Media settings'), className: "blocks-responsive", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Resize for smaller devices'), checked: allowResponsive, help: getResponsiveHelp, onChange: toggleResponsive }) }) })] }); /* harmony default export */ const embed_controls = (EmbedControls); ;// ./node_modules/@wordpress/block-library/build-module/embed/icons.js /** * WordPress dependencies */ const embedContentIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z" }) }); const embedAudioIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z" }) }); const embedPhotoIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" }) }); const embedVideoIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z" }) }); const embedTwitterIcon = { foreground: '#1da1f2', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M22.23 5.924c-.736.326-1.527.547-2.357.646.847-.508 1.498-1.312 1.804-2.27-.793.47-1.67.812-2.606.996C18.325 4.498 17.258 4 16.078 4c-2.266 0-4.103 1.837-4.103 4.103 0 .322.036.635.106.935-3.41-.17-6.433-1.804-8.457-4.287-.353.607-.556 1.312-.556 2.064 0 1.424.724 2.68 1.825 3.415-.673-.022-1.305-.207-1.86-.514v.052c0 1.988 1.415 3.647 3.293 4.023-.344.095-.707.145-1.08.145-.265 0-.522-.026-.773-.074.522 1.63 2.038 2.817 3.833 2.85-1.404 1.1-3.174 1.757-5.096 1.757-.332 0-.66-.02-.98-.057 1.816 1.164 3.973 1.843 6.29 1.843 7.547 0 11.675-6.252 11.675-11.675 0-.178-.004-.355-.012-.53.802-.578 1.497-1.3 2.047-2.124z" }) }) }) }; const embedYouTubeIcon = { foreground: '#ff0000', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z" }) }) }; const embedFacebookIcon = { foreground: '#3b5998', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z" }) }) }; const embedInstagramIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z" }) }) }); const embedWordPressIcon = { foreground: '#0073AA', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z" }) }) }) }; const embedSpotifyIcon = { foreground: '#1db954', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325" }) }) }; const embedFlickrIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z" }) }); const embedVimeoIcon = { foreground: '#1ab7ea', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.G, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z" }) }) }) }; const embedRedditIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M22 12.068a2.184 2.184 0 0 0-2.186-2.186c-.592 0-1.13.233-1.524.609-1.505-1.075-3.566-1.774-5.86-1.864l1.004-4.695 3.261.699A1.56 1.56 0 1 0 18.255 3c-.61-.001-1.147.357-1.398.877l-3.638-.77a.382.382 0 0 0-.287.053.348.348 0 0 0-.161.251l-1.112 5.233c-2.33.072-4.426.77-5.95 1.864a2.201 2.201 0 0 0-1.523-.61 2.184 2.184 0 0 0-.896 4.176c-.036.215-.053.43-.053.663 0 3.37 3.924 6.111 8.763 6.111s8.763-2.724 8.763-6.11c0-.216-.017-.449-.053-.664A2.207 2.207 0 0 0 22 12.068Zm-15.018 1.56a1.56 1.56 0 0 1 3.118 0c0 .86-.699 1.558-1.559 1.558-.86.018-1.559-.699-1.559-1.559Zm8.728 4.139c-1.076 1.075-3.119 1.147-3.71 1.147-.61 0-2.652-.09-3.71-1.147a.4.4 0 0 1 0-.573.4.4 0 0 1 .574 0c.68.68 2.114.914 3.136.914 1.022 0 2.473-.233 3.136-.914a.4.4 0 0 1 .574 0 .436.436 0 0 1 0 .573Zm-.287-2.563a1.56 1.56 0 0 1 0-3.118c.86 0 1.56.699 1.56 1.56 0 .841-.7 1.558-1.56 1.558Z" }) }); const embedTumblrIcon = { foreground: '#35465c', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z" }) }) }; const embedAmazonIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z" })] }); const embedAnimotoIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z", fill: "#4bc7ee" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z", fill: "#d4cdcb" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z", fill: "#c3d82e" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z", fill: "#e4ecb0" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z", fill: "#209dbd" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z", fill: "#7cb3c9" })] }); const embedDailymotionIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M11.903 16.568c-1.82 0-3.124-1.281-3.124-2.967a2.987 2.987 0 0 1 2.989-2.989c1.663 0 2.944 1.304 2.944 3.034 0 1.663-1.281 2.922-2.81 2.922ZM17.997 3l-3.308.73v5.107c-.809-1.034-2.045-1.37-3.505-1.37-1.529 0-2.9.561-4.023 1.662-1.259 1.214-1.933 2.764-1.933 4.495 0 1.888.72 3.506 2.113 4.742 1.056.944 2.314 1.415 3.775 1.415 1.438 0 2.517-.382 3.573-1.415v1.415h3.308V3Z", fill: "#333436" }) }); const embedPinterestIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2" }) }); const embedWolframIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 44 44", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z" }) }); const embedPocketCastsIcon = { foreground: '#f43e37', src: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M24,12A12,12,0,1,1,12,0,12,12,0,0,1,24,12Z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M2.67,12a9.33,9.33,0,0,1,18.66,0H19a7,7,0,1,0-7,7v2.33A9.33,9.33,0,0,1,2.67,12ZM12,17.6A5.6,5.6,0,1,1,17.6,12h-2A3.56,3.56,0,1,0,12,15.56Z", fill: "#fff" })] }) }; const embedBlueskyIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { fill: "#0a7aff", d: "M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/embed/embed-loading.js /** * WordPress dependencies */ const EmbedLoading = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-embed is-loading", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }); /* harmony default export */ const embed_loading = (EmbedLoading); ;// ./node_modules/@wordpress/block-library/build-module/embed/embed-placeholder.js /** * WordPress dependencies */ const EmbedPlaceholder = ({ icon, label, value, onSubmit, onChange, cannotEmbed, fallback, tryAgain }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: icon, showColors: true }), label: label, className: "wp-block-embed", instructions: (0,external_wp_i18n_namespaceObject.__)('Paste a link to the content you want to display on your site.'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { onSubmit: onSubmit, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { __next40pxDefaultSize: true, type: "url", value: value || '', className: "wp-block-embed__placeholder-input", label: label, hideLabelFromVision: true, placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL to embed here…'), onChange: onChange }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", children: (0,external_wp_i18n_namespaceObject._x)('Embed', 'button label') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-embed__learn-more", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/embeds/'), children: (0,external_wp_i18n_namespaceObject.__)('Learn more about embeds') }) }), cannotEmbed && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 3, className: "components-placeholder__error", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "components-placeholder__instructions", children: (0,external_wp_i18n_namespaceObject.__)('Sorry, this content could not be embedded.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { expanded: false, spacing: 3, justify: "flex-start", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: tryAgain, children: (0,external_wp_i18n_namespaceObject._x)('Try again', 'button label') }), ' ', /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: fallback, children: (0,external_wp_i18n_namespaceObject._x)('Convert to link', 'button label') })] })] })] }); }; /* harmony default export */ const embed_placeholder = (EmbedPlaceholder); ;// ./node_modules/@wordpress/block-library/build-module/embed/wp-embed-preview.js /** * WordPress dependencies */ /** @typedef {import('react').SyntheticEvent} SyntheticEvent */ const attributeMap = { class: 'className', frameborder: 'frameBorder', marginheight: 'marginHeight', marginwidth: 'marginWidth' }; function WpEmbedPreview({ html }) { const ref = (0,external_wp_element_namespaceObject.useRef)(); const props = (0,external_wp_element_namespaceObject.useMemo)(() => { const doc = new window.DOMParser().parseFromString(html, 'text/html'); const iframe = doc.querySelector('iframe'); const iframeProps = {}; if (!iframe) { return iframeProps; } Array.from(iframe.attributes).forEach(({ name, value }) => { if (name === 'style') { return; } iframeProps[attributeMap[name] || name] = value; }); return iframeProps; }, [html]); (0,external_wp_element_namespaceObject.useEffect)(() => { const { ownerDocument } = ref.current; const { defaultView } = ownerDocument; /** * Checks for WordPress embed events signaling the height change when * iframe content loads or iframe's window is resized. The event is * sent from WordPress core via the window.postMessage API. * * References: * window.postMessage: * https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage * WordPress core embed-template on load: * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L143 * WordPress core embed-template on resize: * https://github.com/WordPress/WordPress/blob/HEAD/wp-includes/js/wp-embed-template.js#L187 * * @param {MessageEvent} event Message event. */ function resizeWPembeds({ data: { secret, message, value } = {} }) { if (message !== 'height' || secret !== props['data-secret']) { return; } ref.current.height = value; } defaultView.addEventListener('message', resizeWPembeds); return () => { defaultView.removeEventListener('message', resizeWPembeds); }; }, []); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-embed__wrapper", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("iframe", { ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, (0,external_wp_compose_namespaceObject.useFocusableIframe)()]), title: props.title, ...props }) }); } ;// ./node_modules/@wordpress/block-library/build-module/embed/embed-preview.js /** * Internal dependencies */ /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function EmbedPreview({ preview, previewable, url, type, isSelected, className, icon, label }) { const [interactive, setInteractive] = (0,external_wp_element_namespaceObject.useState)(false); if (!isSelected && interactive) { // We only want to change this when the block is not selected, because changing it when // the block becomes selected makes the overlap disappear too early. Hiding the overlay // happens on mouseup when the overlay is clicked. setInteractive(false); } const hideOverlay = () => { // This is called onMouseUp on the overlay. We can't respond to the `isSelected` prop // changing, because that happens on mouse down, and the overlay immediately disappears, // and the mouse event can end up in the preview content. We can't use onClick on // the overlay to hide it either, because then the editor misses the mouseup event, and // thinks we're multi-selecting blocks. setInteractive(true); }; const { scripts } = preview; const html = 'photo' === type ? getPhotoHtml(preview) : preview.html; const embedSourceUrl = (0,external_wp_url_namespaceObject.getAuthority)(url); const iframeTitle = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: host providing embed content e.g: www.youtube.com (0,external_wp_i18n_namespaceObject.__)('Embedded content from %s'), embedSourceUrl); const sandboxClassnames = dist_clsx(type, className, 'wp-block-embed__wrapper'); // Disabled because the overlay div doesn't actually have a role or functionality // as far as the user is concerned. We're just catching the first click so that // the block can be selected without interacting with the embed preview that the overlay covers. /* eslint-disable jsx-a11y/no-static-element-interactions */ const embedWrapper = 'wp-embed' === type ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(WpEmbedPreview, { html: html }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-embed__wrapper", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SandBox, { html: html, scripts: scripts, title: iframeTitle, type: sandboxClassnames, onFocus: hideOverlay }), !interactive && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-library-embed__interactive-overlay", onMouseUp: hideOverlay })] }); /* eslint-enable jsx-a11y/no-static-element-interactions */ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: previewable ? embedWrapper : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: icon, showColors: true }), label: label, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "components-placeholder__error", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: url, children: url }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "components-placeholder__error", children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: host providing embed content e.g: www.youtube.com */ (0,external_wp_i18n_namespaceObject.__)("Embedded content from %s can't be previewed in the editor."), embedSourceUrl) })] }) }); } ;// ./node_modules/@wordpress/block-library/build-module/embed/edit.js /* wp:polyfill */ /** * Internal dependencies */ /** * External dependencies */ /** * WordPress dependencies */ const EmbedEdit = props => { const { attributes: { providerNameSlug, previewable, responsive, url: attributesUrl }, attributes, isSelected, onReplace, setAttributes, insertBlocksAfter, onFocus } = props; const defaultEmbedInfo = { title: (0,external_wp_i18n_namespaceObject._x)('Embed', 'block title'), icon: embedContentIcon }; const { icon, title } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo; const [url, setURL] = (0,external_wp_element_namespaceObject.useState)(attributesUrl); const [isEditingURL, setIsEditingURL] = (0,external_wp_element_namespaceObject.useState)(false); const { invalidateResolution } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { preview, fetching, themeSupportsResponsive, cannotEmbed, hasResolved } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEmbedPreview, isPreviewEmbedFallback, isRequestingEmbedPreview, getThemeSupports, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); if (!attributesUrl) { return { fetching: false, cannotEmbed: false }; } const embedPreview = getEmbedPreview(attributesUrl); const previewIsFallback = isPreviewEmbedFallback(attributesUrl); // The external oEmbed provider does not exist. We got no type info and no html. const badEmbedProvider = embedPreview?.html === false && embedPreview?.type === undefined; // Some WordPress URLs that can't be embedded will cause the API to return // a valid JSON response with no HTML and `data.status` set to 404, rather // than generating a fallback response as other embeds do. const wordpressCantEmbed = embedPreview?.data?.status === 404; const validPreview = !!embedPreview && !badEmbedProvider && !wordpressCantEmbed; return { preview: validPreview ? embedPreview : undefined, fetching: isRequestingEmbedPreview(attributesUrl), themeSupportsResponsive: getThemeSupports()['responsive-embeds'], cannotEmbed: !validPreview || previewIsFallback, hasResolved: hasFinishedResolution('getEmbedPreview', [attributesUrl]) }; }, [attributesUrl]); /** * Returns the attributes derived from the preview, merged with the current attributes. * * @return {Object} Merged attributes. */ const getMergedAttributes = () => getMergedAttributesWithPreview(attributes, preview, title, responsive); const toggleResponsive = () => { const { allowResponsive, className } = attributes; const { html } = preview; const newAllowResponsive = !allowResponsive; setAttributes({ allowResponsive: newAllowResponsive, className: getClassNames(html, className, responsive && newAllowResponsive) }); }; (0,external_wp_element_namespaceObject.useEffect)(() => { if (preview?.html || !cannotEmbed || !hasResolved) { return; } // At this stage, we're not fetching the preview and know it can't be embedded, // so try removing any trailing slash, and resubmit. const newURL = attributesUrl.replace(/\/$/, ''); setURL(newURL); setIsEditingURL(false); setAttributes({ url: newURL }); }, [preview?.html, attributesUrl, cannotEmbed, hasResolved, setAttributes]); // Try a different provider in case the embed url is not supported. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!cannotEmbed || fetching || !url) { return; } // Until X provider is supported in WordPress, as a workaround we use Twitter provider. if ((0,external_wp_url_namespaceObject.getAuthority)(url) === 'x.com') { const newURL = new URL(url); newURL.host = 'twitter.com'; setAttributes({ url: newURL.toString() }); } }, [url, cannotEmbed, fetching, setAttributes]); // Handle incoming preview. (0,external_wp_element_namespaceObject.useEffect)(() => { if (preview && !isEditingURL) { // When obtaining an incoming preview, // we set the attributes derived from the preview data. const mergedAttributes = getMergedAttributes(); setAttributes(mergedAttributes); if (onReplace) { const upgradedBlock = createUpgradedEmbedBlock(props, mergedAttributes); if (upgradedBlock) { onReplace(upgradedBlock); } } } }, [preview, isEditingURL]); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); if (fetching) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(embed_loading, {}) }); } // translators: %s: type of embed e.g: "YouTube", "Twitter", etc. "Embed" is used when no specific type exists const label = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('%s URL'), title); // No preview, or we can't embed the current URL, or we've clicked the edit button. const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL; if (showEmbedPlaceholder) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(embed_placeholder, { icon: icon, label: label, onFocus: onFocus, onSubmit: event => { if (event) { event.preventDefault(); } // If the embed URL was changed, we need to reset the aspect ratio class. // To do this we have to remove the existing ratio class so it can be recalculated. const blockClass = removeAspectRatioClasses(attributes.className); setIsEditingURL(false); setAttributes({ url, className: blockClass }); }, value: url, cannotEmbed: cannotEmbed, onChange: value => setURL(value), fallback: () => fallback(url, onReplace), tryAgain: () => { invalidateResolution('getEmbedPreview', [url]); } }) }); } // Even though we set attributes that get derived from the preview, // we don't access them directly because for the initial render, // the `setAttributes` call will not have taken effect. If we're // rendering responsive content, setting the responsive classes // after the preview has been rendered can result in unwanted // clipping or scrollbars. The `getAttributesFromPreview` function // that `getMergedAttributes` uses is memoized so that we're not // calculating them on every render. const { caption, type, allowResponsive, className: classFromPreview } = getMergedAttributes(); const className = dist_clsx(classFromPreview, props.className); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(embed_controls, { showEditButton: preview && !cannotEmbed, themeSupportsResponsive: themeSupportsResponsive, blockSupportsResponsive: responsive, allowResponsive: allowResponsive, toggleResponsive: toggleResponsive, switchBackToURLInput: () => setIsEditingURL(true) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...blockProps, className: dist_clsx(blockProps.className, className, { [`is-type-${type}`]: type, [`is-provider-${providerNameSlug}`]: providerNameSlug, [`wp-block-embed-${providerNameSlug}`]: providerNameSlug }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EmbedPreview, { preview: preview, previewable: previewable, className: className, url: url, type: type, caption: caption, onCaptionChange: value => setAttributes({ caption: value }), isSelected: isSelected, icon: icon, label: label, insertBlocksAfter: insertBlocksAfter, attributes: attributes, setAttributes: setAttributes }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { attributes: attributes, setAttributes: setAttributes, isSelected: isSelected, insertBlocksAfter: insertBlocksAfter, label: (0,external_wp_i18n_namespaceObject.__)('Embed caption text'), showToolbarButton: isSelected })] })] }); }; /* harmony default export */ const embed_edit = (EmbedEdit); ;// ./node_modules/@wordpress/block-library/build-module/embed/save.js /** * External dependencies */ /** * WordPress dependencies */ function embed_save_save({ attributes }) { const { url, caption, type, providerNameSlug } = attributes; if (!url) { return null; } const className = dist_clsx('wp-block-embed', { [`is-type-${type}`]: type, [`is-provider-${providerNameSlug}`]: providerNameSlug, [`wp-block-embed-${providerNameSlug}`]: providerNameSlug }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-embed__wrapper", children: `\n${url}\n` /* URL needs to be on its own line. */ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), tagName: "figcaption", value: caption })] }); } ;// ./node_modules/@wordpress/block-library/build-module/embed/transforms.js /** * WordPress dependencies */ /** * Internal dependencies */ const transforms_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/embed", title: "Embed", category: "embed", description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", textdomain: "default", attributes: { url: { type: "string", role: "content" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", role: "content" }, type: { type: "string", role: "content" }, providerNameSlug: { type: "string", role: "content" }, allowResponsive: { type: "boolean", "default": true }, responsive: { type: "boolean", "default": false, role: "content" }, previewable: { type: "boolean", "default": true, role: "content" } }, supports: { align: true, spacing: { margin: true }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-embed-editor", style: "wp-block-embed" }; const { name: EMBED_BLOCK } = transforms_metadata; /** * Default transforms for generic embeds. */ const embed_transforms_transforms = { from: [{ type: 'raw', isMatch: node => node.nodeName === 'P' && /^\s*(https?:\/\/\S+)\s*$/i.test(node.textContent) && node.textContent?.match(/https/gi)?.length === 1, transform: node => { return (0,external_wp_blocks_namespaceObject.createBlock)(EMBED_BLOCK, { url: node.textContent.trim() }); } }], to: [{ type: 'block', blocks: ['core/paragraph'], isMatch: ({ url }) => !!url, transform: ({ url, caption, className }) => { let value = `<a href="${url}">${url}</a>`; if (caption?.trim()) { value += `<br />${caption}`; } return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: value, className: removeAspectRatioClasses(className) }); } }] }; /* harmony default export */ const embed_transforms = (embed_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/embed/variations.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ function getTitle(providerName) { return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: provider name */ (0,external_wp_i18n_namespaceObject.__)('%s Embed'), providerName); } /** * The embed provider services. * * @type {WPBlockVariation[]} */ const embed_variations_variations = [{ name: 'twitter', title: getTitle('Twitter'), icon: embedTwitterIcon, keywords: ['tweet', (0,external_wp_i18n_namespaceObject.__)('social')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a tweet.'), patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i], attributes: { providerNameSlug: 'twitter', responsive: true } }, { name: 'youtube', title: getTitle('YouTube'), icon: embedYouTubeIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('video')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a YouTube video.'), patterns: [/^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, /^https?:\/\/youtu\.be\/.+/i], attributes: { providerNameSlug: 'youtube', responsive: true } }, { // Deprecate Facebook Embed per FB policy // See: https://developers.facebook.com/docs/plugins/oembed-legacy name: 'facebook', title: getTitle('Facebook'), icon: embedFacebookIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('social')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a Facebook post.'), scope: ['block'], patterns: [], attributes: { providerNameSlug: 'facebook', previewable: false, responsive: true } }, { // Deprecate Instagram per FB policy // See: https://developers.facebook.com/docs/instagram/oembed-legacy name: 'instagram', title: getTitle('Instagram'), icon: embedInstagramIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('image'), (0,external_wp_i18n_namespaceObject.__)('social')], description: (0,external_wp_i18n_namespaceObject.__)('Embed an Instagram post.'), scope: ['block'], patterns: [], attributes: { providerNameSlug: 'instagram', responsive: true } }, { name: 'wordpress', title: getTitle('WordPress'), icon: embedWordPressIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('post'), (0,external_wp_i18n_namespaceObject.__)('blog')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress post.'), attributes: { providerNameSlug: 'wordpress' } }, { name: 'soundcloud', title: getTitle('SoundCloud'), icon: embedAudioIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], description: (0,external_wp_i18n_namespaceObject.__)('Embed SoundCloud content.'), patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i], attributes: { providerNameSlug: 'soundcloud', responsive: true } }, { name: 'spotify', title: getTitle('Spotify'), icon: embedSpotifyIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Spotify content.'), patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i], attributes: { providerNameSlug: 'spotify', responsive: true } }, { name: 'flickr', title: getTitle('Flickr'), icon: embedFlickrIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('image')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Flickr content.'), patterns: [/^https?:\/\/(www\.)?flickr\.com\/.+/i, /^https?:\/\/flic\.kr\/.+/i], attributes: { providerNameSlug: 'flickr', responsive: true } }, { name: 'vimeo', title: getTitle('Vimeo'), icon: embedVimeoIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a Vimeo video.'), patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i], attributes: { providerNameSlug: 'vimeo', responsive: true } }, { name: 'animoto', title: getTitle('Animoto'), icon: embedAnimotoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed an Animoto video.'), patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i], attributes: { providerNameSlug: 'animoto', responsive: true } }, { name: 'cloudup', title: getTitle('Cloudup'), icon: embedContentIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Cloudup content.'), patterns: [/^https?:\/\/cloudup\.com\/.+/i], attributes: { providerNameSlug: 'cloudup', responsive: true } }, { // Deprecated since CollegeHumor content is now powered by YouTube. name: 'collegehumor', title: getTitle('CollegeHumor'), icon: embedVideoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed CollegeHumor content.'), scope: ['block'], patterns: [], attributes: { providerNameSlug: 'collegehumor', responsive: true } }, { name: 'crowdsignal', title: getTitle('Crowdsignal'), icon: embedContentIcon, keywords: ['polldaddy', (0,external_wp_i18n_namespaceObject.__)('survey')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Crowdsignal (formerly Polldaddy) content.'), patterns: [/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.crowdsignal\.net|.+\.survey\.fm)\/.+/i], attributes: { providerNameSlug: 'crowdsignal', responsive: true } }, { name: 'dailymotion', title: getTitle('Dailymotion'), icon: embedDailymotionIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a Dailymotion video.'), patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i], attributes: { providerNameSlug: 'dailymotion', responsive: true } }, { name: 'imgur', title: getTitle('Imgur'), icon: embedPhotoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Imgur content.'), patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i], attributes: { providerNameSlug: 'imgur', responsive: true } }, { name: 'issuu', title: getTitle('Issuu'), icon: embedContentIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Issuu content.'), patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i], attributes: { providerNameSlug: 'issuu', responsive: true } }, { name: 'kickstarter', title: getTitle('Kickstarter'), icon: embedContentIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Kickstarter content.'), patterns: [/^https?:\/\/(www\.)?kickstarter\.com\/.+/i, /^https?:\/\/kck\.st\/.+/i], attributes: { providerNameSlug: 'kickstarter', responsive: true } }, { name: 'mixcloud', title: getTitle('Mixcloud'), icon: embedAudioIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('music'), (0,external_wp_i18n_namespaceObject.__)('audio')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Mixcloud content.'), patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i], attributes: { providerNameSlug: 'mixcloud', responsive: true } }, { name: 'pocket-casts', title: getTitle('Pocket Casts'), icon: embedPocketCastsIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('podcast'), (0,external_wp_i18n_namespaceObject.__)('audio')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a podcast player from Pocket Casts.'), patterns: [/^https:\/\/pca.st\/\w+/i], attributes: { providerNameSlug: 'pocket-casts', responsive: true } }, { name: 'reddit', title: getTitle('Reddit'), icon: embedRedditIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed a Reddit thread.'), patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i], attributes: { providerNameSlug: 'reddit', responsive: true } }, { name: 'reverbnation', title: getTitle('ReverbNation'), icon: embedAudioIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed ReverbNation content.'), patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i], attributes: { providerNameSlug: 'reverbnation', responsive: true } }, { name: 'screencast', title: getTitle('Screencast'), icon: embedVideoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Screencast content.'), patterns: [/^https?:\/\/(www\.)?screencast\.com\/.+/i], attributes: { providerNameSlug: 'screencast', responsive: true } }, { name: 'scribd', title: getTitle('Scribd'), icon: embedContentIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Scribd content.'), patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i], attributes: { providerNameSlug: 'scribd', responsive: true } }, { name: 'smugmug', title: getTitle('SmugMug'), icon: embedPhotoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed SmugMug content.'), patterns: [/^https?:\/\/(.+\.)?smugmug\.com\/.*/i], attributes: { providerNameSlug: 'smugmug', previewable: false, responsive: true } }, { name: 'speaker-deck', title: getTitle('Speaker Deck'), icon: embedContentIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Speaker Deck content.'), patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i], attributes: { providerNameSlug: 'speaker-deck', responsive: true } }, { name: 'tiktok', title: getTitle('TikTok'), icon: embedVideoIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a TikTok video.'), patterns: [/^https?:\/\/(www\.)?tiktok\.com\/.+/i], attributes: { providerNameSlug: 'tiktok', responsive: true } }, { name: 'ted', title: getTitle('TED'), icon: embedVideoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed a TED video.'), patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i], attributes: { providerNameSlug: 'ted', responsive: true } }, { name: 'tumblr', title: getTitle('Tumblr'), icon: embedTumblrIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('social')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a Tumblr post.'), patterns: [/^https?:\/\/(.+)\.tumblr\.com\/.+/i], attributes: { providerNameSlug: 'tumblr', responsive: true } }, { name: 'videopress', title: getTitle('VideoPress'), icon: embedVideoIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('video')], description: (0,external_wp_i18n_namespaceObject.__)('Embed a VideoPress video.'), patterns: [/^https?:\/\/videopress\.com\/.+/i], attributes: { providerNameSlug: 'videopress', responsive: true } }, { name: 'wordpress-tv', title: getTitle('WordPress.tv'), icon: embedVideoIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed a WordPress.tv video.'), patterns: [/^https?:\/\/wordpress\.tv\/.+/i], attributes: { providerNameSlug: 'wordpress-tv', responsive: true } }, { name: 'amazon-kindle', title: getTitle('Amazon Kindle'), icon: embedAmazonIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('ebook')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Amazon Kindle content.'), patterns: [/^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i], attributes: { providerNameSlug: 'amazon-kindle' } }, { name: 'pinterest', title: getTitle('Pinterest'), icon: embedPinterestIcon, keywords: [(0,external_wp_i18n_namespaceObject.__)('social'), (0,external_wp_i18n_namespaceObject.__)('bookmark')], description: (0,external_wp_i18n_namespaceObject.__)('Embed Pinterest pins, boards, and profiles.'), patterns: [/^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i], attributes: { providerNameSlug: 'pinterest' } }, { name: 'wolfram-cloud', title: getTitle('Wolfram'), icon: embedWolframIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed Wolfram notebook content.'), patterns: [/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i], attributes: { providerNameSlug: 'wolfram-cloud', responsive: true } }, { name: 'bluesky', title: getTitle('Bluesky'), icon: embedBlueskyIcon, description: (0,external_wp_i18n_namespaceObject.__)('Embed a Bluesky post.'), patterns: [/^https?:\/\/bsky\.app\/profile\/.+\/post\/.+/i], attributes: { providerNameSlug: 'bluesky' } }]; /** * Add `isActive` function to all `embed` variations, if not defined. * `isActive` function is used to find a variation match from a created * Block by providing its attributes. */ embed_variations_variations.forEach(variation => { if (variation.isActive) { return; } variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.providerNameSlug === variationAttributes.providerNameSlug; }); /* harmony default export */ const embed_variations = (embed_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/embed/deprecated.js /** * External dependencies */ /** * Internal dependencies */ const embed_deprecated_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/embed", title: "Embed", category: "embed", description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", textdomain: "default", attributes: { url: { type: "string", role: "content" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", role: "content" }, type: { type: "string", role: "content" }, providerNameSlug: { type: "string", role: "content" }, allowResponsive: { type: "boolean", "default": true }, responsive: { type: "boolean", "default": false, role: "content" }, previewable: { type: "boolean", "default": true, role: "content" } }, supports: { align: true, spacing: { margin: true }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-embed-editor", style: "wp-block-embed" }; /** * WordPress dependencies */ const { attributes: embed_deprecated_blockAttributes } = embed_deprecated_metadata; // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname // to the embed figcaption element. const deprecated_v2 = { attributes: embed_deprecated_blockAttributes, save({ attributes }) { const { url, caption, type, providerNameSlug } = attributes; if (!url) { return null; } const className = dist_clsx('wp-block-embed', { [`is-type-${type}`]: type, [`is-provider-${providerNameSlug}`]: providerNameSlug, [`wp-block-embed-${providerNameSlug}`]: providerNameSlug }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-embed__wrapper", children: `\n${url}\n` /* URL needs to be on its own line. */ }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); } }; const embed_deprecated_v1 = { attributes: embed_deprecated_blockAttributes, save({ attributes: { url, caption, type, providerNameSlug } }) { if (!url) { return null; } const embedClassName = dist_clsx('wp-block-embed', { [`is-type-${type}`]: type, [`is-provider-${providerNameSlug}`]: providerNameSlug }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { className: embedClassName, children: [`\n${url}\n` /* URL needs to be on its own line. */, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); } }; const embed_deprecated_deprecated = [deprecated_v2, embed_deprecated_v1]; /* harmony default export */ const embed_deprecated = (embed_deprecated_deprecated); ;// ./node_modules/@wordpress/block-library/build-module/embed/index.js /** * Internal dependencies */ const embed_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/embed", title: "Embed", category: "embed", description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", textdomain: "default", attributes: { url: { type: "string", role: "content" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", role: "content" }, type: { type: "string", role: "content" }, providerNameSlug: { type: "string", role: "content" }, allowResponsive: { type: "boolean", "default": true }, responsive: { type: "boolean", "default": false, role: "content" }, previewable: { type: "boolean", "default": true, role: "content" } }, supports: { align: true, spacing: { margin: true }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-embed-editor", style: "wp-block-embed" }; const { name: embed_name } = embed_metadata; const embed_settings = { icon: embedContentIcon, edit: embed_edit, save: embed_save_save, transforms: embed_transforms, variations: embed_variations, deprecated: embed_deprecated }; const embed_init = () => initBlock({ name: embed_name, metadata: embed_metadata, settings: embed_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/file.js /** * WordPress dependencies */ const file = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" }) }); /* harmony default export */ const library_file = (file); ;// ./node_modules/@wordpress/block-library/build-module/file/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ // Version of the file block without PR#43050 removing the translated aria-label. const deprecated_v3 = { attributes: { id: { type: 'number' }, href: { type: 'string' }, fileId: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'id' }, fileName: { type: 'string', source: 'html', selector: 'a:not([download])' }, textLinkHref: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'href' }, textLinkTarget: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'target' }, showDownloadButton: { type: 'boolean', default: true }, downloadButtonText: { type: 'string', source: 'html', selector: 'a[download]' }, displayPreview: { type: 'boolean' }, previewHeight: { type: 'number', default: 600 } }, supports: { anchor: true, align: true }, save({ attributes }) { const { href, fileId, fileName, textLinkHref, textLinkTarget, showDownloadButton, downloadButtonText, displayPreview, previewHeight } = attributes; const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: filename. */ (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is // actually rendered. const describedById = hasFilename ? fileId : undefined; return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { className: "wp-block-file__embed", data: href, type: "application/pdf", style: { width: '100%', height: `${previewHeight}px` }, "aria-label": pdfEmbedLabel }) }), hasFilename && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { id: describedById, href: textLinkHref, target: textLinkTarget, rel: textLinkTarget ? 'noreferrer noopener' : undefined, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: fileName }) }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, className: dist_clsx('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), download: true, "aria-describedby": describedById, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: downloadButtonText }) })] }); } }; // In #41239 the button was made an element button which added a `wp-element-button` classname // to the download link element. const file_deprecated_v2 = { attributes: { id: { type: 'number' }, href: { type: 'string' }, fileId: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'id' }, fileName: { type: 'string', source: 'html', selector: 'a:not([download])' }, textLinkHref: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'href' }, textLinkTarget: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'target' }, showDownloadButton: { type: 'boolean', default: true }, downloadButtonText: { type: 'string', source: 'html', selector: 'a[download]' }, displayPreview: { type: 'boolean' }, previewHeight: { type: 'number', default: 600 } }, supports: { anchor: true, align: true }, save({ attributes }) { const { href, fileId, fileName, textLinkHref, textLinkTarget, showDownloadButton, downloadButtonText, displayPreview, previewHeight } = attributes; const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: filename. */ (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is // actually rendered. const describedById = hasFilename ? fileId : undefined; return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { className: "wp-block-file__embed", data: href, type: "application/pdf", style: { width: '100%', height: `${previewHeight}px` }, "aria-label": pdfEmbedLabel }) }), hasFilename && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { id: describedById, href: textLinkHref, target: textLinkTarget, rel: textLinkTarget ? 'noreferrer noopener' : undefined, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: fileName }) }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, className: "wp-block-file__button", download: true, "aria-describedby": describedById, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: downloadButtonText }) })] }); } }; // Version of the file block without PR#28062 accessibility fix. const file_deprecated_v1 = { attributes: { id: { type: 'number' }, href: { type: 'string' }, fileName: { type: 'string', source: 'html', selector: 'a:not([download])' }, textLinkHref: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'href' }, textLinkTarget: { type: 'string', source: 'attribute', selector: 'a:not([download])', attribute: 'target' }, showDownloadButton: { type: 'boolean', default: true }, downloadButtonText: { type: 'string', source: 'html', selector: 'a[download]' }, displayPreview: { type: 'boolean' }, previewHeight: { type: 'number', default: 600 } }, supports: { anchor: true, align: true }, save({ attributes }) { const { href, fileName, textLinkHref, textLinkTarget, showDownloadButton, downloadButtonText, displayPreview, previewHeight } = attributes; const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? (0,external_wp_i18n_namespaceObject.__)('PDF embed') : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: filename. */ (0,external_wp_i18n_namespaceObject.__)('Embed of %s.'), fileName); return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { className: "wp-block-file__embed", data: href, type: "application/pdf", style: { width: '100%', height: `${previewHeight}px` }, "aria-label": pdfEmbedLabel }) }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: textLinkHref, target: textLinkTarget, rel: textLinkTarget ? 'noreferrer noopener' : undefined, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: fileName }) }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, className: "wp-block-file__button", download: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: downloadButtonText }) })] }); } }; const file_deprecated_deprecated = [deprecated_v3, file_deprecated_v2, file_deprecated_v1]; /* harmony default export */ const file_deprecated = (file_deprecated_deprecated); ;// ./node_modules/@wordpress/block-library/build-module/file/inspector.js /** * WordPress dependencies */ /** * Internal dependencies */ function FileBlockInspector({ hrefs, openInNewWindow, showDownloadButton, changeLinkDestinationOption, changeOpenInNewWindow, changeShowDownloadButton, displayPreview, changeDisplayPreview, previewHeight, changePreviewHeight }) { const { href, textLinkHref, attachmentPage } = hrefs; let linkDestinationOptions = [{ value: href, label: (0,external_wp_i18n_namespaceObject.__)('URL') }]; if (attachmentPage) { linkDestinationOptions = [{ value: href, label: (0,external_wp_i18n_namespaceObject.__)('Media file') }, { value: attachmentPage, label: (0,external_wp_i18n_namespaceObject.__)('Attachment page') }]; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: [href.endsWith('.pdf') && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('PDF settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show inline embed'), help: displayPreview ? (0,external_wp_i18n_namespaceObject.__)("Note: Most phone and tablet browsers won't display embedded PDFs.") : null, checked: !!displayPreview, onChange: changeDisplayPreview }), displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Height in pixels'), min: MIN_PREVIEW_HEIGHT, max: Math.max(MAX_PREVIEW_HEIGHT, previewHeight), value: previewHeight, onChange: changePreviewHeight })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link to'), value: textLinkHref, options: linkDestinationOptions, onChange: changeLinkDestinationOption }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), checked: openInNewWindow, onChange: changeOpenInNewWindow }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show download button'), checked: showDownloadButton, onChange: changeShowDownloadButton })] })] }) }); } ;// ./node_modules/@wordpress/block-library/build-module/file/utils/index.js /** * Uses a combination of user agent matching and feature detection to determine whether * the current browser supports rendering PDFs inline. * * @return {boolean} Whether or not the browser supports inline PDFs. */ const browserSupportsPdfs = () => { // Most mobile devices include "Mobi" in their UA. if (window.navigator.userAgent.indexOf('Mobi') > -1) { return false; } // Android tablets are the notable exception. if (window.navigator.userAgent.indexOf('Android') > -1) { return false; } // iPad pretends to be a Mac. if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) { return false; } // IE only supports PDFs when there's an ActiveX object available for it. if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) { return false; } return true; }; /** * Helper function for creating ActiveX objects, catching any errors that are thrown * when it's generated. * * @param {string} type The name of the ActiveX object to create. * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed. */ const createActiveXObject = type => { let ax; try { ax = new window.ActiveXObject(type); } catch (e) { ax = undefined; } return ax; }; ;// ./node_modules/@wordpress/block-library/build-module/file/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const MIN_PREVIEW_HEIGHT = 200; const MAX_PREVIEW_HEIGHT = 2000; function ClipboardToolbarButton({ text, disabled }) { const { createNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const ref = (0,external_wp_compose_namespaceObject.useCopyToClipboard)(text, () => { createNotice('info', (0,external_wp_i18n_namespaceObject.__)('Copied URL to clipboard.'), { isDismissible: true, type: 'snackbar' }); }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { className: "components-clipboard-toolbar-button", ref: ref, disabled: disabled, children: (0,external_wp_i18n_namespaceObject.__)('Copy URL') }); } function FileEdit({ attributes, isSelected, setAttributes, clientId }) { const { id, fileName, href, textLinkHref, textLinkTarget, showDownloadButton, downloadButtonText, displayPreview, previewHeight } = attributes; const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(attributes.blob); const { media } = (0,external_wp_data_namespaceObject.useSelect)(select => ({ media: id === undefined ? undefined : select(external_wp_coreData_namespaceObject.store).getMedia(id) }), [id]); const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { toggleSelection, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); useUploadMediaFromBlobURL({ url: temporaryURL, onChange: onSelectFile, onError: onUploadError }); // Note: Handle setting a default value for `downloadButtonText` via HTML API // when it supports replacing text content for HTML tags. (0,external_wp_element_namespaceObject.useEffect)(() => { if (external_wp_blockEditor_namespaceObject.RichText.isEmpty(downloadButtonText)) { __unstableMarkNextChangeAsNotPersistent(); setAttributes({ downloadButtonText: (0,external_wp_i18n_namespaceObject._x)('Download', 'button label') }); } // This effect should only run on mount. }, []); function onSelectFile(newMedia) { var _attributes$displayPr, _attributes$previewHe; if (!newMedia || !newMedia.url) { // Reset attributes. setAttributes({ href: undefined, fileName: undefined, textLinkHref: undefined, id: undefined, fileId: undefined, displayPreview: undefined, previewHeight: undefined }); setTemporaryURL(); return; } if ((0,external_wp_blob_namespaceObject.isBlobURL)(newMedia.url)) { setTemporaryURL(newMedia.url); return; } const isPdf = newMedia.url.endsWith('.pdf'); const pdfAttributes = { displayPreview: isPdf ? (_attributes$displayPr = attributes.displayPreview) !== null && _attributes$displayPr !== void 0 ? _attributes$displayPr : true : undefined, previewHeight: isPdf ? (_attributes$previewHe = attributes.previewHeight) !== null && _attributes$previewHe !== void 0 ? _attributes$previewHe : 600 : undefined }; setAttributes({ href: newMedia.url, fileName: newMedia.title, textLinkHref: newMedia.url, id: newMedia.id, fileId: `wp-block-file--media-${clientId}`, blob: undefined, ...pdfAttributes }); setTemporaryURL(); } function onUploadError(message) { setAttributes({ href: undefined }); createErrorNotice(message, { type: 'snackbar' }); } function changeLinkDestinationOption(newHref) { // Choose Media File or Attachment Page (when file is in Media Library). setAttributes({ textLinkHref: newHref }); } function changeOpenInNewWindow(newValue) { setAttributes({ textLinkTarget: newValue ? '_blank' : false }); } function changeShowDownloadButton(newValue) { setAttributes({ showDownloadButton: newValue }); } function changeDisplayPreview(newValue) { setAttributes({ displayPreview: newValue }); } function handleOnResizeStop(event, direction, elt, delta) { toggleSelection(true); const newHeight = parseInt(previewHeight + delta.height, 10); setAttributes({ previewHeight: newHeight }); } function changePreviewHeight(newValue) { const newHeight = Math.max(parseInt(newValue, 10), MIN_PREVIEW_HEIGHT); setAttributes({ previewHeight: newHeight }); } const attachmentPage = media && media.link; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx(!!temporaryURL && (0,external_wp_components_namespaceObject.__unstableGetAnimateClassName)({ type: 'loading' }), { 'is-transient': !!temporaryURL }) }); const displayPreviewInEditor = browserSupportsPdfs() && displayPreview; if (!href && !temporaryURL) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_file }), labels: { title: (0,external_wp_i18n_namespaceObject.__)('File'), instructions: (0,external_wp_i18n_namespaceObject.__)('Drag and drop a file, upload, or choose from your library.') }, onSelect: onSelectFile, onError: onUploadError, accept: "*" }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FileBlockInspector, { hrefs: { href: href || temporaryURL, textLinkHref, attachmentPage }, openInNewWindow: !!textLinkTarget, showDownloadButton, changeLinkDestinationOption, changeOpenInNewWindow, changeShowDownloadButton, displayPreview, changeDisplayPreview, previewHeight, changePreviewHeight }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: id, mediaURL: href, accept: "*", onSelect: onSelectFile, onError: onUploadError, onReset: () => onSelectFile(undefined) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ClipboardToolbarButton, { text: href, disabled: (0,external_wp_blob_namespaceObject.isBlobURL)(href) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [displayPreviewInEditor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ResizableBox, { size: { height: previewHeight, width: '100%' }, minHeight: MIN_PREVIEW_HEIGHT, maxHeight: MAX_PREVIEW_HEIGHT // The horizontal grid value must be 1 or else the width may snap during a // resize even though only vertical resizing is enabled. , grid: [1, 10], enable: { top: false, right: false, bottom: true, left: false, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }, onResizeStart: () => toggleSelection(false), onResizeStop: handleOnResizeStop, showHandle: isSelected, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { className: "wp-block-file__preview", data: href, type: "application/pdf", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Embed of the selected PDF file.') }), !isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-file__preview-overlay" })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-file__content-wrapper", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "fileName", tagName: "a", value: fileName, placeholder: (0,external_wp_i18n_namespaceObject.__)('Write file name…'), withoutInteractiveFormatting: true, onChange: text => setAttributes({ fileName: removeAnchorTag(text) }), href: textLinkHref }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-file__button-richtext-wrapper", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "downloadButtonText", tagName: "div" // Must be block-level or else cursor disappears. , "aria-label": (0,external_wp_i18n_namespaceObject.__)('Download button text'), className: dist_clsx('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), value: downloadButtonText, withoutInteractiveFormatting: true, placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text…'), onChange: text => setAttributes({ downloadButtonText: removeAnchorTag(text) }) }) })] })] })] }); } /* harmony default export */ const file_edit = (FileEdit); ;// ./node_modules/@wordpress/block-library/build-module/file/save.js /** * External dependencies */ /** * WordPress dependencies */ function file_save_save({ attributes }) { const { href, fileId, fileName, textLinkHref, textLinkTarget, showDownloadButton, downloadButtonText, displayPreview, previewHeight } = attributes; const pdfEmbedLabel = external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName) ? 'PDF embed' : // To do: use toPlainText, but we need ensure it's RichTextData. See // https://github.com/WordPress/gutenberg/pull/56710. fileName.toString(); const hasFilename = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(fileName); // Only output an `aria-describedby` when the element it's referring to is // actually rendered. const describedById = hasFilename ? fileId : undefined; return href && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [displayPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("object", { className: "wp-block-file__embed", data: href, type: "application/pdf", style: { width: '100%', height: `${previewHeight}px` }, "aria-label": pdfEmbedLabel }) }), hasFilename && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { id: describedById, href: textLinkHref, target: textLinkTarget, rel: textLinkTarget ? 'noreferrer noopener' : undefined, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: fileName }) }), showDownloadButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, className: dist_clsx('wp-block-file__button', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')), download: true, "aria-describedby": describedById, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: downloadButtonText }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/file/transforms.js /** * WordPress dependencies */ const file_transforms_transforms = { from: [{ type: 'files', isMatch(files) { return files.length > 0; }, // We define a lower priority (higher number) than the default of 10. This // ensures that the File block is only created as a fallback. priority: 15, transform: files => { const blocks = []; files.forEach(file => { const blobURL = (0,external_wp_blob_namespaceObject.createBlobURL)(file); // File will be uploaded in componentDidMount() if (file.type.startsWith('video/')) { blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/video', { blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) })); } else if (file.type.startsWith('image/')) { blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/image', { blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) })); } else if (file.type.startsWith('audio/')) { blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) })); } else { blocks.push((0,external_wp_blocks_namespaceObject.createBlock)('core/file', { blob: blobURL, fileName: file.name })); } }); return blocks; } }, { type: 'block', blocks: ['core/audio'], transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { href: attributes.src, fileName: attributes.caption, textLinkHref: attributes.src, id: attributes.id, anchor: attributes.anchor }); } }, { type: 'block', blocks: ['core/video'], transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { href: attributes.src, fileName: attributes.caption, textLinkHref: attributes.src, id: attributes.id, anchor: attributes.anchor }); } }, { type: 'block', blocks: ['core/image'], transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/file', { href: attributes.url, fileName: attributes.caption || (0,external_wp_url_namespaceObject.getFilename)(attributes.url), textLinkHref: attributes.url, id: attributes.id, anchor: attributes.anchor }); } }], to: [{ type: 'block', blocks: ['core/audio'], isMatch: ({ id }) => { if (!id) { return false; } const { getMedia } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const media = getMedia(id); return !!media && media.mime_type.includes('audio'); }, transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/audio', { src: attributes.href, caption: attributes.fileName, id: attributes.id, anchor: attributes.anchor }); } }, { type: 'block', blocks: ['core/video'], isMatch: ({ id }) => { if (!id) { return false; } const { getMedia } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const media = getMedia(id); return !!media && media.mime_type.includes('video'); }, transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { src: attributes.href, caption: attributes.fileName, id: attributes.id, anchor: attributes.anchor }); } }, { type: 'block', blocks: ['core/image'], isMatch: ({ id }) => { if (!id) { return false; } const { getMedia } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const media = getMedia(id); return !!media && media.mime_type.includes('image'); }, transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { url: attributes.href, caption: attributes.fileName, id: attributes.id, anchor: attributes.anchor }); } }] }; /* harmony default export */ const file_transforms = (file_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/file/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const file_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/file", title: "File", category: "media", description: "Add a link to a downloadable file.", keywords: ["document", "pdf", "download"], textdomain: "default", attributes: { id: { type: "number" }, blob: { type: "string", role: "local" }, href: { type: "string", role: "content" }, fileId: { type: "string", source: "attribute", selector: "a:not([download])", attribute: "id" }, fileName: { type: "rich-text", source: "rich-text", selector: "a:not([download])", role: "content" }, textLinkHref: { type: "string", source: "attribute", selector: "a:not([download])", attribute: "href", role: "content" }, textLinkTarget: { type: "string", source: "attribute", selector: "a:not([download])", attribute: "target" }, showDownloadButton: { type: "boolean", "default": true }, downloadButtonText: { type: "rich-text", source: "rich-text", selector: "a[download]", role: "content" }, displayPreview: { type: "boolean" }, previewHeight: { type: "number", "default": 600 } }, supports: { anchor: true, align: true, spacing: { margin: true, padding: true }, color: { gradients: true, link: true, text: false, __experimentalDefaultControls: { background: true, link: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } }, interactivity: true }, editorStyle: "wp-block-file-editor", style: "wp-block-file" }; const { name: file_name } = file_metadata; const file_settings = { icon: library_file, example: { attributes: { href: 'https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg', fileName: (0,external_wp_i18n_namespaceObject._x)('Armstrong_Small_Step', 'Name of the file') } }, transforms: file_transforms, deprecated: file_deprecated, edit: file_edit, save: file_save_save }; const file_init = () => initBlock({ name: file_name, metadata: file_metadata, settings: file_settings }); ;// ./node_modules/@wordpress/block-library/build-module/form/utils.js /** * WordPress dependencies */ const formSubmissionNotificationSuccess = ['core/form-submission-notification', { type: 'success' }, [['core/paragraph', { content: '<mark style="background-color:rgba(0, 0, 0, 0);color:#345C00" class="has-inline-color">' + (0,external_wp_i18n_namespaceObject.__)('Your form has been submitted successfully') + '</mark>' }]]]; const formSubmissionNotificationError = ['core/form-submission-notification', { type: 'error' }, [['core/paragraph', { content: '<mark style="background-color:rgba(0, 0, 0, 0);color:#CF2E2E" class="has-inline-color">' + (0,external_wp_i18n_namespaceObject.__)('There was an error submitting your form.') + '</mark>' }]]]; ;// ./node_modules/@wordpress/block-library/build-module/form/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const form_edit_TEMPLATE = [formSubmissionNotificationSuccess, formSubmissionNotificationError, ['core/form-input', { type: 'text', label: (0,external_wp_i18n_namespaceObject.__)('Name'), required: true }], ['core/form-input', { type: 'email', label: (0,external_wp_i18n_namespaceObject.__)('Email'), required: true }], ['core/form-input', { type: 'textarea', label: (0,external_wp_i18n_namespaceObject.__)('Comment'), required: true }], ['core/form-submit-button', {}]]; const form_edit_Edit = ({ attributes, setAttributes, clientId }) => { const { action, method, email, submissionMethod } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const { hasInnerBlocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlock } = select(external_wp_blockEditor_namespaceObject.store); const block = getBlock(clientId); return { hasInnerBlocks: !!(block && block.innerBlocks.length) }; }, [clientId]); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: form_edit_TEMPLATE, renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Submissions method'), options: [ // TODO: Allow plugins to add their own submission methods. { label: (0,external_wp_i18n_namespaceObject.__)('Send email'), value: 'email' }, { label: (0,external_wp_i18n_namespaceObject.__)('- Custom -'), value: 'custom' }], value: submissionMethod, onChange: value => setAttributes({ submissionMethod: value }), help: submissionMethod === 'custom' ? (0,external_wp_i18n_namespaceObject.__)('Select the method to use for form submissions. Additional options for the "custom" mode can be found in the "Advanced" section.') : (0,external_wp_i18n_namespaceObject.__)('Select the method to use for form submissions.') }), submissionMethod === 'email' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, autoComplete: "off", label: (0,external_wp_i18n_namespaceObject.__)('Email for form submissions'), value: email, required: true, onChange: value => { setAttributes({ email: value }); setAttributes({ action: `mailto:${value}` }); setAttributes({ method: 'post' }); }, help: (0,external_wp_i18n_namespaceObject.__)('The email address where form submissions will be sent. Separate multiple email addresses with a comma.'), type: "email" })] }) }), submissionMethod !== 'email' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Method'), options: [{ label: 'Get', value: 'get' }, { label: 'Post', value: 'post' }], value: method, onChange: value => setAttributes({ method: value }), help: (0,external_wp_i18n_namespaceObject.__)('Select the method to use for form submissions.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, autoComplete: "off", label: (0,external_wp_i18n_namespaceObject.__)('Form action'), value: action, onChange: newVal => { setAttributes({ action: newVal }); }, help: (0,external_wp_i18n_namespaceObject.__)('The URL where the form should be submitted.'), type: "url" })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { ...innerBlocksProps, className: "wp-block-form", encType: submissionMethod === 'email' ? 'text/plain' : null })] }); }; /* harmony default export */ const form_edit = (form_edit_Edit); ;// ./node_modules/@wordpress/block-library/build-module/form/save.js /** * WordPress dependencies */ function form_save_save({ attributes }) { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); const { submissionMethod } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { ...blockProps, className: "wp-block-form", encType: submissionMethod === 'email' ? 'text/plain' : null, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } ;// ./node_modules/@wordpress/block-library/build-module/form/variations.js /** * WordPress dependencies */ /** * Internal dependencies */ const form_variations_variations = [{ name: 'comment-form', title: (0,external_wp_i18n_namespaceObject.__)('Experimental Comment form'), description: (0,external_wp_i18n_namespaceObject.__)('A comment form for posts and pages.'), attributes: { submissionMethod: 'custom', action: '{SITE_URL}/wp-comments-post.php', method: 'post', anchor: 'comment-form' }, isDefault: false, innerBlocks: [['core/form-input', { type: 'text', name: 'author', label: (0,external_wp_i18n_namespaceObject.__)('Name'), required: true, visibilityPermissions: 'logged-out' }], ['core/form-input', { type: 'email', name: 'email', label: (0,external_wp_i18n_namespaceObject.__)('Email'), required: true, visibilityPermissions: 'logged-out' }], ['core/form-input', { type: 'textarea', name: 'comment', label: (0,external_wp_i18n_namespaceObject.__)('Comment'), required: true, visibilityPermissions: 'all' }], ['core/form-submit-button', {}]], scope: ['inserter', 'transform'], isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' }, { name: 'wp-privacy-form', title: (0,external_wp_i18n_namespaceObject.__)('Experimental Privacy Request Form'), keywords: ['GDPR'], description: (0,external_wp_i18n_namespaceObject.__)('A form to request data exports and/or deletion.'), attributes: { submissionMethod: 'custom', action: '', method: 'post', anchor: 'gdpr-form' }, isDefault: false, innerBlocks: [formSubmissionNotificationSuccess, formSubmissionNotificationError, ['core/paragraph', { content: (0,external_wp_i18n_namespaceObject.__)('To request an export or deletion of your personal data on this site, please fill-in the form below. You can define the type of request you wish to perform, and your email address. Once the form is submitted, you will receive a confirmation email with instructions on the next steps.') }], ['core/form-input', { type: 'email', name: 'email', label: (0,external_wp_i18n_namespaceObject.__)('Enter your email address.'), required: true, visibilityPermissions: 'all' }], ['core/form-input', { type: 'checkbox', name: 'export_personal_data', label: (0,external_wp_i18n_namespaceObject.__)('Request data export'), required: false, visibilityPermissions: 'all' }], ['core/form-input', { type: 'checkbox', name: 'remove_personal_data', label: (0,external_wp_i18n_namespaceObject.__)('Request data deletion'), required: false, visibilityPermissions: 'all' }], ['core/form-submit-button', {}], ['core/form-input', { type: 'hidden', name: 'wp-action', value: 'wp_privacy_send_request' }], ['core/form-input', { type: 'hidden', name: 'wp-privacy-request', value: '1' }]], scope: ['inserter', 'transform'], isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' }]; /* harmony default export */ const form_variations = (form_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/form/index.js /** * Internal dependencies */ const form_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: true, name: "core/form", title: "Form", category: "common", allowedBlocks: ["core/paragraph", "core/heading", "core/form-input", "core/form-submit-button", "core/form-submission-notification", "core/group", "core/columns"], description: "A form.", keywords: ["container", "wrapper", "row", "section"], textdomain: "default", icon: "feedback", attributes: { submissionMethod: { type: "string", "default": "email" }, method: { type: "string", "default": "post" }, action: { type: "string" }, email: { type: "string" } }, supports: { anchor: true, className: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalTextDecoration: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalSelector: "form" } }; /** * WordPress dependencies */ const { name: form_name } = form_metadata; const form_settings = { edit: form_edit, save: form_save_save, variations: form_variations }; const form_init = () => { // Prevent adding forms inside forms. const DISALLOWED_PARENTS = ['core/form']; (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'core/block-library/preventInsertingFormIntoAnotherForm', (canInsert, blockType, rootClientId, { getBlock, getBlockParentsByBlockName }) => { if (blockType.name !== 'core/form') { return canInsert; } for (const disallowedParentType of DISALLOWED_PARENTS) { const hasDisallowedParent = getBlock(rootClientId)?.name === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length; if (hasDisallowedParent) { return false; } } return true; }); return initBlock({ name: form_name, metadata: form_metadata, settings: form_settings }); }; // EXTERNAL MODULE: ./node_modules/remove-accents/index.js var remove_accents = __webpack_require__(9681); var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents); ;// external ["wp","dom"] const external_wp_dom_namespaceObject = window["wp"]["dom"]; ;// ./node_modules/@wordpress/block-library/build-module/form-input/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ const getNameFromLabelV1 = content => { return remove_accents_default()((0,external_wp_dom_namespaceObject.__unstableStripHTML)(content)) // Convert anything that's not a letter or number to a hyphen. .replace(/[^\p{L}\p{N}]+/gu, '-') // Convert to lowercase .toLowerCase() // Remove any remaining leading or trailing hyphens. .replace(/(^-+)|(-+$)/g, ''); }; const form_input_deprecated_v2 = { attributes: { type: { type: 'string', default: 'text' }, name: { type: 'string' }, label: { type: 'string', default: 'Label', selector: '.wp-block-form-input__label-content', source: 'html', role: 'content' }, inlineLabel: { type: 'boolean', default: false }, required: { type: 'boolean', default: false, selector: '.wp-block-form-input__input', source: 'attribute', attribute: 'required' }, placeholder: { type: 'string', selector: '.wp-block-form-input__input', source: 'attribute', attribute: 'placeholder', role: 'content' }, value: { type: 'string', default: '', selector: 'input', source: 'attribute', attribute: 'value' }, visibilityPermissions: { type: 'string', default: 'all' } }, supports: { anchor: true, reusable: false, spacing: { margin: ['top', 'bottom'] }, __experimentalBorder: { radius: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { radius: true } } }, save({ attributes }) { const { type, name, label, inlineLabel, required, placeholder, value } = attributes; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const inputStyle = { ...borderProps.style, ...colorProps.style }; const inputClasses = dist_clsx('wp-block-form-input__input', colorProps.className, borderProps.className); const TagName = type === 'textarea' ? 'textarea' : 'input'; const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); if ('hidden' === type) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { type: type, name: name, value: value }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("label", { className: dist_clsx('wp-block-form-input__label', { 'is-label-inline': inlineLabel }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "wp-block-form-input__label-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: label }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { className: inputClasses, type: 'textarea' === type ? undefined : type, name: name || getNameFromLabelV1(label), required: required, "aria-required": required, placeholder: placeholder || undefined, style: inputStyle })] }) }); } }; // Version without wrapper div in saved markup // See: https://github.com/WordPress/gutenberg/pull/56507 const form_input_deprecated_v1 = { attributes: { type: { type: 'string', default: 'text' }, name: { type: 'string' }, label: { type: 'string', default: 'Label', selector: '.wp-block-form-input__label-content', source: 'html', role: 'content' }, inlineLabel: { type: 'boolean', default: false }, required: { type: 'boolean', default: false, selector: '.wp-block-form-input__input', source: 'attribute', attribute: 'required' }, placeholder: { type: 'string', selector: '.wp-block-form-input__input', source: 'attribute', attribute: 'placeholder', role: 'content' }, value: { type: 'string', default: '', selector: 'input', source: 'attribute', attribute: 'value' }, visibilityPermissions: { type: 'string', default: 'all' } }, supports: { className: false, anchor: true, reusable: false, spacing: { margin: ['top', 'bottom'] }, __experimentalBorder: { radius: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { radius: true } } }, save({ attributes }) { const { type, name, label, inlineLabel, required, placeholder, value } = attributes; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const inputStyle = { ...borderProps.style, ...colorProps.style }; const inputClasses = dist_clsx('wp-block-form-input__input', colorProps.className, borderProps.className); const TagName = type === 'textarea' ? 'textarea' : 'input'; if ('hidden' === type) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { type: type, name: name, value: value }); } /* eslint-disable jsx-a11y/label-has-associated-control */ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("label", { className: dist_clsx('wp-block-form-input__label', { 'is-label-inline': inlineLabel }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "wp-block-form-input__label-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: label }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { className: inputClasses, type: 'textarea' === type ? undefined : type, name: name || getNameFromLabelV1(label), required: required, "aria-required": required, placeholder: placeholder || undefined, style: inputStyle })] }); /* eslint-enable jsx-a11y/label-has-associated-control */ } }; const form_input_deprecated_deprecated = [form_input_deprecated_v2, form_input_deprecated_v1]; /* harmony default export */ const form_input_deprecated = (form_input_deprecated_deprecated); ;// ./node_modules/@wordpress/block-library/build-module/form-input/edit.js /** * External dependencies */ /** * WordPress dependencies */ function InputFieldBlock({ attributes, setAttributes, className }) { const { type, name, label, inlineLabel, required, placeholder, value } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const ref = (0,external_wp_element_namespaceObject.useRef)(); const TagName = type === 'textarea' ? 'textarea' : 'input'; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); if (ref.current) { ref.current.focus(); } // Note: radio inputs aren't implemented yet. const isCheckboxOrRadio = type === 'checkbox' || type === 'radio'; const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: ['hidden' !== type && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: ['checkbox' !== type && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Inline label'), checked: inlineLabel, onChange: newVal => { setAttributes({ inlineLabel: newVal }); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Required'), checked: required, onChange: newVal => { setAttributes({ required: newVal }); } })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, autoComplete: "off", label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: name, onChange: newVal => { setAttributes({ name: newVal }); }, help: (0,external_wp_i18n_namespaceObject.__)('Affects the "name" attribute of the input element, and is used as a name for the form submission results.') }) })] }); const content = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "span", className: "wp-block-form-input__label-content", value: label, onChange: newLabel => setAttributes({ label: newLabel }), "aria-label": label ? (0,external_wp_i18n_namespaceObject.__)('Label') : (0,external_wp_i18n_namespaceObject.__)('Empty label'), "data-empty": !label, placeholder: (0,external_wp_i18n_namespaceObject.__)('Type the label for this input') }); if ('hidden' === type) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [controls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { type: "hidden", className: dist_clsx(className, 'wp-block-form-input__input', colorProps.className, borderProps.className), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Value'), value: value, onChange: event => setAttributes({ value: event.target.value }) })] }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [controls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("span", { className: dist_clsx('wp-block-form-input__label', { 'is-label-inline': inlineLabel || 'checkbox' === type }), children: [!isCheckboxOrRadio && content, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { type: 'textarea' === type ? undefined : type, className: dist_clsx(className, 'wp-block-form-input__input', colorProps.className, borderProps.className), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') // We hide the placeholder field's placeholder when there is a value. This // stops screen readers from reading the placeholder field's placeholder // which is confusing. , placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'), value: placeholder, onChange: event => setAttributes({ placeholder: event.target.value }), "aria-required": required, style: { ...borderProps.style, ...colorProps.style } }), isCheckboxOrRadio && content] })] }); } /* harmony default export */ const form_input_edit = (InputFieldBlock); ;// ./node_modules/@wordpress/block-library/build-module/form-input/save.js /** * External dependencies */ /** * WordPress dependencies */ /** * Get the name attribute from a content string. * * @param {string} content The block content. * * @return {string} Returns the slug. */ const getNameFromLabel = content => { return remove_accents_default()((0,external_wp_dom_namespaceObject.__unstableStripHTML)(content)) // Convert anything that's not a letter or number to a hyphen. .replace(/[^\p{L}\p{N}]+/gu, '-') // Convert to lowercase .toLowerCase() // Remove any remaining leading or trailing hyphens. .replace(/(^-+)|(-+$)/g, ''); }; function form_input_save_save({ attributes }) { const { type, name, label, inlineLabel, required, placeholder, value } = attributes; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const inputStyle = { ...borderProps.style, ...colorProps.style }; const inputClasses = dist_clsx('wp-block-form-input__input', colorProps.className, borderProps.className); const TagName = type === 'textarea' ? 'textarea' : 'input'; const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); // Note: radio inputs aren't implemented yet. const isCheckboxOrRadio = type === 'checkbox' || type === 'radio'; if ('hidden' === type) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { type: type, name: name, value: value }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("label", { className: dist_clsx('wp-block-form-input__label', { 'is-label-inline': inlineLabel }), children: [!isCheckboxOrRadio && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "wp-block-form-input__label-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: label }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { className: inputClasses, type: 'textarea' === type ? undefined : type, name: name || getNameFromLabel(label), required: required, "aria-required": required, placeholder: placeholder || undefined, style: inputStyle }), isCheckboxOrRadio && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "wp-block-form-input__label-content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: label }) })] }) }); } ;// ./node_modules/@wordpress/block-library/build-module/form-input/variations.js /** * WordPress dependencies */ const form_input_variations_variations = [{ name: 'text', title: (0,external_wp_i18n_namespaceObject.__)('Text Input'), icon: 'edit-page', description: (0,external_wp_i18n_namespaceObject.__)('A generic text input.'), attributes: { type: 'text' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'text' }, { name: 'textarea', title: (0,external_wp_i18n_namespaceObject.__)('Textarea Input'), icon: 'testimonial', description: (0,external_wp_i18n_namespaceObject.__)('A textarea input to allow entering multiple lines of text.'), attributes: { type: 'textarea' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'textarea' }, { name: 'checkbox', title: (0,external_wp_i18n_namespaceObject.__)('Checkbox Input'), description: (0,external_wp_i18n_namespaceObject.__)('A simple checkbox input.'), icon: 'forms', attributes: { type: 'checkbox', inlineLabel: true }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'checkbox' }, { name: 'email', title: (0,external_wp_i18n_namespaceObject.__)('Email Input'), icon: 'email', description: (0,external_wp_i18n_namespaceObject.__)('Used for email addresses.'), attributes: { type: 'email' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'email' }, { name: 'url', title: (0,external_wp_i18n_namespaceObject.__)('URL Input'), icon: 'admin-site', description: (0,external_wp_i18n_namespaceObject.__)('Used for URLs.'), attributes: { type: 'url' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'url' }, { name: 'tel', title: (0,external_wp_i18n_namespaceObject.__)('Telephone Input'), icon: 'phone', description: (0,external_wp_i18n_namespaceObject.__)('Used for phone numbers.'), attributes: { type: 'tel' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'tel' }, { name: 'number', title: (0,external_wp_i18n_namespaceObject.__)('Number Input'), icon: 'edit-page', description: (0,external_wp_i18n_namespaceObject.__)('A numeric input.'), attributes: { type: 'number' }, isDefault: true, scope: ['inserter', 'transform'], isActive: blockAttributes => blockAttributes?.type === 'number' }]; /* harmony default export */ const form_input_variations = (form_input_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/form-input/index.js /** * Internal dependencies */ const form_input_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: true, name: "core/form-input", title: "Input Field", category: "common", ancestor: ["core/form"], description: "The basic building block for forms.", keywords: ["input", "form"], textdomain: "default", icon: "forms", attributes: { type: { type: "string", "default": "text" }, name: { type: "string" }, label: { type: "rich-text", "default": "Label", selector: ".wp-block-form-input__label-content", source: "rich-text", role: "content" }, inlineLabel: { type: "boolean", "default": false }, required: { type: "boolean", "default": false, selector: ".wp-block-form-input__input", source: "attribute", attribute: "required" }, placeholder: { type: "string", selector: ".wp-block-form-input__input", source: "attribute", attribute: "placeholder", role: "content" }, value: { type: "string", "default": "", selector: "input", source: "attribute", attribute: "value" }, visibilityPermissions: { type: "string", "default": "all" } }, supports: { anchor: true, reusable: false, spacing: { margin: ["top", "bottom"] }, __experimentalBorder: { radius: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { radius: true } } }, style: ["wp-block-form-input"] }; const { name: form_input_name } = form_input_metadata; const form_input_settings = { deprecated: form_input_deprecated, edit: form_input_edit, save: form_input_save_save, variations: form_input_variations }; const form_input_init = () => initBlock({ name: form_input_name, metadata: form_input_metadata, settings: form_input_settings }); ;// ./node_modules/@wordpress/block-library/build-module/form-submit-button/edit.js /** * WordPress dependencies */ const form_submit_button_edit_TEMPLATE = [['core/buttons', {}, [['core/button', { text: (0,external_wp_i18n_namespaceObject.__)('Submit'), tagName: 'button', type: 'submit' }]]]]; const form_submit_button_edit_Edit = () => { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: form_submit_button_edit_TEMPLATE, templateLock: 'all' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-form-submit-wrapper", ...innerBlocksProps }); }; /* harmony default export */ const form_submit_button_edit = (form_submit_button_edit_Edit); ;// ./node_modules/@wordpress/block-library/build-module/form-submit-button/save.js /** * WordPress dependencies */ function form_submit_button_save_save() { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-form-submit-wrapper", ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } ;// ./node_modules/@wordpress/block-library/build-module/form-submit-button/index.js /** * Internal dependencies */ const form_submit_button_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: true, name: "core/form-submit-button", title: "Form Submit Button", category: "common", icon: "button", ancestor: ["core/form"], allowedBlocks: ["core/buttons", "core/button"], description: "A submission button for forms.", keywords: ["submit", "button", "form"], textdomain: "default", style: ["wp-block-form-submit-button"] }; const { name: form_submit_button_name } = form_submit_button_metadata; const form_submit_button_settings = { edit: form_submit_button_edit, save: form_submit_button_save_save }; const form_submit_button_init = () => initBlock({ name: form_submit_button_name, metadata: form_submit_button_metadata, settings: form_submit_button_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/group.js /** * WordPress dependencies */ const group = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z" }) }); /* harmony default export */ const library_group = (group); ;// ./node_modules/@wordpress/block-library/build-module/form-submission-notification/edit.js /** * WordPress dependencies */ /** * External dependencies */ const form_submission_notification_edit_TEMPLATE = [['core/paragraph', { content: (0,external_wp_i18n_namespaceObject.__)("Enter the message you wish displayed for form submission error/success, and select the type of the message (success/error) from the block's options.") }]]; const form_submission_notification_edit_Edit = ({ attributes, clientId }) => { const { type } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx('wp-block-form-submission-notification', { [`form-notification-type-${type}`]: type }) }); const { hasInnerBlocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlock } = select(external_wp_blockEditor_namespaceObject.store); const block = getBlock(clientId); return { hasInnerBlocks: !!(block && block.innerBlocks.length) }; }, [clientId]); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: form_submission_notification_edit_TEMPLATE, renderAppender: hasInnerBlocks ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps, "data-message-success": (0,external_wp_i18n_namespaceObject.__)('Submission success notification'), "data-message-error": (0,external_wp_i18n_namespaceObject.__)('Submission error notification') }); }; /* harmony default export */ const form_submission_notification_edit = (form_submission_notification_edit_Edit); ;// ./node_modules/@wordpress/block-library/build-module/form-submission-notification/save.js /** * WordPress dependencies */ /** * External dependencies */ function form_submission_notification_save_save({ attributes }) { const { type } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: dist_clsx('wp-block-form-submission-notification', { [`form-notification-type-${type}`]: type }) })) }); } ;// ./node_modules/@wordpress/block-library/build-module/form-submission-notification/variations.js /** * WordPress dependencies */ const form_submission_notification_variations_variations = [{ name: 'form-submission-success', title: (0,external_wp_i18n_namespaceObject.__)('Form Submission Success'), description: (0,external_wp_i18n_namespaceObject.__)('Success message for form submissions.'), attributes: { type: 'success' }, isDefault: true, innerBlocks: [['core/paragraph', { content: (0,external_wp_i18n_namespaceObject.__)('Your form has been submitted successfully.'), backgroundColor: '#00D084', textColor: '#000000', style: { elements: { link: { color: { text: '#000000' } } } } }]], scope: ['inserter', 'transform'], isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'success' }, { name: 'form-submission-error', title: (0,external_wp_i18n_namespaceObject.__)('Form Submission Error'), description: (0,external_wp_i18n_namespaceObject.__)('Error/failure message for form submissions.'), attributes: { type: 'error' }, isDefault: false, innerBlocks: [['core/paragraph', { content: (0,external_wp_i18n_namespaceObject.__)('There was an error submitting your form.'), backgroundColor: '#CF2E2E', textColor: '#FFFFFF', style: { elements: { link: { color: { text: '#FFFFFF' } } } } }]], scope: ['inserter', 'transform'], isActive: blockAttributes => !blockAttributes?.type || blockAttributes?.type === 'error' }]; /* harmony default export */ const form_submission_notification_variations = (form_submission_notification_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/form-submission-notification/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const form_submission_notification_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: true, name: "core/form-submission-notification", title: "Form Submission Notification", category: "common", ancestor: ["core/form"], description: "Provide a notification message after the form has been submitted.", keywords: ["form", "feedback", "notification", "message"], textdomain: "default", icon: "feedback", attributes: { type: { type: "string", "default": "success" } } }; const { name: form_submission_notification_name } = form_submission_notification_metadata; const form_submission_notification_settings = { icon: library_group, edit: form_submission_notification_edit, save: form_submission_notification_save_save, variations: form_submission_notification_variations }; const form_submission_notification_init = () => initBlock({ name: form_submission_notification_name, metadata: form_submission_notification_metadata, settings: form_submission_notification_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/gallery.js /** * WordPress dependencies */ const gallery = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.375 4.5H4.625a.125.125 0 0 0-.125.125v8.254l2.859-1.54a.75.75 0 0 1 .68-.016l2.384 1.142 2.89-2.074a.75.75 0 0 1 .874 0l2.313 1.66V4.625a.125.125 0 0 0-.125-.125Zm.125 9.398-2.75-1.975-2.813 2.02a.75.75 0 0 1-.76.067l-2.444-1.17L4.5 14.583v1.792c0 .069.056.125.125.125h11.75a.125.125 0 0 0 .125-.125v-2.477ZM4.625 3C3.728 3 3 3.728 3 4.625v11.75C3 17.273 3.728 18 4.625 18h11.75c.898 0 1.625-.727 1.625-1.625V4.625C18 3.728 17.273 3 16.375 3H4.625ZM20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z", fillRule: "evenodd", clipRule: "evenodd" }) }); /* harmony default export */ const library_gallery = (gallery); ;// ./node_modules/@wordpress/block-library/build-module/gallery/constants.js const LINK_DESTINATION_NONE = 'none'; const LINK_DESTINATION_MEDIA = 'media'; const LINK_DESTINATION_LIGHTBOX = 'lightbox'; const LINK_DESTINATION_ATTACHMENT = 'attachment'; const LINK_DESTINATION_MEDIA_WP_CORE = 'file'; const LINK_DESTINATION_ATTACHMENT_WP_CORE = 'post'; ;// ./node_modules/@wordpress/block-library/build-module/gallery/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const DEPRECATED_LINK_DESTINATION_MEDIA = 'file'; const DEPRECATED_LINK_DESTINATION_ATTACHMENT = 'post'; /** * Original function to determine default number of columns from a block's * attributes. * * Used in deprecations: v1-6, for versions of the gallery block that didn't use inner blocks. * * @param {Object} attributes Block attributes. * @return {number} Default number of columns for the gallery. */ function defaultColumnsNumberV1(attributes) { return Math.min(3, attributes?.images?.length); } /** * Original function to determine new href and linkDestination values for an image block from the * supplied Gallery link destination. * * Used in deprecations: v1-6. * * @param {Object} image Gallery image. * @param {string} destination Gallery's selected link destination. * @return {Object} New attributes to assign to image block. */ function getHrefAndDestination(image, destination) { // Need to determine the URL that the selected destination maps to. // Gutenberg and WordPress use different constants so the new link // destination also needs to be tweaked. switch (destination) { case DEPRECATED_LINK_DESTINATION_MEDIA: return { href: image?.source_url || image?.url, // eslint-disable-line camelcase linkDestination: LINK_DESTINATION_MEDIA }; case DEPRECATED_LINK_DESTINATION_ATTACHMENT: return { href: image?.link, linkDestination: LINK_DESTINATION_ATTACHMENT }; case LINK_DESTINATION_MEDIA: return { href: image?.source_url || image?.url, // eslint-disable-line camelcase linkDestination: LINK_DESTINATION_MEDIA }; case LINK_DESTINATION_ATTACHMENT: return { href: image?.link, linkDestination: LINK_DESTINATION_ATTACHMENT }; case LINK_DESTINATION_NONE: return { href: undefined, linkDestination: LINK_DESTINATION_NONE }; } return {}; } function runV2Migration(attributes) { let linkTo = attributes.linkTo ? attributes.linkTo : 'none'; if (linkTo === 'post') { linkTo = 'attachment'; } else if (linkTo === 'file') { linkTo = 'media'; } const imageBlocks = attributes.images.map(image => { return getImageBlock(image, attributes.sizeSlug, linkTo); }); const { images, ids, ...restAttributes } = attributes; return [{ ...restAttributes, linkTo, allowResize: false }, imageBlocks]; } /** * Gets an Image block from gallery image data * * Used to migrate Galleries to nested Image InnerBlocks. * * @param {Object} image Image properties. * @param {string} sizeSlug Gallery sizeSlug attribute. * @param {string} linkTo Gallery linkTo attribute. * @return {Object} Image block. */ function getImageBlock(image, sizeSlug, linkTo) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { ...(image.id && { id: parseInt(image.id) }), url: image.url, alt: image.alt, caption: image.caption, sizeSlug, ...getHrefAndDestination(image, linkTo) }); } // In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname // to the gallery figcaption element. const deprecated_v7 = { attributes: { images: { type: 'array', default: [], source: 'query', selector: '.blocks-gallery-item', query: { url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src' }, fullUrl: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-full-url' }, link: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-link' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, id: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-id' }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-item__caption' } } }, ids: { type: 'array', items: { type: 'number' }, default: [] }, shortCodeTransforms: { type: 'array', default: [], items: { type: 'object' } }, columns: { type: 'number', minimum: 1, maximum: 8 }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-caption' }, imageCrop: { type: 'boolean', default: true }, fixedHeight: { type: 'boolean', default: true }, linkTarget: { type: 'string' }, linkTo: { type: 'string' }, sizeSlug: { type: 'string', default: 'large' }, allowResize: { type: 'boolean', default: false } }, save({ attributes }) { const { caption, columns, imageCrop } = attributes; const className = dist_clsx('has-nested-images', { [`columns-${columns}`]: columns !== undefined, [`columns-default`]: columns === undefined, 'is-cropped': imageCrop }); const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...innerBlocksProps, children: [innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-caption", value: caption })] }); } }; const deprecated_v6 = { attributes: { images: { type: 'array', default: [], source: 'query', selector: '.blocks-gallery-item', query: { url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src' }, fullUrl: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-full-url' }, link: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-link' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, id: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-id' }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-item__caption' } } }, ids: { type: 'array', items: { type: 'number' }, default: [] }, columns: { type: 'number', minimum: 1, maximum: 8 }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-caption' }, imageCrop: { type: 'boolean', default: true }, fixedHeight: { type: 'boolean', default: true }, linkTo: { type: 'string' }, sizeSlug: { type: 'string', default: 'large' } }, supports: { anchor: true, align: true }, save({ attributes }) { const { images, columns = defaultColumnsNumberV1(attributes), imageCrop, caption, linkTo } = attributes; const className = `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "blocks-gallery-grid", children: images.map(image => { let href; switch (linkTo) { case DEPRECATED_LINK_DESTINATION_MEDIA: href = image.fullUrl || image.url; break; case DEPRECATED_LINK_DESTINATION_ATTACHMENT: href = image.link; break; } const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: image.url, alt: image.alt, "data-id": image.id, "data-full-url": image.fullUrl, "data-link": image.link, className: image.id ? `wp-image-${image.id}` : null }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { className: "blocks-gallery-item", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, children: img }) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-item__caption", value: image.caption })] }) }, image.id || image.url); }) }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-caption", value: caption })] }); }, migrate(attributes) { return runV2Migration(attributes); } }; const deprecated_v5 = { attributes: { images: { type: 'array', default: [], source: 'query', selector: '.blocks-gallery-item', query: { url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src' }, fullUrl: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-full-url' }, link: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-link' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, id: { type: 'string', source: 'attribute', selector: 'img', attribute: 'data-id' }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-item__caption' } } }, ids: { type: 'array', items: { type: 'number' }, default: [] }, columns: { type: 'number', minimum: 1, maximum: 8 }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-caption' }, imageCrop: { type: 'boolean', default: true }, linkTo: { type: 'string', default: 'none' }, sizeSlug: { type: 'string', default: 'large' } }, supports: { align: true }, isEligible({ linkTo }) { return !linkTo || linkTo === 'attachment' || linkTo === 'media'; }, migrate(attributes) { return runV2Migration(attributes); }, save({ attributes }) { const { images, columns = defaultColumnsNumberV1(attributes), imageCrop, caption, linkTo } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "blocks-gallery-grid", children: images.map(image => { let href; switch (linkTo) { case 'media': href = image.fullUrl || image.url; break; case 'attachment': href = image.link; break; } const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: image.url, alt: image.alt, "data-id": image.id, "data-full-url": image.fullUrl, "data-link": image.link, className: image.id ? `wp-image-${image.id}` : null }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { className: "blocks-gallery-item", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, children: img }) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-item__caption", value: image.caption })] }) }, image.id || image.url); }) }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-caption", value: caption })] }); } }; const deprecated_v4 = { attributes: { images: { type: 'array', default: [], source: 'query', selector: '.blocks-gallery-item', query: { url: { source: 'attribute', selector: 'img', attribute: 'src' }, fullUrl: { source: 'attribute', selector: 'img', attribute: 'data-full-url' }, link: { source: 'attribute', selector: 'img', attribute: 'data-link' }, alt: { source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, id: { source: 'attribute', selector: 'img', attribute: 'data-id' }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-item__caption' } } }, ids: { type: 'array', default: [] }, columns: { type: 'number' }, caption: { type: 'string', source: 'html', selector: '.blocks-gallery-caption' }, imageCrop: { type: 'boolean', default: true }, linkTo: { type: 'string', default: 'none' } }, supports: { align: true }, isEligible({ ids }) { return ids && ids.some(id => typeof id === 'string'); }, migrate(attributes) { return runV2Migration(attributes); }, save({ attributes }) { const { images, columns = defaultColumnsNumberV1(attributes), imageCrop, caption, linkTo } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: "blocks-gallery-grid", children: images.map(image => { let href; switch (linkTo) { case 'media': href = image.fullUrl || image.url; break; case 'attachment': href = image.link; break; } const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: image.url, alt: image.alt, "data-id": image.id, "data-full-url": image.fullUrl, "data-link": image.link, className: image.id ? `wp-image-${image.id}` : null }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { className: "blocks-gallery-item", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, children: img }) : img, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(image.caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-item__caption", value: image.caption })] }) }, image.id || image.url); }) }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: "blocks-gallery-caption", value: caption })] }); } }; const gallery_deprecated_v3 = { attributes: { images: { type: 'array', default: [], source: 'query', selector: 'ul.wp-block-gallery .blocks-gallery-item', query: { url: { source: 'attribute', selector: 'img', attribute: 'src' }, fullUrl: { source: 'attribute', selector: 'img', attribute: 'data-full-url' }, alt: { source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, id: { source: 'attribute', selector: 'img', attribute: 'data-id' }, link: { source: 'attribute', selector: 'img', attribute: 'data-link' }, caption: { type: 'string', source: 'html', selector: 'figcaption' } } }, ids: { type: 'array', default: [] }, columns: { type: 'number' }, imageCrop: { type: 'boolean', default: true }, linkTo: { type: 'string', default: 'none' } }, supports: { align: true }, save({ attributes }) { const { images, columns = defaultColumnsNumberV1(attributes), imageCrop, linkTo } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`, children: images.map(image => { let href; switch (linkTo) { case 'media': href = image.fullUrl || image.url; break; case 'attachment': href = image.link; break; } const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: image.url, alt: image.alt, "data-id": image.id, "data-full-url": image.fullUrl, "data-link": image.link, className: image.id ? `wp-image-${image.id}` : null }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { className: "blocks-gallery-item", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, children: img }) : img, image.caption && image.caption.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: image.caption })] }) }, image.id || image.url); }) }); }, migrate(attributes) { return runV2Migration(attributes); } }; const gallery_deprecated_v2 = { attributes: { images: { type: 'array', default: [], source: 'query', selector: 'ul.wp-block-gallery .blocks-gallery-item', query: { url: { source: 'attribute', selector: 'img', attribute: 'src' }, alt: { source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, id: { source: 'attribute', selector: 'img', attribute: 'data-id' }, link: { source: 'attribute', selector: 'img', attribute: 'data-link' }, caption: { type: 'string', source: 'html', selector: 'figcaption' } } }, columns: { type: 'number' }, imageCrop: { type: 'boolean', default: true }, linkTo: { type: 'string', default: 'none' } }, isEligible({ images, ids }) { return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || images.some((id, index) => { if (!id && ids[index] !== null) { return true; } return parseInt(id, 10) !== ids[index]; })); }, migrate(attributes) { return runV2Migration(attributes); }, supports: { align: true }, save({ attributes }) { const { images, columns = defaultColumnsNumberV1(attributes), imageCrop, linkTo } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { className: `columns-${columns} ${imageCrop ? 'is-cropped' : ''}`, children: images.map(image => { let href; switch (linkTo) { case 'media': href = image.url; break; case 'attachment': href = image.link; break; } const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: image.url, alt: image.alt, "data-id": image.id, "data-link": image.link, className: image.id ? `wp-image-${image.id}` : null }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { className: "blocks-gallery-item", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, children: img }) : img, image.caption && image.caption.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: image.caption })] }) }, image.id || image.url); }) }); } }; const gallery_deprecated_v1 = { attributes: { images: { type: 'array', default: [], source: 'query', selector: 'div.wp-block-gallery figure.blocks-gallery-image img', query: { url: { source: 'attribute', attribute: 'src' }, alt: { source: 'attribute', attribute: 'alt', default: '' }, id: { source: 'attribute', attribute: 'data-id' } } }, columns: { type: 'number' }, imageCrop: { type: 'boolean', default: true }, linkTo: { type: 'string', default: 'none' }, align: { type: 'string', default: 'none' } }, supports: { align: true }, save({ attributes }) { const { images, columns = defaultColumnsNumberV1(attributes), align, imageCrop, linkTo } = attributes; const className = dist_clsx(`columns-${columns}`, { alignnone: align === 'none', 'is-cropped': imageCrop }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: className, children: images.map(image => { let href; switch (linkTo) { case 'media': href = image.url; break; case 'attachment': href = image.link; break; } const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: image.url, alt: image.alt, "data-id": image.id }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "blocks-gallery-image", children: href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, children: img }) : img }, image.id || image.url); }) }); }, migrate(attributes) { return runV2Migration(attributes); } }; /* harmony default export */ const gallery_deprecated = ([deprecated_v7, deprecated_v6, deprecated_v5, deprecated_v4, gallery_deprecated_v3, gallery_deprecated_v2, gallery_deprecated_v1]); ;// ./node_modules/@wordpress/icons/build-module/library/custom-link.js /** * WordPress dependencies */ const customLink = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z" }) }); /* harmony default export */ const custom_link = (customLink); ;// ./node_modules/@wordpress/icons/build-module/library/image.js /** * WordPress dependencies */ const image_image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" }) }); /* harmony default export */ const library_image = (image_image); ;// ./node_modules/@wordpress/block-library/build-module/gallery/shared-icon.js /** * WordPress dependencies */ const sharedIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_gallery }); ;// ./node_modules/@wordpress/block-library/build-module/gallery/shared.js function defaultColumnsNumber(imageCount) { return imageCount ? Math.min(3, imageCount) : 3; } const pickRelevantMediaFiles = (image, sizeSlug = 'large') => { const imageProps = Object.fromEntries(Object.entries(image !== null && image !== void 0 ? image : {}).filter(([key]) => ['alt', 'id', 'link'].includes(key))); imageProps.url = image?.sizes?.[sizeSlug]?.url || image?.media_details?.sizes?.[sizeSlug]?.source_url || image?.url || image?.source_url; const fullUrl = image?.sizes?.full?.url || image?.media_details?.sizes?.full?.source_url; if (fullUrl) { imageProps.fullUrl = fullUrl; } return imageProps; }; ;// ./node_modules/@wordpress/block-library/build-module/image/constants.js const constants_MIN_SIZE = 20; const constants_LINK_DESTINATION_NONE = 'none'; const constants_LINK_DESTINATION_MEDIA = 'media'; const constants_LINK_DESTINATION_ATTACHMENT = 'attachment'; const LINK_DESTINATION_CUSTOM = 'custom'; const constants_NEW_TAB_REL = ['noreferrer', 'noopener']; const constants_ALLOWED_MEDIA_TYPES = ['image']; const MEDIA_ID_NO_FEATURED_IMAGE_SET = 0; ;// ./node_modules/@wordpress/block-library/build-module/gallery/utils.js /** * Internal dependencies */ /** * Determines new href and linkDestination values for an Image block from the * supplied Gallery link destination, or falls back to the Image blocks link. * * @param {Object} image Gallery image. * @param {string} galleryDestination Gallery's selected link destination. * @param {Object} imageDestination Image block link destination attribute. * @param {Object} attributes Block attributes. * @param {Object} lightboxSetting Lightbox setting. * * @return {Object} New attributes to assign to image block. */ function utils_getHrefAndDestination(image, galleryDestination, imageDestination, attributes, lightboxSetting) { // Gutenberg and WordPress use different constants so if image_default_link_type // option is set we need to map from the WP Core values. switch (imageDestination ? imageDestination : galleryDestination) { case LINK_DESTINATION_MEDIA_WP_CORE: case LINK_DESTINATION_MEDIA: return { href: image?.source_url || image?.url, // eslint-disable-line camelcase linkDestination: constants_LINK_DESTINATION_MEDIA, lightbox: lightboxSetting?.enabled ? { ...attributes?.lightbox, enabled: false } : undefined }; case LINK_DESTINATION_ATTACHMENT_WP_CORE: case LINK_DESTINATION_ATTACHMENT: return { href: image?.link, linkDestination: constants_LINK_DESTINATION_ATTACHMENT, lightbox: lightboxSetting?.enabled ? { ...attributes?.lightbox, enabled: false } : undefined }; case LINK_DESTINATION_LIGHTBOX: return { href: undefined, lightbox: !lightboxSetting?.enabled ? { ...attributes?.lightbox, enabled: true } : undefined, linkDestination: constants_LINK_DESTINATION_NONE }; case LINK_DESTINATION_NONE: return { href: undefined, linkDestination: constants_LINK_DESTINATION_NONE, lightbox: undefined }; } return {}; } ;// ./node_modules/@wordpress/block-library/build-module/image/utils.js /** * Internal dependencies */ /** * Evaluates a CSS aspect-ratio property value as a number. * * Degenerate or invalid ratios behave as 'auto'. And 'auto' ratios return NaN. * * @see https://drafts.csswg.org/css-sizing-4/#aspect-ratio * * @param {string} value CSS aspect-ratio property value. * @return {number} Numerical aspect ratio or NaN if invalid. */ function evalAspectRatio(value) { const [width, height = 1] = value.split('/').map(Number); const aspectRatio = width / height; return aspectRatio === Infinity || aspectRatio === 0 ? NaN : aspectRatio; } function removeNewTabRel(currentRel) { let newRel = currentRel; if (currentRel !== undefined && newRel) { constants_NEW_TAB_REL.forEach(relVal => { const regExp = new RegExp('\\b' + relVal + '\\b', 'gi'); newRel = newRel.replace(regExp, ''); }); // Only trim if NEW_TAB_REL values was replaced. if (newRel !== currentRel) { newRel = newRel.trim(); } if (!newRel) { newRel = undefined; } } return newRel; } /** * Helper to get the link target settings to be stored. * * @param {boolean} value The new link target value. * @param {Object} attributes Block attributes. * @param {Object} attributes.rel Image block's rel attribute. * * @return {Object} Updated link target settings. */ function getUpdatedLinkTargetSettings(value, { rel }) { const linkTarget = value ? '_blank' : undefined; let updatedRel; if (!linkTarget && !rel) { updatedRel = undefined; } else { updatedRel = removeNewTabRel(rel); } return { linkTarget, rel: updatedRel }; } /** * Determines new Image block attributes size selection. * * @param {Object} image Media file object for gallery image. * @param {string} size Selected size slug to apply. */ function getImageSizeAttributes(image, size) { const url = image?.media_details?.sizes?.[size]?.source_url; if (url) { return { url, width: undefined, height: undefined, sizeSlug: size }; } return {}; } /** * Checks if the file has a valid file type. * * @param {File} file - The file to check. * @return {boolean} - Returns true if the file has a valid file type, otherwise false. */ function isValidFileType(file) { return constants_ALLOWED_MEDIA_TYPES.some(mediaType => file.type.indexOf(mediaType) === 0); } ;// ./node_modules/@wordpress/block-library/build-module/gallery/gallery.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function Gallery(props) { const { attributes, isSelected, setAttributes, mediaPlaceholder, insertBlocksAfter, blockProps, __unstableLayoutClassNames: layoutClassNames, isContentLocked, multiGallerySelection } = props; const { align, columns, imageCrop } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...blockProps, className: dist_clsx(blockProps.className, layoutClassNames, 'blocks-gallery-grid', { [`align${align}`]: align, [`columns-${columns}`]: columns !== undefined, [`columns-default`]: columns === undefined, 'is-cropped': imageCrop }), children: [blockProps.children, isSelected && !blockProps.children && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { className: "blocks-gallery-media-placeholder-wrapper", children: mediaPlaceholder }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { attributes: attributes, setAttributes: setAttributes, isSelected: isSelected, insertBlocksAfter: insertBlocksAfter, showToolbarButton: !multiGallerySelection && !isContentLocked, className: "blocks-gallery-caption", label: (0,external_wp_i18n_namespaceObject.__)('Gallery caption text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Add gallery caption') })] }); } ;// ./node_modules/@wordpress/block-library/build-module/gallery/use-image-sizes.js /** * WordPress dependencies */ /** * Calculates the image sizes that are available for the current gallery images in order to * populate the 'Resolution' selector. * * @param {Array} images Basic image block data taken from current gallery innerBlock. * @param {boolean} isSelected Is the block currently selected in the editor. * @param {Function} getSettings Block editor store selector. * * @return {Array} An array of image size options. */ function useImageSizes(images, isSelected, getSettings) { return (0,external_wp_element_namespaceObject.useMemo)(() => getImageSizing(), [images, isSelected]); function getImageSizing() { if (!images || images.length === 0) { return; } const { imageSizes } = getSettings(); let resizedImages = {}; if (isSelected) { resizedImages = images.reduce((currentResizedImages, img) => { if (!img.id) { return currentResizedImages; } const sizes = imageSizes.reduce((currentSizes, size) => { const defaultUrl = img.sizes?.[size.slug]?.url; const mediaDetailsUrl = img.media_details?.sizes?.[size.slug]?.source_url; return { ...currentSizes, [size.slug]: defaultUrl || mediaDetailsUrl }; }, {}); return { ...currentResizedImages, [parseInt(img.id, 10)]: sizes }; }, {}); } const resizedImageSizes = Object.values(resizedImages); return imageSizes.filter(({ slug }) => resizedImageSizes.some(sizes => sizes[slug])).map(({ name, slug }) => ({ value: slug, label: name })); } } ;// ./node_modules/@wordpress/block-library/build-module/gallery/use-get-new-images.js /** * WordPress dependencies */ /** * Keeps track of images already in the gallery to allow new innerBlocks to be identified. This * is required so default gallery attributes can be applied without overwriting any custom * attributes applied to existing images. * * @param {Array} images Basic image block data taken from current gallery innerBlock * @param {Array} imageData The related image data for each of the current gallery images. * * @return {Array} An array of any new images that have been added to the gallery. */ function useGetNewImages(images, imageData) { const [currentImages, setCurrentImages] = (0,external_wp_element_namespaceObject.useState)([]); return (0,external_wp_element_namespaceObject.useMemo)(() => getNewImages(), [images, imageData]); function getNewImages() { let imagesUpdated = false; // First lets check if any images have been deleted. const newCurrentImages = currentImages.filter(currentImg => images.find(img => { return currentImg.clientId === img.clientId; })); if (newCurrentImages.length < currentImages.length) { imagesUpdated = true; } // Now lets see if we have any images hydrated from saved content and if so // add them to currentImages state. images.forEach(image => { if (image.fromSavedContent && !newCurrentImages.find(currentImage => currentImage.id === image.id)) { imagesUpdated = true; newCurrentImages.push(image); } }); // Now check for any new images that have been added to InnerBlocks and for which // we have the imageData we need for setting default block attributes. const newImages = images.filter(image => !newCurrentImages.find(currentImage => image.clientId && currentImage.clientId === image.clientId) && imageData?.find(img => img.id === image.id) && !image.fromSavedContent); if (imagesUpdated || newImages?.length > 0) { setCurrentImages([...newCurrentImages, ...newImages]); } return newImages.length > 0 ? newImages : null; } } ;// ./node_modules/@wordpress/block-library/build-module/gallery/use-get-media.js /** * WordPress dependencies */ const EMPTY_IMAGE_MEDIA = []; /** * Retrieves the extended media info for each gallery image from the store. This is used to * determine which image size options are available for the current gallery. * * @param {Array} innerBlockImages An array of the innerBlock images currently in the gallery. * * @return {Array} An array of media info options for each gallery image. */ function useGetMedia(innerBlockImages) { return (0,external_wp_data_namespaceObject.useSelect)(select => { var _select$getMediaItems; const imageIds = innerBlockImages.map(imageBlock => imageBlock.attributes.id).filter(id => id !== undefined); if (imageIds.length === 0) { return EMPTY_IMAGE_MEDIA; } return (_select$getMediaItems = select(external_wp_coreData_namespaceObject.store).getMediaItems({ include: imageIds.join(','), per_page: -1, orderby: 'include' })) !== null && _select$getMediaItems !== void 0 ? _select$getMediaItems : EMPTY_IMAGE_MEDIA; }, [innerBlockImages]); } ;// ./node_modules/@wordpress/block-library/build-module/gallery/gap-styles.js /** * WordPress dependencies */ function GapStyles({ blockGap, clientId }) { // --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default // gap on the gallery. const fallbackValue = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`; let gapValue = fallbackValue; let column = fallbackValue; let row; // Check for the possibility of split block gap values. See: https://github.com/WordPress/gutenberg/pull/37736 if (!!blockGap) { row = typeof blockGap === 'string' ? (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap) : (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap?.top) || fallbackValue; column = typeof blockGap === 'string' ? (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap) : (0,external_wp_blockEditor_namespaceObject.__experimentalGetGapCSSValue)(blockGap?.left) || fallbackValue; gapValue = row === column ? row : `${row} ${column}`; } // The unstable gallery gap calculation requires a real value (such as `0px`) and not `0`. const gap = `#block-${clientId} { --wp--style--unstable-gallery-gap: ${column === '0' ? '0px' : column}; gap: ${gapValue} }`; (0,external_wp_blockEditor_namespaceObject.useStyleOverride)({ css: gap }); return null; } ;// ./node_modules/@wordpress/block-library/build-module/gallery/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const MAX_COLUMNS = 8; const LINK_OPTIONS = [{ icon: custom_link, label: (0,external_wp_i18n_namespaceObject.__)('Link images to attachment pages'), value: LINK_DESTINATION_ATTACHMENT, noticeText: (0,external_wp_i18n_namespaceObject.__)('Attachment Pages') }, { icon: library_image, label: (0,external_wp_i18n_namespaceObject.__)('Link images to media files'), value: LINK_DESTINATION_MEDIA, noticeText: (0,external_wp_i18n_namespaceObject.__)('Media Files') }, { icon: library_fullscreen, label: (0,external_wp_i18n_namespaceObject.__)('Enlarge on click'), value: LINK_DESTINATION_LIGHTBOX, noticeText: (0,external_wp_i18n_namespaceObject.__)('Lightbox effect'), infoText: (0,external_wp_i18n_namespaceObject.__)('Scale images with a lightbox effect') }, { icon: link_off, label: (0,external_wp_i18n_namespaceObject._x)('None', 'Media item link option'), value: LINK_DESTINATION_NONE, noticeText: (0,external_wp_i18n_namespaceObject.__)('None') }]; const edit_ALLOWED_MEDIA_TYPES = ['image']; const PLACEHOLDER_TEXT = external_wp_element_namespaceObject.Platform.isNative ? (0,external_wp_i18n_namespaceObject.__)('Add media') : (0,external_wp_i18n_namespaceObject.__)('Drag and drop images, upload, or choose from your library.'); const MOBILE_CONTROL_PROPS_RANGE_CONTROL = external_wp_element_namespaceObject.Platform.isNative ? { type: 'stepper' } : {}; const gallery_edit_DEFAULT_BLOCK = { name: 'core/image' }; const EMPTY_ARRAY = []; function GalleryEdit(props) { const { setAttributes, attributes, className, clientId, isSelected, insertBlocksAfter, isContentLocked, onFocus } = props; const [lightboxSetting] = (0,external_wp_blockEditor_namespaceObject.useSettings)('blocks.core/image.lightbox'); const linkOptions = !lightboxSetting?.allowEditing ? LINK_OPTIONS.filter(option => option.value !== LINK_DESTINATION_LIGHTBOX) : LINK_OPTIONS; const { columns, imageCrop, randomOrder, linkTarget, linkTo, sizeSlug } = attributes; const { __unstableMarkNextChangeAsNotPersistent, replaceInnerBlocks, updateBlockAttributes, selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { createSuccessNotice, createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { getBlock, getSettings, innerBlockImages, blockWasJustInserted, multiGallerySelection } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getBlock$innerBlocks; const { getBlockName, getMultiSelectedBlockClientIds, getSettings: _getSettings, getBlock: _getBlock, wasBlockJustInserted } = select(external_wp_blockEditor_namespaceObject.store); const multiSelectedClientIds = getMultiSelectedBlockClientIds(); return { getBlock: _getBlock, getSettings: _getSettings, innerBlockImages: (_getBlock$innerBlocks = _getBlock(clientId)?.innerBlocks) !== null && _getBlock$innerBlocks !== void 0 ? _getBlock$innerBlocks : EMPTY_ARRAY, blockWasJustInserted: wasBlockJustInserted(clientId, 'inserter_menu'), multiGallerySelection: multiSelectedClientIds.length && multiSelectedClientIds.every(_clientId => getBlockName(_clientId) === 'core/gallery') }; }, [clientId]); const images = (0,external_wp_element_namespaceObject.useMemo)(() => innerBlockImages?.map(block => ({ clientId: block.clientId, id: block.attributes.id, url: block.attributes.url, attributes: block.attributes, fromSavedContent: Boolean(block.originalContent) })), [innerBlockImages]); const imageData = useGetMedia(innerBlockImages); const newImages = useGetNewImages(images, imageData); (0,external_wp_element_namespaceObject.useEffect)(() => { newImages?.forEach(newImage => { // Update the images data without creating new undo levels. __unstableMarkNextChangeAsNotPersistent(); updateBlockAttributes(newImage.clientId, { ...buildImageAttributes(newImage.attributes), id: newImage.id, align: undefined }); }); }, [newImages]); const imageSizeOptions = useImageSizes(imageData, isSelected, getSettings); /** * Determines the image attributes that should be applied to an image block * after the gallery updates. * * The gallery will receive the full collection of images when a new image * is added. As a result we need to reapply the image's original settings if * it already existed in the gallery. If the image is in fact new, we need * to apply the gallery's current settings to the image. * * @param {Object} imageAttributes Media object for the actual image. * @return {Object} Attributes to set on the new image block. */ function buildImageAttributes(imageAttributes) { const image = imageAttributes.id ? imageData.find(({ id }) => id === imageAttributes.id) : null; let newClassName; if (imageAttributes.className && imageAttributes.className !== '') { newClassName = imageAttributes.className; } let newLinkTarget; if (imageAttributes.linkTarget || imageAttributes.rel) { // When transformed from image blocks, the link destination and rel attributes are inherited. newLinkTarget = { linkTarget: imageAttributes.linkTarget, rel: imageAttributes.rel }; } else { // When an image is added, update the link destination and rel attributes according to the gallery settings newLinkTarget = getUpdatedLinkTargetSettings(linkTarget, attributes); } return { ...pickRelevantMediaFiles(image, sizeSlug), ...utils_getHrefAndDestination(image, linkTo, imageAttributes?.linkDestination), ...newLinkTarget, className: newClassName, sizeSlug, caption: imageAttributes.caption || image.caption?.raw, alt: imageAttributes.alt || image.alt_text }; } function isValidFileType(file) { // It's necessary to retrieve the media type from the raw image data for already-uploaded images on native. const nativeFileData = external_wp_element_namespaceObject.Platform.isNative && file.id ? imageData.find(({ id }) => id === file.id) : null; const mediaTypeSelector = nativeFileData ? nativeFileData?.media_type : file.type; return edit_ALLOWED_MEDIA_TYPES.some(mediaType => mediaTypeSelector?.indexOf(mediaType) === 0) || file.blob; } function updateImages(selectedImages) { const newFileUploads = Object.prototype.toString.call(selectedImages) === '[object FileList]'; const imageArray = newFileUploads ? Array.from(selectedImages).map(file => { if (!file.url) { return { blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) }; } return file; }) : selectedImages; if (!imageArray.every(isValidFileType)) { createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), { id: 'gallery-upload-invalid-file', type: 'snackbar' }); } const processedImages = imageArray.filter(file => file.url || isValidFileType(file)).map(file => { if (!file.url) { return { blob: file.blob || (0,external_wp_blob_namespaceObject.createBlobURL)(file) }; } return file; }); // Because we are reusing existing innerImage blocks any reordering // done in the media library will be lost so we need to reapply that ordering // once the new image blocks are merged in with existing. const newOrderMap = processedImages.reduce((result, image, index) => (result[image.id] = index, result), {}); const existingImageBlocks = !newFileUploads ? innerBlockImages.filter(block => processedImages.find(img => img.id === block.attributes.id)) : innerBlockImages; const newImageList = processedImages.filter(img => !existingImageBlocks.find(existingImg => img.id === existingImg.attributes.id)); const newBlocks = newImageList.map(image => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { id: image.id, blob: image.blob, url: image.url, caption: image.caption, alt: image.alt }); }); replaceInnerBlocks(clientId, existingImageBlocks.concat(newBlocks).sort((a, b) => newOrderMap[a.attributes.id] - newOrderMap[b.attributes.id])); // Select the first block to scroll into view when new blocks are added. if (newBlocks?.length > 0) { selectBlock(newBlocks[0].clientId); } } function onUploadError(message) { createErrorNotice(message, { type: 'snackbar' }); } function setLinkTo(value) { setAttributes({ linkTo: value }); const changedAttributes = {}; const blocks = []; getBlock(clientId).innerBlocks.forEach(block => { blocks.push(block.clientId); const image = block.attributes.id ? imageData.find(({ id }) => id === block.attributes.id) : null; changedAttributes[block.clientId] = utils_getHrefAndDestination(image, value, false, block.attributes, lightboxSetting); }); updateBlockAttributes(blocks, changedAttributes, true); const linkToText = [...linkOptions].find(linkType => linkType.value === value); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: image size settings */ (0,external_wp_i18n_namespaceObject.__)('All gallery image links updated to: %s'), linkToText.noticeText), { id: 'gallery-attributes-linkTo', type: 'snackbar' }); } function setColumnsNumber(value) { setAttributes({ columns: value }); } function toggleImageCrop() { setAttributes({ imageCrop: !imageCrop }); } function toggleRandomOrder() { setAttributes({ randomOrder: !randomOrder }); } function toggleOpenInNewTab(openInNewTab) { const newLinkTarget = openInNewTab ? '_blank' : undefined; setAttributes({ linkTarget: newLinkTarget }); const changedAttributes = {}; const blocks = []; getBlock(clientId).innerBlocks.forEach(block => { blocks.push(block.clientId); changedAttributes[block.clientId] = getUpdatedLinkTargetSettings(newLinkTarget, block.attributes); }); updateBlockAttributes(blocks, changedAttributes, true); const noticeText = openInNewTab ? (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to open in new tab') : (0,external_wp_i18n_namespaceObject.__)('All gallery images updated to not open in new tab'); createSuccessNotice(noticeText, { id: 'gallery-attributes-openInNewTab', type: 'snackbar' }); } function updateImagesSize(newSizeSlug) { setAttributes({ sizeSlug: newSizeSlug }); const changedAttributes = {}; const blocks = []; getBlock(clientId).innerBlocks.forEach(block => { blocks.push(block.clientId); const image = block.attributes.id ? imageData.find(({ id }) => id === block.attributes.id) : null; changedAttributes[block.clientId] = getImageSizeAttributes(image, newSizeSlug); }); updateBlockAttributes(blocks, changedAttributes, true); const imageSize = imageSizeOptions.find(size => size.value === newSizeSlug); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: image size settings */ (0,external_wp_i18n_namespaceObject.__)('All gallery image sizes updated to: %s'), imageSize.label), { id: 'gallery-attributes-sizeSlug', type: 'snackbar' }); } (0,external_wp_element_namespaceObject.useEffect)(() => { // linkTo attribute must be saved so blocks don't break when changing image_default_link_type in options.php. if (!linkTo) { __unstableMarkNextChangeAsNotPersistent(); setAttributes({ linkTo: window?.wp?.media?.view?.settings?.defaultProps?.link || LINK_DESTINATION_NONE }); } }, [linkTo]); const hasImages = !!images.length; const hasImageIds = hasImages && images.some(image => !!image.id); const imagesUploading = images.some(img => !external_wp_element_namespaceObject.Platform.isNative ? !img.id && img.url?.indexOf('blob:') === 0 : img.url?.indexOf('file:') === 0); // MediaPlaceholder props are different between web and native hence, we provide a platform-specific set. const mediaPlaceholderProps = external_wp_element_namespaceObject.Platform.select({ web: { addToGallery: false, disableMediaButtons: imagesUploading, value: {} }, native: { addToGallery: hasImageIds, isAppender: hasImages, disableMediaButtons: hasImages && !isSelected || imagesUploading, value: hasImageIds ? images : {}, autoOpenMediaUpload: !hasImages && isSelected && blockWasJustInserted, onFocus } }); const mediaPlaceholder = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { handleUpload: false, icon: sharedIcon, labels: { title: (0,external_wp_i18n_namespaceObject.__)('Gallery'), instructions: PLACEHOLDER_TEXT }, onSelect: updateImages, accept: "image/*", allowedTypes: edit_ALLOWED_MEDIA_TYPES, multiple: true, onError: onUploadError, ...mediaPlaceholderProps }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx(className, 'has-nested-images') }); const nativeInnerBlockProps = external_wp_element_namespaceObject.Platform.isNative && { marginHorizontal: 0, marginVertical: 0 }; const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { defaultBlock: gallery_edit_DEFAULT_BLOCK, directInsert: true, orientation: 'horizontal', renderAppender: false, ...nativeInnerBlockProps }); if (!hasImages) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.View, { ...innerBlocksProps, children: [innerBlocksProps.children, mediaPlaceholder] }); } const hasLinkTo = linkTo && linkTo !== 'none'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [images.length > 1 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Columns'), value: columns ? columns : defaultColumnsNumber(images.length), onChange: setColumnsNumber, min: 1, max: Math.min(MAX_COLUMNS, images.length), ...MOBILE_CONTROL_PROPS_RANGE_CONTROL, required: true, __next40pxDefaultSize: true }), imageSizeOptions?.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Resolution'), help: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source images.'), value: sizeSlug, options: imageSizeOptions, onChange: updateImagesSize, hideCancelButton: true, size: "__unstable-large" }), external_wp_element_namespaceObject.Platform.isNative ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link'), value: linkTo, onChange: setLinkTo, options: linkOptions, hideCancelButton: true, size: "__unstable-large" }) : null, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Crop images to fit'), checked: !!imageCrop, onChange: toggleImageCrop }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Randomize order'), checked: !!randomOrder, onChange: toggleRandomOrder }), hasLinkTo && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open images in new tab'), checked: linkTarget === '_blank', onChange: toggleOpenInNewTab }), external_wp_element_namespaceObject.Platform.isWeb && !imageSizeOptions && hasImageIds && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.BaseControl, { className: "gallery-image-sizes", __nextHasNoMarginBottom: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.BaseControl.VisualLabel, { children: (0,external_wp_i18n_namespaceObject.__)('Resolution') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.View, { className: "gallery-image-sizes__loading", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), (0,external_wp_i18n_namespaceObject.__)('Loading options…')] })] })] }) }), external_wp_element_namespaceObject.Platform.isWeb ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { icon: library_link, label: (0,external_wp_i18n_namespaceObject.__)('Link'), children: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: linkOptions.map(linkItem => { const isOptionSelected = linkTo === linkItem.value; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { isSelected: isOptionSelected, className: dist_clsx('components-dropdown-menu__menu-item', { 'is-active': isOptionSelected }), iconPosition: "left", icon: linkItem.icon, onClick: () => { setLinkTo(linkItem.value); onClose(); }, role: "menuitemradio", info: linkItem.infoText, children: linkItem.label }, linkItem.value); }) }) }) }) : null, external_wp_element_namespaceObject.Platform.isWeb && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [!multiGallerySelection && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { allowedTypes: edit_ALLOWED_MEDIA_TYPES, accept: "image/*", handleUpload: false, onSelect: updateImages, name: (0,external_wp_i18n_namespaceObject.__)('Add'), multiple: true, mediaIds: images.filter(image => image.id).map(image => image.id), addToGallery: hasImageIds }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GapStyles, { blockGap: attributes.style?.spacing?.blockGap, clientId: clientId })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Gallery, { ...props, isContentLocked: isContentLocked, images: images, mediaPlaceholder: !hasImages || external_wp_element_namespaceObject.Platform.isNative ? mediaPlaceholder : undefined, blockProps: innerBlocksProps, insertBlocksAfter: insertBlocksAfter, multiGallerySelection: multiGallerySelection })] }); } ;// ./node_modules/@wordpress/block-library/build-module/gallery/save.js /** * External dependencies */ /** * WordPress dependencies */ function saveWithInnerBlocks({ attributes }) { const { caption, columns, imageCrop } = attributes; const className = dist_clsx('has-nested-images', { [`columns-${columns}`]: columns !== undefined, [`columns-default`]: columns === undefined, 'is-cropped': imageCrop }); const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...innerBlocksProps, children: [innerBlocksProps.children, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", className: dist_clsx('blocks-gallery-caption', (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption')), value: caption })] }); } ;// ./node_modules/@wordpress/block-library/build-module/gallery/transforms.js /** * WordPress dependencies */ /** * Internal dependencies */ const parseShortcodeIds = ids => { if (!ids) { return []; } return ids.split(',').map(id => parseInt(id, 10)); }; /** * Third party block plugins don't have an easy way to detect if the * innerBlocks version of the Gallery is running when they run a * 3rdPartyBlock -> GalleryBlock transform so this transform filter * will handle this. Once the innerBlocks version is the default * in a core release, this could be deprecated and removed after * plugin authors have been given time to update transforms. * * @typedef {Object} Attributes * @typedef {Object} Block * @property {Attributes} attributes The attributes of the block. * @param {Block} block The transformed block. * @return {Block} The transformed block. */ function updateThirdPartyTransformToGallery(block) { if (block.name === 'core/gallery' && block.attributes?.images.length > 0) { const innerBlocks = block.attributes.images.map(({ url, id, alt }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { url, id: id ? parseInt(id, 10) : null, alt, sizeSlug: block.attributes.sizeSlug, linkDestination: block.attributes.linkDestination }); }); delete block.attributes.ids; delete block.attributes.images; block.innerBlocks = innerBlocks; } return block; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-to', updateThirdPartyTransformToGallery); /** * Third party block plugins don't have an easy way to detect if the * innerBlocks version of the Gallery is running when they run a * GalleryBlock -> 3rdPartyBlock transform so this transform filter * will handle this. Once the innerBlocks version is the default * in a core release, this could be deprecated and removed after * plugin authors have been given time to update transforms. * * @typedef {Object} Attributes * @typedef {Object} Block * @property {Attributes} attributes The attributes of the block. * @param {Block} toBlock The block to transform to. * @param {Block[]} fromBlocks The blocks to transform from. * @return {Block} The transformed block. */ function updateThirdPartyTransformFromGallery(toBlock, fromBlocks) { const from = Array.isArray(fromBlocks) ? fromBlocks : [fromBlocks]; const galleryBlock = from.find(transformedBlock => transformedBlock.name === 'core/gallery' && transformedBlock.innerBlocks.length > 0 && !transformedBlock.attributes.images?.length > 0 && !toBlock.name.includes('core/')); if (galleryBlock) { const images = galleryBlock.innerBlocks.map(({ attributes: { url, id, alt } }) => ({ url, id: id ? parseInt(id, 10) : null, alt })); const ids = images.map(({ id }) => id); galleryBlock.attributes.images = images; galleryBlock.attributes.ids = ids; } return toBlock; } (0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/gallery/update-third-party-transform-from', updateThirdPartyTransformFromGallery); const gallery_transforms_transforms = { from: [{ type: 'block', isMultiBlock: true, blocks: ['core/image'], transform: attributes => { // Init the align and size from the first item which may be either the placeholder or an image. let { align, sizeSlug } = attributes[0]; // Loop through all the images and check if they have the same align and size. align = attributes.every(attribute => attribute.align === align) ? align : undefined; sizeSlug = attributes.every(attribute => attribute.sizeSlug === sizeSlug) ? sizeSlug : undefined; const validImages = attributes.filter(({ url }) => url); const innerBlocks = validImages.map(image => { // Gallery images can't currently be resized so make sure height and width are undefined. image.width = undefined; image.height = undefined; return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', image); }); return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', { align, sizeSlug }, innerBlocks); } }, { type: 'shortcode', tag: 'gallery', transform({ named: { ids, columns = 3, link, orderby } }) { const imageIds = parseShortcodeIds(ids).map(id => parseInt(id, 10)); let linkTo = LINK_DESTINATION_NONE; if (link === 'post') { linkTo = LINK_DESTINATION_ATTACHMENT; } else if (link === 'file') { linkTo = LINK_DESTINATION_MEDIA; } const galleryBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', { columns: parseInt(columns, 10), linkTo, randomOrder: orderby === 'rand' }, imageIds.map(imageId => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { id: imageId }))); return galleryBlock; }, isMatch({ named }) { return undefined !== named.ids; } }, { // When created by drag and dropping multiple files on an insertion point. Because multiple // files must not be transformed to a gallery when dropped within a gallery there is another transform // within the image block to handle that case. Therefore this transform has to have priority 1 // set so that it overrides the image block transformation when multiple images are dropped outside // of a gallery block. type: 'files', priority: 1, isMatch(files) { return files.length !== 1 && files.every(file => file.type.indexOf('image/') === 0); }, transform(files) { const innerBlocks = files.map(file => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) })); return (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {}, innerBlocks); } }], to: [{ type: 'block', blocks: ['core/image'], transform: ({ align }, innerBlocks) => { if (innerBlocks.length > 0) { return innerBlocks.map(({ attributes: { url, alt, caption, title, href, rel, linkClass, id, sizeSlug: imageSizeSlug, linkDestination, linkTarget, anchor, className } }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { align, url, alt, caption, title, href, rel, linkClass, id, sizeSlug: imageSizeSlug, linkDestination, linkTarget, anchor, className })); } return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { align }); } }] }; /* harmony default export */ const gallery_transforms = (gallery_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/gallery/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const gallery_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/gallery", title: "Gallery", category: "media", allowedBlocks: ["core/image"], description: "Display multiple images in a rich gallery.", keywords: ["images", "photos"], textdomain: "default", attributes: { images: { type: "array", "default": [], source: "query", selector: ".blocks-gallery-item", query: { url: { type: "string", source: "attribute", selector: "img", attribute: "src" }, fullUrl: { type: "string", source: "attribute", selector: "img", attribute: "data-full-url" }, link: { type: "string", source: "attribute", selector: "img", attribute: "data-link" }, alt: { type: "string", source: "attribute", selector: "img", attribute: "alt", "default": "" }, id: { type: "string", source: "attribute", selector: "img", attribute: "data-id" }, caption: { type: "rich-text", source: "rich-text", selector: ".blocks-gallery-item__caption" } } }, ids: { type: "array", items: { type: "number" }, "default": [] }, shortCodeTransforms: { type: "array", items: { type: "object" }, "default": [] }, columns: { type: "number", minimum: 1, maximum: 8 }, caption: { type: "rich-text", source: "rich-text", selector: ".blocks-gallery-caption" }, imageCrop: { type: "boolean", "default": true }, randomOrder: { type: "boolean", "default": false }, fixedHeight: { type: "boolean", "default": true }, linkTarget: { type: "string" }, linkTo: { type: "string" }, sizeSlug: { type: "string", "default": "large" }, allowResize: { type: "boolean", "default": false } }, providesContext: { allowResize: "allowResize", imageCrop: "imageCrop", fixedHeight: "fixedHeight" }, supports: { anchor: true, align: true, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { color: true, radius: true } }, html: false, units: ["px", "em", "rem", "vh", "vw"], spacing: { margin: true, padding: true, blockGap: ["horizontal", "vertical"], __experimentalSkipSerialization: ["blockGap"], __experimentalDefaultControls: { blockGap: true, margin: false, padding: false } }, color: { text: false, background: true, gradients: true }, layout: { allowSwitching: false, allowInheriting: false, allowEditing: false, "default": { type: "flex" } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-gallery-editor", style: "wp-block-gallery" }; const { name: gallery_name } = gallery_metadata; const gallery_settings = { icon: library_gallery, example: { attributes: { columns: 2 }, innerBlocks: [{ name: 'core/image', attributes: { url: 'https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg' } }, { name: 'core/image', attributes: { url: 'https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg' } }] }, transforms: gallery_transforms, edit: GalleryEdit, save: saveWithInnerBlocks, deprecated: gallery_deprecated }; const gallery_init = () => initBlock({ name: gallery_name, metadata: gallery_metadata, settings: gallery_settings }); ;// ./node_modules/@wordpress/block-library/build-module/group/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ const migrateAttributes = attributes => { if (!attributes.tagName) { attributes = { ...attributes, tagName: 'div' }; } if (!attributes.customTextColor && !attributes.customBackgroundColor) { return attributes; } const style = { color: {} }; if (attributes.customTextColor) { style.color.text = attributes.customTextColor; } if (attributes.customBackgroundColor) { style.color.background = attributes.customBackgroundColor; } const { customTextColor, customBackgroundColor, ...restAttributes } = attributes; return { ...restAttributes, style }; }; const group_deprecated_deprecated = [ // Version with default layout. { attributes: { tagName: { type: 'string', default: 'div' }, templateLock: { type: ['string', 'boolean'], enum: ['all', 'insert', false] } }, supports: { __experimentalOnEnter: true, __experimentalSettings: true, align: ['wide', 'full'], anchor: true, ariaLabel: true, html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: ['top', 'bottom'], padding: true, blockGap: true, __experimentalDefaultControls: { padding: true, blockGap: true } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalDefaultControls: { fontSize: true } }, layout: true }, save({ attributes: { tagName: Tag } }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()) }); }, isEligible: ({ layout }) => layout?.inherit || layout?.contentSize && layout?.type !== 'constrained', migrate: attributes => { const { layout = null } = attributes; if (layout?.inherit || layout?.contentSize) { return { ...attributes, layout: { ...layout, type: 'constrained' } }; } } }, // Version of the block with the double div. { attributes: { tagName: { type: 'string', default: 'div' }, templateLock: { type: ['string', 'boolean'], enum: ['all', 'insert', false] } }, supports: { align: ['wide', 'full'], anchor: true, color: { gradients: true, link: true }, spacing: { padding: true }, __experimentalBorder: { radius: true } }, save({ attributes }) { const { tagName: Tag } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-group__inner-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }) }); } }, // Version of the block without global styles support { attributes: { backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, textColor: { type: 'string' }, customTextColor: { type: 'string' } }, supports: { align: ['wide', 'full'], anchor: true, html: false }, migrate: migrateAttributes, save({ attributes }) { const { backgroundColor, customBackgroundColor, textColor, customTextColor } = attributes; const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const className = dist_clsx(backgroundClass, textClass, { 'has-text-color': textColor || customTextColor, 'has-background': backgroundColor || customBackgroundColor }); const styles = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: className, style: styles, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-group__inner-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }) }); } }, // Version of the group block with a bug that made text color class not applied. { attributes: { backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, textColor: { type: 'string' }, customTextColor: { type: 'string' } }, migrate: migrateAttributes, supports: { align: ['wide', 'full'], anchor: true, html: false }, save({ attributes }) { const { backgroundColor, customBackgroundColor, textColor, customTextColor } = attributes; const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const className = dist_clsx(backgroundClass, { 'has-text-color': textColor || customTextColor, 'has-background': backgroundColor || customBackgroundColor }); const styles = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: className, style: styles, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-group__inner-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }) }); } }, // v1 of group block. Deprecated to add an inner-container div around `InnerBlocks.Content`. { attributes: { backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' } }, supports: { align: ['wide', 'full'], anchor: true, html: false }, migrate: migrateAttributes, save({ attributes }) { const { backgroundColor, customBackgroundColor } = attributes; const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const className = dist_clsx(backgroundClass, { 'has-background': backgroundColor || customBackgroundColor }); const styles = { backgroundColor: backgroundClass ? undefined : customBackgroundColor }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: className, style: styles, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } }]; /* harmony default export */ const group_deprecated = (group_deprecated_deprecated); ;// ./node_modules/@wordpress/block-library/build-module/group/placeholder.js /** * WordPress dependencies */ /** * Returns a custom variation icon. * * @param {string} name The block variation name. * * @return {JSX.Element} The SVG element. */ const getGroupPlaceholderIcons = (name = 'group') => { const icons = { group: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z" }) }), 'group-row': /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z" }) }), 'group-stack': /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm0 17a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V27Z" }) }), 'group-grid': /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "48", height: "48", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10ZM0 27a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V27Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V27Z" }) }) }; return icons?.[name]; }; /** * A custom hook to tell the Group block whether to show the variation placeholder. * * @param {Object} props Arguments to pass to hook. * @param {Object} [props.attributes] The block's attributes. * @param {string} [props.usedLayoutType] The block's current layout type. * @param {boolean} [props.hasInnerBlocks] Whether the block has inner blocks. * * @return {[boolean, Function]} A state value and setter function. */ function useShouldShowPlaceHolder({ attributes = { style: undefined, backgroundColor: undefined, textColor: undefined, fontSize: undefined }, usedLayoutType = '', hasInnerBlocks = false }) { const { style, backgroundColor, textColor, fontSize } = attributes; /* * Shows the placeholder when no known styles are set, * or when a non-default layout has been selected. * Should the Group block support more style presets in the * future, e.g., attributes.spacingSize, we can add them to the * condition. */ const [showPlaceholder, setShowPlaceholder] = (0,external_wp_element_namespaceObject.useState)(!hasInnerBlocks && !backgroundColor && !fontSize && !textColor && !style && usedLayoutType !== 'flex' && usedLayoutType !== 'grid'); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!!hasInnerBlocks || !!backgroundColor || !!fontSize || !!textColor || !!style || usedLayoutType === 'flex') { setShowPlaceholder(false); } }, [backgroundColor, fontSize, textColor, style, usedLayoutType, hasInnerBlocks]); return [showPlaceholder, setShowPlaceholder]; } /** * Display group variations if none is selected. * * @param {Object} props Component props. * @param {string} props.name The block's name. * @param {Function} props.onSelect Function to set block's attributes. * * @return {JSX.Element} The placeholder. */ function GroupPlaceHolder({ name, onSelect }) { const variations = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getBlockVariations(name, 'block'), [name]); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: 'wp-block-group__placeholder' }); (0,external_wp_element_namespaceObject.useEffect)(() => { if (variations && variations.length === 1) { onSelect(variations[0]); } }, [onSelect, variations]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { instructions: (0,external_wp_i18n_namespaceObject.__)('Group blocks together. Select a layout:'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { role: "list", className: "wp-block-group-placeholder__variations", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Block variations'), children: variations.map(variation => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", icon: getGroupPlaceholderIcons(variation.name), iconSize: 48, onClick: () => onSelect(variation), className: "wp-block-group-placeholder__variation-button", label: `${variation.title}: ${variation.description}` }) }, variation.name)) }) }) }); } /* harmony default export */ const placeholder = (GroupPlaceHolder); ;// ./node_modules/@wordpress/block-library/build-module/group/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Render inspector controls for the Group block. * * @param {Object} props Component props. * @param {string} props.tagName The HTML tag name. * @param {Function} props.onSelectTagName onChange function for the SelectControl. * * @return {JSX.Element} The control group. */ function GroupEditControls({ tagName, onSelectTagName }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), options: [{ label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), value: 'div' }, { label: '<header>', value: 'header' }, { label: '<main>', value: 'main' }, { label: '<section>', value: 'section' }, { label: '<article>', value: 'article' }, { label: '<aside>', value: 'aside' }, { label: '<footer>', value: 'footer' }], value: tagName, onChange: onSelectTagName, help: htmlElementMessages[tagName] }) }); } function GroupEdit({ attributes, name, setAttributes, clientId }) { const { hasInnerBlocks, themeSupportsLayout } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlock, getSettings } = select(external_wp_blockEditor_namespaceObject.store); const block = getBlock(clientId); return { hasInnerBlocks: !!(block && block.innerBlocks.length), themeSupportsLayout: getSettings()?.supportsLayout }; }, [clientId]); const { tagName: TagName = 'div', templateLock, allowedBlocks, layout = {} } = attributes; // Layout settings. const { type = 'default' } = layout; const layoutSupportEnabled = themeSupportsLayout || type === 'flex' || type === 'grid'; // Hooks. const ref = (0,external_wp_element_namespaceObject.useRef)(); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref }); const [showPlaceholder, setShowPlaceholder] = useShouldShowPlaceHolder({ attributes, usedLayoutType: type, hasInnerBlocks }); // Default to the regular appender being rendered. let renderAppender; if (showPlaceholder) { // In the placeholder state, ensure the appender is not rendered. // This is needed because `...innerBlocksProps` is used in the placeholder // state so that blocks can dragged onto the placeholder area // from both the list view and in the editor canvas. renderAppender = false; } else if (!hasInnerBlocks) { // When there is no placeholder, but the block is also empty, // use the larger button appender. renderAppender = external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender; } const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(layoutSupportEnabled ? blockProps : { className: 'wp-block-group__inner-container' }, { dropZoneElement: ref.current, templateLock, allowedBlocks, renderAppender }); const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const selectVariation = nextVariation => { setAttributes(nextVariation.attributes); selectBlock(clientId, -1); setShowPlaceholder(false); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(GroupEditControls, { tagName: TagName, onSelectTagName: value => setAttributes({ tagName: value }) }), showPlaceholder && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.View, { children: [innerBlocksProps.children, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(placeholder, { name: name, onSelect: selectVariation })] }), layoutSupportEnabled && !showPlaceholder && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...innerBlocksProps }), !layoutSupportEnabled && !showPlaceholder && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }) })] }); } /* harmony default export */ const group_edit = (GroupEdit); ;// ./node_modules/@wordpress/block-library/build-module/group/save.js /** * WordPress dependencies */ function group_save_save({ attributes: { tagName: Tag } }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(external_wp_blockEditor_namespaceObject.useBlockProps.save()) }); } ;// ./node_modules/@wordpress/block-library/build-module/group/transforms.js /** * WordPress dependencies */ const group_transforms_transforms = { from: [{ type: 'block', isMultiBlock: true, blocks: ['*'], __experimentalConvert(blocks) { const alignments = ['wide', 'full']; // Determine the widest setting of all the blocks to be grouped const widestAlignment = blocks.reduce((accumulator, block) => { const { align } = block.attributes; return alignments.indexOf(align) > alignments.indexOf(accumulator) ? align : accumulator; }, undefined); // Clone the Blocks to be Grouped // Failing to create new block references causes the original blocks // to be replaced in the switchToBlockType call thereby meaning they // are removed both from their original location and within the // new group block. const groupInnerBlocks = blocks.map(block => { return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks); }); return (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { align: widestAlignment, layout: { type: 'constrained' } }, groupInnerBlocks); } }] }; /* harmony default export */ const group_transforms = (group_transforms_transforms); ;// ./node_modules/@wordpress/icons/build-module/library/row.js /** * WordPress dependencies */ const row = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z" }) }); /* harmony default export */ const library_row = (row); ;// ./node_modules/@wordpress/icons/build-module/library/stack.js /** * WordPress dependencies */ const stack = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z" }) }); /* harmony default export */ const library_stack = (stack); ;// ./node_modules/@wordpress/icons/build-module/library/grid.js /** * WordPress dependencies */ const grid = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z", fillRule: "evenodd", clipRule: "evenodd" }) }); /* harmony default export */ const library_grid = (grid); ;// ./node_modules/@wordpress/block-library/build-module/group/variations.js /** * WordPress dependencies */ const example = { innerBlocks: [{ name: 'core/paragraph', attributes: { customTextColor: '#cf2e2e', fontSize: 'large', content: (0,external_wp_i18n_namespaceObject.__)('One.') } }, { name: 'core/paragraph', attributes: { customTextColor: '#ff6900', fontSize: 'large', content: (0,external_wp_i18n_namespaceObject.__)('Two.') } }, { name: 'core/paragraph', attributes: { customTextColor: '#fcb900', fontSize: 'large', content: (0,external_wp_i18n_namespaceObject.__)('Three.') } }, { name: 'core/paragraph', attributes: { customTextColor: '#00d084', fontSize: 'large', content: (0,external_wp_i18n_namespaceObject.__)('Four.') } }, { name: 'core/paragraph', attributes: { customTextColor: '#0693e3', fontSize: 'large', content: (0,external_wp_i18n_namespaceObject.__)('Five.') } }, { name: 'core/paragraph', attributes: { customTextColor: '#9b51e0', fontSize: 'large', content: (0,external_wp_i18n_namespaceObject.__)('Six.') } }] }; const group_variations_variations = [{ name: 'group', title: (0,external_wp_i18n_namespaceObject.__)('Group'), description: (0,external_wp_i18n_namespaceObject.__)('Gather blocks in a container.'), attributes: { layout: { type: 'constrained' } }, isDefault: true, scope: ['block', 'inserter', 'transform'], isActive: blockAttributes => !blockAttributes.layout || !blockAttributes.layout?.type || blockAttributes.layout?.type === 'default' || blockAttributes.layout?.type === 'constrained', icon: library_group }, { name: 'group-row', title: (0,external_wp_i18n_namespaceObject._x)('Row', 'single horizontal line'), description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks horizontally.'), attributes: { layout: { type: 'flex', flexWrap: 'nowrap' } }, scope: ['block', 'inserter', 'transform'], isActive: blockAttributes => blockAttributes.layout?.type === 'flex' && (!blockAttributes.layout?.orientation || blockAttributes.layout?.orientation === 'horizontal'), icon: library_row, example }, { name: 'group-stack', title: (0,external_wp_i18n_namespaceObject.__)('Stack'), description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks vertically.'), attributes: { layout: { type: 'flex', orientation: 'vertical' } }, scope: ['block', 'inserter', 'transform'], isActive: blockAttributes => blockAttributes.layout?.type === 'flex' && blockAttributes.layout?.orientation === 'vertical', icon: library_stack, example }, { name: 'group-grid', title: (0,external_wp_i18n_namespaceObject.__)('Grid'), description: (0,external_wp_i18n_namespaceObject.__)('Arrange blocks in a grid.'), attributes: { layout: { type: 'grid' } }, scope: ['block', 'inserter', 'transform'], isActive: blockAttributes => blockAttributes.layout?.type === 'grid', icon: library_grid, example }]; /* harmony default export */ const group_variations = (group_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/group/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const group_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/group", title: "Group", category: "design", description: "Gather blocks in a layout container.", keywords: ["container", "wrapper", "row", "section"], textdomain: "default", attributes: { tagName: { type: "string", "default": "div" }, templateLock: { type: ["string", "boolean"], "enum": ["all", "insert", "contentOnly", false] }, allowedBlocks: { type: "array" } }, supports: { __experimentalOnEnter: true, __experimentalOnMerge: true, __experimentalSettings: true, align: ["wide", "full"], anchor: true, ariaLabel: true, html: false, background: { backgroundImage: true, backgroundSize: true, __experimentalDefaultControls: { backgroundImage: true } }, color: { gradients: true, heading: true, button: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, shadow: true, spacing: { margin: ["top", "bottom"], padding: true, blockGap: true, __experimentalDefaultControls: { padding: true, blockGap: true } }, dimensions: { minHeight: true }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, position: { sticky: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, layout: { allowSizingOnChildren: true }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-group-editor", style: "wp-block-group" }; const { name: group_name } = group_metadata; const group_settings = { icon: library_group, example: { attributes: { layout: { type: 'constrained', justifyContent: 'center' }, style: { spacing: { padding: { top: '4em', right: '3em', bottom: '4em', left: '3em' } } } }, innerBlocks: [{ name: 'core/heading', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('La Mancha'), textAlign: 'center' } }, { name: 'core/paragraph', attributes: { align: 'center', content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.') } }, { name: 'core/spacer', attributes: { height: '10px' } }, { name: 'core/button', attributes: { text: (0,external_wp_i18n_namespaceObject.__)('Read more') } }], viewportWidth: 600 }, transforms: group_transforms, edit: group_edit, save: group_save_save, deprecated: group_deprecated, variations: group_variations }; const group_init = () => initBlock({ name: group_name, metadata: group_metadata, settings: group_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/heading.js /** * WordPress dependencies */ const heading = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6 5V18.5911L12 13.8473L18 18.5911V5H6Z" }) }); /* harmony default export */ const library_heading = (heading); ;// ./node_modules/@wordpress/block-library/build-module/heading/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ const blockSupports = { className: false, anchor: true }; const heading_deprecated_blockAttributes = { align: { type: 'string' }, content: { type: 'string', source: 'html', selector: 'h1,h2,h3,h4,h5,h6', default: '' }, level: { type: 'number', default: 2 }, placeholder: { type: 'string' } }; const deprecated_migrateCustomColors = attributes => { if (!attributes.customTextColor) { return attributes; } const style = { color: { text: attributes.customTextColor } }; const { customTextColor, ...restAttributes } = attributes; return { ...restAttributes, style }; }; const TEXT_ALIGN_OPTIONS = ['left', 'right', 'center']; const migrateTextAlign = attributes => { const { align, ...rest } = attributes; return TEXT_ALIGN_OPTIONS.includes(align) ? { ...rest, textAlign: align } : attributes; }; const heading_deprecated_v1 = { supports: blockSupports, attributes: { ...heading_deprecated_blockAttributes, customTextColor: { type: 'string' }, textColor: { type: 'string' } }, migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)), save({ attributes }) { const { align, level, content, textColor, customTextColor } = attributes; const tagName = 'h' + level; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const className = dist_clsx({ [textClass]: textClass }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: className ? className : undefined, tagName: tagName, style: { textAlign: align, color: textClass ? undefined : customTextColor }, value: content }); } }; const heading_deprecated_v2 = { attributes: { ...heading_deprecated_blockAttributes, customTextColor: { type: 'string' }, textColor: { type: 'string' } }, migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)), save({ attributes }) { const { align, content, customTextColor, level, textColor } = attributes; const tagName = 'h' + level; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const className = dist_clsx({ [textClass]: textClass, [`has-text-align-${align}`]: align }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: className ? className : undefined, tagName: tagName, style: { color: textClass ? undefined : customTextColor }, value: content }); }, supports: blockSupports }; const heading_deprecated_v3 = { supports: blockSupports, attributes: { ...heading_deprecated_blockAttributes, customTextColor: { type: 'string' }, textColor: { type: 'string' } }, migrate: attributes => deprecated_migrateCustomColors(migrateTextAlign(attributes)), save({ attributes }) { const { align, content, customTextColor, level, textColor } = attributes; const tagName = 'h' + level; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const className = dist_clsx({ [textClass]: textClass, 'has-text-color': textColor || customTextColor, [`has-text-align-${align}`]: align }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: className ? className : undefined, tagName: tagName, style: { color: textClass ? undefined : customTextColor }, value: content }); } }; const heading_deprecated_v4 = { supports: { align: ['wide', 'full'], anchor: true, className: false, color: { link: true }, fontSize: true, lineHeight: true, __experimentalSelector: { 'core/heading/h1': 'h1', 'core/heading/h2': 'h2', 'core/heading/h3': 'h3', 'core/heading/h4': 'h4', 'core/heading/h5': 'h5', 'core/heading/h6': 'h6' }, __unstablePasteTextInline: true }, attributes: heading_deprecated_blockAttributes, isEligible: ({ align }) => TEXT_ALIGN_OPTIONS.includes(align), migrate: migrateTextAlign, save({ attributes }) { const { align, content, level } = attributes; const TagName = 'h' + level; const className = dist_clsx({ [`has-text-align-${align}`]: align }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: content }) }); } }; // This deprecation covers the serialization of the `wp-block-heading` class // into the block's markup after className support was enabled. const heading_deprecated_v5 = { supports: { align: ['wide', 'full'], anchor: true, className: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalDefaultControls: { fontSize: true, fontAppearance: true, textTransform: true } }, __experimentalSelector: 'h1,h2,h3,h4,h5,h6', __unstablePasteTextInline: true, __experimentalSlashInserter: true }, attributes: { textAlign: { type: 'string' }, content: { type: 'string', source: 'html', selector: 'h1,h2,h3,h4,h5,h6', default: '', role: 'content' }, level: { type: 'number', default: 2 }, placeholder: { type: 'string' } }, save({ attributes }) { const { textAlign, content, level } = attributes; const TagName = 'h' + level; const className = dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: content }) }); } }; const heading_deprecated_deprecated = [heading_deprecated_v5, heading_deprecated_v4, heading_deprecated_v3, heading_deprecated_v2, heading_deprecated_v1]; /* harmony default export */ const heading_deprecated = (heading_deprecated_deprecated); ;// ./node_modules/@wordpress/block-library/build-module/heading/autogenerate-anchors.js /** * External dependencies */ /** * Object map tracking anchors. * * @type {Record<string, string | null>} */ const autogenerate_anchors_anchors = {}; /** * Returns the text without markup. * * @param {string} text The text. * * @return {string} The text without markup. */ const getTextWithoutMarkup = text => { const dummyElement = document.createElement('div'); dummyElement.innerHTML = text; return dummyElement.innerText; }; /** * Get the slug from the content. * * @param {string} content The block content. * * @return {string} Returns the slug. */ const getSlug = content => { // Get the slug. return remove_accents_default()(getTextWithoutMarkup(content)) // Convert anything that's not a letter or number to a hyphen. .replace(/[^\p{L}\p{N}]+/gu, '-') // Convert to lowercase .toLowerCase() // Remove any remaining leading or trailing hyphens. .replace(/(^-+)|(-+$)/g, ''); }; /** * Generate the anchor for a heading. * * @param {string} clientId The block ID. * @param {string} content The block content. * * @return {string|null} Return the heading anchor. */ const generateAnchor = (clientId, content) => { const slug = getSlug(content); // If slug is empty, then return null. // Returning null instead of an empty string allows us to check again when the content changes. if ('' === slug) { return null; } delete autogenerate_anchors_anchors[clientId]; let anchor = slug; let i = 0; // If the anchor already exists in another heading, append -i. while (Object.values(autogenerate_anchors_anchors).includes(anchor)) { i += 1; anchor = slug + '-' + i; } return anchor; }; /** * Set the anchor for a heading. * * @param {string} clientId The block ID. * @param {string|null} anchor The block anchor. */ const setAnchor = (clientId, anchor) => { autogenerate_anchors_anchors[clientId] = anchor; }; ;// ./node_modules/@wordpress/block-library/build-module/heading/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function HeadingEdit({ attributes, setAttributes, mergeBlocks, onReplace, style, clientId }) { const { textAlign, content, level, levelOptions, placeholder, anchor } = attributes; const tagName = 'h' + level; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }), style }); const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); const { canGenerateAnchors } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getGlobalBlockCount, getSettings } = select(external_wp_blockEditor_namespaceObject.store); const settings = getSettings(); return { canGenerateAnchors: !!settings.generateAnchors || getGlobalBlockCount('core/table-of-contents') > 0 }; }, []); const { __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Initially set anchor for headings that have content but no anchor set. // This is used when transforming a block to heading, or for legacy anchors. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!canGenerateAnchors) { return; } if (!anchor && content) { // This side-effect should not create an undo level. __unstableMarkNextChangeAsNotPersistent(); setAttributes({ anchor: generateAnchor(clientId, content) }); } setAnchor(clientId, anchor); // Remove anchor map when block unmounts. return () => setAnchor(clientId, null); }, [anchor, content, clientId, canGenerateAnchors]); const onContentChange = value => { const newAttrs = { content: value }; if (canGenerateAnchors && (!anchor || !value || generateAnchor(clientId, content) === anchor)) { newAttrs.anchor = generateAnchor(clientId, value); } setAttributes(newAttrs); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { value: level, options: levelOptions, onChange: newLevel => setAttributes({ level: newLevel }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "content", tagName: tagName, value: content, onChange: onContentChange, onMerge: mergeBlocks, onReplace: onReplace, onRemove: () => onReplace([]), placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Heading'), textAlign: textAlign, ...(external_wp_element_namespaceObject.Platform.isNative && { deleteEnter: true }), ...blockProps })] }); } /* harmony default export */ const heading_edit = (HeadingEdit); ;// ./node_modules/@wordpress/block-library/build-module/heading/save.js /** * External dependencies */ /** * WordPress dependencies */ function heading_save_save({ attributes }) { const { textAlign, content, level } = attributes; const TagName = 'h' + level; const className = dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: content }) }); } ;// ./node_modules/@wordpress/block-library/build-module/heading/shared.js /** * Given a node name string for a heading node, returns its numeric level. * * @param {string} nodeName Heading node name. * * @return {number} Heading level. */ function getLevelFromHeadingNodeName(nodeName) { return Number(nodeName.substr(1)); } ;// ./node_modules/@wordpress/block-library/build-module/heading/transforms.js /** * WordPress dependencies */ /** * Internal dependencies */ const heading_transforms_transforms = { from: [{ type: 'block', isMultiBlock: true, blocks: ['core/paragraph'], transform: attributes => attributes.map(({ content, anchor, align: textAlign, metadata }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { content, anchor, textAlign, metadata: getTransformedMetadata(metadata, 'core/heading', ({ content: contentBinding }) => ({ content: contentBinding })) })) }, { type: 'raw', selector: 'h1,h2,h3,h4,h5,h6', schema: ({ phrasingContentSchema, isPaste }) => { const schema = { children: phrasingContentSchema, attributes: isPaste ? [] : ['style', 'id'] }; return { h1: schema, h2: schema, h3: schema, h4: schema, h5: schema, h6: schema }; }, transform(node) { const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/heading', node.outerHTML); const { textAlign } = node.style || {}; attributes.level = getLevelFromHeadingNodeName(node.nodeName); if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') { attributes.align = textAlign; } return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', attributes); } }, ...[1, 2, 3, 4, 5, 6].map(level => ({ type: 'prefix', prefix: Array(level + 1).join('#'), transform(content) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { level, content }); } })), ...[1, 2, 3, 4, 5, 6].map(level => ({ type: 'enter', regExp: new RegExp(`^/(h|H)${level}$`), transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { level }) }))], to: [{ type: 'block', isMultiBlock: true, blocks: ['core/paragraph'], transform: attributes => attributes.map(({ content, textAlign: align, metadata }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content, align, metadata: getTransformedMetadata(metadata, 'core/paragraph', ({ content: contentBinding }) => ({ content: contentBinding })) })) }] }; /* harmony default export */ const heading_transforms = (heading_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/heading/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const heading_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/heading", title: "Heading", category: "text", description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.", keywords: ["title", "subtitle"], textdomain: "default", attributes: { textAlign: { type: "string" }, content: { type: "rich-text", source: "rich-text", selector: "h1,h2,h3,h4,h5,h6", role: "content" }, level: { type: "number", "default": 2 }, levelOptions: { type: "array" }, placeholder: { type: "string" } }, supports: { align: ["wide", "full"], anchor: true, className: true, splitting: true, __experimentalBorder: { color: true, radius: true, style: true, width: true }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalWritingMode: true, __experimentalDefaultControls: { fontSize: true } }, __unstablePasteTextInline: true, __experimentalSlashInserter: true, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-heading-editor", style: "wp-block-heading" }; const { name: heading_name } = heading_metadata; const heading_settings = { icon: library_heading, example: { attributes: { content: (0,external_wp_i18n_namespaceObject.__)('Code is Poetry'), level: 2, textAlign: 'center' } }, __experimentalLabel(attributes, { context }) { const { content, level } = attributes; const customName = attributes?.metadata?.name; const hasContent = content?.trim().length > 0; // In the list view, use the block's content as the label. // If the content is empty, fall back to the default label. if (context === 'list-view' && (customName || hasContent)) { return customName || content; } if (context === 'accessibility') { return !hasContent ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: accessibility text. %s: heading level. */ (0,external_wp_i18n_namespaceObject.__)('Level %s. Empty.'), level) : (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: accessibility text. 1: heading level. 2: heading content. */ (0,external_wp_i18n_namespaceObject.__)('Level %1$s. %2$s'), level, content); } }, transforms: heading_transforms, deprecated: heading_deprecated, merge(attributes, attributesToMerge) { return { content: (attributes.content || '') + (attributesToMerge.content || '') }; }, edit: heading_edit, save: heading_save_save }; const heading_init = () => initBlock({ name: heading_name, metadata: heading_metadata, settings: heading_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/home.js /** * WordPress dependencies */ const home = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" }) }); /* harmony default export */ const library_home = (home); ;// ./node_modules/@wordpress/block-library/build-module/home-link/edit.js /** * External dependencies */ /** * WordPress dependencies */ const preventDefault = event => event.preventDefault(); function HomeEdit({ attributes, setAttributes, context }) { var _attributes$label; const homeUrl = (0,external_wp_data_namespaceObject.useSelect)(select => { // Site index. return select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase')?.home; }, []); const { textColor, backgroundColor, style } = context; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx('wp-block-navigation-item', { 'has-text-color': !!textColor || !!style?.color?.text, [`has-${textColor}-color`]: !!textColor, 'has-background': !!backgroundColor || !!style?.color?.background, [`has-${backgroundColor}-background-color`]: !!backgroundColor }), style: { color: style?.color?.text, backgroundColor: style?.color?.background } }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: "wp-block-home-link__content wp-block-navigation-item__content", href: homeUrl, onClick: preventDefault, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "label", className: "wp-block-home-link__label", value: (_attributes$label = attributes.label) !== null && _attributes$label !== void 0 ? _attributes$label : (0,external_wp_i18n_namespaceObject.__)('Home'), onChange: labelValue => { setAttributes({ label: labelValue }); }, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Home link text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Add home link'), withoutInteractiveFormatting: true }) }) }); } ;// ./node_modules/@wordpress/block-library/build-module/home-link/save.js /** * WordPress dependencies */ function home_link_save_save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } ;// ./node_modules/@wordpress/block-library/build-module/home-link/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const home_link_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/home-link", category: "design", parent: ["core/navigation"], title: "Home Link", description: "Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.", textdomain: "default", attributes: { label: { type: "string" } }, usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "fontSize", "customFontSize", "style"], supports: { reusable: false, html: false, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-home-link-editor", style: "wp-block-home-link" }; const { name: home_link_name } = home_link_metadata; const home_link_settings = { icon: library_home, edit: HomeEdit, save: home_link_save_save, example: { attributes: { label: (0,external_wp_i18n_namespaceObject._x)('Home Link', 'block example') } } }; const home_link_init = () => initBlock({ name: home_link_name, metadata: home_link_metadata, settings: home_link_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/html.js /** * WordPress dependencies */ const html = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z" }) }); /* harmony default export */ const library_html = (html); ;// ./node_modules/@wordpress/block-library/build-module/html/preview.js /** * WordPress dependencies */ // Default styles used to unset some of the styles // that might be inherited from the editor style. const DEFAULT_STYLES = ` html,body,:root { margin: 0 !important; padding: 0 !important; overflow: visible !important; min-height: auto !important; } `; function HTMLEditPreview({ content, isSelected }) { const settingStyles = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().styles, []); const styles = (0,external_wp_element_namespaceObject.useMemo)(() => [DEFAULT_STYLES, ...(0,external_wp_blockEditor_namespaceObject.transformStyles)((settingStyles !== null && settingStyles !== void 0 ? settingStyles : []).filter(style => style.css))], [settingStyles]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SandBox, { html: content, styles: styles, title: (0,external_wp_i18n_namespaceObject.__)('Custom HTML Preview'), tabIndex: -1 }), !isSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-library-html__preview-overlay" })] }); } ;// ./node_modules/@wordpress/block-library/build-module/html/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ function HTMLEdit({ attributes, setAttributes, isSelected }) { const [isPreview, setIsPreview] = (0,external_wp_element_namespaceObject.useState)(); const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(HTMLEdit, 'html-edit-desc'); const isPreviewMode = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_blockEditor_namespaceObject.store).getSettings().isPreviewMode; }, []); function switchToPreview() { setIsPreview(true); } function switchToHTML() { setIsPreview(false); } const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: 'block-library-html__edit', 'aria-describedby': isPreview ? instanceId : undefined }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { isPressed: !isPreview, onClick: switchToHTML, children: "HTML" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { isPressed: isPreview, onClick: switchToPreview, children: (0,external_wp_i18n_namespaceObject.__)('Preview') })] }) }), isPreview || isPreviewMode || isDisabled ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(HTMLEditPreview, { content: attributes.content, isSelected: isSelected }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: instanceId, children: (0,external_wp_i18n_namespaceObject.__)('HTML preview is not yet fully accessible. Please switch screen reader to virtualized mode to navigate the below iFrame.') })] }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { value: attributes.content, onChange: content => setAttributes({ content }), placeholder: (0,external_wp_i18n_namespaceObject.__)('Write HTML…'), "aria-label": (0,external_wp_i18n_namespaceObject.__)('HTML') })] }); } ;// ./node_modules/@wordpress/block-library/build-module/html/save.js /** * WordPress dependencies */ function html_save_save({ attributes }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: attributes.content }); } ;// ./node_modules/@wordpress/block-library/build-module/html/transforms.js /** * WordPress dependencies */ const html_transforms_transforms = { from: [{ type: 'block', blocks: ['core/code'], transform: ({ content: html }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/html', { // The code block may output HTML formatting, so convert it // to plain text. content: (0,external_wp_richText_namespaceObject.create)({ html }).text }); } }] }; /* harmony default export */ const html_transforms = (html_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/html/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const html_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/html", title: "Custom HTML", category: "widgets", description: "Add custom HTML code and preview it as you edit.", keywords: ["embed"], textdomain: "default", attributes: { content: { type: "string", source: "raw" } }, supports: { customClassName: false, className: false, html: false, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-html-editor" }; const { name: html_name } = html_metadata; const html_settings = { icon: library_html, example: { attributes: { content: '<marquee>' + (0,external_wp_i18n_namespaceObject.__)('Welcome to the wonderful world of blocks…') + '</marquee>' } }, edit: HTMLEdit, save: html_save_save, transforms: html_transforms }; const html_init = () => initBlock({ name: html_name, metadata: html_metadata, settings: html_settings }); ;// ./node_modules/@wordpress/block-library/build-module/image/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * Deprecation for adding the `wp-image-${id}` class to the image block for * responsive images. * * @see https://github.com/WordPress/gutenberg/pull/4898 */ const image_deprecated_v1 = { attributes: { url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, caption: { type: 'array', source: 'children', selector: 'figcaption' }, href: { type: 'string', source: 'attribute', selector: 'a', attribute: 'href' }, id: { type: 'number' }, align: { type: 'string' }, width: { type: 'number' }, height: { type: 'number' } }, save({ attributes }) { const { url, alt, caption, align, href, width, height } = attributes; const extraImageProps = width || height ? { width, height } : {}; const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: url, alt: alt, ...extraImageProps }); let figureStyle = {}; if (width) { figureStyle = { width }; } else if (align === 'left' || align === 'right') { figureStyle = { maxWidth: '50%' }; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { className: align ? `align${align}` : null, style: figureStyle, children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, children: image }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); } }; /** * Deprecation for adding the `is-resized` class to the image block to fix * captions on resized images. * * @see https://github.com/WordPress/gutenberg/pull/6496 */ const image_deprecated_v2 = { attributes: { url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, caption: { type: 'array', source: 'children', selector: 'figcaption' }, href: { type: 'string', source: 'attribute', selector: 'a', attribute: 'href' }, id: { type: 'number' }, align: { type: 'string' }, width: { type: 'number' }, height: { type: 'number' } }, save({ attributes }) { const { url, alt, caption, align, href, width, height, id } = attributes; const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: url, alt: alt, className: id ? `wp-image-${id}` : null, width: width, height: height }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { className: align ? `align${align}` : null, children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, children: image }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); } }; /** * Deprecation for image floats including a wrapping div. * * @see https://github.com/WordPress/gutenberg/pull/7721 */ const image_deprecated_v3 = { attributes: { url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, caption: { type: 'array', source: 'children', selector: 'figcaption' }, href: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'href' }, id: { type: 'number' }, align: { type: 'string' }, width: { type: 'number' }, height: { type: 'number' }, linkDestination: { type: 'string', default: 'none' } }, save({ attributes }) { const { url, alt, caption, align, href, width, height, id } = attributes; const classes = dist_clsx({ [`align${align}`]: align, 'is-resized': width || height }); const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: url, alt: alt, className: id ? `wp-image-${id}` : null, width: width, height: height }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { className: classes, children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, children: image }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); } }; /** * Deprecation for removing the outer div wrapper around aligned images. * * @see https://github.com/WordPress/gutenberg/pull/38657 */ const image_deprecated_v4 = { attributes: { align: { type: 'string' }, url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, caption: { type: 'string', source: 'html', selector: 'figcaption' }, title: { type: 'string', source: 'attribute', selector: 'img', attribute: 'title' }, href: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'href' }, rel: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'rel' }, linkClass: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'class' }, id: { type: 'number' }, width: { type: 'number' }, height: { type: 'number' }, sizeSlug: { type: 'string' }, linkDestination: { type: 'string' }, linkTarget: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'target' } }, supports: { anchor: true }, save({ attributes }) { const { url, alt, caption, align, href, rel, linkClass, width, height, id, linkTarget, sizeSlug, title } = attributes; const newRel = !rel ? undefined : rel; const classes = dist_clsx({ [`align${align}`]: align, [`size-${sizeSlug}`]: sizeSlug, 'is-resized': width || height }); const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: url, alt: alt, className: id ? `wp-image-${id}` : null, width: width, height: height, title: title }); const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); if ('left' === align || 'right' === align || 'center' === align) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: classes, children: figure }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes }), children: figure }); } }; /** * Deprecation for moving existing border radius styles onto the inner img * element where new border block support styles must be applied. * It will also add a new `.has-custom-border` class for existing blocks * with border radii set. This class is required to improve caption position * and styling when an image within a gallery has a custom border or * rounded corners. * * @see https://github.com/WordPress/gutenberg/pull/31366 */ const image_deprecated_v5 = { attributes: { align: { type: 'string' }, url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '' }, caption: { type: 'string', source: 'html', selector: 'figcaption' }, title: { type: 'string', source: 'attribute', selector: 'img', attribute: 'title' }, href: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'href' }, rel: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'rel' }, linkClass: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'class' }, id: { type: 'number' }, width: { type: 'number' }, height: { type: 'number' }, sizeSlug: { type: 'string' }, linkDestination: { type: 'string' }, linkTarget: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'target' } }, supports: { anchor: true, color: { __experimentalDuotone: 'img', text: false, background: false }, __experimentalBorder: { radius: true, __experimentalDefaultControls: { radius: true } }, __experimentalStyle: { spacing: { margin: '0 0 1em 0' } } }, save({ attributes }) { const { url, alt, caption, align, href, rel, linkClass, width, height, id, linkTarget, sizeSlug, title } = attributes; const newRel = !rel ? undefined : rel; const classes = dist_clsx({ [`align${align}`]: align, [`size-${sizeSlug}`]: sizeSlug, 'is-resized': width || height }); const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: url, alt: alt, className: id ? `wp-image-${id}` : null, width: width, height: height, title: title }); const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes }), children: figure }); } }; /** * Deprecation for adding width and height as style rules on the inner img. * * @see https://github.com/WordPress/gutenberg/pull/31366 */ const image_deprecated_v6 = { attributes: { align: { type: 'string' }, url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src', role: 'content' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '', role: 'content' }, caption: { type: 'string', source: 'html', selector: 'figcaption', role: 'content' }, title: { type: 'string', source: 'attribute', selector: 'img', attribute: 'title', role: 'content' }, href: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'href', role: 'content' }, rel: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'rel' }, linkClass: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'class' }, id: { type: 'number', role: 'content' }, width: { type: 'number' }, height: { type: 'number' }, aspectRatio: { type: 'string' }, scale: { type: 'string' }, sizeSlug: { type: 'string' }, linkDestination: { type: 'string' }, linkTarget: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'target' } }, supports: { anchor: true, color: { text: false, background: false }, filter: { duotone: true }, __experimentalBorder: { color: true, radius: true, width: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { color: true, radius: true, width: true } } }, migrate(attributes) { const { height, width } = attributes; return { ...attributes, width: typeof width === 'number' ? `${width}px` : width, height: typeof height === 'number' ? `${height}px` : height }; }, save({ attributes }) { const { url, alt, caption, align, href, rel, linkClass, width, height, aspectRatio, scale, id, linkTarget, sizeSlug, title } = attributes; const newRel = !rel ? undefined : rel; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const classes = dist_clsx({ [`align${align}`]: align, [`size-${sizeSlug}`]: sizeSlug, 'is-resized': width || height, 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 }); const imageClasses = dist_clsx(borderProps.className, { [`wp-image-${id}`]: !!id }); const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: url, alt: alt, className: imageClasses || undefined, style: { ...borderProps.style, aspectRatio, objectFit: scale }, width: width, height: height, title: title }); const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), tagName: "figcaption", value: caption })] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes }), children: figure }); } }; /** * Deprecation for converting to string width and height block attributes and * removing the width and height img element attributes which are not needed * as they get added by the TODO hook. * * @see https://github.com/WordPress/gutenberg/pull/53274 */ const image_deprecated_v7 = { attributes: { align: { type: 'string' }, url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src', role: 'content' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '', role: 'content' }, caption: { type: 'string', source: 'html', selector: 'figcaption', role: 'content' }, title: { type: 'string', source: 'attribute', selector: 'img', attribute: 'title', role: 'content' }, href: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'href', role: 'content' }, rel: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'rel' }, linkClass: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'class' }, id: { type: 'number', role: 'content' }, width: { type: 'number' }, height: { type: 'number' }, aspectRatio: { type: 'string' }, scale: { type: 'string' }, sizeSlug: { type: 'string' }, linkDestination: { type: 'string' }, linkTarget: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'target' } }, supports: { anchor: true, color: { text: false, background: false }, filter: { duotone: true }, __experimentalBorder: { color: true, radius: true, width: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { color: true, radius: true, width: true } } }, migrate({ width, height, ...attributes }) { return { ...attributes, width: `${width}px`, height: `${height}px` }; }, save({ attributes }) { const { url, alt, caption, align, href, rel, linkClass, width, height, aspectRatio, scale, id, linkTarget, sizeSlug, title } = attributes; const newRel = !rel ? undefined : rel; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const classes = dist_clsx({ [`align${align}`]: align, [`size-${sizeSlug}`]: sizeSlug, 'is-resized': width || height, 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 }); const imageClasses = dist_clsx(borderProps.className, { [`wp-image-${id}`]: !!id }); const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: url, alt: alt, className: imageClasses || undefined, style: { ...borderProps.style, aspectRatio, objectFit: scale, width, height }, width: width, height: height, title: title }); const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), tagName: "figcaption", value: caption })] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes }), children: figure }); } }; const deprecated_v8 = { attributes: { align: { type: 'string' }, behaviors: { type: 'object' }, url: { type: 'string', source: 'attribute', selector: 'img', attribute: 'src', role: 'content' }, alt: { type: 'string', source: 'attribute', selector: 'img', attribute: 'alt', default: '', role: 'content' }, caption: { type: 'string', source: 'html', selector: 'figcaption', role: 'content' }, title: { type: 'string', source: 'attribute', selector: 'img', attribute: 'title', role: 'content' }, href: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'href', role: 'content' }, rel: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'rel' }, linkClass: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'class' }, id: { type: 'number', role: 'content' }, width: { type: 'string' }, height: { type: 'string' }, aspectRatio: { type: 'string' }, scale: { type: 'string' }, sizeSlug: { type: 'string' }, linkDestination: { type: 'string' }, linkTarget: { type: 'string', source: 'attribute', selector: 'figure > a', attribute: 'target' } }, supports: { anchor: true, color: { text: false, background: false }, filter: { duotone: true }, __experimentalBorder: { color: true, radius: true, width: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { color: true, radius: true, width: true } } }, migrate({ width, height, ...attributes }) { // We need to perform a check here because in cases // where attributes are added dynamically to blocks, // block invalidation overrides the isEligible() method // and forces the migration to run, so it's not guaranteed // that `behaviors` or `behaviors.lightbox` will be defined. if (!attributes.behaviors?.lightbox) { return attributes; } const { behaviors: { lightbox: { enabled } } } = attributes; const newAttributes = { ...attributes, lightbox: { enabled } }; delete newAttributes.behaviors; return newAttributes; }, isEligible(attributes) { return !!attributes.behaviors; }, save({ attributes }) { const { url, alt, caption, align, href, rel, linkClass, width, height, aspectRatio, scale, id, linkTarget, sizeSlug, title } = attributes; const newRel = !rel ? undefined : rel; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const classes = dist_clsx({ [`align${align}`]: align, [`size-${sizeSlug}`]: sizeSlug, 'is-resized': width || height, 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 }); const imageClasses = dist_clsx(borderProps.className, { [`wp-image-${id}`]: !!id }); const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: url, alt: alt, className: imageClasses || undefined, style: { ...borderProps.style, aspectRatio, objectFit: scale, width, height }, title: title }); const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), tagName: "figcaption", value: caption })] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes }), children: figure }); } }; /* harmony default export */ const image_deprecated = ([deprecated_v8, image_deprecated_v7, image_deprecated_v6, image_deprecated_v5, image_deprecated_v4, image_deprecated_v3, image_deprecated_v2, image_deprecated_v1]); ;// ./node_modules/@wordpress/icons/build-module/library/plugins.js /** * WordPress dependencies */ const plugins = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" }) }); /* harmony default export */ const library_plugins = (plugins); ;// ./node_modules/@wordpress/icons/build-module/library/chevron-down.js /** * WordPress dependencies */ const chevronDown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) }); /* harmony default export */ const chevron_down = (chevronDown); ;// ./node_modules/@wordpress/icons/build-module/library/crop.js /** * WordPress dependencies */ const crop = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 20v-2h2v-1.5H7.75a.25.25 0 0 1-.25-.25V4H6v2H4v1.5h2v8.75c0 .966.784 1.75 1.75 1.75h8.75v2H18ZM9.273 7.5h6.977a.25.25 0 0 1 .25.25v6.977H18V7.75A1.75 1.75 0 0 0 16.25 6H9.273v1.5Z" }) }); /* harmony default export */ const library_crop = (crop); ;// ./node_modules/@wordpress/icons/build-module/library/overlay-text.js /** * WordPress dependencies */ const overlayText = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z" }) }); /* harmony default export */ const overlay_text = (overlayText); ;// ./node_modules/@wordpress/icons/build-module/library/upload.js /** * WordPress dependencies */ const upload = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" }) }); /* harmony default export */ const library_upload = (upload); ;// ./node_modules/@wordpress/block-library/build-module/image/image.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Module constants */ const { DimensionsTool, ResolutionTool: image_ResolutionTool } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const scaleOptions = [{ value: 'cover', label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for dimensions control'), help: (0,external_wp_i18n_namespaceObject.__)('Image covers the space evenly.') }, { value: 'contain', label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for dimensions control'), help: (0,external_wp_i18n_namespaceObject.__)('Image is contained without distortion.') }]; const WRITEMODE_POPOVER_PROPS = { placement: 'bottom-start' }; // If the image has a href, wrap in an <a /> tag to trigger any inherited link element styles. const ImageWrapper = ({ href, children }) => { if (!href) { return children; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: href, onClick: event => event.preventDefault(), "aria-disabled": true, style: { // When the Image block is linked, // it's wrapped with a disabled <a /> tag. // Restore cursor style so it doesn't appear 'clickable' // and remove pointer events. Safari needs the display property. pointerEvents: 'none', cursor: 'default', display: 'inline' }, children: children }); }; function ContentOnlyControls({ attributes, setAttributes, lockAltControls, lockAltControlsMessage, lockTitleControls, lockTitleControlsMessage }) { // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); const [isAltDialogOpen, setIsAltDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); const [isTitleDialogOpen, setIsTitleDialogOpen] = (0,external_wp_element_namespaceObject.useState)(false); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarItem, { ref: setPopoverAnchor, children: toggleProps => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { icon: chevron_down /* translators: button label text should, if possible, be under 16 characters. */, label: (0,external_wp_i18n_namespaceObject.__)('More'), toggleProps: { ...toggleProps, description: (0,external_wp_i18n_namespaceObject.__)('Displays more controls.') }, popoverProps: WRITEMODE_POPOVER_PROPS, children: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { setIsAltDialogOpen(true); onClose(); }, "aria-haspopup": "dialog", children: (0,external_wp_i18n_namespaceObject._x)('Alternative text', 'Alternative text for an image. Block toolbar label, a low character count is preferred.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { setIsTitleDialogOpen(true); onClose(); }, "aria-haspopup": "dialog", children: (0,external_wp_i18n_namespaceObject.__)('Title text') })] }) }) }), isAltDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { placement: "bottom-start", anchor: popoverAnchor, onClose: () => setIsAltDialogOpen(false), offset: 13, variant: "toolbar", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-image__toolbar_content_textarea__container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { className: "wp-block-image__toolbar_content_textarea", label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), value: attributes.alt || '', onChange: value => setAttributes({ alt: value }), disabled: lockAltControls, help: lockAltControls ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: lockAltControlsMessage }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. (0,external_wp_i18n_namespaceObject.__)('https://www.w3.org/WAI/tutorials/images/decision-tree/'), children: (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')] }), __nextHasNoMarginBottom: true }) }) }), isTitleDialogOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Popover, { placement: "bottom-start", anchor: popoverAnchor, onClose: () => setIsTitleDialogOpen(false), offset: 13, variant: "toolbar", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-image__toolbar_content_textarea__container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, className: "wp-block-image__toolbar_content_textarea", __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), value: attributes.title || '', onChange: value => setAttributes({ title: value }), disabled: lockTitleControls, help: lockTitleControls ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: lockTitleControlsMessage }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [(0,external_wp_i18n_namespaceObject.__)('Describe the role of this image on the page.'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute", children: (0,external_wp_i18n_namespaceObject.__)('(Note: many devices and browsers do not display this text.)') })] }) }) }) })] }); } function image_Image({ temporaryURL, attributes, setAttributes, isSingleSelected, insertBlocksAfter, onReplace, onSelectImage, onSelectURL, onUploadError, context, clientId, blockEditingMode, parentLayoutType, maxContentWidth }) { const { url = '', alt, align, id, href, rel, linkClass, linkDestination, title, width, height, aspectRatio, scale, linkTarget, sizeSlug, lightbox, metadata } = attributes; // The only supported unit is px, so we can parseInt to strip the px here. const numericWidth = width ? parseInt(width, 10) : undefined; const numericHeight = height ? parseInt(height, 10) : undefined; const imageRef = (0,external_wp_element_namespaceObject.useRef)(); const { allowResize = true } = context; const { getBlock, getSettings } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const image = (0,external_wp_data_namespaceObject.useSelect)(select => id && isSingleSelected ? select(external_wp_coreData_namespaceObject.store).getMedia(id, { context: 'view' }) : null, [id, isSingleSelected]); const { canInsertCover, imageEditing, imageSizes, maxWidth } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId, canInsertBlockType } = select(external_wp_blockEditor_namespaceObject.store); const rootClientId = getBlockRootClientId(clientId); const settings = getSettings(); return { imageEditing: settings.imageEditing, imageSizes: settings.imageSizes, maxWidth: settings.maxWidth, canInsertCover: canInsertBlockType('core/cover', rootClientId) }; }, [clientId]); const { replaceBlocks, toggleSelection } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { createErrorNotice, createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const isWideAligned = ['wide', 'full'].includes(align); const [{ loadedNaturalWidth, loadedNaturalHeight }, setLoadedNaturalSize] = (0,external_wp_element_namespaceObject.useState)({}); const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false); const [externalBlob, setExternalBlob] = (0,external_wp_element_namespaceObject.useState)(); const [hasImageErrored, setHasImageErrored] = (0,external_wp_element_namespaceObject.useState)(false); const hasNonContentControls = blockEditingMode === 'default'; const isContentOnlyMode = blockEditingMode === 'contentOnly'; const isResizable = allowResize && hasNonContentControls && !isWideAligned && isLargeViewport; const imageSizeOptions = imageSizes.filter(({ slug }) => image?.media_details?.sizes?.[slug]?.source_url).map(({ name, slug }) => ({ value: slug, label: name })); // If an image is externally hosted, try to fetch the image data. This may // fail if the image host doesn't allow CORS with the domain. If it works, // we can enable a button in the toolbar to upload the image. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isExternalImage(id, url) || !isSingleSelected || !getSettings().mediaUpload) { setExternalBlob(); return; } if (externalBlob) { return; } window // Avoid cache, which seems to help avoid CORS problems. .fetch(url.includes('?') ? url : url + '?').then(response => response.blob()).then(blob => setExternalBlob(blob)) // Do nothing, cannot upload. .catch(() => {}); }, [id, url, isSingleSelected, externalBlob]); // Get naturalWidth and naturalHeight from image ref, and fall back to loaded natural // width and height. This resolves an issue in Safari where the loaded natural // width and height is otherwise lost when switching between alignments. // See: https://github.com/WordPress/gutenberg/pull/37210. const { naturalWidth, naturalHeight } = (0,external_wp_element_namespaceObject.useMemo)(() => { return { naturalWidth: imageRef.current?.naturalWidth || loadedNaturalWidth || undefined, naturalHeight: imageRef.current?.naturalHeight || loadedNaturalHeight || undefined }; }, [loadedNaturalWidth, loadedNaturalHeight, imageRef.current?.complete]); function onResizeStart() { toggleSelection(false); } function onResizeStop() { toggleSelection(true); } function onImageError() { setHasImageErrored(true); // Check if there's an embed block that handles this URL, e.g., instagram URL. // See: https://github.com/WordPress/gutenberg/pull/11472 const embedBlock = createUpgradedEmbedBlock({ attributes: { url } }); if (undefined !== embedBlock) { onReplace(embedBlock); } } function onImageLoad(event) { setHasImageErrored(false); setLoadedNaturalSize({ loadedNaturalWidth: event.target?.naturalWidth, loadedNaturalHeight: event.target?.naturalHeight }); } function onSetHref(props) { setAttributes(props); } function onSetLightbox(enable) { if (enable && !lightboxSetting?.enabled) { setAttributes({ lightbox: { enabled: true } }); } else if (!enable && lightboxSetting?.enabled) { setAttributes({ lightbox: { enabled: false } }); } else { setAttributes({ lightbox: undefined }); } } function resetLightbox() { // When deleting a link from an image while lightbox settings // are enabled by default, we should disable the lightbox, // otherwise the resulting UX looks like a mistake. // See https://github.com/WordPress/gutenberg/pull/59890/files#r1532286123. if (lightboxSetting?.enabled && lightboxSetting?.allowEditing) { setAttributes({ lightbox: { enabled: false } }); } else { setAttributes({ lightbox: undefined }); } } function onSetTitle(value) { // This is the HTML title attribute, separate from the media object // title. setAttributes({ title: value }); } function updateAlt(newAlt) { setAttributes({ alt: newAlt }); } function updateImage(newSizeSlug) { const newUrl = image?.media_details?.sizes?.[newSizeSlug]?.source_url; if (!newUrl) { return null; } setAttributes({ url: newUrl, sizeSlug: newSizeSlug }); } function uploadExternal() { const { mediaUpload } = getSettings(); if (!mediaUpload) { return; } mediaUpload({ filesList: [externalBlob], onFileChange([img]) { onSelectImage(img); if ((0,external_wp_blob_namespaceObject.isBlobURL)(img.url)) { return; } setExternalBlob(); createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Image uploaded.'), { type: 'snackbar' }); }, allowedTypes: constants_ALLOWED_MEDIA_TYPES, onError(message) { createErrorNotice(message, { type: 'snackbar' }); } }); } (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isSingleSelected) { setIsEditingImage(false); } }, [isSingleSelected]); const canEditImage = id && naturalWidth && naturalHeight && imageEditing; const allowCrop = isSingleSelected && canEditImage && !isEditingImage && !isContentOnlyMode; function switchToCover() { replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.switchToBlockType)(getBlock(clientId), 'core/cover')); } // TODO: Can allow more units after figuring out how they should interact // with the ResizableBox and ImageEditor components. Calculations later on // for those components are currently assuming px units. const dimensionsUnitsOptions = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: ['px'] }); const [lightboxSetting] = (0,external_wp_blockEditor_namespaceObject.useSettings)('lightbox'); const showLightboxSetting = // If a block-level override is set, we should give users the option to // remove that override, even if the lightbox UI is disabled in the settings. !!lightbox && lightbox?.enabled !== lightboxSetting?.enabled || lightboxSetting?.allowEditing; const lightboxChecked = !!lightbox?.enabled || !lightbox && !!lightboxSetting?.enabled; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const dimensionsControl = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionsTool, { value: { width, height, scale, aspectRatio }, onChange: ({ width: newWidth, height: newHeight, scale: newScale, aspectRatio: newAspectRatio }) => { // Rebuilding the object forces setting `undefined` // for values that are removed since setAttributes // doesn't do anything with keys that aren't set. setAttributes({ // CSS includes `height: auto`, but we need // `width: auto` to fix the aspect ratio when // only height is set due to the width and // height attributes set via the server. width: !newWidth && newHeight ? 'auto' : newWidth, height: newHeight, scale: newScale, aspectRatio: newAspectRatio }); }, defaultScale: "cover", defaultAspectRatio: "auto", scaleOptions: scaleOptions, unitsOptions: dimensionsUnitsOptions }); const aspectRatioControl = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionsTool, { value: { aspectRatio }, onChange: ({ aspectRatio: newAspectRatio }) => { setAttributes({ aspectRatio: newAspectRatio, scale: 'cover' }); }, defaultAspectRatio: "auto", tools: ['aspectRatio'] }); const resetAll = () => { setAttributes({ alt: undefined, width: undefined, height: undefined, scale: undefined, aspectRatio: undefined, lightbox: undefined }); }; const sizeControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: resetAll, dropdownMenuProps: dropdownMenuProps, children: isResizable && (parentLayoutType === 'grid' ? aspectRatioControl : dimensionsControl) }) }); const arePatternOverridesEnabled = metadata?.bindings?.__default?.source === 'core/pattern-overrides'; const { lockUrlControls = false, lockHrefControls = false, lockAltControls = false, lockAltControlsMessage, lockTitleControls = false, lockTitleControlsMessage, lockCaption = false } = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!isSingleSelected) { return {}; } const { url: urlBinding, alt: altBinding, title: titleBinding } = metadata?.bindings || {}; const hasParentPattern = !!context['pattern/overrides']; const urlBindingSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(urlBinding?.source); const altBindingSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(altBinding?.source); const titleBindingSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(titleBinding?.source); return { lockUrlControls: !!urlBinding && !urlBindingSource?.canUserEditValue?.({ select, context, args: urlBinding?.args }), lockHrefControls: // Disable editing the link of the URL if the image is inside a pattern instance. // This is a temporary solution until we support overriding the link on the frontend. hasParentPattern || arePatternOverridesEnabled, lockCaption: // Disable editing the caption if the image is inside a pattern instance. // This is a temporary solution until we support overriding the caption on the frontend. hasParentPattern, lockAltControls: !!altBinding && !altBindingSource?.canUserEditValue?.({ select, context, args: altBinding?.args }), lockAltControlsMessage: altBindingSource?.label ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Label of the bindings source. */ (0,external_wp_i18n_namespaceObject.__)('Connected to %s'), altBindingSource.label) : (0,external_wp_i18n_namespaceObject.__)('Connected to dynamic data'), lockTitleControls: !!titleBinding && !titleBindingSource?.canUserEditValue?.({ select, context, args: titleBinding?.args }), lockTitleControlsMessage: titleBindingSource?.label ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Label of the bindings source. */ (0,external_wp_i18n_namespaceObject.__)('Connected to %s'), titleBindingSource.label) : (0,external_wp_i18n_namespaceObject.__)('Connected to dynamic data') }; }, [arePatternOverridesEnabled, context, isSingleSelected, metadata?.bindings]); const showUrlInput = isSingleSelected && !isEditingImage && !lockHrefControls && !lockUrlControls; const showCoverControls = isSingleSelected && canInsertCover; const showBlockControls = showUrlInput || allowCrop || showCoverControls; const mediaReplaceFlow = isSingleSelected && !isEditingImage && !lockUrlControls && /*#__PURE__*/ // For contentOnly mode, put this button in its own area so it has borders around it. (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: isContentOnlyMode ? 'inline' : 'other', children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: id, mediaURL: url, allowedTypes: constants_ALLOWED_MEDIA_TYPES, accept: "image/*", onSelect: onSelectImage, onSelectURL: onSelectURL, onError: onUploadError, name: !url ? (0,external_wp_i18n_namespaceObject.__)('Add image') : (0,external_wp_i18n_namespaceObject.__)('Replace'), onReset: () => onSelectImage(undefined) }) }); const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [showBlockControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [showUrlInput && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, { url: href || '', onChangeUrl: onSetHref, linkDestination: linkDestination, mediaUrl: image && image.source_url || url, mediaLink: image && image.link, linkTarget: linkTarget, linkClass: linkClass, rel: rel, showLightboxSetting: showLightboxSetting, lightboxEnabled: lightboxChecked, onSetLightbox: onSetLightbox, resetLightbox: resetLightbox }), allowCrop && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => setIsEditingImage(true), icon: library_crop, label: (0,external_wp_i18n_namespaceObject.__)('Crop') }), showCoverControls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: overlay_text, label: (0,external_wp_i18n_namespaceObject.__)('Add text over image'), onClick: switchToCover })] }), isSingleSelected && externalBlob && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: uploadExternal, icon: library_upload, label: (0,external_wp_i18n_namespaceObject.__)('Upload to Media Library') }) }) }), isContentOnlyMode && /*#__PURE__*/ // Add some extra controls for content attributes when content only mode is active. // With content only mode active, the inspector is hidden, so users need another way // to edit these attributes. (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ContentOnlyControls, { attributes: attributes, setAttributes: setAttributes, lockAltControls: lockAltControls, lockAltControlsMessage: lockAltControlsMessage, lockTitleControls: lockTitleControls, lockTitleControlsMessage: lockTitleControlsMessage }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: resetAll, dropdownMenuProps: dropdownMenuProps, children: [isSingleSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), isShownByDefault: true, hasValue: () => !!alt, onDeselect: () => setAttributes({ alt: undefined }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), value: alt || '', onChange: updateAlt, readOnly: lockAltControls, help: lockAltControls ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: lockAltControlsMessage }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. (0,external_wp_i18n_namespaceObject.__)('https://www.w3.org/WAI/tutorials/images/decision-tree/'), children: (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')] }), __nextHasNoMarginBottom: true }) }), isResizable && (parentLayoutType === 'grid' ? aspectRatioControl : dimensionsControl), !!imageSizeOptions.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(image_ResolutionTool, { value: sizeSlug, onChange: updateImage, options: imageSizeOptions })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), value: title || '', onChange: onSetTitle, readOnly: lockTitleControls, help: lockTitleControls ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: lockTitleControlsMessage }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [(0,external_wp_i18n_namespaceObject.__)('Describe the role of this image on the page.'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute", children: (0,external_wp_i18n_namespaceObject.__)('(Note: many devices and browsers do not display this text.)') })] }) }) })] }); const filename = (0,external_wp_url_namespaceObject.getFilename)(url); let defaultedAlt; if (alt) { defaultedAlt = alt; } else if (filename) { defaultedAlt = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: file name */ (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute; its file name is %s'), filename); } else { defaultedAlt = (0,external_wp_i18n_namespaceObject.__)('This image has an empty alt attribute'); } const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); const isRounded = attributes.className?.includes('is-style-rounded'); const { postType, postId, queryId } = context; const isDescendentOfQueryLoop = Number.isFinite(queryId); const [, setFeaturedImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId); let img = temporaryURL && hasImageErrored ? /*#__PURE__*/ // Show a placeholder during upload when the blob URL can't be loaded. This can // happen when the user uploads a HEIC image in a browser that doesn't support them. (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className: "wp-block-image__placeholder", withIllustration: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }) : /*#__PURE__*/ // Disable reason: Image itself is not meant to be interactive, but // should direct focus to block. /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: temporaryURL || url, alt: defaultedAlt, onError: onImageError, onLoad: onImageLoad, ref: imageRef, className: borderProps.className, style: { width: width && height || aspectRatio ? '100%' : undefined, height: width && height || aspectRatio ? '100%' : undefined, objectFit: scale, ...borderProps.style, ...shadowProps.style } }), temporaryURL && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})] }) /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */; if (canEditImage && isEditingImage) { img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ImageWrapper, { href: href, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, { id: id, url: url, width: numericWidth, height: numericHeight, naturalHeight: naturalHeight, naturalWidth: naturalWidth, onSaveImage: imageAttributes => setAttributes(imageAttributes), onFinishEditing: () => { setIsEditingImage(false); }, borderProps: isRounded ? undefined : borderProps }) }); } else if (!isResizable || parentLayoutType === 'grid') { img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { width, height, aspectRatio }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ImageWrapper, { href: href, children: img }) }); } else { const numericRatio = aspectRatio && evalAspectRatio(aspectRatio); const customRatio = numericWidth / numericHeight; const naturalRatio = naturalWidth / naturalHeight; const ratio = numericRatio || customRatio || naturalRatio || 1; const currentWidth = !numericWidth && numericHeight ? numericHeight * ratio : numericWidth; const currentHeight = !numericHeight && numericWidth ? numericWidth / ratio : numericHeight; const minWidth = naturalWidth < naturalHeight ? constants_MIN_SIZE : constants_MIN_SIZE * ratio; const minHeight = naturalHeight < naturalWidth ? constants_MIN_SIZE : constants_MIN_SIZE / ratio; // With the current implementation of ResizableBox, an image needs an // explicit pixel value for the max-width. In absence of being able to // set the content-width, this max-width is currently dictated by the // vanilla editor style. The following variable adds a buffer to this // vanilla style, so 3rd party themes have some wiggleroom. This does, // in most cases, allow you to scale the image beyond the width of the // main column, though not infinitely. // @todo It would be good to revisit this once a content-width variable // becomes available. const maxWidthBuffer = maxWidth * 2.5; const maxResizeWidth = maxContentWidth || maxWidthBuffer; let showRightHandle = false; let showLeftHandle = false; /* eslint-disable no-lonely-if */ // See https://github.com/WordPress/gutenberg/issues/7584. if (align === 'center') { // When the image is centered, show both handles. showRightHandle = true; showLeftHandle = true; } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) { // In RTL mode the image is on the right by default. // Show the right handle and hide the left handle only when it is // aligned left. Otherwise always show the left handle. if (align === 'left') { showRightHandle = true; } else { showLeftHandle = true; } } else { // Show the left handle and hide the right handle only when the // image is aligned right. Otherwise always show the right handle. if (align === 'right') { showLeftHandle = true; } else { showRightHandle = true; } } /* eslint-enable no-lonely-if */ img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { style: { display: 'block', objectFit: scale, aspectRatio: !width && !height && aspectRatio ? aspectRatio : undefined }, size: { width: currentWidth !== null && currentWidth !== void 0 ? currentWidth : 'auto', height: currentHeight !== null && currentHeight !== void 0 ? currentHeight : 'auto' }, showHandle: isSingleSelected, minWidth: minWidth, maxWidth: maxResizeWidth, minHeight: minHeight, maxHeight: maxResizeWidth / ratio, lockAspectRatio: ratio, enable: { top: false, right: showRightHandle, bottom: true, left: showLeftHandle }, onResizeStart: onResizeStart, onResizeStop: (event, direction, elt) => { onResizeStop(); // Clear hardcoded width if the resized width is close to the max-content width. if (maxContentWidth && // Only do this if the image is bigger than the container to prevent it from being squished. // TODO: Remove this check if the image support setting 100% width. naturalWidth >= maxContentWidth && Math.abs(elt.offsetWidth - maxContentWidth) < 10) { setAttributes({ width: undefined, height: undefined }); return; } // Since the aspect ratio is locked when resizing, we can // use the width of the resized element to calculate the // height in CSS to prevent stretching when the max-width // is reached. setAttributes({ width: `${elt.offsetWidth}px`, height: 'auto', aspectRatio: ratio === naturalRatio ? undefined : String(ratio) }); }, resizeRatio: align === 'center' ? 2 : 1, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ImageWrapper, { href: href, children: img }) }); } if (!url && !temporaryURL) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [mediaReplaceFlow, metadata?.bindings ? controls : sizeControls] }); } /** * Set the post's featured image with the current image. */ const setPostFeatureImage = () => { setFeaturedImage(id); createSuccessNotice((0,external_wp_i18n_namespaceObject.__)('Post featured image updated.'), { type: 'snackbar' }); }; const featuredImageControl = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { children: ({ selectedClientIds }) => selectedClientIds.length === 1 && !isDescendentOfQueryLoop && postId && id && clientId === selectedClientIds[0] && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: setPostFeatureImage, children: (0,external_wp_i18n_namespaceObject.__)('Set as featured image') }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [mediaReplaceFlow, controls, featuredImageControl, img, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { attributes: attributes, setAttributes: setAttributes, isSelected: isSingleSelected, insertBlocksAfter: insertBlocksAfter, label: (0,external_wp_i18n_namespaceObject.__)('Image caption text'), showToolbarButton: isSingleSelected && hasNonContentControls && !arePatternOverridesEnabled, readOnly: lockCaption })] }); } ;// ./node_modules/@wordpress/block-library/build-module/image/use-max-width-observer.js /** * WordPress dependencies */ function useMaxWidthObserver() { const [contentResizeListener, { width }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const observerRef = (0,external_wp_element_namespaceObject.useRef)(); const maxWidthObserver = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { // Some themes set max-width on blocks. className: "wp-block", "aria-hidden": "true", style: { position: 'absolute', inset: 0, width: '100%', height: 0, margin: 0 }, ref: observerRef, children: contentResizeListener }); return [maxWidthObserver, width]; } ;// ./node_modules/@wordpress/block-library/build-module/image/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Module constants */ const edit_pickRelevantMediaFiles = (image, size) => { const imageProps = Object.fromEntries(Object.entries(image !== null && image !== void 0 ? image : {}).filter(([key]) => ['alt', 'id', 'link', 'caption'].includes(key))); imageProps.url = image?.sizes?.[size]?.url || image?.media_details?.sizes?.[size]?.source_url || image.url; return imageProps; }; /** * Is the url for the image hosted externally. An externally hosted image has no * id and is not a blob url. * * @param {number=} id The id of the image. * @param {string=} url The url of the image. * * @return {boolean} Is the url an externally hosted url? */ const isExternalImage = (id, url) => url && !id && !(0,external_wp_blob_namespaceObject.isBlobURL)(url); /** * Checks if WP generated the specified image size. Size generation is skipped * when the image is smaller than the said size. * * @param {Object} image * @param {string} size * * @return {boolean} Whether or not it has default image size. */ function hasSize(image, size) { var _image$sizes$size, _image$media_details$; return 'url' in ((_image$sizes$size = image?.sizes?.[size]) !== null && _image$sizes$size !== void 0 ? _image$sizes$size : {}) || 'source_url' in ((_image$media_details$ = image?.media_details?.sizes?.[size]) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : {}); } function ImageEdit({ attributes, setAttributes, isSelected: isSingleSelected, className, insertBlocksAfter, onReplace, context, clientId, __unstableParentLayout: parentLayout }) { const { url = '', alt, caption, id, width, height, sizeSlug, aspectRatio, scale, align, metadata } = attributes; const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(attributes.blob); const containerRef = (0,external_wp_element_namespaceObject.useRef)(); // Only observe the max width from the parent container when the parent layout is not flex nor grid. // This won't work for them because the container width changes with the image. // TODO: Find a way to observe the container width for flex and grid layouts. const isMaxWidthContainerWidth = !parentLayout || parentLayout.type !== 'flex' && parentLayout.type !== 'grid'; const [maxWidthObserver, maxContentWidth] = useMaxWidthObserver(); const [placeholderResizeListener, { width: placeholderWidth }] = (0,external_wp_compose_namespaceObject.useResizeObserver)(); const isSmallContainer = placeholderWidth && placeholderWidth < 160; const altRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { altRef.current = alt; }, [alt]); const captionRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { captionRef.current = caption; }, [caption]); const { __unstableMarkNextChangeAsNotPersistent, replaceBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { if (['wide', 'full'].includes(align)) { __unstableMarkNextChangeAsNotPersistent(); setAttributes({ width: undefined, height: undefined, aspectRatio: undefined, scale: undefined }); } }, [__unstableMarkNextChangeAsNotPersistent, align, setAttributes]); const { getSettings, getBlockRootClientId, getBlockName, canInsertBlockType } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); function onUploadError(message) { createErrorNotice(message, { type: 'snackbar' }); setAttributes({ src: undefined, id: undefined, url: undefined, blob: undefined }); } function onSelectImagesList(images) { const win = containerRef.current?.ownerDocument.defaultView; if (images.every(file => file instanceof win.File)) { /** @type {File[]} */ const files = images; const rootClientId = getBlockRootClientId(clientId); if (files.some(file => !isValidFileType(file))) { // Copied from the same notice in the gallery block. createErrorNotice((0,external_wp_i18n_namespaceObject.__)('If uploading to a gallery all files need to be image formats'), { id: 'gallery-upload-invalid-file', type: 'snackbar' }); } const imageBlocks = files.filter(file => isValidFileType(file)).map(file => (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) })); if (getBlockName(rootClientId) === 'core/gallery') { replaceBlock(clientId, imageBlocks); } else if (canInsertBlockType('core/gallery', rootClientId)) { const galleryBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/gallery', {}, imageBlocks); replaceBlock(clientId, galleryBlock); } } } function onSelectImage(media) { if (Array.isArray(media)) { onSelectImagesList(media); return; } if (!media || !media.url) { setAttributes({ url: undefined, alt: undefined, id: undefined, title: undefined, caption: undefined, blob: undefined }); setTemporaryURL(); return; } if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { setTemporaryURL(media.url); return; } const { imageDefaultSize } = getSettings(); // Try to use the previous selected image size if its available // otherwise try the default image size or fallback to "full" let newSize = 'full'; if (sizeSlug && hasSize(media, sizeSlug)) { newSize = sizeSlug; } else if (hasSize(media, imageDefaultSize)) { newSize = imageDefaultSize; } let mediaAttributes = edit_pickRelevantMediaFiles(media, newSize); // If a caption text was meanwhile written by the user, // make sure the text is not overwritten by empty captions. if (captionRef.current && !mediaAttributes.caption) { const { caption: omittedCaption, ...restMediaAttributes } = mediaAttributes; mediaAttributes = restMediaAttributes; } let additionalAttributes; // Reset the dimension attributes if changing to a different image. if (!media.id || media.id !== id) { additionalAttributes = { sizeSlug: newSize }; } else { // Keep the same url when selecting the same file, so "Resolution" // option is not changed. additionalAttributes = { url }; } // Check if default link setting should be used. let linkDestination = attributes.linkDestination; if (!linkDestination) { // Use the WordPress option to determine the proper default. // The constants used in Gutenberg do not match WP options so a little more complicated than ideal. // TODO: fix this in a follow up PR, requires updating media-text and ui component. switch (window?.wp?.media?.view?.settings?.defaultProps?.link || constants_LINK_DESTINATION_NONE) { case 'file': case constants_LINK_DESTINATION_MEDIA: linkDestination = constants_LINK_DESTINATION_MEDIA; break; case 'post': case constants_LINK_DESTINATION_ATTACHMENT: linkDestination = constants_LINK_DESTINATION_ATTACHMENT; break; case LINK_DESTINATION_CUSTOM: linkDestination = LINK_DESTINATION_CUSTOM; break; case constants_LINK_DESTINATION_NONE: linkDestination = constants_LINK_DESTINATION_NONE; break; } } // Check if the image is linked to it's media. let href; switch (linkDestination) { case constants_LINK_DESTINATION_MEDIA: href = media.url; break; case constants_LINK_DESTINATION_ATTACHMENT: href = media.link; break; } mediaAttributes.href = href; setAttributes({ blob: undefined, ...mediaAttributes, ...additionalAttributes, linkDestination }); setTemporaryURL(); } function onSelectURL(newURL) { if (newURL !== url) { setAttributes({ blob: undefined, url: newURL, id: undefined, sizeSlug: getSettings().imageDefaultSize }); setTemporaryURL(); } } useUploadMediaFromBlobURL({ url: temporaryURL, allowedTypes: constants_ALLOWED_MEDIA_TYPES, onChange: onSelectImage, onError: onUploadError }); const isExternal = isExternalImage(id, url); const src = isExternal ? url : undefined; const mediaPreview = !!url && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { alt: (0,external_wp_i18n_namespaceObject.__)('Edit image'), title: (0,external_wp_i18n_namespaceObject.__)('Edit image'), className: "edit-image-preview", src: url }); const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); const classes = dist_clsx(className, { 'is-transient': !!temporaryURL, 'is-resized': !!width || !!height, [`size-${sizeSlug}`]: sizeSlug, 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref: containerRef, className: classes }); // Much of this description is duplicated from MediaPlaceholder. const { lockUrlControls = false, lockUrlControlsMessage } = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!isSingleSelected) { return {}; } const blockBindingsSource = (0,external_wp_blocks_namespaceObject.getBlockBindingsSource)(metadata?.bindings?.url?.source); return { lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue?.({ select, context, args: metadata?.bindings?.url?.args }), lockUrlControlsMessage: blockBindingsSource?.label ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Label of the bindings source. */ (0,external_wp_i18n_namespaceObject.__)('Connected to %s'), blockBindingsSource.label) : (0,external_wp_i18n_namespaceObject.__)('Connected to dynamic data') }; }, [context, isSingleSelected, metadata?.bindings?.url]); const placeholder = content => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { className: dist_clsx('block-editor-media-placeholder', { [borderProps.className]: !!borderProps.className && !isSingleSelected }), icon: !isSmallContainer && (lockUrlControls ? library_plugins : library_image), withIllustration: !isSingleSelected || isSmallContainer, label: !isSmallContainer && (0,external_wp_i18n_namespaceObject.__)('Image'), instructions: !lockUrlControls && !isSmallContainer && (0,external_wp_i18n_namespaceObject.__)('Drag and drop an image, upload, or choose from your library.'), style: { aspectRatio: !(width && height) && aspectRatio ? aspectRatio : undefined, width: height && aspectRatio ? '100%' : width, height: width && aspectRatio ? '100%' : height, objectFit: scale, ...borderProps.style, ...shadowProps.style }, children: [lockUrlControls && !isSmallContainer && lockUrlControlsMessage, !lockUrlControls && !isSmallContainer && content, placeholderResizeListener] }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(image_Image, { temporaryURL: temporaryURL, attributes: attributes, setAttributes: setAttributes, isSingleSelected: isSingleSelected, insertBlocksAfter: insertBlocksAfter, onReplace: onReplace, onSelectImage: onSelectImage, onSelectURL: onSelectURL, onUploadError: onUploadError, context: context, clientId: clientId, blockEditingMode: blockEditingMode, parentLayoutType: parentLayout?.type, maxContentWidth: maxContentWidth }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_image }), onSelect: onSelectImage, onSelectURL: onSelectURL, onError: onUploadError, placeholder: placeholder, accept: "image/*", allowedTypes: constants_ALLOWED_MEDIA_TYPES, handleUpload: files => files.length === 1, value: { id, src }, mediaPreview: mediaPreview, disableMediaButtons: temporaryURL || url })] }), // The listener cannot be placed as the first element as it will break the in-between inserter. // See https://github.com/WordPress/gutenberg/blob/71134165868298fc15e22896d0c28b41b3755ff7/packages/block-editor/src/components/block-list/use-in-between-inserter.js#L120 isSingleSelected && isMaxWidthContainerWidth && maxWidthObserver] }); } /* harmony default export */ const image_edit = (ImageEdit); ;// ./node_modules/@wordpress/block-library/build-module/image/save.js /** * External dependencies */ /** * WordPress dependencies */ function image_save_save({ attributes }) { const { url, alt, caption, align, href, rel, linkClass, width, height, aspectRatio, scale, id, linkTarget, sizeSlug, title } = attributes; const newRel = !rel ? undefined : rel; const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); const classes = dist_clsx({ // All other align classes are handled by block supports. // `{ align: 'none' }` is unique to transforms for the image block. alignnone: 'none' === align, [`size-${sizeSlug}`]: sizeSlug, 'is-resized': width || height, 'has-custom-border': !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 }); const imageClasses = dist_clsx(borderProps.className, { [`wp-image-${id}`]: !!id }); const image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: url, alt: alt, className: imageClasses || undefined, style: { ...borderProps.style, ...shadowProps.style, aspectRatio, objectFit: scale, width, height }, title: title }); const figure = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [href ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }) : image, !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'), tagName: "figcaption", value: caption })] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: classes }), children: figure }); } ;// ./node_modules/@wordpress/block-library/build-module/image/transforms.js /** * WordPress dependencies */ function stripFirstImage(attributes, { shortcode }) { const { body } = document.implementation.createHTMLDocument(''); body.innerHTML = shortcode.content; let nodeToRemove = body.querySelector('img'); // If an image has parents, find the topmost node to remove. while (nodeToRemove && nodeToRemove.parentNode && nodeToRemove.parentNode !== body) { nodeToRemove = nodeToRemove.parentNode; } if (nodeToRemove) { nodeToRemove.parentNode.removeChild(nodeToRemove); } return body.innerHTML.trim(); } function getFirstAnchorAttributeFormHTML(html, attributeName) { const { body } = document.implementation.createHTMLDocument(''); body.innerHTML = html; const { firstElementChild } = body; if (firstElementChild && firstElementChild.nodeName === 'A') { return firstElementChild.getAttribute(attributeName) || undefined; } } const imageSchema = { img: { attributes: ['src', 'alt', 'title'], classes: ['alignleft', 'aligncenter', 'alignright', 'alignnone', /^wp-image-\d+$/] } }; const schema = ({ phrasingContentSchema }) => ({ figure: { require: ['img'], children: { ...imageSchema, a: { attributes: ['href', 'rel', 'target'], classes: ['*'], children: imageSchema }, figcaption: { children: phrasingContentSchema } } } }); const image_transforms_transforms = { from: [{ type: 'raw', isMatch: node => node.nodeName === 'FIGURE' && !!node.querySelector('img'), schema, transform: node => { // Search both figure and image classes. Alignment could be // set on either. ID is set on the image. const className = node.className + ' ' + node.querySelector('img').className; const alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec(className); const anchor = node.id === '' ? undefined : node.id; const align = alignMatches ? alignMatches[1] : undefined; const idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec(className); const id = idMatches ? Number(idMatches[1]) : undefined; const anchorElement = node.querySelector('a'); const linkDestination = anchorElement && anchorElement.href ? 'custom' : undefined; const href = anchorElement && anchorElement.href ? anchorElement.href : undefined; const rel = anchorElement && anchorElement.rel ? anchorElement.rel : undefined; const linkClass = anchorElement && anchorElement.className ? anchorElement.className : undefined; const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)('core/image', node.outerHTML, { align, id, linkDestination, href, rel, linkClass, anchor }); if ((0,external_wp_blob_namespaceObject.isBlobURL)(attributes.url)) { attributes.blob = attributes.url; delete attributes.url; } return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', attributes); } }, { // Note: when dragging and dropping multiple files onto a gallery this overrides the // gallery transform in order to add new images to the gallery instead of // creating a new gallery. type: 'files', isMatch(files) { return files.every(file => file.type.indexOf('image/') === 0); }, transform(files) { const blocks = files.map(file => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { blob: (0,external_wp_blob_namespaceObject.createBlobURL)(file) }); }); return blocks; } }, { type: 'shortcode', tag: 'caption', attributes: { url: { type: 'string', source: 'attribute', attribute: 'src', selector: 'img' }, alt: { type: 'string', source: 'attribute', attribute: 'alt', selector: 'img' }, caption: { shortcode: stripFirstImage }, href: { shortcode: (attributes, { shortcode }) => { return getFirstAnchorAttributeFormHTML(shortcode.content, 'href'); } }, rel: { shortcode: (attributes, { shortcode }) => { return getFirstAnchorAttributeFormHTML(shortcode.content, 'rel'); } }, linkClass: { shortcode: (attributes, { shortcode }) => { return getFirstAnchorAttributeFormHTML(shortcode.content, 'class'); } }, id: { type: 'number', shortcode: ({ named: { id } }) => { if (!id) { return; } return parseInt(id.replace('attachment_', ''), 10); } }, align: { type: 'string', shortcode: ({ named: { align = 'alignnone' } }) => { return align.replace('align', ''); } } } }] }; /* harmony default export */ const image_transforms = (image_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/image/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const image_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/image", title: "Image", category: "media", usesContext: ["allowResize", "imageCrop", "fixedHeight", "postId", "postType", "queryId"], description: "Insert an image to make a visual statement.", keywords: ["img", "photo", "picture"], textdomain: "default", attributes: { blob: { type: "string", role: "local" }, url: { type: "string", source: "attribute", selector: "img", attribute: "src", role: "content" }, alt: { type: "string", source: "attribute", selector: "img", attribute: "alt", "default": "", role: "content" }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption", role: "content" }, lightbox: { type: "object", enabled: { type: "boolean" } }, title: { type: "string", source: "attribute", selector: "img", attribute: "title", role: "content" }, href: { type: "string", source: "attribute", selector: "figure > a", attribute: "href", role: "content" }, rel: { type: "string", source: "attribute", selector: "figure > a", attribute: "rel" }, linkClass: { type: "string", source: "attribute", selector: "figure > a", attribute: "class" }, id: { type: "number", role: "content" }, width: { type: "string" }, height: { type: "string" }, aspectRatio: { type: "string" }, scale: { type: "string" }, sizeSlug: { type: "string" }, linkDestination: { type: "string" }, linkTarget: { type: "string", source: "attribute", selector: "figure > a", attribute: "target" } }, supports: { interactivity: true, align: ["left", "center", "right", "wide", "full"], anchor: true, color: { text: false, background: false }, filter: { duotone: true }, spacing: { margin: true }, __experimentalBorder: { color: true, radius: true, width: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { color: true, radius: true, width: true } }, shadow: { __experimentalSkipSerialization: true } }, selectors: { border: ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", shadow: ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", filter: { duotone: ".wp-block-image img, .wp-block-image .components-placeholder" } }, styles: [{ name: "default", label: "Default", isDefault: true }, { name: "rounded", label: "Rounded" }], editorStyle: "wp-block-image-editor", style: "wp-block-image" }; const { name: image_name } = image_metadata; const image_settings = { icon: library_image, example: { attributes: { sizeSlug: 'large', url: 'https://s.w.org/images/core/5.3/MtBlanc1.jpg', // translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block. caption: (0,external_wp_i18n_namespaceObject.__)('Mont Blanc appears—still, snowy, and serene.') } }, __experimentalLabel(attributes, { context }) { const customName = attributes?.metadata?.name; if (context === 'list-view' && customName) { return customName; } if (context === 'accessibility') { const { caption, alt, url } = attributes; if (!url) { return (0,external_wp_i18n_namespaceObject.__)('Empty'); } if (!alt) { return caption || ''; } // This is intended to be read by a screen reader. // A period simply means a pause, no need to translate it. return alt + (caption ? '. ' + caption : ''); } }, getEditWrapperProps(attributes) { return { 'data-align': attributes.align }; }, transforms: image_transforms, edit: image_edit, save: image_save_save, deprecated: image_deprecated }; const image_init = () => initBlock({ name: image_name, metadata: image_metadata, settings: image_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/comment.js /** * WordPress dependencies */ const comment = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z" }) }); /* harmony default export */ const library_comment = (comment); ;// ./node_modules/@wordpress/block-library/build-module/latest-comments/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Minimum number of comments a user can show using this block. * * @type {number} */ const MIN_COMMENTS = 1; /** * Maximum number of comments a user can show using this block. * * @type {number} */ const MAX_COMMENTS = 100; function LatestComments({ attributes, setAttributes }) { const { commentsToShow, displayAvatar, displayDate, displayExcerpt } = attributes; const serverSideAttributes = { ...attributes, style: { ...attributes?.style, spacing: undefined } }; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ commentsToShow: 5, displayAvatar: true, displayDate: true, displayExcerpt: true }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !displayAvatar, label: (0,external_wp_i18n_namespaceObject.__)('Display avatar'), onDeselect: () => setAttributes({ displayAvatar: true }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display avatar'), checked: displayAvatar, onChange: () => setAttributes({ displayAvatar: !displayAvatar }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !displayDate, label: (0,external_wp_i18n_namespaceObject.__)('Display date'), onDeselect: () => setAttributes({ displayDate: true }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display date'), checked: displayDate, onChange: () => setAttributes({ displayDate: !displayDate }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !displayExcerpt, label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'), onDeselect: () => setAttributes({ displayExcerpt: true }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'), checked: displayExcerpt, onChange: () => setAttributes({ displayExcerpt: !displayExcerpt }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => commentsToShow !== 5, label: (0,external_wp_i18n_namespaceObject.__)('Number of comments'), onDeselect: () => setAttributes({ commentsToShow: 5 }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Number of comments'), value: commentsToShow, onChange: value => setAttributes({ commentsToShow: value }), min: MIN_COMMENTS, max: MAX_COMMENTS, required: true }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { block: "core/latest-comments", attributes: serverSideAttributes // The preview uses the site's locale to make it more true to how // the block appears on the frontend. Setting the locale // explicitly prevents any middleware from setting it to 'user'. , urlQueryArgs: { _locale: 'site' } }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/latest-comments/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const latest_comments_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/latest-comments", title: "Latest Comments", category: "widgets", description: "Display a list of your most recent comments.", keywords: ["recent comments"], textdomain: "default", attributes: { commentsToShow: { type: "number", "default": 5, minimum: 1, maximum: 100 }, displayAvatar: { type: "boolean", "default": true }, displayDate: { type: "boolean", "default": true }, displayExcerpt: { type: "boolean", "default": true } }, supports: { align: true, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, html: false, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-latest-comments-editor", style: "wp-block-latest-comments" }; const { name: latest_comments_name } = latest_comments_metadata; const latest_comments_settings = { icon: library_comment, example: {}, edit: LatestComments }; const latest_comments_init = () => initBlock({ name: latest_comments_name, metadata: latest_comments_metadata, settings: latest_comments_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/post-list.js /** * WordPress dependencies */ const postList = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z" }) }); /* harmony default export */ const post_list = (postList); ;// ./node_modules/@wordpress/block-library/build-module/latest-posts/deprecated.js /** * Internal dependencies */ const latest_posts_deprecated_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/latest-posts", title: "Latest Posts", category: "widgets", description: "Display a list of your most recent posts.", keywords: ["recent posts"], textdomain: "default", attributes: { categories: { type: "array", items: { type: "object" } }, selectedAuthor: { type: "number" }, postsToShow: { type: "number", "default": 5 }, displayPostContent: { type: "boolean", "default": false }, displayPostContentRadio: { type: "string", "default": "excerpt" }, excerptLength: { type: "number", "default": 55 }, displayAuthor: { type: "boolean", "default": false }, displayPostDate: { type: "boolean", "default": false }, postLayout: { type: "string", "default": "list" }, columns: { type: "number", "default": 3 }, order: { type: "string", "default": "desc" }, orderBy: { type: "string", "default": "date" }, displayFeaturedImage: { type: "boolean", "default": false }, featuredImageAlign: { type: "string", "enum": ["left", "center", "right"] }, featuredImageSizeSlug: { type: "string", "default": "thumbnail" }, featuredImageSizeWidth: { type: "number", "default": null }, featuredImageSizeHeight: { type: "number", "default": null }, addLinkToFeaturedImage: { type: "boolean", "default": false } }, supports: { align: true, html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-latest-posts-editor", style: "wp-block-latest-posts" }; const { attributes: deprecated_attributes } = latest_posts_deprecated_metadata; /* harmony default export */ const latest_posts_deprecated = ([{ attributes: { ...deprecated_attributes, categories: { type: 'string' } }, supports: { align: true, html: false }, migrate: oldAttributes => { // This needs the full category object, not just the ID. return { ...oldAttributes, categories: [{ id: Number(oldAttributes.categories) }] }; }, isEligible: ({ categories }) => categories && 'string' === typeof categories, save: () => null }]); ;// ./node_modules/@wordpress/icons/build-module/library/align-none.js /** * WordPress dependencies */ const alignNone = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM5 9h14v6H5V9Z" }) }); /* harmony default export */ const align_none = (alignNone); ;// ./node_modules/@wordpress/icons/build-module/library/position-left.js /** * WordPress dependencies */ const positionLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 5.5h8V4H5v1.5ZM5 20h8v-1.5H5V20ZM19 9H5v6h14V9Z" }) }); /* harmony default export */ const position_left = (positionLeft); ;// ./node_modules/@wordpress/icons/build-module/library/position-center.js /** * WordPress dependencies */ const positionCenter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 5.5H5V4h14v1.5ZM19 20H5v-1.5h14V20ZM7 9h10v6H7V9Z" }) }); /* harmony default export */ const position_center = (positionCenter); ;// ./node_modules/@wordpress/icons/build-module/library/position-right.js /** * WordPress dependencies */ const positionRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 5.5h-8V4h8v1.5ZM19 20h-8v-1.5h8V20ZM5 9h14v6H5V9Z" }) }); /* harmony default export */ const position_right = (positionRight); ;// ./node_modules/@wordpress/icons/build-module/library/list.js /** * WordPress dependencies */ const list = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z" }) }); /* harmony default export */ const library_list = (list); ;// ./node_modules/@wordpress/block-library/build-module/latest-posts/constants.js const MIN_EXCERPT_LENGTH = 10; const MAX_EXCERPT_LENGTH = 100; const MAX_POSTS_COLUMNS = 6; const DEFAULT_EXCERPT_LENGTH = 55; ;// ./node_modules/@wordpress/block-library/build-module/latest-posts/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Module Constants */ const CATEGORIES_LIST_QUERY = { per_page: -1, context: 'view' }; const USERS_LIST_QUERY = { per_page: -1, has_published_posts: ['post'], context: 'view' }; function getFeaturedImageDetails(post, size) { var _image$media_details$; const image = post._embedded?.['wp:featuredmedia']?.['0']; return { url: (_image$media_details$ = image?.media_details?.sizes?.[size]?.source_url) !== null && _image$media_details$ !== void 0 ? _image$media_details$ : image?.source_url, alt: image?.alt_text }; } function LatestPostsEdit({ attributes, setAttributes }) { var _categoriesList$reduc; const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(LatestPostsEdit); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const { postsToShow, order, orderBy, categories, selectedAuthor, displayFeaturedImage, displayPostContentRadio, displayPostContent, displayPostDate, displayAuthor, postLayout, columns, excerptLength, featuredImageAlign, featuredImageSizeSlug, featuredImageSizeWidth, featuredImageSizeHeight, addLinkToFeaturedImage } = attributes; const { imageSizes, latestPosts, defaultImageWidth, defaultImageHeight, categoriesList, authorList } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _settings$imageDimens, _settings$imageDimens2; const { getEntityRecords, getUsers } = select(external_wp_coreData_namespaceObject.store); const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); const catIds = categories && categories.length > 0 ? categories.map(cat => cat.id) : []; const latestPostsQuery = Object.fromEntries(Object.entries({ categories: catIds, author: selectedAuthor, order, orderby: orderBy, per_page: postsToShow, _embed: 'wp:featuredmedia', ignore_sticky: true }).filter(([, value]) => typeof value !== 'undefined')); return { defaultImageWidth: (_settings$imageDimens = settings.imageDimensions?.[featuredImageSizeSlug]?.width) !== null && _settings$imageDimens !== void 0 ? _settings$imageDimens : 0, defaultImageHeight: (_settings$imageDimens2 = settings.imageDimensions?.[featuredImageSizeSlug]?.height) !== null && _settings$imageDimens2 !== void 0 ? _settings$imageDimens2 : 0, imageSizes: settings.imageSizes, latestPosts: getEntityRecords('postType', 'post', latestPostsQuery), categoriesList: getEntityRecords('taxonomy', 'category', CATEGORIES_LIST_QUERY), authorList: getUsers(USERS_LIST_QUERY) }; }, [featuredImageSizeSlug, postsToShow, order, orderBy, categories, selectedAuthor]); // If a user clicks to a link prevent redirection and show a warning. const { createWarningNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const showRedirectionPreventedNotice = event => { event.preventDefault(); createWarningNotice((0,external_wp_i18n_namespaceObject.__)('Links are disabled in the editor.'), { id: `block-library/core/latest-posts/redirection-prevented/${instanceId}`, type: 'snackbar' }); }; const imageSizeOptions = imageSizes.filter(({ slug }) => slug !== 'full').map(({ name, slug }) => ({ value: slug, label: name })); const categorySuggestions = (_categoriesList$reduc = categoriesList?.reduce((accumulator, category) => ({ ...accumulator, [category.name]: category }), {})) !== null && _categoriesList$reduc !== void 0 ? _categoriesList$reduc : {}; const selectCategories = tokens => { const hasNoSuggestion = tokens.some(token => typeof token === 'string' && !categorySuggestions[token]); if (hasNoSuggestion) { return; } // Categories that are already will be objects, while new additions will be strings (the name). // allCategories nomalizes the array so that they are all objects. const allCategories = tokens.map(token => { return typeof token === 'string' ? categorySuggestions[token] : token; }); // We do nothing if the category is not selected // from suggestions. if (allCategories.includes(null)) { return false; } setAttributes({ categories: allCategories }); }; const imageAlignmentOptions = [{ value: 'none', icon: align_none, label: (0,external_wp_i18n_namespaceObject.__)('None') }, { value: 'left', icon: position_left, label: (0,external_wp_i18n_namespaceObject.__)('Left') }, { value: 'center', icon: position_center, label: (0,external_wp_i18n_namespaceObject.__)('Center') }, { value: 'right', icon: position_right, label: (0,external_wp_i18n_namespaceObject.__)('Right') }]; const hasPosts = !!latestPosts?.length; const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Post content'), resetAll: () => setAttributes({ displayPostContent: false, displayPostContentRadio: 'excerpt', excerptLength: DEFAULT_EXCERPT_LENGTH }), dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!displayPostContent, label: (0,external_wp_i18n_namespaceObject.__)('Post content'), onDeselect: () => setAttributes({ displayPostContent: false }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Post content'), checked: displayPostContent, onChange: value => setAttributes({ displayPostContent: value }) }) }), displayPostContent && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => displayPostContentRadio !== 'excerpt', label: (0,external_wp_i18n_namespaceObject.__)('Show'), onDeselect: () => setAttributes({ displayPostContentRadio: 'excerpt' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, { label: (0,external_wp_i18n_namespaceObject.__)('Show'), selected: displayPostContentRadio, options: [{ label: (0,external_wp_i18n_namespaceObject.__)('Excerpt'), value: 'excerpt' }, { label: (0,external_wp_i18n_namespaceObject.__)('Full post'), value: 'full_post' }], onChange: value => setAttributes({ displayPostContentRadio: value }) }) }), displayPostContent && displayPostContentRadio === 'excerpt' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => excerptLength !== DEFAULT_EXCERPT_LENGTH, label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'), onDeselect: () => setAttributes({ excerptLength: DEFAULT_EXCERPT_LENGTH }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'), value: excerptLength, onChange: value => setAttributes({ excerptLength: value }), min: MIN_EXCERPT_LENGTH, max: MAX_EXCERPT_LENGTH }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Post meta'), resetAll: () => setAttributes({ displayAuthor: false, displayPostDate: false }), dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!displayAuthor, label: (0,external_wp_i18n_namespaceObject.__)('Display author name'), onDeselect: () => setAttributes({ displayAuthor: false }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display author name'), checked: displayAuthor, onChange: value => setAttributes({ displayAuthor: value }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!displayPostDate, label: (0,external_wp_i18n_namespaceObject.__)('Display post date'), onDeselect: () => setAttributes({ displayPostDate: false }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display post date'), checked: displayPostDate, onChange: value => setAttributes({ displayPostDate: value }) }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Featured image'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display featured image'), checked: displayFeaturedImage, onChange: value => setAttributes({ displayFeaturedImage: value }) }), displayFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalImageSizeControl, { onChange: value => { const newAttrs = {}; if (value.hasOwnProperty('width')) { newAttrs.featuredImageSizeWidth = value.width; } if (value.hasOwnProperty('height')) { newAttrs.featuredImageSizeHeight = value.height; } setAttributes(newAttrs); }, slug: featuredImageSizeSlug, width: featuredImageSizeWidth, height: featuredImageSizeHeight, imageWidth: defaultImageWidth, imageHeight: defaultImageHeight, imageSizeOptions: imageSizeOptions, imageSizeHelp: (0,external_wp_i18n_namespaceObject.__)('Select the size of the source image.'), onChangeImage: value => setAttributes({ featuredImageSizeSlug: value, featuredImageSizeWidth: undefined, featuredImageSizeHeight: undefined }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { className: "editor-latest-posts-image-alignment-control", __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Image alignment'), value: featuredImageAlign || 'none', onChange: value => setAttributes({ featuredImageAlign: value !== 'none' ? value : undefined }), children: imageAlignmentOptions.map(({ value, icon, label }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOptionIcon, { value: value, icon: icon, label: label }, value); }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Add link to featured image'), checked: addLinkToFeaturedImage, onChange: value => setAttributes({ addLinkToFeaturedImage: value }) })] })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Sorting and filtering'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.QueryControls, { order, orderBy, numberOfItems: postsToShow, onOrderChange: value => setAttributes({ order: value }), onOrderByChange: value => setAttributes({ orderBy: value }), onNumberOfItemsChange: value => setAttributes({ postsToShow: value }), categorySuggestions: categorySuggestions, onCategoryChange: selectCategories, selectedCategories: categories, onAuthorChange: value => setAttributes({ selectedAuthor: '' !== value ? Number(value) : undefined }), authorList: authorList !== null && authorList !== void 0 ? authorList : [], selectedAuthorId: selectedAuthor }), postLayout === 'grid' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Columns'), value: columns, onChange: value => setAttributes({ columns: value }), min: 2, max: !hasPosts ? MAX_POSTS_COLUMNS : Math.min(MAX_POSTS_COLUMNS, latestPosts.length), required: true })] })] }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ 'wp-block-latest-posts__list': true, 'is-grid': postLayout === 'grid', 'has-dates': displayPostDate, 'has-author': displayAuthor, [`columns-${columns}`]: postLayout === 'grid' }) }); if (!hasPosts) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { icon: library_pin, label: (0,external_wp_i18n_namespaceObject.__)('Latest Posts'), children: !Array.isArray(latestPosts) ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : (0,external_wp_i18n_namespaceObject.__)('No posts found.') })] }); } // Removing posts from display should be instant. const displayPosts = latestPosts.length > postsToShow ? latestPosts.slice(0, postsToShow) : latestPosts; const layoutControls = [{ icon: library_list, title: (0,external_wp_i18n_namespaceObject._x)('List view', 'Latest posts block display setting'), onClick: () => setAttributes({ postLayout: 'list' }), isActive: postLayout === 'list' }, { icon: library_grid, title: (0,external_wp_i18n_namespaceObject._x)('Grid view', 'Latest posts block display setting'), onClick: () => setAttributes({ postLayout: 'grid' }), isActive: postLayout === 'grid' }]; const dateFormat = (0,external_wp_date_namespaceObject.getSettings)().formats.date; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { controls: layoutControls }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { ...blockProps, children: displayPosts.map(post => { const titleTrimmed = post.title.rendered.trim(); let excerpt = post.excerpt.rendered; const currentAuthor = authorList?.find(author => author.id === post.author); const excerptElement = document.createElement('div'); excerptElement.innerHTML = excerpt; excerpt = excerptElement.textContent || excerptElement.innerText || ''; const { url: imageSourceUrl, alt: featuredImageAlt } = getFeaturedImageDetails(post, featuredImageSizeSlug); const imageClasses = dist_clsx({ 'wp-block-latest-posts__featured-image': true, [`align${featuredImageAlign}`]: !!featuredImageAlign }); const renderFeaturedImage = displayFeaturedImage && imageSourceUrl; const featuredImage = renderFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: imageSourceUrl, alt: featuredImageAlt, style: { maxWidth: featuredImageSizeWidth, maxHeight: featuredImageSizeHeight } }); const needsReadMore = excerptLength < excerpt.trim().split(' ').length && post.excerpt.raw === ''; const postExcerpt = needsReadMore ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [excerpt.trim().split(' ', excerptLength).join(' '), (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Hidden accessibility text: Post title */ (0,external_wp_i18n_namespaceObject.__)('… <a>Read more<span>: %1$s</span></a>'), titleTrimmed || (0,external_wp_i18n_namespaceObject.__)('(no title)')), { a: /*#__PURE__*/ // eslint-disable-next-line jsx-a11y/anchor-has-content (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: "wp-block-latest-posts__read-more", href: post.link, rel: "noopener noreferrer", onClick: showRedirectionPreventedNotice }), span: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "screen-reader-text" }) })] }) : excerpt; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { children: [renderFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: imageClasses, children: addLinkToFeaturedImage ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: post.link, rel: "noreferrer noopener", onClick: showRedirectionPreventedNotice, children: featuredImage }) : featuredImage }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: "wp-block-latest-posts__post-title", href: post.link, rel: "noreferrer noopener", dangerouslySetInnerHTML: !!titleTrimmed ? { __html: titleTrimmed } : undefined, onClick: showRedirectionPreventedNotice, children: !titleTrimmed ? (0,external_wp_i18n_namespaceObject.__)('(no title)') : null }), displayAuthor && currentAuthor && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-latest-posts__post-author", children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: byline. %s: author. */ (0,external_wp_i18n_namespaceObject.__)('by %s'), currentAuthor.name) }), displayPostDate && post.date_gmt && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { dateTime: (0,external_wp_date_namespaceObject.format)('c', post.date_gmt), className: "wp-block-latest-posts__post-date", children: (0,external_wp_date_namespaceObject.dateI18n)(dateFormat, post.date_gmt) }), displayPostContent && displayPostContentRadio === 'excerpt' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-latest-posts__post-excerpt", children: postExcerpt }), displayPostContent && displayPostContentRadio === 'full_post' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-latest-posts__post-full-content", dangerouslySetInnerHTML: { __html: post.content.raw.trim() } })] }, post.id); }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/latest-posts/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const latest_posts_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/latest-posts", title: "Latest Posts", category: "widgets", description: "Display a list of your most recent posts.", keywords: ["recent posts"], textdomain: "default", attributes: { categories: { type: "array", items: { type: "object" } }, selectedAuthor: { type: "number" }, postsToShow: { type: "number", "default": 5 }, displayPostContent: { type: "boolean", "default": false }, displayPostContentRadio: { type: "string", "default": "excerpt" }, excerptLength: { type: "number", "default": 55 }, displayAuthor: { type: "boolean", "default": false }, displayPostDate: { type: "boolean", "default": false }, postLayout: { type: "string", "default": "list" }, columns: { type: "number", "default": 3 }, order: { type: "string", "default": "desc" }, orderBy: { type: "string", "default": "date" }, displayFeaturedImage: { type: "boolean", "default": false }, featuredImageAlign: { type: "string", "enum": ["left", "center", "right"] }, featuredImageSizeSlug: { type: "string", "default": "thumbnail" }, featuredImageSizeWidth: { type: "number", "default": null }, featuredImageSizeHeight: { type: "number", "default": null }, addLinkToFeaturedImage: { type: "boolean", "default": false } }, supports: { align: true, html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-latest-posts-editor", style: "wp-block-latest-posts" }; const { name: latest_posts_name } = latest_posts_metadata; const latest_posts_settings = { icon: post_list, example: {}, edit: LatestPostsEdit, deprecated: latest_posts_deprecated }; const latest_posts_init = () => initBlock({ name: latest_posts_name, metadata: latest_posts_metadata, settings: latest_posts_settings }); ;// ./node_modules/@wordpress/block-library/build-module/list/utils.js /** * WordPress dependencies */ const LIST_STYLES = { A: 'upper-alpha', a: 'lower-alpha', I: 'upper-roman', i: 'lower-roman' }; function createListBlockFromDOMElement(listElement) { const type = listElement.getAttribute('type'); const listAttributes = { ordered: 'OL' === listElement.tagName, anchor: listElement.id === '' ? undefined : listElement.id, start: listElement.getAttribute('start') ? parseInt(listElement.getAttribute('start'), 10) : undefined, reversed: listElement.hasAttribute('reversed') ? true : undefined, type: type && LIST_STYLES[type] ? LIST_STYLES[type] : undefined }; const innerBlocks = Array.from(listElement.children).map(listItem => { const children = Array.from(listItem.childNodes).filter(node => node.nodeType !== node.TEXT_NODE || node.textContent.trim().length !== 0); children.reverse(); const [nestedList, ...nodes] = children; const hasNestedList = nestedList?.tagName === 'UL' || nestedList?.tagName === 'OL'; if (!hasNestedList) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { content: listItem.innerHTML }); } const htmlNodes = nodes.map(node => { if (node.nodeType === node.TEXT_NODE) { return node.textContent; } return node.outerHTML; }); htmlNodes.reverse(); const childAttributes = { content: htmlNodes.join('').trim() }; const childInnerBlocks = [createListBlockFromDOMElement(nestedList)]; return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', childAttributes, childInnerBlocks); }); return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', listAttributes, innerBlocks); } function migrateToListV2(attributes) { const { values, start, reversed, ordered, type, ...otherAttributes } = attributes; const list = document.createElement(ordered ? 'ol' : 'ul'); list.innerHTML = values; if (start) { list.setAttribute('start', start); } if (reversed) { list.setAttribute('reversed', true); } if (type) { list.setAttribute('type', type); } const [listBlock] = (0,external_wp_blocks_namespaceObject.rawHandler)({ HTML: list.outerHTML }); return [{ ...otherAttributes, ...listBlock.attributes }, listBlock.innerBlocks]; } function migrateTypeToInlineStyle(attributes) { const { type } = attributes; if (type && LIST_STYLES[type]) { return { ...attributes, type: LIST_STYLES[type] }; } return attributes; } ;// ./node_modules/@wordpress/block-library/build-module/list/deprecated.js /** * WordPress dependencies */ /** * Internal dependencies */ const v0 = { attributes: { ordered: { type: 'boolean', default: false, role: 'content' }, values: { type: 'string', source: 'html', selector: 'ol,ul', multiline: 'li', __unstableMultilineWrapperTags: ['ol', 'ul'], default: '', role: 'content' }, type: { type: 'string' }, start: { type: 'number' }, reversed: { type: 'boolean' }, placeholder: { type: 'string' } }, supports: { anchor: true, className: false, typography: { fontSize: true, __experimentalFontFamily: true }, color: { gradients: true, link: true }, __unstablePasteTextInline: true, __experimentalSelector: 'ol,ul', __experimentalSlashInserter: true }, save({ attributes }) { const { ordered, values, type, reversed, start } = attributes; const TagName = ordered ? 'ol' : 'ul'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ type, reversed, start }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: values, multiline: "li" }) }); }, migrate: migrate_font_family, isEligible({ style }) { return style?.typography?.fontFamily; } }; const list_deprecated_v1 = { attributes: { ordered: { type: 'boolean', default: false, role: 'content' }, values: { type: 'string', source: 'html', selector: 'ol,ul', multiline: 'li', __unstableMultilineWrapperTags: ['ol', 'ul'], default: '', role: 'content' }, type: { type: 'string' }, start: { type: 'number' }, reversed: { type: 'boolean' }, placeholder: { type: 'string' } }, supports: { anchor: true, className: false, typography: { fontSize: true, __experimentalFontFamily: true, lineHeight: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalDefaultControls: { fontSize: true } }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, __unstablePasteTextInline: true, __experimentalSelector: 'ol,ul', __experimentalSlashInserter: true }, save({ attributes }) { const { ordered, values, type, reversed, start } = attributes; const TagName = ordered ? 'ol' : 'ul'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ type, reversed, start }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: values, multiline: "li" }) }); }, migrate: migrateToListV2 }; // In #53301 changed to use the inline style instead of type attribute. const list_deprecated_v2 = { attributes: { ordered: { type: 'boolean', default: false, role: 'content' }, values: { type: 'string', source: 'html', selector: 'ol,ul', multiline: 'li', __unstableMultilineWrapperTags: ['ol', 'ul'], default: '', role: 'content' }, type: { type: 'string' }, start: { type: 'number' }, reversed: { type: 'boolean' }, placeholder: { type: 'string' } }, supports: { anchor: true, className: false, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, __unstablePasteTextInline: true, __experimentalSelector: 'ol,ul', __experimentalSlashInserter: true }, isEligible({ type }) { return !!type; }, save({ attributes }) { const { ordered, type, reversed, start } = attributes; const TagName = ordered ? 'ol' : 'ul'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ type, reversed, start }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); }, migrate: migrateTypeToInlineStyle }; // Version without block support 'className: true'. const list_deprecated_v3 = { attributes: { ordered: { type: 'boolean', default: false, role: 'content' }, values: { type: 'string', source: 'html', selector: 'ol,ul', multiline: 'li', __unstableMultilineWrapperTags: ['ol', 'ul'], default: '', role: 'content' }, type: { type: 'string' }, start: { type: 'number' }, reversed: { type: 'boolean' }, placeholder: { type: 'string' } }, supports: { anchor: true, className: false, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, __unstablePasteTextInline: true, __experimentalSelector: 'ol,ul', __experimentalOnMerge: 'true', __experimentalSlashInserter: true }, save({ attributes }) { const { ordered, type, reversed, start } = attributes; const TagName = ordered ? 'ol' : 'ul'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ reversed, start, style: { listStyleType: ordered && type !== 'decimal' ? type : undefined } }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const list_deprecated = ([list_deprecated_v3, list_deprecated_v2, list_deprecated_v1, v0]); ;// ./node_modules/@wordpress/icons/build-module/library/format-outdent-rtl.js /** * WordPress dependencies */ const formatOutdentRTL = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z" }) }); /* harmony default export */ const format_outdent_rtl = (formatOutdentRTL); ;// ./node_modules/@wordpress/icons/build-module/library/format-outdent.js /** * WordPress dependencies */ const formatOutdent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z" }) }); /* harmony default export */ const format_outdent = (formatOutdent); ;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.js /** * WordPress dependencies */ const formatListBulletsRTL = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" }) }); /* harmony default export */ const format_list_bullets_rtl = (formatListBulletsRTL); ;// ./node_modules/@wordpress/icons/build-module/library/format-list-bullets.js /** * WordPress dependencies */ const formatListBullets = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) }); /* harmony default export */ const format_list_bullets = (formatListBullets); ;// ./node_modules/@wordpress/icons/build-module/library/format-list-numbered-rtl.js /** * WordPress dependencies */ const formatListNumberedRTL = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z" }) }); /* harmony default export */ const format_list_numbered_rtl = (formatListNumberedRTL); ;// ./node_modules/@wordpress/icons/build-module/library/format-list-numbered.js /** * WordPress dependencies */ const formatListNumbered = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z" }) }); /* harmony default export */ const format_list_numbered = (formatListNumbered); ;// external ["wp","deprecated"] const external_wp_deprecated_namespaceObject = window["wp"]["deprecated"]; var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_namespaceObject); ;// ./node_modules/@wordpress/block-library/build-module/list/ordered-list-settings.js /** * WordPress dependencies */ const OrderedListSettings = ({ setAttributes, reversed, start, type }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('List style'), options: [{ label: (0,external_wp_i18n_namespaceObject.__)('Numbers'), value: 'decimal' }, { label: (0,external_wp_i18n_namespaceObject.__)('Uppercase letters'), value: 'upper-alpha' }, { label: (0,external_wp_i18n_namespaceObject.__)('Lowercase letters'), value: 'lower-alpha' }, { label: (0,external_wp_i18n_namespaceObject.__)('Uppercase Roman numerals'), value: 'upper-roman' }, { label: (0,external_wp_i18n_namespaceObject.__)('Lowercase Roman numerals'), value: 'lower-roman' }], value: type, onChange: newValue => setAttributes({ type: newValue }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Start value'), type: "number", onChange: value => { const int = parseInt(value, 10); setAttributes({ // It should be possible to unset the value, // e.g. with an empty string. start: isNaN(int) ? undefined : int }); }, value: Number.isInteger(start) ? start.toString(10) : '', step: "1" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Reverse order'), checked: reversed || false, onChange: value => { setAttributes({ // Unset the attribute if not reversed. reversed: value || undefined }); } })] }) }); /* harmony default export */ const ordered_list_settings = (OrderedListSettings); ;// ./node_modules/@wordpress/block-library/build-module/list/tag-name.js /** * WordPress dependencies */ function TagName(props, ref) { const { ordered, ...extraProps } = props; const Tag = ordered ? 'ol' : 'ul'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ref: ref, ...extraProps }); } /* harmony default export */ const tag_name = ((0,external_wp_element_namespaceObject.forwardRef)(TagName)); ;// ./node_modules/@wordpress/block-library/build-module/list/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const list_edit_DEFAULT_BLOCK = { name: 'core/list-item' }; const list_edit_TEMPLATE = [['core/list-item']]; const NATIVE_MARGIN_SPACING = 8; /** * At the moment, deprecations don't handle create blocks from attributes * (like when using CPT templates). For this reason, this hook is necessary * to avoid breaking templates using the old list block format. * * @param {Object} attributes Block attributes. * @param {string} clientId Block client ID. */ function useMigrateOnLoad(attributes, clientId) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { updateBlockAttributes, replaceInnerBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { // As soon as the block is loaded, migrate it to the new version. if (!attributes.values) { return; } const [newAttributes, newInnerBlocks] = migrateToListV2(attributes); external_wp_deprecated_default()('Value attribute on the list block', { since: '6.0', version: '6.5', alternative: 'inner blocks' }); registry.batch(() => { updateBlockAttributes(clientId, newAttributes); replaceInnerBlocks(clientId, newInnerBlocks); }); }, [attributes.values]); } function useOutdentList(clientId) { const { replaceBlocks, selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { getBlockRootClientId, getBlockAttributes, getBlock } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); return (0,external_wp_element_namespaceObject.useCallback)(() => { const parentBlockId = getBlockRootClientId(clientId); const parentBlockAttributes = getBlockAttributes(parentBlockId); // Create a new parent block without the inner blocks. const newParentBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', parentBlockAttributes); const { innerBlocks } = getBlock(clientId); // Replace the parent block with a new parent block without inner blocks, // and make the inner blocks siblings of the parent. replaceBlocks([parentBlockId], [newParentBlock, ...innerBlocks]); // Select the last child of the list being outdent. selectionChange(innerBlocks[innerBlocks.length - 1].clientId); }, [clientId]); } function IndentUI({ clientId }) { const outdentList = useOutdentList(clientId); const canOutdent = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId, getBlockName } = select(external_wp_blockEditor_namespaceObject.store); return getBlockName(getBlockRootClientId(clientId)) === 'core/list-item'; }, [clientId]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent, title: (0,external_wp_i18n_namespaceObject.__)('Outdent'), description: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'), disabled: !canOutdent, onClick: outdentList }) }); } function list_edit_Edit({ attributes, setAttributes, clientId, style }) { const { ordered, type, reversed, start } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ style: { ...(external_wp_element_namespaceObject.Platform.isNative && style), listStyleType: ordered && type !== 'decimal' ? type : undefined } }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { defaultBlock: list_edit_DEFAULT_BLOCK, directInsert: true, template: list_edit_TEMPLATE, templateLock: false, templateInsertUpdatesSelection: true, ...(external_wp_element_namespaceObject.Platform.isNative && { marginVertical: NATIVE_MARGIN_SPACING, marginHorizontal: NATIVE_MARGIN_SPACING, renderAppender: false }), __experimentalCaptureToolbars: true }); useMigrateOnLoad(attributes, clientId); const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_bullets_rtl : format_list_bullets, title: (0,external_wp_i18n_namespaceObject.__)('Unordered'), description: (0,external_wp_i18n_namespaceObject.__)('Convert to unordered list'), isActive: ordered === false, onClick: () => { setAttributes({ ordered: false }); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_list_numbered_rtl : format_list_numbered, title: (0,external_wp_i18n_namespaceObject.__)('Ordered'), description: (0,external_wp_i18n_namespaceObject.__)('Convert to ordered list'), isActive: ordered === true, onClick: () => { setAttributes({ ordered: true }); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(IndentUI, { clientId: clientId })] }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(tag_name, { ordered: ordered, reversed: reversed, start: start, ...innerBlocksProps }), controls, ordered && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ordered_list_settings, { setAttributes, reversed, start, type })] }); } ;// ./node_modules/@wordpress/block-library/build-module/list/save.js /** * WordPress dependencies */ function list_save_save({ attributes }) { const { ordered, type, reversed, start } = attributes; const TagName = ordered ? 'ol' : 'ul'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ reversed, start, style: { listStyleType: ordered && type !== 'decimal' ? type : undefined } }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } ;// ./node_modules/@wordpress/block-library/build-module/list/transforms.js /** * WordPress dependencies */ /** * Internal dependencies */ function getListContentSchema({ phrasingContentSchema }) { const listContentSchema = { ...phrasingContentSchema, ul: {}, ol: { attributes: ['type', 'start', 'reversed'] } }; // Recursion is needed. // Possible: ul > li > ul. // Impossible: ul > ul. ['ul', 'ol'].forEach(tag => { listContentSchema[tag].children = { li: { children: listContentSchema } }; }); return listContentSchema; } function getListContentFlat(blocks) { return blocks.flatMap(({ name, attributes, innerBlocks = [] }) => { if (name === 'core/list-item') { return [attributes.content, ...getListContentFlat(innerBlocks)]; } return getListContentFlat(innerBlocks); }); } const list_transforms_transforms = { from: [{ type: 'block', isMultiBlock: true, blocks: ['core/paragraph', 'core/heading'], transform: blockAttributes => { let childBlocks = []; if (blockAttributes.length > 1) { childBlocks = blockAttributes.map(({ content }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { content }); }); } else if (blockAttributes.length === 1) { const value = (0,external_wp_richText_namespaceObject.create)({ html: blockAttributes[0].content }); childBlocks = (0,external_wp_richText_namespaceObject.split)(value, '\n').map(result => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { content: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: result }) }); }); } return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { anchor: blockAttributes.anchor }, childBlocks); } }, { type: 'raw', selector: 'ol,ul', schema: args => ({ ol: getListContentSchema(args).ol, ul: getListContentSchema(args).ul }), transform: createListBlockFromDOMElement }, ...['*', '-'].map(prefix => ({ type: 'prefix', prefix, transform(content) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { content })]); } })), ...['1.', '1)'].map(prefix => ({ type: 'prefix', prefix, transform(content) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { ordered: true }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/list-item', { content })]); } }))], to: [...['core/paragraph', 'core/heading'].map(block => ({ type: 'block', blocks: [block], transform: (_attributes, childBlocks) => { return getListContentFlat(childBlocks).map(content => (0,external_wp_blocks_namespaceObject.createBlock)(block, { content })); } }))] }; /* harmony default export */ const list_transforms = (list_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/list/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const list_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/list", title: "List", category: "text", allowedBlocks: ["core/list-item"], description: "An organized collection of items displayed in a specific order.", keywords: ["bullet list", "ordered list", "numbered list"], textdomain: "default", attributes: { ordered: { type: "boolean", "default": false, role: "content" }, values: { type: "string", source: "html", selector: "ol,ul", multiline: "li", __unstableMultilineWrapperTags: ["ol", "ul"], "default": "", role: "content" }, type: { type: "string" }, start: { type: "number" }, reversed: { type: "boolean" }, placeholder: { type: "string" } }, supports: { anchor: true, html: false, __experimentalBorder: { color: true, radius: true, style: true, width: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, __unstablePasteTextInline: true, __experimentalOnMerge: true, __experimentalSlashInserter: true, interactivity: { clientNavigation: true } }, selectors: { border: ".wp-block-list:not(.wp-block-list .wp-block-list)" }, editorStyle: "wp-block-list-editor", style: "wp-block-list" }; const { name: list_name } = list_metadata; const list_settings = { icon: library_list, example: { innerBlocks: [{ name: 'core/list-item', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('Alice.') } }, { name: 'core/list-item', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('The White Rabbit.') } }, { name: 'core/list-item', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('The Cheshire Cat.') } }, { name: 'core/list-item', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('The Mad Hatter.') } }, { name: 'core/list-item', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('The Queen of Hearts.') } }] }, transforms: list_transforms, edit: list_edit_Edit, save: list_save_save, deprecated: list_deprecated }; const list_init = () => initBlock({ name: list_name, metadata: list_metadata, settings: list_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/list-item.js /** * WordPress dependencies */ const listItem = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 11v1.5h8V11h-8zm-6-1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) }); /* harmony default export */ const list_item = (listItem); ;// ./node_modules/@wordpress/icons/build-module/library/format-indent-rtl.js /** * WordPress dependencies */ const formatIndentRTL = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z" }) }); /* harmony default export */ const format_indent_rtl = (formatIndentRTL); ;// ./node_modules/@wordpress/icons/build-module/library/format-indent.js /** * WordPress dependencies */ const formatIndent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z" }) }); /* harmony default export */ const format_indent = (formatIndent); ;// ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-indent-list-item.js /** * WordPress dependencies */ function useIndentListItem(clientId) { const { replaceBlocks, selectionChange, multiSelect } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { getBlock, getPreviousBlockClientId, getSelectionStart, getSelectionEnd, hasMultiSelection, getMultiSelectedBlockClientIds } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); return (0,external_wp_element_namespaceObject.useCallback)(() => { const _hasMultiSelection = hasMultiSelection(); const clientIds = _hasMultiSelection ? getMultiSelectedBlockClientIds() : [clientId]; const clonedBlocks = clientIds.map(_clientId => (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(_clientId))); const previousSiblingId = getPreviousBlockClientId(clientId); const newListItem = (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(previousSiblingId)); // If the sibling has no innerBlocks, create a new `list` block. if (!newListItem.innerBlocks?.length) { newListItem.innerBlocks = [(0,external_wp_blocks_namespaceObject.createBlock)('core/list')]; } // A list item usually has one `list`, but it's possible to have // more. So we need to preserve the previous `list` blocks and // merge the new blocks to the last `list`. newListItem.innerBlocks[newListItem.innerBlocks.length - 1].innerBlocks.push(...clonedBlocks); // We get the selection start/end here, because when // we replace blocks, the selection is updated too. const selectionStart = getSelectionStart(); const selectionEnd = getSelectionEnd(); // Replace the previous sibling of the block being indented and the indented blocks, // with a new block whose attributes are equal to the ones of the previous sibling and // whose descendants are the children of the previous sibling, followed by the indented blocks. replaceBlocks([previousSiblingId, ...clientIds], [newListItem]); if (!_hasMultiSelection) { selectionChange(clonedBlocks[0].clientId, selectionEnd.attributeKey, selectionEnd.clientId === selectionStart.clientId ? selectionStart.offset : selectionEnd.offset, selectionEnd.offset); } else { multiSelect(clonedBlocks[0].clientId, clonedBlocks[clonedBlocks.length - 1].clientId); } return true; }, [clientId]); } ;// ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-outdent-list-item.js /** * WordPress dependencies */ function useOutdentListItem() { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { moveBlocksToPosition, removeBlock, insertBlock, updateBlockListSettings } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { getBlockRootClientId, getBlockName, getBlockOrder, getBlockIndex, getSelectedBlockClientIds, getBlock, getBlockListSettings } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); function getParentListItemId(id) { const listId = getBlockRootClientId(id); const parentListItemId = getBlockRootClientId(listId); if (!parentListItemId) { return; } if (getBlockName(parentListItemId) !== 'core/list-item') { return; } return parentListItemId; } return (0,external_wp_element_namespaceObject.useCallback)((clientIds = getSelectedBlockClientIds()) => { if (!Array.isArray(clientIds)) { clientIds = [clientIds]; } if (!clientIds.length) { return; } const firstClientId = clientIds[0]; // Can't outdent if it's not a list item. if (getBlockName(firstClientId) !== 'core/list-item') { return; } const parentListItemId = getParentListItemId(firstClientId); // Can't outdent if it's at the top level. if (!parentListItemId) { return; } const parentListId = getBlockRootClientId(firstClientId); const lastClientId = clientIds[clientIds.length - 1]; const order = getBlockOrder(parentListId); const followingListItems = order.slice(getBlockIndex(lastClientId) + 1); registry.batch(() => { if (followingListItems.length) { let nestedListId = getBlockOrder(firstClientId)[0]; if (!nestedListId) { const nestedListBlock = (0,external_wp_blocks_namespaceObject.cloneBlock)(getBlock(parentListId), {}, []); nestedListId = nestedListBlock.clientId; insertBlock(nestedListBlock, 0, firstClientId, false); // Immediately update the block list settings, otherwise // blocks can't be moved here due to canInsert checks. updateBlockListSettings(nestedListId, getBlockListSettings(parentListId)); } moveBlocksToPosition(followingListItems, parentListId, nestedListId); } moveBlocksToPosition(clientIds, parentListId, getBlockRootClientId(parentListItemId), getBlockIndex(parentListItemId) + 1); if (!getBlockOrder(parentListId).length) { const shouldSelectParent = false; removeBlock(parentListId, shouldSelectParent); } }); return true; }, []); } ;// ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-enter.js /** * WordPress dependencies */ /** * Internal dependencies */ function use_enter_useEnter(props) { const { replaceBlocks, selectionChange } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { getBlock, getBlockRootClientId, getBlockIndex, getBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); propsRef.current = props; const outdentListItem = useOutdentListItem(); return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { function onKeyDown(event) { if (event.defaultPrevented || event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { return; } const { content, clientId } = propsRef.current; if (content.length) { return; } event.preventDefault(); const canOutdent = getBlockName(getBlockRootClientId(getBlockRootClientId(propsRef.current.clientId))) === 'core/list-item'; if (canOutdent) { outdentListItem(); return; } // Here we are in top level list so we need to split. const topParentListBlock = getBlock(getBlockRootClientId(clientId)); const blockIndex = getBlockIndex(clientId); const head = (0,external_wp_blocks_namespaceObject.cloneBlock)({ ...topParentListBlock, innerBlocks: topParentListBlock.innerBlocks.slice(0, blockIndex) }); const middle = (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)()); // Last list item might contain a `list` block innerBlock // In that case append remaining innerBlocks blocks. const after = [...(topParentListBlock.innerBlocks[blockIndex].innerBlocks[0]?.innerBlocks || []), ...topParentListBlock.innerBlocks.slice(blockIndex + 1)]; const tail = after.length ? [(0,external_wp_blocks_namespaceObject.cloneBlock)({ ...topParentListBlock, innerBlocks: after })] : []; replaceBlocks(topParentListBlock.clientId, [head, middle, ...tail], 1); // We manually change the selection here because we are replacing // a different block than the selected one. selectionChange(middle.clientId); } element.addEventListener('keydown', onKeyDown); return () => { element.removeEventListener('keydown', onKeyDown); }; }, []); } ;// ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-space.js /** * WordPress dependencies */ /** * Internal dependencies */ function useSpace(clientId) { const { getSelectionStart, getSelectionEnd, getBlockIndex } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const indentListItem = useIndentListItem(clientId); const outdentListItem = useOutdentListItem(); return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { function onKeyDown(event) { const { keyCode, shiftKey, altKey, metaKey, ctrlKey } = event; if (event.defaultPrevented || keyCode !== external_wp_keycodes_namespaceObject.SPACE && keyCode !== external_wp_keycodes_namespaceObject.TAB || // Only override when no modifiers are pressed. altKey || metaKey || ctrlKey) { return; } const selectionStart = getSelectionStart(); const selectionEnd = getSelectionEnd(); if (selectionStart.offset === 0 && selectionEnd.offset === 0) { if (shiftKey) { // Note that backspace behaviour in defined in onMerge. if (keyCode === external_wp_keycodes_namespaceObject.TAB) { if (outdentListItem()) { event.preventDefault(); } } } else if (getBlockIndex(clientId) !== 0) { if (indentListItem()) { event.preventDefault(); } } } } element.addEventListener('keydown', onKeyDown); return () => { element.removeEventListener('keydown', onKeyDown); }; }, [clientId, indentListItem]); } ;// ./node_modules/@wordpress/block-library/build-module/list-item/hooks/use-merge.js /** * WordPress dependencies */ /** * Internal dependencies */ function useMerge(clientId, onMerge) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { getPreviousBlockClientId, getNextBlockClientId, getBlockOrder, getBlockRootClientId, getBlockName } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const { mergeBlocks, moveBlocksToPosition } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const outdentListItem = useOutdentListItem(); function getTrailingId(id) { const order = getBlockOrder(id); if (!order.length) { return id; } return getTrailingId(order[order.length - 1]); } function getParentListItemId(id) { const listId = getBlockRootClientId(id); const parentListItemId = getBlockRootClientId(listId); if (!parentListItemId) { return; } if (getBlockName(parentListItemId) !== 'core/list-item') { return; } return parentListItemId; } /** * Return the next list item with respect to the given list item. If none, * return the next list item of the parent list item if it exists. * * @param {string} id A list item client ID. * @return {?string} The client ID of the next list item. */ function _getNextId(id) { const next = getNextBlockClientId(id); if (next) { return next; } const parentListItemId = getParentListItemId(id); if (!parentListItemId) { return; } return _getNextId(parentListItemId); } /** * Given a client ID, return the client ID of the list item on the next * line, regardless of indentation level. * * @param {string} id The client ID of the current list item. * @return {?string} The client ID of the next list item. */ function getNextId(id) { const order = getBlockOrder(id); // If the list item does not have a nested list, return the next list // item. if (!order.length) { return _getNextId(id); } // Get the first list item in the nested list. return getBlockOrder(order[0])[0]; } return forward => { function mergeWithNested(clientIdA, clientIdB) { registry.batch(() => { // When merging a sub list item with a higher next list item, we // also need to move any nested list items. Check if there's a // listed list, and append its nested list items to the current // list. const [nestedListClientId] = getBlockOrder(clientIdB); if (nestedListClientId) { // If we are merging with the previous list item, and the // previous list item does not have nested list, move the // nested list to the previous list item. if (getPreviousBlockClientId(clientIdB) === clientIdA && !getBlockOrder(clientIdA).length) { moveBlocksToPosition([nestedListClientId], clientIdB, clientIdA); } else { moveBlocksToPosition(getBlockOrder(nestedListClientId), nestedListClientId, getBlockRootClientId(clientIdA)); } } mergeBlocks(clientIdA, clientIdB); }); } if (forward) { const nextBlockClientId = getNextId(clientId); if (!nextBlockClientId) { onMerge(forward); return; } if (getParentListItemId(nextBlockClientId)) { outdentListItem(nextBlockClientId); } else { mergeWithNested(clientId, nextBlockClientId); } } else { // Merging is only done from the top level. For lowel levels, the // list item is outdented instead. const previousBlockClientId = getPreviousBlockClientId(clientId); if (getParentListItemId(clientId)) { outdentListItem(clientId); } else if (previousBlockClientId) { const trailingId = getTrailingId(previousBlockClientId); mergeWithNested(trailingId, clientId); } else { onMerge(forward); } } }; } ;// ./node_modules/@wordpress/block-library/build-module/list-item/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ function edit_IndentUI({ clientId }) { const indentListItem = useIndentListItem(clientId); const outdentListItem = useOutdentListItem(); const { canIndent, canOutdent } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockIndex, getBlockRootClientId, getBlockName } = select(external_wp_blockEditor_namespaceObject.store); return { canIndent: getBlockIndex(clientId) > 0, canOutdent: getBlockName(getBlockRootClientId(getBlockRootClientId(clientId))) === 'core/list-item' }; }, [clientId]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_outdent_rtl : format_outdent, title: (0,external_wp_i18n_namespaceObject.__)('Outdent'), description: (0,external_wp_i18n_namespaceObject.__)('Outdent list item'), disabled: !canOutdent, onClick: () => outdentListItem() }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? format_indent_rtl : format_indent, title: (0,external_wp_i18n_namespaceObject.__)('Indent'), description: (0,external_wp_i18n_namespaceObject.__)('Indent list item'), disabled: !canIndent, onClick: () => indentListItem() })] }); } function ListItemEdit({ attributes, setAttributes, clientId, mergeBlocks }) { const { placeholder, content } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { renderAppender: false, __unstableDisableDropZone: true }); const useEnterRef = use_enter_useEnter({ content, clientId }); const useSpaceRef = useSpace(clientId); const onMerge = useMerge(clientId, mergeBlocks); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { ...innerBlocksProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([useEnterRef, useSpaceRef]), identifier: "content", tagName: "div", onChange: nextContent => setAttributes({ content: nextContent }), value: content, "aria-label": (0,external_wp_i18n_namespaceObject.__)('List text'), placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('List'), onMerge: onMerge }), innerBlocksProps.children] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_IndentUI, { clientId: clientId }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/list-item/save.js /** * WordPress dependencies */ function list_item_save_save({ attributes }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: attributes.content }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {})] }); } ;// ./node_modules/@wordpress/block-library/build-module/list-item/transforms.js /** * WordPress dependencies */ const list_item_transforms_transforms = { to: [{ type: 'block', blocks: ['core/paragraph'], transform: (attributes, innerBlocks = []) => [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes), ...innerBlocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block))] }] }; /* harmony default export */ const list_item_transforms = (list_item_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/list-item/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const list_item_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/list-item", title: "List Item", category: "text", parent: ["core/list"], allowedBlocks: ["core/list"], description: "An individual item within a list.", textdomain: "default", attributes: { placeholder: { type: "string" }, content: { type: "rich-text", source: "rich-text", selector: "li", role: "content" } }, supports: { anchor: true, className: false, splitting: true, __experimentalBorder: { color: true, radius: true, style: true, width: true }, color: { gradients: true, link: true, background: true, __experimentalDefaultControls: { text: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, selectors: { root: ".wp-block-list > li", border: ".wp-block-list:not(.wp-block-list .wp-block-list) > li" } }; const { name: list_item_name } = list_item_metadata; const list_item_settings = { icon: list_item, edit: ListItemEdit, save: list_item_save_save, merge(attributes, attributesToMerge) { return { ...attributes, content: attributes.content + attributesToMerge.content }; }, transforms: list_item_transforms, [unlock(external_wp_blockEditor_namespaceObject.privateApis).requiresWrapperOnCopy]: true }; const list_item_init = () => initBlock({ name: list_item_name, metadata: list_item_metadata, settings: list_item_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/login.js /** * WordPress dependencies */ const login = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z" }) }); /* harmony default export */ const library_login = (login); ;// ./node_modules/@wordpress/block-library/build-module/loginout/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ function LoginOutEdit({ attributes, setAttributes }) { const { displayLoginAsForm, redirectToCurrent } = attributes; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ displayLoginAsForm: false, redirectToCurrent: true }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Display login as form'), isShownByDefault: true, hasValue: () => displayLoginAsForm, onDeselect: () => setAttributes({ displayLoginAsForm: false }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display login as form'), checked: displayLoginAsForm, onChange: () => setAttributes({ displayLoginAsForm: !displayLoginAsForm }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Redirect to current URL'), isShownByDefault: true, hasValue: () => !redirectToCurrent, onDeselect: () => setAttributes({ redirectToCurrent: true }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Redirect to current URL'), checked: redirectToCurrent, onChange: () => setAttributes({ redirectToCurrent: !redirectToCurrent }) }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: 'logged-in' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#login-pseudo-link", children: (0,external_wp_i18n_namespaceObject.__)('Log out') }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/loginout/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const loginout_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/loginout", title: "Login/out", category: "theme", description: "Show login & logout links.", keywords: ["login", "logout", "form"], textdomain: "default", attributes: { displayLoginAsForm: { type: "boolean", "default": false }, redirectToCurrent: { type: "boolean", "default": true } }, example: { viewportWidth: 350 }, supports: { className: true, color: { background: true, text: false, gradients: true, link: true }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true }, interactivity: { clientNavigation: true } }, style: "wp-block-loginout" }; const { name: loginout_name } = loginout_metadata; const loginout_settings = { icon: library_login, edit: LoginOutEdit }; const loginout_init = () => initBlock({ name: loginout_name, metadata: loginout_metadata, settings: loginout_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/media-and-text.js /** * WordPress dependencies */ const mediaAndText = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M3 6v11.5h8V6H3Zm11 3h7V7.5h-7V9Zm7 3.5h-7V11h7v1.5ZM14 16h7v-1.5h-7V16Z" }) }); /* harmony default export */ const media_and_text = (mediaAndText); ;// ./node_modules/@wordpress/block-library/build-module/media-text/constants.js /** * WordPress dependencies */ const constants_DEFAULT_MEDIA_SIZE_SLUG = 'full'; const WIDTH_CONSTRAINT_PERCENTAGE = 15; const media_text_constants_LINK_DESTINATION_MEDIA = 'media'; const media_text_constants_LINK_DESTINATION_ATTACHMENT = 'attachment'; const constants_TEMPLATE = [['core/paragraph', { placeholder: (0,external_wp_i18n_namespaceObject._x)('Content…', 'content placeholder') }]]; ;// ./node_modules/@wordpress/block-library/build-module/media-text/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const v1ToV5ImageFillStyles = (url, focalPoint) => { return url ? { backgroundImage: `url(${url})`, backgroundPosition: focalPoint ? `${focalPoint.x * 100}% ${focalPoint.y * 100}%` : `50% 50%` } : {}; }; const v6ToV7ImageFillStyles = (url, focalPoint) => { return url ? { backgroundImage: `url(${url})`, backgroundPosition: focalPoint ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : `50% 50%` } : {}; }; const DEFAULT_MEDIA_WIDTH = 50; const noop = () => {}; const media_text_deprecated_migrateCustomColors = attributes => { if (!attributes.customBackgroundColor) { return attributes; } const style = { color: { background: attributes.customBackgroundColor } }; const { customBackgroundColor, ...restAttributes } = attributes; return { ...restAttributes, style }; }; // After align attribute's default was updated this function explicitly sets // the align value for deprecated blocks to the `wide` value which was default // for their versions of this block. const migrateDefaultAlign = attributes => { if (attributes.align) { return attributes; } return { ...attributes, align: 'wide' }; }; const v0Attributes = { align: { type: 'string', default: 'wide' }, mediaAlt: { type: 'string', source: 'attribute', selector: 'figure img', attribute: 'alt', default: '' }, mediaPosition: { type: 'string', default: 'left' }, mediaId: { type: 'number' }, mediaType: { type: 'string' }, mediaWidth: { type: 'number', default: 50 }, isStackedOnMobile: { type: 'boolean', default: false } }; const v4ToV5BlockAttributes = { ...v0Attributes, isStackedOnMobile: { type: 'boolean', default: true }, mediaUrl: { type: 'string', source: 'attribute', selector: 'figure video,figure img', attribute: 'src' }, mediaLink: { type: 'string' }, linkDestination: { type: 'string' }, linkTarget: { type: 'string', source: 'attribute', selector: 'figure a', attribute: 'target' }, href: { type: 'string', source: 'attribute', selector: 'figure a', attribute: 'href' }, rel: { type: 'string', source: 'attribute', selector: 'figure a', attribute: 'rel' }, linkClass: { type: 'string', source: 'attribute', selector: 'figure a', attribute: 'class' }, mediaSizeSlug: { type: 'string' }, verticalAlignment: { type: 'string' }, imageFill: { type: 'boolean' }, focalPoint: { type: 'object' } }; const v6Attributes = { ...v4ToV5BlockAttributes, mediaAlt: { type: 'string', source: 'attribute', selector: 'figure img', attribute: 'alt', default: '', role: 'content' }, mediaId: { type: 'number', role: 'content' }, mediaUrl: { type: 'string', source: 'attribute', selector: 'figure video,figure img', attribute: 'src', role: 'content' }, href: { type: 'string', source: 'attribute', selector: 'figure a', attribute: 'href', role: 'content' }, mediaType: { type: 'string', role: 'content' } }; const v7Attributes = { ...v6Attributes, align: { type: 'string', // v7 changed the default for the `align` attribute. default: 'none' }, // New attribute. useFeaturedImage: { type: 'boolean', default: false } }; const v4ToV5Supports = { anchor: true, align: ['wide', 'full'], html: false, color: { gradients: true, link: true } }; const v6Supports = { ...v4ToV5Supports, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } } }; const v7Supports = { ...v6Supports, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, color: { gradients: true, heading: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, interactivity: { clientNavigation: true } }; // Version with 'none' as the default alignment. // See: https://github.com/WordPress/gutenberg/pull/64981 const media_text_deprecated_v7 = { attributes: v7Attributes, supports: v7Supports, usesContext: ['postId', 'postType'], save({ attributes }) { const { isStackedOnMobile, mediaAlt, mediaPosition, mediaType, mediaUrl, mediaWidth, mediaId, verticalAlignment, imageFill, focalPoint, linkClass, href, linkTarget, rel } = attributes; const mediaSizeSlug = attributes.mediaSizeSlug || constants_DEFAULT_MEDIA_SIZE_SLUG; const newRel = !rel ? undefined : rel; const imageClasses = dist_clsx({ [`wp-image-${mediaId}`]: mediaId && mediaType === 'image', [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image' }); let image = mediaUrl ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: mediaUrl, alt: mediaAlt, className: imageClasses || null }) : null; if (href) { image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }); } const mediaTypeRenders = { image: () => image, video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { controls: true, src: mediaUrl }) }; const className = dist_clsx({ 'has-media-on-the-right': 'right' === mediaPosition, 'is-stacked-on-mobile': isStackedOnMobile, [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment, 'is-image-fill': imageFill }); const backgroundStyles = imageFill ? v6ToV7ImageFillStyles(mediaUrl, focalPoint) : {}; let gridTemplateColumns; if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`; } const style = { gridTemplateColumns }; if ('right' === mediaPosition) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-media-text__content' }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", style: backgroundStyles, children: (mediaTypeRenders[mediaType] || noop)() })] }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", style: backgroundStyles, children: (mediaTypeRenders[mediaType] || noop)() }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-media-text__content' }) })] }); } }; // Version with wide as the default alignment. // See: https://github.com/WordPress/gutenberg/pull/48404 const media_text_deprecated_v6 = { attributes: v6Attributes, supports: v6Supports, save({ attributes }) { const { isStackedOnMobile, mediaAlt, mediaPosition, mediaType, mediaUrl, mediaWidth, mediaId, verticalAlignment, imageFill, focalPoint, linkClass, href, linkTarget, rel } = attributes; const mediaSizeSlug = attributes.mediaSizeSlug || constants_DEFAULT_MEDIA_SIZE_SLUG; const newRel = !rel ? undefined : rel; const imageClasses = dist_clsx({ [`wp-image-${mediaId}`]: mediaId && mediaType === 'image', [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image' }); let image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: mediaUrl, alt: mediaAlt, className: imageClasses || null }); if (href) { image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }); } const mediaTypeRenders = { image: () => image, video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { controls: true, src: mediaUrl }) }; const className = dist_clsx({ 'has-media-on-the-right': 'right' === mediaPosition, 'is-stacked-on-mobile': isStackedOnMobile, [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment, 'is-image-fill': imageFill }); const backgroundStyles = imageFill ? v6ToV7ImageFillStyles(mediaUrl, focalPoint) : {}; let gridTemplateColumns; if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`; } const style = { gridTemplateColumns }; if ('right' === mediaPosition) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-media-text__content' }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", style: backgroundStyles, children: (mediaTypeRenders[mediaType] || noop)() })] }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", style: backgroundStyles, children: (mediaTypeRenders[mediaType] || noop)() }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-media-text__content' }) })] }); }, migrate: migrateDefaultAlign, isEligible(attributes, innerBlocks, { block }) { const { attributes: finalizedAttributes } = block; // When the align attribute defaults to none, valid block markup should // not contain any alignment CSS class. Unfortunately, this // deprecation's version of the block won't be invalidated due to the // alignwide class still being in the markup. That is because the custom // CSS classname support picks it up and adds it to the className // attribute. At the time of parsing, the className attribute won't // contain the alignwide class, hence the need to check the finalized // block attributes. return attributes.align === undefined && !!finalizedAttributes.className?.includes('alignwide'); } }; // Version with non-rounded background position attribute for focal point. // See: https://github.com/WordPress/gutenberg/pull/33915 const media_text_deprecated_v5 = { attributes: v4ToV5BlockAttributes, supports: v4ToV5Supports, save({ attributes }) { const { isStackedOnMobile, mediaAlt, mediaPosition, mediaType, mediaUrl, mediaWidth, mediaId, verticalAlignment, imageFill, focalPoint, linkClass, href, linkTarget, rel } = attributes; const mediaSizeSlug = attributes.mediaSizeSlug || constants_DEFAULT_MEDIA_SIZE_SLUG; const newRel = !rel ? undefined : rel; const imageClasses = dist_clsx({ [`wp-image-${mediaId}`]: mediaId && mediaType === 'image', [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image' }); let image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: mediaUrl, alt: mediaAlt, className: imageClasses || null }); if (href) { image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }); } const mediaTypeRenders = { image: () => image, video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { controls: true, src: mediaUrl }) }; const className = dist_clsx({ 'has-media-on-the-right': 'right' === mediaPosition, 'is-stacked-on-mobile': isStackedOnMobile, [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment, 'is-image-fill': imageFill }); const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; let gridTemplateColumns; if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`; } const style = { gridTemplateColumns }; if ('right' === mediaPosition) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-media-text__content' }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", style: backgroundStyles, children: (mediaTypeRenders[mediaType] || noop)() })] }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", style: backgroundStyles, children: (mediaTypeRenders[mediaType] || noop)() }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-media-text__content' }) })] }); }, migrate: migrateDefaultAlign }; // Version with CSS grid // See: https://github.com/WordPress/gutenberg/pull/40806 const media_text_deprecated_v4 = { attributes: v4ToV5BlockAttributes, supports: v4ToV5Supports, save({ attributes }) { const { isStackedOnMobile, mediaAlt, mediaPosition, mediaType, mediaUrl, mediaWidth, mediaId, verticalAlignment, imageFill, focalPoint, linkClass, href, linkTarget, rel } = attributes; const mediaSizeSlug = attributes.mediaSizeSlug || constants_DEFAULT_MEDIA_SIZE_SLUG; const newRel = !rel ? undefined : rel; const imageClasses = dist_clsx({ [`wp-image-${mediaId}`]: mediaId && mediaType === 'image', [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image' }); let image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: mediaUrl, alt: mediaAlt, className: imageClasses || null }); if (href) { image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }); } const mediaTypeRenders = { image: () => image, video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { controls: true, src: mediaUrl }) }; const className = dist_clsx({ 'has-media-on-the-right': 'right' === mediaPosition, 'is-stacked-on-mobile': isStackedOnMobile, [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment, 'is-image-fill': imageFill }); const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; let gridTemplateColumns; if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`; } const style = { gridTemplateColumns }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", style: backgroundStyles, children: (mediaTypeRenders[mediaType] || noop)() }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-media-text__content' }) })] }); }, migrate: migrateDefaultAlign }; // Version with ad-hoc color attributes // See: https://github.com/WordPress/gutenberg/pull/21169 const media_text_deprecated_v3 = { attributes: { ...v0Attributes, isStackedOnMobile: { type: 'boolean', default: true }, backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, mediaLink: { type: 'string' }, linkDestination: { type: 'string' }, linkTarget: { type: 'string', source: 'attribute', selector: 'figure a', attribute: 'target' }, href: { type: 'string', source: 'attribute', selector: 'figure a', attribute: 'href' }, rel: { type: 'string', source: 'attribute', selector: 'figure a', attribute: 'rel' }, linkClass: { type: 'string', source: 'attribute', selector: 'figure a', attribute: 'class' }, verticalAlignment: { type: 'string' }, imageFill: { type: 'boolean' }, focalPoint: { type: 'object' } }, migrate: (0,external_wp_compose_namespaceObject.compose)(media_text_deprecated_migrateCustomColors, migrateDefaultAlign), save({ attributes }) { const { backgroundColor, customBackgroundColor, isStackedOnMobile, mediaAlt, mediaPosition, mediaType, mediaUrl, mediaWidth, mediaId, verticalAlignment, imageFill, focalPoint, linkClass, href, linkTarget, rel } = attributes; const newRel = !rel ? undefined : rel; let image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: mediaUrl, alt: mediaAlt, className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null }); if (href) { image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }); } const mediaTypeRenders = { image: () => image, video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { controls: true, src: mediaUrl }) }; const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const className = dist_clsx({ 'has-media-on-the-right': 'right' === mediaPosition, 'has-background': backgroundClass || customBackgroundColor, [backgroundClass]: backgroundClass, 'is-stacked-on-mobile': isStackedOnMobile, [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment, 'is-image-fill': imageFill }); const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; let gridTemplateColumns; if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`; } const style = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, gridTemplateColumns }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: className, style: style, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", style: backgroundStyles, children: (mediaTypeRenders[mediaType] || noop)() }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-media-text__content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })] }); } }; // Version with stack on mobile off by default // See: https://github.com/WordPress/gutenberg/pull/14364 const media_text_deprecated_v2 = { attributes: { ...v0Attributes, backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, mediaUrl: { type: 'string', source: 'attribute', selector: 'figure video,figure img', attribute: 'src' }, verticalAlignment: { type: 'string' }, imageFill: { type: 'boolean' }, focalPoint: { type: 'object' } }, migrate: (0,external_wp_compose_namespaceObject.compose)(media_text_deprecated_migrateCustomColors, migrateDefaultAlign), save({ attributes }) { const { backgroundColor, customBackgroundColor, isStackedOnMobile, mediaAlt, mediaPosition, mediaType, mediaUrl, mediaWidth, mediaId, verticalAlignment, imageFill, focalPoint } = attributes; const mediaTypeRenders = { image: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: mediaUrl, alt: mediaAlt, className: mediaId && mediaType === 'image' ? `wp-image-${mediaId}` : null }), video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { controls: true, src: mediaUrl }) }; const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const className = dist_clsx({ 'has-media-on-the-right': 'right' === mediaPosition, [backgroundClass]: backgroundClass, 'is-stacked-on-mobile': isStackedOnMobile, [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment, 'is-image-fill': imageFill }); const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; let gridTemplateColumns; if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`; } const style = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, gridTemplateColumns }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: className, style: style, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", style: backgroundStyles, children: (mediaTypeRenders[mediaType] || noop)() }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-media-text__content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })] }); } }; // Version without the wp-image-#### class on image // See: https://github.com/WordPress/gutenberg/pull/11922 const media_text_deprecated_v1 = { attributes: { ...v0Attributes, backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, mediaUrl: { type: 'string', source: 'attribute', selector: 'figure video,figure img', attribute: 'src' } }, migrate: migrateDefaultAlign, save({ attributes }) { const { backgroundColor, customBackgroundColor, isStackedOnMobile, mediaAlt, mediaPosition, mediaType, mediaUrl, mediaWidth } = attributes; const mediaTypeRenders = { image: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: mediaUrl, alt: mediaAlt }), video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { controls: true, src: mediaUrl }) }; const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const className = dist_clsx({ 'has-media-on-the-right': 'right' === mediaPosition, [backgroundClass]: backgroundClass, 'is-stacked-on-mobile': isStackedOnMobile }); let gridTemplateColumns; if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`; } const style = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, gridTemplateColumns }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: className, style: style, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", children: (mediaTypeRenders[mediaType] || noop)() }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-media-text__content", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) })] }); } }; /* harmony default export */ const media_text_deprecated = ([media_text_deprecated_v7, media_text_deprecated_v6, media_text_deprecated_v5, media_text_deprecated_v4, media_text_deprecated_v3, media_text_deprecated_v2, media_text_deprecated_v1]); ;// ./node_modules/@wordpress/icons/build-module/library/pull-left.js /** * WordPress dependencies */ const pullLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 18h6V6H4v12zm9-9.5V10h7V8.5h-7zm0 7h7V14h-7v1.5z" }) }); /* harmony default export */ const pull_left = (pullLeft); ;// ./node_modules/@wordpress/icons/build-module/library/pull-right.js /** * WordPress dependencies */ const pullRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14 6v12h6V6h-6zM4 10h7V8.5H4V10zm0 5.5h7V14H4v1.5z" }) }); /* harmony default export */ const pull_right = (pullRight); ;// ./node_modules/@wordpress/icons/build-module/library/media.js /** * WordPress dependencies */ const media = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m7 6.5 4 2.5-4 2.5z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z" })] }); /* harmony default export */ const library_media = (media); ;// ./node_modules/@wordpress/block-library/build-module/media-text/image-fill.js function imageFillStyles(url, focalPoint) { return url ? { objectPosition: focalPoint ? `${Math.round(focalPoint.x * 100)}% ${Math.round(focalPoint.y * 100)}%` : `50% 50%` } : {}; } ;// ./node_modules/@wordpress/block-library/build-module/media-text/media-container.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Constants */ const media_container_ALLOWED_MEDIA_TYPES = ['image', 'video']; const media_container_noop = () => {}; const ResizableBoxContainer = (0,external_wp_element_namespaceObject.forwardRef)(({ isSelected, isStackedOnMobile, ...props }, ref) => { const isMobile = (0,external_wp_compose_namespaceObject.useViewportMatch)('small', '<'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { ref: ref, showHandle: isSelected && (!isMobile || !isStackedOnMobile), ...props }); }); function ToolbarEditButton({ mediaId, mediaUrl, onSelectMedia, toggleUseFeaturedImage, useFeaturedImage }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: mediaId, mediaURL: mediaUrl, allowedTypes: media_container_ALLOWED_MEDIA_TYPES, accept: "image/*,video/*", onSelect: onSelectMedia, onToggleFeaturedImage: toggleUseFeaturedImage, useFeaturedImage: useFeaturedImage, onReset: () => onSelectMedia(undefined) }) }); } function PlaceholderContainer({ className, mediaUrl, onSelectMedia, toggleUseFeaturedImage }) { const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const onUploadError = message => { createErrorNotice(message, { type: 'snackbar' }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: library_media }), labels: { title: (0,external_wp_i18n_namespaceObject.__)('Media area') }, className: className, onSelect: onSelectMedia, accept: "image/*,video/*", onToggleFeaturedImage: toggleUseFeaturedImage, allowedTypes: media_container_ALLOWED_MEDIA_TYPES, onError: onUploadError, disableMediaButtons: mediaUrl }); } function MediaContainer(props, ref) { const { className, commitWidthChange, focalPoint, imageFill, isSelected, isStackedOnMobile, mediaAlt, mediaId, mediaPosition, mediaType, mediaUrl, mediaWidth, onSelectMedia, onWidthChange, enableResize, toggleUseFeaturedImage, useFeaturedImage, featuredImageURL, featuredImageAlt, refMedia } = props; const isTemporaryMedia = !mediaId && (0,external_wp_blob_namespaceObject.isBlobURL)(mediaUrl); const { toggleSelection } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); if (mediaUrl || featuredImageURL || useFeaturedImage) { const onResizeStart = () => { toggleSelection(false); }; const onResize = (event, direction, elt) => { onWidthChange(parseInt(elt.style.width)); }; const onResizeStop = (event, direction, elt) => { toggleSelection(true); commitWidthChange(parseInt(elt.style.width)); }; const enablePositions = { right: enableResize && mediaPosition === 'left', left: enableResize && mediaPosition === 'right' }; const positionStyles = mediaType === 'image' && imageFill ? imageFillStyles(mediaUrl || featuredImageURL, focalPoint) : {}; const mediaTypeRenderers = { image: () => useFeaturedImage && featuredImageURL ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { ref: refMedia, src: featuredImageURL, alt: featuredImageAlt, style: positionStyles }) : mediaUrl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { ref: refMedia, src: mediaUrl, alt: mediaAlt, style: positionStyles }), video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { controls: true, ref: refMedia, src: mediaUrl }) }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ResizableBoxContainer, { as: "figure", className: dist_clsx(className, 'editor-media-container__resizer', { 'is-transient': isTemporaryMedia }), size: { width: mediaWidth + '%' }, minWidth: "10%", maxWidth: "100%", enable: enablePositions, onResizeStart: onResizeStart, onResize: onResize, onResizeStop: onResizeStop, axis: "x", isSelected: isSelected, isStackedOnMobile: isStackedOnMobile, ref: ref, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ToolbarEditButton, { onSelectMedia: onSelectMedia, mediaUrl: useFeaturedImage && featuredImageURL ? featuredImageURL : mediaUrl, mediaId: mediaId, toggleUseFeaturedImage: toggleUseFeaturedImage }), (mediaTypeRenderers[mediaType] || media_container_noop)(), isTemporaryMedia && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PlaceholderContainer, { ...props }), !featuredImageURL && useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className: "wp-block-media-text--placeholder-image", style: positionStyles, withIllustration: true })] }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PlaceholderContainer, { ...props }); } /* harmony default export */ const media_container = ((0,external_wp_element_namespaceObject.forwardRef)(MediaContainer)); ;// ./node_modules/@wordpress/block-library/build-module/media-text/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { ResolutionTool: edit_ResolutionTool } = unlock(external_wp_blockEditor_namespaceObject.privateApis); // this limits the resize to a safe zone to avoid making broken layouts const applyWidthConstraints = width => Math.max(WIDTH_CONSTRAINT_PERCENTAGE, Math.min(width, 100 - WIDTH_CONSTRAINT_PERCENTAGE)); function getImageSourceUrlBySizeSlug(image, slug) { // eslint-disable-next-line camelcase return image?.media_details?.sizes?.[slug]?.source_url; } function edit_attributesFromMedia({ attributes: { linkDestination, href }, setAttributes }) { return media => { if (!media || !media.url) { setAttributes({ mediaAlt: undefined, mediaId: undefined, mediaType: undefined, mediaUrl: undefined, mediaLink: undefined, href: undefined, focalPoint: undefined, useFeaturedImage: false }); return; } if ((0,external_wp_blob_namespaceObject.isBlobURL)(media.url)) { media.type = (0,external_wp_blob_namespaceObject.getBlobTypeByURL)(media.url); } let mediaType; let src; // For media selections originated from a file upload. if (media.media_type) { if (media.media_type === 'image') { mediaType = 'image'; } else { // only images and videos are accepted so if the media_type is not an image we can assume it is a video. // video contain the media type of 'file' in the object returned from the rest api. mediaType = 'video'; } } else { // For media selections originated from existing files in the media library. mediaType = media.type; } if (mediaType === 'image') { // Try the "large" size URL, falling back to the "full" size URL below. src = media.sizes?.large?.url || // eslint-disable-next-line camelcase media.media_details?.sizes?.large?.source_url; } let newHref = href; if (linkDestination === media_text_constants_LINK_DESTINATION_MEDIA) { // Update the media link. newHref = media.url; } // Check if the image is linked to the attachment page. if (linkDestination === media_text_constants_LINK_DESTINATION_ATTACHMENT) { // Update the media link. newHref = media.link; } setAttributes({ mediaAlt: media.alt, mediaId: media.id, mediaType, mediaUrl: src || media.url, mediaLink: media.link || undefined, href: newHref, focalPoint: undefined, useFeaturedImage: false }); }; } function MediaTextResolutionTool({ image, value, onChange }) { const { imageSizes } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); return { imageSizes: getSettings().imageSizes }; }, []); if (!imageSizes?.length) { return null; } const imageSizeOptions = imageSizes.filter(({ slug }) => getImageSourceUrlBySizeSlug(image, slug)).map(({ name, slug }) => ({ value: slug, label: name })); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_ResolutionTool, { value: value, defaultValue: constants_DEFAULT_MEDIA_SIZE_SLUG, options: imageSizeOptions, onChange: onChange }); } function MediaTextEdit({ attributes, isSelected, setAttributes, context: { postId, postType } }) { const { focalPoint, href, imageFill, isStackedOnMobile, linkClass, linkDestination, linkTarget, mediaAlt, mediaId, mediaPosition, mediaType, mediaUrl, mediaWidth, mediaSizeSlug, rel, verticalAlignment, allowedBlocks, useFeaturedImage } = attributes; const [featuredImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'featured_media', postId); const { featuredImageMedia } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { featuredImageMedia: featuredImage && useFeaturedImage ? select(external_wp_coreData_namespaceObject.store).getMedia(featuredImage, { context: 'view' }) : undefined }; }, [featuredImage, useFeaturedImage]); const { image } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { image: mediaId && isSelected ? select(external_wp_coreData_namespaceObject.store).getMedia(mediaId, { context: 'view' }) : null }; }, [isSelected, mediaId]); const featuredImageURL = useFeaturedImage ? featuredImageMedia?.source_url : ''; const featuredImageAlt = useFeaturedImage ? featuredImageMedia?.alt_text : ''; const toggleUseFeaturedImage = () => { setAttributes({ imageFill: false, mediaType: 'image', mediaId: undefined, mediaUrl: undefined, mediaAlt: undefined, mediaLink: undefined, linkDestination: undefined, linkTarget: undefined, linkClass: undefined, rel: undefined, href: undefined, useFeaturedImage: !useFeaturedImage }); }; const refMedia = (0,external_wp_element_namespaceObject.useRef)(); const imperativeFocalPointPreview = value => { const { style } = refMedia.current; const { x, y } = value; style.objectPosition = `${x * 100}% ${y * 100}%`; }; const [temporaryMediaWidth, setTemporaryMediaWidth] = (0,external_wp_element_namespaceObject.useState)(null); const onSelectMedia = edit_attributesFromMedia({ attributes, setAttributes }); const onSetHref = props => { setAttributes(props); }; const onWidthChange = width => { setTemporaryMediaWidth(applyWidthConstraints(width)); }; const commitWidthChange = width => { setAttributes({ mediaWidth: applyWidthConstraints(width) }); setTemporaryMediaWidth(null); }; const classNames = dist_clsx({ 'has-media-on-the-right': 'right' === mediaPosition, 'is-selected': isSelected, 'is-stacked-on-mobile': isStackedOnMobile, [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment, 'is-image-fill-element': imageFill }); const widthString = `${temporaryMediaWidth || mediaWidth}%`; const gridTemplateColumns = 'right' === mediaPosition ? `1fr ${widthString}` : `${widthString} 1fr`; const style = { gridTemplateColumns, msGridColumns: gridTemplateColumns }; const onMediaAltChange = newMediaAlt => { setAttributes({ mediaAlt: newMediaAlt }); }; const onVerticalAlignmentChange = alignment => { setAttributes({ verticalAlignment: alignment }); }; const updateImage = newMediaSizeSlug => { const newUrl = getImageSourceUrlBySizeSlug(image, newMediaSizeSlug); if (!newUrl) { return null; } setAttributes({ mediaUrl: newUrl, mediaSizeSlug: newMediaSizeSlug }); }; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const mediaTextGeneralSettings = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ isStackedOnMobile: true, imageFill: false, mediaAlt: '', focalPoint: undefined, mediaWidth: 50, mediaSizeSlug: undefined }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Media width'), isShownByDefault: true, hasValue: () => mediaWidth !== 50, onDeselect: () => setAttributes({ mediaWidth: 50 }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Media width'), value: temporaryMediaWidth || mediaWidth, onChange: commitWidthChange, min: WIDTH_CONSTRAINT_PERCENTAGE, max: 100 - WIDTH_CONSTRAINT_PERCENTAGE }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), isShownByDefault: true, hasValue: () => !isStackedOnMobile, onDeselect: () => setAttributes({ isStackedOnMobile: true }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Stack on mobile'), checked: isStackedOnMobile, onChange: () => setAttributes({ isStackedOnMobile: !isStackedOnMobile }) }) }), mediaType === 'image' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Crop image to fill'), isShownByDefault: true, hasValue: () => !!imageFill, onDeselect: () => setAttributes({ imageFill: false }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Crop image to fill'), checked: !!imageFill, onChange: () => setAttributes({ imageFill: !imageFill }) }) }), imageFill && (mediaUrl || featuredImageURL) && mediaType === 'image' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), isShownByDefault: true, hasValue: () => !!focalPoint, onDeselect: () => setAttributes({ focalPoint: undefined }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FocalPointPicker, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Focal point'), url: useFeaturedImage && featuredImageURL ? featuredImageURL : mediaUrl, value: focalPoint, onChange: value => setAttributes({ focalPoint: value }), onDragStart: imperativeFocalPointPreview, onDrag: imperativeFocalPointPreview }) }), mediaType === 'image' && mediaUrl && !useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), isShownByDefault: true, hasValue: () => !!mediaAlt, onDeselect: () => setAttributes({ mediaAlt: '' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Alternative text'), value: mediaAlt, onChange: onMediaAltChange, help: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { href: // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. (0,external_wp_i18n_namespaceObject.__)('https://www.w3.org/WAI/tutorials/images/decision-tree/'), children: (0,external_wp_i18n_namespaceObject.__)('Describe the purpose of the image.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("br", {}), (0,external_wp_i18n_namespaceObject.__)('Leave empty if decorative.')] }) }) }), mediaType === 'image' && !useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MediaTextResolutionTool, { image: image, value: mediaSizeSlug, onChange: updateImage })] }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classNames, style }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ className: 'wp-block-media-text__content' }, { template: constants_TEMPLATE, allowedBlocks }); const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: mediaTextGeneralSettings }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockVerticalAlignmentControl, { onChange: onVerticalAlignmentChange, value: verticalAlignment }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: pull_left, title: (0,external_wp_i18n_namespaceObject.__)('Show media on left'), isActive: mediaPosition === 'left', onClick: () => setAttributes({ mediaPosition: 'left' }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: pull_right, title: (0,external_wp_i18n_namespaceObject.__)('Show media on right'), isActive: mediaPosition === 'right', onClick: () => setAttributes({ mediaPosition: 'right' }) })] }), mediaType === 'image' && !useFeaturedImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalImageURLInputUI, { url: href || '', onChangeUrl: onSetHref, linkDestination: linkDestination, mediaType: mediaType, mediaUrl: image && image.source_url, mediaLink: image && image.link, linkTarget: linkTarget, linkClass: linkClass, rel: rel })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [mediaPosition === 'right' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(media_container, { className: "wp-block-media-text__media", onSelectMedia: onSelectMedia, onWidthChange: onWidthChange, commitWidthChange: commitWidthChange, refMedia: refMedia, enableResize: blockEditingMode === 'default', toggleUseFeaturedImage: toggleUseFeaturedImage, focalPoint, imageFill, isSelected, isStackedOnMobile, mediaAlt, mediaId, mediaPosition, mediaType, mediaUrl, mediaWidth, useFeaturedImage, featuredImageURL, featuredImageAlt }), mediaPosition !== 'right' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })] })] }); } /* harmony default export */ const media_text_edit = (MediaTextEdit); ;// ./node_modules/@wordpress/block-library/build-module/media-text/save.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const save_DEFAULT_MEDIA_WIDTH = 50; const save_noop = () => {}; function media_text_save_save({ attributes }) { const { isStackedOnMobile, mediaAlt, mediaPosition, mediaType, mediaUrl, mediaWidth, mediaId, verticalAlignment, imageFill, focalPoint, linkClass, href, linkTarget, rel } = attributes; const mediaSizeSlug = attributes.mediaSizeSlug || constants_DEFAULT_MEDIA_SIZE_SLUG; const newRel = !rel ? undefined : rel; const imageClasses = dist_clsx({ [`wp-image-${mediaId}`]: mediaId && mediaType === 'image', [`size-${mediaSizeSlug}`]: mediaId && mediaType === 'image' }); const positionStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {}; let image = mediaUrl ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: mediaUrl, alt: mediaAlt, className: imageClasses || null, style: positionStyles }) : null; if (href) { image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: linkClass, href: href, target: linkTarget, rel: newRel, children: image }); } const mediaTypeRenders = { image: () => image, video: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("video", { controls: true, src: mediaUrl }) }; const className = dist_clsx({ 'has-media-on-the-right': 'right' === mediaPosition, 'is-stacked-on-mobile': isStackedOnMobile, [`is-vertically-aligned-${verticalAlignment}`]: verticalAlignment, 'is-image-fill-element': imageFill }); let gridTemplateColumns; if (mediaWidth !== save_DEFAULT_MEDIA_WIDTH) { gridTemplateColumns = 'right' === mediaPosition ? `auto ${mediaWidth}%` : `${mediaWidth}% auto`; } const style = { gridTemplateColumns }; if ('right' === mediaPosition) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-media-text__content' }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", children: (mediaTypeRenders[mediaType] || save_noop)() })] }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: "wp-block-media-text__media", children: (mediaTypeRenders[mediaType] || save_noop)() }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save({ className: 'wp-block-media-text__content' }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/media-text/transforms.js /** * WordPress dependencies */ const media_text_transforms_transforms = { from: [{ type: 'block', blocks: ['core/image'], transform: ({ alt, url, id, anchor }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', { mediaAlt: alt, mediaId: id, mediaUrl: url, mediaType: 'image', anchor }) }, { type: 'block', blocks: ['core/video'], transform: ({ src, id, anchor }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', { mediaId: id, mediaUrl: src, mediaType: 'video', anchor }) }, { type: 'block', blocks: ['core/cover'], transform: ({ align, alt, anchor, backgroundType, customGradient, customOverlayColor, gradient, id, overlayColor, style, textColor, url }, innerBlocks) => { let additionalAttributes = {}; if (customGradient) { additionalAttributes = { style: { color: { gradient: customGradient } } }; } else if (customOverlayColor) { additionalAttributes = { style: { color: { background: customOverlayColor } } }; } // Maintain custom text color block support value. if (style?.color?.text) { additionalAttributes.style = { color: { ...additionalAttributes.style?.color, text: style.color.text } }; } return (0,external_wp_blocks_namespaceObject.createBlock)('core/media-text', { align, anchor, backgroundColor: overlayColor, gradient, mediaAlt: alt, mediaId: id, mediaType: backgroundType, mediaUrl: url, textColor, ...additionalAttributes }, innerBlocks); } }], to: [{ type: 'block', blocks: ['core/image'], isMatch: ({ mediaType, mediaUrl }) => { return !mediaUrl || mediaType === 'image'; }, transform: ({ mediaAlt, mediaId, mediaUrl, anchor }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/image', { alt: mediaAlt, id: mediaId, url: mediaUrl, anchor }); } }, { type: 'block', blocks: ['core/video'], isMatch: ({ mediaType, mediaUrl }) => { return !mediaUrl || mediaType === 'video'; }, transform: ({ mediaId, mediaUrl, anchor }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/video', { id: mediaId, src: mediaUrl, anchor }); } }, { type: 'block', blocks: ['core/cover'], transform: ({ align, anchor, backgroundColor, focalPoint, gradient, mediaAlt, mediaId, mediaType, mediaUrl, style, textColor }, innerBlocks) => { const additionalAttributes = {}; // Migrate the background styles or gradient to Cover's custom // gradient and overlay properties. if (style?.color?.gradient) { additionalAttributes.customGradient = style.color.gradient; } else if (style?.color?.background) { additionalAttributes.customOverlayColor = style.color.background; } // Maintain custom text color support style. if (style?.color?.text) { additionalAttributes.style = { color: { text: style.color.text } }; } const coverAttributes = { align, alt: mediaAlt, anchor, backgroundType: mediaType, dimRatio: !!mediaUrl ? 50 : 100, focalPoint, gradient, id: mediaId, overlayColor: backgroundColor, textColor, url: mediaUrl, ...additionalAttributes }; return (0,external_wp_blocks_namespaceObject.createBlock)('core/cover', coverAttributes, innerBlocks); } }] }; /* harmony default export */ const media_text_transforms = (media_text_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/media-text/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const media_text_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/media-text", title: "Media & Text", category: "media", description: "Set media and words side-by-side for a richer layout.", keywords: ["image", "video"], textdomain: "default", attributes: { align: { type: "string", "default": "none" }, mediaAlt: { type: "string", source: "attribute", selector: "figure img", attribute: "alt", "default": "", role: "content" }, mediaPosition: { type: "string", "default": "left" }, mediaId: { type: "number", role: "content" }, mediaUrl: { type: "string", source: "attribute", selector: "figure video,figure img", attribute: "src", role: "content" }, mediaLink: { type: "string" }, linkDestination: { type: "string" }, linkTarget: { type: "string", source: "attribute", selector: "figure a", attribute: "target" }, href: { type: "string", source: "attribute", selector: "figure a", attribute: "href", role: "content" }, rel: { type: "string", source: "attribute", selector: "figure a", attribute: "rel" }, linkClass: { type: "string", source: "attribute", selector: "figure a", attribute: "class" }, mediaType: { type: "string", role: "content" }, mediaWidth: { type: "number", "default": 50 }, mediaSizeSlug: { type: "string" }, isStackedOnMobile: { type: "boolean", "default": true }, verticalAlignment: { type: "string" }, imageFill: { type: "boolean" }, focalPoint: { type: "object" }, allowedBlocks: { type: "array" }, useFeaturedImage: { type: "boolean", "default": false } }, usesContext: ["postId", "postType"], supports: { anchor: true, align: ["wide", "full"], html: false, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, color: { gradients: true, heading: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-media-text-editor", style: "wp-block-media-text" }; const { name: media_text_name } = media_text_metadata; const media_text_settings = { icon: media_and_text, example: { viewportWidth: 601, // Columns collapse "@media (max-width: 600px)". attributes: { mediaType: 'image', mediaUrl: 'https://s.w.org/images/core/5.3/Biologia_Centrali-Americana_-_Cantorchilus_semibadius_1902.jpg' }, innerBlocks: [{ name: 'core/paragraph', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('The wren<br>Earns his living<br>Noiselessly.') } }, { name: 'core/paragraph', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('— Kobayashi Issa (一茶)') } }] }, transforms: media_text_transforms, edit: media_text_edit, save: media_text_save_save, deprecated: media_text_deprecated }; const media_text_init = () => initBlock({ name: media_text_name, metadata: media_text_metadata, settings: media_text_settings }); ;// ./node_modules/@wordpress/block-library/build-module/missing/edit.js /** * WordPress dependencies */ function MissingEdit({ attributes, clientId }) { const { originalName, originalUndelimitedContent } = attributes; const hasContent = !!originalUndelimitedContent; const { hasFreeformBlock, hasHTMLBlock } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canInsertBlockType, getBlockRootClientId } = select(external_wp_blockEditor_namespaceObject.store); return { hasFreeformBlock: canInsertBlockType('core/freeform', getBlockRootClientId(clientId)), hasHTMLBlock: canInsertBlockType('core/html', getBlockRootClientId(clientId)) }; }, [clientId]); const { replaceBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); function convertToHTML() { replaceBlock(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/html', { content: originalUndelimitedContent })); } const actions = []; let messageHTML; const convertToHtmlButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, onClick: convertToHTML, variant: "primary", children: (0,external_wp_i18n_namespaceObject.__)('Keep as HTML') }, "convert"); if (hasContent && !hasFreeformBlock && !originalName) { if (hasHTMLBlock) { messageHTML = (0,external_wp_i18n_namespaceObject.__)('It appears you are trying to use the deprecated Classic block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely. Alternatively, you can refresh the page to use the Classic block.'); actions.push(convertToHtmlButton); } else { messageHTML = (0,external_wp_i18n_namespaceObject.__)('It appears you are trying to use the deprecated Classic block. You can leave this block intact, or remove it entirely. Alternatively, you can refresh the page to use the Classic block.'); } } else if (hasContent && hasHTMLBlock) { messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave it as-is, convert it to custom HTML, or remove it.'), originalName); actions.push(convertToHtmlButton); } else { messageHTML = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ (0,external_wp_i18n_namespaceObject.__)('Your site doesn’t include support for the "%s" block. You can leave it as-is or remove it.'), originalName); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: 'has-warning' }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { actions: actions, children: messageHTML }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: (0,external_wp_dom_namespaceObject.safeHTML)(originalUndelimitedContent) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/missing/save.js /** * WordPress dependencies */ function missing_save_save({ attributes }) { // Preserve the missing block's content. return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: attributes.originalContent }); } ;// ./node_modules/@wordpress/block-library/build-module/missing/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const missing_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/missing", title: "Unsupported", category: "text", description: "Your site doesn\u2019t include support for this block.", textdomain: "default", attributes: { originalName: { type: "string" }, originalUndelimitedContent: { type: "string" }, originalContent: { type: "string", source: "raw" } }, supports: { className: false, customClassName: false, inserter: false, html: false, reusable: false, interactivity: { clientNavigation: true } } }; const { name: missing_name } = missing_metadata; const missing_settings = { name: missing_name, __experimentalLabel(attributes, { context }) { if (context === 'accessibility') { const { originalName } = attributes; const originalBlockType = originalName ? (0,external_wp_blocks_namespaceObject.getBlockType)(originalName) : undefined; if (originalBlockType) { return originalBlockType.settings.title || originalName; } return ''; } }, edit: MissingEdit, save: missing_save_save }; const missing_init = () => initBlock({ name: missing_name, metadata: missing_metadata, settings: missing_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/more.js /** * WordPress dependencies */ const more = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z" }) }); /* harmony default export */ const library_more = (more); ;// ./node_modules/@wordpress/block-library/build-module/more/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const DEFAULT_TEXT = (0,external_wp_i18n_namespaceObject.__)('Read more'); function MoreEdit({ attributes: { customText, noTeaser }, insertBlocksAfter, setAttributes }) { const onChangeInput = event => { setAttributes({ customText: event.target.value }); }; const onKeyDown = ({ keyCode }) => { if (keyCode === external_wp_keycodes_namespaceObject.ENTER) { insertBlocksAfter([(0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())]); } }; const getHideExcerptHelp = checked => checked ? (0,external_wp_i18n_namespaceObject.__)('The excerpt is hidden.') : (0,external_wp_i18n_namespaceObject.__)('The excerpt is visible.'); const toggleHideExcerpt = () => setAttributes({ noTeaser: !noTeaser }); const style = { width: `${(customText ? customText : DEFAULT_TEXT).length + 1.2}em` }; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ noTeaser: false }); }, dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Hide excerpt'), isShownByDefault: true, hasValue: () => noTeaser, onDeselect: () => setAttributes({ noTeaser: false }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Hide the excerpt on the full content page'), checked: !!noTeaser, onChange: toggleHideExcerpt, help: getHideExcerptHelp }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { "aria-label": (0,external_wp_i18n_namespaceObject.__)('“Read more” link text'), type: "text", value: customText, placeholder: DEFAULT_TEXT, onChange: onChangeInput, onKeyDown: onKeyDown, style: style }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/more/save.js /** * WordPress dependencies */ function more_save_save({ attributes: { customText, noTeaser } }) { const moreTag = customText ? `<!--more ${customText}-->` : '<!--more-->'; const noTeaserTag = noTeaser ? '<!--noteaser-->' : ''; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: [moreTag, noTeaserTag].filter(Boolean).join('\n') }); } ;// ./node_modules/@wordpress/block-library/build-module/more/transforms.js /** * WordPress dependencies */ const more_transforms_transforms = { from: [{ type: 'raw', schema: { 'wp-block': { attributes: ['data-block'] } }, isMatch: node => node.dataset && node.dataset.block === 'core/more', transform(node) { const { customText, noTeaser } = node.dataset; const attrs = {}; // Don't copy unless defined and not an empty string. if (customText) { attrs.customText = customText; } // Special handling for boolean. if (noTeaser === '') { attrs.noTeaser = true; } return (0,external_wp_blocks_namespaceObject.createBlock)('core/more', attrs); } }] }; /* harmony default export */ const more_transforms = (more_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/more/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const more_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/more", title: "More", category: "design", description: "Content before this block will be shown in the excerpt on your archives page.", keywords: ["read more"], textdomain: "default", attributes: { customText: { type: "string", "default": "" }, noTeaser: { type: "boolean", "default": false } }, supports: { customClassName: false, className: false, html: false, multiple: false, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-more-editor" }; const { name: more_name } = more_metadata; const more_settings = { icon: library_more, example: {}, __experimentalLabel(attributes, { context }) { const customName = attributes?.metadata?.name; if (context === 'list-view' && customName) { return customName; } if (context === 'accessibility') { return attributes.customText; } }, transforms: more_transforms, edit: MoreEdit, save: more_save_save }; const more_init = () => initBlock({ name: more_name, metadata: more_metadata, settings: more_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/navigation.js /** * WordPress dependencies */ const navigation = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" }) }); /* harmony default export */ const library_navigation = (navigation); ;// external ["wp","a11y"] const external_wp_a11y_namespaceObject = window["wp"]["a11y"]; ;// ./node_modules/@wordpress/icons/build-module/icon/index.js /** * WordPress dependencies */ /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ /** * Return an SVG icon. * * @param {IconProps} props icon is the SVG component to render * size is a number specifying the icon size in pixels * Other props will be passed to wrapped SVG component * @param {import('react').ForwardedRef<HTMLElement>} ref The forwarded ref to the SVG element. * * @return {JSX.Element} Icon component */ function Icon({ icon, size = 24, ...props }, ref) { return (0,external_wp_element_namespaceObject.cloneElement)(icon, { width: size, height: size, ...props, ref }); } /* harmony default export */ const build_module_icon = ((0,external_wp_element_namespaceObject.forwardRef)(Icon)); ;// ./node_modules/@wordpress/icons/build-module/library/close.js /** * WordPress dependencies */ const close_close = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" }) }); /* harmony default export */ const library_close = (close_close); ;// ./node_modules/@wordpress/block-library/build-module/navigation/constants.js const constants_DEFAULT_BLOCK = { name: 'core/navigation-link' }; const PRIORITIZED_INSERTER_BLOCKS = ['core/navigation-link/page', 'core/navigation-link']; // These parameters must be kept aligned with those in // lib/compat/wordpress-6.3/navigation-block-preloading.php // and // edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js const PRELOADED_NAVIGATION_MENUS_QUERY = { per_page: 100, status: ['publish', 'draft'], order: 'desc', orderby: 'date' }; const SELECT_NAVIGATION_MENUS_ARGS = ['postType', 'wp_navigation', PRELOADED_NAVIGATION_MENUS_QUERY]; ;// ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-menu.js /** * WordPress dependencies */ /** * Internal dependencies */ function useNavigationMenu(ref) { const permissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)({ kind: 'postType', name: 'wp_navigation', id: ref }); const { navigationMenu, isNavigationMenuResolved, isNavigationMenuMissing } = (0,external_wp_data_namespaceObject.useSelect)(select => { return selectExistingMenu(select, ref); }, [ref]); const { // Can the user create navigation menus? canCreate: canCreateNavigationMenus, // Can the user update the specific navigation menu with the given post ID? canUpdate: canUpdateNavigationMenu, // Can the user delete the specific navigation menu with the given post ID? canDelete: canDeleteNavigationMenu, isResolving: isResolvingPermissions, hasResolved: hasResolvedPermissions } = permissions; const { records: navigationMenus, isResolving: isResolvingNavigationMenus, hasResolved: hasResolvedNavigationMenus } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', `wp_navigation`, PRELOADED_NAVIGATION_MENUS_QUERY); const canSwitchNavigationMenu = ref ? navigationMenus?.length > 1 : navigationMenus?.length > 0; return { navigationMenu, isNavigationMenuResolved, isNavigationMenuMissing, navigationMenus, isResolvingNavigationMenus, hasResolvedNavigationMenus, canSwitchNavigationMenu, canUserCreateNavigationMenus: canCreateNavigationMenus, isResolvingCanUserCreateNavigationMenus: isResolvingPermissions, hasResolvedCanUserCreateNavigationMenus: hasResolvedPermissions, canUserUpdateNavigationMenu: canUpdateNavigationMenu, hasResolvedCanUserUpdateNavigationMenu: ref ? hasResolvedPermissions : undefined, canUserDeleteNavigationMenu: canDeleteNavigationMenu, hasResolvedCanUserDeleteNavigationMenu: ref ? hasResolvedPermissions : undefined }; } function selectExistingMenu(select, ref) { if (!ref) { return { isNavigationMenuResolved: false, isNavigationMenuMissing: true }; } const { getEntityRecord, getEditedEntityRecord, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); const args = ['postType', 'wp_navigation', ref]; const navigationMenu = getEntityRecord(...args); const editedNavigationMenu = getEditedEntityRecord(...args); const hasResolvedNavigationMenu = hasFinishedResolution('getEditedEntityRecord', args); // Only published Navigation posts are considered valid. // Draft Navigation posts are valid only on the editor, // requiring a post update to publish to show in frontend. // To achieve that, index.php must reflect this validation only for published. const isNavigationMenuPublishedOrDraft = editedNavigationMenu.status === 'publish' || editedNavigationMenu.status === 'draft'; return { isNavigationMenuResolved: hasResolvedNavigationMenu, isNavigationMenuMissing: hasResolvedNavigationMenu && (!navigationMenu || !isNavigationMenuPublishedOrDraft), // getEditedEntityRecord will return the post regardless of status. // Therefore if the found post is not published then we should ignore it. navigationMenu: isNavigationMenuPublishedOrDraft ? editedNavigationMenu : null }; } ;// ./node_modules/@wordpress/block-library/build-module/navigation/use-navigation-entities.js /** * WordPress dependencies */ /** * @typedef {Object} NavigationEntitiesData * @property {Array|undefined} pages - a collection of WP Post entity objects of post type "Page". * @property {boolean} isResolvingPages - indicates whether the request to fetch pages is currently resolving. * @property {boolean} hasResolvedPages - indicates whether the request to fetch pages has finished resolving. * @property {Array|undefined} menus - a collection of Menu entity objects. * @property {boolean} isResolvingMenus - indicates whether the request to fetch menus is currently resolving. * @property {boolean} hasResolvedMenus - indicates whether the request to fetch menus has finished resolving. * @property {Array|undefined} menusItems - a collection of Menu Item entity objects for the current menuId. * @property {boolean} hasResolvedMenuItems - indicates whether the request to fetch menuItems has finished resolving. * @property {boolean} hasPages - indicates whether there is currently any data for pages. * @property {boolean} hasMenus - indicates whether there is currently any data for menus. */ /** * Manages fetching and resolution state for all entities required * for the Navigation block. * * @param {number} menuId the menu for which to retrieve menuItem data. * @return { NavigationEntitiesData } the entity data. */ function useNavigationEntities(menuId) { const { records: menus, isResolving: isResolvingMenus, hasResolved: hasResolvedMenus } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'menu', { per_page: -1, context: 'view' }); const { records: pages, isResolving: isResolvingPages, hasResolved: hasResolvedPages } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', { parent: 0, order: 'asc', orderby: 'id', per_page: -1, context: 'view' }); const { records: menuItems, hasResolved: hasResolvedMenuItems } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('root', 'menuItem', { menus: menuId, per_page: -1, context: 'view' }, { enabled: !!menuId }); return { pages, isResolvingPages, hasResolvedPages, hasPages: !!(hasResolvedPages && pages?.length), menus, isResolvingMenus, hasResolvedMenus, hasMenus: !!(hasResolvedMenus && menus?.length), menuItems, hasResolvedMenuItems }; } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/placeholder-preview.js /** * WordPress dependencies */ const PlaceholderPreview = ({ isVisible = true }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { "aria-hidden": !isVisible ? true : undefined, className: "wp-block-navigation-placeholder__preview", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-navigation-placeholder__actions__indicator", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_navigation }), (0,external_wp_i18n_namespaceObject.__)('Navigation')] }) }); }; /* harmony default export */ const placeholder_preview = (PlaceholderPreview); ;// ./node_modules/@wordpress/icons/build-module/library/more-vertical.js /** * WordPress dependencies */ const moreVertical = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); /* harmony default export */ const more_vertical = (moreVertical); ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-selector.js /** * WordPress dependencies */ /** * Internal dependencies */ function buildMenuLabel(title, id, status) { if (!title) { /* translators: %s: the index of the menu in the list of menus. */ return (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('(no title %s)'), id); } if (status === 'publish') { return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title); } return (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: title of the menu. 2: status of the menu (draft, pending, etc.). (0,external_wp_i18n_namespaceObject.__)('%1$s (%2$s)'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title), status); } function NavigationMenuSelector({ currentMenuId, onSelectNavigationMenu, onSelectClassicMenu, onCreateNew, actionLabel, createNavigationMenuIsSuccess, createNavigationMenuIsError }) { /* translators: %s: The name of a menu. */ const createActionLabel = (0,external_wp_i18n_namespaceObject.__)("Create from '%s'"); const [isUpdatingMenuRef, setIsUpdatingMenuRef] = (0,external_wp_element_namespaceObject.useState)(false); actionLabel = actionLabel || createActionLabel; const { menus: classicMenus } = useNavigationEntities(); const { navigationMenus, isResolvingNavigationMenus, hasResolvedNavigationMenus, canUserCreateNavigationMenus, canSwitchNavigationMenu, isNavigationMenuMissing } = useNavigationMenu(currentMenuId); const [currentTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title'); const menuChoices = (0,external_wp_element_namespaceObject.useMemo)(() => { return navigationMenus?.map(({ id, title, status }, index) => { const label = buildMenuLabel(title?.rendered, index + 1, status); return { value: id, label, ariaLabel: (0,external_wp_i18n_namespaceObject.sprintf)(actionLabel, label), disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus }; }) || []; }, [navigationMenus, actionLabel, isResolvingNavigationMenus, hasResolvedNavigationMenus, isUpdatingMenuRef]); const hasNavigationMenus = !!navigationMenus?.length; const hasClassicMenus = !!classicMenus?.length; const showNavigationMenus = !!canSwitchNavigationMenu; const showClassicMenus = !!canUserCreateNavigationMenus; const noMenuSelected = hasNavigationMenus && !currentMenuId; const noBlockMenus = !hasNavigationMenus && hasResolvedNavigationMenus; const menuUnavailable = hasResolvedNavigationMenus && currentMenuId === null; const navMenuHasBeenDeleted = currentMenuId && isNavigationMenuMissing; let selectorLabel = ''; if (isResolvingNavigationMenus) { selectorLabel = (0,external_wp_i18n_namespaceObject.__)('Loading…'); } else if (noMenuSelected || noBlockMenus || menuUnavailable || navMenuHasBeenDeleted) { // Note: classic Menus may be available. selectorLabel = (0,external_wp_i18n_namespaceObject.__)('Choose or create a Navigation Menu'); } else { // Current Menu's title. selectorLabel = currentTitle; } (0,external_wp_element_namespaceObject.useEffect)(() => { if (isUpdatingMenuRef && (createNavigationMenuIsSuccess || createNavigationMenuIsError)) { setIsUpdatingMenuRef(false); } }, [hasResolvedNavigationMenus, createNavigationMenuIsSuccess, canUserCreateNavigationMenus, createNavigationMenuIsError, isUpdatingMenuRef, menuUnavailable, noBlockMenus, noMenuSelected]); const NavigationMenuSelectorDropdown = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { label: selectorLabel, icon: more_vertical, toggleProps: { size: 'small' }, children: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [showNavigationMenus && hasNavigationMenus && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Menus'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItemsChoice, { value: currentMenuId, onSelect: menuId => { onSelectNavigationMenu(menuId); onClose(); }, choices: menuChoices }) }), showClassicMenus && hasClassicMenus && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Import Classic Menus'), children: classicMenus?.map(menu => { const label = (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(menu.name); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: async () => { setIsUpdatingMenuRef(true); await onSelectClassicMenu(menu); setIsUpdatingMenuRef(false); onClose(); }, "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(createActionLabel, label), disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus, children: label }, menu.id); }) }), canUserCreateNavigationMenus && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { label: (0,external_wp_i18n_namespaceObject.__)('Tools'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: async () => { setIsUpdatingMenuRef(true); await onCreateNew(); setIsUpdatingMenuRef(false); onClose(); }, disabled: isUpdatingMenuRef || isResolvingNavigationMenus || !hasResolvedNavigationMenus, children: (0,external_wp_i18n_namespaceObject.__)('Create new Menu') }) })] }) }); return NavigationMenuSelectorDropdown; } /* harmony default export */ const navigation_menu_selector = (NavigationMenuSelector); ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/placeholder/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function NavigationPlaceholder({ isSelected, currentMenuId, clientId, canUserCreateNavigationMenus = false, isResolvingCanUserCreateNavigationMenus, onSelectNavigationMenu, onSelectClassicMenu, onCreateEmpty }) { const { isResolvingMenus, hasResolvedMenus } = useNavigationEntities(); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isSelected) { return; } if (isResolvingMenus) { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Loading navigation block setup options…')); } if (hasResolvedMenus) { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Navigation block setup options ready.')); } }, [hasResolvedMenus, isResolvingMenus, isSelected]); const isResolvingActions = isResolvingMenus && isResolvingCanUserCreateNavigationMenus; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { className: "wp-block-navigation-placeholder", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(placeholder_preview, { isVisible: !isSelected }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { "aria-hidden": !isSelected ? true : undefined, className: "wp-block-navigation-placeholder__controls", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-navigation-placeholder__actions", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-navigation-placeholder__actions__indicator", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_navigation }), " ", (0,external_wp_i18n_namespaceObject.__)('Navigation')] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("hr", {}), isResolvingActions && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigation_menu_selector, { currentMenuId: currentMenuId, clientId: clientId, onSelectNavigationMenu: onSelectNavigationMenu, onSelectClassicMenu: onSelectClassicMenu }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("hr", {}), canUserCreateNavigationMenus && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onCreateEmpty, children: (0,external_wp_i18n_namespaceObject.__)('Start empty') })] }) })] }) }); } ;// ./node_modules/@wordpress/icons/build-module/library/menu.js /** * WordPress dependencies */ const menu = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 5v1.5h14V5H5zm0 7.8h14v-1.5H5v1.5zM5 19h14v-1.5H5V19z" }) }); /* harmony default export */ const library_menu = (menu); ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/overlay-menu-icon.js /** * WordPress dependencies */ function OverlayMenuIcon({ icon }) { if (icon === 'menu') { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_menu }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24", height: "24", "aria-hidden": "true", focusable: "false", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Rect, { x: "4", y: "7.5", width: "16", height: "1.5" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Rect, { x: "4", y: "15", width: "16", height: "1.5" })] }); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/responsive-wrapper.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ResponsiveWrapper({ children, id, isOpen, isResponsive, onToggle, isHiddenByDefault, overlayBackgroundColor, overlayTextColor, hasIcon, icon }) { if (!isResponsive) { return children; } const responsiveContainerClasses = dist_clsx('wp-block-navigation__responsive-container', { 'has-text-color': !!overlayTextColor.color || !!overlayTextColor?.class, [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', overlayTextColor?.slug)]: !!overlayTextColor?.slug, 'has-background': !!overlayBackgroundColor.color || overlayBackgroundColor?.class, [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', overlayBackgroundColor?.slug)]: !!overlayBackgroundColor?.slug, 'is-menu-open': isOpen, 'hidden-by-default': isHiddenByDefault }); const styles = { color: !overlayTextColor?.slug && overlayTextColor?.color, backgroundColor: !overlayBackgroundColor?.slug && overlayBackgroundColor?.color && overlayBackgroundColor.color }; const openButtonClasses = dist_clsx('wp-block-navigation__responsive-container-open', { 'always-shown': isHiddenByDefault }); const modalId = `${id}-modal`; const dialogProps = { className: 'wp-block-navigation__responsive-dialog', ...(isOpen && { role: 'dialog', 'aria-modal': true, 'aria-label': (0,external_wp_i18n_namespaceObject.__)('Menu') }) }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [!isOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, "aria-haspopup": "true", "aria-label": hasIcon && (0,external_wp_i18n_namespaceObject.__)('Open menu'), className: openButtonClasses, onClick: () => onToggle(true), children: [hasIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverlayMenuIcon, { icon: icon }), !hasIcon && (0,external_wp_i18n_namespaceObject.__)('Menu')] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: responsiveContainerClasses, style: styles, id: modalId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-navigation__responsive-close", tabIndex: "-1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...dialogProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: "wp-block-navigation__responsive-container-close", "aria-label": hasIcon && (0,external_wp_i18n_namespaceObject.__)('Close menu'), onClick: () => onToggle(false), children: [hasIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_close }), !hasIcon && (0,external_wp_i18n_namespaceObject.__)('Close')] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-navigation__responsive-container-content", id: `${modalId}-content`, children: children })] }) }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/inner-blocks.js /** * WordPress dependencies */ /** * Internal dependencies */ function NavigationInnerBlocks({ clientId, hasCustomPlaceholder, orientation, templateLock }) { const { isImmediateParentOfSelectedBlock, selectedBlockHasChildren, isSelected } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockCount, hasSelectedInnerBlock, getSelectedBlockClientId } = select(external_wp_blockEditor_namespaceObject.store); const selectedBlockId = getSelectedBlockClientId(); return { isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false), selectedBlockHasChildren: !!getBlockCount(selectedBlockId), // This prop is already available but computing it here ensures it's // fresh compared to isImmediateParentOfSelectedBlock. isSelected: selectedBlockId === clientId }; }, [clientId]); const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_navigation'); // When the block is selected itself or has a top level item selected that // doesn't itself have children, show the standard appender. Else show no // appender. const parentOrChildHasSelection = isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren; const placeholder = (0,external_wp_element_namespaceObject.useMemo)(() => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(placeholder_preview, {}), []); const hasMenuItems = !!blocks?.length; // If there is a `ref` attribute pointing to a `wp_navigation` but // that menu has no **items** (i.e. empty) then show a placeholder. // The block must also be selected else the placeholder will display // alongside the appender. const showPlaceholder = !hasCustomPlaceholder && !hasMenuItems && !isSelected; const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ className: 'wp-block-navigation__container' }, { value: blocks, onInput, onChange, prioritizedInserterBlocks: PRIORITIZED_INSERTER_BLOCKS, defaultBlock: constants_DEFAULT_BLOCK, directInsert: true, orientation, templateLock, // As an exception to other blocks which feature nesting, show // the block appender even when a child block is selected. // This should be a temporary fix, to be replaced by improvements to // the sibling inserter. // See https://github.com/WordPress/gutenberg/issues/37572. renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender. parentOrChildHasSelection ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false, placeholder: showPlaceholder ? placeholder : undefined, __experimentalCaptureToolbars: true, __unstableDisableLayoutClassNames: true }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-name-control.js /** * WordPress dependencies */ function NavigationMenuNameControl() { const [title, updateTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Menu name'), value: title, onChange: updateTitle }); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/are-blocks-dirty.js function areBlocksDirty(originalBlocks, blocks) { return !isDeepEqual(originalBlocks, blocks, (prop, x) => { // Skip inner blocks of page list during comparison as they // are **always** controlled and may be updated async due to // syncing with entity records. Left unchecked this would // inadvertently trigger the dirty state. if (x?.name === 'core/page-list' && prop === 'innerBlocks') { return true; } }); } /** * Conditionally compares two candidates for deep equality. * Provides an option to skip a given property of an object during comparison. * * @param {*} x 1st candidate for comparison * @param {*} y 2nd candidate for comparison * @param {Function|undefined} shouldSkip a function which can be used to skip a given property of an object. * @return {boolean} whether the two candidates are deeply equal. */ const isDeepEqual = (x, y, shouldSkip) => { if (x === y) { return true; } else if (typeof x === 'object' && x !== null && x !== undefined && typeof y === 'object' && y !== null && y !== undefined) { if (Object.keys(x).length !== Object.keys(y).length) { return false; } for (const prop in x) { if (y.hasOwnProperty(prop)) { // Afford skipping a given property of an object. if (shouldSkip && shouldSkip(prop, x)) { return true; } if (!isDeepEqual(x[prop], y[prop], shouldSkip)) { return false; } } else { return false; } } return true; } return false; }; ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/unsaved-inner-blocks.js /** * WordPress dependencies */ /** * Internal dependencies */ const EMPTY_OBJECT = {}; function UnsavedInnerBlocks({ blocks, createNavigationMenu, hasSelection }) { const originalBlocksRef = (0,external_wp_element_namespaceObject.useRef)(); (0,external_wp_element_namespaceObject.useEffect)(() => { // Initially store the uncontrolled inner blocks for // dirty state comparison. if (!originalBlocksRef?.current) { originalBlocksRef.current = blocks; } }, [blocks]); // If the current inner blocks are different from the original inner blocks // from the post content then the user has made changes to the inner blocks. // At this point the inner blocks can be considered "dirty". // Note: referential equality is not sufficient for comparison as the inner blocks // of the page list are controlled and may be updated async due to syncing with // entity records. As a result we need to perform a deep equality check skipping // the page list's inner blocks. const innerBlocksAreDirty = areBlocksDirty(originalBlocksRef?.current, blocks); // The block will be disabled in a block preview, use this as a way of // avoiding the side-effects of this component for block previews. const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ className: 'wp-block-navigation__container' }, { renderAppender: hasSelection ? undefined : false, defaultBlock: constants_DEFAULT_BLOCK, directInsert: true }); const { isSaving, hasResolvedAllNavigationMenus } = (0,external_wp_data_namespaceObject.useSelect)(select => { if (isDisabled) { return EMPTY_OBJECT; } const { hasFinishedResolution, isSavingEntityRecord } = select(external_wp_coreData_namespaceObject.store); return { isSaving: isSavingEntityRecord('postType', 'wp_navigation'), hasResolvedAllNavigationMenus: hasFinishedResolution('getEntityRecords', SELECT_NAVIGATION_MENUS_ARGS) }; }, [isDisabled]); // Automatically save the uncontrolled blocks. (0,external_wp_element_namespaceObject.useEffect)(() => { // The block will be disabled when used in a BlockPreview. // In this case avoid automatic creation of a wp_navigation post. // Otherwise the user will be spammed with lots of menus! // // Also ensure other navigation menus have loaded so an // accurate name can be created. // // Don't try saving when another save is already // in progress. // // And finally only create the menu when the block is selected, // which is an indication they want to start editing. if (isDisabled || isSaving || !hasResolvedAllNavigationMenus || !hasSelection || !innerBlocksAreDirty) { return; } createNavigationMenu(null, blocks); }, [blocks, createNavigationMenu, isDisabled, isSaving, hasResolvedAllNavigationMenus, innerBlocksAreDirty, hasSelection]); const Wrapper = isSaving ? external_wp_components_namespaceObject.Disabled : 'div'; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, { ...innerBlocksProps }); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/navigation-menu-delete-control.js /** * WordPress dependencies */ function NavigationMenuDeleteControl({ onDelete }) { const [isConfirmDialogVisible, setIsConfirmDialogVisible] = (0,external_wp_element_namespaceObject.useState)(false); const id = (0,external_wp_coreData_namespaceObject.useEntityId)('postType', 'wp_navigation'); const { deleteEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: "wp-block-navigation-delete-menu-button", variant: "secondary", isDestructive: true, onClick: () => { setIsConfirmDialogVisible(true); }, children: (0,external_wp_i18n_namespaceObject.__)('Delete menu') }), isConfirmDialogVisible && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalConfirmDialog, { isOpen: true, onConfirm: () => { deleteEntityRecord('postType', 'wp_navigation', id, { force: true }); onDelete(); }, onCancel: () => { setIsConfirmDialogVisible(false); }, confirmButtonText: (0,external_wp_i18n_namespaceObject.__)('Delete'), size: "medium", children: (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this Navigation Menu?') })] }); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-navigation-notice.js /** * WordPress dependencies */ function useNavigationNotice({ name, message = '' } = {}) { const noticeRef = (0,external_wp_element_namespaceObject.useRef)(); const { createWarningNotice, removeNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const showNotice = (0,external_wp_element_namespaceObject.useCallback)(customMsg => { if (noticeRef.current) { return; } noticeRef.current = name; createWarningNotice(customMsg || message, { id: noticeRef.current, type: 'snackbar' }); }, [noticeRef, createWarningNotice, message, name]); const hideNotice = (0,external_wp_element_namespaceObject.useCallback)(() => { if (!noticeRef.current) { return; } removeNotice(noticeRef.current); noticeRef.current = null; }, [noticeRef, removeNotice]); return [showNotice, hideNotice]; } /* harmony default export */ const use_navigation_notice = (useNavigationNotice); ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/overlay-menu-preview.js /** * WordPress dependencies */ /** * Internal dependencies */ function OverlayMenuPreview({ setAttributes, hasIcon, icon }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show icon button'), help: (0,external_wp_i18n_namespaceObject.__)('Configure the visual appearance of the button that toggles the overlay menu.'), onChange: value => setAttributes({ hasIcon: value }), checked: hasIcon }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, className: "wp-block-navigation__overlay-menu-icon-toggle-group", label: (0,external_wp_i18n_namespaceObject.__)('Icon'), value: icon, onChange: value => setAttributes({ icon: value }), isBlock: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "handle", "aria-label": (0,external_wp_i18n_namespaceObject.__)('handle'), label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverlayMenuIcon, { icon: "handle" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "menu", "aria-label": (0,external_wp_i18n_namespaceObject.__)('menu'), label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverlayMenuIcon, { icon: "menu" }) })] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/menu-items-to-blocks.js /** * WordPress dependencies */ /** * Convert a flat menu item structure to a nested blocks structure. * * @param {Object[]} menuItems An array of menu items. * * @return {WPBlock[]} An array of blocks. */ function menuItemsToBlocks(menuItems) { if (!menuItems) { return null; } const menuTree = createDataTree(menuItems); const blocks = mapMenuItemsToBlocks(menuTree); return (0,external_wp_hooks_namespaceObject.applyFilters)('blocks.navigation.__unstableMenuItemsToBlocks', blocks, menuItems); } /** * A recursive function that maps menu item nodes to blocks. * * @param {WPNavMenuItem[]} menuItems An array of WPNavMenuItem items. * @param {number} level An integer representing the nesting level. * @return {Object} Object containing innerBlocks and mapping. */ function mapMenuItemsToBlocks(menuItems, level = 0) { let mapping = {}; // The menuItem should be in menu_order sort order. const sortedItems = [...menuItems].sort((a, b) => a.menu_order - b.menu_order); const innerBlocks = sortedItems.map(menuItem => { if (menuItem.type === 'block') { const [block] = (0,external_wp_blocks_namespaceObject.parse)(menuItem.content.raw); if (!block) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/freeform', { content: menuItem.content }); } return block; } const blockType = menuItem.children?.length ? 'core/navigation-submenu' : 'core/navigation-link'; const attributes = menuItemToBlockAttributes(menuItem, blockType, level); // If there are children recurse to build those nested blocks. const { innerBlocks: nestedBlocks = [], // alias to avoid shadowing mapping: nestedMapping = {} // alias to avoid shadowing } = menuItem.children?.length ? mapMenuItemsToBlocks(menuItem.children, level + 1) : {}; // Update parent mapping with nested mapping. mapping = { ...mapping, ...nestedMapping }; // Create block with nested "innerBlocks". const block = (0,external_wp_blocks_namespaceObject.createBlock)(blockType, attributes, nestedBlocks); // Create mapping for menuItem -> block. mapping[menuItem.id] = block.clientId; return block; }); return { innerBlocks, mapping }; } /** * A WP nav_menu_item object. * For more documentation on the individual fields present on a menu item please see: * https://core.trac.wordpress.org/browser/tags/5.7.1/src/wp-includes/nav-menu.php#L789 * * @typedef WPNavMenuItem * * @property {Object} title stores the raw and rendered versions of the title/label for this menu item. * @property {Array} xfn the XFN relationships expressed in the link of this menu item. * @property {Array} classes the HTML class attributes for this menu item. * @property {string} attr_title the HTML title attribute for this menu item. * @property {string} object The type of object originally represented, such as 'category', 'post', or 'attachment'. * @property {string} object_id The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories. * @property {string} description The description of this menu item. * @property {string} url The URL to which this menu item points. * @property {string} type The family of objects originally represented, such as 'post_type' or 'taxonomy'. * @property {string} target The target attribute of the link element for this menu item. */ /** * Convert block attributes to menu item. * * @param {WPNavMenuItem} menuItem the menu item to be converted to block attributes. * @param {string} blockType The block type. * @param {number} level An integer representing the nesting level. * @return {Object} the block attributes converted from the WPNavMenuItem item. */ function menuItemToBlockAttributes({ title: menuItemTitleField, xfn, classes, // eslint-disable-next-line camelcase attr_title, object, // eslint-disable-next-line camelcase object_id, description, url, type: menuItemTypeField, target }, blockType, level) { // For historical reasons, the `core/navigation-link` variation type is `tag` // whereas WP Core expects `post_tag` as the `object` type. // To avoid writing a block migration we perform a conversion here. // See also inverse equivalent in `blockAttributesToMenuItem`. if (object && object === 'post_tag') { object = 'tag'; } return { label: menuItemTitleField?.rendered || '', ...(object?.length && { type: object }), kind: menuItemTypeField?.replace('_', '-') || 'custom', url: url || '', ...(xfn?.length && xfn.join(' ').trim() && { rel: xfn.join(' ').trim() }), ...(classes?.length && classes.join(' ').trim() && { className: classes.join(' ').trim() }), /* eslint-disable camelcase */ ...(attr_title?.length && { title: attr_title }), ...(object_id && 'custom' !== object && { id: object_id }), /* eslint-enable camelcase */ ...(description?.length && { description }), ...(target === '_blank' && { opensInNewTab: true }), ...(blockType === 'core/navigation-submenu' && { isTopLevelItem: level === 0 }), ...(blockType === 'core/navigation-link' && { isTopLevelLink: level === 0 }) }; } /** * Creates a nested, hierarchical tree representation from unstructured data that * has an inherent relationship defined between individual items. * * For example, by default, each element in the dataset should have an `id` and * `parent` property where the `parent` property indicates a relationship between * the current item and another item with a matching `id` properties. * * This is useful for building linked lists of data from flat data structures. * * @param {Array} dataset linked data to be rearranged into a hierarchical tree based on relational fields. * @param {string} id the property which uniquely identifies each entry within the array. * @param {*} relation the property which identifies how the current item is related to other items in the data (if at all). * @return {Array} a nested array of parent/child relationships */ function createDataTree(dataset, id = 'id', relation = 'parent') { const hashTable = Object.create(null); const dataTree = []; for (const data of dataset) { hashTable[data[id]] = { ...data, children: [] }; if (data[relation]) { hashTable[data[relation]] = hashTable[data[relation]] || {}; hashTable[data[relation]].children = hashTable[data[relation]].children || []; hashTable[data[relation]].children.push(hashTable[data[id]]); } else { dataTree.push(hashTable[data[id]]); } } return dataTree; } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js /** * WordPress dependencies */ /** * Internal dependencies */ const CLASSIC_MENU_CONVERSION_SUCCESS = 'success'; const CLASSIC_MENU_CONVERSION_ERROR = 'error'; const CLASSIC_MENU_CONVERSION_PENDING = 'pending'; const CLASSIC_MENU_CONVERSION_IDLE = 'idle'; // This is needed to ensure that multiple components using this hook // do not import the same classic menu twice. let classicMenuBeingConvertedId = null; function useConvertClassicToBlockMenu(createNavigationMenu, { throwOnError = false } = {}) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CLASSIC_MENU_CONVERSION_IDLE); const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null); const convertClassicMenuToBlockMenu = (0,external_wp_element_namespaceObject.useCallback)(async (menuId, menuName, postStatus = 'publish') => { let navigationMenu; let classicMenuItems; // 1. Fetch the classic Menu items. try { classicMenuItems = await registry.resolveSelect(external_wp_coreData_namespaceObject.store).getMenuItems({ menus: menuId, per_page: -1, context: 'view' }); } catch (err) { throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The name of a menu (e.g. Header menu). (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName), { cause: err }); } // Handle offline response which resolves to `null`. if (classicMenuItems === null) { throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The name of a menu (e.g. Header menu). (0,external_wp_i18n_namespaceObject.__)(`Unable to fetch classic menu "%s" from API.`), menuName)); } // 2. Convert the classic items into blocks. const { innerBlocks } = menuItemsToBlocks(classicMenuItems); // 3. Create the `wp_navigation` Post with the blocks. try { navigationMenu = await createNavigationMenu(menuName, innerBlocks, postStatus); /** * Immediately trigger editEntityRecord to change the wp_navigation post status to 'publish'. * This status change causes the menu to be displayed on the front of the site and sets the post state to be "dirty". * The problem being solved is if saveEditedEntityRecord was used here, the menu would be updated on the frontend and the editor _automatically_, * without user interaction. * If the user abandons the site editor without saving, there would still be a wp_navigation post created as draft. */ await editEntityRecord('postType', 'wp_navigation', navigationMenu.id, { status: 'publish' }, { throwOnError: true }); } catch (err) { throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The name of a menu (e.g. Header menu). (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), { cause: err }); } return navigationMenu; }, [createNavigationMenu, editEntityRecord, registry]); const convert = (0,external_wp_element_namespaceObject.useCallback)(async (menuId, menuName, postStatus) => { // Check whether this classic menu is being imported already. if (classicMenuBeingConvertedId === menuId) { return; } // Set the ID for the currently importing classic menu. classicMenuBeingConvertedId = menuId; if (!menuId || !menuName) { setError('Unable to convert menu. Missing menu details.'); setStatus(CLASSIC_MENU_CONVERSION_ERROR); return; } setStatus(CLASSIC_MENU_CONVERSION_PENDING); setError(null); return await convertClassicMenuToBlockMenu(menuId, menuName, postStatus).then(navigationMenu => { setStatus(CLASSIC_MENU_CONVERSION_SUCCESS); // Reset the ID for the currently importing classic menu. classicMenuBeingConvertedId = null; return navigationMenu; }).catch(err => { setError(err?.message); // Reset the ID for the currently importing classic menu. setStatus(CLASSIC_MENU_CONVERSION_ERROR); // Reset the ID for the currently importing classic menu. classicMenuBeingConvertedId = null; // Rethrow error for debugging. if (throwOnError) { throw new Error((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The name of a menu (e.g. Header menu). (0,external_wp_i18n_namespaceObject.__)(`Unable to create Navigation Menu "%s".`), menuName), { cause: err }); } }); }, [convertClassicMenuToBlockMenu, throwOnError]); return { convert, status, error }; } /* harmony default export */ const use_convert_classic_menu_to_block_menu = (useConvertClassicToBlockMenu); ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/create-template-part-id.js /** * Generates a template part Id based on slug and theme inputs. * * @param {string} theme the template part's theme. * @param {string} slug the template part's slug * @return {string|null} the template part's Id. */ function createTemplatePartId(theme, slug) { return theme && slug ? theme + '//' + slug : null; } ;// ./node_modules/@wordpress/icons/build-module/library/header.js /** * WordPress dependencies */ const header = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.5 10.5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); /* harmony default export */ const library_header = (header); ;// ./node_modules/@wordpress/icons/build-module/library/footer.js /** * WordPress dependencies */ const footer = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); /* harmony default export */ const library_footer = (footer); ;// ./node_modules/@wordpress/icons/build-module/library/sidebar.js /** * WordPress dependencies */ const sidebar = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); /* harmony default export */ const library_sidebar = (sidebar); ;// ./node_modules/@wordpress/icons/build-module/library/symbol-filled.js /** * WordPress dependencies */ const symbolFilled = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-17.6 1L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) }); /* harmony default export */ const symbol_filled = (symbolFilled); ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/get-template-part-icon.js /** * WordPress dependencies */ const getTemplatePartIcon = iconName => { if ('header' === iconName) { return library_header; } else if ('footer' === iconName) { return library_footer; } else if ('sidebar' === iconName) { return library_sidebar; } return symbol_filled; }; ;// ./node_modules/@wordpress/block-library/build-module/navigation/use-template-part-area-label.js /** * WordPress dependencies */ /** * Internal dependencies */ // TODO: this util should perhaps be refactored somewhere like core-data. function useTemplatePartAreaLabel(clientId) { return (0,external_wp_data_namespaceObject.useSelect)(select => { // Use the lack of a clientId as an opportunity to bypass the rest // of this hook. if (!clientId) { return; } const { getBlock, getBlockParentsByBlockName } = select(external_wp_blockEditor_namespaceObject.store); const withAscendingResults = true; const parentTemplatePartClientIds = getBlockParentsByBlockName(clientId, 'core/template-part', withAscendingResults); if (!parentTemplatePartClientIds?.length) { return; } const { getCurrentTheme, getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const currentTheme = getCurrentTheme(); const defaultTemplatePartAreas = currentTheme?.default_template_part_areas || []; const definedAreas = defaultTemplatePartAreas.map(item => ({ ...item, icon: getTemplatePartIcon(item.icon) })); for (const templatePartClientId of parentTemplatePartClientIds) { const templatePartBlock = getBlock(templatePartClientId); // The 'area' usually isn't stored on the block, but instead // on the entity. const { theme = currentTheme?.stylesheet, slug } = templatePartBlock.attributes; const templatePartEntityId = createTemplatePartId(theme, slug); const templatePartEntity = getEditedEntityRecord('postType', 'wp_template_part', templatePartEntityId); // Look up the `label` for the area in the defined areas so // that an internationalized label can be used. if (templatePartEntity?.area) { return definedAreas.find(definedArea => definedArea.area !== 'uncategorized' && definedArea.area === templatePartEntity.area)?.label; } } }, [clientId]); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-generate-default-navigation-title.js /** * WordPress dependencies */ /** * Internal dependencies */ const DRAFT_MENU_PARAMS = ['postType', 'wp_navigation', { status: 'draft', per_page: -1 }]; const PUBLISHED_MENU_PARAMS = ['postType', 'wp_navigation', { per_page: -1, status: 'publish' }]; function useGenerateDefaultNavigationTitle(clientId) { // The block will be disabled in a block preview, use this as a way of // avoiding the side-effects of this component for block previews. const isDisabled = (0,external_wp_element_namespaceObject.useContext)(external_wp_components_namespaceObject.Disabled.Context); // Because we can't conditionally call hooks, pass an undefined client id // arg to bypass the expensive `useTemplateArea` code. The hook will return // early. const area = useTemplatePartAreaLabel(isDisabled ? undefined : clientId); const registry = (0,external_wp_data_namespaceObject.useRegistry)(); return (0,external_wp_element_namespaceObject.useCallback)(async () => { // Ensure other navigation menus have loaded so an // accurate name can be created. if (isDisabled) { return ''; } const { getEntityRecords } = registry.resolveSelect(external_wp_coreData_namespaceObject.store); const [draftNavigationMenus, navigationMenus] = await Promise.all([getEntityRecords(...DRAFT_MENU_PARAMS), getEntityRecords(...PUBLISHED_MENU_PARAMS)]); const title = area ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of a menu (e.g. Header menu). (0,external_wp_i18n_namespaceObject.__)('%s menu'), area) : // translators: 'menu' as in website navigation menu. (0,external_wp_i18n_namespaceObject.__)('Menu'); // Determine how many menus start with the automatic title. const matchingMenuTitleCount = [...draftNavigationMenus, ...navigationMenus].reduce((count, menu) => menu?.title?.raw?.startsWith(title) ? count + 1 : count, 0); // Append a number to the end of the title if a menu with // the same name exists. const titleWithCount = matchingMenuTitleCount > 0 ? `${title} ${matchingMenuTitleCount + 1}` : title; return titleWithCount || ''; }, [isDisabled, area, registry]); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-create-navigation-menu.js /** * WordPress dependencies */ /** * Internal dependencies */ const CREATE_NAVIGATION_MENU_SUCCESS = 'success'; const CREATE_NAVIGATION_MENU_ERROR = 'error'; const CREATE_NAVIGATION_MENU_PENDING = 'pending'; const CREATE_NAVIGATION_MENU_IDLE = 'idle'; function useCreateNavigationMenu(clientId) { const [status, setStatus] = (0,external_wp_element_namespaceObject.useState)(CREATE_NAVIGATION_MENU_IDLE); const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(null); const [error, setError] = (0,external_wp_element_namespaceObject.useState)(null); const { saveEntityRecord, editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const generateDefaultTitle = useGenerateDefaultNavigationTitle(clientId); // This callback uses data from the two placeholder steps and only creates // a new navigation menu when the user completes the final step. const create = (0,external_wp_element_namespaceObject.useCallback)(async (title = null, blocks = [], postStatus) => { // Guard against creating Navigations without a title. // Note you can pass no title, but if one is passed it must be // a string otherwise the title may end up being empty. if (title && typeof title !== 'string') { setError('Invalid title supplied when creating Navigation Menu.'); setStatus(CREATE_NAVIGATION_MENU_ERROR); throw new Error(`Value of supplied title argument was not a string.`); } setStatus(CREATE_NAVIGATION_MENU_PENDING); setValue(null); setError(null); if (!title) { title = await generateDefaultTitle().catch(err => { setError(err?.message); setStatus(CREATE_NAVIGATION_MENU_ERROR); throw new Error('Failed to create title when saving new Navigation Menu.', { cause: err }); }); } const record = { title, content: (0,external_wp_blocks_namespaceObject.serialize)(blocks), status: postStatus }; // Return affords ability to await on this function directly return saveEntityRecord('postType', 'wp_navigation', record).then(response => { setValue(response); setStatus(CREATE_NAVIGATION_MENU_SUCCESS); // Set the status to publish so that the Navigation block // shows up in the multi entity save flow. if (postStatus !== 'publish') { editEntityRecord('postType', 'wp_navigation', response.id, { status: 'publish' }); } return response; }).catch(err => { setError(err?.message); setStatus(CREATE_NAVIGATION_MENU_ERROR); throw new Error('Unable to save new Navigation Menu', { cause: err }); }); }, [saveEntityRecord, editEntityRecord, generateDefaultTitle]); return { create, status, value, error, isIdle: status === CREATE_NAVIGATION_MENU_IDLE, isPending: status === CREATE_NAVIGATION_MENU_PENDING, isSuccess: status === CREATE_NAVIGATION_MENU_SUCCESS, isError: status === CREATE_NAVIGATION_MENU_ERROR }; } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/use-inner-blocks.js /** * WordPress dependencies */ const use_inner_blocks_EMPTY_ARRAY = []; function useInnerBlocks(clientId) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlock, getBlocks, hasSelectedInnerBlock } = select(external_wp_blockEditor_namespaceObject.store); // This relies on the fact that `getBlock` won't return controlled // inner blocks, while `getBlocks` does. It might be more stable to // introduce a selector like `getUncontrolledInnerBlocks`, just in // case `getBlock` is fixed. const _uncontrolledInnerBlocks = getBlock(clientId).innerBlocks; const _hasUncontrolledInnerBlocks = !!_uncontrolledInnerBlocks?.length; const _controlledInnerBlocks = _hasUncontrolledInnerBlocks ? use_inner_blocks_EMPTY_ARRAY : getBlocks(clientId); return { innerBlocks: _hasUncontrolledInnerBlocks ? _uncontrolledInnerBlocks : _controlledInnerBlocks, hasUncontrolledInnerBlocks: _hasUncontrolledInnerBlocks, uncontrolledInnerBlocks: _uncontrolledInnerBlocks, controlledInnerBlocks: _controlledInnerBlocks, isInnerBlockSelected: hasSelectedInnerBlock(clientId, true) }; }, [clientId]); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/utils.js /** * External dependencies */ function getComputedStyle(node) { return node.ownerDocument.defaultView.getComputedStyle(node); } function detectColors(colorsDetectionElement, setColor, setBackground) { if (!colorsDetectionElement) { return; } setColor(getComputedStyle(colorsDetectionElement).color); let backgroundColorNode = colorsDetectionElement; let backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; while (backgroundColor === 'rgba(0, 0, 0, 0)' && backgroundColorNode.parentNode && backgroundColorNode.parentNode.nodeType === backgroundColorNode.parentNode.ELEMENT_NODE) { backgroundColorNode = backgroundColorNode.parentNode; backgroundColor = getComputedStyle(backgroundColorNode).backgroundColor; } setBackground(backgroundColor); } /** * Determine the colors for a menu. * * Order of priority is: * 1: Overlay custom colors (if submenu) * 2: Overlay theme colors (if submenu) * 3: Custom colors * 4: Theme colors * 5: Global styles * * @param {Object} context * @param {boolean} isSubMenu */ function getColors(context, isSubMenu) { const { textColor, customTextColor, backgroundColor, customBackgroundColor, overlayTextColor, customOverlayTextColor, overlayBackgroundColor, customOverlayBackgroundColor, style } = context; const colors = {}; if (isSubMenu && !!customOverlayTextColor) { colors.customTextColor = customOverlayTextColor; } else if (isSubMenu && !!overlayTextColor) { colors.textColor = overlayTextColor; } else if (!!customTextColor) { colors.customTextColor = customTextColor; } else if (!!textColor) { colors.textColor = textColor; } else if (!!style?.color?.text) { colors.customTextColor = style.color.text; } if (isSubMenu && !!customOverlayBackgroundColor) { colors.customBackgroundColor = customOverlayBackgroundColor; } else if (isSubMenu && !!overlayBackgroundColor) { colors.backgroundColor = overlayBackgroundColor; } else if (!!customBackgroundColor) { colors.customBackgroundColor = customBackgroundColor; } else if (!!backgroundColor) { colors.backgroundColor = backgroundColor; } else if (!!style?.color?.background) { colors.customTextColor = style.color.background; } return colors; } function getNavigationChildBlockProps(innerBlocksColors) { return { className: dist_clsx('wp-block-navigation__submenu-container', { 'has-text-color': !!(innerBlocksColors.textColor || innerBlocksColors.customTextColor), [`has-${innerBlocksColors.textColor}-color`]: !!innerBlocksColors.textColor, 'has-background': !!(innerBlocksColors.backgroundColor || innerBlocksColors.customBackgroundColor), [`has-${innerBlocksColors.backgroundColor}-background-color`]: !!innerBlocksColors.backgroundColor }), style: { color: innerBlocksColors.customTextColor, backgroundColor: innerBlocksColors.customBackgroundColor } }; } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/manage-menus-button.js /** * WordPress dependencies */ const ManageMenusButton = ({ className = '', disabled, isMenuItem = false }) => { let ComponentName = external_wp_components_namespaceObject.Button; if (isMenuItem) { ComponentName = external_wp_components_namespaceObject.MenuItem; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ComponentName, { variant: "link", disabled: disabled, className: className, href: (0,external_wp_url_namespaceObject.addQueryArgs)('edit.php', { post_type: 'wp_navigation' }), children: (0,external_wp_i18n_namespaceObject.__)('Manage menus') }); }; /* harmony default export */ const manage_menus_button = (ManageMenusButton); ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/deleted-navigation-warning.js /** * WordPress dependencies */ function DeletedNavigationWarning({ onCreateNew, isNotice = false }) { const [isButtonDisabled, setIsButtonDisabled] = (0,external_wp_element_namespaceObject.useState)(false); const handleButtonClick = () => { setIsButtonDisabled(true); onCreateNew(); }; const message = (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Navigation Menu has been deleted or is unavailable. <button>Create a new Menu?</button>'), { button: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, onClick: handleButtonClick, variant: "link", disabled: isButtonDisabled, accessibleWhenDisabled: true }) }); return isNotice ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "warning", isDismissible: false, children: message }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: message }); } /* harmony default export */ const deleted_navigation_warning = (DeletedNavigationWarning); ;// ./node_modules/@wordpress/icons/build-module/library/add-submenu.js /** * WordPress dependencies */ const addSubmenu = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z" }) }); /* harmony default export */ const add_submenu = (addSubmenu); ;// ./node_modules/@wordpress/icons/build-module/library/chevron-up.js /** * WordPress dependencies */ const chevronUp = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) }); /* harmony default export */ const chevron_up = (chevronUp); ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/leaf-more-menu.js /** * WordPress dependencies */ const POPOVER_PROPS = { className: 'block-editor-block-settings-menu__popover', placement: 'bottom-start' }; const BLOCKS_THAT_CAN_BE_CONVERTED_TO_SUBMENU = ['core/navigation-link', 'core/navigation-submenu']; function AddSubmenuItem({ block, onClose, expandedState, expand, setInsertedBlock }) { const { insertBlock, replaceBlock, replaceInnerBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const clientId = block.clientId; const isDisabled = !BLOCKS_THAT_CAN_BE_CONVERTED_TO_SUBMENU.includes(block.name); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: add_submenu, disabled: isDisabled, onClick: () => { const updateSelectionOnInsert = false; const newLink = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); if (block.name === 'core/navigation-submenu') { insertBlock(newLink, block.innerBlocks.length, clientId, updateSelectionOnInsert); } else { // Convert to a submenu if the block currently isn't one. const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', block.attributes, block.innerBlocks); // The following must happen as two independent actions. // Why? Because the offcanvas editor relies on the getLastInsertedBlocksClientIds // selector to determine which block is "active". As the UX needs the newLink to be // the "active" block it must be the last block to be inserted. // Therefore the Submenu is first created and **then** the newLink is inserted // thus ensuring it is the last inserted block. replaceBlock(clientId, newSubmenu); replaceInnerBlocks(newSubmenu.clientId, [newLink], updateSelectionOnInsert); } // This call sets the local List View state for the "last inserted block". // This is required for the Nav Block to determine whether or not to display // the Link UI for this new block. setInsertedBlock(newLink); if (!expandedState[block.clientId]) { expand(block.clientId); } onClose(); }, children: (0,external_wp_i18n_namespaceObject.__)('Add submenu link') }); } function LeafMoreMenu(props) { const { block } = props; const { clientId } = block; const { moveBlocksDown, moveBlocksUp, removeBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const removeLabel = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: block name */ (0,external_wp_i18n_namespaceObject.__)('Remove %s'), (0,external_wp_blockEditor_namespaceObject.BlockTitle)({ clientId, maximumLength: 25 })); const rootClientId = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId } = select(external_wp_blockEditor_namespaceObject.store); return getBlockRootClientId(clientId); }, [clientId]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropdownMenu, { icon: more_vertical, label: (0,external_wp_i18n_namespaceObject.__)('Options'), className: "block-editor-block-settings-menu", popoverProps: POPOVER_PROPS, noIcons: true, ...props, children: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.MenuGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: chevron_up, onClick: () => { moveBlocksUp([clientId], rootClientId); onClose(); }, children: (0,external_wp_i18n_namespaceObject.__)('Move up') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: chevron_down, onClick: () => { moveBlocksDown([clientId], rootClientId); onClose(); }, children: (0,external_wp_i18n_namespaceObject.__)('Move down') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AddSubmenuItem, { block: block, onClose: onClose, expanded: true, expandedState: props.expandedState, expand: props.expand, setInsertedBlock: props.setInsertedBlock })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { removeBlocks([clientId], false); onClose(); }, children: removeLabel }) })] }) }); } ;// external ["wp","escapeHtml"] const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/update-attributes.js /** * WordPress dependencies */ /** * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind */ /** * Navigation Link Block Attributes * * @typedef {Object} WPNavigationLinkBlockAttributes * * @property {string} [label] Link text. * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status. * @property {string} [type] The type such as post, page, tag, category and other custom types. * @property {string} [rel] The relationship of the linked URL. * @property {number} [id] A post or term id. * @property {boolean} [opensInNewTab] Sets link target to _blank when true. * @property {string} [url] Link href. * @property {string} [title] Link title attribute. */ /** * Link Control onChange handler that updates block attributes when a setting is changed. * * @param {Object} updatedValue New block attributes to update. * @param {Function} setAttributes Block attribute update function. * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes. */ const updateAttributes = (updatedValue = {}, setAttributes, blockAttributes = {}) => { const { label: originalLabel = '', kind: originalKind = '', type: originalType = '' } = blockAttributes; const { title: newLabel = '', // the title of any provided Post. url: newUrl = '', opensInNewTab, id, kind: newKind = originalKind, type: newType = originalType } = updatedValue; const newLabelWithoutHttp = newLabel.replace(/http(s?):\/\//gi, ''); const newUrlWithoutHttp = newUrl.replace(/http(s?):\/\//gi, ''); const useNewLabel = newLabel && newLabel !== originalLabel && // LinkControl without the title field relies // on the check below. Specifically, it assumes that // the URL is the same as a title. // This logic a) looks suspicious and b) should really // live in the LinkControl and not here. It's a great // candidate for future refactoring. newLabelWithoutHttp !== newUrlWithoutHttp; // Unfortunately this causes the escaping model to be inverted. // The escaped content is stored in the block attributes (and ultimately in the database), // and then the raw data is "recovered" when outputting into the DOM. // It would be preferable to store the **raw** data in the block attributes and escape it in JS. // Why? Because there isn't one way to escape data. Depending on the context, you need to do // different transforms. It doesn't make sense to me to choose one of them for the purposes of storage. // See also: // - https://github.com/WordPress/gutenberg/pull/41063 // - https://github.com/WordPress/gutenberg/pull/18617. const label = useNewLabel ? (0,external_wp_escapeHtml_namespaceObject.escapeHTML)(newLabel) : originalLabel || (0,external_wp_escapeHtml_namespaceObject.escapeHTML)(newUrlWithoutHttp); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag" const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_'); const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1; const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom'; const kind = isCustomLink ? 'custom' : newKind; setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string. ...(newUrl && { url: encodeURI((0,external_wp_url_namespaceObject.safeDecodeURI)(newUrl)) }), ...(label && { label }), ...(undefined !== opensInNewTab && { opensInNewTab }), ...(id && Number.isInteger(id) && { id }), ...(kind && { kind }), ...(type && type !== 'URL' && { type }) }); }; ;// ./node_modules/@wordpress/icons/build-module/library/chevron-right-small.js /** * WordPress dependencies */ const chevronRightSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z" }) }); /* harmony default export */ const chevron_right_small = (chevronRightSmall); ;// ./node_modules/@wordpress/icons/build-module/library/chevron-left-small.js /** * WordPress dependencies */ const chevronLeftSmall = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m13.1 16-3.4-4 3.4-4 1.1 1-2.6 3 2.6 3-1.1 1z" }) }); /* harmony default export */ const chevron_left_small = (chevronLeftSmall); ;// ./node_modules/@wordpress/icons/build-module/library/plus.js /** * WordPress dependencies */ const plus = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) }); /* harmony default export */ const library_plus = (plus); ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/link-ui.js /** * WordPress dependencies */ /** * Internal dependencies */ const { PrivateQuickInserter: QuickInserter } = unlock(external_wp_blockEditor_namespaceObject.privateApis); /** * Given the Link block's type attribute, return the query params to give to * /wp/v2/search. * * @param {string} type Link block's type attribute. * @param {string} kind Link block's entity of kind (post-type|taxonomy) * @return {{ type?: string, subtype?: string }} Search query params. */ function getSuggestionsQuery(type, kind) { switch (type) { case 'post': case 'page': return { type: 'post', subtype: type }; case 'category': return { type: 'term', subtype: 'category' }; case 'tag': return { type: 'term', subtype: 'post_tag' }; case 'post_format': return { type: 'post-format' }; default: if (kind === 'taxonomy') { return { type: 'term', subtype: type }; } if (kind === 'post-type') { return { type: 'post', subtype: type }; } return { // for custom link which has no type // always show pages as initial suggestions initialSuggestionsSearchOptions: { type: 'post', subtype: 'page', perPage: 20 } }; } } function LinkUIBlockInserter({ clientId, onBack }) { const { rootBlockClientId } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId } = select(external_wp_blockEditor_namespaceObject.store); return { rootBlockClientId: getBlockRootClientId(clientId) }; }, [clientId]); const focusOnMountRef = (0,external_wp_compose_namespaceObject.useFocusOnMount)('firstElement'); const dialogTitleId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_blockEditor_namespaceObject.LinkControl, `link-ui-block-inserter__title`); const dialogDescriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_blockEditor_namespaceObject.LinkControl, `link-ui-block-inserter__description`); if (!clientId) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "link-ui-block-inserter", role: "dialog", "aria-labelledby": dialogTitleId, "aria-describedby": dialogDescriptionId, ref: focusOnMountRef, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.VisuallyHidden, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { id: dialogTitleId, children: (0,external_wp_i18n_namespaceObject.__)('Add block') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { id: dialogDescriptionId, children: (0,external_wp_i18n_namespaceObject.__)('Choose a block to add to your Navigation.') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { className: "link-ui-block-inserter__back", icon: (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right_small : chevron_left_small, onClick: e => { e.preventDefault(); onBack(); }, size: "small", children: (0,external_wp_i18n_namespaceObject.__)('Back') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QuickInserter, { rootClientId: rootBlockClientId, clientId: clientId, isAppender: false, prioritizePatterns: false, selectBlockOnInsert: true, hasSearch: false })] }); } function UnforwardedLinkUI(props, ref) { const { label, url, opensInNewTab, type, kind } = props.link; const postType = type || 'page'; const [addingBlock, setAddingBlock] = (0,external_wp_element_namespaceObject.useState)(false); const [focusAddBlockButton, setFocusAddBlockButton] = (0,external_wp_element_namespaceObject.useState)(false); const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const permissions = (0,external_wp_coreData_namespaceObject.useResourcePermissions)({ kind: 'postType', name: postType }); async function handleCreate(pageTitle) { const page = await saveEntityRecord('postType', postType, { title: pageTitle, status: 'draft' }); return { id: page.id, type: postType, // Make `title` property consistent with that in `fetchLinkSuggestions` where the `rendered` title (containing HTML entities) // is also being decoded. By being consistent in both locations we avoid having to branch in the rendering output code. // Ideally in the future we will update both APIs to utilise the "raw" form of the title which is better suited to edit contexts. // e.g. // - title.raw = "Yes & No" // - title.rendered = "Yes & No" // - decodeEntities( title.rendered ) = "Yes & No" // See: // - https://github.com/WordPress/gutenberg/pull/41063 // - https://github.com/WordPress/gutenberg/blob/a1e1fdc0e6278457e9f4fc0b31ac6d2095f5450b/packages/core-data/src/fetch/__experimental-fetch-link-suggestions.js#L212-L218 title: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(page.title.rendered), url: page.link, kind: 'post-type' }; } // Memoize link value to avoid overriding the LinkControl's internal state. // This is a temporary fix. See https://github.com/WordPress/gutenberg/issues/50976#issuecomment-1568226407. const link = (0,external_wp_element_namespaceObject.useMemo)(() => ({ url, opensInNewTab, title: label && (0,external_wp_dom_namespaceObject.__unstableStripHTML)(label) }), [label, opensInNewTab, url]); const dialogTitleId = (0,external_wp_compose_namespaceObject.useInstanceId)(LinkUI, `link-ui-link-control__title`); const dialogDescriptionId = (0,external_wp_compose_namespaceObject.useInstanceId)(LinkUI, `link-ui-link-control__description`); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Popover, { ref: ref, placement: "bottom", onClose: props.onClose, anchor: props.anchor, shift: true, children: [!addingBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { role: "dialog", "aria-labelledby": dialogTitleId, "aria-describedby": dialogDescriptionId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.VisuallyHidden, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { id: dialogTitleId, children: (0,external_wp_i18n_namespaceObject.__)('Add link') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { id: dialogDescriptionId, children: (0,external_wp_i18n_namespaceObject.__)('Search for and add a link to your Navigation.') })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.LinkControl, { hasTextControl: true, hasRichPreviews: true, value: link, showInitialSuggestions: true, withCreateSuggestion: permissions.canCreate, createSuggestion: handleCreate, createSuggestionButtonText: searchTerm => { let format; if (type === 'post') { /* translators: %s: search term. */ format = (0,external_wp_i18n_namespaceObject.__)('Create draft post: <mark>%s</mark>'); } else { /* translators: %s: search term. */ format = (0,external_wp_i18n_namespaceObject.__)('Create draft page: <mark>%s</mark>'); } return (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.sprintf)(format, searchTerm), { mark: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("mark", {}) }); }, noDirectEntry: !!type, noURLSuggestion: !!type, suggestionsQuery: getSuggestionsQuery(type, kind), onChange: props.onChange, onRemove: props.onRemove, onCancel: props.onCancel, renderControlBottom: () => !link?.url?.length && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkUITools, { focusAddBlockButton: focusAddBlockButton, setAddingBlock: () => { setAddingBlock(true); setFocusAddBlockButton(false); } }) })] }), addingBlock && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkUIBlockInserter, { clientId: props.clientId, onBack: () => { setAddingBlock(false); setFocusAddBlockButton(true); } })] }); } const LinkUI = (0,external_wp_element_namespaceObject.forwardRef)(UnforwardedLinkUI); const LinkUITools = ({ setAddingBlock, focusAddBlockButton }) => { const blockInserterAriaRole = 'listbox'; const addBlockButtonRef = (0,external_wp_element_namespaceObject.useRef)(); // Focus the add block button when the popover is opened. (0,external_wp_element_namespaceObject.useEffect)(() => { if (focusAddBlockButton) { addBlockButtonRef.current?.focus(); } }, [focusAddBlockButton]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { className: "link-ui-tools", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, ref: addBlockButtonRef, icon: library_plus, onClick: e => { e.preventDefault(); setAddingBlock(true); }, "aria-haspopup": blockInserterAriaRole, children: (0,external_wp_i18n_namespaceObject.__)('Add block') }) }); }; /* harmony default export */ const link_ui = ((/* unused pure expression or super */ null && (LinkUITools))); ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/menu-inspector-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ const actionLabel = /* translators: %s: The name of a menu. */(0,external_wp_i18n_namespaceObject.__)("Switch to '%s'"); const BLOCKS_WITH_LINK_UI_SUPPORT = ['core/navigation-link', 'core/navigation-submenu']; const { PrivateListView } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function AdditionalBlockContent({ block, insertedBlock, setInsertedBlock }) { const { updateBlockAttributes } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const supportsLinkControls = BLOCKS_WITH_LINK_UI_SUPPORT?.includes(insertedBlock?.name); const blockWasJustInserted = insertedBlock?.clientId === block.clientId; const showLinkControls = supportsLinkControls && blockWasJustInserted; if (!showLinkControls) { return null; } const setInsertedBlockAttributes = _insertedBlockClientId => _updatedAttributes => { if (!_insertedBlockClientId) { return; } updateBlockAttributes(_insertedBlockClientId, _updatedAttributes); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkUI, { clientId: insertedBlock?.clientId, link: insertedBlock?.attributes, onClose: () => { setInsertedBlock(null); }, onChange: updatedValue => { updateAttributes(updatedValue, setInsertedBlockAttributes(insertedBlock?.clientId), insertedBlock?.attributes); setInsertedBlock(null); }, onCancel: () => { setInsertedBlock(null); } }); } const MainContent = ({ clientId, currentMenuId, isLoading, isNavigationMenuMissing, onCreateNew }) => { const hasChildren = (0,external_wp_data_namespaceObject.useSelect)(select => { return !!select(external_wp_blockEditor_namespaceObject.store).getBlockCount(clientId); }, [clientId]); const { navigationMenu } = useNavigationMenu(currentMenuId); if (currentMenuId && isNavigationMenuMissing) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(deleted_navigation_warning, { onCreateNew: onCreateNew, isNotice: true }); } if (isLoading) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}); } const description = navigationMenu ? (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: The name of a menu. */ (0,external_wp_i18n_namespaceObject.__)('Structure for Navigation Menu: %s'), navigationMenu?.title || (0,external_wp_i18n_namespaceObject.__)('Untitled menu')) : (0,external_wp_i18n_namespaceObject.__)('You have not yet created any menus. Displaying a list of your Pages'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-navigation__menu-inspector-controls", children: [!hasChildren && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "wp-block-navigation__menu-inspector-controls__empty-message", children: (0,external_wp_i18n_namespaceObject.__)('This Navigation Menu is empty.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivateListView, { rootClientId: clientId, isExpanded: true, description: description, showAppender: true, blockSettingsMenu: LeafMoreMenu, additionalBlockContent: AdditionalBlockContent })] }); }; const MenuInspectorControls = props => { const { createNavigationMenuIsSuccess, createNavigationMenuIsError, currentMenuId = null, onCreateNew, onSelectClassicMenu, onSelectNavigationMenu, isManageMenusButtonDisabled, blockEditingMode } = props; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "list", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: null, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { className: "wp-block-navigation-off-canvas-editor__header", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHeading, { className: "wp-block-navigation-off-canvas-editor__title", level: 2, children: (0,external_wp_i18n_namespaceObject.__)('Menu') }), blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(navigation_menu_selector, { currentMenuId: currentMenuId, onSelectClassicMenu: onSelectClassicMenu, onSelectNavigationMenu: onSelectNavigationMenu, onCreateNew: onCreateNew, createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, createNavigationMenuIsError: createNavigationMenuIsError, actionLabel: actionLabel, isManageMenusButtonDisabled: isManageMenusButtonDisabled })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MainContent, { ...props })] }) }); }; /* harmony default export */ const menu_inspector_controls = (MenuInspectorControls); ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/accessible-description.js /** * WordPress dependencies */ function AccessibleDescription({ id, children }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { id: id, className: "wp-block-navigation__description", children: children }) }); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/accessible-menu-description.js /** * WordPress dependencies */ /** * Internal dependencies */ function AccessibleMenuDescription({ id }) { const [menuTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_navigation', 'title'); /* translators: %s: Title of a Navigation Menu post. */ const description = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)(`Navigation Menu: "%s"`), menuTitle); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AccessibleDescription, { id: id, children: description }); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/edit/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ColorTools({ textColor, setTextColor, backgroundColor, setBackgroundColor, overlayTextColor, setOverlayTextColor, overlayBackgroundColor, setOverlayBackgroundColor, clientId, navRef }) { const [detectedBackgroundColor, setDetectedBackgroundColor] = (0,external_wp_element_namespaceObject.useState)(); const [detectedColor, setDetectedColor] = (0,external_wp_element_namespaceObject.useState)(); const [detectedOverlayBackgroundColor, setDetectedOverlayBackgroundColor] = (0,external_wp_element_namespaceObject.useState)(); const [detectedOverlayColor, setDetectedOverlayColor] = (0,external_wp_element_namespaceObject.useState)(); // Turn on contrast checker for web only since it's not supported on mobile yet. const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web'; (0,external_wp_element_namespaceObject.useEffect)(() => { if (!enableContrastChecking) { return; } detectColors(navRef.current, setDetectedColor, setDetectedBackgroundColor); const subMenuElement = navRef.current?.querySelector('[data-type="core/navigation-submenu"] [data-type="core/navigation-link"]'); if (!subMenuElement) { return; } // Only detect submenu overlay colors if they have previously been explicitly set. // This avoids the contrast checker from reporting on inherited submenu colors and // showing the contrast warning twice. if (overlayTextColor.color || overlayBackgroundColor.color) { detectColors(subMenuElement, setDetectedOverlayColor, setDetectedOverlayBackgroundColor); } }, [enableContrastChecking, overlayTextColor.color, overlayBackgroundColor.color, navRef]); const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); if (!colorGradientSettings.hasColorsOrGradients) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { __experimentalIsRenderedInSidebar: true, settings: [{ colorValue: textColor.color, label: (0,external_wp_i18n_namespaceObject.__)('Text'), onColorChange: setTextColor, resetAllFilter: () => setTextColor(), clearable: true }, { colorValue: backgroundColor.color, label: (0,external_wp_i18n_namespaceObject.__)('Background'), onColorChange: setBackgroundColor, resetAllFilter: () => setBackgroundColor(), clearable: true }, { colorValue: overlayTextColor.color, label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay text'), onColorChange: setOverlayTextColor, resetAllFilter: () => setOverlayTextColor(), clearable: true }, { colorValue: overlayBackgroundColor.color, label: (0,external_wp_i18n_namespaceObject.__)('Submenu & overlay background'), onColorChange: setOverlayBackgroundColor, resetAllFilter: () => setOverlayBackgroundColor(), clearable: true }], panelId: clientId, ...colorGradientSettings, gradients: [], disableCustomGradients: true }), enableContrastChecking && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ContrastChecker, { backgroundColor: detectedBackgroundColor, textColor: detectedColor }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ContrastChecker, { backgroundColor: detectedOverlayBackgroundColor, textColor: detectedOverlayColor })] })] }); } function Navigation({ attributes, setAttributes, clientId, isSelected, className, backgroundColor, setBackgroundColor, textColor, setTextColor, overlayBackgroundColor, setOverlayBackgroundColor, overlayTextColor, setOverlayTextColor, // These props are used by the navigation editor to override specific // navigation block settings. hasSubmenuIndicatorSetting = true, customPlaceholder: CustomPlaceholder = null, __unstableLayoutClassNames: layoutClassNames }) { const { openSubmenusOnClick, overlayMenu, showSubmenuIcon, templateLock, layout: { justifyContent, orientation = 'horizontal', flexWrap = 'wrap' } = {}, hasIcon, icon = 'handle' } = attributes; const ref = attributes.ref; const setRef = (0,external_wp_element_namespaceObject.useCallback)(postId => { setAttributes({ ref: postId }); }, [setAttributes]); const recursionId = `navigationMenu/${ref}`; const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(recursionId); const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); // Preload classic menus, so that they don't suddenly pop-in when viewing // the Select Menu dropdown. const { menus: classicMenus } = useNavigationEntities(); const [showNavigationMenuStatusNotice, hideNavigationMenuStatusNotice] = use_navigation_notice({ name: 'block-library/core/navigation/status' }); const [showClassicMenuConversionNotice, hideClassicMenuConversionNotice] = use_navigation_notice({ name: 'block-library/core/navigation/classic-menu-conversion' }); const [showNavigationMenuPermissionsNotice, hideNavigationMenuPermissionsNotice] = use_navigation_notice({ name: 'block-library/core/navigation/permissions/update' }); const { create: createNavigationMenu, status: createNavigationMenuStatus, error: createNavigationMenuError, value: createNavigationMenuPost, isPending: isCreatingNavigationMenu, isSuccess: createNavigationMenuIsSuccess, isError: createNavigationMenuIsError } = useCreateNavigationMenu(clientId); const createUntitledEmptyNavigationMenu = async () => { await createNavigationMenu(''); }; const { hasUncontrolledInnerBlocks, uncontrolledInnerBlocks, isInnerBlockSelected, innerBlocks } = useInnerBlocks(clientId); const hasSubmenus = !!innerBlocks.find(block => block.name === 'core/navigation-submenu'); const { replaceInnerBlocks, selectBlock, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const [isResponsiveMenuOpen, setResponsiveMenuVisibility] = (0,external_wp_element_namespaceObject.useState)(false); const [overlayMenuPreview, setOverlayMenuPreview] = (0,external_wp_element_namespaceObject.useState)(false); const { hasResolvedNavigationMenus, isNavigationMenuResolved, isNavigationMenuMissing, canUserUpdateNavigationMenu, hasResolvedCanUserUpdateNavigationMenu, canUserDeleteNavigationMenu, hasResolvedCanUserDeleteNavigationMenu, canUserCreateNavigationMenus, isResolvingCanUserCreateNavigationMenus, hasResolvedCanUserCreateNavigationMenus } = useNavigationMenu(ref); const navMenuResolvedButMissing = hasResolvedNavigationMenus && isNavigationMenuMissing; const { convert: convertClassicMenu, status: classicMenuConversionStatus, error: classicMenuConversionError } = use_convert_classic_menu_to_block_menu(createNavigationMenu); const isConvertingClassicMenu = classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING; const handleUpdateMenu = (0,external_wp_element_namespaceObject.useCallback)((menuId, options = { focusNavigationBlock: false }) => { const { focusNavigationBlock } = options; setRef(menuId); if (focusNavigationBlock) { selectBlock(clientId); } }, [selectBlock, clientId, setRef]); const isEntityAvailable = !isNavigationMenuMissing && isNavigationMenuResolved; // If the block has inner blocks, but no menu id, then these blocks are either: // - inserted via a pattern. // - inserted directly via Code View (or otherwise). // - from an older version of navigation block added before the block used a wp_navigation entity. // Consider this state as 'unsaved' and offer an uncontrolled version of inner blocks, // that automatically saves the menu as an entity when changes are made to the inner blocks. const hasUnsavedBlocks = hasUncontrolledInnerBlocks && !isEntityAvailable; const { getNavigationFallbackId } = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_coreData_namespaceObject.store)); const navigationFallbackId = !(ref || hasUnsavedBlocks) ? getNavigationFallbackId() : null; (0,external_wp_element_namespaceObject.useEffect)(() => { // If: // - there is an existing menu, OR // - there are existing (uncontrolled) inner blocks // ...then don't request a fallback menu. if (ref || hasUnsavedBlocks || !navigationFallbackId) { return; } /** * This fallback displays (both in editor and on front) * The fallback should not request a save (entity dirty state) * nor to be undoable, hence why it is marked as non persistent */ __unstableMarkNextChangeAsNotPersistent(); setRef(navigationFallbackId); }, [ref, setRef, hasUnsavedBlocks, navigationFallbackId, __unstableMarkNextChangeAsNotPersistent]); const navRef = (0,external_wp_element_namespaceObject.useRef)(); // The standard HTML5 tag for the block wrapper. const TagName = 'nav'; // "placeholder" shown if: // - there is no ref attribute pointing to a Navigation Post. // - there is no classic menu conversion process in progress. // - there is no menu creation process in progress. // - there are no uncontrolled blocks. const isPlaceholder = !ref && !isCreatingNavigationMenu && !isConvertingClassicMenu && hasResolvedNavigationMenus && classicMenus?.length === 0 && !hasUncontrolledInnerBlocks; // "loading" state: // - there is a menu creation process in progress. // - there is a classic menu conversion process in progress. // OR: // - there is a ref attribute pointing to a Navigation Post // - the Navigation Post isn't available (hasn't resolved) yet. const isLoading = !hasResolvedNavigationMenus || isCreatingNavigationMenu || isConvertingClassicMenu || !!(ref && !isEntityAvailable && !isConvertingClassicMenu); const textDecoration = attributes.style?.typography?.textDecoration; const hasBlockOverlay = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__unstableHasActiveBlockOverlayActive(clientId), [clientId]); const isResponsive = 'never' !== overlayMenu; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref: navRef, className: dist_clsx(className, { 'items-justified-right': justifyContent === 'right', 'items-justified-space-between': justifyContent === 'space-between', 'items-justified-left': justifyContent === 'left', 'items-justified-center': justifyContent === 'center', 'is-vertical': orientation === 'vertical', 'no-wrap': flexWrap === 'nowrap', 'is-responsive': isResponsive, 'has-text-color': !!textColor.color || !!textColor?.class, [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor?.slug)]: !!textColor?.slug, 'has-background': !!backgroundColor.color || backgroundColor.class, [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor?.slug)]: !!backgroundColor?.slug, [`has-text-decoration-${textDecoration}`]: textDecoration, 'block-editor-block-content-overlay': hasBlockOverlay }, layoutClassNames), style: { color: !textColor?.slug && textColor?.color, backgroundColor: !backgroundColor?.slug && backgroundColor?.color } }); const onSelectClassicMenu = async classicMenu => { return convertClassicMenu(classicMenu.id, classicMenu.name, 'draft'); }; const onSelectNavigationMenu = menuId => { handleUpdateMenu(menuId); }; (0,external_wp_element_namespaceObject.useEffect)(() => { hideNavigationMenuStatusNotice(); if (isCreatingNavigationMenu) { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)(`Creating Navigation Menu.`)); } if (createNavigationMenuIsSuccess) { handleUpdateMenu(createNavigationMenuPost?.id, { focusNavigationBlock: true }); showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.__)(`Navigation Menu successfully created.`)); } if (createNavigationMenuIsError) { showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.__)('Failed to create Navigation Menu.')); } }, [createNavigationMenuStatus, createNavigationMenuError, createNavigationMenuPost?.id, createNavigationMenuIsError, createNavigationMenuIsSuccess, isCreatingNavigationMenu, handleUpdateMenu, hideNavigationMenuStatusNotice, showNavigationMenuStatusNotice]); (0,external_wp_element_namespaceObject.useEffect)(() => { hideClassicMenuConversionNotice(); if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_PENDING) { (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Classic menu importing.')); } if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_SUCCESS) { showClassicMenuConversionNotice((0,external_wp_i18n_namespaceObject.__)('Classic menu imported successfully.')); handleUpdateMenu(createNavigationMenuPost?.id, { focusNavigationBlock: true }); } if (classicMenuConversionStatus === CLASSIC_MENU_CONVERSION_ERROR) { showClassicMenuConversionNotice((0,external_wp_i18n_namespaceObject.__)('Classic menu import failed.')); } }, [classicMenuConversionStatus, classicMenuConversionError, hideClassicMenuConversionNotice, showClassicMenuConversionNotice, createNavigationMenuPost?.id, handleUpdateMenu]); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isSelected && !isInnerBlockSelected) { hideNavigationMenuPermissionsNotice(); } if (isSelected || isInnerBlockSelected) { if (ref && !navMenuResolvedButMissing && hasResolvedCanUserUpdateNavigationMenu && !canUserUpdateNavigationMenu) { showNavigationMenuPermissionsNotice((0,external_wp_i18n_namespaceObject.__)('You do not have permission to edit this Menu. Any changes made will not be saved.')); } if (!ref && hasResolvedCanUserCreateNavigationMenus && !canUserCreateNavigationMenus) { showNavigationMenuPermissionsNotice((0,external_wp_i18n_namespaceObject.__)('You do not have permission to create Navigation Menus.')); } } }, [isSelected, isInnerBlockSelected, canUserUpdateNavigationMenu, hasResolvedCanUserUpdateNavigationMenu, canUserCreateNavigationMenus, hasResolvedCanUserCreateNavigationMenus, ref, hideNavigationMenuPermissionsNotice, showNavigationMenuPermissionsNotice, navMenuResolvedButMissing]); const hasManagePermissions = canUserCreateNavigationMenus || canUserUpdateNavigationMenu; const overlayMenuPreviewClasses = dist_clsx('wp-block-navigation__overlay-menu-preview', { open: overlayMenuPreview }); const submenuAccessibilityNotice = !showSubmenuIcon && !openSubmenusOnClick ? (0,external_wp_i18n_namespaceObject.__)('The current menu options offer reduced accessibility for users and are not recommended. Enabling either "Open on Click" or "Show arrow" offers enhanced accessibility by allowing keyboard users to browse submenus selectively.') : ''; const isFirstRender = (0,external_wp_element_namespaceObject.useRef)(true); // Don't speak on first render. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isFirstRender.current && submenuAccessibilityNotice) { (0,external_wp_a11y_namespaceObject.speak)(submenuAccessibilityNotice); } isFirstRender.current = false; }, [submenuAccessibilityNotice]); const overlayMenuPreviewId = (0,external_wp_compose_namespaceObject.useInstanceId)(OverlayMenuPreview, `overlay-menu-preview`); const stylingInspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: hasSubmenuIndicatorSetting && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Display'), children: [isResponsive && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, className: overlayMenuPreviewClasses, onClick: () => { setOverlayMenuPreview(!overlayMenuPreview); }, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Overlay menu controls'), "aria-controls": overlayMenuPreviewId, "aria-expanded": overlayMenuPreview, children: [hasIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverlayMenuIcon, { icon: icon }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_close })] }), !hasIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: (0,external_wp_i18n_namespaceObject.__)('Menu') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: (0,external_wp_i18n_namespaceObject.__)('Close') })] })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { id: overlayMenuPreviewId, children: overlayMenuPreview && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(OverlayMenuPreview, { setAttributes: setAttributes, hasIcon: hasIcon, icon: icon, hidden: !overlayMenuPreview }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Overlay Menu'), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Configure overlay menu'), value: overlayMenu, help: (0,external_wp_i18n_namespaceObject.__)('Collapses the navigation options in a menu icon opening an overlay.'), onChange: value => setAttributes({ overlayMenu: value }), isBlock: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "never", label: (0,external_wp_i18n_namespaceObject.__)('Off') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "mobile", label: (0,external_wp_i18n_namespaceObject.__)('Mobile') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "always", label: (0,external_wp_i18n_namespaceObject.__)('Always') })] }), hasSubmenus && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h3", { children: (0,external_wp_i18n_namespaceObject.__)('Submenus') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, checked: openSubmenusOnClick, onChange: value => { setAttributes({ openSubmenusOnClick: value, ...(value && { showSubmenuIcon: true }) // Make sure arrows are shown when we toggle this on. }); }, label: (0,external_wp_i18n_namespaceObject.__)('Open on click') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, checked: showSubmenuIcon, onChange: value => { setAttributes({ showSubmenuIcon: value }); }, disabled: attributes.openSubmenusOnClick, label: (0,external_wp_i18n_namespaceObject.__)('Show arrow') }), submenuAccessibilityNotice && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { spokenMessage: null, status: "warning", isDismissible: false, children: submenuAccessibilityNotice }) })] })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "color", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ColorTools, { textColor: textColor, setTextColor: setTextColor, backgroundColor: backgroundColor, setBackgroundColor: setBackgroundColor, overlayTextColor: overlayTextColor, setOverlayTextColor: setOverlayTextColor, overlayBackgroundColor: overlayBackgroundColor, setOverlayBackgroundColor: setOverlayBackgroundColor, clientId: clientId, navRef: navRef }) })] }); const accessibleDescriptionId = `${clientId}-desc`; const isHiddenByDefault = 'always' === overlayMenu; const isManageMenusButtonDisabled = !hasManagePermissions || !hasResolvedNavigationMenus; if (hasUnsavedBlocks && !isCreatingNavigationMenu) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { ...blockProps, "aria-describedby": !isPlaceholder ? accessibleDescriptionId : undefined, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AccessibleDescription, { id: accessibleDescriptionId, children: (0,external_wp_i18n_namespaceObject.__)('Unsaved Navigation Menu.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_inspector_controls, { clientId: clientId, createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, createNavigationMenuIsError: createNavigationMenuIsError, currentMenuId: ref, isNavigationMenuMissing: isNavigationMenuMissing, isManageMenusButtonDisabled: isManageMenusButtonDisabled, onCreateNew: createUntitledEmptyNavigationMenu, onSelectClassicMenu: onSelectClassicMenu, onSelectNavigationMenu: onSelectNavigationMenu, isLoading: isLoading, blockEditingMode: blockEditingMode }), blockEditingMode === 'default' && stylingInspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResponsiveWrapper, { id: clientId, onToggle: setResponsiveMenuVisibility, isOpen: isResponsiveMenuOpen, hasIcon: hasIcon, icon: icon, isResponsive: isResponsive, isHiddenByDefault: isHiddenByDefault, overlayBackgroundColor: overlayBackgroundColor, overlayTextColor: overlayTextColor, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(UnsavedInnerBlocks, { createNavigationMenu: createNavigationMenu, blocks: uncontrolledInnerBlocks, hasSelection: isSelected || isInnerBlockSelected }) })] }); } // Show a warning if the selected menu is no longer available. // TODO - the user should be able to select a new one? if (ref && isNavigationMenuMissing) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_inspector_controls, { clientId: clientId, createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, createNavigationMenuIsError: createNavigationMenuIsError, currentMenuId: ref, isNavigationMenuMissing: isNavigationMenuMissing, isManageMenusButtonDisabled: isManageMenusButtonDisabled, onCreateNew: createUntitledEmptyNavigationMenu, onSelectClassicMenu: onSelectClassicMenu, onSelectNavigationMenu: onSelectNavigationMenu, isLoading: isLoading, blockEditingMode: blockEditingMode }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(deleted_navigation_warning, { onCreateNew: createUntitledEmptyNavigationMenu })] }); } if (isEntityAvailable && hasAlreadyRendered) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.') }) }); } const PlaceholderComponent = CustomPlaceholder ? CustomPlaceholder : NavigationPlaceholder; /** * Historically the navigation block has supported custom placeholders. * Even though the current UX tries as hard as possible not to * end up in a placeholder state, the block continues to support * this extensibility point, via a CustomPlaceholder. * When CustomPlaceholder is present it becomes the default fallback * for an empty navigation block, instead of the default fallbacks. * */ if (isPlaceholder && CustomPlaceholder) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PlaceholderComponent, { isSelected: isSelected, currentMenuId: ref, clientId: clientId, canUserCreateNavigationMenus: canUserCreateNavigationMenus, isResolvingCanUserCreateNavigationMenus: isResolvingCanUserCreateNavigationMenus, onSelectNavigationMenu: onSelectNavigationMenu, onSelectClassicMenu: onSelectClassicMenu, onCreateEmpty: createUntitledEmptyNavigationMenu }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_coreData_namespaceObject.EntityProvider, { kind: "postType", type: "wp_navigation", id: ref, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.RecursionProvider, { uniqueId: recursionId, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(menu_inspector_controls, { clientId: clientId, createNavigationMenuIsSuccess: createNavigationMenuIsSuccess, createNavigationMenuIsError: createNavigationMenuIsError, currentMenuId: ref, isNavigationMenuMissing: isNavigationMenuMissing, isManageMenusButtonDisabled: isManageMenusButtonDisabled, onCreateNew: createUntitledEmptyNavigationMenu, onSelectClassicMenu: onSelectClassicMenu, onSelectNavigationMenu: onSelectNavigationMenu, isLoading: isLoading, blockEditingMode: blockEditingMode }), blockEditingMode === 'default' && stylingInspectorControls, blockEditingMode === 'default' && isEntityAvailable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: [hasResolvedCanUserUpdateNavigationMenu && canUserUpdateNavigationMenu && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuNameControl, {}), hasResolvedCanUserDeleteNavigationMenu && canUserDeleteNavigationMenu && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationMenuDeleteControl, { onDelete: () => { replaceInnerBlocks(clientId, []); showNavigationMenuStatusNotice((0,external_wp_i18n_namespaceObject.__)('Navigation Menu successfully deleted.')); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(manage_menus_button, { disabled: isManageMenusButtonDisabled, className: "wp-block-navigation-manage-menus-button" })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(TagName, { ...blockProps, "aria-describedby": !isPlaceholder && !isLoading ? accessibleDescriptionId : undefined, children: [isLoading && !isHiddenByDefault && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-navigation__loading-indicator-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { className: "wp-block-navigation__loading-indicator" }) }), (!isLoading || isHiddenByDefault) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(AccessibleMenuDescription, { id: accessibleDescriptionId }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResponsiveWrapper, { id: clientId, onToggle: setResponsiveMenuVisibility, hasIcon: hasIcon, icon: icon, isOpen: isResponsiveMenuOpen, isResponsive: isResponsive, isHiddenByDefault: isHiddenByDefault, overlayBackgroundColor: overlayBackgroundColor, overlayTextColor: overlayTextColor, children: isEntityAvailable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(NavigationInnerBlocks, { clientId: clientId, hasCustomPlaceholder: !!CustomPlaceholder, templateLock: templateLock, orientation: orientation }) })] })] })] }) }); } /* harmony default export */ const navigation_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)({ textColor: 'color' }, { backgroundColor: 'color' }, { overlayBackgroundColor: 'color' }, { overlayTextColor: 'color' })(Navigation)); ;// ./node_modules/@wordpress/block-library/build-module/navigation/save.js /** * WordPress dependencies */ function navigation_save_save({ attributes }) { if (attributes.ref) { // Avoid rendering inner blocks when a ref is defined. // When this id is defined the inner blocks are loaded from the // `wp_navigation` entity rather than the hard-coded block html. return; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } ;// ./node_modules/@wordpress/block-library/build-module/navigation/deprecated.js /** * WordPress dependencies */ /** * Internal dependencies */ const TYPOGRAPHY_PRESET_DEPRECATION_MAP = { fontStyle: 'var:preset|font-style|', fontWeight: 'var:preset|font-weight|', textDecoration: 'var:preset|text-decoration|', textTransform: 'var:preset|text-transform|' }; const migrateIdToRef = ({ navigationMenuId, ...attributes }) => { return { ...attributes, ref: navigationMenuId }; }; const deprecated_migrateWithLayout = attributes => { if (!!attributes.layout) { return attributes; } const { itemsJustification, orientation, ...updatedAttributes } = attributes; if (itemsJustification || orientation) { Object.assign(updatedAttributes, { layout: { type: 'flex', ...(itemsJustification && { justifyContent: itemsJustification }), ...(orientation && { orientation }) } }); } return updatedAttributes; }; const navigation_deprecated_v6 = { attributes: { navigationMenuId: { type: 'number' }, textColor: { type: 'string' }, customTextColor: { type: 'string' }, rgbTextColor: { type: 'string' }, backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, rgbBackgroundColor: { type: 'string' }, showSubmenuIcon: { type: 'boolean', default: true }, openSubmenusOnClick: { type: 'boolean', default: false }, overlayMenu: { type: 'string', default: 'mobile' }, __unstableLocation: { type: 'string' }, overlayBackgroundColor: { type: 'string' }, customOverlayBackgroundColor: { type: 'string' }, overlayTextColor: { type: 'string' }, customOverlayTextColor: { type: 'string' } }, supports: { align: ['wide', 'full'], anchor: true, html: false, inserter: true, typography: { fontSize: true, lineHeight: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalTextTransform: true, __experimentalFontFamily: true, __experimentalTextDecoration: true, __experimentalDefaultControls: { fontSize: true } }, spacing: { blockGap: true, units: ['px', 'em', 'rem', 'vh', 'vw'], __experimentalDefaultControls: { blockGap: true } }, layout: { allowSwitching: false, allowInheriting: false, default: { type: 'flex' } } }, save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); }, isEligible: ({ navigationMenuId }) => !!navigationMenuId, migrate: migrateIdToRef }; const navigation_deprecated_v5 = { attributes: { navigationMenuId: { type: 'number' }, orientation: { type: 'string', default: 'horizontal' }, textColor: { type: 'string' }, customTextColor: { type: 'string' }, rgbTextColor: { type: 'string' }, backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, rgbBackgroundColor: { type: 'string' }, itemsJustification: { type: 'string' }, showSubmenuIcon: { type: 'boolean', default: true }, openSubmenusOnClick: { type: 'boolean', default: false }, overlayMenu: { type: 'string', default: 'never' }, __unstableLocation: { type: 'string' }, overlayBackgroundColor: { type: 'string' }, customOverlayBackgroundColor: { type: 'string' }, overlayTextColor: { type: 'string' }, customOverlayTextColor: { type: 'string' } }, supports: { align: ['wide', 'full'], anchor: true, html: false, inserter: true, typography: { fontSize: true, lineHeight: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalTextTransform: true, __experimentalFontFamily: true, __experimentalTextDecoration: true, __experimentalDefaultControls: { fontSize: true } }, spacing: { blockGap: true, units: ['px', 'em', 'rem', 'vh', 'vw'], __experimentalDefaultControls: { blockGap: true } } }, save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); }, isEligible: ({ itemsJustification, orientation }) => !!itemsJustification || !!orientation, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout) }; const navigation_deprecated_v4 = { attributes: { orientation: { type: 'string', default: 'horizontal' }, textColor: { type: 'string' }, customTextColor: { type: 'string' }, rgbTextColor: { type: 'string' }, backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, rgbBackgroundColor: { type: 'string' }, itemsJustification: { type: 'string' }, showSubmenuIcon: { type: 'boolean', default: true }, openSubmenusOnClick: { type: 'boolean', default: false }, overlayMenu: { type: 'string', default: 'never' }, __unstableLocation: { type: 'string' }, overlayBackgroundColor: { type: 'string' }, customOverlayBackgroundColor: { type: 'string' }, overlayTextColor: { type: 'string' }, customOverlayTextColor: { type: 'string' } }, supports: { align: ['wide', 'full'], anchor: true, html: false, inserter: true, typography: { fontSize: true, lineHeight: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalTextTransform: true, __experimentalFontFamily: true, __experimentalTextDecoration: true }, spacing: { blockGap: true, units: ['px', 'em', 'rem', 'vh', 'vw'], __experimentalDefaultControls: { blockGap: true } } }, save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family), isEligible({ style }) { return style?.typography?.fontFamily; } }; const migrateIsResponsive = function (attributes) { delete attributes.isResponsive; return { ...attributes, overlayMenu: 'mobile' }; }; const migrateTypographyPresets = function (attributes) { var _attributes$style$typ; return { ...attributes, style: { ...attributes.style, typography: Object.fromEntries(Object.entries((_attributes$style$typ = attributes.style.typography) !== null && _attributes$style$typ !== void 0 ? _attributes$style$typ : {}).map(([key, value]) => { const prefix = TYPOGRAPHY_PRESET_DEPRECATION_MAP[key]; if (prefix && value.startsWith(prefix)) { const newValue = value.slice(prefix.length); if ('textDecoration' === key && 'strikethrough' === newValue) { return [key, 'line-through']; } return [key, newValue]; } return [key, value]; })) } }; }; const navigation_deprecated_deprecated = [navigation_deprecated_v6, navigation_deprecated_v5, navigation_deprecated_v4, // Remove `isResponsive` attribute. { attributes: { orientation: { type: 'string', default: 'horizontal' }, textColor: { type: 'string' }, customTextColor: { type: 'string' }, rgbTextColor: { type: 'string' }, backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, rgbBackgroundColor: { type: 'string' }, itemsJustification: { type: 'string' }, showSubmenuIcon: { type: 'boolean', default: true }, openSubmenusOnClick: { type: 'boolean', default: false }, isResponsive: { type: 'boolean', default: 'false' }, __unstableLocation: { type: 'string' }, overlayBackgroundColor: { type: 'string' }, customOverlayBackgroundColor: { type: 'string' }, overlayTextColor: { type: 'string' }, customOverlayTextColor: { type: 'string' } }, supports: { align: ['wide', 'full'], anchor: true, html: false, inserter: true, typography: { fontSize: true, lineHeight: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalTextTransform: true, __experimentalFontFamily: true, __experimentalTextDecoration: true } }, isEligible(attributes) { return attributes.isResponsive; }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateIsResponsive), save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } }, { attributes: { orientation: { type: 'string' }, textColor: { type: 'string' }, customTextColor: { type: 'string' }, rgbTextColor: { type: 'string' }, backgroundColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, rgbBackgroundColor: { type: 'string' }, itemsJustification: { type: 'string' }, showSubmenuIcon: { type: 'boolean', default: true } }, supports: { align: ['wide', 'full'], anchor: true, html: false, inserter: true, fontSize: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalTextTransform: true, color: true, __experimentalFontFamily: true, __experimentalTextDecoration: true }, save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); }, isEligible(attributes) { if (!attributes.style || !attributes.style.typography) { return false; } for (const styleAttribute in TYPOGRAPHY_PRESET_DEPRECATION_MAP) { const attributeValue = attributes.style.typography[styleAttribute]; if (attributeValue && attributeValue.startsWith(TYPOGRAPHY_PRESET_DEPRECATION_MAP[styleAttribute])) { return true; } } return false; }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, deprecated_migrateWithLayout, migrate_font_family, migrateTypographyPresets) }, { attributes: { className: { type: 'string' }, textColor: { type: 'string' }, rgbTextColor: { type: 'string' }, backgroundColor: { type: 'string' }, rgbBackgroundColor: { type: 'string' }, fontSize: { type: 'string' }, customFontSize: { type: 'number' }, itemsJustification: { type: 'string' }, showSubmenuIcon: { type: 'boolean' } }, isEligible(attribute) { return attribute.rgbTextColor || attribute.rgbBackgroundColor; }, supports: { align: ['wide', 'full'], anchor: true, html: false, inserter: true }, migrate: (0,external_wp_compose_namespaceObject.compose)(migrateIdToRef, attributes => { const { rgbTextColor, rgbBackgroundColor, ...restAttributes } = attributes; return { ...restAttributes, customTextColor: attributes.textColor ? undefined : attributes.rgbTextColor, customBackgroundColor: attributes.backgroundColor ? undefined : attributes.rgbBackgroundColor }; }), save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } }]; /* harmony default export */ const navigation_deprecated = (navigation_deprecated_deprecated); ;// ./node_modules/@wordpress/block-library/build-module/navigation/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const navigation_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/navigation", title: "Navigation", category: "theme", allowedBlocks: ["core/navigation-link", "core/search", "core/social-links", "core/page-list", "core/spacer", "core/home-link", "core/site-title", "core/site-logo", "core/navigation-submenu", "core/loginout", "core/buttons"], description: "A collection of blocks that allow visitors to get around your site.", keywords: ["menu", "navigation", "links"], textdomain: "default", attributes: { ref: { type: "number" }, textColor: { type: "string" }, customTextColor: { type: "string" }, rgbTextColor: { type: "string" }, backgroundColor: { type: "string" }, customBackgroundColor: { type: "string" }, rgbBackgroundColor: { type: "string" }, showSubmenuIcon: { type: "boolean", "default": true }, openSubmenusOnClick: { type: "boolean", "default": false }, overlayMenu: { type: "string", "default": "mobile" }, icon: { type: "string", "default": "handle" }, hasIcon: { type: "boolean", "default": true }, __unstableLocation: { type: "string" }, overlayBackgroundColor: { type: "string" }, customOverlayBackgroundColor: { type: "string" }, overlayTextColor: { type: "string" }, customOverlayTextColor: { type: "string" }, maxNestingLevel: { type: "number", "default": 5 }, templateLock: { type: ["string", "boolean"], "enum": ["all", "insert", "contentOnly", false] } }, providesContext: { textColor: "textColor", customTextColor: "customTextColor", backgroundColor: "backgroundColor", customBackgroundColor: "customBackgroundColor", overlayTextColor: "overlayTextColor", customOverlayTextColor: "customOverlayTextColor", overlayBackgroundColor: "overlayBackgroundColor", customOverlayBackgroundColor: "customOverlayBackgroundColor", fontSize: "fontSize", customFontSize: "customFontSize", showSubmenuIcon: "showSubmenuIcon", openSubmenusOnClick: "openSubmenusOnClick", style: "style", maxNestingLevel: "maxNestingLevel" }, supports: { align: ["wide", "full"], ariaLabel: true, html: false, inserter: true, typography: { fontSize: true, lineHeight: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalTextTransform: true, __experimentalFontFamily: true, __experimentalLetterSpacing: true, __experimentalTextDecoration: true, __experimentalSkipSerialization: ["textDecoration"], __experimentalDefaultControls: { fontSize: true } }, spacing: { blockGap: true, units: ["px", "em", "rem", "vh", "vw"], __experimentalDefaultControls: { blockGap: true } }, layout: { allowSwitching: false, allowInheriting: false, allowVerticalAlignment: false, allowSizingOnChildren: true, "default": { type: "flex" } }, interactivity: true, renaming: false }, editorStyle: "wp-block-navigation-editor", style: "wp-block-navigation" }; const { name: navigation_name } = navigation_metadata; const navigation_settings = { icon: library_navigation, example: { attributes: { overlayMenu: 'never' }, innerBlocks: [{ name: 'core/navigation-link', attributes: { // translators: 'Home' as in a website's home page. label: (0,external_wp_i18n_namespaceObject.__)('Home'), url: 'https://make.wordpress.org/' } }, { name: 'core/navigation-link', attributes: { // translators: 'About' as in a website's about page. label: (0,external_wp_i18n_namespaceObject.__)('About'), url: 'https://make.wordpress.org/' } }, { name: 'core/navigation-link', attributes: { // translators: 'Contact' as in a website's contact page. label: (0,external_wp_i18n_namespaceObject.__)('Contact'), url: 'https://make.wordpress.org/' } }] }, edit: navigation_edit, save: navigation_save_save, __experimentalLabel: ({ ref }) => { if (!ref) { return; } const navigation = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_navigation', ref); if (!navigation?.title) { return; } return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(navigation.title); }, deprecated: navigation_deprecated }; const navigation_init = () => initBlock({ name: navigation_name, metadata: navigation_metadata, settings: navigation_settings }); ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const navigation_link_edit_DEFAULT_BLOCK = { name: 'core/navigation-link' }; /** * A React hook to determine if it's dragging within the target element. * * @typedef {import('@wordpress/element').RefObject} RefObject * * @param {RefObject<HTMLElement>} elementRef The target elementRef object. * * @return {boolean} Is dragging within the target element. */ const useIsDraggingWithin = elementRef => { const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { const { ownerDocument } = elementRef.current; function handleDragStart(event) { // Check the first time when the dragging starts. handleDragEnter(event); } // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape. function handleDragEnd() { setIsDraggingWithin(false); } function handleDragEnter(event) { // Check if the current target is inside the item element. if (elementRef.current.contains(event.target)) { setIsDraggingWithin(true); } else { setIsDraggingWithin(false); } } // Bind these events to the document to catch all drag events. // Ideally, we can also use `event.relatedTarget`, but sadly that // doesn't work in Safari. ownerDocument.addEventListener('dragstart', handleDragStart); ownerDocument.addEventListener('dragend', handleDragEnd); ownerDocument.addEventListener('dragenter', handleDragEnter); return () => { ownerDocument.removeEventListener('dragstart', handleDragStart); ownerDocument.removeEventListener('dragend', handleDragEnd); ownerDocument.removeEventListener('dragenter', handleDragEnter); }; }, [elementRef]); return isDraggingWithin; }; const useIsInvalidLink = (kind, type, id) => { const isPostType = kind === 'post-type' || type === 'post' || type === 'page'; const hasId = Number.isInteger(id); const postStatus = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!isPostType) { return null; } const { getEntityRecord } = select(external_wp_coreData_namespaceObject.store); return getEntityRecord('postType', type, id)?.status; }, [isPostType, type, id]); // Check Navigation Link validity if: // 1. Link is 'post-type'. // 2. It has an id. // 3. It's neither null, nor undefined, as valid items might be either of those while loading. // If those conditions are met, check if // 1. The post status is published. // 2. The Navigation Link item has no label. // If either of those is true, invalidate. const isInvalid = isPostType && hasId && postStatus && 'trash' === postStatus; const isDraft = 'draft' === postStatus; return [isInvalid, isDraft]; }; function getMissingText(type) { let missingText = ''; switch (type) { case 'post': /* translators: label for missing post in navigation link block */ missingText = (0,external_wp_i18n_namespaceObject.__)('Select post'); break; case 'page': /* translators: label for missing page in navigation link block */ missingText = (0,external_wp_i18n_namespaceObject.__)('Select page'); break; case 'category': /* translators: label for missing category in navigation link block */ missingText = (0,external_wp_i18n_namespaceObject.__)('Select category'); break; case 'tag': /* translators: label for missing tag in navigation link block */ missingText = (0,external_wp_i18n_namespaceObject.__)('Select tag'); break; default: /* translators: label for missing values in navigation link block */ missingText = (0,external_wp_i18n_namespaceObject.__)('Add link'); } return missingText; } /* * Warning, this duplicated in * packages/block-library/src/navigation-submenu/edit.js * Consider reusing this components for both blocks. */ function Controls({ attributes, setAttributes, setIsLabelFieldFocused }) { const { label, url, description, title, rel } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!label, label: (0,external_wp_i18n_namespaceObject.__)('Text'), onDeselect: () => setAttributes({ label: '' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Text'), value: label ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(label) : '', onChange: labelValue => { setAttributes({ label: labelValue }); }, autoComplete: "off", onFocus: () => setIsLabelFieldFocused(true), onBlur: () => setIsLabelFieldFocused(false) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!url, label: (0,external_wp_i18n_namespaceObject.__)('Link'), onDeselect: () => setAttributes({ url: '' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Link'), value: url ? (0,external_wp_url_namespaceObject.safeDecodeURI)(url) : '', onChange: urlValue => { updateAttributes({ url: urlValue }, setAttributes, attributes); }, autoComplete: "off", type: "url" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!description, label: (0,external_wp_i18n_namespaceObject.__)('Description'), onDeselect: () => setAttributes({ description: '' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Description'), value: description || '', onChange: descriptionValue => { setAttributes({ description: descriptionValue }); }, help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!title, label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), onDeselect: () => setAttributes({ title: '' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), value: title || '', onChange: titleValue => { setAttributes({ title: titleValue }); }, autoComplete: "off", help: (0,external_wp_i18n_namespaceObject.__)('Additional information to help clarify the purpose of the link.') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!rel, label: (0,external_wp_i18n_namespaceObject.__)('Rel attribute'), onDeselect: () => setAttributes({ rel: '' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Rel attribute'), value: rel || '', onChange: relValue => { setAttributes({ rel: relValue }); }, autoComplete: "off", help: (0,external_wp_i18n_namespaceObject.__)('The relationship of the linked URL as space-separated link types.') }) })] }); } function NavigationLinkEdit({ attributes, isSelected, setAttributes, insertBlocksAfter, mergeBlocks, onReplace, context, clientId }) { const { id, label, type, url, description, kind } = attributes; const [isInvalid, isDraft] = useIsInvalidLink(kind, type, id); const { maxNestingLevel } = context; const { replaceBlock, __unstableMarkNextChangeAsNotPersistent, selectBlock, selectPreviousBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Have the link editing ui open on mount when lacking a url and selected. const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(isSelected && !url); // Store what element opened the popover, so we know where to return focus to (toolbar button vs navigation link text) const [openedBy, setOpenedBy] = (0,external_wp_element_namespaceObject.useState)(null); // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null); const isDraggingWithin = useIsDraggingWithin(listItemRef); const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add label…'); const ref = (0,external_wp_element_namespaceObject.useRef)(); const linkUIref = (0,external_wp_element_namespaceObject.useRef)(); const prevUrl = (0,external_wp_compose_namespaceObject.usePrevious)(url); // Change the label using inspector causes rich text to change focus on firefox. // This is a workaround to keep the focus on the label field when label filed is focused we don't render the rich text. const [isLabelFieldFocused, setIsLabelFieldFocused] = (0,external_wp_element_namespaceObject.useState)(false); const { isAtMaxNesting, isTopLevelLink, isParentOfSelectedBlock, hasChildren } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockCount, getBlockName, getBlockRootClientId, hasSelectedInnerBlock, getBlockParentsByBlockName } = select(external_wp_blockEditor_namespaceObject.store); return { isAtMaxNesting: getBlockParentsByBlockName(clientId, ['core/navigation-link', 'core/navigation-submenu']).length >= maxNestingLevel, isTopLevelLink: getBlockName(getBlockRootClientId(clientId)) === 'core/navigation', isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true), hasChildren: !!getBlockCount(clientId) }; }, [clientId, maxNestingLevel]); const { getBlocks } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); /** * Transform to submenu block. */ const transformToSubmenu = () => { let innerBlocks = getBlocks(clientId); if (innerBlocks.length === 0) { innerBlocks = [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link')]; selectBlock(innerBlocks[0].clientId); } const newSubmenu = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks); replaceBlock(clientId, newSubmenu); }; (0,external_wp_element_namespaceObject.useEffect)(() => { // If block has inner blocks, transform to Submenu. if (hasChildren) { // This side-effect should not create an undo level as those should // only be created via user interactions. __unstableMarkNextChangeAsNotPersistent(); transformToSubmenu(); } }, [hasChildren]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text. (0,external_wp_element_namespaceObject.useEffect)(() => { // We only want to do this when the URL has gone from nothing to a new URL AND the label looks like a URL if (!prevUrl && url && isLinkOpen && (0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) { // Focus and select the label text. selectLabelText(); } }, [prevUrl, url, isLinkOpen, label]); /** * Focus the Link label text and select it. */ function selectLabelText() { ref.current.focus(); const { ownerDocument } = ref.current; const { defaultView } = ownerDocument; const selection = defaultView.getSelection(); const range = ownerDocument.createRange(); // Get the range of the current ref contents so we can add this range to the selection. range.selectNodeContents(ref.current); selection.removeAllRanges(); selection.addRange(range); } /** * Removes the current link if set. */ function removeLink() { // Reset all attributes that comprise the link. // It is critical that all attributes are reset // to their default values otherwise this may // in advertently trigger side effects because // the values will have "changed". setAttributes({ url: undefined, label: undefined, id: undefined, kind: undefined, type: undefined, opensInNewTab: false }); // Close the link editing UI. setIsLinkOpen(false); } const { textColor, customTextColor, backgroundColor, customBackgroundColor } = getColors(context, !isTopLevelLink); function onKeyDown(event) { if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) { // Required to prevent the command center from opening, // as it shares the CMD+K shortcut. // See https://github.com/WordPress/gutenberg/pull/59845. event.preventDefault(); // If this link is a child of a parent submenu item, the parent submenu item event will also open, closing this popover event.stopPropagation(); setIsLinkOpen(true); setOpenedBy(ref.current); } } const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, listItemRef]), className: dist_clsx('wp-block-navigation-item', { 'is-editing': isSelected || isParentOfSelectedBlock, 'is-dragging-within': isDraggingWithin, 'has-link': !!url, 'has-child': hasChildren, 'has-text-color': !!textColor || !!customTextColor, [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor, 'has-background': !!backgroundColor || customBackgroundColor, [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor }), style: { color: !textColor && customTextColor, backgroundColor: !backgroundColor && customBackgroundColor }, onKeyDown }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ ...blockProps, className: 'remove-outline' // Remove the outline from the inner blocks container. }, { defaultBlock: navigation_link_edit_DEFAULT_BLOCK, directInsert: true, renderAppender: false }); if (!url || isInvalid || isDraft) { blockProps.onClick = () => { setIsLinkOpen(true); setOpenedBy(ref.current); }; } const classes = dist_clsx('wp-block-navigation-item__content', { 'wp-block-navigation-link__placeholder': !url || isInvalid || isDraft }); const missingText = getMissingText(type); /* translators: Whether the navigation link is Invalid or a Draft. */ const placeholderText = `(${isInvalid ? (0,external_wp_i18n_namespaceObject.__)('Invalid') : (0,external_wp_i18n_namespaceObject.__)('Draft')})`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { name: "link", icon: library_link, title: (0,external_wp_i18n_namespaceObject.__)('Link'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), onClick: event => { setIsLinkOpen(true); setOpenedBy(event.currentTarget); } }), !isAtMaxNesting && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { name: "submenu", icon: add_submenu, title: (0,external_wp_i18n_namespaceObject.__)('Add submenu'), onClick: transformToSubmenu })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Controls, { attributes: attributes, setAttributes: setAttributes, setIsLabelFieldFocused: setIsLabelFieldFocused }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { className: classes, children: [!url ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-navigation-link__placeholder-text", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: missingText }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [!isInvalid && !isDraft && !isLabelFieldFocused && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { ref: ref, identifier: "label", className: "wp-block-navigation-item__label", value: label, onChange: labelValue => setAttributes({ label: labelValue }), onMerge: mergeBlocks, onReplace: onReplace, __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link')), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'), placeholder: itemLabelPlaceholder, withoutInteractiveFormatting: true }), description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "wp-block-navigation-item__description", children: description })] }), (isInvalid || isDraft || isLabelFieldFocused) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: dist_clsx('wp-block-navigation-link__placeholder-text', 'wp-block-navigation-link__label', { 'is-invalid': isInvalid, 'is-draft': isDraft }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: // Some attributes are stored in an escaped form. It's a legacy issue. // Ideally they would be stored in a raw, unescaped form. // Unescape is used here to "recover" the escaped characters // so they display without encoding. // See `updateAttributes` for more details. `${(0,external_wp_htmlEntities_namespaceObject.decodeEntities)(label)} ${isInvalid || isDraft ? placeholderText : ''}`.trim() }) })] }), isLinkOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkUI, { ref: linkUIref, clientId: clientId, link: attributes, onClose: () => { // If there is no link then remove the auto-inserted block. // This avoids empty blocks which can provided a poor UX. if (!url) { // Fixes https://github.com/WordPress/gutenberg/issues/61361 // There's a chance we're closing due to the user selecting the browse all button. // Only move focus if the focus is still within the popover ui. If it's not within // the popover, it's because something has taken the focus from the popover, and // we don't want to steal it back. if (linkUIref.current.contains(window.document.activeElement)) { // Select the previous block to keep focus nearby selectPreviousBlock(clientId, true); } // Remove the link. onReplace([]); return; } setIsLinkOpen(false); if (openedBy) { openedBy.focus(); setOpenedBy(null); } else if (ref.current) { // select the ref when adding a new link ref.current.focus(); } else { // Fallback selectPreviousBlock(clientId, true); } }, anchor: popoverAnchor, onRemove: removeLink, onChange: updatedValue => { updateAttributes(updatedValue, setAttributes, attributes); } })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/save.js /** * WordPress dependencies */ function navigation_link_save_save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } ;// ./node_modules/@wordpress/icons/build-module/library/page.js /** * WordPress dependencies */ const page = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" })] }); /* harmony default export */ const library_page = (page); ;// ./node_modules/@wordpress/icons/build-module/library/tag.js /** * WordPress dependencies */ const tag = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" }) }); /* harmony default export */ const library_tag = (tag); ;// ./node_modules/@wordpress/icons/build-module/library/custom-post-type.js /** * WordPress dependencies */ const customPostType = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z" }) }); /* harmony default export */ const custom_post_type = (customPostType); ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/hooks.js /** * WordPress dependencies */ function getIcon(variationName) { switch (variationName) { case 'post': return post_list; case 'page': return library_page; case 'tag': return library_tag; case 'category': return library_category; default: return custom_post_type; } } function enhanceNavigationLinkVariations(settings, name) { if (name !== 'core/navigation-link') { return settings; } // Otherwise decorate server passed variations with an icon and isActive function. if (settings.variations) { const isActive = (blockAttributes, variationAttributes) => { return blockAttributes.type === variationAttributes.type; }; const variations = settings.variations.map(variation => { return { ...variation, ...(!variation.icon && { icon: getIcon(variation.name) }), ...(!variation.isActive && { isActive }) }; }); return { ...settings, variations }; } return settings; } ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/transforms.js /** * WordPress dependencies */ const navigation_link_transforms_transforms = { from: [{ type: 'block', blocks: ['core/site-logo'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); } }, { type: 'block', blocks: ['core/spacer'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); } }, { type: 'block', blocks: ['core/home-link'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); } }, { type: 'block', blocks: ['core/social-links'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); } }, { type: 'block', blocks: ['core/search'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); } }, { type: 'block', blocks: ['core/page-list'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); } }, { type: 'block', blocks: ['core/buttons'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link'); } }], to: [{ type: 'block', blocks: ['core/navigation-submenu'], transform: (attributes, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks) }, { type: 'block', blocks: ['core/spacer'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer'); } }, { type: 'block', blocks: ['core/site-logo'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo'); } }, { type: 'block', blocks: ['core/home-link'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link'); } }, { type: 'block', blocks: ['core/social-links'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links'); } }, { type: 'block', blocks: ['core/search'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/search', { showLabel: false, buttonUseIcon: true, buttonPosition: 'button-inside' }); } }, { type: 'block', blocks: ['core/page-list'], transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/page-list'); } }, { type: 'block', blocks: ['core/buttons'], transform: ({ label, url, rel, title, opensInNewTab }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/buttons', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/button', { text: label, url, rel, title, linkTarget: opensInNewTab ? '_blank' : undefined })]); } }] }; /* harmony default export */ const navigation_link_transforms = (navigation_link_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const navigation_link_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/navigation-link", title: "Custom Link", category: "design", parent: ["core/navigation"], allowedBlocks: ["core/navigation-link", "core/navigation-submenu", "core/page-list"], description: "Add a page, link, or another item to your navigation.", textdomain: "default", attributes: { label: { type: "string" }, type: { type: "string" }, description: { type: "string" }, rel: { type: "string" }, id: { type: "number" }, opensInNewTab: { type: "boolean", "default": false }, url: { type: "string" }, title: { type: "string" }, kind: { type: "string" }, isTopLevelLink: { type: "boolean" } }, usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style"], supports: { reusable: false, html: false, __experimentalSlashInserter: true, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, renaming: false, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-navigation-link-editor", style: "wp-block-navigation-link" }; const { name: navigation_link_name } = navigation_link_metadata; const navigation_link_settings = { icon: custom_link, __experimentalLabel: ({ label }) => label, merge(leftAttributes, { label: rightLabel = '' }) { return { ...leftAttributes, label: leftAttributes.label + rightLabel }; }, edit: NavigationLinkEdit, save: navigation_link_save_save, example: { attributes: { label: (0,external_wp_i18n_namespaceObject._x)('Example Link', 'navigation link preview example'), url: 'https://example.com' } }, deprecated: [{ isEligible(attributes) { return attributes.nofollow; }, attributes: { label: { type: 'string' }, type: { type: 'string' }, nofollow: { type: 'boolean' }, description: { type: 'string' }, id: { type: 'number' }, opensInNewTab: { type: 'boolean', default: false }, url: { type: 'string' } }, migrate({ nofollow, ...rest }) { return { rel: nofollow ? 'nofollow' : '', ...rest }; }, save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } }], transforms: navigation_link_transforms }; const navigation_link_init = () => { (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/navigation-link', enhanceNavigationLinkVariations); return initBlock({ name: navigation_link_name, metadata: navigation_link_metadata, settings: navigation_link_settings }); }; ;// ./node_modules/@wordpress/icons/build-module/library/remove-submenu.js /** * WordPress dependencies */ const removeSubmenu = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m13.955 20.748 8-17.5-.91-.416L19.597 6H13.5v1.5h5.411l-1.6 3.5H13.5v1.5h3.126l-1.6 3.5H13.5l.028 1.5h.812l-1.295 2.832.91.416ZM17.675 16l-.686 1.5h4.539L21.5 16h-3.825Zm2.286-5-.686 1.5H21.5V11h-1.54ZM2 12c0 3.58 2.42 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.48 0-4.5-1.52-4.5-4S5.52 7.5 8 7.5h3.5V6H8c-3.58 0-6 2.42-6 6Z" }) }); /* harmony default export */ const remove_submenu = (removeSubmenu); ;// ./node_modules/@wordpress/block-library/build-module/navigation-submenu/icons.js /** * WordPress dependencies */ const ItemSubmenuIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M1.50002 4L6.00002 8L10.5 4", strokeWidth: "1.5" }) }); ;// ./node_modules/@wordpress/block-library/build-module/navigation-submenu/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const ALLOWED_BLOCKS = ['core/navigation-link', 'core/navigation-submenu', 'core/page-list']; const navigation_submenu_edit_DEFAULT_BLOCK = { name: 'core/navigation-link' }; /** * A React hook to determine if it's dragging within the target element. * * @typedef {import('@wordpress/element').RefObject} RefObject * * @param {RefObject<HTMLElement>} elementRef The target elementRef object. * * @return {boolean} Is dragging within the target element. */ const edit_useIsDraggingWithin = elementRef => { const [isDraggingWithin, setIsDraggingWithin] = (0,external_wp_element_namespaceObject.useState)(false); (0,external_wp_element_namespaceObject.useEffect)(() => { const { ownerDocument } = elementRef.current; function handleDragStart(event) { // Check the first time when the dragging starts. handleDragEnter(event); } // Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape. function handleDragEnd() { setIsDraggingWithin(false); } function handleDragEnter(event) { // Check if the current target is inside the item element. if (elementRef.current.contains(event.target)) { setIsDraggingWithin(true); } else { setIsDraggingWithin(false); } } // Bind these events to the document to catch all drag events. // Ideally, we can also use `event.relatedTarget`, but sadly that // doesn't work in Safari. ownerDocument.addEventListener('dragstart', handleDragStart); ownerDocument.addEventListener('dragend', handleDragEnd); ownerDocument.addEventListener('dragenter', handleDragEnter); return () => { ownerDocument.removeEventListener('dragstart', handleDragStart); ownerDocument.removeEventListener('dragend', handleDragEnd); ownerDocument.removeEventListener('dragenter', handleDragEnter); }; }, []); return isDraggingWithin; }; /** * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind */ /** * Navigation Link Block Attributes * * @typedef {Object} WPNavigationLinkBlockAttributes * * @property {string} [label] Link text. * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status. * @property {string} [type] The type such as post, page, tag, category and other custom types. * @property {string} [rel] The relationship of the linked URL. * @property {number} [id] A post or term id. * @property {boolean} [opensInNewTab] Sets link target to _blank when true. * @property {string} [url] Link href. * @property {string} [title] Link title attribute. */ function NavigationSubmenuEdit({ attributes, isSelected, setAttributes, mergeBlocks, onReplace, context, clientId }) { const { label, url, description, rel, title } = attributes; const { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context; const { __unstableMarkNextChangeAsNotPersistent, replaceBlock, selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const [isLinkOpen, setIsLinkOpen] = (0,external_wp_element_namespaceObject.useState)(false); // Store what element opened the popover, so we know where to return focus to (toolbar button vs navigation link text) const [openedBy, setOpenedBy] = (0,external_wp_element_namespaceObject.useState)(null); // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); const listItemRef = (0,external_wp_element_namespaceObject.useRef)(null); const isDraggingWithin = edit_useIsDraggingWithin(listItemRef); const itemLabelPlaceholder = (0,external_wp_i18n_namespaceObject.__)('Add text…'); const ref = (0,external_wp_element_namespaceObject.useRef)(); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const { parentCount, isParentOfSelectedBlock, isImmediateParentOfSelectedBlock, hasChildren, selectedBlockHasChildren, onlyDescendantIsEmptyLink } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { hasSelectedInnerBlock, getSelectedBlockClientId, getBlockParentsByBlockName, getBlock, getBlockCount, getBlockOrder } = select(external_wp_blockEditor_namespaceObject.store); let _onlyDescendantIsEmptyLink; const selectedBlockId = getSelectedBlockClientId(); const selectedBlockChildren = getBlockOrder(selectedBlockId); // Check for a single descendant in the submenu. If that block // is a link block in a "placeholder" state with no label then // we can consider as an "empty" link. if (selectedBlockChildren?.length === 1) { const singleBlock = getBlock(selectedBlockChildren[0]); _onlyDescendantIsEmptyLink = singleBlock?.name === 'core/navigation-link' && !singleBlock?.attributes?.label; } return { parentCount: getBlockParentsByBlockName(clientId, 'core/navigation-submenu').length, isParentOfSelectedBlock: hasSelectedInnerBlock(clientId, true), isImmediateParentOfSelectedBlock: hasSelectedInnerBlock(clientId, false), hasChildren: !!getBlockCount(clientId), selectedBlockHasChildren: !!selectedBlockChildren?.length, onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink }; }, [clientId]); const prevHasChildren = (0,external_wp_compose_namespaceObject.usePrevious)(hasChildren); // Show the LinkControl on mount if the URL is empty // ( When adding a new menu item) // This can't be done in the useState call because it conflicts // with the autofocus behavior of the BlockListBlock component. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!openSubmenusOnClick && !url) { setIsLinkOpen(true); } }, []); /** * The hook shouldn't be necessary but due to a focus loss happening * when selecting a suggestion in the link popover, we force close on block unselection. */ (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isSelected) { setIsLinkOpen(false); } }, [isSelected]); // If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text. (0,external_wp_element_namespaceObject.useEffect)(() => { if (isLinkOpen && url) { // Does this look like a URL and have something TLD-ish? if ((0,external_wp_url_namespaceObject.isURL)((0,external_wp_url_namespaceObject.prependHTTP)(label)) && /^.+\.[a-z]+/.test(label)) { // Focus and select the label text. selectLabelText(); } } }, [url]); /** * Focus the Link label text and select it. */ function selectLabelText() { ref.current.focus(); const { ownerDocument } = ref.current; const { defaultView } = ownerDocument; const selection = defaultView.getSelection(); const range = ownerDocument.createRange(); // Get the range of the current ref contents so we can add this range to the selection. range.selectNodeContents(ref.current); selection.removeAllRanges(); selection.addRange(range); } const { textColor, customTextColor, backgroundColor, customBackgroundColor } = getColors(context, parentCount > 0); function onKeyDown(event) { if (external_wp_keycodes_namespaceObject.isKeyboardEvent.primary(event, 'k')) { // Required to prevent the command center from opening, // as it shares the CMD+K shortcut. // See https://github.com/WordPress/gutenberg/pull/59845. event.preventDefault(); // If we don't stop propagation, this event bubbles up to the parent submenu item event.stopPropagation(); setIsLinkOpen(true); setOpenedBy(ref.current); } } const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, listItemRef]), className: dist_clsx('wp-block-navigation-item', { 'is-editing': isSelected || isParentOfSelectedBlock, 'is-dragging-within': isDraggingWithin, 'has-link': !!url, 'has-child': hasChildren, 'has-text-color': !!textColor || !!customTextColor, [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor)]: !!textColor, 'has-background': !!backgroundColor || customBackgroundColor, [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor)]: !!backgroundColor, 'open-on-click': openSubmenusOnClick }), style: { color: !textColor && customTextColor, backgroundColor: !backgroundColor && customBackgroundColor }, onKeyDown }); // Always use overlay colors for submenus. const innerBlocksColors = getColors(context, true); const allowedBlocks = parentCount >= maxNestingLevel ? ALLOWED_BLOCKS.filter(blockName => blockName !== 'core/navigation-submenu') : ALLOWED_BLOCKS; const navigationChildBlockProps = getNavigationChildBlockProps(innerBlocksColors); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(navigationChildBlockProps, { allowedBlocks, defaultBlock: navigation_submenu_edit_DEFAULT_BLOCK, directInsert: true, // Ensure block toolbar is not too far removed from item // being edited. // see: https://github.com/WordPress/gutenberg/pull/34615. __experimentalCaptureToolbars: true, renderAppender: isSelected || isImmediateParentOfSelectedBlock && !selectedBlockHasChildren || // Show the appender while dragging to allow inserting element between item and the appender. hasChildren ? external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender : false }); const ParentElement = openSubmenusOnClick ? 'button' : 'a'; function transformToLink() { const newLinkBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes); replaceBlock(clientId, newLinkBlock); } (0,external_wp_element_namespaceObject.useEffect)(() => { // If block becomes empty, transform to Navigation Link. if (!hasChildren && prevHasChildren) { // This side-effect should not create an undo level as those should // only be created via user interactions. __unstableMarkNextChangeAsNotPersistent(); transformToLink(); } }, [hasChildren, prevHasChildren]); const canConvertToLink = !selectedBlockHasChildren || onlyDescendantIsEmptyLink; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { children: [!openSubmenusOnClick && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { name: "link", icon: library_link, title: (0,external_wp_i18n_namespaceObject.__)('Link'), shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k'), onClick: event => { setIsLinkOpen(true); setOpenedBy(event.currentTarget); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { name: "revert", icon: remove_submenu, title: (0,external_wp_i18n_namespaceObject.__)('Convert to Link'), onClick: transformToLink, className: "wp-block-navigation__submenu__revert", disabled: !canConvertToLink })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ label: '', url: '', description: '', title: '', rel: '' }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Text'), isShownByDefault: true, hasValue: () => !!label, onDeselect: () => setAttributes({ label: '' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, value: label || '', onChange: labelValue => { setAttributes({ label: labelValue }); }, label: (0,external_wp_i18n_namespaceObject.__)('Text'), autoComplete: "off" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Link'), isShownByDefault: true, hasValue: () => !!url, onDeselect: () => setAttributes({ url: '' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, value: url || '', onChange: urlValue => { setAttributes({ url: urlValue }); }, label: (0,external_wp_i18n_namespaceObject.__)('Link'), autoComplete: "off", type: "url" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Description'), isShownByDefault: true, hasValue: () => !!description, onDeselect: () => setAttributes({ description: '' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextareaControl, { __nextHasNoMarginBottom: true, value: description || '', onChange: descriptionValue => { setAttributes({ description: descriptionValue }); }, label: (0,external_wp_i18n_namespaceObject.__)('Description'), help: (0,external_wp_i18n_namespaceObject.__)('The description will be displayed in the menu if the current theme supports it.') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), isShownByDefault: true, hasValue: () => !!title, onDeselect: () => setAttributes({ title: '' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, value: title || '', onChange: titleValue => { setAttributes({ title: titleValue }); }, label: (0,external_wp_i18n_namespaceObject.__)('Title attribute'), autoComplete: "off", help: (0,external_wp_i18n_namespaceObject.__)('Additional information to help clarify the purpose of the link.') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Rel attribute'), isShownByDefault: true, hasValue: () => !!rel, onDeselect: () => setAttributes({ rel: '' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, value: rel || '', onChange: relValue => { setAttributes({ rel: relValue }); }, label: (0,external_wp_i18n_namespaceObject.__)('Rel attribute'), autoComplete: "off", help: (0,external_wp_i18n_namespaceObject.__)('The relationship of the linked URL as space-separated link types.') }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(ParentElement, { className: "wp-block-navigation-item__content", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { ref: ref, identifier: "label", className: "wp-block-navigation-item__label", value: label, onChange: labelValue => setAttributes({ label: labelValue }), onMerge: mergeBlocks, onReplace: onReplace, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Navigation link text'), placeholder: itemLabelPlaceholder, withoutInteractiveFormatting: true, onClick: () => { if (!openSubmenusOnClick && !url) { setIsLinkOpen(true); setOpenedBy(ref.current); } } }), description && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "wp-block-navigation-item__description", children: description }), !openSubmenusOnClick && isLinkOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(LinkUI, { clientId: clientId, link: attributes, onClose: () => { setIsLinkOpen(false); if (openedBy) { openedBy.focus(); setOpenedBy(null); } else { selectBlock(clientId); } }, anchor: popoverAnchor, onRemove: () => { setAttributes({ url: '' }); (0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.__)('Link removed.'), 'assertive'); }, onChange: updatedValue => { updateAttributes(updatedValue, setAttributes, attributes); } })] }), (showSubmenuIcon || openSubmenusOnClick) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "wp-block-navigation__submenu-icon", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ItemSubmenuIcon, {}) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps })] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/navigation-submenu/save.js /** * WordPress dependencies */ function navigation_submenu_save_save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } ;// ./node_modules/@wordpress/block-library/build-module/navigation-submenu/transforms.js /** * WordPress dependencies */ const navigation_submenu_transforms_transforms = { to: [{ type: 'block', blocks: ['core/navigation-link'], isMatch: (attributes, block) => block?.innerBlocks?.length === 0, transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', attributes) }, { type: 'block', blocks: ['core/spacer'], isMatch: (attributes, block) => block?.innerBlocks?.length === 0, transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer'); } }, { type: 'block', blocks: ['core/site-logo'], isMatch: (attributes, block) => block?.innerBlocks?.length === 0, transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo'); } }, { type: 'block', blocks: ['core/home-link'], isMatch: (attributes, block) => block?.innerBlocks?.length === 0, transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/home-link'); } }, { type: 'block', blocks: ['core/social-links'], isMatch: (attributes, block) => block?.innerBlocks?.length === 0, transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/social-links'); } }, { type: 'block', blocks: ['core/search'], isMatch: (attributes, block) => block?.innerBlocks?.length === 0, transform: () => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/search'); } }] }; /* harmony default export */ const navigation_submenu_transforms = (navigation_submenu_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/navigation-submenu/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const navigation_submenu_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/navigation-submenu", title: "Submenu", category: "design", parent: ["core/navigation"], description: "Add a submenu to your navigation.", textdomain: "default", attributes: { label: { type: "string" }, type: { type: "string" }, description: { type: "string" }, rel: { type: "string" }, id: { type: "number" }, opensInNewTab: { type: "boolean", "default": false }, url: { type: "string" }, title: { type: "string" }, kind: { type: "string" }, isTopLevelItem: { type: "boolean" } }, usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "openSubmenusOnClick", "style"], supports: { reusable: false, html: false, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-navigation-submenu-editor", style: "wp-block-navigation-submenu" }; const { name: navigation_submenu_name } = navigation_submenu_metadata; const navigation_submenu_settings = { icon: ({ context }) => { if (context === 'list-view') { return library_page; } return add_submenu; }, __experimentalLabel(attributes, { context }) { const { label } = attributes; const customName = attributes?.metadata?.name; // In the list view, use the block's menu label as the label. // If the menu label is empty, fall back to the default label. if (context === 'list-view' && (customName || label)) { return attributes?.metadata?.name || label; } return label; }, edit: NavigationSubmenuEdit, example: { attributes: { label: (0,external_wp_i18n_namespaceObject._x)('About', 'Example link text for Navigation Submenu'), type: 'page' } }, save: navigation_submenu_save_save, transforms: navigation_submenu_transforms }; const navigation_submenu_init = () => initBlock({ name: navigation_submenu_name, metadata: navigation_submenu_metadata, settings: navigation_submenu_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/page-break.js /** * WordPress dependencies */ const pageBreak = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.5 9V6a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v3H8V6a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v3h1.5Zm0 6.5V18a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2v-2.5H8V18a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-2.5h1.5ZM4 13h16v-1.5H4V13Z" }) }); /* harmony default export */ const page_break = (pageBreak); ;// ./node_modules/@wordpress/block-library/build-module/nextpage/edit.js /** * WordPress dependencies */ function NextPageEdit() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: (0,external_wp_i18n_namespaceObject.__)('Page break') }) }); } ;// ./node_modules/@wordpress/block-library/build-module/nextpage/save.js /** * WordPress dependencies */ function nextpage_save_save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: '<!--nextpage-->' }); } ;// ./node_modules/@wordpress/block-library/build-module/nextpage/transforms.js /** * WordPress dependencies */ const nextpage_transforms_transforms = { from: [{ type: 'raw', schema: { 'wp-block': { attributes: ['data-block'] } }, isMatch: node => node.dataset && node.dataset.block === 'core/nextpage', transform() { return (0,external_wp_blocks_namespaceObject.createBlock)('core/nextpage', {}); } }] }; /* harmony default export */ const nextpage_transforms = (nextpage_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/nextpage/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const nextpage_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/nextpage", title: "Page Break", category: "design", description: "Separate your content into a multi-page experience.", keywords: ["next page", "pagination"], parent: ["core/post-content"], textdomain: "default", supports: { customClassName: false, className: false, html: false, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-nextpage-editor" }; const { name: nextpage_name } = nextpage_metadata; const nextpage_settings = { icon: page_break, example: {}, transforms: nextpage_transforms, edit: NextPageEdit, save: nextpage_save_save }; const nextpage_init = () => initBlock({ name: nextpage_name, metadata: nextpage_metadata, settings: nextpage_settings }); ;// ./node_modules/@wordpress/block-library/build-module/pattern/recursion-detector.js /** * THIS MODULE IS INTENTIONALLY KEPT WITHIN THE PATTERN BLOCK'S SOURCE. * * This is because this approach for preventing infinite loops due to * recursively rendering blocks is specific to the way that the `core/pattern` * block behaves in the editor. Any other block types that deal with recursion * SHOULD USE THE STANDARD METHOD for avoiding loops: * * @see https://github.com/WordPress/gutenberg/pull/31455 * @see packages/block-editor/src/components/recursion-provider/README.md */ /** * WordPress dependencies */ /** * Naming is hard. * * @see useParsePatternDependencies * * @type {WeakMap<Object, Function>} */ const cachedParsers = new WeakMap(); /** * Hook used by PatternEdit to parse block patterns. It returns a function that * takes a pattern and returns nothing but throws an error if the pattern is * recursive. * * @example * ```js * const parsePatternDependencies = useParsePatternDependencies(); * parsePatternDependencies( selectedPattern ); * ``` * * @see parsePatternDependencies * * @return {Function} A function to parse block patterns. */ function useParsePatternDependencies() { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); // Instead of caching maps, go straight to the point and cache bound // functions. Each of those functions is bound to a different Map that will // keep track of patterns in the context of the given registry. if (!cachedParsers.has(registry)) { const deps = new Map(); cachedParsers.set(registry, parsePatternDependencies.bind(null, deps)); } return cachedParsers.get(registry); } /** * Parse a given pattern and traverse its contents to detect any subsequent * patterns on which it may depend. Such occurrences will be added to an * internal dependency graph. If a circular dependency is detected, an * error will be thrown. * * EXPORTED FOR TESTING PURPOSES ONLY. * * @param {Map<string, Set<string>>} deps Map of pattern dependencies. * @param {Object} pattern Pattern. * @param {string} pattern.name Pattern name. * @param {Array} pattern.blocks Pattern's block list. * * @throws {Error} If a circular dependency is detected. */ function parsePatternDependencies(deps, { name, blocks }) { const queue = [...blocks]; while (queue.length) { const block = queue.shift(); for (const innerBlock of (_block$innerBlocks = block.innerBlocks) !== null && _block$innerBlocks !== void 0 ? _block$innerBlocks : []) { var _block$innerBlocks; queue.unshift(innerBlock); } if (block.name === 'core/pattern') { registerDependency(deps, name, block.attributes.slug); } } } /** * Declare that pattern `a` depends on pattern `b`. If a circular * dependency is detected, an error will be thrown. * * EXPORTED FOR TESTING PURPOSES ONLY. * * @param {Map<string, Set<string>>} deps Map of pattern dependencies. * @param {string} a Slug for pattern A. * @param {string} b Slug for pattern B. * * @throws {Error} If a circular dependency is detected. */ function registerDependency(deps, a, b) { if (!deps.has(a)) { deps.set(a, new Set()); } deps.get(a).add(b); if (hasCycle(deps, a)) { throw new TypeError(`Pattern ${a} has a circular dependency and cannot be rendered.`); } } /** * Determine if a given pattern has circular dependencies on other patterns. * This will be determined by running a depth-first search on the current state * of the graph represented by `patternDependencies`. * * @param {Map<string, Set<string>>} deps Map of pattern dependencies. * @param {string} slug Pattern slug. * @param {Set<string>} [visitedNodes] Set to track visited nodes in the graph. * @param {Set<string>} [currentPath] Set to track and backtrack graph paths. * @return {boolean} Whether any cycle was found. */ function hasCycle(deps, slug, visitedNodes = new Set(), currentPath = new Set()) { var _deps$get; visitedNodes.add(slug); currentPath.add(slug); const dependencies = (_deps$get = deps.get(slug)) !== null && _deps$get !== void 0 ? _deps$get : new Set(); for (const dependency of dependencies) { if (!visitedNodes.has(dependency)) { if (hasCycle(deps, dependency, visitedNodes, currentPath)) { return true; } } else if (currentPath.has(dependency)) { return true; } } // Remove the current node from the current path when backtracking currentPath.delete(slug); return false; } ;// ./node_modules/@wordpress/block-library/build-module/pattern/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const PatternEdit = ({ attributes, clientId }) => { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const selectedPattern = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).__experimentalGetParsedPattern(attributes.slug), [attributes.slug]); const currentThemeStylesheet = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.stylesheet, []); const { replaceBlocks, setBlockEditingMode, __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { getBlockRootClientId, getBlockEditingMode } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const [hasRecursionError, setHasRecursionError] = (0,external_wp_element_namespaceObject.useState)(false); const parsePatternDependencies = useParsePatternDependencies(); // Duplicated in packages/editor/src/components/start-template-options/index.js. function injectThemeAttributeInBlockTemplateContent(block) { if (block.innerBlocks.find(innerBlock => innerBlock.name === 'core/template-part')) { block.innerBlocks = block.innerBlocks.map(innerBlock => { if (innerBlock.name === 'core/template-part' && innerBlock.attributes.theme === undefined) { innerBlock.attributes.theme = currentThemeStylesheet; } return innerBlock; }); } if (block.name === 'core/template-part' && block.attributes.theme === undefined) { block.attributes.theme = currentThemeStylesheet; } return block; } // Run this effect when the component loads. // This adds the Pattern's contents to the post. // This change won't be saved. // It will continue to pull from the pattern file unless changes are made to its respective template part. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!hasRecursionError && selectedPattern?.blocks) { try { parsePatternDependencies(selectedPattern); } catch (error) { setHasRecursionError(true); return; } // We batch updates to block list settings to avoid triggering cascading renders // for each container block included in a tree and optimize initial render. // Since the above uses microtasks, we need to use a microtask here as well, // because nested pattern blocks cannot be inserted if the parent block supports // inner blocks but doesn't have blockSettings in the state. window.queueMicrotask(() => { const rootClientId = getBlockRootClientId(clientId); // Clone blocks from the pattern before insertion to ensure they receive // distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628. const clonedBlocks = selectedPattern.blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(injectThemeAttributeInBlockTemplateContent(block))); // If the pattern has a single block and categories, we should add the // categories of the pattern to the block's metadata. if (clonedBlocks.length === 1 && selectedPattern.categories?.length > 0) { clonedBlocks[0].attributes = { ...clonedBlocks[0].attributes, metadata: { ...clonedBlocks[0].attributes.metadata, categories: selectedPattern.categories, patternName: selectedPattern.name, name: clonedBlocks[0].attributes.metadata.name || selectedPattern.title } }; } const rootEditingMode = getBlockEditingMode(rootClientId); registry.batch(() => { // Temporarily set the root block to default mode to allow replacing the pattern. // This could happen when the page is disabling edits of non-content blocks. __unstableMarkNextChangeAsNotPersistent(); setBlockEditingMode(rootClientId, 'default'); __unstableMarkNextChangeAsNotPersistent(); replaceBlocks(clientId, clonedBlocks); // Restore the root block's original mode. __unstableMarkNextChangeAsNotPersistent(); setBlockEditingMode(rootClientId, rootEditingMode); }); }); } }, [clientId, hasRecursionError, selectedPattern, __unstableMarkNextChangeAsNotPersistent, replaceBlocks, getBlockEditingMode, setBlockEditingMode, getBlockRootClientId]); const props = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); if (hasRecursionError) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...props, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: A warning in which %s is the name of a pattern. (0,external_wp_i18n_namespaceObject.__)('Pattern "%s" cannot be rendered inside itself.'), selectedPattern?.name) }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...props }); }; /* harmony default export */ const pattern_edit = (PatternEdit); ;// ./node_modules/@wordpress/block-library/build-module/pattern/index.js /** * Internal dependencies */ const pattern_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/pattern", title: "Pattern Placeholder", category: "theme", description: "Show a block pattern.", supports: { html: false, inserter: false, renaming: false, interactivity: { clientNavigation: true } }, textdomain: "default", attributes: { slug: { type: "string" } } }; const { name: pattern_name } = pattern_metadata; const pattern_settings = { edit: pattern_edit }; const pattern_init = () => initBlock({ name: pattern_name, metadata: pattern_metadata, settings: pattern_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/pages.js /** * WordPress dependencies */ const pages = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" })] }); /* harmony default export */ const library_pages = (pages); ;// ./node_modules/@wordpress/block-library/build-module/page-list/use-convert-to-navigation-links.js /** * WordPress dependencies */ /** * Converts an array of pages into a nested array of navigation link blocks. * * @param {Array} pages An array of pages. * * @return {Array} A nested array of navigation link blocks. */ function createNavigationLinks(pages = []) { const linkMap = {}; const navigationLinks = []; pages.forEach(({ id, title, link: url, type, parent }) => { var _linkMap$id$innerBloc; // See if a placeholder exists. This is created if children appear before parents in list. const innerBlocks = (_linkMap$id$innerBloc = linkMap[id]?.innerBlocks) !== null && _linkMap$id$innerBloc !== void 0 ? _linkMap$id$innerBloc : []; linkMap[id] = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', { id, label: title.rendered, url, type, kind: 'post-type' }, innerBlocks); if (!parent) { navigationLinks.push(linkMap[id]); } else { if (!linkMap[parent]) { // Use a placeholder if the child appears before parent in list. linkMap[parent] = { innerBlocks: [] }; } // Although these variables are not referenced, they are needed to store the innerBlocks in memory. const parentLinkInnerBlocks = linkMap[parent].innerBlocks; parentLinkInnerBlocks.push(linkMap[id]); } }); return navigationLinks; } /** * Finds a navigation link block by id, recursively. * It might be possible to make this a more generic helper function. * * @param {Array} navigationLinks An array of navigation link blocks. * @param {number} id The id of the navigation link to find. * * @return {Object|null} The navigation link block with the given id. */ function findNavigationLinkById(navigationLinks, id) { for (const navigationLink of navigationLinks) { // Is this the link we're looking for? if (navigationLink.attributes.id === id) { return navigationLink; } // If not does it have innerBlocks? if (navigationLink.innerBlocks && navigationLink.innerBlocks.length) { const foundNavigationLink = findNavigationLinkById(navigationLink.innerBlocks, id); if (foundNavigationLink) { return foundNavigationLink; } } } return null; } function convertToNavigationLinks(pages = [], parentPageID = null) { let navigationLinks = createNavigationLinks(pages); // If a parent page ID is provided, only return the children of that page. if (parentPageID) { const parentPage = findNavigationLinkById(navigationLinks, parentPageID); if (parentPage && parentPage.innerBlocks) { navigationLinks = parentPage.innerBlocks; } } // Transform all links with innerBlocks into Submenus. This can't be done // sooner because page objects have no information on their children. const transformSubmenus = listOfLinks => { listOfLinks.forEach((block, index, listOfLinksArray) => { const { attributes, innerBlocks } = block; if (innerBlocks.length !== 0) { transformSubmenus(innerBlocks); const transformedBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-submenu', attributes, innerBlocks); listOfLinksArray[index] = transformedBlock; } }); }; transformSubmenus(navigationLinks); return navigationLinks; } function useConvertToNavigationLinks({ clientId, pages, parentClientId, parentPageID }) { const { replaceBlock, selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); return () => { const navigationLinks = convertToNavigationLinks(pages, parentPageID); // Replace the Page List block with the Navigation Links. replaceBlock(clientId, navigationLinks); // Select the Navigation block to reveal the changes. selectBlock(parentClientId); }; } ;// ./node_modules/@wordpress/block-library/build-module/page-list/convert-to-links-modal.js /** * WordPress dependencies */ const convertDescription = (0,external_wp_i18n_namespaceObject.__)("This Navigation Menu displays your website's pages. Editing it will enable you to add, delete, or reorder pages. However, new pages will no longer be added automatically."); function ConvertToLinksModal({ onClick, onClose, disabled }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Modal, { onRequestClose: onClose, title: (0,external_wp_i18n_namespaceObject.__)('Edit Page List'), className: "wp-block-page-list-modal", aria: { describedby: (0,external_wp_compose_namespaceObject.useInstanceId)(ConvertToLinksModal, 'wp-block-page-list-modal__description') }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { id: (0,external_wp_compose_namespaceObject.useInstanceId)(ConvertToLinksModal, 'wp-block-page-list-modal__description'), children: convertDescription }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-page-list-modal-buttons", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: onClose, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", accessibleWhenDisabled: true, disabled: disabled, onClick: onClick, children: (0,external_wp_i18n_namespaceObject.__)('Edit') })] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/page-list/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ // We only show the edit option when page count is <= MAX_PAGE_COUNT // Performance of Navigation Links is not good past this value. const MAX_PAGE_COUNT = 100; const NOOP = () => {}; function BlockContent({ blockProps, innerBlocksProps, hasResolvedPages, blockList, pages, parentPageID }) { if (!hasResolvedPages) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-page-list__loading-indicator-container", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, { className: "wp-block-page-list__loading-indicator" }) }) }); } if (pages === null) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "warning", isDismissible: false, children: (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.') }) }); } if (pages.length === 0) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "info", isDismissible: false, children: (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.') }) }); } if (blockList.length === 0) { const parentPageDetails = pages.find(page => page.id === parentPageID); if (parentPageDetails?.title?.rendered) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Page title. (0,external_wp_i18n_namespaceObject.__)('Page List: "%s" page has no children.'), parentPageDetails.title.rendered) }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "warning", isDismissible: false, children: (0,external_wp_i18n_namespaceObject.__)('Page List: Cannot retrieve Pages.') }) }); } if (pages.length > 0) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { ...innerBlocksProps }); } } function PageListEdit({ context, clientId, attributes, setAttributes }) { const { parentPageID } = attributes; const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false); const openModal = (0,external_wp_element_namespaceObject.useCallback)(() => setOpen(true), []); const closeModal = () => setOpen(false); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const { records: pages, hasResolved: hasResolvedPages } = (0,external_wp_coreData_namespaceObject.useEntityRecords)('postType', 'page', { per_page: MAX_PAGE_COUNT, _fields: ['id', 'link', 'menu_order', 'parent', 'title', 'type'], // TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby // values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent // sort. orderby: 'menu_order', order: 'asc' }); const allowConvertToLinks = 'showSubmenuIcon' in context && pages?.length > 0 && pages?.length <= MAX_PAGE_COUNT; const pagesByParentId = (0,external_wp_element_namespaceObject.useMemo)(() => { if (pages === null) { return new Map(); } // TODO: Once the REST API supports passing multiple values to // 'orderby', this can be removed. // https://core.trac.wordpress.org/ticket/39037 const sortedPages = pages.sort((a, b) => { if (a.menu_order === b.menu_order) { return a.title.rendered.localeCompare(b.title.rendered); } return a.menu_order - b.menu_order; }); return sortedPages.reduce((accumulator, page) => { const { parent } = page; if (accumulator.has(parent)) { accumulator.get(parent).push(page); } else { accumulator.set(parent, [page]); } return accumulator; }, new Map()); }, [pages]); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx('wp-block-page-list', { 'has-text-color': !!context.textColor, [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', context.textColor)]: !!context.textColor, 'has-background': !!context.backgroundColor, [(0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', context.backgroundColor)]: !!context.backgroundColor }), style: { ...context.style?.color } }); const pagesTree = (0,external_wp_element_namespaceObject.useMemo)(function makePagesTree(parentId = 0, level = 0) { const childPages = pagesByParentId.get(parentId); if (!childPages?.length) { return []; } return childPages.reduce((tree, page) => { const hasChildren = pagesByParentId.has(page.id); const item = { value: page.id, label: '— '.repeat(level) + page.title.rendered, rawName: page.title.rendered }; tree.push(item); if (hasChildren) { tree.push(...makePagesTree(page.id, level + 1)); } return tree; }, []); }, [pagesByParentId]); const blockList = (0,external_wp_element_namespaceObject.useMemo)(function getBlockList(parentId = parentPageID) { const childPages = pagesByParentId.get(parentId); if (!childPages?.length) { return []; } return childPages.reduce((template, page) => { const hasChildren = pagesByParentId.has(page.id); const pageProps = { id: page.id, label: // translators: displayed when a page has an empty title. page.title?.rendered?.trim() !== '' ? page.title?.rendered : (0,external_wp_i18n_namespaceObject.__)('(no title)'), title: // translators: displayed when a page has an empty title. page.title?.rendered?.trim() !== '' ? page.title?.rendered : (0,external_wp_i18n_namespaceObject.__)('(no title)'), link: page.url, hasChildren }; let item = null; const children = getBlockList(page.id); item = (0,external_wp_blocks_namespaceObject.createBlock)('core/page-list-item', pageProps, children); template.push(item); return template; }, []); }, [pagesByParentId, parentPageID]); const { isNested, hasSelectedChild, parentClientId, hasDraggedChild, isChildOfNavigation } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockParentsByBlockName, hasSelectedInnerBlock, hasDraggedInnerBlock } = select(external_wp_blockEditor_namespaceObject.store); const blockParents = getBlockParentsByBlockName(clientId, 'core/navigation-submenu', true); const navigationBlockParents = getBlockParentsByBlockName(clientId, 'core/navigation', true); return { isNested: blockParents.length > 0, isChildOfNavigation: navigationBlockParents.length > 0, hasSelectedChild: hasSelectedInnerBlock(clientId, true), hasDraggedChild: hasDraggedInnerBlock(clientId, true), parentClientId: navigationBlockParents[0] }; }, [clientId]); const convertToNavigationLinks = useConvertToNavigationLinks({ clientId, pages, parentClientId, parentPageID }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { renderAppender: false, __unstableDisableDropZone: true, templateLock: isChildOfNavigation ? false : 'all', onInput: NOOP, onChange: NOOP, value: blockList }); const { selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { if (hasSelectedChild || hasDraggedChild) { openModal(); selectBlock(parentClientId); } }, [hasSelectedChild, hasDraggedChild, parentClientId, selectBlock, openModal]); (0,external_wp_element_namespaceObject.useEffect)(() => { setAttributes({ isNested }); }, [isNested, setAttributes]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [(pagesTree.length > 0 || allowConvertToLinks) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ parentPageID: 0 }); }, dropdownMenuProps: dropdownMenuProps, children: [pagesTree.length > 0 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Parent Page'), hasValue: () => parentPageID !== 0, onDeselect: () => setAttributes({ parentPageID: 0 }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, className: "editor-page-attributes__parent", label: (0,external_wp_i18n_namespaceObject.__)('Parent'), value: parentPageID, options: pagesTree, onChange: value => setAttributes({ parentPageID: value !== null && value !== void 0 ? value : 0 }), help: (0,external_wp_i18n_namespaceObject.__)('Choose a page to show only its subpages.') }) }), allowConvertToLinks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { style: { gridColumn: '1 / -1' }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: convertDescription }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", accessibleWhenDisabled: true, disabled: !hasResolvedPages, onClick: convertToNavigationLinks, children: (0,external_wp_i18n_namespaceObject.__)('Edit') })] })] }) }), allowConvertToLinks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { title: (0,external_wp_i18n_namespaceObject.__)('Edit'), onClick: openModal, children: (0,external_wp_i18n_namespaceObject.__)('Edit') }) }), isOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ConvertToLinksModal, { onClick: convertToNavigationLinks, onClose: closeModal, disabled: !hasResolvedPages })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(BlockContent, { blockProps: blockProps, innerBlocksProps: innerBlocksProps, hasResolvedPages: hasResolvedPages, blockList: blockList, pages: pages, parentPageID: parentPageID })] }); } ;// ./node_modules/@wordpress/block-library/build-module/page-list/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const page_list_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/page-list", title: "Page List", category: "widgets", allowedBlocks: ["core/page-list-item"], description: "Display a list of all pages.", keywords: ["menu", "navigation"], textdomain: "default", attributes: { parentPageID: { type: "integer", "default": 0 }, isNested: { type: "boolean", "default": false } }, usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"], supports: { reusable: false, html: false, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, color: { text: true, background: true, link: true, gradients: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true }, spacing: { padding: true, margin: true, __experimentalDefaultControls: { padding: false, margin: false } } }, editorStyle: "wp-block-page-list-editor", style: "wp-block-page-list" }; const { name: page_list_name } = page_list_metadata; const page_list_settings = { icon: library_pages, example: {}, edit: PageListEdit }; const page_list_init = () => initBlock({ name: page_list_name, metadata: page_list_metadata, settings: page_list_settings }); ;// ./node_modules/@wordpress/block-library/build-module/navigation-link/icons.js /** * WordPress dependencies */ const icons_ItemSubmenuIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M1.50002 4L6.00002 8L10.5 4", strokeWidth: "1.5" }) }); ;// ./node_modules/@wordpress/block-library/build-module/page-list-item/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function useFrontPageId() { return (0,external_wp_data_namespaceObject.useSelect)(select => { const canReadSettings = select(external_wp_coreData_namespaceObject.store).canUser('read', { kind: 'root', name: 'site' }); if (!canReadSettings) { return undefined; } const site = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', 'site'); return site?.show_on_front === 'page' && site?.page_on_front; }, []); } function PageListItemEdit({ context, attributes }) { const { id, label, link, hasChildren, title } = attributes; const isNavigationChild = 'showSubmenuIcon' in context; const frontPageId = useFrontPageId(); const innerBlocksColors = getColors(context, true); const navigationChildBlockProps = getNavigationChildBlockProps(innerBlocksColors); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(navigationChildBlockProps, { className: 'wp-block-pages-list__item' }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { className: dist_clsx('wp-block-pages-list__item', { 'has-child': hasChildren, 'wp-block-navigation-item': isNavigationChild, 'open-on-click': context.openSubmenusOnClick, 'open-on-hover-click': !context.openSubmenusOnClick && context.showSubmenuIcon, 'menu-item-home': id === frontPageId }), children: [hasChildren && context.openSubmenusOnClick ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { type: "button", className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle", "aria-expanded": "false", children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(label) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_ItemSubmenuIcon, {}) })] }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: dist_clsx('wp-block-pages-list__item__link', { 'wp-block-navigation-item__content': isNavigationChild }), href: link, children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) }), hasChildren && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [!context.openSubmenusOnClick && context.showSubmenuIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { className: "wp-block-navigation-item__content wp-block-navigation-submenu__toggle wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon", "aria-expanded": "false", type: "button", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(icons_ItemSubmenuIcon, {}) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { ...innerBlocksProps })] })] }, id); } ;// ./node_modules/@wordpress/block-library/build-module/page-list-item/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const page_list_item_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/page-list-item", title: "Page List Item", category: "widgets", parent: ["core/page-list"], description: "Displays a page inside a list of all pages.", keywords: ["page", "menu", "navigation"], textdomain: "default", attributes: { id: { type: "number" }, label: { type: "string" }, title: { type: "string" }, link: { type: "string" }, hasChildren: { type: "boolean" } }, usesContext: ["textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick"], supports: { reusable: false, html: false, lock: false, inserter: false, __experimentalToolbar: false, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-page-list-editor", style: "wp-block-page-list" }; const { name: page_list_item_name } = page_list_item_metadata; const page_list_item_settings = { __experimentalLabel: ({ label }) => label, icon: library_page, example: {}, edit: PageListItemEdit }; const page_list_item_init = () => initBlock({ name: page_list_item_name, metadata: page_list_item_metadata, settings: page_list_item_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/paragraph.js /** * WordPress dependencies */ const paragraph = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m9.99609 14v-.2251l.00391.0001v6.225h1.5v-14.5h2.5v14.5h1.5v-14.5h3v-1.5h-8.50391c-2.76142 0-5 2.23858-5 5 0 2.7614 2.23858 5 5 5z" }) }); /* harmony default export */ const library_paragraph = (paragraph); ;// ./node_modules/@wordpress/block-library/build-module/paragraph/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ const deprecated_supports = { className: false }; const paragraph_deprecated_blockAttributes = { align: { type: 'string' }, content: { type: 'string', source: 'html', selector: 'p', default: '' }, dropCap: { type: 'boolean', default: false }, placeholder: { type: 'string' }, textColor: { type: 'string' }, backgroundColor: { type: 'string' }, fontSize: { type: 'string' }, direction: { type: 'string', enum: ['ltr', 'rtl'] }, style: { type: 'object' } }; const migrateCustomColorsAndFontSizes = attributes => { if (!attributes.customTextColor && !attributes.customBackgroundColor && !attributes.customFontSize) { return attributes; } const style = {}; if (attributes.customTextColor || attributes.customBackgroundColor) { style.color = {}; } if (attributes.customTextColor) { style.color.text = attributes.customTextColor; } if (attributes.customBackgroundColor) { style.color.background = attributes.customBackgroundColor; } if (attributes.customFontSize) { style.typography = { fontSize: attributes.customFontSize }; } const { customTextColor, customBackgroundColor, customFontSize, ...restAttributes } = attributes; return { ...restAttributes, style }; }; const { style, ...restBlockAttributes } = paragraph_deprecated_blockAttributes; const paragraph_deprecated_deprecated = [ // Version without drop cap on aligned text. { supports: deprecated_supports, attributes: { ...restBlockAttributes, customTextColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, customFontSize: { type: 'number' } }, save({ attributes }) { const { align, content, dropCap, direction } = attributes; const className = dist_clsx({ 'has-drop-cap': align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center' ? false : dropCap, [`has-text-align-${align}`]: align }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, dir: direction }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: content }) }); } }, { supports: deprecated_supports, attributes: { ...restBlockAttributes, customTextColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, customFontSize: { type: 'number' } }, migrate: migrateCustomColorsAndFontSizes, save({ attributes }) { const { align, content, dropCap, backgroundColor, textColor, customBackgroundColor, customTextColor, fontSize, customFontSize, direction } = attributes; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize); const className = dist_clsx({ 'has-text-color': textColor || customTextColor, 'has-background': backgroundColor || customBackgroundColor, 'has-drop-cap': dropCap, [`has-text-align-${align}`]: align, [fontSizeClass]: fontSizeClass, [textClass]: textClass, [backgroundClass]: backgroundClass }); const styles = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor, fontSize: fontSizeClass ? undefined : customFontSize }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", style: styles, className: className ? className : undefined, value: content, dir: direction }); } }, { supports: deprecated_supports, attributes: { ...restBlockAttributes, customTextColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, customFontSize: { type: 'number' } }, migrate: migrateCustomColorsAndFontSizes, save({ attributes }) { const { align, content, dropCap, backgroundColor, textColor, customBackgroundColor, customTextColor, fontSize, customFontSize, direction } = attributes; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const fontSizeClass = (0,external_wp_blockEditor_namespaceObject.getFontSizeClass)(fontSize); const className = dist_clsx({ 'has-text-color': textColor || customTextColor, 'has-background': backgroundColor || customBackgroundColor, 'has-drop-cap': dropCap, [fontSizeClass]: fontSizeClass, [textClass]: textClass, [backgroundClass]: backgroundClass }); const styles = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor, fontSize: fontSizeClass ? undefined : customFontSize, textAlign: align }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", style: styles, className: className ? className : undefined, value: content, dir: direction }); } }, { supports: deprecated_supports, attributes: { ...restBlockAttributes, customTextColor: { type: 'string' }, customBackgroundColor: { type: 'string' }, customFontSize: { type: 'number' }, width: { type: 'string' } }, migrate: migrateCustomColorsAndFontSizes, save({ attributes }) { const { width, align, content, dropCap, backgroundColor, textColor, customBackgroundColor, customTextColor, fontSize, customFontSize } = attributes; const textClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const fontSizeClass = fontSize && `is-${fontSize}-text`; const className = dist_clsx({ [`align${width}`]: width, 'has-background': backgroundColor || customBackgroundColor, 'has-drop-cap': dropCap, [fontSizeClass]: fontSizeClass, [textClass]: textClass, [backgroundClass]: backgroundClass }); const styles = { backgroundColor: backgroundClass ? undefined : customBackgroundColor, color: textClass ? undefined : customTextColor, fontSize: fontSizeClass ? undefined : customFontSize, textAlign: align }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", style: styles, className: className ? className : undefined, value: content }); } }, { supports: deprecated_supports, attributes: { ...restBlockAttributes, fontSize: { type: 'number' } }, save({ attributes }) { const { width, align, content, dropCap, backgroundColor, textColor, fontSize } = attributes; const className = dist_clsx({ [`align${width}`]: width, 'has-background': backgroundColor, 'has-drop-cap': dropCap }); const styles = { backgroundColor, color: textColor, fontSize, textAlign: align }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { style: styles, className: className ? className : undefined, children: content }); }, migrate(attributes) { return migrateCustomColorsAndFontSizes({ ...attributes, customFontSize: Number.isFinite(attributes.fontSize) ? attributes.fontSize : undefined, customTextColor: attributes.textColor && '#' === attributes.textColor[0] ? attributes.textColor : undefined, customBackgroundColor: attributes.backgroundColor && '#' === attributes.backgroundColor[0] ? attributes.backgroundColor : undefined }); } }, { supports: deprecated_supports, attributes: { ...paragraph_deprecated_blockAttributes, content: { type: 'string', source: 'html', default: '' } }, save({ attributes }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: attributes.content }); }, migrate(attributes) { return attributes; } }]; /* harmony default export */ const paragraph_deprecated = (paragraph_deprecated_deprecated); ;// ./node_modules/@wordpress/icons/build-module/library/format-ltr.js /** * WordPress dependencies */ const formatLtr = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z" }) }); /* harmony default export */ const format_ltr = (formatLtr); ;// ./node_modules/@wordpress/block-library/build-module/paragraph/use-enter.js /** * WordPress dependencies */ function useOnEnter(props) { const { batch } = (0,external_wp_data_namespaceObject.useRegistry)(); const { moveBlocksToPosition, replaceInnerBlocks, duplicateBlocks, insertBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { getBlockRootClientId, getBlockIndex, getBlockOrder, getBlockName, getBlock, getNextBlockClientId, canInsertBlockType } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const propsRef = (0,external_wp_element_namespaceObject.useRef)(props); propsRef.current = props; return (0,external_wp_compose_namespaceObject.useRefEffect)(element => { function onKeyDown(event) { if (event.defaultPrevented) { return; } if (event.keyCode !== external_wp_keycodes_namespaceObject.ENTER) { return; } const { content, clientId } = propsRef.current; // The paragraph should be empty. if (content.length) { return; } const wrapperClientId = getBlockRootClientId(clientId); if (!(0,external_wp_blocks_namespaceObject.hasBlockSupport)(getBlockName(wrapperClientId), '__experimentalOnEnter', false)) { return; } const order = getBlockOrder(wrapperClientId); const position = order.indexOf(clientId); // If it is the last block, exit. if (position === order.length - 1) { let newWrapperClientId = wrapperClientId; while (!canInsertBlockType(getBlockName(clientId), getBlockRootClientId(newWrapperClientId))) { newWrapperClientId = getBlockRootClientId(newWrapperClientId); } if (typeof newWrapperClientId === 'string') { event.preventDefault(); moveBlocksToPosition([clientId], wrapperClientId, getBlockRootClientId(newWrapperClientId), getBlockIndex(newWrapperClientId) + 1); } return; } const defaultBlockName = (0,external_wp_blocks_namespaceObject.getDefaultBlockName)(); if (!canInsertBlockType(defaultBlockName, getBlockRootClientId(wrapperClientId))) { return; } event.preventDefault(); // If it is in the middle, split the block in two. const wrapperBlock = getBlock(wrapperClientId); batch(() => { duplicateBlocks([wrapperClientId]); const blockIndex = getBlockIndex(wrapperClientId); replaceInnerBlocks(wrapperClientId, wrapperBlock.innerBlocks.slice(0, position)); replaceInnerBlocks(getNextBlockClientId(wrapperClientId), wrapperBlock.innerBlocks.slice(position + 1)); insertBlock((0,external_wp_blocks_namespaceObject.createBlock)(defaultBlockName), blockIndex + 1, getBlockRootClientId(wrapperClientId), true); }); } element.addEventListener('keydown', onKeyDown); return () => { element.removeEventListener('keydown', onKeyDown); }; }, []); } ;// ./node_modules/@wordpress/block-library/build-module/paragraph/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ParagraphRTLControl({ direction, setDirection }) { return (0,external_wp_i18n_namespaceObject.isRTL)() && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { icon: format_ltr, title: (0,external_wp_i18n_namespaceObject._x)('Left to right', 'editor button'), isActive: direction === 'ltr', onClick: () => { setDirection(direction === 'ltr' ? undefined : 'ltr'); } }); } function hasDropCapDisabled(align) { return align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center'; } function DropCapControl({ clientId, attributes, setAttributes, name }) { // Please do not add a useSelect call to the paragraph block unconditionally. // Every useSelect added to a (frequently used) block will degrade load // and type performance. By moving it within InspectorControls, the subscription is // now only added for the selected block(s). const [isDropCapFeatureEnabled] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.dropCap'); if (!isDropCapFeatureEnabled) { return null; } const { align, dropCap } = attributes; let helpText; if (hasDropCapDisabled(align)) { helpText = (0,external_wp_i18n_namespaceObject.__)('Not available for aligned text.'); } else if (dropCap) { helpText = (0,external_wp_i18n_namespaceObject.__)('Showing large initial letter.'); } else { helpText = (0,external_wp_i18n_namespaceObject.__)('Show a large initial letter.'); } const isDropCapControlEnabledByDefault = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, 'typography.defaultControls.dropCap', false); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "typography", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!dropCap, label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'), isShownByDefault: isDropCapControlEnabledByDefault, onDeselect: () => setAttributes({ dropCap: undefined }), resetAllFilter: () => ({ dropCap: undefined }), panelId: clientId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Drop cap'), checked: !!dropCap, onChange: () => setAttributes({ dropCap: !dropCap }), help: helpText, disabled: hasDropCapDisabled(align) }) }) }); } function ParagraphBlock({ attributes, mergeBlocks, onReplace, onRemove, setAttributes, clientId, isSelected: isSingleSelected, name }) { const { align, content, direction, dropCap, placeholder } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref: useOnEnter({ clientId, content }), className: dist_clsx({ 'has-drop-cap': hasDropCapDisabled(align) ? false : dropCap, [`has-text-align-${align}`]: align }), style: { direction } }); const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: align, onChange: newAlign => setAttributes({ align: newAlign, dropCap: hasDropCapDisabled(newAlign) ? false : dropCap }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ParagraphRTLControl, { direction: direction, setDirection: newDirection => setAttributes({ direction: newDirection }) })] }), isSingleSelected && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DropCapControl, { name: name, clientId: clientId, attributes: attributes, setAttributes: setAttributes }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "content", tagName: "p", ...blockProps, value: content, onChange: newContent => setAttributes({ content: newContent }), onMerge: mergeBlocks, onReplace: onReplace, onRemove: onRemove, "aria-label": external_wp_blockEditor_namespaceObject.RichText.isEmpty(content) ? (0,external_wp_i18n_namespaceObject.__)('Empty block; start writing or type forward slash to choose a block') : (0,external_wp_i18n_namespaceObject.__)('Block: Paragraph'), "data-empty": external_wp_blockEditor_namespaceObject.RichText.isEmpty(content), placeholder: placeholder || (0,external_wp_i18n_namespaceObject.__)('Type / to choose a block'), "data-custom-placeholder": placeholder ? true : undefined, __unstableEmbedURLOnPaste: true, __unstableAllowPrefixTransformations: true })] }); } /* harmony default export */ const paragraph_edit = (ParagraphBlock); ;// ./node_modules/@wordpress/block-library/build-module/paragraph/save.js /** * External dependencies */ /** * WordPress dependencies */ function paragraph_save_save({ attributes }) { const { align, content, dropCap, direction } = attributes; const className = dist_clsx({ 'has-drop-cap': align === ((0,external_wp_i18n_namespaceObject.isRTL)() ? 'left' : 'right') || align === 'center' ? false : dropCap, [`has-text-align-${align}`]: align }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, dir: direction }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: content }) }); } ;// ./node_modules/@wordpress/block-library/build-module/paragraph/transforms.js /** * WordPress dependencies */ /** * Internal dependencies */ const { name: transforms_name } = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/paragraph", title: "Paragraph", category: "text", description: "Start with the basic building block of all narrative.", keywords: ["text"], textdomain: "default", attributes: { align: { type: "string" }, content: { type: "rich-text", source: "rich-text", selector: "p", role: "content" }, dropCap: { type: "boolean", "default": false }, placeholder: { type: "string" }, direction: { type: "string", "enum": ["ltr", "rtl"] } }, supports: { splitting: true, anchor: true, className: false, __experimentalBorder: { color: true, radius: true, style: true, width: true }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalTextDecoration: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalWritingMode: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalSelector: "p", __unstablePasteTextInline: true, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-paragraph-editor", style: "wp-block-paragraph" }; const paragraph_transforms_transforms = { from: [{ type: 'raw', // Paragraph is a fallback and should be matched last. priority: 20, selector: 'p', schema: ({ phrasingContentSchema, isPaste }) => ({ p: { children: phrasingContentSchema, attributes: isPaste ? [] : ['style', 'id'] } }), transform(node) { const attributes = (0,external_wp_blocks_namespaceObject.getBlockAttributes)(transforms_name, node.outerHTML); const { textAlign } = node.style || {}; if (textAlign === 'left' || textAlign === 'center' || textAlign === 'right') { attributes.align = textAlign; } return (0,external_wp_blocks_namespaceObject.createBlock)(transforms_name, attributes); } }] }; /* harmony default export */ const paragraph_transforms = (paragraph_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/paragraph/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const paragraph_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/paragraph", title: "Paragraph", category: "text", description: "Start with the basic building block of all narrative.", keywords: ["text"], textdomain: "default", attributes: { align: { type: "string" }, content: { type: "rich-text", source: "rich-text", selector: "p", role: "content" }, dropCap: { type: "boolean", "default": false }, placeholder: { type: "string" }, direction: { type: "string", "enum": ["ltr", "rtl"] } }, supports: { splitting: true, anchor: true, className: false, __experimentalBorder: { color: true, radius: true, style: true, width: true }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalTextDecoration: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalWritingMode: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalSelector: "p", __unstablePasteTextInline: true, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-paragraph-editor", style: "wp-block-paragraph" }; const { name: paragraph_name } = paragraph_metadata; const paragraph_settings = { icon: library_paragraph, example: { attributes: { content: (0,external_wp_i18n_namespaceObject.__)('In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing.') } }, __experimentalLabel(attributes, { context }) { const customName = attributes?.metadata?.name; if (context === 'list-view' && customName) { return customName; } if (context === 'accessibility') { if (customName) { return customName; } const { content } = attributes; return !content || content.length === 0 ? (0,external_wp_i18n_namespaceObject.__)('Empty') : content; } }, transforms: paragraph_transforms, deprecated: paragraph_deprecated, merge(attributes, attributesToMerge) { return { content: (attributes.content || '') + (attributesToMerge.content || '') }; }, edit: paragraph_edit, save: paragraph_save_save }; const paragraph_init = () => initBlock({ name: paragraph_name, metadata: paragraph_metadata, settings: paragraph_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/post-author.js /** * WordPress dependencies */ const postAuthor = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z", fillRule: "evenodd", clipRule: "evenodd" }) }); /* harmony default export */ const post_author = (postAuthor); ;// ./node_modules/@wordpress/block-library/build-module/post-author/edit.js /** * External dependencies */ /** * WordPress dependencies */ const minimumUsersForCombobox = 25; const edit_AUTHORS_QUERY = { who: 'authors', per_page: 100 }; function PostAuthorEdit({ isSelected, context: { postType, postId, queryId }, attributes, setAttributes }) { const isDescendentOfQueryLoop = Number.isFinite(queryId); const { authorId, authorDetails, authors, supportsAuthor } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getPostType$supports; const { getEditedEntityRecord, getUser, getUsers, getPostType } = select(external_wp_coreData_namespaceObject.store); const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; return { authorId: _authorId, authorDetails: _authorId ? getUser(_authorId) : null, authors: getUsers(edit_AUTHORS_QUERY), supportsAuthor: (_getPostType$supports = getPostType(postType)?.supports?.author) !== null && _getPostType$supports !== void 0 ? _getPostType$supports : false }; }, [postType, postId]); const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const { textAlign, showAvatar, showBio, byline, isLink, linkTarget } = attributes; const avatarSizes = []; const authorName = authorDetails?.name || (0,external_wp_i18n_namespaceObject.__)('Post Author'); if (authorDetails?.avatar_urls) { Object.keys(authorDetails.avatar_urls).forEach(size => { avatarSizes.push({ value: size, label: `${size} x ${size}` }); }); } const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const authorOptions = authors?.length ? authors.map(({ id, name }) => { return { value: id, label: name }; }) : []; const handleSelect = nextAuthorId => { editEntityRecord('postType', postType, postId, { author: nextAuthorId }); }; const showCombobox = authorOptions.length >= minimumUsersForCombobox; const showAuthorControl = !!postId && !isDescendentOfQueryLoop && authorOptions.length > 0; if (!supportsAuthor && postType !== undefined) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post". (0,external_wp_i18n_namespaceObject.__)('This post type (%s) does not support the author.'), postType) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, className: "wp-block-post-author__inspector-settings", children: [showAuthorControl && (showCombobox && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ComboboxControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Author'), options: authorOptions, value: authorId, onChange: handleSelect, allowReset: false }) || /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Author'), value: authorId, options: authorOptions, onChange: handleSelect })), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show avatar'), checked: showAvatar, onChange: () => setAttributes({ showAvatar: !showAvatar }) }), showAvatar && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Avatar size'), value: attributes.avatarSize, options: avatarSizes, onChange: size => { setAttributes({ avatarSize: Number(size) }); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show bio'), checked: showBio, onChange: () => setAttributes({ showBio: !showBio }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link author name to author page'), checked: isLink, onChange: () => setAttributes({ isLink: !isLink }) }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: value => setAttributes({ linkTarget: value ? '_blank' : '_self' }), checked: linkTarget === '_blank' })] }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [showAvatar && authorDetails?.avatar_urls && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-post-author__avatar", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { width: attributes.avatarSize, src: authorDetails.avatar_urls[attributes.avatarSize], alt: authorDetails.name }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-post-author__content", children: [(!external_wp_blockEditor_namespaceObject.RichText.isEmpty(byline) || isSelected) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "byline", className: "wp-block-post-author__byline", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Post author byline text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Write byline…'), value: byline, onChange: value => setAttributes({ byline: value }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "wp-block-post-author__name", children: isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#post-author-pseudo-link", onClick: event => event.preventDefault(), children: authorName }) : authorName }), showBio && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "wp-block-post-author__bio", dangerouslySetInnerHTML: { __html: authorDetails?.description } })] })] })] }); } /* harmony default export */ const post_author_edit = (PostAuthorEdit); ;// ./node_modules/@wordpress/block-library/build-module/post-author/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_author_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-author", title: "Author", category: "theme", description: "Display post author details such as name, avatar, and bio.", textdomain: "default", attributes: { textAlign: { type: "string" }, avatarSize: { type: "number", "default": 48 }, showAvatar: { type: "boolean", "default": true }, showBio: { type: "boolean" }, byline: { type: "string" }, isLink: { type: "boolean", "default": false, role: "content" }, linkTarget: { type: "string", "default": "_self", role: "content" } }, usesContext: ["postType", "postId", "queryId"], supports: { html: false, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, color: { gradients: true, link: true, __experimentalDuotone: ".wp-block-post-author__avatar img", __experimentalDefaultControls: { background: true, text: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, editorStyle: "wp-block-post-author-editor", style: "wp-block-post-author" }; const { name: post_author_name } = post_author_metadata; const post_author_settings = { icon: post_author, example: { viewportWidth: 350, attributes: { showBio: true, byline: (0,external_wp_i18n_namespaceObject.__)('Posted by') } }, edit: post_author_edit }; const post_author_init = () => initBlock({ name: post_author_name, metadata: post_author_metadata, settings: post_author_settings }); ;// ./node_modules/@wordpress/block-library/build-module/post-author-name/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function PostAuthorNameEdit({ context: { postType, postId }, attributes: { textAlign, isLink, linkTarget }, setAttributes }) { const { authorName, supportsAuthor } = (0,external_wp_data_namespaceObject.useSelect)(select => { var _getPostType$supports; const { getEditedEntityRecord, getUser, getPostType } = select(external_wp_coreData_namespaceObject.store); const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; return { authorName: _authorId ? getUser(_authorId) : null, supportsAuthor: (_getPostType$supports = getPostType(postType)?.supports?.author) !== null && _getPostType$supports !== void 0 ? _getPostType$supports : false }; }, [postType, postId]); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const displayName = authorName?.name || (0,external_wp_i18n_namespaceObject.__)('Author Name'); const displayAuthor = isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#author-pseudo-link", onClick: event => event.preventDefault(), className: "wp-block-post-author-name__link", children: displayName }) : displayName; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ isLink: false, linkTarget: '_self' }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Link to author archive'), isShownByDefault: true, hasValue: () => isLink, onDeselect: () => setAttributes({ isLink: false }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link to author archive'), onChange: () => setAttributes({ isLink: !isLink }), checked: isLink }) }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), isShownByDefault: true, hasValue: () => linkTarget !== '_self', onDeselect: () => setAttributes({ linkTarget: '_self' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: value => setAttributes({ linkTarget: value ? '_blank' : '_self' }), checked: linkTarget === '_blank' }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: !supportsAuthor && postType !== undefined ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post". (0,external_wp_i18n_namespaceObject.__)('This post type (%s) does not support the author.'), postType) : displayAuthor })] }); } /* harmony default export */ const post_author_name_edit = (PostAuthorNameEdit); ;// ./node_modules/@wordpress/block-library/build-module/post-author-name/transforms.js /** * WordPress dependencies */ const post_author_name_transforms_transforms = { from: [{ type: 'block', blocks: ['core/post-author'], transform: ({ textAlign }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-author-name', { textAlign }) }], to: [{ type: 'block', blocks: ['core/post-author'], transform: ({ textAlign }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-author', { textAlign }) }] }; /* harmony default export */ const post_author_name_transforms = (post_author_name_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/post-author-name/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_author_name_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-author-name", title: "Author Name", category: "theme", description: "The author name.", textdomain: "default", attributes: { textAlign: { type: "string" }, isLink: { type: "boolean", "default": false, role: "content" }, linkTarget: { type: "string", "default": "_self", role: "content" } }, usesContext: ["postType", "postId"], example: { viewportWidth: 350 }, supports: { html: false, spacing: { margin: true, padding: true }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-post-author-name" }; const { name: post_author_name_name } = post_author_name_metadata; const post_author_name_settings = { icon: post_author, transforms: post_author_name_transforms, edit: post_author_name_edit }; const post_author_name_init = () => initBlock({ name: post_author_name_name, metadata: post_author_name_metadata, settings: post_author_name_settings }); ;// ./node_modules/@wordpress/block-library/build-module/post-author-biography/edit.js /** * External dependencies */ /** * WordPress dependencies */ function PostAuthorBiographyEdit({ context: { postType, postId }, attributes: { textAlign }, setAttributes }) { const { authorDetails } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedEntityRecord, getUser } = select(external_wp_coreData_namespaceObject.store); const _authorId = getEditedEntityRecord('postType', postType, postId)?.author; return { authorDetails: _authorId ? getUser(_authorId) : null }; }, [postType, postId]); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const displayAuthorBiography = authorDetails?.description || (0,external_wp_i18n_namespaceObject.__)('Author Biography'); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, dangerouslySetInnerHTML: { __html: displayAuthorBiography } })] }); } /* harmony default export */ const post_author_biography_edit = (PostAuthorBiographyEdit); ;// ./node_modules/@wordpress/block-library/build-module/post-author-biography/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_author_biography_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-author-biography", title: "Author Biography", category: "theme", description: "The author biography.", textdomain: "default", attributes: { textAlign: { type: "string" } }, usesContext: ["postType", "postId"], example: { viewportWidth: 350 }, supports: { spacing: { margin: true, padding: true }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-post-author-biography" }; const { name: post_author_biography_name } = post_author_biography_metadata; const post_author_biography_settings = { icon: post_author, edit: post_author_biography_edit }; const post_author_biography_init = () => initBlock({ name: post_author_biography_name, metadata: post_author_biography_metadata, settings: post_author_biography_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/block-default.js /** * WordPress dependencies */ const blockDefault = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" }) }); /* harmony default export */ const block_default = (blockDefault); ;// ./node_modules/@wordpress/block-library/build-module/post-comment/edit.js /** * WordPress dependencies */ const post_comment_edit_TEMPLATE = [['core/avatar'], ['core/comment-author-name'], ['core/comment-date'], ['core/comment-content'], ['core/comment-reply-link'], ['core/comment-edit-link']]; function post_comment_edit_Edit({ attributes: { commentId }, setAttributes }) { const [commentIdInput, setCommentIdInput] = (0,external_wp_element_namespaceObject.useState)(commentId); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: post_comment_edit_TEMPLATE }); if (!commentId) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { icon: block_default, label: (0,external_wp_i18n_namespaceObject._x)('Post Comment', 'block title'), instructions: (0,external_wp_i18n_namespaceObject.__)('To show a comment, input the comment ID.'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, value: commentId, onChange: val => setCommentIdInput(parseInt(val)) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", onClick: () => { setAttributes({ commentId: commentIdInput }); }, children: (0,external_wp_i18n_namespaceObject.__)('Save') })] }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }); } ;// ./node_modules/@wordpress/block-library/build-module/post-comment/save.js /** * WordPress dependencies */ function post_comment_save_save() { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }); } ;// ./node_modules/@wordpress/block-library/build-module/post-comment/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_comment_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: "fse", name: "core/post-comment", title: "Comment (deprecated)", category: "theme", allowedBlocks: ["core/avatar", "core/comment-author-name", "core/comment-content", "core/comment-date", "core/comment-edit-link", "core/comment-reply-link"], description: "This block is deprecated. Please use the Comments block instead.", textdomain: "default", attributes: { commentId: { type: "number" } }, providesContext: { commentId: "commentId" }, supports: { html: false, inserter: false, interactivity: { clientNavigation: true } } }; const { name: post_comment_name } = post_comment_metadata; const post_comment_settings = { icon: library_comment, edit: post_comment_edit_Edit, save: post_comment_save_save }; const post_comment_init = () => initBlock({ name: post_comment_name, metadata: post_comment_metadata, settings: post_comment_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/post-comments-count.js /** * WordPress dependencies */ const postCommentsCount = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z" }) }); /* harmony default export */ const post_comments_count = (postCommentsCount); ;// ./node_modules/@wordpress/block-library/build-module/post-comments-count/edit.js /** * External dependencies */ /** * WordPress dependencies */ function PostCommentsCountEdit({ attributes, context, setAttributes }) { const { textAlign } = attributes; const { postId } = context; const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)(); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!postId) { return; } const currentPostId = postId; external_wp_apiFetch_default()({ path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { post: postId }), parse: false }).then(res => { // Stale requests will have the `currentPostId` of an older closure. if (currentPostId === postId) { setCommentsCount(res.headers.get('X-WP-Total')); } }); }, [postId]); const hasPostAndComments = postId && commentsCount !== undefined; const blockStyles = { ...blockProps.style, textDecoration: hasPostAndComments ? blockProps.style?.textDecoration : undefined }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, style: blockStyles, children: hasPostAndComments ? commentsCount : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Post Comments Count block: post not found.') }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/post-comments-count/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_comments_count_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: "fse", name: "core/post-comments-count", title: "Comments Count", category: "theme", description: "Display a post's comments count.", textdomain: "default", attributes: { textAlign: { type: "string" } }, usesContext: ["postId"], supports: { html: false, color: { gradients: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true }, interactivity: { clientNavigation: true } }, style: "wp-block-post-comments-count" }; const { name: post_comments_count_name } = post_comments_count_metadata; const post_comments_count_settings = { icon: post_comments_count, edit: PostCommentsCountEdit }; const post_comments_count_init = () => initBlock({ name: post_comments_count_name, metadata: post_comments_count_metadata, settings: post_comments_count_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/post-comments-form.js /** * WordPress dependencies */ const postCommentsForm = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z" }) }); /* harmony default export */ const post_comments_form = (postCommentsForm); ;// ./node_modules/@wordpress/block-library/build-module/post-comments-form/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function PostCommentsFormEdit({ attributes, context, setAttributes }) { const { textAlign } = attributes; const { postId, postType } = context; const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostCommentsFormEdit); const instanceIdDesc = (0,external_wp_i18n_namespaceObject.sprintf)('comments-form-edit-%d-desc', instanceId); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }), 'aria-describedby': instanceIdDesc }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_comments_form_form, { postId: postId, postType: postType }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.VisuallyHidden, { id: instanceIdDesc, children: (0,external_wp_i18n_namespaceObject.__)('Comments form disabled in editor.') })] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/post-comments-form/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_comments_form_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-comments-form", title: "Comments Form", category: "theme", description: "Display a post's comments form.", textdomain: "default", attributes: { textAlign: { type: "string" } }, usesContext: ["postId", "postType"], supports: { html: false, color: { gradients: true, heading: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, editorStyle: "wp-block-post-comments-form-editor", style: ["wp-block-post-comments-form", "wp-block-buttons", "wp-block-button"], example: { attributes: { textAlign: "center" } } }; const { name: post_comments_form_name } = post_comments_form_metadata; const post_comments_form_settings = { icon: post_comments_form, edit: PostCommentsFormEdit }; const post_comments_form_init = () => initBlock({ name: post_comments_form_name, metadata: post_comments_form_metadata, settings: post_comments_form_settings }); ;// ./node_modules/@wordpress/block-library/build-module/post-comments-link/edit.js /** * External dependencies */ /** * WordPress dependencies */ function PostCommentsLinkEdit({ context, attributes, setAttributes }) { const { textAlign } = attributes; const { postType, postId } = context; const [commentsCount, setCommentsCount] = (0,external_wp_element_namespaceObject.useState)(); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!postId) { return; } const currentPostId = postId; external_wp_apiFetch_default()({ path: (0,external_wp_url_namespaceObject.addQueryArgs)('/wp/v2/comments', { post: postId }), parse: false }).then(res => { // Stale requests will have the `currentPostId` of an older closure. if (currentPostId === postId) { setCommentsCount(res.headers.get('X-WP-Total')); } }); }, [postId]); const post = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', postType, postId), [postType, postId]); if (!post) { return null; } const { link } = post; let commentsText; if (commentsCount !== undefined) { const commentsNumber = parseInt(commentsCount); if (commentsNumber === 0) { commentsText = (0,external_wp_i18n_namespaceObject.__)('No comments'); } else { commentsText = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Number of comments */ (0,external_wp_i18n_namespaceObject._n)('%s comment', '%s comments', commentsNumber), commentsNumber.toLocaleString()); } } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: link && commentsText !== undefined ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: link + '#comments', onClick: event => event.preventDefault(), children: commentsText }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Post Comments Link block: post not found.') }) })] }); } /* harmony default export */ const post_comments_link_edit = (PostCommentsLinkEdit); ;// ./node_modules/@wordpress/block-library/build-module/post-comments-link/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_comments_link_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: "fse", name: "core/post-comments-link", title: "Comments Link", category: "theme", description: "Displays the link to the current post comments.", textdomain: "default", usesContext: ["postType", "postId"], attributes: { textAlign: { type: "string" } }, supports: { html: false, color: { link: true, text: false, __experimentalDefaultControls: { background: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-post-comments-link" }; const { name: post_comments_link_name } = post_comments_link_metadata; const post_comments_link_settings = { edit: post_comments_link_edit, icon: post_comments_count }; const post_comments_link_init = () => initBlock({ name: post_comments_link_name, metadata: post_comments_link_metadata, settings: post_comments_link_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/post-content.js /** * WordPress dependencies */ const postContent = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z" }) }); /* harmony default export */ const post_content = (postContent); ;// ./node_modules/@wordpress/block-library/build-module/post-content/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ function ReadOnlyContent({ parentLayout, layoutClassNames, userCanEdit, postType, postId }) { const [,, content] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: layoutClassNames }); const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { return content?.raw ? (0,external_wp_blocks_namespaceObject.parse)(content.raw) : []; }, [content?.raw]); const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({ blocks, props: blockProps, layout: parentLayout }); if (userCanEdit) { /* * Rendering the block preview using the raw content blocks allows for * block support styles to be generated and applied by the editor. * * The preview using the raw blocks can only be presented to users with * edit permissions for the post to prevent potential exposure of private * block content. */ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockPreviewProps }); } return content?.protected ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('This content is password protected.') }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, dangerouslySetInnerHTML: { __html: content?.rendered } }); } function EditableContent({ context = {} }) { const { postType, postId } = context; const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, { id: postId }); const entityRecord = (0,external_wp_data_namespaceObject.useSelect)(select => { return select(external_wp_coreData_namespaceObject.store).getEntityRecord('postType', postType, postId); }, [postType, postId]); const hasInnerBlocks = !!entityRecord?.content?.raw || blocks?.length; const initialInnerBlocks = [['core/paragraph']]; const props = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)((0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: 'entry-content' }), { value: blocks, onInput, onChange, template: !hasInnerBlocks ? initialInnerBlocks : undefined }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...props }); } function Content(props) { const { context: { queryId, postType, postId } = {}, layoutClassNames } = props; const userCanEdit = useCanEditEntity('postType', postType, postId); if (userCanEdit === undefined) { return null; } const isDescendentOfQueryLoop = Number.isFinite(queryId); const isEditable = userCanEdit && !isDescendentOfQueryLoop; return isEditable ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EditableContent, { ...props }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReadOnlyContent, { parentLayout: props.parentLayout, layoutClassNames: layoutClassNames, userCanEdit: userCanEdit, postType: postType, postId: postId }); } function edit_Placeholder({ layoutClassNames }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: layoutClassNames }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('This is the Content block, it will display all the blocks in any single post or page.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('That might be a simple arrangement like consecutive paragraphs in a blog post, or a more elaborate composition that includes image galleries, videos, tables, columns, and any other block types.') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('If there are any Custom Post Types registered at your site, the Content block can display the contents of those entries as well.') })] }); } function RecursionError() { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.') }) }); } function PostContentEdit({ context, __unstableLayoutClassNames: layoutClassNames, __unstableParentLayout: parentLayout }) { const { postId: contextPostId, postType: contextPostType } = context; const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(contextPostId); if (contextPostId && contextPostType && hasAlreadyRendered) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RecursionError, {}); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RecursionProvider, { uniqueId: contextPostId, children: contextPostId && contextPostType ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Content, { context: context, parentLayout: parentLayout, layoutClassNames: layoutClassNames }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(edit_Placeholder, { layoutClassNames: layoutClassNames }) }); } ;// ./node_modules/@wordpress/block-library/build-module/post-content/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_content_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-content", title: "Content", category: "theme", description: "Displays the contents of a post or page.", textdomain: "default", usesContext: ["postId", "postType", "queryId"], example: { viewportWidth: 350 }, supports: { align: ["wide", "full"], html: false, layout: true, background: { backgroundImage: true, backgroundSize: true, __experimentalDefaultControls: { backgroundImage: true } }, dimensions: { minHeight: true }, spacing: { blockGap: true, padding: true, margin: true, __experimentalDefaultControls: { margin: false, padding: false } }, color: { gradients: true, heading: true, link: true, __experimentalDefaultControls: { background: false, text: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-post-content", editorStyle: "wp-block-post-content-editor" }; const { name: post_content_name } = post_content_metadata; const post_content_settings = { icon: post_content, edit: PostContentEdit }; const post_content_init = () => initBlock({ name: post_content_name, metadata: post_content_metadata, settings: post_content_settings }); ;// ./node_modules/@wordpress/block-library/build-module/post-date/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function PostDateEdit({ attributes: { textAlign, format, isLink, displayType }, context: { postId, postType: postTypeSlug, queryId }, setAttributes }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign, [`wp-block-post-date__modified-date`]: displayType === 'modified' }) }); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); // Memoize popoverProps to avoid returning a new object every time. const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({ anchor: popoverAnchor }), [popoverAnchor]); const isDescendentOfQueryLoop = Number.isFinite(queryId); const dateSettings = (0,external_wp_date_namespaceObject.getSettings)(); const [siteFormat = dateSettings.formats.date] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'date_format'); const [siteTimeFormat = dateSettings.formats.time] = (0,external_wp_coreData_namespaceObject.useEntityProp)('root', 'site', 'time_format'); const [date, setDate] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, displayType, postId); const postType = (0,external_wp_data_namespaceObject.useSelect)(select => postTypeSlug ? select(external_wp_coreData_namespaceObject.store).getPostType(postTypeSlug) : null, [postTypeSlug]); const dateLabel = displayType === 'date' ? (0,external_wp_i18n_namespaceObject.__)('Post Date') : (0,external_wp_i18n_namespaceObject.__)('Post Modified Date'); let postDate = date ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("time", { dateTime: (0,external_wp_date_namespaceObject.dateI18n)('c', date), ref: setPopoverAnchor, children: format === 'human-diff' ? (0,external_wp_date_namespaceObject.humanTimeDiff)(date) : (0,external_wp_date_namespaceObject.dateI18n)(format || siteFormat, date) }) : dateLabel; if (isLink && date) { postDate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#post-date-pseudo-link", onClick: event => event.preventDefault(), children: postDate }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }), date && displayType === 'date' && !isDescendentOfQueryLoop && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: popoverProps, renderContent: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalPublishDateTimePicker, { currentDate: date, onChange: setDate, is12Hour: is12HourFormat(siteTimeFormat), onClose: onClose, dateOrder: /* translators: Order of day, month, and year. Available formats are 'dmy', 'mdy', and 'ymd'. */ (0,external_wp_i18n_namespaceObject._x)('dmy', 'date order') }), renderToggle: ({ isOpen, onToggle }) => { const openOnArrowDown = event => { if (!isOpen && event.keyCode === external_wp_keycodes_namespaceObject.DOWN) { event.preventDefault(); onToggle(); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { "aria-expanded": isOpen, icon: library_edit, title: (0,external_wp_i18n_namespaceObject.__)('Change Date'), onClick: onToggle, onKeyDown: openOnArrowDown }); } }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ format: undefined, isLink: false, displayType: 'date' }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!format, label: (0,external_wp_i18n_namespaceObject.__)('Date Format'), onDeselect: () => setAttributes({ format: undefined }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalDateFormatPicker, { format: format, defaultFormat: siteFormat, onChange: nextFormat => setAttributes({ format: nextFormat }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => isLink !== false, label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post". (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'), onDeselect: () => setAttributes({ isLink: false }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post". (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name.toLowerCase()) : (0,external_wp_i18n_namespaceObject.__)('Link to post'), onChange: () => setAttributes({ isLink: !isLink }), checked: isLink }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => displayType !== 'date', label: (0,external_wp_i18n_namespaceObject.__)('Display last modified date'), onDeselect: () => setAttributes({ displayType: 'date' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display last modified date'), onChange: value => setAttributes({ displayType: value ? 'modified' : 'date' }), checked: displayType === 'modified', help: (0,external_wp_i18n_namespaceObject.__)('Only shows if the post has been modified') }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: postDate })] }); } function is12HourFormat(format) { // To know if the time format is a 12 hour time, look for any of the 12 hour // format characters: 'a', 'A', 'g', and 'h'. The character must be // unescaped, i.e. not preceded by a '\'. Coincidentally, 'aAgh' is how I // feel when working with regular expressions. // https://www.php.net/manual/en/datetime.format.php return /(?:^|[^\\])[aAgh]/.test(format); } ;// ./node_modules/@wordpress/block-library/build-module/post-date/deprecated.js /** * Internal dependencies */ const post_date_deprecated_v1 = { attributes: { textAlign: { type: 'string' }, format: { type: 'string' }, isLink: { type: 'boolean', default: false } }, supports: { html: false, color: { gradients: true, link: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalLetterSpacing: true } }, save() { return null; }, migrate: migrate_font_family, isEligible({ style }) { return style?.typography?.fontFamily; } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const post_date_deprecated = ([post_date_deprecated_v1]); ;// ./node_modules/@wordpress/block-library/build-module/post-date/variations.js /** * WordPress dependencies */ const post_date_variations_variations = [{ name: 'post-date-modified', title: (0,external_wp_i18n_namespaceObject.__)('Modified Date'), description: (0,external_wp_i18n_namespaceObject.__)("Display a post's last updated date."), attributes: { displayType: 'modified' }, scope: ['block', 'inserter'], isActive: blockAttributes => blockAttributes.displayType === 'modified', icon: post_date }]; /* harmony default export */ const post_date_variations = (post_date_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/post-date/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_date_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-date", title: "Date", category: "theme", description: "Display the publish date for an entry such as a post or page.", textdomain: "default", attributes: { textAlign: { type: "string" }, format: { type: "string" }, isLink: { type: "boolean", "default": false, role: "content" }, displayType: { type: "string", "default": "date" } }, usesContext: ["postId", "postType", "queryId"], example: { viewportWidth: 350 }, supports: { html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } } }; const { name: post_date_name } = post_date_metadata; const post_date_settings = { icon: post_date, edit: PostDateEdit, deprecated: post_date_deprecated, variations: post_date_variations }; const post_date_init = () => initBlock({ name: post_date_name, metadata: post_date_metadata, settings: post_date_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/post-excerpt.js /** * WordPress dependencies */ const postExcerpt = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M8.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H4v-3h4.001ZM4 20h9v-1.5H4V20Zm16-4H4v-1.5h16V16ZM13.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H9v-3h4.001Z" }) }); /* harmony default export */ const post_excerpt = (postExcerpt); ;// ./node_modules/@wordpress/block-library/build-module/post-excerpt/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const ELLIPSIS = '…'; function PostExcerptEditor({ attributes: { textAlign, moreText, showMoreOnNewLine, excerptLength }, setAttributes, isSelected, context: { postId, postType, queryId } }) { const isDescendentOfQueryLoop = Number.isFinite(queryId); const userCanEdit = useCanEditEntity('postType', postType, postId); const [rawExcerpt, setExcerpt, { rendered: renderedExcerpt, protected: isProtected } = {}] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'excerpt', postId); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); /** * Check if the post type supports excerpts. * Add an exception and return early for the "page" post type, * which is registered without support for the excerpt UI, * but supports saving the excerpt to the database. * See: https://core.trac.wordpress.org/browser/branches/6.1/src/wp-includes/post.php#L65 * Without this exception, users that have excerpts saved to the database will * not be able to edit the excerpts. */ const postTypeSupportsExcerpts = (0,external_wp_data_namespaceObject.useSelect)(select => { if (postType === 'page') { return true; } return !!select(external_wp_coreData_namespaceObject.store).getPostType(postType)?.supports?.excerpt; }, [postType]); /** * The excerpt is editable if: * - The user can edit the post * - It is not a descendent of a Query Loop block * - The post type supports excerpts */ const isEditable = userCanEdit && !isDescendentOfQueryLoop && postTypeSupportsExcerpts; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); /** * translators: If your word count is based on single characters (e.g. East Asian characters), * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. * Do not translate into your own language. */ const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!'); /** * When excerpt is editable, strip the html tags from * rendered excerpt. This will be used if the entity's * excerpt has been produced from the content. */ const strippedRenderedExcerpt = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!renderedExcerpt) { return ''; } const document = new window.DOMParser().parseFromString(renderedExcerpt, 'text/html'); return document.body.textContent || document.body.innerText || ''; }, [renderedExcerpt]); if (!postType || !postId) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { value: textAlign, onChange: newAlign => setAttributes({ textAlign: newAlign }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('This block will display the excerpt.') }) })] }); } if (isProtected && !userCanEdit) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('The content is currently protected and does not have the available excerpt.') }) }); } const readMoreLink = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "moreText", className: "wp-block-post-excerpt__more-link", tagName: "a", "aria-label": (0,external_wp_i18n_namespaceObject.__)('“Read more” link text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Add "read more" link text'), value: moreText, onChange: newMoreText => setAttributes({ moreText: newMoreText }), withoutInteractiveFormatting: true }); const excerptClassName = dist_clsx('wp-block-post-excerpt__excerpt', { 'is-inline': !showMoreOnNewLine }); /** * The excerpt length setting needs to be applied to both * the raw and the rendered excerpt depending on which is being used. */ const rawOrRenderedExcerpt = (rawExcerpt || strippedRenderedExcerpt).trim(); let trimmedExcerpt = ''; if (wordCountType === 'words') { trimmedExcerpt = rawOrRenderedExcerpt.split(' ', excerptLength).join(' '); } else if (wordCountType === 'characters_excluding_spaces') { /* * 1. Split the excerpt at the character limit, * then join the substrings back into one string. * 2. Count the number of spaces in the excerpt * by comparing the lengths of the string with and without spaces. * 3. Add the number to the length of the visible excerpt, * so that the spaces are excluded from the word count. */ const excerptWithSpaces = rawOrRenderedExcerpt.split('', excerptLength).join(''); const numberOfSpaces = excerptWithSpaces.length - excerptWithSpaces.replaceAll(' ', '').length; trimmedExcerpt = rawOrRenderedExcerpt.split('', excerptLength + numberOfSpaces).join(''); } else if (wordCountType === 'characters_including_spaces') { trimmedExcerpt = rawOrRenderedExcerpt.split('', excerptLength).join(''); } const isTrimmed = trimmedExcerpt !== rawOrRenderedExcerpt; const excerptContent = isEditable ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { className: excerptClassName, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Excerpt text'), value: isSelected ? rawOrRenderedExcerpt : (!isTrimmed ? rawOrRenderedExcerpt : trimmedExcerpt + ELLIPSIS) || (0,external_wp_i18n_namespaceObject.__)('No excerpt found'), onChange: setExcerpt, tagName: "p" }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: excerptClassName, children: !isTrimmed ? rawOrRenderedExcerpt || (0,external_wp_i18n_namespaceObject.__)('No excerpt found') : trimmedExcerpt + ELLIPSIS }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { value: textAlign, onChange: newAlign => setAttributes({ textAlign: newAlign }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ showMoreOnNewLine: true, excerptLength: 55 }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => showMoreOnNewLine !== true, label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'), onDeselect: () => setAttributes({ showMoreOnNewLine: true }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show link on new line'), checked: showMoreOnNewLine, onChange: newShowMoreOnNewLine => setAttributes({ showMoreOnNewLine: newShowMoreOnNewLine }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => excerptLength !== 55, label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'), onDeselect: () => setAttributes({ excerptLength: 55 }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Max number of words'), value: excerptLength, onChange: value => { setAttributes({ excerptLength: value }); }, min: "10", max: "100" }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [excerptContent, !showMoreOnNewLine && ' ', showMoreOnNewLine ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { className: "wp-block-post-excerpt__more-text", children: readMoreLink }) : readMoreLink] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/post-excerpt/transforms.js /** * WordPress dependencies */ const post_excerpt_transforms_transforms = { from: [{ type: 'block', blocks: ['core/post-content'], transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-excerpt') }], to: [{ type: 'block', blocks: ['core/post-content'], transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/post-content') }] }; /* harmony default export */ const post_excerpt_transforms = (post_excerpt_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/post-excerpt/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_excerpt_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-excerpt", title: "Excerpt", category: "theme", description: "Display the excerpt.", textdomain: "default", attributes: { textAlign: { type: "string" }, moreText: { type: "string" }, showMoreOnNewLine: { type: "boolean", "default": true }, excerptLength: { type: "number", "default": 55 } }, usesContext: ["postId", "postType", "queryId"], example: { viewportWidth: 350 }, supports: { html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, editorStyle: "wp-block-post-excerpt-editor", style: "wp-block-post-excerpt" }; const { name: post_excerpt_name } = post_excerpt_metadata; const post_excerpt_settings = { icon: post_excerpt, transforms: post_excerpt_transforms, edit: PostExcerptEditor }; const post_excerpt_init = () => initBlock({ name: post_excerpt_name, metadata: post_excerpt_metadata, settings: post_excerpt_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/post-featured-image.js /** * WordPress dependencies */ const postFeaturedImage = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z" }) }); /* harmony default export */ const post_featured_image = (postFeaturedImage); ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/dimension-controls.js /** * WordPress dependencies */ const SCALE_OPTIONS = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "cover", label: (0,external_wp_i18n_namespaceObject._x)('Cover', 'Scale option for Image dimension control') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "contain", label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for Image dimension control') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "fill", label: (0,external_wp_i18n_namespaceObject._x)('Fill', 'Scale option for Image dimension control') })] }); const DEFAULT_SCALE = 'cover'; const scaleHelp = { cover: (0,external_wp_i18n_namespaceObject.__)('Image is scaled and cropped to fill the entire space without being distorted.'), contain: (0,external_wp_i18n_namespaceObject.__)('Image is scaled to fill the space without clipping nor distorting.'), fill: (0,external_wp_i18n_namespaceObject.__)('Image will be stretched and distorted to completely fill the space.') }; const DimensionControls = ({ clientId, attributes: { aspectRatio, width, height, scale }, setAttributes }) => { const [availableUnits, defaultRatios, themeRatios, showDefaultRatios] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units', 'dimensions.aspectRatios.default', 'dimensions.aspectRatios.theme', 'dimensions.defaultAspectRatios'); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits || ['px', '%', 'vw', 'em', 'rem'] }); const onDimensionChange = (dimension, nextValue) => { const parsedValue = parseFloat(nextValue); /** * If we have no value set and we change the unit, * we don't want to set the attribute, as it would * end up having the unit as value without any number. */ if (isNaN(parsedValue) && nextValue) { return; } setAttributes({ [dimension]: parsedValue < 0 ? '0' : nextValue }); }; const scaleLabel = (0,external_wp_i18n_namespaceObject._x)('Scale', 'Image scaling options'); const showScaleControl = height || aspectRatio && aspectRatio !== 'auto'; const themeOptions = themeRatios?.map(({ name, ratio }) => ({ label: name, value: ratio })); const defaultOptions = defaultRatios?.map(({ name, ratio }) => ({ label: name, value: ratio })); const aspectRatioOptions = [{ label: (0,external_wp_i18n_namespaceObject._x)('Original', 'Aspect ratio option for dimensions control'), value: 'auto' }, ...(showDefaultRatios ? defaultOptions : []), ...(themeOptions ? themeOptions : [])]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!aspectRatio, label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'), onDeselect: () => setAttributes({ aspectRatio: undefined }), resetAllFilter: () => ({ aspectRatio: undefined }), isShownByDefault: true, panelId: clientId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Aspect ratio'), value: aspectRatio, options: aspectRatioOptions, onChange: nextAspectRatio => setAttributes({ aspectRatio: nextAspectRatio }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { className: "single-column", hasValue: () => !!height, label: (0,external_wp_i18n_namespaceObject.__)('Height'), onDeselect: () => setAttributes({ height: undefined }), resetAllFilter: () => ({ height: undefined }), isShownByDefault: true, panelId: clientId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Height'), labelPosition: "top", value: height || '', min: 0, onChange: nextHeight => onDimensionChange('height', nextHeight), units: units }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { className: "single-column", hasValue: () => !!width, label: (0,external_wp_i18n_namespaceObject.__)('Width'), onDeselect: () => setAttributes({ width: undefined }), resetAllFilter: () => ({ width: undefined }), isShownByDefault: true, panelId: clientId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Width'), labelPosition: "top", value: width || '', min: 0, onChange: nextWidth => onDimensionChange('width', nextWidth), units: units }) }), showScaleControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!scale && scale !== DEFAULT_SCALE, label: scaleLabel, onDeselect: () => setAttributes({ scale: DEFAULT_SCALE }), resetAllFilter: () => ({ scale: DEFAULT_SCALE }), isShownByDefault: true, panelId: clientId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: scaleLabel, value: scale, help: scaleHelp[scale], onChange: value => setAttributes({ scale: value }), isBlock: true, children: SCALE_OPTIONS }) })] }); }; /* harmony default export */ const dimension_controls = (DimensionControls); ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/overlay-controls.js /** * WordPress dependencies */ const Overlay = ({ clientId, attributes, setAttributes, overlayColor, setOverlayColor }) => { const { dimRatio } = attributes; const { gradientValue, setGradient } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); if (!colorGradientSettings.hasColorsOrGradients) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { __experimentalIsRenderedInSidebar: true, settings: [{ colorValue: overlayColor.color, gradientValue, label: (0,external_wp_i18n_namespaceObject.__)('Overlay'), onColorChange: setOverlayColor, onGradientChange: setGradient, isShownByDefault: true, resetAllFilter: () => ({ overlayColor: undefined, customOverlayColor: undefined, gradient: undefined, customGradient: undefined }), clearable: true }], panelId: clientId, ...colorGradientSettings }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => dimRatio !== undefined, label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), onDeselect: () => setAttributes({ dimRatio: 0 }), resetAllFilter: () => ({ dimRatio: 0 }), isShownByDefault: true, panelId: clientId, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Overlay opacity'), value: dimRatio, onChange: newDimRatio => setAttributes({ dimRatio: newDimRatio }), min: 0, max: 100, step: 10, required: true, __next40pxDefaultSize: true }) })] }); }; /* harmony default export */ const overlay_controls = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({ overlayColor: 'background-color' })])(Overlay)); ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/utils.js /** * Generates the opacity/dim class based on given number. * * @param {number} ratio Dim/opacity number. * * @return {string} Generated class. */ function utils_dimRatioToClass(ratio) { return ratio === undefined ? null : 'has-background-dim-' + 10 * Math.round(ratio / 10); } ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/overlay.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const overlay_Overlay = ({ attributes, overlayColor }) => { const { dimRatio } = attributes; const { gradientClass, gradientValue } = (0,external_wp_blockEditor_namespaceObject.__experimentalUseGradient)(); const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); const overlayStyles = { backgroundColor: overlayColor.color, backgroundImage: gradientValue, ...borderProps.style }; if (!colorGradientSettings.hasColorsOrGradients || !dimRatio) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { "aria-hidden": "true", className: dist_clsx('wp-block-post-featured-image__overlay', utils_dimRatioToClass(dimRatio), { [overlayColor.class]: overlayColor.class, 'has-background-dim': dimRatio !== undefined, 'has-background-gradient': gradientValue, [gradientClass]: gradientClass }, borderProps.className), style: overlayStyles }); }; /* harmony default export */ const overlay = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_blockEditor_namespaceObject.withColors)({ overlayColor: 'background-color' })])(overlay_Overlay)); ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const post_featured_image_edit_ALLOWED_MEDIA_TYPES = ['image']; const { ResolutionTool: post_featured_image_edit_ResolutionTool } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const edit_DEFAULT_MEDIA_SIZE_SLUG = 'full'; function FeaturedImageResolutionTool({ image, value, onChange }) { const { imageSizes } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); return { imageSizes: getSettings().imageSizes }; }, []); if (!imageSizes?.length) { return null; } const imageSizeOptions = imageSizes.filter(({ slug }) => image?.media_details?.sizes?.[slug]?.source_url).map(({ name, slug }) => ({ value: slug, label: name })); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_featured_image_edit_ResolutionTool, { value: value, defaultValue: edit_DEFAULT_MEDIA_SIZE_SLUG, options: imageSizeOptions, onChange: onChange }); } function PostFeaturedImageEdit({ clientId, attributes, setAttributes, context: { postId, postType: postTypeSlug, queryId } }) { const isDescendentOfQueryLoop = Number.isFinite(queryId); const { isLink, aspectRatio, height, width, scale, sizeSlug, rel, linkTarget, useFirstImageFromPost } = attributes; const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(); const [storedFeaturedImage, setFeaturedImage] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'featured_media', postId); // Fallback to post content if no featured image is set. // This is needed for the "Use first image from post" option. const [postContent] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postTypeSlug, 'content', postId); const featuredImage = (0,external_wp_element_namespaceObject.useMemo)(() => { if (storedFeaturedImage) { return storedFeaturedImage; } if (!useFirstImageFromPost) { return; } const imageOpener = /<!--\s+wp:(?:core\/)?image\s+(?<attrs>{(?:(?:[^}]+|}+(?=})|(?!}\s+\/?-->).)*)?}\s+)?-->/.exec(postContent); const imageId = imageOpener?.groups?.attrs && JSON.parse(imageOpener.groups.attrs)?.id; return imageId; }, [storedFeaturedImage, useFirstImageFromPost, postContent]); const { media, postType, postPermalink } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getMedia, getPostType, getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); return { media: featuredImage && getMedia(featuredImage, { context: 'view' }), postType: postTypeSlug && getPostType(postTypeSlug), postPermalink: getEditedEntityRecord('postType', postTypeSlug, postId)?.link }; }, [featuredImage, postTypeSlug, postId]); const mediaUrl = media?.media_details?.sizes?.[sizeSlug]?.source_url || media?.source_url; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ style: { width, height, aspectRatio }, className: dist_clsx({ 'is-transient': temporaryURL }) }); const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); const shadowProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetShadowClassesAndStyles)(attributes); const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); const placeholder = content => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className: dist_clsx('block-editor-media-placeholder', borderProps.className), withIllustration: true, style: { height: !!aspectRatio && '100%', width: !!aspectRatio && '100%', ...borderProps.style, ...shadowProps.style }, children: content }); }; const onSelectImage = value => { if (value?.id) { setFeaturedImage(value.id); } if (value?.url && (0,external_wp_blob_namespaceObject.isBlobURL)(value.url)) { setTemporaryURL(value.url); } }; // Reset temporary url when media is available. (0,external_wp_element_namespaceObject.useEffect)(() => { if (mediaUrl && temporaryURL) { setTemporaryURL(); } }, [mediaUrl, temporaryURL]); const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const onUploadError = message => { createErrorNotice(message, { type: 'snackbar' }); setTemporaryURL(); }; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const controls = blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "color", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(overlay_controls, { attributes: attributes, setAttributes: setAttributes, clientId: clientId }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "dimensions", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(dimension_controls, { clientId: clientId, attributes: attributes, setAttributes: setAttributes, media: media }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ isLink: false, linkTarget: '_self', rel: '' }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post". (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name) : (0,external_wp_i18n_namespaceObject.__)('Link to post'), isShownByDefault: true, hasValue: () => !!isLink, onDeselect: () => setAttributes({ isLink: false }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: postType?.labels.singular_name ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: Name of the post type e.g: "post". (0,external_wp_i18n_namespaceObject.__)('Link to %s'), postType.labels.singular_name) : (0,external_wp_i18n_namespaceObject.__)('Link to post'), onChange: () => setAttributes({ isLink: !isLink }), checked: isLink }) }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), isShownByDefault: true, hasValue: () => '_self' !== linkTarget, onDeselect: () => setAttributes({ linkTarget: '_self' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: value => setAttributes({ linkTarget: value ? '_blank' : '_self' }), checked: linkTarget === '_blank' }) }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), isShownByDefault: true, hasValue: () => !!rel, onDeselect: () => setAttributes({ rel: '' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), value: rel, onChange: newRel => setAttributes({ rel: newRel }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FeaturedImageResolutionTool, { image: media, value: sizeSlug, onChange: nextSizeSlug => setAttributes({ sizeSlug: nextSizeSlug }) })] }) })] }); let image; /** * A Post Featured Image block should not have image replacement * or upload options in the following cases: * - Is placed in a Query Loop. This is a conscious decision to * prevent content editing of different posts in Query Loop, and * this could change in the future. * - Is in a context where it does not have a postId (for example * in a template or template part). */ if (!featuredImage && (isDescendentOfQueryLoop || !postId)) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [controls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [!!isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: postPermalink, target: linkTarget, children: placeholder() }) : placeholder(), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(overlay, { attributes: attributes, setAttributes: setAttributes, clientId: clientId })] })] }); } const label = (0,external_wp_i18n_namespaceObject.__)('Add a featured image'); const imageStyles = { ...borderProps.style, ...shadowProps.style, height: aspectRatio ? '100%' : height, width: !!aspectRatio && '100%', objectFit: !!(height || aspectRatio) && scale }; /** * When the post featured image block is placed in a context where: * - It has a postId (for example in a single post) * - It is not inside a query loop * - It has no image assigned yet * Then display the placeholder with the image upload option. */ if (!featuredImage && !temporaryURL) { image = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { onSelect: onSelectImage, accept: "image/*", allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES, onError: onUploadError, placeholder: placeholder, mediaLibraryButton: ({ open }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, icon: library_upload, variant: "primary", label: label, showTooltip: true, tooltipPosition: "top center", onClick: e => { e.preventDefault(); open(); } }); } }); } else { // We have a Featured image so show a Placeholder if is loading. image = !media && !temporaryURL ? placeholder() : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: borderProps.className, src: temporaryURL || mediaUrl, alt: media && media?.alt_text ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The image's alt text. (0,external_wp_i18n_namespaceObject.__)('Featured image: %s'), media.alt_text) : (0,external_wp_i18n_namespaceObject.__)('Featured image'), style: imageStyles }), temporaryURL && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})] }); } /** * When the post featured image block: * - Has an image assigned * - Is not inside a query loop * Then display the image and the image replacement option. */ return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [!temporaryURL && controls, !!media && !isDescendentOfQueryLoop && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { mediaId: featuredImage, mediaURL: mediaUrl, allowedTypes: post_featured_image_edit_ALLOWED_MEDIA_TYPES, accept: "image/*", onSelect: onSelectImage, onError: onUploadError, onReset: () => setFeaturedImage(0) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...blockProps, children: [!!isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: postPermalink, target: linkTarget, children: image }) : image, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(overlay, { attributes: attributes, setAttributes: setAttributes, clientId: clientId })] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/post-featured-image/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_featured_image_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-featured-image", title: "Featured Image", category: "theme", description: "Display a post's featured image.", textdomain: "default", attributes: { isLink: { type: "boolean", "default": false, role: "content" }, aspectRatio: { type: "string" }, width: { type: "string" }, height: { type: "string" }, scale: { type: "string", "default": "cover" }, sizeSlug: { type: "string" }, rel: { type: "string", attribute: "rel", "default": "", role: "content" }, linkTarget: { type: "string", "default": "_self", role: "content" }, overlayColor: { type: "string" }, customOverlayColor: { type: "string" }, dimRatio: { type: "number", "default": 0 }, gradient: { type: "string" }, customGradient: { type: "string" }, useFirstImageFromPost: { type: "boolean", "default": false } }, usesContext: ["postId", "postType", "queryId"], example: { viewportWidth: 350 }, supports: { align: ["left", "right", "center", "wide", "full"], color: { text: false, background: false }, __experimentalBorder: { color: true, radius: true, width: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { color: true, radius: true, width: true } }, filter: { duotone: true }, shadow: { __experimentalSkipSerialization: true }, html: false, spacing: { margin: true, padding: true }, interactivity: { clientNavigation: true } }, selectors: { border: ".wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay", shadow: ".wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder", filter: { duotone: ".wp-block-post-featured-image img, .wp-block-post-featured-image .wp-block-post-featured-image__placeholder, .wp-block-post-featured-image .components-placeholder__illustration, .wp-block-post-featured-image .components-placeholder::before" } }, editorStyle: "wp-block-post-featured-image-editor", style: "wp-block-post-featured-image" }; const { name: post_featured_image_name } = post_featured_image_metadata; const post_featured_image_settings = { icon: post_featured_image, edit: PostFeaturedImageEdit }; const post_featured_image_init = () => initBlock({ name: post_featured_image_name, metadata: post_featured_image_metadata, settings: post_featured_image_settings }); ;// ./node_modules/@wordpress/block-library/build-module/post-navigation-link/edit.js /** * External dependencies */ /** * WordPress dependencies */ function PostNavigationLinkEdit({ context: { postType }, attributes: { type, label, showTitle, textAlign, linkLabel, arrow, taxonomy }, setAttributes }) { const isNext = type === 'next'; let placeholder = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next') : (0,external_wp_i18n_namespaceObject.__)('Previous'); const arrowMap = { none: '', arrow: isNext ? '→' : '←', chevron: isNext ? '»' : '«' }; const displayArrow = arrowMap[arrow]; if (showTitle) { placeholder = isNext ? /* translators: Label before for next and previous post. There is a space after the colon. */ (0,external_wp_i18n_namespaceObject.__)('Next: ') // eslint-disable-line @wordpress/i18n-no-flanking-whitespace : /* translators: Label before for next and previous post. There is a space after the colon. */ (0,external_wp_i18n_namespaceObject.__)('Previous: '); // eslint-disable-line @wordpress/i18n-no-flanking-whitespace } const ariaLabel = isNext ? (0,external_wp_i18n_namespaceObject.__)('Next post') : (0,external_wp_i18n_namespaceObject.__)('Previous post'); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getTaxonomies } = select(external_wp_coreData_namespaceObject.store); const filteredTaxonomies = getTaxonomies({ type: postType, per_page: -1 }); return filteredTaxonomies; }, [postType]); const getTaxonomyOptions = () => { const selectOption = { label: (0,external_wp_i18n_namespaceObject.__)('Unfiltered'), value: '' }; const taxonomyOptions = (taxonomies !== null && taxonomies !== void 0 ? taxonomies : []).filter(({ visibility }) => !!visibility?.publicly_queryable).map(item => { return { value: item.slug, label: item.name }; }); return [selectOption, ...taxonomyOptions]; }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display the title as a link'), help: (0,external_wp_i18n_namespaceObject.__)('If you have entered a custom label, it will be prepended before the title.'), checked: !!showTitle, onChange: () => setAttributes({ showTitle: !showTitle }) }), showTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Include the label as part of the link'), checked: !!linkLabel, onChange: () => setAttributes({ linkLabel: !linkLabel }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Arrow'), value: arrow, onChange: value => { setAttributes({ arrow: value }); }, help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow for the next and previous link.'), isBlock: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "none", label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Next/Previous link') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "arrow", label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Next/Previous link') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "chevron", label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Next/Previous link') })] })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Filter by taxonomy'), value: taxonomy, options: getTaxonomyOptions(), onChange: value => setAttributes({ taxonomy: value }), help: (0,external_wp_i18n_namespaceObject.__)('Only link to posts that have the same taxonomy terms as the current post. For example the same tags or categories.') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [!isNext && displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: `wp-block-post-navigation-link__arrow-previous is-arrow-${arrow}`, children: displayArrow }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "a", identifier: "label", "aria-label": ariaLabel, placeholder: placeholder, value: label, withoutInteractiveFormatting: true, onChange: newLabel => setAttributes({ label: newLabel }) }), showTitle && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#post-navigation-pseudo-link", onClick: event => event.preventDefault(), children: (0,external_wp_i18n_namespaceObject.__)('An example title') }), isNext && displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: `wp-block-post-navigation-link__arrow-next is-arrow-${arrow}`, "aria-hidden": true, children: displayArrow })] })] }); } ;// ./node_modules/@wordpress/icons/build-module/library/next.js /** * WordPress dependencies */ const next = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" }) }); /* harmony default export */ const library_next = (next); ;// ./node_modules/@wordpress/icons/build-module/library/previous.js /** * WordPress dependencies */ const previous = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" }) }); /* harmony default export */ const library_previous = (previous); ;// ./node_modules/@wordpress/block-library/build-module/post-navigation-link/variations.js /** * WordPress dependencies */ const post_navigation_link_variations_variations = [{ isDefault: true, name: 'post-next', title: (0,external_wp_i18n_namespaceObject.__)('Next Post'), description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that follows the current post.'), icon: library_next, attributes: { type: 'next' }, scope: ['inserter', 'transform'], example: { attributes: { label: (0,external_wp_i18n_namespaceObject.__)('Next post'), arrow: 'arrow' } } }, { name: 'post-previous', title: (0,external_wp_i18n_namespaceObject.__)('Previous Post'), description: (0,external_wp_i18n_namespaceObject.__)('Displays the post link that precedes the current post.'), icon: library_previous, attributes: { type: 'previous' }, scope: ['inserter', 'transform'], example: { attributes: { label: (0,external_wp_i18n_namespaceObject.__)('Previous post'), arrow: 'arrow' } } }]; /** * Add `isActive` function to all `post-navigation-link` variations, if not defined. * `isActive` function is used to find a variation match from a created * Block by providing its attributes. */ post_navigation_link_variations_variations.forEach(variation => { if (variation.isActive) { return; } variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type; }); /* harmony default export */ const post_navigation_link_variations = (post_navigation_link_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/post-navigation-link/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_navigation_link_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-navigation-link", title: "Post Navigation Link", category: "theme", description: "Displays the next or previous post link that is adjacent to the current post.", textdomain: "default", attributes: { textAlign: { type: "string" }, type: { type: "string", "default": "next" }, label: { type: "string" }, showTitle: { type: "boolean", "default": false }, linkLabel: { type: "boolean", "default": false }, arrow: { type: "string", "default": "none" }, taxonomy: { type: "string", "default": "" } }, usesContext: ["postType"], supports: { reusable: false, html: false, color: { link: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalWritingMode: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, style: "wp-block-post-navigation-link" }; const { name: post_navigation_link_name } = post_navigation_link_metadata; const post_navigation_link_settings = { edit: PostNavigationLinkEdit, variations: post_navigation_link_variations, example: { attributes: { label: (0,external_wp_i18n_namespaceObject.__)('Next post'), arrow: 'arrow' } } }; const post_navigation_link_init = () => initBlock({ name: post_navigation_link_name, metadata: post_navigation_link_metadata, settings: post_navigation_link_settings }); ;// ./node_modules/@wordpress/block-library/build-module/post-template/edit.js /** * External dependencies */ /** * WordPress dependencies */ const post_template_edit_TEMPLATE = [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]; function PostTemplateInnerBlocks({ classList }) { const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)({ className: dist_clsx('wp-block-post', classList) }, { template: post_template_edit_TEMPLATE, __unstableDisableLayoutClassNames: true }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { ...innerBlocksProps }); } function PostTemplateBlockPreview({ blocks, blockContextId, classList, isHidden, setActiveBlockContextId }) { const blockPreviewProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBlockPreview)({ blocks, props: { className: dist_clsx('wp-block-post', classList) } }); const handleOnClick = () => { setActiveBlockContextId(blockContextId); }; const style = { display: isHidden ? 'none' : undefined }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { ...blockPreviewProps, tabIndex: 0 // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role , role: "button", onClick: handleOnClick, onKeyPress: handleOnClick, style: style }); } const MemoizedPostTemplateBlockPreview = (0,external_wp_element_namespaceObject.memo)(PostTemplateBlockPreview); function PostTemplateEdit({ setAttributes, clientId, context: { query: { perPage, offset = 0, postType, order, orderBy, author, search, exclude, sticky, inherit, taxQuery, parents, pages, format, // We gather extra query args to pass to the REST API call. // This way extenders of Query Loop can add their own query args, // and have accurate previews in the editor. // Noting though that these args should either be supported by the // REST API or be handled by custom REST filters like `rest_{$this->post_type}_query`. ...restQueryArgs } = {}, templateSlug, previewPostType }, attributes: { layout }, __unstableLayoutClassNames }) { const { type: layoutType, columnCount = 3 } = layout || {}; const [activeBlockContextId, setActiveBlockContextId] = (0,external_wp_element_namespaceObject.useState)(); const { posts, blocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecords, getTaxonomies } = select(external_wp_coreData_namespaceObject.store); const { getBlocks } = select(external_wp_blockEditor_namespaceObject.store); const templateCategory = inherit && templateSlug?.startsWith('category-') && getEntityRecords('taxonomy', 'category', { context: 'view', per_page: 1, _fields: ['id'], slug: templateSlug.replace('category-', '') }); const templateTag = inherit && templateSlug?.startsWith('tag-') && getEntityRecords('taxonomy', 'post_tag', { context: 'view', per_page: 1, _fields: ['id'], slug: templateSlug.replace('tag-', '') }); const query = { offset: offset || 0, order, orderby: orderBy }; // There is no need to build the taxQuery if we inherit. if (taxQuery && !inherit) { const taxonomies = getTaxonomies({ type: postType, per_page: -1, context: 'view' }); // We have to build the tax query for the REST API and use as // keys the taxonomies `rest_base` with the `term ids` as values. const builtTaxQuery = Object.entries(taxQuery).reduce((accumulator, [taxonomySlug, terms]) => { const taxonomy = taxonomies?.find(({ slug }) => slug === taxonomySlug); if (taxonomy?.rest_base) { accumulator[taxonomy?.rest_base] = terms; } return accumulator; }, {}); if (!!Object.keys(builtTaxQuery).length) { Object.assign(query, builtTaxQuery); } } if (perPage) { query.per_page = perPage; } if (author) { query.author = author; } if (search) { query.search = search; } if (exclude?.length) { query.exclude = exclude; } if (parents?.length) { query.parent = parents; } if (format?.length) { query.format = format; } /* * Handle cases where sticky is set to `exclude` or `only`. * Which works as a `post__in/post__not_in` query for sticky posts. */ if (sticky && sticky !== 'ignore') { query.sticky = sticky === 'only'; } if (sticky === 'ignore') { // Remove any leftover sticky query parameter. delete query.sticky; query.ignore_sticky = true; } // If `inherit` is truthy, adjust conditionally the query to create a better preview. let currentPostType = postType; if (inherit) { // Change the post-type if needed. if (templateSlug?.startsWith('archive-')) { query.postType = templateSlug.replace('archive-', ''); currentPostType = query.postType; } else if (templateCategory) { query.categories = templateCategory[0]?.id; } else if (templateTag) { query.tags = templateTag[0]?.id; } else if (templateSlug?.startsWith('taxonomy-post_format')) { // Get the post format slug from the template slug by removing the prefix. query.format = templateSlug.replace('taxonomy-post_format-post-format-', ''); } } // When we preview Query Loop blocks we should prefer the current // block's postType, which is passed through block context. const usedPostType = previewPostType || currentPostType; return { posts: getEntityRecords('postType', usedPostType, { ...query, ...restQueryArgs }), blocks: getBlocks(clientId) }; }, [perPage, offset, order, orderBy, clientId, author, search, postType, exclude, sticky, inherit, templateSlug, taxQuery, parents, format, restQueryArgs, previewPostType]); const blockContexts = (0,external_wp_element_namespaceObject.useMemo)(() => posts?.map(post => { var _post$class_list; return { postType: post.type, postId: post.id, classList: (_post$class_list = post.class_list) !== null && _post$class_list !== void 0 ? _post$class_list : '' }; }), [posts]); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx(__unstableLayoutClassNames, { [`columns-${columnCount}`]: layoutType === 'grid' && columnCount // Ensure column count is flagged via classname for backwards compatibility. }) }); if (!posts) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }); } if (!posts.length) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { ...blockProps, children: [" ", (0,external_wp_i18n_namespaceObject.__)('No results found.')] }); } const setDisplayLayout = newDisplayLayout => setAttributes({ layout: { ...layout, ...newDisplayLayout } }); const displayLayoutControls = [{ icon: library_list, title: (0,external_wp_i18n_namespaceObject._x)('List view', 'Post template block display setting'), onClick: () => setDisplayLayout({ type: 'default' }), isActive: layoutType === 'default' || layoutType === 'constrained' }, { icon: library_grid, title: (0,external_wp_i18n_namespaceObject._x)('Grid view', 'Post template block display setting'), onClick: () => setDisplayLayout({ type: 'grid', columnCount }), isActive: layoutType === 'grid' }]; // To avoid flicker when switching active block contexts, a preview is rendered // for each block context, but the preview for the active block context is hidden. // This ensures that when it is displayed again, the cached rendering of the // block preview is used, instead of having to re-render the preview from scratch. return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { controls: displayLayoutControls }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { ...blockProps, children: blockContexts && blockContexts.map(blockContext => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { value: blockContext, children: [blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId) ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostTemplateInnerBlocks, { classList: blockContext.classList }) : null, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(MemoizedPostTemplateBlockPreview, { blocks: blocks, blockContextId: blockContext.postId, classList: blockContext.classList, setActiveBlockContextId: setActiveBlockContextId, isHidden: blockContext.postId === (activeBlockContextId || blockContexts[0]?.postId) })] }, blockContext.postId)) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/post-template/save.js /** * WordPress dependencies */ function PostTemplateSave() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } ;// ./node_modules/@wordpress/block-library/build-module/post-template/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_template_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-template", title: "Post Template", category: "theme", ancestor: ["core/query"], description: "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.", textdomain: "default", usesContext: ["queryId", "query", "displayLayout", "templateSlug", "previewPostType", "enhancedPagination", "postType"], supports: { reusable: false, html: false, align: ["wide", "full"], layout: true, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, spacing: { margin: true, padding: true, blockGap: { __experimentalDefault: "1.25em" }, __experimentalDefaultControls: { blockGap: true, padding: false, margin: false } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true } }, style: "wp-block-post-template", editorStyle: "wp-block-post-template-editor" }; const { name: post_template_name } = post_template_metadata; const post_template_settings = { icon: library_layout, edit: PostTemplateEdit, save: PostTemplateSave }; const post_template_init = () => initBlock({ name: post_template_name, metadata: post_template_metadata, settings: post_template_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/post-categories.js /** * WordPress dependencies */ const postCategories = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z", fillRule: "evenodd", clipRule: "evenodd" }) }); /* harmony default export */ const post_categories = (postCategories); ;// ./node_modules/@wordpress/block-library/build-module/post-terms/use-post-terms.js /** * WordPress dependencies */ const use_post_terms_EMPTY_ARRAY = []; function usePostTerms({ postId, term }) { const { slug } = term; return (0,external_wp_data_namespaceObject.useSelect)(select => { const visible = term?.visibility?.publicly_queryable; if (!visible) { return { postTerms: use_post_terms_EMPTY_ARRAY, isLoading: false, hasPostTerms: false }; } const { getEntityRecords, isResolving } = select(external_wp_coreData_namespaceObject.store); const taxonomyArgs = ['taxonomy', slug, { post: postId, per_page: -1, context: 'view' }]; const terms = getEntityRecords(...taxonomyArgs); return { postTerms: terms, isLoading: isResolving('getEntityRecords', taxonomyArgs), hasPostTerms: !!terms?.length }; }, [postId, term?.visibility?.publicly_queryable, slug]); } ;// ./node_modules/@wordpress/block-library/build-module/post-terms/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ // Allowed formats for the prefix and suffix fields. const ALLOWED_FORMATS = ['core/bold', 'core/image', 'core/italic', 'core/link', 'core/strikethrough', 'core/text-color']; function PostTermsEdit({ attributes, clientId, context, isSelected, setAttributes, insertBlocksAfter }) { const { term, textAlign, separator, prefix, suffix } = attributes; const { postId, postType } = context; const selectedTerm = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!term) { return {}; } const { getTaxonomy } = select(external_wp_coreData_namespaceObject.store); const taxonomy = getTaxonomy(term); return taxonomy?.visibility?.publicly_queryable ? taxonomy : {}; }, [term]); const { postTerms, hasPostTerms, isLoading } = usePostTerms({ postId, term: selectedTerm }); const hasPost = postId && postType; const blockInformation = (0,external_wp_blockEditor_namespaceObject.useBlockDisplayInformation)(clientId); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign, [`taxonomy-${term}`]: term }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, autoComplete: "off", label: (0,external_wp_i18n_namespaceObject.__)('Separator'), value: separator || '', onChange: nextValue => { setAttributes({ separator: nextValue }); }, help: (0,external_wp_i18n_namespaceObject.__)('Enter character(s) used to separate terms.') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [isLoading && hasPost && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !isLoading && (isSelected || prefix) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "prefix", allowedFormats: ALLOWED_FORMATS, className: "wp-block-post-terms__prefix", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Prefix'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Prefix') + ' ', value: prefix, onChange: value => setAttributes({ prefix: value }), tagName: "span" }), (!hasPost || !term) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: blockInformation.title }), hasPost && !isLoading && hasPostTerms && postTerms.map(postTerm => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: postTerm.link, onClick: event => event.preventDefault(), rel: "tag", children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(postTerm.name) }, postTerm.id)).reduce((prev, curr) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [prev, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "wp-block-post-terms__separator", children: separator || ' ' }), curr] })), hasPost && !isLoading && !hasPostTerms && (selectedTerm?.labels?.no_terms || (0,external_wp_i18n_namespaceObject.__)('Term items not found.')), !isLoading && (isSelected || suffix) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "suffix", allowedFormats: ALLOWED_FORMATS, className: "wp-block-post-terms__suffix", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Suffix'), placeholder: ' ' + (0,external_wp_i18n_namespaceObject.__)('Suffix'), value: suffix, onChange: value => setAttributes({ suffix: value }), tagName: "span", __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) })] })] }); } ;// ./node_modules/@wordpress/icons/build-module/library/post-terms.js /** * WordPress dependencies */ const postTerms = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z" }) }); /* harmony default export */ const post_terms = (postTerms); ;// ./node_modules/@wordpress/block-library/build-module/post-terms/hooks.js /** * WordPress dependencies */ const variationIconMap = { category: post_categories, post_tag: post_terms }; // We add `icons` to categories and tags. The remaining ones use // the block's default icon. function enhanceVariations(settings, name) { if (name !== 'core/post-terms') { return settings; } const variations = settings.variations.map(variation => { var _variationIconMap$var; return { ...variation, ...{ icon: (_variationIconMap$var = variationIconMap[variation.name]) !== null && _variationIconMap$var !== void 0 ? _variationIconMap$var : post_categories } }; }); return { ...settings, variations }; } ;// ./node_modules/@wordpress/block-library/build-module/post-terms/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_terms_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-terms", title: "Post Terms", category: "theme", description: "Post terms.", textdomain: "default", attributes: { term: { type: "string" }, textAlign: { type: "string" }, separator: { type: "string", "default": ", " }, prefix: { type: "string", "default": "" }, suffix: { type: "string", "default": "" } }, usesContext: ["postId", "postType"], example: { viewportWidth: 350 }, supports: { html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-post-terms" }; const { name: post_terms_name } = post_terms_metadata; const post_terms_settings = { icon: post_categories, edit: PostTermsEdit }; const post_terms_init = () => { (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceVariations); return initBlock({ name: post_terms_name, metadata: post_terms_metadata, settings: post_terms_settings }); }; ;// external ["wp","wordcount"] const external_wp_wordcount_namespaceObject = window["wp"]["wordcount"]; ;// ./node_modules/@wordpress/block-library/build-module/post-time-to-read/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Average reading rate - based on average taken from * https://irisreading.com/average-reading-speed-in-various-languages/ * (Characters/minute used for Chinese rather than words). */ const AVERAGE_READING_RATE = 189; function PostTimeToReadEdit({ attributes, setAttributes, context }) { const { textAlign } = attributes; const { postId, postType } = context; const [contentStructure] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'content', postId); const [blocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', postType, { id: postId }); const minutesToReadString = (0,external_wp_element_namespaceObject.useMemo)(() => { // Replicates the logic found in getEditedPostContent(). let content; if (contentStructure instanceof Function) { content = contentStructure({ blocks }); } else if (blocks) { // If we have parsed blocks already, they should be our source of truth. // Parsing applies block deprecations and legacy block conversions that // unparsed content will not have. content = (0,external_wp_blocks_namespaceObject.__unstableSerializeAndClean)(blocks); } else { content = contentStructure; } /* * translators: If your word count is based on single characters (e.g. East Asian characters), * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. * Do not translate into your own language. */ const wordCountType = (0,external_wp_i18n_namespaceObject._x)('words', 'Word count type. Do not translate!'); const minutesToRead = Math.max(1, Math.round((0,external_wp_wordcount_namespaceObject.count)(content || '', wordCountType) / AVERAGE_READING_RATE)); return (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: the number of minutes to read the post. */ (0,external_wp_i18n_namespaceObject._n)('%s minute', '%s minutes', minutesToRead), minutesToRead); }, [contentStructure, blocks]); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: minutesToReadString })] }); } /* harmony default export */ const post_time_to_read_edit = (PostTimeToReadEdit); ;// ./node_modules/@wordpress/block-library/build-module/post-time-to-read/icon.js /** * WordPress dependencies */ /* harmony default export */ const icon = (/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16.5c-4.1 0-7.5-3.4-7.5-7.5S7.9 4.5 12 4.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5zM12 7l-1 5c0 .3.2.6.4.8l4.2 2.8-2.7-4.1L12 7z" }) })); ;// ./node_modules/@wordpress/block-library/build-module/post-time-to-read/index.js /** * Internal dependencies */ const post_time_to_read_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: true, name: "core/post-time-to-read", title: "Time to Read", category: "theme", description: "Show minutes required to finish reading the post.", textdomain: "default", usesContext: ["postId", "postType"], attributes: { textAlign: { type: "string" } }, supports: { color: { gradients: true, __experimentalDefaultControls: { background: true, text: true } }, html: false, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true } } }; const { name: post_time_to_read_name } = post_time_to_read_metadata; const post_time_to_read_settings = { icon: icon, edit: post_time_to_read_edit, example: {} }; const post_time_to_read_init = () => initBlock({ name: post_time_to_read_name, metadata: post_time_to_read_metadata, settings: post_time_to_read_settings }); ;// ./node_modules/@wordpress/block-library/build-module/post-title/edit.js /** * External dependencies */ /** * WordPress dependencies */ function PostTitleEdit({ attributes: { level, levelOptions, textAlign, isLink, rel, linkTarget }, setAttributes, context: { postType, postId, queryId }, insertBlocksAfter }) { const TagName = level === 0 ? 'p' : `h${level}`; const isDescendentOfQueryLoop = Number.isFinite(queryId); const userCanEdit = (0,external_wp_data_namespaceObject.useSelect)(select => { /** * useCanEditEntity may trigger an OPTIONS request to the REST API * via the canUser resolver. However, when the Post Title is a * descendant of a Query Loop block, the title cannot be edited. In * order to avoid these unnecessary requests, we call the hook * without the proper data, resulting in returning early without * making them. */ if (isDescendentOfQueryLoop) { return false; } return select(external_wp_coreData_namespaceObject.store).canUser('update', { kind: 'postType', name: postType, id: postId }); }, [isDescendentOfQueryLoop, postType, postId]); const [rawTitle = '', setTitle, fullTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'title', postId); const [link] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', postType, 'link', postId); const onSplitAtEnd = () => { insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())); }; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); let titleElement = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: (0,external_wp_i18n_namespaceObject.__)('Title') }); if (postType && postId) { titleElement = userCanEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { tagName: TagName, placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'), value: rawTitle, onChange: setTitle, __experimentalVersion: 2, __unstableOnSplitAtEnd: onSplitAtEnd, ...blockProps }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, dangerouslySetInnerHTML: { __html: fullTitle?.rendered } }); } if (isLink && postType && postId) { titleElement = userCanEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { tagName: "a", href: link, target: linkTarget, rel: rel, placeholder: !rawTitle.length ? (0,external_wp_i18n_namespaceObject.__)('No title') : null, value: rawTitle, onChange: setTitle, __experimentalVersion: 2, __unstableOnSplitAtEnd: onSplitAtEnd }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: link, target: linkTarget, rel: rel, onClick: event => event.preventDefault(), dangerouslySetInnerHTML: { __html: fullTitle?.rendered } }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [blockEditingMode === 'default' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { value: level, options: levelOptions, onChange: newLevel => setAttributes({ level: newLevel }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Make title a link'), onChange: () => setAttributes({ isLink: !isLink }), checked: isLink }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: value => setAttributes({ linkTarget: value ? '_blank' : '_self' }), checked: linkTarget === '_blank' }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), value: rel, onChange: newRel => setAttributes({ rel: newRel }) })] })] }) })] }), titleElement] }); } ;// ./node_modules/@wordpress/block-library/build-module/post-title/deprecated.js /** * Internal dependencies */ const post_title_deprecated_v1 = { attributes: { textAlign: { type: 'string' }, level: { type: 'number', default: 2 }, isLink: { type: 'boolean', default: false }, rel: { type: 'string', attribute: 'rel', default: '' }, linkTarget: { type: 'string', default: '_self' } }, supports: { align: ['wide', 'full'], html: false, color: { gradients: true, link: true }, spacing: { margin: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true } }, save() { return null; }, migrate: migrate_font_family, isEligible({ style }) { return style?.typography?.fontFamily; } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const post_title_deprecated = ([post_title_deprecated_v1]); ;// ./node_modules/@wordpress/block-library/build-module/post-title/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const post_title_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/post-title", title: "Title", category: "theme", description: "Displays the title of a post, page, or any other content-type.", textdomain: "default", usesContext: ["postId", "postType", "queryId"], attributes: { textAlign: { type: "string" }, level: { type: "number", "default": 2 }, levelOptions: { type: "array" }, isLink: { type: "boolean", "default": false, role: "content" }, rel: { type: "string", attribute: "rel", "default": "", role: "content" }, linkTarget: { type: "string", "default": "_self", role: "content" } }, example: { viewportWidth: 350 }, supports: { align: ["wide", "full"], html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-post-title" }; const { name: post_title_name } = post_title_metadata; const post_title_settings = { icon: library_title, edit: PostTitleEdit, deprecated: post_title_deprecated }; const post_title_init = () => initBlock({ name: post_title_name, metadata: post_title_metadata, settings: post_title_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/preformatted.js /** * WordPress dependencies */ const preformatted = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z" }) }); /* harmony default export */ const library_preformatted = (preformatted); ;// ./node_modules/@wordpress/block-library/build-module/preformatted/edit.js /** * WordPress dependencies */ function PreformattedEdit({ attributes, mergeBlocks, setAttributes, onRemove, insertBlocksAfter, style }) { const { content } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ style }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "pre", identifier: "content", preserveWhiteSpace: true, value: content, onChange: nextContent => { setAttributes({ content: nextContent }); }, onRemove: onRemove, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Preformatted text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Write preformatted text…'), onMerge: mergeBlocks, ...blockProps, __unstablePastePlainText: true, __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) }); } ;// ./node_modules/@wordpress/block-library/build-module/preformatted/save.js /** * WordPress dependencies */ function preformatted_save_save({ attributes }) { const { content } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: content }) }); } ;// ./node_modules/@wordpress/block-library/build-module/preformatted/transforms.js /** * WordPress dependencies */ const preformatted_transforms_transforms = { from: [{ type: 'block', blocks: ['core/code', 'core/paragraph'], transform: ({ content, anchor }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/preformatted', { content, anchor }) }, { type: 'raw', isMatch: node => node.nodeName === 'PRE' && !(node.children.length === 1 && node.firstChild.nodeName === 'CODE'), schema: ({ phrasingContentSchema }) => ({ pre: { children: phrasingContentSchema } }) }], to: [{ type: 'block', blocks: ['core/paragraph'], transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes) }, { type: 'block', blocks: ['core/code'], transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/code', attributes) }] }; /* harmony default export */ const preformatted_transforms = (preformatted_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/preformatted/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const preformatted_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/preformatted", title: "Preformatted", category: "text", description: "Add text that respects your spacing and tabs, and also allows styling.", textdomain: "default", attributes: { content: { type: "rich-text", source: "rich-text", selector: "pre", __unstablePreserveWhiteSpace: true, role: "content" } }, supports: { anchor: true, color: { gradients: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { padding: true, margin: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-preformatted" }; const { name: preformatted_name } = preformatted_metadata; const preformatted_settings = { icon: library_preformatted, example: { attributes: { /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ // translators: Sample content for the Preformatted block. Can be replaced with a more locale-adequate work. content: (0,external_wp_i18n_namespaceObject.__)('EXT. XANADU - FAINT DAWN - 1940 (MINIATURE)\nWindow, very small in the distance, illuminated.\nAll around this is an almost totally black screen. Now, as the camera moves slowly towards the window which is almost a postage stamp in the frame, other forms appear;') /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ } }, transforms: preformatted_transforms, edit: PreformattedEdit, save: preformatted_save_save, merge(attributes, attributesToMerge) { return { content: attributes.content + '\n\n' + attributesToMerge.content }; } }; const preformatted_init = () => initBlock({ name: preformatted_name, metadata: preformatted_metadata, settings: preformatted_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/pullquote.js /** * WordPress dependencies */ const pullquote = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18 8H6c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2zm.5 6c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-4c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v4zM4 4v1.5h16V4H4zm0 16h16v-1.5H4V20z" }) }); /* harmony default export */ const library_pullquote = (pullquote); ;// ./node_modules/@wordpress/block-library/build-module/pullquote/shared.js const SOLID_COLOR_CLASS = `is-style-solid-color`; ;// ./node_modules/@wordpress/block-library/build-module/pullquote/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const pullquote_deprecated_blockAttributes = { value: { type: 'string', source: 'html', selector: 'blockquote', multiline: 'p' }, citation: { type: 'string', source: 'html', selector: 'cite', default: '' }, mainColor: { type: 'string' }, customMainColor: { type: 'string' }, textColor: { type: 'string' }, customTextColor: { type: 'string' } }; function parseBorderColor(styleString) { if (!styleString) { return; } const matches = styleString.match(/border-color:([^;]+)[;]?/); if (matches && matches[1]) { return matches[1]; } } function multilineToInline(value) { value = value || `<p></p>`; const padded = `</p>${value}<p>`; const values = padded.split(`</p><p>`); values.shift(); values.pop(); return values.join('<br>'); } const pullquote_deprecated_v5 = { attributes: { value: { type: 'string', source: 'html', selector: 'blockquote', multiline: 'p', role: 'content' }, citation: { type: 'string', source: 'html', selector: 'cite', default: '', role: 'content' }, textAlign: { type: 'string' } }, save({ attributes }) { const { textAlign, citation, value } = attributes; const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: value, multiline: true }), shouldShowCitation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "cite", value: citation })] }) }); }, migrate({ value, ...attributes }) { return { value: multilineToInline(value), ...attributes }; } }; // TODO: this is ripe for a bit of a clean up according to the example in https://developer.wordpress.org/block-editor/reference-guides/block-api/block-deprecation/#example const pullquote_deprecated_v4 = { attributes: { ...pullquote_deprecated_blockAttributes }, save({ attributes }) { const { mainColor, customMainColor, customTextColor, textColor, value, citation, className } = attributes; const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); let figureClasses, figureStyles; // Is solid color style if (isSolidColorStyle) { const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor); figureClasses = dist_clsx({ 'has-background': backgroundClass || customMainColor, [backgroundClass]: backgroundClass }); figureStyles = { backgroundColor: backgroundClass ? undefined : customMainColor }; // Is normal style and a custom color is being used ( we can set a style directly with its value) } else if (customMainColor) { figureStyles = { borderColor: customMainColor }; } const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const blockquoteClasses = dist_clsx({ 'has-text-color': textColor || customTextColor, [blockquoteTextColorClass]: blockquoteTextColorClass }); const blockquoteStyles = blockquoteTextColorClass ? undefined : { color: customTextColor }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: figureClasses, style: figureStyles }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { className: blockquoteClasses, style: blockquoteStyles, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: value, multiline: true }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "cite", value: citation })] }) }); }, migrate({ value, className, mainColor, customMainColor, customTextColor, ...attributes }) { const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); let style; if (customMainColor) { if (!isSolidColorStyle) { // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute. style = { border: { color: customMainColor } }; } else { // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute. style = { color: { background: customMainColor } }; } } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute. if (customTextColor && style) { style.color = { ...style.color, text: customTextColor }; } return { value: multilineToInline(value), className, backgroundColor: isSolidColorStyle ? mainColor : undefined, borderColor: isSolidColorStyle ? undefined : mainColor, textAlign: isSolidColorStyle ? 'left' : undefined, style, ...attributes }; } }; const pullquote_deprecated_v3 = { attributes: { ...pullquote_deprecated_blockAttributes, // figureStyle is an attribute that never existed. // We are using it as a way to access the styles previously applied to the figure. figureStyle: { source: 'attribute', selector: 'figure', attribute: 'style' } }, save({ attributes }) { const { mainColor, customMainColor, textColor, customTextColor, value, citation, className, figureStyle } = attributes; const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); let figureClasses, figureStyles; // Is solid color style if (isSolidColorStyle) { const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor); figureClasses = dist_clsx({ 'has-background': backgroundClass || customMainColor, [backgroundClass]: backgroundClass }); figureStyles = { backgroundColor: backgroundClass ? undefined : customMainColor }; // Is normal style and a custom color is being used ( we can set a style directly with its value) } else if (customMainColor) { figureStyles = { borderColor: customMainColor }; // If normal style and a named color are being used, we need to retrieve the color value to set the style, // as there is no expectation that themes create classes that set border colors. } else if (mainColor) { // Previously here we queried the color settings to know the color value // of a named color. This made the save function impure and the block was refactored, // because meanwhile a change in the editor made it impossible to query color settings in the save function. // Here instead of querying the color settings to know the color value, we retrieve the value // directly from the style previously serialized. const borderColor = parseBorderColor(figureStyle); figureStyles = { borderColor }; } const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const blockquoteClasses = (textColor || customTextColor) && dist_clsx('has-text-color', { [blockquoteTextColorClass]: blockquoteTextColorClass }); const blockquoteStyles = blockquoteTextColorClass ? undefined : { color: customTextColor }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: figureClasses, style: figureStyles, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { className: blockquoteClasses, style: blockquoteStyles, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: value, multiline: true }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "cite", value: citation })] }) }); }, migrate({ value, className, figureStyle, mainColor, customMainColor, customTextColor, ...attributes }) { const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); let style; if (customMainColor) { if (!isSolidColorStyle) { // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute. style = { border: { color: customMainColor } }; } else { // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute. style = { color: { background: customMainColor } }; } } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute. if (customTextColor && style) { style.color = { ...style.color, text: customTextColor }; } // If is the default style, and a main color is set, // migrate the main color value into a custom border color. // The custom border color value is retrieved by parsing the figure styles. if (!isSolidColorStyle && mainColor && figureStyle) { const borderColor = parseBorderColor(figureStyle); if (borderColor) { return { value: multilineToInline(value), ...attributes, className, // Block supports: Set style.border.color if a deprecated block has `mainColor`, inline border CSS and is not a solid color style. style: { border: { color: borderColor } } }; } } return { value: multilineToInline(value), className, backgroundColor: isSolidColorStyle ? mainColor : undefined, borderColor: isSolidColorStyle ? undefined : mainColor, textAlign: isSolidColorStyle ? 'left' : undefined, style, ...attributes }; } }; const pullquote_deprecated_v2 = { attributes: pullquote_deprecated_blockAttributes, save({ attributes }) { const { mainColor, customMainColor, textColor, customTextColor, value, citation, className } = attributes; const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); let figureClass, figureStyles; // Is solid color style if (isSolidColorStyle) { figureClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', mainColor); if (!figureClass) { figureStyles = { backgroundColor: customMainColor }; } // Is normal style and a custom color is being used ( we can set a style directly with its value) } else if (customMainColor) { figureStyles = { borderColor: customMainColor }; // Is normal style and a named color is being used, we need to retrieve the color value to set the style, // as there is no expectation that themes create classes that set border colors. } else if (mainColor) { var _select$getSettings$c; const colors = (_select$getSettings$c = (0,external_wp_data_namespaceObject.select)(external_wp_blockEditor_namespaceObject.store).getSettings().colors) !== null && _select$getSettings$c !== void 0 ? _select$getSettings$c : []; const colorObject = (0,external_wp_blockEditor_namespaceObject.getColorObjectByAttributeValues)(colors, mainColor); figureStyles = { borderColor: colorObject.color }; } const blockquoteTextColorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', textColor); const blockquoteClasses = textColor || customTextColor ? dist_clsx('has-text-color', { [blockquoteTextColorClass]: blockquoteTextColorClass }) : undefined; const blockquoteStyle = blockquoteTextColorClass ? undefined : { color: customTextColor }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { className: figureClass, style: figureStyles, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { className: blockquoteClasses, style: blockquoteStyle, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: value, multiline: true }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "cite", value: citation })] }) }); }, migrate({ value, className, mainColor, customMainColor, customTextColor, ...attributes }) { const isSolidColorStyle = className?.includes(SOLID_COLOR_CLASS); let style = {}; if (customMainColor) { if (!isSolidColorStyle) { // Block supports: Set style.border.color if a deprecated block has a default style and a `customMainColor` attribute. style = { border: { color: customMainColor } }; } else { // Block supports: Set style.color.background if a deprecated block has a solid style and a `customMainColor` attribute. style = { color: { background: customMainColor } }; } } // Block supports: Set style.color.text if a deprecated block has a `customTextColor` attribute. if (customTextColor && style) { style.color = { ...style.color, text: customTextColor }; } return { value: multilineToInline(value), className, backgroundColor: isSolidColorStyle ? mainColor : undefined, borderColor: isSolidColorStyle ? undefined : mainColor, textAlign: isSolidColorStyle ? 'left' : undefined, style, ...attributes }; } }; const pullquote_deprecated_v1 = { attributes: { ...pullquote_deprecated_blockAttributes }, save({ attributes }) { const { value, citation } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: value, multiline: true }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "cite", value: citation })] }); }, migrate({ value, ...attributes }) { return { value: multilineToInline(value), ...attributes }; } }; const deprecated_v0 = { attributes: { ...pullquote_deprecated_blockAttributes, citation: { type: 'string', source: 'html', selector: 'footer' }, align: { type: 'string', default: 'none' } }, save({ attributes }) { const { value, citation, align } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { className: `align${align}`, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: value, multiline: true }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "footer", value: citation })] }); }, migrate({ value, ...attributes }) { return { value: multilineToInline(value), ...attributes }; } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const pullquote_deprecated = ([pullquote_deprecated_v5, pullquote_deprecated_v4, pullquote_deprecated_v3, pullquote_deprecated_v2, pullquote_deprecated_v1, deprecated_v0]); ;// ./node_modules/@wordpress/block-library/build-module/pullquote/figure.js const Figure = 'figure'; ;// ./node_modules/@wordpress/block-library/build-module/pullquote/blockquote.js const BlockQuote = 'blockquote'; ;// ./node_modules/@wordpress/block-library/build-module/pullquote/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web'; function PullQuoteEdit({ attributes, setAttributes, isSelected, insertBlocksAfter }) { const { textAlign, citation, value } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }); const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) || isSelected; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Figure, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(BlockQuote, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "value", tagName: "p", value: value, onChange: nextValue => setAttributes({ value: nextValue }), "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote text'), placeholder: // translators: placeholder text used for the quote (0,external_wp_i18n_namespaceObject.__)('Add quote'), textAlign: "center" }), shouldShowCitation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "citation", tagName: isWebPlatform ? 'cite' : undefined, style: { display: 'block' }, value: citation, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Pullquote citation text'), placeholder: // translators: placeholder text used for the citation (0,external_wp_i18n_namespaceObject.__)('Add citation'), onChange: nextCitation => setAttributes({ citation: nextCitation }), className: "wp-block-pullquote__citation", __unstableMobileNoFocusOnMount: true, textAlign: "center", __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) })] }) })] }); } /* harmony default export */ const pullquote_edit = (PullQuoteEdit); ;// ./node_modules/@wordpress/block-library/build-module/pullquote/save.js /** * External dependencies */ /** * WordPress dependencies */ function pullquote_save_save({ attributes }) { const { textAlign, citation, value } = attributes; const shouldShowCitation = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }) }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", value: value }), shouldShowCitation && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "cite", value: citation })] }) }); } ;// ./node_modules/@wordpress/block-library/build-module/pullquote/transforms.js /** * WordPress dependencies */ const pullquote_transforms_transforms = { from: [{ type: 'block', isMultiBlock: true, blocks: ['core/paragraph'], transform: attributes => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { value: (0,external_wp_richText_namespaceObject.toHTMLString)({ value: (0,external_wp_richText_namespaceObject.join)(attributes.map(({ content }) => (0,external_wp_richText_namespaceObject.create)({ html: content })), '\n') }), anchor: attributes.anchor }); } }, { type: 'block', blocks: ['core/heading'], transform: ({ content, anchor }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { value: content, anchor }); } }], to: [{ type: 'block', blocks: ['core/paragraph'], transform: ({ value, citation }) => { const paragraphs = []; if (value) { paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: value })); } if (citation) { paragraphs.push((0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: citation })); } if (paragraphs.length === 0) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: '' }); } return paragraphs; } }, { type: 'block', blocks: ['core/heading'], transform: ({ value, citation }) => { // If there is no pullquote content, use the citation as the // content of the resulting heading. A nonexistent citation // will result in an empty heading. if (!value) { return (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { content: citation }); } const headingBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { content: value }); if (!citation) { return headingBlock; } return [headingBlock, (0,external_wp_blocks_namespaceObject.createBlock)('core/heading', { content: citation })]; } }] }; /* harmony default export */ const pullquote_transforms = (pullquote_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/pullquote/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const pullquote_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/pullquote", title: "Pullquote", category: "text", description: "Give special visual emphasis to a quote from your text.", textdomain: "default", attributes: { value: { type: "rich-text", source: "rich-text", selector: "p", role: "content" }, citation: { type: "rich-text", source: "rich-text", selector: "cite", role: "content" }, textAlign: { type: "string" } }, supports: { anchor: true, align: ["left", "right", "wide", "full"], background: { backgroundImage: true, backgroundSize: true, __experimentalDefaultControls: { backgroundImage: true } }, color: { gradients: true, background: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, dimensions: { minHeight: true, __experimentalDefaultControls: { minHeight: false } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, __experimentalStyle: { typography: { fontSize: "1.5em", lineHeight: "1.6" } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-pullquote-editor", style: "wp-block-pullquote" }; const { name: pullquote_name } = pullquote_metadata; const pullquote_settings = { icon: library_pullquote, example: { attributes: { value: // translators: Quote serving as example for the Pullquote block. Attributed to Matt Mullenweg. (0,external_wp_i18n_namespaceObject.__)('One of the hardest things to do in technology is disrupt yourself.'), citation: (0,external_wp_i18n_namespaceObject.__)('Matt Mullenweg') } }, transforms: pullquote_transforms, edit: pullquote_edit, save: pullquote_save_save, deprecated: pullquote_deprecated }; const pullquote_init = () => initBlock({ name: pullquote_name, metadata: pullquote_metadata, settings: pullquote_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/loop.js /** * WordPress dependencies */ const loop = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z" }) }); /* harmony default export */ const library_loop = (loop); ;// ./node_modules/@wordpress/block-library/build-module/query/utils.js /** * WordPress dependencies */ /** @typedef {import('@wordpress/blocks').WPBlockVariation} WPBlockVariation */ /** @typedef {import('@wordpress/components/build-types/query-controls/types').OrderByOption} OrderByOption */ /** * @typedef IHasNameAndId * @property {string|number} id The entity's id. * @property {string} name The entity's name. */ /** * The object used in Query block that contains info and helper mappings * from an array of IHasNameAndId objects. * * @typedef {Object} QueryEntitiesInfo * @property {IHasNameAndId[]} entities The array of entities. * @property {Object<string, IHasNameAndId>} mapById Object mapping with the id as key and the entity as value. * @property {Object<string, IHasNameAndId>} mapByName Object mapping with the name as key and the entity as value. * @property {string[]} names Array with the entities' names. */ /** * Returns a helper object with mapping from Objects that implement * the `IHasNameAndId` interface. The returned object is used for * integration with `FormTokenField` component. * * @param {IHasNameAndId[]} entities The entities to extract of helper object. * @return {QueryEntitiesInfo} The object with the entities information. */ const getEntitiesInfo = entities => { const mapping = entities?.reduce((accumulator, entity) => { const { mapById, mapByName, names } = accumulator; mapById[entity.id] = entity; mapByName[entity.name] = entity; names.push(entity.name); return accumulator; }, { mapById: {}, mapByName: {}, names: [] }); return { entities, ...mapping }; }; /** * Helper util to return a value from a certain path of the object. * Path is specified as a string of properties, separated by dots, * for example: "parent.child". * * @param {Object} object Input object. * @param {string} path Path to the object property. * @return {*} Value of the object property at the specified path. */ const getValueFromObjectPath = (object, path) => { const normalizedPath = path.split('.'); let value = object; normalizedPath.forEach(fieldName => { value = value?.[fieldName]; }); return value; }; /** * Helper util to map records to add a `name` prop from a * provided path, in order to handle all entities in the same * fashion(implementing`IHasNameAndId` interface). * * @param {Object[]} entities The array of entities. * @param {string} path The path to map a `name` property from the entity. * @return {IHasNameAndId[]} An array of entities that now implement the `IHasNameAndId` interface. */ const mapToIHasNameAndId = (entities, path) => { return (entities || []).map(entity => ({ ...entity, name: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getValueFromObjectPath(entity, path)) })); }; /** * Returns a helper object that contains: * 1. An `options` object from the available post types, to be passed to a `SelectControl`. * 2. A helper map with available taxonomies per post type. * 3. A helper map with post format support per post type. * * @return {Object} The helper object related to post types. */ const usePostTypes = () => { const postTypes = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getPostTypes } = select(external_wp_coreData_namespaceObject.store); const excludedPostTypes = ['attachment']; const filteredPostTypes = getPostTypes({ per_page: -1 })?.filter(({ viewable, slug }) => viewable && !excludedPostTypes.includes(slug)); return filteredPostTypes; }, []); const postTypesTaxonomiesMap = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!postTypes?.length) { return; } return postTypes.reduce((accumulator, type) => { accumulator[type.slug] = type.taxonomies; return accumulator; }, {}); }, [postTypes]); const postTypesSelectOptions = (0,external_wp_element_namespaceObject.useMemo)(() => (postTypes || []).map(({ labels, slug }) => ({ label: labels.singular_name, value: slug })), [postTypes]); const postTypeFormatSupportMap = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!postTypes?.length) { return {}; } return postTypes.reduce((accumulator, type) => { accumulator[type.slug] = type.supports?.['post-formats'] || false; return accumulator; }, {}); }, [postTypes]); return { postTypesTaxonomiesMap, postTypesSelectOptions, postTypeFormatSupportMap }; }; /** * Hook that returns the taxonomies associated with a specific post type. * * @param {string} postType The post type from which to retrieve the associated taxonomies. * @return {Object[]} An array of the associated taxonomies. */ const useTaxonomies = postType => { const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getTaxonomies, getPostType } = select(external_wp_coreData_namespaceObject.store); // Does the post type have taxonomies? if (getPostType(postType)?.taxonomies?.length > 0) { return getTaxonomies({ type: postType, per_page: -1 }); } return []; }, [postType]); return (0,external_wp_element_namespaceObject.useMemo)(() => { return taxonomies?.filter(({ visibility }) => !!visibility?.publicly_queryable); }, [taxonomies]); }; /** * Hook that returns whether a specific post type is hierarchical. * * @param {string} postType The post type to check. * @return {boolean} Whether a specific post type is hierarchical. */ function useIsPostTypeHierarchical(postType) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const type = select(external_wp_coreData_namespaceObject.store).getPostType(postType); return type?.viewable && type?.hierarchical; }, [postType]); } /** * List of avaiable options to order by. * * @param {string} postType The post type to check. * @return {OrderByOption[]} List of order options. */ function useOrderByOptions(postType) { const supportsCustomOrder = (0,external_wp_data_namespaceObject.useSelect)(select => { const type = select(external_wp_coreData_namespaceObject.store).getPostType(postType); return !!type?.supports?.['page-attributes']; }, [postType]); return (0,external_wp_element_namespaceObject.useMemo)(() => { const orderByOptions = [{ label: (0,external_wp_i18n_namespaceObject.__)('Newest to oldest'), value: 'date/desc' }, { label: (0,external_wp_i18n_namespaceObject.__)('Oldest to newest'), value: 'date/asc' }, { /* translators: Label for ordering posts by title in ascending order. */ label: (0,external_wp_i18n_namespaceObject.__)('A → Z'), value: 'title/asc' }, { /* translators: Label for ordering posts by title in descending order. */ label: (0,external_wp_i18n_namespaceObject.__)('Z → A'), value: 'title/desc' }]; if (supportsCustomOrder) { orderByOptions.push({ /* translators: Label for ordering posts by ascending menu order. */ label: (0,external_wp_i18n_namespaceObject.__)('Ascending by order'), value: 'menu_order/asc' }, { /* translators: Label for ordering posts by descending menu order. */ label: (0,external_wp_i18n_namespaceObject.__)('Descending by order'), value: 'menu_order/desc' }); } return orderByOptions; }, [supportsCustomOrder]); } /** * Hook that returns the query properties' names defined by the active * block variation, to determine which block's filters to show. * * @param {Object} attributes Block attributes. * @return {string[]} An array of the query attributes. */ function useAllowedControls(attributes) { return (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getActiveBlockVariation('core/query', attributes)?.allowedControls, [attributes]); } function isControlAllowed(allowedControls, key) { // Every controls is allowed if the list is not defined. if (!allowedControls) { return true; } return allowedControls.includes(key); } /** * Clones a pattern's blocks and then recurses over that list of blocks, * transforming them to retain some `query` attribute properties. * For now we retain the `postType` and `inherit` properties as they are * fundamental for the expected functionality of the block and don't affect * its design and presentation. * * Returns the cloned/transformed blocks and array of existing Query Loop * client ids for further manipulation, in order to avoid multiple recursions. * * @param {WPBlock[]} blocks The list of blocks to look through and transform(mutate). * @param {Record<string,*>} queryBlockAttributes The existing Query Loop's attributes. * @return {{ newBlocks: WPBlock[], queryClientIds: string[] }} An object with the cloned/transformed blocks and all the Query Loop clients from these blocks. */ const getTransformedBlocksFromPattern = (blocks, queryBlockAttributes) => { const { query: { postType, inherit }, namespace } = queryBlockAttributes; const clonedBlocks = blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block)); const queryClientIds = []; const blocksQueue = [...clonedBlocks]; while (blocksQueue.length > 0) { const block = blocksQueue.shift(); if (block.name === 'core/query') { block.attributes.query = { ...block.attributes.query, postType, inherit }; if (namespace) { block.attributes.namespace = namespace; } queryClientIds.push(block.clientId); } block.innerBlocks?.forEach(innerBlock => { blocksQueue.push(innerBlock); }); } return { newBlocks: clonedBlocks, queryClientIds }; }; /** * Helper hook that determines if there is an active variation of the block * and if there are available specific patterns for this variation. * If there are, these patterns are going to be the only ones suggested to * the user in setup and replace flow, without including the default ones * for Query Loop. * * If there are no such patterns, the default ones for Query Loop are going * to be suggested. * * @param {string} clientId The block's client ID. * @param {Object} attributes The block's attributes. * @return {string} The block name to be used in the patterns suggestions. */ function useBlockNameForPatterns(clientId, attributes) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const activeVariationName = select(external_wp_blocks_namespaceObject.store).getActiveBlockVariation('core/query', attributes)?.name; if (!activeVariationName) { return 'core/query'; } const { getBlockRootClientId, getPatternsByBlockTypes } = select(external_wp_blockEditor_namespaceObject.store); const rootClientId = getBlockRootClientId(clientId); const activePatterns = getPatternsByBlockTypes(`core/query/${activeVariationName}`, rootClientId); return activePatterns.length > 0 ? `core/query/${activeVariationName}` : 'core/query'; }, [clientId, attributes]); } /** * Helper hook that determines if there is an active variation of the block * and if there are available specific scoped `block` variations connected with * this variation. * * If there are, these variations are going to be the only ones suggested * to the user in setup flow when clicking to `start blank`, without including * the default ones for Query Loop. * * If there are no such scoped `block` variations, the default ones for Query * Loop are going to be suggested. * * The way we determine such variations is with the convention that they have the `namespace` * attribute defined as an array. This array should contain the names(`name` property) of any * variations they want to be connected to. * For example, if we have a `Query Loop` scoped `inserter` variation with the name `products`, * we can connect a scoped `block` variation by setting its `namespace` attribute to `['products']`. * If the user selects this variation, the `namespace` attribute will be overridden by the * main `inserter` variation. * * @param {Object} attributes The block's attributes. * @return {WPBlockVariation[]} The block variations to be suggested in setup flow, when clicking to `start blank`. */ function useScopedBlockVariations(attributes) { const { activeVariationName, blockVariations } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getActiveBlockVariation, getBlockVariations } = select(external_wp_blocks_namespaceObject.store); return { activeVariationName: getActiveBlockVariation('core/query', attributes)?.name, blockVariations: getBlockVariations('core/query', 'block') }; }, [attributes]); const variations = (0,external_wp_element_namespaceObject.useMemo)(() => { // Filter out the variations that have defined a `namespace` attribute, // which means they are 'connected' to specific variations of the block. const isNotConnected = variation => !variation.attributes?.namespace; if (!activeVariationName) { return blockVariations.filter(isNotConnected); } const connectedVariations = blockVariations.filter(variation => variation.attributes?.namespace?.includes(activeVariationName)); if (!!connectedVariations.length) { return connectedVariations; } return blockVariations.filter(isNotConnected); }, [activeVariationName, blockVariations]); return variations; } /** * Hook that returns the block patterns for a specific block type. * * @param {string} clientId The block's client ID. * @param {string} name The block type name. * @return {Object[]} An array of valid block patterns. */ const usePatterns = (clientId, name) => { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId, getPatternsByBlockTypes } = select(external_wp_blockEditor_namespaceObject.store); const rootClientId = getBlockRootClientId(clientId); return getPatternsByBlockTypes(name, rootClientId); }, [name, clientId]); }; /** * The object returned by useUnsupportedBlocks with info about the type of * unsupported blocks present inside the Query block. * * @typedef {Object} UnsupportedBlocksInfo * @property {boolean} hasBlocksFromPlugins True if blocks from plugins are present. * @property {boolean} hasPostContentBlock True if a 'core/post-content' block is present. * @property {boolean} hasUnsupportedBlocks True if there are any unsupported blocks. */ /** * Hook that returns an object with information about the unsupported blocks * present inside a Query Loop with the given `clientId`. The returned object * contains props that are true when a certain type of unsupported block is * present. * * @param {string} clientId The block's client ID. * @return {UnsupportedBlocksInfo} The object containing the information. */ const useUnsupportedBlocks = clientId => { return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getClientIdsOfDescendants, getBlockName } = select(external_wp_blockEditor_namespaceObject.store); const blocks = {}; getClientIdsOfDescendants(clientId).forEach(descendantClientId => { const blockName = getBlockName(descendantClientId); /* * Client side navigation can be true in two states: * - supports.interactivity = true; * - supports.interactivity.clientNavigation = true; */ const blockSupportsInteractivity = Object.is((0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'interactivity'), true); const blockSupportsInteractivityClientNavigation = (0,external_wp_blocks_namespaceObject.getBlockSupport)(blockName, 'interactivity.clientNavigation'); const blockInteractivity = blockSupportsInteractivity || blockSupportsInteractivityClientNavigation; if (!blockInteractivity) { blocks.hasBlocksFromPlugins = true; } else if (blockName === 'core/post-content') { blocks.hasPostContentBlock = true; } }); blocks.hasUnsupportedBlocks = blocks.hasBlocksFromPlugins || blocks.hasPostContentBlock; return blocks; }, [clientId]); }; /** * Helper function that returns the query context from the editor based on the * available template slug. * * @param {string} templateSlug Current template slug based on context. * @return {Object} An object with isSingular and templateType properties. */ function getQueryContextFromTemplate(templateSlug) { // In the Post Editor, the template slug is not available. if (!templateSlug) { return { isSingular: true }; } let isSingular = false; let templateType = templateSlug === 'wp' ? 'custom' : templateSlug; const singularTemplates = ['404', 'blank', 'single', 'page', 'custom']; const templateTypeFromSlug = templateSlug.includes('-') ? templateSlug.split('-', 1)[0] : templateSlug; const queryFromTemplateSlug = templateSlug.includes('-') ? templateSlug.split('-').slice(1).join('-') : ''; if (queryFromTemplateSlug) { templateType = templateTypeFromSlug; } isSingular = singularTemplates.includes(templateType); return { isSingular, templateType }; } ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/enhanced-pagination-control.js /** * WordPress dependencies */ /** * Internal dependencies */ function EnhancedPaginationControl({ enhancedPagination, setAttributes, clientId }) { const { hasUnsupportedBlocks } = useUnsupportedBlocks(clientId); const fullPageClientSideNavigation = window.__experimentalFullPageClientSideNavigation; let help = (0,external_wp_i18n_namespaceObject.__)('Reload the full page—instead of just the posts list—when visitors navigate between pages.'); if (fullPageClientSideNavigation) { help = (0,external_wp_i18n_namespaceObject.__)('Experimental full-page client-side navigation setting enabled.'); } else if (hasUnsupportedBlocks) { help = (0,external_wp_i18n_namespaceObject.__)('Enhancement disabled because there are non-compatible blocks inside the Query block.'); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Reload full page'), help: help, checked: !enhancedPagination && !fullPageClientSideNavigation, disabled: hasUnsupportedBlocks || fullPageClientSideNavigation, onChange: value => { setAttributes({ enhancedPagination: !value }); } }) }); } ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/order-control.js /** * WordPress dependencies */ const defaultOrderByOptions = [{ label: (0,external_wp_i18n_namespaceObject.__)('Newest to oldest'), value: 'date/desc' }, { label: (0,external_wp_i18n_namespaceObject.__)('Oldest to newest'), value: 'date/asc' }, { /* translators: Label for ordering posts by title in ascending order. */ label: (0,external_wp_i18n_namespaceObject.__)('A → Z'), value: 'title/asc' }, { /* translators: Label for ordering posts by title in descending order. */ label: (0,external_wp_i18n_namespaceObject.__)('Z → A'), value: 'title/desc' }]; function OrderControl({ order, orderBy, orderByOptions = defaultOrderByOptions, onChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Order by'), value: `${orderBy}/${order}`, options: orderByOptions, onChange: value => { const [newOrderBy, newOrder] = value.split('/'); onChange({ order: newOrder, orderBy: newOrderBy }); } }); } /* harmony default export */ const order_control = (OrderControl); ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/author-control.js /** * WordPress dependencies */ /** * Internal dependencies */ const author_control_AUTHORS_QUERY = { who: 'authors', per_page: -1, _fields: 'id,name', context: 'view' }; function AuthorControl({ value, onChange }) { const authorsList = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getUsers } = select(external_wp_coreData_namespaceObject.store); return getUsers(author_control_AUTHORS_QUERY); }, []); if (!authorsList) { return null; } const authorsInfo = getEntitiesInfo(authorsList); /** * We need to normalize the value because the block operates on a * comma(`,`) separated string value and `FormTokenField` needs an * array. */ const normalizedValue = !value ? [] : value.toString().split(','); // Returns only the existing authors ids. This prevents the component // from crashing in the editor, when non existing ids are provided. const sanitizedValue = normalizedValue.reduce((accumulator, authorId) => { const author = authorsInfo.mapById[authorId]; if (author) { accumulator.push({ id: authorId, value: author.name }); } return accumulator; }, []); const getIdByValue = (entitiesMappedByName, authorValue) => { const id = authorValue?.id || entitiesMappedByName[authorValue]?.id; if (id) { return id; } }; const onAuthorChange = newValue => { const ids = Array.from(newValue.reduce((accumulator, author) => { // Verify that new values point to existing entities. const id = getIdByValue(authorsInfo.mapByName, author); if (id) { accumulator.add(id); } return accumulator; }, new Set())); onChange({ author: ids.join(',') }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, { label: (0,external_wp_i18n_namespaceObject.__)('Authors'), value: sanitizedValue, suggestions: authorsInfo.names, onChange: onAuthorChange, __experimentalShowHowTo: false, __nextHasNoMarginBottom: true, __next40pxDefaultSize: true }); } /* harmony default export */ const author_control = (AuthorControl); ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/parent-control.js /** * WordPress dependencies */ /** * Internal dependencies */ const parent_control_EMPTY_ARRAY = []; const BASE_QUERY = { order: 'asc', _fields: 'id,title', context: 'view' }; function ParentControl({ parents, postType, onChange }) { const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)(''); const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY); const [suggestions, setSuggestions] = (0,external_wp_element_namespaceObject.useState)(parent_control_EMPTY_ARRAY); const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 250); const { searchResults, searchHasResolved } = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!search) { return { searchResults: parent_control_EMPTY_ARRAY, searchHasResolved: true }; } const { getEntityRecords, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); const selectorArgs = ['postType', postType, { ...BASE_QUERY, search, orderby: 'relevance', exclude: parents, per_page: 20 }]; return { searchResults: getEntityRecords(...selectorArgs), searchHasResolved: hasFinishedResolution('getEntityRecords', selectorArgs) }; }, [search, parents]); const currentParents = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!parents?.length) { return parent_control_EMPTY_ARRAY; } const { getEntityRecords } = select(external_wp_coreData_namespaceObject.store); return getEntityRecords('postType', postType, { ...BASE_QUERY, include: parents, per_page: parents.length }); }, [parents]); // Update the `value` state only after the selectors are resolved // to avoid emptying the input when we're changing parents. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!parents?.length) { setValue(parent_control_EMPTY_ARRAY); } if (!currentParents?.length) { return; } const currentParentsInfo = getEntitiesInfo(mapToIHasNameAndId(currentParents, 'title.rendered')); // Returns only the existing entity ids. This prevents the component // from crashing in the editor, when non existing ids are provided. const sanitizedValue = parents.reduce((accumulator, id) => { const entity = currentParentsInfo.mapById[id]; if (entity) { accumulator.push({ id, value: entity.name }); } return accumulator; }, []); setValue(sanitizedValue); }, [parents, currentParents]); const entitiesInfo = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!searchResults?.length) { return parent_control_EMPTY_ARRAY; } return getEntitiesInfo(mapToIHasNameAndId(searchResults, 'title.rendered')); }, [searchResults]); // Update suggestions only when the query has resolved. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!searchHasResolved) { return; } setSuggestions(entitiesInfo.names); }, [entitiesInfo.names, searchHasResolved]); const getIdByValue = (entitiesMappedByName, entity) => { const id = entity?.id || entitiesMappedByName?.[entity]?.id; if (id) { return id; } }; const onParentChange = newValue => { const ids = Array.from(newValue.reduce((accumulator, entity) => { // Verify that new values point to existing entities. const id = getIdByValue(entitiesInfo.mapByName, entity); if (id) { accumulator.add(id); } return accumulator; }, new Set())); setSuggestions(parent_control_EMPTY_ARRAY); onChange({ parents: ids }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Parents'), value: value, onInputChange: debouncedSearch, suggestions: suggestions, onChange: onParentChange, __experimentalShowHowTo: false, __nextHasNoMarginBottom: true }); } /* harmony default export */ const parent_control = (ParentControl); ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/taxonomy-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ const taxonomy_controls_EMPTY_ARRAY = []; const taxonomy_controls_BASE_QUERY = { order: 'asc', _fields: 'id,name', context: 'view' }; // Helper function to get the term id based on user input in terms `FormTokenField`. const getTermIdByTermValue = (terms, termValue) => { // First we check for exact match by `term.id` or case sensitive `term.name` match. const termId = termValue?.id || terms?.find(term => term.name === termValue)?.id; if (termId) { return termId; } /** * Here we make an extra check for entered terms in a non case sensitive way, * to match user expectations, due to `FormTokenField` behaviour that shows * suggestions which are case insensitive. * * Although WP tries to discourage users to add terms with the same name (case insensitive), * it's still possible if you manually change the name, as long as the terms have different slugs. * In this edge case we always apply the first match from the terms list. */ const termValueLower = termValue.toLocaleLowerCase(); return terms?.find(term => term.name.toLocaleLowerCase() === termValueLower)?.id; }; function TaxonomyControls({ onChange, query }) { const { postType, taxQuery } = query; const taxonomies = useTaxonomies(postType); if (!taxonomies || taxonomies.length === 0) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: 4, children: taxonomies.map(taxonomy => { const termIds = taxQuery?.[taxonomy.slug] || []; const handleChange = newTermIds => onChange({ taxQuery: { ...taxQuery, [taxonomy.slug]: newTermIds } }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyItem, { taxonomy: taxonomy, termIds: termIds, onChange: handleChange }, taxonomy.slug); }) }); } /** * Renders a `FormTokenField` for a given taxonomy. * * @param {Object} props The props for the component. * @param {Object} props.taxonomy The taxonomy object. * @param {number[]} props.termIds An array with the block's term ids for the given taxonomy. * @param {Function} props.onChange Callback `onChange` function. * @return {JSX.Element} The rendered component. */ function TaxonomyItem({ taxonomy, termIds, onChange }) { const [search, setSearch] = (0,external_wp_element_namespaceObject.useState)(''); const [value, setValue] = (0,external_wp_element_namespaceObject.useState)(taxonomy_controls_EMPTY_ARRAY); const [suggestions, setSuggestions] = (0,external_wp_element_namespaceObject.useState)(taxonomy_controls_EMPTY_ARRAY); const debouncedSearch = (0,external_wp_compose_namespaceObject.useDebounce)(setSearch, 250); const { searchResults, searchHasResolved } = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!search) { return { searchResults: taxonomy_controls_EMPTY_ARRAY, searchHasResolved: true }; } const { getEntityRecords, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); const selectorArgs = ['taxonomy', taxonomy.slug, { ...taxonomy_controls_BASE_QUERY, search, orderby: 'name', exclude: termIds, per_page: 20 }]; return { searchResults: getEntityRecords(...selectorArgs), searchHasResolved: hasFinishedResolution('getEntityRecords', selectorArgs) }; }, [search, termIds]); // `existingTerms` are the ones fetched from the API and their type is `{ id: number; name: string }`. // They are used to extract the terms' names to populate the `FormTokenField` properly // and to sanitize the provided `termIds`, by setting only the ones that exist. const existingTerms = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!termIds?.length) { return taxonomy_controls_EMPTY_ARRAY; } const { getEntityRecords } = select(external_wp_coreData_namespaceObject.store); return getEntityRecords('taxonomy', taxonomy.slug, { ...taxonomy_controls_BASE_QUERY, include: termIds, per_page: termIds.length }); }, [termIds]); // Update the `value` state only after the selectors are resolved // to avoid emptying the input when we're changing terms. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!termIds?.length) { setValue(taxonomy_controls_EMPTY_ARRAY); } if (!existingTerms?.length) { return; } // Returns only the existing entity ids. This prevents the component // from crashing in the editor, when non existing ids are provided. const sanitizedValue = termIds.reduce((accumulator, id) => { const entity = existingTerms.find(term => term.id === id); if (entity) { accumulator.push({ id, value: entity.name }); } return accumulator; }, []); setValue(sanitizedValue); }, [termIds, existingTerms]); // Update suggestions only when the query has resolved. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!searchHasResolved) { return; } setSuggestions(searchResults.map(result => result.name)); }, [searchResults, searchHasResolved]); const onTermsChange = newTermValues => { const newTermIds = new Set(); for (const termValue of newTermValues) { const termId = getTermIdByTermValue(searchResults, termValue); if (termId) { newTermIds.add(termId); } } setSuggestions(taxonomy_controls_EMPTY_ARRAY); onChange(Array.from(newTermIds)); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-library-query-inspector__taxonomy-control", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, { label: taxonomy.name, value: value, onInputChange: debouncedSearch, suggestions: suggestions, displayTransform: external_wp_htmlEntities_namespaceObject.decodeEntities, onChange: onTermsChange, __experimentalShowHowTo: false, __nextHasNoMarginBottom: true, __next40pxDefaultSize: true }) }); } ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/format-controls.js /** * WordPress dependencies */ // All WP post formats, sorted alphabetically by translated name. // Value is the post format slug. Label is the name. const POST_FORMATS = [{ value: 'aside', label: (0,external_wp_i18n_namespaceObject.__)('Aside') }, { value: 'audio', label: (0,external_wp_i18n_namespaceObject.__)('Audio') }, { value: 'chat', label: (0,external_wp_i18n_namespaceObject.__)('Chat') }, { value: 'gallery', label: (0,external_wp_i18n_namespaceObject.__)('Gallery') }, { value: 'image', label: (0,external_wp_i18n_namespaceObject.__)('Image') }, { value: 'link', label: (0,external_wp_i18n_namespaceObject.__)('Link') }, { value: 'quote', label: (0,external_wp_i18n_namespaceObject.__)('Quote') }, { value: 'standard', label: (0,external_wp_i18n_namespaceObject.__)('Standard') }, { value: 'status', label: (0,external_wp_i18n_namespaceObject.__)('Status') }, { value: 'video', label: (0,external_wp_i18n_namespaceObject.__)('Video') }].sort((a, b) => { const normalizedA = a.label.toUpperCase(); const normalizedB = b.label.toUpperCase(); if (normalizedA < normalizedB) { return -1; } if (normalizedA > normalizedB) { return 1; } return 0; }); // A helper function to convert translatable post format names into their static values. function formatNamesToValues(names, formats) { return names.map(name => { return formats.find(item => item.label.toLocaleLowerCase() === name.toLocaleLowerCase())?.value; }).filter(Boolean); } function FormatControls({ onChange, query: { format } }) { // 'format' is expected to be an array. If it is not an array, for example // if a user has manually entered an invalid value in the block markup, // convert it to an array to prevent JavaScript errors. const normalizedFormats = Array.isArray(format) ? format : [format]; const { supportedFormats } = (0,external_wp_data_namespaceObject.useSelect)(select => { const themeSupports = select(external_wp_coreData_namespaceObject.store).getThemeSupports(); return { supportedFormats: themeSupports.formats }; }, []); const formats = POST_FORMATS.filter(item => supportedFormats.includes(item.value)); const values = normalizedFormats.map(name => formats.find(item => item.value === name)?.label).filter(Boolean); const suggestions = formats.filter(item => !normalizedFormats.includes(item.value)).map(item => item.label); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FormTokenField, { label: (0,external_wp_i18n_namespaceObject.__)('Formats'), value: values, suggestions: suggestions, onChange: newValues => { onChange({ format: formatNamesToValues(newValues, formats) }); }, __experimentalShowHowTo: false, __experimentalExpandOnFocus: true, __nextHasNoMarginBottom: true, __next40pxDefaultSize: true }); } ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/sticky-control.js /** * WordPress dependencies */ const stickyOptions = [{ label: (0,external_wp_i18n_namespaceObject.__)('Include'), value: '' }, { label: (0,external_wp_i18n_namespaceObject.__)('Ignore'), value: 'ignore' }, { label: (0,external_wp_i18n_namespaceObject.__)('Exclude'), value: 'exclude' }, { label: (0,external_wp_i18n_namespaceObject.__)('Only'), value: 'only' }]; function StickyControl({ value, onChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'), options: stickyOptions, value: value, onChange: onChange, help: (0,external_wp_i18n_namespaceObject.__)('Sticky posts always appear first, regardless of their publish date.') }); } ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/per-page-control.js /** * WordPress dependencies */ const MIN_POSTS_PER_PAGE = 1; const MAX_POSTS_PER_PAGE = 100; const PerPageControl = ({ perPage, offset = 0, onChange }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Items per page'), min: MIN_POSTS_PER_PAGE, max: MAX_POSTS_PER_PAGE, onChange: newPerPage => { if (isNaN(newPerPage) || newPerPage < MIN_POSTS_PER_PAGE || newPerPage > MAX_POSTS_PER_PAGE) { return; } onChange({ perPage: newPerPage, offset }); }, value: parseInt(perPage, 10) }); }; /* harmony default export */ const per_page_control = (PerPageControl); ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/offset-controls.js /** * WordPress dependencies */ const MIN_OFFSET = 0; const MAX_OFFSET = 100; const OffsetControl = ({ offset = 0, onChange }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Offset'), value: offset, min: MIN_OFFSET, onChange: newOffset => { if (isNaN(newOffset) || newOffset < MIN_OFFSET || newOffset > MAX_OFFSET) { return; } onChange({ offset: newOffset }); } }); }; /* harmony default export */ const offset_controls = (OffsetControl); ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/pages-control.js /** * WordPress dependencies */ const PagesControl = ({ pages, onChange }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalNumberControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Max pages to show'), value: pages, min: 0, onChange: newPages => { if (isNaN(newPages) || newPages < 0) { return; } onChange({ pages: newPages }); }, help: (0,external_wp_i18n_namespaceObject.__)('Limit the pages you want to show, even if the query has more results. To show all pages use 0 (zero).') }); }; /* harmony default export */ const pages_control = (PagesControl); ;// ./node_modules/@wordpress/block-library/build-module/query/edit/inspector-controls/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function QueryInspectorControls(props) { const { attributes, setQuery, setDisplayLayout, isSingular } = props; const { query, displayLayout } = attributes; const { order, orderBy, author: authorIds, pages, postType, perPage, offset, sticky, inherit, taxQuery, parents, format } = query; const allowedControls = useAllowedControls(attributes); const showSticky = postType === 'post'; const { postTypesTaxonomiesMap, postTypesSelectOptions, postTypeFormatSupportMap } = usePostTypes(); const taxonomies = useTaxonomies(postType); const isPostTypeHierarchical = useIsPostTypeHierarchical(postType); const onPostTypeChange = newValue => { const updateQuery = { postType: newValue }; // We need to dynamically update the `taxQuery` property, // by removing any not supported taxonomy from the query. const supportedTaxonomies = postTypesTaxonomiesMap[newValue]; const updatedTaxQuery = Object.entries(taxQuery || {}).reduce((accumulator, [taxonomySlug, terms]) => { if (supportedTaxonomies.includes(taxonomySlug)) { accumulator[taxonomySlug] = terms; } return accumulator; }, {}); updateQuery.taxQuery = !!Object.keys(updatedTaxQuery).length ? updatedTaxQuery : undefined; if (newValue !== 'post') { updateQuery.sticky = ''; } // We need to reset `parents` because they are tied to each post type. updateQuery.parents = []; // Post types can register post format support with `add_post_type_support`. // But we need to reset the `format` property when switching to post types // that do not support post formats. const hasFormatSupport = postTypeFormatSupportMap[newValue]; if (!hasFormatSupport) { updateQuery.format = []; } setQuery(updateQuery); }; const [querySearch, setQuerySearch] = (0,external_wp_element_namespaceObject.useState)(query.search); const onChangeDebounced = (0,external_wp_element_namespaceObject.useCallback)((0,external_wp_compose_namespaceObject.debounce)(() => { if (query.search !== querySearch) { setQuery({ search: querySearch }); } }, 250), [querySearch, query.search]); (0,external_wp_element_namespaceObject.useEffect)(() => { onChangeDebounced(); return onChangeDebounced.cancel; }, [querySearch, onChangeDebounced]); const orderByOptions = useOrderByOptions(postType); const showInheritControl = !isSingular && isControlAllowed(allowedControls, 'inherit'); const showPostTypeControl = !inherit && isControlAllowed(allowedControls, 'postType'); const postTypeControlLabel = (0,external_wp_i18n_namespaceObject.__)('Post type'); const postTypeControlHelp = (0,external_wp_i18n_namespaceObject.__)('Select the type of content to display: posts, pages, or custom post types.'); const showColumnsControl = false; const showOrderControl = !inherit && isControlAllowed(allowedControls, 'order'); const showStickyControl = !inherit && showSticky && isControlAllowed(allowedControls, 'sticky'); const showSettingsPanel = showInheritControl || showPostTypeControl || showColumnsControl || showOrderControl || showStickyControl; const showTaxControl = !!taxonomies?.length && isControlAllowed(allowedControls, 'taxQuery'); const showAuthorControl = isControlAllowed(allowedControls, 'author'); const showSearchControl = isControlAllowed(allowedControls, 'search'); const showParentControl = isControlAllowed(allowedControls, 'parents') && isPostTypeHierarchical; const postTypeHasFormatSupport = postTypeFormatSupportMap[postType]; const showFormatControl = (0,external_wp_data_namespaceObject.useSelect)(select => { // Check if the post type supports post formats and if the control is allowed. if (!postTypeHasFormatSupport || !isControlAllowed(allowedControls, 'format')) { return false; } const themeSupports = select(external_wp_coreData_namespaceObject.store).getThemeSupports(); // If there are no supported formats, getThemeSupports still includes the default 'standard' format, // and in this case the control should not be shown since the user has no other formats to choose from. return themeSupports.formats && themeSupports.formats.length > 0 && themeSupports.formats.some(type => type !== 'standard'); }, [allowedControls, postTypeHasFormatSupport]); const showFiltersPanel = showTaxControl || showAuthorControl || showSearchControl || showParentControl || showFormatControl; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const showPostCountControl = isControlAllowed(allowedControls, 'postCount'); const showOffSetControl = isControlAllowed(allowedControls, 'offset'); const showPagesControl = isControlAllowed(allowedControls, 'pages'); const showDisplayPanel = showPostCountControl || showOffSetControl || showPagesControl; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [showSettingsPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setQuery({ postType: 'post', order: 'desc', orderBy: 'date', sticky: '', inherit: true }); }, dropdownMenuProps: dropdownMenuProps, children: [showInheritControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !inherit, label: (0,external_wp_i18n_namespaceObject.__)('Query type'), onDeselect: () => setQuery({ inherit: true }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Query type'), isBlock: true, onChange: value => { setQuery({ inherit: value === 'default' }); }, help: inherit ? (0,external_wp_i18n_namespaceObject.__)('Display a list of posts or custom post types based on the current template.') : (0,external_wp_i18n_namespaceObject.__)('Display a list of posts or custom post types based on specific criteria.'), value: !!inherit ? 'default' : 'custom', children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "default", label: (0,external_wp_i18n_namespaceObject.__)('Default') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "custom", label: (0,external_wp_i18n_namespaceObject.__)('Custom') })] }) }), showPostTypeControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => postType !== 'post', label: postTypeControlLabel, onDeselect: () => onPostTypeChange('post'), isShownByDefault: true, children: postTypesSelectOptions.length > 2 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, options: postTypesSelectOptions, value: postType, label: postTypeControlLabel, onChange: onPostTypeChange, help: postTypeControlHelp }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, isBlock: true, value: postType, label: postTypeControlLabel, onChange: onPostTypeChange, help: postTypeControlHelp, children: postTypesSelectOptions.map(option => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: option.value, label: option.label }, option.value)) }) }), showColumnsControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => displayLayout?.columns !== 2, label: (0,external_wp_i18n_namespaceObject.__)('Columns'), onDeselect: () => setDisplayLayout({ columns: 2 }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Columns'), value: displayLayout.columns, onChange: value => setDisplayLayout({ columns: value }), min: 2, max: Math.max(6, displayLayout.columns) }), displayLayout.columns > 6 && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Notice, { status: "warning", isDismissible: false, children: (0,external_wp_i18n_namespaceObject.__)('This column count exceeds the recommended amount and may cause visual breakage.') })] }) }), showOrderControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => order !== 'desc' || orderBy !== 'date', label: (0,external_wp_i18n_namespaceObject.__)('Order by'), onDeselect: () => setQuery({ order: 'desc', orderBy: 'date' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(order_control, { order, orderBy, orderByOptions, onChange: setQuery }) }), showStickyControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!sticky, label: (0,external_wp_i18n_namespaceObject.__)('Sticky posts'), onDeselect: () => setQuery({ sticky: '' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(StickyControl, { value: sticky, onChange: value => setQuery({ sticky: value }) }) })] }), !inherit && showDisplayPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { className: "block-library-query-toolspanel__display", label: (0,external_wp_i18n_namespaceObject.__)('Display'), resetAll: () => { setQuery({ offset: 0, pages: 0 }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Items per page'), hasValue: () => perPage > 0, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(per_page_control, { perPage: perPage, offset: offset, onChange: setQuery }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Offset'), hasValue: () => offset > 0, onDeselect: () => setQuery({ offset: 0 }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(offset_controls, { offset: offset, onChange: setQuery }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Max pages to show'), hasValue: () => pages > 0, onDeselect: () => setQuery({ pages: 0 }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(pages_control, { pages: pages, onChange: setQuery }) })] }), !inherit && showFiltersPanel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { className: "block-library-query-toolspanel__filters" // unused but kept for backward compatibility , label: (0,external_wp_i18n_namespaceObject.__)('Filters'), resetAll: () => { setQuery({ author: '', parents: [], search: '', taxQuery: null, format: [] }); setQuerySearch(''); }, dropdownMenuProps: dropdownMenuProps, children: [showTaxControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Taxonomies'), hasValue: () => Object.values(taxQuery || {}).some(terms => !!terms.length), onDeselect: () => setQuery({ taxQuery: null }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TaxonomyControls, { onChange: setQuery, query: query }) }), showAuthorControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!authorIds, label: (0,external_wp_i18n_namespaceObject.__)('Authors'), onDeselect: () => setQuery({ author: '' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(author_control, { value: authorIds, onChange: setQuery }) }), showSearchControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!querySearch, label: (0,external_wp_i18n_namespaceObject.__)('Keyword'), onDeselect: () => setQuerySearch(''), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Keyword'), value: querySearch, onChange: setQuerySearch }) }), showParentControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!parents?.length, label: (0,external_wp_i18n_namespaceObject.__)('Parents'), onDeselect: () => setQuery({ parents: [] }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(parent_control, { parents: parents, postType: postType, onChange: setQuery }) }), showFormatControl && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!format?.length, label: (0,external_wp_i18n_namespaceObject.__)('Formats'), onDeselect: () => setQuery({ format: [] }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(FormatControls, { onChange: setQuery, query: query }) })] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/query/edit/enhanced-pagination-modal.js /** * WordPress dependencies */ /** * Internal dependencies */ const modalDescriptionId = 'wp-block-query-enhanced-pagination-modal__description'; function EnhancedPaginationModal({ clientId, attributes: { enhancedPagination }, setAttributes }) { const [isOpen, setOpen] = (0,external_wp_element_namespaceObject.useState)(false); const { hasBlocksFromPlugins, hasPostContentBlock, hasUnsupportedBlocks } = useUnsupportedBlocks(clientId); (0,external_wp_element_namespaceObject.useEffect)(() => { if (enhancedPagination && hasUnsupportedBlocks && !window.__experimentalFullPageClientSideNavigation) { setAttributes({ enhancedPagination: false }); setOpen(true); } }, [enhancedPagination, hasUnsupportedBlocks, setAttributes]); const closeModal = () => { setOpen(false); }; let notice = (0,external_wp_i18n_namespaceObject.__)('If you still want to prevent full page reloads, remove that block, then disable "Reload full page" again in the Query Block settings.'); if (hasBlocksFromPlugins) { notice = (0,external_wp_i18n_namespaceObject.__)('Currently, avoiding full page reloads is not possible when non-interactive or non-client Navigation compatible blocks from plugins are present inside the Query block.') + ' ' + notice; } else if (hasPostContentBlock) { notice = (0,external_wp_i18n_namespaceObject.__)('Currently, avoiding full page reloads is not possible when a Content block is present inside the Query block.') + ' ' + notice; } return isOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.__)('Query block: Reload full page enabled'), className: "wp-block-query__enhanced-pagination-modal", aria: { describedby: modalDescriptionId }, role: "alertdialog", focusOnMount: "firstElement", isDismissible: false, onRequestClose: closeModal, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { alignment: "right", spacing: 5, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { id: modalDescriptionId, children: notice }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", onClick: closeModal, children: (0,external_wp_i18n_namespaceObject.__)('OK') })] }) }); } ;// ./node_modules/@wordpress/block-library/build-module/utils/search-patterns.js /** * External dependencies */ /** * Sanitizes the search input string. * * @param {string} input The search input to normalize. * * @return {string} The normalized search input. */ function normalizeSearchInput(input = '') { // Disregard diacritics. input = remove_accents_default()(input); // Trim & Lowercase. input = input.trim().toLowerCase(); return input; } /** * Get the search rank for a given pattern and a specific search term. * * @param {Object} pattern Pattern to rank * @param {string} searchValue Search term * @return {number} A pattern search rank */ function getPatternSearchRank(pattern, searchValue) { const normalizedSearchValue = normalizeSearchInput(searchValue); const normalizedTitle = normalizeSearchInput(pattern.title); let rank = 0; if (normalizedSearchValue === normalizedTitle) { rank += 30; } else if (normalizedTitle.startsWith(normalizedSearchValue)) { rank += 20; } else { const searchTerms = normalizedSearchValue.split(' '); const hasMatchedTerms = searchTerms.every(searchTerm => normalizedTitle.includes(searchTerm)); // Prefer pattern with every search word in the title. if (hasMatchedTerms) { rank += 10; } } return rank; } /** * Filters an pattern list given a search term. * * @param {Array} patterns Item list * @param {string} searchValue Search input. * * @return {Array} Filtered pattern list. */ function searchPatterns(patterns = [], searchValue = '') { if (!searchValue) { return patterns; } const rankedPatterns = patterns.map(pattern => { return [pattern, getPatternSearchRank(pattern, searchValue)]; }).filter(([, rank]) => rank > 0); rankedPatterns.sort(([, rank1], [, rank2]) => rank2 - rank1); return rankedPatterns.map(([pattern]) => pattern); } ;// ./node_modules/@wordpress/block-library/build-module/query/edit/pattern-selection.js /** * WordPress dependencies */ /** * Internal dependencies */ function PatternSelectionModal({ clientId, attributes, setIsPatternSelectionModalOpen }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { overlayClassName: "block-library-query-pattern__selection-modal", title: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern'), onRequestClose: () => setIsPatternSelectionModalOpen(false), isFullScreen: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelection, { clientId: clientId, attributes: attributes }) }); } function useBlockPatterns(clientId, attributes) { const blockNameForPatterns = useBlockNameForPatterns(clientId, attributes); return usePatterns(clientId, blockNameForPatterns); } function PatternSelection({ clientId, attributes, showTitlesAsTooltip = false, showSearch = true }) { const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)(''); const { replaceBlock, selectBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const blockPatterns = useBlockPatterns(clientId, attributes); /* * When we preview Query Loop blocks we should prefer the current * block's postType, which is passed through block context. */ const blockPreviewContext = (0,external_wp_element_namespaceObject.useMemo)(() => ({ previewPostType: attributes.query.postType }), [attributes.query.postType]); const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { return searchPatterns(blockPatterns, searchValue); }, [blockPatterns, searchValue]); const onBlockPatternSelect = (pattern, blocks) => { const { newBlocks, queryClientIds } = getTransformedBlocksFromPattern(blocks, attributes); replaceBlock(clientId, newBlocks); if (queryClientIds[0]) { selectBlock(queryClientIds[0]); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-library-query-pattern__selection-content", children: [showSearch && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-library-query-pattern__selection-search", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { __nextHasNoMarginBottom: true, onChange: setSearchValue, value: searchValue, label: (0,external_wp_i18n_namespaceObject.__)('Search'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockContextProvider, { value: blockPreviewContext, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { blockPatterns: filteredBlockPatterns, onClickPattern: onBlockPatternSelect, showTitlesAsTooltip: showTitlesAsTooltip }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/query/edit/query-toolbar.js /** * WordPress dependencies */ /** * Internal dependencies */ function QueryToolbar({ clientId, attributes }) { const hasPatterns = useBlockPatterns(clientId, attributes).length; if (!hasPatterns) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { className: "wp-block-template-part__block-control-group", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalDropdownContentWrapper, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { contentClassName: "block-editor-block-settings-menu__popover", focusOnMount: "firstElement", expandOnMobile: true, renderToggle: ({ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { "aria-haspopup": "true", "aria-expanded": isOpen, onClick: onToggle, children: (0,external_wp_i18n_namespaceObject.__)('Change design') }), renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelection, { clientId: clientId, attributes: attributes, showSearch: false, showTitlesAsTooltip: true }) }) }) }); } ;// ./node_modules/@wordpress/block-library/build-module/query/edit/query-content.js /** * WordPress dependencies */ /** * Internal dependencies */ const DEFAULTS_POSTS_PER_PAGE = 3; const query_content_TEMPLATE = [['core/post-template']]; function QueryContent({ attributes, setAttributes, clientId, context, name }) { const { queryId, query, displayLayout, enhancedPagination, tagName: TagName = 'div', query: { inherit } = {} } = attributes; const { templateSlug } = context; const { isSingular } = getQueryContextFromTemplate(templateSlug); const { __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(QueryContent); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: query_content_TEMPLATE }); const { postsPerPage } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); const { getEntityRecord, getEntityRecordEdits, canUser } = select(external_wp_coreData_namespaceObject.store); const settingPerPage = canUser('read', { kind: 'root', name: 'site' }) ? +getEntityRecord('root', 'site')?.posts_per_page : +getSettings().postsPerPage; // Gets changes made via the template area posts per page setting. These won't be saved // until the page is saved, but we should reflect this setting within the query loops // that inherit it. const editedSettingPerPage = +getEntityRecordEdits('root', 'site')?.posts_per_page; return { postsPerPage: editedSettingPerPage || settingPerPage || DEFAULTS_POSTS_PER_PAGE }; }, []); // There are some effects running where some initialization logic is // happening and setting some values to some attributes (ex. queryId). // These updates can cause an `undo trap` where undoing will result in // resetting again, so we need to mark these changes as not persistent // with `__unstableMarkNextChangeAsNotPersistent`. // Changes in query property (which is an object) need to be in the same callback, // because updates are batched after the render and changes in different query properties // would cause to override previous wanted changes. const updateQuery = (0,external_wp_element_namespaceObject.useCallback)(newQuery => setAttributes({ query: { ...query, ...newQuery } }), [query, setAttributes]); (0,external_wp_element_namespaceObject.useEffect)(() => { const newQuery = {}; // When we inherit from global query always need to set the `perPage` // based on the reading settings. if (inherit && query.perPage !== postsPerPage) { newQuery.perPage = postsPerPage; } else if (!query.perPage && postsPerPage) { newQuery.perPage = postsPerPage; } // We need to reset the `inherit` value if in a singular template, as queries // are not inherited when in singular content (e.g. post, page, 404, blank). if (isSingular && query.inherit) { newQuery.inherit = false; } if (!!Object.keys(newQuery).length) { __unstableMarkNextChangeAsNotPersistent(); updateQuery(newQuery); } }, [query.perPage, query.inherit, postsPerPage, inherit, isSingular, __unstableMarkNextChangeAsNotPersistent, updateQuery]); // We need this for multi-query block pagination. // Query parameters for each block are scoped to their ID. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!Number.isFinite(queryId)) { __unstableMarkNextChangeAsNotPersistent(); setAttributes({ queryId: instanceId }); } }, [queryId, instanceId, __unstableMarkNextChangeAsNotPersistent, setAttributes]); const updateDisplayLayout = newDisplayLayout => setAttributes({ displayLayout: { ...displayLayout, ...newDisplayLayout } }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnhancedPaginationModal, { attributes: attributes, setAttributes: setAttributes, clientId: clientId }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryInspectorControls, { name: name, attributes: attributes, setQuery: updateQuery, setDisplayLayout: updateDisplayLayout, setAttributes: setAttributes, clientId: clientId, isSingular: isSingular }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryToolbar, { attributes: attributes, clientId: clientId }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), options: [{ label: (0,external_wp_i18n_namespaceObject.__)('Default (<div>)'), value: 'div' }, { label: '<main>', value: 'main' }, { label: '<section>', value: 'section' }, { label: '<aside>', value: 'aside' }], value: TagName, onChange: value => setAttributes({ tagName: value }), help: htmlElementMessages[TagName] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(EnhancedPaginationControl, { enhancedPagination: enhancedPagination, setAttributes: setAttributes, clientId: clientId })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...innerBlocksProps })] }); } ;// ./node_modules/@wordpress/block-library/build-module/query/edit/query-placeholder.js /** * WordPress dependencies */ /** * Internal dependencies */ function QueryPlaceholder({ attributes, clientId, name, openPatternSelectionModal }) { const [isStartingBlank, setIsStartingBlank] = (0,external_wp_element_namespaceObject.useState)(false); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const { blockType, activeBlockVariation } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getActiveBlockVariation, getBlockType } = select(external_wp_blocks_namespaceObject.store); return { blockType: getBlockType(name), activeBlockVariation: getActiveBlockVariation(name, attributes) }; }, [name, attributes]); const hasPatterns = !!useBlockPatterns(clientId, attributes).length; const icon = activeBlockVariation?.icon?.src || activeBlockVariation?.icon || blockType?.icon?.src; const label = activeBlockVariation?.title || blockType?.title; if (isStartingBlank) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryVariationPicker, { clientId: clientId, attributes: attributes, icon: icon, label: label }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { icon: icon, label: label, instructions: (0,external_wp_i18n_namespaceObject.__)('Choose a pattern for the query loop or start blank.'), children: [!!hasPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", onClick: openPatternSelectionModal, children: (0,external_wp_i18n_namespaceObject.__)('Choose') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: () => { setIsStartingBlank(true); }, children: (0,external_wp_i18n_namespaceObject.__)('Start blank') })] }) }); } function QueryVariationPicker({ clientId, attributes, icon, label }) { const scopeVariations = useScopedBlockVariations(attributes); const { replaceInnerBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockVariationPicker, { icon: icon, label: label, variations: scopeVariations, onSelect: variation => { if (variation.innerBlocks) { replaceInnerBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlocksFromInnerBlocksTemplate)(variation.innerBlocks), false); } } }) }); } ;// ./node_modules/@wordpress/block-library/build-module/query/edit/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const QueryEdit = props => { const { clientId, attributes } = props; const [isPatternSelectionModalOpen, setIsPatternSelectionModalOpen] = (0,external_wp_element_namespaceObject.useState)(false); const hasInnerBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_blockEditor_namespaceObject.store).getBlocks(clientId).length, [clientId]); const Component = hasInnerBlocks ? QueryContent : QueryPlaceholder; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Component, { ...props, openPatternSelectionModal: () => setIsPatternSelectionModalOpen(true) }), isPatternSelectionModalOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PatternSelectionModal, { clientId: clientId, attributes: attributes, setIsPatternSelectionModalOpen: setIsPatternSelectionModalOpen })] }); }; /* harmony default export */ const query_edit = (QueryEdit); ;// ./node_modules/@wordpress/block-library/build-module/query/save.js /** * WordPress dependencies */ function query_save_save({ attributes: { tagName: Tag = 'div' } }) { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...innerBlocksProps }); } ;// ./node_modules/@wordpress/block-library/build-module/query/icons.js /** * WordPress dependencies */ const titleDate = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zM7 26h12v1H7v-1zm34-5H7v3h34v-3zM7 38h12v1H7v-1zm34-5H7v3h34v-3z" }) }); const titleExcerpt = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M41 9H7v3h34V9zm-4 5H7v1h30v-1zm4 3H7v1h34v-1zM7 20h30v1H7v-1zm0 12h30v1H7v-1zm34 3H7v1h34v-1zM7 38h30v1H7v-1zm34-11H7v3h34v-3z" }) }); const titleDateExcerpt = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M41 9H7v3h34V9zm-22 5H7v1h12v-1zm22 3H7v1h34v-1zM7 20h34v1H7v-1zm0 12h12v1H7v-1zm34 3H7v1h34v-1zM7 38h34v1H7v-1zm34-11H7v3h34v-3z" }) }); const imageDateTitle = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M7 9h34v6H7V9zm12 8H7v1h12v-1zm18 3H7v1h30v-1zm0 18H7v1h30v-1zM7 35h12v1H7v-1zm34-8H7v6h34v-6z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/query/variations.js /** * WordPress dependencies */ /** * Internal dependencies */ const query_variations_variations = [{ name: 'title-date', title: (0,external_wp_i18n_namespaceObject.__)('Title & Date'), icon: titleDate, attributes: {}, innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date']]], ['core/query-pagination'], ['core/query-no-results']], scope: ['block'] }, { name: 'title-excerpt', title: (0,external_wp_i18n_namespaceObject.__)('Title & Excerpt'), icon: titleExcerpt, attributes: {}, innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']], scope: ['block'] }, { name: 'title-date-excerpt', title: (0,external_wp_i18n_namespaceObject.__)('Title, Date, & Excerpt'), icon: titleDateExcerpt, attributes: {}, innerBlocks: [['core/post-template', {}, [['core/post-title'], ['core/post-date'], ['core/post-excerpt']]], ['core/query-pagination'], ['core/query-no-results']], scope: ['block'] }, { name: 'image-date-title', title: (0,external_wp_i18n_namespaceObject.__)('Image, Date, & Title'), icon: imageDateTitle, attributes: {}, innerBlocks: [['core/post-template', {}, [['core/post-featured-image'], ['core/post-date'], ['core/post-title']]], ['core/query-pagination'], ['core/query-no-results']], scope: ['block'] }]; /* harmony default export */ const query_variations = (query_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/query/deprecated.js /** * WordPress dependencies */ /** * Internal dependencies */ const { cleanEmptyObject: deprecated_cleanEmptyObject } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const migrateToTaxQuery = attributes => { const { query } = attributes; const { categoryIds, tagIds, ...newQuery } = query; if (query.categoryIds?.length || query.tagIds?.length) { newQuery.taxQuery = { category: !!query.categoryIds?.length ? query.categoryIds : undefined, post_tag: !!query.tagIds?.length ? query.tagIds : undefined }; } return { ...attributes, query: newQuery }; }; const migrateColors = (attributes, innerBlocks) => { // Remove color style attributes from the Query block. const { style, backgroundColor, gradient, textColor, ...newAttributes } = attributes; const hasColorStyles = backgroundColor || gradient || textColor || style?.color || style?.elements?.link; // If the query block doesn't currently have any color styles, // nothing needs migrating. if (!hasColorStyles) { return [attributes, innerBlocks]; } // Clean color values from style attribute object. if (style) { newAttributes.style = deprecated_cleanEmptyObject({ ...style, color: undefined, elements: { ...style.elements, link: undefined } }); } // If the inner blocks are already wrapped in a single group // block, add the color support styles to that group block. if (hasSingleInnerGroupBlock(innerBlocks)) { const groupBlock = innerBlocks[0]; // Create new styles for the group block. const hasStyles = style?.color || style?.elements?.link || groupBlock.attributes.style; const newStyles = hasStyles ? deprecated_cleanEmptyObject({ ...groupBlock.attributes.style, color: style?.color, elements: style?.elements?.link ? { link: style?.elements?.link } : undefined }) : undefined; // Create a new Group block from the original. const updatedGroupBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { ...groupBlock.attributes, backgroundColor, gradient, textColor, style: newStyles }, groupBlock.innerBlocks); return [newAttributes, [updatedGroupBlock]]; } // When we don't have a single wrapping group block for the inner // blocks, wrap the current inner blocks in a group applying the // color styles to that. const newGroupBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { backgroundColor, gradient, textColor, style: deprecated_cleanEmptyObject({ color: style?.color, elements: style?.elements?.link ? { link: style?.elements?.link } : undefined }) }, innerBlocks); return [newAttributes, [newGroupBlock]]; }; const hasSingleInnerGroupBlock = (innerBlocks = []) => innerBlocks.length === 1 && innerBlocks[0].name === 'core/group'; const migrateToConstrainedLayout = attributes => { const { layout = null } = attributes; if (!layout) { return attributes; } const { inherit = null, contentSize = null, ...newLayout } = layout; if (inherit || contentSize) { return { ...attributes, layout: { ...newLayout, contentSize, type: 'constrained' } }; } return attributes; }; const findPostTemplateBlock = (innerBlocks = []) => { let foundBlock = null; for (const block of innerBlocks) { if (block.name === 'core/post-template') { foundBlock = block; break; } else if (block.innerBlocks.length) { foundBlock = findPostTemplateBlock(block.innerBlocks); } } return foundBlock; }; const replacePostTemplateBlock = (innerBlocks = [], replacementBlock) => { innerBlocks.forEach((block, index) => { if (block.name === 'core/post-template') { innerBlocks.splice(index, 1, replacementBlock); } else if (block.innerBlocks.length) { block.innerBlocks = replacePostTemplateBlock(block.innerBlocks, replacementBlock); } }); return innerBlocks; }; const migrateDisplayLayout = (attributes, innerBlocks) => { const { displayLayout = null, ...newAttributes } = attributes; if (!displayLayout) { return [attributes, innerBlocks]; } const postTemplateBlock = findPostTemplateBlock(innerBlocks); if (!postTemplateBlock) { return [attributes, innerBlocks]; } const { type, columns } = displayLayout; // Convert custom displayLayout values to canonical layout types. const updatedLayoutType = type === 'flex' ? 'grid' : 'default'; const newPostTemplateBlock = (0,external_wp_blocks_namespaceObject.createBlock)('core/post-template', { ...postTemplateBlock.attributes, layout: { type: updatedLayoutType, ...(columns && { columnCount: columns }) } }, postTemplateBlock.innerBlocks); return [newAttributes, replacePostTemplateBlock(innerBlocks, newPostTemplateBlock)]; }; // Version with NO wrapper `div` element. const query_deprecated_v1 = { attributes: { queryId: { type: 'number' }, query: { type: 'object', default: { perPage: null, pages: 0, offset: 0, postType: 'post', categoryIds: [], tagIds: [], order: 'desc', orderBy: 'date', author: '', search: '', exclude: [], sticky: '', inherit: true } }, layout: { type: 'object', default: { type: 'list' } } }, supports: { html: false }, migrate(attributes, innerBlocks) { const withTaxQuery = migrateToTaxQuery(attributes); const { layout, ...restWithTaxQuery } = withTaxQuery; const newAttributes = { ...restWithTaxQuery, displayLayout: withTaxQuery.layout }; return migrateDisplayLayout(newAttributes, innerBlocks); }, save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } }; // Version with `categoryIds and tagIds`. const query_deprecated_v2 = { attributes: { queryId: { type: 'number' }, query: { type: 'object', default: { perPage: null, pages: 0, offset: 0, postType: 'post', categoryIds: [], tagIds: [], order: 'desc', orderBy: 'date', author: '', search: '', exclude: [], sticky: '', inherit: true } }, tagName: { type: 'string', default: 'div' }, displayLayout: { type: 'object', default: { type: 'list' } } }, supports: { align: ['wide', 'full'], html: false, color: { gradients: true, link: true }, layout: true }, isEligible: ({ query: { categoryIds, tagIds } = {} }) => categoryIds || tagIds, migrate(attributes, innerBlocks) { const withTaxQuery = migrateToTaxQuery(attributes); const [withColorAttributes, withColorInnerBlocks] = migrateColors(withTaxQuery, innerBlocks); const withConstrainedLayoutAttributes = migrateToConstrainedLayout(withColorAttributes); return migrateDisplayLayout(withConstrainedLayoutAttributes, withColorInnerBlocks); }, save({ attributes: { tagName: Tag = 'div' } }) { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...innerBlocksProps }); } }; // Version with color support prior to moving it to the PostTemplate block. const query_deprecated_v3 = { attributes: { queryId: { type: 'number' }, query: { type: 'object', default: { perPage: null, pages: 0, offset: 0, postType: 'post', order: 'desc', orderBy: 'date', author: '', search: '', exclude: [], sticky: '', inherit: true, taxQuery: null, parents: [] } }, tagName: { type: 'string', default: 'div' }, displayLayout: { type: 'object', default: { type: 'list' } }, namespace: { type: 'string' } }, supports: { align: ['wide', 'full'], html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, layout: true }, isEligible(attributes) { const { style, backgroundColor, gradient, textColor } = attributes; return backgroundColor || gradient || textColor || style?.color || style?.elements?.link; }, migrate(attributes, innerBlocks) { const [withColorAttributes, withColorInnerBlocks] = migrateColors(attributes, innerBlocks); const withConstrainedLayoutAttributes = migrateToConstrainedLayout(withColorAttributes); return migrateDisplayLayout(withConstrainedLayoutAttributes, withColorInnerBlocks); }, save({ attributes: { tagName: Tag = 'div' } }) { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...innerBlocksProps }); } }; const query_deprecated_v4 = { attributes: { queryId: { type: 'number' }, query: { type: 'object', default: { perPage: null, pages: 0, offset: 0, postType: 'post', order: 'desc', orderBy: 'date', author: '', search: '', exclude: [], sticky: '', inherit: true, taxQuery: null, parents: [] } }, tagName: { type: 'string', default: 'div' }, displayLayout: { type: 'object', default: { type: 'list' } }, namespace: { type: 'string' } }, supports: { align: ['wide', 'full'], html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, layout: true }, save({ attributes: { tagName: Tag = 'div' } }) { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...innerBlocksProps }); }, isEligible: ({ layout }) => layout?.inherit || layout?.contentSize && layout?.type !== 'constrained', migrate(attributes, innerBlocks) { const withConstrainedLayoutAttributes = migrateToConstrainedLayout(attributes); return migrateDisplayLayout(withConstrainedLayoutAttributes, innerBlocks); } }; const query_deprecated_v5 = { attributes: { queryId: { type: 'number' }, query: { type: 'object', default: { perPage: null, pages: 0, offset: 0, postType: 'post', order: 'desc', orderBy: 'date', author: '', search: '', exclude: [], sticky: '', inherit: true, taxQuery: null, parents: [] } }, tagName: { type: 'string', default: 'div' }, displayLayout: { type: 'object', default: { type: 'list' } }, namespace: { type: 'string' } }, supports: { align: ['wide', 'full'], anchor: true, html: false, layout: true }, save({ attributes: { tagName: Tag = 'div' } }) { const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save(); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...innerBlocksProps }); }, isEligible: ({ displayLayout }) => { return !!displayLayout; }, migrate: migrateDisplayLayout }; const query_deprecated_deprecated = [query_deprecated_v5, query_deprecated_v4, query_deprecated_v3, query_deprecated_v2, query_deprecated_v1]; /* harmony default export */ const query_deprecated = (query_deprecated_deprecated); ;// ./node_modules/@wordpress/block-library/build-module/query/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const query_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/query", title: "Query Loop", category: "theme", description: "An advanced block that allows displaying post types based on different query parameters and visual configurations.", keywords: ["posts", "list", "blog", "blogs", "custom post types"], textdomain: "default", attributes: { queryId: { type: "number" }, query: { type: "object", "default": { perPage: null, pages: 0, offset: 0, postType: "post", order: "desc", orderBy: "date", author: "", search: "", exclude: [], sticky: "", inherit: true, taxQuery: null, parents: [], format: [] } }, tagName: { type: "string", "default": "div" }, namespace: { type: "string" }, enhancedPagination: { type: "boolean", "default": false } }, usesContext: ["templateSlug"], providesContext: { queryId: "queryId", query: "query", displayLayout: "displayLayout", enhancedPagination: "enhancedPagination" }, supports: { align: ["wide", "full"], html: false, layout: true, interactivity: true }, editorStyle: "wp-block-query-editor" }; const { name: query_name } = query_metadata; const query_settings = { icon: library_loop, edit: query_edit, example: { viewportWidth: 650, attributes: { namespace: 'core/posts-list', query: { perPage: 4, pages: 1, offset: 0, postType: 'post', order: 'desc', orderBy: 'date', author: '', search: '', sticky: 'exclude', inherit: false } }, innerBlocks: [{ name: 'core/post-template', attributes: { layout: { type: 'grid', columnCount: 2 } }, innerBlocks: [{ name: 'core/post-title' }, { name: 'core/post-date' }, { name: 'core/post-excerpt' }] }] }, save: query_save_save, variations: query_variations, deprecated: query_deprecated }; const query_init = () => initBlock({ name: query_name, metadata: query_metadata, settings: query_settings }); ;// ./node_modules/@wordpress/block-library/build-module/query-no-results/edit.js /** * WordPress dependencies */ const query_no_results_edit_TEMPLATE = [['core/paragraph', { placeholder: (0,external_wp_i18n_namespaceObject.__)('Add text or blocks that will display when a query returns no results.') }]]; function QueryNoResultsEdit() { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: query_no_results_edit_TEMPLATE }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }); } ;// ./node_modules/@wordpress/block-library/build-module/query-no-results/save.js /** * WordPress dependencies */ function query_no_results_save_save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } ;// ./node_modules/@wordpress/block-library/build-module/query-no-results/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const query_no_results_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/query-no-results", title: "No Results", category: "theme", description: "Contains the block elements used to render content when no query results are found.", ancestor: ["core/query"], textdomain: "default", usesContext: ["queryId", "query"], supports: { align: true, reusable: false, html: false, color: { gradients: true, link: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } } }; const { name: query_no_results_name } = query_no_results_metadata; const query_no_results_settings = { icon: library_loop, edit: QueryNoResultsEdit, save: query_no_results_save_save, example: { innerBlocks: [{ name: 'core/paragraph', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('No posts were found.') } }] } }; const query_no_results_init = () => initBlock({ name: query_no_results_name, metadata: query_no_results_metadata, settings: query_no_results_settings }); ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-arrow-controls.js /** * WordPress dependencies */ function QueryPaginationArrowControls({ value, onChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Arrow'), value: value, onChange: onChange, help: (0,external_wp_i18n_namespaceObject.__)('A decorative arrow appended to the next and previous page link.'), isBlock: true, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "none", label: (0,external_wp_i18n_namespaceObject._x)('None', 'Arrow option for Query Pagination Next/Previous blocks') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "arrow", label: (0,external_wp_i18n_namespaceObject._x)('Arrow', 'Arrow option for Query Pagination Next/Previous blocks') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: "chevron", label: (0,external_wp_i18n_namespaceObject._x)('Chevron', 'Arrow option for Query Pagination Next/Previous blocks') })] }); } ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/query-pagination-label-control.js /** * WordPress dependencies */ function QueryPaginationLabelControl({ value, onChange }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show label text'), help: (0,external_wp_i18n_namespaceObject.__)('Make label text visible, e.g. "Next Page".'), onChange: onChange, checked: value === true }); } ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const query_pagination_edit_TEMPLATE = [['core/query-pagination-previous'], ['core/query-pagination-numbers'], ['core/query-pagination-next']]; function edit_QueryPaginationEdit({ attributes: { paginationArrow, showLabel }, setAttributes, clientId }) { const hasNextPreviousBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlocks } = select(external_wp_blockEditor_namespaceObject.store); const innerBlocks = getBlocks(clientId); /** * Show the `paginationArrow` and `showLabel` controls only if a * `QueryPaginationNext/Previous` block exists. */ return innerBlocks?.find(innerBlock => { return ['core/query-pagination-next', 'core/query-pagination-previous'].includes(innerBlock.name); }); }, [clientId]); const { __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: query_pagination_edit_TEMPLATE }); // Always show label text if paginationArrow is set to 'none'. (0,external_wp_element_namespaceObject.useEffect)(() => { if (paginationArrow === 'none' && !showLabel) { __unstableMarkNextChangeAsNotPersistent(); setAttributes({ showLabel: true }); } }, [paginationArrow, setAttributes, showLabel, __unstableMarkNextChangeAsNotPersistent]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [hasNextPreviousBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ paginationArrow: 'none', showLabel: true }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => paginationArrow !== 'none', label: (0,external_wp_i18n_namespaceObject.__)('Pagination arrow'), onDeselect: () => setAttributes({ paginationArrow: 'none' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryPaginationArrowControls, { value: paginationArrow, onChange: value => { setAttributes({ paginationArrow: value }); } }) }), paginationArrow !== 'none' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !showLabel, label: (0,external_wp_i18n_namespaceObject.__)('Show text'), onDeselect: () => setAttributes({ showLabel: true }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(QueryPaginationLabelControl, { value: showLabel, onChange: value => { setAttributes({ showLabel: value }); } }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("nav", { ...innerBlocksProps })] }); } ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/save.js /** * WordPress dependencies */ function query_pagination_save_save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}); } ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/deprecated.js /** * WordPress dependencies */ const query_pagination_deprecated_deprecated = [ // Version with wrapper `div` element. { save() { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } }]; /* harmony default export */ const query_pagination_deprecated = (query_pagination_deprecated_deprecated); ;// ./node_modules/@wordpress/block-library/build-module/query-pagination/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const query_pagination_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/query-pagination", title: "Pagination", category: "theme", ancestor: ["core/query"], allowedBlocks: ["core/query-pagination-previous", "core/query-pagination-numbers", "core/query-pagination-next"], description: "Displays a paginated navigation to next/previous set of posts, when applicable.", textdomain: "default", attributes: { paginationArrow: { type: "string", "default": "none" }, showLabel: { type: "boolean", "default": true } }, usesContext: ["queryId", "query"], providesContext: { paginationArrow: "paginationArrow", showLabel: "showLabel" }, supports: { align: true, reusable: false, html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, layout: { allowSwitching: false, allowInheriting: false, "default": { type: "flex" } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-query-pagination-editor", style: "wp-block-query-pagination" }; const { name: query_pagination_name } = query_pagination_metadata; const query_pagination_settings = { icon: query_pagination, edit: edit_QueryPaginationEdit, save: query_pagination_save_save, deprecated: query_pagination_deprecated }; const query_pagination_init = () => initBlock({ name: query_pagination_name, metadata: query_pagination_metadata, settings: query_pagination_settings }); ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-next/edit.js /** * WordPress dependencies */ const query_pagination_next_edit_arrowMap = { none: '', arrow: '→', chevron: '»' }; function QueryPaginationNextEdit({ attributes: { label }, setAttributes, context: { paginationArrow, showLabel } }) { const displayArrow = query_pagination_next_edit_arrowMap[paginationArrow]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#pagination-next-pseudo-link", onClick: event => event.preventDefault(), ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: [showLabel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { __experimentalVersion: 2, tagName: "span", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Next page link'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Next Page'), value: label, onChange: newLabel => setAttributes({ label: newLabel }) }), displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: `wp-block-query-pagination-next-arrow is-arrow-${paginationArrow}`, "aria-hidden": true, children: displayArrow })] }); } ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-next/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const query_pagination_next_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/query-pagination-next", title: "Next Page", category: "theme", parent: ["core/query-pagination"], description: "Displays the next posts page link.", textdomain: "default", attributes: { label: { type: "string" } }, usesContext: ["queryId", "query", "paginationArrow", "showLabel", "enhancedPagination"], supports: { reusable: false, html: false, color: { gradients: true, text: false, __experimentalDefaultControls: { background: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } } }; const { name: query_pagination_next_name } = query_pagination_next_metadata; const query_pagination_next_settings = { icon: query_pagination_next, edit: QueryPaginationNextEdit }; const query_pagination_next_init = () => initBlock({ name: query_pagination_next_name, metadata: query_pagination_next_metadata, settings: query_pagination_next_settings }); ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ const createPaginationItem = (content, Tag = 'a', extraClass = '') => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { className: `page-numbers ${extraClass}`, children: content }, content); const previewPaginationNumbers = midSize => { const paginationItems = []; // First set of pagination items. for (let i = 1; i <= midSize; i++) { paginationItems.push(createPaginationItem(i)); } // Current pagination item. paginationItems.push(createPaginationItem(midSize + 1, 'span', 'current')); // Second set of pagination items. for (let i = 1; i <= midSize; i++) { paginationItems.push(createPaginationItem(midSize + 1 + i)); } // Dots. paginationItems.push(createPaginationItem('...', 'span', 'dots')); // Last pagination item. paginationItems.push(createPaginationItem(midSize * 2 + 3)); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: paginationItems }); }; function QueryPaginationNumbersEdit({ attributes, setAttributes }) { const { midSize } = attributes; const paginationNumbers = previewPaginationNumbers(parseInt(midSize, 10)); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => setAttributes({ midSize: 2 }), dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Number of links'), hasValue: () => midSize !== 2, onDeselect: () => setAttributes({ midSize: 2 }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Number of links'), help: (0,external_wp_i18n_namespaceObject.__)('Specify how many links can appear before and after the current page number. Links to the first, current and last page are always visible.'), value: midSize, onChange: value => { setAttributes({ midSize: parseInt(value, 10) }); }, min: 0, max: 5, withInputField: false }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: paginationNumbers })] }); } ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-numbers/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const query_pagination_numbers_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/query-pagination-numbers", title: "Page Numbers", category: "theme", parent: ["core/query-pagination"], description: "Displays a list of page numbers for pagination.", textdomain: "default", attributes: { midSize: { type: "number", "default": 2 } }, usesContext: ["queryId", "query", "enhancedPagination"], supports: { reusable: false, html: false, color: { gradients: true, text: false, __experimentalDefaultControls: { background: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-query-pagination-numbers-editor" }; const { name: query_pagination_numbers_name } = query_pagination_numbers_metadata; const query_pagination_numbers_settings = { icon: query_pagination_numbers, edit: QueryPaginationNumbersEdit, example: {} }; const query_pagination_numbers_init = () => initBlock({ name: query_pagination_numbers_name, metadata: query_pagination_numbers_metadata, settings: query_pagination_numbers_settings }); ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/edit.js /** * WordPress dependencies */ const query_pagination_previous_edit_arrowMap = { none: '', arrow: '←', chevron: '«' }; function QueryPaginationPreviousEdit({ attributes: { label }, setAttributes, context: { paginationArrow, showLabel } }) { const displayArrow = query_pagination_previous_edit_arrowMap[paginationArrow]; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("a", { href: "#pagination-previous-pseudo-link", onClick: event => event.preventDefault(), ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: [displayArrow && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: `wp-block-query-pagination-previous-arrow is-arrow-${paginationArrow}`, "aria-hidden": true, children: displayArrow }), showLabel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { __experimentalVersion: 2, tagName: "span", "aria-label": (0,external_wp_i18n_namespaceObject.__)('Previous page link'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Previous Page'), value: label, onChange: newLabel => setAttributes({ label: newLabel }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/query-pagination-previous/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const query_pagination_previous_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/query-pagination-previous", title: "Previous Page", category: "theme", parent: ["core/query-pagination"], description: "Displays the previous posts page link.", textdomain: "default", attributes: { label: { type: "string" } }, usesContext: ["queryId", "query", "paginationArrow", "showLabel", "enhancedPagination"], supports: { reusable: false, html: false, color: { gradients: true, text: false, __experimentalDefaultControls: { background: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true } } }; const { name: query_pagination_previous_name } = query_pagination_previous_metadata; const query_pagination_previous_settings = { icon: query_pagination_previous, edit: QueryPaginationPreviousEdit }; const query_pagination_previous_init = () => initBlock({ name: query_pagination_previous_name, metadata: query_pagination_previous_metadata, settings: query_pagination_previous_settings }); ;// ./node_modules/@wordpress/block-library/build-module/query-title/use-archive-label.js /** * WordPress dependencies */ function useArchiveLabel() { const templateSlug = (0,external_wp_data_namespaceObject.useSelect)(select => { // @wordpress/block-library should not depend on @wordpress/editor. // Blocks can be loaded into a *non-post* block editor, so to avoid // declaring @wordpress/editor as a dependency, we must access its // store by string. // The solution here is to split WP specific blocks from generic blocks. // eslint-disable-next-line @wordpress/data-no-store-string-literals const { getCurrentPostId, getCurrentPostType, getCurrentTemplateId } = select('core/editor'); const currentPostType = getCurrentPostType(); const templateId = getCurrentTemplateId() || (currentPostType === 'wp_template' ? getCurrentPostId() : null); return templateId ? select(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_template', templateId)?.slug : null; }, []); const taxonomyMatches = templateSlug?.match(/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/); let taxonomy; let term; let isAuthor = false; let authorSlug; if (taxonomyMatches) { // If is for a all taxonomies of a type if (taxonomyMatches[1]) { taxonomy = taxonomyMatches[2] ? taxonomyMatches[2] : taxonomyMatches[1]; } // If is for a all taxonomies of a type else if (taxonomyMatches[3]) { taxonomy = taxonomyMatches[6] ? taxonomyMatches[6] : taxonomyMatches[4]; term = taxonomyMatches[7]; } taxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy; //getTaxonomy( 'category' ); //wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} ); } else { const authorMatches = templateSlug?.match(/^(author)$|^author-(.+)$/); if (authorMatches) { isAuthor = true; if (authorMatches[2]) { authorSlug = authorMatches[2]; } } } return (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecords, getTaxonomy, getAuthors } = select(external_wp_coreData_namespaceObject.store); let archiveTypeLabel; let archiveNameLabel; if (taxonomy) { archiveTypeLabel = getTaxonomy(taxonomy)?.labels?.singular_name; } if (term) { const records = getEntityRecords('taxonomy', taxonomy, { slug: term, per_page: 1 }); if (records && records[0]) { archiveNameLabel = records[0].name; } } if (isAuthor) { archiveTypeLabel = 'Author'; if (authorSlug) { const authorRecords = getAuthors({ slug: authorSlug }); if (authorRecords && authorRecords[0]) { archiveNameLabel = authorRecords[0].name; } } } return { archiveTypeLabel, archiveNameLabel }; }, [authorSlug, isAuthor, taxonomy, term]); } ;// ./node_modules/@wordpress/block-library/build-module/query-title/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const SUPPORTED_TYPES = ['archive', 'search']; function QueryTitleEdit({ attributes: { type, level, levelOptions, textAlign, showPrefix, showSearchTerm }, setAttributes }) { const { archiveTypeLabel, archiveNameLabel } = useArchiveLabel(); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const TagName = `h${level}`; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx('wp-block-query-title__placeholder', { [`has-text-align-${textAlign}`]: textAlign }) }); if (!SUPPORTED_TYPES.includes(type)) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Provided type is not supported.') }) }); } let titleElement; if (type === 'archive') { let title; if (archiveTypeLabel) { if (showPrefix) { if (archiveNameLabel) { title = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: 1: Archive type title e.g: "Category", 2: Label of the archive e.g: "Shoes" */ (0,external_wp_i18n_namespaceObject._x)('%1$s: %2$s', 'archive label'), archiveTypeLabel, archiveNameLabel); } else { title = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Archive type title e.g: "Category", "Tag"... */ (0,external_wp_i18n_namespaceObject.__)('%s: Name'), archiveTypeLabel); } } else if (archiveNameLabel) { title = archiveNameLabel; } else { title = (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Archive type title e.g: "Category", "Tag"... */ (0,external_wp_i18n_namespaceObject.__)('%s name'), archiveTypeLabel); } } else { title = showPrefix ? (0,external_wp_i18n_namespaceObject.__)('Archive type: Name') : (0,external_wp_i18n_namespaceObject.__)('Archive title'); } titleElement = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => setAttributes({ showPrefix: true }), dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !showPrefix, label: (0,external_wp_i18n_namespaceObject.__)('Show archive type in title'), onDeselect: () => setAttributes({ showPrefix: true }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show archive type in title'), onChange: () => setAttributes({ showPrefix: !showPrefix }), checked: showPrefix }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: title })] }); } if (type === 'search') { titleElement = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => setAttributes({ showSearchTerm: true }), dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !showSearchTerm, label: (0,external_wp_i18n_namespaceObject.__)('Show search term in title'), onDeselect: () => setAttributes({ showSearchTerm: true }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show search term in title'), onChange: () => setAttributes({ showSearchTerm: !showSearchTerm }), checked: showSearchTerm }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: showSearchTerm ? (0,external_wp_i18n_namespaceObject.__)('Search results for: “search term”') : (0,external_wp_i18n_namespaceObject.__)('Search results') })] }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { value: level, options: levelOptions, onChange: newLevel => setAttributes({ level: newLevel }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } })] }), titleElement] }); } ;// ./node_modules/@wordpress/block-library/build-module/query-title/variations.js /** * WordPress dependencies */ const query_title_variations_variations = [{ isDefault: true, name: 'archive-title', title: (0,external_wp_i18n_namespaceObject.__)('Archive Title'), description: (0,external_wp_i18n_namespaceObject.__)('Display the archive title based on the queried object.'), icon: library_title, attributes: { type: 'archive' }, scope: ['inserter'] }, { isDefault: false, name: 'search-title', title: (0,external_wp_i18n_namespaceObject.__)('Search Results Title'), description: (0,external_wp_i18n_namespaceObject.__)('Display the search results title based on the queried object.'), icon: library_title, attributes: { type: 'search' }, scope: ['inserter'] }]; /** * Add `isActive` function to all `query-title` variations, if not defined. * `isActive` function is used to find a variation match from a created * Block by providing its attributes. */ query_title_variations_variations.forEach(variation => { if (variation.isActive) { return; } variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.type === variationAttributes.type; }); /* harmony default export */ const query_title_variations = (query_title_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/query-title/deprecated.js /** * Internal dependencies */ const query_title_deprecated_v1 = { attributes: { type: { type: 'string' }, textAlign: { type: 'string' }, level: { type: 'number', default: 1 } }, supports: { align: ['wide', 'full'], html: false, color: { gradients: true }, spacing: { margin: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true } }, save() { return null; }, migrate: migrate_font_family, isEligible({ style }) { return style?.typography?.fontFamily; } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const query_title_deprecated = ([query_title_deprecated_v1]); ;// ./node_modules/@wordpress/block-library/build-module/query-title/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const query_title_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/query-title", title: "Query Title", category: "theme", description: "Display the query title.", textdomain: "default", attributes: { type: { type: "string" }, textAlign: { type: "string" }, level: { type: "number", "default": 1 }, levelOptions: { type: "array" }, showPrefix: { type: "boolean", "default": true }, showSearchTerm: { type: "boolean", "default": true } }, example: { attributes: { type: "search" } }, supports: { align: ["wide", "full"], html: false, color: { gradients: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-query-title" }; const { name: query_title_name } = query_title_metadata; const query_title_settings = { icon: library_title, edit: QueryTitleEdit, variations: query_title_variations, deprecated: query_title_deprecated }; const query_title_init = () => initBlock({ name: query_title_name, metadata: query_title_metadata, settings: query_title_settings }); ;// ./node_modules/@wordpress/block-library/build-module/query-total/icons.js /** * WordPress dependencies */ const resultsFound = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24", height: "24", "aria-hidden": "true", focusable: "false", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M4 11h4v2H4v-2zm6 0h6v2h-6v-2zm8 0h2v2h-2v-2z" }) }); const displayingResults = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24", height: "24", "aria-hidden": "true", focusable: "false", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M4 13h2v-2H4v2zm4 0h10v-2H8v2zm12 0h2v-2h-2v2z" }) }); const queryTotal = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24", height: "24", "aria-hidden": "true", focusable: "false", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2Zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12Zm-7-6-4.1 5h8.8v-3h-1.5v1.5h-4.2l2.9-3.5-2.9-3.5h4.2V10h1.5V7H7.4l4.1 5Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/query-total/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ function QueryTotalEdit({ attributes, setAttributes }) { const { displayType } = attributes; // Block properties and classes. const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const getButtonPositionIcon = () => { switch (displayType) { case 'total-results': return resultsFound; case 'range-display': return displayingResults; } }; const buttonPositionControls = [{ role: 'menuitemradio', title: (0,external_wp_i18n_namespaceObject.__)('Total results'), isActive: displayType === 'total-results', icon: resultsFound, onClick: () => { setAttributes({ displayType: 'total-results' }); } }, { role: 'menuitemradio', title: (0,external_wp_i18n_namespaceObject.__)('Range display'), isActive: displayType === 'range-display', icon: displayingResults, onClick: () => { setAttributes({ displayType: 'range-display' }); } }]; // Controls for the block. const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { icon: getButtonPositionIcon(), label: (0,external_wp_i18n_namespaceObject.__)('Change display type'), controls: buttonPositionControls }) }) }); // Render output based on the selected display type. const renderDisplay = () => { if (displayType === 'total-results') { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: (0,external_wp_i18n_namespaceObject.__)('12 results found') }); } if (displayType === 'range-display') { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: (0,external_wp_i18n_namespaceObject.__)('Displaying 1 – 10 of 12') }); } return null; }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [controls, renderDisplay()] }); } ;// ./node_modules/@wordpress/block-library/build-module/query-total/index.js /** * Internal dependencies */ const query_total_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/query-total", title: "Query Total", category: "theme", ancestor: ["core/query"], description: "Display the total number of results in a query.", textdomain: "default", attributes: { displayType: { type: "string", "default": "total-results" } }, usesContext: ["queryId", "query"], supports: { align: ["wide", "full"], html: false, spacing: { margin: true, padding: true }, color: { gradients: true, __experimentalDefaultControls: { background: true, text: true } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } }, interactivity: { clientNavigation: true } }, style: "wp-block-query-total" }; /* Block settings */ const { name: query_total_name } = query_total_metadata; const query_total_settings = { icon: queryTotal, edit: QueryTotalEdit }; const query_total_init = () => initBlock({ name: query_total_name, metadata: query_total_metadata, settings: query_total_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/quote.js /** * WordPress dependencies */ const quote = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z" }) }); /* harmony default export */ const library_quote = (quote); ;// ./node_modules/@wordpress/block-library/build-module/quote/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ const migrateToQuoteV2 = attributes => { const { value, ...restAttributes } = attributes; return [{ ...restAttributes }, value ? (0,external_wp_blocks_namespaceObject.parseWithAttributeSchema)(value, { type: 'array', source: 'query', selector: 'p', query: { content: { type: 'string', source: 'html' } } }).map(({ content }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content })) : (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph')]; }; const deprecated_TEXT_ALIGN_OPTIONS = ['left', 'right', 'center']; // Migrate existing text alignment settings to the renamed attribute. const deprecated_migrateTextAlign = (attributes, innerBlocks) => { const { align, ...rest } = attributes; // Check if there are valid alignments stored in the old attribute // and assign them to the new attribute name. const migratedAttributes = deprecated_TEXT_ALIGN_OPTIONS.includes(align) ? { ...rest, textAlign: align } : attributes; return [migratedAttributes, innerBlocks]; }; // Migrate the v2 blocks with style === `2`; const migrateLargeStyle = (attributes, innerBlocks) => { return [{ ...attributes, className: attributes.className ? attributes.className + ' is-style-large' : 'is-style-large' }, innerBlocks]; }; // Version before the 'align' attribute was replaced with 'textAlign'. const quote_deprecated_v4 = { attributes: { value: { type: 'string', source: 'html', selector: 'blockquote', multiline: 'p', default: '', role: 'content' }, citation: { type: 'string', source: 'html', selector: 'cite', default: '', role: 'content' }, align: { type: 'string' } }, supports: { anchor: true, html: false, __experimentalOnEnter: true, __experimentalOnMerge: true, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true, fontAppearance: true } }, color: { gradients: true, heading: true, link: true, __experimentalDefaultControls: { background: true, text: true } } }, isEligible: ({ align }) => deprecated_TEXT_ALIGN_OPTIONS.includes(align), save({ attributes }) { const { align, citation } = attributes; const className = dist_clsx({ [`has-text-align-${align}`]: align }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "cite", value: citation })] }); }, migrate: deprecated_migrateTextAlign }; const quote_deprecated_v3 = { attributes: { value: { type: 'string', source: 'html', selector: 'blockquote', multiline: 'p', default: '', role: 'content' }, citation: { type: 'string', source: 'html', selector: 'cite', default: '', role: 'content' }, align: { type: 'string' } }, supports: { anchor: true, __experimentalSlashInserter: true, typography: { fontSize: true, lineHeight: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalDefaultControls: { fontSize: true, fontAppearance: true } } }, save({ attributes }) { const { align, value, citation } = attributes; const className = dist_clsx({ [`has-text-align-${align}`]: align }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { multiline: true, value: value }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "cite", value: citation })] }); }, migrate(attributes) { return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes)); } }; const quote_deprecated_v2 = { attributes: { value: { type: 'string', source: 'html', selector: 'blockquote', multiline: 'p', default: '' }, citation: { type: 'string', source: 'html', selector: 'cite', default: '' }, align: { type: 'string' } }, migrate(attributes) { return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes)); }, save({ attributes }) { const { align, value, citation } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { style: { textAlign: align ? align : null }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { multiline: true, value: value }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "cite", value: citation })] }); } }; const quote_deprecated_v1 = { attributes: { value: { type: 'string', source: 'html', selector: 'blockquote', multiline: 'p', default: '' }, citation: { type: 'string', source: 'html', selector: 'cite', default: '' }, align: { type: 'string' }, style: { type: 'number', default: 1 } }, migrate(attributes) { if (attributes.style === 2) { const { style, ...restAttributes } = attributes; return deprecated_migrateTextAlign(...migrateLargeStyle(...migrateToQuoteV2(restAttributes))); } return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes)); }, save({ attributes }) { const { align, value, citation, style } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { className: style === 2 ? 'is-large' : '', style: { textAlign: align ? align : null }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { multiline: true, value: value }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "cite", value: citation })] }); } }; const quote_deprecated_v0 = { attributes: { value: { type: 'string', source: 'html', selector: 'blockquote', multiline: 'p', default: '' }, citation: { type: 'string', source: 'html', selector: 'footer', default: '' }, align: { type: 'string' }, style: { type: 'number', default: 1 } }, migrate(attributes) { if (!isNaN(parseInt(attributes.style))) { const { style, ...restAttributes } = attributes; return deprecated_migrateTextAlign(...migrateToQuoteV2(restAttributes)); } return deprecated_migrateTextAlign(...migrateToQuoteV2(attributes)); }, save({ attributes }) { const { align, value, citation, style } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { className: `blocks-quote-style-${style}`, style: { textAlign: align ? align : null }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { multiline: true, value: value }), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "footer", value: citation })] }); } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const quote_deprecated = ([quote_deprecated_v4, quote_deprecated_v3, quote_deprecated_v2, quote_deprecated_v1, quote_deprecated_v0]); ;// ./node_modules/@wordpress/icons/build-module/library/verse.js /** * WordPress dependencies */ const verse = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" }) }); /* harmony default export */ const library_verse = (verse); ;// ./node_modules/@wordpress/block-library/build-module/quote/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const edit_isWebPlatform = external_wp_element_namespaceObject.Platform.OS === 'web'; const quote_edit_TEMPLATE = [['core/paragraph', {}]]; /** * At the moment, deprecations don't handle create blocks from attributes * (like when using CPT templates). For this reason, this hook is necessary * to avoid breaking templates using the old quote block format. * * @param {Object} attributes Block attributes. * @param {string} clientId Block client ID. */ const edit_useMigrateOnLoad = (attributes, clientId) => { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { updateBlockAttributes, replaceInnerBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { // As soon as the block is loaded, migrate it to the new version. if (!attributes.value) { // No need to migrate if it doesn't have the value attribute. return; } const [newAttributes, newInnerBlocks] = migrateToQuoteV2(attributes); external_wp_deprecated_default()('Value attribute on the quote block', { since: '6.0', version: '6.5', alternative: 'inner blocks' }); registry.batch(() => { updateBlockAttributes(clientId, newAttributes); replaceInnerBlocks(clientId, newInnerBlocks); }); }, [attributes.value]); }; function QuoteEdit({ attributes, setAttributes, insertBlocksAfter, clientId, className, style, isSelected }) { const { textAlign } = attributes; edit_useMigrateOnLoad(attributes, clientId); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx(className, { [`has-text-align-${textAlign}`]: textAlign }), ...(!edit_isWebPlatform && { style }) }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { template: quote_edit_TEMPLATE, templateInsertUpdatesSelection: true, __experimentalCaptureToolbars: true, renderAppender: false }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.BlockQuotation, { ...innerBlocksProps, children: [innerBlocksProps.children, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { attributeKey: "citation", tagName: edit_isWebPlatform ? 'cite' : 'p', style: edit_isWebPlatform && { display: 'block' }, isSelected: isSelected, attributes: attributes, setAttributes: setAttributes, __unstableMobileNoFocusOnMount: true, icon: library_verse, label: (0,external_wp_i18n_namespaceObject.__)('Quote citation'), placeholder: // translators: placeholder text used for the // citation (0,external_wp_i18n_namespaceObject.__)('Add citation'), addLabel: (0,external_wp_i18n_namespaceObject.__)('Add citation'), removeLabel: (0,external_wp_i18n_namespaceObject.__)('Remove citation'), excludeElementClassName: true, className: "wp-block-quote__citation", insertBlocksAfter: insertBlocksAfter, ...(!edit_isWebPlatform ? { textAlign } : {}) })] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/quote/save.js /** * External dependencies */ /** * WordPress dependencies */ function quote_save_save({ attributes }) { const { textAlign, citation } = attributes; const className = dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("blockquote", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}), !external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "cite", value: citation })] }); } ;// ./node_modules/@wordpress/block-library/build-module/quote/transforms.js /** * WordPress dependencies */ const quote_transforms_transforms = { from: [{ type: 'block', blocks: ['core/pullquote'], transform: ({ value, align, citation, anchor, fontSize, style }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', { align, citation, anchor, fontSize, style }, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: value })]); } }, { type: 'prefix', prefix: '>', transform: content => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content })]) }, { type: 'raw', schema: () => ({ blockquote: { children: '*' } }), selector: 'blockquote', transform: (node, handler) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', // Don't try to parse any `cite` out of this content. // * There may be more than one cite. // * There may be more attribution text than just the cite. // * If the cite is nested in the quoted text, it's wrong to // remove it. {}, handler({ HTML: node.innerHTML, mode: 'BLOCKS' })); } }, { type: 'block', isMultiBlock: true, blocks: ['*'], isMatch: ({}, blocks) => { // When a single block is selected make the transformation // available only to specific blocks that make sense. if (blocks.length === 1) { return ['core/paragraph', 'core/heading', 'core/list', 'core/pullquote'].includes(blocks[0].name); } return !blocks.some(({ name }) => name === 'core/quote'); }, __experimentalConvert: blocks => (0,external_wp_blocks_namespaceObject.createBlock)('core/quote', {}, blocks.map(block => (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, block.innerBlocks))) }], to: [{ type: 'block', blocks: ['core/pullquote'], isMatch: ({}, block) => { return block.innerBlocks.every(({ name }) => name === 'core/paragraph'); }, transform: ({ align, citation, anchor, fontSize, style }, innerBlocks) => { const value = innerBlocks.map(({ attributes }) => `${attributes.content}`).join('<br>'); return (0,external_wp_blocks_namespaceObject.createBlock)('core/pullquote', { value, align, citation, anchor, fontSize, style }); } }, { type: 'block', blocks: ['core/paragraph'], transform: ({ citation }, innerBlocks) => external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: citation })] }, { type: 'block', blocks: ['core/group'], transform: ({ citation, anchor }, innerBlocks) => (0,external_wp_blocks_namespaceObject.createBlock)('core/group', { anchor }, external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: citation })]) }], ungroup: ({ citation }, innerBlocks) => external_wp_blockEditor_namespaceObject.RichText.isEmpty(citation) ? innerBlocks : [...innerBlocks, (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: citation })] }; /* harmony default export */ const quote_transforms = (quote_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/quote/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const quote_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/quote", title: "Quote", category: "text", description: "Give quoted text visual emphasis. \"In quoting others, we cite ourselves.\" \u2014 Julio Cort\xE1zar", keywords: ["blockquote", "cite"], textdomain: "default", attributes: { value: { type: "string", source: "html", selector: "blockquote", multiline: "p", "default": "", role: "content" }, citation: { type: "rich-text", source: "rich-text", selector: "cite", role: "content" }, textAlign: { type: "string" } }, supports: { anchor: true, align: ["left", "right", "wide", "full"], html: false, background: { backgroundImage: true, backgroundSize: true, __experimentalDefaultControls: { backgroundImage: true } }, __experimentalBorder: { color: true, radius: true, style: true, width: true, __experimentalDefaultControls: { color: true, radius: true, style: true, width: true } }, dimensions: { minHeight: true, __experimentalDefaultControls: { minHeight: false } }, __experimentalOnEnter: true, __experimentalOnMerge: true, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, color: { gradients: true, heading: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, layout: { allowEditing: false }, spacing: { blockGap: true, padding: true, margin: true }, interactivity: { clientNavigation: true } }, styles: [{ name: "default", label: "Default", isDefault: true }, { name: "plain", label: "Plain" }], editorStyle: "wp-block-quote-editor", style: "wp-block-quote" }; const { name: quote_name } = quote_metadata; const quote_settings = { icon: library_quote, example: { attributes: { citation: 'Julio Cortázar' }, innerBlocks: [{ name: 'core/paragraph', attributes: { content: (0,external_wp_i18n_namespaceObject.__)('In quoting others, we cite ourselves.') } }] }, transforms: quote_transforms, edit: QuoteEdit, save: quote_save_save, deprecated: quote_deprecated }; const quote_init = () => initBlock({ name: quote_name, metadata: quote_metadata, settings: quote_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/symbol.js /** * WordPress dependencies */ const symbol = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) }); /* harmony default export */ const library_symbol = (symbol); ;// external ["wp","patterns"] const external_wp_patterns_namespaceObject = window["wp"]["patterns"]; ;// ./node_modules/@wordpress/block-library/build-module/block/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { useLayoutClasses } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const { hasOverridableBlocks } = unlock(external_wp_patterns_namespaceObject.privateApis); const fullAlignments = ['full', 'wide', 'left', 'right']; const useInferredLayout = (blocks, parentLayout) => { const initialInferredAlignmentRef = (0,external_wp_element_namespaceObject.useRef)(); return (0,external_wp_element_namespaceObject.useMemo)(() => { // Exit early if the pattern's blocks haven't loaded yet. if (!blocks?.length) { return {}; } let alignment = initialInferredAlignmentRef.current; // Only track the initial alignment so that temporarily removed // alignments can be reapplied. if (alignment === undefined) { const isConstrained = parentLayout?.type === 'constrained'; const hasFullAlignment = blocks.some(block => fullAlignments.includes(block.attributes.align)); alignment = isConstrained && hasFullAlignment ? 'full' : null; initialInferredAlignmentRef.current = alignment; } const layout = alignment ? parentLayout : undefined; return { alignment, layout }; }, [blocks, parentLayout]); }; function RecursionWarning() { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.') }) }); } const edit_NOOP = () => {}; // Wrap the main Edit function for the pattern block with a recursion wrapper // that allows short-circuiting rendering as early as possible, before any // of the other effects in the block edit have run. function ReusableBlockEditRecursionWrapper(props) { const { ref } = props.attributes; const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(ref); if (hasAlreadyRendered) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(RecursionWarning, {}); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RecursionProvider, { uniqueId: ref, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReusableBlockEdit, { ...props }) }); } function ReusableBlockControl({ recordId, canOverrideBlocks, hasContent, handleEditOriginal, resetContent }) { const canUserEdit = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(external_wp_coreData_namespaceObject.store).canUser('update', { kind: 'postType', name: 'wp_block', id: recordId }), [recordId]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [canUserEdit && !!handleEditOriginal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: handleEditOriginal, children: (0,external_wp_i18n_namespaceObject.__)('Edit original') }) }) }), canOverrideBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: resetContent, disabled: !hasContent, children: (0,external_wp_i18n_namespaceObject.__)('Reset') }) }) })] }); } function ReusableBlockEdit({ name, attributes: { ref, content }, __unstableParentLayout: parentLayout, setAttributes }) { const { record, hasResolved } = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', 'wp_block', ref); const [blocks] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_block', { id: ref }); const isMissing = hasResolved && !record; const { __unstableMarkLastChangeAsPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { onNavigateToEntityRecord, hasPatternOverridesSource } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); // For editing link to the site editor if the theme and user permissions support it. return { onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord, hasPatternOverridesSource: !!(0,external_wp_blocks_namespaceObject.getBlockBindingsSource)('core/pattern-overrides') }; }, []); const canOverrideBlocks = (0,external_wp_element_namespaceObject.useMemo)(() => hasPatternOverridesSource && hasOverridableBlocks(blocks), [hasPatternOverridesSource, blocks]); const { alignment, layout } = useInferredLayout(blocks, parentLayout); const layoutClasses = useLayoutClasses({ layout }, name); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx('block-library-block__reusable-block-container', layout && layoutClasses, { [`align${alignment}`]: alignment }) }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { layout, value: blocks, onInput: edit_NOOP, onChange: edit_NOOP, renderAppender: blocks?.length ? undefined : external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender }); const handleEditOriginal = () => { onNavigateToEntityRecord({ postId: ref, postType: 'wp_block' }); }; const resetContent = () => { if (content) { // Make sure any previous changes are persisted before resetting. __unstableMarkLastChangeAsPersistent(); setAttributes({ content: undefined }); } }; let children = null; if (isMissing) { children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Block has been deleted or is unavailable.') }); } if (!hasResolved) { children = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [hasResolved && !isMissing && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReusableBlockControl, { recordId: ref, canOverrideBlocks: canOverrideBlocks, hasContent: !!content, handleEditOriginal: onNavigateToEntityRecord ? handleEditOriginal : undefined, resetContent: resetContent }), children === null ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...innerBlocksProps }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: children })] }); } ;// ./node_modules/@wordpress/block-library/build-module/block/deprecated.js const isObject = obj => typeof obj === 'object' && !Array.isArray(obj) && obj !== null; // v2: Migrate to a more condensed version of the 'content' attribute attribute. const block_deprecated_v2 = { attributes: { ref: { type: 'number' }, content: { type: 'object' } }, supports: { customClassName: false, html: false, inserter: false, renaming: false }, // Force this deprecation to run whenever there's a values sub-property that's an object. // // This could fail in the future if a block ever has binding to a `values` attribute. // Some extra protection is added to ensure `values` is an object, but this only reduces // the likelihood, it doesn't solve it completely. isEligible({ content }) { return !!content && Object.keys(content).every(contentKey => content[contentKey].values && isObject(content[contentKey].values)); }, /* * Old attribute format: * content: { * "V98q_x": { * // The attribute values are now stored as a 'values' sub-property. * values: { content: 'My content value' }, * // ... additional metadata, like the block name can be stored here. * } * } * * New attribute format: * content: { * "V98q_x": { * content: 'My content value', * } * } */ migrate(attributes) { const { content, ...retainedAttributes } = attributes; if (content && Object.keys(content).length) { const updatedContent = { ...content }; for (const contentKey in content) { updatedContent[contentKey] = content[contentKey].values; } return { ...retainedAttributes, content: updatedContent }; } return attributes; } }; // v1: Rename the `overrides` attribute to the `content` attribute. const block_deprecated_v1 = { attributes: { ref: { type: 'number' }, overrides: { type: 'object' } }, supports: { customClassName: false, html: false, inserter: false, renaming: false }, // Force this deprecation to run whenever there's an `overrides` object. isEligible({ overrides }) { return !!overrides; }, /* * Old attribute format: * overrides: { * // An key is an id that represents a block. * // The values are the attribute values of the block. * "V98q_x": { content: 'My content value' } * } * * New attribute format: * content: { * "V98q_x": { content: 'My content value' } * } * */ migrate(attributes) { const { overrides, ...retainedAttributes } = attributes; const content = {}; Object.keys(overrides).forEach(id => { content[id] = overrides[id]; }); return { ...retainedAttributes, content }; } }; /* harmony default export */ const block_deprecated = ([block_deprecated_v2, block_deprecated_v1]); ;// ./node_modules/@wordpress/block-library/build-module/block/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const block_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/block", title: "Pattern", category: "reusable", description: "Reuse this design across your site.", keywords: ["reusable"], textdomain: "default", attributes: { ref: { type: "number" }, content: { type: "object", "default": {} } }, providesContext: { "pattern/overrides": "content" }, supports: { customClassName: false, html: false, inserter: false, renaming: false, interactivity: { clientNavigation: true } } }; const { name: block_name } = block_metadata; const block_settings = { deprecated: block_deprecated, edit: ReusableBlockEditRecursionWrapper, icon: library_symbol, __experimentalLabel: ({ ref }) => { if (!ref) { return; } const entity = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store).getEditedEntityRecord('postType', 'wp_block', ref); if (!entity?.title) { return; } return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(entity.title); } }; const block_init = () => initBlock({ name: block_name, metadata: block_metadata, settings: block_settings }); ;// ./node_modules/@wordpress/block-library/build-module/read-more/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ function ReadMore({ attributes: { content, linkTarget }, setAttributes, insertBlocksAfter }) { const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => setAttributes({ linkTarget: '_self' }), dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), isShownByDefault: true, hasValue: () => linkTarget !== '_self', onDeselect: () => setAttributes({ linkTarget: '_self' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: value => setAttributes({ linkTarget: value ? '_blank' : '_self' }), checked: linkTarget === '_blank' }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "content", tagName: "a", "aria-label": (0,external_wp_i18n_namespaceObject.__)('“Read more” link text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Read more'), value: content, onChange: newValue => setAttributes({ content: newValue }), __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())), withoutInteractiveFormatting: true, ...blockProps })] }); } ;// ./node_modules/@wordpress/block-library/build-module/read-more/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const read_more_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/read-more", title: "Read More", category: "theme", description: "Displays the link of a post, page, or any other content-type.", textdomain: "default", attributes: { content: { type: "string" }, linkTarget: { type: "string", "default": "_self" } }, usesContext: ["postId"], supports: { html: false, color: { gradients: true, text: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalLetterSpacing: true, __experimentalTextDecoration: true, __experimentalDefaultControls: { fontSize: true, textDecoration: true } }, spacing: { margin: ["top", "bottom"], padding: true, __experimentalDefaultControls: { padding: true } }, __experimentalBorder: { color: true, radius: true, width: true, __experimentalDefaultControls: { width: true } }, interactivity: { clientNavigation: true } }, style: "wp-block-read-more" }; const { name: read_more_name } = read_more_metadata; const read_more_settings = { icon: library_link, edit: ReadMore, example: { attributes: { content: (0,external_wp_i18n_namespaceObject.__)('Read more') } } }; const read_more_init = () => initBlock({ name: read_more_name, metadata: read_more_metadata, settings: read_more_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/rss.js /** * WordPress dependencies */ const rss = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5 10.2h-.8v1.5H5c1.9 0 3.8.8 5.1 2.1 1.4 1.4 2.1 3.2 2.1 5.1v.8h1.5V19c0-2.3-.9-4.5-2.6-6.2-1.6-1.6-3.8-2.6-6.1-2.6zm10.4-1.6C12.6 5.8 8.9 4.2 5 4.2h-.8v1.5H5c3.5 0 6.9 1.4 9.4 3.9s3.9 5.8 3.9 9.4v.8h1.5V19c0-3.9-1.6-7.6-4.4-10.4zM4 20h3v-3H4v3z" }) }); /* harmony default export */ const library_rss = (rss); ;// ./node_modules/@wordpress/block-library/build-module/rss/edit.js /** * WordPress dependencies */ const DEFAULT_MIN_ITEMS = 1; const DEFAULT_MAX_ITEMS = 20; function RSSEdit({ attributes, setAttributes }) { const [isEditing, setIsEditing] = (0,external_wp_element_namespaceObject.useState)(!attributes.feedURL); const { blockLayout, columns, displayAuthor, displayDate, displayExcerpt, excerptLength, feedURL, itemsToShow } = attributes; function toggleAttribute(propName) { return () => { const value = attributes[propName]; setAttributes({ [propName]: !value }); }; } function onSubmitURL(event) { event.preventDefault(); if (feedURL) { setAttributes({ feedURL: (0,external_wp_url_namespaceObject.prependHTTP)(feedURL) }); setIsEditing(false); } } const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const label = (0,external_wp_i18n_namespaceObject.__)('RSS URL'); if (isEditing) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { icon: library_rss, label: label, instructions: (0,external_wp_i18n_namespaceObject.__)('Display entries from any RSS or Atom feed.'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { onSubmit: onSubmitURL, className: "wp-block-rss__placeholder-form", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControl, { __next40pxDefaultSize: true, label: label, type: "url", hideLabelFromVision: true, placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter URL here…'), value: feedURL, onChange: value => setAttributes({ feedURL: value }), className: "wp-block-rss__placeholder-input" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", children: (0,external_wp_i18n_namespaceObject.__)('Apply') })] }) }) }); } const toolbarControls = [{ icon: library_edit, title: (0,external_wp_i18n_namespaceObject.__)('Edit RSS URL'), onClick: () => setIsEditing(true) }, { icon: library_list, title: (0,external_wp_i18n_namespaceObject._x)('List view', 'RSS block display setting'), onClick: () => setAttributes({ blockLayout: 'list' }), isActive: blockLayout === 'list' }, { icon: library_grid, title: (0,external_wp_i18n_namespaceObject._x)('Grid view', 'RSS block display setting'), onClick: () => setAttributes({ blockLayout: 'grid' }), isActive: blockLayout === 'grid' }]; /* * This function merges the existing attributes with additional style properties. * The `border` and `spacing` properties are set to `undefined` to ensure that * these styles are reset and not applied on the server side. */ const serverSideAttributes = { ...attributes, style: { ...attributes?.style, border: undefined, spacing: undefined } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { controls: toolbarControls }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Number of items'), value: itemsToShow, onChange: value => setAttributes({ itemsToShow: value }), min: DEFAULT_MIN_ITEMS, max: DEFAULT_MAX_ITEMS, required: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display author'), checked: displayAuthor, onChange: toggleAttribute('displayAuthor') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display date'), checked: displayDate, onChange: toggleAttribute('displayDate') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Display excerpt'), checked: displayExcerpt, onChange: toggleAttribute('displayExcerpt') }), displayExcerpt && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Max number of words in excerpt'), value: excerptLength, onChange: value => setAttributes({ excerptLength: value }), min: 10, max: 100, required: true }), blockLayout === 'grid' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Columns'), value: columns, onChange: value => setAttributes({ columns: value }), min: 2, max: 6, required: true })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { block: "core/rss", attributes: serverSideAttributes }) }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/rss/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const rss_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/rss", title: "RSS", category: "widgets", description: "Display entries from any RSS or Atom feed.", keywords: ["atom", "feed"], textdomain: "default", attributes: { columns: { type: "number", "default": 2 }, blockLayout: { type: "string", "default": "list" }, feedURL: { type: "string", "default": "" }, itemsToShow: { type: "number", "default": 5 }, displayExcerpt: { type: "boolean", "default": false }, displayAuthor: { type: "boolean", "default": false }, displayDate: { type: "boolean", "default": false }, excerptLength: { type: "number", "default": 55 } }, supports: { align: true, html: false, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { padding: false, margin: false } }, color: { background: true, text: true, gradients: true, link: true } }, editorStyle: "wp-block-rss-editor", style: "wp-block-rss" }; const { name: rss_name } = rss_metadata; const rss_settings = { icon: library_rss, example: { attributes: { feedURL: 'https://wordpress.org' } }, edit: RSSEdit }; const rss_init = () => initBlock({ name: rss_name, metadata: rss_metadata, settings: rss_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/search.js /** * WordPress dependencies */ const search = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) }); /* harmony default export */ const library_search = (search); ;// ./node_modules/@wordpress/block-library/build-module/search/icons.js /** * WordPress dependencies */ const buttonOnly = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "7", y: "10", width: "10", height: "4", rx: "1", fill: "currentColor" }) }); const buttonOutside = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "4.75", y: "15.25", width: "6.5", height: "9.5", transform: "rotate(-90 4.75 15.25)", stroke: "currentColor", strokeWidth: "1.5", fill: "none" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "16", y: "10", width: "4", height: "4", rx: "1", fill: "currentColor" })] }); const buttonInside = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "4.75", y: "15.25", width: "6.5", height: "14.5", transform: "rotate(-90 4.75 15.25)", stroke: "currentColor", strokeWidth: "1.5", fill: "none" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "14", y: "10", width: "4", height: "4", rx: "1", fill: "currentColor" })] }); const noButton = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "4.75", y: "15.25", width: "6.5", height: "14.5", transform: "rotate(-90 4.75 15.25)", stroke: "currentColor", fill: "none", strokeWidth: "1.5" }) }); const buttonWithIcon = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "4.75", y: "7.75", width: "14.5", height: "8.5", rx: "1.25", stroke: "currentColor", fill: "none", strokeWidth: "1.5" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "8", y: "11", width: "8", height: "2", fill: "currentColor" })] }); const toggleLabel = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "4.75", y: "17.25", width: "5.5", height: "14.5", transform: "rotate(-90 4.75 17.25)", stroke: "currentColor", fill: "none", strokeWidth: "1.5" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Rect, { x: "4", y: "7", width: "10", height: "2", fill: "currentColor" })] }); ;// ./node_modules/@wordpress/block-library/build-module/search/utils.js /** * Constants */ const PC_WIDTH_DEFAULT = 50; const PX_WIDTH_DEFAULT = 350; const MIN_WIDTH = 220; /** * Returns a boolean whether passed unit is percentage * * @param {string} unit Block width unit. * * @return {boolean} Whether unit is '%'. */ function utils_isPercentageUnit(unit) { return unit === '%'; } ;// ./node_modules/@wordpress/block-library/build-module/search/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ // Used to calculate border radius adjustment to avoid "fat" corners when // button is placed inside wrapper. const DEFAULT_INNER_PADDING = '4px'; const PERCENTAGE_WIDTHS = [25, 50, 75, 100]; function SearchEdit({ className, attributes, setAttributes, toggleSelection, isSelected, clientId }) { const { label, showLabel, placeholder, width, widthUnit, align, buttonText, buttonPosition, buttonUseIcon, isSearchFieldHidden, style } = attributes; const wasJustInsertedIntoNavigationBlock = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockParentsByBlockName, wasBlockJustInserted } = select(external_wp_blockEditor_namespaceObject.store); return !!getBlockParentsByBlockName(clientId, 'core/navigation')?.length && wasBlockJustInserted(clientId); }, [clientId]); const { __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); (0,external_wp_element_namespaceObject.useEffect)(() => { if (wasJustInsertedIntoNavigationBlock) { // This side-effect should not create an undo level. __unstableMarkNextChangeAsNotPersistent(); setAttributes({ showLabel: false, buttonUseIcon: true, buttonPosition: 'button-inside' }); } }, [__unstableMarkNextChangeAsNotPersistent, wasJustInsertedIntoNavigationBlock, setAttributes]); const borderRadius = style?.border?.radius; let borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); // Check for old deprecated numerical border radius. Done as a separate // check so that a borderRadius style won't overwrite the longhand // per-corner styles. if (typeof borderRadius === 'number') { borderProps = { ...borderProps, style: { ...borderProps.style, borderRadius: `${borderRadius}px` } }; } const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); const [fluidTypographySettings, layout] = (0,external_wp_blockEditor_namespaceObject.useSettings)('typography.fluid', 'layout'); const typographyProps = (0,external_wp_blockEditor_namespaceObject.getTypographyClassesAndStyles)(attributes, { typography: { fluid: fluidTypographySettings }, layout: { wideSize: layout?.wideSize } }); const unitControlInstanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl); const unitControlInputId = `wp-block-search__width-${unitControlInstanceId}`; const isButtonPositionInside = 'button-inside' === buttonPosition; const isButtonPositionOutside = 'button-outside' === buttonPosition; const hasNoButton = 'no-button' === buttonPosition; const hasOnlyButton = 'button-only' === buttonPosition; const searchFieldRef = (0,external_wp_element_namespaceObject.useRef)(); const buttonRef = (0,external_wp_element_namespaceObject.useRef)(); const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: ['%', 'px'], defaultValues: { '%': PC_WIDTH_DEFAULT, px: PX_WIDTH_DEFAULT } }); (0,external_wp_element_namespaceObject.useEffect)(() => { if (hasOnlyButton && !isSelected) { setAttributes({ isSearchFieldHidden: true }); } }, [hasOnlyButton, isSelected, setAttributes]); // Show the search field when width changes. (0,external_wp_element_namespaceObject.useEffect)(() => { if (!hasOnlyButton || !isSelected) { return; } setAttributes({ isSearchFieldHidden: false }); }, [hasOnlyButton, isSelected, setAttributes, width]); const getBlockClassNames = () => { return dist_clsx(className, isButtonPositionInside ? 'wp-block-search__button-inside' : undefined, isButtonPositionOutside ? 'wp-block-search__button-outside' : undefined, hasNoButton ? 'wp-block-search__no-button' : undefined, hasOnlyButton ? 'wp-block-search__button-only' : undefined, !buttonUseIcon && !hasNoButton ? 'wp-block-search__text-button' : undefined, buttonUseIcon && !hasNoButton ? 'wp-block-search__icon-button' : undefined, hasOnlyButton && isSearchFieldHidden ? 'wp-block-search__searchfield-hidden' : undefined); }; const buttonPositionControls = [{ role: 'menuitemradio', title: (0,external_wp_i18n_namespaceObject.__)('Button outside'), isActive: buttonPosition === 'button-outside', icon: buttonOutside, onClick: () => { setAttributes({ buttonPosition: 'button-outside', isSearchFieldHidden: false }); } }, { role: 'menuitemradio', title: (0,external_wp_i18n_namespaceObject.__)('Button inside'), isActive: buttonPosition === 'button-inside', icon: buttonInside, onClick: () => { setAttributes({ buttonPosition: 'button-inside', isSearchFieldHidden: false }); } }, { role: 'menuitemradio', title: (0,external_wp_i18n_namespaceObject.__)('No button'), isActive: buttonPosition === 'no-button', icon: noButton, onClick: () => { setAttributes({ buttonPosition: 'no-button', isSearchFieldHidden: false }); } }, { role: 'menuitemradio', title: (0,external_wp_i18n_namespaceObject.__)('Button only'), isActive: buttonPosition === 'button-only', icon: buttonOnly, onClick: () => { setAttributes({ buttonPosition: 'button-only', isSearchFieldHidden: true }); } }]; const getButtonPositionIcon = () => { switch (buttonPosition) { case 'button-inside': return buttonInside; case 'button-outside': return buttonOutside; case 'no-button': return noButton; case 'button-only': return buttonOnly; } }; const getResizableSides = () => { if (hasOnlyButton) { return {}; } return { right: align !== 'right', left: align === 'right' }; }; const renderTextField = () => { // If the input is inside the wrapper, the wrapper gets the border color styles/classes, not the input control. const textFieldClasses = dist_clsx('wp-block-search__input', isButtonPositionInside ? undefined : borderProps.className, typographyProps.className); const textFieldStyles = { ...(isButtonPositionInside ? { borderRadius } : borderProps.style), ...typographyProps.style, textDecoration: undefined }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("input", { type: "search", className: textFieldClasses, style: textFieldStyles, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Optional placeholder text') // We hide the placeholder field's placeholder when there is a value. This // stops screen readers from reading the placeholder field's placeholder // which is confusing. , placeholder: placeholder ? undefined : (0,external_wp_i18n_namespaceObject.__)('Optional placeholder…'), value: placeholder, onChange: event => setAttributes({ placeholder: event.target.value }), ref: searchFieldRef }); }; const renderButton = () => { // If the button is inside the wrapper, the wrapper gets the border color styles/classes, not the button. const buttonClasses = dist_clsx('wp-block-search__button', colorProps.className, typographyProps.className, isButtonPositionInside ? undefined : borderProps.className, buttonUseIcon ? 'has-icon' : undefined, (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('button')); const buttonStyles = { ...colorProps.style, ...typographyProps.style, ...(isButtonPositionInside ? { borderRadius } : borderProps.style) }; const handleButtonClick = () => { if (hasOnlyButton) { setAttributes({ isSearchFieldHidden: !isSearchFieldHidden }); } }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [buttonUseIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("button", { type: "button", className: buttonClasses, style: buttonStyles, "aria-label": buttonText ? (0,external_wp_dom_namespaceObject.__unstableStripHTML)(buttonText) : (0,external_wp_i18n_namespaceObject.__)('Search'), onClick: handleButtonClick, ref: buttonRef, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(build_module_icon, { icon: library_search }) }), !buttonUseIcon && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "buttonText", className: buttonClasses, style: buttonStyles, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Button text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Add button text…'), withoutInteractiveFormatting: true, value: buttonText, onChange: html => setAttributes({ buttonText: html }), onClick: handleButtonClick })] }); }; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const controls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ToolbarGroup, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { title: (0,external_wp_i18n_namespaceObject.__)('Show search label'), icon: toggleLabel, onClick: () => { setAttributes({ showLabel: !showLabel }); }, className: showLabel ? 'is-pressed' : undefined }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { icon: getButtonPositionIcon(), label: (0,external_wp_i18n_namespaceObject.__)('Change button position'), controls: buttonPositionControls }), !hasNoButton && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { title: (0,external_wp_i18n_namespaceObject.__)('Use button with icon'), icon: buttonWithIcon, onClick: () => { setAttributes({ buttonUseIcon: !buttonUseIcon }); }, className: buttonUseIcon ? 'is-pressed' : undefined })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ width: undefined, widthUnit: undefined }); }, dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!width, label: (0,external_wp_i18n_namespaceObject.__)('Width'), onDeselect: () => { setAttributes({ width: undefined, widthUnit: undefined }); }, isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Width'), id: unitControlInputId // Unused, kept for backwards compatibility , min: utils_isPercentageUnit(widthUnit) ? 0 : MIN_WIDTH, max: utils_isPercentageUnit(widthUnit) ? 100 : undefined, step: 1, onChange: newWidth => { const parsedNewWidth = newWidth === '' ? undefined : parseInt(newWidth, 10); setAttributes({ width: parsedNewWidth }); }, onUnitChange: newUnit => { setAttributes({ width: '%' === newUnit ? PC_WIDTH_DEFAULT : PX_WIDTH_DEFAULT, widthUnit: newUnit }); }, __unstableInputWidth: "80px", value: `${width}${widthUnit}`, units: units }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControl, { label: (0,external_wp_i18n_namespaceObject.__)('Percentage Width'), value: PERCENTAGE_WIDTHS.includes(width) && widthUnit === '%' ? width : undefined, hideLabelFromVision: true, onChange: newWidth => { setAttributes({ width: newWidth, widthUnit: '%' }); }, isBlock: true, __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, children: PERCENTAGE_WIDTHS.map(widthValue => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToggleGroupControlOption, { value: widthValue, label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: Percentage value. */ (0,external_wp_i18n_namespaceObject.__)('%d%%'), widthValue) }, widthValue); }) })] }) }) }) })] }); const padBorderRadius = radius => radius ? `calc(${radius} + ${DEFAULT_INNER_PADDING})` : undefined; const getWrapperStyles = () => { const styles = isButtonPositionInside ? borderProps.style : { borderRadius: borderProps.style?.borderRadius, borderTopLeftRadius: borderProps.style?.borderTopLeftRadius, borderTopRightRadius: borderProps.style?.borderTopRightRadius, borderBottomLeftRadius: borderProps.style?.borderBottomLeftRadius, borderBottomRightRadius: borderProps.style?.borderBottomRightRadius }; const isNonZeroBorderRadius = borderRadius !== undefined && parseInt(borderRadius, 10) !== 0; if (isButtonPositionInside && isNonZeroBorderRadius) { // We have button inside wrapper and a border radius value to apply. // Add default padding so we don't get "fat" corners. // // CSS calc() is used here to support non-pixel units. The inline // style using calc() will only apply if both values have units. if (typeof borderRadius === 'object') { // Individual corner border radii present. const { topLeft, topRight, bottomLeft, bottomRight } = borderRadius; return { ...styles, borderTopLeftRadius: padBorderRadius(topLeft), borderTopRightRadius: padBorderRadius(topRight), borderBottomLeftRadius: padBorderRadius(bottomLeft), borderBottomRightRadius: padBorderRadius(bottomRight) }; } // The inline style using calc() will only apply if both values // supplied to calc() have units. Deprecated block's may have // unitless integer. const radius = Number.isInteger(borderRadius) ? `${borderRadius}px` : borderRadius; styles.borderRadius = `calc(${radius} + ${DEFAULT_INNER_PADDING})`; } return styles; }; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: getBlockClassNames(), style: { ...typographyProps.style, // Input opts out of text decoration. textDecoration: undefined } }); const labelClassnames = dist_clsx('wp-block-search__label', typographyProps.className); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [controls, showLabel && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { identifier: "label", className: labelClassnames, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Label text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Add label…'), withoutInteractiveFormatting: true, value: label, onChange: html => setAttributes({ label: html }), style: typographyProps.style }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.ResizableBox, { size: { width: width === undefined ? 'auto' : `${width}${widthUnit}`, height: 'auto' }, className: dist_clsx('wp-block-search__inside-wrapper', isButtonPositionInside ? borderProps.className : undefined), style: getWrapperStyles(), minWidth: MIN_WIDTH, enable: getResizableSides(), onResizeStart: (event, direction, elt) => { setAttributes({ width: parseInt(elt.offsetWidth, 10), widthUnit: 'px' }); toggleSelection(false); }, onResizeStop: (event, direction, elt, delta) => { setAttributes({ width: parseInt(width + delta.width, 10) }); toggleSelection(true); }, showHandle: isSelected, children: [(isButtonPositionInside || isButtonPositionOutside || hasOnlyButton) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [renderTextField(), renderButton()] }), hasNoButton && renderTextField()] })] }); } ;// ./node_modules/@wordpress/block-library/build-module/search/variations.js /** * WordPress dependencies */ const search_variations_variations = [{ name: 'default', isDefault: true, attributes: { buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'), label: (0,external_wp_i18n_namespaceObject.__)('Search') } }]; /* harmony default export */ const search_variations = (search_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/search/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const search_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/search", title: "Search", category: "widgets", description: "Help visitors find your content.", keywords: ["find"], textdomain: "default", attributes: { label: { type: "string", role: "content" }, showLabel: { type: "boolean", "default": true }, placeholder: { type: "string", "default": "", role: "content" }, width: { type: "number" }, widthUnit: { type: "string" }, buttonText: { type: "string", role: "content" }, buttonPosition: { type: "string", "default": "button-outside" }, buttonUseIcon: { type: "boolean", "default": false }, query: { type: "object", "default": {} }, isSearchFieldHidden: { type: "boolean", "default": false } }, supports: { align: ["left", "center", "right"], color: { gradients: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { background: true, text: true } }, interactivity: true, typography: { __experimentalSkipSerialization: true, __experimentalSelector: ".wp-block-search__label, .wp-block-search__input, .wp-block-search__button", fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { color: true, radius: true, width: true, __experimentalSkipSerialization: true, __experimentalDefaultControls: { color: true, radius: true, width: true } }, spacing: { margin: true }, html: false }, editorStyle: "wp-block-search-editor", style: "wp-block-search" }; const { name: search_name } = search_metadata; const search_settings = { icon: library_search, example: { attributes: { buttonText: (0,external_wp_i18n_namespaceObject.__)('Search'), label: (0,external_wp_i18n_namespaceObject.__)('Search') }, viewportWidth: 400 }, variations: search_variations, edit: SearchEdit }; const search_init = () => initBlock({ name: search_name, metadata: search_metadata, settings: search_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/separator.js /** * WordPress dependencies */ const separator = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4.5 12.5v4H3V7h1.5v3.987h15V7H21v9.5h-1.5v-4h-15Z" }) }); /* harmony default export */ const library_separator = (separator); ;// ./node_modules/@wordpress/block-library/build-module/separator/use-deprecated-opacity.js /** * WordPress dependencies */ function useDeprecatedOpacity(opacity, currentColor, setAttributes) { const [deprecatedOpacityWithNoColor, setDeprecatedOpacityWithNoColor] = (0,external_wp_element_namespaceObject.useState)(false); const previousColor = (0,external_wp_compose_namespaceObject.usePrevious)(currentColor); // A separator with no color set will always have previousColor set to undefined, // and we need to differentiate these from those with color set that will return // previousColor as undefined on the first render. (0,external_wp_element_namespaceObject.useEffect)(() => { if (opacity === 'css' && !currentColor && !previousColor) { setDeprecatedOpacityWithNoColor(true); } }, [currentColor, previousColor, opacity]); // For deprecated blocks, that have a default 0.4 css opacity set, we // need to remove this if the current color is changed, or a color is added. // In these instances the opacity attribute is set back to the default of // alpha-channel which allows a new custom opacity to be set via the color picker. (0,external_wp_element_namespaceObject.useEffect)(() => { if (opacity === 'css' && (deprecatedOpacityWithNoColor && currentColor || previousColor && currentColor !== previousColor)) { setAttributes({ opacity: 'alpha-channel' }); setDeprecatedOpacityWithNoColor(false); } }, [deprecatedOpacityWithNoColor, currentColor, previousColor]); } ;// ./node_modules/@wordpress/block-library/build-module/separator/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function SeparatorEdit({ attributes, setAttributes }) { const { backgroundColor, opacity, style, tagName } = attributes; const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); const currentColor = colorProps?.style?.backgroundColor; const hasCustomColor = !!style?.color?.background; useDeprecatedOpacity(opacity, currentColor, setAttributes); // The dots styles uses text for the dots, to change those dots color is // using color, not backgroundColor. const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor); const className = dist_clsx({ 'has-text-color': backgroundColor || currentColor, [colorClass]: colorClass, 'has-css-opacity': opacity === 'css', 'has-alpha-channel-opacity': opacity === 'alpha-channel' }, colorProps.className); const styles = { color: currentColor, backgroundColor: currentColor }; const Wrapper = tagName === 'hr' ? external_wp_components_namespaceObject.HorizontalRule : tagName; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), options: [{ label: (0,external_wp_i18n_namespaceObject.__)('Default (<hr>)'), value: 'hr' }, { label: '<div>', value: 'div' }], value: tagName, onChange: value => setAttributes({ tagName: value }), help: htmlElementMessages[tagName] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Wrapper, { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className, style: hasCustomColor ? styles : undefined }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/separator/save.js /** * External dependencies */ /** * WordPress dependencies */ function separatorSave({ attributes }) { const { backgroundColor, style, opacity, tagName: Tag } = attributes; const customColor = style?.color?.background; const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); // The hr support changing color using border-color, since border-color // is not yet supported in the color palette, we use background-color. // The dots styles uses text for the dots, to change those dots color is // using color, not backgroundColor. const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', backgroundColor); const className = dist_clsx({ 'has-text-color': backgroundColor || customColor, [colorClass]: colorClass, 'has-css-opacity': opacity === 'css', 'has-alpha-channel-opacity': opacity === 'alpha-channel' }, colorProps.className); const styles = { backgroundColor: colorProps?.style?.backgroundColor, color: colorClass ? undefined : customColor }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style: styles }) }); } ;// ./node_modules/@wordpress/block-library/build-module/separator/transforms.js /** * WordPress dependencies */ const separator_transforms_transforms = { from: [{ type: 'enter', regExp: /^-{3,}$/, transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/separator') }, { type: 'raw', selector: 'hr', schema: { hr: {} } }], to: [{ type: 'block', blocks: ['core/spacer'], // Transform to Spacer. transform: ({ anchor }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/spacer', { anchor: anchor || '' }); } }] }; /* harmony default export */ const separator_transforms = (separator_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/separator/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ const separator_deprecated_v1 = { attributes: { color: { type: 'string' }, customColor: { type: 'string' } }, save({ attributes }) { const { color, customColor } = attributes; // the hr support changing color using border-color, since border-color // is not yet supported in the color palette, we use background-color const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', color); // the dots styles uses text for the dots, to change those dots color is // using color, not backgroundColor const colorClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('color', color); const className = dist_clsx({ 'has-text-color has-background': color || customColor, [backgroundClass]: backgroundClass, [colorClass]: colorClass }); const style = { backgroundColor: backgroundClass ? undefined : customColor, color: colorClass ? undefined : customColor }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("hr", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style }) }); }, migrate(attributes) { const { color, customColor, ...restAttributes } = attributes; return { ...restAttributes, backgroundColor: color ? color : undefined, opacity: 'css', style: customColor ? { color: { background: customColor } } : undefined, tagName: 'hr' }; } }; /* harmony default export */ const separator_deprecated = ([separator_deprecated_v1]); ;// ./node_modules/@wordpress/block-library/build-module/separator/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const separator_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/separator", title: "Separator", category: "design", description: "Create a break between ideas or sections with a horizontal separator.", keywords: ["horizontal-line", "hr", "divider"], textdomain: "default", attributes: { opacity: { type: "string", "default": "alpha-channel" }, tagName: { type: "string", "enum": ["hr", "div"], "default": "hr" } }, supports: { anchor: true, align: ["center", "wide", "full"], color: { enableContrastChecker: false, __experimentalSkipSerialization: true, gradients: true, background: true, text: false, __experimentalDefaultControls: { background: true } }, spacing: { margin: ["top", "bottom"] }, interactivity: { clientNavigation: true } }, styles: [{ name: "default", label: "Default", isDefault: true }, { name: "wide", label: "Wide Line" }, { name: "dots", label: "Dots" }], editorStyle: "wp-block-separator-editor", style: "wp-block-separator" }; const { name: separator_name } = separator_metadata; const separator_settings = { icon: library_separator, example: { attributes: { customColor: '#065174', className: 'is-style-wide' } }, transforms: separator_transforms, edit: SeparatorEdit, save: separatorSave, deprecated: separator_deprecated }; const separator_init = () => initBlock({ name: separator_name, metadata: separator_metadata, settings: separator_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/shortcode.js /** * WordPress dependencies */ const shortcode = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z" }) }); /* harmony default export */ const library_shortcode = (shortcode); ;// ./node_modules/@wordpress/block-library/build-module/shortcode/edit.js /** * WordPress dependencies */ function ShortcodeEdit({ attributes, setAttributes }) { const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(ShortcodeEdit); const inputId = `blocks-shortcode-input-${instanceId}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { icon: library_shortcode, label: (0,external_wp_i18n_namespaceObject.__)('Shortcode'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.PlainText, { className: "blocks-shortcode__textarea", id: inputId, value: attributes.text, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Shortcode text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Write shortcode here…'), onChange: text => setAttributes({ text }) }) }) }); } ;// ./node_modules/@wordpress/block-library/build-module/shortcode/save.js /** * WordPress dependencies */ function shortcode_save_save({ attributes }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_element_namespaceObject.RawHTML, { children: attributes.text }); } ;// external ["wp","autop"] const external_wp_autop_namespaceObject = window["wp"]["autop"]; ;// ./node_modules/@wordpress/block-library/build-module/shortcode/transforms.js /** * WordPress dependencies */ const shortcode_transforms_transforms = { from: [{ type: 'shortcode', // Per "Shortcode names should be all lowercase and use all // letters, but numbers and underscores should work fine too. // Be wary of using hyphens (dashes), you'll be better off not // using them." in https://codex.wordpress.org/Shortcode_API // Require that the first character be a letter. This notably // prevents footnote markings ([1]) from being caught as // shortcodes. tag: '[a-z][a-z0-9_-]*', attributes: { text: { type: 'string', shortcode: (attrs, { content }) => { return (0,external_wp_autop_namespaceObject.removep)((0,external_wp_autop_namespaceObject.autop)(content)); } } }, priority: 20 }] }; /* harmony default export */ const shortcode_transforms = (shortcode_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/shortcode/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const shortcode_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/shortcode", title: "Shortcode", category: "widgets", description: "Insert additional custom elements with a WordPress shortcode.", textdomain: "default", attributes: { text: { type: "string", source: "raw" } }, supports: { className: false, customClassName: false, html: false }, editorStyle: "wp-block-shortcode-editor" }; const { name: shortcode_name } = shortcode_metadata; const shortcode_settings = { icon: library_shortcode, transforms: shortcode_transforms, edit: ShortcodeEdit, save: shortcode_save_save }; const shortcode_init = () => initBlock({ name: shortcode_name, metadata: shortcode_metadata, settings: shortcode_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/site-logo.js /** * WordPress dependencies */ const siteLogo = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 3c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 1.5c4.1 0 7.5 3.4 7.5 7.5v.1c-1.4-.8-3.3-1.7-3.4-1.8-.2-.1-.5-.1-.8.1l-2.9 2.1L9 11.3c-.2-.1-.4 0-.6.1l-3.7 2.2c-.1-.5-.2-1-.2-1.5 0-4.2 3.4-7.6 7.5-7.6zm0 15c-3.1 0-5.7-1.9-6.9-4.5l3.7-2.2 3.5 1.2c.2.1.5 0 .7-.1l2.9-2.1c.8.4 2.5 1.2 3.5 1.9-.9 3.3-3.9 5.8-7.4 5.8z" }) }); /* harmony default export */ const site_logo = (siteLogo); ;// ./node_modules/@wordpress/block-library/build-module/site-logo/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const site_logo_edit_ALLOWED_MEDIA_TYPES = ['image']; const ACCEPT_MEDIA_STRING = 'image/*'; const SiteLogo = ({ alt, attributes: { align, width, height, isLink, linkTarget, shouldSyncIcon }, isSelected, setAttributes, setLogo, logoUrl, siteUrl, logoId, iconId, setIcon, canUserEdit }) => { const isLargeViewport = (0,external_wp_compose_namespaceObject.useViewportMatch)('medium'); const isWideAligned = ['wide', 'full'].includes(align); const isResizable = !isWideAligned && isLargeViewport; const [{ naturalWidth, naturalHeight }, setNaturalSize] = (0,external_wp_element_namespaceObject.useState)({}); const [isEditingImage, setIsEditingImage] = (0,external_wp_element_namespaceObject.useState)(false); const { toggleSelection } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const { imageEditing, maxWidth, title } = (0,external_wp_data_namespaceObject.useSelect)(select => { const settings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); const siteEntities = select(external_wp_coreData_namespaceObject.store).getEntityRecord('root', '__unstableBase'); return { title: siteEntities?.name, imageEditing: settings.imageEditing, maxWidth: settings.maxWidth }; }, []); (0,external_wp_element_namespaceObject.useEffect)(() => { // Turn the `Use as site icon` toggle off if it is on but the logo and icon have // fallen out of sync. This can happen if the toggle is saved in the `on` position, // but changes are later made to the site icon in the Customizer. if (shouldSyncIcon && logoId !== iconId) { setAttributes({ shouldSyncIcon: false }); } }, []); (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isSelected) { setIsEditingImage(false); } }, [isSelected]); function onResizeStart() { toggleSelection(false); } function onResizeStop() { toggleSelection(true); } const img = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { className: "custom-logo", src: logoUrl, alt: alt, onLoad: event => { setNaturalSize({ naturalWidth: event.target.naturalWidth, naturalHeight: event.target.naturalHeight }); } }), (0,external_wp_blob_namespaceObject.isBlobURL)(logoUrl) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {})] }); let imgWrapper = img; // Disable reason: Image itself is not meant to be interactive, but // should direct focus to block. if (isLink) { imgWrapper = /*#__PURE__*/ /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */ (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: siteUrl, className: "custom-logo-link", rel: "home", title: title, onClick: event => event.preventDefault(), children: img }) /* eslint-enable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */; } if (!isResizable || !naturalWidth || !naturalHeight) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { style: { width, height }, children: imgWrapper }); } // Set the default width to a responsible size. // Note that this width is also set in the attached frontend CSS file. const defaultWidth = 120; const currentWidth = width || defaultWidth; const ratio = naturalWidth / naturalHeight; const currentHeight = currentWidth / ratio; const minWidth = naturalWidth < naturalHeight ? constants_MIN_SIZE : Math.ceil(constants_MIN_SIZE * ratio); const minHeight = naturalHeight < naturalWidth ? constants_MIN_SIZE : Math.ceil(constants_MIN_SIZE / ratio); // With the current implementation of ResizableBox, an image needs an // explicit pixel value for the max-width. In absence of being able to // set the content-width, this max-width is currently dictated by the // vanilla editor style. The following variable adds a buffer to this // vanilla style, so 3rd party themes have some wiggleroom. This does, // in most cases, allow you to scale the image beyond the width of the // main column, though not infinitely. // @todo It would be good to revisit this once a content-width variable // becomes available. const maxWidthBuffer = maxWidth * 2.5; let showRightHandle = false; let showLeftHandle = false; /* eslint-disable no-lonely-if */ // See https://github.com/WordPress/gutenberg/issues/7584. if (align === 'center') { // When the image is centered, show both handles. showRightHandle = true; showLeftHandle = true; } else if ((0,external_wp_i18n_namespaceObject.isRTL)()) { // In RTL mode the image is on the right by default. // Show the right handle and hide the left handle only when it is // aligned left. Otherwise always show the left handle. if (align === 'left') { showRightHandle = true; } else { showLeftHandle = true; } } else { // Show the left handle and hide the right handle only when the // image is aligned right. Otherwise always show the right handle. if (align === 'right') { showLeftHandle = true; } else { showRightHandle = true; } } /* eslint-enable no-lonely-if */ const canEditImage = logoId && naturalWidth && naturalHeight && imageEditing; const imgEdit = canEditImage && isEditingImage ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, { id: logoId, url: logoUrl, width: currentWidth, height: currentHeight, naturalHeight: naturalHeight, naturalWidth: naturalWidth, onSaveImage: imageAttributes => { setLogo(imageAttributes.id); }, onFinishEditing: () => { setIsEditingImage(false); } }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { size: { width: currentWidth, height: currentHeight }, showHandle: isSelected, minWidth: minWidth, maxWidth: maxWidthBuffer, minHeight: minHeight, maxHeight: maxWidthBuffer / ratio, lockAspectRatio: true, enable: { top: false, right: showRightHandle, bottom: true, left: showLeftHandle }, onResizeStart: onResizeStart, onResizeStop: (event, direction, elt, delta) => { onResizeStop(); setAttributes({ width: parseInt(currentWidth + delta.width, 10), height: parseInt(currentHeight + delta.height, 10) }); }, children: imgWrapper }); // Support the previous location for the Site Icon settings. To be removed // when the required WP core version for Gutenberg is >= 6.5.0. const shouldUseNewUrl = !window?.__experimentalUseCustomizerSiteLogoUrl; const siteIconSettingsUrl = shouldUseNewUrl ? siteUrl + '/wp-admin/options-general.php' : siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline'; const syncSiteIconHelpText = (0,external_wp_element_namespaceObject.createInterpolateElement)((0,external_wp_i18n_namespaceObject.__)('Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'), { a: /*#__PURE__*/ // eslint-disable-next-line jsx-a11y/anchor-has-content (0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: siteIconSettingsUrl, target: "_blank", rel: "noopener noreferrer" }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Settings'), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Image width'), onChange: newWidth => setAttributes({ width: newWidth }), min: minWidth, max: maxWidthBuffer, initialPosition: Math.min(defaultWidth, maxWidthBuffer), value: width || '', disabled: !isResizable }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link image to home'), onChange: () => setAttributes({ isLink: !isLink }), checked: isLink }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: value => setAttributes({ linkTarget: value ? '_blank' : '_self' }), checked: linkTarget === '_blank' }) }), canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Use as Site Icon'), onChange: value => { setAttributes({ shouldSyncIcon: value }); setIcon(value ? logoId : undefined); }, checked: !!shouldSyncIcon, help: syncSiteIconHelpText }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: canEditImage && !isEditingImage && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => setIsEditingImage(true), icon: library_crop, label: (0,external_wp_i18n_namespaceObject.__)('Crop') }) }), imgEdit] }); }; // This is a light wrapper around MediaReplaceFlow because the block has two // different MediaReplaceFlows, one for the inspector and one for the toolbar. function SiteLogoReplaceFlow({ mediaURL, ...mediaReplaceProps }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaReplaceFlow, { ...mediaReplaceProps, mediaURL: mediaURL, allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES, accept: ACCEPT_MEDIA_STRING }); } const InspectorLogoPreview = ({ media, itemGroupProps }) => { const { alt_text: alt, source_url: logoUrl, slug: logoSlug, media_details: logoMediaDetails } = media !== null && media !== void 0 ? media : {}; const logoLabel = logoMediaDetails?.sizes?.full?.file || logoSlug; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalItemGroup, { ...itemGroupProps, as: "span", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "flex-start", as: "span", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("img", { src: logoUrl, alt: alt }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { as: "span", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalTruncate, { numberOfLines: 1, className: "block-library-site-logo__inspector-media-replace-title", children: logoLabel }) })] }) }); }; function LogoEdit({ attributes, className, setAttributes, isSelected }) { const { width, shouldSyncIcon } = attributes; const { siteLogoId, canUserEdit, url, siteIconId, mediaItemData, isRequestingMediaItem } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canUser, getEntityRecord, getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const _canUserEdit = canUser('update', { kind: 'root', name: 'site' }); const siteSettings = _canUserEdit ? getEditedEntityRecord('root', 'site') : undefined; const siteData = getEntityRecord('root', '__unstableBase'); const _siteLogoId = _canUserEdit ? siteSettings?.site_logo : siteData?.site_logo; const _siteIconId = siteSettings?.site_icon; const mediaItem = _siteLogoId && select(external_wp_coreData_namespaceObject.store).getMedia(_siteLogoId, { context: 'view' }); const _isRequestingMediaItem = !!_siteLogoId && !select(external_wp_coreData_namespaceObject.store).hasFinishedResolution('getMedia', [_siteLogoId, { context: 'view' }]); return { siteLogoId: _siteLogoId, canUserEdit: _canUserEdit, url: siteData?.home, mediaItemData: mediaItem, isRequestingMediaItem: _isRequestingMediaItem, siteIconId: _siteIconId }; }, []); const { getSettings } = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store); const [temporaryURL, setTemporaryURL] = (0,external_wp_element_namespaceObject.useState)(); const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const setLogo = (newValue, shouldForceSync = false) => { // `shouldForceSync` is used to force syncing when the attribute // may not have updated yet. if (shouldSyncIcon || shouldForceSync) { setIcon(newValue); } editEntityRecord('root', 'site', undefined, { site_logo: newValue }); }; const setIcon = newValue => // The new value needs to be `null` to reset the Site Icon. editEntityRecord('root', 'site', undefined, { site_icon: newValue !== null && newValue !== void 0 ? newValue : null }); const { alt_text: alt, source_url: logoUrl } = mediaItemData !== null && mediaItemData !== void 0 ? mediaItemData : {}; const onInitialSelectLogo = media => { // Initialize the syncSiteIcon toggle. If we currently have no Site logo and no // site icon, automatically sync the logo to the icon. if (shouldSyncIcon === undefined) { const shouldForceSync = !siteIconId; setAttributes({ shouldSyncIcon: shouldForceSync }); // Because we cannot rely on the `shouldSyncIcon` attribute to have updated by // the time `setLogo` is called, pass an argument to force the syncing. onSelectLogo(media, shouldForceSync); return; } onSelectLogo(media); }; const onSelectLogo = (media, shouldForceSync = false) => { if (!media) { return; } if (!media.id && media.url) { // This is a temporary blob image. setTemporaryURL(media.url); setLogo(undefined); return; } setLogo(media.id, shouldForceSync); }; const onRemoveLogo = () => { setLogo(null); setAttributes({ width: undefined }); }; const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const onUploadError = message => { createErrorNotice(message, { type: 'snackbar' }); setTemporaryURL(); }; const onFilesDrop = filesList => { getSettings().mediaUpload({ allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES, filesList, onFileChange([image]) { if ((0,external_wp_blob_namespaceObject.isBlobURL)(image?.url)) { setTemporaryURL(image.url); return; } onInitialSelectLogo(image); }, onError: onUploadError, multiple: false }); }; const mediaReplaceFlowProps = { mediaURL: logoUrl, name: !logoUrl ? (0,external_wp_i18n_namespaceObject.__)('Choose logo') : (0,external_wp_i18n_namespaceObject.__)('Replace'), onSelect: onSelectLogo, onError: onUploadError, onReset: onRemoveLogo }; const controls = canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteLogoReplaceFlow, { ...mediaReplaceFlowProps }) }); let logoImage; const isLoading = siteLogoId === undefined || isRequestingMediaItem; if (isLoading) { logoImage = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}); } // Reset temporary url when logoUrl is available. (0,external_wp_element_namespaceObject.useEffect)(() => { if (logoUrl && temporaryURL) { setTemporaryURL(); } }, [logoUrl, temporaryURL]); if (!!logoUrl || !!temporaryURL) { logoImage = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteLogo, { alt: alt, attributes: attributes, className: className, isSelected: isSelected, setAttributes: setAttributes, logoUrl: temporaryURL || logoUrl, setLogo: setLogo, logoId: mediaItemData?.id || siteLogoId, siteUrl: url, setIcon: setIcon, iconId: siteIconId, canUserEdit: canUserEdit }), canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, { onFilesDrop: onFilesDrop })] }); } const placeholder = content => { const placeholderClassName = dist_clsx('block-editor-media-placeholder', className); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className: placeholderClassName, preview: logoImage, withIllustration: true, style: { width }, children: content }); }; const classes = dist_clsx(className, { 'is-default-size': !width, 'is-transient': temporaryURL }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: classes }); const mediaInspectorPanel = (canUserEdit || logoUrl) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Media'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-library-site-logo__inspector-media-replace-container", children: !canUserEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorLogoPreview, { media: mediaItemData, itemGroupProps: { isBordered: true, className: 'block-library-site-logo__inspector-readonly-logo-preview' } }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteLogoReplaceFlow, { ...mediaReplaceFlowProps, name: !!logoUrl ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(InspectorLogoPreview, { media: mediaItemData }) : (0,external_wp_i18n_namespaceObject.__)('Choose logo'), renderToggle: props => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { ...props, __next40pxDefaultSize: true, children: temporaryURL ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) : props.children }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.DropZone, { onFilesDrop: onFilesDrop })] }) }) }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { ...blockProps, children: [controls, mediaInspectorPanel, (!!logoUrl || !!temporaryURL) && logoImage, (isLoading || !temporaryURL && !logoUrl && !canUserEdit) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { className: "site-logo_placeholder", withIllustration: true, children: isLoading && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: "components-placeholder__preview", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) }) }), !isLoading && !temporaryURL && !logoUrl && canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.MediaPlaceholder, { onSelect: onInitialSelectLogo, accept: ACCEPT_MEDIA_STRING, allowedTypes: site_logo_edit_ALLOWED_MEDIA_TYPES, onError: onUploadError, placeholder: placeholder, mediaLibraryButton: ({ open }) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, icon: library_upload, variant: "primary", label: (0,external_wp_i18n_namespaceObject.__)('Choose logo'), showTooltip: true, tooltipPosition: "middle right", onClick: () => { open(); } }); } })] }); } ;// ./node_modules/@wordpress/block-library/build-module/site-logo/transforms.js /** * WordPress dependencies */ const site_logo_transforms_transforms = { to: [{ type: 'block', blocks: ['core/site-title'], transform: ({ isLink, linkTarget }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-title', { isLink, linkTarget }); } }] }; /* harmony default export */ const site_logo_transforms = (site_logo_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/site-logo/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const site_logo_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/site-logo", title: "Site Logo", category: "theme", description: "Display an image to represent this site. Update this block and the changes apply everywhere.", textdomain: "default", attributes: { width: { type: "number" }, isLink: { type: "boolean", "default": true, role: "content" }, linkTarget: { type: "string", "default": "_self", role: "content" }, shouldSyncIcon: { type: "boolean" } }, example: { viewportWidth: 500, attributes: { width: 350, className: "block-editor-block-types-list__site-logo-example" } }, supports: { html: false, align: true, alignWide: false, color: { __experimentalDuotone: "img, .components-placeholder__illustration, .components-placeholder::before", text: false, background: false }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, interactivity: { clientNavigation: true } }, styles: [{ name: "default", label: "Default", isDefault: true }, { name: "rounded", label: "Rounded" }], editorStyle: "wp-block-site-logo-editor", style: "wp-block-site-logo" }; const { name: site_logo_name } = site_logo_metadata; const site_logo_settings = { icon: site_logo, example: {}, edit: LogoEdit, transforms: site_logo_transforms }; const site_logo_init = () => initBlock({ name: site_logo_name, metadata: site_logo_metadata, settings: site_logo_settings }); ;// ./node_modules/@wordpress/block-library/build-module/site-tagline/edit.js /** * External dependencies */ /** * WordPress dependencies */ function SiteTaglineEdit({ attributes, setAttributes, insertBlocksAfter }) { const { textAlign, level, levelOptions } = attributes; const { canUserEdit, tagline } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canUser, getEntityRecord, getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const canEdit = canUser('update', { kind: 'root', name: 'site' }); const settings = canEdit ? getEditedEntityRecord('root', 'site') : {}; const readOnlySettings = getEntityRecord('root', '__unstableBase'); return { canUserEdit: canEdit, tagline: canEdit ? settings?.description : readOnlySettings?.description }; }, []); const TagName = level === 0 ? 'p' : `h${level}`; const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); function setTagline(newTagline) { editEntityRecord('root', 'site', undefined, { description: newTagline }); } const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign, 'wp-block-site-tagline__placeholder': !canUserEdit && !tagline }) }); const siteTaglineContent = canUserEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { allowedFormats: [], onChange: setTagline, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site tagline text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site tagline…'), tagName: TagName, value: tagline, disableLineBreaks: true, __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())), ...blockProps }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: tagline || (0,external_wp_i18n_namespaceObject.__)('Site Tagline placeholder') }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { value: level, options: levelOptions, onChange: newLevel => setAttributes({ level: newLevel }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { onChange: newAlign => setAttributes({ textAlign: newAlign }), value: textAlign })] }), siteTaglineContent] }); } ;// ./node_modules/@wordpress/block-library/build-module/site-tagline/icon.js /** * WordPress dependencies */ /* harmony default export */ const site_tagline_icon = (/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Path, { d: "M4 10.5h16V9H4v1.5ZM4 15h9v-1.5H4V15Z" }) })); ;// ./node_modules/@wordpress/block-library/build-module/site-tagline/deprecated.js /** * Internal dependencies */ const site_tagline_deprecated_v1 = { attributes: { textAlign: { type: 'string' } }, supports: { align: ['wide', 'full'], html: false, color: { gradients: true }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalTextTransform: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true } }, save() { return null; }, migrate: migrate_font_family, isEligible({ style }) { return style?.typography?.fontFamily; } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const site_tagline_deprecated = ([site_tagline_deprecated_v1]); ;// ./node_modules/@wordpress/block-library/build-module/site-tagline/index.js /** * Internal dependencies */ const site_tagline_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/site-tagline", title: "Site Tagline", category: "theme", description: "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it\u2019s not displayed in the theme design.", keywords: ["description"], textdomain: "default", attributes: { textAlign: { type: "string" }, level: { type: "number", "default": 0 }, levelOptions: { type: "array", "default": [0, 1, 2, 3, 4, 5, 6] } }, example: { viewportWidth: 350, attributes: { textAlign: "center" } }, supports: { align: ["wide", "full"], html: false, color: { gradients: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalWritingMode: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true } }, editorStyle: "wp-block-site-tagline-editor", style: "wp-block-site-tagline" }; const { name: site_tagline_name } = site_tagline_metadata; const site_tagline_settings = { icon: site_tagline_icon, edit: SiteTaglineEdit, deprecated: site_tagline_deprecated }; const site_tagline_init = () => initBlock({ name: site_tagline_name, metadata: site_tagline_metadata, settings: site_tagline_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/map-marker.js /** * WordPress dependencies */ const mapMarker = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z" }) }); /* harmony default export */ const map_marker = (mapMarker); ;// ./node_modules/@wordpress/block-library/build-module/site-title/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function SiteTitleEdit({ attributes, setAttributes, insertBlocksAfter }) { const { level, levelOptions, textAlign, isLink, linkTarget } = attributes; const { canUserEdit, title } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { canUser, getEntityRecord, getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const canEdit = canUser('update', { kind: 'root', name: 'site' }); const settings = canEdit ? getEditedEntityRecord('root', 'site') : {}; const readOnlySettings = getEntityRecord('root', '__unstableBase'); return { canUserEdit: canEdit, title: canEdit ? settings?.title : readOnlySettings?.name }; }, []); const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); function setTitle(newTitle) { editEntityRecord('root', 'site', undefined, { title: newTitle }); } const TagName = level === 0 ? 'p' : `h${level}`; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign, 'wp-block-site-title__placeholder': !canUserEdit && !title }) }); const siteTitleContent = canUserEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { tagName: isLink ? 'a' : 'span', href: isLink ? '#site-title-pseudo-link' : undefined, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Site title text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Write site title…'), value: title, onChange: setTitle, allowedFormats: [], disableLineBreaks: true, __unstableOnSplitAtEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: isLink ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { href: "#site-title-pseudo-link", onClick: event => event.preventDefault(), children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder') }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(title) || (0,external_wp_i18n_namespaceObject.__)('Site Title placeholder') }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.HeadingLevelDropdown, { value: level, options: levelOptions, onChange: newLevel => setAttributes({ level: newLevel }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ isLink: true, linkTarget: '_self' }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !isLink, label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'), onDeselect: () => setAttributes({ isLink: true }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Make title link to home'), onChange: () => setAttributes({ isLink: !isLink }), checked: isLink }) }), isLink && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => linkTarget !== '_self', label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onDeselect: () => setAttributes({ linkTarget: '_self' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open in new tab'), onChange: value => setAttributes({ linkTarget: value ? '_blank' : '_self' }), checked: linkTarget === '_blank' }) })] }) }), siteTitleContent] }); } ;// ./node_modules/@wordpress/block-library/build-module/site-title/deprecated.js /** * Internal dependencies */ const site_title_deprecated_v1 = { attributes: { level: { type: 'number', default: 1 }, textAlign: { type: 'string' }, isLink: { type: 'boolean', default: true }, linkTarget: { type: 'string', default: '_self' } }, supports: { align: ['wide', 'full'], html: false, color: { gradients: true, link: true }, spacing: { padding: true, margin: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalTextTransform: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true } }, save() { return null; }, migrate: migrate_font_family, isEligible({ style }) { return style?.typography?.fontFamily; } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const site_title_deprecated = ([site_title_deprecated_v1]); ;// ./node_modules/@wordpress/block-library/build-module/site-title/transforms.js /** * WordPress dependencies */ const site_title_transforms_transforms = { to: [{ type: 'block', blocks: ['core/site-logo'], transform: ({ isLink, linkTarget }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/site-logo', { isLink, linkTarget }); } }] }; /* harmony default export */ const site_title_transforms = (site_title_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/site-title/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const site_title_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/site-title", title: "Site Title", category: "theme", description: "Displays the name of this site. Update the block, and the changes apply everywhere it\u2019s used. This will also appear in the browser title bar and in search results.", textdomain: "default", attributes: { level: { type: "number", "default": 1 }, levelOptions: { type: "array", "default": [0, 1, 2, 3, 4, 5, 6] }, textAlign: { type: "string" }, isLink: { type: "boolean", "default": true, role: "content" }, linkTarget: { type: "string", "default": "_self", role: "content" } }, example: { viewportWidth: 500 }, supports: { align: ["wide", "full"], html: false, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true, link: true } }, spacing: { padding: true, margin: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalWritingMode: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true } }, editorStyle: "wp-block-site-title-editor", style: "wp-block-site-title" }; const { name: site_title_name } = site_title_metadata; const site_title_settings = { icon: map_marker, example: { viewportWidth: 350, attributes: { textAlign: 'center' } }, edit: SiteTitleEdit, transforms: site_title_transforms, deprecated: site_title_deprecated }; const site_title_init = () => initBlock({ name: site_title_name, metadata: site_title_metadata, settings: site_title_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/share.js /** * WordPress dependencies */ const share = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z" }) }); /* harmony default export */ const library_share = (share); ;// ./node_modules/@wordpress/icons/build-module/library/keyboard-return.js /** * WordPress dependencies */ const keyboardReturn = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-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" }) }); /* harmony default export */ const keyboard_return = (keyboardReturn); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/wordpress.js /** * WordPress dependencies */ const WordPressIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.158,12.786L9.46,20.625c0.806,0.237,1.657,0.366,2.54,0.366c1.047,0,2.051-0.181,2.986-0.51 c-0.024-0.038-0.046-0.079-0.065-0.124L12.158,12.786z M3.009,12c0,3.559,2.068,6.634,5.067,8.092L3.788,8.341 C3.289,9.459,3.009,10.696,3.009,12z M18.069,11.546c0-1.112-0.399-1.881-0.741-2.48c-0.456-0.741-0.883-1.368-0.883-2.109 c0-0.826,0.627-1.596,1.51-1.596c0.04,0,0.078,0.005,0.116,0.007C16.472,3.904,14.34,3.009,12,3.009 c-3.141,0-5.904,1.612-7.512,4.052c0.211,0.007,0.41,0.011,0.579,0.011c0.94,0,2.396-0.114,2.396-0.114 C7.947,6.93,8.004,7.642,7.52,7.699c0,0-0.487,0.057-1.029,0.085l3.274,9.739l1.968-5.901l-1.401-3.838 C9.848,7.756,9.389,7.699,9.389,7.699C8.904,7.67,8.961,6.93,9.446,6.958c0,0,1.484,0.114,2.368,0.114 c0.94,0,2.397-0.114,2.397-0.114c0.485-0.028,0.542,0.684,0.057,0.741c0,0-0.488,0.057-1.029,0.085l3.249,9.665l0.897-2.996 C17.841,13.284,18.069,12.316,18.069,11.546z M19.889,7.686c0.039,0.286,0.06,0.593,0.06,0.924c0,0.912-0.171,1.938-0.684,3.22 l-2.746,7.94c2.673-1.558,4.47-4.454,4.47-7.771C20.991,10.436,20.591,8.967,19.889,7.686z M12,22C6.486,22,2,17.514,2,12 C2,6.486,6.486,2,12,2c5.514,0,10,4.486,10,10C22,17.514,17.514,22,12,22z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/fivehundredpx.js /** * WordPress dependencies */ const FivehundredpxIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.94026,15.1412c.00437.01213.108.29862.168.44064a6.55008,6.55008,0,1,0,6.03191-9.09557,6.68654,6.68654,0,0,0-2.58357.51467A8.53914,8.53914,0,0,0,8.21268,8.61344L8.209,8.61725V3.22948l9.0504-.00008c.32934-.0036.32934-.46353.32934-.61466s0-.61091-.33035-.61467L7.47248,2a.43.43,0,0,0-.43131.42692v7.58355c0,.24466.30476.42131.58793.4819.553.11812.68074-.05864.81617-.2457l.018-.02481A10.52673,10.52673,0,0,1,9.32258,9.258a5.35268,5.35268,0,1,1,7.58985,7.54976,5.417,5.417,0,0,1-3.80867,1.56365,5.17483,5.17483,0,0,1-2.69822-.74478l.00342-4.61111a2.79372,2.79372,0,0,1,.71372-1.78792,2.61611,2.61611,0,0,1,1.98282-.89477,2.75683,2.75683,0,0,1,1.95525.79477,2.66867,2.66867,0,0,1,.79656,1.909,2.724,2.724,0,0,1-2.75849,2.748,4.94651,4.94651,0,0,1-.86254-.13719c-.31234-.093-.44519.34058-.48892.48349-.16811.54966.08453.65862.13687.67489a3.75751,3.75751,0,0,0,1.25234.18375,3.94634,3.94634,0,1,0-2.82444-6.742,3.67478,3.67478,0,0,0-1.13028,2.584l-.00041.02323c-.0035.11667-.00579,2.881-.00644,3.78811l-.00407-.00451a6.18521,6.18521,0,0,1-1.0851-1.86092c-.10544-.27856-.34358-.22925-.66857-.12917-.14192.04372-.57386.17677-.47833.489Zm4.65165-1.08338a.51346.51346,0,0,0,.19513.31818l.02276.022a.52945.52945,0,0,0,.3517.18416.24242.24242,0,0,0,.16577-.0611c.05473-.05082.67382-.67812.73287-.738l.69041.68819a.28978.28978,0,0,0,.21437.11032.53239.53239,0,0,0,.35708-.19486c.29792-.30419.14885-.46821.07676-.54751l-.69954-.69975.72952-.73469c.16-.17311.01874-.35708-.12218-.498-.20461-.20461-.402-.25742-.52855-.14083l-.7254.72665-.73354-.73375a.20128.20128,0,0,0-.14179-.05695.54135.54135,0,0,0-.34379.19648c-.22561.22555-.274.38149-.15656.5059l.73374.7315-.72942.73072A.26589.26589,0,0,0,11.59191,14.05782Zm1.59866-9.915A8.86081,8.86081,0,0,0,9.854,4.776a.26169.26169,0,0,0-.16938.22759.92978.92978,0,0,0,.08619.42094c.05682.14524.20779.531.50006.41955a8.40969,8.40969,0,0,1,2.91968-.55484,7.87875,7.87875,0,0,1,3.086.62286,8.61817,8.61817,0,0,1,2.30562,1.49315.2781.2781,0,0,0,.18318.07586c.15529,0,.30425-.15253.43167-.29551.21268-.23861.35873-.4369.1492-.63538a8.50425,8.50425,0,0,0-2.62312-1.694A9.0177,9.0177,0,0,0,13.19058,4.14283ZM19.50945,18.6236h0a.93171.93171,0,0,0-.36642-.25406.26589.26589,0,0,0-.27613.06613l-.06943.06929A7.90606,7.90606,0,0,1,7.60639,18.505a7.57284,7.57284,0,0,1-1.696-2.51537,8.58715,8.58715,0,0,1-.5147-1.77754l-.00871-.04864c-.04939-.25873-.28755-.27684-.62981-.22448-.14234.02178-.5755.088-.53426.39969l.001.00712a9.08807,9.08807,0,0,0,15.406,4.99094c.00193-.00192.04753-.04718.0725-.07436C19.79425,19.16234,19.87422,18.98728,19.50945,18.6236Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/amazon.js /** * WordPress dependencies */ const AmazonIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13.582,8.182C11.934,8.367,9.78,8.49,8.238,9.166c-1.781,0.769-3.03,2.337-3.03,4.644 c0,2.953,1.86,4.429,4.253,4.429c2.02,0,3.125-0.477,4.685-2.065c0.516,0.747,0.685,1.109,1.629,1.894 c0.212,0.114,0.483,0.103,0.672-0.066l0.006,0.006c0.567-0.505,1.599-1.401,2.18-1.888c0.231-0.188,0.19-0.496,0.009-0.754 c-0.52-0.718-1.072-1.303-1.072-2.634V8.305c0-1.876,0.133-3.599-1.249-4.891C15.23,2.369,13.422,2,12.04,2 C9.336,2,6.318,3.01,5.686,6.351C5.618,6.706,5.877,6.893,6.109,6.945l2.754,0.298C9.121,7.23,9.308,6.977,9.357,6.72 c0.236-1.151,1.2-1.706,2.284-1.706c0.584,0,1.249,0.215,1.595,0.738c0.398,0.584,0.346,1.384,0.346,2.061V8.182z M13.049,14.088 c-0.451,0.8-1.169,1.291-1.967,1.291c-1.09,0-1.728-0.83-1.728-2.061c0-2.42,2.171-2.86,4.227-2.86v0.615 C13.582,12.181,13.608,13.104,13.049,14.088z M20.683,19.339C18.329,21.076,14.917,22,11.979,22c-4.118,0-7.826-1.522-10.632-4.057 c-0.22-0.199-0.024-0.471,0.241-0.317c3.027,1.762,6.771,2.823,10.639,2.823c2.608,0,5.476-0.541,8.115-1.66 C20.739,18.62,21.072,19.051,20.683,19.339z M21.336,21.043c-0.194,0.163-0.379,0.076-0.293-0.139 c0.284-0.71,0.92-2.298,0.619-2.684c-0.301-0.386-1.99-0.183-2.749-0.092c-0.23,0.027-0.266-0.173-0.059-0.319 c1.348-0.946,3.555-0.673,3.811-0.356C22.925,17.773,22.599,19.986,21.336,21.043z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/bandcamp.js /** * WordPress dependencies */ const BandcampIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M15.27 17.289 3 17.289 8.73 6.711 21 6.711 15.27 17.289" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/behance.js /** * WordPress dependencies */ const BehanceIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7.799,5.698c0.589,0,1.12,0.051,1.606,0.156c0.482,0.102,0.894,0.273,1.241,0.507c0.344,0.235,0.612,0.546,0.804,0.938 c0.188,0.387,0.281,0.871,0.281,1.443c0,0.619-0.141,1.137-0.421,1.551c-0.284,0.413-0.7,0.751-1.255,1.014 c0.756,0.218,1.317,0.601,1.689,1.146c0.374,0.549,0.557,1.205,0.557,1.975c0,0.623-0.12,1.161-0.359,1.612 c-0.241,0.457-0.569,0.828-0.973,1.114c-0.408,0.288-0.876,0.5-1.399,0.637C9.052,17.931,8.514,18,7.963,18H2V5.698H7.799 M7.449,10.668c0.481,0,0.878-0.114,1.192-0.345c0.311-0.228,0.463-0.603,0.463-1.119c0-0.286-0.051-0.523-0.152-0.707 C8.848,8.315,8.711,8.171,8.536,8.07C8.362,7.966,8.166,7.894,7.94,7.854c-0.224-0.044-0.457-0.06-0.697-0.06H4.709v2.874H7.449z M7.6,15.905c0.267,0,0.521-0.024,0.759-0.077c0.243-0.053,0.457-0.137,0.637-0.261c0.182-0.12,0.332-0.283,0.441-0.491 C9.547,14.87,9.6,14.602,9.6,14.278c0-0.633-0.18-1.084-0.533-1.357c-0.356-0.27-0.83-0.404-1.413-0.404H4.709v3.388L7.6,15.905z M16.162,15.864c0.367,0.358,0.897,0.538,1.583,0.538c0.493,0,0.92-0.125,1.277-0.374c0.354-0.248,0.571-0.514,0.654-0.79h2.155 c-0.347,1.072-0.872,1.838-1.589,2.299C19.534,18,18.67,18.23,17.662,18.23c-0.701,0-1.332-0.113-1.899-0.337 c-0.567-0.227-1.041-0.544-1.439-0.958c-0.389-0.415-0.689-0.907-0.904-1.484c-0.213-0.574-0.32-1.21-0.32-1.899 c0-0.666,0.11-1.288,0.329-1.863c0.222-0.577,0.529-1.075,0.933-1.492c0.406-0.42,0.885-0.751,1.444-0.994 c0.558-0.241,1.175-0.363,1.857-0.363c0.754,0,1.414,0.145,1.98,0.44c0.563,0.291,1.026,0.686,1.389,1.181 c0.363,0.493,0.622,1.057,0.783,1.69c0.16,0.632,0.217,1.292,0.171,1.983h-6.428C15.557,14.84,15.795,15.506,16.162,15.864 M18.973,11.184c-0.291-0.321-0.783-0.496-1.384-0.496c-0.39,0-0.714,0.066-0.973,0.2c-0.254,0.132-0.461,0.297-0.621,0.491 c-0.157,0.197-0.265,0.405-0.328,0.628c-0.063,0.217-0.101,0.413-0.111,0.587h3.98C19.478,11.969,19.265,11.509,18.973,11.184z M15.057,7.738h4.985V6.524h-4.985L15.057,7.738z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/bluesky.js /** * WordPress dependencies */ const BlueskyIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/chain.js /** * WordPress dependencies */ const ChainIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.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" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/codepen.js /** * WordPress dependencies */ const CodepenIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M22.016,8.84c-0.002-0.013-0.005-0.025-0.007-0.037c-0.005-0.025-0.008-0.048-0.015-0.072 c-0.003-0.015-0.01-0.028-0.013-0.042c-0.008-0.02-0.015-0.04-0.023-0.062c-0.007-0.015-0.013-0.028-0.02-0.042 c-0.008-0.02-0.018-0.037-0.03-0.057c-0.007-0.013-0.017-0.027-0.025-0.038c-0.012-0.018-0.023-0.035-0.035-0.052 c-0.01-0.013-0.02-0.025-0.03-0.037c-0.015-0.017-0.028-0.032-0.043-0.045c-0.01-0.012-0.022-0.023-0.035-0.035 c-0.015-0.015-0.032-0.028-0.048-0.04c-0.012-0.01-0.025-0.02-0.037-0.03c-0.005-0.003-0.01-0.008-0.015-0.012l-9.161-6.096 c-0.289-0.192-0.666-0.192-0.955,0L2.359,8.237C2.354,8.24,2.349,8.245,2.344,8.249L2.306,8.277 c-0.017,0.013-0.033,0.027-0.048,0.04C2.246,8.331,2.234,8.342,2.222,8.352c-0.015,0.015-0.028,0.03-0.042,0.047 c-0.012,0.013-0.022,0.023-0.03,0.037C2.139,8.453,2.125,8.471,2.115,8.488C2.107,8.501,2.099,8.514,2.09,8.526 C2.079,8.548,2.069,8.565,2.06,8.585C2.054,8.6,2.047,8.613,2.04,8.626C2.032,8.648,2.025,8.67,2.019,8.69 c-0.005,0.013-0.01,0.027-0.013,0.042C1.999,8.755,1.995,8.778,1.99,8.803C1.989,8.817,1.985,8.828,1.984,8.84 C1.978,8.879,1.975,8.915,1.975,8.954v6.093c0,0.037,0.003,0.075,0.008,0.112c0.002,0.012,0.005,0.025,0.007,0.038 c0.005,0.023,0.008,0.047,0.015,0.072c0.003,0.015,0.008,0.028,0.013,0.04c0.007,0.022,0.013,0.042,0.022,0.063 c0.007,0.015,0.013,0.028,0.02,0.04c0.008,0.02,0.018,0.038,0.03,0.058c0.007,0.013,0.015,0.027,0.025,0.038 c0.012,0.018,0.023,0.035,0.035,0.052c0.01,0.013,0.02,0.025,0.03,0.037c0.013,0.015,0.028,0.032,0.042,0.045 c0.012,0.012,0.023,0.023,0.035,0.035c0.015,0.013,0.032,0.028,0.048,0.04l0.038,0.03c0.005,0.003,0.01,0.007,0.013,0.01 l9.163,6.095C11.668,21.953,11.833,22,12,22c0.167,0,0.332-0.047,0.478-0.144l9.163-6.095l0.015-0.01 c0.013-0.01,0.027-0.02,0.037-0.03c0.018-0.013,0.035-0.028,0.048-0.04c0.013-0.012,0.025-0.023,0.035-0.035 c0.017-0.015,0.03-0.032,0.043-0.045c0.01-0.013,0.02-0.025,0.03-0.037c0.013-0.018,0.025-0.035,0.035-0.052 c0.008-0.013,0.018-0.027,0.025-0.038c0.012-0.02,0.022-0.038,0.03-0.058c0.007-0.013,0.013-0.027,0.02-0.04 c0.008-0.022,0.015-0.042,0.023-0.063c0.003-0.013,0.01-0.027,0.013-0.04c0.007-0.025,0.01-0.048,0.015-0.072 c0.002-0.013,0.005-0.027,0.007-0.037c0.003-0.042,0.007-0.079,0.007-0.117V8.954C22.025,8.915,22.022,8.879,22.016,8.84z M12.862,4.464l6.751,4.49l-3.016,2.013l-3.735-2.492V4.464z M11.138,4.464v4.009l-3.735,2.494L4.389,8.954L11.138,4.464z M3.699,10.562L5.853,12l-2.155,1.438V10.562z M11.138,19.536l-6.749-4.491l3.015-2.011l3.735,2.492V19.536z M12,14.035L8.953,12 L12,9.966L15.047,12L12,14.035z M12.862,19.536v-4.009l3.735-2.492l3.016,2.011L12.862,19.536z M20.303,13.438L18.147,12 l2.156-1.438L20.303,13.438z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/deviantart.js /** * WordPress dependencies */ const DeviantArtIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M 18.19 5.636 18.19 2 18.188 2 14.553 2 14.19 2.366 12.474 5.636 11.935 6 5.81 6 5.81 10.994 9.177 10.994 9.477 11.357 5.81 18.363 5.81 22 5.811 22 9.447 22 9.81 21.634 11.526 18.364 12.065 18 18.19 18 18.19 13.006 14.823 13.006 14.523 12.641 18.19 5.636z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/discord.js /** * WordPress dependencies */ const DiscordIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20.317 4.369A19.88 19.88 0 0 0 15.894 3a14.145 14.145 0 0 0-.719 1.518 19.205 19.205 0 0 0-5.351 0A14.183 14.183 0 0 0 9.104 3 19.896 19.896 0 0 0 4.682 4.369a18.921 18.921 0 0 0-3.012 12.52 19.929 19.929 0 0 0 6.081 3.097c.487-.65.922-1.339 1.3-2.061a12.445 12.445 0 0 1-1.958-.896c.165-.12.326-.246.483-.374a12.445 12.445 0 0 0 8.946 0c.157.128.318.253.483.374-.627.371-1.281.683-1.958.896.379.722.813 1.41 1.3 2.061a19.94 19.94 0 0 0 6.081-3.097 18.921 18.921 0 0 0-3.012-12.52ZM8.12 15.233c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Zm7.757 0c-1.202 0-2.184-1.09-2.184-2.431 0-1.34.97-2.431 2.184-2.431 1.213 0 2.202 1.09 2.184 2.431 0 1.341-.97 2.431-2.184 2.431Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/dribbble.js /** * WordPress dependencies */ const DribbbleIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12,22C6.486,22,2,17.514,2,12S6.486,2,12,2c5.514,0,10,4.486,10,10S17.514,22,12,22z M20.434,13.369 c-0.292-0.092-2.644-0.794-5.32-0.365c1.117,3.07,1.572,5.57,1.659,6.09C18.689,17.798,20.053,15.745,20.434,13.369z M15.336,19.876c-0.127-0.749-0.623-3.361-1.822-6.477c-0.019,0.006-0.038,0.013-0.056,0.019c-4.818,1.679-6.547,5.02-6.701,5.334 c1.448,1.129,3.268,1.803,5.243,1.803C13.183,20.555,14.311,20.313,15.336,19.876z M5.654,17.724 c0.193-0.331,2.538-4.213,6.943-5.637c0.111-0.036,0.224-0.07,0.337-0.102c-0.214-0.485-0.448-0.971-0.692-1.45 c-4.266,1.277-8.405,1.223-8.778,1.216c-0.003,0.087-0.004,0.174-0.004,0.261C3.458,14.207,4.29,16.21,5.654,17.724z M3.639,10.264 c0.382,0.005,3.901,0.02,7.897-1.041c-1.415-2.516-2.942-4.631-3.167-4.94C5.979,5.41,4.193,7.613,3.639,10.264z M9.998,3.709 c0.236,0.316,1.787,2.429,3.187,5c3.037-1.138,4.323-2.867,4.477-3.085C16.154,4.286,14.17,3.471,12,3.471 C11.311,3.471,10.641,3.554,9.998,3.709z M18.612,6.612C18.432,6.855,17,8.69,13.842,9.979c0.199,0.407,0.389,0.821,0.567,1.237 c0.063,0.148,0.124,0.295,0.184,0.441c2.842-0.357,5.666,0.215,5.948,0.275C20.522,9.916,19.801,8.065,18.612,6.612z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/dropbox.js /** * WordPress dependencies */ const DropboxIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12,6.134L6.069,9.797L2,6.54l5.883-3.843L12,6.134z M2,13.054l5.883,3.843L12,13.459L6.069,9.797L2,13.054z M12,13.459 l4.116,3.439L22,13.054l-4.069-3.257L12,13.459z M22,6.54l-5.884-3.843L12,6.134l5.931,3.663L22,6.54z M12.011,14.2l-4.129,3.426 l-1.767-1.153v1.291l5.896,3.539l5.897-3.539v-1.291l-1.769,1.153L12.011,14.2z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/etsy.js /** * WordPress dependencies */ const EtsyIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M9.16033,4.038c0-.27174.02717-.43478.48913-.43478h6.22283c1.087,0,1.68478.92391,2.11957,2.663l.35326,1.38587h1.05978C19.59511,3.712,19.75815,2,19.75815,2s-2.663.29891-4.23913.29891h-7.962L3.29076,2.163v1.1413L4.731,3.57609c1.00543.19022,1.25.40761,1.33152,1.33152,0,0,.08152,2.71739.08152,7.20109s-.08152,7.17391-.08152,7.17391c0,.81522-.32609,1.11413-1.33152,1.30435l-1.44022.27174V22l4.2663-.13587h7.11957c1.60326,0,5.32609.13587,5.32609.13587.08152-.97826.625-5.40761.70652-5.89674H19.7038L18.644,18.52174c-.84239,1.90217-2.06522,2.038-3.42391,2.038H11.1712c-1.3587,0-2.01087-.54348-2.01087-1.712V12.65217s3.0163,0,3.99457.08152c.76087.05435,1.22283.27174,1.46739,1.33152l.32609,1.413h1.16848l-.08152-3.55978.163-3.587H15.02989l-.38043,1.57609c-.24457,1.03261-.40761,1.22283-1.46739,1.33152-1.38587.13587-4.02174.1087-4.02174.1087Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/facebook.js /** * WordPress dependencies */ const FacebookIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12 2C6.5 2 2 6.5 2 12c0 5 3.7 9.1 8.4 9.9v-7H7.9V12h2.5V9.8c0-2.5 1.5-3.9 3.8-3.9 1.1 0 2.2.2 2.2.2v2.5h-1.3c-1.2 0-1.6.8-1.6 1.6V12h2.8l-.4 2.9h-2.3v7C18.3 21.1 22 17 22 12c0-5.5-4.5-10-10-10z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/feed.js /** * WordPress dependencies */ const FeedIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M2,8.667V12c5.515,0,10,4.485,10,10h3.333C15.333,14.637,9.363,8.667,2,8.667z M2,2v3.333 c9.19,0,16.667,7.477,16.667,16.667H22C22,10.955,13.045,2,2,2z M4.5,17C3.118,17,2,18.12,2,19.5S3.118,22,4.5,22S7,20.88,7,19.5 S5.882,17,4.5,17z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/flickr.js /** * WordPress dependencies */ const FlickrIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5S9.25,7,6.5,7z M17.5,7c-2.75,0-5,2.25-5,5s2.25,5,5,5s5-2.25,5-5 S20.25,7,17.5,7z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/foursquare.js /** * WordPress dependencies */ const FoursquareIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.573,2c0,0-9.197,0-10.668,0S5,3.107,5,3.805s0,16.948,0,16.948c0,0.785,0.422,1.077,0.66,1.172 c0.238,0.097,0.892,0.177,1.285-0.275c0,0,5.035-5.843,5.122-5.93c0.132-0.132,0.132-0.132,0.262-0.132h3.26 c1.368,0,1.588-0.977,1.732-1.552c0.078-0.318,0.692-3.428,1.225-6.122l0.675-3.368C19.56,2.893,19.14,2,17.573,2z M16.495,7.22 c-0.053,0.252-0.372,0.518-0.665,0.518c-0.293,0-4.157,0-4.157,0c-0.467,0-0.802,0.318-0.802,0.787v0.508 c0,0.467,0.337,0.798,0.805,0.798c0,0,3.197,0,3.528,0s0.655,0.362,0.583,0.715c-0.072,0.353-0.407,2.102-0.448,2.295 c-0.04,0.193-0.262,0.523-0.655,0.523c-0.33,0-2.88,0-2.88,0c-0.523,0-0.683,0.068-1.033,0.503 c-0.35,0.437-3.505,4.223-3.505,4.223c-0.032,0.035-0.063,0.027-0.063-0.015V4.852c0-0.298,0.26-0.648,0.648-0.648 c0,0,8.228,0,8.562,0c0.315,0,0.61,0.297,0.528,0.683L16.495,7.22z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/goodreads.js /** * WordPress dependencies */ const GoodreadsIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.3,17.5c-0.2,0.8-0.5,1.4-1,1.9c-0.4,0.5-1,0.9-1.7,1.2C13.9,20.9,13.1,21,12,21c-0.6,0-1.3-0.1-1.9-0.2 c-0.6-0.1-1.1-0.4-1.6-0.7c-0.5-0.3-0.9-0.7-1.2-1.2c-0.3-0.5-0.5-1.1-0.5-1.7h1.5c0.1,0.5,0.2,0.9,0.5,1.2 c0.2,0.3,0.5,0.6,0.9,0.8c0.3,0.2,0.7,0.3,1.1,0.4c0.4,0.1,0.8,0.1,1.2,0.1c1.4,0,2.5-0.4,3.1-1.2c0.6-0.8,1-2,1-3.5v-1.7h0 c-0.4,0.8-0.9,1.4-1.6,1.9c-0.7,0.5-1.5,0.7-2.4,0.7c-1,0-1.9-0.2-2.6-0.5C8.7,15,8.1,14.5,7.7,14c-0.5-0.6-0.8-1.3-1-2.1 c-0.2-0.8-0.3-1.6-0.3-2.5c0-0.9,0.1-1.7,0.4-2.5c0.3-0.8,0.6-1.5,1.1-2c0.5-0.6,1.1-1,1.8-1.4C10.3,3.2,11.1,3,12,3 c0.5,0,0.9,0.1,1.3,0.2c0.4,0.1,0.8,0.3,1.1,0.5c0.3,0.2,0.6,0.5,0.9,0.8c0.3,0.3,0.5,0.6,0.6,1h0V3.4h1.5V15 C17.6,15.9,17.5,16.7,17.3,17.5z M13.8,14.1c0.5-0.3,0.9-0.7,1.3-1.1c0.3-0.5,0.6-1,0.8-1.6c0.2-0.6,0.3-1.2,0.3-1.9 c0-0.6-0.1-1.2-0.2-1.9c-0.1-0.6-0.4-1.2-0.7-1.7c-0.3-0.5-0.7-0.9-1.3-1.2c-0.5-0.3-1.1-0.5-1.9-0.5s-1.4,0.2-1.9,0.5 c-0.5,0.3-1,0.7-1.3,1.2C8.5,6.4,8.3,7,8.1,7.6C8,8.2,7.9,8.9,7.9,9.5c0,0.6,0.1,1.3,0.2,1.9C8.3,12,8.6,12.5,8.9,13 c0.3,0.5,0.8,0.8,1.3,1.1c0.5,0.3,1.1,0.4,1.9,0.4C12.7,14.5,13.3,14.4,13.8,14.1z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/google.js /** * WordPress dependencies */ const GoogleIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.02,10.18v3.72v0.01h5.51c-0.26,1.57-1.67,4.22-5.5,4.22c-3.31,0-6.01-2.75-6.01-6.12s2.7-6.12,6.01-6.12 c1.87,0,3.13,0.8,3.85,1.48l2.84-2.76C16.99,2.99,14.73,2,12.03,2c-5.52,0-10,4.48-10,10s4.48,10,10,10c5.77,0,9.6-4.06,9.6-9.77 c0-0.83-0.11-1.42-0.25-2.05H12.02z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/github.js /** * WordPress dependencies */ const GitHubIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12,2C6.477,2,2,6.477,2,12c0,4.419,2.865,8.166,6.839,9.489c0.5,0.09,0.682-0.218,0.682-0.484 c0-0.236-0.009-0.866-0.014-1.699c-2.782,0.602-3.369-1.34-3.369-1.34c-0.455-1.157-1.11-1.465-1.11-1.465 c-0.909-0.62,0.069-0.608,0.069-0.608c1.004,0.071,1.532,1.03,1.532,1.03c0.891,1.529,2.341,1.089,2.91,0.833 c0.091-0.647,0.349-1.086,0.635-1.337c-2.22-0.251-4.555-1.111-4.555-4.943c0-1.091,0.39-1.984,1.03-2.682 C6.546,8.54,6.202,7.524,6.746,6.148c0,0,0.84-0.269,2.75,1.025C10.295,6.95,11.15,6.84,12,6.836 c0.85,0.004,1.705,0.114,2.504,0.336c1.909-1.294,2.748-1.025,2.748-1.025c0.546,1.376,0.202,2.394,0.1,2.646 c0.64,0.699,1.026,1.591,1.026,2.682c0,3.841-2.337,4.687-4.565,4.935c0.359,0.307,0.679,0.917,0.679,1.852 c0,1.335-0.012,2.415-0.012,2.741c0,0.269,0.18,0.579,0.688,0.481C19.138,20.161,22,16.416,22,12C22,6.477,17.523,2,12,2z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/gravatar.js /** * WordPress dependencies */ const GravatarIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.8001 4.69937V10.6494C10.8001 11.1001 10.9791 11.5323 11.2978 11.851C11.6165 12.1697 12.0487 12.3487 12.4994 12.3487C12.9501 12.3487 13.3824 12.1697 13.7011 11.851C14.0198 11.5323 14.1988 11.1001 14.1988 10.6494V6.69089C15.2418 7.05861 16.1371 7.75537 16.7496 8.67617C17.3622 9.59698 17.6589 10.6919 17.595 11.796C17.5311 12.9001 17.1101 13.9535 16.3954 14.7975C15.6807 15.6415 14.711 16.2303 13.6325 16.4753C12.5541 16.7202 11.4252 16.608 10.4161 16.1555C9.40691 15.703 8.57217 14.9348 8.03763 13.9667C7.50308 12.9985 7.29769 11.8828 7.45242 10.7877C7.60714 9.69266 8.11359 8.67755 8.89545 7.89537C9.20904 7.57521 9.38364 7.14426 9.38132 6.69611C9.37899 6.24797 9.19994 5.81884 8.88305 5.50195C8.56616 5.18506 8.13704 5.00601 7.68889 5.00369C7.24075 5.00137 6.80979 5.17597 6.48964 5.48956C5.09907 6.8801 4.23369 8.7098 4.04094 10.6669C3.84819 12.624 4.34 14.5873 5.43257 16.2224C6.52515 17.8575 8.15088 19.0632 10.0328 19.634C11.9146 20.2049 13.9362 20.1055 15.753 19.3529C17.5699 18.6003 19.0695 17.241 19.9965 15.5066C20.9234 13.7722 21.2203 11.7701 20.8366 9.84133C20.4528 7.91259 19.4122 6.17658 17.892 4.92911C16.3717 3.68163 14.466 2.99987 12.4994 3C12.0487 3 11.6165 3.17904 11.2978 3.49773C10.9791 3.81643 10.8001 4.24867 10.8001 4.69937Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/instagram.js /** * WordPress dependencies */ const InstagramIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12,4.622c2.403,0,2.688,0.009,3.637,0.052c0.877,0.04,1.354,0.187,1.671,0.31c0.42,0.163,0.72,0.358,1.035,0.673 c0.315,0.315,0.51,0.615,0.673,1.035c0.123,0.317,0.27,0.794,0.31,1.671c0.043,0.949,0.052,1.234,0.052,3.637 s-0.009,2.688-0.052,3.637c-0.04,0.877-0.187,1.354-0.31,1.671c-0.163,0.42-0.358,0.72-0.673,1.035 c-0.315,0.315-0.615,0.51-1.035,0.673c-0.317,0.123-0.794,0.27-1.671,0.31c-0.949,0.043-1.233,0.052-3.637,0.052 s-2.688-0.009-3.637-0.052c-0.877-0.04-1.354-0.187-1.671-0.31c-0.42-0.163-0.72-0.358-1.035-0.673 c-0.315-0.315-0.51-0.615-0.673-1.035c-0.123-0.317-0.27-0.794-0.31-1.671C4.631,14.688,4.622,14.403,4.622,12 s0.009-2.688,0.052-3.637c0.04-0.877,0.187-1.354,0.31-1.671c0.163-0.42,0.358-0.72,0.673-1.035 c0.315-0.315,0.615-0.51,1.035-0.673c0.317-0.123,0.794-0.27,1.671-0.31C9.312,4.631,9.597,4.622,12,4.622 M12,3 C9.556,3,9.249,3.01,8.289,3.054C7.331,3.098,6.677,3.25,6.105,3.472C5.513,3.702,5.011,4.01,4.511,4.511 c-0.5,0.5-0.808,1.002-1.038,1.594C3.25,6.677,3.098,7.331,3.054,8.289C3.01,9.249,3,9.556,3,12c0,2.444,0.01,2.751,0.054,3.711 c0.044,0.958,0.196,1.612,0.418,2.185c0.23,0.592,0.538,1.094,1.038,1.594c0.5,0.5,1.002,0.808,1.594,1.038 c0.572,0.222,1.227,0.375,2.185,0.418C9.249,20.99,9.556,21,12,21s2.751-0.01,3.711-0.054c0.958-0.044,1.612-0.196,2.185-0.418 c0.592-0.23,1.094-0.538,1.594-1.038c0.5-0.5,0.808-1.002,1.038-1.594c0.222-0.572,0.375-1.227,0.418-2.185 C20.99,14.751,21,14.444,21,12s-0.01-2.751-0.054-3.711c-0.044-0.958-0.196-1.612-0.418-2.185c-0.23-0.592-0.538-1.094-1.038-1.594 c-0.5-0.5-1.002-0.808-1.594-1.038c-0.572-0.222-1.227-0.375-2.185-0.418C14.751,3.01,14.444,3,12,3L12,3z M12,7.378 c-2.552,0-4.622,2.069-4.622,4.622S9.448,16.622,12,16.622s4.622-2.069,4.622-4.622S14.552,7.378,12,7.378z M12,15 c-1.657,0-3-1.343-3-3s1.343-3,3-3s3,1.343,3,3S13.657,15,12,15z M16.804,6.116c-0.596,0-1.08,0.484-1.08,1.08 s0.484,1.08,1.08,1.08c0.596,0,1.08-0.484,1.08-1.08S17.401,6.116,16.804,6.116z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/lastfm.js /** * WordPress dependencies */ const LastfmIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M 12.0002 1.5 C 6.2006 1.5 1.5 6.2011 1.5 11.9998 C 1.5 17.799 6.2006 22.5 12.0002 22.5 C 17.799 22.5 22.5 17.799 22.5 11.9998 C 22.5 6.2011 17.799 1.5 12.0002 1.5 Z M 16.1974 16.2204 C 14.8164 16.2152 13.9346 15.587 13.3345 14.1859 L 13.1816 13.8451 L 11.8541 10.8101 C 11.4271 9.7688 10.3526 9.0712 9.1801 9.0712 C 7.5695 9.0712 6.2593 10.3851 6.2593 12.001 C 6.2593 13.6165 7.5695 14.9303 9.1801 14.9303 C 10.272 14.9303 11.2651 14.3275 11.772 13.3567 C 11.7893 13.3235 11.8239 13.302 11.863 13.3038 C 11.9007 13.3054 11.9353 13.3288 11.9504 13.3632 L 12.4865 14.6046 C 12.5016 14.639 12.4956 14.6778 12.4723 14.7069 C 11.6605 15.6995 10.4602 16.2683 9.1801 16.2683 C 6.8331 16.2683 4.9234 14.3536 4.9234 12.001 C 4.9234 9.6468 6.833 7.732 9.1801 7.732 C 10.9572 7.732 12.3909 8.6907 13.1138 10.3636 C 13.1206 10.3802 13.8412 12.0708 14.4744 13.5191 C 14.8486 14.374 15.1462 14.896 16.1288 14.9292 C 17.0663 14.9613 17.7538 14.4122 17.7538 13.6485 C 17.7538 12.9691 17.3321 12.8004 16.3803 12.4822 C 14.7365 11.9398 13.845 11.3861 13.845 10.0182 C 13.845 8.6809 14.7667 7.8162 16.192 7.8162 C 17.1288 7.8162 17.8155 8.2287 18.2921 9.0768 C 18.305 9.1006 18.3079 9.1281 18.3004 9.1542 C 18.2929 9.1803 18.2748 9.2021 18.2507 9.2138 L 17.3614 9.669 C 17.3178 9.692 17.2643 9.6781 17.2356 9.6385 C 16.9329 9.2135 16.5956 9.0251 16.1423 9.0251 C 15.5512 9.0251 15.122 9.429 15.122 9.9865 C 15.122 10.6738 15.6529 10.8414 16.5339 11.1192 C 16.6491 11.1558 16.7696 11.194 16.8939 11.2343 C 18.2763 11.6865 19.0768 12.2311 19.0768 13.6836 C 19.0769 15.1297 17.8389 16.2204 16.1974 16.2204 Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/linkedin.js /** * WordPress dependencies */ const LinkedInIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19.7,3H4.3C3.582,3,3,3.582,3,4.3v15.4C3,20.418,3.582,21,4.3,21h15.4c0.718,0,1.3-0.582,1.3-1.3V4.3 C21,3.582,20.418,3,19.7,3z M8.339,18.338H5.667v-8.59h2.672V18.338z M7.004,8.574c-0.857,0-1.549-0.694-1.549-1.548 c0-0.855,0.691-1.548,1.549-1.548c0.854,0,1.547,0.694,1.547,1.548C8.551,7.881,7.858,8.574,7.004,8.574z M18.339,18.338h-2.669 v-4.177c0-0.996-0.017-2.278-1.387-2.278c-1.389,0-1.601,1.086-1.601,2.206v4.249h-2.667v-8.59h2.559v1.174h0.037 c0.356-0.675,1.227-1.387,2.526-1.387c2.703,0,3.203,1.779,3.203,4.092V18.338z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/mail.js /** * WordPress dependencies */ const MailIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 5H5c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm.5 12c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l7.5 5.6 7.5-5.6V17zm0-9.1L12 13.6 4.5 7.9V7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v.9z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/mastodon.js /** * WordPress dependencies */ const MastodonIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M23.193 7.879c0-5.206-3.411-6.732-3.411-6.732C18.062.357 15.108.025 12.041 0h-.076c-3.068.025-6.02.357-7.74 1.147 0 0-3.411 1.526-3.411 6.732 0 1.192-.023 2.618.015 4.129.124 5.092.934 10.109 5.641 11.355 2.17.574 4.034.695 5.535.612 2.722-.15 4.25-.972 4.25-.972l-.09-1.975s-1.945.613-4.129.539c-2.165-.074-4.449-.233-4.799-2.891a5.499 5.499 0 0 1-.048-.745s2.125.52 4.817.643c1.646.075 3.19-.097 4.758-.283 3.007-.359 5.625-2.212 5.954-3.905.517-2.665.475-6.507.475-6.507zm-4.024 6.709h-2.497V8.469c0-1.29-.543-1.944-1.628-1.944-1.2 0-1.802.776-1.802 2.312v3.349h-2.483v-3.35c0-1.536-.602-2.312-1.802-2.312-1.085 0-1.628.655-1.628 1.944v6.119H4.832V8.284c0-1.289.328-2.313.987-3.07.68-.758 1.569-1.146 2.674-1.146 1.278 0 2.246.491 2.886 1.474L12 6.585l.622-1.043c.64-.983 1.608-1.474 2.886-1.474 1.104 0 1.994.388 2.674 1.146.658.757.986 1.781.986 3.07v6.304z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/meetup.js /** * WordPress dependencies */ const MeetupIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19.24775,14.722a3.57032,3.57032,0,0,1-2.94457,3.52073,3.61886,3.61886,0,0,1-.64652.05634c-.07314-.0008-.10187.02846-.12507.09547A2.38881,2.38881,0,0,1,13.49453,20.094a2.33092,2.33092,0,0,1-1.827-.50716.13635.13635,0,0,0-.19878-.00408,3.191,3.191,0,0,1-2.104.60248,3.26309,3.26309,0,0,1-3.00324-2.71993,2.19076,2.19076,0,0,1-.03512-.30865c-.00156-.08579-.03413-.1189-.11608-.13493a2.86421,2.86421,0,0,1-1.23189-.56111,2.945,2.945,0,0,1-1.166-2.05749,2.97484,2.97484,0,0,1,.87524-2.50774.112.112,0,0,0,.02091-.16107,2.7213,2.7213,0,0,1-.36648-1.48A2.81256,2.81256,0,0,1,6.57673,7.58838a.35764.35764,0,0,0,.28869-.22819,4.2208,4.2208,0,0,1,6.02892-1.90111.25161.25161,0,0,0,.22023.0243,3.65608,3.65608,0,0,1,3.76031.90678A3.57244,3.57244,0,0,1,17.95918,8.626a2.97339,2.97339,0,0,1,.01829.57356.10637.10637,0,0,0,.0853.12792,1.97669,1.97669,0,0,1,1.27939,1.33733,2.00266,2.00266,0,0,1-.57112,2.12652c-.05284.05166-.04168.08328-.01173.13489A3.51189,3.51189,0,0,1,19.24775,14.722Zm-6.35959-.27836a1.6984,1.6984,0,0,0,1.14556,1.61113,3.82039,3.82039,0,0,0,1.036.17935,1.46888,1.46888,0,0,0,.73509-.12255.44082.44082,0,0,0,.26057-.44274.45312.45312,0,0,0-.29211-.43375.97191.97191,0,0,0-.20678-.063c-.21326-.03806-.42754-.0701-.63973-.11215a.54787.54787,0,0,1-.50172-.60926,2.75864,2.75864,0,0,1,.1773-.901c.1763-.535.414-1.045.64183-1.55913A12.686,12.686,0,0,0,15.85,10.47863a1.58461,1.58461,0,0,0,.04861-.87208,1.04531,1.04531,0,0,0-.85432-.83981,1.60658,1.60658,0,0,0-1.23654.16594.27593.27593,0,0,1-.36286-.03413c-.085-.0747-.16594-.15379-.24918-.23055a.98682.98682,0,0,0-1.33577-.04933,6.1468,6.1468,0,0,1-.4989.41615.47762.47762,0,0,1-.51535.03566c-.17448-.09307-.35512-.175-.53531-.25665a1.74949,1.74949,0,0,0-.56476-.2016,1.69943,1.69943,0,0,0-1.61654.91787,8.05815,8.05815,0,0,0-.32952.80126c-.45471,1.2557-.82507,2.53825-1.20838,3.81639a1.24151,1.24151,0,0,0,.51532,1.44389,1.42659,1.42659,0,0,0,1.22008.17166,1.09728,1.09728,0,0,0,.66994-.69764c.44145-1.04111.839-2.09989,1.25981-3.14926.11581-.28876.22792-.57874.35078-.86438a.44548.44548,0,0,1,.69189-.19539.50521.50521,0,0,1,.15044.43836,1.75625,1.75625,0,0,1-.14731.50453c-.27379.69219-.55265,1.38236-.82766,2.074a2.0836,2.0836,0,0,0-.14038.42876.50719.50719,0,0,0,.27082.57722.87236.87236,0,0,0,.66145.02739.99137.99137,0,0,0,.53406-.532q.61571-1.20914,1.228-2.42031.28423-.55863.57585-1.1133a.87189.87189,0,0,1,.29055-.35253.34987.34987,0,0,1,.37634-.01265.30291.30291,0,0,1,.12434.31459.56716.56716,0,0,1-.04655.1915c-.05318.12739-.10286.25669-.16183.38156-.34118.71775-.68754,1.43273-1.02568,2.152A2.00213,2.00213,0,0,0,12.88816,14.44366Zm4.78568,5.28972a.88573.88573,0,0,0-1.77139.00465.8857.8857,0,0,0,1.77139-.00465Zm-14.83838-7.296a.84329.84329,0,1,0,.00827-1.68655.8433.8433,0,0,0-.00827,1.68655Zm10.366-9.43673a.83506.83506,0,1,0-.0091,1.67.83505.83505,0,0,0,.0091-1.67Zm6.85014,5.22a.71651.71651,0,0,0-1.433.0093.71656.71656,0,0,0,1.433-.0093ZM5.37528,6.17908A.63823.63823,0,1,0,6.015,5.54483.62292.62292,0,0,0,5.37528,6.17908Zm6.68214,14.80843a.54949.54949,0,1,0-.55052.541A.54556.54556,0,0,0,12.05742,20.98752Zm8.53235-8.49689a.54777.54777,0,0,0-.54027.54023.53327.53327,0,0,0,.532.52293.51548.51548,0,0,0,.53272-.5237A.53187.53187,0,0,0,20.58977,12.49063ZM7.82846,2.4715a.44927.44927,0,1,0,.44484.44766A.43821.43821,0,0,0,7.82846,2.4715Zm13.775,7.60492a.41186.41186,0,0,0-.40065.39623.40178.40178,0,0,0,.40168.40168A.38994.38994,0,0,0,22,10.48172.39946.39946,0,0,0,21.60349,10.07642ZM5.79193,17.96207a.40469.40469,0,0,0-.397-.39646.399.399,0,0,0-.396.405.39234.39234,0,0,0,.39939.389A.39857.39857,0,0,0,5.79193,17.96207Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/medium.js /** * WordPress dependencies */ const MediumIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13.2,12c0,3-2.4,5.4-5.3,5.4S2.6,15,2.6,12s2.4-5.4,5.3-5.4S13.2,9,13.2,12 M19.1,12c0,2.8-1.2,5-2.7,5s-2.7-2.3-2.7-5s1.2-5,2.7-5C17.9,7,19.1,9.2,19.1,12 M21.4,12c0,2.5-0.4,4.5-0.9,4.5c-0.5,0-0.9-2-0.9-4.5s0.4-4.5,0.9-4.5C21,7.5,21.4,9.5,21.4,12" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/patreon.js /** * WordPress dependencies */ const PatreonIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M20 8.40755C19.9969 6.10922 18.2543 4.22555 16.2097 3.54588C13.6708 2.70188 10.3222 2.82421 7.89775 3.99921C4.95932 5.42355 4.03626 8.54355 4.00186 11.6552C3.97363 14.2136 4.2222 20.9517 7.92225 20.9997C10.6715 21.0356 11.0809 17.3967 12.3529 15.6442C13.258 14.3974 14.4233 14.0452 15.8578 13.6806C18.3233 13.0537 20.0036 11.0551 20 8.40755Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/pinterest.js /** * WordPress dependencies */ const PinterestIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/pocket.js /** * WordPress dependencies */ const PocketIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M21.927,4.194C21.667,3.48,20.982,3,20.222,3h-0.01h-1.721H3.839C3.092,3,2.411,3.47,2.145,4.17 C2.066,4.378,2.026,4.594,2.026,4.814v6.035l0.069,1.2c0.29,2.73,1.707,5.115,3.899,6.778c0.039,0.03,0.079,0.059,0.119,0.089 l0.025,0.018c1.175,0.859,2.491,1.441,3.91,1.727c0.655,0.132,1.325,0.2,1.991,0.2c0.615,0,1.232-0.057,1.839-0.17 c0.073-0.014,0.145-0.028,0.219-0.044c0.02-0.004,0.042-0.012,0.064-0.023c1.359-0.297,2.621-0.864,3.753-1.691l0.025-0.018 c0.04-0.029,0.08-0.058,0.119-0.089c2.192-1.664,3.609-4.049,3.898-6.778l0.069-1.2V4.814C22.026,4.605,22,4.398,21.927,4.194z M17.692,10.481l-4.704,4.512c-0.266,0.254-0.608,0.382-0.949,0.382c-0.342,0-0.684-0.128-0.949-0.382l-4.705-4.512 C5.838,9.957,5.82,9.089,6.344,8.542c0.524-0.547,1.392-0.565,1.939-0.04l3.756,3.601l3.755-3.601 c0.547-0.524,1.415-0.506,1.939,0.04C18.256,9.089,18.238,9.956,17.692,10.481z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/reddit.js /** * WordPress dependencies */ const RedditIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M5.27 9.221A2.775 2.775 0 0 0 2.498 11.993a2.785 2.785 0 0 0 1.6 2.511 5.337 5.337 0 0 0 2.374 4.11 9.386 9.386 0 0 0 5.539 1.7 9.386 9.386 0 0 0 5.541-1.7 5.331 5.331 0 0 0 2.372-4.114 2.787 2.787 0 0 0 1.583-2.5 2.775 2.775 0 0 0-2.772-2.772 2.742 2.742 0 0 0-1.688.574 9.482 9.482 0 0 0-4.637-1.348v-.008a2.349 2.349 0 0 1 2.011-2.316 1.97 1.97 0 0 0 1.926 1.521 1.98 1.98 0 0 0 1.978-1.978 1.98 1.98 0 0 0-1.978-1.978 1.985 1.985 0 0 0-1.938 1.578 3.183 3.183 0 0 0-2.849 3.172v.011a9.463 9.463 0 0 0-4.59 1.35 2.741 2.741 0 0 0-1.688-.574Zm6.736 9.1a3.162 3.162 0 0 1-2.921-1.944.215.215 0 0 1 .014-.2.219.219 0 0 1 .168-.106 27.327 27.327 0 0 1 2.74-.133 27.357 27.357 0 0 1 2.74.133.219.219 0 0 1 .168.106.215.215 0 0 1 .014.2 3.158 3.158 0 0 1-2.921 1.944Zm3.743-3.157a1.265 1.265 0 0 1-1.4-1.371 1.954 1.954 0 0 1 .482-1.442 1.15 1.15 0 0 1 .842-.379 1.7 1.7 0 0 1 1.49 1.777 1.323 1.323 0 0 1-.325 1.015 1.476 1.476 0 0 1-1.089.4Zm-7.485 0a1.476 1.476 0 0 1-1.086-.4 1.323 1.323 0 0 1-.325-1.016 1.7 1.7 0 0 1 1.49-1.777 1.151 1.151 0 0 1 .843.379 1.951 1.951 0 0 1 .481 1.441 1.276 1.276 0 0 1-1.403 1.373Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/skype.js /** * WordPress dependencies */ const SkypeIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M10.113,2.699c0.033-0.006,0.067-0.013,0.1-0.02c0.033,0.017,0.066,0.033,0.098,0.051L10.113,2.699z M2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223z M21.275,13.771 c0.007-0.035,0.011-0.071,0.018-0.106c-0.018-0.031-0.033-0.064-0.052-0.095L21.275,13.771z M13.563,21.199 c0.032,0.019,0.065,0.035,0.096,0.053c0.036-0.006,0.071-0.011,0.105-0.017L13.563,21.199z M22,16.386 c0,1.494-0.581,2.898-1.637,3.953c-1.056,1.057-2.459,1.637-3.953,1.637c-0.967,0-1.914-0.251-2.75-0.725 c0.036-0.006,0.071-0.011,0.105-0.017l-0.202-0.035c0.032,0.019,0.065,0.035,0.096,0.053c-0.543,0.096-1.099,0.147-1.654,0.147 c-1.275,0-2.512-0.25-3.676-0.743c-1.125-0.474-2.135-1.156-3.002-2.023c-0.867-0.867-1.548-1.877-2.023-3.002 c-0.493-1.164-0.743-2.401-0.743-3.676c0-0.546,0.049-1.093,0.142-1.628c0.018,0.032,0.033,0.064,0.051,0.095L2.72,10.223 c-0.006,0.034-0.011,0.069-0.017,0.103C2.244,9.5,2,8.566,2,7.615c0-1.493,0.582-2.898,1.637-3.953 c1.056-1.056,2.46-1.638,3.953-1.638c0.915,0,1.818,0.228,2.622,0.655c-0.033,0.007-0.067,0.013-0.1,0.02l0.199,0.031 c-0.032-0.018-0.066-0.034-0.098-0.051c0.002,0,0.003-0.001,0.004-0.001c0.586-0.112,1.187-0.169,1.788-0.169 c1.275,0,2.512,0.249,3.676,0.742c1.124,0.476,2.135,1.156,3.002,2.024c0.868,0.867,1.548,1.877,2.024,3.002 c0.493,1.164,0.743,2.401,0.743,3.676c0,0.575-0.054,1.15-0.157,1.712c-0.018-0.031-0.033-0.064-0.052-0.095l0.034,0.201 c0.007-0.035,0.011-0.071,0.018-0.106C21.754,14.494,22,15.432,22,16.386z M16.817,14.138c0-1.331-0.613-2.743-3.033-3.282 l-2.209-0.49c-0.84-0.192-1.807-0.444-1.807-1.237c0-0.794,0.679-1.348,1.903-1.348c2.468,0,2.243,1.696,3.468,1.696 c0.645,0,1.209-0.379,1.209-1.031c0-1.521-2.435-2.663-4.5-2.663c-2.242,0-4.63,0.952-4.63,3.488c0,1.221,0.436,2.521,2.839,3.123 l2.984,0.745c0.903,0.223,1.129,0.731,1.129,1.189c0,0.762-0.758,1.507-2.129,1.507c-2.679,0-2.307-2.062-3.743-2.062 c-0.645,0-1.113,0.444-1.113,1.078c0,1.236,1.501,2.886,4.856,2.886C15.236,17.737,16.817,16.199,16.817,14.138z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/snapchat.js /** * WordPress dependencies */ const SnapchatIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.065,2a5.526,5.526,0,0,1,3.132.892A5.854,5.854,0,0,1,17.326,5.4a5.821,5.821,0,0,1,.351,2.33q0,.612-.117,2.487a.809.809,0,0,0,.365.091,1.93,1.93,0,0,0,.664-.176,1.93,1.93,0,0,1,.664-.176,1.3,1.3,0,0,1,.729.234.7.7,0,0,1,.351.6.839.839,0,0,1-.41.7,2.732,2.732,0,0,1-.9.41,3.192,3.192,0,0,0-.9.378.728.728,0,0,0-.41.618,1.575,1.575,0,0,0,.156.56,6.9,6.9,0,0,0,1.334,1.953,5.6,5.6,0,0,0,1.881,1.315,5.875,5.875,0,0,0,1.042.3.42.42,0,0,1,.365.456q0,.911-2.852,1.341a1.379,1.379,0,0,0-.143.507,1.8,1.8,0,0,1-.182.605.451.451,0,0,1-.429.241,5.878,5.878,0,0,1-.807-.085,5.917,5.917,0,0,0-.833-.085,4.217,4.217,0,0,0-.807.065,2.42,2.42,0,0,0-.82.293,6.682,6.682,0,0,0-.755.5q-.351.267-.755.527a3.886,3.886,0,0,1-.989.436A4.471,4.471,0,0,1,11.831,22a4.307,4.307,0,0,1-1.256-.176,3.784,3.784,0,0,1-.976-.436q-.4-.26-.749-.527a6.682,6.682,0,0,0-.755-.5,2.422,2.422,0,0,0-.807-.293,4.432,4.432,0,0,0-.82-.065,5.089,5.089,0,0,0-.853.1,5,5,0,0,1-.762.1.474.474,0,0,1-.456-.241,1.819,1.819,0,0,1-.182-.618,1.411,1.411,0,0,0-.143-.521q-2.852-.429-2.852-1.341a.42.42,0,0,1,.365-.456,5.793,5.793,0,0,0,1.042-.3,5.524,5.524,0,0,0,1.881-1.315,6.789,6.789,0,0,0,1.334-1.953A1.575,1.575,0,0,0,6,12.9a.728.728,0,0,0-.41-.618,3.323,3.323,0,0,0-.9-.384,2.912,2.912,0,0,1-.9-.41.814.814,0,0,1-.41-.684.71.71,0,0,1,.338-.593,1.208,1.208,0,0,1,.716-.241,1.976,1.976,0,0,1,.625.169,2.008,2.008,0,0,0,.69.169.919.919,0,0,0,.416-.091q-.117-1.849-.117-2.474A5.861,5.861,0,0,1,6.385,5.4,5.516,5.516,0,0,1,8.625,2.819,7.075,7.075,0,0,1,12.062,2Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/soundcloud.js /** * WordPress dependencies */ const SoundCloudIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M23.994 14.552a3.36 3.36 0 01-3.401 3.171h-8.176a.685.685 0 01-.679-.681V8.238a.749.749 0 01.452-.716S12.942 7 14.526 7a5.357 5.357 0 012.748.755 5.44 5.44 0 012.56 3.546c.282-.08.574-.12.868-.119a3.273 3.273 0 013.292 3.37zM10.718 8.795a.266.266 0 10-.528 0c-.224 2.96-.397 5.735 0 8.685a.265.265 0 00.528 0c.425-2.976.246-5.7 0-8.685zM9.066 9.82a.278.278 0 00-.553 0 33.183 33.183 0 000 7.663.278.278 0 00.55 0c.33-2.544.332-5.12.003-7.664zM7.406 9.56a.269.269 0 00-.535 0c-.253 2.7-.38 5.222 0 7.917a.266.266 0 10.531 0c.394-2.73.272-5.181.004-7.917zM5.754 10.331a.275.275 0 10-.55 0 28.035 28.035 0 000 7.155.272.272 0 00.54 0c.332-2.373.335-4.78.01-7.155zM4.087 12.12a.272.272 0 00-.544 0c-.393 1.843-.208 3.52.016 5.386a.26.26 0 00.512 0c.247-1.892.435-3.53.016-5.386zM2.433 11.838a.282.282 0 00-.56 0c-.349 1.882-.234 3.54.01 5.418.025.285.508.282.54 0 .269-1.907.394-3.517.01-5.418zM.762 12.76a.282.282 0 00-.56 0c-.32 1.264-.22 2.31.023 3.578a.262.262 0 00.521 0c.282-1.293.42-2.317.016-3.578z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/spotify.js /** * WordPress dependencies */ const SpotifyIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12,2C6.477,2,2,6.477,2,12c0,5.523,4.477,10,10,10c5.523,0,10-4.477,10-10C22,6.477,17.523,2,12,2 M16.586,16.424 c-0.18,0.295-0.563,0.387-0.857,0.207c-2.348-1.435-5.304-1.76-8.785-0.964c-0.335,0.077-0.67-0.133-0.746-0.469 c-0.077-0.335,0.132-0.67,0.469-0.746c3.809-0.871,7.077-0.496,9.713,1.115C16.673,15.746,16.766,16.13,16.586,16.424 M17.81,13.7 c-0.226,0.367-0.706,0.482-1.072,0.257c-2.687-1.652-6.785-2.131-9.965-1.166C6.36,12.917,5.925,12.684,5.8,12.273 C5.675,11.86,5.908,11.425,6.32,11.3c3.632-1.102,8.147-0.568,11.234,1.328C17.92,12.854,18.035,13.335,17.81,13.7 M17.915,10.865 c-3.223-1.914-8.54-2.09-11.618-1.156C5.804,9.859,5.281,9.58,5.131,9.086C4.982,8.591,5.26,8.069,5.755,7.919 c3.532-1.072,9.404-0.865,13.115,1.338c0.445,0.264,0.59,0.838,0.327,1.282C18.933,10.983,18.359,11.129,17.915,10.865" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/telegram.js /** * WordPress dependencies */ const TelegramIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 128 128", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M28.9700376,63.3244248 C47.6273373,55.1957357 60.0684594,49.8368063 66.2934036,47.2476366 C84.0668845,39.855031 87.7600616,38.5708563 90.1672227,38.528 C90.6966555,38.5191258 91.8804274,38.6503351 92.6472251,39.2725385 C93.294694,39.7979149 93.4728387,40.5076237 93.5580865,41.0057381 C93.6433345,41.5038525 93.7494885,42.63857 93.6651041,43.5252052 C92.7019529,53.6451182 88.5344133,78.2034783 86.4142057,89.5379542 C85.5170662,94.3339958 83.750571,95.9420841 82.0403991,96.0994568 C78.3237996,96.4414641 75.5015827,93.6432685 71.9018743,91.2836143 C66.2690414,87.5912212 63.0868492,85.2926952 57.6192095,81.6896017 C51.3004058,77.5256038 55.3966232,75.2369981 58.9976911,71.4967761 C59.9401076,70.5179421 76.3155302,55.6232293 76.6324771,54.2720454 C76.6721165,54.1030573 76.7089039,53.4731496 76.3346867,53.1405352 C75.9604695,52.8079208 75.4081573,52.921662 75.0095933,53.0121213 C74.444641,53.1403447 65.4461175,59.0880351 48.0140228,70.8551922 C45.4598218,72.6091037 43.1463059,73.4636682 41.0734751,73.4188859 C38.7883453,73.3695169 34.3926725,72.1268388 31.1249416,71.0646282 C27.1169366,69.7617838 23.931454,69.0729605 24.208838,66.8603276 C24.3533167,65.7078514 25.9403832,64.5292172 28.9700376,63.3244248 Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/threads.js /** * WordPress dependencies */ const ThreadsIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.3 11.3c-.1 0-.2-.1-.2-.1-.1-2.6-1.5-4-3.9-4-1.4 0-2.6.6-3.3 1.7l1.3.9c.5-.8 1.4-1 2-1 .8 0 1.4.2 1.7.7.3.3.5.8.5 1.3-.7-.1-1.4-.2-2.2-.1-2.2.1-3.7 1.4-3.6 3.2 0 .9.5 1.7 1.3 2.2.7.4 1.5.6 2.4.6 1.2-.1 2.1-.5 2.7-1.3.5-.6.8-1.4.9-2.4.6.3 1 .8 1.2 1.3.4.9.4 2.4-.8 3.6-1.1 1.1-2.3 1.5-4.3 1.5-2.1 0-3.8-.7-4.8-2S5.7 14.3 5.7 12c0-2.3.5-4.1 1.5-5.4 1.1-1.3 2.7-2 4.8-2 2.2 0 3.8.7 4.9 2 .5.7.9 1.5 1.2 2.5l1.5-.4c-.3-1.2-.8-2.2-1.5-3.1-1.3-1.7-3.3-2.6-6-2.6-2.6 0-4.7.9-6 2.6C4.9 7.2 4.3 9.3 4.3 12s.6 4.8 1.9 6.4c1.4 1.7 3.4 2.6 6 2.6 2.3 0 4-.6 5.3-2 1.8-1.8 1.7-4 1.1-5.4-.4-.9-1.2-1.7-2.3-2.3zm-4 3.8c-1 .1-2-.4-2-1.3 0-.7.5-1.5 2.1-1.6h.5c.6 0 1.1.1 1.6.2-.2 2.3-1.3 2.7-2.2 2.7z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/tiktok.js /** * WordPress dependencies */ const TiktokIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 32 32", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.708 0.027c1.745-0.027 3.48-0.011 5.213-0.027 0.105 2.041 0.839 4.12 2.333 5.563 1.491 1.479 3.6 2.156 5.652 2.385v5.369c-1.923-0.063-3.855-0.463-5.6-1.291-0.76-0.344-1.468-0.787-2.161-1.24-0.009 3.896 0.016 7.787-0.025 11.667-0.104 1.864-0.719 3.719-1.803 5.255-1.744 2.557-4.771 4.224-7.88 4.276-1.907 0.109-3.812-0.411-5.437-1.369-2.693-1.588-4.588-4.495-4.864-7.615-0.032-0.667-0.043-1.333-0.016-1.984 0.24-2.537 1.495-4.964 3.443-6.615 2.208-1.923 5.301-2.839 8.197-2.297 0.027 1.975-0.052 3.948-0.052 5.923-1.323-0.428-2.869-0.308-4.025 0.495-0.844 0.547-1.485 1.385-1.819 2.333-0.276 0.676-0.197 1.427-0.181 2.145 0.317 2.188 2.421 4.027 4.667 3.828 1.489-0.016 2.916-0.88 3.692-2.145 0.251-0.443 0.532-0.896 0.547-1.417 0.131-2.385 0.079-4.76 0.095-7.145 0.011-5.375-0.016-10.735 0.025-16.093z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/tumblr.js /** * WordPress dependencies */ const TumblrIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.04 21.28h-3.28c-2.84 0-4.94-1.37-4.94-5.02v-5.67H6.08V7.5c2.93-.73 4.11-3.3 4.3-5.48h3.01v4.93h3.47v3.65H13.4v4.93c0 1.47.73 2.01 1.92 2.01h1.73v3.75z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitch.js /** * WordPress dependencies */ const TwitchIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.499,8.089h-1.636v4.91h1.636V8.089z M12,8.089h-1.637v4.91H12V8.089z M4.228,3.178L3,6.451v13.092h4.499V22h2.456 l2.454-2.456h3.681L21,14.636V3.178H4.228z M19.364,13.816l-2.864,2.865H12l-2.453,2.453V16.68H5.863V4.814h13.501V13.816z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/twitter.js /** * WordPress dependencies */ const TwitterIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M22.23,5.924c-0.736,0.326-1.527,0.547-2.357,0.646c0.847-0.508,1.498-1.312,1.804-2.27 c-0.793,0.47-1.671,0.812-2.606,0.996C18.324,4.498,17.257,4,16.077,4c-2.266,0-4.103,1.837-4.103,4.103 c0,0.322,0.036,0.635,0.106,0.935C8.67,8.867,5.647,7.234,3.623,4.751C3.27,5.357,3.067,6.062,3.067,6.814 c0,1.424,0.724,2.679,1.825,3.415c-0.673-0.021-1.305-0.206-1.859-0.513c0,0.017,0,0.034,0,0.052c0,1.988,1.414,3.647,3.292,4.023 c-0.344,0.094-0.707,0.144-1.081,0.144c-0.264,0-0.521-0.026-0.772-0.074c0.522,1.63,2.038,2.816,3.833,2.85 c-1.404,1.1-3.174,1.756-5.096,1.756c-0.331,0-0.658-0.019-0.979-0.057c1.816,1.164,3.973,1.843,6.29,1.843 c7.547,0,11.675-6.252,11.675-11.675c0-0.178-0.004-0.355-0.012-0.531C20.985,7.47,21.68,6.747,22.23,5.924z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/vimeo.js /** * WordPress dependencies */ const VimeoIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M22.396,7.164c-0.093,2.026-1.507,4.799-4.245,8.32C15.322,19.161,12.928,21,10.97,21c-1.214,0-2.24-1.119-3.079-3.359 c-0.56-2.053-1.119-4.106-1.68-6.159C5.588,9.243,4.921,8.122,4.206,8.122c-0.156,0-0.701,0.328-1.634,0.98L1.594,7.841 c1.027-0.902,2.04-1.805,3.037-2.708C6.001,3.95,7.03,3.327,7.715,3.264c1.619-0.156,2.616,0.951,2.99,3.321 c0.404,2.557,0.685,4.147,0.841,4.769c0.467,2.121,0.981,3.181,1.542,3.181c0.435,0,1.09-0.688,1.963-2.065 c0.871-1.376,1.338-2.422,1.401-3.142c0.125-1.187-0.343-1.782-1.401-1.782c-0.498,0-1.012,0.115-1.541,0.341 c1.023-3.35,2.977-4.977,5.862-4.884C21.511,3.066,22.52,4.453,22.396,7.164z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/vk.js /** * WordPress dependencies */ const VkIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M22,7.1c0.2,0.4-0.4,1.5-1.6,3.1c-0.2,0.2-0.4,0.5-0.7,0.9c-0.5,0.7-0.9,1.1-0.9,1.4c-0.1,0.3-0.1,0.6,0.1,0.8 c0.1,0.1,0.4,0.4,0.8,0.9h0l0,0c1,0.9,1.6,1.7,2,2.3c0,0,0,0.1,0.1,0.1c0,0.1,0,0.1,0.1,0.3c0,0.1,0,0.2,0,0.4 c0,0.1-0.1,0.2-0.3,0.3c-0.1,0.1-0.4,0.1-0.6,0.1l-2.7,0c-0.2,0-0.4,0-0.6-0.1c-0.2-0.1-0.4-0.1-0.5-0.2l-0.2-0.1 c-0.2-0.1-0.5-0.4-0.7-0.7s-0.5-0.6-0.7-0.8c-0.2-0.2-0.4-0.4-0.6-0.6C14.8,15,14.6,15,14.4,15c0,0,0,0-0.1,0c0,0-0.1,0.1-0.2,0.2 c-0.1,0.1-0.2,0.2-0.2,0.3c-0.1,0.1-0.1,0.3-0.2,0.5c-0.1,0.2-0.1,0.5-0.1,0.8c0,0.1,0,0.2,0,0.3c0,0.1-0.1,0.2-0.1,0.2l0,0.1 c-0.1,0.1-0.3,0.2-0.6,0.2h-1.2c-0.5,0-1,0-1.5-0.2c-0.5-0.1-1-0.3-1.4-0.6s-0.7-0.5-1.1-0.7s-0.6-0.4-0.7-0.6l-0.3-0.3 c-0.1-0.1-0.2-0.2-0.3-0.3s-0.4-0.5-0.7-0.9s-0.7-1-1.1-1.6c-0.4-0.6-0.8-1.3-1.3-2.2C2.9,9.4,2.5,8.5,2.1,7.5C2,7.4,2,7.3,2,7.2 c0-0.1,0-0.1,0-0.2l0-0.1c0.1-0.1,0.3-0.2,0.6-0.2l2.9,0c0.1,0,0.2,0,0.2,0.1S5.9,6.9,5.9,7L6,7c0.1,0.1,0.2,0.2,0.3,0.3 C6.4,7.7,6.5,8,6.7,8.4C6.9,8.8,7,9,7.1,9.2l0.2,0.3c0.2,0.4,0.4,0.8,0.6,1.1c0.2,0.3,0.4,0.5,0.5,0.7s0.3,0.3,0.4,0.4 c0.1,0.1,0.3,0.1,0.4,0.1c0.1,0,0.2,0,0.3-0.1c0,0,0,0,0.1-0.1c0,0,0.1-0.1,0.1-0.2c0.1-0.1,0.1-0.3,0.1-0.5c0-0.2,0.1-0.5,0.1-0.8 c0-0.4,0-0.8,0-1.3c0-0.3,0-0.5-0.1-0.8c0-0.2-0.1-0.4-0.1-0.5L9.6,7.6C9.4,7.3,9.1,7.2,8.7,7.1C8.6,7.1,8.6,7,8.7,6.9 C8.9,6.7,9,6.6,9.1,6.5c0.4-0.2,1.2-0.3,2.5-0.3c0.6,0,1,0.1,1.4,0.1c0.1,0,0.3,0.1,0.3,0.1c0.1,0.1,0.2,0.1,0.2,0.3 c0,0.1,0.1,0.2,0.1,0.3s0,0.3,0,0.5c0,0.2,0,0.4,0,0.6c0,0.2,0,0.4,0,0.7c0,0.3,0,0.6,0,0.9c0,0.1,0,0.2,0,0.4c0,0.2,0,0.4,0,0.5 c0,0.1,0,0.3,0,0.4s0.1,0.3,0.1,0.4c0.1,0.1,0.1,0.2,0.2,0.3c0.1,0,0.1,0,0.2,0c0.1,0,0.2,0,0.3-0.1c0.1-0.1,0.2-0.2,0.4-0.4 s0.3-0.4,0.5-0.7c0.2-0.3,0.5-0.7,0.7-1.1c0.4-0.7,0.8-1.5,1.1-2.3c0-0.1,0.1-0.1,0.1-0.2c0-0.1,0.1-0.1,0.1-0.1l0,0l0.1,0 c0,0,0,0,0.1,0s0.2,0,0.2,0l3,0c0.3,0,0.5,0,0.7,0S21.9,7,21.9,7L22,7.1z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/whatsapp.js /** * WordPress dependencies */ const WhatsAppIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M 12.011719 2 C 6.5057187 2 2.0234844 6.478375 2.0214844 11.984375 C 2.0204844 13.744375 2.4814687 15.462563 3.3554688 16.976562 L 2 22 L 7.2324219 20.763672 C 8.6914219 21.559672 10.333859 21.977516 12.005859 21.978516 L 12.009766 21.978516 C 17.514766 21.978516 21.995047 17.499141 21.998047 11.994141 C 22.000047 9.3251406 20.962172 6.8157344 19.076172 4.9277344 C 17.190172 3.0407344 14.683719 2.001 12.011719 2 z M 12.009766 4 C 14.145766 4.001 16.153109 4.8337969 17.662109 6.3417969 C 19.171109 7.8517969 20.000047 9.8581875 19.998047 11.992188 C 19.996047 16.396187 16.413812 19.978516 12.007812 19.978516 C 10.674812 19.977516 9.3544062 19.642812 8.1914062 19.007812 L 7.5175781 18.640625 L 6.7734375 18.816406 L 4.8046875 19.28125 L 5.2851562 17.496094 L 5.5019531 16.695312 L 5.0878906 15.976562 C 4.3898906 14.768562 4.0204844 13.387375 4.0214844 11.984375 C 4.0234844 7.582375 7.6067656 4 12.009766 4 z M 8.4765625 7.375 C 8.3095625 7.375 8.0395469 7.4375 7.8105469 7.6875 C 7.5815469 7.9365 6.9355469 8.5395781 6.9355469 9.7675781 C 6.9355469 10.995578 7.8300781 12.182609 7.9550781 12.349609 C 8.0790781 12.515609 9.68175 15.115234 12.21875 16.115234 C 14.32675 16.946234 14.754891 16.782234 15.212891 16.740234 C 15.670891 16.699234 16.690438 16.137687 16.898438 15.554688 C 17.106437 14.971687 17.106922 14.470187 17.044922 14.367188 C 16.982922 14.263188 16.816406 14.201172 16.566406 14.076172 C 16.317406 13.951172 15.090328 13.348625 14.861328 13.265625 C 14.632328 13.182625 14.464828 13.140625 14.298828 13.390625 C 14.132828 13.640625 13.655766 14.201187 13.509766 14.367188 C 13.363766 14.534188 13.21875 14.556641 12.96875 14.431641 C 12.71875 14.305641 11.914938 14.041406 10.960938 13.191406 C 10.218937 12.530406 9.7182656 11.714844 9.5722656 11.464844 C 9.4272656 11.215844 9.5585938 11.079078 9.6835938 10.955078 C 9.7955938 10.843078 9.9316406 10.663578 10.056641 10.517578 C 10.180641 10.371578 10.223641 10.267562 10.306641 10.101562 C 10.389641 9.9355625 10.347156 9.7890625 10.285156 9.6640625 C 10.223156 9.5390625 9.737625 8.3065 9.515625 7.8125 C 9.328625 7.3975 9.131125 7.3878594 8.953125 7.3808594 C 8.808125 7.3748594 8.6425625 7.375 8.4765625 7.375 z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/x.js /** * WordPress dependencies */ const XIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/yelp.js /** * WordPress dependencies */ const YelpIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M12.271,16.718v1.417q-.011,3.257-.067,3.4a.707.707,0,0,1-.569.446,4.637,4.637,0,0,1-2.024-.424A4.609,4.609,0,0,1,7.8,20.565a.844.844,0,0,1-.19-.4.692.692,0,0,1,.044-.29,3.181,3.181,0,0,1,.379-.524q.335-.412,2.019-2.409.011,0,.669-.781a.757.757,0,0,1,.44-.274.965.965,0,0,1,.552.039.945.945,0,0,1,.418.324.732.732,0,0,1,.139.468Zm-1.662-2.8a.783.783,0,0,1-.58.781l-1.339.435q-3.067.981-3.257.981a.711.711,0,0,1-.6-.4,2.636,2.636,0,0,1-.19-.836,9.134,9.134,0,0,1,.011-1.857,3.559,3.559,0,0,1,.335-1.389.659.659,0,0,1,.625-.357,22.629,22.629,0,0,1,2.253.859q.781.324,1.283.524l.937.379a.771.771,0,0,1,.4.34A.982.982,0,0,1,10.609,13.917Zm9.213,3.313a4.467,4.467,0,0,1-1.021,1.8,4.559,4.559,0,0,1-1.512,1.417.671.671,0,0,1-.7-.078q-.156-.112-2.052-3.2l-.524-.859a.761.761,0,0,1-.128-.513.957.957,0,0,1,.217-.513.774.774,0,0,1,.926-.29q.011.011,1.327.446,2.264.736,2.7.887a2.082,2.082,0,0,1,.524.229.673.673,0,0,1,.245.68Zm-7.5-7.049q.056,1.137-.6,1.361-.647.19-1.272-.792L6.237,4.08a.7.7,0,0,1,.212-.691,5.788,5.788,0,0,1,2.314-1,5.928,5.928,0,0,1,2.5-.352.681.681,0,0,1,.547.5q.034.2.245,3.407T12.327,10.181Zm7.384,1.2a.679.679,0,0,1-.29.658q-.167.112-3.67.959-.747.167-1.015.257l.011-.022a.769.769,0,0,1-.513-.044.914.914,0,0,1-.413-.357.786.786,0,0,1,0-.971q.011-.011.836-1.137,1.394-1.908,1.673-2.275a2.423,2.423,0,0,1,.379-.435A.7.7,0,0,1,17.435,8a4.482,4.482,0,0,1,1.372,1.489,4.81,4.81,0,0,1,.9,1.868v.034Z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/icons/youtube.js /** * WordPress dependencies */ const YouTubeIcon = () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M21.8,8.001c0,0-0.195-1.378-0.795-1.985c-0.76-0.797-1.613-0.801-2.004-0.847c-2.799-0.202-6.997-0.202-6.997-0.202 h-0.009c0,0-4.198,0-6.997,0.202C4.608,5.216,3.756,5.22,2.995,6.016C2.395,6.623,2.2,8.001,2.2,8.001S2,9.62,2,11.238v1.517 c0,1.618,0.2,3.237,0.2,3.237s0.195,1.378,0.795,1.985c0.761,0.797,1.76,0.771,2.205,0.855c1.6,0.153,6.8,0.201,6.8,0.201 s4.203-0.006,7.001-0.209c0.391-0.047,1.243-0.051,2.004-0.847c0.6-0.607,0.795-1.985,0.795-1.985s0.2-1.618,0.2-3.237v-1.517 C22,9.62,21.8,8.001,21.8,8.001z M9.935,14.594l-0.001-5.62l5.404,2.82L9.935,14.594z" }) }); ;// ./node_modules/@wordpress/block-library/build-module/social-link/variations.js /** * Internal dependencies */ const social_link_variations_variations = [{ isDefault: true, name: 'wordpress', attributes: { service: 'wordpress' }, title: 'WordPress', icon: WordPressIcon }, { name: 'fivehundredpx', attributes: { service: 'fivehundredpx' }, title: '500px', icon: FivehundredpxIcon }, { name: 'amazon', attributes: { service: 'amazon' }, title: 'Amazon', icon: AmazonIcon }, { name: 'bandcamp', attributes: { service: 'bandcamp' }, title: 'Bandcamp', icon: BandcampIcon }, { name: 'behance', attributes: { service: 'behance' }, title: 'Behance', icon: BehanceIcon }, { name: 'bluesky', attributes: { service: 'bluesky' }, title: 'Bluesky', icon: BlueskyIcon }, { name: 'chain', attributes: { service: 'chain' }, title: 'Link', icon: ChainIcon }, { name: 'codepen', attributes: { service: 'codepen' }, title: 'CodePen', icon: CodepenIcon }, { name: 'deviantart', attributes: { service: 'deviantart' }, title: 'DeviantArt', icon: DeviantArtIcon }, { name: 'discord', attributes: { service: 'discord' }, title: 'Discord', icon: DiscordIcon }, { name: 'dribbble', attributes: { service: 'dribbble' }, title: 'Dribbble', icon: DribbbleIcon }, { name: 'dropbox', attributes: { service: 'dropbox' }, title: 'Dropbox', icon: DropboxIcon }, { name: 'etsy', attributes: { service: 'etsy' }, title: 'Etsy', icon: EtsyIcon }, { name: 'facebook', attributes: { service: 'facebook' }, title: 'Facebook', icon: FacebookIcon }, { name: 'feed', attributes: { service: 'feed' }, title: 'RSS Feed', icon: FeedIcon }, { name: 'flickr', attributes: { service: 'flickr' }, title: 'Flickr', icon: FlickrIcon }, { name: 'foursquare', attributes: { service: 'foursquare' }, title: 'Foursquare', icon: FoursquareIcon }, { name: 'goodreads', attributes: { service: 'goodreads' }, title: 'Goodreads', icon: GoodreadsIcon }, { name: 'google', attributes: { service: 'google' }, title: 'Google', icon: GoogleIcon }, { name: 'github', attributes: { service: 'github' }, title: 'GitHub', icon: GitHubIcon }, { name: 'gravatar', attributes: { service: 'gravatar' }, title: 'Gravatar', icon: GravatarIcon }, { name: 'instagram', attributes: { service: 'instagram' }, title: 'Instagram', icon: InstagramIcon }, { name: 'lastfm', attributes: { service: 'lastfm' }, title: 'Last.fm', icon: LastfmIcon }, { name: 'linkedin', attributes: { service: 'linkedin' }, title: 'LinkedIn', icon: LinkedInIcon }, { name: 'mail', attributes: { service: 'mail' }, title: 'Mail', keywords: ['email', 'e-mail'], icon: MailIcon }, { name: 'mastodon', attributes: { service: 'mastodon' }, title: 'Mastodon', icon: MastodonIcon }, { name: 'meetup', attributes: { service: 'meetup' }, title: 'Meetup', icon: MeetupIcon }, { name: 'medium', attributes: { service: 'medium' }, title: 'Medium', icon: MediumIcon }, { name: 'patreon', attributes: { service: 'patreon' }, title: 'Patreon', icon: PatreonIcon }, { name: 'pinterest', attributes: { service: 'pinterest' }, title: 'Pinterest', icon: PinterestIcon }, { name: 'pocket', attributes: { service: 'pocket' }, title: 'Pocket', icon: PocketIcon }, { name: 'reddit', attributes: { service: 'reddit' }, title: 'Reddit', icon: RedditIcon }, { name: 'skype', attributes: { service: 'skype' }, title: 'Skype', icon: SkypeIcon }, { name: 'snapchat', attributes: { service: 'snapchat' }, title: 'Snapchat', icon: SnapchatIcon }, { name: 'soundcloud', attributes: { service: 'soundcloud' }, title: 'SoundCloud', icon: SoundCloudIcon }, { name: 'spotify', attributes: { service: 'spotify' }, title: 'Spotify', icon: SpotifyIcon }, { name: 'telegram', attributes: { service: 'telegram' }, title: 'Telegram', icon: TelegramIcon }, { name: 'threads', attributes: { service: 'threads' }, title: 'Threads', icon: ThreadsIcon }, { name: 'tiktok', attributes: { service: 'tiktok' }, title: 'TikTok', icon: TiktokIcon }, { name: 'tumblr', attributes: { service: 'tumblr' }, title: 'Tumblr', icon: TumblrIcon }, { name: 'twitch', attributes: { service: 'twitch' }, title: 'Twitch', icon: TwitchIcon }, { name: 'twitter', attributes: { service: 'twitter' }, title: 'Twitter', icon: TwitterIcon }, { name: 'vimeo', attributes: { service: 'vimeo' }, title: 'Vimeo', icon: VimeoIcon }, { name: 'vk', attributes: { service: 'vk' }, title: 'VK', icon: VkIcon }, { name: 'whatsapp', attributes: { service: 'whatsapp' }, title: 'WhatsApp', icon: WhatsAppIcon }, { name: 'x', attributes: { service: 'x' }, keywords: ['twitter'], title: 'X', icon: XIcon }, { name: 'yelp', attributes: { service: 'yelp' }, title: 'Yelp', icon: YelpIcon }, { name: 'youtube', attributes: { service: 'youtube' }, title: 'YouTube', icon: YouTubeIcon }]; /** * Add `isActive` function to all `social link` variations, if not defined. * `isActive` function is used to find a variation match from a created * Block by providing its attributes. */ social_link_variations_variations.forEach(variation => { if (variation.isActive) { return; } variation.isActive = (blockAttributes, variationAttributes) => blockAttributes.service === variationAttributes.service; }); /* harmony default export */ const social_link_variations = (social_link_variations_variations); ;// ./node_modules/@wordpress/block-library/build-module/social-link/social-list.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Retrieves the social service's icon component. * * @param {string} name key for a social service (lowercase slug) * * @return {Component} Icon component for social service. */ const getIconBySite = name => { const variation = social_link_variations.find(v => v.name === name); return variation ? variation.icon : ChainIcon; }; /** * Retrieves the display name for the social service. * * @param {string} name key for a social service (lowercase slug) * * @return {string} Display name for social service */ const getNameBySite = name => { const variation = social_link_variations.find(v => v.name === name); return variation ? variation.title : (0,external_wp_i18n_namespaceObject.__)('Social Icon'); }; ;// ./node_modules/@wordpress/block-library/build-module/social-link/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const SocialLinkURLPopover = ({ url, setAttributes, setPopover, popoverAnchor, clientId }) => { const { removeBlock } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.URLPopover, { anchor: popoverAnchor, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Edit social link'), onClose: () => { setPopover(false); popoverAnchor?.focus(); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { className: "block-editor-url-popover__link-editor", onSubmit: event => { event.preventDefault(); setPopover(false); popoverAnchor?.focus(); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-editor-url-input", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.URLInput, { value: url, onChange: nextURL => setAttributes({ url: nextURL }), placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter social link'), label: (0,external_wp_i18n_namespaceObject.__)('Enter social link'), hideLabelFromVision: true, disableSuggestions: true, onKeyDown: event => { if (!!url || event.defaultPrevented || ![external_wp_keycodes_namespaceObject.BACKSPACE, external_wp_keycodes_namespaceObject.DELETE].includes(event.keyCode)) { return; } removeBlock(clientId); }, suffix: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalInputControlSuffixWrapper, { variant: "control", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { icon: keyboard_return, label: (0,external_wp_i18n_namespaceObject.__)('Apply'), type: "submit", size: "small" }) }) }) }) }) }); }; const SocialLinkEdit = ({ attributes, context, isSelected, setAttributes, clientId }) => { const { url, service, label = '', rel } = attributes; const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const { showLabels, iconColor, iconColorValue, iconBackgroundColor, iconBackgroundColorValue } = context; const [showURLPopover, setPopover] = (0,external_wp_element_namespaceObject.useState)(false); const wrapperClasses = dist_clsx('wp-social-link', // Manually adding this class for backwards compatibility of CSS when moving the // blockProps from the li to the button: https://github.com/WordPress/gutenberg/pull/64883 'wp-block-social-link', 'wp-social-link-' + service, { 'wp-social-link__is-incomplete': !url, [`has-${iconColor}-color`]: iconColor, [`has-${iconBackgroundColor}-background-color`]: iconBackgroundColor }); // Use internal state instead of a ref to make sure that the component // re-renders when the popover's anchor updates. const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null); const isContentOnlyMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)() === 'contentOnly'; const IconComponent = getIconBySite(service); const socialLinkName = getNameBySite(service); // The initial label (ie. the link text) is an empty string. // We want to prevent empty links so that the link text always fallbacks to // the social name, even when users enter and save an empty string or only // spaces. The PHP render callback fallbacks to the social name as well. const socialLinkText = label.trim() === '' ? socialLinkName : label; const ref = (0,external_wp_element_namespaceObject.useRef)(); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: 'wp-block-social-link-anchor', ref: (0,external_wp_compose_namespaceObject.useMergeRefs)([setPopoverAnchor, ref]), onClick: () => setPopover(true), onKeyDown: event => { if (event.keyCode === external_wp_keycodes_namespaceObject.ENTER) { event.preventDefault(); setPopover(true); } } }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isContentOnlyMode && showLabels && /*#__PURE__*/ // Add an extra control to modify the label attribute when content only mode is active. // With content only mode active, the inspector is hidden, so users need another way // to edit this attribute. (0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, { popoverProps: { position: 'bottom right' }, renderToggle: ({ isOpen, onToggle }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: onToggle, "aria-haspopup": "true", "aria-expanded": isOpen, children: (0,external_wp_i18n_namespaceObject.__)('Text') }), renderContent: () => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, className: "wp-block-social-link__toolbar_content_text", label: (0,external_wp_i18n_namespaceObject.__)('Text'), help: (0,external_wp_i18n_namespaceObject.__)('Provide a text label or use the default.'), value: label, onChange: value => setAttributes({ label: value }), placeholder: socialLinkName }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ label: undefined }); }, dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { isShownByDefault: true, label: (0,external_wp_i18n_namespaceObject.__)('Text'), hasValue: () => !!label, onDeselect: () => { setAttributes({ label: undefined }); }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Text'), help: (0,external_wp_i18n_namespaceObject.__)('The text is visible when enabled from the parent Social Icons block.'), value: label, onChange: value => setAttributes({ label: value }), placeholder: socialLinkName }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Link rel'), value: rel || '', onChange: value => setAttributes({ rel: value }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { role: "presentation", className: wrapperClasses, style: { color: iconColorValue, backgroundColor: iconBackgroundColorValue }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("button", { "aria-haspopup": "dialog", ...blockProps, role: "button", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(IconComponent, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: dist_clsx('wp-block-social-link-label', { 'screen-reader-text': !showLabels }), children: socialLinkText })] }), isSelected && showURLPopover && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SocialLinkURLPopover, { url: url, setAttributes: setAttributes, setPopover: setPopover, popoverAnchor: popoverAnchor, clientId: clientId })] })] }); }; /* harmony default export */ const social_link_edit = (SocialLinkEdit); ;// ./node_modules/@wordpress/block-library/build-module/social-link/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const social_link_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/social-link", title: "Social Icon", category: "widgets", parent: ["core/social-links"], description: "Display an icon linking to a social profile or site.", textdomain: "default", attributes: { url: { type: "string", role: "content" }, service: { type: "string" }, label: { type: "string", role: "content" }, rel: { type: "string" } }, usesContext: ["openInNewTab", "showLabels", "iconColor", "iconColorValue", "iconBackgroundColor", "iconBackgroundColorValue"], supports: { reusable: false, html: false, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-social-link-editor" }; const { name: social_link_name } = social_link_metadata; const social_link_settings = { icon: library_share, edit: social_link_edit, variations: social_link_variations }; const social_link_init = () => initBlock({ name: social_link_name, metadata: social_link_metadata, settings: social_link_settings }); ;// ./node_modules/@wordpress/block-library/build-module/social-links/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * The specific handling by `className` below is needed because `itemsJustification` * was introduced in https://github.com/WordPress/gutenberg/pull/28980/files and wasn't * declared in block.json. * * @param {Object} attributes Block's attributes. */ const social_links_deprecated_migrateWithLayout = attributes => { if (!!attributes.layout) { return attributes; } const { className } = attributes; // Matches classes with `items-justified-` prefix. const prefix = `items-justified-`; const justifiedItemsRegex = new RegExp(`\\b${prefix}[^ ]*[ ]?\\b`, 'g'); const newAttributes = { ...attributes, className: className?.replace(justifiedItemsRegex, '').trim() }; /** * Add `layout` prop only if `justifyContent` is defined, for backwards * compatibility. In other cases the block's default layout will be used. * Also noting that due to the missing attribute, it's possible for a block * to have more than one of `justified` classes. */ const justifyContent = className?.match(justifiedItemsRegex)?.[0]?.trim(); if (justifyContent) { Object.assign(newAttributes, { layout: { type: 'flex', justifyContent: justifyContent.slice(prefix.length) } }); } return newAttributes; }; // Social Links block deprecations. const social_links_deprecated_deprecated = [ // V1. Remove CSS variable use for colors. { attributes: { iconColor: { type: 'string' }, customIconColor: { type: 'string' }, iconColorValue: { type: 'string' }, iconBackgroundColor: { type: 'string' }, customIconBackgroundColor: { type: 'string' }, iconBackgroundColorValue: { type: 'string' }, openInNewTab: { type: 'boolean', default: false }, size: { type: 'string' } }, providesContext: { openInNewTab: 'openInNewTab' }, supports: { align: ['left', 'center', 'right'], anchor: true }, migrate: social_links_deprecated_migrateWithLayout, save: props => { const { attributes: { iconBackgroundColorValue, iconColorValue, itemsJustification, size } } = props; const className = dist_clsx(size, { 'has-icon-color': iconColorValue, 'has-icon-background-color': iconBackgroundColorValue, [`items-justified-${itemsJustification}`]: itemsJustification }); const style = { '--wp--social-links--icon-color': iconColorValue, '--wp--social-links--icon-background-color': iconBackgroundColorValue }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className, style }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InnerBlocks.Content, {}) }); } }]; /* harmony default export */ const social_links_deprecated = (social_links_deprecated_deprecated); ;// ./node_modules/@wordpress/icons/build-module/library/check.js /** * WordPress dependencies */ const check = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z" }) }); /* harmony default export */ const library_check = (check); ;// ./node_modules/@wordpress/block-library/build-module/social-links/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const sizeOptions = [{ name: (0,external_wp_i18n_namespaceObject.__)('Small'), value: 'has-small-icon-size' }, { name: (0,external_wp_i18n_namespaceObject.__)('Normal'), value: 'has-normal-icon-size' }, { name: (0,external_wp_i18n_namespaceObject.__)('Large'), value: 'has-large-icon-size' }, { name: (0,external_wp_i18n_namespaceObject.__)('Huge'), value: 'has-huge-icon-size' }]; function SocialLinksEdit(props) { var _attributes$layout$or; const { clientId, attributes, iconBackgroundColor, iconColor, isSelected, setAttributes, setIconBackgroundColor, setIconColor } = props; const { iconBackgroundColorValue, customIconBackgroundColor, iconColorValue, openInNewTab, showLabels, size } = attributes; const hasSelectedChild = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).hasSelectedInnerBlock(clientId), [clientId]); const hasAnySelected = isSelected || hasSelectedChild; const logosOnly = attributes.className?.includes('is-style-logos-only'); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); // Remove icon background color when logos only style is selected or // restore it when any other style is selected. const backgroundBackupRef = (0,external_wp_element_namespaceObject.useRef)({}); (0,external_wp_element_namespaceObject.useEffect)(() => { if (logosOnly) { backgroundBackupRef.current = { iconBackgroundColor, iconBackgroundColorValue, customIconBackgroundColor }; setAttributes({ iconBackgroundColor: undefined, customIconBackgroundColor: undefined, iconBackgroundColorValue: undefined }); } else { setAttributes({ ...backgroundBackupRef.current }); } }, [logosOnly]); const SocialPlaceholder = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("li", { className: "wp-block-social-links__social-placeholder", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "wp-block-social-links__social-placeholder-icons", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-social-link wp-social-link-twitter" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-social-link wp-social-link-facebook" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-social-link wp-social-link-instagram" })] }) }); // Fallback color values are used maintain selections in case switching // themes and named colors in palette do not match. const className = dist_clsx(size, { 'has-visible-labels': showLabels, 'has-icon-color': iconColor.color || iconColorValue, 'has-icon-background-color': iconBackgroundColor.color || iconBackgroundColorValue }); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { placeholder: !isSelected && SocialPlaceholder, templateLock: false, orientation: (_attributes$layout$or = attributes.layout?.orientation) !== null && _attributes$layout$or !== void 0 ? _attributes$layout$or : 'horizontal', __experimentalAppenderTagName: 'li', renderAppender: hasAnySelected && external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender }); const POPOVER_PROPS = { position: 'bottom right' }; const colorSettings = [{ // Use custom attribute as fallback to prevent loss of named color selection when // switching themes to a new theme that does not have a matching named color. value: iconColor.color || iconColorValue, onChange: colorValue => { setIconColor(colorValue); setAttributes({ iconColorValue: colorValue }); }, label: (0,external_wp_i18n_namespaceObject.__)('Icon color'), resetAllFilter: () => { setIconColor(undefined); setAttributes({ iconColorValue: undefined }); } }]; if (!logosOnly) { colorSettings.push({ // Use custom attribute as fallback to prevent loss of named color selection when // switching themes to a new theme that does not have a matching named color. value: iconBackgroundColor.color || iconBackgroundColorValue, onChange: colorValue => { setIconBackgroundColor(colorValue); setAttributes({ iconBackgroundColorValue: colorValue }); }, label: (0,external_wp_i18n_namespaceObject.__)('Icon background'), resetAllFilter: () => { setIconBackgroundColor(undefined); setAttributes({ iconBackgroundColorValue: undefined }); } }); } const colorGradientSettings = (0,external_wp_blockEditor_namespaceObject.__experimentalUseMultipleOriginColorsAndGradients)(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { label: (0,external_wp_i18n_namespaceObject.__)('Size'), text: (0,external_wp_i18n_namespaceObject.__)('Size'), icon: null, popoverProps: POPOVER_PROPS, children: ({ onClose }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuGroup, { children: sizeOptions.map(entry => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { icon: (size === entry.value || !size && entry.value === 'has-normal-icon-size') && library_check, isSelected: size === entry.value, onClick: () => { setAttributes({ size: entry.value }); }, onClose: onClose, role: "menuitemradio", children: entry.name }, entry.value); }) }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ openInNewTab: false, showLabels: false }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { isShownByDefault: true, label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'), hasValue: () => !!openInNewTab, onDeselect: () => setAttributes({ openInNewTab: false }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Open links in new tab'), checked: openInNewTab, onChange: () => setAttributes({ openInNewTab: !openInNewTab }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { isShownByDefault: true, label: (0,external_wp_i18n_namespaceObject.__)('Show text'), hasValue: () => !!showLabels, onDeselect: () => setAttributes({ showLabels: false }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show text'), checked: showLabels, onChange: () => setAttributes({ showLabels: !showLabels }) }) })] }) }), colorGradientSettings.hasColorsOrGradients && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "color", children: [colorSettings.map(({ onChange, label, value, resetAllFilter }) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalColorGradientSettingsDropdown, { __experimentalIsRenderedInSidebar: true, settings: [{ colorValue: value, label, onColorChange: onChange, isShownByDefault: true, resetAllFilter, enableAlpha: true, clearable: true }], panelId: clientId, ...colorGradientSettings }, `social-links-color-${label}`)), !logosOnly && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.ContrastChecker, { textColor: iconColorValue, backgroundColor: iconBackgroundColorValue, isLargeText: false })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { ...innerBlocksProps })] }); } const iconColorAttributes = { iconColor: 'icon-color', iconBackgroundColor: 'icon-background-color' }; /* harmony default export */ const social_links_edit = ((0,external_wp_blockEditor_namespaceObject.withColors)(iconColorAttributes)(SocialLinksEdit)); ;// ./node_modules/@wordpress/block-library/build-module/social-links/save.js /** * External dependencies */ /** * WordPress dependencies */ function social_links_save_save(props) { const { attributes: { iconBackgroundColorValue, iconColorValue, showLabels, size } } = props; const className = dist_clsx(size, { 'has-visible-labels': showLabels, 'has-icon-color': iconColorValue, 'has-icon-background-color': iconBackgroundColorValue }); const blockProps = external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }); const innerBlocksProps = external_wp_blockEditor_namespaceObject.useInnerBlocksProps.save(blockProps); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ul", { ...innerBlocksProps }); } ;// ./node_modules/@wordpress/block-library/build-module/social-links/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const social_links_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/social-links", title: "Social Icons", category: "widgets", allowedBlocks: ["core/social-link"], description: "Display icons linking to your social profiles or sites.", keywords: ["links"], textdomain: "default", attributes: { iconColor: { type: "string" }, customIconColor: { type: "string" }, iconColorValue: { type: "string" }, iconBackgroundColor: { type: "string" }, customIconBackgroundColor: { type: "string" }, iconBackgroundColorValue: { type: "string" }, openInNewTab: { type: "boolean", "default": false }, showLabels: { type: "boolean", "default": false }, size: { type: "string" } }, providesContext: { openInNewTab: "openInNewTab", showLabels: "showLabels", iconColor: "iconColor", iconColorValue: "iconColorValue", iconBackgroundColor: "iconBackgroundColor", iconBackgroundColorValue: "iconBackgroundColorValue" }, supports: { align: ["left", "center", "right"], anchor: true, __experimentalExposeControlsToChildren: true, layout: { allowSwitching: false, allowInheriting: false, allowVerticalAlignment: false, "default": { type: "flex" } }, color: { enableContrastChecker: false, background: true, gradients: true, text: false, __experimentalDefaultControls: { background: false } }, spacing: { blockGap: ["horizontal", "vertical"], margin: true, padding: true, units: ["px", "em", "rem", "vh", "vw"], __experimentalDefaultControls: { blockGap: true, margin: true, padding: false } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, styles: [{ name: "default", label: "Default", isDefault: true }, { name: "logos-only", label: "Logos Only" }, { name: "pill-shape", label: "Pill Shape" }], editorStyle: "wp-block-social-links-editor", style: "wp-block-social-links" }; const { name: social_links_name } = social_links_metadata; const social_links_settings = { example: { innerBlocks: [{ name: 'core/social-link', attributes: { service: 'wordpress', url: 'https://wordpress.org' } }, { name: 'core/social-link', attributes: { service: 'facebook', url: 'https://www.facebook.com/WordPress/' } }, { name: 'core/social-link', attributes: { service: 'twitter', url: 'https://twitter.com/WordPress' } }] }, icon: library_share, edit: social_links_edit, save: social_links_save_save, deprecated: social_links_deprecated }; const social_links_init = () => initBlock({ name: social_links_name, metadata: social_links_metadata, settings: social_links_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/resize-corner-n-e.js /** * WordPress dependencies */ const resizeCornerNE = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7 18h4.5v1.5h-7v-7H6V17L17 6h-4.5V4.5h7v7H18V7L7 18Z" }) }); /* harmony default export */ const resize_corner_n_e = (resizeCornerNE); ;// ./node_modules/@wordpress/block-library/build-module/spacer/deprecated.js /** * WordPress dependencies */ const spacer_deprecated_deprecated = [{ attributes: { height: { type: 'number', default: 100 }, width: { type: 'number' } }, migrate(attributes) { const { height, width } = attributes; return { ...attributes, width: width !== undefined ? `${width}px` : undefined, height: height !== undefined ? `${height}px` : undefined }; }, save({ attributes }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ style: { height: attributes.height, width: attributes.width }, 'aria-hidden': true }) }); } }]; /* harmony default export */ const spacer_deprecated = (spacer_deprecated_deprecated); ;// ./node_modules/@wordpress/block-library/build-module/spacer/constants.js const MIN_SPACER_SIZE = 0; ;// ./node_modules/@wordpress/block-library/build-module/spacer/controls.js /** * WordPress dependencies */ /** * Internal dependencies */ const { useSpacingSizes } = unlock(external_wp_blockEditor_namespaceObject.privateApis); function DimensionInput({ label, onChange, isResizing, value = '' }) { const inputId = (0,external_wp_compose_namespaceObject.useInstanceId)(external_wp_components_namespaceObject.__experimentalUnitControl, 'block-spacer-height-input'); const spacingSizes = useSpacingSizes(); const [spacingUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); // In most contexts the spacer size cannot meaningfully be set to a // percentage, since this is relative to the parent container. This // unit is disabled from the UI. const availableUnits = spacingUnits ? spacingUnits.filter(unit => unit !== '%') : ['px', 'em', 'rem', 'vw', 'vh']; const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits, defaultValues: { px: 100, em: 10, rem: 10, vw: 10, vh: 25 } }); // Force the unit to update to `px` when the Spacer is being resized. const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value); const computedValue = (0,external_wp_blockEditor_namespaceObject.isValueSpacingPreset)(value) ? value : [parsedQuantity, isResizing ? 'px' : parsedUnit].join(''); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: spacingSizes?.length < 2 ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { id: inputId, isResetValueOnUnitChange: true, min: MIN_SPACER_SIZE, onChange: onChange, value: computedValue, units: units, label: label, __next40pxDefaultSize: true }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { className: "tools-panel-item-spacing", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalSpacingSizesControl, { values: { all: computedValue }, onChange: ({ all }) => { onChange(all); }, label: label, sides: ['all'], units: units, allowReset: false, splitOnAxis: false, showSideInLabel: false }) }) }); } function SpacerControls({ setAttributes, orientation, height, width, isResizing }) { const dropdownMenuProps = useToolsPanelDropdownMenuProps(); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ width: undefined, height: '100px' }); }, dropdownMenuProps: dropdownMenuProps, children: [orientation === 'horizontal' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Width'), isShownByDefault: true, hasValue: () => width !== undefined, onDeselect: () => setAttributes({ width: undefined }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionInput, { label: (0,external_wp_i18n_namespaceObject.__)('Width'), value: width, onChange: nextWidth => setAttributes({ width: nextWidth }), isResizing: isResizing }) }), orientation !== 'horizontal' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { label: (0,external_wp_i18n_namespaceObject.__)('Height'), isShownByDefault: true, hasValue: () => height !== '100px', onDeselect: () => setAttributes({ height: '100px' }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(DimensionInput, { label: (0,external_wp_i18n_namespaceObject.__)('Height'), value: height, onChange: nextHeight => setAttributes({ height: nextHeight }), isResizing: isResizing }) })] }) }); } ;// ./node_modules/@wordpress/block-library/build-module/spacer/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const { useSpacingSizes: edit_useSpacingSizes } = unlock(external_wp_blockEditor_namespaceObject.privateApis); const ResizableSpacer = ({ orientation, onResizeStart, onResize, onResizeStop, isSelected, isResizing, setIsResizing, ...props }) => { const getCurrentSize = elt => { return orientation === 'horizontal' ? elt.clientWidth : elt.clientHeight; }; const getNextVal = elt => { return `${getCurrentSize(elt)}px`; }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ResizableBox, { className: dist_clsx('block-library-spacer__resize-container', { 'resize-horizontal': orientation === 'horizontal', 'is-resizing': isResizing, 'is-selected': isSelected }), onResizeStart: (_event, _direction, elt) => { const nextVal = getNextVal(elt); onResizeStart(nextVal); onResize(nextVal); }, onResize: (_event, _direction, elt) => { onResize(getNextVal(elt)); if (!isResizing) { setIsResizing(true); } }, onResizeStop: (_event, _direction, elt) => { const nextVal = getCurrentSize(elt); onResizeStop(`${nextVal}px`); setIsResizing(false); }, __experimentalShowTooltip: true, __experimentalTooltipProps: { axis: orientation === 'horizontal' ? 'x' : 'y', position: 'corner', isVisible: isResizing }, showHandle: isSelected, ...props }); }; const SpacerEdit = ({ attributes, isSelected, setAttributes, toggleSelection, context, __unstableParentLayout: parentLayout, className }) => { const disableCustomSpacingSizes = (0,external_wp_data_namespaceObject.useSelect)(select => { const editorSettings = select(external_wp_blockEditor_namespaceObject.store).getSettings(); return editorSettings?.disableCustomSpacingSizes; }); const { orientation } = context; const { orientation: parentOrientation, type, default: { type: defaultType } = {} } = parentLayout || {}; // Check if the spacer is inside a flex container. const isFlexLayout = type === 'flex' || !type && defaultType === 'flex'; // If the spacer is inside a flex container, it should either inherit the orientation // of the parent or use the flex default orientation. const inheritedOrientation = !parentOrientation && isFlexLayout ? 'horizontal' : parentOrientation || orientation; const { height, width, style: blockStyle = {} } = attributes; const { layout = {} } = blockStyle; const { selfStretch, flexSize } = layout; const spacingSizes = edit_useSpacingSizes(); const [isResizing, setIsResizing] = (0,external_wp_element_namespaceObject.useState)(false); const [temporaryHeight, setTemporaryHeight] = (0,external_wp_element_namespaceObject.useState)(null); const [temporaryWidth, setTemporaryWidth] = (0,external_wp_element_namespaceObject.useState)(null); const onResizeStart = () => toggleSelection(false); const onResizeStop = () => toggleSelection(true); const { __unstableMarkNextChangeAsNotPersistent } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const handleOnVerticalResizeStop = newHeight => { onResizeStop(); if (isFlexLayout) { setAttributes({ style: { ...blockStyle, layout: { ...layout, flexSize: newHeight, selfStretch: 'fixed' } } }); } setAttributes({ height: newHeight }); setTemporaryHeight(null); }; const handleOnHorizontalResizeStop = newWidth => { onResizeStop(); if (isFlexLayout) { setAttributes({ style: { ...blockStyle, layout: { ...layout, flexSize: newWidth, selfStretch: 'fixed' } } }); } setAttributes({ width: newWidth }); setTemporaryWidth(null); }; const getHeightForVerticalBlocks = () => { if (isFlexLayout) { return undefined; } return temporaryHeight || (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(height) || undefined; }; const getWidthForHorizontalBlocks = () => { if (isFlexLayout) { return undefined; } return temporaryWidth || (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(width) || undefined; }; const sizeConditionalOnOrientation = inheritedOrientation === 'horizontal' ? temporaryWidth || flexSize : temporaryHeight || flexSize; const style = { height: inheritedOrientation === 'horizontal' ? 24 : getHeightForVerticalBlocks(), width: inheritedOrientation === 'horizontal' ? getWidthForHorizontalBlocks() : undefined, // In vertical flex containers, the spacer shrinks to nothing without a minimum width. minWidth: inheritedOrientation === 'vertical' && isFlexLayout ? 48 : undefined, // Add flex-basis so temporary sizes are respected. flexBasis: isFlexLayout ? sizeConditionalOnOrientation : undefined, // Remove flex-grow when resizing. flexGrow: isFlexLayout && isResizing ? 0 : undefined }; const resizableBoxWithOrientation = blockOrientation => { if (blockOrientation === 'horizontal') { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableSpacer, { minWidth: MIN_SPACER_SIZE, enable: { top: false, right: true, bottom: false, left: false, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }, orientation: blockOrientation, onResizeStart: onResizeStart, onResize: setTemporaryWidth, onResizeStop: handleOnHorizontalResizeStop, isSelected: isSelected, isResizing: isResizing, setIsResizing: setIsResizing }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ResizableSpacer, { minHeight: MIN_SPACER_SIZE, enable: { top: false, right: false, bottom: true, left: false, topRight: false, bottomRight: false, bottomLeft: false, topLeft: false }, orientation: blockOrientation, onResizeStart: onResizeStart, onResize: setTemporaryHeight, onResizeStop: handleOnVerticalResizeStop, isSelected: isSelected, isResizing: isResizing, setIsResizing: setIsResizing }) }); }; (0,external_wp_element_namespaceObject.useEffect)(() => { // To avoid interfering with undo/redo operations any changes in this // effect must not make history and should be preceded by // `__unstableMarkNextChangeAsNotPersistent()`. const setAttributesCovertly = nextAttributes => { __unstableMarkNextChangeAsNotPersistent(); setAttributes(nextAttributes); }; if (isFlexLayout && selfStretch !== 'fill' && selfStretch !== 'fit' && flexSize === undefined) { if (inheritedOrientation === 'horizontal') { // If spacer is moving from a vertical container to a horizontal container, // it might not have width but have height instead. const newSize = (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(width, spacingSizes) || (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(height, spacingSizes) || '100px'; setAttributesCovertly({ width: '0px', style: { ...blockStyle, layout: { ...layout, flexSize: newSize, selfStretch: 'fixed' } } }); } else { const newSize = (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(height, spacingSizes) || (0,external_wp_blockEditor_namespaceObject.getCustomValueFromPreset)(width, spacingSizes) || '100px'; setAttributesCovertly({ height: '0px', style: { ...blockStyle, layout: { ...layout, flexSize: newSize, selfStretch: 'fixed' } } }); } } else if (isFlexLayout && (selfStretch === 'fill' || selfStretch === 'fit')) { setAttributesCovertly(inheritedOrientation === 'horizontal' ? { width: undefined } : { height: undefined }); } else if (!isFlexLayout && (selfStretch || flexSize)) { setAttributesCovertly({ ...(inheritedOrientation === 'horizontal' ? { width: flexSize } : { height: flexSize }), style: { ...blockStyle, layout: { ...layout, flexSize: undefined, selfStretch: undefined } } }); } }, [blockStyle, flexSize, height, inheritedOrientation, isFlexLayout, layout, selfStretch, setAttributes, spacingSizes, width, __unstableMarkNextChangeAsNotPersistent]); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.View, { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ style, className: dist_clsx(className, { 'custom-sizes-disabled': disableCustomSpacingSizes }) }), children: resizableBoxWithOrientation(inheritedOrientation) }), !isFlexLayout && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SpacerControls, { setAttributes: setAttributes, height: temporaryHeight || height, width: temporaryWidth || width, orientation: inheritedOrientation, isResizing: isResizing })] }); }; /* harmony default export */ const spacer_edit = (SpacerEdit); ;// ./node_modules/@wordpress/block-library/build-module/spacer/transforms.js /** * WordPress dependencies */ const spacer_transforms_transforms = { to: [{ type: 'block', blocks: ['core/separator'], // Transform to Separator. transform: ({ anchor }) => { return (0,external_wp_blocks_namespaceObject.createBlock)('core/separator', { anchor: anchor || '' }); } }] }; /* harmony default export */ const spacer_transforms = (spacer_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/spacer/save.js /** * WordPress dependencies */ function spacer_save_save({ attributes }) { const { height, width, style } = attributes; const { layout: { selfStretch } = {} } = style || {}; // If selfStretch is set to 'fill' or 'fit', don't set default height. const finalHeight = selfStretch === 'fill' || selfStretch === 'fit' ? undefined : height; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ style: { height: (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(finalHeight), width: (0,external_wp_blockEditor_namespaceObject.getSpacingPresetCssVar)(width) }, 'aria-hidden': true }) }); } ;// ./node_modules/@wordpress/block-library/build-module/spacer/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const spacer_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/spacer", title: "Spacer", category: "design", description: "Add white space between blocks and customize its height.", textdomain: "default", attributes: { height: { type: "string", "default": "100px" }, width: { type: "string" } }, usesContext: ["orientation"], supports: { anchor: true, spacing: { margin: ["top", "bottom"], __experimentalDefaultControls: { margin: true } }, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-spacer-editor", style: "wp-block-spacer" }; const { name: spacer_name } = spacer_metadata; const spacer_settings = { icon: resize_corner_n_e, transforms: spacer_transforms, edit: spacer_edit, save: spacer_save_save, deprecated: spacer_deprecated }; const spacer_init = () => initBlock({ name: spacer_name, metadata: spacer_metadata, settings: spacer_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/block-table.js /** * WordPress dependencies */ const blockTable = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z" }) }); /* harmony default export */ const block_table = (blockTable); ;// ./node_modules/@wordpress/block-library/build-module/table/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ // As the previous arbitrary colors won't match theme color palettes, the hex // value will be mapped to the style.color.background attribute as if it was // a custom color selection. const oldColors = { 'subtle-light-gray': '#f3f4f5', 'subtle-pale-green': '#e9fbe5', 'subtle-pale-blue': '#e7f5fe', 'subtle-pale-pink': '#fcf0ef' }; // Fixed width table cells on by default. const v4Query = { content: { type: 'rich-text', source: 'rich-text' }, tag: { type: 'string', default: 'td', source: 'tag' }, scope: { type: 'string', source: 'attribute', attribute: 'scope' }, align: { type: 'string', source: 'attribute', attribute: 'data-align' }, colspan: { type: 'string', source: 'attribute', attribute: 'colspan' }, rowspan: { type: 'string', source: 'attribute', attribute: 'rowspan' } }; const table_deprecated_v4 = { attributes: { hasFixedLayout: { type: 'boolean', default: false }, caption: { type: 'rich-text', source: 'rich-text', selector: 'figcaption' }, head: { type: 'array', default: [], source: 'query', selector: 'thead tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v4Query } } }, body: { type: 'array', default: [], source: 'query', selector: 'tbody tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v4Query } } }, foot: { type: 'array', default: [], source: 'query', selector: 'tfoot tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v4Query } } } }, supports: { anchor: true, align: true, color: { __experimentalSkipSerialization: true, gradients: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { __experimentalSkipSerialization: true, color: true, style: true, width: true, __experimentalDefaultControls: { color: true, style: true, width: true } }, __experimentalSelector: '.wp-block-table > table', interactivity: { clientNavigation: true } }, save({ attributes }) { const { hasFixedLayout, head, body, foot, caption } = attributes; const isEmpty = !head.length && !body.length && !foot.length; if (isEmpty) { return null; } const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const classes = dist_clsx(colorProps.className, borderProps.className, { 'has-fixed-layout': hasFixedLayout }); const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption); const Section = ({ type, rows }) => { if (!rows.length) { return null; } const Tag = `t${type}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { children: rows.map(({ cells }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { children: cells.map(({ content, tag, scope, align, colspan, rowspan }, cellIndex) => { const cellClasses = dist_clsx({ [`has-text-align-${align}`]: align }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: cellClasses ? cellClasses : undefined, "data-align": align, tagName: tag, value: content, scope: tag === 'th' ? scope : undefined, colSpan: colspan, rowSpan: rowspan }, cellIndex); }) }, rowIndex)) }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { className: classes === '' ? undefined : classes, style: { ...colorProps.style, ...borderProps.style }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "head", rows: head }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "body", rows: body }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "foot", rows: foot })] }), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption, className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption') })] }); } }; // In #41140 support was added to global styles for caption elements which // added a `wp-element-caption` classname to the embed figcaption element. const v3Query = { content: { type: 'string', source: 'html' }, tag: { type: 'string', default: 'td', source: 'tag' }, scope: { type: 'string', source: 'attribute', attribute: 'scope' }, align: { type: 'string', source: 'attribute', attribute: 'data-align' } }; const table_deprecated_v3 = { attributes: { hasFixedLayout: { type: 'boolean', default: false }, caption: { type: 'string', source: 'html', selector: 'figcaption', default: '' }, head: { type: 'array', default: [], source: 'query', selector: 'thead tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v3Query } } }, body: { type: 'array', default: [], source: 'query', selector: 'tbody tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v3Query } } }, foot: { type: 'array', default: [], source: 'query', selector: 'tfoot tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v3Query } } } }, supports: { anchor: true, align: true, color: { __experimentalSkipSerialization: true, gradients: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { __experimentalSkipSerialization: true, color: true, style: true, width: true, __experimentalDefaultControls: { color: true, style: true, width: true } }, __experimentalSelector: '.wp-block-table > table' }, save({ attributes }) { const { hasFixedLayout, head, body, foot, caption } = attributes; const isEmpty = !head.length && !body.length && !foot.length; if (isEmpty) { return null; } const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const classes = dist_clsx(colorProps.className, borderProps.className, { 'has-fixed-layout': hasFixedLayout }); const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption); const Section = ({ type, rows }) => { if (!rows.length) { return null; } const Tag = `t${type}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { children: rows.map(({ cells }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { children: cells.map(({ content, tag, scope, align }, cellIndex) => { const cellClasses = dist_clsx({ [`has-text-align-${align}`]: align }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: cellClasses ? cellClasses : undefined, "data-align": align, tagName: tag, value: content, scope: tag === 'th' ? scope : undefined }, cellIndex); }) }, rowIndex)) }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { className: classes === '' ? undefined : classes, style: { ...colorProps.style, ...borderProps.style }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "head", rows: head }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "body", rows: body }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "foot", rows: foot })] }), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); } }; // Deprecation migrating table block to use colors block support feature. const v2Query = { content: { type: 'string', source: 'html' }, tag: { type: 'string', default: 'td', source: 'tag' }, scope: { type: 'string', source: 'attribute', attribute: 'scope' }, align: { type: 'string', source: 'attribute', attribute: 'data-align' } }; const table_deprecated_v2 = { attributes: { hasFixedLayout: { type: 'boolean', default: false }, backgroundColor: { type: 'string' }, caption: { type: 'string', source: 'html', selector: 'figcaption', default: '' }, head: { type: 'array', default: [], source: 'query', selector: 'thead tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v2Query } } }, body: { type: 'array', default: [], source: 'query', selector: 'tbody tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v2Query } } }, foot: { type: 'array', default: [], source: 'query', selector: 'tfoot tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v2Query } } } }, supports: { anchor: true, align: true, __experimentalSelector: '.wp-block-table > table' }, save: ({ attributes }) => { const { hasFixedLayout, head, body, foot, backgroundColor, caption } = attributes; const isEmpty = !head.length && !body.length && !foot.length; if (isEmpty) { return null; } const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const classes = dist_clsx(backgroundClass, { 'has-fixed-layout': hasFixedLayout, 'has-background': !!backgroundClass }); const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption); const Section = ({ type, rows }) => { if (!rows.length) { return null; } const Tag = `t${type}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { children: rows.map(({ cells }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { children: cells.map(({ content, tag, scope, align }, cellIndex) => { const cellClasses = dist_clsx({ [`has-text-align-${align}`]: align }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: cellClasses ? cellClasses : undefined, "data-align": align, tagName: tag, value: content, scope: tag === 'th' ? scope : undefined }, cellIndex); }) }, rowIndex)) }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { className: classes === '' ? undefined : classes, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "head", rows: head }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "body", rows: body }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "foot", rows: foot })] }), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption })] }); }, isEligible: attributes => { return attributes.backgroundColor && attributes.backgroundColor in oldColors && !attributes.style; }, // This version is the first to introduce the style attribute to the // table block. As a result, we'll explicitly override that. migrate: attributes => { return { ...attributes, backgroundColor: undefined, style: { color: { background: oldColors[attributes.backgroundColor] } } }; } }; const v1Query = { content: { type: 'string', source: 'html' }, tag: { type: 'string', default: 'td', source: 'tag' }, scope: { type: 'string', source: 'attribute', attribute: 'scope' } }; const table_deprecated_v1 = { attributes: { hasFixedLayout: { type: 'boolean', default: false }, backgroundColor: { type: 'string' }, head: { type: 'array', default: [], source: 'query', selector: 'thead tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v1Query } } }, body: { type: 'array', default: [], source: 'query', selector: 'tbody tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v1Query } } }, foot: { type: 'array', default: [], source: 'query', selector: 'tfoot tr', query: { cells: { type: 'array', default: [], source: 'query', selector: 'td,th', query: v1Query } } } }, supports: { align: true }, save({ attributes }) { const { hasFixedLayout, head, body, foot, backgroundColor } = attributes; const isEmpty = !head.length && !body.length && !foot.length; if (isEmpty) { return null; } const backgroundClass = (0,external_wp_blockEditor_namespaceObject.getColorClassName)('background-color', backgroundColor); const classes = dist_clsx(backgroundClass, { 'has-fixed-layout': hasFixedLayout, 'has-background': !!backgroundClass }); const Section = ({ type, rows }) => { if (!rows.length) { return null; } const Tag = `t${type}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { children: rows.map(({ cells }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { children: cells.map(({ content, tag, scope }, cellIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: tag, value: content, scope: tag === 'th' ? scope : undefined }, cellIndex)) }, rowIndex)) }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { className: classes, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "head", rows: head }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "body", rows: body }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "foot", rows: foot })] }); } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const table_deprecated = ([table_deprecated_v4, table_deprecated_v3, table_deprecated_v2, table_deprecated_v1]); ;// ./node_modules/@wordpress/icons/build-module/library/align-left.js /** * WordPress dependencies */ const alignLeft = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z" }) }); /* harmony default export */ const align_left = (alignLeft); ;// ./node_modules/@wordpress/icons/build-module/library/align-center.js /** * WordPress dependencies */ const alignCenter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z" }) }); /* harmony default export */ const align_center = (alignCenter); ;// ./node_modules/@wordpress/icons/build-module/library/align-right.js /** * WordPress dependencies */ const alignRight = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z" }) }); /* harmony default export */ const align_right = (alignRight); ;// ./node_modules/@wordpress/icons/build-module/library/table-row-before.js /** * WordPress dependencies */ const tableRowBefore = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84zM6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z" }) }); /* harmony default export */ const table_row_before = (tableRowBefore); ;// ./node_modules/@wordpress/icons/build-module/library/table-row-after.js /** * WordPress dependencies */ const tableRowAfter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z" }) }); /* harmony default export */ const table_row_after = (tableRowAfter); ;// ./node_modules/@wordpress/icons/build-module/library/table-row-delete.js /** * WordPress dependencies */ const tableRowDelete = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z" }) }); /* harmony default export */ const table_row_delete = (tableRowDelete); ;// ./node_modules/@wordpress/icons/build-module/library/table-column-before.js /** * WordPress dependencies */ const tableColumnBefore = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z" }) }); /* harmony default export */ const table_column_before = (tableColumnBefore); ;// ./node_modules/@wordpress/icons/build-module/library/table-column-after.js /** * WordPress dependencies */ const tableColumnAfter = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z" }) }); /* harmony default export */ const table_column_after = (tableColumnAfter); ;// ./node_modules/@wordpress/icons/build-module/library/table-column-delete.js /** * WordPress dependencies */ const tableColumnDelete = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "-2 -2 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z" }) }); /* harmony default export */ const table_column_delete = (tableColumnDelete); ;// ./node_modules/@wordpress/icons/build-module/library/table.js /** * WordPress dependencies */ const table = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M4 6v11.5h16V6H4zm1.5 1.5h6V11h-6V7.5zm0 8.5v-3.5h6V16h-6zm13 0H13v-3.5h5.5V16zM13 11V7.5h5.5V11H13z" }) }); /* harmony default export */ const library_table = (table); ;// ./node_modules/@wordpress/block-library/build-module/table/state.js const INHERITED_COLUMN_ATTRIBUTES = ['align']; /** * Creates a table state. * * @param {Object} options * @param {number} options.rowCount Row count for the table to create. * @param {number} options.columnCount Column count for the table to create. * * @return {Object} New table state. */ function createTable({ rowCount, columnCount }) { return { body: Array.from({ length: rowCount }).map(() => ({ cells: Array.from({ length: columnCount }).map(() => ({ content: '', tag: 'td' })) })) }; } /** * Returns the first row in the table. * * @param {Object} state Current table state. * * @return {Object | undefined} The first table row. */ function getFirstRow(state) { if (!isEmptyTableSection(state.head)) { return state.head[0]; } if (!isEmptyTableSection(state.body)) { return state.body[0]; } if (!isEmptyTableSection(state.foot)) { return state.foot[0]; } } /** * Gets an attribute for a cell. * * @param {Object} state Current table state. * @param {Object} cellLocation The location of the cell * @param {string} attributeName The name of the attribute to get the value of. * * @return {*} The attribute value. */ function getCellAttribute(state, cellLocation, attributeName) { const { sectionName, rowIndex, columnIndex } = cellLocation; return state[sectionName]?.[rowIndex]?.cells?.[columnIndex]?.[attributeName]; } /** * Returns updated cell attributes after applying the `updateCell` function to the selection. * * @param {Object} state The block attributes. * @param {Object} selection The selection of cells to update. * @param {Function} updateCell A function to update the selected cell attributes. * * @return {Object} New table state including the updated cells. */ function updateSelectedCell(state, selection, updateCell) { if (!selection) { return state; } const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key))); const { sectionName: selectionSectionName, rowIndex: selectionRowIndex } = selection; return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => { if (selectionSectionName && selectionSectionName !== sectionName) { return [sectionName, section]; } return [sectionName, section.map((row, rowIndex) => { if (selectionRowIndex && selectionRowIndex !== rowIndex) { return row; } return { cells: row.cells.map((cellAttributes, columnIndex) => { const cellLocation = { sectionName, columnIndex, rowIndex }; if (!isCellSelected(cellLocation, selection)) { return cellAttributes; } return updateCell(cellAttributes); }) }; })]; })); } /** * Returns whether the cell at `cellLocation` is included in the selection `selection`. * * @param {Object} cellLocation An object containing cell location properties. * @param {Object} selection An object containing selection properties. * * @return {boolean} True if the cell is selected, false otherwise. */ function isCellSelected(cellLocation, selection) { if (!cellLocation || !selection) { return false; } switch (selection.type) { case 'column': return selection.type === 'column' && cellLocation.columnIndex === selection.columnIndex; case 'cell': return selection.type === 'cell' && cellLocation.sectionName === selection.sectionName && cellLocation.columnIndex === selection.columnIndex && cellLocation.rowIndex === selection.rowIndex; } } /** * Inserts a row in the table state. * * @param {Object} state Current table state. * @param {Object} options * @param {string} options.sectionName Section in which to insert the row. * @param {number} options.rowIndex Row index at which to insert the row. * @param {number} options.columnCount Column count for the table to create. * * @return {Object} New table state. */ function insertRow(state, { sectionName, rowIndex, columnCount }) { const firstRow = getFirstRow(state); const cellCount = columnCount === undefined ? firstRow?.cells?.length : columnCount; // Bail early if the function cannot determine how many cells to add. if (!cellCount) { return state; } return { [sectionName]: [...state[sectionName].slice(0, rowIndex), { cells: Array.from({ length: cellCount }).map((_, index) => { var _firstRow$cells$index; const firstCellInColumn = (_firstRow$cells$index = firstRow?.cells?.[index]) !== null && _firstRow$cells$index !== void 0 ? _firstRow$cells$index : {}; const inheritedAttributes = Object.fromEntries(Object.entries(firstCellInColumn).filter(([key]) => INHERITED_COLUMN_ATTRIBUTES.includes(key))); return { ...inheritedAttributes, content: '', tag: sectionName === 'head' ? 'th' : 'td' }; }) }, ...state[sectionName].slice(rowIndex)] }; } /** * Deletes a row from the table state. * * @param {Object} state Current table state. * @param {Object} options * @param {string} options.sectionName Section in which to delete the row. * @param {number} options.rowIndex Row index to delete. * * @return {Object} New table state. */ function deleteRow(state, { sectionName, rowIndex }) { return { [sectionName]: state[sectionName].filter((row, index) => index !== rowIndex) }; } /** * Inserts a column in the table state. * * @param {Object} state Current table state. * @param {Object} options * @param {number} options.columnIndex Column index at which to insert the column. * * @return {Object} New table state. */ function insertColumn(state, { columnIndex }) { const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key))); return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => { // Bail early if the table section is empty. if (isEmptyTableSection(section)) { return [sectionName, section]; } return [sectionName, section.map(row => { // Bail early if the row is empty or it's an attempt to insert past // the last possible index of the array. if (isEmptyRow(row) || row.cells.length < columnIndex) { return row; } return { cells: [...row.cells.slice(0, columnIndex), { content: '', tag: sectionName === 'head' ? 'th' : 'td' }, ...row.cells.slice(columnIndex)] }; })]; })); } /** * Deletes a column from the table state. * * @param {Object} state Current table state. * @param {Object} options * @param {number} options.columnIndex Column index to delete. * * @return {Object} New table state. */ function deleteColumn(state, { columnIndex }) { const tableSections = Object.fromEntries(Object.entries(state).filter(([key]) => ['head', 'body', 'foot'].includes(key))); return Object.fromEntries(Object.entries(tableSections).map(([sectionName, section]) => { // Bail early if the table section is empty. if (isEmptyTableSection(section)) { return [sectionName, section]; } return [sectionName, section.map(row => ({ cells: row.cells.length >= columnIndex ? row.cells.filter((cell, index) => index !== columnIndex) : row.cells })).filter(row => row.cells.length)]; })); } /** * Toggles the existence of a section. * * @param {Object} state Current table state. * @param {string} sectionName Name of the section to toggle. * * @return {Object} New table state. */ function toggleSection(state, sectionName) { var _state$body$0$cells$l; // Section exists, replace it with an empty row to remove it. if (!isEmptyTableSection(state[sectionName])) { return { [sectionName]: [] }; } // Get the length of the first row of the body to use when creating the header. const columnCount = (_state$body$0$cells$l = state.body?.[0]?.cells?.length) !== null && _state$body$0$cells$l !== void 0 ? _state$body$0$cells$l : 1; // Section doesn't exist, insert an empty row to create the section. return insertRow(state, { sectionName, rowIndex: 0, columnCount }); } /** * Determines whether a table section is empty. * * @param {Object} section Table section state. * * @return {boolean} True if the table section is empty, false otherwise. */ function isEmptyTableSection(section) { return !section || !section.length || section.every(isEmptyRow); } /** * Determines whether a table row is empty. * * @param {Object} row Table row state. * * @return {boolean} True if the table section is empty, false otherwise. */ function isEmptyRow(row) { return !(row.cells && row.cells.length); } ;// ./node_modules/@wordpress/block-library/build-module/table/edit.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const ALIGNMENT_CONTROLS = [{ icon: align_left, title: (0,external_wp_i18n_namespaceObject.__)('Align column left'), align: 'left' }, { icon: align_center, title: (0,external_wp_i18n_namespaceObject.__)('Align column center'), align: 'center' }, { icon: align_right, title: (0,external_wp_i18n_namespaceObject.__)('Align column right'), align: 'right' }]; const cellAriaLabel = { head: (0,external_wp_i18n_namespaceObject.__)('Header cell text'), body: (0,external_wp_i18n_namespaceObject.__)('Body cell text'), foot: (0,external_wp_i18n_namespaceObject.__)('Footer cell text') }; const edit_placeholder = { head: (0,external_wp_i18n_namespaceObject.__)('Header label'), foot: (0,external_wp_i18n_namespaceObject.__)('Footer label') }; function TSection({ name, ...props }) { const TagName = `t${name}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...props }); } function TableEdit({ attributes, setAttributes, insertBlocksAfter, isSelected: isSingleSelected }) { const { hasFixedLayout, head, foot } = attributes; const [initialRowCount, setInitialRowCount] = (0,external_wp_element_namespaceObject.useState)(2); const [initialColumnCount, setInitialColumnCount] = (0,external_wp_element_namespaceObject.useState)(2); const [selectedCell, setSelectedCell] = (0,external_wp_element_namespaceObject.useState)(); const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseColorProps)(attributes); const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalUseBorderProps)(attributes); const tableRef = (0,external_wp_element_namespaceObject.useRef)(); const [hasTableCreated, setHasTableCreated] = (0,external_wp_element_namespaceObject.useState)(false); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); /** * Updates the initial column count used for table creation. * * @param {number} count New initial column count. */ function onChangeInitialColumnCount(count) { setInitialColumnCount(count); } /** * Updates the initial row count used for table creation. * * @param {number} count New initial row count. */ function onChangeInitialRowCount(count) { setInitialRowCount(count); } /** * Creates a table based on dimensions in local state. * * @param {Object} event Form submit event. */ function onCreateTable(event) { event.preventDefault(); setAttributes(createTable({ rowCount: parseInt(initialRowCount, 10) || 2, columnCount: parseInt(initialColumnCount, 10) || 2 })); setHasTableCreated(true); } /** * Toggles whether the table has a fixed layout or not. */ function onChangeFixedLayout() { setAttributes({ hasFixedLayout: !hasFixedLayout }); } /** * Changes the content of the currently selected cell. * * @param {Array} content A RichText content value. */ function onChange(content) { if (!selectedCell) { return; } setAttributes(updateSelectedCell(attributes, selectedCell, cellAttributes => ({ ...cellAttributes, content }))); } /** * Align text within the a column. * * @param {string} align The new alignment to apply to the column. */ function onChangeColumnAlignment(align) { if (!selectedCell) { return; } // Convert the cell selection to a column selection so that alignment // is applied to the entire column. const columnSelection = { type: 'column', columnIndex: selectedCell.columnIndex }; const newAttributes = updateSelectedCell(attributes, columnSelection, cellAttributes => ({ ...cellAttributes, align })); setAttributes(newAttributes); } /** * Get the alignment of the currently selected cell. * * @return {string | undefined} The new alignment to apply to the column. */ function getCellAlignment() { if (!selectedCell) { return; } return getCellAttribute(attributes, selectedCell, 'align'); } /** * Add or remove a `head` table section. */ function onToggleHeaderSection() { setAttributes(toggleSection(attributes, 'head')); } /** * Add or remove a `foot` table section. */ function onToggleFooterSection() { setAttributes(toggleSection(attributes, 'foot')); } /** * Inserts a row at the currently selected row index, plus `delta`. * * @param {number} delta Offset for selected row index at which to insert. */ function onInsertRow(delta) { if (!selectedCell) { return; } const { sectionName, rowIndex } = selectedCell; const newRowIndex = rowIndex + delta; setAttributes(insertRow(attributes, { sectionName, rowIndex: newRowIndex })); // Select the first cell of the new row. setSelectedCell({ sectionName, rowIndex: newRowIndex, columnIndex: 0, type: 'cell' }); } /** * Inserts a row before the currently selected row. */ function onInsertRowBefore() { onInsertRow(0); } /** * Inserts a row after the currently selected row. */ function onInsertRowAfter() { onInsertRow(1); } /** * Deletes the currently selected row. */ function onDeleteRow() { if (!selectedCell) { return; } const { sectionName, rowIndex } = selectedCell; setSelectedCell(); setAttributes(deleteRow(attributes, { sectionName, rowIndex })); } /** * Inserts a column at the currently selected column index, plus `delta`. * * @param {number} delta Offset for selected column index at which to insert. */ function onInsertColumn(delta = 0) { if (!selectedCell) { return; } const { columnIndex } = selectedCell; const newColumnIndex = columnIndex + delta; setAttributes(insertColumn(attributes, { columnIndex: newColumnIndex })); // Select the first cell of the new column. setSelectedCell({ rowIndex: 0, columnIndex: newColumnIndex, type: 'cell' }); } /** * Inserts a column before the currently selected column. */ function onInsertColumnBefore() { onInsertColumn(0); } /** * Inserts a column after the currently selected column. */ function onInsertColumnAfter() { onInsertColumn(1); } /** * Deletes the currently selected column. */ function onDeleteColumn() { if (!selectedCell) { return; } const { sectionName, columnIndex } = selectedCell; setSelectedCell(); setAttributes(deleteColumn(attributes, { sectionName, columnIndex })); } (0,external_wp_element_namespaceObject.useEffect)(() => { if (!isSingleSelected) { setSelectedCell(); } }, [isSingleSelected]); (0,external_wp_element_namespaceObject.useEffect)(() => { if (hasTableCreated) { tableRef?.current?.querySelector('td div[contentEditable="true"]')?.focus(); setHasTableCreated(false); } }, [hasTableCreated]); const sections = ['head', 'body', 'foot'].filter(name => !isEmptyTableSection(attributes[name])); const tableControls = [{ icon: table_row_before, title: (0,external_wp_i18n_namespaceObject.__)('Insert row before'), isDisabled: !selectedCell, onClick: onInsertRowBefore }, { icon: table_row_after, title: (0,external_wp_i18n_namespaceObject.__)('Insert row after'), isDisabled: !selectedCell, onClick: onInsertRowAfter }, { icon: table_row_delete, title: (0,external_wp_i18n_namespaceObject.__)('Delete row'), isDisabled: !selectedCell, onClick: onDeleteRow }, { icon: table_column_before, title: (0,external_wp_i18n_namespaceObject.__)('Insert column before'), isDisabled: !selectedCell, onClick: onInsertColumnBefore }, { icon: table_column_after, title: (0,external_wp_i18n_namespaceObject.__)('Insert column after'), isDisabled: !selectedCell, onClick: onInsertColumnAfter }, { icon: table_column_delete, title: (0,external_wp_i18n_namespaceObject.__)('Delete column'), isDisabled: !selectedCell, onClick: onDeleteColumn }]; const renderedSections = sections.map(name => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TSection, { name: name, children: attributes[name].map(({ cells }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { children: cells.map(({ content, tag: CellTag, scope, align, colspan, rowspan }, columnIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(CellTag, { scope: CellTag === 'th' ? scope : undefined, colSpan: colspan, rowSpan: rowspan, className: dist_clsx({ [`has-text-align-${align}`]: align }, 'wp-block-table__cell-content'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { value: content, onChange: onChange, onFocus: () => { setSelectedCell({ sectionName: name, rowIndex, columnIndex, type: 'cell' }); }, "aria-label": cellAriaLabel[name], placeholder: edit_placeholder[name] }) }, columnIndex)) }, rowIndex)) }, name)); const isEmpty = !sections.length; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ ref: tableRef }), children: [!isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { label: (0,external_wp_i18n_namespaceObject.__)('Change column alignment'), alignmentControls: ALIGNMENT_CONTROLS, value: getCellAlignment(), onChange: nextAlign => onChangeColumnAlignment(nextAlign) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarDropdownMenu, { icon: library_table, label: (0,external_wp_i18n_namespaceObject.__)('Edit table'), controls: tableControls }) })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ hasFixedLayout: true, head: [], foot: [] }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => hasFixedLayout !== true, label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'), onDeselect: () => setAttributes({ hasFixedLayout: true }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Fixed width table cells'), checked: !!hasFixedLayout, onChange: onChangeFixedLayout }) }), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => head && head.length, label: (0,external_wp_i18n_namespaceObject.__)('Header section'), onDeselect: () => setAttributes({ head: [] }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Header section'), checked: !!(head && head.length), onChange: onToggleHeaderSection }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => foot && foot.length, label: (0,external_wp_i18n_namespaceObject.__)('Footer section'), onDeselect: () => setAttributes({ foot: [] }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Footer section'), checked: !!(foot && foot.length), onChange: onToggleFooterSection }) })] })] }) }), !isEmpty && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("table", { className: dist_clsx(colorProps.className, borderProps.className, { 'has-fixed-layout': hasFixedLayout, // This is required in the editor only to overcome // the fact the editor rewrites individual border // widths into a shorthand format. 'has-individual-borders': (0,external_wp_components_namespaceObject.__experimentalHasSplitBorders)(attributes?.style?.border) }), style: { ...colorProps.style, ...borderProps.style }, children: renderedSections }), isEmpty ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { label: (0,external_wp_i18n_namespaceObject.__)('Table'), icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: block_table, showColors: true }), instructions: (0,external_wp_i18n_namespaceObject.__)('Insert a table for sharing data.'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("form", { className: "blocks-table__placeholder-form", onSubmit: onCreateTable, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, type: "number", label: (0,external_wp_i18n_namespaceObject.__)('Column count'), value: initialColumnCount, onChange: onChangeInitialColumnCount, min: "1", className: "blocks-table__placeholder-input" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, type: "number", label: (0,external_wp_i18n_namespaceObject.__)('Row count'), value: initialRowCount, onChange: onChangeInitialRowCount, min: "1", className: "blocks-table__placeholder-input" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", children: (0,external_wp_i18n_namespaceObject.__)('Create Table') })] }) }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Caption, { attributes: attributes, setAttributes: setAttributes, isSelected: isSingleSelected, insertBlocksAfter: insertBlocksAfter, label: (0,external_wp_i18n_namespaceObject.__)('Table caption text'), showToolbarButton: isSingleSelected })] }); } /* harmony default export */ const table_edit = (TableEdit); ;// ./node_modules/@wordpress/block-library/build-module/table/save.js /** * External dependencies */ /** * WordPress dependencies */ function table_save_save({ attributes }) { const { hasFixedLayout, head, body, foot, caption } = attributes; const isEmpty = !head.length && !body.length && !foot.length; if (isEmpty) { return null; } const colorProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetColorClassesAndStyles)(attributes); const borderProps = (0,external_wp_blockEditor_namespaceObject.__experimentalGetBorderClassesAndStyles)(attributes); const classes = dist_clsx(colorProps.className, borderProps.className, { 'has-fixed-layout': hasFixedLayout }); const hasCaption = !external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption); const Section = ({ type, rows }) => { if (!rows.length) { return null; } const Tag = `t${type}`; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Tag, { children: rows.map(({ cells }, rowIndex) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("tr", { children: cells.map(({ content, tag, scope, align, colspan, rowspan }, cellIndex) => { const cellClasses = dist_clsx({ [`has-text-align-${align}`]: align }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { className: cellClasses ? cellClasses : undefined, "data-align": align, tagName: tag, value: content, scope: tag === 'th' ? scope : undefined, colSpan: colspan, rowSpan: rowspan }, cellIndex); }) }, rowIndex)) }); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("figure", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("table", { className: classes === '' ? undefined : classes, style: { ...colorProps.style, ...borderProps.style }, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "head", rows: head }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "body", rows: body }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(Section, { type: "foot", rows: foot })] }), hasCaption && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "figcaption", value: caption, className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption') })] }); } ;// ./node_modules/@wordpress/block-library/build-module/table/utils.js /** * Normalize the rowspan/colspan value. * Returns undefined if the parameter is not a positive number * or the default value (1) for rowspan/colspan. * * @param {number|undefined} rowColSpan rowspan/colspan value. * * @return {string|undefined} normalized rowspan/colspan value. */ function normalizeRowColSpan(rowColSpan) { const parsedValue = parseInt(rowColSpan, 10); if (!Number.isInteger(parsedValue)) { return undefined; } return parsedValue < 0 || parsedValue === 1 ? undefined : parsedValue.toString(); } ;// ./node_modules/@wordpress/block-library/build-module/table/transforms.js /** * WordPress dependencies */ /** * Internal dependencies */ const tableContentPasteSchema = ({ phrasingContentSchema }) => ({ tr: { allowEmpty: true, children: { th: { allowEmpty: true, children: phrasingContentSchema, attributes: ['scope', 'colspan', 'rowspan'] }, td: { allowEmpty: true, children: phrasingContentSchema, attributes: ['colspan', 'rowspan'] } } } }); const tablePasteSchema = args => ({ table: { children: { thead: { allowEmpty: true, children: tableContentPasteSchema(args) }, tfoot: { allowEmpty: true, children: tableContentPasteSchema(args) }, tbody: { allowEmpty: true, children: tableContentPasteSchema(args) } } } }); const table_transforms_transforms = { from: [{ type: 'raw', selector: 'table', schema: tablePasteSchema, transform: node => { const attributes = Array.from(node.children).reduce((sectionAcc, section) => { if (!section.children.length) { return sectionAcc; } const sectionName = section.nodeName.toLowerCase().slice(1); const sectionAttributes = Array.from(section.children).reduce((rowAcc, row) => { if (!row.children.length) { return rowAcc; } const rowAttributes = Array.from(row.children).reduce((colAcc, col) => { const rowspan = normalizeRowColSpan(col.getAttribute('rowspan')); const colspan = normalizeRowColSpan(col.getAttribute('colspan')); colAcc.push({ tag: col.nodeName.toLowerCase(), content: col.innerHTML, rowspan, colspan }); return colAcc; }, []); rowAcc.push({ cells: rowAttributes }); return rowAcc; }, []); sectionAcc[sectionName] = sectionAttributes; return sectionAcc; }, {}); return (0,external_wp_blocks_namespaceObject.createBlock)('core/table', attributes); } }] }; /* harmony default export */ const table_transforms = (table_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/table/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const table_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/table", title: "Table", category: "text", description: "Create structured content in rows and columns to display information.", textdomain: "default", attributes: { hasFixedLayout: { type: "boolean", "default": true }, caption: { type: "rich-text", source: "rich-text", selector: "figcaption" }, head: { type: "array", "default": [], source: "query", selector: "thead tr", query: { cells: { type: "array", "default": [], source: "query", selector: "td,th", query: { content: { type: "rich-text", source: "rich-text" }, tag: { type: "string", "default": "td", source: "tag" }, scope: { type: "string", source: "attribute", attribute: "scope" }, align: { type: "string", source: "attribute", attribute: "data-align" }, colspan: { type: "string", source: "attribute", attribute: "colspan" }, rowspan: { type: "string", source: "attribute", attribute: "rowspan" } } } } }, body: { type: "array", "default": [], source: "query", selector: "tbody tr", query: { cells: { type: "array", "default": [], source: "query", selector: "td,th", query: { content: { type: "rich-text", source: "rich-text" }, tag: { type: "string", "default": "td", source: "tag" }, scope: { type: "string", source: "attribute", attribute: "scope" }, align: { type: "string", source: "attribute", attribute: "data-align" }, colspan: { type: "string", source: "attribute", attribute: "colspan" }, rowspan: { type: "string", source: "attribute", attribute: "rowspan" } } } } }, foot: { type: "array", "default": [], source: "query", selector: "tfoot tr", query: { cells: { type: "array", "default": [], source: "query", selector: "td,th", query: { content: { type: "rich-text", source: "rich-text" }, tag: { type: "string", "default": "td", source: "tag" }, scope: { type: "string", source: "attribute", attribute: "scope" }, align: { type: "string", source: "attribute", attribute: "data-align" }, colspan: { type: "string", source: "attribute", attribute: "colspan" }, rowspan: { type: "string", source: "attribute", attribute: "rowspan" } } } } } }, supports: { anchor: true, align: true, color: { __experimentalSkipSerialization: true, gradients: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalDefaultControls: { fontSize: true } }, __experimentalBorder: { __experimentalSkipSerialization: true, color: true, style: true, width: true, __experimentalDefaultControls: { color: true, style: true, width: true } }, interactivity: { clientNavigation: true } }, selectors: { root: ".wp-block-table > table", spacing: ".wp-block-table" }, styles: [{ name: "regular", label: "Default", isDefault: true }, { name: "stripes", label: "Stripes" }], editorStyle: "wp-block-table-editor", style: "wp-block-table" }; const { name: table_name } = table_metadata; const table_settings = { icon: block_table, example: { attributes: { head: [{ cells: [{ content: (0,external_wp_i18n_namespaceObject.__)('Version'), tag: 'th' }, { content: (0,external_wp_i18n_namespaceObject.__)('Jazz Musician'), tag: 'th' }, { content: (0,external_wp_i18n_namespaceObject.__)('Release Date'), tag: 'th' }] }], body: [{ cells: [{ content: '5.2', tag: 'td' }, { content: 'Jaco Pastorius', tag: 'td' }, { content: (0,external_wp_i18n_namespaceObject.__)('May 7, 2019'), tag: 'td' }] }, { cells: [{ content: '5.1', tag: 'td' }, { content: 'Betty Carter', tag: 'td' }, { content: (0,external_wp_i18n_namespaceObject.__)('February 21, 2019'), tag: 'td' }] }, { cells: [{ content: '5.0', tag: 'td' }, { content: 'Bebo Valdés', tag: 'td' }, { content: (0,external_wp_i18n_namespaceObject.__)('December 6, 2018'), tag: 'td' }] }] }, viewportWidth: 450 }, transforms: table_transforms, edit: table_edit, save: table_save_save, deprecated: table_deprecated }; const table_init = () => initBlock({ name: table_name, metadata: table_metadata, settings: table_settings }); ;// ./node_modules/@wordpress/icons/build-module/library/table-of-contents.js /** * WordPress dependencies */ const tableOfContents = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M20 9.484h-8.889v-1.5H20v1.5Zm0 7h-4.889v-1.5H20v1.5Zm-14 .032a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M13 15.516a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM8 8.484a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" })] }); /* harmony default export */ const table_of_contents = (tableOfContents); ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/list.js /** * External dependencies */ /** * Internal dependencies */ const ENTRY_CLASS_NAME = 'wp-block-table-of-contents__entry'; function TableOfContentsList({ nestedHeadingList, disableLinkActivation, onClick }) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: nestedHeadingList.map((node, index) => { const { content, link } = node.heading; const entry = link ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("a", { className: ENTRY_CLASS_NAME, href: link, "aria-disabled": disableLinkActivation || undefined, onClick: disableLinkActivation && 'function' === typeof onClick ? onClick : undefined, children: content }) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { className: ENTRY_CLASS_NAME, children: content }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("li", { children: [entry, node.children ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, { nestedHeadingList: node.children, disableLinkActivation: disableLinkActivation, onClick: disableLinkActivation && 'function' === typeof onClick ? onClick : undefined }) }) : null] }, index); }) }); } ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/utils.js /** * Takes a flat list of heading parameters and nests them based on each header's * immediate parent's level. * * @param headingList The flat list of headings to nest. * * @return The nested list of headings. */ function linearToNestedHeadingList(headingList) { const nestedHeadingList = []; headingList.forEach((heading, key) => { if (heading.content === '') { return; } // Make sure we are only working with the same level as the first iteration in our set. if (heading.level === headingList[0].level) { // Check that the next iteration will return a value. // If it does and the next level is greater than the current level, // the next iteration becomes a child of the current iteration. if (headingList[key + 1]?.level > heading.level) { // We must calculate the last index before the next iteration that // has the same level (siblings). We then use this index to slice // the array for use in recursion. This prevents duplicate nodes. let endOfSlice = headingList.length; for (let i = key + 1; i < headingList.length; i++) { if (headingList[i].level === heading.level) { endOfSlice = i; break; } } // We found a child node: Push a new node onto the return array // with children. nestedHeadingList.push({ heading, children: linearToNestedHeadingList(headingList.slice(key + 1, endOfSlice)) }); } else { // No child node: Push a new node onto the return array. nestedHeadingList.push({ heading, children: null }); } } }); return nestedHeadingList; } // EXTERNAL MODULE: ./node_modules/fast-deep-equal/es6/index.js var es6 = __webpack_require__(7734); var es6_default = /*#__PURE__*/__webpack_require__.n(es6); ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/hooks.js /** * External dependencies */ /** * WordPress dependencies */ function getLatestHeadings(select, clientId) { var _select$getPermalink, _getBlockAttributes; const { getBlockAttributes, getBlockName, getClientIdsWithDescendants, getBlocksByName } = select(external_wp_blockEditor_namespaceObject.store); // FIXME: @wordpress/block-library should not depend on @wordpress/editor. // Blocks can be loaded into a *non-post* block editor, so to avoid // declaring @wordpress/editor as a dependency, we must access its // store by string. When the store is not available, editorSelectors // will be null, and the block's saved markup will lack permalinks. // eslint-disable-next-line @wordpress/data-no-store-string-literals const permalink = (_select$getPermalink = select('core/editor').getPermalink()) !== null && _select$getPermalink !== void 0 ? _select$getPermalink : null; const isPaginated = getBlocksByName('core/nextpage').length !== 0; const { onlyIncludeCurrentPage } = (_getBlockAttributes = getBlockAttributes(clientId)) !== null && _getBlockAttributes !== void 0 ? _getBlockAttributes : {}; // Get the client ids of all blocks in the editor. const allBlockClientIds = getClientIdsWithDescendants(); // If onlyIncludeCurrentPage is true, calculate the page (of a paginated post) this block is part of, so we know which headings to include; otherwise, skip the calculation. let tocPage = 1; if (isPaginated && onlyIncludeCurrentPage) { // We can't use getBlockIndex because it only returns the index // relative to sibling blocks. const tocIndex = allBlockClientIds.indexOf(clientId); for (const [blockIndex, blockClientId] of allBlockClientIds.entries()) { // If we've reached blocks after the Table of Contents, we've // finished calculating which page the block is on. if (blockIndex >= tocIndex) { break; } if (getBlockName(blockClientId) === 'core/nextpage') { tocPage++; } } } const latestHeadings = []; /** The page (of a paginated post) a heading will be part of. */ let headingPage = 1; let headingPageLink = null; // If the core/editor store is available, we can add permalinks to the // generated table of contents. if (typeof permalink === 'string') { headingPageLink = isPaginated ? (0,external_wp_url_namespaceObject.addQueryArgs)(permalink, { page: headingPage }) : permalink; } for (const blockClientId of allBlockClientIds) { const blockName = getBlockName(blockClientId); if (blockName === 'core/nextpage') { headingPage++; // If we're only including headings from the current page (of // a paginated post), then exit the loop if we've reached the // pages after the one with the Table of Contents block. if (onlyIncludeCurrentPage && headingPage > tocPage) { break; } if (typeof permalink === 'string') { headingPageLink = (0,external_wp_url_namespaceObject.addQueryArgs)((0,external_wp_url_namespaceObject.removeQueryArgs)(permalink, ['page']), { page: headingPage }); } } // If we're including all headings or we've reached headings on // the same page as the Table of Contents block, add them to the // list. else if (!onlyIncludeCurrentPage || headingPage === tocPage) { if (blockName === 'core/heading') { const headingAttributes = getBlockAttributes(blockClientId); const canBeLinked = typeof headingPageLink === 'string' && typeof headingAttributes.anchor === 'string' && headingAttributes.anchor !== ''; latestHeadings.push({ // Convert line breaks to spaces, and get rid of HTML tags in the headings. content: (0,external_wp_dom_namespaceObject.__unstableStripHTML)(headingAttributes.content.replace(/(<br *\/?>)+/g, ' ')), level: headingAttributes.level, link: canBeLinked ? `${headingPageLink}#${headingAttributes.anchor}` : null }); } } } return latestHeadings; } function observeCallback(select, dispatch, clientId) { const { getBlockAttributes } = select(external_wp_blockEditor_namespaceObject.store); const { updateBlockAttributes, __unstableMarkNextChangeAsNotPersistent } = dispatch(external_wp_blockEditor_namespaceObject.store); /** * If the block no longer exists in the store, skip the update. * The "undo" action recreates the block and provides a new `clientId`. * The hook still might be observing the changes while the old block unmounts. */ const attributes = getBlockAttributes(clientId); if (attributes === null) { return; } const headings = getLatestHeadings(select, clientId); if (!es6_default()(headings, attributes.headings)) { __unstableMarkNextChangeAsNotPersistent(); updateBlockAttributes(clientId, { headings }); } } function useObserveHeadings(clientId) { const registry = (0,external_wp_data_namespaceObject.useRegistry)(); (0,external_wp_element_namespaceObject.useEffect)(() => { // Todo: Limit subscription to block editor store when data no longer depends on `getPermalink`. // See: https://github.com/WordPress/gutenberg/pull/45513 return registry.subscribe(() => observeCallback(registry.select, registry.dispatch, clientId)); }, [registry, clientId]); } ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ /** @typedef {import('./utils').HeadingData} HeadingData */ /** * Table of Contents block edit component. * * @param {Object} props The props. * @param {Object} props.attributes The block attributes. * @param {HeadingData[]} props.attributes.headings A list of data for each heading in the post. * @param {boolean} props.attributes.onlyIncludeCurrentPage Whether to only include headings from the current page (if the post is paginated). * @param {string} props.clientId * @param {(attributes: Object) => void} props.setAttributes * * @return {Component} The component. */ function TableOfContentsEdit({ attributes: { headings = [], onlyIncludeCurrentPage }, clientId, setAttributes }) { useObserveHeadings(clientId); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const instanceId = (0,external_wp_compose_namespaceObject.useInstanceId)(TableOfContentsEdit, 'table-of-contents'); // If a user clicks to a link prevent redirection and show a warning. const { createWarningNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const showRedirectionPreventedNotice = event => { event.preventDefault(); createWarningNotice((0,external_wp_i18n_namespaceObject.__)('Links are disabled in the editor.'), { id: `block-library/core/table-of-contents/redirection-prevented/${instanceId}`, type: 'snackbar' }); }; const canInsertList = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getBlockRootClientId, canInsertBlockType } = select(external_wp_blockEditor_namespaceObject.store); const rootClientId = getBlockRootClientId(clientId); return canInsertBlockType('core/list', rootClientId); }, [clientId]); const { replaceBlocks } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); const headingTree = linearToNestedHeadingList(headings); const toolbarControls = canInsertList && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarGroup, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => replaceBlocks(clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/list', { ordered: true, values: (0,external_wp_element_namespaceObject.renderToString)(/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, { nestedHeadingList: headingTree })) })), children: (0,external_wp_i18n_namespaceObject.__)('Convert to static list') }) }) }); const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ onlyIncludeCurrentPage: false }); }, dropdownMenuProps: dropdownMenuProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => !!onlyIncludeCurrentPage, label: (0,external_wp_i18n_namespaceObject.__)('Only include current page'), onDeselect: () => setAttributes({ onlyIncludeCurrentPage: false }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Only include current page'), checked: onlyIncludeCurrentPage, onChange: value => setAttributes({ onlyIncludeCurrentPage: value }), help: onlyIncludeCurrentPage ? (0,external_wp_i18n_namespaceObject.__)('Only including headings from the current page (if the post is paginated).') : (0,external_wp_i18n_namespaceObject.__)('Include headings from all pages (if the post is paginated).') }) }) }) }); // If there are no headings or the only heading is empty. // Note that the toolbar controls are intentionally omitted since the // "Convert to static list" option is useless to the placeholder state. if (headings.length === 0) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Placeholder, { icon: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockIcon, { icon: table_of_contents }), label: (0,external_wp_i18n_namespaceObject.__)('Table of Contents'), instructions: (0,external_wp_i18n_namespaceObject.__)('Start adding Heading blocks to create a table of contents. Headings with HTML anchors will be linked here.') }) }), inspectorControls] }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("nav", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, { nestedHeadingList: headingTree, disableLinkActivation: true, onClick: showRedirectionPreventedNotice }) }) }), toolbarControls, inspectorControls] }); } ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/save.js /** * WordPress dependencies */ /** * Internal dependencies */ function table_of_contents_save_save({ attributes: { headings = [] } }) { if (headings.length === 0) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("nav", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("ol", { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TableOfContentsList, { nestedHeadingList: linearToNestedHeadingList(headings) }) }) }); } ;// ./node_modules/@wordpress/block-library/build-module/table-of-contents/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const table_of_contents_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, __experimental: true, name: "core/table-of-contents", title: "Table of Contents", category: "design", description: "Summarize your post with a list of headings. Add HTML anchors to Heading blocks to link them here.", keywords: ["document outline", "summary"], textdomain: "default", attributes: { headings: { type: "array", items: { type: "object" }, "default": [] }, onlyIncludeCurrentPage: { type: "boolean", "default": false } }, supports: { html: false, color: { text: true, background: true, gradients: true, link: true }, spacing: { margin: true, padding: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, style: "wp-block-table-of-contents" }; const { name: table_of_contents_name } = table_of_contents_metadata; const table_of_contents_settings = { icon: table_of_contents, edit: TableOfContentsEdit, save: table_of_contents_save_save, example: { innerBlocks: [{ name: 'core/heading', attributes: { level: 2, content: (0,external_wp_i18n_namespaceObject.__)('Heading') } }, { name: 'core/heading', attributes: { level: 3, content: (0,external_wp_i18n_namespaceObject.__)('Subheading') } }, { name: 'core/heading', attributes: { level: 2, content: (0,external_wp_i18n_namespaceObject.__)('Heading') } }, { name: 'core/heading', attributes: { level: 3, content: (0,external_wp_i18n_namespaceObject.__)('Subheading') } }], attributes: { headings: [{ content: (0,external_wp_i18n_namespaceObject.__)('Heading'), level: 2 }, { content: (0,external_wp_i18n_namespaceObject.__)('Subheading'), level: 3 }, { content: (0,external_wp_i18n_namespaceObject.__)('Heading'), level: 2 }, { content: (0,external_wp_i18n_namespaceObject.__)('Subheading'), level: 3 }] } } }; const table_of_contents_init = () => initBlock({ name: table_of_contents_name, metadata: table_of_contents_metadata, settings: table_of_contents_settings }); ;// ./node_modules/@wordpress/block-library/build-module/tag-cloud/transforms.js /** * WordPress dependencies */ const tag_cloud_transforms_transforms = { from: [{ type: 'block', blocks: ['core/categories'], transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/tag-cloud') }], to: [{ type: 'block', blocks: ['core/categories'], transform: () => (0,external_wp_blocks_namespaceObject.createBlock)('core/categories') }] }; /* harmony default export */ const tag_cloud_transforms = (tag_cloud_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/tag-cloud/edit.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * Minimum number of tags a user can show using this block. * * @type {number} */ const MIN_TAGS = 1; /** * Maximum number of tags a user can show using this block. * * @type {number} */ const MAX_TAGS = 100; const MIN_FONT_SIZE = 0.1; const MAX_FONT_SIZE = 100; function TagCloudEdit({ attributes, setAttributes }) { const { taxonomy, showTagCounts, numberOfTags, smallestFontSize, largestFontSize } = attributes; const [availableUnits] = (0,external_wp_blockEditor_namespaceObject.useSettings)('spacing.units'); const dropdownMenuProps = useToolsPanelDropdownMenuProps(); // The `pt` unit is used as the default value and is therefore // always considered an available unit. const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({ availableUnits: availableUnits ? [...availableUnits, 'pt'] : ['%', 'px', 'em', 'rem', 'pt'] }); const taxonomies = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getTaxonomies({ per_page: -1 }), []); const getTaxonomyOptions = () => { const selectOption = { label: (0,external_wp_i18n_namespaceObject.__)('- Select -'), value: '', disabled: true }; const taxonomyOptions = (taxonomies !== null && taxonomies !== void 0 ? taxonomies : []).filter(tax => !!tax.show_cloud).map(item => { return { value: item.slug, label: item.name }; }); return [selectOption, ...taxonomyOptions]; }; const onFontSizeChange = (fontSizeLabel, newValue) => { // eslint-disable-next-line @wordpress/no-unused-vars-before-return const [quantity, newUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(newValue); if (!Number.isFinite(quantity)) { return; } const updateObj = { [fontSizeLabel]: newValue }; // We need to keep in sync the `unit` changes to both `smallestFontSize` // and `largestFontSize` attributes. Object.entries({ smallestFontSize, largestFontSize }).forEach(([attribute, currentValue]) => { const [currentQuantity, currentUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(currentValue); // Only add an update if the other font size attribute has a different unit. if (attribute !== fontSizeLabel && currentUnit !== newUnit) { updateObj[attribute] = `${currentQuantity}${newUnit}`; } }); setAttributes(updateObj); }; // Remove border styles from the server-side attributes to prevent duplicate border. const serverSideAttributes = { ...attributes, style: { ...attributes?.style, border: undefined } }; const inspectorControls = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalToolsPanel, { label: (0,external_wp_i18n_namespaceObject.__)('Settings'), resetAll: () => { setAttributes({ taxonomy: 'post_tag', showTagCounts: false, numberOfTags: 45, smallestFontSize: '8pt', largestFontSize: '22pt' }); }, dropdownMenuProps: dropdownMenuProps, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => taxonomy !== 'post_tag', label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'), onDeselect: () => setAttributes({ taxonomy: 'post_tag' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Taxonomy'), options: getTaxonomyOptions(), value: taxonomy, onChange: selectedTaxonomy => setAttributes({ taxonomy: selectedTaxonomy }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => smallestFontSize !== '8pt' || largestFontSize !== '22pt', label: (0,external_wp_i18n_namespaceObject.__)('Font size'), onDeselect: () => setAttributes({ smallestFontSize: '8pt', largestFontSize: '22pt' }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Flex, { gap: 4, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { label: (0,external_wp_i18n_namespaceObject.__)('Smallest size'), value: smallestFontSize, onChange: value => { onFontSizeChange('smallestFontSize', value); }, units: units, min: MIN_FONT_SIZE, max: MAX_FONT_SIZE, size: "__unstable-large" }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { isBlock: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalUnitControl, { label: (0,external_wp_i18n_namespaceObject.__)('Largest size'), value: largestFontSize, onChange: value => { onFontSizeChange('largestFontSize', value); }, units: units, min: MIN_FONT_SIZE, max: MAX_FONT_SIZE, size: "__unstable-large" }) })] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => numberOfTags !== 45, label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'), onDeselect: () => setAttributes({ numberOfTags: 45 }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Number of tags'), value: numberOfTags, onChange: value => setAttributes({ numberOfTags: value }), min: MIN_TAGS, max: MAX_TAGS, required: true }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, { hasValue: () => showTagCounts !== false, label: (0,external_wp_i18n_namespaceObject.__)('Show tag counts'), onDeselect: () => setAttributes({ showTagCounts: false }), isShownByDefault: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToggleControl, { __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Show tag counts'), checked: showTagCounts, onChange: () => setAttributes({ showTagCounts: !showTagCounts }) }) })] }) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [inspectorControls, /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)(), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Disabled, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)((external_wp_serverSideRender_default()), { skipBlockSupportAttributes: true, block: "core/tag-cloud", attributes: serverSideAttributes }) }) })] }); } /* harmony default export */ const tag_cloud_edit = (TagCloudEdit); ;// ./node_modules/@wordpress/block-library/build-module/tag-cloud/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const tag_cloud_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/tag-cloud", title: "Tag Cloud", category: "widgets", description: "A cloud of popular keywords, each sized by how often it appears.", textdomain: "default", attributes: { numberOfTags: { type: "number", "default": 45, minimum: 1, maximum: 100 }, taxonomy: { type: "string", "default": "post_tag" }, showTagCounts: { type: "boolean", "default": false }, smallestFontSize: { type: "string", "default": "8pt" }, largestFontSize: { type: "string", "default": "22pt" } }, styles: [{ name: "default", label: "Default", isDefault: true }, { name: "outline", label: "Outline" }], supports: { html: false, align: true, spacing: { margin: true, padding: true }, typography: { lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalLetterSpacing: true }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } }, editorStyle: "wp-block-tag-cloud-editor" }; const { name: tag_cloud_name } = tag_cloud_metadata; const tag_cloud_settings = { icon: library_tag, example: {}, edit: tag_cloud_edit, transforms: tag_cloud_transforms }; const tag_cloud_init = () => initBlock({ name: tag_cloud_name, metadata: tag_cloud_metadata, settings: tag_cloud_settings }); ;// ./node_modules/tslib/tslib.es6.mjs /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { var context = {}; for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; for (var p in contextIn.access) context.access[p] = contextIn.access[p]; context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); if (_ = accept(result.get)) descriptor.get = _; if (_ = accept(result.set)) descriptor.set = _; if (_ = accept(result.init)) initializers.unshift(_); } else if (_ = accept(result)) { if (kind === "field") initializers.unshift(_); else descriptor[key] = _; } } if (target) Object.defineProperty(target, contextIn.name, descriptor); done = true; }; function __runInitializers(thisArg, initializers, value) { var useValue = arguments.length > 2; for (var i = 0; i < initializers.length; i++) { value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); } return useValue ? value : void 0; }; function __propKey(x) { return typeof x === "symbol" ? x : "".concat(x); }; function __setFunctionName(f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); }; function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } function __classPrivateFieldIn(state, receiver) { if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); return typeof state === "function" ? receiver === state : state.has(receiver); } function __addDisposableResource(env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); var dispose, inner; if (async) { if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); dispose = value[Symbol.asyncDispose]; } if (dispose === void 0) { if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); dispose = value[Symbol.dispose]; if (async) inner = dispose; } if (typeof dispose !== "function") throw new TypeError("Object not disposable."); if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; env.stack.push({ value: value, dispose: dispose, async: async }); } else if (async) { env.stack.push({ async: true }); } return value; } var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { var e = new Error(message); return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }; function __disposeResources(env) { function fail(e) { env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; env.hasError = true; } var r, s = 0; function next() { while (r = env.stack.pop()) { try { if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); if (r.dispose) { var result = r.dispose.call(r.value); if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); } else s |= 1; } catch (e) { fail(e); } } if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); if (env.hasError) throw env.error; } return next(); } function __rewriteRelativeImportExtension(path, preserveJsx) { if (typeof path === "string" && /^\.\.?\//.test(path)) { return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) { return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js"); }); } return path; } /* harmony default export */ const tslib_es6 = ({ __extends, __assign, __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources, __rewriteRelativeImportExtension, }); ;// ./node_modules/lower-case/dist.es2015/index.js /** * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt */ var SUPPORTED_LOCALE = { tr: { regexp: /\u0130|\u0049|\u0049\u0307/g, map: { İ: "\u0069", I: "\u0131", İ: "\u0069", }, }, az: { regexp: /\u0130/g, map: { İ: "\u0069", I: "\u0131", İ: "\u0069", }, }, lt: { regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, map: { I: "\u0069\u0307", J: "\u006A\u0307", Į: "\u012F\u0307", Ì: "\u0069\u0307\u0300", Í: "\u0069\u0307\u0301", Ĩ: "\u0069\u0307\u0303", }, }, }; /** * Localized lower case. */ function localeLowerCase(str, locale) { var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; if (lang) return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); return lowerCase(str); } /** * Lower case as a function. */ function lowerCase(str) { return str.toLowerCase(); } ;// ./node_modules/no-case/dist.es2015/index.js // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; // Remove all non-word characters. var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; /** * Normalize the string into something other libraries can manipulate easier. */ function noCase(input, options) { if (options === void 0) { options = {}; } var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); var start = 0; var end = result.length; // Trim the delimiter from around the output string. while (result.charAt(start) === "\0") start++; while (result.charAt(end - 1) === "\0") end--; // Transform each token independently. return result.slice(start, end).split("\0").map(transform).join(delimiter); } /** * Replace `re` in the input string with the replacement value. */ function replace(input, re, value) { if (re instanceof RegExp) return input.replace(re, value); return re.reduce(function (input, re) { return input.replace(re, value); }, input); } ;// ./node_modules/upper-case-first/dist.es2015/index.js /** * Upper case the first character of an input string. */ function upperCaseFirst(input) { return input.charAt(0).toUpperCase() + input.substr(1); } ;// ./node_modules/capital-case/dist.es2015/index.js function capitalCaseTransform(input) { return upperCaseFirst(input.toLowerCase()); } function capitalCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: " ", transform: capitalCaseTransform }, options)); } ;// ./node_modules/dot-case/dist.es2015/index.js function dotCase(input, options) { if (options === void 0) { options = {}; } return noCase(input, __assign({ delimiter: "." }, options)); } ;// ./node_modules/param-case/dist.es2015/index.js function paramCase(input, options) { if (options === void 0) { options = {}; } return dotCase(input, __assign({ delimiter: "-" }, options)); } ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/hooks.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Retrieves the available template parts for the given area. * * @param {string} area Template part area. * @param {string} excludedId Template part ID to exclude. * * @return {{ templateParts: Array, isResolving: boolean }} array of template parts. */ function useAlternativeTemplateParts(area, excludedId) { const { templateParts, isResolving } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEntityRecords, isResolving: _isResolving } = select(external_wp_coreData_namespaceObject.store); const query = { per_page: -1 }; return { templateParts: getEntityRecords('postType', 'wp_template_part', query), isResolving: _isResolving('getEntityRecords', ['postType', 'wp_template_part', query]) }; }, []); const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!templateParts) { return []; } return templateParts.filter(templatePart => createTemplatePartId(templatePart.theme, templatePart.slug) !== excludedId && (!area || 'uncategorized' === area || templatePart.area === area)) || []; }, [templateParts, area, excludedId]); return { templateParts: filteredTemplateParts, isResolving }; } /** * Retrieves the available block patterns for the given area. * * @param {string} area Template part area. * @param {string} clientId Block Client ID. (The container of the block can impact allowed blocks). * * @return {Array} array of block patterns. */ function useAlternativeBlockPatterns(area, clientId) { return (0,external_wp_data_namespaceObject.useSelect)(select => { const blockNameWithArea = area ? `core/template-part/${area}` : 'core/template-part'; const { getBlockRootClientId, getPatternsByBlockTypes } = select(external_wp_blockEditor_namespaceObject.store); const rootClientId = getBlockRootClientId(clientId); return getPatternsByBlockTypes(blockNameWithArea, rootClientId); }, [area, clientId]); } function useCreateTemplatePartFromBlocks(area, setAttributes) { const { saveEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); return async (blocks = [], title = (0,external_wp_i18n_namespaceObject.__)('Untitled Template Part')) => { // Currently template parts only allow latin chars. // Fallback slug will receive suffix by default. const cleanSlug = paramCase(title).replace(/[^\w-]+/g, '') || 'wp-custom-part'; // If we have `area` set from block attributes, means an exposed // block variation was inserted. So add this prop to the template // part entity on creation. Afterwards remove `area` value from // block attributes. const record = { title, slug: cleanSlug, content: (0,external_wp_blocks_namespaceObject.serialize)(blocks), // `area` is filterable on the server and defaults to `UNCATEGORIZED` // if provided value is not allowed. area }; const templatePart = await saveEntityRecord('postType', 'wp_template_part', record); setAttributes({ slug: templatePart.slug, theme: templatePart.theme, area: undefined }); }; } /** * Retrieves the template part area object. * * @param {string} area Template part area identifier. * * @return {{icon: Object, label: string, tagName: string}} Template Part area. */ function useTemplatePartArea(area) { return (0,external_wp_data_namespaceObject.useSelect)(select => { var _selectedArea$area_ta; const definedAreas = select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || []; const selectedArea = definedAreas.find(definedArea => definedArea.area === area); const defaultArea = definedAreas.find(definedArea => definedArea.area === 'uncategorized'); return { icon: selectedArea?.icon || defaultArea?.icon, label: selectedArea?.label || (0,external_wp_i18n_namespaceObject.__)('Template Part'), tagName: (_selectedArea$area_ta = selectedArea?.area_tag) !== null && _selectedArea$area_ta !== void 0 ? _selectedArea$area_ta : 'div' }; }, [area]); } ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/title-modal.js /** * WordPress dependencies */ function TitleModal({ areaLabel, onClose, onSubmit }) { // Restructure onCreate to set the blocks on local state. // Add modal to confirm title and trigger onCreate. const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)(''); const submitForCreation = event => { event.preventDefault(); onSubmit(title); }; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.). (0,external_wp_i18n_namespaceObject.__)('Create new %s'), areaLabel.toLowerCase()), onRequestClose: onClose, focusOnMount: "firstContentElement", size: "small", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", { onSubmit: submitForCreation, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, { spacing: "5", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { label: (0,external_wp_i18n_namespaceObject.__)('Name'), value: title, onChange: setTitle, placeholder: (0,external_wp_i18n_namespaceObject.__)('Custom Template Part'), __nextHasNoMarginBottom: true, __next40pxDefaultSize: true }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { justify: "right", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "tertiary", onClick: () => { onClose(); setTitle(''); }, children: (0,external_wp_i18n_namespaceObject.__)('Cancel') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { variant: "primary", type: "submit", accessibleWhenDisabled: true, disabled: !title.length, __next40pxDefaultSize: true, children: (0,external_wp_i18n_namespaceObject.__)('Create') })] })] }) }) }); } ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/placeholder.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplatePartPlaceholder({ area, clientId, templatePartId, onOpenSelectionModal, setAttributes }) { const { templateParts, isResolving } = useAlternativeTemplateParts(area, templatePartId); const blockPatterns = useAlternativeBlockPatterns(area, clientId); const { isBlockBasedTheme, canCreateTemplatePart } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getCurrentTheme, canUser } = select(external_wp_coreData_namespaceObject.store); return { isBlockBasedTheme: getCurrentTheme()?.is_block_theme, canCreateTemplatePart: canUser('create', { kind: 'postType', name: 'wp_template_part' }) }; }, []); const [showTitleModal, setShowTitleModal] = (0,external_wp_element_namespaceObject.useState)(false); const areaObject = useTemplatePartArea(area); const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.Placeholder, { icon: areaObject.icon, label: areaObject.label, instructions: isBlockBasedTheme ? (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.). (0,external_wp_i18n_namespaceObject.__)('Choose an existing %s or create a new one.'), areaObject.label.toLowerCase()) : (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.). (0,external_wp_i18n_namespaceObject.__)('Choose an existing %s.'), areaObject.label.toLowerCase()), children: [isResolving && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}), !isResolving && !!(templateParts.length || blockPatterns.length) && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", onClick: onOpenSelectionModal, children: (0,external_wp_i18n_namespaceObject.__)('Choose') }), !isResolving && isBlockBasedTheme && canCreateTemplatePart && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "secondary", onClick: () => { setShowTitleModal(true); }, children: (0,external_wp_i18n_namespaceObject.__)('Start blank') }), showTitleModal && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TitleModal, { areaLabel: areaObject.label, onClose: () => setShowTitleModal(false), onSubmit: title => { createFromBlocks([], title); } })] }); } ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/map-template-part-to-block-pattern.js /** * WordPress dependencies */ /** * Internal dependencies */ /** * This maps the properties of a template part to those of a block pattern. * @param {Object} templatePart * @return {Object} The template part in the shape of block pattern. */ function mapTemplatePartToBlockPattern(templatePart) { return { name: createTemplatePartId(templatePart.theme, templatePart.slug), title: templatePart.title.rendered, blocks: (0,external_wp_blocks_namespaceObject.parse)(templatePart.content.raw), templatePart }; } ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/selection-modal.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplatePartSelectionModal({ setAttributes, onClose, templatePartId = null, area, clientId }) { const [searchValue, setSearchValue] = (0,external_wp_element_namespaceObject.useState)(''); const { templateParts } = useAlternativeTemplateParts(area, templatePartId); // We can map template parts to block patters to reuse the BlockPatternsList UI const filteredTemplateParts = (0,external_wp_element_namespaceObject.useMemo)(() => { const partsAsPatterns = templateParts.map(templatePart => mapTemplatePartToBlockPattern(templatePart)); return searchPatterns(partsAsPatterns, searchValue); }, [templateParts, searchValue]); const blockPatterns = useAlternativeBlockPatterns(area, clientId); const filteredBlockPatterns = (0,external_wp_element_namespaceObject.useMemo)(() => { return searchPatterns(blockPatterns, searchValue); }, [blockPatterns, searchValue]); const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const onTemplatePartSelect = templatePart => { setAttributes({ slug: templatePart.slug, theme: templatePart.theme, area: undefined }); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: template part title. */ (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" inserted.'), templatePart.title?.rendered || templatePart.slug), { type: 'snackbar' }); onClose(); }; const hasTemplateParts = !!filteredTemplateParts.length; const hasBlockPatterns = !!filteredBlockPatterns.length; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { className: "block-library-template-part__selection-content", children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "block-library-template-part__selection-search", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SearchControl, { __nextHasNoMarginBottom: true, onChange: setSearchValue, value: searchValue, label: (0,external_wp_i18n_namespaceObject.__)('Search'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Search') }) }), hasTemplateParts && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("h2", { children: (0,external_wp_i18n_namespaceObject.__)('Existing template parts') }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { blockPatterns: filteredTemplateParts, onClickPattern: pattern => { onTemplatePartSelect(pattern.templatePart); } })] }), !hasTemplateParts && !hasBlockPatterns && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, { alignment: "center", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("p", { children: (0,external_wp_i18n_namespaceObject.__)('No results found.') }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/utils/transformers.js /** * WordPress dependencies */ /** * Converts a widget entity record into a block. * * @param {Object} widget The widget entity record. * @return {Object} a block (converted from the entity record). */ function transformWidgetToBlock(widget) { if (widget.id_base !== 'block') { let attributes; if (widget._embedded.about[0].is_multi) { attributes = { idBase: widget.id_base, instance: widget.instance }; } else { attributes = { id: widget.id }; } return switchLegacyWidgetType((0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes)); } const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, { __unstableSkipAutop: true }); if (!parsedBlocks.length) { return undefined; } const block = parsedBlocks[0]; if (block.name === 'core/widget-group') { return (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getGroupingBlockName)(), undefined, transformInnerBlocks(block.innerBlocks)); } if (block.innerBlocks.length > 0) { return (0,external_wp_blocks_namespaceObject.cloneBlock)(block, undefined, transformInnerBlocks(block.innerBlocks)); } return block; } /** * Switch Legacy Widget to the first matching transformation block. * * @param {Object} block Legacy Widget block object * @return {Object|undefined} a block */ function switchLegacyWidgetType(block) { const transforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)([block]).filter(item => { // The block without any transformations can't be a wildcard. if (!item.transforms) { return true; } const hasWildCardFrom = item.transforms?.from?.find(from => from.blocks && from.blocks.includes('*')); const hasWildCardTo = item.transforms?.to?.find(to => to.blocks && to.blocks.includes('*')); // Skip wildcard transformations. return !hasWildCardFrom && !hasWildCardTo; }); if (!transforms.length) { return undefined; } return (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, transforms[0].name); } function transformInnerBlocks(innerBlocks = []) { return innerBlocks.flatMap(block => { if (block.name === 'core/legacy-widget') { return switchLegacyWidgetType(block); } return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, transformInnerBlocks(block.innerBlocks)); }).filter(block => !!block); } ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/import-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ const SIDEBARS_QUERY = { per_page: -1, _fields: 'id,name,description,status,widgets' }; function TemplatePartImportControls({ area, setAttributes }) { const [selectedSidebar, setSelectedSidebar] = (0,external_wp_element_namespaceObject.useState)(''); const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); const registry = (0,external_wp_data_namespaceObject.useRegistry)(); const { sidebars, hasResolved } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSidebars, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); return { sidebars: getSidebars(SIDEBARS_QUERY), hasResolved: hasFinishedResolution('getSidebars', [SIDEBARS_QUERY]) }; }, []); const { createErrorNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const createFromBlocks = useCreateTemplatePartFromBlocks(area, setAttributes); const options = (0,external_wp_element_namespaceObject.useMemo)(() => { const sidebarOptions = (sidebars !== null && sidebars !== void 0 ? sidebars : []).filter(widgetArea => widgetArea.id !== 'wp_inactive_widgets' && widgetArea.widgets.length > 0).map(widgetArea => { return { value: widgetArea.id, label: widgetArea.name }; }); if (!sidebarOptions.length) { return []; } return [{ value: '', label: (0,external_wp_i18n_namespaceObject.__)('Select widget area') }, ...sidebarOptions]; }, [sidebars]); // Render an empty node while data is loading to avoid SlotFill re-positioning bug. // See: https://github.com/WordPress/gutenberg/issues/15641. if (!hasResolved) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginBottom: "0" }); } if (hasResolved && !options.length) { return null; } async function createFromWidgets(event) { event.preventDefault(); if (isBusy || !selectedSidebar) { return; } setIsBusy(true); const sidebar = options.find(({ value }) => value === selectedSidebar); const { getWidgets } = registry.resolveSelect(external_wp_coreData_namespaceObject.store); // The widgets API always returns a successful response. const widgets = await getWidgets({ sidebar: sidebar.value, _embed: 'about' }); const skippedWidgets = new Set(); const blocks = widgets.flatMap(widget => { const block = transformWidgetToBlock(widget); // Skip the block if we have no matching transformations. if (!block) { skippedWidgets.add(widget.id_base); return []; } return block; }); await createFromBlocks(blocks, /* translators: %s: name of the widget area */ (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Widget area: %s'), sidebar.label)); if (skippedWidgets.size) { createErrorNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: the list of widgets */ (0,external_wp_i18n_namespaceObject.__)('Unable to import the following widgets: %s.'), Array.from(skippedWidgets).join(', ')), { type: 'snackbar' }); } setIsBusy(false); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalSpacer, { marginBottom: "4", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { as: "form", onSubmit: createFromWidgets, children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexBlock, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { label: (0,external_wp_i18n_namespaceObject.__)('Import widget area'), value: selectedSidebar, options: options, onChange: value => setSelectedSidebar(value), disabled: !options.length, __next40pxDefaultSize: true, __nextHasNoMarginBottom: true }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.FlexItem, { style: { marginBottom: '8px', marginTop: 'auto' }, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", isBusy: isBusy, "aria-disabled": isBusy || !selectedSidebar, children: (0,external_wp_i18n_namespaceObject._x)('Import', 'button label') }) })] }) }); } ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/advanced-controls.js /** * WordPress dependencies */ /** * Internal dependencies */ function TemplatePartAdvancedControls({ tagName, setAttributes, isEntityAvailable, templatePartId, defaultWrapper, hasInnerBlocks }) { const [area, setArea] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'area', templatePartId); const [title, setTitle] = (0,external_wp_coreData_namespaceObject.useEntityProp)('postType', 'wp_template_part', 'title', templatePartId); const defaultTemplatePartAreas = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.default_template_part_areas || [], []); const areaOptions = defaultTemplatePartAreas.map(({ label, area: _area }) => ({ label, value: _area })); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [isEntityAvailable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Title'), value: title, onChange: value => { setTitle(value); }, onFocus: event => event.target.select() }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __next40pxDefaultSize: true, __nextHasNoMarginBottom: true, label: (0,external_wp_i18n_namespaceObject.__)('Area'), labelPosition: "top", options: areaOptions, value: area, onChange: setArea })] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.SelectControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('HTML element'), options: [{ label: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: HTML tag based on area. */ (0,external_wp_i18n_namespaceObject.__)('Default based on area (%s)'), `<${defaultWrapper}>`), value: '' }, { label: '<header>', value: 'header' }, { label: '<main>', value: 'main' }, { label: '<section>', value: 'section' }, { label: '<article>', value: 'article' }, { label: '<aside>', value: 'aside' }, { label: '<footer>', value: 'footer' }, { label: '<div>', value: 'div' }], value: tagName || '', onChange: value => setAttributes({ tagName: value }), help: htmlElementMessages[tagName] }), !hasInnerBlocks && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartImportControls, { area: area, setAttributes: setAttributes })] }); } ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/inner-blocks.js /** * WordPress dependencies */ function useRenderAppender(hasInnerBlocks) { const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); // Disable appending when the editing mode is 'contentOnly'. This is so that the user can't // append into a template part when editing a page in the site editor. See // DisableNonPageContentBlocks. Ideally instead of (mis)using editing mode there would be a // block editor API for achieving this. if (blockEditingMode === 'contentOnly') { return false; } if (!hasInnerBlocks) { return external_wp_blockEditor_namespaceObject.InnerBlocks.ButtonBlockAppender; } } function useLayout(layout) { const themeSupportsLayout = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getSettings } = select(external_wp_blockEditor_namespaceObject.store); return getSettings()?.supportsLayout; }, []); const [defaultLayout] = (0,external_wp_blockEditor_namespaceObject.useSettings)('layout'); if (themeSupportsLayout) { return layout?.inherit ? defaultLayout || {} : layout; } } function NonEditableTemplatePartPreview({ postId: id, layout, tagName: TagName, blockProps }) { (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)('disabled'); const { content, editedBlocks } = (0,external_wp_data_namespaceObject.useSelect)(select => { if (!id) { return {}; } const { getEditedEntityRecord } = select(external_wp_coreData_namespaceObject.store); const editedRecord = getEditedEntityRecord('postType', 'wp_template_part', id, { context: 'view' }); return { editedBlocks: editedRecord.blocks, content: editedRecord.content }; }, [id]); const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => { if (!id) { return undefined; } if (editedBlocks) { return editedBlocks; } if (!content || typeof content !== 'string') { return []; } return (0,external_wp_blocks_namespaceObject.parse)(content); }, [id, editedBlocks, content]); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { value: blocks, onInput: () => {}, onChange: () => {}, renderAppender: false, layout: useLayout(layout) }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...innerBlocksProps }); } function EditableTemplatePartInnerBlocks({ postId: id, hasInnerBlocks, layout, tagName: TagName, blockProps }) { const onNavigateToEntityRecord = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blockEditor_namespaceObject.store).getSettings().onNavigateToEntityRecord, []); const [blocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_template_part', { id }); const innerBlocksProps = (0,external_wp_blockEditor_namespaceObject.useInnerBlocksProps)(blockProps, { value: blocks, onInput, onChange, renderAppender: useRenderAppender(hasInnerBlocks), layout: useLayout(layout) }); const blockEditingMode = (0,external_wp_blockEditor_namespaceObject.useBlockEditingMode)(); const customProps = blockEditingMode === 'contentOnly' && onNavigateToEntityRecord ? { onDoubleClick: () => onNavigateToEntityRecord({ postId: id, postType: 'wp_template_part' }) } : {}; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...innerBlocksProps, ...customProps }); } function TemplatePartInnerBlocks({ postId: id, hasInnerBlocks, layout, tagName: TagName, blockProps }) { const { canViewTemplatePart, canEditTemplatePart } = (0,external_wp_data_namespaceObject.useSelect)(select => { return { canViewTemplatePart: !!select(external_wp_coreData_namespaceObject.store).canUser('read', { kind: 'postType', name: 'wp_template_part', id }), canEditTemplatePart: !!select(external_wp_coreData_namespaceObject.store).canUser('update', { kind: 'postType', name: 'wp_template_part', id }) }; }, [id]); if (!canViewTemplatePart) { return null; } const TemplatePartInnerBlocksComponent = canEditTemplatePart ? EditableTemplatePartInnerBlocks : NonEditableTemplatePartPreview; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartInnerBlocksComponent, { postId: id, hasInnerBlocks: hasInnerBlocks, layout: layout, tagName: TagName, blockProps: blockProps }); } ;// ./node_modules/@wordpress/block-library/build-module/template-part/edit/index.js /** * WordPress dependencies */ /** * Internal dependencies */ function ReplaceButton({ isEntityAvailable, area, templatePartId, isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen }) { // This hook fetches patterns, so don't run it unconditionally in the main // edit function! const { templateParts } = useAlternativeTemplateParts(area, templatePartId); const hasReplacements = !!templateParts.length; const canReplace = isEntityAvailable && hasReplacements && (area === 'header' || area === 'footer'); if (!canReplace) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.MenuItem, { onClick: () => { setIsTemplatePartSelectionOpen(true); }, "aria-expanded": isTemplatePartSelectionOpen, "aria-haspopup": "dialog", children: (0,external_wp_i18n_namespaceObject.__)('Replace') }); } function TemplatesList({ area, clientId, isEntityAvailable, onSelect }) { // This hook fetches patterns, so don't run it unconditionally in the main // edit function! const blockPatterns = useAlternativeBlockPatterns(area, clientId); const canReplace = isEntityAvailable && !!blockPatterns.length && (area === 'header' || area === 'footer'); if (!canReplace) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { title: (0,external_wp_i18n_namespaceObject.__)('Design'), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalBlockPatternsList, { label: (0,external_wp_i18n_namespaceObject.__)('Templates'), blockPatterns: blockPatterns, onClickPattern: onSelect, showTitlesAsTooltip: true }) }); } function TemplatePartEdit({ attributes, setAttributes, clientId }) { const { createSuccessNotice } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); const { editEntityRecord } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store); const currentTheme = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_coreData_namespaceObject.store).getCurrentTheme()?.stylesheet, []); const { slug, theme = currentTheme, tagName, layout = {} } = attributes; const templatePartId = createTemplatePartId(theme, slug); const hasAlreadyRendered = (0,external_wp_blockEditor_namespaceObject.useHasRecursion)(templatePartId); const [isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen] = (0,external_wp_element_namespaceObject.useState)(false); const { isResolved, hasInnerBlocks, isMissing, area, onNavigateToEntityRecord, title, canUserEdit } = (0,external_wp_data_namespaceObject.useSelect)(select => { const { getEditedEntityRecord, hasFinishedResolution } = select(external_wp_coreData_namespaceObject.store); const { getBlockCount, getSettings } = select(external_wp_blockEditor_namespaceObject.store); const getEntityArgs = ['postType', 'wp_template_part', templatePartId]; const entityRecord = templatePartId ? getEditedEntityRecord(...getEntityArgs) : null; const _area = entityRecord?.area || attributes.area; const hasResolvedEntity = templatePartId ? hasFinishedResolution('getEditedEntityRecord', getEntityArgs) : false; const _canUserEdit = hasResolvedEntity ? select(external_wp_coreData_namespaceObject.store).canUser('update', { kind: 'postType', name: 'wp_template_part', id: templatePartId }) : false; return { hasInnerBlocks: getBlockCount(clientId) > 0, isResolved: hasResolvedEntity, isMissing: hasResolvedEntity && (!entityRecord || Object.keys(entityRecord).length === 0), area: _area, onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord, title: entityRecord?.title, canUserEdit: !!_canUserEdit }; }, [templatePartId, attributes.area, clientId]); const areaObject = useTemplatePartArea(area); const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)(); const isPlaceholder = !slug; const isEntityAvailable = !isPlaceholder && !isMissing && isResolved; const TagName = tagName || areaObject.tagName; const onPatternSelect = async pattern => { await editEntityRecord('postType', 'wp_template_part', templatePartId, { blocks: pattern.blocks, content: (0,external_wp_blocks_namespaceObject.serialize)(pattern.blocks) }); createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: template part title. */ (0,external_wp_i18n_namespaceObject.__)('Template Part "%s" updated.'), title || slug), { type: 'snackbar' }); }; // We don't want to render a missing state if we have any inner blocks. // A new template part is automatically created if we have any inner blocks but no entity. if (!hasInnerBlocks && (slug && !theme || slug && isMissing)) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.sprintf)(/* translators: %s: Template part slug. */ (0,external_wp_i18n_namespaceObject.__)('Template part has been deleted or is unavailable: %s'), slug) }) }); } if (isEntityAvailable && hasAlreadyRendered) { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.Warning, { children: (0,external_wp_i18n_namespaceObject.__)('Block cannot be rendered inside itself.') }) }); } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_blockEditor_namespaceObject.RecursionProvider, { uniqueId: templatePartId, children: [isEntityAvailable && onNavigateToEntityRecord && canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "other", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ToolbarButton, { onClick: () => onNavigateToEntityRecord({ postId: templatePartId, postType: 'wp_template_part' }), children: (0,external_wp_i18n_namespaceObject.__)('Edit') }) }), canUserEdit && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { group: "advanced", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartAdvancedControls, { tagName: tagName, setAttributes: setAttributes, isEntityAvailable: isEntityAvailable, templatePartId: templatePartId, defaultWrapper: areaObject.tagName, hasInnerBlocks: hasInnerBlocks }) }), isPlaceholder && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartPlaceholder, { area: attributes.area, templatePartId: templatePartId, clientId: clientId, setAttributes: setAttributes, onOpenSelectionModal: () => setIsTemplatePartSelectionOpen(true) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, { children: ({ selectedClientIds }) => { // Only enable for single selection that matches the current block. // Ensures menu item doesn't render multiple times. if (!(selectedClientIds.length === 1 && clientId === selectedClientIds[0])) { return null; } return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(ReplaceButton, { isEntityAvailable, area, clientId, templatePartId, isTemplatePartSelectionOpen, setIsTemplatePartSelectionOpen }); } }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatesList, { area: area, clientId: clientId, isEntityAvailable: isEntityAvailable, onSelect: pattern => onPatternSelect(pattern) }) }), isEntityAvailable && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartInnerBlocks, { tagName: TagName, blockProps: blockProps, postId: templatePartId, hasInnerBlocks: hasInnerBlocks, layout: layout }), !isPlaceholder && !isResolved && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TagName, { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Spinner, {}) })] }), isTemplatePartSelectionOpen && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Modal, { overlayClassName: "block-editor-template-part__selection-modal", title: (0,external_wp_i18n_namespaceObject.sprintf)( // Translators: %s as template part area title ("Header", "Footer", etc.). (0,external_wp_i18n_namespaceObject.__)('Choose a %s'), areaObject.label.toLowerCase()), onRequestClose: () => setIsTemplatePartSelectionOpen(false), isFullScreen: true, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(TemplatePartSelectionModal, { templatePartId: templatePartId, clientId: clientId, area: area, setAttributes: setAttributes, onClose: () => setIsTemplatePartSelectionOpen(false) }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/template-part/variations.js /** * WordPress dependencies */ /** * Internal dependencies */ function enhanceTemplatePartVariations(settings, name) { if (name !== 'core/template-part') { return settings; } if (settings.variations) { const isActive = (blockAttributes, variationAttributes) => { const { area, theme, slug } = blockAttributes; // We first check the `area` block attribute which is set during insertion. // This property is removed on the creation of a template part. if (area) { return area === variationAttributes.area; } // Find a matching variation from the created template part // by checking the entity's `area` property. if (!slug) { return false; } const { getCurrentTheme, getEntityRecord } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const entity = getEntityRecord('postType', 'wp_template_part', `${theme || getCurrentTheme()?.stylesheet}//${slug}`); if (entity?.slug) { return entity.slug === variationAttributes.slug; } return entity?.area === variationAttributes.area; }; const variations = settings.variations.map(variation => { return { ...variation, ...(!variation.isActive && { isActive }), ...(typeof variation.icon === 'string' && { icon: getTemplatePartIcon(variation.icon) }) }; }); return { ...settings, variations }; } return settings; } ;// ./node_modules/@wordpress/block-library/build-module/template-part/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const template_part_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/template-part", title: "Template Part", category: "theme", description: "Edit the different global regions of your site, like the header, footer, sidebar, or create your own.", textdomain: "default", attributes: { slug: { type: "string" }, theme: { type: "string" }, tagName: { type: "string" }, area: { type: "string" } }, supports: { align: true, html: false, reusable: false, renaming: false, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-template-part-editor" }; const { name: template_part_name } = template_part_metadata; const template_part_settings = { icon: symbol_filled, __experimentalLabel: ({ slug, theme }) => { // Attempt to find entity title if block is a template part. // Require slug to request, otherwise entity is uncreated and will throw 404. if (!slug) { return; } const { getCurrentTheme, getEditedEntityRecord } = (0,external_wp_data_namespaceObject.select)(external_wp_coreData_namespaceObject.store); const entity = getEditedEntityRecord('postType', 'wp_template_part', (theme || getCurrentTheme()?.stylesheet) + '//' + slug); if (!entity) { return; } return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(entity.title) || capitalCase(entity.slug || ''); }, edit: TemplatePartEdit }; const template_part_init = () => { (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/template-part', enhanceTemplatePartVariations); // Prevent adding template parts inside post templates. const DISALLOWED_PARENTS = ['core/post-template', 'core/post-content']; (0,external_wp_hooks_namespaceObject.addFilter)('blockEditor.__unstableCanInsertBlockType', 'core/block-library/removeTemplatePartsFromPostTemplates', (canInsert, blockType, rootClientId, { getBlock, getBlockParentsByBlockName }) => { if (blockType.name !== 'core/template-part') { return canInsert; } for (const disallowedParentType of DISALLOWED_PARENTS) { const hasDisallowedParent = getBlock(rootClientId)?.name === disallowedParentType || getBlockParentsByBlockName(rootClientId, disallowedParentType).length; if (hasDisallowedParent) { return false; } } return true; }); return initBlock({ name: template_part_name, metadata: template_part_metadata, settings: template_part_settings }); }; ;// ./node_modules/@wordpress/icons/build-module/library/term-description.js /** * WordPress dependencies */ const term_description_tag = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_primitives_namespaceObject.Path, { d: "M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z" }) }); /* harmony default export */ const term_description = (term_description_tag); ;// ./node_modules/@wordpress/block-library/build-module/term-description/edit.js /** * External dependencies */ /** * WordPress dependencies */ function TermDescriptionEdit({ attributes, setAttributes, mergedStyle }) { const { textAlign } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }), style: mergedStyle }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { group: "block", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentControl, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...blockProps, children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-term-description__placeholder", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("span", { children: (0,external_wp_i18n_namespaceObject.__)('Term Description') }) }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/term-description/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const term_description_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/term-description", title: "Term Description", category: "theme", description: "Display the description of categories, tags and custom taxonomies when viewing an archive.", textdomain: "default", attributes: { textAlign: { type: "string" } }, supports: { align: ["wide", "full"], html: false, color: { link: true, __experimentalDefaultControls: { background: true, text: true } }, spacing: { padding: true, margin: true }, typography: { fontSize: true, lineHeight: true, __experimentalFontFamily: true, __experimentalFontWeight: true, __experimentalFontStyle: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalLetterSpacing: true, __experimentalDefaultControls: { fontSize: true } }, interactivity: { clientNavigation: true }, __experimentalBorder: { radius: true, color: true, width: true, style: true, __experimentalDefaultControls: { radius: true, color: true, width: true, style: true } } } }; const { name: term_description_name } = term_description_metadata; const term_description_settings = { icon: term_description, edit: TermDescriptionEdit, example: {} }; const term_description_init = () => initBlock({ name: term_description_name, metadata: term_description_metadata, settings: term_description_settings }); ;// ./node_modules/@wordpress/block-library/build-module/text-columns/edit.js /** * WordPress dependencies */ function TextColumnsEdit({ attributes, setAttributes }) { const { width, content, columns } = attributes; external_wp_deprecated_default()('The Text Columns block', { since: '5.3', alternative: 'the Columns block' }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockAlignmentToolbar, { value: width, onChange: nextWidth => setAttributes({ width: nextWidth }), controls: ['center', 'wide', 'full'] }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.InspectorControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.PanelBody, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RangeControl, { __nextHasNoMarginBottom: true, __next40pxDefaultSize: true, label: (0,external_wp_i18n_namespaceObject.__)('Columns'), value: columns, onChange: value => setAttributes({ columns: value }), min: 2, max: 4, required: true }) }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...(0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: `align${width} columns-${columns}` }), children: Array.from({ length: columns }).map((_, index) => { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-column", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "p", value: content?.[index]?.children, onChange: nextContent => { setAttributes({ content: [...content.slice(0, index), { children: nextContent }, ...content.slice(index + 1)] }); }, "aria-label": (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: column index (starting with 1) (0,external_wp_i18n_namespaceObject.__)('Column %d text'), index + 1), placeholder: (0,external_wp_i18n_namespaceObject.__)('New Column') }) }, `column-${index}`); }) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/text-columns/save.js /** * WordPress dependencies */ function text_columns_save_save({ attributes }) { const { width, content, columns } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className: `align${width} columns-${columns}` }), children: Array.from({ length: columns }).map((_, index) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { className: "wp-block-column", children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "p", value: content?.[index]?.children }) }, `column-${index}`)) }); } ;// ./node_modules/@wordpress/block-library/build-module/text-columns/transforms.js /** * WordPress dependencies */ const text_columns_transforms_transforms = { to: [{ type: 'block', blocks: ['core/columns'], transform: ({ className, columns, content, width }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/columns', { align: 'wide' === width || 'full' === width ? width : undefined, className, columns }, content.map(({ children }) => (0,external_wp_blocks_namespaceObject.createBlock)('core/column', {}, [(0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', { content: children })]))) }] }; /* harmony default export */ const text_columns_transforms = (text_columns_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/text-columns/index.js /** * Internal dependencies */ const text_columns_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/text-columns", title: "Text Columns (deprecated)", icon: "columns", category: "design", description: "This block is deprecated. Please use the Columns block instead.", textdomain: "default", attributes: { content: { type: "array", source: "query", selector: "p", query: { children: { type: "string", source: "html" } }, "default": [{}, {}] }, columns: { type: "number", "default": 2 }, width: { type: "string" } }, supports: { inserter: false, interactivity: { clientNavigation: true } }, editorStyle: "wp-block-text-columns-editor", style: "wp-block-text-columns" }; const { name: text_columns_name } = text_columns_metadata; const text_columns_settings = { transforms: text_columns_transforms, getEditWrapperProps(attributes) { const { width } = attributes; if ('wide' === width || 'full' === width) { return { 'data-align': width }; } }, edit: TextColumnsEdit, save: text_columns_save_save }; const text_columns_init = () => initBlock({ name: text_columns_name, metadata: text_columns_metadata, settings: text_columns_settings }); ;// ./node_modules/@wordpress/block-library/build-module/verse/deprecated.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ const verse_deprecated_v1 = { attributes: { content: { type: 'string', source: 'html', selector: 'pre', default: '' }, textAlign: { type: 'string' } }, save({ attributes }) { const { textAlign, content } = attributes; return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { tagName: "pre", style: { textAlign }, value: content }); } }; const verse_deprecated_v2 = { attributes: { content: { type: 'string', source: 'html', selector: 'pre', default: '', __unstablePreserveWhiteSpace: true, role: 'content' }, textAlign: { type: 'string' } }, supports: { anchor: true, color: { gradients: true, link: true }, typography: { fontSize: true, __experimentalFontFamily: true }, spacing: { padding: true } }, save({ attributes }) { const { textAlign, content } = attributes; const className = dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: content }) }); }, migrate: migrate_font_family, isEligible({ style }) { return style?.typography?.fontFamily; } }; /** * New deprecations need to be placed first * for them to have higher priority. * * Old deprecations may need to be updated as well. * * See block-deprecation.md */ /* harmony default export */ const verse_deprecated = ([verse_deprecated_v2, verse_deprecated_v1]); ;// ./node_modules/@wordpress/block-library/build-module/verse/edit.js /** * External dependencies */ /** * WordPress dependencies */ function VerseEdit({ attributes, setAttributes, mergeBlocks, onRemove, insertBlocksAfter, style }) { const { textAlign, content } = attributes; const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)({ className: dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }), style }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.BlockControls, { children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.AlignmentToolbar, { value: textAlign, onChange: nextAlign => { setAttributes({ textAlign: nextAlign }); } }) }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText, { tagName: "pre", identifier: "content", preserveWhiteSpace: true, value: content, onChange: nextContent => { setAttributes({ content: nextContent }); }, "aria-label": (0,external_wp_i18n_namespaceObject.__)('Verse text'), placeholder: (0,external_wp_i18n_namespaceObject.__)('Write verse…'), onRemove: onRemove, onMerge: mergeBlocks, textAlign: textAlign, ...blockProps, __unstablePastePlainText: true, __unstableOnSplitAtDoubleLineEnd: () => insertBlocksAfter((0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getDefaultBlockName)())) })] }); } ;// ./node_modules/@wordpress/block-library/build-module/verse/save.js /** * External dependencies */ /** * WordPress dependencies */ function verse_save_save({ attributes }) { const { textAlign, content } = attributes; const className = dist_clsx({ [`has-text-align-${textAlign}`]: textAlign }); return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("pre", { ...external_wp_blockEditor_namespaceObject.useBlockProps.save({ className }), children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.RichText.Content, { value: content }) }); } ;// ./node_modules/@wordpress/block-library/build-module/verse/transforms.js /** * WordPress dependencies */ const verse_transforms_transforms = { from: [{ type: 'block', blocks: ['core/paragraph'], transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/verse', attributes) }], to: [{ type: 'block', blocks: ['core/paragraph'], transform: attributes => (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', attributes) }] }; /* harmony default export */ const verse_transforms = (verse_transforms_transforms); ;// ./node_modules/@wordpress/block-library/build-module/verse/index.js /** * WordPress dependencies */ /** * Internal dependencies */ const verse_metadata = { $schema: "https://schemas.wp.org/trunk/block.json", apiVersion: 3, name: "core/verse", title: "Verse", category: "text", description: "Insert poetry. Use special spacing formats. Or quote song lyrics.", keywords: ["poetry", "poem"], textdomain: "default", attributes: { content: { type: "rich-text", source: "rich-text", selector: "pre", __unstablePreserveWhiteSpace: true, role: "content" }, textAlign: { type: "string" } }, supports: { anchor: true, background: { backgroundImage: true, backgroundSize: true, __experimentalDefaultControls: { backgroundImage: true } }, color: { gradients: true, link: true, __experimentalDefaultControls: { background: true, text: true } }, dimensions: { minHeight: true, __experimentalDefaultControls: { minHeight: false } }, typography: { fontSize: true, __experimentalFontFamily: true, lineHeight: true, __experimentalFontStyle: true, __experimentalFontWeight: true, __experimentalLetterSpacing: true, __experimentalTextTransform: true, __experimentalTextDecoration: true, __experimentalWritingMode: true, __experimentalDefaultControls: { fontSize: true } }, spacing: { margin: true, padding: true, __experimentalDefaultControls: { margin: false, padding: false } }, __experimentalBorder: { radius: true, width: true, color: true, style: true }, interactivity: { clientNavigation: true } }, style: "wp-block-verse", editorStyle: "wp-block-verse-editor" }; const { name: verse_name } = verse_metadata; const verse_settings = { icon: library_verse, example: { attributes: { /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ // translators: Sample content for the Verse block. Can be replaced with a more locale-adequate work. content: (0,external_wp_i18n_namespaceObject.__)('WHAT was he doing, the great god Pan,\n Down in the reeds by the river?\nSpreading ruin and scattering ban,\nSplashing and paddling with hoofs of a goat,\nAnd breaking the golden lilies afloat\n With the dragon-fly on the river.') /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ } }, transforms: verse_transforms, deprecated: verse_deprecated, merge(attributes, attributesToMerge) { return { content: attributes.content + '\n\n' + attributesToMerge.content }; }, edit: VerseEdit, save: verse_save_save }; const verse_init = () =>