PATH:
home
/
lab2454c
/
spaxtac.com
/
wp-includes
/
js
/
dist
/*! 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 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={};e.r(t);const n=window.React,o=window.wp.element,r=window.wp.i18n;var a=function(){return a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},a.apply(this,arguments)};Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;function s(e){return e.toLowerCase()}var i=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],l=/[^A-Z0-9]+/gi;function c(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}function p(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?i:n,r=t.stripRegexp,a=void 0===r?l:r,p=t.transform,d=void 0===p?s:p,u=t.delimiter,w=void 0===u?" ":u,m=c(c(e,o,"$1\0$2"),a,"\0"),f=0,b=m.length;"\0"===m.charAt(f);)f++;for(;"\0"===m.charAt(b-1);)b--;return m.slice(f,b).split("\0").map(d).join(w)}(e,a({delimiter:"."},t))}const d=window.wp.apiFetch;var u=e.n(d);const w=window.wp.blob;const m=async function(e){const t=await u()({path:"/wp/v2/types/wp_block"}),n=await u()({path:`/wp/v2/${t.rest_base}/${e}?context=edit`}),o=n.title.raw,r=n.content.raw,s=n.wp_pattern_sync_status,i=JSON.stringify({__file:"wp_block",title:o,content:r,syncStatus:s},null,2),l=(void 0===c&&(c={}),p(o,a({delimiter:"-"},c))+".json");var c;(0,w.downloadBlob)(l,i,"application/json")},f=window.wp.compose,b=window.wp.components;const _=async function(e){const t=await function(e){const t=new window.FileReader;return new Promise((n=>{t.onload=()=>{n(t.result)},t.readAsText(e)}))}(e);let n;try{n=JSON.parse(t)}catch(e){throw new Error("Invalid JSON file")}if("wp_block"!==n.__file||!n.title||!n.content||"string"!=typeof n.title||"string"!=typeof n.content||n.syncStatus&&"string"!=typeof n.syncStatus)throw new Error("Invalid pattern JSON file");const o=await u()({path:"/wp/v2/types/wp_block"});return await u()({path:`/wp/v2/${o.rest_base}`,data:{title:n.title,content:n.content,status:"publish",meta:"unsynced"===n.syncStatus?{wp_pattern_sync_status:n.syncStatus}:void 0},method:"POST"})};const v=(0,f.withInstanceId)((function({instanceId:e,onUpload:t}){const a="list-reusable-blocks-import-form-"+e,s=(0,o.useRef)(),[i,l]=(0,o.useState)(!1),[c,p]=(0,o.useState)(null),[d,u]=(0,o.useState)(null);return(0,n.createElement)("form",{className:"list-reusable-blocks-import-form",onSubmit:e=>{e.preventDefault(),d&&(l({isLoading:!0}),_(d).then((e=>{s&&(l(!1),t(e))})).catch((e=>{if(!s)return;let t;switch(e.message){case"Invalid JSON file":t=(0,r.__)("Invalid JSON file");break;case"Invalid pattern JSON file":t=(0,r.__)("Invalid pattern JSON file");break;default:t=(0,r.__)("Unknown error")}l(!1),p(t)})))},ref:s},c&&(0,n.createElement)(b.Notice,{status:"error",onRemove:()=>{p(null)}},c),(0,n.createElement)("label",{htmlFor:a,className:"list-reusable-blocks-import-form__label"},(0,r.__)("File")),(0,n.createElement)("input",{id:a,type:"file",onChange:e=>{u(e.target.files[0]),p(null)}}),(0,n.createElement)(b.Button,{type:"submit",isBusy:i,disabled:!d||i,variant:"secondary",className:"list-reusable-blocks-import-form__button"},(0,r._x)("Import","button label")))}));const y=function({onUpload:e}){return(0,n.createElement)(b.Dropdown,{popoverProps:{placement:"bottom-start"},contentClassName:"list-reusable-blocks-import-dropdown__content",renderToggle:({isOpen:e,onToggle:t})=>(0,n.createElement)(b.Button,{"aria-expanded":e,onClick:t,variant:"primary"},(0,r.__)("Import from JSON")),renderContent:({onClose:t})=>(0,n.createElement)(v,{onUpload:(0,f.pipe)(t,e)})})};document.body.addEventListener("click",(e=>{e.target.classList.contains("wp-list-reusable-blocks__export")&&(e.preventDefault(),m(e.target.dataset.id))})),document.addEventListener("DOMContentLoaded",(()=>{const e=document.querySelector(".page-title-action");if(!e)return;const t=document.createElement("div");t.className="list-reusable-blocks__container",e.parentNode.insertBefore(t,e),(0,o.createRoot)(t).render((0,n.createElement)(y,{onUpload:()=>{const e=document.createElement("div");e.className="notice notice-success is-dismissible",e.innerHTML=`<p>${(0,r.__)("Pattern imported successfully!")}</p>`;const t=document.querySelector(".wp-header-end");t&&t.parentNode.insertBefore(e,t)}}))})),(window.wp=window.wp||{}).listReusableBlocks=t})();
[-] private-apis.js
[edit]
[-] i18n.min.js
[edit]
[-] editor.js
[edit]
[-] widgets.min.js
[edit]
[-] core-data.js
[edit]
[-] is-shallow-equal.js
[edit]
[-] format-library.js
[edit]
[-] rich-text.js
[edit]
[-] reusable-blocks.min.js
[edit]
[-] url.min.js
[edit]
[-] primitives.js
[edit]
[-] html-entities.js
[edit]
[-] plugins.js
[edit]
[-] blob.min.js
[edit]
[-] a11y.min.js
[edit]
[-] shortcode.min.js
[edit]
[-] patterns.min.js
[edit]
[-] block-directory.js
[edit]
[-] autop.js
[edit]
[-] blocks.min.js
[edit]
[-] compose.min.js
[edit]
[-] edit-widgets.js
[edit]
[-] style-engine.js
[edit]
[+]
..
[-] components.min.js
[edit]
[-] dom-ready.js
[edit]
[-] edit-post.js
[edit]
[-] date.min.js
[edit]
[-] edit-post.min.js
[edit]
[-] keyboard-shortcuts.js
[edit]
[-] token-list.min.js
[edit]
[-] core-commands.min.js
[edit]
[-] viewport.js
[edit]
[-] block-serialization-default-parser.min.js
[edit]
[-] priority-queue.min.js
[edit]
[-] preferences-persistence.min.js
[edit]
[-] rich-text.min.js
[edit]
[-] widgets.js
[edit]
[-] undo-manager.js
[edit]
[-] components.js
[edit]
[-] undo-manager.min.js
[edit]
[-] a11y.js
[edit]
[-] url.js
[edit]
[-] wordcount.min.js
[edit]
[-] viewport.min.js
[edit]
[-] is-shallow-equal.min.js
[edit]
[-] block-library.js
[edit]
[-] style-engine.min.js
[edit]
[-] preferences.min.js
[edit]
[-] commands.js
[edit]
[-] preferences-persistence.js
[edit]
[-] redux-routine.min.js
[edit]
[-] blob.js
[edit]
[-] api-fetch.js
[edit]
[-] block-editor.js
[edit]
[-] escape-html.min.js
[edit]
[-] customize-widgets.js
[edit]
[-] nux.min.js
[edit]
[-] edit-site.js
[edit]
[-] priority-queue.js
[edit]
[-] block-directory.min.js
[edit]
[-] html-entities.min.js
[edit]
[+]
development
[-] date.js
[edit]
[-] primitives.min.js
[edit]
[-] nux.js
[edit]
[+]
vendor
[-] editor.min.js
[edit]
[-] notices.js
[edit]
[-] dom.min.js
[edit]
[-] core-commands.js
[edit]
[-] keyboard-shortcuts.min.js
[edit]
[-] plugins.min.js
[edit]
[-] router.min.js
[edit]
[-] i18n.js
[edit]
[-] warning.js
[edit]
[-] data-controls.min.js
[edit]
[-] customize-widgets.min.js
[edit]
[-] block-editor.min.js
[edit]
[-] hooks.min.js
[edit]
[-] reusable-blocks.js
[edit]
[-] deprecated.js
[edit]
[-] block-serialization-default-parser.js
[edit]
[-] interactivity.js
[edit]
[-] commands.min.js
[edit]
[-] list-reusable-blocks.js
[edit]
[-] list-reusable-blocks.min.js
[edit]
[-] blocks.js
[edit]
[-] server-side-render.min.js
[edit]
[-] edit-site.min.js
[edit]
[-] interactivity-router.asset.php
[edit]
[-] data-controls.js
[edit]
[-] keycodes.js
[edit]
[-] dom.js
[edit]
[-] patterns.js
[edit]
[-] router.js
[edit]
[-] annotations.min.js
[edit]
[-] redux-routine.js
[edit]
[-] interactivity.min.js
[edit]
[-] format-library.min.js
[edit]
[-] interactivity-router.min.asset.php
[edit]
[-] preferences.js
[edit]
[-] keycodes.min.js
[edit]
[-] media-utils.min.js
[edit]
[-] interactivity-router.js
[edit]
[-] hooks.js
[edit]
[-] autop.min.js
[edit]
[-] block-library.min.js
[edit]
[-] deprecated.min.js
[edit]
[-] data.js
[edit]
[-] compose.js
[edit]
[-] private-apis.min.js
[edit]
[-] warning.min.js
[edit]
[-] escape-html.js
[edit]
[-] core-data.min.js
[edit]
[-] edit-widgets.min.js
[edit]
[-] annotations.js
[edit]
[-] notices.min.js
[edit]
[-] api-fetch.min.js
[edit]
[-] element.js
[edit]
[-] media-utils.js
[edit]
[-] shortcode.js
[edit]
[-] dom-ready.min.js
[edit]
[-] element.min.js
[edit]
[-] interactivity-router.min.js
[edit]
[-] token-list.js
[edit]
[-] server-side-render.js
[edit]
[-] wordcount.js
[edit]
[-] data.min.js
[edit]